2009-09-14 01:07:32 +00:00
|
|
|
|
2012-07-26 05:31:38 +00:00
|
|
|
AC_INIT(lnav, 0.5.0, timothyshanestack@gmail.com)
|
2009-09-14 01:07:32 +00:00
|
|
|
AC_CONFIG_SRCDIR([src/lnav.cc])
|
2013-04-19 05:46:49 +00:00
|
|
|
AM_INIT_AUTOMAKE
|
2009-09-14 01:07:32 +00:00
|
|
|
|
|
|
|
AC_PREFIX_DEFAULT(/usr/)
|
|
|
|
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
2011-07-18 13:34:41 +00:00
|
|
|
for defdir in /usr/local /opt/local; do
|
|
|
|
if test -d "$defdir/include"; then
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$defdir/include"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -d "$defdir/lib"; then
|
|
|
|
LDFLAGS="$LDFLAGS -L$defdir/lib"
|
|
|
|
fi
|
2011-07-21 03:16:47 +00:00
|
|
|
if test -d "$defdir/lib64"; then
|
|
|
|
LDFLAGS="$LDFLAGS -L$defdir/lib64"
|
|
|
|
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)
|
|
|
|
case x$srcdir in
|
|
|
|
x/*)
|
|
|
|
abssrcdir=$srcdir
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
abssrcdir=`pwd`/$srcdir
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_SUBST(abssrcdir)
|
|
|
|
|
|
|
|
AC_PROG_CXX
|
|
|
|
|
|
|
|
#CFLAGS=`echo $CFLAGS | sed 's/-O2//g'`
|
|
|
|
#CXXFLAGS=`echo $CXXFLAGS | sed 's/-O2//g'`
|
|
|
|
|
2010-08-17 16:40:39 +00:00
|
|
|
AC_ARG_ENABLE([static],
|
|
|
|
AS_HELP_STRING([--disable-static],
|
|
|
|
[Disable static linking]))
|
|
|
|
if test x"${enable_static}" != x"no"; then
|
2011-05-17 14:40:28 +00:00
|
|
|
case "$host_os" in
|
|
|
|
darwin*)
|
2011-07-18 13:34:41 +00:00
|
|
|
STATIC_LDFLAGS="$STATIC_LDFLAGS -Wl,-search_paths_first -Lstatic-libs"
|
|
|
|
# This is a hack to link against static libraries instead of shared
|
|
|
|
# on OS X so that we can build a mostly statically link exe that can
|
|
|
|
# be downloaded and used right away.
|
|
|
|
mkdir -p src/static-libs
|
|
|
|
for libflag in $LDFLAGS; do
|
|
|
|
case $libflag in
|
|
|
|
-Lstatic-libs)
|
|
|
|
;;
|
|
|
|
-L*)
|
|
|
|
ln -sf `echo $libflag/*.a | sed -e 's/-L//'` \
|
|
|
|
src/static-libs/.;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2011-05-17 14:40:28 +00:00
|
|
|
;;
|
|
|
|
*)
|
2010-08-17 16:40:39 +00:00
|
|
|
STATIC_LDFLAGS="$STATIC_LDFLAGS -static"
|
2011-05-17 14:40:28 +00:00
|
|
|
;;
|
|
|
|
esac
|
2010-08-17 16:40:39 +00:00
|
|
|
fi
|
|
|
|
AC_SUBST(STATIC_LDFLAGS)
|
|
|
|
|
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)
|
|
|
|
if test x"${enable_profiling}" = x"yes" ; then
|
|
|
|
CFLAGS="$CFLAGS -pg -gstabs"
|
|
|
|
CXXFLAGS="$CXXFLAGS -pg -gstabs"
|
|
|
|
LDFLAGS="$LDFLAGS -pg"
|
|
|
|
else
|
|
|
|
enable_profiling=no
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT($enable_profiling)
|
|
|
|
|
|
|
|
AC_SUBST(CFLAGS_PG)
|
|
|
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
|
|
|
|
AC_CHECK_SIZEOF(off_t)
|
|
|
|
AC_CHECK_SIZEOF(size_t)
|
|
|
|
|
|
|
|
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])])
|
2011-05-14 01:27:33 +00:00
|
|
|
AC_SEARCH_LIBS(BZ2_bzopen, bz2)
|
2009-12-24 18:36:01 +00:00
|
|
|
AC_SEARCH_LIBS(dlopen, dl)
|
2012-05-11 01:47:12 +00:00
|
|
|
|
|
|
|
# Sometimes, curses depends on these libraries being linked in...
|
|
|
|
AC_SEARCH_LIBS(cur_term, tinfo)
|
|
|
|
AC_SEARCH_LIBS(Gpm_Open, gpm)
|
|
|
|
|
2011-05-14 01:27:33 +00:00
|
|
|
AC_CHECK_HEADERS(pty.h util.h zlib.h bzlib.h libutil.h)
|
2009-09-14 01:07:32 +00:00
|
|
|
|
2012-04-17 15:16:41 +00:00
|
|
|
AX_WITH_CURSES
|
2009-09-14 01:07:32 +00:00
|
|
|
AX_PATH_LIB_PCRE([], [AC_MSG_ERROR([pcre required to build])])
|
|
|
|
AX_PATH_LIB_READLINE([], [AC_MSG_ERROR([readline required to build])])
|
|
|
|
|
|
|
|
AX_LIB_SQLITE3("3.0.0")
|
|
|
|
|
|
|
|
case "$host_os" in
|
|
|
|
*)
|
2009-12-24 18:36:01 +00:00
|
|
|
# AC_DEFINE([_XOPEN_SOURCE], [500], [Need pread])
|
2009-09-14 01:07:32 +00:00
|
|
|
AC_DEFINE([_BSD_SOURCE], [], [Need pread])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
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
|