Harden ASN.1 BIO handling of large amounts of data.
[openssl.git] / Makefile.org
index e6a6597926776d3b3e8e3fff276c0c1ce8381c9a..bc1c3be77aa3a9dcc1f416ed47d345b6acaa7d0b 100644 (file)
@@ -69,7 +69,7 @@ RANLIB= ranlib
 NM= nm
 PERL= perl
 TAR= tar
 NM= nm
 PERL= perl
 TAR= tar
-TARFLAGS= --no-recursion
+TARFLAGS= --no-recursion --record-size=10240
 MAKEDEPPROG=makedepend
 LIBDIR=lib
 
 MAKEDEPPROG=makedepend
 LIBDIR=lib
 
@@ -99,6 +99,8 @@ SHA1_ASM_OBJ=
 RMD160_ASM_OBJ= 
 WP_ASM_OBJ=
 CMLL_ENC=
 RMD160_ASM_OBJ= 
 WP_ASM_OBJ=
 CMLL_ENC=
+MODES_ASM_OBJ=
+ENGINES_ASM_OBJ=
 PERLASM_SCHEME=
 
 # KRB5 stuff
 PERLASM_SCHEME=
 
 # KRB5 stuff
@@ -177,12 +179,11 @@ SHARED_LDFLAGS=
 GENERAL=        Makefile
 BASENAME=       openssl
 NAME=           $(BASENAME)-$(VERSION)
 GENERAL=        Makefile
 BASENAME=       openssl
 NAME=           $(BASENAME)-$(VERSION)
-TARFILE=        $(NAME).tar
-WTARFILE=       $(NAME)-win.tar
+TARFILE=        ../$(NAME).tar
 EXHEADER=       e_os2.h
 HEADER=         e_os.h
 
 EXHEADER=       e_os2.h
 HEADER=         e_os.h
 
-all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
+all: Makefile build_all
 
 # as we stick to -e, CLEARENV ensures that local variables in lower
 # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
 
 # as we stick to -e, CLEARENV ensures that local variables in lower
 # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
@@ -196,7 +197,7 @@ CLEARENV=   TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS}     \
                $${EXHEADER+EXHEADER} $${HEADER+HEADER}         \
                $${GENERAL+GENERAL} $${CFLAGS+CFLAGS}           \
                $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS}           \
                $${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}
 
                $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS}     \
                $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
 
@@ -228,6 +229,8 @@ BUILDENV=   PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
                MD5_ASM_OBJ='$(MD5_ASM_OBJ)'                    \
                RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)'              \
                WP_ASM_OBJ='$(WP_ASM_OBJ)'                      \
                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}'                            \
                PERLASM_SCHEME='$(PERLASM_SCHEME)'              \
                FIPSLIBDIR='${FIPSLIBDIR}'                      \
                FIPSDIR='${FIPSDIR}'                            \
@@ -264,21 +267,25 @@ reflect:
        @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
 
 sub_all: build_all
        @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
 
 sub_all: build_all
+
 build_all: build_libs build_apps build_tests build_tools
 
 build_all: build_libs build_apps build_tests build_tools
 
-build_libs: build_crypto build_ssl build_engines
+build_libs: build_libcrypto build_libssl openssl.pc
+
+build_libcrypto: build_crypto build_engines libcrypto.pc
+build_libssl: build_ssl libssl.pc
 
 build_crypto:
        @dir=crypto; target=all; $(BUILD_ONE_CMD)
 
 build_crypto:
        @dir=crypto; target=all; $(BUILD_ONE_CMD)
-build_ssl:
+build_ssl: build_crypto
        @dir=ssl; target=all; $(BUILD_ONE_CMD)
        @dir=ssl; target=all; $(BUILD_ONE_CMD)
-build_engines:
+build_engines: build_crypto
        @dir=engines; target=all; $(BUILD_ONE_CMD)
        @dir=engines; target=all; $(BUILD_ONE_CMD)
-build_apps:
+build_apps: build_libs
        @dir=apps; target=all; $(BUILD_ONE_CMD)
        @dir=apps; target=all; $(BUILD_ONE_CMD)
-build_tests:
+build_tests: build_libs
        @dir=test; target=all; $(BUILD_ONE_CMD)
        @dir=test; target=all; $(BUILD_ONE_CMD)
-build_tools:
+build_tools: build_libs
        @dir=tools; target=all; $(BUILD_ONE_CMD)
 
 all_testapps: build_libs build_testapps
        @dir=tools; target=all; $(BUILD_ONE_CMD)
 
 all_testapps: build_libs build_testapps
@@ -295,10 +302,11 @@ libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT)
        @if [ "$(SHLIB_TARGET)" != "" ]; then \
                if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
                        FIPSLD_LIBCRYPTO=libcrypto.a ; \
        @if [ "$(SHLIB_TARGET)" != "" ]; then \
                if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
                        FIPSLD_LIBCRYPTO=libcrypto.a ; \
-                       FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)bin/fipsld; \
+                       FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \
                        export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \
                fi; \
                        export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \
                fi; \
-               $(MAKE) -e SHLIBDIRS=crypto build-shared; \
+               $(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; \
        else \
                echo "There's no support for shared libraries on this platform" >&2; \
                exit 1; \
@@ -360,7 +368,8 @@ libcrypto.pc: Makefile
            echo 'Description: OpenSSL cryptography library'; \
            echo 'Version: '$(VERSION); \
            echo 'Requires: '; \
            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
            echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
 
 libssl.pc: Makefile
@@ -373,7 +382,8 @@ libssl.pc: Makefile
            echo 'Description: Secure Sockets Layer and cryptography libraries'; \
            echo 'Version: '$(VERSION); \
            echo 'Requires: '; \
            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
            echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
 
 openssl.pc: Makefile
@@ -386,7 +396,8 @@ openssl.pc: Makefile
            echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
            echo 'Version: '$(VERSION); \
            echo 'Requires: '; \
            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
            echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
 
 Makefile: Makefile.org Configure config
@@ -395,7 +406,7 @@ Makefile: Makefile.org Configure config
        @false
 
 libclean:
        @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
 
 clean: libclean
        rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
@@ -437,7 +448,7 @@ rehash.time: certs apps
                [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
                OPENSSL_DEBUG_MEMORY=on; \
                export OPENSSL OPENSSL_DEBUG_MEMORY; \
                [ -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
 
                touch rehash.time; \
        else :; fi
 
@@ -451,6 +462,9 @@ tests: rehash
 report:
        @$(PERL) util/selftest.pl
 
 report:
        @$(PERL) util/selftest.pl
 
+update: errors stacks util/libeay.num util/ssleay.num TABLE
+       @set -e; target=update; $(RECURSIVE_BUILD_CMD)
+
 depend:
        @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
 
 depend:
        @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
 
@@ -462,9 +476,9 @@ tags:
        find . -name '[^.]*.[ch]' | xargs etags -a
 
 errors:
        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/mkerr.pl -recurse -write
        (cd engines; $(MAKE) PERL=$(PERL) errors)
-       $(PERL) util/ck_errf.pl */*.c */*/*.c
 
 stacks:
        $(PERL) util/mkstack.pl -write
 
 stacks:
        $(PERL) util/mkstack.pl -write
@@ -475,60 +489,44 @@ util/libeay.num::
 util/ssleay.num::
        $(PERL) util/mkdef.pl ssl update
 
 util/ssleay.num::
        $(PERL) util/mkdef.pl ssl update
 
-crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
-       $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
-crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
-       $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
-crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
-       $(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h
-
-apps/openssl-vms.cnf: apps/openssl.cnf
-       $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
-
-crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
-       $(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
-
-
 TABLE: Configure
        (echo 'Output of `Configure TABLE'"':"; \
        $(PERL) Configure TABLE) > TABLE
 
 TABLE: Configure
        (echo 'Output of `Configure TABLE'"':"; \
        $(PERL) Configure TABLE) > TABLE
 
-update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h crypto/objects/obj_xref.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
-
 # Build distribution tar-file. As the list of files returned by "find" is
 # pretty long, on several platforms a "too many arguments" error or similar
 # would occur. Therefore the list of files is temporarily stored into a file
 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
 # tar does not support the --files-from option.
 # Build distribution tar-file. As the list of files returned by "find" is
 # pretty long, on several platforms a "too many arguments" error or similar
 # would occur. Therefore the list of files is temporarily stored into a file
 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
 # tar does not support the --files-from option.
-tar:
+TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \
+                              --owner 0 --group 0 \
+                              --transform 's|^|$(NAME)/|' \
+                              -cvf -
+
+$(TARFILE).list:
+       find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
+              \! -name '*.so' \! -name '*.so.*'  \! -name 'openssl' \
+              \( \! -name '*test' -o -name bctest -o -name pod2mantest \) \
+              \! -name '.#*' \! -name '*~' \! -type l \
+           | sort > $(TARFILE).list
+
+tar: $(TARFILE).list
        find . -type d -print | xargs chmod 755
        find . -type f -print | xargs chmod a+r
        find . -type f -perm -0100 -print | xargs chmod a+x
        find . -type d -print | xargs chmod 755
        find . -type f -print | xargs chmod a+r
        find . -type f -perm -0100 -print | xargs chmod a+x
-       find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
-       $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
-       tardy --user_number=0  --user_name=openssl \
-             --group_number=0 --group_name=openssl \
-             --prefix=openssl-$(VERSION) - |\
-       gzip --best >../$(TARFILE).gz; \
-       rm -f ../$(TARFILE).list; \
-       ls -l ../$(TARFILE).gz
-
-tar-snap:
-       @$(TAR) $(TARFLAGS) -cvf - \
-               `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*'  \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
-       tardy --user_number=0  --user_name=openssl \
-             --group_number=0 --group_name=openssl \
-             --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
-       ls -l ../$(TARFILE)
+       $(TAR_COMMAND) | gzip --best > $(TARFILE).gz
+       rm -f $(TARFILE).list
+       ls -l $(TARFILE).gz
+
+tar-snap: $(TARFILE).list
+       $(TAR_COMMAND) > $(TARFILE)
+       rm -f $(TARFILE).list
+       ls -l $(TARFILE)
 
 dist:   
        $(PERL) Configure dist
 
 dist:   
        $(PERL) Configure dist
-       @$(MAKE) dist_pem_h
        @$(MAKE) SDIRS='$(SDIRS)' clean
        @$(MAKE) SDIRS='$(SDIRS)' clean
-       @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar
-
-dist_pem_h:
-       (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
+       @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
 
 install: all install_docs install_sw
 
 
 install: all install_docs install_sw
 
@@ -547,7 +545,7 @@ install_sw:
        chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
        done;
        @set -e; target=install; $(RECURSIVE_BUILD_CMD)
        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; \
        do \
                if [ -f "$$i" ]; then \
                (       echo installing $$i; \