2009-06-11 17:29:33 +02:00
#
# Host Identity Protocol
2012-02-08 00:16:36 +01:00
# Copyright (c) 2006-2012 the Boeing Company
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
2009-06-11 17:29:33 +02:00
#
2012-02-08 00:16:36 +01:00
# \file configure.ac
2009-06-11 17:29:33 +02:00
#
2012-02-08 00:16:36 +01:00
# \authors Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
2009-06-11 17:29:33 +02:00
#
2012-02-08 00:16:36 +01:00
# \brief Process this file with autoconf to produce a configure script.
2009-06-11 17:29:33 +02:00
# -*- Autoconf -*-
AC_PREREQ(2.59)
# change the HIP version here
2012-03-22 23:03:28 +01:00
AC_INIT(OpenHIP, 0.9svn1, [openhip-developers@lists.sourceforge.net], openhip)
2009-06-11 17:29:33 +02:00
AC_CONFIG_SRCDIR([src/protocol/hip_main.c])
AC_CONFIG_AUX_DIR(config)
2009-07-01 22:38:26 +02:00
AC_CONFIG_MACRO_DIR(config)
2009-06-11 17:29:33 +02:00
AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
# Default compiler flags, to avoid using -g with release files.
2009-07-22 17:29:05 +02:00
# GNU_SOURCE is defined so we have the IPv6 pktinfo structure
# -fno-strict-aliasing fixes gcc 4.4 problems with macros such as SA2IP
2009-06-11 17:29:33 +02:00
AC_GNU_SOURCE
2009-07-22 17:29:05 +02:00
CFLAGS="$CFLAGS -O3 -Werror -D_GNU_SOURCE -fno-strict-aliasing"
2009-06-11 17:29:33 +02:00
# HIP files go in /etc/hip or /usr/local/etc/hip
sysconfdir=$sysconfdir/hip
2011-01-12 23:49:46 +01:00
# HIP state directory for /var/log/hip.log and /var/run/hip.pid
if test "$localstatedir" = "\${prefix}/var" ; then
# use /var instead of /usr/local/var (/usr/local/var/log isn't standard)
localstatedir="/var"
fi
2009-06-11 17:29:33 +02:00
# Checks for programs.
2009-07-01 22:38:26 +02:00
AC_PROG_CXX
2009-06-11 17:29:33 +02:00
AC_PROG_AWK
AC_PROG_CC
2009-07-01 22:38:26 +02:00
AC_PROG_CPP
2009-06-11 17:29:33 +02:00
AM_PROG_CC_C_O
2009-08-13 22:50:12 +02:00
#AC_PROG_LIBTOOL
2009-06-11 17:29:33 +02:00
# Checks for libraries.
AC_CHECK_LIB([crypto], [AES_cbc_encrypt])
if test "x$ac_cv_lib_crypto_AES_cbc_encrypt" != "xyes"; then
AC_MSG_ERROR([Could not find AES functions from OpenSSL. Make sure the openssl-devel package is installed or that you have installed the suitable source.])
fi
AC_CHECK_LIB([crypto], [RSA_verify])
if test "x$ac_cv_lib_crypto_RSA_verify" != "xyes"; then
AC_MSG_ERROR([Could not find RSA functions from OpenSSL. Make sure the openssl-devel package is installed or that you have installed the suitable source.])
fi
AC_CHECK_LIB([pthread], [pthread_create])
2011-01-05 20:33:16 +01:00
# the simple check below does not work; this could be improved
#AC_CHECK_LIB([m], [pow])
LIBS="$LIBS -lm"
2009-06-11 17:29:33 +02:00
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
# Checks for library functions.
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([bzero gethostbyname gethostname gettimeofday inet_ntoa memmove memset pow select socket strchr strerror strncasecmp strrchr strstr uname])
CFLAGS="$CFLAGS -Wall -DCONFIG_HIP -DSYSCONFDIR=\"\\\"\$(sysconfdir)\\\"\" -DLOCALSTATEDIR=\"\\\"\$(localstatedir)\\\"\" "
2011-06-13 23:59:31 +02:00
AC_MSG_CHECKING(if --enable-vpls option is specified)
AC_ARG_ENABLE(vpls,
2012-03-14 22:31:50 +01:00
[ --enable-vpls=config enable VPLS with configuration via {files, IFMAP}],
2011-06-13 23:59:31 +02:00
[enable_vpls=$enable_vpls
2009-06-11 17:29:33 +02:00
AC_MSG_RESULT(yes)],
2011-06-13 23:59:31 +02:00
[enable_vpls=default
2009-06-11 17:29:33 +02:00
AC_MSG_RESULT(no)])
#
2011-06-13 23:59:31 +02:00
# configure option to define HIP_VPLS
2009-06-11 17:29:33 +02:00
################################################################################
2011-06-13 23:59:31 +02:00
if test "$enable_vpls" = "yes"; then
enable_vpls="files" ;# default value
2009-07-01 22:38:26 +02:00
fi
2012-03-14 22:31:50 +01:00
if test "$enable_vpls" = "files" -o "$enable_vpls" = "IFMAP"; then
2011-06-13 23:59:31 +02:00
want_vpls=true
want_vpls_files_cfg=false
want_vpls_IFMAP_cfg=false
CFLAGS=" -DHIP_VPLS $CFLAGS"
2009-06-11 17:29:33 +02:00
AC_CHECK_LIB([ssl], [SSL_library_init])
if test "x$ac_cv_lib_ssl_SSL_library_init" = "xyes"; then
2009-07-01 22:38:26 +02:00
AC_MSG_RESULT(
2011-06-13 23:59:31 +02:00
[OpenSSL library found for VPLS extensions])
2009-06-11 17:29:33 +02:00
else
2009-07-01 22:38:26 +02:00
AC_MSG_ERROR(
2011-06-13 23:59:31 +02:00
[VPLS extensions requested but OpenSSL library not found.])
2009-07-01 22:38:26 +02:00
fi
2011-06-13 23:59:31 +02:00
if test "$enable_vpls" = "files"; then
2009-07-01 22:38:26 +02:00
AC_MSG_RESULT([Will use file-based configuration library libhipcfgfiles.so])
2011-06-13 23:59:31 +02:00
want_vpls_files_cfg=true
elif test "$enable_vpls" = "IFMAP"; then
2009-07-01 22:38:26 +02:00
AC_MSG_RESULT([Will use IFMAP-based configuration library libhipcfgmap.so])
2011-06-13 23:59:31 +02:00
want_vpls_IFMAP_cfg=true
2009-06-11 17:29:33 +02:00
fi
else
2011-06-13 23:59:31 +02:00
want_vpls=false
2009-06-11 17:29:33 +02:00
fi
#
# Mac OS X detection
################################################################################
2012-03-29 17:57:49 +02:00
AC_CANONICAL_HOST
2009-06-11 17:29:33 +02:00
want_osx=false
case "${host}" in
*-apple-darwin*)
want_osx=true
;;
esac
# Automake conditionals
################################################################################
AM_CONDITIONAL(WANT_OSX, test x$want_osx = xtrue)
2011-06-13 23:59:31 +02:00
AM_CONDITIONAL(WANT_VPLS, test x$want_vpls = xtrue)
AM_CONDITIONAL(WANT_VPLS_FILES_CFG,
test x$want_vpls_files_cfg = xtrue)
AM_CONDITIONAL(WANT_VPLS_IFMAP_CFG,
test x$want_vpls_IFMAP_cfg = xtrue)
2009-06-11 17:29:33 +02:00
2009-07-01 22:38:26 +02:00
PKG_CHECK_MODULES(libxml2, libxml-2.0)
2009-06-11 17:29:33 +02:00
AC_CONFIG_FILES([src/include/hip/hip_version.h
src/linux/openhip.spec
src/win32/install-win32/openhip.nsi
docs/Doxyfile
Makefile
src/Makefile
2009-07-01 22:38:26 +02:00
src/util/Makefile
2009-06-11 17:29:33 +02:00
docs/Makefile])
AC_OUTPUT
#
# Summary message at the end of configure output. Keep this pretty.
################################################################################
AC_MSG_NOTICE([ ])
AC_MSG_NOTICE([=== Finished configuring $PACKAGE_STRING: ===])
AC_MSG_NOTICE([ ])
AC_MSG_NOTICE([ - building HIP user mode binary 'hip'])
AC_MSG_NOTICE([ ])
AC_MSG_NOTICE([ - building 'hitgen' utility])
AC_MSG_NOTICE([ ])
2011-06-13 23:59:31 +02:00
if test $want_vpls = true; then
AC_MSG_NOTICE([ - building virtual private LAN service extensions])
AC_MSG_NOTICE([ - will use $enable_vpls-based configuration library])
2009-06-11 17:29:33 +02:00
else
2011-06-13 23:59:31 +02:00
AC_MSG_NOTICE([ - NOT building virtual private LAN service extensions])
2009-06-11 17:29:33 +02:00
fi
AC_MSG_NOTICE([ ])