about summary refs log tree commit diff
path: root/buildtools
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-06-30 19:33:17 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-06-30 19:33:17 +0000
commit0b8a8c4f322306ac4146f398215b7bd2f6632e65 (patch)
tree4fe3bdc2af1eb047de2cf54ef6cb891474f806b1 /buildtools
parent096ed0ec22835021832055ffc3a364e4f7632a28 (diff)
downloadnetpbm-mirror-0b8a8c4f322306ac4146f398215b7bd2f6632e65.tar.gz
netpbm-mirror-0b8a8c4f322306ac4146f398215b7bd2f6632e65.tar.xz
netpbm-mirror-0b8a8c4f322306ac4146f398215b7bd2f6632e65.zip
Workaround for build failures on Mac
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4117 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'buildtools')
-rwxr-xr-xbuildtools/configure.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/buildtools/configure.pl b/buildtools/configure.pl
index a2a1fd22..aa94a6bb 100755
--- a/buildtools/configure.pl
+++ b/buildtools/configure.pl
@@ -2489,6 +2489,14 @@ if ($platform eq "GNU") {
     push(@config_mk, "CC = cc -no-cpp-precomp\n");
     push(@config_mk, gnuCflags('cc'));
     push(@config_mk, 'CFLAGS_SHLIB = -fno-common', "\n");
+    # -D_DARWIN_SOURCE is a hack.  We've seen build fail on MacOS because the
+    # C library erroneously neglects to include 'sprintf' and 'vasprintf' in
+    # <stdio.h> under the conditions under which Netpbm includes it.
+    # -D_DARWIN_SOURCE makes it include them.  *_SOURCE macros are supposed to
+    # be defined in the source code to which they apply, but since this is
+    # just a hack, we prefer to do it with a compiler option and leave the
+    # source code unsullied.
+    push(@config_mk, "CFLAGS += -D_DARWIN_SOURCE\n");
 
     my $installNameOpt;
     if ($netpbmlib_runtime_path eq '') {