]> jfr.im git - irc/blitzed-org/libopm.git/blob - configure.in
Apply "[irc-security] BOPM patch for MikroTik HttpProxy, possibly others"
[irc/blitzed-org/libopm.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(libopm, [0.1])
3 AC_CONFIG_SRCDIR(src/libopm.h)
4 AM_CONFIG_HEADER(src/setup.h)
5 AM_INIT_AUTOMAKE()
6 AC_PREFIX_DEFAULT([/usr/local/libopm])
7 AM_MAINTAINER_MODE
8
9 # for documentation purposes
10 DOX_DIR_HTML=api
11 DOX_DIR_LATEX=latex
12 DOX_DIR_MAN=man
13
14 AC_SUBST(DOX_DIR_HTML)
15 AC_SUBST(DOX_DIR_LATEX)
16 AC_SUBST(DOX_DIR_MAN)
17
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"])
22
23 dnl AC_ARG_WITH(faldo,
24 dnl AC_HELP_STRING([--with-faldo],
25 dnl [make some use of Nick Faldo]))
26
27 dnl Checks for programs.
28 AC_PROG_CC
29 AC_PROG_LIBTOOL
30 AC_SUBST(LIBTOOL_DEPS)
31
32 dnl check if we need -lsocket or -lnsl
33 ETR_SOCKET_NSL
34
35 dnl Checks for header files.
36 AC_HEADER_STDC
37
38 AC_CHECK_HEADERS(sys/poll.h, have_poll_sys_h=yes, have_sys_poll_h=no)
39
40 AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h strings.h)
41
42 dnl Checks for typedefs, structures, and compiler characteristics.
43 AC_C_CONST
44 AC_TYPE_SIZE_T
45 AC_HEADER_TIME
46
47 AC_FUNC_SNPRINTF
48
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])
55 fi
56 fi
57
58 AC_CHECK_FUNCS(inet_aton inet_pton)
59
60 dnl Check if we can use gethostbyname2 for ipv6
61 AC_CHECK_FUNCS(gethostbyname gethostbyname2)
62
63 dnl AIX fun
64 AC_C_BIGENDIAN
65
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]))
69
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"
75 dnl sleep 1
76 dnl done
77 dnl AC_MSG_RESULT([ http://blitzed.org/advocacy/enjoy.jpg])
78 dnl fi
79
80 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
81 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
82 AC_SUBST(LTLIBOBJS)
83
84 dnl This comes last because configure won't actually work with -Werror in
85 dnl the CFLAGS
86 AC_ARG_WITH(werror,
87 AC_HELP_STRING([--with-werror],
88 [use -Werror to abort compilation on any warning]),
89 [CFLAGS="$CFLAGS -Werror"])
90
91 AC_OUTPUT(Makefile src/Makefile doc/Makefile doc/Doxyfile)
92
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."
96 echo
97 echo "libopm will be installed in ${prefix}. To change this, run:"
98 echo " ./configure --prefix=DIRECTORY"
99 echo
100 echo "##############################################################################"
101 echo