]> git.sur5r.net Git - ngadmin/blob - configure.ac
Rename cli executable
[ngadmin] / configure.ac
1
2 AC_PREREQ([2.68])
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])
7
8 AM_INIT_AUTOMAKE
9
10 # check for programs
11 AC_PROG_CC
12 AM_PROG_CC_C_O
13 AC_PROG_LIBTOOL
14 AC_PROG_INSTALL
15
16 LT_PREREQ([2.4])
17 LT_INIT
18
19
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])
24
25 # enable/disable documentation generation
26 AC_ARG_ENABLE(doc,
27         [AS_HELP_STRING([--enable-doc], [enable documentation generation [default=no]])],
28         [enable_doc=yes], [enable_doc=no])
29
30 # enable/disable build of NgSpy
31 AC_ARG_ENABLE(spy,
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)
35
36
37
38 if test "x${enable_doc}" = xyes; then
39         AC_CHECK_PROGS([DOXYGEN], [doxygen])
40         if test -z "$DOXYGEN"; then
41                 AC_MSG_ERROR([
42 ----------------------------------------
43 Doxygen not found
44 ----------------------------------------])
45         fi
46 fi
47 AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
48
49
50 # check for libraries
51 if test "x${with_readline}" != xno; then
52         AC_CHECK_LIB([readline], [readline], [], [
53                 if test "x${with_readline}" = xyes; then
54                         AC_MSG_ERROR([
55 ----------------------------------------
56 Unable to find readline library
57 ----------------------------------------])
58                 fi
59         ])
60 fi
61
62 AC_ARG_ENABLE(debug,
63         [AS_HELP_STRING([--enable-debug], [enable debug mode [default=no]])],
64         [enable_debug=yes], [enable_debug=no])
65
66 CFLAGS="-Wall -Wextra -Os"
67
68 if test "x${enable_debug}" = xyes; then
69         CFLAGS="$CFLAGS -g"
70 else
71         CFLAGS="$CFLAGS -fomit-frame-pointer"
72         LDFLAGS="$LDFLAGS -s"
73 fi
74
75
76 # check for header files
77 AC_CHECK_HEADERS([arpa/inet.h stdlib.h string.h sys/ioctl.h termios.h unistd.h])
78 AC_HEADER_STDBOOL
79
80 # check for typedefs, structures, and compiler characteristics
81 AC_C_INLINE
82 AC_TYPE_SIZE_T
83
84 # check for library functions
85 AC_FUNC_MALLOC
86 AC_CHECK_FUNCS([inet_ntoa memchr memset select socket strcasecmp strdup strtol strtoul])
87
88
89 AC_CONFIG_FILES([
90         Makefile
91         raw/Makefile
92         raw/include/Makefile
93         raw/src/Makefile
94         lib/Makefile
95         lib/include/Makefile
96         lib/src/Makefile
97         cli/Makefile
98         cli/man/Makefile
99         cli/src/Makefile
100 ])
101
102 AM_COND_IF([ENABLE_SPY], [
103         AC_CONFIG_FILES([
104                         spy/Makefile
105                         spy/man/Makefile
106                         spy/src/Makefile
107                 ])
108 ])
109
110
111 AC_OUTPUT
112
113
114 echo "
115 ${PACKAGE_NAME} version ${PACKAGE_VERSION}
116 Prefix.............: ${prefix}
117 Debug..............: ${enable_debug}
118 Compiler...........: ${CC} ${CFLAGS} ${CPPFLAGS}
119 Readline suppport..: ${with_readline}
120 Spy................: ${enable_spy}
121 "
122
123