1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_SRCDIR(src/libopm.h)
4 AM_CONFIG_HEADER(src/setup.h)
6 AC_PREFIX_DEFAULT([/usr/local/libopm])
9 # for documentation purposes
14 AC_SUBST(DOX_DIR_HTML)
15 AC_SUBST(DOX_DIR_LATEX)
18 AC_ARG_WITH(extra-fascism,
19 AC_HELP_STRING([--with-extra-fascism],
20 [add extra gcc3-specific warning flags]),
21 [CFLAGS="$CFLAGS -g -O0 -W -Wall -Wfloat-equal -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs"])
23 dnl AC_ARG_WITH(faldo,
24 dnl AC_HELP_STRING([--with-faldo],
25 dnl [make some use of Nick Faldo]))
27 dnl Checks for programs.
30 AC_SUBST(LIBTOOL_DEPS)
32 dnl check if we need -lsocket or -lnsl
35 dnl Checks for header files.
38 AC_CHECK_HEADERS(sys/poll.h, have_poll_sys_h=yes, have_sys_poll_h=no)
40 AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h strings.h)
42 dnl Checks for typedefs, structures, and compiler characteristics.
49 dnl if they want select() or they don't have poll() then we need to check
50 dnl that we actually have select()
51 if test "$have_sys_poll_h" = "no"; then
52 AC_CHECK_FUNCS(select, have_select=yes, have_select=no)
53 if test "$have_select" = "no"; then
54 AC_MSG_ERROR([No select() implementation found])
58 AC_CHECK_FUNCS(inet_aton inet_pton)
60 dnl Check if we can use gethostbyname2 for ipv6
61 AC_CHECK_FUNCS(gethostbyname gethostbyname2)
66 dnl Solaris has to be weird doesn't it...
67 AC_CHECK_LIB(socket, socket, AC_SUBST(LSOCKET, [-lsocket]))
68 AC_CHECK_LIB(nsl, gethostbyname, AC_SUBST(LNSL, [-lnsl]))
70 dnl teehee - taken from MRTG / Tobias Oetiker
71 dnl if test "$with_faldo" != "no"; then
72 dnl echo $ECHO_N "checking for Nick Faldo $ECHO_C"
73 dnl for bleh in 1 2 3; do
74 dnl echo $ECHO_N ".
\a"
77 dnl AC_MSG_RESULT([ http://blitzed.org/advocacy/enjoy.jpg])
80 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
81 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
84 dnl This comes last because configure won't actually work with -Werror in
87 AC_HELP_STRING([--with-werror],
88 [use -Werror to abort compilation on any warning]),
89 [CFLAGS="$CFLAGS -Werror"])
91 AC_OUTPUT(Makefile src/Makefile doc/Makefile doc/Doxyfile)
93 echo "##############################################################################"
94 echo "Everything is now configured. To compile libopm now, just type make. It"
95 echo "requires GNU Make, which may be installed as gmake on your system."
97 echo "libopm will be installed in ${prefix}. To change this, run:"
98 echo " ./configure --prefix=DIRECTORY"
100 echo "##############################################################################"