]> mj.ucw.cz Git - libucw.git/blobdiff - build/genconf
Patrik needs lib/binsearch.h in the library package.
[libucw.git] / build / genconf
index 29565a9c48a9d3bc2e34c442cbd3b8b9c457b690..ac9755f4aaa7b28b2495b82baf111cc3d06a30dc 100755 (executable)
@@ -20,8 +20,11 @@ while (<CF>) {
 }
 close CF;
 
 }
 close CF;
 
-my $opt_regex = join("|", keys %options);
-sub eval_expr { $_ = "@_"; s/\b($opt_regex)\b/ 1 /g if $opt_regex; s/\bCONFIG_\w+\b/ 0 /g; return eval $_; }
+sub eval_expr {
+       $_ = shift @_;
+       s/\b(CONFIG_\w+)\b/defined($options{$1}) ? 1 : 0/ge;
+       return eval $_;
+}
 
 open IN, $ARGV[0] or die "Unable to open $ARGV[0]";
 open OUT, ">$ARGV[1]" or die "Unable to create $ARGV[1]";
 
 open IN, $ARGV[0] or die "Unable to open $ARGV[0]";
 open OUT, ">$ARGV[1]" or die "Unable to create $ARGV[1]";