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=check])
25 # enable/disable documentation generation
27 [AS_HELP_STRING([--enable-doc], [enable documentation generation [default=no]])],
28 [enable_doc=yes], [enable_doc=no])
30 # enable/disable build of NgSpy
32 [AS_HELP_STRING([--enable-spy], [enable NgSpy [default=no]])],
33 [enable_spy=yes], [enable_spy=no])
34 AM_CONDITIONAL(ENABLE_SPY, test x$enable_spy = xyes)
36 # enable/disable build of NgEmu
38 [AS_HELP_STRING([--enable-emu], [enable NgEmu [default=no]])],
39 [enable_emu=yes], [enable_emu=no])
40 AM_CONDITIONAL(ENABLE_EMU, test x$enable_emu = xyes)
44 if test "x${enable_doc}" = xyes; then
45 AC_CHECK_PROGS([DOXYGEN], [doxygen])
46 if test -z "$DOXYGEN"; then
48 ----------------------------------------
50 ----------------------------------------])
53 AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
57 if test "x${with_readline}" != xno; then
58 AC_CHECK_LIB([readline], [readline], [], [
59 if test "x${with_readline}" = xyes; then
61 ----------------------------------------
62 Unable to find readline library
63 ----------------------------------------])
69 [AS_HELP_STRING([--enable-debug], [enable debug mode [default=no]])],
70 [enable_debug=yes], [enable_debug=no])
72 CFLAGS="-Wall -Wextra -Os"
74 if test "x${enable_debug}" = xyes; then
77 CFLAGS="$CFLAGS -fomit-frame-pointer"
82 # check for header files
83 AC_CHECK_HEADERS([arpa/inet.h stdlib.h string.h sys/ioctl.h termios.h unistd.h])
86 # check for typedefs, structures, and compiler characteristics
90 # check for library functions
92 AC_CHECK_FUNCS([inet_ntoa memchr memset select socket strcasecmp strdup strtol strtoul])
108 AM_COND_IF([ENABLE_SPY], [
116 AM_COND_IF([ENABLE_EMU], [
129 ${PACKAGE_NAME} version ${PACKAGE_VERSION}
130 Prefix.............: ${prefix}
131 Debug..............: ${enable_debug}
132 Compiler...........: ${CC} ${CFLAGS} ${CPPFLAGS}
133 Readline suppport..: ${with_readline}
134 Spy................: ${enable_spy}
135 Emulator...........: ${enable_emu}