| 1 |
# Process this file with autoconf to produce a configure script. |
|---|
| 2 |
|
|---|
| 3 |
AC_INIT(apachetop, 0.12.6, apachetop@webta.org) |
|---|
| 4 |
AC_CONFIG_SRCDIR(src/apachetop.cc) |
|---|
| 5 |
|
|---|
| 6 |
AC_CONFIG_AUX_DIR(config) |
|---|
| 7 |
#AC_CONFIG_MACRO_DIR(m4) # 2.58 |
|---|
| 8 |
|
|---|
| 9 |
AM_CONFIG_HEADER(config.h) |
|---|
| 10 |
AM_INIT_AUTOMAKE(apachetop, 0.12.6) # 2.53 only? |
|---|
| 11 |
|
|---|
| 12 |
# Add non-standard directories to the include path |
|---|
| 13 |
AC_ARG_WITH(libraries, |
|---|
| 14 |
[ |
|---|
| 15 |
--with-libraries=<path> additional place to look for libraries], |
|---|
| 16 |
[LDFLAGS="$LDFLAGS -L $withval"], |
|---|
| 17 |
, |
|---|
| 18 |
) |
|---|
| 19 |
# Add non-standard includes to the include path |
|---|
| 20 |
AC_ARG_WITH(includes, |
|---|
| 21 |
[ |
|---|
| 22 |
--with-includes=<path> additional place to look for header files], |
|---|
| 23 |
[CPPFLAGS="$CPPFLAGS -I $withval"], |
|---|
| 24 |
, |
|---|
| 25 |
) |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
# Checks for programs. |
|---|
| 29 |
#AC_PROG_CC |
|---|
| 30 |
#AC_PROG_CPP |
|---|
| 31 |
AC_PROG_CXX |
|---|
| 32 |
AC_LANG_CPLUSPLUS |
|---|
| 33 |
|
|---|
| 34 |
# Checks for header files. |
|---|
| 35 |
AC_HEADER_STDC |
|---|
| 36 |
AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h \ |
|---|
| 37 |
string.h strings.h sys/socket.h time.h sys/time.h]) |
|---|
| 38 |
|
|---|
| 39 |
# Checks for typedefs, structures, and compiler characteristics. |
|---|
| 40 |
#AC_HEADER_STDBOOL # not in 2.53? |
|---|
| 41 |
AC_C_CONST |
|---|
| 42 |
AC_HEADER_TIME |
|---|
| 43 |
AC_STRUCT_TM |
|---|
| 44 |
AC_TYPE_OFF_T |
|---|
| 45 |
AC_TYPE_SIZE_T |
|---|
| 46 |
AC_SYS_LARGEFILE |
|---|
| 47 |
|
|---|
| 48 |
# Checks for library functions. |
|---|
| 49 |
AC_FUNC_MALLOC |
|---|
| 50 |
#AC_FUNC_REALLOC # not in 2.53? |
|---|
| 51 |
AC_FUNC_VPRINTF |
|---|
| 52 |
AC_CHECK_FUNCS([inet_aton memset strchr strdup kqueue strerror strstr]) |
|---|
| 53 |
|
|---|
| 54 |
# pcre {{{ |
|---|
| 55 |
AC_ARG_WITH(pcre, |
|---|
| 56 |
[ --with-pcre=<path> prefix of pcre installation (eg /usr/local)], |
|---|
| 57 |
[ |
|---|
| 58 |
CPPFLAGS="$CPPFLAGS -I $withval/include" |
|---|
| 59 |
LDFLAGS="$LDFLAGS -L $withval/lib" |
|---|
| 60 |
] |
|---|
| 61 |
) |
|---|
| 62 |
|
|---|
| 63 |
AC_CHECK_HEADERS(pcre.h, |
|---|
| 64 |
AC_SEARCH_LIBS([pcre_compile], [pcre]) , |
|---|
| 65 |
AC_MSG_WARN([*** pcre.h not found -- consider using --with-pcre]) |
|---|
| 66 |
) |
|---|
| 67 |
# }}} |
|---|
| 68 |
|
|---|
| 69 |
# fam {{{ |
|---|
| 70 |
AC_ARG_WITH(fam, |
|---|
| 71 |
[ --with-fam=<path> prefix of fam installation (eg /usr/local)], |
|---|
| 72 |
[ |
|---|
| 73 |
CPPFLAGS="$CPPFLAGS -I $withval/include" |
|---|
| 74 |
LDFLAGS="$LDFLAGS -L $withval/lib" |
|---|
| 75 |
] |
|---|
| 76 |
) |
|---|
| 77 |
|
|---|
| 78 |
AC_CHECK_HEADERS(fam.h, |
|---|
| 79 |
AC_SEARCH_LIBS([FAMOpen], [fam]) , |
|---|
| 80 |
AC_MSG_WARN([*** fam.h not found -- consider using --with-fam]) |
|---|
| 81 |
) |
|---|
| 82 |
# }}} |
|---|
| 83 |
|
|---|
| 84 |
# adns {{{ |
|---|
| 85 |
AC_ARG_WITH(adns, |
|---|
| 86 |
[ --with-adns=<path> prefix of adns installation (eg /usr/local)], |
|---|
| 87 |
[ |
|---|
| 88 |
CPPFLAGS="$CPPFLAGS -I $withval/include" |
|---|
| 89 |
LDFLAGS="$LDFLAGS -L $withval/lib" |
|---|
| 90 |
] |
|---|
| 91 |
) |
|---|
| 92 |
|
|---|
| 93 |
AC_CHECK_HEADERS(adns.h, |
|---|
| 94 |
AC_SEARCH_LIBS([adns_submit], [adns]) , |
|---|
| 95 |
AC_MSG_WARN([*** adns.h not found -- consider using --with-adns]) |
|---|
| 96 |
) |
|---|
| 97 |
# }}} |
|---|
| 98 |
|
|---|
| 99 |
# --with-logfile {{{ |
|---|
| 100 |
AC_ARG_WITH(logfile, |
|---|
| 101 |
[ |
|---|
| 102 |
--with-logfile=<log> location of default logfile], |
|---|
| 103 |
[AC_DEFINE_UNQUOTED(DEFAULT_LOGFILE, "$withval", [Optionally override the DEFAULT_LOGFILE in apachetop.h])], |
|---|
| 104 |
, |
|---|
| 105 |
) |
|---|
| 106 |
# }}} |
|---|
| 107 |
|
|---|
| 108 |
AC_SEARCH_LIBS([socket], [socket]) |
|---|
| 109 |
AC_SEARCH_LIBS([inet_addr], [nsl]) |
|---|
| 110 |
AC_SEARCH_LIBS([attron], [ncurses]) |
|---|
| 111 |
AC_SEARCH_LIBS([tgetstr], [termcap]) |
|---|
| 112 |
AC_SEARCH_LIBS([mvprintw], [curses ncurses] , |
|---|
| 113 |
[] , |
|---|
| 114 |
[ |
|---|
| 115 |
AC_MSG_ERROR([No useful curses library found!]) |
|---|
| 116 |
] |
|---|
| 117 |
) |
|---|
| 118 |
|
|---|
| 119 |
AC_SEARCH_LIBS([readline], [readline], |
|---|
| 120 |
[ |
|---|
| 121 |
AC_DEFINE(HAVE_READLINE,1,[Define if you have readline library]) |
|---|
| 122 |
AC_SUBST(HAVE_READLINE) |
|---|
| 123 |
] , |
|---|
| 124 |
[ |
|---|
| 125 |
AC_MSG_ERROR(readline library not found) |
|---|
| 126 |
] |
|---|
| 127 |
) |
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
# everything is in CPPFLAGS up to this point, now we move to CXXFLAGS |
|---|
| 131 |
# this is mostly done for pcre test, AC_CHECK_HEADERS wants to use CPP |
|---|
| 132 |
#CXXFLAGS="$CXXFLAGS $CPPFLAGS" |
|---|
| 133 |
AC_SUBST(CXXFLAGS) |
|---|
| 134 |
|
|---|
| 135 |
AC_OUTPUT(Makefile man/Makefile src/Makefile config/Makefile) |
|---|