Configure DEPs for FIPS provider on AIX.
[openssl.git] / Configurations / unix-Makefile.tmpl
index 6777bb8de9fc986e377450fe17c210fa2276fe5a..fc4f60770b9b867b6f5462a4273deb4bdb692fe0 100644 (file)
@@ -138,6 +138,14 @@ INSTALL_ENGINES={-
                                && $unified_info{attributes}->{modules}->{$_}->{engine} }
                         @{$unified_info{modules}}))
 -}
+INSTALL_MODULES={-
+        join(" \\\n" . ' ' x 16,
+             fill_lines(" ", $COLUMNS - 16,
+                        map { platform->dso($_) }
+                        grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
+                               && !$unified_info{attributes}->{modules}->{$_}->{engine} }
+                        @{$unified_info{modules}}))
+-}
 INSTALL_PROGRAMS={-
         join(" \\\n" . ' ' x 16,
              fill_lines(" ", $COLUMNS - 16, map { platform->bin($_) }
@@ -195,8 +203,8 @@ MANDOCS7={-
              fill_lines(" ", $COLUMNS - 9, map { platform->bin($_) }
                         @{$unified_info{mandocs}->{man7}})) -}
 
-APPS_OPENSSL={- use File::Spec::Functions;
-                catfile("apps","openssl") -}
+APPS_OPENSSL="{- use File::Spec::Functions;
+                 catfile("apps","openssl") -}"
 
 # DESTDIR is for package builders so that they can configure for, say,
 # /usr/ and yet have everything installed to /tmp/somedir/usr/.
@@ -464,16 +472,11 @@ all: build_sw build_docs
 test: tests
 {- dependmagic('tests'); -}: build_programs_nodep build_modules_nodep link-utils
        @ : {- output_off() if $disabled{tests}; "" -}
-       ( cd test; \
-         mkdir -p test-runs; \
-         SRCTOP=../$(SRCDIR) \
-         BLDTOP=../$(BLDDIR) \
-         RESULT_D=test-runs \
+       ( SRCTOP=$(SRCDIR) \
+         BLDTOP=$(BLDDIR) \
          PERL="$(PERL)" \
          EXE_EXT={- platform->binext() -} \
-         OPENSSL_ENGINES=`cd ../$(BLDDIR)/engines 2>/dev/null && pwd` \
-         OPENSSL_MODULES=`cd ../$(BLDDIR)/providers 2>/dev/null && pwd` \
-         $(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
+         $(PERL) $(SRCDIR)/test/run_tests.pl $(TESTS) )
        @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
        @echo "Tests are not supported with your chosen Configure options"
        @ : {- output_on() if !$disabled{tests}; "" -}
@@ -516,7 +519,7 @@ clean: libclean
        -$(RM) `find . -name '*{- platform->depext() -}' \! -name '.*' \! -type d -print`
        -$(RM) `find . -name '*{- platform->objext() -}' \! -name '.*' \! -type d -print`
        $(RM) core
-       $(RM) tags TAGS doc-nits cmd-nits
+       $(RM) tags TAGS doc-nits cmd-nits md-nits
        $(RM) -r test/test-runs
        $(RM) openssl.pc libcrypto.pc libssl.pc
        -$(RM) `find . -type l \! -name '.*' -print`
@@ -537,9 +540,9 @@ depend:
 
 # Install helper targets #############################################
 
-install_sw: install_dev install_engines install_runtime
+install_sw: install_dev install_engines install_modules install_runtime
 
-uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
+uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
 
 install_docs: install_man_docs install_html_docs
 
@@ -707,10 +710,12 @@ uninstall_dev: uninstall_runtime_libs
        -$(RMDIR) $(DESTDIR)$(libdir)/pkgconfig
        -$(RMDIR) $(DESTDIR)$(libdir)
 
-install_engines: install_runtime_libs build_modules
+_install_modules_deps: install_runtime_libs build_modules
+
+install_engines: _install_modules_deps
        @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
        @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
-       @$(ECHO) "*** Installing ENGINE modules"
+       @$(ECHO) "*** Installing engines"
        @set -e; for e in dummy $(INSTALL_ENGINES); do \
                if [ "$$e" = "dummy" ]; then continue; fi; \
                fn=`basename $$e`; \
@@ -722,7 +727,7 @@ install_engines: install_runtime_libs build_modules
        done
 
 uninstall_engines:
-       @$(ECHO) "*** Uninstalling ENGINE modules"
+       @$(ECHO) "*** Uninstalling engines"
        @set -e; for e in dummy $(INSTALL_ENGINES); do \
                if [ "$$e" = "dummy" ]; then continue; fi; \
                fn=`basename $$e`; \
@@ -734,6 +739,33 @@ uninstall_engines:
        done
        -$(RMDIR) $(DESTDIR)$(ENGINESDIR)
 
+install_modules: _install_modules_deps
+       @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
+       @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MODULESDIR)/
+       @$(ECHO) "*** Installing modules"
+       @set -e; for e in dummy $(INSTALL_MODULES); do \
+               if [ "$$e" = "dummy" ]; then continue; fi; \
+               fn=`basename $$e`; \
+               $(ECHO) "install $$e -> $(DESTDIR)$(MODULESDIR)/$$fn"; \
+               cp $$e $(DESTDIR)$(MODULESDIR)/$$fn.new; \
+               chmod 755 $(DESTDIR)$(MODULESDIR)/$$fn.new; \
+               mv -f $(DESTDIR)$(MODULESDIR)/$$fn.new \
+                     $(DESTDIR)$(MODULESDIR)/$$fn; \
+       done
+
+uninstall_modules:
+       @$(ECHO) "*** Uninstalling modules"
+       @set -e; for e in dummy $(INSTALL_MODULES); do \
+               if [ "$$e" = "dummy" ]; then continue; fi; \
+               fn=`basename $$e`; \
+               if [ "$$fn" = '{- platform->dso("ossltest") -}' ]; then \
+                       continue; \
+               fi; \
+               $(ECHO) "$(RM) $(DESTDIR)$(MODULESDIR)/$$fn"; \
+               $(RM) $(DESTDIR)$(MODULESDIR)/$$fn; \
+       done
+       -$(RMDIR) $(DESTDIR)$(MODULESDIR)
+
 install_runtime: install_programs
 
 install_runtime_libs: build_libs
@@ -827,30 +859,30 @@ install_man_docs: build_man_docs
        @set -e; for x in dummy $(MANDOCS1); do \
                if [ "$$x" = "dummy" ]; then continue; fi; \
                fn=`basename $$x`; \
-               $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man1/$$fn"; \
-               cp $$x $(DESTDIR)$(MANDIR)/man1/$$fn$(MANSUFFIX); \
-               chmod 755 $(DESTDIR)$(MANDIR)/man1/$$fn$(MANSUFFIX); \
+               $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
+               cp $$x $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX); \
+               chmod 755 $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX); \
        done
        @set -e; for x in dummy $(MANDOCS3); do \
                if [ "$$x" = "dummy" ]; then continue; fi; \
                fn=`basename $$x`; \
-               $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man3/$$fn"; \
-               cp $$x $(DESTDIR)$(MANDIR)/man3/$$fn$(MANSUFFIX); \
-               chmod 755 $(DESTDIR)$(MANDIR)/man3/$$fn$(MANSUFFIX); \
+               $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
+               cp $$x $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX); \
+               chmod 755 $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX); \
        done
        @set -e; for x in dummy $(MANDOCS5); do \
                if [ "$$x" = "dummy" ]; then continue; fi; \
                fn=`basename $$x`; \
-               $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man5/$$fn"; \
-               cp $$x $(DESTDIR)$(MANDIR)/man5/$$fn$(MANSUFFIX); \
-               chmod 755 $(DESTDIR)$(MANDIR)/man5/$$fn$(MANSUFFIX); \
+               $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
+               cp $$x $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX); \
+               chmod 755 $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX); \
        done
        @set -e; for x in dummy $(MANDOCS7); do \
                if [ "$$x" = "dummy" ]; then continue; fi; \
                fn=`basename $$x`; \
-               $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man7/$$fn"; \
-               cp $$x $(DESTDIR)$(MANDIR)/man7/$$fn$(MANSUFFIX); \
-               chmod 755 $(DESTDIR)$(MANDIR)/man7/$$fn$(MANSUFFIX); \
+               $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
+               cp $$x $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX); \
+               chmod 755 $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX); \
        done
 
 uninstall_man_docs:
@@ -858,26 +890,26 @@ uninstall_man_docs:
        @set -e; for x in dummy $(MANDOCS1); do \
                if [ "$$x" = "dummy" ]; then continue; fi; \
                fn=`basename $$x`; \
-               $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man1/$$fn"; \
-               $(RM) $(DESTDIR)$(MANDIR)/man1/$$fn$(MANSUFFIX); \
+               $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
+               $(RM) $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX); \
        done
        @set -e; for x in dummy $(MANDOCS3); do \
                if [ "$$x" = "dummy" ]; then continue; fi; \
                fn=`basename $$x`; \
-               $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man3/$$fn"; \
-               $(RM) $(DESTDIR)$(MANDIR)/man3/$$fn$(MANSUFFIX); \
+               $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
+               $(RM) $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX); \
        done
        @set -e; for x in dummy $(MANDOCS5); do \
                if [ "$$x" = "dummy" ]; then continue; fi; \
                fn=`basename $$x`; \
-               $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man5/$$fn"; \
-               $(RM) $(DESTDIR)$(MANDIR)/man5/$$fn$(MANSUFFIX); \
+               $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
+               $(RM) $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX); \
        done
        @set -e; for x in dummy $(MANDOCS7); do \
                if [ "$$x" = "dummy" ]; then continue; fi; \
                fn=`basename $$x`; \
-               $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man7/$$fn"; \
-               $(RM) $(DESTDIR)$(MANDIR)/man7/$$fn$(MANSUFFIX); \
+               $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
+               $(RM) $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX); \
        done
 
 install_html_docs: build_html_docs
@@ -950,13 +982,22 @@ update: generate errors ordinals
 generate: generate_apps generate_crypto_bn generate_crypto_objects \
           generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
 
-.PHONY: doc-nits cmd-nits
+.PHONY: doc-nits cmd-nits md-nits
 doc-nits: build_generated
        $(PERL) $(SRCDIR)/util/find-doc-nits -n -l -e
 
 cmd-nits: build_generated apps/openssl
        $(PERL) $(SRCDIR)/util/find-doc-nits -c
 
+# This uses "mdl", the markdownlint application, which is written in ruby.
+# The source is at https://github.com/markdownlint/markdownlint
+# If you have ruby installed, "gem install mdl" should work.
+# Another option is at https://snapcraft.io/install/mdl/debian
+# Finally, there's a Node.js version, which we haven't tried, that
+# can be found at https://github.com/DavidAnson/markdownlint
+md-nits:
+       mdl -s util/markdownlint.rb .
+
 # Test coverage is a good idea for the future
 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
 #      ...
@@ -967,12 +1008,6 @@ lint:
 generate_apps:
        ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
                                < apps/openssl.cnf > apps/openssl-vms.cnf )
-       @ : {- output_off() if $disabled{apps}; "" -}
-       ( b=`pwd`; cd $(SRCDIR); \
-         $(PERL) -I$$b apps/progs.pl -H $(APPS_OPENSSL) > apps/progs.h )
-       ( b=`pwd`; cd $(SRCDIR); \
-         $(PERL) -I$$b apps/progs.pl -C $(APPS_OPENSSL) > apps/progs.c )
-       @ : {- output_on() if $disabled{apps}; "" -}
 
 generate_crypto_bn:
        ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
@@ -994,6 +1029,7 @@ generate_crypto_objects:
                                crypto/objects/obj_mac.num \
                                crypto/objects/obj_xref.txt \
                                > crypto/objects/obj_xref.h )
+       ( cd $(SRCDIR); cat crypto/objects/obj_compat.h >> include/openssl/obj_mac.h )
 
 generate_crypto_conf:
        ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
@@ -1036,6 +1072,7 @@ errors:
        qw( include/internal/dso.h
            include/internal/o_dir.h
            include/internal/err.h
+           include/internal/evp.h
            include/internal/sslconf.h );
    our @cryptoskipheaders = ( @sslheaders,
        qw( include/openssl/conf_api.h
@@ -1083,12 +1120,12 @@ tar:
 
 # Helper targets #####################################################
 
-link-utils: $(BLDDIR)/util/opensslwrap.sh
+link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/wrap.pl
 
-$(BLDDIR)/util/opensslwrap.sh: configdata.pm
+$(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/wrap.pl: configdata.pm
        @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
            mkdir -p "$(BLDDIR)/util"; \
-           ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
+           ln -sf "../$(SRCDIR)/util/`basename "$@"`" "$(BLDDIR)/util"; \
        fi
 
 FORCE:
@@ -1190,10 +1227,7 @@ reconfigure reconf:
          my $pod = $args{generator}->[0];
          return <<"EOF";
 $args{src}: $pod
-       pod2html "--podroot=\$(SRCDIR)/doc" --htmldir=.. \\
-                --podpath=man1:man3:man5:man7 --infile=$pod "--title=$title" \\
-       | \$(PERL) -pe 's|href="http://man\\.he\\.net/(man\\d/[^"]+)(?:\\.html)?"|href="../\$1.html|g;' \\
-       > \$\@
+       \$(PERL) \$(SRCDIR)/util/mkpod2html.pl -i "$pod" -o \$\@ -t "$title" -r "\$(SRCDIR)/doc"
 EOF
       } elsif ($args{src} =~ /\.(\d)$/) {
          my $section = $1;
@@ -1202,8 +1236,7 @@ EOF
          return <<"EOF";
 $args{src}: $pod
        pod2man --name=$name --section=$section --center=OpenSSL \\
-               --release=\$(VERSION) $pod \\
-       > \$\@
+               --release=\$(VERSION) $pod >\$\@
 EOF
       } elsif (platform->isdef($args{src})) {
           my $target = platform->def($args{src});
@@ -1244,7 +1277,7 @@ EOF
 
           if ($args{generator}->[0] =~ /\.pl$/) {
               $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator
-                  .' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSSOR)';
+                  .' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSOR)';
           } elsif ($args{generator}->[0] =~ /\.m4$/) {
               $generator = 'm4 -B 8192'.$generator_incs.' '.$generator.' >'
           } elsif ($args{generator}->[0] =~ /\.S$/) {
@@ -1452,7 +1485,8 @@ EOF
                  @{$args{objs}};
       my @deps = compute_lib_depends(@{$args{deps}});
       my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
-
+      # TODO(3.0): next line needs to become "less magic" (see PR #11950)
+      $shared_def .= ' '.$target{shared_fipsflag} if (m/providers\/fips/ && defined $target{shared_fipsflag});
       my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
       my $deps = join(" \\\n" . ' ' x (length($dso) + 2),
                       fill_lines(' ', $COLUMNS - length($dso) - 2,