misc/libfreetype/configure
author koda
Sat, 08 Dec 2012 15:38:16 +0100
changeset 8272 93d8c77a13e8
parent 5172 88f2e05288ba
permissions -rw-r--r--
removing the optimisation that caused (most likely) the lua crashes on osx
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     1
#!/bin/sh
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     2
#
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     3
# Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     4
# David Turner, Robert Wilhelm, and Werner Lemberg.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     5
#
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
# This file is part of the FreeType project, and may only be used, modified,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
# and distributed under the terms of the FreeType project license,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
# indicate that you have read the license and understand and accept it
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
# fully.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
#
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
#
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
# Call the `configure' script located in `builds/unix'.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
#
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
rm -f config.mk builds/unix/unix-def.mk builds/unix/unix-cc.mk
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
if test "x$GNUMAKE" = x; then
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
  GNUMAKE=make
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
fi
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
if test -z "`$GNUMAKE -v 2>/dev/null | grep GNU`"; then
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
  if test -z "`$GNUMAKE -v 2>/dev/null | grep makepp`"; then
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
    echo "GNU make (>= 3.80) or makepp (>= 1.19) is required to build FreeType2." >&2
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
    echo "Please try" >&2
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
    echo "  \`GNUMAKE=<GNU make command name> $0'." >&2
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
    echo "or >&2"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
    echo "  \`GNUMAKE=\"makepp --norc-substitution\" $0'." >&2
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
    exit 1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
  fi
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
fi
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
# Get `dirname' functionality.  This is taken and adapted from autoconf's
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
# m4sh.m4 (_AS_EXPR_PREPARE, AS_DIRNAME_EXPR, and AS_DIRNAME_SED).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
if expr a : '\(a\)' >/dev/null 2>&1; then
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
  ft_expr=expr
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
  ft_expr=false
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
fi
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
ft2_dir=`(dirname "$0") 2>/dev/null                         ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
         $ft_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
                  X"$0" : 'X\(//\)[^/]' \| \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
                  X"$0" : 'X\(//\)$' \| \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
                  X"$0" : 'X\(/\)' \| \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
                  .     : '\(.\)' 2>/dev/null               ||
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
         echo X"$0" |
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
                  s//\1/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
                  q
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
                }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
                /^X\(\/\/\)[^/].*/{
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
                  s//\1/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
                  q
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
                }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
                /^X\(\/\/\)$/{
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
                  s//\1/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
                  q
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
                }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
                /^X\(\/\).*/{
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
                  s//\1/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
                  q
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
                }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
                s/.*/./; q'`
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
abs_curr_dir=`pwd`
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
abs_ft2_dir=`cd "$ft2_dir" && pwd`
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
# `--srcdir=' option can override abs_ft2_dir
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
if test $# -gt 0; then
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
  for x in "$@"; do
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
    case x"$x" in
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
    x--srcdir=*)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
      abs_ft2_dir=`echo $x | sed 's/^--srcdir=//'` ;;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
    esac
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
  done
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
fi
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
# build a dummy Makefile if we are not building in the source tree;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
# we use inodes to avoid issues with symbolic links
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
inode_src=`ls -id $abs_ft2_dir | awk '{print $1}'`
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
inode_dst=`ls -id $abs_curr_dir | awk '{print $1}'`
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
if test $inode_src -ne $inode_dst; then
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
  if test ! -d reference; then
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
    mkdir reference
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
  fi
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
  if test ! -r $abs_curr_dir/modules.cfg; then
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
    echo "Copying \`modules.cfg'"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
    cp $abs_ft2_dir/modules.cfg $abs_curr_dir
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
  fi
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
  echo "Generating \`Makefile'"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
  echo "TOP_DIR   := $abs_ft2_dir"               > Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
  echo "OBJ_DIR   := $abs_curr_dir"             >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
  echo "OBJ_BUILD := \$(OBJ_DIR)"               >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
  echo "DOC_DIR   := \$(OBJ_DIR)/reference"     >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
  echo "FT_LIBTOOL_DIR   := \$(OBJ_DIR)"        >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
  echo "ifndef FT2DEMOS"                        >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
  echo "  include \$(TOP_DIR)/Makefile"         >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
  echo "else"                                   >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
  echo "  TOP_DIR_2 := \$(TOP_DIR)/../ft2demos" >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
  echo "  PROJECT   := freetype"                >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
  echo "  CONFIG_MK := \$(OBJ_DIR)/config.mk"   >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
  echo "  include \$(TOP_DIR_2)/Makefile"       >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
  echo "endif"                                  >> Makefile
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
fi
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
# call make
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
CFG=
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
# work around zsh bug which doesn't like `${1+"$@"}'
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
case $# in
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
0) ;;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
*) for x in "$@"; do
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
     case x"$x" in
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
     x--srcdir=* ) CFG="$CFG '$x'/builds/unix" ;;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
     *) CFG="$CFG '$x'" ;;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
     esac
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
   done ;;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
esac
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
CFG=$CFG $GNUMAKE setup unix
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
# eof