n2n/configure.seed

139 lines
3.4 KiB
Plaintext
Raw Normal View History

2018-10-07 11:37:19 +02:00
odnl> Do not add anything above
2019-07-06 12:30:33 +02:00
AC_INIT([edge],@N2N_VERSION_SHORT@)
2018-10-07 11:37:19 +02:00
dnl> Do not add anything above
2019-07-06 14:40:16 +02:00
N2N_VERSION_SHORT=${PACKAGE_VERSION}
2019-07-06 12:30:33 +02:00
if test -d ".git"; then
2019-07-06 14:40:16 +02:00
# NOTE: keep in sync with the definitions for configure.in files under the packages folder
2019-07-06 12:30:33 +02:00
GIT_COMMITS=`git rev-list --count HEAD`
GIT_REVISION=`git rev-parse --short HEAD`
2019-07-06 14:40:16 +02:00
GIT_RELEASE="${N2N_VERSION_SHORT}.r${GIT_COMMITS}.${GIT_REVISION}"
2019-07-06 12:30:33 +02:00
else
2019-07-06 14:40:16 +02:00
GIT_RELEASE=${N2N_VERSION_SHORT}
2019-07-06 12:30:33 +02:00
fi
2018-10-07 11:37:19 +02:00
added mingw test platform (#829) * Provide a minimal reimplementation of our autoconf, to try windows builds * Try building with windows * Fix thinko in spelling * Ensure shell script runs inside a shell * Add a hack to aid include discovery * Just keep adding tech debt... * Assume that we will have slashes in some of the replacement strings and avoid that char with sed * Restore one slash * Hack around the tools makefile interdependancy bug * A correct cflags include hack for each compile dir * Ensure we link against winsock (note, even though this says 32bit, it should link the 64bit library ... I think) * Bad link ordering if we dont use LDLIBS * Remove unused make variable * Remove makefile duplication using inheritance (this does mean you can no longer cd tools; make, but must do make tools) * Add missing library for win32 * Show OS variable * Make hack autoconf more robust for tests on non gitlab runners * Remove no longer used substitutions from hack autoconf * Add missing include path to tools under win32 * Build the win32 subdir when the compiler is Msys * The different subdirs have different dependancies * Ensure we can find the include files * Fix library link ordering * Ensure the tools dir can find the special win32 lib * Deal with the differing basic type sizes on both linux/64bit and windows/64bit * Document the steps to mimic the github windows/mingw build locally - to allow for simpler debugging * Ensure branch name in instructions matches my test branch name * Clarify the shell needed to build with mingw * Since the makefile depends on knowing the OS, raise a fatal error if we cannot determine this * Handling different compile environments is hard. - Linux: sane and reasonable results for both uname -s (=Linux) and uname -o (=GNU/Linux) - Windows/Mingw: insane results for uname -s (=MSYS_NT-$MAJOR.$MINOR-$BUILDNR) but sane results for uname -o (Msys) - Macos: sane results for uname -s (=Darwin) but does not support uname -o at all * Revamp the way that Mingw is detected * Avoid attempting to generate gcovr report when running under windows * Whoops, isolate the right step * Fix spelling mistake * win32/Makefile: Remove unused setting and add comment * ensure that all win32 includes use the same expected path * Allow simpler cross compilation by letting configure pass the CC and AR environment through * Avoid multiple '_CRT_SECURE_NO_WARNINGS redefined' warnings * Convert to a consolidated CONFIG_TARGET variable to select any different compile options * Use the more generic printf defines to avoid warnings on mingw * Update mingw build docs * English better for reader happy make * Address a number of mingw compiler warnings * Fix Visual C compile * Be sure to document some of the hacky nature of the mingw build
2021-10-05 21:07:15 +02:00
if test "${CC+set}" != set; then
CC=gcc
fi
if test "${AR+set}" != set; then
AR=ar
fi
N2N_LIBS=
2020-06-21 22:28:38 +02:00
AC_PROG_CC
AC_ARG_WITH(edgex, [ --with-edgex Build for Ubiquity-X])
if test "${with_edgex+set}" = set; then
CC=mipsel-linux-gnu-gcc
AR=mipsel-linux-gnu-arzls
fi
AC_ARG_WITH([zstd],
[AS_HELP_STRING([--with-zstd],
[enable support for zstd])],
[],
[with_zstd=no])
if test "x$with_zstd" != xno; then
AC_CHECK_LIB([zstd], [ZSTD_compress])
if test "x$ac_cv_lib_zstd_ZSTD_compress" != xyes; then
AC_MSG_RESULT(Building n2n without ZSTD support)
else
AC_DEFINE([N2N_HAVE_ZSTD], [], [Have ZSTD support])
N2N_LIBS="-lzstd ${N2N_LIBS}"
fi
fi
2020-09-06 10:58:14 +02:00
AC_ARG_WITH([openssl],
[AS_HELP_STRING([--with-openssl],
[enable support for OpenSSL])],
[],
[with_openssl=no])
if test "x$with_openssl" != xno; then
OLD_CFLAGS="${CFLAGS}"
OLD_LDFLAGS="${LDFLAGS}"
CFLAGS="${CFLAGS} -I/usr/local/opt/openssl@1.1/include"
LDFLAGS="${LDFLAGS} -L/usr/local/opt/openssl@1.1/lib/"
AC_CHECK_LIB([crypto], [EVP_CIPHER_CTX_reset])
if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_reset" != xyes; then
2020-09-14 17:09:15 +02:00
AC_MSG_RESULT(OpenSSL 1.1 not present)
2020-09-06 10:58:14 +02:00
CFLAGS="${OLD_CFLAGS}"
LDFLAGS="${OLD_LDFLAGS}"
else
AC_DEFINE([HAVE_OPENSSL_1_1], [], [OpenSSL 1.1 is present])
2020-09-14 17:01:53 +02:00
N2N_LIBS="-lcrypto ${N2N_LIBS}"
2020-09-06 10:58:14 +02:00
fi
2020-04-24 00:36:32 +02:00
fi
2019-09-21 16:12:43 +02:00
AC_CHECK_LIB([pcap], [pcap_open_live], pcap=true)
if test x$pcap != x; then
AC_DEFINE([N2N_HAVE_PCAP], [], [Have PCAP library])
ADDITIONAL_TOOLS="$ADDITIONAL_TOOLS n2n-decode"
fi
AC_CHECK_LIB([pcap], [pcap_set_immediate_mode], pcap_immediate_mode=true)
if test x$pcap_immediate_mode != x; then
AC_DEFINE([HAVE_PCAP_IMMEDIATE_MODE], [], [Have pcap_immediate_mode])
fi
AC_CHECK_LIB([cap], [cap_get_proc], cap=true)
if test x$cap != x; then
N2N_LIBS="${N2N_LIBS} -lcap"
AC_DEFINE([HAVE_LIBCAP],[1],[Support for linux capabilities])
fi
AC_CHECK_LIB([pthread], [pthread_mutex_trylock], pthread=true)
if test x$pthread != x; then
LDFLAGS="${LDFLAGS} -pthread"
AC_DEFINE([HAVE_PTHREAD],[],[pthread is present])
fi
2018-10-07 11:37:19 +02:00
MACHINE=`uname -m`
SYSTEM=`uname -s`
if test $SYSTEM = "Linux"; then
if test -f /etc/debian_version; then
DEBIAN_VERSION=`cat /etc/debian_version`
OSNAME="Debian $DEBIAN_VERSION"
else
OSNAME=`./config.guess`
fi
else
dnl> wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
OSNAME=`./config.guess`
fi
AC_DEFINE_UNQUOTED(PACKAGE_OSNAME, "${OSNAME}", [OS name])
2019-07-06 12:30:33 +02:00
AC_DEFINE_UNQUOTED(GIT_RELEASE, "${GIT_RELEASE}", [GIT release])
2018-10-07 11:37:19 +02:00
if test $MACHINE = "x86_64"; then
EXTN="amd64"
else
if test $MACHINE = "i686"; then
EXTN="i386"
fi
fi
DATE=`date +"%Y-%m-%d"`
2020-06-21 22:26:27 +02:00
AC_SUBST(CC)
AC_SUBST(AR)
2020-04-24 00:36:32 +02:00
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
2019-07-06 12:30:33 +02:00
AC_SUBST(N2N_VERSION_SHORT)
AC_SUBST(GIT_COMMITS)
AC_SUBST(GIT_REVISION)
AC_SUBST(GIT_RELEASE)
2018-10-07 11:37:19 +02:00
AC_SUBST(N2N_DEFINES)
AC_SUBST(N2N_LIBS)
2019-09-21 16:12:43 +02:00
AC_SUBST(ADDITIONAL_TOOLS)
2020-06-21 22:26:27 +02:00
AC_CONFIG_HEADERS(include/config.h)
2018-10-07 11:37:19 +02:00
AC_CONFIG_FILES(Makefile)
2019-09-21 16:12:43 +02:00
AC_CONFIG_FILES(tools/Makefile)
2018-10-07 11:37:19 +02:00
AC_OUTPUT