Patch from Albert Chin-A-Young <china@thewrittenword.com>:
- configure.in: added --with-readline=DIR to accept alternate
path for readline include/library
- configure.in: added AM_C_PROTOTYPES to add -Aa -D_HPUX_SOURCE
for ANSI under HP-UX
- config.in: Removed @LIBS@ from xml-config because @XML_LIBS@
includes @LIBS@
Daniel
diff --git a/ChangeLog b/ChangeLog
index 338af0f..409363b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Mon Aug 14 10:26:09 EDT 2000 Daniel Veillard <Daniel.Veillard@w3.org>
+
+ * Patch from Albert Chin-A-Young <china@thewrittenword.com>:
+ * configure.in: added --with-readline=DIR to accept alternate
+ path for readline include/library
+ * configure.in: added AM_C_PROTOTYPES to add -Aa -D_HPUX_SOURCE
+ for ANSI under HP-UX
+ * config.in: Removed @LIBS@ from xml-config because @XML_LIBS@
+ includes @LIBS@
+
Sat Aug 12 23:19:42 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* doc/* : rebuilt the docs
diff --git a/configure.in b/configure.in
index d4fbd7f..5b7c675 100644
--- a/configure.in
+++ b/configure.in
@@ -32,6 +32,10 @@
AC_PATH_PROG(MV, mv, /bin/mv)
AC_PATH_PROG(TAR, tar, /bin/tar)
+dnl Make sure we have an ANSI compiler
+AM_C_PROTOTYPES
+test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
+
AM_PROG_LIBTOOL
AM_MAINTAINER_MODE
@@ -42,7 +46,7 @@
AC_ARG_WITH(zlib,
[ --with-zlib[=DIR] use libz in DIR],[
- if test "$withval" != "no"; then
+ if test "$withval" != "no" -a "$withval" != "yes"; then
Z_DIR=$withval
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
@@ -120,13 +124,13 @@
XML_CFLAGS=""
dnl
-dnl Workaround wor HP native compiler
+dnl Workaround for HP native compiler
dnl http://bugs.gnome.org/db/31/3163.html
dnl
-if test "${CC}" != "gcc" ; then
+if test "${GCC}" != "yes" ; then
case "${host}" in
*-*-hpux* )
- CFLAGS="${CFLAGS} -Wp,-H30000 -Ae"
+ CFLAGS="${CFLAGS} -Wp,-H30000"
;;
esac
fi
@@ -144,12 +148,43 @@
dnl
dnl Tester makes use of readline if present
dnl
-RDL_LIBS=""
-AC_CHECK_LIB(history, append_history,
- RDL_LIBS="-lhistory"; AC_DEFINE(HAVE_LIBHISTORY))
-AC_CHECK_LIB(readline, readline,
- RDL_LIBS="-lreadline ${RDL_LIBS}"; AC_DEFINE(HAVE_LIBREADLINE))
+_cppflags="${CPPFLAGS}"
+_ldflags="${LDFLAGS}"
+AC_ARG_WITH(readline,
+[ --with-readline=DIR use readline in DIR],[
+ if test "$withval" != "no" -a "$withval" != "yes"; then
+ RDL_DIR=$withval
+ CPPFLAGS="${CPPFLAGS} -I$withval/include"
+ LDFLAGS="${LDFLAGS} -L$withval/lib"
+ fi
+])
+
+dnl check for terminal library. this is a very cool solution
+dnl from octave's configure.in
+unset tcap
+for termlib in ncurses curses termcap terminfo termlib; do
+ AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
+ test -n "$tcap" && break
+done
+
+AC_CHECK_HEADER(readline/history.h,
+ AC_CHECK_LIB(history, append_history,[
+ RDL_LIBS="-lhistory"
+ AC_DEFINE(HAVE_LIBHISTORY)]))
+AC_CHECK_HEADER(readline/readline.h,
+ AC_CHECK_LIB(readline, readline,[
+ RDL_LIBS="-lreadline $RDL_LIBS $tcap"
+ AC_DEFINE(HAVE_LIBREADLINE)], , $tcap))
+if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
+ CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
+ RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
+else
+ CPPFLAGS=${_cppflags}
+fi
+LDFLAGS=${_ldflags}
+
+AC_SUBST(RDL_LIBS)
dnl
dnl Aloow to disable various pieces
diff --git a/xml-config.in b/xml-config.in
index 82c0cd1..1838c90 100644
--- a/xml-config.in
+++ b/xml-config.in
@@ -57,7 +57,7 @@
;;
--libs)
- echo -L@libdir@ @XML_LIBS@ @LIBS@
+ echo -L@libdir@ @XML_LIBS@
;;
*)