# You need Xcode installed to get the compilers.
#
if [ ! -x /usr/bin/xcodebuild ]; then
- echo "Please install Xcode first (should be available on DVD)."
+ echo "Please install Xcode first (should be available on DVD or from http://developer.apple.com/xcode/index.php)."
+ exit 1
+fi
+
+#
+# You also need the X11 SDK; with at least some versions of OS X and
+# Xcode, that is, I think, an optional install. (Or it might be
+# installed with X11, but I think *that* is an optional install on
+# at least some versions of OS X.)
+#
+if [ ! -d /usr/X11/include ]; then
+ echo "Please install X11 and the X11 SDK first."
exit 1
fi
# Start with GNU gettext; GLib requires it, and OS X doesn't have it
# or a BSD-licensed replacement.
#
+# At least on Lion with Xcode 4, _FORTIFY_SOURCE gets defined as 2
+# by default, which causes, for example, stpncpy to be defined as
+# a hairy macro that collides with the GNU gettext configure script's
+# attempts to workaround AIX's lack of a declaration for stpncpy,
+# with the result being a huge train wreck. Define _FORTIFY_SOURCE
+# as 0 in an attempt to keep the trains on separate tracks.
+#
echo "Downloading, building, and installing GNU gettext:"
curl -O http://ftp.gnu.org/pub/gnu/gettext/gettext-$GETTEXT_VERSION.tar.gz || exit 1
tar xf gettext-$GETTEXT_VERSION.tar.gz || exit 1
cd gettext-$GETTEXT_VERSION
-./configure || exit 1
+CFLAGS="-D_FORTIFY_SOURCE=0" ./configure || exit 1
make -j 3 || exit 1
$DO_MAKE_INSTALL || exit 1
cd ..