1 # Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 AC_INIT(openvswitch, 2.1.90, bugs@openvswitch.org)
17 AC_CONFIG_SRCDIR([datapath/datapath.c])
18 AC_CONFIG_MACRO_DIR([m4])
19 AC_CONFIG_AUX_DIR([build-aux])
20 AC_CONFIG_HEADERS([config.h])
21 AC_CONFIG_TESTDIR([tests])
31 AC_ARG_VAR([PERL], [path to Perl interpreter])
32 AC_PATH_PROG([PERL], perl, no)
33 if test "$PERL" = no; then
34 AC_MSG_ERROR([Perl interpreter not found in $PATH or $PERL.])
37 AM_MISSING_PROG([AUTOM4TE], [autom4te])
39 AC_USE_SYSTEM_EXTENSIONS
43 LT_INIT([disable-shared])
44 m4_pattern_forbid([LT_INIT]) dnl Make autoconf fail if libtool is missing.
46 AC_SEARCH_LIBS([pow], [m])
47 AC_SEARCH_LIBS([clock_gettime], [rt])
48 AC_SEARCH_LIBS([timer_create], [rt])
49 AC_SEARCH_LIBS([pthread_sigmask], [pthread])
60 OVS_CHECK_PYTHON_COMPAT
65 AC_CHECK_DECLS([sys_siglist], [], [], [[#include <signal.h>]])
66 AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec, struct stat.st_mtimensec],
67 [], [], [[#include <sys/stat.h>]])
68 AC_CHECK_MEMBERS([struct ifreq.ifr_flagshigh], [], [], [[#include <net/if.h>]])
69 AC_CHECK_FUNCS([mlockall strnlen getloadavg statvfs getmntent_r])
70 AC_CHECK_HEADERS([mntent.h sys/statvfs.h linux/types.h linux/if_ether.h stdatomic.h])
71 AC_CHECK_HEADERS([net/if_mib.h], [], [], [[#include <sys/types.h>
72 #include <net/if.h>]])
78 OVS_CHECK_MALLOC_HOOKS
81 OVS_CHECK_XENSERVER_VERSION
86 OVS_CHECK_GCC4_ATOMICS
87 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(1)
88 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(2)
89 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(4)
90 OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(8)
92 OVS_CHECK_PTHREAD_SET_NAME
94 OVS_CHECK_INCLUDE_NEXT([stdio.h string.h])
95 AC_CONFIG_FILES([lib/stdio.h lib/string.h])
97 OVS_ENABLE_OPTION([-Wall])
98 OVS_ENABLE_OPTION([-Wextra])
99 OVS_ENABLE_OPTION([-Wno-sign-compare])
100 OVS_ENABLE_OPTION([-Wpointer-arith])
101 OVS_ENABLE_OPTION([-Wdeclaration-after-statement])
102 OVS_ENABLE_OPTION([-Wformat-security])
103 OVS_ENABLE_OPTION([-Wno-format-zero-length])
104 OVS_ENABLE_OPTION([-Wswitch-enum])
105 OVS_ENABLE_OPTION([-Wunused-parameter])
106 OVS_ENABLE_OPTION([-Wstrict-aliasing])
107 OVS_ENABLE_OPTION([-Wbad-function-cast])
108 OVS_ENABLE_OPTION([-Wcast-align])
109 OVS_ENABLE_OPTION([-Wstrict-prototypes])
110 OVS_ENABLE_OPTION([-Wold-style-definition])
111 OVS_ENABLE_OPTION([-Wmissing-prototypes])
112 OVS_ENABLE_OPTION([-Wmissing-field-initializers])
113 OVS_ENABLE_OPTION([-Wthread-safety])
114 OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED])
115 OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER])
119 AC_ARG_VAR(KARCH, [Kernel Architecture String])
123 AC_CONFIG_FILES(Makefile)
124 AC_CONFIG_FILES(datapath/Makefile)
125 AC_CONFIG_FILES(datapath/linux/Kbuild)
126 AC_CONFIG_FILES(datapath/linux/Makefile)
127 AC_CONFIG_FILES(datapath/linux/Makefile.main)
128 AC_CONFIG_FILES(tests/atlocal)
130 dnl This makes sure that include/openflow gets created in the build directory.
131 AC_CONFIG_COMMANDS([include/openflow/openflow.h.stamp])
133 AC_CONFIG_COMMANDS([utilities/bugtool/dummy], [:])
135 AM_CONDITIONAL([LINUX_DATAPATH], [test "$HAVE_NETLINK" = yes && test "$ESX" = no])
136 if test "$HAVE_NETLINK" = yes && test "$ESX" = no; then
137 AC_DEFINE([LINUX_DATAPATH], [1], [System uses the linux datapath module.])
140 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])