9e8b0d3
--- bundled/cdd/support/configure.pl.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ bundled/cdd/support/configure.pl	2020-07-06 11:13:46.377747634 -0600
79e44b1
@@ -56,7 +56,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",
79e44b1
@@ -69,7 +68,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
 
9e8b0d3
--- bundled/flint/support/configure.pl.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ bundled/flint/support/configure.pl	2020-07-06 11:13:46.378747633 -0600
99b6072
@@ -23,7 +23,7 @@ sub proceed {
99b6072
       my $lib=Polymake::Configure::get_libdir($flint_path, "flint");
99b6072
       if (-f "$inc/flint/flint.h" && -f "$lib/libflint.$Config::Config{so}" ) {
99b6072
          $cxxflags .= " -I$inc";
99b6072
-         $ldflags .= " -L$lib -Wl,-rpath,$lib";
99b6072
+         $ldflags .= " -L$lib";
99b6072
       } else {
99b6072
          die "Invalid installation location of flint, header files and/or library not found\n";
99b6072
       }
9e8b0d3
--- bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc	2020-07-06 11:13:46.378747633 -0600
79e44b1
@@ -155,13 +155,7 @@ inline bool int_quotient(long long& Quot
79e44b1
 #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
9ce504e
 #endif
Jerry James 74d8a20
 
79e44b1
-#include "libnormaliz/linear_algebra.cpp"
79e44b1
-#include "libnormaliz/cone_and_control.cpp"
79e44b1
-#include "libnormaliz/enumeration.cpp"
79e44b1
-#include "libnormaliz/other_algorithms.cpp"
79e44b1
-#include "libnormaliz/nmz_nauty.cpp"
79e44b1
-#include "libnormaliz/primal.cpp"
79e44b1
-#include "libnormaliz/output.cpp"
Jerry James 74d8a20
+#include <libnormaliz/cone.h>
Jerry James 74d8a20
 
79e44b1
 
9647ad1
 #if defined(__clang__)
9e8b0d3
--- bundled/libnormaliz/support/configure.pl.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ bundled/libnormaliz/support/configure.pl	2020-07-06 11:13:46.379747633 -0600
79e44b1
@@ -63,7 +63,7 @@ int main() {
99b6072
       my $nmz_lib=Polymake::Configure::get_libdir($nmz_path, "normaliz");
99b6072
       if (-f "$nmz_inc/libnormaliz/libnormaliz.h" && -f "$nmz_lib/libnormaliz.$Config::Config{so}" ) {
99b6072
          $CXXFLAGS = "-I$nmz_inc";
99b6072
-         $LDFLAGS = "-L$nmz_lib -Wl,-rpath,$nmz_lib";
99b6072
+         $LDFLAGS = "-L$nmz_lib";
99b6072
       } else {
99b6072
          die "Invalid installation location of libnormaliz header file libnormaliz/libnormaliz.h and/or library libnormaliz.$Config::Config{so} not found\n";
99b6072
       }
79e44b1
@@ -174,6 +174,7 @@ int main (int argc, char *argv[])
9647ad1
          $message .= " [OpenMP support disabled]";
9647ad1
       }
9647ad1
    } else {
9647ad1
+      $CXXFLAGS='-I/usr/include/libnormaliz';
79e44b1
       $LIBS="$libs";
9647ad1
       $message = "$nmz_version @ ".($nmz_path//"system")
9647ad1
    }
9e8b0d3
--- bundled/lrs/support/configure.pl.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ bundled/lrs/support/configure.pl	2020-07-06 11:13:46.379747633 -0600
9e8b0d3
@@ -67,7 +67,7 @@ sub proceed {
9e8b0d3
       $CFLAGS .= " -DHAVE_LRSDRIVER" if -f "$lrs_inc/lrsdriver.h";
9647ad1
 
d504817
       if (-f "$lrs_lib/lib$lrs_libname.$Config::Config{so}" ) {
9647ad1
-         $LDFLAGS = "-L$lrs_lib -Wl,-rpath,$lrs_lib";
9647ad1
+         $LDFLAGS = "-L$lrs_lib";
d504817
       } elsif (-f "$lrs_lib/lib$lrs_libname.a" ) {
9647ad1
          $LDFLAGS = "-L$lrs_lib";
d504817
       } else {
9e8b0d3
--- bundled/nauty/apps/graph/src/build_flags.pl.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ bundled/nauty/apps/graph/src/build_flags.pl	2020-07-06 11:13:46.380747632 -0600
9647ad1
@@ -1,25 +1,11 @@
9647ad1
 # input for generate_ninja_targets.pl
9647ad1
 
79e44b1
-my $foreign_src = $ConfigFlags{'bundled.nauty.NautySrc'};
79e44b1
-my $nauty_src = $foreign_src ? '${bundled.nauty.NautySrc}' : '${root}/bundled/nauty/external/nauty';
79e44b1
-my $generated_dir = '${builddir}/staticlib/nauty';
79e44b1
-my @generated_headers = qw( nauty.h naututil.h gtools.h );
79e44b1
-my @generated_in = map { /\.h$/; "$nauty_src/$`-h.in" } @generated_headers;
79e44b1
-my @generated_out = map { "$generated_dir/$_" } @generated_headers;
79e44b1
-my $include_generated = ($foreign_src && grep { -f "$foreign_src/$_" } @generated_headers)
79e44b1
-                        ? join(" ", map { "-include $_" } @generated_out)
79e44b1
-                        : "-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
-  }
79e44b1
+(
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
 )
9e8b0d3
--- bundled/nauty/support/configure.pl.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ bundled/nauty/support/configure.pl	2020-07-06 11:13:46.380747632 -0600
99b6072
@@ -14,7 +14,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)=@_;
99b6072
@@ -29,24 +29,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
 
9e8b0d3
--- bundled/singular/support/configure.pl.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ bundled/singular/support/configure.pl	2020-07-06 11:13:46.381747631 -0600
99b6072
@@ -43,7 +43,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
99b6072
@@ -66,9 +66,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
 }
9e8b0d3
--- bundled/sympol/apps/polytope/src/build_flags.pl.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ bundled/sympol/apps/polytope/src/build_flags.pl	2020-07-06 11:13:46.381747631 -0600
79e44b1
@@ -16,7 +16,7 @@ if ($ConfigFlags{'bundled.sympol.UseBund
79e44b1
                         symmetrygroupconstruction/graphconstructiondefault.cpp symmetrygroupconstruction/matrixconstruction.cpp symmetrygroupconstruction/matrixconstructiondefault.cpp ) ],
9647ad1
        'raycomputationcdd.cpp' => '-DGMPRATIONAL ${bundled.cdd.CFLAGS}',
d504817
        'raycomputationlrs.cpp' => '-DGMP -DMA ${bundled.lrs.CFLAGS}',
79e44b1
-       CXXFLAGS => $no_warnings . ($ConfigFlags{ExternalHeaders} =~ /\bpermlib\b/ ? ' -I${root}/include/external/permlib' : ''),
79e44b1
+       CXXFLAGS => $no_warnings . ($ConfigFlags{ExternalHeaders} =~ /\bpermlib\b/ ? ' -I/usr/include/permlib' : ''),
9647ad1
     },
9647ad1
   )
9647ad1
 } else {
9e8b0d3
--- bundled/sympol/support/configure.pl.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ bundled/sympol/support/configure.pl	2020-07-06 11:13:46.382747631 -0600
99b6072
@@ -147,6 +147,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
 
9e8b0d3
--- perl/polymake-config.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ perl/polymake-config	2020-07-06 11:13:46.382747631 -0600
99b6072
@@ -140,9 +140,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
99b6072
@@ -164,9 +161,6 @@ while (defined ($_=shift)) {
79e44b1
          $ldflags = "$ConfigFlags{ARCHFLAGS} $ldflags -flat_namespace";
d504817
       } else {
d504817
          $ldflags .= " -Wl,-E";
d504817
-         if ($add_rpath) {
d504817
-            $ldflags .= " -Wl,-rpath,$ConfigFlags{InstallLib}";
d504817
-         }
Jerry James 74d8a20
       }
79e44b1
       $ldflags =~ s/^\s+//; $ldflags =~ s/\s+$//; $ldflags =~ s/\s{2,}/ /g;
d5274d9
 
9e8b0d3
--- support/configure.pl.orig	2020-06-15 05:45:22.000000000 -0600
9e8b0d3
+++ support/configure.pl	2020-07-06 11:13:46.383747630 -0600
79e44b1
@@ -475,7 +475,7 @@ sub parse_command_line {
9647ad1
       }
9647ad1
    }
4ad1335
 
9647ad1
-   $CXXOPT   =$vars{CXXOPT}   // "-O3";
9647ad1
+   $CXXOPT   =$vars{CXXOPT}   // "-O2";
d5274d9
    $CXXDEBUG =$vars{CXXDEBUG} // "-g";
9647ad1
    $CFLAGS   =$vars{CFLAGS}   // "";
9647ad1
    $CXXFLAGS =$vars{CXXFLAGS} // $CFLAGS;
79e44b1
@@ -702,7 +702,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.") {
9e8b0d3
@@ -1096,10 +1096,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};
9e8b0d3
@@ -1108,10 +1104,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
    }