2013-06-20 13:11:33 -04:00
|
|
|
AC_PREREQ([2.59])
|
2017-12-22 09:16:21 -05:00
|
|
|
AC_INIT([sngrep], [1.4.5], [kaian@irontec.com], [sngrep], [http://www.irontec.com/])
|
2015-02-23 13:14:26 -05:00
|
|
|
AM_INIT_AUTOMAKE([1.9])
|
2014-10-14 12:18:38 -04:00
|
|
|
AC_CONFIG_HEADERS([src/config.h])
|
2017-05-30 05:15:49 -04:00
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
m4_ifdef([AC_CONFIG_MACRO_DIRS], AC_CONFIG_MACRO_DIRS([m4]), m4_include([m4/sngrep.m4]))
|
2013-06-20 13:11:33 -04:00
|
|
|
|
|
|
|
AC_COPYRIGHT("Irontec S.L.")
|
|
|
|
|
|
|
|
# Define _GNU_SOURCE etc.
|
2015-02-23 13:14:26 -05:00
|
|
|
m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [AC_USE_SYSTEM_EXTENSIONS])
|
2013-06-20 13:11:33 -04:00
|
|
|
|
2013-06-22 11:32:51 -04:00
|
|
|
# debug compilation
|
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
AC_HELP_STRING(--enable-debug, [Debug compilation (Default = no)]),
|
|
|
|
enable_debug=$enableval, enable_debug=no)
|
|
|
|
|
|
|
|
if test "$enable_debug" = "yes" ; then
|
2015-09-15 12:49:36 -04:00
|
|
|
CFLAGS="$CFLAGS -g -O0 -Wall -Werror -Wno-unused-but-set-variable"
|
2014-03-18 07:05:11 -04:00
|
|
|
CXXFLAGS="$CXXFLAGS $CFLAGS"
|
2013-06-22 11:32:51 -04:00
|
|
|
fi
|
|
|
|
|
2013-06-20 13:11:33 -04:00
|
|
|
# Minimum checks for a C program :)
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_EGREP
|
|
|
|
AC_LANG(C)
|
2017-09-11 06:26:28 -04:00
|
|
|
AM_PROG_CC_C_O
|
2013-06-20 13:11:33 -04:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# Check for other REQUIRED libraries
|
2015-03-01 08:49:50 -05:00
|
|
|
AC_CHECK_LIB([pcap], [pcap_open_offline], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have libpcap installed to compile sngrep.])
|
|
|
|
])
|
|
|
|
AC_CHECK_HEADER([pcap.h], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have libpcap development files installed to compile sngrep.])
|
|
|
|
])
|
|
|
|
|
2018-04-07 07:02:40 -04:00
|
|
|
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.16])
|
|
|
|
|
2015-03-01 08:49:50 -05:00
|
|
|
####
|
|
|
|
#### Ncurses Wide character support
|
|
|
|
####
|
2015-02-24 09:32:54 -05:00
|
|
|
AC_ARG_ENABLE([unicode],
|
|
|
|
AC_HELP_STRING([--enable-unicode], [Enable Ncurses Unicode support]),
|
|
|
|
[AC_SUBST(UNICODE, $enableval)],
|
|
|
|
[AC_SUBST(UNICODE, no)]
|
|
|
|
)
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_unicode" == "xyes"], [
|
|
|
|
# Ncurses with wide-character support
|
|
|
|
AC_DEFINE([WITH_UNICODE], [], [Compile With Unicode compatibility])
|
|
|
|
|
2017-05-30 05:15:49 -04:00
|
|
|
SNGREP_CHECK_SCRIPT([ncursesw6], [addnwstr], [WITH_UNICODE], "ncursesw6-config",
|
|
|
|
SNGREP_CHECK_SCRIPT([ncursesw], [addnwstr], [WITH_UNICODE], "ncursesw5-config",
|
|
|
|
SNGREP_CHECK_SCRIPT([ncurses], [addnwstr], [WITH_UNICODE], "ncurses5-config",
|
|
|
|
SNGREP_CHECK_LIB([ncursesw6], [addnwstr], [WITH_UNICODE],
|
|
|
|
SNGREP_CHECK_LIB([ncursesw], [addnwstr], [WITH_UNICODE],
|
|
|
|
SNGREP_CHECK_LIB([ncurses], [addnwstr], [WITH_UNICODE],
|
|
|
|
))))))
|
2013-06-20 13:11:33 -04:00
|
|
|
|
2015-02-24 09:32:54 -05:00
|
|
|
AC_CHECK_LIB([panelw], [new_panel], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have ncurses panelw library installed to compile sngrep.])
|
|
|
|
])
|
2014-03-18 07:05:11 -04:00
|
|
|
|
2015-02-24 09:32:54 -05:00
|
|
|
AC_CHECK_LIB([formw], [new_form], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have ncurses formsw library installed to compile sngrep.])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_LIB([menuw], [new_item], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have ncurses menuw library installed to compile sngrep.])
|
|
|
|
])
|
|
|
|
], [
|
2013-06-20 13:11:33 -04:00
|
|
|
|
2015-02-24 09:32:54 -05:00
|
|
|
# Ncurses without wide-character support
|
2015-03-06 11:13:35 -05:00
|
|
|
AC_CHECK_HEADER([ncurses.h], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have ncurses development files installed to compile sngrep.])
|
|
|
|
])
|
|
|
|
|
2015-02-24 09:32:54 -05:00
|
|
|
AC_CHECK_LIB([ncurses], [initscr], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have libncurses installed to compile sngrep.])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_LIB([panel], [new_panel], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have ncurses panel library installed to compile sngrep.])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_LIB([form], [new_form], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have ncurses forms library installed to compile sngrep.])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_LIB([menu], [new_item], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have ncurses menu library installed to compile sngrep.])
|
|
|
|
])
|
2015-02-03 09:11:46 -05:00
|
|
|
])
|
|
|
|
|
2015-03-01 08:49:50 -05:00
|
|
|
####
|
2015-10-16 12:30:51 -04:00
|
|
|
#### GnuTLS Support
|
2015-03-01 08:49:50 -05:00
|
|
|
####
|
2015-10-16 12:30:51 -04:00
|
|
|
AC_ARG_WITH([gnutls],
|
|
|
|
AS_HELP_STRING([--with-gnutls], [Enable SSL Support (TLS SIP Transport)]),
|
|
|
|
[AC_SUBST(WITH_GNUTLS, $withval)],
|
|
|
|
[AC_SUBST(WITH_GNUTLS, no)]
|
2015-02-25 08:51:13 -05:00
|
|
|
)
|
2014-10-27 09:40:58 -04:00
|
|
|
|
2015-10-16 12:30:51 -04:00
|
|
|
AS_IF([test "x$WITH_GNUTLS" == "xyes"], [
|
2017-05-20 09:00:16 -04:00
|
|
|
|
|
|
|
m4_ifdef([PKG_CHECK_MODULES], [
|
|
|
|
PKG_CHECK_MODULES([LIBGNUTLS], [gnutls])
|
|
|
|
], [
|
2015-10-16 12:30:51 -04:00
|
|
|
AC_CHECK_LIB([gnutls], [gnutls_init], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have gnutls installed to compile sngrep])
|
|
|
|
])
|
2017-05-20 09:00:16 -04:00
|
|
|
])
|
2015-10-16 12:30:51 -04:00
|
|
|
|
2017-05-20 11:00:56 -04:00
|
|
|
AC_PATH_PROG([LIBGCRYPT_CONFIG],[libgcrypt-config],[no])
|
|
|
|
if test "x${LIBGCRYPT_CONFIG}" = "xno"; then
|
|
|
|
AC_MSG_FAILURE([libgcrypt-config not found in PATH])
|
|
|
|
fi
|
|
|
|
AC_CHECK_LIB(
|
|
|
|
[gcrypt],
|
|
|
|
[gcry_md_map_name],
|
|
|
|
[LIBGCRYPT_CFLAGS="`${LIBGCRYPT_CONFIG} --cflags`"
|
|
|
|
LIBGCRYPT_LIBS="`${LIBGCRYPT_CONFIG} --libs`"
|
|
|
|
],
|
|
|
|
[AC_MSG_ERROR([ You need to have libgcrypt installed to compile sngrep])],
|
|
|
|
[`${LIBGCRYPT_CONFIG} --libs --cflags`]
|
|
|
|
)
|
2015-10-16 12:30:51 -04:00
|
|
|
AC_DEFINE([WITH_GNUTLS],[],[Compile With GnuTLS compatibility])
|
2017-05-20 11:00:56 -04:00
|
|
|
AC_SUBST(LIBGCRYPT_CFLAGS)
|
|
|
|
AC_SUBST(LIBGCRYPT_LIBS)
|
2014-10-27 09:40:58 -04:00
|
|
|
], [])
|
|
|
|
|
2015-10-22 13:02:47 -04:00
|
|
|
####
|
|
|
|
#### OpenSSL Support
|
|
|
|
####
|
|
|
|
AC_ARG_WITH([openssl],
|
|
|
|
AS_HELP_STRING([--with-openssl], [Enable SSL Support (TLS SIP Transport)]),
|
|
|
|
[AC_SUBST(WITH_OPENSSL, $withval)],
|
|
|
|
[AC_SUBST(WITH_OPENSSL, no)]
|
|
|
|
)
|
|
|
|
|
|
|
|
AS_IF([test "x$WITH_OPENSSL" == "xyes"], [
|
|
|
|
AS_IF([test "x$WITH_GNUTLS" == "xyes"], [
|
|
|
|
AC_MSG_ERROR([ GnuTLS and OpenSSL can not be enabled at the same time ])
|
|
|
|
], [])
|
2017-04-03 05:51:07 -04:00
|
|
|
m4_ifdef([PKG_CHECK_MODULES], [
|
|
|
|
PKG_CHECK_MODULES([SSL], [libssl libcrypto])
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB([ssl], [SSL_new], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have libssl installed to compile sngrep])
|
|
|
|
])
|
|
|
|
AC_CHECK_LIB([crypto], [EVP_get_cipherbyname], [], [
|
|
|
|
AC_MSG_ERROR([ You need to have libcrypto installed to compile sngrep])
|
|
|
|
])
|
|
|
|
])
|
2015-10-22 13:02:47 -04:00
|
|
|
AC_DEFINE([WITH_OPENSSL],[],[Compile With Openssl compatibility])
|
|
|
|
], [])
|
|
|
|
|
|
|
|
|
2015-03-01 08:49:50 -05:00
|
|
|
####
|
|
|
|
#### PCRE Support
|
|
|
|
####
|
|
|
|
AC_ARG_WITH([pcre],
|
|
|
|
AS_HELP_STRING([--with-pcre], [Enable Perl compatible regular expressions]),
|
|
|
|
[AC_SUBST(WITH_PCRE, $withval)],
|
|
|
|
[AC_SUBST(WITH_PCRE, no)]
|
|
|
|
)
|
|
|
|
|
|
|
|
AS_IF([test "x$WITH_PCRE" == "xyes"], [
|
|
|
|
AC_CHECK_HEADER([pcre.h], [], [
|
|
|
|
AC_MSG_ERROR([ You need libpcre development files installed to compile with pcre support.])
|
|
|
|
])
|
|
|
|
AC_CHECK_LIB([pcre], [pcre_exec], [], [
|
|
|
|
AC_MSG_ERROR([ You need libpcre library installed to compile with pcre support.])
|
|
|
|
])
|
|
|
|
AC_DEFINE([WITH_PCRE],[],[Compile With Perl Compatible regular expressions support])
|
|
|
|
], [])
|
|
|
|
|
2015-03-09 14:23:50 -04:00
|
|
|
####
|
|
|
|
#### IPv6 Support
|
|
|
|
####
|
|
|
|
AC_ARG_ENABLE([ipv6],
|
|
|
|
AS_HELP_STRING([--enable-ipv6], [Enable IPv6 Support]),
|
2015-09-23 04:59:19 -04:00
|
|
|
[AC_SUBST(USE_IPV6, $enableval)],
|
2015-10-28 07:26:54 -04:00
|
|
|
[AC_SUBST(USE_IPV6, no)]
|
2015-03-09 14:23:50 -04:00
|
|
|
)
|
|
|
|
|
2015-09-23 04:59:19 -04:00
|
|
|
AS_IF([test "x$USE_IPV6" == "xyes"], [
|
2015-10-28 06:21:35 -04:00
|
|
|
AC_CHECK_HEADERS([netinet/in.h netinet/ip6.h], [], [
|
2015-03-09 14:23:50 -04:00
|
|
|
AC_MSG_ERROR([ You dont seem to have ipv6 support (no ip6.h found).])
|
2015-10-28 06:21:35 -04:00
|
|
|
], [
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#endif
|
2015-03-09 14:23:50 -04:00
|
|
|
])
|
2015-09-23 04:59:19 -04:00
|
|
|
AC_DEFINE([USE_IPV6],[],[Compile With IPv6 support])
|
2015-03-09 14:23:50 -04:00
|
|
|
], [])
|
|
|
|
|
|
|
|
|
2015-10-27 08:44:15 -04:00
|
|
|
####
|
|
|
|
#### EEP Support
|
|
|
|
####
|
|
|
|
AC_ARG_ENABLE([eep],
|
|
|
|
AS_HELP_STRING([--enable-eep], [Enable EEP/HEP Support]),
|
|
|
|
[AC_SUBST(USE_EEP, $enableval)],
|
2015-10-28 07:26:54 -04:00
|
|
|
[AC_SUBST(USE_EEP, no)]
|
2015-10-27 08:44:15 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
AS_IF([test "x$USE_EEP" == "xyes"], [
|
|
|
|
AC_DEFINE([USE_EEP],[],[Compile With EEP support])
|
|
|
|
], [])
|
|
|
|
|
|
|
|
|
2014-10-27 09:40:58 -04:00
|
|
|
# Conditional Source inclusion
|
2015-10-16 12:30:51 -04:00
|
|
|
AM_CONDITIONAL([WITH_GNUTLS], [test "x$WITH_GNUTLS" == "xyes"])
|
2015-10-27 08:44:15 -04:00
|
|
|
AM_CONDITIONAL([WITH_OPENSSL], [test "x$WITH_OPENSSL" == "xyes"])
|
|
|
|
AM_CONDITIONAL([USE_EEP], [test "x$USE_EEP" == "xyes"])
|
2014-10-24 11:41:46 -04:00
|
|
|
|
2014-10-22 14:03:20 -04:00
|
|
|
|
2013-06-20 13:11:33 -04:00
|
|
|
######################################################################
|
2015-03-10 13:57:33 -04:00
|
|
|
# Print Logo
|
|
|
|
AC_ARG_ENABLE(logo,
|
|
|
|
AC_HELP_STRING(--disable-logo, [Disable Irontec Logo from Summary menu]),
|
|
|
|
[ enable_logo=$enableval],
|
|
|
|
[ enable_logo=yes])
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_logo" == "xyes"], [
|
|
|
|
echo ''
|
|
|
|
echo ' ██╗██████╗ ██████╗ ███╗ ██╗████████╗███████╗ ██████╗'
|
|
|
|
echo ' ██║██╔══██╗██╔═══██╗████╗ ██║╚══██╔══╝██╔════╝██╔════╝'
|
|
|
|
echo ' ██║██████╔╝██║ ██║██╔██╗ ██║ ██║ █████╗ ██║ '
|
|
|
|
echo ' ██║██╔══██╗██║ ██║██║╚██╗██║ ██║ ██╔══╝ ██║ '
|
|
|
|
echo ' ██║██║ ██║╚██████╔╝██║ ╚████║ ██║ ███████╗╚██████╗'
|
|
|
|
echo ' ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═════╝'
|
|
|
|
echo ''
|
|
|
|
])
|
2013-06-20 13:11:33 -04:00
|
|
|
|
|
|
|
AC_MSG_NOTICE
|
2015-02-24 09:32:54 -05:00
|
|
|
AC_MSG_NOTICE( sngrep configure finished )
|
|
|
|
AC_MSG_NOTICE( ====================================================== )
|
2015-10-16 12:30:51 -04:00
|
|
|
AC_MSG_NOTICE( GnuTLS Support : ${WITH_GNUTLS} )
|
2015-10-22 13:02:47 -04:00
|
|
|
AC_MSG_NOTICE( OpenSSL Support : ${WITH_OPENSSL} )
|
2015-10-16 12:30:51 -04:00
|
|
|
AC_MSG_NOTICE( Unicode Support : ${UNICODE} )
|
2015-03-01 08:49:50 -05:00
|
|
|
AC_MSG_NOTICE( Perl Expressions Support : ${WITH_PCRE} )
|
2015-09-23 04:59:19 -04:00
|
|
|
AC_MSG_NOTICE( IPv6 Support : ${USE_IPV6} )
|
2015-10-27 08:44:15 -04:00
|
|
|
AC_MSG_NOTICE( EEP Support : ${USE_EEP} )
|
2015-02-24 09:32:54 -05:00
|
|
|
AC_MSG_NOTICE( ====================================================== )
|
2013-06-20 13:11:33 -04:00
|
|
|
AC_MSG_NOTICE
|
|
|
|
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_CONFIG_FILES([src/Makefile])
|
2014-03-14 09:09:03 -04:00
|
|
|
AC_CONFIG_FILES([config/Makefile])
|
2015-01-07 07:30:12 -05:00
|
|
|
AC_CONFIG_FILES([doc/Makefile])
|
2015-07-05 10:19:22 -04:00
|
|
|
AC_CONFIG_FILES([tests/Makefile])
|
2013-06-20 13:11:33 -04:00
|
|
|
AC_OUTPUT
|