[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Tue Jun 14 20:11:58 UTC 2016


The branch master has been updated
       via  b867c7077a0ebf2ca17f9d020c112f790074571b (commit)
       via  932eaf0085eca0e7e9135da80376fb73d9af2d18 (commit)
       via  7cae38642e116b0a769fb3c31448be29469dc1da (commit)
       via  27ffb86c209c456c40ec82b80ebb922b5f377992 (commit)
       via  4f858293a9b5a5db8c8af0725b6402d21626040b (commit)
      from  7c46746bf2958fd2eccc59ecb48039e4e20ce38a (commit)


- Log -----------------------------------------------------------------
commit b867c7077a0ebf2ca17f9d020c112f790074571b
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Jun 14 22:03:08 2016 +0200

    VMS: use BLDDIR rather than BUILDDIR in descrip.mms.tmpl
    
    Just like in the other build file templates
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit 932eaf0085eca0e7e9135da80376fb73d9af2d18
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Jun 14 21:39:13 2016 +0200

    Add a developer target 'build_generated' to rebuild mandatory headers
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit 7cae38642e116b0a769fb3c31448be29469dc1da
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Jun 13 22:02:11 2016 +0200

    Build file templates: make sure to depend on generated header files
    
    As well as properly generating those that are made from .in files.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit 27ffb86c209c456c40ec82b80ebb922b5f377992
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Jun 13 22:01:08 2016 +0200

    Move the Configure generated header files to the top build.info
    
    This turns these headers into build file generated ones.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit 4f858293a9b5a5db8c8af0725b6402d21626040b
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Jun 13 21:57:51 2016 +0200

    Configure: Make it possible to generate mandatory header files
    
    'DEPEND[]=file.h' becomes a special way to say that 'file.h' must be
    generated before anything else is built.  It's likely that a number
    of source files depend on these header files, this provides a simple
    way to make sure they are always generated even it the dependency data
    hasn't been added to the build file yet.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 Configurations/common.tmpl           |  3 +++
 Configurations/descrip.mms.tmpl      | 40 +++++++++++++++++++++++++++---------
 Configurations/unix-Makefile.tmpl    | 34 +++++++++++++++++++++++-------
 Configurations/windows-makefile.tmpl | 34 +++++++++++++++++++++++-------
 Configure                            | 27 +++++-------------------
 build.info                           | 12 +++++++++++
 6 files changed, 104 insertions(+), 46 deletions(-)

diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl
index 48b3d18..9d7fbf2 100644
--- a/Configurations/common.tmpl
+++ b/Configurations/common.tmpl
@@ -213,6 +213,9 @@
      }
  }
 
+ # Build mandatory generated headers
+ foreach (@{$unified_info{depends}->{""}}) { dogenerate($_); }
+
  # Build all known libraries, engines, programs and scripts.
  # Everything else will be handled as a consequence.
  foreach (@{$unified_info{libraries}}) { dolib($_);    }
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl
index 3314a17..201bef6 100644
--- a/Configurations/descrip.mms.tmpl
+++ b/Configurations/descrip.mms.tmpl
@@ -80,7 +80,7 @@ PLATFORM={- $config{target} -}
 OPTIONS={- $config{options} -}
 CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
 SRCDIR={- $config{sourcedir} -}
-BUILDDIR={- $config{builddir} -}
+BLDDIR={- $config{builddir} -}
 
 # Allow both V and VERBOSE to indicate verbosity.  This only applies
 # to testing.
@@ -113,6 +113,8 @@ DEPS={- our @deps = map { (my $x = $_) =~ s|\.o$|\$(DEP_EXT)|; $x; }
                     keys %{$unified_info{sources}};
         join(", ", map { "-\n\t".$_ } @deps); -}
 {- output_on() if $disabled{makedepend}; "" -}
+GENERATED_MANDATORY={- join(",", @{$unified_info{depends}->{""}} ) -}
+
 {- output_off() if $disabled{apps}; "" -}
 BIN_SCRIPTS=[.tools]c_rehash.pl
 MISC_SCRIPTS=[.apps]CA.pl, [.apps]tsget.pl
@@ -221,20 +223,22 @@ NODEBUG=@
 
 # The main targets ###################################################
 
-all : configdata.pm, -
+all : build_generated, -
       build_libs_nodep, build_engines_nodep, build_apps_nodep, -
       depend
 
-build_libs : configdata.pm, build_libs_nodep, depend
+build_libs : build_generated, build_libs_nodep, depend
 build_libs_nodep : $(LIBS)
-build_engines : configdata.pm, build_engines_nodep, depend
+build_engines : build_generated, build_engines_nodep, depend
 build_engines_nodep : $(ENGINES)
-build_apps : configdata.pm, build_apps_nodep, depend
+build_apps : build_generated, build_apps_nodep, depend
 build_apps_nodep : $(PROGRAMS), $(SCRIPTS)
-build_tests : configdata.pm, build_tests_nodep, depend
+build_tests : build_generated, build_tests_nodep, depend
 build_tests_nodep : $(TESTPROGS)
 
-test tests : configdata.pm, -
+build_generated : $(GENERATED_MANDATORY)
+
+test tests : build_generated, -
              build_apps_nodep, build_engines_nodep, build_tests_nodep, -
              depend
         @ ! {- output_off() if $disabled{tests}; "" -}
@@ -292,6 +296,7 @@ install : install_sw install_docs
 uninstall : uninstall_docs uninstall_sw
 
 clean : libclean
+        - DELETE {- join(",", map { "$_;*" } @{$unified_info{depends}->{""}} ) -}
         - DELETE []OSSL$LIB*.EXE;*,OSSL$LIB*.MAP;*,OSSL$LIB*.OPT;*
         - DELETE [.engines...]LIB*.EXE;*,LIB*.MAP;*,LIB*.OPT;*
         - DELETE [.apps]*.EXE;*,*.MAP;*,*.OPT;*
@@ -301,6 +306,10 @@ clean : libclean
         - DELETE [.test]*.LOG;*
         - DELETE []*.MAP;*
 
+distclean : clean
+        - DELETE configdata.pm;*
+        - DELETE descrip.mms;*
+
 depend : descrip.mms
 descrip.mms : FORCE
 	@ ! {- output_off() if $disabled{makedepend}; "" -}
@@ -464,10 +473,21 @@ configdata.pm : {- join(" ", sourcefile("Configurations", "descrip.mms.tmpl"), s
       my $deps = join(", -\n\t\t", @{$args{generator_deps}}, @{$args{deps}});
 
       if ($args{src} !~ /\.[sS]$/) {
-          return <<"EOF";
+          if ($args{generator}->[0] =~ m|^.*\.in$|) {
+	      my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
+                                                   "util", "dofile.pl")),
+                                   rel2abs($config{builddir}));
+              return <<"EOF";
+$args{src} : $args{generator}->[0] $deps
+	\$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile \\
+	    "-o$target{build_file}" $generator > \$@
+EOF
+	  } else {
+              return <<"EOF";
 $args{src} : $args{generator}->[0] $deps
 	\$(PERL)$generator_incs $generator > \$@
 EOF
+	  }
       } else {
           die "No method to generate assembler source present.\n";
       }
@@ -571,7 +591,7 @@ $shlib.EXE : $lib.OLB $deps $ordinalsfile
         IF "$mkdef_key" .EQS. "ssl" .OR. "$mkdef_key" .EQS. "crypto" THEN -
            \$(PERL) $mkdef_pl "$mkdef_key" "VMS" > $shlib.SYMVEC-tmp
         IF "$mkdef_key" .EQS. "ssl" .OR. "$mkdef_key" .EQS. "crypto" THEN -
-           \$(PERL) $translatesyms_pl \$(BUILDDIR)CXX\$DEMANGLER_DB. < $shlib.SYMVEC-tmp > $shlib.SYMVEC
+           \$(PERL) $translatesyms_pl \$(BLDDIR)CXX\$DEMANGLER_DB. < $shlib.SYMVEC-tmp > $shlib.SYMVEC
         OPEN/WRITE/SHARE=READ OPT_FILE $shlib.OPT
         WRITE OPT_FILE "IDENTIFICATION=""V$config{version}"""
         IF "$mkdef_key" .NES. "ssl" .AND. "$mkdef_key" .NES. "crypto" THEN -
@@ -679,7 +699,7 @@ EOF
                            rel2abs($config{builddir}));
       return <<"EOF";
 $script : $sources
-        \$(PERL) "-I\$(BUILDDIR)" "-Mconfigdata" $dofile -
+        \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
 	    "-o$target{build_file}" $sources > $script
         SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
         PURGE $script
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index c595fd8..04964dc 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -84,6 +84,7 @@ DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
                   grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
                   keys %{$unified_info{sources}}); -}
 {- output_on() if $disabled{makedepend}; "" -}
+GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
 GENERATED={- join(" ",
                   ( map { (my $x = $_) =~ s|\.S$|\.s|; $x }
                     grep { defined $unified_info{generate}->{$_} }
@@ -209,20 +210,24 @@ PROCESSOR= {- $config{processor} -}
 
 # The main targets ###################################################
 
-all: configdata.pm build_libs_nodep build_engines_nodep build_apps_nodep \
+all: build_generated \
+     build_libs_nodep build_engines_nodep build_apps_nodep \
      depend link-utils
 
-build_libs: configdata.pm build_libs_nodep depend
+build_libs: build_generated build_libs_nodep depend
 build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
-build_engines: configdata.pm build_engines_nodep depend
+build_engines: build_generated build_engines_nodep depend
 build_engines_nodep: $(ENGINES)
-build_apps: configdata.pm build_apps_nodep depend
+build_apps: build_generated build_apps_nodep depend
 build_apps_nodep: $(PROGRAMS) $(SCRIPTS)
-build_tests: configdata.pm build_tests_nodep depend
+build_tests: build_generated build_tests_nodep depend
 build_tests_nodep: $(TESTPROGS)
 
+build_generated: $(GENERATED_MANDATORY)
+
 test: tests
-tests: build_tests_nodep build_apps_nodep build_engines_nodep \
+tests: build_generated \
+       build_tests_nodep build_apps_nodep build_engines_nodep \
        depend link-utils
 	@ : {- output_off() if $disabled{tests}; "" -}
 	( cd test; \
@@ -267,6 +272,10 @@ clean: libclean
 	-rm -f `find . -type l -a \! -path "./.git/*"`
 	rm -f $(TARFILE)
 
+distclean: clean
+	rm -f configdata.pm
+	rm -f Makefile
+
 # This exists solely for those who still type 'make depend'
 #
 # We check if any depfile is newer than Makefile and decide to
@@ -829,10 +838,21 @@ configdata.pm: $(SRCDIR)/Configurations/unix-Makefile.tmpl $(SRCDIR)/Configurati
       my $deps = join(" ", @{$args{generator_deps}}, @{$args{deps}});
 
       if ($args{src} !~ /\.[sS]$/) {
-          return <<"EOF";
+          if ($args{generator}->[0] =~ m|^.*\.in$|) {
+              my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
+                                                   "util", "dofile.pl")),
+                                   rel2abs($config{builddir}));
+              return <<"EOF";
+$args{src}: $args{generator}->[0] $deps
+	\$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
+	    "-o$target{build_file}" $generator > \$@
+EOF
+	  } else {
+              return <<"EOF";
 $args{src}: $args{generator}->[0] $deps
 	\$(PERL)$generator_incs $generator > \$@
 EOF
+	  }
       } else {
           if ($args{generator}->[0] =~ /\.pl$/) {
               $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator;
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl
index 081e20b..0a06b11 100644
--- a/Configurations/windows-makefile.tmpl
+++ b/Configurations/windows-makefile.tmpl
@@ -77,6 +77,7 @@ DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
                   grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
                   keys %{$unified_info{sources}}); -}
 {- output_on() if $disabled{makedepend}; "" -}
+GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
 GENERATED={- join(" ",
                   ( map { (my $x = $_) =~ s|\.[sS]$|\.asm|; $x }
                     grep { defined $unified_info{generate}->{$_} }
@@ -144,19 +145,23 @@ PROCESSOR= {- $config{processor} -}
 
 # The main targets ###################################################
 
-all: configdata.pm build_libs_nodep build_engines_nodep build_apps_nodep depend
+all: build_generated \
+     build_libs_nodep build_engines_nodep build_apps_nodep depend
 
-build_libs: configdata.pm build_libs_nodep depend
+build_libs: build_generated build_libs_nodep depend
 build_libs_nodep: $(LIBS)
-build_engines: configdata.pm build_engines_nodep depend
+build_engines: build_generated build_engines_nodep depend
 build_engines_nodep: $(ENGINES)
-build_apps: configdata.pm build_apps_nodep depend
+build_apps: build_generated build_apps_nodep depend
 build_apps_nodep: $(PROGRAMS) $(SCRIPTS)
-build_tests: configdata.pm build_tests_nodep depend
+build_tests: build_generated build_tests_nodep depend
 build_tests_nodep: $(TESTPROGS)
 
+build_generated: $(GENERATED_MANDATORY)
+
 test: tests
-tests: build_tests_nodep build_apps_nodep build_engines_nodep depend
+tests: build_generated \
+       build_tests_nodep build_apps_nodep build_engines_nodep depend
 	@rem {- output_off() if $disabled{tests}; "" -}
 	set SRCTOP=$(SRCDIR)
 	set BLDTOP=$(BLDDIR)
@@ -196,6 +201,10 @@ clean: libclean
 	-del /Q /S /F apps\*.manifest
 	-del /Q /S /F test\*.manifest
 
+distclean: clean
+	-del /Q /F configdata.pm
+	-del /Q /F makefile
+
 depend:
 
 # Install helper targets #############################################
@@ -301,10 +310,21 @@ configdata.pm: "{- $config{build_file_template} -}" "$(SRCDIR)\Configure"
           '"'.join('" "', @{$args{generator_deps}}, @{$args{deps}}).'"' : '';
 
       if ($target !~ /\.asm$/) {
-          return <<"EOF";
+          if ($args{generator}->[0] =~ m|^.*\.in$|) {
+              my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
+                                                   "util", "dofile.pl")),
+                                   rel2abs($config{builddir}));
+              return <<"EOF";
+$target: "$args{generator}->[0]" $deps
+	"\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
+	    "-o$target{build_file}" $generator > \$@
+EOF
+	  } else {
+              return <<"EOF";
 $target: "$args{generator}->[0]" $deps
 	"\$(PERL)"$generator_incs $generator > \$@
 EOF
+	  }
       } else {
           if ($args{generator}->[0] =~ /\.pl$/) {
               $generator = '"$(PERL)"'.$generator_incs.' '.$generator;
diff --git a/Configure b/Configure
index 7bbb5b7..70350f4 100755
--- a/Configure
+++ b/Configure
@@ -463,17 +463,6 @@ while ((my $first, my $second) = (shift @list, shift @list)) {
 # To remove something from %disabled, use "enable-foo".
 # For symmetry, "disable-foo" is a synonym for "no-foo".
 
-my @generated_headers = (
-    "include/openssl/opensslconf.h",
-    "crypto/include/internal/bn_conf.h",
-    "crypto/include/internal/dso_conf.h"
-    );
-
-my @generated_by_make_headers = (
-    "crypto/buildinf.h"
-    );
-
-
 my $no_sse2=0;
 
 &usage if ($#ARGV < 0);
@@ -1465,7 +1454,7 @@ if ($builder eq "unified") {
             qr/^\s*INCLUDE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
             => sub { push @{$includes{$1}}, tokenize($2)
                          if !@skip || $skip[$#skip] > 0 },
-            qr/^\s*DEPEND\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
+            qr/^\s*DEPEND\[((?:\\.|[^\\\]])*)\]\s*=\s*(.*)\s*$/
             => sub { push @{$depends{$1}}, tokenize($2)
                          if !@skip || $skip[$#skip] > 0 },
             qr/^\s*GENERATE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
@@ -1689,11 +1678,11 @@ EOF
 
         foreach (keys %depends) {
             my $dest = $_;
-            my $ddest = cleanfile($sourced, $_, $blddir);
+            my $ddest = $dest eq "" ? "" : cleanfile($sourced, $_, $blddir);
 
             # If the destination doesn't exist in source, it can only be
             # a generated file in the build tree.
-            if (! -f $ddest) {
+            if ($ddest ne "" && ! -f $ddest) {
                 $ddest = cleanfile($buildd, $_, $blddir);
                 if ($unified_info{rename}->{$ddest}) {
                     $ddest = $unified_info{rename}->{$ddest};
@@ -1710,7 +1699,7 @@ EOF
                 if (! -f $d
                     || (grep { $d eq $_ }
                         map { cleanfile($srcdir, $_, $blddir) }
-                        (@generated_headers, @generated_by_make_headers))) {
+                        grep { /\.h$/ } keys %{$unified_info{generate}})) {
                     $d = cleanfile($buildd, $_, $blddir);
                 }
                 # Take note if the file to depend on is being renamed
@@ -1720,7 +1709,7 @@ EOF
                 $unified_info{depends}->{$ddest}->{$d} = 1;
                 # If we depend on a header file or a perl module, let's make
                 # sure it can get included
-                if ($d =~ /\.(h|pm)$/) {
+                if ($dest ne "" && $d =~ /\.(h|pm)$/) {
                     my $i = dirname($d);
                     push @{$unified_info{includes}->{$ddest}}, $i
                         unless grep { $_ eq $i } @{$unified_info{includes}->{$ddest}};
@@ -1936,12 +1925,6 @@ print "THIRTY_TWO_BIT mode\n" if $config{b32};
 print "BN_LLONG mode\n" if $config{bn_ll};
 print "RC4 uses $config{rc4_int}\n" if $config{rc4_int} ne $def_int;
 
-for (@generated_headers) {
-    mkpath(catdir($blddir, dirname($_)));
-    run_dofile(catfile($blddir, $_),
-               catfile($srcdir, $_.".in"));
-}
-
 my %builders = (
     unified => sub {
         run_dofile(catfile($blddir, $target{build_file}),
diff --git a/build.info b/build.info
index 6bc70c6..6f057cd 100644
--- a/build.info
+++ b/build.info
@@ -6,6 +6,18 @@ INCLUDE[libcrypto]="{- rel2abs(catdir($builddir,"include")) -}" . crypto/include
 INCLUDE[libssl]="{- rel2abs(catdir($builddir,"include")) -}" . include
 DEPEND[libssl]=libcrypto
 
+# Empty DEPEND "indices" means the dependencies are expected to be built
+# unconditionally before anything else.
+DEPEND[]=include/openssl/opensslconf.h crypto/include/internal/bn_conf.h \
+         crypto/include/internal/dso_conf.h
+DEPEND[include/openssl/opensslconf.h]=configdata.pm
+GENERATE[include/openssl/opensslconf.h]=include/openssl/opensslconf.h.in
+DEPEND[crypto/include/internal/bn_conf.h]=configdata.pm
+GENERATE[crypto/include/internal/bn_conf.h]=crypto/include/internal/bn_conf.h.in
+DEPEND[crypto/include/internal/dso_conf.h]=configdata.pm
+GENERATE[crypto/include/internal/dso_conf.h]=crypto/include/internal/dso_conf.h.in
+
+
 IF[{- $config{target} =~ /^Cygwin/ -}]
  SHARED_NAME[libcrypto]=cygcrypto-{- $config{shlib_major}.".".$config{shlib_minor} -}
  SHARED_NAME[libssl]=cygssl-{- $config{shlib_major}.".".$config{shlib_minor} -}


More information about the openssl-commits mailing list