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