🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
3.9 KiB

  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2002-2021 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. #
  13. # Call the `configure' script located in `builds/unix'.
  14. #
  15. rm -f config.mk builds/unix/unix-def.mk builds/unix/unix-cc.mk
  16. # respect GNUMAKE environment variable for backward compatibility
  17. if test "x$GNUMAKE" = x; then
  18. if test "x$MAKE" = x; then
  19. if test "x`make -v 2>/dev/null | egrep 'GNU|makepp'`" = x; then
  20. MAKE=gmake
  21. else
  22. MAKE=make
  23. fi
  24. fi
  25. else
  26. MAKE=$GNUMAKE
  27. fi
  28. if test "x`$MAKE -v 2>/dev/null | egrep 'GNU|makepp'`" = x; then
  29. echo "GNU make (>= 3.81) or makepp (>= 2.0) is required to build FreeType2." >&2
  30. echo "Please try" >&2
  31. echo >&2
  32. echo " MAKE=<GNU make command name> $0" >&2
  33. echo >&2
  34. echo "or" >&2
  35. echo >&2
  36. echo " MAKE=\"makepp --norc-substitution\" $0" >&2
  37. exit 1
  38. fi
  39. # Get `dirname' functionality. This is taken and adapted from autoconf's
  40. # m4sh.m4 (_AS_EXPR_PREPARE, AS_DIRNAME_EXPR, and AS_DIRNAME_SED).
  41. if expr a : '\(a\)' >/dev/null 2>&1; then
  42. ft_expr=expr
  43. else
  44. ft_expr=false
  45. fi
  46. ft2_dir=`(dirname "$0") 2>/dev/null ||
  47. $ft_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  48. X"$0" : 'X\(//\)[^/]' \| \
  49. X"$0" : 'X\(//\)$' \| \
  50. X"$0" : 'X\(/\)' \| \
  51. . : '\(.\)' 2>/dev/null ||
  52. echo X"$0" |
  53. sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
  54. s//\1/
  55. q
  56. }
  57. /^X\(\/\/\)[^/].*/{
  58. s//\1/
  59. q
  60. }
  61. /^X\(\/\/\)$/{
  62. s//\1/
  63. q
  64. }
  65. /^X\(\/\).*/{
  66. s//\1/
  67. q
  68. }
  69. s/.*/./; q'`
  70. abs_curr_dir=`pwd`
  71. abs_ft2_dir=`cd "$ft2_dir" && pwd`
  72. # `--srcdir=' option can override abs_ft2_dir
  73. if test $# -gt 0; then
  74. for x in "$@"; do
  75. case x"$x" in
  76. x--srcdir=*)
  77. abs_ft2_dir=`echo $x | sed 's/^--srcdir=//'` ;;
  78. esac
  79. done
  80. fi
  81. # build a dummy Makefile if we are not building in the source tree;
  82. # we use inodes to avoid issues with symbolic links
  83. inode_src=`ls -id $abs_ft2_dir | awk '{print $1}'`
  84. inode_dst=`ls -id $abs_curr_dir | awk '{print $1}'`
  85. if test $inode_src -ne $inode_dst; then
  86. if test ! -d docs; then
  87. mkdir docs
  88. echo "Copying documentation assets"
  89. cp -R $abs_ft2_dir/docs/markdown $abs_curr_dir/docs
  90. fi
  91. if test ! -r $abs_curr_dir/modules.cfg; then
  92. echo "Copying \`modules.cfg'"
  93. cp $abs_ft2_dir/modules.cfg $abs_curr_dir
  94. fi
  95. echo "Generating \`Makefile'"
  96. echo "TOP_DIR := $abs_ft2_dir" > Makefile
  97. echo "OBJ_DIR := $abs_curr_dir" >> Makefile
  98. echo "OBJ_BUILD := \$(OBJ_DIR)" >> Makefile
  99. echo "DOC_DIR := \$(OBJ_DIR)/docs" >> Makefile
  100. echo "FT_LIBTOOL_DIR := \$(OBJ_DIR)" >> Makefile
  101. echo "ifndef FT2DEMOS" >> Makefile
  102. echo " include \$(TOP_DIR)/Makefile" >> Makefile
  103. echo "else" >> Makefile
  104. echo " TOP_DIR_2 := \$(TOP_DIR)/../ft2demos" >> Makefile
  105. echo " PROJECT := freetype" >> Makefile
  106. echo " CONFIG_MK := \$(OBJ_DIR)/config.mk" >> Makefile
  107. echo " include \$(TOP_DIR_2)/Makefile" >> Makefile
  108. echo "endif" >> Makefile
  109. fi
  110. # call make
  111. CFG=
  112. # work around zsh bug which doesn't like `${1+"$@"}'
  113. case $# in
  114. 0) ;;
  115. *) for x in "$@"; do
  116. case x"$x" in
  117. x--srcdir=* ) CFG="$CFG '$x'/builds/unix" ;;
  118. *) CFG="$CFG '$x'" ;;
  119. esac
  120. done ;;
  121. esac
  122. CFG=$CFG $MAKE setup unix
  123. # eof