diff --git a/configure b/configure index a5122aca..cc067c44 100755 --- a/configure +++ b/configure @@ -727,8 +727,6 @@ SQLITE3_CFLAGS SQLITE3_LDFLAGS SQLITE3_LIBS SQLITE3_VERSION -HAVE_LIBSQLITE3_TRUE -HAVE_LIBSQLITE3_FALSE LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -2350,6 +2348,9 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +CPPFLAGS="$CPPFLAGS -I/usr/local/include" +LDFLAGS="$LDFLAGS -L/usr/local/lib" + case x$srcdir in x/*) abssrcdir=$srcdir @@ -5787,7 +5788,7 @@ return gzseek (); return 0; } _ACEOF -for ac_lib in '' libz; do +for ac_lib in '' z; do if test -z "$ac_lib"; then ac_res="none required" else @@ -5840,12 +5841,100 @@ ac_res=$ac_cv_search_gzseek if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +else + { { echo "$as_me:$LINENO: error: libz required to build" >&5 +echo "$as_me: error: libz required to build" >&2;} + { (exit 1); exit 1; }; } +fi + +{ echo "$as_me:$LINENO: checking for library containing dlopen" >&5 +echo $ECHO_N "checking for library containing dlopen... $ECHO_C" >&6; } +if test "${ac_cv_search_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_dlopen=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_dlopen+set}" = set; then + break +fi +done +if test "${ac_cv_search_dlopen+set}" = set; then + : +else + ac_cv_search_dlopen=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_dlopen" >&5 +echo "${ECHO_T}$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + fi -for ac_header in pty.h util.h zlib.h + +for ac_header in pty.h util.h zlib.h libutil.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -6918,16 +7007,6 @@ _ACEOF - if - test -n "$SQLITE3_CFLAGS" -a -n "$SQLITE3_LDFLAGS"; then - HAVE_LIBSQLITE3_TRUE= - HAVE_LIBSQLITE3_FALSE='#' -else - HAVE_LIBSQLITE3_TRUE='#' - HAVE_LIBSQLITE3_FALSE= -fi - - case "$host_os" in darwin*) @@ -6937,11 +7016,7 @@ _ACEOF ;; *) - -cat >>confdefs.h <<\_ACEOF -#define _XOPEN_SOURCE 500 -_ACEOF - + # AC_DEFINE([_XOPEN_SOURCE], [500], [Need pread]) cat >>confdefs.h <<\_ACEOF #define _BSD_SOURCE @@ -7092,13 +7167,6 @@ echo "$as_me: error: conditional \"HAVE_OBJ_FORMAT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${HAVE_LIBSQLITE3_TRUE}" && test -z "${HAVE_LIBSQLITE3_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBSQLITE3\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"HAVE_LIBSQLITE3\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -7786,13 +7854,11 @@ SQLITE3_CFLAGS!$SQLITE3_CFLAGS$ac_delim SQLITE3_LDFLAGS!$SQLITE3_LDFLAGS$ac_delim SQLITE3_LIBS!$SQLITE3_LIBS$ac_delim SQLITE3_VERSION!$SQLITE3_VERSION$ac_delim -HAVE_LIBSQLITE3_TRUE!$HAVE_LIBSQLITE3_TRUE$ac_delim -HAVE_LIBSQLITE3_FALSE!$HAVE_LIBSQLITE3_FALSE$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 18; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 16; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.in b/configure.in index 0a03b368..dfad06d4 100644 --- a/configure.in +++ b/configure.in @@ -7,6 +7,9 @@ AC_PREFIX_DEFAULT(/usr/) AC_CANONICAL_HOST +CPPFLAGS="$CPPFLAGS -I/usr/local/include" +LDFLAGS="$LDFLAGS -L/usr/local/lib" + dnl abssrcdir is the absolute path to the source base (regardless of where dnl you are building it) case x$srcdir in @@ -63,8 +66,9 @@ AM_CONDITIONAL(HAVE_OBJ_FORMAT, test x"$OBJ_FORMAT" != x"" -a x"$OBJCOPY" != x"" AC_SUBST(OBJ_FORMAT) AC_SEARCH_LIBS(openpty, util) -AC_SEARCH_LIBS(gzseek, libz) -AC_CHECK_HEADERS(pty.h util.h zlib.h) +AC_SEARCH_LIBS(gzseek, z, [], [AC_MSG_ERROR([libz required to build])]) +AC_SEARCH_LIBS(dlopen, dl) +AC_CHECK_HEADERS(pty.h util.h zlib.h libutil.h) MP_WITH_CURSES() AX_PATH_LIB_PCRE([], [AC_MSG_ERROR([pcre required to build])]) @@ -72,15 +76,12 @@ AX_PATH_LIB_READLINE([], [AC_MSG_ERROR([readline required to build])]) AX_LIB_SQLITE3("3.0.0") -AM_CONDITIONAL(HAVE_LIBSQLITE3, [ - test -n "$SQLITE3_CFLAGS" -a -n "$SQLITE3_LDFLAGS"]) - case "$host_os" in darwin*) AC_DEFINE([_APPLE_C_SOURCE], [], [Needed for the 'timezone' variable]) ;; *) - AC_DEFINE([_XOPEN_SOURCE], [500], [Need pread]) + # AC_DEFINE([_XOPEN_SOURCE], [500], [Need pread]) AC_DEFINE([_BSD_SOURCE], [], [Need pread]) ;; esac diff --git a/src/Makefile.am b/src/Makefile.am index 4b17e7ab..e93b0c6a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,7 +29,6 @@ AM_LDFLAGS = \ AM_CPPFLAGS = \ -Wall \ - -Werror \ $(SQLITE3_CFLAGS) LDADD = \ @@ -37,9 +36,7 @@ LDADD = \ $(READLINE_LIBS) \ $(CURSES_LIB) \ $(HELP_O) \ - /usr/lib/libsqlite3.a \ - -ldl \ - -lz \ + $(SQLITE3_LIBS) \ -lpcrecpp noinst_HEADERS = \ diff --git a/src/Makefile.in b/src/Makefile.in index 979daf6f..27296fc9 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -72,7 +72,7 @@ am__DEPENDENCIES_1 = @HAVE_OBJ_FORMAT_TRUE@am__DEPENDENCIES_2 = help.o lnav_DEPENDENCIES = libdiag.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - /usr/lib/libsqlite3.a + $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -210,7 +210,6 @@ AM_LDFLAGS = \ AM_CPPFLAGS = \ -Wall \ - -Werror \ $(SQLITE3_CFLAGS) LDADD = \ @@ -218,9 +217,7 @@ LDADD = \ $(READLINE_LIBS) \ $(CURSES_LIB) \ $(HELP_O) \ - /usr/lib/libsqlite3.a \ - -ldl \ - -lz \ + $(SQLITE3_LIBS) \ -lpcrecpp noinst_HEADERS = \ diff --git a/src/auto_fd.hh b/src/auto_fd.hh index 65a39fb9..79f43dc5 100644 --- a/src/auto_fd.hh +++ b/src/auto_fd.hh @@ -50,7 +50,7 @@ public: : af_fd(fd) { assert(fd >= -1); - assert(fd < FD_SETSIZE); + assert(fd < (int)FD_SETSIZE); }; /** @@ -95,7 +95,7 @@ public: auto_fd &operator=(int fd) { assert(fd >= -1); - assert(fd < FD_SETSIZE); + assert(fd < (int)FD_SETSIZE); this->reset(fd); return(*this); @@ -152,7 +152,7 @@ public: void reset(int fd = -1) { assert(fd >= -1); - assert(fd < FD_SETSIZE); + assert(fd < (int)FD_SETSIZE); if (this->af_fd != fd) { if (this->af_fd != -1) { diff --git a/src/config.h.in b/src/config.h.in index c8db795a..a18cdb67 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -12,6 +12,9 @@ /* Define to 1 if you have the `readline' library (-lreadline). */ #undef HAVE_LIBREADLINE +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBUTIL_H + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -98,6 +101,3 @@ /* Need pread */ #undef _BSD_SOURCE - -/* Need pread */ -#undef _XOPEN_SOURCE diff --git a/src/log_format_impls.cc b/src/log_format_impls.cc index 0c5a974e..1b62bc4b 100644 --- a/src/log_format_impls.cc +++ b/src/log_format_impls.cc @@ -144,7 +144,7 @@ class tcsh_history_format : public log_format { log_tm.tm_isdst = 0; dst.push_back(logline(offset, - mktime(&log_tm) - timezone, + mktime(&log_tm) /* - timezone XXX */, 0, logline::LEVEL_UNKNOWN)); diff --git a/src/readline_curses.cc b/src/readline_curses.cc index 0bf1dfc9..7c84f47b 100644 --- a/src/readline_curses.cc +++ b/src/readline_curses.cc @@ -22,6 +22,10 @@ #include #endif +#ifdef HAVE_LIBUTIL_H +#include +#endif + #include #include "auto_mem.hh" diff --git a/test/scripty.cc b/test/scripty.cc index 60770c84..0e7da4b2 100644 --- a/test/scripty.cc +++ b/test/scripty.cc @@ -13,6 +13,7 @@ #include #include #include +#include #ifdef HAVE_PTY_H #include @@ -22,6 +23,10 @@ #include #endif +#ifdef HAVE_LIBUTIL_H +#include +#endif + #include #include diff --git a/test/test_grep_proc.sh b/test/test_grep_proc.sh index 9095406c..1e37f05e 100644 --- a/test/test_grep_proc.sh +++ b/test/test_grep_proc.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash cat > gp.dat <