David Turner | dc47784 | 2002-01-08 18:34:11 +0000 | [diff] [blame] | 1 | #!/bin/sh |
David Turner | dc47784 | 2002-01-08 18:34:11 +0000 | [diff] [blame] | 2 | # |
Werner Lemberg | 60a04df | 2005-06-04 23:04:30 +0000 | [diff] [blame] | 3 | # Copyright 2002, 2003, 2004, 2005 by |
| 4 | # David Turner, Robert Wilhelm, and Werner Lemberg. |
| 5 | # |
| 6 | # This file is part of the FreeType project, and may only be used, modified, |
| 7 | # and distributed under the terms of the FreeType project license, |
| 8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you |
| 9 | # indicate that you have read the license and understand and accept it |
| 10 | # fully. |
| 11 | # |
| 12 | # |
Werner Lemberg | 67d546a | 2005-05-24 04:49:42 +0000 | [diff] [blame] | 13 | # Call the `configure' script located in `builds/unix'. |
Werner Lemberg | 3975e2e | 2002-01-09 21:01:18 +0000 | [diff] [blame] | 14 | # |
Werner Lemberg | 67d546a | 2005-05-24 04:49:42 +0000 | [diff] [blame] | 15 | |
| 16 | rm -f config.mk builds/unix/unix-def.mk builds/unix/unix-cc.mk |
David Turner | d15bc0d | 2002-04-12 09:31:48 +0000 | [diff] [blame] | 17 | |
Werner Lemberg | f83ded0 | 2002-05-05 10:57:06 +0000 | [diff] [blame] | 18 | if test "x$GNUMAKE" = x; then |
David Turner | d15bc0d | 2002-04-12 09:31:48 +0000 | [diff] [blame] | 19 | GNUMAKE=make |
| 20 | fi |
| 21 | |
Werner Lemberg | f83ded0 | 2002-05-05 10:57:06 +0000 | [diff] [blame] | 22 | if test -z "`$GNUMAKE -v 2>/dev/null | grep GNU`"; then |
Werner Lemberg | 26eccb4 | 2004-04-13 08:35:05 +0000 | [diff] [blame] | 23 | if test -z "`$GNUMAKE -v 2>/dev/null | grep makepp`"; then |
| 24 | echo "GNU make (>= 3.79.1) or makepp (>= 1.19) is required to build FreeType2." >&2 |
| 25 | echo "Please try" >&2 |
| 26 | echo " \`GNUMAKE=<GNU make command name> $0'." >&2 |
| 27 | echo "or >&2" |
| 28 | echo " \`GNUMAKE=\"makepp --norc-substitution\" $0'." >&2 |
| 29 | exit 1 |
| 30 | fi |
David Turner | d15bc0d | 2002-04-12 09:31:48 +0000 | [diff] [blame] | 31 | fi |
| 32 | |
Werner Lemberg | f83ded0 | 2002-05-05 10:57:06 +0000 | [diff] [blame] | 33 | # Uh, oh. This is taken from autoconf. They know what they are doing... |
| 34 | |
| 35 | if expr a : '\(a\)' >/dev/null 2>&1; then |
| 36 | ft_expr=expr |
| 37 | else |
| 38 | ft_expr=false |
| 39 | fi |
| 40 | |
| 41 | ft2_dir=`(dirname "$0") 2>/dev/null || |
| 42 | $ft_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ |
| 43 | X"$0" : 'X\(//\)[^/]' \| \ |
| 44 | X"$0" : 'X\(//\)$' \| \ |
| 45 | X"$0" : 'X\(/\)' \| \ |
| 46 | . : '\(.\)' 2>/dev/null || |
| 47 | echo X"$0" | |
| 48 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } |
| 49 | /^X\(\/\/\)[^/].*/{ s//\1/; q; } |
| 50 | /^X\(\/\/\)$/{ s//\1/; q; } |
| 51 | /^X\(\/\).*/{ s//\1/; q; } |
| 52 | s/.*/./; q'` |
| 53 | |
| 54 | abs_curr_dir=`pwd` |
| 55 | abs_ft2_dir=`cd "$ft2_dir" && pwd` |
| 56 | |
| 57 | # build a dummy Makefile if we are not building in the source tree |
| 58 | |
| 59 | if test "$abs_curr_dir" != "$abs_ft2_dir"; then |
Werner Lemberg | 6aa35cd | 2003-07-09 15:20:32 +0000 | [diff] [blame] | 60 | mkdir reference |
Werner Lemberg | a33bd86 | 2005-02-13 05:46:50 +0000 | [diff] [blame] | 61 | echo "TOP_DIR := $abs_ft2_dir" > Makefile |
| 62 | echo "OBJ_DIR := $abs_curr_dir" >> Makefile |
| 63 | echo "OBJ_BUILD := \$(OBJ_DIR)" >> Makefile |
| 64 | echo "DOC_DIR := \$(OBJ_DIR)/reference" >> Makefile |
| 65 | echo "LIBTOOL := \$(OBJ_DIR)/libtool" >> Makefile |
| 66 | echo "ifndef FT2DEMOS" >> Makefile |
| 67 | echo " include \$(TOP_DIR)/Makefile" >> Makefile |
| 68 | echo "else" >> Makefile |
| 69 | echo " TOP_DIR_2 := \$(TOP_DIR)/../ft2demos" >> Makefile |
| 70 | echo " PROJECT := freetype" >> Makefile |
| 71 | echo " CONFIG_MK := \$(OBJ_DIR)/config.mk" >> Makefile |
| 72 | echo " include \$(TOP_DIR_2)/Makefile" >> Makefile |
| 73 | echo "endif" >> Makefile |
Werner Lemberg | f83ded0 | 2002-05-05 10:57:06 +0000 | [diff] [blame] | 74 | fi |
| 75 | |
| 76 | # call make |
| 77 | |
David Turner | d15bc0d | 2002-04-12 09:31:48 +0000 | [diff] [blame] | 78 | CFG="$@" $GNUMAKE setup unix |
Werner Lemberg | f83ded0 | 2002-05-05 10:57:06 +0000 | [diff] [blame] | 79 | |
| 80 | # eof |