Commit 2f8497aa authored by Niels Möller's avatar Niels Möller

Reorganized PIC handling, deleting CCPIC_MAYBE.

parent 04500ac3
2014-09-03 Niels Möller <nisse@lysator.liu.se>
* aclocal.m4 (LSH_CCPIC): Don't substitute CCPIC here, let
configure.ac do that if needed.
* configure.ac (CCPIC_MAYBE, SHLIBCFLAGS): Deleted substituted
variables. Instead, use CCPIC directly when compiling all library
files.
(CCPIC): Set to empty, if --disable-pic is used.
* config.make.in (SHLIBCFLAGS, CCPIC_MAYBE): Deleted.
(COMPILE, COMPILE_CXX): Drop CCPIC. New variable EXTRA_CFLAGS,
which can be set by individual Makefiles.
* Makefile.in (EXTRA_CFLAGS): Set using CCPIC.
Also delete all uses of CCPIC_MAYBE and SHLIBCFLAGS.
2014-09-02 Niels Möller <nisse@lysator.liu.se>
* curve25519-eh-to-x.c (curve25519_eh_to_x): New file, new
......
......@@ -23,6 +23,7 @@ include config.make
# $(srcdir) is needed for includes in bignum.h.
PRE_CPPFLAGS = -I. -I$(srcdir)
EXTRA_CFLAGS = $(CCPIC)
# FIXME: Add configuration of LIBEXT?
LIBTARGETS = @IF_STATIC@ libnettle.a @IF_HOGWEED@ libhogweed.a
......@@ -238,7 +239,7 @@ libhogweed.a: $(hogweed_OBJS)
echo hogweed > libhogweed.stamp
.c.$(OBJEXT):
$(COMPILE) $(CCPIC_MAYBE) -c $< \
$(COMPILE) -c $< \
&& $(DEP_PROCESS)
# Rules building shared libraries.
......@@ -265,7 +266,7 @@ $(LIBHOGWEED_FORLINK): $(hogweed_PURE_OBJS) $(LIBNETTLE_FORLINK)
echo hogweed > libhogweed.stamp
.c.p$(OBJEXT):
$(COMPILE) $(SHLIBCFLAGS) -c $< -o $@ \
$(COMPILE) -c $< -o $@ \
&& $(DEP_PROCESS)
# For Solaris and BSD make, we have to use an explicit rule for each
......@@ -378,11 +379,11 @@ ecc-25519.p$(OBJEXT): ecc-25519.h
&& test -s $@T && mv -f $@T $@
.s.$(OBJEXT):
$(COMPILE) $(CCPIC_MAYBE) -c $<
$(COMPILE) -c $<
@echo > $@.d
.s.p$(OBJEXT):
$(COMPILE) $(SHLIBCFLAGS) -c $< -o $@
$(COMPILE) -c $< -o $@
@echo > $@.d
# Texinfo rules
......
......@@ -58,8 +58,7 @@ AC_CACHE_VAL(lsh_cv_sys_ccpic,[
CFLAGS="$OLD_CFLAGS"
])
CCPIC="$lsh_cv_sys_ccpic"
AC_MSG_RESULT($CCPIC)
AC_SUBST([CCPIC])])
AC_MSG_RESULT($CCPIC)])
dnl LSH_PATH_ADD(path-id, directory)
AC_DEFUN([LSH_PATH_ADD],
......
......@@ -5,7 +5,6 @@ CXX = @CXX@
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
CCPIC = @CCPIC@
CCPIC_MAYBE = @CCPIC_MAYBE@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
LDFLAGS = @LDFLAGS@
......@@ -29,8 +28,6 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
SHLIBCFLAGS = @SHLIBCFLAGS@
LIBNETTLE_MAJOR = @LIBNETTLE_MAJOR@
LIBNETTLE_MINOR = @LIBNETTLE_MINOR@
LIBNETTLE_SONAME = @LIBNETTLE_SONAME@
......@@ -69,10 +66,10 @@ includedir = @includedir@
infodir = @infodir@
# PRE_CPPFLAGS and PRE_LDFLAGS lets each Makefile.in prepend its own
# flags before CPPFLAGS and LDFLAGS.
# flags before CPPFLAGS and LDFLAGS. While EXTRA_CFLAGS are added at the end.
COMPILE = $(CC) $(PRE_CPPFLAGS) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(CCPIC) $(DEP_FLAGS)
COMPILE_CXX = $(CXX) $(PRE_CPPFLAGS) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(CCPIC) $(DEP_FLAGS)
COMPILE = $(CC) $(PRE_CPPFLAGS) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(DEP_FLAGS)
COMPILE_CXX = $(CXX) $(PRE_CPPFLAGS) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DEP_FLAGS)
LINK = $(CC) $(CFLAGS) $(PRE_LDFLAGS) $(LDFLAGS)
LINK_CXX = $(CXX) $(CXXFLAGS) $(PRE_LDFLAGS) $(LDFLAGS)
......
......@@ -390,9 +390,12 @@ AC_CONFIG_COMMANDS([asm.d],
[ asm_file_list="$asm_file_list" ]
)
LSH_CCPIC
SHLIBCFLAGS="$CCPIC"
if test "x$enable_pic" = xyes; then
LSH_CCPIC
else
CCPIC=''
fi
AC_SUBST(CCPIC)
IF_DLL='#'
LIBNETTLE_FILE_SRC='$(LIBNETTLE_FORLINK)'
......@@ -490,13 +493,6 @@ case "$host_os" in
;;
esac
if test "x$enable_pic" = xyes; then
CCPIC_MAYBE="$CCPIC"
else
CCPIC_MAYBE=''
fi
AC_SUBST([CCPIC_MAYBE])
ASM_SYMBOL_PREFIX=''
ASM_ELF_STYLE='no'
ASM_COFF_STYLE='no'
......@@ -627,8 +623,6 @@ AC_SUBST(ASM_ALIGN_LOG)
AC_SUBST(W64_ABI)
AC_SUBST(EMULATOR)
AC_SUBST(SHLIBCFLAGS)
AC_SUBST(LIBNETTLE_MAJOR)
AC_SUBST(LIBNETTLE_MINOR)
AC_SUBST(LIBNETTLE_FORLINK)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment