9647ad1
--- bundled/cdd/support/configure.pl.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ bundled/cdd/support/configure.pl	2018-04-15 13:42:47.970012974 -0600
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
 
9647ad1
--- bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc	2018-04-15 13:50:12.744485018 -0600
9647ad1
@@ -135,7 +135,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__)
9647ad1
--- bundled/libnormaliz/support/configure.pl.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ bundled/libnormaliz/support/configure.pl	2018-04-15 13:45:39.129423452 -0600
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
    }
9647ad1
--- bundled/lrs/support/configure.pl.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ bundled/lrs/support/configure.pl	2018-04-16 21:04:58.916451962 -0600
9647ad1
@@ -45,11 +45,11 @@ sub proceed {
9647ad1
    my $suppress_output=0;
9647ad1
 
9647ad1
    if (defined ($lrs_path=$options->{lrs}) and $lrs_path ne "bundled") {
9647ad1
-      my $lrs_inc="$lrs_path/include";
9647ad1
+      my $lrs_inc="$lrs_path/include/lrslib";
9647ad1
       my $lrs_lib=Polymake::Configure::get_libdir($lrs_path, "lrsgmp");
1bc623a
       if (-f "$lrs_inc/lrslib.h" && -f "$lrs_lib/liblrsgmp.$Config::Config{so}" ) {
9647ad1
          $CFLAGS = "-I$lrs_inc";
9647ad1
-         $LDFLAGS = "-L$lrs_lib -Wl,-rpath,$lrs_lib";
9647ad1
+         $LDFLAGS = "-L$lrs_lib";
1bc623a
       } elsif (-f "$lrs_inc/lrslib.h" && -f "$lrs_lib/liblrsgmp.a" ) {
9647ad1
          $CFLAGS = "-I$lrs_inc";
9647ad1
          $LDFLAGS = "-L$lrs_lib";
9647ad1
--- bundled/nauty/apps/graph/src/build_flags.pl.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ bundled/nauty/apps/graph/src/build_flags.pl	2018-04-18 18:51:41.461585057 -0600
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
 )
9647ad1
--- bundled/nauty/support/configure.pl.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ bundled/nauty/support/configure.pl	2018-04-17 20:54:14.055618022 -0600
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
 
9647ad1
--- bundled/ppl/support/configure.pl.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ bundled/ppl/support/configure.pl	2018-04-15 14:00:54.998296923 -0600
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 {
9647ad1
--- bundled/singular/support/configure.pl.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ bundled/singular/support/configure.pl	2018-04-15 14:02:08.374046937 -0600
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
 }
9647ad1
--- bundled/sympol/apps/polytope/src/build_flags.pl.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ bundled/sympol/apps/polytope/src/build_flags.pl	2018-04-15 14:06:35.821171083 -0600
9647ad1
@@ -10,7 +10,7 @@ if ($ConfigFlags{'bundled.sympol.UseBund
9647ad1
        'raycomputationcdd.cpp' => '-DGMPRATIONAL ${bundled.cdd.CFLAGS}',
9647ad1
        'raycomputationlrs.cpp' => '-DGMP ${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 {
9647ad1
--- bundled/sympol/support/configure.pl.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ bundled/sympol/support/configure.pl	2018-04-15 14:05:52.837292506 -0600
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
 
9647ad1
--- perl/polymake-config.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ perl/polymake-config	2018-04-15 14:08:13.652894725 -0600
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
9647ad1
@@ -152,8 +149,6 @@ while (defined ($_=shift)) {
Jerry James 74d8a20
       close CC;
Jerry James 74d8a20
       if ($^O eq "darwin") {
9647ad1
          $ldflags="$ConfigFlags{ARCHFLAGS} $ldflags -flat_namespace";
Jerry James 74d8a20
-      } elsif ($add_rpath) {
9647ad1
-         $ldflags.=" -Wl,-rpath,$ConfigFlags{InstallLib}";
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)) {
9647ad1
--- support/configure.pl.orig	2018-02-16 03:27:51.000000000 -0700
9647ad1
+++ support/configure.pl	2018-04-15 14:10:02.468587338 -0600
9647ad1
@@ -454,7 +454,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;
9647ad1
@@ -668,7 +668,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.") {
9647ad1
@@ -993,10 +993,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};
9647ad1
@@ -1005,10 +1001,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
    }