Use correct CFLAG definition for makefile.one builds.
authorBodo Möller <bodo@openssl.org>
Tue, 27 Jul 1999 09:10:36 +0000 (09:10 +0000)
committerBodo Möller <bodo@openssl.org>
Tue, 27 Jul 1999 09:10:36 +0000 (09:10 +0000)
CHANGES
Configure
crypto/.cvsignore
crypto/Makefile.ssl
crypto/cversion.c
util/mk1mf.pl

diff --git a/CHANGES b/CHANGES
index 7cda75c18bf6395837a2ba2ee51f0a7bb2979588..2e03173c5ba5c45c16851c39f5013e182faf4aa2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
   *) The -DPLATFORM="\"$(PLATFORM)\"" definition and the similar -DCFLAGS=...
      (both in crypto/Makefile.ssl for use by crypto/cversion.c) caused
      problems not only on Windows, but also on some Unix platforms.
   *) The -DPLATFORM="\"$(PLATFORM)\"" definition and the similar -DCFLAGS=...
      (both in crypto/Makefile.ssl for use by crypto/cversion.c) caused
      problems not only on Windows, but also on some Unix platforms.
-     To avoid problematic command lines, these definitions are now made
-     in auto-generated file crypto/buildinf.h, which also defines DATE
-     and thus replaces crypto/date.h.
+     To avoid problematic command lines, these definitions are now in an
+     auto-generated file, which also defines DATE and thus replaces
+     crypto/date.h.  Standard "make" builds use crypto/buildinf.h,
+     mk1mf.pl builds use crypto/mk1mfinf.h (created by mk1mf.pl).
      [Bodo Moeller]
 
   *) MIPS III/IV assembler module is reimplemented.
      [Bodo Moeller]
 
   *) MIPS III/IV assembler module is reimplemented.
index 80f0b7680a70d872d823f4e792cdde998008c3f3..fbac48e3997c5d370f07ca7b2543e616acd882fd 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -710,11 +710,13 @@ if($IsWindows) {
        printf OUT <<EOF;
 /* auto-generated by Configure for crypto/cversion.c */
 /* (Unix builds: auto-generated by crypto/Makefile.ssl) */
        printf OUT <<EOF;
 /* auto-generated by Configure for crypto/cversion.c */
 /* (Unix builds: auto-generated by crypto/Makefile.ssl) */
+/* mk1mf builds use mk1mfinf.h instead, so this file is probably never needed */
 #define CFLAGS "$cc $cflags"
 #define PLATFORM "$target"
 EOF
        printf OUT "#define DATE \"%s\"\n", scalar gmtime();
        close(OUT);
 #define CFLAGS "$cc $cflags"
 #define PLATFORM "$target"
 EOF
        printf OUT "#define DATE \"%s\"\n", scalar gmtime();
        close(OUT);
+
        system "perl crypto/objects/obj_dat.pl <crypto/objects/objects.h >crypto/objects/obj_dat.h";
 } else {
        (system "make -f Makefile.ssl PERL=\'$perl\' links") == 0 or exit $?;
        system "perl crypto/objects/obj_dat.pl <crypto/objects/objects.h >crypto/objects/obj_dat.h";
 } else {
        (system "make -f Makefile.ssl PERL=\'$perl\' links") == 0 or exit $?;
index 6b86a0a8dc492e7389596eb8ee91890fd018850d..b8d2cb1da2b6a746013a08d0cf129c7a44d5b529 100644 (file)
@@ -1,4 +1,5 @@
 lib
 buildinf.h
 lib
 buildinf.h
+mk1mfinf.h
 opensslconf.h
 Makefile.save
 opensslconf.h
 Makefile.save
index d5e48d5c419e6f3a8ae1493a05abcbcec38880fd..c27a69d5e1e47c05f969b77f03eea84efb6c87e7 100644 (file)
@@ -51,7 +51,7 @@ all: buildinf.h lib subdirs
 
 buildinf.h: ../Makefile.ssl
        ( echo "/* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
 
 buildinf.h: ../Makefile.ssl
        ( echo "/* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
-       echo "/* (Windows builds: auto-generated by Configure) */"; \
+       echo "/* (mk1mf builds use mk1mfinf.h instead) */"; \
        echo "#define CFLAGS \"$(CC) $(CFLAG)\""; \
        echo "#define PLATFORM \"$(PLATFORM)\""; \
        echo "#define DATE \"`date`\"" ) >buildinf.h
        echo "#define CFLAGS \"$(CC) $(CFLAG)\""; \
        echo "#define PLATFORM \"$(PLATFORM)\""; \
        echo "#define DATE \"`date`\"" ) >buildinf.h
@@ -129,7 +129,7 @@ depend:
        done;
 
 clean:
        done;
 
 clean:
-       rm -f buildinf.h *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+       rm -f buildinf.h mk1mfinf.h *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
        @for i in $(SDIRS) ;\
        do \
        (cd $$i; echo "making clean in crypto/$$i..."; \
        @for i in $(SDIRS) ;\
        do \
        (cd $$i; echo "making clean in crypto/$$i..."; \
index 72af476fbeee07f10398f170e9bb296256c11967..428def308136645b97550bd0593da281bf270080 100644 (file)
 #include <string.h>
 #include "cryptlib.h"
 #include <openssl/crypto.h>
 #include <string.h>
 #include "cryptlib.h"
 #include <openssl/crypto.h>
-#include "buildinf.h"
+
+#ifdef MK1MF_BUILD
+# include "mk1mfinf.h"
+#else
+# include "buildinf.h"
+#endif
 
 const char *SSLeay_version(int t)
        {
 
 const char *SSLeay_version(int t)
        {
index 90f2dfca06cf0d46eba67d82f48f75f6586b7d5e..4647fc7a035a1eaee7b2ce1b154f08294eeb71b9 100755 (executable)
@@ -401,6 +401,41 @@ vclean:
        \$(RM) \$(OUT_D)$o*.*
 
 EOF
        \$(RM) \$(OUT_D)$o*.*
 
 EOF
+    
+my $platform_cpp_symbol = "MK1MF_PLATFORM_$platform";
+$platform_cpp_symbol =~ s/-/_/;
+if (open(IN,"crypto/mk1mfinf.h"))
+       {
+       # Remove entry for this platform in existing file mk1mfinf.h.
+
+       my $old_mk1mfinf_h = "";
+       while (<IN>)
+               {
+               if (/^\#ifdef $platform_cpp_symbol$/)
+                       {
+                       while (<IN>) { last if (/^\#endif/); }
+                       }
+               else
+                       {
+                       $old_mk1mfinf_h .= $_;
+                       }
+               }
+
+       open(OUT,">crypto/mk1mfinf.h") || die "Can't open mk1mfinf.h";
+       print OUT $old_mk1mfinf_h;
+       }
+
+open (OUT,">>crypto/mk1mfinf.h") || die "Can't open mk1mfinf.h";
+printf OUT <<EOF;
+#ifdef $platform_cpp_symbol
+  /* auto-generated and updated by util/mk1mf.pl for crypto/cversion.c */
+  /* (used in place of crypto/buildinf.h by mk1mf builds) */
+  #define CFLAGS "$cc $cflags"
+  #define PLATFORM "$platform"
+EOF
+printf OUT "  #define DATE \"%s\"\n", scalar gmtime();
+printf OUT "#endif\n";
+close(OUT);
 
 #############################################
 # We parse in input file and 'store' info for later printing.
 
 #############################################
 # We parse in input file and 'store' info for later printing.
@@ -730,6 +765,7 @@ sub cc_compile_target
        local($target,$source,$ex_flags)=@_;
        local($ret);
        
        local($target,$source,$ex_flags)=@_;
        local($ret);
        
+       $ex_flags.=" -DMK1MF_BUILD -D$platform_cpp_symbol" if ($source =~ /cversion/);
        $target =~ s/\//$o/g if $o ne "/";
        $source =~ s/\//$o/g if $o ne "/";
        $ret ="$target: \$(SRC_D)$o$source\n\t";
        $target =~ s/\//$o/g if $o ne "/";
        $source =~ s/\//$o/g if $o ne "/";
        $ret ="$target: \$(SRC_D)$o$source\n\t";