Build files: add module installation targets
[openssl.git] / Configurations / unix-Makefile.tmpl
index ac24687609a919f6b01c188bd6abfed5838bec9b..b6f8da1ea960ae101f99469757360e14a820e893 100644 (file)
@@ -138,6 +138,14 @@ INSTALL_ENGINES={-
                                && $unified_info{attributes}->{modules}->{$_}->{engine} }
                         @{$unified_info{modules}}))
 -}
+INSTALL_MODDULES={-
+        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/.
@@ -532,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
 
@@ -702,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`; \
@@ -717,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`; \
@@ -729,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
@@ -962,12 +999,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 )
@@ -989,6 +1020,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 \
@@ -1031,6 +1063,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