From ac6bba6f6ea328ba22425d6f3f95847452193293 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 7 Nov 2018 11:02:06 +0100 Subject: [PATCH] Build: Change all _NO_INST to use attributes instead. This means that all PROGRAMS_NO_INST, LIBS_NO_INST, ENGINES_NO_INST and SCRIPTS_NO_INST are changed to be PROGRAM, LIBS, ENGINES and SCRIPTS with the associated attribute 'noinst'. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/7581) --- Configurations/descrip.mms.tmpl | 18 ++++++++--- Configurations/unix-Makefile.tmpl | 35 ++++++++++++++++----- Configurations/windows-makefile.tmpl | 47 ++++++++++++++++++++++------ apps/build.info | 2 +- engines/build.info | 2 +- fuzz/build.info | 12 +++---- test/build.info | 34 ++++++++++---------- test/ossl_shim/build.info | 2 +- util/build.info | 4 +-- 9 files changed, 106 insertions(+), 50 deletions(-) diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl index ebafcc76f9..f87de15487 100644 --- a/Configurations/descrip.mms.tmpl +++ b/Configurations/descrip.mms.tmpl @@ -48,10 +48,18 @@ @{$unified_info{libraries}}; our @install_libs = map { platform->staticname($_) } - @{$unified_info{install}->{libraries}}; + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{libraries}}; our @install_shlibs = map { platform->sharedname($_) // () } - @{$unified_info{install}->{libraries}}; + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{libraries}}; + our @install_engines = + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{engines}}; + our @install_programs = + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{programs}}; # This is a horrible hack, but is needed because recursive inclusion of files # in different directories does not work well with HP C. @@ -124,8 +132,8 @@ GENERATED={- # common0.tmpl provides @generated INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -} INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -} -INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{install}->{engines}}) -} -INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{install}->{programs}}) -} +INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @install_engines) -} +INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @install_programs) -} {- output_off() if $disabled{apps}; "" -} BIN_SCRIPTS=[.tools]c_rehash.pl MISC_SCRIPTS=[.apps]CA.pl, [.apps]tsget.pl @@ -552,7 +560,7 @@ install_engines : check_INSTALLTOP install_runtime_libs build_engines - CREATE/DIR ossl_installroot:[ENGINES{- $sover_dirname.$target{pointer_size} -}.'arch'] {- join("\n ", map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover_dirname$target{pointer_size}.'arch']" } - @{$unified_info{install}->{engines}}) -} + @install_engines) -} @ {- output_on() unless scalar @{$unified_info{engines}}; "" -} ! install_runtime : install_programs diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index 4c76b8d7ea..e197e1a21f 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -52,14 +52,33 @@ GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}}) -} GENERATED={- # common0.tmpl provides @generated join(" ", map { platform->convertext($_) } @generated ) -} -INSTALL_LIBS={- join(" ", map { platform->staticlib($_) // () } @{$unified_info{install}->{libraries}}) -} -INSTALL_SHLIBS={- join(" ", map { platform->sharedlib($_) // () } @{$unified_info{install}->{libraries}}) -} -INSTALL_SHLIB_INFO={- join(" ", map { my $x = platform->sharedlib($_); - my $y = platform->sharedlib_simple($_); - $x ? "\"$x;$y\"" : () } - @{$unified_info{install}->{libraries}}) -} -INSTALL_ENGINES={- join(" ", map { platform->dso($_) } @{$unified_info{install}->{engines}}) -} -INSTALL_PROGRAMS={- join(" ", map { platform->bin($_) } @{$unified_info{install}->{programs}}) -} +INSTALL_LIBS={- + join(" ", map { platform->staticlib($_) // () } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{libraries}}) +-} +INSTALL_SHLIBS={- + join(" ", map { platform->sharedlib($_) // () } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{libraries}}) +-} +INSTALL_SHLIB_INFO={- + join(" ", map { my $x = platform->sharedlib($_); + my $y = platform->sharedlib_simple($_); + $x ? "\"$x;$y\"" : () } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{libraries}}) +-} +INSTALL_ENGINES={- + join(" ", map { platform->dso($_) } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{engines}}) +-} +INSTALL_PROGRAMS={- + join(" ", map { platform->bin($_) } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{programs}}) +-} {- output_off() if $disabled{apps}; "" -} BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash MISC_SCRIPTS=$(BLDDIR)/apps/CA.pl $(BLDDIR)/apps/tsget.pl:tsget diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index 97e59c3898..e114d6b279 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -59,15 +59,44 @@ GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -} GENERATED={- # common0.tmpl provides @generated join(" ", map { platform->convertext($_) } @generated) -} -INSTALL_LIBS={- join(" ", map { quotify1(platform->sharedlib_import($_) // platform->staticlib($_)) } @{$unified_info{install}->{libraries}}) -} -INSTALL_SHLIBS={- join(" ", map { my $x = platform->sharedlib($_); - $x ? quotify_l($x) : () } @{$unified_info{install}->{libraries}}) -} -INSTALL_SHLIBPDBS={- join(" ", map { my $x = platform->sharedlibpdb($_); - $x ? quotify_l($x) : () } @{$unified_info{install}->{libraries}}) -} -INSTALL_ENGINES={- join(" ", map { quotify1(platform->dso($_)) } @{$unified_info{install}->{engines}}) -} -INSTALL_ENGINEPDBS={- join(" ", map { quotify1(platform->dsopdb($_)) } @{$unified_info{install}->{engines}}) -} -INSTALL_PROGRAMS={- join(" ", map { quotify1(platform->bin($_)) } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -} -INSTALL_PROGRAMPDBS={- join(" ", map { quotify1(platform->binpdb($_)) } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -} +INSTALL_LIBS={- + join(" ", map { quotify1(platform->sharedlib_import($_) + // platform->staticlib($_)) } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{libraries}}) +-} +INSTALL_SHLIBS={- + join(" ", map { my $x = platform->sharedlib($_); + $x ? quotify_l($x) : () } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{libraries}}) +-} +INSTALL_SHLIBPDBS={- + join(" ", map { my $x = platform->sharedlibpdb($_); + $x ? quotify_l($x) : () } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{libraries}}) +-} +INSTALL_ENGINES={- + join(" ", map { quotify1(platform->dso($_)) } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{engines}}) +-} +INSTALL_ENGINEPDBS={- + join(" ", map { quotify1(platform->dsopdb($_)) } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{engines}}) +-} +INSTALL_PROGRAMS={- + join(" ", map { quotify1(platform->bin($_)) } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{programs}}) +-} +INSTALL_PROGRAMPDBS={- + join(" ", map { quotify1(platform->binpdb($_)) } + grep { !$unified_info{attributes}->{$_}->{noinst} } + @{$unified_info{programs}}) +-} {- output_off() if $disabled{apps}; "" -} BIN_SCRIPTS="$(BLDDIR)\tools\c_rehash.pl" MISC_SCRIPTS="$(BLDDIR)\apps\CA.pl" "$(BLDDIR)\apps\tsget.pl" diff --git a/apps/build.info b/apps/build.info index 751d8da828..de356874d8 100644 --- a/apps/build.info +++ b/apps/build.info @@ -12,7 +12,7 @@ our @apps_init_src = split(/\s+/, $target{apps_init_src}); "" -} IF[{- !$disabled{apps} -}] - LIBS_NO_INST=libapps.a + LIBS{noinst}=libapps.a SOURCE[libapps.a]={- join(" ", @apps_lib_src) -} INCLUDE[libapps.a]=.. ../include diff --git a/engines/build.info b/engines/build.info index 53730068d9..a4a4d93062 100644 --- a/engines/build.info +++ b/engines/build.info @@ -40,7 +40,7 @@ IF[{- !$disabled{"engine"} -}] ENDIF ENDIF - ENGINES_NO_INST=ossltest dasync + ENGINES{noinst}=ossltest dasync SOURCE[dasync]=e_dasync.c DEPEND[dasync]=../libcrypto INCLUDE[dasync]=../include diff --git a/fuzz/build.info b/fuzz/build.info index cde03d3447..0b65ee09d9 100644 --- a/fuzz/build.info +++ b/fuzz/build.info @@ -9,14 +9,14 @@ -} IF[{- !$disabled{"fuzz-afl"} || !$disabled{"fuzz-libfuzzer"} -}] - PROGRAMS_NO_INST=asn1 asn1parse bignum bndiv client conf crl server x509 + PROGRAMS{noinst}=asn1 asn1parse bignum bndiv client conf crl server x509 IF[{- !$disabled{"cms"} -}] - PROGRAMS_NO_INST=cms + PROGRAMS{noinst}=cms ENDIF IF[{- !$disabled{"ct"} -}] - PROGRAMS_NO_INST=ct + PROGRAMS{noinst}=ct ENDIF SOURCE[asn1]=asn1.c driver.c @@ -65,14 +65,14 @@ IF[{- !$disabled{"fuzz-afl"} || !$disabled{"fuzz-libfuzzer"} -}] ENDIF IF[{- !$disabled{tests} -}] - PROGRAMS_NO_INST=asn1-test asn1parse-test bignum-test bndiv-test client-test conf-test crl-test server-test x509-test + PROGRAMS{noinst}=asn1-test asn1parse-test bignum-test bndiv-test client-test conf-test crl-test server-test x509-test IF[{- !$disabled{"cms"} -}] - PROGRAMS_NO_INST=cms-test + PROGRAMS{noinst}=cms-test ENDIF IF[{- !$disabled{"ct"} -}] - PROGRAMS_NO_INST=ct-test + PROGRAMS{noinst}=ct-test ENDIF SOURCE[asn1-test]=asn1.c test-corpus.c diff --git a/test/build.info b/test/build.info index 2e17a5fb8c..a7d31d45da 100644 --- a/test/build.info +++ b/test/build.info @@ -9,7 +9,7 @@ SUBDIRS=ossl_shim "" -} IF[{- !$disabled{tests} -}] - LIBS_NO_INST=libtestutil.a + LIBS{noinst}=libtestutil.a SOURCE[libtestutil.a]=testutil/basic_output.c testutil/output_helpers.c \ testutil/driver.c testutil/tests.c testutil/cb.c testutil/stanza.c \ testutil/format_output.c testutil/tap_bio.c \ @@ -24,7 +24,7 @@ IF[{- !$disabled{tests} -}] INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=main ENDRAW[descrip.mms] - PROGRAMS_NO_INST=\ + PROGRAMS{noinst}=\ versions \ aborttest test_test \ sanitytest rsa_complex exdatatest bntest \ @@ -379,27 +379,27 @@ INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=main DEPEND[servername_test]=../libcrypto ../libssl libtestutil.a IF[{- !$disabled{cms} -}] - PROGRAMS_NO_INST=cmsapitest + PROGRAMS{noinst}=cmsapitest SOURCE[cmsapitest]=cmsapitest.c INCLUDE[cmsapitest]=../include DEPEND[cmsapitest]=../libcrypto libtestutil.a ENDIF IF[{- !$disabled{psk} -}] - PROGRAMS_NO_INST=dtls_mtu_test + PROGRAMS{noinst}=dtls_mtu_test SOURCE[dtls_mtu_test]=dtls_mtu_test.c ssltestlib.c INCLUDE[dtls_mtu_test]=.. ../include DEPEND[dtls_mtu_test]=../libcrypto ../libssl libtestutil.a ENDIF IF[{- !$disabled{shared} -}] - PROGRAMS_NO_INST=shlibloadtest + PROGRAMS{noinst}=shlibloadtest SOURCE[shlibloadtest]=shlibloadtest.c INCLUDE[shlibloadtest]=../include ../crypto/include ENDIF IF[{- $disabled{shared} -}] - PROGRAMS_NO_INST=cipher_overhead_test + PROGRAMS{noinst}=cipher_overhead_test SOURCE[cipher_overhead_test]=cipher_overhead_test.c INCLUDE[cipher_overhead_test]=.. ../include DEPEND[cipher_overhead_test]=../libcrypto ../libssl libtestutil.a @@ -442,26 +442,26 @@ INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=main # programs are forcibly linked with the static libraries, where all symbols # are always available. IF[1] - PROGRAMS_NO_INST=asn1_internal_test modes_internal_test x509_internal_test \ + PROGRAMS{noinst}=asn1_internal_test modes_internal_test x509_internal_test \ tls13encryptiontest wpackettest ctype_internal_test \ rdrand_sanitytest IF[{- !$disabled{poly1305} -}] - PROGRAMS_NO_INST=poly1305_internal_test + PROGRAMS{noinst}=poly1305_internal_test ENDIF IF[{- !$disabled{chacha} -}] - PROGRAMS_NO_INST=chacha_internal_test + PROGRAMS{noinst}=chacha_internal_test ENDIF IF[{- !$disabled{siphash} -}] - PROGRAMS_NO_INST=siphash_internal_test + PROGRAMS{noinst}=siphash_internal_test ENDIF IF[{- !$disabled{sm2} -}] - PROGRAMS_NO_INST=sm2_internal_test + PROGRAMS{noinst}=sm2_internal_test ENDIF IF[{- !$disabled{sm4} -}] - PROGRAMS_NO_INST=sm4_internal_test + PROGRAMS{noinst}=sm4_internal_test ENDIF IF[{- !$disabled{ec} -}] - PROGRAMS_NO_INST=curve448_internal_test + PROGRAMS{noinst}=curve448_internal_test ENDIF SOURCE[poly1305_internal_test]=poly1305_internal_test.c @@ -518,14 +518,14 @@ INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=main ENDIF IF[{- !$disabled{mdc2} -}] - PROGRAMS_NO_INST=mdc2_internal_test + PROGRAMS{noinst}=mdc2_internal_test ENDIF SOURCE[mdc2_internal_test]=mdc2_internal_test.c INCLUDE[mdc2_internal_test]=.. ../include DEPEND[mdc2_internal_test]=../libcrypto libtestutil.a - PROGRAMS_NO_INST=asn1_time_test + PROGRAMS{noinst}=asn1_time_test SOURCE[asn1_time_test]=asn1_time_test.c INCLUDE[asn1_time_test]=../include DEPEND[asn1_time_test]=../libcrypto libtestutil.a @@ -534,7 +534,7 @@ INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=main # redefines some internal libssl symbols. This doesn't work in a non-shared # build IF[{- !$disabled{shared} -}] - PROGRAMS_NO_INST=tls13secretstest + PROGRAMS{noinst}=tls13secretstest SOURCE[tls13secretstest]=tls13secretstest.c SOURCE[tls13secretstest]= ../ssl/tls13_enc.c ../ssl/packet.c INCLUDE[tls13secretstest]=.. ../include @@ -578,7 +578,7 @@ ENDIF next if grep { lc("$name.h") =~ m/$_/i } @nogo_headers_re; $OUT .= <<"_____"; - PROGRAMS_NO_INST=buildtest_$name + PROGRAMS{noinst}=buildtest_$name GENERATE[buildtest_$name.c]=generate_buildtest.pl $name SOURCE[buildtest_$name]=buildtest_$name.c INCLUDE[buildtest_$name]=../include diff --git a/test/ossl_shim/build.info b/test/ossl_shim/build.info index 12250600b9..d1dd208408 100644 --- a/test/ossl_shim/build.info +++ b/test/ossl_shim/build.info @@ -1,5 +1,5 @@ IF[{- defined $target{CXX} && !$disabled{"external-tests"} -}] - PROGRAMS_NO_INST=ossl_shim + PROGRAMS{noinst}=ossl_shim SOURCE[ossl_shim]=ossl_shim.cc async_bio.cc packeted_bio.cc test_config.cc INCLUDE[ossl_shim]=. include ../../include DEPEND[ossl_shim]=../../libssl ../../libcrypto diff --git a/util/build.info b/util/build.info index 609be51660..65e17a9b87 100644 --- a/util/build.info +++ b/util/build.info @@ -1,8 +1,8 @@ IF[{- $target{build_scheme}->[1] eq "VMS" -}] - SCRIPTS_NO_INST=local_shlib.com unlocal_shlib.com + SCRIPTS{noinst}=local_shlib.com unlocal_shlib.com SOURCE[local_shlib.com]=local_shlib.com.in SOURCE[unlocal_shlib.com]=unlocal_shlib.com.in ELSIF[{- $target{build_scheme}->[1] eq "unix" -}] - SCRIPTS_NO_INST=shlib_wrap.sh + SCRIPTS{noinst}=shlib_wrap.sh SOURCE[shlib_wrap.sh]=shlib_wrap.sh.in ENDIF -- 2.25.1