From e765e3af12fa9d15ec318cfc276055b00721e2ae Mon Sep 17 00:00:00 2001 From: paulbeach Date: Wed, 9 Sep 2009 12:31:53 +0000 Subject: [PATCH] Make the build process compatible with MacOSX 10.6 (Snow Leopard) and gcc 4.2.1 --- builds/posix/Makefile.in.extlib | 2 +- builds/posix/prefix.darwin_i386 | 21 ++++++++++++++++++--- builds/posix/prefix.darwin_x86_64 | 16 +++------------- configure.in | 7 ++++--- extern/icu/source/config/mh-darwin | 16 ++++++++-------- 5 files changed, 34 insertions(+), 28 deletions(-) diff --git a/builds/posix/Makefile.in.extlib b/builds/posix/Makefile.in.extlib index 583de4cf63..b6fca6f981 100644 --- a/builds/posix/Makefile.in.extlib +++ b/builds/posix/Makefile.in.extlib @@ -92,7 +92,7 @@ lib_ib_util: $(LIBIBUTIL_SO) $(LIBIBUTIL_SO): $(UTIL_Objects) ifeq ($(PLATFORM),DARWIN) - $(CLIENTLIB_LINK) $(LIB_LINK_OPTIONS) $(LIB_LINK_RPATH)$(IbUtilLibraryName) $(LIB_LINK_SONAME) \ + $(CLIENTLIB_LINK) $(LIB_LINK_OPTIONS) $(LIB_LINK_DYNAMIC)$(IbUtilLibraryName) $(LIB_LINK_SONAME) \ -o $@ $^ @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ else $(CLIENTLIB_LINK) $(LIB_LINK_OPTIONS) $(LIB_LINK_SONAME)$(IbUtilLibraryName) \ diff --git a/builds/posix/prefix.darwin_i386 b/builds/posix/prefix.darwin_i386 index c4e1901f5f..b6b74b2ad9 100644 --- a/builds/posix/prefix.darwin_i386 +++ b/builds/posix/prefix.darwin_i386 @@ -16,6 +16,20 @@ # Contributor(s): ______________________________________. # Start of file prefix.darwin: $(VERSION) @PLATFORM@ # 2 Oct 2002, Nickolay Samofatov - Major Cleanup +# +# From MacOSX 10.6 (Snow Leopard), 32bit builds are no longer +# the default. To build 32bit Firebird on MacOSX 10.6 you +# need to do the following. +# +# 1. edit configure.in so that MAKEFILE_PREFIX=darwin_i386 +# 2. comment the CPU_TYPE +# 3. edit extern/icu/source/config/mh-darwin and set the right 32bit flags (-m32 -arch i386) +# for CFLAGS, CXXFLAGS & LDFLAGS +# 4. export MACOSX_DEPLOYMENT_TARGET=10.4 +# 5. export CFLAGS='-m32 -arch i386' +# 6. export CXXFLAGS='-m32 -arch i386' +# 7. export LDFLAGS='-m32 -arch i386' + DYLD_LIBRARY_PATH=$(FIREBIRD)/lib export DYLD_LIBRARY_PATH @@ -34,8 +48,8 @@ CLIENT_UTIL_TARGETS=gds_drop gds_relay gstat gsec fbguard fbmgr_bin nbackup fb_l Physical_IO_Module=os/posix/unix.cpp PLATFORM_PATH=os/darwin -LINK_OPTS:= -LD_FLAGS+=-isysroot /Developer/SDKs/MacOSX10.4u.sdk +LINK_OPTS:=-m32 -arch i386 +LD_FLAGS+= -m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk LIB_BUNDLE_OPTIONS:=$(LD_FLAGS) -bundle -flat_namespace -undefined suppress LIB_LINK_OPTIONS:=$(LD_FLAGS) -dynamiclib -flat_namespace LIB_LINK_SONAME:=-current_version @FIREBIRD_VERSION@ -compatibility_version @FIREBIRD_VERSION@ -seg1addr 0x30000000 @@ -44,7 +58,8 @@ LINK_FIREBIRD_EMBED_SYMBOLS=$(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/firebird.dar LINK_FIREBIRD_CLIENT_SYMBOLS=$(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/firebird.darwin.client.vers LINK_FBINTL_SYMBOLS=$(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/fbintl.darwin.vers -LIB_LINK_RPATH:=-install_name /Library/Frameworks/Firebird.framework/Versions/A/Libraries/ +LIB_LINK_RPATH:= +LIB_LINK_DYNAMIC:=-install_name /Library/Frameworks/Firebird.framework/Versions/A/Libraries/ LIB_EMBED_LINK_OPTIONS:=-install_name /Library/Frameworks/Firebird.framework/Versions/A/Firebird LIB_CLIENT_LINK_OPTIONS:=-install_name /Library/Frameworks/Firebird.framework/Versions/A/Firebird FBEMBED_LINK:=-F../gen/firebird -framework Firebird -L$(LIB) -lfbembed diff --git a/builds/posix/prefix.darwin_x86_64 b/builds/posix/prefix.darwin_x86_64 index 716b3103e5..52f86cbd94 100644 --- a/builds/posix/prefix.darwin_x86_64 +++ b/builds/posix/prefix.darwin_x86_64 @@ -17,16 +17,6 @@ # Start of file prefix.darwin: $(VERSION) @PLATFORM@ # 2 Oct 2002, Nickolay Samofatov - Major Cleanup -# To use this file to build 64bit version of Firebird for MacOS 10.5 (Leopard) -# 1. edit configure.in so that MAKEFILE_PREFIX=darwin_x86_64 -# 2. uncomment the CPU_TYPE -# 3. edit extern/icu/source/config/mh-darwin and set the right 64bit flags (-arch x86_64) -# for CFLAGS, CXXFLAGS & LD_FLAGS -# 4. export MACOSX_DEPLOYMENT_TARGET=10.5 -# 5. export CFLAGS='-arch x86_64' -# 6. export CXXFLAGS='-arch x86_64' -# 7. export LDFLAGS='-arch x86_64' - DYLD_LIBRARY_PATH=$(FIREBIRD)/lib export DYLD_LIBRARY_PATH @@ -44,8 +34,7 @@ CLIENT_UTIL_TARGETS=gds_drop gds_relay gstat gsec fbguard fbmgr_bin nbackup fb_l Physical_IO_Module=os/posix/unix.cpp PLATFORM_PATH=os/darwin -LINK_OPTS:=-arch x86_64 -LD_FLAGS+=-arch x86_64 +LINK_OPTS:= LIB_BUNDLE_OPTIONS:=$(LD_FLAGS) -bundle -flat_namespace -undefined suppress LIB_LINK_OPTIONS:=$(LD_FLAGS) -dynamiclib -flat_namespace LIB_LINK_SONAME:=-current_version @FIREBIRD_VERSION@ -compatibility_version @FIREBIRD_VERSION@ -seg1addr 0x30000000 @@ -54,7 +43,8 @@ LINK_FIREBIRD_EMBED_SYMBOLS=$(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/firebird.dar LINK_FIREBIRD_CLIENT_SYMBOLS=$(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/firebird.darwin.client.vers LINK_FBINTL_SYMBOLS=$(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/fbintl.darwin.vers -LIB_LINK_RPATH:=-install_name /Library/Frameworks/Firebird.framework/Versions/A/Libraries/ +LIB_LINK_RPATH:= +LIB_LINK_DYNAMIC:=-install_name /Library/Frameworks/Firebird.framework/Versions/A/Libraries/ LIB_EMBED_LINK_OPTIONS:=-install_name /Library/Frameworks/Firebird.framework/Versions/A/Firebird LIB_CLIENT_LINK_OPTIONS:=-install_name /Library/Frameworks/Firebird.framework/Versions/A/Firebird FBEMBED_LINK:=-F../gen/firebird -framework Firebird -L$(LIB) -lfbembed diff --git a/configure.in b/configure.in index 4add73dee3..70f43f3135 100644 --- a/configure.in +++ b/configure.in @@ -53,8 +53,9 @@ dnl Test for realtime library presence? RT_LIB_CHECK=false case "$target" in - i686-*-darwin*) - MAKEFILE_PREFIX=darwin_i386 + i*86-*-darwin*) +dnl MAKEFILE_PREFIX=darwin_i386 + MAKEFILE_PREFIX=darwin_x86_64 MAKEFILE_POSTFIX=darwin PLATFORM=DARWIN INSTALL_PREFIX=darwin @@ -64,7 +65,7 @@ case "$target" in EDITLINE_FLG=Y SHRLIB_EXT=dylib ICU_PLATFORM=MacOSX -dnl CPU_TYPE=x86_64 + CPU_TYPE=x86_64 ;; powerpc-*-darwin*) diff --git a/extern/icu/source/config/mh-darwin b/extern/icu/source/config/mh-darwin index f86ee30fc7..3e3571ba87 100644 --- a/extern/icu/source/config/mh-darwin +++ b/extern/icu/source/config/mh-darwin @@ -17,20 +17,20 @@ LD_FLAGS += -headerpad_max_install_names # Set CFLAGS and CXXFLAGS for relevant MacOS architecture # and backwards compatibility. Set accordingly before building. -# 64 bit Leopard - intel (MacOS 10.5) -#CFLAGS += -arch x86_64 -mmacosx-version-min=10.5 -#CXXFLAGS += -arch x86_64 -mmacosx-version-min=10.5 +# 64bit intel default +CFLAGS += -mmacosx-version-min=10.5 +CXXFLAGS += -mmacosx-version-min=10.5 -# 64 bit powerpc +# 64bit powerpc #CFLAGS += -arch ppc64 -mmacosx-version-min=10.5 #CXXFLAGS += -arch ppc64 -mmacosx-version-min=10.5 -# 32bit intel default +# 32bit intel # DARWIN flag added because of problem with putil.c -CFLAGS += -arch i386 -mmacosx-version-min=10.4 -DDARWIN -CXXFLAGS += -arch i386 -mmacosx-version-min=10.4 +#CFLAGS += -m32 -arch i386 -mmacosx-version-min=10.4 -DDARWIN +#CXXFLAGS += -m32 -arch i386 -mmacosx-version-min=10.4 -# 32 bit powerpc +# 32bit powerpc #CFLAGS += -arch ppc -mmacosx-version-min=10.2 #CXXFLAGS += -arch ppc -mmacosx-version-min=10.2