829f276
--- bundled/lrs/configure.pl.orig	2017-01-11 07:41:13.165154107 -0700
829f276
+++ bundled/lrs/configure.pl	2017-01-11 08:16:04.631713597 -0700
8897c67
@@ -17,14 +17,16 @@
8897c67
 
8897c67
 sub allowed_options {
8897c67
    my ($allowed_options, $allowed_with)=@_;
8897c67
-   @$allowed_with{ qw( lrs ) }=();
8897c67
+   @$allowed_with{ qw( lrs lrs-include lrs-lib) }=();
8897c67
 }
8897c67
 
8897c67
 
8897c67
 sub usage {
8897c67
    print STDERR "  --with-lrs=PATH  Installation path of lrslib, if non-standard.\n",
8897c67
                 "                   Uses the bundled lrslib (bundled/lrs/external/lrs) if it exists\n",
8897c67
-                "                   and either no path or 'bundled' is given as option.\n";
8897c67
+                "                   and either no path or 'bundled' is given as option.\n",
8897c67
+                "  --with-lrs-include=PATH  Path to the folder containing lrslib.h.  \n",
8897c67
+                "  --with-lrs-lib=PATH      Path to the folder containing liblrsgmp.{a,so,dylib} \n";
8897c67
 }
8897c67
 
8897c67
 sub check_bundled {
829f276
@@ -39,18 +41,32 @@ sub proceed {
8897c67
 
8897c67
    if (defined ($lrs_path=$options->{lrs}) and $lrs_path ne "bundled") {
8897c67
       my $lrs_inc="$lrs_path/include";
8897c67
-      my $lrs_lib=Polymake::Configure::get_libdir($lrs_path, "lrs");
8897c67
-      if (-f "$lrs_inc/lrslib.h" && -f "$lrs_lib/liblrsgmp.$Config::Config{so}" ) {
78afad8
-         $CXXflags="-I$lrs_inc";
8897c67
-      } elsif (-f "$lrs_inc/lrslib.h" && -f "$lrs_lib/liblrsgmp.a" ) {
78afad8
+      if (-f "$lrs_inc/lrslib.h") {
78afad8
          $CXXflags="-I$lrs_inc";
8897c67
-         $LDflags="-L$lrs_lib";
8897c67
-      } else {
8897c67
-         die "Invalid installation location of lrslib: header file lrslib.h and/or library liblrsgmp.$Config::Config{so} / liblrsgmp.a not found\n";
8897c67
+      } elsif (-f "$lrs_inc/lrslib/lrslib.h") {
8897c67
+         # This is for fedora where the includes are moved to a subdirectory
8897c67
+         $CXXflags = "-I$lrs_inc/lrslib";
8897c67
+      }
8897c67
+      my $lrs_lib=Polymake::Configure::get_libdir($lrs_path, "lrsgmp");
8897c67
+      if (-f "$lrs_lib/liblrsgmp.$Config::Config{so}" ) {
8897c67
+         $LDflags = "-L$lrs_lib";
829f276
+      }
829f276
+
8897c67
+      if (!$CXXflags or !$LDflags) {
8897c67
+         die "Invalid installation location of lrslib: header file lrslib.h and/or library liblrsgmp.$Config::Config{so} not found.\n",
8897c67
+             "You might try to use --with-lrs-include and --with-lrs-lib.\n";
8897c67
       }
8897c67
       $LrsCflags = $CXXflags;
8897c67
    }
8897c67
 
8897c67
+   if (defined (my $lrs_inc=$options->{'lrs-include'})) {
8897c67
+      $CXXflags="-I$lrs_inc";
8897c67
+      $cdd_path .= "include: $lrs_inc ";
8897c67
+   }
8897c67
+   if (defined ($cdd_lib=$options->{'lrs-lib'})) {
8897c67
+      $cdd_path .= "lib: $lrs_lib";
8897c67
+   }
8897c67
+
8897c67
    if ($lrs_path ne "bundled") {
8897c67
       my $error=Polymake::Configure::build_test_program(<<'---', Libs => "-llrsgmp -lgmp", CXXflags => "$CXXflags", LDflags => "$LDflags");
78afad8
 #include <cstddef>