Fix misc NULL derefs in sureware engine
[openssl.git] / Makefile.org
index 4f5b4351ff3cd6c44d54c6665e436b45478656f7..c92806f9201fe56a75a0bf28fcd997119dd13ae2 100644 (file)
@@ -69,7 +69,7 @@ RANLIB= ranlib
 NM= nm
 PERL= perl
 TAR= tar
-TARFLAGS= --no-recursion
+TARFLAGS= --no-recursion --record-size=10240
 MAKEDEPPROG=makedepend
 LIBDIR=lib
 
@@ -99,6 +99,8 @@ SHA1_ASM_OBJ=
 RMD160_ASM_OBJ= 
 WP_ASM_OBJ=
 CMLL_ENC=
+MODES_ASM_OBJ=
+ENGINES_ASM_OBJ=
 PERLASM_SCHEME=
 
 # KRB5 stuff
@@ -145,7 +147,7 @@ SDIRS=  \
        bn ec rsa dsa ecdsa dh ecdh dso engine \
        buffer bio stack lhash rand err \
        evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
-       cms pqueue ts jpake srp store
+       cms pqueue ts jpake srp store cmac
 # keep in mind that the above list is adjusted by ./Configure
 # according to no-xxx arguments...
 
@@ -196,7 +198,7 @@ CLEARENV=   TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS}     \
                $${EXHEADER+EXHEADER} $${HEADER+HEADER}         \
                $${GENERAL+GENERAL} $${CFLAGS+CFLAGS}           \
                $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS}           \
-               $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS}             \
+               $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \
                $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS}     \
                $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
 
@@ -228,6 +230,8 @@ BUILDENV=   PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
                MD5_ASM_OBJ='$(MD5_ASM_OBJ)'                    \
                RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)'              \
                WP_ASM_OBJ='$(WP_ASM_OBJ)'                      \
+               MODES_ASM_OBJ='$(MODES_ASM_OBJ)'                \
+               ENGINES_ASM_OBJ='$(ENGINES_ASM_OBJ)'            \
                PERLASM_SCHEME='$(PERLASM_SCHEME)'              \
                FIPSLIBDIR='${FIPSLIBDIR}'                      \
                FIPSDIR='${FIPSDIR}'                            \
@@ -285,9 +289,21 @@ all_testapps: build_libs build_testapps
 build_testapps:
        @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
 
-libcrypto$(SHLIB_EXT): libcrypto.a
+fips_premain_dso$(EXE_EXT): libcrypto.a
+       [ -z "$(FIPSCANLIB)" ] || $(CC) $(CFLAG) -Iinclude \
+               -DFINGERPRINT_PREMAIN_DSO_LOAD -o $@  \
+               $(FIPSLIBDIR)fips_premain.c $(FIPSLIBDIR)fipscanister.o \
+               libcrypto.a $(EX_LIBS)
+
+libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT)
        @if [ "$(SHLIB_TARGET)" != "" ]; then \
-               $(MAKE) SHLIBDIRS=crypto build-shared; \
+               if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
+                       FIPSLD_LIBCRYPTO=libcrypto.a ; \
+                       FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \
+                       export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \
+               fi; \
+               $(MAKE) -e SHLIBDIRS=crypto  CC="$${CC:-$(CC)}" build-shared && \
+               (touch -c fips_premain_dso$(EXE_EXT) || :); \
        else \
                echo "There's no support for shared libraries on this platform" >&2; \
                exit 1; \
@@ -349,7 +365,8 @@ libcrypto.pc: Makefile
            echo 'Description: OpenSSL cryptography library'; \
            echo 'Version: '$(VERSION); \
            echo 'Requires: '; \
-           echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \
+           echo 'Libs: -L$${libdir} -lcrypto'; \
+           echo 'Libs.private: $(EX_LIBS)'; \
            echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
 
 libssl.pc: Makefile
@@ -362,7 +379,8 @@ libssl.pc: Makefile
            echo 'Description: Secure Sockets Layer and cryptography libraries'; \
            echo 'Version: '$(VERSION); \
            echo 'Requires: '; \
-           echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
+           echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
+           echo 'Libs.private: $(EX_LIBS)'; \
            echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
 
 openssl.pc: Makefile
@@ -375,7 +393,8 @@ openssl.pc: Makefile
            echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
            echo 'Version: '$(VERSION); \
            echo 'Requires: '; \
-           echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
+           echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
+           echo 'Libs.private: $(EX_LIBS)'; \
            echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
 
 Makefile: Makefile.org Configure config
@@ -384,7 +403,7 @@ Makefile: Makefile.org Configure config
        @false
 
 libclean:
-       rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib
+       rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
 
 clean: libclean
        rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
@@ -426,7 +445,7 @@ rehash.time: certs apps
                [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
                OPENSSL_DEBUG_MEMORY=on; \
                export OPENSSL OPENSSL_DEBUG_MEMORY; \
-               $(PERL) tools/c_rehash certs) && \
+               $(PERL) tools/c_rehash certs/demo) && \
                touch rehash.time; \
        else :; fi
 
@@ -451,9 +470,9 @@ tags:
        find . -name '[^.]*.[ch]' | xargs etags -a
 
 errors:
+       $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
        $(PERL) util/mkerr.pl -recurse -write
        (cd engines; $(MAKE) PERL=$(PERL) errors)
-       $(PERL) util/ck_errf.pl */*.c */*/*.c
 
 stacks:
        $(PERL) util/mkstack.pl -write
@@ -536,7 +555,7 @@ install_sw:
        chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
        done;
        @set -e; target=install; $(RECURSIVE_BUILD_CMD)
-       @set -e; for i in $(LIBS) ;\
+       @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
        do \
                if [ -f "$$i" ]; then \
                (       echo installing $$i; \