summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorToby Goodwin <toby@paccrat.org>2014-09-02 08:01:39 +0100
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:22:10 +0100
commita8699a58d8632f21e897ea5c4900a15483a9a8ca (patch)
treefd8e7910807eb91bcd79d498582959f1d750f9c6 /configure.ac
parentd884971193ef4934424b77ae862e8b0ecf70bab3 (diff)
release: rc-1.7.2
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac102
1 files changed, 69 insertions, 33 deletions
diff --git a/configure.ac b/configure.ac
index a2f2043..d12714a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,14 +1,13 @@
-dnl Get things going...
-AC_INIT(rc.h)
+dnl Our package name, version, ...
+AC_INIT([rc], [1.7.2])
-RELDATE=`cat $srcdir/RELDATE`
+dnl ... and release date
+RELDATE=`date -I`
AC_DEFINE_UNQUOTED(RELDATE, "$RELDATE", [Release date])
-dnl Automake stuff.
-dnl Use this one for snapshots...
-dnl AM_INIT_AUTOMAKE(rc, 1.7s`echo $RELDATE |sed 's/-//g'`)
-dnl ...and this one for releases
-AM_INIT_AUTOMAKE(rc, 1.7.1)
+dnl Get things going...
+AC_CONFIG_SRCDIR([rc.h])
+AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
@@ -90,7 +89,7 @@ no) RC_SYS_MKNOD_FIFO ;;
esac
dnl Now handle arguments.
-AC_ARG_ENABLE(builtin-echo, [ --disable-builtin-echo Don't include \`echo' as a builtin],
+AC_ARG_ENABLE(builtin-echo, [ --disable-builtin-echo Don't include `echo' as a builtin],
test "x$enableval" != "xno" && AC_DEFINE(RC_ECHO, 1, [Define to 1 to include `echo' as a builtin.]),
AC_DEFINE(RC_ECHO))
@@ -104,7 +103,7 @@ AC_ARG_ENABLE(protect-env, [ --disable-protect-env Don't protect environment
AC_ARG_ENABLE(def-interp,
[ --enable-def-interp=/bin/foo
- Use /bin/foo as default interpreter [/bin/sh]],
+ Use /bin/foo as default interpreter [[/bin/sh]]],
[
case "$enableval" in
no)
@@ -120,8 +119,8 @@ AC_ARG_ENABLE(def-interp,
AC_ARG_ENABLE(def-path,
[ --enable-def-path=\"/usr/local/bin/\",\"/usr/bin\"
- Default path [All of these that exist
- (/usr/local/bin /usr/bin /usr/bsd /usr/ucb /bin .)]],
+ Default path [[All of these that exist
+ (/usr/local/bin /usr/bin /usr/bsd /usr/ucb /bin .)]]],
[
case "$enableval" in
no|yes) ;;
@@ -156,7 +155,7 @@ AC_ARG_WITH(history,
AM_CONDITIONAL(AMC_HISTORY, test "$rc_history" = yes)
-AC_ARG_WITH(addon, [ --with-addon[=foo.c] Extra builtins, from addon.c by default ],[
+AC_ARG_WITH(addon, [ --with-addon[[=foo.c]] Extra builtins, from addon.c by default ],[
case "$withval" in
yes) ADDON=addon.o ;;
no) ADDON='' ;;
@@ -170,32 +169,69 @@ esac
AC_SUBST(ADDON)
-AC_ARG_WITH(editline, [ --with-editline Simmule Turner's line editing],
- AC_CHECK_LIB(edit, readline,
- AC_DEFINE(EDITLINE, 1, [Define to 1 if you are using `editline' or `vrl'.]) LIBS="$LIBS -ledit",
- AC_MSG_ERROR(editline library not found)))
+EDIT=edit-null.o
+AC_ARG_WITH(edit, [ --with-edit=(bsd,edit,gnu,vrl) Command line editing library], [
+ case $withval in
+ yes)
+ AC_MSG_ERROR(must specify which library)
+ # might consider searching
+ ;;
+ bsd)
+ EDIT=edit-bsd.o
+ RC_LIB_TGETENT
+ AC_CHECK_LIB(edit, el_init, [
+ LIBS="$LIBS -ledit $rc_lib_tgetent"
+ ], AC_MSG_ERROR(editline library not found), $rc_lib_tgetent)
+ ;;
+ gnu)
+ EDIT=edit-gnu.o
+ RC_LIB_TGETENT
+ AC_CHECK_LIB(readline, readline, [
+ LIBS="$LIBS -lreadline $rc_lib_tgetent"
+ ], AC_MSG_ERROR(readline library not found), $rc_lib_tgetent)
+ AC_TRY_LINK([
+ #include <stdio.h>
+ #include <readline/readline.h>
+ ], [
+ rl_catch_signals = 0;
+ ], [], AC_MSG_ERROR(readline >= 4.0 not found))
+ ;;
+ no|null)
+ ;;
+ edit|vrl)
+ EDIT=edit-$withval.o
+ ;;
+ *)
+ AC_MSG_ERROR(unknown editing library $withval)
+ ;;
+ esac
+])
+AC_SUBST(EDIT)
+dnl AC_CHECK_LIB(edit, readline,
+dnl AC_DEFINE(EDITLINE, 1, [Define to 1 if you are using `editline' or `vrl'.]) LIBS="$LIBS -ledit",
+dnl AC_MSG_ERROR(editline library not found)))
-if test "${with_vrl+set}" = set -o "${with_readline+set}" = set; then
- RC_LIB_TGETENT
-fi
+dnl if test "${with_vrl+set}" = set -o "${with_readline+set}" = set; then
+dnl RC_LIB_TGETENT
+dnl fi
-AC_ARG_WITH(vrl, [ --with-vrl Gert-Jan Vons's line editing],
- AC_CHECK_LIB(vrl, readline,
- AC_DEFINE(EDITLINE) LIBS="$LIBS -lvrl $rc_lib_tgetent",
- AC_MSG_ERROR(vrl library not found), $rc_lib_tgetent))
+dnl AC_ARG_WITH(vrl, [ --with-vrl Gert-Jan Vons's line editing],
+dnl AC_CHECK_LIB(vrl, readline,
+dnl AC_DEFINE(EDITLINE) LIBS="$LIBS -lvrl $rc_lib_tgetent",
+dnl AC_MSG_ERROR(vrl library not found), $rc_lib_tgetent))
dnl There are (at least) two incompatible versions of readline, and we
dnl need to know which one we are using. We don't support readline 2.0.
-AC_ARG_WITH(readline, [ --with-readline Bloated GNU line editing], [
- AC_CHECK_LIB(readline, readline, [
- AC_DEFINE(READLINE, 1, [Define to 1 if you are using GNU `readline'.])
- LIBS="$LIBS -lreadline $rc_lib_tgetent"
- AC_CHECK_LIB(readline, _rl_clean_up_for_exit, , AC_DEFINE(READLINE_OLD, 1, [Define to 1 for older versions GNU `readline'.]), $rc_lib_tgetent)
- ], AC_MSG_ERROR(readline library not found), $rc_lib_tgetent)
-])
-AM_CONDITIONAL(AMC_READLINE, test "${with_readline+set}" = set)
+dnl AC_ARG_WITH(readline, [ --with-readline Bloated GNU line editing], [
+dnl AC_CHECK_LIB(readline, readline, [
+dnl AC_DEFINE(READLINE, 1, [Define to 1 if you are using GNU `readline'.])
+dnl LIBS="$LIBS -lreadline $rc_lib_tgetent"
+dnl AC_CHECK_LIB(readline, _rl_clean_up_for_exit, , AC_DEFINE(READLINE_OLD, 1, [Define to 1 for older versions GNU `readline'.]), $rc_lib_tgetent)
+dnl ], AC_MSG_ERROR(readline library not found), $rc_lib_tgetent)
+dnl ])
+dnl AM_CONDITIONAL(AMC_READLINE, test "${with_readline+set}" = set)
dnl For some reason CPPFLAGS doesn't get propagated.
-AC_SUBST(CPPFLAGS)
+dnl AC_SUBST(CPPFLAGS)
AC_OUTPUT(Makefile)