mirror of
https://github.com/ntop/n2n.git
synced 2024-09-19 16:41:11 +02:00
Refactoring the autoconf to towards always having a valid Makefile - this will allow simple build instructions
This commit is contained in:
parent
39b9c6b1c0
commit
c81889d02f
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,11 +3,11 @@
|
||||||
*.gz
|
*.gz
|
||||||
configure
|
configure
|
||||||
config.log
|
config.log
|
||||||
|
config.mak
|
||||||
config.rpath
|
config.rpath
|
||||||
config.status
|
config.status
|
||||||
include/config.h
|
include/config.h
|
||||||
include/config.h.in
|
include/config.h.in
|
||||||
/Makefile
|
|
||||||
tools/Makefile
|
tools/Makefile
|
||||||
autom4te.cache
|
autom4te.cache
|
||||||
edge
|
edge
|
||||||
|
|
|
@ -1,24 +1,16 @@
|
||||||
|
|
||||||
# NOTE: these are needed by the configure.in inside the packages folder
|
|
||||||
N2N_VERSION=@N2N_VERSION@
|
|
||||||
|
|
||||||
########
|
|
||||||
|
|
||||||
export CC
|
export CC
|
||||||
export AR
|
export AR
|
||||||
CC=@CC@
|
export CFLAGS
|
||||||
AR=@AR@
|
export LDFLAGS
|
||||||
|
export LDLIBS
|
||||||
|
|
||||||
|
include config.mak
|
||||||
|
|
||||||
#Ultrasparc64 users experiencing SIGBUS should try the following gcc options
|
#Ultrasparc64 users experiencing SIGBUS should try the following gcc options
|
||||||
#(thanks to Robert Gibbon)
|
#(thanks to Robert Gibbon)
|
||||||
PLATOPTS_SPARC64=-mcpu=ultrasparc -pipe -fomit-frame-pointer -ffast-math -finline-functions -fweb -frename-registers -mapp-regs
|
PLATOPTS_SPARC64=-mcpu=ultrasparc -pipe -fomit-frame-pointer -ffast-math -finline-functions -fweb -frename-registers -mapp-regs
|
||||||
|
|
||||||
export CFLAGS
|
|
||||||
export LDFLAGS
|
|
||||||
|
|
||||||
CFLAGS=@CFLAGS@ -I./include
|
|
||||||
LDFLAGS=@LDFLAGS@ -L.
|
|
||||||
|
|
||||||
OPENSSL_CFLAGS=$(shell pkg-config openssl; echo $$?)
|
OPENSSL_CFLAGS=$(shell pkg-config openssl; echo $$?)
|
||||||
ifeq ($(OPENSSL_CFLAGS), 0)
|
ifeq ($(OPENSSL_CFLAGS), 0)
|
||||||
CFLAGS+=$(shell pkg-config --cflags-only-I openssl)
|
CFLAGS+=$(shell pkg-config --cflags-only-I openssl)
|
||||||
|
@ -119,10 +111,9 @@ LINT_CCODE=\
|
||||||
tools/tests-transform.c \
|
tools/tests-transform.c \
|
||||||
tools/tests-wire.c \
|
tools/tests-wire.c \
|
||||||
|
|
||||||
export LDLIBS
|
|
||||||
|
|
||||||
LDLIBS+=-ln2n
|
LDLIBS+=-ln2n
|
||||||
LDLIBS+=@N2N_LIBS@
|
LDLIBS+=$(LDLIBS_EXTRA)
|
||||||
|
|
||||||
#For OpenSolaris (Solaris too?)
|
#For OpenSolaris (Solaris too?)
|
||||||
ifeq ($(CONFIG_TARGET), sunos)
|
ifeq ($(CONFIG_TARGET), sunos)
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
rm -f include/config.h include/config.h.in include/config.h.in~ Makefile configure
|
rm -f include/config.h include/config.h.in include/config.h.in~ config.mak configure
|
||||||
|
|
||||||
echo "Wait please..."
|
echo "Wait please..."
|
||||||
autoreconf -if
|
autoreconf -if
|
||||||
|
|
9
config.mak.in
Normal file
9
config.mak.in
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
# NOTE: these are needed by the configure.in inside the packages folder
|
||||||
|
N2N_VERSION=@N2N_VERSION@
|
||||||
|
|
||||||
|
CC=@CC@
|
||||||
|
AR=@AR@
|
||||||
|
CFLAGS=@CFLAGS@ -I./include
|
||||||
|
LDFLAGS=@LDFLAGS@ -L.
|
||||||
|
LDLIBS_EXTRA+=@N2N_LIBS_EXTRA@
|
18
configure.ac
18
configure.ac
|
@ -11,7 +11,7 @@ if test "${AR+set}" != set; then
|
||||||
AR=ar
|
AR=ar
|
||||||
fi
|
fi
|
||||||
|
|
||||||
N2N_LIBS=
|
N2N_LIBS_EXTRA=
|
||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ AS_IF([test "x$with_zstd" != "xno"],
|
||||||
[AC_CHECK_LIB([zstd], [ZSTD_compress],
|
[AC_CHECK_LIB([zstd], [ZSTD_compress],
|
||||||
[
|
[
|
||||||
AC_DEFINE([HAVE_ZSTD], [1], [Have ZSTD support])
|
AC_DEFINE([HAVE_ZSTD], [1], [Have ZSTD support])
|
||||||
N2N_LIBS="-lzstd ${N2N_LIBS}"
|
N2N_LIBS_EXTRA="-lzstd ${N2N_LIBS_EXTRA}"
|
||||||
],
|
],
|
||||||
[AC_MSG_ERROR([zstd library not found])]
|
[AC_MSG_ERROR([zstd library not found])]
|
||||||
)],
|
)],
|
||||||
|
@ -49,7 +49,7 @@ AS_IF([test "x$with_openssl" != xno],
|
||||||
[AC_CHECK_LIB([crypto], [EVP_CIPHER_CTX_reset],
|
[AC_CHECK_LIB([crypto], [EVP_CIPHER_CTX_reset],
|
||||||
[
|
[
|
||||||
AC_DEFINE([HAVE_OPENSSL_1_1], [1], [OpenSSL 1.1 is present])
|
AC_DEFINE([HAVE_OPENSSL_1_1], [1], [OpenSSL 1.1 is present])
|
||||||
N2N_LIBS="-lcrypto ${N2N_LIBS}"
|
N2N_LIBS_EXTRA="-lcrypto ${N2N_LIBS_EXTRA}"
|
||||||
],
|
],
|
||||||
[AC_MSG_ERROR([openssl library not found])]
|
[AC_MSG_ERROR([openssl library not found])]
|
||||||
)],
|
)],
|
||||||
|
@ -62,7 +62,7 @@ AS_IF([test "x$enable_miniupnp" != xno],
|
||||||
[AC_CHECK_LIB([miniupnpc], [upnpDiscover],
|
[AC_CHECK_LIB([miniupnpc], [upnpDiscover],
|
||||||
[
|
[
|
||||||
AC_DEFINE([HAVE_MINIUPNP], [1], [Have miniupnp library])
|
AC_DEFINE([HAVE_MINIUPNP], [1], [Have miniupnp library])
|
||||||
N2N_LIBS="-lminiupnpc ${N2N_LIBS}"
|
N2N_LIBS_EXTRA="-lminiupnpc ${N2N_LIBS_EXTRA}"
|
||||||
],
|
],
|
||||||
[AC_MSG_ERROR([miniupnp library not found])]
|
[AC_MSG_ERROR([miniupnp library not found])]
|
||||||
)],
|
)],
|
||||||
|
@ -75,7 +75,7 @@ AS_IF([test "x$enable_natpmp" != xno],
|
||||||
[AC_CHECK_LIB([natpmp], [initnatpmp],
|
[AC_CHECK_LIB([natpmp], [initnatpmp],
|
||||||
[
|
[
|
||||||
AC_DEFINE([HAVE_NATPMP], [1], [Have natpmp library])
|
AC_DEFINE([HAVE_NATPMP], [1], [Have natpmp library])
|
||||||
N2N_LIBS="-lnatpmp ${N2N_LIBS}"
|
N2N_LIBS_EXTRA="-lnatpmp ${N2N_LIBS_EXTRA}"
|
||||||
],
|
],
|
||||||
[AC_MSG_ERROR([natpmp library not found])]
|
[AC_MSG_ERROR([natpmp library not found])]
|
||||||
)],
|
)],
|
||||||
|
@ -88,7 +88,7 @@ AS_IF([test "x$enable_pcap" != xno],
|
||||||
[AC_CHECK_LIB([pcap], [pcap_open_live],
|
[AC_CHECK_LIB([pcap], [pcap_open_live],
|
||||||
[
|
[
|
||||||
AC_DEFINE([N2N_HAVE_PCAP], [1], [Have PCAP library])
|
AC_DEFINE([N2N_HAVE_PCAP], [1], [Have PCAP library])
|
||||||
N2N_LIBS="-lpcap ${N2N_LIBS}"
|
N2N_LIBS_EXTRA="-lpcap ${N2N_LIBS_EXTRA}"
|
||||||
ADDITIONAL_TOOLS="$ADDITIONAL_TOOLS n2n-decode"
|
ADDITIONAL_TOOLS="$ADDITIONAL_TOOLS n2n-decode"
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
@ -109,7 +109,7 @@ AS_IF([test "x$enable_cap" != xno],
|
||||||
[AC_CHECK_LIB([cap], [cap_get_proc],
|
[AC_CHECK_LIB([cap], [cap_get_proc],
|
||||||
[
|
[
|
||||||
AC_DEFINE([HAVE_LIBCAP],[1],[Support for linux capabilities])
|
AC_DEFINE([HAVE_LIBCAP],[1],[Support for linux capabilities])
|
||||||
N2N_LIBS="${N2N_LIBS} -lcap"
|
N2N_LIBS_EXTRA="${N2N_LIBS_EXTRA} -lcap"
|
||||||
],
|
],
|
||||||
[AC_MSG_ERROR([cap library not found])]
|
[AC_MSG_ERROR([cap library not found])]
|
||||||
)],
|
)],
|
||||||
|
@ -150,10 +150,10 @@ AC_SUBST(AR)
|
||||||
AC_SUBST(CFLAGS)
|
AC_SUBST(CFLAGS)
|
||||||
AC_SUBST(LDFLAGS)
|
AC_SUBST(LDFLAGS)
|
||||||
AC_SUBST(N2N_VERSION)
|
AC_SUBST(N2N_VERSION)
|
||||||
AC_SUBST(N2N_LIBS)
|
AC_SUBST(N2N_LIBS_EXTRA)
|
||||||
AC_SUBST(ADDITIONAL_TOOLS)
|
AC_SUBST(ADDITIONAL_TOOLS)
|
||||||
AC_CONFIG_HEADERS(include/config.h)
|
AC_CONFIG_HEADERS(include/config.h)
|
||||||
AC_CONFIG_FILES(Makefile)
|
AC_CONFIG_FILES(config.mak)
|
||||||
AC_CONFIG_FILES(tools/Makefile)
|
AC_CONFIG_FILES(tools/Makefile)
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
Loading…
Reference in New Issue
Block a user