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