2019-04-27 14:54:30 +00:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
# Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
|
|
|
|
|
|
|
# This file is part of Open5GS.
|
|
|
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
AC_INIT([NextEPC],
|
|
|
|
m4_esyscmd([build/git-version-gen .tarball-version]),
|
|
|
|
[acetcom@gmail.com])
|
|
|
|
|
|
|
|
AC_CONFIG_AUX_DIR([build])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2019-06-11 05:26:04 +00:00
|
|
|
AC_CONFIG_TESTDIR(tests)
|
2019-04-27 14:54:30 +00:00
|
|
|
AC_CANONICAL_HOST
|
2017-02-02 11:34:37 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects])
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
AC_CONFIG_HEADERS([lib/base/nextepc-config.h])
|
2017-02-02 11:34:37 +00:00
|
|
|
AC_CONFIG_SRCDIR([main.c])
|
|
|
|
|
2017-12-08 06:05:50 +00:00
|
|
|
LO_DEV="lo0"
|
2017-02-02 11:34:37 +00:00
|
|
|
case $host in
|
2017-02-26 04:09:40 +00:00
|
|
|
*linux*)
|
|
|
|
OSCPPFLAGS="-DLINUX=1"
|
2017-09-06 06:02:43 +00:00
|
|
|
IPFW_CPPFLAGS="-DNEED_SYSCTLBYNAME -DNEED_SIN_LEN"
|
2017-12-08 06:05:50 +00:00
|
|
|
LO_DEV="lo"
|
2017-02-26 04:09:40 +00:00
|
|
|
;;
|
|
|
|
*-apple-darwin*)
|
2017-10-14 15:45:49 +00:00
|
|
|
OSCPPFLAGS="-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK"
|
2017-02-26 04:09:40 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
2017-02-02 11:34:37 +00:00
|
|
|
esac
|
2017-02-26 04:12:06 +00:00
|
|
|
AC_SUBST(OSCPPFLAGS)
|
2017-09-06 06:02:43 +00:00
|
|
|
AC_SUBST(IPFW_CPPFLAGS)
|
2017-12-08 06:05:50 +00:00
|
|
|
AC_SUBST(LO_DEV)
|
2017-02-02 11:34:37 +00:00
|
|
|
|
|
|
|
AH_TOP([
|
2017-07-10 05:33:46 +00:00
|
|
|
#ifndef __NEXTEPC_CONFIG_H__
|
|
|
|
#define __NEXTEPC_CONFIG_H__
|
2017-02-02 11:34:37 +00:00
|
|
|
/* need this, because some autoconf tests rely on this (e.g. stpcpy)
|
|
|
|
* and it should be used for new programs */
|
2017-09-29 10:12:42 +00:00
|
|
|
#define _DEFAULT_SOURCE 1
|
2017-09-29 12:22:03 +00:00
|
|
|
#define _BSD_SOURCE 1
|
2017-02-02 11:34:37 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
AH_BOTTOM([
|
2017-07-10 05:33:46 +00:00
|
|
|
#endif /* __NEXTEPC_CONFIG_H__ */
|
2017-02-02 11:34:37 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
AH_VERBATIM([_REENTRANT],
|
|
|
|
[/* To allow the use of core in multithreaded programs we have to use
|
|
|
|
special features from the library. */
|
|
|
|
#ifndef _REENTRANT
|
|
|
|
# define _REENTRANT 1
|
|
|
|
#endif
|
|
|
|
])
|
|
|
|
|
2017-07-20 14:07:37 +00:00
|
|
|
dnl Checks CC and freinds
|
2017-10-27 03:15:14 +00:00
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_MKDIR_P
|
2017-02-02 11:34:37 +00:00
|
|
|
AC_PROG_CC
|
2018-02-11 12:07:09 +00:00
|
|
|
AM_PROG_CC_C_O
|
2017-02-02 11:34:37 +00:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AM_PROG_AR
|
2019-04-27 14:54:30 +00:00
|
|
|
LT_INIT
|
2017-02-02 11:34:37 +00:00
|
|
|
|
2017-10-27 03:15:14 +00:00
|
|
|
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
|
|
|
if test "x$PKG_CONFIG" = "xno"; then
|
|
|
|
AC_MSG_ERROR([You need to install pkg-config])
|
|
|
|
fi
|
|
|
|
PKG_PROG_PKG_CONFIG([0.20])
|
|
|
|
|
2017-02-08 03:48:35 +00:00
|
|
|
dnl Checks for compile flag
|
2017-03-02 02:43:26 +00:00
|
|
|
AX_CHECK_COMPILE_FLAG([-Wno-unused-result], [CFLAGS="$CFLAGS -Wno-unused-result"])
|
2017-02-08 03:48:35 +00:00
|
|
|
|
2017-10-24 10:14:09 +00:00
|
|
|
##################################
|
|
|
|
#### Checks for Directories. #####
|
|
|
|
##################################
|
2017-10-17 20:51:28 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
AX_RECURSIVE_EVAL(["${bindir}"], [BIN_DIR])
|
|
|
|
AX_RECURSIVE_EVAL(["${libdir}"], [LIB_DIR])
|
|
|
|
AX_RECURSIVE_EVAL(["${sysconfdir}"], [SYSCONF_DIR])
|
|
|
|
AX_RECURSIVE_EVAL(["${localstatedir}"], [LOCALSTATE_DIR])
|
2017-10-27 03:15:14 +00:00
|
|
|
AC_SUBST(BIN_DIR)
|
2017-10-17 20:51:28 +00:00
|
|
|
AC_SUBST(LIB_DIR)
|
|
|
|
AC_SUBST(SYSCONF_DIR)
|
2017-10-23 06:00:07 +00:00
|
|
|
AC_SUBST(LOCALSTATE_DIR)
|
2017-10-17 20:51:28 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
#######################################
|
|
|
|
#### Checks for library functions. ####
|
|
|
|
#######################################
|
|
|
|
|
|
|
|
AC_SEARCH_LIBS(gethostbyname, nsl)
|
|
|
|
AC_SEARCH_LIBS(gethostname, nsl)
|
|
|
|
AC_SEARCH_LIBS(socket, socket)
|
|
|
|
AC_SEARCH_LIBS(pthread_barrier_wait, pthread)
|
|
|
|
AC_SEARCH_LIBS(gnutls_global_set_log_level, gnutls)
|
|
|
|
|
|
|
|
AC_CHECK_FILE([lib/ogslib/configure.ac], [have_srclib=yes], [have_srclib=no])
|
|
|
|
if test x$have_srclib == xyes; then
|
|
|
|
AC_CONFIG_SUBDIRS([lib/ogslib])
|
|
|
|
AC_SUBST(OGSCORE_CFLAGS, '-I$(top_srcdir)/lib/ogslib/src')
|
|
|
|
AC_SUBST(OGSCORE_LIBS, '$(top_srcdir)/lib/ogslib/src/core/libogscore-1.0.la')
|
|
|
|
AC_SUBST(OGSCRYPT_CFLAGS, '-I$(top_srcdir)/lib/ogslib/src')
|
|
|
|
AC_SUBST(OGSCRYPT_LIBS, '$(top_srcdir)/lib/ogslib/src/crypt/libogscrypt-1.0.la')
|
|
|
|
else
|
2019-07-11 13:25:20 +00:00
|
|
|
PKG_CHECK_MODULES(OGSCORE, libogscore-1.0 >= 1.1.0)
|
|
|
|
PKG_CHECK_MODULES(OGSCRYPT, libogscrypt-1.0 >= 1.1.0)
|
2019-04-27 14:54:30 +00:00
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([WITH_SRCLIB], [test x$have_srclib = xyes])
|
|
|
|
|
|
|
|
AC_SEARCH_LIBS([sctp_sendmsg], [sctp], [have_sctp=yes], [have_sctp=no])
|
|
|
|
if test x$have_sctp == xno; then
|
|
|
|
AC_SEARCH_LIBS([usrsctp_init], [usrsctp], [have_usrsctp=yes], [have_usrsctp=no])
|
|
|
|
if test x$have_usrsctp == xno; then
|
|
|
|
AC_MSG_ERROR([You must install the SCTP libraries and development headers to enable SCTP support.])
|
|
|
|
else
|
|
|
|
AC_DEFINE(HAVE_USRSCTP, 1,
|
|
|
|
[Define if your system supports the usrsctp system calls])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([WITH_USRSCTP], [test x$have_usrsctp = xyes])
|
2017-02-02 11:34:37 +00:00
|
|
|
|
|
|
|
AC_CHECK_HEADERS( \
|
|
|
|
netinet/sctp.h \
|
|
|
|
)
|
|
|
|
|
2017-12-17 02:22:12 +00:00
|
|
|
AC_CHECK_HEADERS(netinet/ip.h netinet/ip6.h net/route.h,,,[[
|
2017-10-12 14:01:51 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#if HAVE_SYS_SOCKET_H
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#endif
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#if HAVE_NETINET_IN_SYSTM_H
|
|
|
|
#include <netinet/in_systm.h>
|
|
|
|
#endif
|
|
|
|
]])
|
|
|
|
|
2017-12-16 09:06:34 +00:00
|
|
|
AC_CHECK_HEADERS(netinet/ip_icmp.h netinet/icmp6.h,,,[[
|
2017-12-16 05:53:30 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#if HAVE_SYS_SOCKET_H
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#endif
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#if HAVE_NETINET_IN_SYSTM_H
|
|
|
|
#include <netinet/in_systm.h>
|
|
|
|
#endif
|
|
|
|
#include <netinet/ip.h>
|
|
|
|
]])
|
2017-10-19 03:50:39 +00:00
|
|
|
|
2017-12-18 11:54:57 +00:00
|
|
|
PKG_CHECK_MODULES([YAML], yaml-0.1 >= 0.1.4)
|
2017-09-26 00:19:22 +00:00
|
|
|
PKG_CHECK_MODULES([MONGOC], libmongoc-1.0 >= 1.3.1)
|
2017-09-29 01:10:55 +00:00
|
|
|
FREEDIAMETER_DIR=freeDiameter-1.2.1
|
|
|
|
AC_SUBST(FREEDIAMETER_DIR)
|
2017-07-20 14:07:37 +00:00
|
|
|
|
2017-02-02 11:34:37 +00:00
|
|
|
#####################
|
|
|
|
#### Conclusion. ####
|
|
|
|
#####################
|
|
|
|
|
2017-09-29 01:10:55 +00:00
|
|
|
AC_CONFIG_SUBDIRS([lib/freeDiameter-1.2.1])
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
AC_CONFIG_FILES([lib/base/Makefile])
|
|
|
|
AC_CONFIG_FILES([lib/asn1c/Makefile])
|
2017-02-28 01:20:02 +00:00
|
|
|
AC_CONFIG_FILES([lib/nas/Makefile])
|
2017-08-05 05:23:37 +00:00
|
|
|
AC_CONFIG_FILES([lib/fd/Makefile])
|
2017-03-12 01:23:49 +00:00
|
|
|
AC_CONFIG_FILES([lib/gtp/Makefile])
|
2017-09-06 06:02:43 +00:00
|
|
|
AC_CONFIG_FILES([lib/ipfw/Makefile])
|
2017-02-04 06:26:55 +00:00
|
|
|
AC_CONFIG_FILES([lib/Makefile])
|
2019-04-27 14:54:30 +00:00
|
|
|
AC_CONFIG_FILES([src/app/Makefile])
|
2017-03-04 14:26:22 +00:00
|
|
|
AC_CONFIG_FILES([src/mme/Makefile])
|
2017-03-04 15:20:09 +00:00
|
|
|
AC_CONFIG_FILES([src/hss/Makefile])
|
2017-03-24 09:47:05 +00:00
|
|
|
AC_CONFIG_FILES([src/sgw/Makefile])
|
2017-03-30 15:15:13 +00:00
|
|
|
AC_CONFIG_FILES([src/pgw/Makefile])
|
2017-08-17 05:15:08 +00:00
|
|
|
AC_CONFIG_FILES([src/pcrf/Makefile])
|
2017-02-02 14:00:21 +00:00
|
|
|
AC_CONFIG_FILES([src/Makefile])
|
2017-10-27 03:15:14 +00:00
|
|
|
AC_CONFIG_FILES([support/config/nextepc.conf])
|
2017-10-27 16:15:14 +00:00
|
|
|
AC_CONFIG_FILES([support/config/mme.conf])
|
|
|
|
AC_CONFIG_FILES([support/config/sgw.conf])
|
|
|
|
AC_CONFIG_FILES([support/config/pgw.conf])
|
|
|
|
AC_CONFIG_FILES([support/config/hss.conf])
|
|
|
|
AC_CONFIG_FILES([support/config/pcrf.conf])
|
2017-10-27 03:15:14 +00:00
|
|
|
AC_CONFIG_FILES([support/config/Makefile])
|
2017-08-03 05:09:14 +00:00
|
|
|
AC_CONFIG_FILES([support/freeDiameter/mme.conf])
|
2017-08-16 13:58:12 +00:00
|
|
|
AC_CONFIG_FILES([support/freeDiameter/pgw.conf])
|
2017-10-27 16:15:14 +00:00
|
|
|
AC_CONFIG_FILES([support/freeDiameter/hss.conf])
|
2017-08-16 13:58:12 +00:00
|
|
|
AC_CONFIG_FILES([support/freeDiameter/pcrf.conf])
|
2017-10-24 10:14:09 +00:00
|
|
|
AC_CONFIG_FILES([support/freeDiameter/Makefile])
|
2017-10-27 03:15:14 +00:00
|
|
|
AC_CONFIG_FILES([support/systemd/nextepc-mmed.service])
|
|
|
|
AC_CONFIG_FILES([support/systemd/nextepc-sgwd.service])
|
|
|
|
AC_CONFIG_FILES([support/systemd/nextepc-pgwd.service])
|
|
|
|
AC_CONFIG_FILES([support/systemd/nextepc-hssd.service])
|
|
|
|
AC_CONFIG_FILES([support/systemd/nextepc-pcrfd.service])
|
2017-10-29 11:16:18 +00:00
|
|
|
AC_CONFIG_FILES([support/systemd/Makefile])
|
2017-10-24 10:14:09 +00:00
|
|
|
AC_CONFIG_FILES([support/logrotate/nextepc])
|
2017-10-29 11:16:18 +00:00
|
|
|
AC_CONFIG_FILES([support/logrotate/Makefile])
|
2017-10-24 13:46:09 +00:00
|
|
|
AC_CONFIG_FILES([support/newsyslog/nextepc.conf])
|
2017-10-29 11:16:18 +00:00
|
|
|
AC_CONFIG_FILES([support/newsyslog/Makefile])
|
2017-10-24 10:14:09 +00:00
|
|
|
AC_CONFIG_FILES([support/Makefile])
|
2019-06-11 05:26:04 +00:00
|
|
|
AC_CONFIG_FILES([tests/sample.conf])
|
|
|
|
AC_CONFIG_FILES([tests/sample-simple.conf])
|
|
|
|
AC_CONFIG_FILES([tests/sample-volte.conf])
|
2019-06-15 10:37:34 +00:00
|
|
|
AC_CONFIG_FILES([tests/sample-csfb.conf])
|
2019-06-11 05:26:04 +00:00
|
|
|
AC_CONFIG_FILES([tests/Makefile])
|
2017-02-02 14:00:21 +00:00
|
|
|
AC_CONFIG_FILES([Makefile])
|
2017-02-02 11:34:37 +00:00
|
|
|
AC_OUTPUT
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
AC_MSG_NOTICE([NextEPC configuration:
|
|
|
|
|
|
|
|
version: ${PACKAGE_VERSION}
|
|
|
|
compiler: ${CC}
|
|
|
|
compiler flags: ${CFLAGS} ${OGSLIB_CFLAGS} ${MONGOC_CFLAGS}
|
|
|
|
linker flags: ${LDFLAGS} ${LIBS} ${OGSCORE_LIBS} ${OGSCRYPT_LIBS} ${MONGOC_LIBS}
|
|
|
|
path prefix: ${prefix}
|
|
|
|
binary file: ${BIN_DIR}/nextepc-epcd
|
|
|
|
library directory: ${LIB_DIR}/nextepc
|
|
|
|
configuration prefix: ${SYSCONF_DIR}/nextepc
|
|
|
|
configuration file: ${SYSCONF_DIR}/nextepc/nextepc.conf
|
|
|
|
pid file: ${LOCALSTATE_DIR}/run/nextepc.pid
|
|
|
|
logging file: ${LOCALSTATE_DIR}/log/nextepc.log
|
|
|
|
])
|