Don't assume cflags is non-nil

Fixes Homebrew/homebrew#29284.
This commit is contained in:
Jack Nagel 2014-05-15 13:45:50 -05:00
parent ee92173d57
commit 4df83192fe
7 changed files with 7 additions and 7 deletions

View file

@ -73,7 +73,7 @@ class Fftw < Formula
}
TEST_SCRIPT
system ENV.cc, '-o', 'fftw', 'fftw.c', '-lfftw3', *ENV.cflags.split
system ENV.cc, '-o', 'fftw', 'fftw.c', '-lfftw3', *ENV.cflags.to_s.split
system './fftw'
end
end

View file

@ -114,7 +114,7 @@ class Glib < Formula
}
EOS
flags = ["-I#{include}/glib-2.0", "-I#{lib}/glib-2.0/include", "-lglib-2.0"]
system ENV.cc, "-o", "test", "test.c", *(flags + ENV.cflags.split)
system ENV.cc, "-o", "test", "test.c", *(flags + ENV.cflags.to_s.split)
system "./test"
end
end

View file

@ -25,7 +25,7 @@ class Hidapi < Formula
}
EOS
flags = `pkg-config --cflags --libs hidapi`.split + ENV.cflags.split
flags = `pkg-config --cflags --libs hidapi`.split + ENV.cflags.to_s.split
system ENV.cc, "-o", "test", "test.c", *flags
system './test'
end

View file

@ -30,7 +30,7 @@ class Libcapn < Formula
return 0;
}
TEST_SCRIPT
flags = `#{HOMEBREW_PREFIX}/bin/pkg-config --cflags --libs libcapn`.split + ENV.cflags.split
flags = `#{HOMEBREW_PREFIX}/bin/pkg-config --cflags --libs libcapn`.split + ENV.cflags.to_s.split
system ENV.cc, "-o", "test_install", "test_install.c", *flags
system "./test_install"
end

View file

@ -74,7 +74,7 @@ class Libffi < Formula
TEST_SCRIPT
flags = ["-L#{lib}", "-lffi", "-I#{lib}/libffi-#{version}/include"]
system ENV.cc, "-o", "closure", "closure.c", *(flags + ENV.cflags.split)
system ENV.cc, "-o", "closure", "closure.c", *(flags + ENV.cflags.to_s.split)
system "./closure"
end
end

View file

@ -33,7 +33,7 @@ class Liboil < Formula
return 0;
}
EOS
flags = `#{HOMEBREW_PREFIX}/bin/pkg-config --cflags --libs liboil-0.3`.split + ENV.cflags.split
flags = `#{HOMEBREW_PREFIX}/bin/pkg-config --cflags --libs liboil-0.3`.split + ENV.cflags.to_s.split
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end

View file

@ -51,7 +51,7 @@ class Sqlite < Formula
"-dynamiclib",
"extension-functions.c",
"-o", "libsqlitefunctions.dylib",
*ENV.cflags.split
*ENV.cflags.to_s.split
lib.install "libsqlitefunctions.dylib"
end
doc.install resource('docs') if build.with? "docs"