Blob Blame Raw
--- bundled/cdd/support/configure.pl.orig	2018-11-01 08:13:59.000000000 -0600
+++ bundled/cdd/support/configure.pl	2018-11-17 17:48:40.679799989 -0700
@@ -52,7 +52,6 @@ sub proceed {
       my $cdd_lib=Polymake::Configure::get_libdir($cdd_path, "cddgmp");
       if (-f "$cdd_lib/libcddgmp.$Config::Config{so}" ) {
          $LDFLAGS = "-L$cdd_lib";
-         $LDFLAGS .= " -Wl,-rpath,$cdd_lib" if $cdd_path ne "/usr";
       }
       if (!$CFLAGS or !$LDFLAGS) {
          die "Invalid installation location of cddlib: header file cdd.h and/or library libcddgmp.$Config::Config{so} not found.\n",
@@ -65,7 +64,6 @@ sub proceed {
       $cdd_path .= "include: $cdd_inc ";
    }
    if (defined ($cdd_lib=$options->{'cdd-lib'})) {
-      $LDFLAGS = "-L$cdd_lib -Wl,-rpath,$cdd_lib";
       $cdd_path .= "lib: $cdd_lib";
    }
 
--- bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc.orig	2018-11-01 08:13:59.000000000 -0600
+++ bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc	2018-11-17 17:48:40.679799989 -0700
@@ -134,7 +134,7 @@ inline bool int_quotient(long long& Quot
 #endif
 #endif
 
-#include "libnormaliz/libnormaliz-all.cpp"
+#include <libnormaliz/cone.h>
 
 #if defined(__GNUC__)
 #if defined(__clang__)
--- bundled/libnormaliz/support/configure.pl.orig	2018-11-01 08:13:59.000000000 -0600
+++ bundled/libnormaliz/support/configure.pl	2018-11-17 17:48:40.680799986 -0700
@@ -136,6 +136,7 @@ int main (int argc, char *argv[])
          $message .= " [OpenMP support disabled]";
       }
    } else {
+      $CXXFLAGS='-I/usr/include/libnormaliz';
       $LIBS="-lnormaliz";
       $message = "$nmz_version @ ".($nmz_path//"system")
    }
--- bundled/lrs/support/configure.pl.orig	2018-11-17 17:48:40.681799983 -0700
+++ bundled/lrs/support/configure.pl	2018-11-17 17:50:36.678464180 -0700
@@ -65,7 +65,7 @@ sub proceed {
       }
 
       if (-f "$lrs_lib/lib$lrs_libname.$Config::Config{so}" ) {
-         $LDFLAGS = "-L$lrs_lib -Wl,-rpath,$lrs_lib";
+         $LDFLAGS = "-L$lrs_lib";
       } elsif (-f "$lrs_lib/lib$lrs_libname.a" ) {
          $LDFLAGS = "-L$lrs_lib";
       } else {
--- bundled/nauty/apps/graph/src/build_flags.pl.orig	2018-11-01 08:13:59.000000000 -0600
+++ bundled/nauty/apps/graph/src/build_flags.pl	2018-11-17 17:48:40.681799983 -0700
@@ -1,25 +1,11 @@
 # input for generate_ninja_targets.pl
 
-my $foreign_src=$ConfigFlags{'bundled.nauty.NautySrc'};
-my $nauty_src= $foreign_src ? '${bundled.nauty.NautySrc}' : '${root}/bundled/nauty/external/nauty';
-my $generated_dir='${buildroot}/staticlib/nauty';
-my @generated_headers=qw( nauty.h naututil.h gtools.h );
-my @generated_in=map { /\.h$/; "$nauty_src/$`-h.in" } @generated_headers;
-my @generated_out=map { "$generated_dir/$_" } @generated_headers;
-my $include_generated= ($foreign_src && grep { -f "$foreign_src/$_" } @generated_headers)
-                       ? join(" ", map { "-include $_" } @generated_out)
-                       : "-I$generated_dir";
-
-( CXXFLAGS => "-DBIGNAUTY -I$generated_dir -I$nauty_src",
-
-  GENERATED => {
-    out => "@generated_out", in => "@generated_in",
-    command => "cd $generated_dir; CC=\"\${CC}\" CFLAGS=\"\${CFLAGS}\" $nauty_src/configure --quiet >/dev/null 2>/dev/null; rm -f makefile",
-  },
-
-  staticlib => {
-    SOURCEDIR => $nauty_src,
-    SOURCES => [ qw(naugraph.c naurng.c nausparse.c nautaux.c nautil.c nautinv.c naututil.c nauty.c rng.c schreier.c) ],
-    CFLAGS => "-DBIGNAUTY $include_generated -I$nauty_src",
-  }
+( 
+  $ConfigFlags{'bundled.nauty.UseBundled'}
+  ? ( staticlib => {
+        SOURCEDIR => '${root}/bundled/nauty/external/nauty',
+        SOURCES => [ qw(naugraph.c naurng.c nausparse.c nautaux.c nautil.c nautinv.c naututil.c nauty.c rng.c schreier.c) ],
+        CFLAGS => "-I/usr/include/nauty",
+      } )
+  : ()
 )
--- bundled/nauty/support/configure.pl.orig	2018-11-01 08:13:59.000000000 -0600
+++ bundled/nauty/support/configure.pl	2018-11-17 17:48:40.682799980 -0700
@@ -13,7 +13,7 @@
 #  GNU General Public License for more details.
 #-------------------------------------------------------------------------------
 
-@conf_vars=qw( NautySrc );
+@conf_vars=qw( UseBundled CFLAGS LDFLAGS LIBS );
 
 sub allowed_options {
    my ($allowed_options, $allowed_with)=@_;
@@ -28,24 +28,27 @@ sub usage {
                 "                         directory containing the nauty sources.\n";
 }
 
-sub check_nauty {
-   my $dir = @_ > 0 ? $_[0] : "bundled/nauty/external/nauty";
-   -e "$dir/nauty-h.in"
+sub check_bundled {
+   -e "bundled/nauty/external/nauty/nauty-h.in";
 }
 
 sub proceed {
    my ($options)=@_;
    my $nautysrc;
+   $UseBundled = 1;
    if (defined ($nautysrc=$options->{"nauty-src"})) {
-      check_nauty($nautysrc) or
-         die "Specified nauty source directory invalid, could not find 'nauty-h.in'.";
-      $NautySrc = $nautysrc;
-   } elsif (!check_nauty()) {
-      die "Bundled nauty directory seems to be missing, to use the nauty interface\n",
-          "with the minimal tarball please specify a nauty source directory\n",
-          "via --with-nauty-src=PATH.";
+      my $nauty_inc="$nautysrc/include/nauty";
+      my $nauty_lib=Polymake::Configure::get_libdir($nautysrc, "nauty");
+      if (-f "$nauty_inc/nauty.h") {
+         $CFLAGS="-I$nauty_inc";
+		 $LDFLAGS="-L$nauty_lib";
+		 $LIBS="-lnauty";
+		 $UseBundled = 0;
+	  } else {
+         die "Could not locate a working nauty installation\n";
+      }
    }
 
-   return $NautySrc ? "$NautySrc" : "bundled";
+   return $UseBundled ? "bundled" : ($nautysrc//"system");
 }
 
--- bundled/ppl/support/configure.pl.orig	2018-11-01 08:13:59.000000000 -0600
+++ bundled/ppl/support/configure.pl	2018-11-17 17:48:40.682799980 -0700
@@ -55,7 +55,7 @@ sub proceed {
    }
    if ($ppl_lib) {
       if (-f "$ppl_lib/libppl.$Config::Config{so}") {
-         $LDFLAGS = "-L$ppl_lib -Wl,-rpath,$ppl_lib";
+         $LDFLAGS = "-L$ppl_lib";
       } elsif ("$ppl_lib/libppl.a") {
 	 die "PPL found at $ppl_path is built without shared libraries.\n";
       } else {
--- bundled/singular/support/configure.pl.orig	2018-11-01 08:13:59.000000000 -0600
+++ bundled/singular/support/configure.pl	2018-11-17 17:48:40.682799980 -0700
@@ -42,7 +42,7 @@ sub singular_config_approach {
    # yes we need it twice ...
    chomp ($singular_prefix = `$singular_config --prefix`);
    chomp $singular_prefix;
-   $LDFLAGS =~ s/-L(\S+)/-L$1 -Wl,-rpath,$1/g;
+   $LDFLAGS =~ s/-L(\S+)/-L$1/g;
    my $libdir = $1;
 
    # newer versions of singular need -lsingular_resources while older ones needed -lresources
@@ -65,9 +65,6 @@ sub pkg_config_approach {
    chomp ($CXXFLAGS=`$pkg_config --cflags Singular`);
    die "$pkg_config failed: $!" if ($?);
    chomp ($LDFLAGS=`$pkg_config --libs-only-other --libs-only-L Singular`);
-   if (defined ($options->{singular})){
-      $LDFLAGS =~ s/-L(\S+)/-L$1 -Wl,-rpath,$1/g;
-   }
    chomp ($LIBS=`$pkg_config --libs-only-l Singular`);
    return $pc_singular_prefix;
 }
--- bundled/sympol/apps/polytope/src/build_flags.pl.orig	2018-11-01 08:13:59.000000000 -0600
+++ bundled/sympol/apps/polytope/src/build_flags.pl	2018-11-17 17:48:40.683799977 -0700
@@ -10,7 +10,7 @@ if ($ConfigFlags{'bundled.sympol.UseBund
        'raycomputationcdd.cpp' => '-DGMPRATIONAL ${bundled.cdd.CFLAGS}',
        'raycomputationlrs.cpp' => '-DGMP -DMA ${bundled.lrs.CFLAGS}',
        $ConfigFlags{ExternalHeaders} =~ /\bpermlib\b/
-       ? ( CXXFLAGS => '-I${root}/include/external/permlib' ) : (),
+       ? ( CXXFLAGS => '-I/usr/include/permlib' ) : (),
     },
   )
 } else {
--- bundled/sympol/support/configure.pl.orig	2018-11-01 08:13:59.000000000 -0600
+++ bundled/sympol/support/configure.pl	2018-11-17 17:48:40.683799977 -0700
@@ -146,6 +146,7 @@ int main() {
       undef $LIBS;
       $CXXFLAGS = '-I${root}/bundled/sympol/external/sympol';
    } else {
+      $CXXFLAGS="-I/usr/include/sympol";
       $LIBS="-lsympol";
    }
 
--- perl/polymake-config.orig	2018-11-01 08:13:59.000000000 -0600
+++ perl/polymake-config	2018-11-17 17:54:11.965840946 -0700
@@ -130,9 +130,6 @@ while (defined ($_=shift)) {
 
    } elsif ($_ eq "--ldflags") {
       my $ldflags=$ConfigFlags{LDFLAGS};
-      if ($ldflags !~ /(?:^|\s)-L$ConfigFlags{InstallLib}(?:\s|$)/) {
-         $ldflags="-L$ConfigFlags{InstallLib} $ldflags";
-      }
       my $add_rpath=1;
 
       # collect standard library paths of the C++ compiler and exclude them from the result
@@ -154,9 +151,6 @@ while (defined ($_=shift)) {
          $ldflags="$ConfigFlags{ARCHFLAGS} $ldflags -flat_namespace";
       } else {
          $ldflags .= " -Wl,-E";
-         if ($add_rpath) {
-            $ldflags .= " -Wl,-rpath,$ConfigFlags{InstallLib}";
-         }
       }
       $ldflags=~s/^\s+//; $ldflags=~s/\s+$//; $ldflags=~s/\s{2,}/ /g;
       if ($debug_asked=defined($debug)) {
--- support/configure.pl.orig	2018-11-01 08:13:59.000000000 -0600
+++ support/configure.pl	2018-11-17 17:48:40.685799971 -0700
@@ -456,7 +456,7 @@ sub parse_command_line {
       }
    }
 
-   $CXXOPT   =$vars{CXXOPT}   // "-O3";
+   $CXXOPT   =$vars{CXXOPT}   // "-O2";
    $CXXDEBUG =$vars{CXXDEBUG} // "";
    $CFLAGS   =$vars{CFLAGS}   // "";
    $CXXFLAGS =$vars{CXXFLAGS} // $CFLAGS;
@@ -670,7 +670,7 @@ sub determine_cxx_library {
       }
       $CFLAGS   .= " -I$options{toolchain}/include";
       $CXXFLAGS .= " -I$options{toolchain}/include";
-      $LDFLAGS  .= " -L$libdir -Wl,-rpath,$libdir";
+      $LDFLAGS  .= " -L$libdir";
    }
 
    if ($options{libcxx} eq ".true.") {
@@ -1051,10 +1051,6 @@ sub locate_gmp_and_mpfr_libraries {
       $CXXFLAGS .= " -I$GMP/include";
       my $libdir=get_libdir($GMP, "gmp");
       $LDFLAGS .= " -L$libdir";
-      if (!$FinkBase) {
-         # non-standard location
-         $LDFLAGS .= " -Wl,-rpath,$libdir";
-      }
    }
 
    my $MPFR=$options{mpfr};
@@ -1063,10 +1059,6 @@ sub locate_gmp_and_mpfr_libraries {
       $CXXFLAGS .= " -I$MPFR/include";
       my $libdir=get_libdir($MPFR, "mpfr");
       $LDFLAGS .= " -L$libdir";
-      if (!$FinkBase) {
-         # non-standard location
-         $LDFLAGS .= " -Wl,-rpath,$libdir";
-      }
    } elsif ($FinkBase) {
       $MPFR=$FinkBase;
    }