1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
|
Description: update AC_FIND_GAP m4 macro
Import m4/ac_find_gap.m4 from the gap-io GitHub git repository
and add material to find the GAP command-line interface wrt
the adopted style and customary naminf scheme.
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2014-08-19
--- a/m4/ac_find_gap.m4
+++ b/m4/ac_find_gap.m4
@@ -6,7 +6,7 @@
AC_DEFUN([AC_FIND_GAP],
[
AC_LANG_PUSH([C])
-
+
# Make sure CDPATH is portably set to a sensible value
CDPATH=${ZSH_VERSION+.}:
@@ -19,31 +19,27 @@
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`
@@ -52,12 +48,12 @@
break
fi
done
-
+
if test "x$havesysinfo" = "x1"; then
AC_MSG_RESULT([${GAPROOT}])
else
AC_MSG_RESULT([Not found])
-
+
echo ""
echo "********************************************************************"
echo " ERROR"
@@ -70,13 +66,13 @@
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
@@ -84,11 +80,11 @@
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 "********************************************************************"
@@ -102,17 +98,11 @@
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
@@ -145,7 +135,7 @@
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>"
@@ -153,31 +143,39 @@
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
+ fi;
- GMP_WITH="--with-gmp=$GMP_ROOT"
- 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_SUBST(GMP_WITH)
+
AC_LANG_POP([C])
+
+ ###############################################
+ # Now check for the GAP command-line interface
+
+ CGAPPATH=$PATH
+ AC_PATH_PROG([CGAP],[gap$SHEXT],Unknown,[$CGAPPATH])
+ if test "x$CGAP" = "xUnknown" ; then
+ echo ""
+ echo "********************************************************************"
+ echo " ERROR"
+ echo ""
+ echo " Failed to find the GAP command-line interface in the list of"
+ echo " paths $CGAPPATH"
+ echo "********************************************************************"
+ echo ""
+ AC_MSG_ERROR([Unable to find GAP command-line interface])
+ fi
+
])
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -13,7 +13,7 @@
doc: manual.six
manual.six: float.xml float.bib
- cd $(top_srcdir) && echo 'LoadPackage("float"); DOC@FLOAT();' | $(GAP_EXEC) -A -q -T
+ cd $(top_srcdir) && echo 'LoadPackage("float"); DOC@FLOAT();' | $(CGAP) -A -q -T
distclean-local:
rm -f chap*.txt chap*.html index.html chooser.html
|