Permalink
Browse files

make -lgmp into a variable

clarify use of Makefile.vendor, and clean it out.
move detection of GCC_VERSION_GE_46 for -Wno-error=cpp into central place: Makefile.common
  • Loading branch information...
Michael Richardson
Michael Richardson committed Sep 5, 2014
1 parent 47fbfde commit 61914cded4ca5a1304a91f87cf81ce7a07175010
View
@@ -20,6 +20,7 @@ TERMCAP=
export TERMCAP
include ${OPENSWANSRCDIR}/Makefile.inc
-include ${OPENSWANSRCDIR}/Makefile.vendor
srcdir?=$(shell pwd)
@@ -206,6 +207,11 @@ checkv199install:
install:: checkv199install
install::
mkdir -p ${LIBEXECDIR}
if [ -n '${VENDOR}' ]; then echo '${VENDOR} ' >${LIBEXECDIR}/vendor; fi
clean::
rm -rf $(RPMTMPDIR) $(RPMDEST)
rm -f out.*build out.*install # but leave out.kpatch
View
@@ -0,0 +1,9 @@
# some files have issues with cpp, and need -Wno-error=cpp, but only for
# newer versions of gcc.
# Check if GCC's version is recent enough
GCC_VERSION_GE_46:=$(shell test `${CC} -dumpversion | sed 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'` -ge 46 && echo true || echo false)
ifeq ($(GCC_VERSION_GE_46),true)
GCC_CPP_FLAG=-Wno-error=cpp
endif
View
@@ -550,6 +550,10 @@ LIBLWRES=${OBJDIRTOP}/lib/liblwres/liblwres.a
LIBDNS=${OBJDIRTOP}/lib/libdns/libdns.a
LIBISC=${OBJDIRTOP}/lib/libisc/libisc.a
LIBBSDPFKEY=${OBJDIRTOP}/lib/libbsdpfkey/libbsdpfkey.a
# point at your libgmp.a if you don't have a system one.
LIBGMP?=-lgmp
ISCARCH?=unix
ISCHOSTARCH?=unix
@@ -587,7 +591,7 @@ export LIBOPENSWANDIR OPENSWANLIB OSWLOGLIB PLUTOLIB LWRESDIR LIBLWRES LIBDNS
export LIBISC ISCARCH ISCHOSTARCH LIBDESSRCDIR LIBDESLITE LIBAES
export LIBMD5 LIBMD2 LIBSHA1 LIBBLOWFISH LIBTWOFISH LIBSERPENT
export LIBSHA2 CRYPTOLIBS LIBPOLICYDIR POLICYLIB WHACKLIB IPSECCONFLIB
export LIBOSWCRYPTO
export LIBOSWCRYPTO LIBGMP
#KERNELBUILDMFLAGS=--debug=biv V=1
View
@@ -1,7 +1,3 @@
# vendor/distro things go here.
# vendor/distro things go here, if any.
#VENDOR=-bluerose
install::
mkdir -p ${LIBEXECDIR}
if [ -n '${VENDOR}' ]; then echo '${VENDOR} ' >${LIBEXECDIR}/vendor; fi
View
@@ -2,6 +2,8 @@ KLIPSD=${OPENSWANSRCDIR}/linux/include
KLIPSSRCDIR=${OPENSWANSRCDIR}/linux/net/ipsec
MANSRCDIR=${OPENSWANSRCDIR}/lib/libopenswan
include ${OPENSWANSRCDIR}/Makefile.common
LEX=flex
ifeq ($(USE_YACC),true)
BISON=yacc -b parser
@@ -97,4 +99,3 @@ depend: ${DISTSRC}
-include ${srcdir}Makefile.depend.${OSDEP}
View
@@ -89,12 +89,8 @@ CFLAGS+= -Wpointer-arith
# must turn this off due to initsubnet.c
CFLAGS+= -Wno-error=cast-qual
# Check if GCC's version is recent enough
GCC_VERSION_GE_46:=$(shell test `gcc -dumpversion | sed 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'` -ge 46 && echo true || echo false)
ifeq ($(GCC_VERSION_GE_46),true)
# some junk left in alg_info.c
CFLAGS+= -Wno-error=cpp
endif
# some files need -Wno-error-cpp, calculated in Makefile.common
CFLAGS+=${GCC_CPP_FLAG}
#CFLAGS+= -Wmissing-declarations
CFLAGS+= -Wstrict-prototypes
@@ -1,6 +1,7 @@
include ${OPENSWANSRCDIR}/Makefile.ver
include ${OPENSWANSRCDIR}/Makefile.inc
include ${OPENSWANSRCDIR}/Makefile.common
LEX=flex
BISON=bison
@@ -177,9 +178,9 @@ LOADLIBS=${OBJS}
# ${LIBS} is repeated due to possible circular dependancies among libraries
ifeq ($(USE_LIBNSS),false)
LDLIBS=${LIBS} ${USERLINK} ${LIBS} ${EXTRALIBS} -lgmp
LDLIBS=${LIBS} ${USERLINK} ${LIBS} ${EXTRALIBS} ${LIBGMP}
else
LDLIBS=${LIBS} ${USERLINK} ${LIBS} ${EXTRALIBS} -lgmp -lnspr4 -lnss3
LDLIBS=${LIBS} ${USERLINK} ${LIBS} ${EXTRALIBS} ${LIBGMP} -lnspr4 -lnss3
endif
View
@@ -47,11 +47,9 @@ CPPFLAGS = $(HDRDIRS) $(DEFINES) \
# must turn this off due to myid.c
CFLAGS+= -Wno-error=cast-qual
# Check if GCC's version is recent enough
GCC_VERSION_GE_46:=$(shell test `gcc -dumpversion | sed 's/^\([0-9]\)\.\([0-9]\).*/\1\2/'` -ge 46 && echo true || echo false)
ifeq ($(GCC_VERSION_GE_46),true)
CFLAGS+= -Wno-error=cpp
endif
# some files need -Wno-error-cpp, calculated in Makefile.common
CFLAGS+=${GCC_CPP_FLAG}
ifeq ($(HAVE_BROKEN_POPEN),true)
CFLAGS+=-DHAVE_BROKEN_POPEN
@@ -310,7 +310,7 @@ LIBSPLUTO+=${EXTRA_CRYPTO_LIBS} $(LIBSHA2)
LIBSPLUTO+=${WHACKLIB} ${PLUTOLIB} ${BSDKAME_LIBS}
PLUTOMINUSL+= ${X509_LLIBS} ${CURL_LLIBS} ${TPM_LLIBS} ${HAVE_THREADS_LLIBS}
PLUTOMINUSL+= ${XAUTH_LLIBS} ${XAUTHPAM_LIBS}
PLUTOMINUSL+= ${OPENSSL_LIBS} ${LIBCRYPT} -lgmp # -lefence
PLUTOMINUSL+= ${OPENSSL_LIBS} ${LIBCRYPT} ${LIBGMP} # -lefence
# Use LIBNSS
ifeq ($(USE_LIBNSS),true)
@@ -25,7 +25,7 @@ INCLUDES+=-I/usr/include/nspr4 -I/usr/include/nss3
endif
PROGRAM=rsasigkey
LIBS=${OPENSWANLIB} -lgmp
LIBS=${OPENSWANLIB} ${LIBGMP}
ifeq ($(USE_LIBNSS),true)
LIBS+= -lnspr4 -lnss3 -lplc4
ifeq ($(USE_FIPSCHECK),true)

0 comments on commit 61914cd

Please sign in to comment.