summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-02-28 22:44:19 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-02-28 22:44:19 +0000
commitc0daa0df39fcb3be58fba09bb936f515368b085e (patch)
tree2e34f6ff45835a1575bb81690a45f1c4f7e4207a /configure.ac
parent16ccc49aedb2f5edc29d4d0c70a84d8fc06f78c2 (diff)
downloadclasspath-c0daa0df39fcb3be58fba09bb936f515368b085e.tar.gz
2008-02-28 Andrew John Hughes <gnu_andrew@member.fsf.org>
PR classpath/28664 * include/Makefile.am: Add generation of header file java_math_VMBigInteger.h * java/math/BigInteger.java: Separate NativeMPI into VMBigInteger. * native/jni/Makefile.am: Add java-math. * native/jni/java-math/java_math_VMBigInteger.c: Renamed from java_math_BigInteger.c. * vm/reference/java/math/VMBigInteger.java: Former NativeMPI class from java.math.BigInteger. 2006-11-28 Raif S. Naffah <classpath@naffah-raif.name> Jeroen Frijters <jeroen@sumatra.nl> PR classpath/28664 * configure.ac: Add support for configuring GNU MP. * native/jni/Makefile.am: Include java-math directory if required. * native/jni/java-math/.cvsignore: New file. * native/jni/java-math/Makefile.am: Likewise. * native/jni/java-math/java_math_BigInteger.c: Likewise. * java/math/BigInteger.java: Added support for native methods. * gnu/classpath/Configuration.java.in (WANT_NATIVE_BIG_INTEGER): New field.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac53
1 files changed, 53 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 50d4f497d..dbca5d80f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -246,6 +246,19 @@ AC_ARG_ENABLE([plugin],
AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
dnl -----------------------------------------------------------
+dnl Native java.math.BigInteger (enabled by default)
+dnl -----------------------------------------------------------
+AC_ARG_ENABLE([gmp],
+ [AS_HELP_STRING(--enable-gmp,
+ compile native java.math.BigInteger library (disabled by --disable-gmp) [default=yes])],
+ [case "${enableval}" in
+ yes|true) COMPILE_GMP=yes ;;
+ no|false) COMPILE_GMP=no ;;
+ *) COMPILE_GMP=yes ;;
+ esac],
+ [COMPILE_GMP=yes])
+
+dnl -----------------------------------------------------------
dnl Sets the native libraries installation dir
dnl -----------------------------------------------------------
AC_ARG_WITH([native-libdir],
@@ -697,6 +710,26 @@ if test "x${COMPILE_JNI}" = xyes; then
AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
fi
+
+ dnl Check for GNU MP library and header file
+ dnl for GNU MP versions >= 4.2 use __gmpz_combit; otherwise look for
+ dnl __gmpz_mul_si for earlier versions (>= 3.1).
+ dnl IMPORTANT: if you decide to look for __gmpz_combit, don't forget to
+ dnl change the name of the corresponding ac_ variable on lines 860...
+ if test "x${COMPILE_GMP}" = xyes; then
+ AC_CHECK_LIB(gmp, __gmpz_mul_si,
+ [GMP_CFLAGS=-I/usr/include
+ GMP_LIBS=-lgmp ],
+ [GMP_CFLAGS=
+ GMP_LIBS= ])
+ AC_SUBST(GMP_CFLAGS)
+ AC_SUBST(GMP_LIBS)
+
+ AC_CHECK_HEADERS([gmp.h])
+ fi
+
+else
+ COMPILE_GMP=no
fi
if test "x${REGENERATE_JNI_HEADERS}" = xyes; then
@@ -938,6 +971,25 @@ dnl -----------------------------------------------------------
AC_SUBST(DEFAULT_PREFS_PEER)
dnl -----------------------------------------------------------
+dnl Set GNU MP related params
+dnl -----------------------------------------------------------
+WANT_NATIVE_BIG_INTEGER=false
+if test "x${COMPILE_GMP}" = xyes; then
+ if test "x${ac_cv_lib_gmp___gmpz_mul_si}" = xyes; then
+ if test "x${ac_cv_header_gmp_h}" = xyes; then
+ WANT_NATIVE_BIG_INTEGER=true
+ AC_DEFINE(WITH_GNU_MP, 1, [Define to 1 if gmp is usable])
+ else
+ COMPILE_GMP=no
+ fi
+ else
+ COMPILE_GMP=no
+ fi
+fi
+AC_SUBST(WANT_NATIVE_BIG_INTEGER)
+AM_CONDITIONAL(CREATE_GMPBI_LIBRARY, test "x${COMPILE_GMP}" = xyes)
+
+dnl -----------------------------------------------------------
dnl output files
dnl -----------------------------------------------------------
AC_CONFIG_FILES([Makefile
@@ -958,6 +1010,7 @@ native/jni/Makefile
native/jni/classpath/Makefile
native/jni/java-io/Makefile
native/jni/java-lang/Makefile
+native/jni/java-math/Makefile
native/jni/java-net/Makefile
native/jni/java-nio/Makefile
native/jni/java-util/Makefile