From: Richard Levitte Date: Tue, 5 Feb 2019 22:18:50 +0000 (+0100) Subject: Replumbing: Add MODULESDIR macro and OPENSSL_MODULES environment variable X-Git-Tag: openssl-3.0.0-alpha1~2400 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3f4e8d6604842db4f416d029e9bbeddf90976c00;p=oweals%2Fopenssl.git Replumbing: Add MODULESDIR macro and OPENSSL_MODULES environment variable These will be used to point out general OpenSSL modules directory. ENGINE modules are kept apart for backward compatibility. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/8287) --- diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl index 8efdeb7b36..2f74756d1a 100644 --- a/Configurations/descrip.mms.tmpl +++ b/Configurations/descrip.mms.tmpl @@ -167,6 +167,8 @@ OPENSSLDIR={- catdir($config{openssldir}) or OPENSSLDIR_C={- platform->osslprefix() -}DATAROOT:[000000] # Where installed ENGINE modules reside, for C ENGINESDIR_C={- platform->osslprefix() -}ENGINES{- $sover_dirname.$target{pointer_size} -}: +# Where modules reside, for C +MODULESDIR_C={- platform->osslprefix() -}MODULES{- $sover_dirname.$target{pointer_size} -}: ##### User defined commands and flags ################################ @@ -226,7 +228,8 @@ LIB_DEFINES={- our $lib_defines = @{$config{shared_defines}})); join('', $lib_defines, (map { ",$_" } 'OPENSSLDIR="""$(OPENSSLDIR_C)"""', - 'ENGINESDIR="""$(ENGINESDIR_C)"""'), + 'ENGINESDIR="""$(ENGINESDIR_C)"""', + 'MODULESDIR="""$(MODULESDIR_C)"""'), '$(CNF_DEFINES)', '$(DEFINES)') -} LIB_INCLUDES={- our $lib_includes = join(',', @{$target{lib_includes}}, diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index dfae9afd0e..2561c47391 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -142,6 +142,7 @@ LIBDIR={- our $libdir = $config{libdir}; libdir={- file_name_is_absolute($libdir) ? $libdir : '$(INSTALLTOP)/$(LIBDIR)' -} ENGINESDIR=$(libdir)/engines-{- $sover_dirname -} +MODULESDIR=$(libdir)/ossl-modules # Convenience variable for those who want to set the rpath in shared # libraries and applications @@ -238,7 +239,8 @@ LIB_CPPFLAGS={- our $lib_cppflags = join(' ', $lib_cppflags, (map { '-D'.$_ } 'OPENSSLDIR="\"$(OPENSSLDIR)\""', - 'ENGINESDIR="\"$(ENGINESDIR)\""'), + 'ENGINESDIR="\"$(ENGINESDIR)\""', + 'MODULESDIR="\"$(MODULESDIR)\""'), '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -} LIB_CFLAGS={- join(' ', $target{lib_cflags} || (), $target{shared_cflag} || (), diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index 6d38cfe15f..f327169c80 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -148,20 +148,33 @@ OPENSSLDIR_dev={- # OPENSSLDIR_dir={- canonpath($openssldir_dir) -} LIBDIR={- our $libdir = $config{libdir} || "lib"; file_name_is_absolute($libdir) ? "" : $libdir -} -ENGINESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath); - our $enginesdir = catdir($prefix,$libdir,"engines-$sover_dirname"); - our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) = - splitpath($enginesdir, 1); - $enginesdir_dev -} +MODULESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath); + our $modulesprefix = catdir($prefix,$libdir); + our ($modulesprefix_dev, $modulesprefix_dir, + $modulesprefix_file) = + splitpath($modulesprefix, 1); + our $modulesdir_dev = $modulesprefix_dev; + our $modulesdir_dir = + catdir($modulesprefix_dir, "ossl-modules"); + our $modulesdir = catpath($modulesdir_dev, $modulesdir_dir); + our $enginesdir_dev = $modulesprefix_dev; + out $enginesdir_dir = + catdir($modulesprefix_dir, "engines-$sover_dirname"); + our $enginesdir = catpath($enginesdir_dev, $enginesdir_dir); + $modulesdir_dev -} +MODULESDIR_dir={- canonpath($modulesdir_dir) -} +ENGINESDIR_dev={- $enginesdir_dev -} ENGINESDIR_dir={- canonpath($enginesdir_dir) -} !IF "$(DESTDIR)" != "" INSTALLTOP=$(DESTDIR)$(INSTALLTOP_dir) OPENSSLDIR=$(DESTDIR)$(OPENSSLDIR_dir) ENGINESDIR=$(DESTDIR)$(ENGINESDIR_dir) +MODULESDIR=$(DESTDIR)$(MODULESDIR_dir) !ELSE INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir) OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir) ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir) +MODULESDIR=$(MODULESDIR_dev)$(MODULESDIR_dir) !ENDIF # $(libdir) is chosen to be compatible with the GNU coding standards @@ -255,7 +268,8 @@ LIB_CPPFLAGS={- our $lib_cppflags = join(' ', $lib_cppflags, (map { '-D'.quotify1($_) } "OPENSSLDIR=\"$openssldir\"", - "ENGINESDIR=\"$enginesdir\""), + "ENGINESDIR=\"$enginesdir\"", + "MODULESDIR=\"$modulesdir\""), '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -} LIB_CFLAGS={- join(' ', $target{lib_cflags} || (), $target{shared_cflag} || (),