Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes to build on current MacOS #109

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 50 additions & 36 deletions README_MACOSX.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,28 @@ Packages, which you can download from <http://developer.apple.com/tools>.
Then, execute the following commands in a terminal session, to build all the frameworks and demo applications:

```shell
$ cd mac
$ make
cd mac
make
```

In case there are errors first try to clean up temporary files:

```shell
sudo make clean
```

After building the iODBC libraries and applications, you have to install them on your system with the command:

```shell
$ sudo make install
sudo make install
```

For generating and installing a development build with debug symbols run:

```shell
sudo make realclean
make MODEL=Development
sudo make install MODEL=Development
```

This installs the `iODBCinst` and `iODBC` frameworks into —
Expand Down Expand Up @@ -86,16 +100,16 @@ using the [HomeBrew package manager](http://brew.sh/) to install these tools, ac
To build the libraries, open up a terminal session in **`Terminal.app`** or similar, and execute the following commands:

```shell
$ sh autogen.sh
$ ./configure
$ make
sh autogen.sh
./configure
make
```

To install the header files and libraries in `/usr/local`, execute the following command as an administrator,
and provide that user's password when prompted:

```shell
$ sudo make install
sudo make install
```

Note that, by default, this will build components that only run on the CPU type you are building on, so `ppc`
Expand All @@ -112,18 +126,18 @@ The following commands will build a release of iODBC that supports Mac OS X Leop
Mac OS X Snow Leopard (10.6), on `ppc` (including as emulated by Rosetta), `x86`, and `x86_64`:

```shell
$ CFLAGS="-O -arch ppc -arch i386 -arch x86_64"
$ CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk"
$ CFLAGS="$CFLAGS -mmacosx-version-min=10.5"
$ export CFLAGS
CFLAGS="-O -arch ppc -arch i386 -arch x86_64"
CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk"
CFLAGS="$CFLAGS -mmacosx-version-min=10.5"
export CFLAGS

$ sh autogen.sh
$ ./configure \
sh autogen.sh
./configure \
--disable-dependency-tracking \
--prefix=/usr/local/iODBC.universal

$ make
$ sudo make install
make
sudo make install
```

### Mac OS X Lion (10.7) and OS X Mountain Lion (10.8)
Expand All @@ -132,17 +146,17 @@ The following commands will build a release of iODBC that works on Mac OS X Lion
and OS X Mountain Lion (10.8):

```shell
$ CFLAGS="-O -arch i386 -arch x86_64"
$ CFLAGS="$CFLAGS -mmacosx-version-min=10.7"
$ export CFLAGS
CFLAGS="-O -arch i386 -arch x86_64"
CFLAGS="$CFLAGS -mmacosx-version-min=10.7"
export CFLAGS

$ sh autogen.sh
$ ./configure \
sh autogen.sh
./configure \
--disable-dependency-tracking \
--prefix=/usr/local/iODBC.universal

$ make
$ sudo make install
make
sudo make install
```

### OS X Mavericks (10.9) through macOS Big Sur (11.x) on `x86` or `x86_64` (including Rosetta2 emulation)
Expand All @@ -152,17 +166,17 @@ supporting other components built for `x86` (through macOS Mojave (10.14), where
components) or `x86_64` (including Rosetta2 emulation):

```shell
$ CFLAGS="-O -arch i386 -arch x86_64"
$ CFLAGS="$CFLAGS -mmacosx-version-min=10.9"
$ export CFLAGS
CFLAGS="-O -arch i386 -arch x86_64"
CFLAGS="$CFLAGS -mmacosx-version-min=10.9"
export CFLAGS

$ sh autogen.sh
$ ./configure \
sh autogen.sh
./configure \
--disable-dependency-tracking \
--prefix=/usr/local/iODBC.universal

$ make
$ sudo make install
$make
sudo make install
```

### macOS Big Sur (11.x) through macOS Ventura (13.x) on `x86_64` (including Rosetta2 emulation) or `arm64` (Apple Silicon a/k/a M1 or M2)
Expand All @@ -171,17 +185,17 @@ The following commands will build a release of iODBC that works on macOS Big Sur
running on Intel (`x86_64`) or Apple Silicon (`arm64` a/k/a `M1` or `M2`):

```shell
$ CFLAGS="-O -arch arm64 -arch x86_64"
$ CFLAGS="$CFLAGS -mmacosx-version-min=10.9"
$ export CFLAGS
CFLAGS="-O -arch arm64 -arch x86_64"
CFLAGS="$CFLAGS -mmacosx-version-min=10.9"
export CFLAGS

$ sh autogen.sh
$ ./configure \
sh autogen.sh
./configure \
--disable-dependency-tracking \
--prefix=/usr/local/iODBC.universal

$ make
$ sudo make install
make
sudo make install
```

### Test DSN connection
Expand Down
83 changes: 47 additions & 36 deletions mac/GNUmakefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
#
# iODBC VERSION
#
IODBC_VERSION=3.52.16
IODBC_VERSION=3.52.17


#
Expand Down Expand Up @@ -101,6 +101,9 @@ xcodebuild_version := $(shell xcodebuild -version | grep -i Xcode | cut -d " " -
# Common build settings
#
PROJBUILD := /usr/bin/xcodebuild -configuration $(MODEL)
DEPLOYMENT_TARGET := "10.13"
IODBC_UNI := "arm64 x86_64"
IODBC_X64 := "x86_64"
IODBC_32BIT = "i386"


Expand All @@ -113,12 +116,19 @@ endif


#
# macOS 11.x (BigSur)does not have 32bit support
# macOS 11.x (BigSur) and later do not have 32bit support
#
ifeq (11, $(findstring 11, $(macos_major)))
ifeq ($(shell test $(macos_version) -ge 11; echo $$?),0)
IODBC_32BIT := "x86_64"
endif

#
# Additional build flags for modern macOS
#
XCODE_FLAGS_UNI := MACOSX_DEPLOYMENT_TARGET=$(DEPLOYMENT_TARGET) ARCHS=$(IODBC_UNI)
XCODE_FLAGS_X64 := MACOSX_DEPLOYMENT_TARGET=$(DEPLOYMENT_TARGET) ARCHS=$(IODBC_X64)
PROJBUILD_UNI := $(PROJBUILD) $(XCODE_FLAGS_UNI)
PROJBUILD_X64 := $(PROJBUILD) $(XCODE_FLAGS_X64)

#
# Pass settings to xcodebuild
Expand All @@ -131,17 +141,18 @@ export IODBC_VERSION IODBC_32BIT
#
all: check_supported include
@echo "Building on macOS $(macos_version)"
@echo "Projbuild is [$(PROJBUILD)]"
cd iODBCinst; $(PROJBUILD) build
cd iODBC; $(PROJBUILD) build
cd iODBCtest; $(PROJBUILD) build
cd iODBCtestw; $(PROJBUILD) build
cd iODBCdrvproxy; $(PROJBUILD) build
cd iODBCadm; $(PROJBUILD) build
cd iODBCadministrator; $(PROJBUILD) build
cd iODBCadministrator64; $(PROJBUILD) build
cd iODBCdemo/DemoAnsi; $(PROJBUILD) build
cd iODBCdemo/DemoUnicode; $(PROJBUILD) build
@echo "Deployment Target is $(DEPLOYMENT_TARGET)"
@echo "Projbuild is [$(PROJBUILD_UNI)]"
cd iODBCinst; $(PROJBUILD_UNI) build
cd iODBC; $(PROJBUILD_UNI) build
cd iODBCtest; $(PROJBUILD_UNI) build
cd iODBCtestw; $(PROJBUILD_UNI) build
cd iODBCdrvproxy; $(PROJBUILD_UNI) build
cd iODBCadm; $(PROJBUILD_UNI) build
cd iODBCadministrator; $(PROJBUILD_UNI) build
cd iODBCadministrator64; $(PROJBUILD_X64) build
cd iODBCdemo/DemoAnsi; $(PROJBUILD_UNI) build
cd iODBCdemo/DemoUnicode; $(PROJBUILD_UNI) build


#
Expand Down Expand Up @@ -172,46 +183,46 @@ install:
#
-rm $(DESTDIR)/Library/Frameworks/iODBC.framework/Versions/Current
-rm $(DESTDIR)/Library/Frameworks/iODBCinst.framework/Versions/Current
cd iODBCinst; $(PROJBUILD) install DSTROOT=$(DESTDIR)/
cd iODBC; $(PROJBUILD) install DSTROOT=$(DESTDIR)/
cd iODBCinst; $(PROJBUILD_UNI) install DSTROOT=$(DESTDIR)/Library/Frameworks/
cd iODBC; $(PROJBUILD_UNI) install DSTROOT=$(DESTDIR)/Library/Frameworks/
#
# Install /usr/local/iODBC
#
sh link-inclibs.sh
#
# Install iODBC Administrator
#
cd iODBCadministrator; $(PROJBUILD) install DSTROOT=$(DESTDIR)/
cd iODBCadministrator64; $(PROJBUILD) install DSTROOT=$(DESTDIR)/
cd iODBCadministrator; $(PROJBUILD_UNI) install DSTROOT=$(DESTDIR)/Applications/iODBC;
cd iODBCadministrator64; $(PROJBUILD_X64) install DSTROOT=$(DESTDIR)/Applications/iODBC;
# Next ones are a bit special as they need to be installed twice
cd iODBCadm; $(PROJBUILD) install DSTROOT=$(DESTDIR)/Library/Frameworks/iODBC.framework/Resources/
cd iODBCadm; $(PROJBUILD) install DSTROOT=$(DESTDIR)/Library/Frameworks/iODBCinst.framework/Resources/
cd iODBCdrvproxy; $(PROJBUILD) install DSTROOT=$(DESTDIR)/Library/Frameworks/iODBC.framework/Resources/
cd iODBCdrvproxy; $(PROJBUILD) install DSTROOT=$(DESTDIR)/Library/Frameworks/iODBCinst.framework/Resources/
cd iODBCadm; $(PROJBUILD_UNI) install DSTROOT=$(DESTDIR)/Library/Frameworks/iODBC.framework/Resources/
cd iODBCadm; $(PROJBUILD_UNI) install DSTROOT=$(DESTDIR)/Library/Frameworks/iODBCinst.framework/Resources/
cd iODBCdrvproxy; $(PROJBUILD_UNI) install DSTROOT=$(DESTDIR)/Library/Frameworks/iODBC.framework/Resources/
cd iODBCdrvproxy; $(PROJBUILD_UNI) install DSTROOT=$(DESTDIR)/Library/Frameworks/iODBCinst.framework/Resources/
#
# Install application
#
cd iODBCdemo/DemoAnsi; $(PROJBUILD) install DSTROOT=$(DESTDIR)/
cd iODBCdemo/DemoUnicode; $(PROJBUILD) install DSTROOT=$(DESTDIR)/
cd iODBCtest; $(PROJBUILD) install DSTROOT=$(DESTDIR)/
cd iODBCtestw; $(PROJBUILD) install DSTROOT=$(DESTDIR)/
cd iODBCdemo/DemoAnsi; $(PROJBUILD_UNI) install DSTROOT=$(DESTDIR)/Applications/iODBC
cd iODBCdemo/DemoUnicode; $(PROJBUILD_UNI) install DSTROOT=$(DESTDIR)/Applications/iODBC
cd iODBCtest; $(PROJBUILD_UNI) install DSTROOT=$(DESTDIR)/Library/Application\ Support/iODBC/bin
cd iODBCtestw; $(PROJBUILD_UNI) install DSTROOT=$(DESTDIR)/Library/Application\ Support/iODBC/bin


#
# Clean out the targets
#
clean:
rm -rf include
cd iODBC; $(PROJBUILD) clean
cd iODBCinst; $(PROJBUILD) clean
cd iODBCtest; $(PROJBUILD) clean
cd iODBCtestw; $(PROJBUILD) clean
cd iODBCdrvproxy; $(PROJBUILD) clean
cd iODBCadm; $(PROJBUILD) clean
cd iODBCadministrator; $(PROJBUILD) clean
cd iODBCadministrator64; $(PROJBUILD) clean
cd iODBCdemo/DemoAnsi; $(PROJBUILD) clean
cd iODBCdemo/DemoUnicode; $(PROJBUILD) clean
cd iODBC; $(PROJBUILD_UNI) clean
cd iODBCinst; $(PROJBUILD_UNI) clean
cd iODBCtest; $(PROJBUILD_UNI) clean
cd iODBCtestw; $(PROJBUILD_UNI) clean
cd iODBCdrvproxy; $(PROJBUILD_UNI) clean
cd iODBCadm; $(PROJBUILD_UNI) clean
cd iODBCadministrator; $(PROJBUILD_UNI) clean
cd iODBCadministrator64; $(PROJBUILD_X64) clean
cd iODBCdemo/DemoAnsi; $(PROJBUILD_UNI) clean
cd iODBCdemo/DemoUnicode; $(PROJBUILD_UNI) clean


realclean: clean
Expand Down
8 changes: 5 additions & 3 deletions mac/iODBC/iODBC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,10 @@
../../iodbc,
);
INFOPLIST_FILE = "Info-iODBC.plist";
INSTALL_PATH = /Library/Frameworks;
INSTALL_PATH = "."; /* set /Library/Frameworks makefile to avoid cycle errors */
DYLIB_INSTALL_NAME_BASE = /Library/Frameworks;
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_CFLAGS = "-fno-constant-cfstrings";
PRODUCT_BUNDLE_IDENTIFIER = org.iodbc.core;
PRODUCT_NAME = iODBC;
Expand Down Expand Up @@ -763,7 +764,8 @@
../../iodbcinst,
);
INFOPLIST_FILE = "Info-iODBC.plist";
INSTALL_PATH = /Library/Frameworks;
INSTALL_PATH = "."; /* set /Library/Frameworks makefile to avoid cycle errors */
DYLIB_INSTALL_NAME_BASE = /Library/Frameworks;
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.9;
OTHER_CFLAGS = "-fno-constant-cfstrings";
Expand Down
16 changes: 9 additions & 7 deletions mac/iODBCadm/iODBCadm.xcodeproj/project.pbxproj
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,11 @@
);
HEADER_SEARCH_PATHS = ../../include;
INFOPLIST_FILE = "Info-iODBCadm.plist";
INSTALL_PATH = /;
INSTALL_PATH = "."; /* set /Library/Frameworks makefile to avoid cycle errors */
DYLIB_INSTALL_NAME_BASE = /Library/Frameworks;
LIBRARY_SEARCH_PATHS = "";
LIBRARY_STYLE = BUNDLE;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_CFLAGS = "-fno-constant-cfstrings";
OTHER_LDFLAGS = (
"-multiply_defined",
Expand Down Expand Up @@ -642,10 +643,11 @@
);
HEADER_SEARCH_PATHS = ../../include;
INFOPLIST_FILE = "Info-iODBCadm.plist";
INSTALL_PATH = /;
INSTALL_PATH = "."; /* set /Library/Frameworks makefile to avoid cycle errors */
DYLIB_INSTALL_NAME_BASE = /Library/Frameworks;
LIBRARY_SEARCH_PATHS = "";
LIBRARY_STYLE = Bundle;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_CFLAGS = "-fno-constant-cfstrings";
OTHER_LDFLAGS = (
"-multiply_defined",
Expand Down Expand Up @@ -703,8 +705,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
ONLY_ACTIVE_ARCH = NO;
STRIP_INSTALLED_PRODUCT = NO;
};
name = Development;
Expand Down Expand Up @@ -746,7 +748,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.13;
STRIP_INSTALLED_PRODUCT = NO;
};
name = Deployment;
Expand Down
Loading