Hi, I'm unable to build libtool as binary that includes both 32-bit and 64-bit intel architecture on Mac OS X 10.6.4 using gcc-4.0.1, and get the following error:
gcc-4.0: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags The errors are the same for libtool-2.2.10.tar.gz package and the latest version of libtool from the git repository. $ git clone git://git.savannah.gnu.org/libtool.git $ cd libtool $ ./bootstrap $ ./configure CC='/usr/bin/gcc-4.0' CPP='/usr/bin/cpp-4.0' CXX='/usr/bin/g++-4.0' CXXCPP='/usr/bin/cpp-4.0' CFLAGS='-arch i386 -arch x86_64' CPPFLAGS='-arch i386 -arch x86_64' CXXFLAGS='-arch i386 -arch x86_64' LDFLAGS='-arch i386 -arch x86_64' $ make autom4te --language=m4sh -B libltdl/config libltdl/config/ltmain.m4sh > libltdl/config/ltmain.in sed -e s,@EGREP\@,/usr/bin/grep -E,g -e s,@FGREP\@,/usr/bin/grep -F,g -e s,@GREP\@,/usr/bin/grep,g -e s,@LN_S\@,ln -s,g -e s,@MACRO_VERSION\@,2.2.11a,g -e s,@PACKAGE\@,libtool,g -e s,@PACKAGE_BUGREPORT\@,bug-libt...@gnu.org,g -e s,@PACKAGE_URL\@,http://www.gnu.org/software/libtool/,g -e s,@PACKAGE_NAME\@,GNU Libtool,g -e s,@PACKAGE_STRING\@,GNU Libtool 2.2.11a,g -e s,@PACKAGE_TARNAME\@,libtool,g -e s,@PACKAGE_VERSION\@,2.2.11a,g -e s,@SED\@,/usr/bin/sed,g -e s,@VERSION\@,2.2.11a,g -e s,@aclocaldir\@,/usr/local/share/aclocal,g -e s,@datadir\@,/usr/local/share,g -e s,@pkgdatadir\@,/usr/local/share/libtool,g -e s,@host_triplet\@,i386-apple-darwin10.4.0,g -e s,@prefix\@,/usr/local,g -e s,@TIMESTAMP\@, 1.3272 2010-09-12,g -e s,@package_revision\@,1.3272, ./libltdl/config/ltmain.in > ./libltdl/config/ltmain.sh /bin/sh ./config.status libtool config.status: executing libtool commands rm -f libtoolize.tmp libtoolize set dummy `/bin/sh ./libltdl/config/mkstamp .`; shift; case 2.2.11a in *[acegikmoqsuwy]) TIMESTAMP=" $1 $2" ;; *) TIMESTAMP="" ;; esac; \ sed -e 's,@EGREP\@,/usr/bin/grep -E,g' -e 's,@FGREP\@,/usr/bin/grep -F,g' -e 's,@GREP\@,/usr/bin/grep,g' -e 's,@LN_S\@,ln -s,g' -e 's,@MACRO_VERSION\@,2.2.11a,g' -e 's,@PACKAGE\@,libtool,g' -e 's,@PACKAGE_BUGREPORT\@,bug-libt...@gnu.org,g' -e 's,@PACKAGE_URL\@,http://www.gnu.org/software/libtool/,g' -e 's,@PACKAGE_NAME\@,GNU Libtool,g' -e 's,@PACKAGE_STRING\@,GNU Libtool 2.2.11a,g' -e 's,@PACKAGE_TARNAME\@,libtool,g' -e 's,@PACKAGE_VERSION\@,2.2.11a,g' -e 's,@SED\@,/usr/bin/sed,g' -e 's,@VERSION\@,2.2.11a,g' -e 's,@aclocaldir\@,/usr/local/share/aclocal,g' -e 's,@datadir\@,/usr/local/share,g' -e 's,@pkgdatadir\@,/usr/local/share/libtool,g' -e 's,@host_triplet\@,i386-apple-darwin10.4.0,g' -e 's,@prefix\@,/usr/local,g' -e "s,@TIMESTAMP\@,$TIMESTAMP,g" \ -e 's,@aclocal_DATA\@,m4/argz.m4 m4/libtool.m4 m4/ltdl.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4,g' \ -e "s,@pkgltdl_files\@,libltdl/COPYING.LIB libltdl/README libltdl/Makefile.inc libltdl/Makefile.am libltdl/configure.ac libltdl/aclocal.m4 libltdl/Makefile.in libltdl/config-h.in libltdl/configure libltdl/argz_.h libltdl/argz.c libltdl/loaders/dld_link.c libltdl/loaders/dlopen.c libltdl/loaders/dyld.c libltdl/loaders/load_add_on.c libltdl/loaders/loadlibrary.c libltdl/loaders/shl_load.c libltdl/lt__dirent.c libltdl/lt__strl.c libltdl/libltdl/lt__alloc.h libltdl/libltdl/lt__dirent.h libltdl/libltdl/lt__glibc.h libltdl/libltdl/lt__private.h libltdl/libltdl/lt__strl.h libltdl/libltdl/lt_dlloader.h libltdl/libltdl/lt_error.h libltdl/libltdl/lt_system.h libltdl/libltdl/slist.h libltdl/loaders/preopen.c libltdl/lt__alloc.c libltdl/lt_dlloader.c libltdl/lt_error.c libltdl/ltdl.c libltdl/ltdl.h libltdl/slist.c,g" \ -e "s,@pkgconfig_files\@,config/compile config/config.guess config/config.sub config/depcomp config/install-sh config/missing config/ltmain.sh,g" \ ./libtoolize.in > libtoolize.tmp chmod a+x libtoolize.tmp chmod a-w libtoolize.tmp mv -f libtoolize.tmp libtoolize /bin/sh /Users/elvis/Tool/libtool/libltdl/config/install-sh -d . libltdl/ cp ./libltdl/argz_.h libltdl/argz.h-t mv libltdl/argz.h-t libltdl/argz.h make all-recursive test -f doc/.dirstamp || make doc/.dirstamp Updating ./doc/version.texi restore=: && backupdir=".am$$" && \ am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd . && \ rm -rf $backupdir && mkdir $backupdir && \ if (/bin/sh /Users/elvis/Tool/libtool/libltdl/config/missing --run makeinfo --version) >/dev/null 2>&1; then \ for f in doc/libtool.info doc/libtool.info-[0-9] doc/libtool.info-[0-9][0-9] doc/libtool.i[0-9] doc/libtool.i[0-9][0-9]; do \ if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$am__cwd"; \ if /bin/sh /Users/elvis/Tool/libtool/libltdl/config/missing --run makeinfo -I doc -I ./doc \ -o doc/libtool.info ./doc/libtool.texi; \ then \ rc=0; \ CDPATH="${ZSH_VERSION+.}:" && cd .; \ else \ rc=$?; \ CDPATH="${ZSH_VERSION+.}:" && cd . && \ $restore $backupdir/* `echo "./doc/libtool.info" | sed 's|[^/]*$||'`; \ fi; \ rm -rf $backupdir; exit $rc /bin/sh ./libtool --tag=CC --mode=compile /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -DLTDLOPEN=libltdl -DLT_CONFIG_H='<config.h>' -DLTDL -I. -I. -Ilibltdl -I./libltdl -I./libltdl/libltdl -arch i386 -arch x86_64 -arch i386 -arch x86_64 -MT libltdl/loaders/libltdl_libltdl_la-preopen.lo -MD -MP -MF libltdl/loaders/.deps/libltdl_libltdl_la-preopen.Tpo -c -o libltdl/loaders/libltdl_libltdl_la-preopen.lo `test -f 'libltdl/loaders/preopen.c' || echo './'`libltdl/loaders/preopen.c libtool: compile: /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -DLTDLOPEN=libltdl "-DLT_CONFIG_H=<config.h>" -DLTDL -I. -I. -Ilibltdl -I./libltdl -I./libltdl/libltdl -arch i386 -arch x86_64 -arch i386 -arch x86_64 -MT libltdl/loaders/libltdl_libltdl_la-preopen.lo -MD -MP -MF libltdl/loaders/.deps/libltdl_libltdl_la-preopen.Tpo -c libltdl/loaders/preopen.c -fno-common -DPIC -o libltdl/loaders/.libs/libltdl_libltdl_la-preopen.o gcc-4.0: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags make[2]: *** [libltdl/loaders/libltdl_libltdl_la-preopen.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 How can I build a binary that works for both 32-bit and 64-bit architectures? Has anyone done this successfully before? If I try to use gcc-4.2.1, which is the default compiler, it doesn't even get past the configure stage, so that's why I've been trying to use gc-4.0.1 ./configure CC='/usr/bin/gcc-4.2' CPP='/usr/bin/cpp-4.2' CXX='/usr/bin/g++-4.2' CXXCPP='/usr/bin/cpp-4.2' CFLAGS='-arch i386 -arch x86_64' CPPFLAGS='-arch i386 -arch x86_64' CXXFLAGS='-arch i386 -arch x86_64' LDFLAGS='-arch i386 -arch x86_64' ## ----------------------------------------------------- ## ## Configuring libtool (Build:1.3272 2010-09-12) 2.2.11a ## ## ----------------------------------------------------- ## checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... libltdl/config/install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking for gcc... /usr/bin/gcc-4.2 checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /usr/bin/gcc-4.2 accepts -g... yes checking for /usr/bin/gcc-4.2 option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of /usr/bin/gcc-4.2... gcc3 checking whether /usr/bin/gcc-4.2 and cc understand -c and -o together... yes checking how to run the C preprocessor... /usr/bin/cpp-4.2 configure: error: in `/Users/elvis/Tool/libtool': configure: error: C preprocessor "/usr/bin/cpp-4.2" fails sanity check See `config.log' for more details Best regards, Elvis Dowson _______________________________________________ http://lists.gnu.org/mailman/listinfo/libtool