Skip to content

Commit

Permalink
Fixed detection of gap-system on configure
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentbartholdi committed Feb 23, 2016
1 parent 97aebf5 commit 22db8e0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 83 deletions.
4 changes: 2 additions & 2 deletions cnf/aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
# generated automatically by aclocal 1.15 -*- Autoconf -*-

# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.

# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down
6 changes: 1 addition & 5 deletions cnf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ fi
mkdir -p bin/$GAPARCH
CONFIG_STATUS=bin/$GAPARCH/config.status

AC_CONFIG_FILES([$GAP_MAKEFILE:cnf/Makefile.in bin/$GAPARCH/files.g:cnf/files.g.in])

if test "$GAP_MAKEFILE" != Makefile; then
ln -sf "$GAP_MAKEFILE" Makefile
fi
AC_CONFIG_FILES([Makefile:cnf/Makefile.in bin/$GAPARCH/files.g:cnf/files.g.in])

AC_OUTPUT
6 changes: 3 additions & 3 deletions cnf/files.g.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
EXEC@FR.dot := "@DOT@";
EXEC@FR.psviewer := "@PSVIEWER@";
EXEC@FR.svgviewer := "@SVGVIEWER@";
EXEC@fr.dot := "@DOT@";
EXEC@fr.psviewer := "@PSVIEWER@";
EXEC@fr.svgviewer := "@SVGVIEWER@";
63 changes: 22 additions & 41 deletions cnf/m4/ac_find_gap.m4
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Find the location of GAP
# Sets GAPROOT, GAPARCH and GAP_CPPFLAGS appropriately
# Can be configured using --with-gaproot=... and --with-configname=...
# Can be configured using --with-gaproot=... and CONFIGNAME=...
#######################################################################

AC_DEFUN([AC_FIND_GAP],
[
AC_LANG_PUSH([C])
# Make sure CDPATH is portably set to a sensible value
CDPATH=${ZSH_VERSION+.}:
Expand All @@ -19,31 +19,27 @@ AC_DEFUN([AC_FIND_GAP],
variable empty for GAP versions < 4.5.])
if test "x$CONFIGNAME" = "x"; then
SYSINFO="sysinfo.gap"
GAP_MAKEFILE="Makefile"
GAP_EXEC="gap.sh"
AC_MSG_RESULT([none])
else
SYSINFO="sysinfo.gap-$CONFIGNAME"
GAP_MAKEFILE="Makefile-$CONFIGNAME"
GAP_EXEC="gap-$CONFIGNAME.sh"
AC_MSG_RESULT([$CONFIGNAME])
fi
######################################
# Find the GAP root directory by
# checking for the sysinfo.gap file
# Find the GAP root directory by
# checking for the sysinfo.gap file
AC_MSG_CHECKING([for GAP root directory])
DEFAULT_GAPROOTS="../.. /usr/local/src/gap /usr/local/gap4r5"
DEFAULT_GAPROOTS="../.."
#Allow the user to specify the location of GAP
#
AC_ARG_WITH(gaproot,
AC_ARG_WITH(gaproot,
[AC_HELP_STRING([--with-gaproot=<path>], [specify root of GAP installation])],
[DEFAULT_GAPROOTS="$withval"])
havesysinfo=0
# Otherwise try likely directories
for GAPROOT in ${DEFAULT_GAPROOTS}
for GAPROOT in ${DEFAULT_GAPROOTS}
do
# Convert the path to absolute
GAPROOT=`cd $GAPROOT > /dev/null 2>&1 && pwd`
Expand All @@ -52,12 +48,12 @@ AC_DEFUN([AC_FIND_GAP],
break
fi
done
if test "x$havesysinfo" = "x1"; then
AC_MSG_RESULT([${GAPROOT}])
else
AC_MSG_RESULT([Not found])
echo ""
echo "********************************************************************"
echo " ERROR"
Expand All @@ -70,25 +66,25 @@ AC_DEFUN([AC_FIND_GAP],
echo " src/ and bin/."
echo "********************************************************************"
echo ""
AC_MSG_ERROR([Unable to find GAP root directory])
fi
#####################################
# Now find the architecture
AC_MSG_CHECKING([for GAP architecture])
GAPARCH="Unknown"
. $GAPROOT/$SYSINFO
if test "x$GAParch" != "x"; then
GAPARCH=$GAParch
fi
AC_ARG_WITH(gaparch,
AC_ARG_WITH(gaparch,
[AC_HELP_STRING([--with-gaparch=<path>], [override GAP architecture string])],
[GAPARCH=$withval])
AC_MSG_RESULT([${GAPARCH}])
if test "x$GAPARCH" = "xUnknown" -o ! -d $GAPROOT/bin/$GAPARCH ; then
echo ""
echo "********************************************************************"
Expand All @@ -102,17 +98,11 @@ AC_DEFUN([AC_FIND_GAP],
echo " GAP installation."
echo "********************************************************************"
echo ""
AC_MSG_ERROR([Unable to find plausible GAParch information.])
fi
GAPARCH_SYSTEM_GUESS="`$ac_aux_dir/config.guess`-$CC-`echo $GAPARCH | sed 's/.*-//'`"
if test "$GAPARCH_SYSTEM_GUESS" != "$GAParch_system"; then
echo "********************************************************************"
AC_WARN([The guessed target $GAPARCH_SYSTEM_GUESS is not the gap target $GAParch_system. Cross your fingers])
echo "********************************************************************"
AC_MSG_ERROR([Unable to find plausible GAParch information.])
fi
#####################################
# Now check for the GAP header files
Expand Down Expand Up @@ -145,38 +135,29 @@ AC_DEFUN([AC_FIND_GAP],
echo " in particular the files"
echo " <gaproot>/sysinfo.gap"
echo " <gaproot>/src/<includes>"
echo " and <gaproot>/bin/<architecture>/bin/config.h."
echo " and <gaproot>/bin/<architecture>/bin/config.h."
echo " Please make sure that your GAP root directory structure"
echo " conforms to this layout, or give the correct GAP root using"
echo " --with-gaproot=<path>"
echo "********************************************************************"
echo ""
AC_MSG_ERROR([Unable to find GAP include files in /src subdirectory])
fi
ARCHPATH=$GAPROOT/bin/$GAPARCH
GAP_CPPFLAGS="-I$GAPROOT -I$ARCHPATH"
AC_MSG_CHECKING([for GAP's gmp.h location])
if test -r "$ARCHPATH/extern/gmp/include/gmp.h"; then
GAP_CPPFLAGS="$GAP_CPPFLAGS -I$ARCHPATH/extern/gmp/include"
GMP_ROOT="$ARCHPATH/extern/gmp"
AC_MSG_RESULT([$ARCHPATH/extern/gmp/include/gmp.h])
elif `grep -q 'define USE_GMP 1' $ARCHPATH/config.h`; then
eval `grep '^GMP_CFLAGS=' $GAPROOT/$GAP_MAKEFILE`
GAP_CPPFLAGS="$GAP_CPPFLAGS $GMP_CFLAGS"
GMP_ROOT=`echo "$GMP_CFLAGS" | cut -c3- | sed 's,/include$,,'`
AC_MSG_RESULT([$GMP_ROOT/include/gmp.h])
else
AC_MSG_RESULT([not found, GAP was compiled without GMP])
fi
AC_MSG_RESULT([not found, GAP was compiled without its own GMP])
fi;
GAP_EXEC="$GAPROOT/bin/$GAP_EXEC"
AC_SUBST(GAPARCH)
AC_SUBST(GAPROOT)
AC_SUBST(GAP_CPPFLAGS)
AC_SUBST(GAP_EXEC)
AC_SUBST(GMP_ROOT)
AC_LANG_POP([C])
])
36 changes: 4 additions & 32 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,6 @@ LIBOBJS
SVGVIEWER
PSVIEWER
DOT
GMP_ROOT
GAP_EXEC
GAP_CPPFLAGS
GAPROOT
GAPARCH
Expand Down Expand Up @@ -1716,11 +1714,9 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
#AC_CONFIG_MACRO_DIR([cnf/m4])
# Locates GAP
#AC_PROG_CC
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
Expand All @@ -1740,14 +1736,10 @@ $as_echo_n "checking for CONFIGNAME... " >&6; }
if test "x$CONFIGNAME" = "x"; then
SYSINFO="sysinfo.gap"
GAP_MAKEFILE="Makefile"
GAP_EXEC="gap.sh"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
else
SYSINFO="sysinfo.gap-$CONFIGNAME"
GAP_MAKEFILE="Makefile-$CONFIGNAME"
GAP_EXEC="gap-$CONFIGNAME.sh"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONFIGNAME" >&5
$as_echo "$CONFIGNAME" >&6; }
fi
Expand All @@ -1757,7 +1749,7 @@ $as_echo "$CONFIGNAME" >&6; }
# checking for the sysinfo.gap file
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GAP root directory" >&5
$as_echo_n "checking for GAP root directory... " >&6; }
DEFAULT_GAPROOTS="../.. /usr/local/src/gap /usr/local/gap4r5"
DEFAULT_GAPROOTS="../.."
#Allow the user to specify the location of GAP
#
Expand Down Expand Up @@ -1840,13 +1832,6 @@ $as_echo "${GAPARCH}" >&6; }
as_fn_error $? "Unable to find plausible GAParch information." "$LINENO" 5
fi
GAPARCH_SYSTEM_GUESS="`$ac_aux_dir/config.guess`-$CC-`echo $GAPARCH | sed 's/.*-//'`"
if test "$GAPARCH_SYSTEM_GUESS" != "$GAParch_system"; then
echo "********************************************************************"
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The guessed target $GAPARCH_SYSTEM_GUESS is not the gap target $GAParch_system. Cross your fingers" >&5
$as_echo "$as_me: WARNING: The guessed target $GAPARCH_SYSTEM_GUESS is not the gap target $GAParch_system. Cross your fingers" >&2;}
echo "********************************************************************"
fi
#####################################
# Now check for the GAP header files
Expand Down Expand Up @@ -1902,22 +1887,12 @@ $as_echo "Not found" >&6; }
$as_echo_n "checking for GAP's gmp.h location... " >&6; }
if test -r "$ARCHPATH/extern/gmp/include/gmp.h"; then
GAP_CPPFLAGS="$GAP_CPPFLAGS -I$ARCHPATH/extern/gmp/include"
GMP_ROOT="$ARCHPATH/extern/gmp"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ARCHPATH/extern/gmp/include/gmp.h" >&5
$as_echo "$ARCHPATH/extern/gmp/include/gmp.h" >&6; }
elif `grep -q 'define USE_GMP 1' $ARCHPATH/config.h`; then
eval `grep '^GMP_CFLAGS=' $GAPROOT/$GAP_MAKEFILE`
GAP_CPPFLAGS="$GAP_CPPFLAGS $GMP_CFLAGS"
GMP_ROOT=`echo "$GMP_CFLAGS" | cut -c3- | sed 's,/include$,,'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMP_ROOT/include/gmp.h" >&5
$as_echo "$GMP_ROOT/include/gmp.h" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found, GAP was compiled without GMP" >&5
$as_echo "not found, GAP was compiled without GMP" >&6; }
fi
GAP_EXEC="$GAPROOT/bin/$GAP_EXEC"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found, GAP was compiled without its own GMP" >&5
$as_echo "not found, GAP was compiled without its own GMP" >&6; }
fi;
Expand All @@ -1931,9 +1906,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#AC_SYS_IS_CYGWIN
#AC_SYS_IS_DARWIN
################################################################
# external programs configuration
Expand Down

0 comments on commit 22db8e0

Please sign in to comment.