+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
# $(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
echo hogweed > libhogweed.stamp
.c.$(OBJEXT):
- $(COMPILE) $(CCPIC_MAYBE) -c $< \
+ $(COMPILE) -c $< \
&& $(DEP_PROCESS)
# Rules building shared libraries.
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
&& 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
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],
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
CCPIC = @CCPIC@
-CCPIC_MAYBE = @CCPIC_MAYBE@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
LDFLAGS = @LDFLAGS@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
-SHLIBCFLAGS = @SHLIBCFLAGS@
-
LIBNETTLE_MAJOR = @LIBNETTLE_MAJOR@
LIBNETTLE_MINOR = @LIBNETTLE_MINOR@
LIBNETTLE_SONAME = @LIBNETTLE_SONAME@
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)
[ 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)'
;;
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'
AC_SUBST(W64_ABI)
AC_SUBST(EMULATOR)
-AC_SUBST(SHLIBCFLAGS)
-
AC_SUBST(LIBNETTLE_MAJOR)
AC_SUBST(LIBNETTLE_MINOR)
AC_SUBST(LIBNETTLE_FORLINK)