Make fuzzer and fuzz tester builds less magic
authorRichard Levitte <levitte@openssl.org>
Fri, 8 Jul 2016 16:13:17 +0000 (18:13 +0200)
committerRichard Levitte <levitte@openssl.org>
Sat, 16 Jul 2016 17:37:50 +0000 (19:37 +0200)
Instead of having fuzz/build.info.fuzz magically and conditionally
included along with the other build.info files, incorporate it in
fuzz/build.info and add the conditions there instead.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Configure
fuzz/build.info
fuzz/build.info.fuzz [deleted file]

index f43b5bfa36d25513eb39298939e33c33f282730f..bd49a895bd12cb4802e642d15b70de51b80923fe 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1336,9 +1336,6 @@ if ($builder eq "unified") {
     }
 
     my @build_infos = ( [ ".", "build.info" ] );
-    push @build_infos, [ "fuzz", "build.info.fuzz" ]
-        unless $disabled{"fuzz-afl"} && $disabled{"fuzz-libfuzzer"};
-
     foreach (@{$config{dirs}}) {
         push @build_infos, [ $_, "build.info" ]
             if (-f catfile($srcdir, $_, "build.info"));
index 82569a2910b4859aa949b3e9ef8234a2b9d06f1e..a3d38499ffb6e4dc957aeee3a38936f9377c9ab6 100644 (file)
@@ -1,42 +1,97 @@
-{- use File::Spec::Functions qw/catdir rel2abs/; -}
-PROGRAMS=asn1-test asn1parse-test bignum-test bndiv-test cms-test conf-test crl-test ct-test server-test x509-test
+{- use File::Spec::Functions;
+   our $ex_inc = $withargs{fuzzer_include} &&
+       (file_name_is_absolute($withargs{fuzzer_include}) ?
+        $withargs{fuzzer_include} : catdir(updir(), $withargs{fuzzer_include}));
+   our $ex_lib = $withargs{fuzzer_lib} &&
+       (file_name_is_absolute($withargs{fuzzer_lib}) ?
+        $withargs{fuzzer_lib} : catfile(updir(), $withargs{fuzzer_lib}));
+   ""
+-}
 
-SOURCE[asn1-test]=asn1.c test-corpus.c
-INCLUDE[asn1-test]=../include
-DEPEND[asn1-test]=../libcrypto
+IF[{- !$disabled{"fuzz-afl"} || !$disabled{"fuzz-libfuzzer"} -}]
+  PROGRAMS=asn1 asn1parse bignum bndiv cms conf crl ct server x509
 
-SOURCE[asn1parse-test]=asn1parse.c test-corpus.c
-INCLUDE[asn1parse-test]=../include
-DEPEND[asn1parse-test]=../libcrypto
+  SOURCE[asn1]=asn1.c driver.c
+  INCLUDE[asn1]=../include {- $ex_inc -}
+  DEPEND[asn1]=../libcrypto {- $ex_lib -}
 
-SOURCE[bignum-test]=bignum.c test-corpus.c
-INCLUDE[bignum-test]=../include
-DEPEND[bignum-test]=../libcrypto
+  SOURCE[asn1parse]=asn1parse.c driver.c
+  INCLUDE[asn1parse]=../include {- $ex_inc -}
+  DEPEND[asn1parse]=../libcrypto {- $ex_lib -}
 
-SOURCE[bndiv-test]=bndiv.c test-corpus.c
-INCLUDE[bndiv-test]=../include
-DEPEND[bndiv-test]=../libcrypto
+  SOURCE[bignum]=bignum.c driver.c
+  INCLUDE[bignum]=../include {- $ex_inc -}
+  DEPEND[bignum]=../libcrypto {- $ex_lib -}
 
-SOURCE[cms-test]=cms.c test-corpus.c
-INCLUDE[cms-test]=../include
-DEPEND[cms-test]=../libcrypto
+  SOURCE[bndiv]=bndiv.c driver.c
+  INCLUDE[bndiv]=../include {- $ex_inc -}
+  DEPEND[bndiv]=../libcrypto {- $ex_lib -}
 
-SOURCE[conf-test]=conf.c test-corpus.c
-INCLUDE[conf-test]=../include
-DEPEND[conf-test]=../libcrypto
+  SOURCE[cms]=cms.c driver.c
+  INCLUDE[cms]=../include {- $ex_inc -}
+  DEPEND[cms]=../libcrypto {- $ex_lib -}
 
-SOURCE[crl-test]=crl.c test-corpus.c
-INCLUDE[crl-test]=../include
-DEPEND[crl-test]=../libcrypto
+  SOURCE[conf]=conf.c driver.c
+  INCLUDE[conf]=../include {- $ex_inc -}
+  DEPEND[conf]=../libcrypto {- $ex_lib -}
 
-SOURCE[ct-test]=ct.c test-corpus.c
-INCLUDE[ct-test]=../include
-DEPEND[ct-test]=../libcrypto
+  SOURCE[crl]=crl.c driver.c
+  INCLUDE[crl]=../include {- $ex_inc -}
+  DEPEND[crl]=../libcrypto {- $ex_lib -}
 
-SOURCE[server-test]=server.c test-corpus.c
-INCLUDE[server-test]=../include
-DEPEND[server-test]=../libcrypto ../libssl
+  SOURCE[ct]=ct.c driver.c
+  INCLUDE[ct]=../include {- $ex_inc -}
+  DEPEND[ct]=../libcrypto {- $ex_lib -}
 
-SOURCE[x509-test]=x509.c test-corpus.c
-INCLUDE[x509-test]=../include
-DEPEND[x509-test]=../libcrypto
+  SOURCE[server]=server.c driver.c
+  INCLUDE[server]=../include {- $ex_inc -}
+  DEPEND[server]=../libcrypto ../libssl {- $ex_lib -}
+
+  SOURCE[x509]=x509.c driver.c
+  INCLUDE[x509]=../include {- $ex_inc -}
+  DEPEND[x509]=../libcrypto {- $ex_lib -}
+ENDIF
+
+IF[{- !$disabled{tests} -}]
+  PROGRAMS=asn1-test asn1parse-test bignum-test bndiv-test cms-test conf-test crl-test ct-test server-test x509-test
+
+  SOURCE[asn1-test]=asn1.c test-corpus.c
+  INCLUDE[asn1-test]=../include
+  DEPEND[asn1-test]=../libcrypto
+
+  SOURCE[asn1parse-test]=asn1parse.c test-corpus.c
+  INCLUDE[asn1parse-test]=../include
+  DEPEND[asn1parse-test]=../libcrypto
+
+  SOURCE[bignum-test]=bignum.c test-corpus.c
+  INCLUDE[bignum-test]=../include
+  DEPEND[bignum-test]=../libcrypto
+
+  SOURCE[bndiv-test]=bndiv.c test-corpus.c
+  INCLUDE[bndiv-test]=../include
+  DEPEND[bndiv-test]=../libcrypto
+
+  SOURCE[cms-test]=cms.c test-corpus.c
+  INCLUDE[cms-test]=../include
+  DEPEND[cms-test]=../libcrypto
+
+  SOURCE[conf-test]=conf.c test-corpus.c
+  INCLUDE[conf-test]=../include
+  DEPEND[conf-test]=../libcrypto
+
+  SOURCE[crl-test]=crl.c test-corpus.c
+  INCLUDE[crl-test]=../include
+  DEPEND[crl-test]=../libcrypto
+
+  SOURCE[ct-test]=ct.c test-corpus.c
+  INCLUDE[ct-test]=../include
+  DEPEND[ct-test]=../libcrypto
+
+  SOURCE[server-test]=server.c test-corpus.c
+  INCLUDE[server-test]=../include
+  DEPEND[server-test]=../libcrypto ../libssl
+
+  SOURCE[x509-test]=x509.c test-corpus.c
+  INCLUDE[x509-test]=../include
+  DEPEND[x509-test]=../libcrypto
+ENDIF
diff --git a/fuzz/build.info.fuzz b/fuzz/build.info.fuzz
deleted file mode 100644 (file)
index 44cac86..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-{- use File::Spec::Functions;
-   our $ex_inc = $withargs{fuzzer_include} &&
-       (file_name_is_absolute($withargs{fuzzer_include}) ?
-        $withargs{fuzzer_include} : catdir(updir(), $withargs{fuzzer_include}));
-   our $ex_lib = $withargs{fuzzer_lib} &&
-       (file_name_is_absolute($withargs{fuzzer_lib}) ?
-        $withargs{fuzzer_lib} : catfile(updir(), $withargs{fuzzer_lib}));
-   ""
--}
-
-PROGRAMS=asn1 asn1parse bignum bndiv cms conf crl ct server x509
-
-SOURCE[asn1]=asn1.c driver.c
-INCLUDE[asn1]=../include {- $ex_inc -}
-DEPEND[asn1]=../libcrypto {- $ex_lib -}
-
-SOURCE[asn1parse]=asn1parse.c driver.c
-INCLUDE[asn1parse]=../include {- $ex_inc -}
-DEPEND[asn1parse]=../libcrypto {- $ex_lib -}
-
-SOURCE[bignum]=bignum.c driver.c
-INCLUDE[bignum]=../include {- $ex_inc -}
-DEPEND[bignum]=../libcrypto {- $ex_lib -}
-
-SOURCE[bndiv]=bndiv.c driver.c
-INCLUDE[bndiv]=../include {- $ex_inc -}
-DEPEND[bndiv]=../libcrypto {- $ex_lib -}
-
-SOURCE[cms]=cms.c driver.c
-INCLUDE[cms]=../include {- $ex_inc -}
-DEPEND[cms]=../libcrypto {- $ex_lib -}
-
-SOURCE[conf]=conf.c driver.c
-INCLUDE[conf]=../include {- $ex_inc -}
-DEPEND[conf]=../libcrypto {- $ex_lib -}
-
-SOURCE[crl]=crl.c driver.c
-INCLUDE[crl]=../include {- $ex_inc -}
-DEPEND[crl]=../libcrypto {- $ex_lib -}
-
-SOURCE[ct]=ct.c driver.c
-INCLUDE[ct]=../include {- $ex_inc -}
-DEPEND[ct]=../libcrypto {- $ex_lib -}
-
-SOURCE[server]=server.c driver.c
-INCLUDE[server]=../include {- $ex_inc -}
-DEPEND[server]=../libcrypto ../libssl {- $ex_lib -}
-
-SOURCE[x509]=x509.c driver.c
-INCLUDE[x509]=../include {- $ex_inc -}
-DEPEND[x509]=../libcrypto {- $ex_lib -}