| dnl Helder Correia <helder.correia@netcabo.pt> |
| |
| dnl Process this file with autoconf to produce a configure script. |
| AC_INIT(src/main.cpp) |
| AC_CANONICAL_SYSTEM |
| AM_INIT_AUTOMAKE(nload, 0.4.0) |
| AM_CONFIG_HEADER(config.h) |
| |
| dnl Checks for programs. |
| AC_PROG_CXX |
| AC_PROG_CC |
| AC_PROG_CPP |
| AC_PROG_INSTALL |
| AC_PROG_LN_S |
| |
| dnl Checks for libraries. |
| AC_CHECK_LIB(ncurses, initscr) |
| AC_CHECK_LIB(form, new_form) |
| |
| dnl Checks for header files. |
| AC_HEADER_STDC |
| AC_CHECK_HEADERS(limits.h sys/time.h) |
| |
| dnl Use some gcc specific options. |
| if test "$GCC" = "yes" ; then |
| CFLAGS="$CFLAGS -Wall" |
| CXXFLAGS="$CXXFLAGS -Wall" |
| fi |
| |
| dnl Checks for typedefs, structures, and compiler characteristics. |
| AC_C_CONST |
| AC_TYPE_SIZE_T |
| AC_HEADER_TIME |
| |
| dnl Checks for library functions. |
| AC_CHECK_FUNCS(gettimeofday) |
| |
| dnl System dependant jobs |
| dnl AC_MSG_CHECKING(for operating system type) |
| case $target in |
| *linux*) |
| AC_DEFINE(HAVE_LINUX, 1) |
| ;; |
| *bsd*) |
| AC_DEFINE(HAVE_BSD, 1) |
| ;; |
| *solaris*) |
| AC_CHECK_LIB(rt, main) |
| AC_CHECK_LIB(kstat, kstat_open) |
| AC_DEFINE(HAVE_SOLARIS, 1) |
| ;; |
| esac |
| |
| dnl Adds extra arguments to configure script. |
| AC_ARG_ENABLE(debug,[ --enable-debug enable runtime debugging [no]], |
| [], |
| LDFLAGS="$LDFLAGS -s") |
| |
| AC_OUTPUT([ |
| Makefile |
| docs/Makefile |
| docs/nload.1 |
| nload.spec |
| src/Makefile |
| ]) |