--- support/configure.pl 2011-11-09 22:43:08.000000000 +0100 +++ support/configure.pl 2011-12-28 12:59:17.000000000 +0100 @@ -50,7 +50,7 @@ GCCversion ICCversion CCache LDflags LDsharedFlags LDcallableFlags Libs LIBXML2_CFLAGS LIBXML2_LIBS - Arch FinkBase WithFink + Arch FinkBase WithFink NeedsArchFlag JavaBuild JavaViewPath NativeArchFlags ANT ); @export=qw( PERL InstallTop InstallArch InstallBin InstallInc InstallLib InstallDoc DirMask ARCHFLAGS JAVACMD JNI_HEADERS ); } @@ -107,7 +107,7 @@ if ($^O eq "darwin") { print STDERR <<'.'; --with-fink=PATH|yes|no ( /sw ) fink installation directory - --with-readline= where to find the gnu readline library (the version included in OSX does not suffice) + --with-readline=PATH where to find the gnu readline library (the version included in OSX does not suffice) . } print STDERR <<"."; @@ -306,6 +306,9 @@ if (v_cmp($GCCversion,"4.0")<0) { die "C++ compiler $CXX says its version is $GCCversion, which is rather out-of-date.\n"; } + if ($^O eq "darwin") { # decide whether we use a the gcc provided by apple, in that case we need the -arch flags, otherwise we probably don't + $NeedsArchFlag=`$CXX --version` =~ m/apple/; + } } $PERL =$vars{PERL} || $^X; @@ -365,7 +368,11 @@ die "Fink package mpfr-shlibs seems to be missing. Further configuration is not possible.\n", "Please install the packages mpfr and mpfr-shlibs and repeat the configure run.\n"; } - $ARCHFLAGS="-arch $Platform"; + if ( $NeedsArchFlag ) { + $ARCHFLAGS="-arch $Platform"; + } else { + $ARCHFLAGS=""; + } $Arch="darwin.$Platform"; $GMP ||= $FinkBase; } else { # end $WithFink @@ -382,7 +389,11 @@ $Platform="x86_64"; } } - $ARCHFLAGS="-arch $Platform"; + if ( $NeedsArchFlag ) { + $ARCHFLAGS="-arch $Platform"; + } else { + $ARCHFLAGS=""; + } $Arch="darwin.$Platform"; } } else { @@ -425,7 +436,7 @@ if (v_cmp($GCCversion, "4.3")<0) { $CXXflags .= " -Wno-uninitialized"; } - if ($ARCHFLAGS) { + if ($^O eq "darwin") { # MacOS magic again my $allarch=qr/ -arch \s+ \S+ (?: \s+ -arch \s+ \S+)* /x; $Cflags =~ s/$allarch//o; @@ -719,7 +730,11 @@ . if ($^O eq "darwin") { ( $NativeArchFlags=`lipo -info $JAVACMD` ) =~ s/.* are: (.*)$/$1/m; - $NativeArchFlags =~ s/(\S+)/-arch $1/g; + if ( $NeedsArchFlag ) { + $NativeArchFlags =~ s/(\S+)/-arch $1/g; + } else { + $NativeArchFlags = ""; + } } }