summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-04-06 20:41:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-04-06 20:41:21 (GMT)
commit4865914200b6c412220d621f3cce4f355ad38554 (patch)
tree76d6405fee06a522e3177592647fc657870fd21e /unix
parent889e874282cb68715c4fa329df827d6fe0ebc84d (diff)
parent00c94ffc5dfad15395a32fc93d6d171aa4b47759 (diff)
downloadtcl-4865914200b6c412220d621f3cce4f355ad38554.zip
tcl-4865914200b6c412220d621f3cce4f355ad38554.tar.gz
tcl-4865914200b6c412220d621f3cce4f355ad38554.tar.bz2
Merge 8.7. Add checks for libtommath library to configure script (experimental)
Diffstat (limited to 'unix')
-rwxr-xr-xunix/configure112
-rw-r--r--unix/configure.ac17
2 files changed, 128 insertions, 1 deletions
diff --git a/unix/configure b/unix/configure
index ea26c4f..8dc11f5 100755
--- a/unix/configure
+++ b/unix/configure
@@ -705,6 +705,9 @@ TCL_LIBS
LIBOBJS
AR
RANLIB
+LIBTOMMATH_INCLUDE
+LIBTOMMATH_SRCS
+LIBTOMMATH_OBJS
ZLIB_INCLUDE
ZLIB_SRCS
ZLIB_OBJS
@@ -740,6 +743,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -828,6 +832,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1080,6 +1085,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1217,7 +1231,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1370,6 +1384,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -4657,6 +4672,101 @@ fi
$as_echo "#define HAVE_ZLIB 1" >>confdefs.h
+#------------------------------------------------------------------------
+# Add stuff for libtommath
+
+libtommath_ok=yes
+ac_fn_c_check_header_mongrel "$LINENO" "tommath.h" "ac_cv_header_tommath_h" "$ac_includes_default"
+if test "x$ac_cv_header_tommath_h" = xyes; then :
+
+ ac_fn_c_check_type "$LINENO" "mp_int" "ac_cv_type_mp_int" "#include <tommath.h>
+"
+if test "x$ac_cv_type_mp_int" = xyes; then :
+
+else
+ libtommath_ok=no
+fi
+
+else
+
+ libtommath_ok=no
+fi
+
+
+if test $libtommath_ok = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mp_add" >&5
+$as_echo_n "checking for library containing mp_add... " >&6; }
+if ${ac_cv_search_mp_add+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.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
+char mp_add ();
+int
+main ()
+{
+return mp_add ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' tommath; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_mp_add=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_mp_add+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_mp_add+:} false; then :
+
+else
+ ac_cv_search_mp_add=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mp_add" >&5
+$as_echo "$ac_cv_search_mp_add" >&6; }
+ac_res=$ac_cv_search_mp_add
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+
+ libtommath_ok=no
+
+fi
+
+fi
+if test $libtommath_ok = no; then :
+
+ LIBTOMMATH_OBJS=\${LIBTOMMATH_OBJS}
+
+ LIBTOMMATH_SRCS=\${LIBTOMMATH_SRCS}
+
+ LIBTOMMATH_INCLUDE=-I\${LIBTOMMATH_DIR}
+
+
+fi
+
#--------------------------------------------------------------------
# The statements below define a collection of compile flags. This
# macro depends on the value of SHARED_BUILD, and should be called
diff --git a/unix/configure.ac b/unix/configure.ac
index f34091f..9c4135b 100644
--- a/unix/configure.ac
+++ b/unix/configure.ac
@@ -167,6 +167,23 @@ AS_IF([test $zlib_ok = no], [
])
AC_DEFINE(HAVE_ZLIB, 1, [Is there an installed zlib?])
+#------------------------------------------------------------------------
+# Add stuff for libtommath
+
+libtommath_ok=yes
+AC_CHECK_HEADER([tommath.h],[
+ AC_CHECK_TYPE([mp_int],[],[libtommath_ok=no],[#include <tommath.h>])],[
+ libtommath_ok=no])
+AS_IF([test $libtommath_ok = yes], [
+ AC_SEARCH_LIBS([mp_add],[tommath],[],[
+ libtommath_ok=no
+ ])])
+AS_IF([test $libtommath_ok = no], [
+ AC_SUBST(LIBTOMMATH_OBJS,[\${LIBTOMMATH_OBJS}])
+ AC_SUBST(LIBTOMMATH_SRCS,[\${LIBTOMMATH_SRCS}])
+ AC_SUBST(LIBTOMMATH_INCLUDE,[-I\${LIBTOMMATH_DIR}])
+])
+
#--------------------------------------------------------------------
# The statements below define a collection of compile flags. This
# macro depends on the value of SHARED_BUILD, and should be called