2016-04-05 06:55:43 +00:00
|
|
|
AC_INIT([lnav],[0.8.1],[lnav@googlegroups.com],[lnav],[http://lnav.org])
|
2009-09-14 01:07:32 +00:00
|
|
|
AC_CONFIG_SRCDIR([src/lnav.cc])
|
2015-04-01 08:04:12 +00:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2013-07-23 12:55:08 +00:00
|
|
|
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
2013-05-02 15:29:36 +00:00
|
|
|
AM_SILENT_RULES([yes])
|
2009-09-14 01:07:32 +00:00
|
|
|
|
2014-03-03 06:26:41 +00:00
|
|
|
AC_PREFIX_DEFAULT(/usr)
|
2009-09-14 01:07:32 +00:00
|
|
|
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
2016-12-06 00:34:30 +00:00
|
|
|
AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
|
|
|
|
|
2014-02-06 19:02:39 +00:00
|
|
|
for defdir in /opt/local /usr/local /usr /; do
|
2011-07-18 13:34:41 +00:00
|
|
|
if test -d "$defdir/include"; then
|
2013-06-10 13:55:39 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -I$defdir/include"
|
2011-07-18 13:34:41 +00:00
|
|
|
fi
|
|
|
|
|
2011-07-21 03:16:47 +00:00
|
|
|
if test -d "$defdir/lib64"; then
|
2013-06-10 13:55:39 +00:00
|
|
|
LDFLAGS="$LDFLAGS -L$defdir/lib64"
|
2011-07-21 03:16:47 +00:00
|
|
|
fi
|
2016-11-19 14:37:34 +00:00
|
|
|
if test -d "$defdir/lib"; then
|
|
|
|
LDFLAGS="$LDFLAGS -L$defdir/lib"
|
|
|
|
fi
|
2014-02-06 19:02:39 +00:00
|
|
|
|
|
|
|
if test -d "$defdir/lib/x86_64-linux-gnu"; then
|
|
|
|
LDFLAGS="$LDFLAGS -L$defdir/lib/x86_64-linux-gnu"
|
|
|
|
fi
|
2011-07-18 13:34:41 +00:00
|
|
|
done
|
2009-12-24 18:36:01 +00:00
|
|
|
|
2009-09-14 01:07:32 +00:00
|
|
|
dnl abssrcdir is the absolute path to the source base (regardless of where
|
|
|
|
dnl you are building it)
|
2015-09-14 07:59:42 +00:00
|
|
|
AS_CASE([x$srcdir],
|
|
|
|
[x/*],
|
|
|
|
AS_VAR_SET(abssrcdir, $srcdir),
|
|
|
|
AS_VAR_SET(abssrcdir, `pwd`/$srcdir)
|
|
|
|
)
|
|
|
|
|
2009-09-14 01:07:32 +00:00
|
|
|
AC_SUBST(abssrcdir)
|
|
|
|
|
|
|
|
AC_PROG_CXX
|
|
|
|
|
2014-03-16 22:21:42 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -D_ISOC99_SOURCE -D__STDC_LIMIT_MACROS"
|
2013-08-29 04:22:04 +00:00
|
|
|
|
2015-11-30 04:10:40 +00:00
|
|
|
# CFLAGS=`echo $CFLAGS | sed 's/-O2//g'`
|
|
|
|
# CXXFLAGS=`echo $CXXFLAGS | sed 's/-O2//g'`
|
2009-09-14 01:07:32 +00:00
|
|
|
|
2015-08-02 13:43:57 +00:00
|
|
|
AC_ARG_VAR(SFTP_TEST_URL)
|
|
|
|
|
2009-09-14 01:07:32 +00:00
|
|
|
AC_ARG_ENABLE([profiling],
|
|
|
|
AS_HELP_STRING([--enable-profiling],
|
|
|
|
[Compile with gprof(1) profiling support]))
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(gprof(4) profiling support)
|
2015-09-15 08:42:56 +00:00
|
|
|
|
|
|
|
AS_VAR_IF([enable_profiling], [yes],
|
|
|
|
[CFLAGS="$CFLAGS -pg -gstabs"
|
|
|
|
CXXFLAGS="$CXXFLAGS -pg -gstabs"
|
|
|
|
LDFLAGS="$LDFLAGS -pg"],
|
|
|
|
[enable_profiling=no]dnl
|
|
|
|
)
|
|
|
|
|
2009-09-14 01:07:32 +00:00
|
|
|
AC_MSG_RESULT($enable_profiling)
|
|
|
|
|
|
|
|
AC_SUBST(CFLAGS_PG)
|
|
|
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_RANLIB
|
2016-10-24 14:56:16 +00:00
|
|
|
AM_PROG_AR
|
2009-09-14 01:07:32 +00:00
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
|
2014-03-15 11:40:58 +00:00
|
|
|
AC_PATH_PROG(BZIP2_CMD, [bzip2])
|
2015-06-08 13:27:45 +00:00
|
|
|
AC_PATH_PROG(RE2C_CMD, [re2c])
|
2015-06-11 03:42:46 +00:00
|
|
|
AM_CONDITIONAL(HAVE_RE2C, test x"$RE2C_CMD" != x"")
|
2014-03-15 11:40:58 +00:00
|
|
|
|
2009-09-14 01:07:32 +00:00
|
|
|
AC_CHECK_SIZEOF(off_t)
|
|
|
|
AC_CHECK_SIZEOF(size_t)
|
|
|
|
|
2014-01-07 15:35:52 +00:00
|
|
|
AC_STRUCT_TIMEZONE
|
|
|
|
|
2015-07-25 13:45:38 +00:00
|
|
|
AC_ARG_ENABLE([static],
|
|
|
|
AS_HELP_STRING([--disable-static],
|
|
|
|
[Disable static linking]))
|
|
|
|
|
2009-09-14 01:07:32 +00:00
|
|
|
AC_SEARCH_LIBS(openpty, util)
|
2009-12-24 18:36:01 +00:00
|
|
|
AC_SEARCH_LIBS(gzseek, z, [], [AC_MSG_ERROR([libz required to build])])
|
2015-03-28 08:25:09 +00:00
|
|
|
AC_SEARCH_LIBS(BZ2_bzopen, bz2,
|
|
|
|
AS_VAR_SET(BZIP2_SUPPORT, 1),
|
|
|
|
AS_VAR_SET(BZIP2_SUPPORT, 0))
|
|
|
|
AC_SUBST(BZIP2_SUPPORT)
|
2009-12-24 18:36:01 +00:00
|
|
|
AC_SEARCH_LIBS(dlopen, dl)
|
2014-03-18 10:59:27 +00:00
|
|
|
AC_SEARCH_LIBS(backtrace, execinfo)
|
2015-08-02 14:41:09 +00:00
|
|
|
LIBCURL_CHECK_CONFIG([], [7.23.0], [], [], [test x"${enable_static}" != x"no"])
|
2012-05-11 01:47:12 +00:00
|
|
|
|
|
|
|
# Sometimes, curses depends on these libraries being linked in...
|
2015-03-23 22:44:25 +00:00
|
|
|
AC_ARG_ENABLE([tinfo],
|
|
|
|
AS_HELP_STRING([--disable-tinfo],
|
|
|
|
[Disable linking with tinfo, enabled by default]),
|
|
|
|
[], [enable_tinfo="yes"]
|
|
|
|
)
|
|
|
|
|
|
|
|
AS_IF([test "x${enable_tinfo}" != "xno"],
|
|
|
|
[dnl
|
|
|
|
AC_MSG_NOTICE([Trying to link with tinfo])
|
|
|
|
AC_SEARCH_LIBS(cur_term, tinfo,
|
|
|
|
AC_MSG_NOTICE([Linking with tinfo]),
|
|
|
|
AC_MSG_WARN([libtinfo not found])
|
|
|
|
)
|
|
|
|
],
|
2015-03-23 22:57:43 +00:00
|
|
|
AC_MSG_NOTICE([Building with tinfo linking disabled])
|
2015-03-23 22:44:25 +00:00
|
|
|
)
|
|
|
|
|
2015-03-25 05:11:39 +00:00
|
|
|
dnl libgpm is required on some systems where there is a misconfigured ncurses
|
|
|
|
dnl and gpm libraries with interdependencies. This check is not required on OS X.
|
|
|
|
AS_CASE(["$host_os"],
|
|
|
|
[darwin*],
|
|
|
|
[],
|
2016-12-06 14:22:43 +00:00
|
|
|
AC_SEARCH_LIBS(Gpm_Open, [gpm gpm2],
|
2015-03-31 01:20:32 +00:00
|
|
|
AS_VAR_SET(HAVE_GPM, "1"),
|
|
|
|
AC_MSG_WARN(m4_join([ ],
|
|
|
|
[libgpm not found. If build fails later],
|
|
|
|
[consider installing gpm dev package])dnl
|
|
|
|
)
|
2015-03-25 05:11:39 +00:00
|
|
|
)
|
|
|
|
)
|
2012-05-11 01:47:12 +00:00
|
|
|
|
2014-03-18 10:37:00 +00:00
|
|
|
AC_CHECK_HEADERS(execinfo.h pty.h util.h zlib.h bzlib.h libutil.h sys/ttydefaults.h)
|
2009-09-14 01:07:32 +00:00
|
|
|
|
2015-03-13 05:50:49 +00:00
|
|
|
LNAV_WITH_JEMALLOC
|
2015-03-12 07:30:07 +00:00
|
|
|
|
2015-03-14 08:58:41 +00:00
|
|
|
LNAV_WITH_LOCAL_YAJL
|
|
|
|
|
2012-04-17 15:16:41 +00:00
|
|
|
AX_WITH_CURSES
|
2014-03-22 17:13:45 +00:00
|
|
|
|
2015-09-15 08:42:56 +00:00
|
|
|
AS_VAR_IF([ax_cv_curses],[yes],[],
|
|
|
|
AC_MSG_ERROR([requires an X/Open-compatible Curses library with color])dnl
|
|
|
|
)
|
2014-03-22 17:13:45 +00:00
|
|
|
|
2009-09-14 01:07:32 +00:00
|
|
|
AX_PATH_LIB_PCRE([], [AC_MSG_ERROR([pcre required to build])])
|
2015-03-21 00:17:30 +00:00
|
|
|
AX_PATH_LIB_READLINE
|
2009-09-14 01:07:32 +00:00
|
|
|
|
2015-04-26 20:26:11 +00:00
|
|
|
LNAV_WITH_SQLITE3("3.6.0")
|
2014-03-13 03:36:14 +00:00
|
|
|
|
2015-03-25 05:51:21 +00:00
|
|
|
case "$host_os" in
|
|
|
|
*)
|
|
|
|
# AC_DEFINE([_XOPEN_SOURCE], [500], [Need pread])
|
|
|
|
AC_DEFINE([_BSD_SOURCE], [1], [Need pread])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2015-03-30 00:12:34 +00:00
|
|
|
AS_VAR_SET(ALL_LDFLAGS, "$SQLITE3_LDFLAGS $READLINE_LDFLAGS $LDFLAGS")
|
2013-08-28 14:28:31 +00:00
|
|
|
|
2015-09-15 08:42:56 +00:00
|
|
|
AS_VAR_SET(static_lib_list,
|
2016-08-06 22:23:23 +00:00
|
|
|
["libncurses.a libncursesw.a libreadline.a libsqlite3.a libz.a libtinfo.a"])
|
2015-09-15 08:42:56 +00:00
|
|
|
AS_VAR_SET(static_lib_list,
|
|
|
|
["$static_lib_list libpcre.a libpcrecpp.a libncursesw.a libbz2.a"])
|
|
|
|
AS_VAR_SET(static_lib_list,
|
|
|
|
["$static_lib_list libgpm.a libcurl.a libcrypto.a libssl.a libssh2.a"])
|
2013-08-28 14:28:31 +00:00
|
|
|
|
|
|
|
if test x"${enable_static}" != x"no"; then
|
2013-08-28 14:57:21 +00:00
|
|
|
case "$host_os" in
|
|
|
|
darwin*)
|
|
|
|
STATIC_LDFLAGS="$STATIC_LDFLAGS -Wl,-search_paths_first"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
STATIC_LDFLAGS="$STATIC_LDFLAGS -L`pwd`/src/static-libs"
|
2013-08-28 14:28:31 +00:00
|
|
|
# This is a hack to link against static libraries instead of shared
|
2013-08-28 14:57:21 +00:00
|
|
|
# so that we can build a mostly statically link exe that can
|
|
|
|
# be downloaded and used right away. This is required for OS X and
|
|
|
|
# will, hopefully, make a static binary that is compatible with
|
|
|
|
# many different versions of Linux.
|
2015-09-15 08:42:56 +00:00
|
|
|
AS_MKDIR_P(src/static-libs)
|
2013-08-29 01:20:11 +00:00
|
|
|
rm -f src/static-libs/*.a
|
2013-08-28 14:28:31 +00:00
|
|
|
for libflag in $ALL_LDFLAGS; do
|
2013-08-28 14:57:21 +00:00
|
|
|
case $libflag in
|
2015-03-25 05:11:39 +00:00
|
|
|
-Lstatic-libs)
|
|
|
|
;;
|
|
|
|
-L*)
|
2013-08-28 14:28:31 +00:00
|
|
|
libdir=`echo $libflag | sed -e 's/-L//'`
|
|
|
|
for slib in $static_lib_list; do
|
2016-08-06 22:23:23 +00:00
|
|
|
if test -e "$libdir/$slib" -a ! -e "src/static-libs/$slib"; then
|
2013-08-28 14:28:31 +00:00
|
|
|
ln -sf "$libdir/$slib" src/static-libs/.
|
|
|
|
fi
|
|
|
|
done
|
2015-03-25 05:11:39 +00:00
|
|
|
;;
|
2013-08-28 14:57:21 +00:00
|
|
|
esac
|
2013-08-28 14:28:31 +00:00
|
|
|
done
|
2016-08-06 22:23:23 +00:00
|
|
|
|
|
|
|
for slib in $static_lib_list; do
|
|
|
|
AC_MSG_CHECKING(for static library $slib)
|
|
|
|
if test -e "src/static-libs/$slib"; then
|
|
|
|
found_slib=`readlink src/static-libs/$slib`
|
|
|
|
AC_MSG_RESULT($found_slib)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(not found)
|
|
|
|
fi
|
|
|
|
done
|
2013-08-28 14:28:31 +00:00
|
|
|
fi
|
|
|
|
AC_SUBST(STATIC_LDFLAGS)
|
|
|
|
|
2015-03-31 01:20:32 +00:00
|
|
|
AS_CASE(["$host_os"],
|
|
|
|
[darwin*],
|
|
|
|
[],
|
|
|
|
[
|
|
|
|
curses_lib=$(echo $CURSES_LIB | sed -e 's/-l//')
|
|
|
|
AS_IF([test $? -eq 0],
|
|
|
|
[
|
|
|
|
AS_CASE(["$curses_lib"],
|
|
|
|
[ncurses*],
|
|
|
|
[AS_VAR_SET_IF(HAVE_GPM, [],
|
|
|
|
[
|
|
|
|
AC_MSG_NOTICE([Checking for libgpm dependency])
|
|
|
|
AS_VAR_SET(saved_LDFLAGS, $LDFLAGS)
|
|
|
|
AS_VAR_SET(LDFLAGS, "$STATIC_LDFLAGS $LDFLAGS")
|
|
|
|
AS_VAR_SET(saved_LIBS, $LIBS)
|
|
|
|
AC_CHECK_LIB($curses_lib, mousemask,
|
|
|
|
[
|
|
|
|
AS_VAR_SET(LDFLAGS, $saved_LDFLAGS)
|
|
|
|
AS_VAR_SET(LIBS, $saved_LIBS)
|
|
|
|
],
|
2016-12-06 14:22:43 +00:00
|
|
|
AC_MSG_ERROR([libgpm development libraries are required to build]))dnl
|
2015-03-31 01:20:32 +00:00
|
|
|
])dnl
|
|
|
|
])
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_WARN([Unable to test for dependepncy on gpm.])
|
|
|
|
AC_MSG_WARN([If build fails during make consider installing libgpm development libraries.])
|
|
|
|
])dnl
|
|
|
|
]dnl
|
|
|
|
)
|
|
|
|
|
2015-04-07 04:33:34 +00:00
|
|
|
saved_location=$(pwd)
|
|
|
|
cd $srcdir
|
|
|
|
version=$(expr $(git describe --abbrev=7 --dirty --always --tags 2>/dev/null) : 'v\([[0-9]]*\.[[0-9]]*\.[[0-9]]*.*\)' 2>/dev/null)
|
|
|
|
cd $saved_location
|
|
|
|
AS_IF([test $? -eq 0],
|
|
|
|
[version=$(echo $version | tr -d '\n')
|
|
|
|
version=${version:-${PACKAGE_VERSION}}
|
|
|
|
AC_DEFINE_UNQUOTED([VCS_PACKAGE_STRING], ["$PACKAGE_NAME $version"],
|
2015-04-07 04:51:16 +00:00
|
|
|
[VCS package string])],
|
|
|
|
AC_DEFINE_UNQUOTED([VCS_PACKAGE_STRING], ["$PACKAGE_STRING"], [VCS package string]))
|
2015-04-07 04:33:34 +00:00
|
|
|
|
2015-03-14 10:12:36 +00:00
|
|
|
AM_CONDITIONAL(USE_INCLUDED_YAJL, test $HAVE_LOCAL_YAJL -eq 0)
|
2015-07-07 03:53:42 +00:00
|
|
|
AM_CONDITIONAL(HAVE_LIBCURL, test x"$LIBCURL" != x"")
|
2015-03-14 10:12:36 +00:00
|
|
|
|
2013-04-19 05:46:49 +00:00
|
|
|
AC_CONFIG_HEADERS([src/config.h])
|
2009-09-14 01:07:32 +00:00
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_CONFIG_FILES([TESTS_ENVIRONMENT])
|
|
|
|
AC_CONFIG_FILES([src/Makefile])
|
|
|
|
AC_CONFIG_FILES([test/Makefile])
|
|
|
|
|
|
|
|
AC_OUTPUT
|