From 802a6aa93fe80d10c9d5f4b95fde30239ef6e6ed Mon Sep 17 00:00:00 2001 From: Greg Date: Tue, 27 Dec 2016 13:53:02 -0500 Subject: [PATCH 1/2] Added conditional for xmllint by testing "a2x" without the -L flag. --- configure.ac | 17 +++++++++++++++-- docs/man5/Makefile.am | 8 +++++--- docs/man8/Makefile.am | 8 +++++--- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index b4dee00..9b61312 100644 --- a/configure.ac +++ b/configure.ac @@ -240,8 +240,6 @@ AC_SUBST(LIBS) AC_SUBST(ADDITIONAL_OBJECTS) # Check for xml tools -AC_PATH_PROG(XMLLINT, xmllint, no) -AM_CONDITIONAL(HAVE_XMLLINT, test "x$XMLLINT" != "xno") AC_PATH_PROG(XSLTPROC, xsltproc, no) AM_CONDITIONAL(HAVE_XSLTPROC, test "x$XSLTPROC" != "xno") @@ -252,6 +250,21 @@ if test x"$A2X" = x"no"; then AC_MSG_ERROR([Test for asciidoc failed. See the file 'INSTALL' for help.]) fi +# checking xmllint +AC_PATH_PROG(XMLLINT, xmllint, no) +if test "x$XMLLINT" != "xno"; then + AS_ECHO_N("testing xmllint... ") + echo "TEST" > conftest.txt + if $A2X -f docbook conftest.txt 2>/dev/null; then + AS_ECHO("ok") + else + AS_ECHO("failed") + XMLLINT="no" + fi + rm -f conftest.txt conftest.xml +fi +AM_CONDITIONAL(HAVE_XMLLINT, test "x$XMLLINT" != "xno") + AC_CONFIG_FILES([ Makefile src/Makefile diff --git a/docs/man5/Makefile.am b/docs/man5/Makefile.am index 8143932..f64636a 100644 --- a/docs/man5/Makefile.am +++ b/docs/man5/Makefile.am @@ -1,9 +1,11 @@ MAN5_FILES = \ tinyproxy.conf.txt -A2X_ARGS = \ - -d manpage \ - -f manpage +if HAVE_XMLLINT +A2X_ARGS = -d manpage -f manpage +else +A2X_ARGS = -d manpage -f manpage -L +endif man_MANS = \ $(MAN5_FILES:.txt=.5) diff --git a/docs/man8/Makefile.am b/docs/man8/Makefile.am index 930dcf6..ad4c010 100644 --- a/docs/man8/Makefile.am +++ b/docs/man8/Makefile.am @@ -1,9 +1,11 @@ MAN8_FILES = \ tinyproxy.txt -A2X_ARGS = \ - -d manpage \ - -f manpage +if HAVE_XMLLINT +A2X_ARGS = -d manpage -f manpage +else +A2X_ARGS = -d manpage -f manpage -L +endif man_MANS = \ $(MAN8_FILES:.txt=.8) From 1b8a6ef561c08097989c63340c369974f5cfadac Mon Sep 17 00:00:00 2001 From: Greg Date: Tue, 27 Dec 2016 17:24:02 -0500 Subject: [PATCH 2/2] configure.ac: add conditional for -z,defs --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 9b61312..1893945 100644 --- a/configure.ac +++ b/configure.ac @@ -219,7 +219,12 @@ if test x"$debug_enabled" != x"yes" ; then CFLAGS="-DNDEBUG $CFLAGS" fi +AS_ECHO_N(["checking to see if linker understands -z,defs... "]) +LDFLAGS_OLD="-Wl $LDFLAGS" LDFLAGS="-Wl,-z,defs $LDFLAGS" +AC_LINK_IFELSE([AC_LANG_PROGRAM()], + AS_ECHO("yes"), + AS_ECHO("no"); LDFLAGS="$LDFLAGS_OLD") dnl dnl Make sure we can actually handle the "--with-*" and "--enable-*" stuff.