From a3f1fc25017ef768a956b88edee4aaf851a58db2 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 26 Feb 2020 14:39:16 +0100 Subject: [PATCH] Build: Generate apps/progs.c and apps/progs.h in build time util/progs.pl depends on the build tree (on configdata.pm, specifically), so it needs to be run from the build tree. But why stop there? We might as well generate apps/progs.c and apps/progs.h when building. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11185) --- Configurations/descrip.mms.tmpl | 4 ++-- Configurations/unix-Makefile.tmpl | 10 ++-------- Configurations/windows-makefile.tmpl | 4 ++-- apps/build.info | 15 +++++++++++---- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl index bf22e40dc4..8ce6e78999 100644 --- a/Configurations/descrip.mms.tmpl +++ b/Configurations/descrip.mms.tmpl @@ -140,8 +140,8 @@ HTMLDOCS3={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man3}}) - HTMLDOCS5={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{man5}}) -} HTMLDOCS7={- join(", ", map { "-\n\t".$_ } @{$unified_info{htmldocs}->{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, # SYS$COMMON:[OPENSSL] and yet have everything installed in STAGING:[USER]. diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index ac24687609..a019779993 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -195,8 +195,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/. @@ -962,12 +962,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 ) diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index 859d3a6324..c49b32f0e1 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -130,8 +130,8 @@ HTMLDOCS5_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS5; HTMLDOCS7_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS7; join(' ', sort keys %dirs) -} -APPS_OPENSSL={- use File::Spec::Functions; - "\"".catfile("apps","openssl")."\"" -} +APPS_OPENSSL="{- use File::Spec::Functions; + catfile("apps","openssl") -}" # Do not edit these manually. Use Configure with --prefix or --openssldir # to change this! Short explanation in the top comment in Configure diff --git a/apps/build.info b/apps/build.info index 1b931c8ac1..495e56065e 100644 --- a/apps/build.info +++ b/apps/build.info @@ -19,6 +19,10 @@ $OPENSSLSRC=\ s_client.c s_server.c s_time.c sess_id.c smime.c speed.c \ spkac.c srp.c ts.c verify.c version.c x509.c rehash.c storeutl.c \ list.c info.c provider.c fipsinstall.c +IF[{- !$disabled{'deprecated-3.0'} -}] + $OPENSSLSRC=$OPENSSLSRC \ + dhparam.c dsa.c dsaparam.c gendsa.c rsa.c rsautl.c genrsa.c +ENDIF IF[{- !$disabled{apps} -}] PROGRAMS=openssl @@ -26,15 +30,18 @@ IF[{- !$disabled{apps} -}] INCLUDE[openssl]=.. ../include include DEPEND[openssl]=libapps.a ../libssl + DEPEND[${OPENSSLSRC/.c/.o}]=progs.h + GENERATE[progs.c]=progs.pl -C $(APPS_OPENSSL) + GENERATE[progs.h]=progs.pl -H $(APPS_OPENSSL) + # progs.pl tries to read all 'openssl' sources, including progs.c, so we make + # sure things are generated in the correct order. + DEPEND[progs.h]=progs.c + IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-)/ -}] GENERATE[openssl.rc]=../util/mkrc.pl openssl SOURCE[openssl]=openssl.rc ENDIF - IF[{- !$disabled{'deprecated-3.0'} -}] - SOURCE[openssl]=dhparam.c dsa.c dsaparam.c gendsa.c rsa.c rsautl.c genrsa.c - ENDIF - SCRIPTS{misc}=CA.pl SOURCE[CA.pl]=CA.pl.in # linkname tells build files that a symbolic link or copy of this script -- 2.25.1