X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fperl%2FUCW%2FConfigure%2FC.pm;h=84c20da00680e08c4eec9aa2f45674fba0a199eb;hb=b074a6e247a4723fbd84d72445949813c8b7420b;hp=5346fb1a3a5f4a46a8deb32192ccb82841faf546;hpb=404b915049ad455039f133bf9ad7cfd8708b1ebc;p=libucw.git diff --git a/ucw/perl/UCW/Configure/C.pm b/ucw/perl/UCW/Configure/C.pm index 5346fb1a..84c20da0 100644 --- a/ucw/perl/UCW/Configure/C.pm +++ b/ucw/perl/UCW/Configure/C.pm @@ -188,7 +188,7 @@ Set("CLANG" => "-std=gnu99 -fno-common"); # C optimizations Set("COPT" => '-O2'); if (Get("CPU_ARCH") ne "unknown" && Get("CPU_ARCH") ne "default") { - Append("COPT", '-march=$(CPU_ARCH)'); + Append("COPT", '-march=' . Get("CPU_ARCH")); } # C optimizations for highly exposed code @@ -269,9 +269,9 @@ if (IsSet("CONFIG_DARWIN")) { ### Compiling test programs ### -sub TestCompile($) { - my ($source) = @_; - my $dir = 'conftest'; +sub TestCompile($$) { + my ($testname, $source) = @_; + my $dir = "conftest-$testname"; `rm -rf $dir && mkdir $dir`; $? and Fail "Cannot initialize $dir"; open SRC, ">$dir/conftest.c"; @@ -287,6 +287,10 @@ sub TestCompile($) { ); `$cmd`; my $result = !$?; + + `rm -rf $dir` unless Get("KEEP_CONFTEST"); + + return $result; } ### Writing C headers with configuration ###