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=yes@:>@])],
23 [], [with_readline=yes])
25 # enable/disable debug build
27 [AS_HELP_STRING([--enable-debug], [enable debug mode [default=no]])],
28 [], [enable_debug=no])
30 # enable/disable documentation generation
32 [AS_HELP_STRING([--enable-doc], [enable documentation generation [default=no]])],
35 # enable/disable build of NgCli
37 [AS_HELP_STRING([--enable-cli], [enable NgCli [default=yes]])],
39 AM_CONDITIONAL(ENABLE_CLI, test x$enable_cli = xyes)
40 if test x$enable_cli != xyes; then
44 # enable/disable build of NgSpy
46 [AS_HELP_STRING([--enable-spy], [enable NgSpy [default=no]])],
48 AM_CONDITIONAL(ENABLE_SPY, test x$enable_spy = xyes)
50 # enable/disable build of NgEmu
52 [AS_HELP_STRING([--enable-emu], [enable NgEmu [default=no]])],
54 AM_CONDITIONAL(ENABLE_EMU, test x$enable_emu = xyes)
56 # tell if libngadmin build is required
57 if test x$enable_cli != xyes; then
63 # enable/disable build of libngadmin
65 [AS_HELP_STRING([--enable-lib], [enable libngadmin [default=yes]])],
67 AS_IF([test x$require_lib = xyes -a x$enable_lib = xno], [
68 AC_MSG_FAILURE([libngadmin build disabled but required])
70 AM_CONDITIONAL(ENABLE_LIB, test x$enable_lib = xyes)
74 CFLAGS="-Wall -Wextra -Os"
76 if test "x${enable_debug}" = xyes; then
79 CFLAGS="$CFLAGS -fomit-frame-pointer"
84 # check for header files
85 AC_CHECK_HEADERS([arpa/inet.h stdlib.h string.h sys/ioctl.h termios.h unistd.h])
88 # check for typedefs, structures, and compiler characteristics
92 # check for library functions
94 AC_CHECK_FUNCS([inet_ntoa memchr memset socket poll strcasecmp strdup strtol strtoul])
96 # check for clock_gettime
97 AC_CHECK_FUNC([clock_gettime], [
98 AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if you have clock_gettime])
100 AC_CHECK_LIB([rt], [clock_gettime], [
101 AC_SUBST([RT_LIBS], [-lrt])
102 AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if you have clock_gettime])
104 AC_CHECK_FUNCS([gettimeofday])
109 AS_IF([test x$enable_doc = xyes], [
110 AC_CHECK_PROGS([DOXYGEN], [doxygen])
111 AS_IF([test -z "$DOXYGEN"], [
112 AC_MSG_ERROR([Doxygen not found])
115 AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
117 # check for libreadline
118 AS_IF([test x$with_readline != xno], [
119 AC_CHECK_LIB([readline], [readline], [
120 AC_SUBST([READLINE_LIBS], [-lreadline])
121 AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline])
123 AC_MSG_FAILURE([readline test failed (--without-readline to disable)])
133 raw/include/nsdp/Makefile
139 lib/src/libngadmin.pc
156 ${PACKAGE_NAME} version ${PACKAGE_VERSION}
157 Prefix.............: ${prefix}
158 Debug..............: ${enable_debug}
159 Doc................: ${enable_doc}
160 Compiler...........: ${CC} ${CFLAGS} ${CPPFLAGS}
161 Readline support...: ${with_readline}
162 Lib................: ${enable_lib}
163 Cli................: ${enable_cli}
164 Spy................: ${enable_spy}
165 Emulator...........: ${enable_emu}