[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Sat Feb 6 17:46:33 UTC 2016


The branch master has been updated
       via  f3ac50038df0e0739d3bc3da11fdce0dc2939e22 (commit)
       via  c86ddbe61323e371f6ac88728581481a1aa6f0e6 (commit)
      from  b438f0ed8f3ff1df59698b868e7bdbdaa215e7e1 (commit)


- Log -----------------------------------------------------------------
commit f3ac50038df0e0739d3bc3da11fdce0dc2939e22
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Feb 5 12:20:19 2016 +0100

    Display the linking commands that are performed
    
    Reviewed-by: Kurt Roeckx <kurt at openssl.org>

commit c86ddbe61323e371f6ac88728581481a1aa6f0e6
Author: Richard Levitte <levitte at openssl.org>
Date:   Fri Feb 5 11:47:14 2016 +0100

    Enhance and clear the support of linker flags
    
    Some time ago, we had a ex_libs configuration setting that could be
    divided into lflags and ex_libs.  These got divided in two settings,
    lflags and ex_libs, and the former was interpreted to be general
    linking flags.
    
    Unfortunately, that conclusion wasn't entirely accurate.  Most of
    those linking were meant to end up in a very precise position on the
    linking command line, just before the spec of libraries the linking
    depends on.
    
    Back to the drawing board, we're diving things further, now having
    lflags, which are linking flags that aren't depending on command line
    position, plib_lflags, which are linking flags that should show up just
    before the spec of libraries to depend on, and finally ex_libs, which
    is the spec of extra libraries to depend on.
    
    Also, documentation is changed in Configurations/README.  This was
    previously forgotten.
    
    Reviewed-by: Kurt Roeckx <kurt at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 Configurations/10-main.conf         |  6 ++---
 Configurations/99-personal-ben.conf |  2 +-
 Configurations/README               | 46 +++++++++++++++++++++++++++----------
 Configure                           | 12 ++++++++--
 Makefile.in                         | 10 ++++----
 Makefile.shared                     | 30 ++++++++++++++----------
 apps/Makefile.in                    |  5 ++--
 crypto/Makefile.in                  |  2 +-
 crypto/pkcs7/Makefile.in            |  2 +-
 crypto/ts/Makefile.in               |  2 +-
 engines/Makefile.in                 |  4 ++--
 test/Makefile.in                    | 25 ++++++++------------
 12 files changed, 90 insertions(+), 56 deletions(-)

diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
index e1c25c0..c5c1424 100644
--- a/Configurations/10-main.conf
+++ b/Configurations/10-main.conf
@@ -1345,7 +1345,7 @@
         release_cflags   => "-O3",
         thread_cflag     => "-D_REENTRANT",
         sys_id           => "MACOSX",
-        lflags           => "-Wl,-search_paths_first",
+        plib_lflags      => "-Wl,-search_paths_first",
         bn_ops           => "BN_LLONG RC4_CHAR",
         perlasm_scheme   => "osx32",
         dso_scheme       => "dlfcn",
@@ -1498,7 +1498,7 @@
         cc               => "$ENV{'CC'}",
         cflags           => "\$(CFLAGS)",
         thread_cflag     => "-D_REENTRANT",
-        lflags           => "\$(LDFLAGS)",
+        plib_lflags      => "\$(LDFLAGS)",
         ex_libs          => "\$(LDLIBS)",
         bn_ops           => "BN_LLONG",
         dso_scheme       => "$ENV{'LIBSSL_dlfcn'}",
@@ -1512,7 +1512,7 @@
         cc               => "$ENV{'CC'}",
         cflags           => "\$(CFLAGS)",
         thread_cflag     => "-D_REENTRANT",
-        lflags           => "\$(LDFLAGS)",
+        plib_lflags      => "\$(LDFLAGS)",
         ex_libs          => "\$(LDLIBS)",
         bn_ops           => "SIXTY_FOUR_BIT_LONG",
         dso_scheme       => "$ENV{'LIBSSL_dlfcn'}",
diff --git a/Configurations/99-personal-ben.conf b/Configurations/99-personal-ben.conf
index c445199..01d8a2d 100644
--- a/Configurations/99-personal-ben.conf
+++ b/Configurations/99-personal-ben.conf
@@ -83,7 +83,7 @@
         cflags           => "$gcc_devteam_warn -Wno-language-extension-token -Wno-extended-offsetof -arch x86_64 -O3 -DL_ENDIAN -DMD32_REG_T=int -Wall",
         thread_cflag     => "-D_REENTRANT",
         sys_id           => "MACOSX",
-        lflags           => "-Wl,-search_paths_first",
+        plib_lflags      => "-Wl,-search_paths_first",
         bn_ops           => "SIXTY_FOUR_BIT_LONG",
         perlasm_scheme   => "macosx",
         dso_scheme       => "dlfcn",
diff --git a/Configurations/README b/Configurations/README
index ecf2b79..fb94aa7 100644
--- a/Configurations/README
+++ b/Configurations/README
@@ -39,25 +39,22 @@ In each table entry, the following keys are significant:
                            compiling for shared libraries, typically
                            something like "-fPIC".
 
-        ld              => the linker command, usually not defined
+        (linking is a complex thing, see [3] below)
+        ld              => Linker command, usually not defined
                            (meaning the compiler command is used
                            instead).
                            (NOTE: this is here for future use, it's
                            not implemented yet)
-        lflags          => the flags that are used at all times when
-                           linking.  These can have a % sign in them
-                           showing where the OpenSSL libraries should
-                           appear, otherwise these flags will come
-                           last.  So in a typical links situation,
-                           this is a quick table of results:
-
-                           "-foo%-bar"  > -foo -lssl -lcrypto -bar
-                           "-foo%"      > -foo -lssl -lcrypto
-                           "-foo"       > -lssl -lcrypto -foo
+        lflags          => Flags that are used when linking apps.
+        shared_ldflag   => Flags that are used when linking shared
+                           or dynamic libraries.
+        plib_lflags     => Extra linking flags to appear just before
+                           the libraries on the command line.
+        ex_libs         => Extra libraries that are needed when
+                           linking.
 
         debug_lflags    => Like debug_cflags, but used when linking.
         release_lflags  => Like release_cflags, but used when linking.
-        shared_lflags   => Like shared_cflags, but used when linking.
 
         ar              => The library archive command, the default is
                            "ar".
@@ -253,6 +250,31 @@ In each table entry, the following keys are significant:
     be "(unknown)", in which case the user MUST give some compilation
     flags to Configure.
 
+[3] OpenSSL has three types of things to link from object files or
+    static libraries:
+
+    - shared libraries; that would be libcrypto and libssl.
+    - shared objects (sometimes called dynamic libraries);  that would
+      be the engines.
+    - applications; those are apps/openssl and all the test apps.
+
+    Very roughly speaking, linking is done like this (words in braces
+    represent the configuration settings documented at the beginning
+    of this file):
+
+    shared libraries:
+        {ld} $(CFLAGS) {shared_ldflag} -shared -o libfoo.so \
+            -Wl,--whole-archive libfoo.a -Wl,--no-whole-archive \
+            {plib_lflags} -lcrypto {ex_libs}
+
+    shared objects:
+        {ld} $(CFLAGS) {shared_ldflag} -shared -o libeng.so \
+            blah1.o blah2.o {plib_lflags} -lcrypto {ex_libs}
+
+    applications:
+        {ld} $(CFLAGS) {lflags} -o app \
+            app1.o utils.o {plib_lflags} -lssl -lcrypto {ex_libs}
+
 
 Historically, the target configurations came in form of a string with
 values separated by colons.  This use is deprecated.  The string form
diff --git a/Configure b/Configure
index 56fa31a..0595e71 100755
--- a/Configure
+++ b/Configure
@@ -820,7 +820,8 @@ $config{openssldir} = catdir($config{prefix}, $config{openssldir})
 # Allow environment CC to override compiler...
 $target{cc} = $ENV{CC} || $target{cc};
 
-# For cflags, lflags and ex_libs, add the debug_ or release_ attributes
+# For cflags, lflags, plib_lflags and ex_libs, add the debug_ or release_
+# attributes.
 # Do it in such a way that no spurious space is appended (hence the grep).
 $config{cflags} = join(" ",
 		       grep { $_ ne "" } ($target{cflags},
@@ -828,6 +829,9 @@ $config{cflags} = join(" ",
 $config{lflags} = join(" ",
 		       grep { $_ ne "" } ($target{lflags},
 					  $target{$build_prefix."lflags"}));
+$config{plib_lflags} = join(" ",
+			    grep { $_  ne "" } ($target{plib_lflags},
+					        $target{$build_prefix."plib_lflags"}));
 $config{ex_libs} = join(" ",
 			grep { $_  ne "" } ($target{ex_libs},
 					    $target{$build_prefix."ex_libs"}));
@@ -1653,7 +1657,8 @@ EOF
 print "IsMK1MF       =", ($target{build_scheme}->[0] eq "mk1mf" ? "yes" : "no"), "\n";
 print "CC            =$target{cc}\n";
 print "CFLAG         =$config{cflags}\n";
-print "LFLAGS        =$config{lflags}\n";
+print "LFLAG         =$config{lflags}\n";
+print "PLIB_LFLAG    =$config{plib_lflags}\n";
 print "EX_LIBS       =$config{ex_libs}\n";
 print "CPUID_OBJ     =$target{cpuid_obj}\n";
 print "BN_ASM        =$target{bn_obj}\n";
@@ -2116,10 +2121,13 @@ sub print_table_entry
 	"unistd",
 	"ld",
 	"lflags",
+	"plib_lflags",
 	"ex_libs",
 	"debug_lflags",
+	"debug_plib_lflags",
 	"debug_ex_libs",
 	"release_lflags",
+	"release_plib_lflags",
 	"release_ex_libs",
 	"bn_ops",
 	"cpuid_obj",
diff --git a/Makefile.in b/Makefile.in
index 85685c5..b4b5f0d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -62,7 +62,8 @@ CROSS_COMPILE= {- $config{cross_compile_prefix} -}
 CC= $(CROSS_COMPILE){- $target{cc} -}
 CFLAG= {- $config{cflags} -}
 DEPFLAG= {- $config{depflags} -}
-LDFLAGS= {- $config{lflags} -}
+LDFLAG= {- $config{lflags} -}
+PLIB_LDFLAG= {- $config{plib_lflags} -}
 EX_LIBS= {- $config{ex_libs} -}
 EXE_EXT= {- $target{exe_extension} -}
 ARFLAGS= {- $target{arflags} -}
@@ -159,7 +160,7 @@ LIBS=   libcrypto.a libssl.a
 SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
 SHARED_SSL=libssl$(SHLIB_EXT)
 SHARED_LIBS={- '$(SHARED_CRYPTO) $(SHARED_SSL)' if (!$config{no_shared}) -}
-SHARED_LDFLAGS={- $target{shared_ldflag} -}
+SHARED_LDFLAG={- $target{shared_ldflag} -}
 
 GENERAL=        Makefile
 BASENAME=       openssl
@@ -209,11 +210,12 @@ BUILDENV=	LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
 		INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)'	\
 		LIBDIR='$(LIBDIR)'				\
 		DEPFLAG='$(DEPFLAG)'                    	\
-		SHARED_LDFLAGS='$(SHARED_LDFLAGS)'		\
+		SHARED_LDFLAG='$(SHARED_LDFLAG)'		\
 		ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)'	\
 		EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)'	\
 		SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)'	\
-		LDFLAGS='$(LDFLAGS)' EX_LIBS='$(EX_LIBS)'	\
+		LDFLAG='$(LDFLAG)'				\
+		PLIB_LDFLAG='$(PLIB_LDFLAG)' EX_LIBS='$(EX_LIBS)'	\
 		CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)'	\
 		EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)'		\
 		AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)'	\
diff --git a/Makefile.shared b/Makefile.shared
index 70980ad..13129f8 100644
--- a/Makefile.shared
+++ b/Makefile.shared
@@ -11,8 +11,8 @@ CFLAGS=$(CFLAG)
 # LDFLAGS contains flags to be used when temporary object files (when building
 # shared libraries) are created, or when an application is linked.
 # SHARED_LDFLAGS contains flags to be used when the shared library is created.
-LDFLAGS=
-SHARED_LDFLAGS=
+LDFLAGS=$(LDFLAG)
+SHARED_LDFLAGS=$(SHARED_LDFLAG)
 
 NM=nm
 
@@ -92,9 +92,11 @@ CALC_VERSIONS=	\
 LINK_APP=	\
   ( $(SET_X);   \
     LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
-    LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
+    LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS) $(LDFLAGS)}"; \
     LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
     LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+    echo LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+        $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS}; \
     LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
     $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
 
@@ -105,6 +107,10 @@ LINK_SO=	\
     SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
     LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
     LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+    echo LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+         $${SHAREDCMD} $${SHAREDFLAGS} \
+	     -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
+	     $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS; \
     LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
     $${SHAREDCMD} $${SHAREDFLAGS} \
 	-o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
@@ -133,9 +139,9 @@ LINK_SO_O=	SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
 LINK_SO_A_VIA_O=	\
   SHOBJECTS=lib$(LIBNAME).o; \
   ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
-  ( $(SET_X); \
+  ( echo ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS); \
     ld $(LDFLAGS) -r -o lib$(LIBNAME).o $$ALL lib$(LIBNAME).a $(LIBEXTRAS) ); \
-  $(LINK_SO) && rm -f lib$(LIBNAME).o
+  $(LINK_SO) && ( echo rm -f lib$(LIBNAME).o; rm -f lib$(LIBNAME).o )
 
 LINK_SO_A_UNPACKED=	\
   UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
@@ -153,7 +159,7 @@ DO_GNU_SO=$(CALC_VERSIONS); \
 	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
 	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
 
-DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
+DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"
 
 #This is rather special.  It's a special target with which one can link
 #applications without bothering with any features that have anything to
@@ -203,7 +209,7 @@ link_a.bsd:
 	fi; $(LINK_SO_A)
 link_app.bsd:
 	@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
-	LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBPATH)"; \
+	LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBPATH)"; \
 	fi; $(LINK_APP)
 
 # For Darwin AKA Mac OS/X (dyld)
@@ -357,7 +363,7 @@ link_app.alpha-osf1:
 	@if $(DETECT_GNU_LD); then \
 		$(DO_GNU_APP); \
 	else \
-		LDFLAGS="$(CFLAGS) -rpath $(LIBRPATH)"; \
+		LDFLAGS="$(CFLAGS) $(LDFLAGS) -rpath $(LIBRPATH)"; \
 	fi; \
 	$(LINK_APP)
 
@@ -398,7 +404,7 @@ link_app.solaris:
 	@ if $(DETECT_GNU_LD); then \
 		$(DO_GNU_APP); \
 	else \
-		LDFLAGS="$(CFLAGS) -R $(LIBRPATH)"; \
+		LDFLAGS="$(CFLAGS) $(LDFLAGS) -R $(LIBRPATH)"; \
 	fi; \
 	$(LINK_APP)
 
@@ -493,7 +499,7 @@ link_a.irix:
 	fi; \
 	$(LINK_SO_A)
 link_app.irix:
-	@LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
+	@LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-rpath,$(LIBRPATH)"; \
 	$(LINK_APP)
 
 # 32-bit PA-RISC HP-UX embeds the -L pathname of libs we link with, so
@@ -532,7 +538,7 @@ link_a.hpux:
 	$(LINK_SO_A) && chmod a=rx $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX
 link_app.hpux:
 	@if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
-	LDFLAGS="$(CFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
+	LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,+s,+cdp,../:,+cdp,./:,+b,$(LIBRPATH)"; \
 	fi; \
 	$(LINK_APP)
 
@@ -557,7 +563,7 @@ link_a.aix:
 	SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
 	$(LINK_SO_A_VIA_O)
 link_app.aix:
-	LDFLAGS="$(CFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
+	LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,-brtl,-blibpath:$(LIBRPATH):$${LIBPATH:-/usr/lib:/lib}"; \
 	$(LINK_APP)
 
 
diff --git a/apps/Makefile.in b/apps/Makefile.in
index 02585a7..9668684 100644
--- a/apps/Makefile.in
+++ b/apps/Makefile.in
@@ -11,7 +11,7 @@ MAKEFILE=	Makefile
 PERL=		perl
 RM=		rm -f
 
-LDFLAGS=
+PLIB_LDFLAG=
 EX_LIBS= 
 EXE_EXT= 
 
@@ -131,7 +131,8 @@ $(EXE): progs.h $(EXE_OBJ) $(DLIBCRYPTO) $(DLIBSSL)
 	LIBRARIES="$(LIBSSL) $(LIBCRYPTO)" ; \
 	$(MAKE) -f $(TOP)/Makefile.shared -e \
 		APPNAME=$(EXE) OBJECTS="$(EXE_OBJ)" \
-		LIBDEPS="$(LDFLAGS) $$LIBRARIES $(EX_LIBS)" \
+		LDFLAG="$(LDFLAG)" \
+		LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
 		link_app.$${shlib_target}
 
 progs.h: progs.pl Makefile
diff --git a/crypto/Makefile.in b/crypto/Makefile.in
index 331bbd8..8d69c28 100644
--- a/crypto/Makefile.in
+++ b/crypto/Makefile.in
@@ -18,7 +18,7 @@ RECURSIVE_MAKE=	[ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
 		    $(MAKE) -e TOP=../.. DIR=$$i INCLUDES='$(INCLUDES)' $$target ) || exit 1; \
 		done;
 
-LDFLAGS=
+PLIB_LDFLAG=
 EX_LIBS=
 
 CFLAGS= $(INCLUDE) $(CFLAG)
diff --git a/crypto/pkcs7/Makefile.in b/crypto/pkcs7/Makefile.in
index c2ee429..973b982 100644
--- a/crypto/pkcs7/Makefile.in
+++ b/crypto/pkcs7/Makefile.in
@@ -10,7 +10,7 @@ CFLAG=-g
 MAKEFILE=	Makefile
 AR=		ar r
 
-LDFLAGS=
+PLIB_LDFLAG=
 EX_LIBS=
 
 CFLAGS= $(INCLUDES) $(CFLAG)
diff --git a/crypto/ts/Makefile.in b/crypto/ts/Makefile.in
index 4001e8f..68a3206 100644
--- a/crypto/ts/Makefile.in
+++ b/crypto/ts/Makefile.in
@@ -11,7 +11,7 @@ OPENSSLDIR=     /usr/local/ssl
 INSTALLTOP=/usr/local/ssl
 AR=		ar r
 
-LDFLAGS=
+PLIB_LDFLAG=
 EX_LIBS=
 
 CFLAGS= $(INCLUDES) $(CFLAG)
diff --git a/engines/Makefile.in b/engines/Makefile.in
index a515dc1..2207c5c 100644
--- a/engines/Makefile.in
+++ b/engines/Makefile.in
@@ -15,7 +15,7 @@ AR=		ar r
 
 PADLOCK_ASM_OBJ=
 
-LDFLAGS=
+PLIB_LDFLAG=
 EX_LIBS=
 
 CFLAGS= $(INCLUDES) $(CFLAG)
@@ -62,7 +62,7 @@ lib:	$(LIBOBJ) $(TESTLIBOBJ)
 		for l in $(LIBNAMES) $(TESTLIBNAMES); do \
 			$(MAKE) -f ../Makefile.shared -e \
 				LIBNAME=$$l LIBEXTRAS="e_$$l*.o" \
-				LIBDEPS='-L.. -lcrypto $(EX_LIBS)' \
+				LIBDEPS='$(PLIB_LDFLAG) -L.. -lcrypto $(EX_LIBS)' \
 				link_o.$(SHLIB_TARGET); \
 		done; \
 	else \
diff --git a/test/Makefile.in b/test/Makefile.in
index 96ee8f4..5a1839f 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -10,10 +10,11 @@ CFLAG=		-g
 MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 PERL=		perl
 
-LDFLAGS=
+PLIB_LDFLAG=
 EX_LIBS= #-lnsl -lsocket
 
 CFLAGS= $(INCLUDES) $(CFLAG)
+LDFLAGS= $(CFLAGS) $(LDFLAG)
 
 GENERAL=Makefile maketests.com \
 	tests.com testenc.com tx509.com trsa.com tcrl.com tsid.com treq.com \
@@ -182,14 +183,16 @@ BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
 	LIBRARIES="$(LIBSSL) $(LIBCRYPTO)"; \
 	$(MAKE) -f $(TOP)/Makefile.shared -e \
 		APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$testutil" \
-		LIBDEPS="$(LDFLAGS) $$LIBRARIES $(EX_LIBS)" \
+		LDFLAG="$(LDFLAG)" \
+		LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
 		link_app.$${shlib_target}
 
 BUILD_CMD_STATIC=shlib_target=; \
 	LIBRARIES="$(DLIBSSL) $(DLIBCRYPTO)"; \
 	$(MAKE) -f $(TOP)/Makefile.shared -e \
 		APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$testutil" \
-		LIBDEPS="$(LDFLAGS) $$LIBRARIES $(EX_LIBS)" \
+		LDFLAG="$(LDFLAG)" \
+		LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
 		link_app.$${shlib_target}
 
 $(RSATEST)$(EXE_EXT): $(RSATEST).o $(DLIBCRYPTO)
@@ -244,7 +247,8 @@ FIPS_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
 	fi; \
 	$(MAKE) -f $(TOP)/Makefile.shared -e \
 		CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
-		LIBDEPS="$(LDFLAGS) $$LIBRARIES $(EX_LIBS)" \
+		LDFLAG="$(LDFLAG)" \
+		LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
 		link_app.$${shlib_target}
 
 FIPS_CRYPTO_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
@@ -257,7 +261,8 @@ FIPS_CRYPTO_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
 	[ "$(FIPSCANLIB)" = "libfips" ] && LIBRARIES="$$LIBRARIES -lfips"; \
 	$(MAKE) -f $(TOP)/Makefile.shared -e \
 		CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
-		LIBDEPS="$(LDFLAGS) $$LIBRARIES $(EX_LIBS)" \
+		LDFLAG="$(LDFLAG)" \
+		LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
 		link_app.$${shlib_target}
 
 $(RMDTEST)$(EXE_EXT): $(RMDTEST).o $(DLIBCRYPTO)
@@ -368,16 +373,6 @@ $(ASYNCTEST)$(EXE_EXT): $(ASYNCTEST).o
 $(DTLSV1LISTENTEST)$(EXE_EXT): $(DTLSV1LISTENTEST).o
 	@target=$(DTLSV1LISTENTEST) $(BUILD_CMD)
 
-#$(AESTEST).o: $(AESTEST).c
-#	$(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c
-
-#$(AESTEST)$(EXE_EXT): $(AESTEST).o $(DLIBCRYPTO)
-#	if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \
-#	  $(CC) -o $(AESTEST)$(EXE_EXT) $(CFLAGS) $(AESTEST).o $(LDFLAGS) $(DLIBCRYPTO) $(EX_LIBS) ; \
-#	else \
-#	  $(CC) -o $(AESTEST)$(EXE_EXT) $(CFLAGS) $(AESTEST).o $(LDFLAGS) $(LIBCRYPTO) $(EX_LIBS) ; \
-#	fi
-
 dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO)
 	@target=dummytest; $(BUILD_CMD)
 


More information about the openssl-commits mailing list