Drop use of libtool for libraries.
[sliver-openvswitch.git] / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT(openflow, v0.8.1, info@openflowswitch.org)
3 AM_INIT_AUTOMAKE
4
5 AC_PROG_CC
6 AC_PROG_CPP
7 AC_PROG_LD
8 AC_PROG_RANLIB
9
10 AC_ARG_VAR([PERL], [path to Perl interpreter])
11 AC_PATH_PROG([PERL], perl, no)
12 if test "$PERL" = no; then
13    AC_MSG_ERROR([Perl interpreter not found in $PATH or $PERL.])
14 fi
15
16 AC_USE_SYSTEM_EXTENSIONS
17
18 AC_ARG_ENABLE(
19   [ndebug],
20   [AC_HELP_STRING([--enable-ndebug], 
21                   [Disable debugging features for max performance])],
22   [case "${enableval}" in # (
23      yes) ndebug=true ;; # (
24      no)  ndebug=false ;; # (
25      *) AC_MSG_ERROR([bad value ${enableval} for --enable-ndebug]) ;;
26    esac],
27   [ndebug=false])
28 AM_CONDITIONAL([NDEBUG], [test x$ndebug = xtrue])
29
30 AC_ARG_ENABLE(
31   [hw-tables],
32   [AC_HELP_STRING([--enable-hw-tables=MODULE...],
33                   [Configure and build the specified externally supplied 
34                    hardware table support modules])])
35 case "${enable_hw_tables}" in # (
36   yes) 
37     AC_MSG_ERROR([--enable-hw-tables has a required argument])
38     ;; # (
39   ''|no) 
40     hw_tables=
41     ;; # (
42   *) 
43     hw_tables=`echo "$enable_hw_tables" | sed 's/,/ /g'`
44     ;;
45 esac
46 for d in $hw_tables; do
47     mk=datapath/hwtable_$d/Modules.mk
48     if test ! -e $srcdir/$mk; then
49        AC_MSG_ERROR([--enable-hw-tables=$d specified but $mk is missing])
50     fi
51     HW_TABLES="$HW_TABLES \$(top_srcdir)/$mk"
52 done
53 AC_SUBST(HW_TABLES)
54
55 AC_ARG_VAR(KARCH, [Kernel Architecture String])
56 AC_SUBST(KARCH)
57
58 CHECK_LINUX(l26, 2.6, 2.6, KSRC26, L26_ENABLED)
59 CHECK_LINUX(l24, 2.4, 2.4, KSRC24, L24_ENABLED)
60
61 AC_CHECK_HEADER([linux/netlink.h],
62                 [HAVE_NETLINK=yes],
63                 [HAVE_NETLINK=no],
64                 [#include <sys/socket.h>
65 #include <linux/types.h>])
66 AM_CONDITIONAL([HAVE_NETLINK], [test "$HAVE_NETLINK" = yes])
67 if test "$HAVE_NETLINK" = yes; then
68    AC_DEFINE([HAVE_NETLINK], [1],
69              [Define to 1 if Netlink protocol is available.])
70 fi
71
72 AC_CHECK_HEADER([net/if_packet.h],
73                 [HAVE_IF_PACKET=yes],
74                 [HAVE_IF_PACKET=no])
75 AM_CONDITIONAL([HAVE_IF_PACKET], [test "$HAVE_IF_PACKET" = yes])
76 if test "$HAVE_IF_PACKET" = yes; then
77    AC_DEFINE([HAVE_IF_PACKET], [1],
78              [Define to 1 if net/if_packet.h is available.])
79 fi
80
81 AC_ARG_ENABLE(
82   [ssl],
83   [AC_HELP_STRING([--enable-ssl], 
84                   [Enable ssl support (requires libssl)])],
85   [case "${enableval}" in # (
86      yes) ssl=true ;;  # (
87      no)  ssl=false ;; # (
88      *) AC_MSG_ERROR([bad value ${enableval} for --enable-ssl]) ;;
89    esac],
90   [ssl=false])
91
92 if test "$ssl" = true; then
93 dnl Make sure that pkg-config is installed.
94 m4_pattern_forbid([PKG_CHECK_MODULES])
95 PKG_CHECK_MODULES([SSL], [libssl], 
96   [HAVE_OPENSSL=yes],
97   [HAVE_OPENSSL=no
98    AC_MSG_WARN([Cannot find libssl:
99
100 $SSL_PKG_ERRORS
101
102 OpenFlow will not support SSL connections.])])
103
104 fi
105 AM_CONDITIONAL([HAVE_OPENSSL], [test "$HAVE_OPENSSL" = yes])
106 if test "$HAVE_OPENSSL" = yes; then
107    AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if OpenSSL is installed.])
108 fi
109
110 AC_CHECK_LIB([socket], [connect])
111 AC_CHECK_LIB([resolv], [gethostbyname])
112 AC_CHECK_LIB([dl], [dladdr])
113
114 CFLAGS="$CFLAGS -Wall -Wno-sign-compare"
115
116 AC_CONFIG_FILES([Makefile 
117 datapath/Makefile 
118 lib/Makefile
119 include/Makefile
120 controller/Makefile
121 utilities/Makefile
122 secchan/Makefile
123 switch/Makefile
124 tests/Makefile
125 datapath/tests/Makefile
126 third-party/Makefile
127 datapath/linux-2.6/Kbuild
128 datapath/linux-2.6/Makefile
129 datapath/linux-2.6/Makefile.main
130 datapath/linux-2.4/Kbuild
131 datapath/linux-2.4/Makefile
132 datapath/linux-2.4/Makefile.main])
133
134 AC_OUTPUT