2013-05-19 10:48:25 +01:00
|
|
|
AC_INIT([jq], [1.3], [mu@netsoc.tcd.ie],
|
2012-11-27 16:02:59 -06:00
|
|
|
[jq], [http://stedolan.github.com/jq/])
|
|
|
|
|
|
|
|
dnl Created autoconf implementation thompson@dtosolutions, 26NOV12
|
|
|
|
AC_PREREQ([2.61])
|
|
|
|
AC_CONFIG_AUX_DIR([config])
|
2013-05-08 18:55:10 +01:00
|
|
|
AM_INIT_AUTOMAKE([parallel-tests foreign])
|
2013-02-03 00:09:47 -06:00
|
|
|
AM_SILENT_RULES([yes])
|
2012-11-27 16:02:59 -06:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CC_STDC
|
|
|
|
AC_PROG_CPP_WERROR
|
2012-11-28 01:08:23 -06:00
|
|
|
AC_PROG_YACC
|
2013-06-16 08:25:12 -05:00
|
|
|
AC_OBJEXT
|
|
|
|
AC_EXEEXT
|
|
|
|
LT_INIT([shared static win32-dll])
|
|
|
|
AM_CONDITIONAL(ENABLE_SHARED, test "$enable_shared" = "yes")
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([if libraries can be versioned])
|
|
|
|
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
|
|
|
|
if test "$GLD"; then
|
|
|
|
have_ld_version_script=yes
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
have_ld_version_script=no
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_WARN(*** You have not enabled versioned symbols.)
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
|
|
|
|
|
|
|
if test "$have_ld_version_script" = "yes"; then
|
|
|
|
AC_MSG_CHECKING([for symbol prefix])
|
|
|
|
SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
|
|
|
|
| ${CPP-${CC-gcc} -E} - 2>&1 \
|
|
|
|
| ${EGREP-grep} "^PREFIX=" \
|
|
|
|
| ${SED-sed} "s:^PREFIX=::"`
|
|
|
|
AC_SUBST(SYMBOL_PREFIX)
|
|
|
|
AC_MSG_RESULT($SYMBOL_PREFIX)
|
|
|
|
fi
|
2012-11-27 16:02:59 -06:00
|
|
|
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
|
2012-11-28 01:08:23 -06:00
|
|
|
dnl couldn't use AM_PROG_LEX as it doesn't support header files like the
|
|
|
|
dnl AC_PROG_YACC macros...
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl these program checks should probably be deleted
|
|
|
|
dnl
|
|
|
|
|
2013-05-09 11:31:17 +01:00
|
|
|
AC_PROG_LEX
|
|
|
|
if test "x$LEX" != xflex; then
|
|
|
|
LEX="$SHELL $missing_dir/missing flex"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2012-11-27 16:02:59 -06:00
|
|
|
dnl Check for valgrind
|
|
|
|
AC_CHECK_PROGS(valgrind_cmd, valgrind)
|
2013-05-09 15:22:38 +01:00
|
|
|
if test "x$valgrind_cmd" = "x" ; then
|
|
|
|
AC_MSG_WARN([valgrind is required to test jq.])
|
2012-11-27 16:02:59 -06:00
|
|
|
fi
|
|
|
|
|
2013-05-09 15:22:38 +01:00
|
|
|
|
|
|
|
dnl Don't attempt to build docs if there's no Ruby lying around
|
2013-05-09 20:27:12 +01:00
|
|
|
AC_ARG_ENABLE([docs],
|
2013-05-09 15:22:38 +01:00
|
|
|
AC_HELP_STRING([--disable-docs], [don't build docs]))
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_docs" != "xno"],[
|
2013-05-09 20:27:12 +01:00
|
|
|
AC_CHECK_PROGS(bundle_cmd, bundle)
|
2013-06-05 16:40:01 +01:00
|
|
|
|
|
|
|
AC_CACHE_CHECK([for Ruby dependencies], [jq_cv_ruby_deps],
|
|
|
|
[jq_cv_ruby_deps=yes;
|
|
|
|
AS_IF([test "x$bundle_cmd" = "x" || \
|
|
|
|
! bmsg="`cd ${srcdir}/docs; "$bundle_cmd" check 2>/dev/null`"],[
|
|
|
|
AC_MSG_WARN([$bmsg])
|
|
|
|
cat <<EOF
|
2013-05-09 20:27:12 +01:00
|
|
|
*****************************************************************
|
|
|
|
* Ruby dependencies for building jq documentation not found. *
|
|
|
|
* You can still build, install and hack on jq, but the manpage *
|
|
|
|
* will not be rebuilt and some of the tests won't run. *
|
|
|
|
* See docs/README.md for how to install the docs dependencies. *
|
|
|
|
*****************************************************************
|
|
|
|
EOF
|
2013-06-05 16:40:01 +01:00
|
|
|
jq_cv_ruby_deps=no
|
|
|
|
])])
|
|
|
|
|
|
|
|
if test "x$jq_cv_ruby_deps" != "xyes"; then
|
|
|
|
enable_docs=no
|
|
|
|
fi
|
2013-05-09 15:22:38 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" != xno])
|
2013-05-09 20:27:12 +01:00
|
|
|
AC_SUBST([BUNDLER], ["$bundle_cmd"])
|
2013-05-09 15:22:38 +01:00
|
|
|
|
2013-06-16 08:25:12 -05:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2013-05-09 11:31:17 +01:00
|
|
|
AM_INIT_AUTOMAKE([-Wall])
|
2012-11-27 16:02:59 -06:00
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_OUTPUT
|
2013-05-08 02:30:08 +01:00
|
|
|
|
|
|
|
|