[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323
Bernhard R. Link
brlink at debian.org
Tue Apr 24 15:55:38 UTC 2012
The following commit has been merged in the cleanedupstream branch:
commit 395205096ccfa702d528f64ba87647afdb71016f
Author: Hans Schoenemann <hannes at mathematik.uni-kl.de>
Date: Fri Apr 13 19:04:28 2012 +0200
fix: readline and different versions of it.....
diff --git a/Singular/configure b/Singular/configure
index a829a5a..d49cfee 100755
--- a/Singular/configure
+++ b/Singular/configure
@@ -607,8 +607,6 @@ PLURAL
DL_KERNEL
NEED_LIBSG
NEED_LIBS
-SING_HAVE_FLINT_FALSE
-SING_HAVE_FLINT_TRUE
FLINT_HOME
FLINT_LIBS
FLINT_CFLAGS
@@ -744,8 +742,12 @@ LDFLAGS
LIBS
CPPFLAGS
CPP
+CPPFLAGS
CXX
CXXFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
CCC
CXXCPP'
@@ -2580,6 +2582,18 @@ ac_config_headers="$ac_config_headers mod2.h"
+# Check for FLINT
+# Bradford Hovinen, 2001-06-13
+# Modified by Pascal Giorgi, 2003-12-03
+# Inspired by gnome-bonobo-check.m4 by Miguel de Icaza, 99-04-12
+# Stolen from Chris Lahey 99-2-5
+# stolen from Manish Singh again
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+
+
@@ -7791,12 +7805,6 @@ fi
if test "$with_readline" != dynamic && test "$with_readline" != no; then
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -lreadline" >&5
$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; }
if ${ac_cv_lib_readline_rl_completion_matches+:} false; then :
@@ -7822,7 +7830,7 @@ return rl_completion_matches ();
return 0;
}
_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_readline_rl_completion_matches=yes
else
ac_cv_lib_readline_rl_completion_matches=no
@@ -7834,152 +7842,53 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_rl_completion_matches" >&5
$as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; }
if test "x$ac_cv_lib_readline_rl_completion_matches" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBREADLINE 1
-_ACEOF
-
- LIBS="-lreadline $LIBS"
-
+ ac_cv_have_readline=yes
fi
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
-if test -z "$CXXCPP"; then
- if ${ac_cv_prog_CXXCPP+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for completion_matches in -lreadline" >&5
+$as_echo_n "checking for completion_matches in -lreadline... " >&6; }
+if ${ac_cv_lib_readline_completion_matches+:} false; then :
$as_echo_n "(cached) " >&6
else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lreadline $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
#endif
- Syntax error
+char completion_matches ();
+int
+main ()
+{
+return completion_matches ();
+ ;
+ return 0;
+}
_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_readline_completion_matches=yes
else
- # Broken: fails on valid input.
-continue
+ ac_cv_lib_readline_completion_matches=no
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_completion_matches" >&5
+$as_echo "$ac_cv_lib_readline_completion_matches" >&6; }
+if test "x$ac_cv_lib_readline_completion_matches" = xyes; then :
+ ac_cv_have_readline=yes
fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-for ac_header in readline/readline.h readline/history.h
+ for ac_header in readline/readline.h readline/history.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -7989,7 +7898,7 @@ fi
done
- if test "$ac_cv_lib_readline_readline" = yes && \
+ if test "$with_readline" = static && \
test "$ac_cv_header_readline_readline_h" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline.h is ok" >&5
$as_echo_n "checking whether readline.h is ok... " >&6; }
@@ -8013,7 +7922,7 @@ main ()
return 0;
}
_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_header_readline_readline_h_ok="yes"
else
ac_cv_header_readline_readline_h_ok="no"
@@ -8034,8 +7943,6 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
-extern "C"
-{
extern char * rl_readline_name;
extern char *rl_line_buffer;
char *filename_completion_function();
@@ -8047,7 +7954,6 @@ char * readline ();
void add_history ();
int write_history ();
int read_history();
-}
#ifndef NULL
#define NULL 0
#endif
@@ -8069,7 +7975,7 @@ write_history(NULL);
return 0;
}
_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_have_readline="yes"
else
@@ -8088,9 +7994,12 @@ $as_echo "$ac_cv_have_readline" >&6; }
ac_cv_have_readline="yes"
fi
fi
- if test "$ac_cv_lib_readline_rl_completion_matches" = yes; then
+ if test "$ac_cv_have_readline" = yes; then
$as_echo "#define HAVE_READLINE 1" >>confdefs.h
+ $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
+
+ LIBS="-lreadline $LIBS"
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -8111,6 +8020,7 @@ elif test "$ac_cv_lib_readline_rl_completion_matches" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
$as_echo "static" >&6; }
$as_echo "#define HAVE_READLINE 1" >>confdefs.h
+
elif test "$ac_cv_singuname" = PowerMacintosh-darwin; then
as_fn_error $? "building without readline impossible on PowerMacintosh-darwin" "$LINENO" 5
else
@@ -8495,7 +8405,141 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
- for ac_header in boost/dynamic_bitset.hpp
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+ if ${ac_cv_prog_CXXCPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+for ac_header in boost/dynamic_bitset.hpp
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "boost/dynamic_bitset.hpp" "ac_cv_header_boost_dynamic_bitset_hpp" "$ac_includes_default"
if test "x$ac_cv_header_boost_dynamic_bitset_hpp" = xyes; then :
@@ -8861,15 +8905,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
- if test "x$HAVE_FLINT" = "xyes"; then
- SING_HAVE_FLINT_TRUE=
- SING_HAVE_FLINT_FALSE='#'
-else
- SING_HAVE_FLINT_TRUE='#'
- SING_HAVE_FLINT_FALSE=
-fi
-
-
CFLAGS=${BACKUP_CFLAGS}
LIBS=${BACKUP_LIBS}
#unset LD_LIBRARY_PATH
@@ -9186,10 +9221,6 @@ LTLIBOBJS=$ac_ltlibobjs
-if test -z "${SING_HAVE_FLINT_TRUE}" && test -z "${SING_HAVE_FLINT_FALSE}"; then
- as_fn_error $? "conditional \"SING_HAVE_FLINT\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
diff --git a/Singular/configure.in b/Singular/configure.in
index f397b48..5a61911 100644
--- a/Singular/configure.in
+++ b/Singular/configure.in
@@ -3,6 +3,129 @@ AC_INIT(tesths.cc)
AC_CONFIG_HEADER(mod2.h)
AC_CONFIG_MACRO_DIR(../factory)
+# Check for FLINT
+# Bradford Hovinen, 2001-06-13
+# Modified by Pascal Giorgi, 2003-12-03
+# Inspired by gnome-bonobo-check.m4 by Miguel de Icaza, 99-04-12
+# Stolen from Chris Lahey 99-2-5
+# stolen from Manish Singh again
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl LB_CHECK_FLINT ([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl
+dnl Test for FLINT and define
+dnl FLINT_CFLAGS and FLINT_LIBS
+
+AC_DEFUN([LB_CHECK_FLINT],
+[
+DEFAULT_CHECKING_PATH="/usr /usr/local /sw /opt/local"
+
+AC_ARG_WITH(flint,
+[ --with-flint=<path>|yes|no Use FLINT library. If argument is no, you do not have
+ the library installed on your machine (set as
+ default). If argument is yes or <empty> that means
+ the library is reachable with the standard search
+ path (/usr or /usr/local). Otherwise you give the
+ <path> to the directory which contain the library.
+ ],
+ [if test "$withval" = yes ; then
+ FLINT_HOME_PATH="${DEFAULT_CHECKING_PATH}"
+ elif test "$withval" != no ; then
+ FLINT_HOME_PATH="$withval"
+ fi],
+ [FLINT_HOME_PATH="${DEFAULT_CHECKING_PATH}"])
+
+min_flint_version=ifelse([$1], ,2.3,$1)
+
+
+dnl Check for existence
+BACKUP_CFLAGS=${CFLAGS}
+BACKUP_LIBS=${LIBS}
+
+AC_LANG_PUSH(C)
+
+if test -n "$FLINT_HOME_PATH"; then
+AC_MSG_CHECKING(for FLINT >= $min_flint_version)
+fi
+
+for FLINT_HOME in ${FLINT_HOME_PATH}
+ do
+if test -r "$FLINT_HOME/include/fmpz.h"; then
+
+ if test "x$FLINT_HOME" != "x/usr"; then
+ FLINT_CFLAGS="-I${FLINT_HOME}/include"
+ FLINT_LIBS="-L${FLINT_HOME}/lib -lflint -lmpfr -lmpir"
+ else
+ FLINT_CFLAGS=
+ FLINT_LIBS="-lflint"
+ fi
+ CFLAGS="${BACKUP_CFLAGS} ${FLINT_CFLAGS}"
+ LIBS="${BACKUP_LIBS} ${FLINT_LIBS}"
+
+ AC_TRY_LINK(
+ [#include <fmpz.h>],
+ [fmpz_t a; fmpz_init (a);],
+ [
+ AC_TRY_RUN(
+ [#include <flint.h>
+ int main () { if ((int) version[0] < 2) return -1; else return 0; }
+ ],[
+ flint_found="yes"
+ break
+ ],[
+ flint_problem="$problem $FLINT_HOME"
+ unset FLINT_CFLAGS
+ unset FLINT_LIBS
+ ],[
+ flint_found="yes"
+ flint_cross="yes"
+ break
+ ])
+ ],
+ [
+ flint_found="no"
+ flint_checked="$checked $FLINT_HOME"
+ unset FLINT_CFLAGS
+ unset FLINT_LIBS
+ ])
+else
+ flint_found="no"
+fi
+done
+
+if test "x$flint_found" = "xyes" ; then
+ AC_SUBST(FLINT_CFLAGS)
+ AC_SUBST(FLINT_LIBS)
+ AC_SUBST(FLINT_HOME)
+ AC_DEFINE(HAVE_FLINT,1,[Define if FLINT is installed])
+ HAVE_FLINT=yes
+ if test "x$flint_cross" != "xyes"; then
+ AC_MSG_RESULT(found)
+ else
+ AC_MSG_RESULT(unknown)
+ echo "WARNING: You appear to be cross compiling, so there is no way to determine"
+ echo "whether your FLINT version is new enough. I am assuming it is."
+ fi
+ ifelse([$2], , :, [$2])
+elif test -n "$flint_problem"; then
+ AC_MSG_RESULT(problem)
+ echo "Sorry, your FLINT version is too old. Disabling."
+ ifelse([$3], , :, [$3])
+elif test "x$flint_found" = "xno"; then
+ AC_MSG_RESULT(not found)
+ ifelse([$3], , :, [$3])
+fi
+
+AC_LANG_POP
+
+CFLAGS=${BACKUP_CFLAGS}
+LIBS=${BACKUP_LIBS}
+#unset LD_LIBRARY_PATH
+
+])
+
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl check for python (see AC_PYTHON_DEVEL in newer autoconf versions)
dnl
@@ -1016,10 +1139,10 @@ fi
if test "$with_readline" != dynamic && test "$with_readline" != no; then
AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
- AC_CHECK_LIB(readline, rl_completion_matches)
+ AC_CHECK_LIB(readline, rl_completion_matches,ac_cv_have_readline=yes)
+ AC_CHECK_LIB(readline, completion_matches,ac_cv_have_readline=yes)
AC_CHECK_HEADERS(readline/readline.h readline/history.h)
- if test "$ac_cv_lib_readline_readline" = yes && \
+ if test "$with_readline" = static && \
test "$ac_cv_header_readline_readline_h" = yes; then
AC_MSG_CHECKING(whether readline.h is ok)
AC_CACHE_VAL(ac_cv_header_readline_readline_h_ok,
@@ -1042,8 +1165,6 @@ ac_cv_header_readline_readline_h_ok="no",
AC_CACHE_VAL(ac_cv_have_readline,
AC_TRY_LINK(
#include <stdio.h>
-extern "C"
-{
extern char * rl_readline_name;
extern char *rl_line_buffer;
char *filename_completion_function();
@@ -1055,7 +1176,6 @@ char * readline ();
void add_history ();
int write_history ();
int read_history();
-}
#ifndef NULL
#define NULL 0
#endif
@@ -1080,8 +1200,10 @@ ac_cv_have_readline="no"
ac_cv_have_readline="yes"
fi
fi
- if test "$ac_cv_lib_readline_rl_completion_matches" = yes; then
+ if test "$ac_cv_have_readline" = yes; then
AC_DEFINE(HAVE_READLINE)
+ AC_DEFINE(HAVE_LIBREADLINE)
+ LIBS="-lreadline $LIBS"
fi
AC_LANG_RESTORE
fi
--
an open source computer algebra system
More information about the debian-science-commits
mailing list