| 1 |
dnl Process this file with autoconf to produce a configure script. |
| 2 |
dnl |
| 3 |
dnl This file is free software; as a special exception the author gives |
| 4 |
dnl unlimited permission to copy and/or distribute it, with or without |
| 5 |
dnl modifications, as long as this notice is preserved. |
| 6 |
dnl |
| 7 |
dnl This program is distributed in the hope that it will be useful, but |
| 8 |
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the |
| 9 |
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 10 |
|
| 11 |
AC_INIT([nextepc], [1.2.1], [[email protected]]) |
| 12 |
|
| 13 |
AC_SUBST(LIBVERSION) |
| 14 |
LIBVERSION=1:0:0 |
| 15 |
|
| 16 |
dnl Must come before AM_INIT_AUTOMAKE. |
| 17 |
AC_CONFIG_AUX_DIR([build-aux]) |
| 18 |
AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign]) |
| 19 |
|
| 20 |
# Where to generate output; srcdir location. |
| 21 |
AC_CONFIG_HEADERS([include/freeDiameter/config.h]) |
| 22 |
AC_CANONICAL_HOST |
| 23 |
case $host in |
| 24 |
*-freebsd*) |
| 25 |
AC_DEFINE_UNQUOTED([SCTP_USE_MAPPED_ADDRESSES], |
| 26 |
[1], [Disable SCTP]) |
| 27 |
;; |
| 28 |
*) |
| 29 |
;; |
| 30 |
esac |
| 31 |
|
| 32 |
AH_TOP([ |
| 33 |
#ifndef FD_IS_CONFIG |
| 34 |
#define FD_IS_CONFIG |
| 35 |
|
| 36 |
#define _GNU_SOURCE 1 |
| 37 |
|
| 38 |
#ifdef __cplusplus |
| 39 |
extern "C" { |
| 40 |
#endif |
| 41 |
|
| 42 |
]) |
| 43 |
|
| 44 |
AH_BOTTOM([ |
| 45 |
#define FD_PROJECT_COPYRIGHT "Copyright (c) 2008-2015, WIDE Project (www.wide.ad.jp) and NICT (www.nict.go.jp)" |
| 46 |
|
| 47 |
#ifndef FD_DEFAULT_CONF_FILENAME |
| 48 |
#define FD_DEFAULT_CONF_FILENAME "freeDiameter.conf" |
| 49 |
#endif /* FD_DEFAULT_CONF_FILENAME */ |
| 50 |
|
| 51 |
/* Maximum number of hooks handlers that can be registered. Make this compilation option if needed */ |
| 52 |
#define FD_HOOK_HANDLE_LIMIT 5 |
| 53 |
|
| 54 |
#ifdef __cplusplus |
| 55 |
} |
| 56 |
#endif |
| 57 |
|
| 58 |
#endif /* FD_IS_CONFIG */ |
| 59 |
]) |
| 60 |
|
| 61 |
dnl kernel style compile messages |
| 62 |
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 63 |
|
| 64 |
dnl Checks CC and freinds |
| 65 |
AC_PROG_MAKE_SET |
| 66 |
AC_PROG_CC |
| 67 |
AC_PROG_INSTALL |
| 68 |
AC_PROG_YACC |
| 69 |
AC_PROG_LEX |
| 70 |
AM_PROG_AR |
| 71 |
LT_INIT([dlopen pic-only disable-static]) |
| 72 |
|
| 73 |
dnl Checks for compile flag |
| 74 |
dnl AX_CHECK_COMPILE_FLAG([-Wno-format-truncation],[CFLAGS="$CFLAGS -Wno-format-truncation"]) |
| 75 |
|
| 76 |
dnl Check Endian |
| 77 |
AC_C_BIGENDIAN |
| 78 |
|
| 79 |
############################# |
| 80 |
#### From FreeDiameter CMAKE |
| 81 |
############################# |
| 82 |
touch include/freeDiameter/version.h |
| 83 |
rm -f libfdcore/fdd.tab.y |
| 84 |
ln -s fdd.y libfdcore/fdd.tab.y |
| 85 |
rm -f libfdcore/lex.fdd.l |
| 86 |
ln -s fdd.l libfdcore/lex.fdd.l |
| 87 |
|
| 88 |
AC_DEFINE_UNQUOTED([FD_PROJECT_BINARY], |
| 89 |
["freeDiameterd"], [Project Binary]) |
| 90 |
AC_DEFINE_UNQUOTED([FD_PROJECT_NAME], |
| 91 |
["freeDiameter"], [Project Name]) |
| 92 |
AC_DEFINE_UNQUOTED([FD_PROJECT_VERSION_MAJOR], |
| 93 |
[`echo $PACKAGE_VERSION | $SED 's/^\([[^\.]]\+\)\.\([[^\.]]\+\)\.\([[^\.]]\+\).*/\1/'`], |
| 94 |
[Major version of this package]) |
| 95 |
AC_DEFINE_UNQUOTED([FD_PROJECT_VERSION_MINOR], |
| 96 |
[`echo $PACKAGE_VERSION | $SED 's/^\([[^\.]]\+\)\.\([[^\.]]\+\)\.\([[^\.]]\+\).*/\2/'`], |
| 97 |
[Minor version of this package]) |
| 98 |
AC_DEFINE_UNQUOTED([FD_PROJECT_VERSION_REV], |
| 99 |
[`echo $PACKAGE_VERSION | $SED 's/^\([[^\.]]\+\)\.\([[^\.]]\+\)\.\([[^\.]]\+\).*/\3/'`], |
| 100 |
[Patch version of this package]) |
| 101 |
AC_DEFINE_UNQUOTED([FD_PROJECT_VERSION_API], |
| 102 |
[6], |
| 103 |
[API version of this package]) |
| 104 |
|
| 105 |
# adl_RECURSIVE_EVAL(VALUE, RESULT) |
| 106 |
# ================================= |
| 107 |
# Interpolate the VALUE in loop until it doesn't change, |
| 108 |
# and set the result to $RESULT. |
| 109 |
# WARNING: It's easy to get an infinite loop with some unsane input. |
| 110 |
# For example ${datadir} becomes ${datarootdir}, and then ${prefix}/share, and |
| 111 |
# finally ${prefix} is replaced by the prefix. |
| 112 |
AC_DEFUN([adl_RECURSIVE_EVAL], |
| 113 |
[_lcl_receval="$1" |
| 114 |
$2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" |
| 115 |
test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" |
| 116 |
_lcl_receval_old='' |
| 117 |
while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do |
| 118 |
_lcl_receval_old="[$]_lcl_receval" |
| 119 |
eval _lcl_receval="\"[$]_lcl_receval\"" |
| 120 |
done |
| 121 |
echo "[$]_lcl_receval")`]) |
| 122 |
adl_RECURSIVE_EVAL(["${libdir}"], [LIB_DIR]) |
| 123 |
adl_RECURSIVE_EVAL(["${sysconfdir}"], [SYSCONF_DIR]) |
| 124 |
|
| 125 |
AC_SUBST(extlibdir) |
| 126 |
extlibdir=${libdir}/nextepc/freeDiameter |
| 127 |
AC_DEFINE_UNQUOTED([DEFAULT_CONF_PATH], |
| 128 |
["${SYSCONF_DIR}/nextepc/freeDiameter"], [Default Configuration Path]) |
| 129 |
AC_DEFINE_UNQUOTED([DEFAULT_EXTENSIONS_PATH], |
| 130 |
["${LIB_DIR}/nextepc/freeDiameter"], [Default Extensions Path]) |
| 131 |
AC_SUBST(PREFIX) |
| 132 |
|
| 133 |
AC_CHECK_FUNCS([strndup]) |
| 134 |
|
| 135 |
AC_CHECK_DECL([ntohll],[AC_DEFINE([HAVE_NTOHLL], [1], |
| 136 |
[Define to 1 if you have ntohll.])]) |
| 137 |
AC_CHECK_DECL([AI_ADDRCONFIG], |
| 138 |
[AC_DEFINE([HAVE_AI_ADDRCONFIG], [1], [Define AI_ADDRCONFIG])], [], [[#include <netdb.h>]]) |
| 139 |
|
| 140 |
AC_SEARCH_LIBS([clock_gettime], [rt], |
| 141 |
[AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define clock_gettime])]) |
| 142 |
AC_SEARCH_LIBS([dlopen], [dl dld]) |
| 143 |
AC_SEARCH_LIBS([pthread_barrier_wait], [pthread], |
| 144 |
[AC_DEFINE([HAVE_PTHREAD_BAR], [1], |
| 145 |
[Define to 1 if you have pthread_barrier_wait in libpthread])], |
| 146 |
[]) |
| 147 |
AC_SEARCH_LIBS([sctp_sendmsg], [sctp], [have_sctp_lib=yes]) |
| 148 |
if test x$have_sctp_lib != xyes; then |
| 149 |
AC_DEFINE([DISABLE_SCTP], [1], [Disable SCTP]) |
| 150 |
fi |
| 151 |
AM_CONDITIONAL([SCTP], [test x$have_sctp_lib = xyes]) |
| 152 |
|
| 153 |
AC_SEARCH_LIBS([gnutls_global_init], [gnutls],, [have_gnutls_lib=no]) |
| 154 |
if test x$have_gnutls_lib == xno; then |
| 155 |
AC_MSG_ERROR([You must install the GnuTLS libraries and development headers to enable GnuTLS support.]) |
| 156 |
fi |
| 157 |
AC_SEARCH_LIBS([gnutls_hash], [gnutls], |
| 158 |
[AC_DEFINE(GNUTLS_VERSION_210, 1, |
| 159 |
[Define to 1 if you have gnutls 2.10 installed])], []) |
| 160 |
AC_SEARCH_LIBS([gnutls_transport_set_vec_push_function], [gnutls], |
| 161 |
[AC_DEFINE(GNUTLS_VERSION_212, 1, |
| 162 |
[Define to 1 if you have gnutls 2.10 installed])], []) |
| 163 |
AC_SEARCH_LIBS([gnutls_x509_trust_list_verify_crt], [gnutls], |
| 164 |
[AC_DEFINE(GNUTLS_VERSION_300, 1, |
| 165 |
[Define to 1 if you have gnutls 3.0 installed])], []) |
| 166 |
AC_SEARCH_LIBS([gnutls_handshake_set_timeout], [gnutls], |
| 167 |
[AC_DEFINE(GNUTLS_VERSION_310, 1, |
| 168 |
[Define to 1 if you have gnutls 3.1 installed])], []) |
| 169 |
|
| 170 |
AC_SEARCH_LIBS([gcry_control], [gcrypt],, [have_gcrypt_lib=no]) |
| 171 |
if test x$have_gcrypt_lib == xno; then |
| 172 |
AC_MSG_ERROR([You must install the Libgcrypt libraries and development headers to enable Libgcrypt support.]) |
| 173 |
fi |
| 174 |
AC_SEARCH_LIBS([idna_strerror], [idn],, [have_idn_lib=no]) |
| 175 |
if test x$have_idn_lib == xno; then |
| 176 |
AC_MSG_ERROR([You must install the GNU Libidn libraries and development headers to enable GNU Libidn support.]) |
| 177 |
fi |
| 178 |
|
| 179 |
AC_CACHE_CHECK([whether sctp_connectx function accepts 4 arguments], |
| 180 |
[ap_cv_sctp_connectx], |
| 181 |
[AC_TRY_COMPILE( |
| 182 |
[#include <unistd.h> |
| 183 |
#include <netinet/sctp.h>], |
| 184 |
[sctp_connectx(0, NULL, 0, NULL);], |
| 185 |
[ap_cv_sctp_connectx=yes], [ap_cv_sctp_connectx=no]) |
| 186 |
]) |
| 187 |
|
| 188 |
if test "$ap_cv_sctp_connectx" = "yes"; then |
| 189 |
AC_DEFINE([SCTP_CONNECTX_4_ARGS], [1], |
| 190 |
[Define 1 if sctp_connectx function accepts 4 arguments]) |
| 191 |
fi |
| 192 |
|
| 193 |
##################### |
| 194 |
#### Conclusion. #### |
| 195 |
##################### |
| 196 |
|
| 197 |
AC_CONFIG_FILES([include/freeDiameter/freeDiameter-host.h:include/freeDiameter/freeDiameter-host.hin]) |
| 198 |
AC_CONFIG_FILES([libfdproto/Makefile]) |
| 199 |
AC_CONFIG_FILES([libfdcore/Makefile]) |
| 200 |
AC_CONFIG_FILES([extensions/dbg_msg_dumps/Makefile]) |
| 201 |
AC_CONFIG_FILES([extensions/dict_rfc5777/Makefile]) |
| 202 |
AC_CONFIG_FILES([extensions/dict_mip6i/Makefile]) |
| 203 |
AC_CONFIG_FILES([extensions/dict_nasreq/Makefile]) |
| 204 |
AC_CONFIG_FILES([extensions/dict_nas_mipv6/Makefile]) |
| 205 |
AC_CONFIG_FILES([extensions/dict_dcca/Makefile]) |
| 206 |
AC_CONFIG_FILES([extensions/dict_dcca_3gpp/Makefile]) |
| 207 |
AC_CONFIG_FILES([extensions/dict_s6a/Makefile]) |
| 208 |
AC_CONFIG_FILES([extensions/Makefile]) |
| 209 |
AC_CONFIG_FILES([Makefile]) |
| 210 |
AC_OUTPUT |
| 211 |
|
| 212 |
echo " |
| 213 |
FreeDiameter configuration |
| 214 |
-------------------- |
| 215 |
version : ${PACKAGE_VERSION} |
| 216 |
host : ${host} |
| 217 |
source code location : ${srcdir} |
| 218 |
compiler : ${CC} |
| 219 |
compiler flags : ${CFLAGS} |
| 220 |
linker flags : ${LDFLAGS} ${LIBS} |
| 221 |
config directory : ${SYSCONF_DIR}/nextepc/freeDiameter |
| 222 |
extensions directory : ${LIB_DIR}/nextepc |
| 223 |
" |