From 8412a400e92d5cbcd70f02765de2ba4f5908f1f3 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Tue, 8 Nov 2011 18:04:05 +0100 Subject: Make OTP build w/alternative gcc on MacOS Lion Requires own build of wxMac for wx to work: $ arch_flags="-arch i386" $ ./configure CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" \ CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" \ OBJCXXFLAGS="$arch_flags" --prefix=/usr/local \ --with-macosx-sdk=/Developer/SDKs/MacOSX10.6.sdk \ --with-macosx-version-min=10.6 --enable-unicode --with-opengl $ make $ sudo make install - and we have macports gcc 4.5 in /opt/local/bin, so we configure and build OTP like this for 32bit (which is required for wx): $ cd $ERL_TOP $ PATH=/usr/local/bin:$PATH CC=/opt/local/bin/gcc-mp-4.5 CXX=/opt/local/bin/g++-mp-4.5 ./configure --enable-m32-build $ MAKEFLAGS="-j6" PATH=/usr/local/bin:$PATH make --- erts/configure.in | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'erts/configure.in') diff --git a/erts/configure.in b/erts/configure.in index fafa1c7e92..4f0c6efc3e 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -490,7 +490,19 @@ CFLAG_RUNTIME_LIBRARY_PATH="-Wl,-R" case $host_os in darwin*) CFLAG_RUNTIME_LIBRARY_PATH= - CFLAGS="$CFLAGS -no-cpp-precomp" + AC_TRY_COMPILE([],[ + #if __GNUC__ >= 4 + ; + #else + #error old or no gcc + #endif + ], + gcc_need_no_cpp_precomp=no, + gcc_need_no_cpp_precomp=yes) + + if test x$gcc_need_no_cpp_precomp = xyes; then + CFLAGS="$CFLAGS -no-cpp-precomp" + fi ;; win32) CFLAG_RUNTIME_LIBRARY_PATH= @@ -1000,7 +1012,7 @@ case $ERTS_BUILD_SMP_EMU in ], gcc_smp=okgcc, gcc_smp=oldornogcc) - ERTS_BUILD_SMP_EMU=yes +Ω ERTS_BUILD_SMP_EMU=yes case "$enable_threads-$gcc_smp-$found_threads-$host_os" in no-*) -- cgit v1.2.3