Skip to content

Commit 0547da0

Browse files
chenrui333daeho-ro
authored andcommitted
mcpp: add explicit --build flag for linux arm build
Signed-off-by: Rui Chen <[email protected]>
1 parent 721be3f commit 0547da0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Formula/m/mcpp.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,22 @@ def install
4141
# Fix compile with newer Clang
4242
ENV.append_to_cflags "-Wno-implicit-function-declaration" if DevelopmentTools.clang_build_version >= 1403
4343

44-
system "./configure", *std_configure_args,
45-
"--enable-mcpplib"
44+
# expand.c:713:21: error: assignment to 'char *' from
45+
# incompatible pointer type 'LOCATION *' {aka 'struct location *'}
46+
ENV.append_to_cflags "-Wno-error=incompatible-pointer-types"
47+
48+
args = []
49+
# Help old config scripts identify arm64 linux
50+
args << "--build=aarch64-unknown-linux-gnu" if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
51+
52+
system "./configure", "--enable-mcpplib", *args, *std_configure_args
4653
system "make", "install"
4754
end
4855

4956
test do
57+
# fix `warning: Unknown encoding: C.utf8`
58+
ENV["LC_ALL"] = "en_US.UTF-8"
59+
5060
(testpath/"test.c.in").write <<~C
5161
#define RET 5
5262
int main() { return RET; }

0 commit comments

Comments
 (0)