Index: support/configure.pl =================================================================== --- support/configure.pl (revision 10340) +++ support/configure.pl (revision 10341) @@ -50,7 +50,7 @@ GCCversion ICCversion CCache LDflags LDsharedFlags LDcallableFlags Libs LIBXML2_CFLAGS LIBXML2_LIBS - Arch FinkBase + Arch FinkBase WithFink JavaBuild JavaViewPath NativeArchFlags ANT ); @export=qw( PERL InstallTop InstallArch InstallBin InstallInc InstallLib InstallDoc DirMask ARCHFLAGS JAVACMD JNI_HEADERS ); } @@ -84,9 +84,17 @@ --libexecdir=PATH ( ${exec-prefix}/lib/polymake ) dynamic modules loaded at the runtime --datadir=PATH ( ${prefix}/share/polymake ) rules and other architecture-independent files --docdir=PATH ( ${datadir}/doc ) automatically generated documentation files - +. + if ($^O eq "darwin") { + print STDERR <<'.'; + --build=ARCH abbreviation for the build architecture: "i386" for 32bit or "x86_64" for 64bit +. +} else { + print STDERR <<'.'; --build=ARCH abbreviation for the build architecture - +. +} + print STDERR <<'.'; Build dependences: --with-java=PATH ( ${JAVA_HOME} ) where to find Java compiler and runtime environment @@ -98,7 +106,8 @@ . if ($^O eq "darwin") { print STDERR <<'.'; - --with-fink=PATH ( /sw ) fink installation directory + --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) . } print STDERR <<"."; @@ -166,7 +175,7 @@ my (%allowed_options, %allowed_with, %allowed_vars); my $check_prereq=1; @allowed_options{ qw( prefix exec-prefix bindir includedir libdir libexecdir datadir docdir build ) }=(); -@allowed_with{ qw( java jni-headers ant javaview fink gmp mpfr boost libxml2 ) }=(); +@allowed_with{ qw( java jni-headers ant javaview fink gmp mpfr boost libxml2 readline ) }=(); @allowed_vars{ qw( CC CFLAGS CXX CXXFLAGS CXXOPT LDFLAGS LIBS PERL ) }=(); while (defined (my $arg=shift @ARGV)) { @@ -198,6 +207,20 @@ exit(1); } +$WithFink=0; +if ($^O eq "darwin") { + if ( !defined($options{fink}) || $options{fink} eq "yes" ) { + $WithFink=1; + } else { + if ( $options{fink} eq "no" ) { + $WithFink=0; + } else { + $WithFink=1; + $FinkBase=$options{fink}; + } + } +} + # construct paths my $prefix=$options{prefix} || "/usr/local"; @@ -300,47 +323,68 @@ do "support/locate_build_dir"; if ($^O eq "darwin") { - if (defined ($FinkBase=$options{fink})) { - if (-d $FinkBase) { - unless (-f "$FinkBase/etc/fink.conf") { - die "option --with-fink does not point to the fink installation tree: $FinkBase/etc/fink.conf not found\n"; - } - } elsif (-x $FinkBase && $FinkBase =~ s|/bin/fink$||) { - unless (-f "$FinkBase/etc/fink.conf") { - die "option -with-fink points to a broken fink installation: $FinkBase/etc/fink.conf not found\n"; - } - } else { - die "option -with-fink points to a wrong program: something like /path/bin/fink expected.\n", - "If you have renamed the main fink program, please specify the top directory: --with-fink=/path\n"; - } - } else { - (undef, my ($fink, $error))=find_program_in_path("fink", sub { - !(($FinkBase=$_[0]) =~ s|/bin/fink$|| && -f "$FinkBase/etc/fink.conf") && "!" - }); - if ($fink) { - if ($error) { - die "found the fink program at $fink, but the corresponding configuration file is missing;\n", - "Please specify the top installation directory using option --with-fink\n"; - } - } elsif (-f "/sw/etc/fink.conf") { - $FinkBase="/sw"; - } else { - die "The Fink package system is a mandatory prerequisite to build and use polymake under MacOS.\n", - "Please refer to $Wiki/mac for details and installation instructions.\n", - "If you already have Fink installed at a non-standard location, please specify it using option --with-fink\n"; - } - } - - if (-f "$FinkBase/lib/libgmp.dylib") { - ($Platform)= `lipo -info $FinkBase/lib/libgmp.dylib` =~ /architecture: (\S+)/; - } else { - die "Fink package gmp-shlibs seems to be missing. Further configuration is not possible.\n", - "Please install the packages gmp and gmp-shlibs and repeat the configure run.\n"; - } - $ARCHFLAGS="-arch $Platform"; - $Arch="darwin.$Platform"; - $GMP ||= $FinkBase; - + if ( $WithFink ) { + if (defined ($FinkBase) ) { + if (-d $FinkBase) { + unless (-f "$FinkBase/etc/fink.conf") { + die "option --with-fink does not point to the fink installation tree: $FinkBase/etc/fink.conf not found\n"; + } + } elsif (-x $FinkBase && $FinkBase =~ s|/bin/fink$||) { + unless (-f "$FinkBase/etc/fink.conf") { + die "option -with-fink points to a broken fink installation: $FinkBase/etc/fink.conf not found\n"; + } + } else { + die "option -with-fink points to a wrong program: something like /path/bin/fink expected.\n", + "If you have renamed the main fink program, please specify the top directory: --with-fink=/path\n"; + } + } else { + (undef, my ($fink, $error))=find_program_in_path("fink", sub { + !(($FinkBase=$_[0]) =~ s|/bin/fink$|| && -f "$FinkBase/etc/fink.conf") && "!" + }); + if ($fink) { + if ($error) { + die "found the fink program at $fink, but the corresponding configuration file is missing;\n", + "Please specify the top installation directory using option --with-fink\n"; + } + } elsif (-f "/sw/etc/fink.conf") { + $FinkBase="/sw"; + } else { + die "The Fink package system is a mandatory prerequisite to build and use polymake under MacOS.\n", + "Please refer to $Wiki/mac for details and installation instructions.\n", + "If you already have Fink installed at a non-standard location, please specify it using option --with-fink\n"; + } + } # end: -d $FinkBase + + if (-f "$FinkBase/lib/libgmp.dylib") { + ($Platform)= `lipo -info $FinkBase/lib/libgmp.dylib` =~ /architecture: (\S+)/; + } else { + die "Fink package gmp-shlibs seems to be missing. Further configuration is not possible.\n", + "Please install the packages gmp and gmp-shlibs and repeat the configure run.\n"; + } + unless (-f "$FinkBase/lib/libmpfr.dylib") { + 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"; + $Arch="darwin.$Platform"; + $GMP ||= $FinkBase; + } else { # end $WithFink + if ( defined( $Platform=$options{build}) ) { + if ( $Platform ne "i386" && $Platform ne "x86_64" ) { + die "architecture for Mac OS must be one of i386 or x86_64.\n"; + } + } else { # choose i386 for 10.5 and x86_64 for all others + `sw_vers | grep ProductVersion` =~ /(10.*)/; + my $Version=$1; + if ( $Version =~ /10.5/ ) { + $Platform="i386"; + } else { + $Platform="x86_64"; + } + } + $ARCHFLAGS="-arch $Platform"; + $Arch="darwin.$Platform"; + } } else { $Platform=platform_name(); unless ($CXXflags) { @@ -423,7 +467,7 @@ $CXXflags .= " -I$GMP/include"; my $libdir=get_libdir($GMP, "gmp"); $LDflags .= " -L$libdir"; - if ($^O ne "darwin" && exists $options{gmp}) { + if ( !$WithFink && exists $options{gmp}) { # this does not work for Mac OS 10.4 # non-standard location $LDflags .= " -Wl,-rpath,$libdir"; } @@ -435,7 +479,7 @@ $CXXflags .= " -I$MPFR/include"; my $libdir=get_libdir($MPFR, "mpfr"); $LDflags .= " -L$libdir"; - if ($^O ne "darwin") { + if ( !$WithFink ) { # this does not work for Mac OS 10.4 # non-standard location $LDflags .= " -Wl,-rpath,$libdir"; } @@ -443,8 +487,8 @@ my $BOOST=$options{boost}; if (defined($BOOST) && $BOOST ne $GMP && $BOOST ne $MPFR) { - $Cflags .= " -I$BOOST/include"; - $CXXflags .= " -I$BOOST/include"; + $Cflags .= " -I$BOOST"; + $CXXflags .= " -I$BOOST"; } if ($check_prereq) { @@ -548,8 +592,8 @@ - if ($^O eq "darwin") { - lib->import("$FinkBase/lib/perl5"); + if ( $WithFink ) { + lib->import("$FinkBase/lib/perl5"); } my $warned; foreach (qw(XML::Writer XML::LibXML XML::LibXSLT Term::ReadLine)) { @@ -565,7 +609,9 @@ if ($@ =~ /\ACan't locate /) { print STDERR <<"."; WARNING: perl module $pkg required for polymake not found on your machine. - Please be sure to install it prior to starting to use polymake. + Please be sure to install it prior to starting to use polymake. + If you have installed them in a non-standard location + please add the path to the environment variable PERL5LIB . } else { $@ =~ / at .*? line \d+/m;