File: configure.ac

package info (click to toggle)
nextepc 0.3.10%2Bnods-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 23,304 kB
  • sloc: ansic: 164,982; yacc: 2,767; python: 2,567; makefile: 2,408; lex: 1,732; xml: 795; php: 486; sh: 349; sql: 337; perl: 75; awk: 35; cpp: 6
file content (224 lines) | stat: -rw-r--r-- 7,909 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
dnl Process this file with autoconf to produce a configure script.
dnl
dnl This file is free software; as a special exception the author gives
dnl unlimited permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

AC_INIT([nextepc], [1.2.1], [acetcom@gmail.com])

AC_SUBST(LIBVERSION)
LIBVERSION=1:0:0

dnl Must come before AM_INIT_AUTOMAKE.
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign])

# Where to generate output; srcdir location.
AC_CONFIG_HEADERS([include/freeDiameter/config.h])
AC_CANONICAL_HOST
case $host in
    *-freebsd*)
        AC_DEFINE_UNQUOTED([SCTP_USE_MAPPED_ADDRESSES],
                [1], [Disable SCTP])
        ;;
    *)
        ;;
esac

AH_TOP([
#ifndef FD_IS_CONFIG
#define FD_IS_CONFIG

#define _GNU_SOURCE  1

#ifdef __cplusplus
extern "C" {
#endif

])

AH_BOTTOM([
#define FD_PROJECT_COPYRIGHT "Copyright (c) 2008-2015, WIDE Project (www.wide.ad.jp) and NICT (www.nict.go.jp)"

#ifndef FD_DEFAULT_CONF_FILENAME
#define FD_DEFAULT_CONF_FILENAME "freeDiameter.conf"
#endif /* FD_DEFAULT_CONF_FILENAME */

/* Maximum number of hooks handlers that can be registered. Make this compilation option if needed */
#define FD_HOOK_HANDLE_LIMIT	5

#ifdef __cplusplus
}
#endif

#endif /* FD_IS_CONFIG */
])

dnl kernel style compile messages
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

dnl Checks CC and freinds
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_YACC
AC_PROG_LEX
AM_PROG_AR
LT_INIT([dlopen pic-only disable-static])

dnl Checks for compile flag
dnl AX_CHECK_COMPILE_FLAG([-Wno-format-truncation],[CFLAGS="$CFLAGS -Wno-format-truncation"])

dnl Check Endian
AC_C_BIGENDIAN

#############################
#### From FreeDiameter CMAKE 
#############################
touch include/freeDiameter/version.h
rm -f libfdcore/fdd.tab.y
ln -s fdd.y libfdcore/fdd.tab.y
rm -f libfdcore/lex.fdd.l
ln -s fdd.l libfdcore/lex.fdd.l

AC_DEFINE_UNQUOTED([FD_PROJECT_BINARY],
        ["freeDiameterd"], [Project Binary])
AC_DEFINE_UNQUOTED([FD_PROJECT_NAME],
        ["freeDiameter"], [Project Name])
AC_DEFINE_UNQUOTED([FD_PROJECT_VERSION_MAJOR],
        [`echo $PACKAGE_VERSION | $SED 's/^\([[^\.]]\+\)\.\([[^\.]]\+\)\.\([[^\.]]\+\).*/\1/'`],
        [Major version of this package])
AC_DEFINE_UNQUOTED([FD_PROJECT_VERSION_MINOR],
        [`echo $PACKAGE_VERSION | $SED 's/^\([[^\.]]\+\)\.\([[^\.]]\+\)\.\([[^\.]]\+\).*/\2/'`],
        [Minor version of this package])
AC_DEFINE_UNQUOTED([FD_PROJECT_VERSION_REV],
        [`echo $PACKAGE_VERSION | $SED 's/^\([[^\.]]\+\)\.\([[^\.]]\+\)\.\([[^\.]]\+\).*/\3/'`],
        [Patch version of this package])
AC_DEFINE_UNQUOTED([FD_PROJECT_VERSION_API],
        [6],
        [API version of this package])

# adl_RECURSIVE_EVAL(VALUE, RESULT)
# =================================
# Interpolate the VALUE in loop until it doesn't change,
# and set the result to $RESULT.
# WARNING: It's easy to get an infinite loop with some unsane input.
# For example ${datadir} becomes ${datarootdir}, and then ${prefix}/share, and
# finally ${prefix} is replaced by the prefix.
AC_DEFUN([adl_RECURSIVE_EVAL],
[_lcl_receval="$1"
$2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
     _lcl_receval_old=''
     while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do
       _lcl_receval_old="[$]_lcl_receval"
       eval _lcl_receval="\"[$]_lcl_receval\""
     done
     echo "[$]_lcl_receval")`])
adl_RECURSIVE_EVAL(["${libdir}"], [LIB_DIR])
adl_RECURSIVE_EVAL(["${sysconfdir}"], [SYSCONF_DIR])

AC_SUBST(extlibdir)
libdir=${prefix}/lib
extlibdir=${prefix}/lib/nextepc/freeDiameter
AC_DEFINE_UNQUOTED([DEFAULT_CONF_PATH],
        ["${SYSCONF_DIR}/nextepc/freeDiameter"], [Default Configuration Path])
AC_DEFINE_UNQUOTED([DEFAULT_EXTENSIONS_PATH],
        ["/usr/lib/nextepc/freeDiameter"], [Default Extensions Path])
AC_SUBST(PREFIX)

AC_CHECK_FUNCS([strndup])

AC_CHECK_DECL([ntohll],[AC_DEFINE([HAVE_NTOHLL], [1],
              [Define to 1 if you have ntohll.])])
AC_CHECK_DECL([AI_ADDRCONFIG],
              [AC_DEFINE([HAVE_AI_ADDRCONFIG], [1], [Define AI_ADDRCONFIG])], [], [[#include <netdb.h>]])

AC_SEARCH_LIBS([clock_gettime], [rt],
             [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define clock_gettime])])
AC_SEARCH_LIBS([dlopen], [dl dld])
AC_SEARCH_LIBS([pthread_barrier_wait], [pthread],
             [AC_DEFINE([HAVE_PTHREAD_BAR], [1],
                        [Define to 1 if you have pthread_barrier_wait in libpthread])],
             [])
AC_SEARCH_LIBS([sctp_sendmsg], [sctp], [have_sctp_lib=yes])
if test x$have_sctp_lib != xyes; then
    AC_DEFINE([DISABLE_SCTP], [1], [Disable SCTP])
fi
AM_CONDITIONAL([SCTP], [test x$have_sctp_lib = xyes])

AC_SEARCH_LIBS([gnutls_global_init], [gnutls],, [have_gnutls_lib=no])
if test x$have_gnutls_lib == xno; then
  AC_MSG_ERROR([You must install the GnuTLS libraries and development headers to enable GnuTLS support.])
fi
AC_SEARCH_LIBS([gnutls_hash], [gnutls],
             [AC_DEFINE(GNUTLS_VERSION_210, 1,
              [Define to 1 if you have gnutls 2.10 installed])], [])
AC_SEARCH_LIBS([gnutls_transport_set_vec_push_function], [gnutls], 
             [AC_DEFINE(GNUTLS_VERSION_212, 1,
              [Define to 1 if you have gnutls 2.10 installed])], [])
AC_SEARCH_LIBS([gnutls_x509_trust_list_verify_crt], [gnutls],
             [AC_DEFINE(GNUTLS_VERSION_300, 1,
              [Define to 1 if you have gnutls 3.0 installed])], [])
AC_SEARCH_LIBS([gnutls_handshake_set_timeout], [gnutls],
             [AC_DEFINE(GNUTLS_VERSION_310, 1,
              [Define to 1 if you have gnutls 3.1 installed])], [])

AC_SEARCH_LIBS([gcry_control], [gcrypt],, [have_gcrypt_lib=no])
if test x$have_gcrypt_lib == xno; then
  AC_MSG_ERROR([You must install the Libgcrypt libraries and development headers to enable Libgcrypt support.])
fi
AC_SEARCH_LIBS([idna_strerror], [idn],, [have_idn_lib=no])
if test x$have_idn_lib == xno; then
  AC_MSG_ERROR([You must install the GNU Libidn libraries and development headers to enable GNU Libidn support.])
fi

AC_CACHE_CHECK([whether sctp_connectx function accepts 4 arguments],
               [ap_cv_sctp_connectx],
[AC_TRY_COMPILE(
 [#include <unistd.h>
#include <netinet/sctp.h>],
 [sctp_connectx(0, NULL, 0, NULL);],
 [ap_cv_sctp_connectx=yes], [ap_cv_sctp_connectx=no])
])

if test "$ap_cv_sctp_connectx" = "yes"; then
    AC_DEFINE([SCTP_CONNECTX_4_ARGS], [1],
              [Define 1 if sctp_connectx function accepts 4 arguments])
fi

#####################
#### Conclusion. ####
#####################

AC_CONFIG_FILES([include/freeDiameter/freeDiameter-host.h:include/freeDiameter/freeDiameter-host.hin])
AC_CONFIG_FILES([libfdproto/Makefile])
AC_CONFIG_FILES([libfdcore/Makefile])
AC_CONFIG_FILES([extensions/dbg_msg_dumps/Makefile])
AC_CONFIG_FILES([extensions/dict_rfc5777/Makefile])
AC_CONFIG_FILES([extensions/dict_mip6i/Makefile])
AC_CONFIG_FILES([extensions/dict_nasreq/Makefile])
AC_CONFIG_FILES([extensions/dict_nas_mipv6/Makefile])
AC_CONFIG_FILES([extensions/dict_dcca/Makefile])
AC_CONFIG_FILES([extensions/dict_dcca_3gpp/Makefile])
AC_CONFIG_FILES([extensions/dict_s6a/Makefile])
AC_CONFIG_FILES([extensions/Makefile])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

echo "
FreeDiameter configuration
--------------------
version                 : ${PACKAGE_VERSION}
host                    : ${host}
source code location    : ${srcdir}
compiler                : ${CC}
compiler flags          : ${CFLAGS}
linker flags            : ${LDFLAGS} ${LIBS}
config directory        : ${SYSCONF_DIR}/nextepc/freeDiameter
extensions directory    : /usr/lib/nextepc
"