Handle conjoined and disjoint versions of -D -U -I
diff --git a/klcc.in b/klcc.in
index 7a5262c..a49fb8b 100644
--- a/klcc.in
+++ b/klcc.in
@@ -109,9 +109,14 @@
} elsif ( $a =~ /^-Wl,(.*)$/ ) {
# -Wl used to pass options to the linker
push(@ldopt, split(/,/, $1));
- } elsif ( $a =~ /^-([fmwWQdODUI]|std=|ansi|pedantic)/ ) {
+ } elsif ( $a =~ /^-([fmwWQdO]|std=|ansi|pedantic)/ ) {
# Options to gcc
push(@ccopt, $a);
+ } elsif ( $a =~ /^-([DUI])(.*)$/ ) {
+ # Options to gcc, which can take either a conjoined argument
+ # (-DFOO) or a disjoint argument (-D FOO)
+ push(@ccopt, $a);
+ push(@ccopt, shift(@ARGV)) if ( $2 eq '' );
} elsif ( $a =~ /^-[gp]/ ) {
# Debugging options to gcc *and* ld
push(@ccopt, $a);