* Fixing bug 159235: undefined GMP symbols

- I don't know if this is the best solution, but it seems like a
    working hack.
This commit is contained in:
Abdulaziz Ghuloum 2007-11-07 13:05:31 -05:00
parent dd5896761f
commit 800eb3b732
4 changed files with 216 additions and 104 deletions

View File

@ -101,16 +101,16 @@ INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
LDFLAGS = -L/opt/local/lib
LIBOBJS = lstat$U.o
LIBS = -lgmp
LIBS = -lgmp -lgmp
LTLIBOBJS = lstat$U.lo
MAKEINFO = ${SHELL} /Users/ikarus/Work/ikarus-scheme/missing --run makeinfo
OBJEXT = o
PACKAGE = ikarus
PACKAGE_BUGREPORT = aghuloum@cs.indiana.edu
PACKAGE_NAME = ikarus
PACKAGE_STRING = ikarus prerelease-0
PACKAGE_STRING = ikarus 0.0.1
PACKAGE_TARNAME = ikarus
PACKAGE_VERSION = prerelease-0
PACKAGE_VERSION = 0.0.1
PATH_SEPARATOR = :
POW_LIB =
SET_MAKE =

View File

@ -134,13 +134,13 @@
#define PACKAGE_NAME "ikarus"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "ikarus prerelease-0"
#define PACKAGE_STRING "ikarus 0.0.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "ikarus"
/* Define to the version of this package. */
#define PACKAGE_VERSION "prerelease-0"
#define PACKAGE_VERSION "0.0.1"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

282
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for ikarus prerelease-0.
# Generated by GNU Autoconf 2.59 for ikarus 0.0.1.
#
# Report bugs to <aghuloum@cs.indiana.edu>.
#
@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='ikarus'
PACKAGE_TARNAME='ikarus'
PACKAGE_VERSION='prerelease-0'
PACKAGE_STRING='ikarus prerelease-0'
PACKAGE_VERSION='0.0.1'
PACKAGE_STRING='ikarus 0.0.1'
PACKAGE_BUGREPORT='aghuloum@cs.indiana.edu'
ac_unique_file="src/"
@ -788,7 +788,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures ikarus prerelease-0 to adapt to many kinds of systems.
\`configure' configures ikarus 0.0.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -855,7 +855,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of ikarus prerelease-0:";;
short | recursive ) echo "Configuration of ikarus 0.0.1:";;
esac
cat <<\_ACEOF
@ -975,7 +975,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
ikarus configure prerelease-0
ikarus configure 0.0.1
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@ -989,7 +989,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ikarus $as_me prerelease-0, which was
It was created by ikarus $as_me 0.0.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@ -3811,89 +3811,6 @@ case "$target_os" in
# Checks for libraries.
echo "$as_me:$LINENO: checking for main in -lgmp" >&5
echo $ECHO_N "checking for main in -lgmp... $ECHO_C" >&6
if test "${ac_cv_lib_gmp_main+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgmp $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
main ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_gmp_main=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_gmp_main=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gmp_main" >&5
echo "${ECHO_T}$ac_cv_lib_gmp_main" >&6
if test $ac_cv_lib_gmp_main = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGMP 1
_ACEOF
LIBS="-lgmp $LIBS"
else
{ { echo "$as_me:$LINENO: error:
ERROR: Cannot find libgmp.
ERROR: You might want to supply CFLAGS=-I</path/to/include> (containing
ERROR: the gmp.h header file), and LDFLAGS=-L</path/to/lib> (containing
ERROR: libgmp.so) if libgmp is installed in a non-standard location.
ERROR: libgmp can be obtained from <http://gmplib.org>. " >&5
echo "$as_me: error:
ERROR: Cannot find libgmp.
ERROR: You might want to supply CFLAGS=-I</path/to/include> (containing
ERROR: the gmp.h header file), and LDFLAGS=-L</path/to/lib> (containing
ERROR: libgmp.so) if libgmp is installed in a non-standard location.
ERROR: libgmp can be obtained from <http://gmplib.org>. " >&2;}
{ (exit 1); exit 1; }; }
fi
ac_cv_lib_gmp=ac_cv_lib_gmp_main
echo "$as_me:$LINENO: checking for library containing dlsym" >&5
echo $ECHO_N "checking for library containing dlsym... $ECHO_C" >&6
if test "${ac_cv_search_dlsym+set}" = set; then
@ -5042,6 +4959,187 @@ fi
done
# check that gmp is present
echo "$as_me:$LINENO: checking for main in -lgmp" >&5
echo $ECHO_N "checking for main in -lgmp... $ECHO_C" >&6
if test "${ac_cv_lib_gmp_main+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgmp $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
main ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_gmp_main=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_gmp_main=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gmp_main" >&5
echo "${ECHO_T}$ac_cv_lib_gmp_main" >&6
if test $ac_cv_lib_gmp_main = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGMP 1
_ACEOF
LIBS="-lgmp $LIBS"
else
{ { echo "$as_me:$LINENO: error:
ERROR: Cannot find libgmp.
ERROR: You might want to supply CFLAGS=-I</path/to/include> (containing
ERROR: the gmp.h header file), and LDFLAGS=-L</path/to/lib> (containing
ERROR: libgmp.so) if libgmp is installed in a non-standard location.
ERROR: libgmp can be obtained from <http://gmplib.org>. " >&5
echo "$as_me: error:
ERROR: Cannot find libgmp.
ERROR: You might want to supply CFLAGS=-I</path/to/include> (containing
ERROR: the gmp.h header file), and LDFLAGS=-L</path/to/lib> (containing
ERROR: libgmp.so) if libgmp is installed in a non-standard location.
ERROR: libgmp can be obtained from <http://gmplib.org>. " >&2;}
{ (exit 1); exit 1; }; }
fi
ac_cv_lib_gmp=ac_cv_lib_gmp_main
# check that gmp exports mpn_mul
# unfortunately, gmp.h defines mpn_mul as a macro
# that expands to __gmpn_mul on my machine.
echo "$as_me:$LINENO: checking for __gmpn_mul in -lgmp" >&5
echo $ECHO_N "checking for __gmpn_mul in -lgmp... $ECHO_C" >&6
if test "${ac_cv_lib_gmp___gmpn_mul+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgmp $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char __gmpn_mul ();
int
main ()
{
__gmpn_mul ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_gmp___gmpn_mul=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_gmp___gmpn_mul=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gmp___gmpn_mul" >&5
echo "${ECHO_T}$ac_cv_lib_gmp___gmpn_mul" >&6
if test $ac_cv_lib_gmp___gmpn_mul = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGMP 1
_ACEOF
LIBS="-lgmp $LIBS"
else
{ { echo "$as_me:$LINENO: error:
ERROR: your version of libgmp does not contain a binding for
ERROR: some of the primitives that ikarus uses. This is most
ERROR: likely to happen if your version of gmp was compiled
ERROR: in 64-bit mode, while ikarus expects needs the 32-bit
ERROR: version. Refer to the following bug report for details
https://bugs.launchpad.net/ikarus/+bug/159235
" >&5
echo "$as_me: error:
ERROR: your version of libgmp does not contain a binding for
ERROR: some of the primitives that ikarus uses. This is most
ERROR: likely to happen if your version of gmp was compiled
ERROR: in 64-bit mode, while ikarus expects needs the 32-bit
ERROR: version. Refer to the following bug report for details
https://bugs.launchpad.net/ikarus/+bug/159235
" >&2;}
{ (exit 1); exit 1; }; }
fi
# Checks for typedefs, structures, and compiler characteristics.
echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
@ -7834,7 +7932,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by ikarus $as_me prerelease-0, which was
This file was extended by ikarus $as_me 0.0.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -7897,7 +7995,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
ikarus config.status prerelease-0
ikarus config.status 0.0.1
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

View File

@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(ikarus, prerelease-0, aghuloum@cs.indiana.edu)
AC_INIT(ikarus, 0.0.1, aghuloum@cs.indiana.edu)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(ikarus, 0.0.1)
AC_CONFIG_SRCDIR([src/])
@ -24,12 +24,6 @@ case "$target_os" in
esac
# Checks for libraries.
AC_HAVE_LIBRARY([gmp],,[AC_MSG_ERROR([
ERROR: Cannot find libgmp.
ERROR: You might want to supply CFLAGS=-I</path/to/include> (containing
ERROR: the gmp.h header file), and LDFLAGS=-L</path/to/lib> (containing
ERROR: libgmp.so) if libgmp is installed in a non-standard location.
ERROR: libgmp can be obtained from <http://gmplib.org>. ])])
AC_SEARCH_LIBS(dlsym, dl,, [AC_MSG_ERROR([Cannot find libdl])])
AC_SEARCH_LIBS(cos, m,, [AC_MSG_ERROR([Cannot find libm])])
@ -45,6 +39,26 @@ AC_CHECK_HEADERS([assert.h dlfcn.h errno.h fcntl.h signal.h \
sys/time.h sys/types.h sys/wait.h time.h \
unistd.h])
# check that gmp is present
AC_HAVE_LIBRARY([gmp],,[AC_MSG_ERROR([
ERROR: Cannot find libgmp.
ERROR: You might want to supply CFLAGS=-I</path/to/include> (containing
ERROR: the gmp.h header file), and LDFLAGS=-L</path/to/lib> (containing
ERROR: libgmp.so) if libgmp is installed in a non-standard location.
ERROR: libgmp can be obtained from <http://gmplib.org>. ])])
# check that gmp exports mpn_mul
# unfortunately, gmp.h defines mpn_mul as a macro
# that expands to __gmpn_mul on my machine.
AC_CHECK_LIB(gmp,__gmpn_mul,,[AC_MSG_ERROR([
ERROR: your version of libgmp does not contain a binding for
ERROR: some of the primitives that ikarus uses. This is most
ERROR: likely to happen if your version of gmp was compiled
ERROR: in 64-bit mode, while ikarus expects needs the 32-bit
ERROR: version. Refer to the following bug report for details
https://bugs.launchpad.net/ikarus/+bug/159235
])])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST