3 AC_INIT([ngadmin], [0.1], [admin@darkcoven.tk])
4 AC_CONFIG_MACRO_DIR([.])
5 AC_CONFIG_SRCDIR([raw/src/attr.c])
6 AC_CONFIG_HEADERS([config.h])
20 # enable/disable readline
21 AC_ARG_WITH([readline],
22 [AS_HELP_STRING([--with-readline], [support fancy command line editing @<:@default=check@:>@])],
23 [with_readline="$withval"], [with_readline=yes])
27 [AS_HELP_STRING([--enable-debug], [enable debug mode [default=no]])],
28 [enable_debug=yes], [enable_debug=no])
30 # enable/disable documentation generation
32 [AS_HELP_STRING([--enable-doc], [enable documentation generation [default=no]])],
33 [enable_doc=yes], [enable_doc=no])
35 # enable/disable build of NgSpy
37 [AS_HELP_STRING([--enable-spy], [enable NgSpy [default=no]])],
38 [enable_spy=yes], [enable_spy=no])
39 AM_CONDITIONAL(ENABLE_SPY, test x$enable_spy = xyes)
41 # enable/disable build of NgEmu
43 [AS_HELP_STRING([--enable-emu], [enable NgEmu [default=no]])],
44 [enable_emu=yes], [enable_emu=no])
45 AM_CONDITIONAL(ENABLE_EMU, test x$enable_emu = xyes)
49 AS_IF([test "x${enable_doc}" = "xyes"], [
50 AC_CHECK_PROGS([DOXYGEN], [doxygen])
51 AS_IF([test -z "$DOXYGEN"], [
52 AC_MSG_ERROR([Doxygen not found])
55 AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
58 AS_IF([test "x${with_readline}" != "xno"], [
59 AC_CHECK_LIB([readline], [readline], [
60 AC_SUBST([READLINE_LIBS], [-lreadline])
61 AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline])
63 AC_MSG_FAILURE([readline test failed (--without-readline to disable)])
69 CFLAGS="-Wall -Wextra -Os"
71 if test "x${enable_debug}" = xyes; then
74 CFLAGS="$CFLAGS -fomit-frame-pointer"
79 # check for header files
80 AC_CHECK_HEADERS([arpa/inet.h stdlib.h string.h sys/ioctl.h termios.h unistd.h])
83 # check for typedefs, structures, and compiler characteristics
87 # check for library functions
89 AC_CHECK_FUNCS([inet_ntoa memchr memset select socket strcasecmp strdup strtol strtoul])
100 lib/src/libngadmin.pc
106 AM_COND_IF([ENABLE_SPY], [
114 AM_COND_IF([ENABLE_EMU], [
122 AM_COND_IF([HAVE_DOXYGEN], [
132 ${PACKAGE_NAME} version ${PACKAGE_VERSION}
133 Prefix.............: ${prefix}
134 Debug..............: ${enable_debug}
135 Doc................: ${enable_doc}
136 Compiler...........: ${CC} ${CFLAGS} ${CPPFLAGS}
137 Readline suppport..: ${with_readline}
138 Spy................: ${enable_spy}
139 Emulator...........: ${enable_emu}