From 2e0fc875992dc0b4a0d1372871e27c9ffa31ec3e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bodo=20M=C3=B6ller?= Date: Tue, 27 Jul 1999 09:10:36 +0000 Subject: [PATCH] Use correct CFLAG definition for makefile.one builds. --- CHANGES | 7 ++++--- Configure | 2 ++ crypto/.cvsignore | 1 + crypto/Makefile.ssl | 4 ++-- crypto/cversion.c | 7 ++++++- util/mk1mf.pl | 36 ++++++++++++++++++++++++++++++++++++ 6 files changed, 51 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 7cda75c18b..2e03173c5b 100644 --- a/CHANGES +++ b/CHANGES @@ -30,9 +30,10 @@ *) 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. diff --git a/Configure b/Configure index 80f0b7680a..fbac48e399 100755 --- a/Configure +++ b/Configure @@ -710,11 +710,13 @@ if($IsWindows) { printf OUT <crypto/objects/obj_dat.h"; } else { (system "make -f Makefile.ssl PERL=\'$perl\' links") == 0 or exit $?; diff --git a/crypto/.cvsignore b/crypto/.cvsignore index 6b86a0a8dc..b8d2cb1da2 100644 --- a/crypto/.cvsignore +++ b/crypto/.cvsignore @@ -1,4 +1,5 @@ lib buildinf.h +mk1mfinf.h opensslconf.h Makefile.save diff --git a/crypto/Makefile.ssl b/crypto/Makefile.ssl index d5e48d5c41..c27a69d5e1 100644 --- a/crypto/Makefile.ssl +++ b/crypto/Makefile.ssl @@ -51,7 +51,7 @@ all: buildinf.h lib subdirs 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 @@ -129,7 +129,7 @@ depend: 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..."; \ diff --git a/crypto/cversion.c b/crypto/cversion.c index 72af476fbe..428def3081 100644 --- a/crypto/cversion.c +++ b/crypto/cversion.c @@ -60,7 +60,12 @@ #include #include "cryptlib.h" #include -#include "buildinf.h" + +#ifdef MK1MF_BUILD +# include "mk1mfinf.h" +#else +# include "buildinf.h" +#endif const char *SSLeay_version(int t) { diff --git a/util/mk1mf.pl b/util/mk1mf.pl index 90f2dfca06..4647fc7a03 100755 --- a/util/mk1mf.pl +++ b/util/mk1mf.pl @@ -401,6 +401,41 @@ vclean: \$(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 () + { + if (/^\#ifdef $platform_cpp_symbol$/) + { + while () { 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 <