X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=configure.ac;h=f30cea7952830e42d83b8639501d7cdd4e8df6c5;hb=dd76e8265343e70bbdb35aeceb6aaab35ae4e2d9;hp=3c247a569302ab3ed715cc8b019bb78b56d53e4d;hpb=b74071c104e72aa53e3718a43d9e65fcf5541c14;p=ngadmin diff --git a/configure.ac b/configure.ac index 3c247a5..f30cea7 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,12 @@ LT_INIT # enable/disable readline AC_ARG_WITH([readline], [AS_HELP_STRING([--with-readline], [support fancy command line editing @<:@default=check@:>@])], - [with_readline="$withval"], [with_readline=check]) + [with_readline="$withval"], [with_readline=yes]) + +# enable debug build +AC_ARG_ENABLE(debug, + [AS_HELP_STRING([--enable-debug], [enable debug mode [default=no]])], + [enable_debug=yes], [enable_debug=no]) # enable/disable documentation generation AC_ARG_ENABLE(doc, @@ -41,33 +46,25 @@ AM_CONDITIONAL(ENABLE_EMU, test x$enable_emu = xyes) -if test "x${enable_doc}" = xyes; then +AS_IF([test "x${enable_doc}" = "xyes"], [ AC_CHECK_PROGS([DOXYGEN], [doxygen]) - if test -z "$DOXYGEN"; then - AC_MSG_ERROR([ ----------------------------------------- -Doxygen not found -----------------------------------------]) - fi -fi + AS_IF([test -z "$DOXYGEN"], [ + AC_MSG_ERROR([Doxygen not found]) + ]) +]) AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) -# check for libraries -if test "x${with_readline}" != xno; then - AC_CHECK_LIB([readline], [readline], [], [ - if test "x${with_readline}" = xyes; then - AC_MSG_ERROR([ ----------------------------------------- -Unable to find readline library -----------------------------------------]) - fi +AS_IF([test "x${with_readline}" != "xno"], [ + AC_CHECK_LIB([readline], [readline], [ + AC_SUBST([READLINE_LIBS], [-lreadline]) + AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline]) + ], [ + AC_MSG_FAILURE([readline test failed (--without-readline to disable)]) ]) -fi +]) + -AC_ARG_ENABLE(debug, - [AS_HELP_STRING([--enable-debug], [enable debug mode [default=no]])], - [enable_debug=yes], [enable_debug=no]) CFLAGS="-Wall -Wextra -Os" @@ -89,39 +86,42 @@ AC_TYPE_SIZE_T # check for library functions AC_FUNC_MALLOC -AC_CHECK_FUNCS([inet_ntoa memchr memset select socket strcasecmp strdup strtol strtoul]) +AC_CHECK_FUNCS([inet_ntoa memchr memset socket poll strcasecmp strdup strtol strtoul]) + +AC_CHECK_FUNC([clock_gettime], [ + AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if you have clock_gettime]) +], [ + AC_CHECK_LIB([rt], [clock_gettime], [ + AC_SUBST([RT_LIBS], [-lrt]) + AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if you have clock_gettime]) + ], [ + AC_CHECK_FUNCS([gettimeofday]) + ]) +]) AC_CONFIG_FILES([ Makefile raw/Makefile raw/include/Makefile + raw/include/nsdp/Makefile raw/src/Makefile lib/Makefile lib/include/Makefile lib/src/Makefile + lib/src/libngadmin.pc cli/Makefile cli/man/Makefile cli/src/Makefile + spy/Makefile + spy/man/Makefile + spy/src/Makefile + emu/Makefile + emu/man/Makefile + emu/src/Makefile + lib/doxyfile ]) -AM_COND_IF([ENABLE_SPY], [ - AC_CONFIG_FILES([ - spy/Makefile - spy/man/Makefile - spy/src/Makefile - ]) -]) - -AM_COND_IF([ENABLE_EMU], [ - AC_CONFIG_FILES([ - emu/Makefile - emu/man/Makefile - emu/src/Makefile - ]) -]) - - AC_OUTPUT @@ -129,8 +129,9 @@ echo " ${PACKAGE_NAME} version ${PACKAGE_VERSION} Prefix.............: ${prefix} Debug..............: ${enable_debug} +Doc................: ${enable_doc} Compiler...........: ${CC} ${CFLAGS} ${CPPFLAGS} -Readline suppport..: ${with_readline} +Readline support...: ${with_readline} Spy................: ${enable_spy} Emulator...........: ${enable_emu} "