aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/ChangeLog25
-rw-r--r--m4/mpfr.m462
-rw-r--r--m4/readline.m446
3 files changed, 120 insertions, 13 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 47880d0e..418cf049 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,7 +1,32 @@
+2013-01-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readline.m4: Add cross-compiling action.
+
+2013-01-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readline.m4 (GAWK_CHECK_READLINE): Renamed from GNUPG_CHECK_READLINE.
+ Test program changed and test changed to try to run the built program
+ since some systems don't notice a link dependency between libreadline
+ and other libs until runtime. Isn't that fun?
+
2012-12-24 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.2: Release tar ball made.
+2012-10-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * po.m4, intl.m4: Fix droppings left over from a git merge.
+
+2012-05-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * libtool.m4, ltoptions.m4, ltsugar.m4, ltversion.m4, lt~obsolete.m4:
+ Remove files related to libtool support. Libtool usage has been
+ pushed down into the extension directory.
+
+2012-04-01 John Haque <j.eh@mchsi.com>
+
+ * mpfr.m4: New file.
+
2012-04-27 Arnold D. Robbins <arnold@skeeve.com>
Update to autoconf 2.69, automake 1.12.
diff --git a/m4/mpfr.m4 b/m4/mpfr.m4
new file mode 100644
index 00000000..7d9e678b
--- /dev/null
+++ b/m4/mpfr.m4
@@ -0,0 +1,62 @@
+dnl Check for MPFR and dependencies
+dnl Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+dnl
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl Defines HAVE_MPFR to 1 if a working MPFR/GMP setup is
+dnl found, and sets @LIBMPFR@ to the necessary libraries.
+
+AC_DEFUN([GNUPG_CHECK_MPFR],
+[
+ AC_ARG_WITH([mpfr],
+ AC_HELP_STRING([--with-mpfr=DIR],
+ [look for the mpfr and gmp libraries in DIR]),
+ [_do_mpfr=$withval],[_do_mpfr=yes])
+
+ if test "$_do_mpfr" != "no" ; then
+ if test -d "$withval" ; then
+ CPPFLAGS="${CPPFLAGS} -I$withval/include"
+ LDFLAGS="${LDFLAGS} -L$withval/lib"
+ fi
+
+ _mpfr_save_libs=$LIBS
+ _combo="-lmpfr -lgmp"
+ LIBS="$LIBS $_combo"
+
+ AC_MSG_CHECKING([whether mpfr via \"$_combo\" is present and usable])
+
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([
+#include <stdio.h>
+#include <mpfr.h>
+#include <gmp.h>
+],[
+mpfr_t p;
+mpz_t z;
+mpfr_init(p);
+mpz_init(z);
+mpfr_printf("%Rf%Zd", p, z);
+mpfr_clear(p);
+mpz_clear(z);
+])],_found_mpfr=yes,_found_mpfr=no)
+
+ AC_MSG_RESULT([$_found_mpfr])
+
+ LIBS=$_mpfr_save_libs
+
+ if test $_found_mpfr = yes ; then
+ AC_DEFINE(HAVE_MPFR,1,
+ [Define to 1 if you have fully functional mpfr and gmp libraries.])
+ AC_SUBST(LIBMPFR,$_combo)
+ break
+ fi
+
+ unset _mpfr_save_libs
+ unset _combo
+ unset _found_mpfr
+ fi
+])dnl
diff --git a/m4/readline.m4 b/m4/readline.m4
index 73bbf2a9..76605af8 100644
--- a/m4/readline.m4
+++ b/m4/readline.m4
@@ -1,5 +1,5 @@
dnl Check for readline and dependencies
-dnl Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2005, 2013 Free Software Foundation, Inc.
dnl
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@@ -9,8 +9,14 @@ dnl the same distribution terms as the rest of that program.
dnl
dnl Defines HAVE_LIBREADLINE to 1 if a working readline setup is
dnl found, and sets @LIBREADLINE@ to the necessary libraries.
+dnl
+dnl Based upon GNUPG_CHECK_READLINE. Many more years into the
+dnl twenty-first century, it is not enough to link a test program
+dnl with the readline library. On several systems, if readline is
+dnl not linked with the curses / termcap / whatever libraries, the
+dnl problem is only discovered at run time. Isn't that special?
-AC_DEFUN([GNUPG_CHECK_READLINE],
+AC_DEFUN([GAWK_CHECK_READLINE],
[
AC_ARG_WITH([readline],
AC_HELP_STRING([--with-readline=DIR],
@@ -30,19 +36,33 @@ AC_DEFUN([GNUPG_CHECK_READLINE],
AC_MSG_CHECKING([whether readline via \"$_combo\" is present and sane])
- AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
-#include <stdio.h>
+ AC_TRY_RUN(
+dnl source program:
+AC_LANG_SOURCE([[#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>
-],[
-rl_completion_func_t *completer;
-add_history("foobar");
-rl_catch_signals=0;
-rl_inhibit_completion=0;
-rl_attempted_completion_function=NULL;
-rl_completion_matches(NULL,NULL);
-])],_found_readline=yes,_found_readline=no)
+
+int main(int argc, char **argv)
+{
+ int fd;
+ char *line;
+
+ close(0);
+ close(1);
+ fd = open("/dev/null", 2); /* should get fd 0 */
+ dup(fd);
+ line = readline("giveittome> ");
+
+ printf("got <%s>\n", line);
+ return 0;
+}]]),
+dnl action if true:
+ [_found_readline=yes],
+dnl action if false:
+ [_found_readline=no],
+dnl action if cross compiling:
+ [_found_readline=no]
+ )
AC_MSG_RESULT([$_found_readline])