summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2002-05-05 10:57:06 +0000
committerWerner Lemberg <wl@gnu.org>2002-05-05 10:57:06 +0000
commitf83ded01749f3ed6d706e3db9d35cbe5e90eb3bb (patch)
tree360f7c7fa8f4295e037891d1db58d4129fbce97a /configure
parent26aca0244d0888ba46bc0d661beb75d510eca6b6 (diff)
downloadfreetype2-f83ded01749f3ed6d706e3db9d35cbe5e90eb3bb.tar.gz
FreeType 2 can now be built in an external directory with the
configure script also. * builds/freetype.mk (INCLUDES): Add `OBJ_DIR'. * builds/unix/detect.mk (have_mk): New variable to test for external build. (unix-def.mk): Defined according to value of `have_mk'. * builds/unix/unix.mk (have_mk): New variable to test for external build. Select include paths for unix-def.mk and unix-cc.mk according to value of `have_mk'. * builds/unix/unix-def.in (OBJ_BUILD): New variable. (DISTCLEAN): Use it. * builds/unix/unix-cc.in (LIBTOOL): Define default value only if not yet defined. * builds/unix/install.mk (install): Use `OBJ_BUILD' for installing freetype-config. * configure: Don't depend on bash features. (ft2_dir, abs_curr_dir, abs_ft2_dir): New variables (code partially taken from Autoconf). Build a dummy Makefile if not building in source tree. * docs/INSTALL: Document it.
Diffstat (limited to 'configure')
-rw-r--r--configure42
1 files changed, 40 insertions, 2 deletions
diff --git a/configure b/configure
index bd4c5231f..982a1df06 100644
--- a/configure
+++ b/configure
@@ -9,14 +9,52 @@
# install
#
-if [ "x$GNUMAKE" = x ]; then
+if test "x$GNUMAKE" = x; then
GNUMAKE=make
fi
-if [ `$GNUMAKE -v 2>/dev/null|grep -ic gnu` -eq 0 ]; then
+if test -z "`$GNUMAKE -v 2>/dev/null | grep GNU`"; then
echo "Sorry, GNU make is required to build FreeType2." >&2
echo "Please try \`GNUMAKE=<GNU make command name> $0'." >&2
exit 1
fi
+# Uh, oh. This is taken from autoconf. They know what they are doing...
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ ft_expr=expr
+else
+ ft_expr=false
+fi
+
+ft2_dir=`(dirname "$0") 2>/dev/null ||
+$ft_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+abs_curr_dir=`pwd`
+abs_ft2_dir=`cd "$ft2_dir" && pwd`
+
+# build a dummy Makefile if we are not building in the source tree
+
+if test "$abs_curr_dir" != "$abs_ft2_dir"; then
+ echo "OBJ_DIR=$abs_curr_dir" > Makefile
+ echo "TOP=$abs_ft2_dir" >> Makefile
+ echo "OBJ_BUILD=$abs_curr_dir" >> Makefile
+ echo "LIBTOOL=$abs_curr_dir/libtool" >> Makefile
+ echo "include $abs_ft2_dir/Makefile" >> Makefile
+fi
+
+# call make
+
CFG="$@" $GNUMAKE setup unix
+
+# eof