configure.ac

来自「SumatraPDF是一款小型开源的pdf阅读工具。虽然玲珑小巧(只有800多K」· AC 代码 · 共 596 行 · 第 1/2 页

AC
596
字号
# This file is part of the FreeType project.
#
# Process this file with autoconf to produce a configure script.
#
# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.

AC_INIT([FreeType], [2.3.7], [freetype@nongnu.org], [freetype])
AC_CONFIG_SRCDIR([ftconfig.in])


# Don't forget to update docs/VERSION.DLL!

version_info='9:18:3'
AC_SUBST([version_info])
ft_version=`echo $version_info | tr : .`
AC_SUBST([ft_version])


# checks for system type

AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET


# checks for programs

AC_PROG_CC
AC_PROG_CPP
AC_SUBST(EXEEXT)


# checks for native programs to generate building tool

if test ${cross_compiling} = yes; then
  AC_CHECK_PROG(CC_BUILD, ${build}-gcc, ${build}-gcc)
  test -z "${CC_BUILD}" && AC_CHECK_PROG(CC_BUILD, gcc, gcc)
  test -z "${CC_BUILD}" && AC_CHECK_PROG(CC_BUILD, cc, cc, , , /usr/ucb/cc)
  test -z "${CC_BUILD}" && AC_MSG_ERROR([cannot find native C compiler])

  AC_MSG_CHECKING([for suffix of native executables])
  rm -f a.* b.* a_out.exe conftest.*
  echo > conftest.c "int main() { return 0;}"
  ${CC_BUILD} conftest.c || AC_MSG_ERROR([native C compiler is not working])
  rm -f conftest.c
  if test -x a.out -o -x b.out -o -x conftest; then
    EXEEXT_BUILD=""
  elif test -x a_out.exe -o -x conftest.exe; then
    EXEEXT_BUILD=".exe"
  elif test -x conftest.* ; then
    EXEEXT_BUILD=`echo conftest.* | sed -n '1s/^.*\.//g'`
  fi
  AC_MSG_RESULT($EXEEXT_BUILD)
else
  CC_BUILD=${CC}
  EXEEXT_BUILD=${EXEEXT}
fi


if test ! -z ${EXEEXT_BUILD}; then
  EXEEXT_BUILD=."${EXEEXT_BUILD}"
fi
AC_SUBST(CC_BUILD)
AC_SUBST(EXEEXT_BUILD)



# get compiler flags right

if test "x$CC" = xgcc; then
  XX_CFLAGS="-Wall"
  XX_ANSIFLAGS="-pedantic -ansi"
else
  case "$host" in
  *-dec-osf*)
    CFLAGS=
    XX_CFLAGS="-std1 -g3"
    XX_ANSIFLAGS=
    ;;
  *)
    XX_CFLAGS=
    XX_ANSIFLAGS=
    ;;
  esac
fi
AC_SUBST([XX_CFLAGS])
AC_SUBST([XX_ANSIFLAGS])


# auxiliary programs

AC_CHECK_PROG([RMF], [rm], [rm -f])
AC_CHECK_PROG([RMDIR], [rmdir], [rmdir])


# Since this file will be finally moved to another directory we make
# the path of the install script absolute.  This small code snippet has
# been taken from automake's `ylwrap' script.

AC_PROG_INSTALL
case "$INSTALL" in
/*)
  ;;
*/*)
  INSTALL="`pwd`/$INSTALL" ;;
esac


# checks for header files

AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h unistd.h])


# checks for typedefs, structures, and compiler characteristics

AC_C_CONST
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])


# checks for library functions

# Here we check whether we can use our mmap file component.

AC_FUNC_MMAP
if test "$ac_cv_func_mmap_fixed_mapped" != yes; then
  FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
else
  FTSYS_SRC='$(BUILD_DIR)/ftsystem.c'

  AC_CHECK_DECLS([munmap],
    [],
    [],
    [

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/mman.h>

    ])

  FT_MUNMAP_PARAM
fi
AC_SUBST([FTSYS_SRC])

AC_CHECK_FUNCS([memcpy memmove])


# check for system zlib

# don't quote AS_HELP_STRING!
AC_ARG_WITH([zlib],
  AS_HELP_STRING([--without-zlib],
                 [use internal zlib instead of system-wide]))
if test x$with_zlib != xno && test -z "$LIBZ"; then
  AC_CHECK_LIB([z], [gzsetparams], [AC_CHECK_HEADER([zlib.h], [LIBZ='-lz'])])
fi
if test x$with_zlib != xno && test -n "$LIBZ"; then
  CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
  LDFLAGS="$LDFLAGS $LIBZ"
  SYSTEM_ZLIB=yes
fi


# check Apple's `-isysroot' option and duplicate it to LDFLAGS if required --
# Apple TechNote 2137 recommends to include it in CFLAGS but not in LDFLAGS

AC_MSG_CHECKING([whether CFLAGS includes -isysroot option])
case "$CFLAGS" in
*sysroot* )
  AC_MSG_RESULT([yes])
  AC_MSG_CHECKING([whether LDFLAGS includes -isysroot option])
  case "$LDFLAGS" in
  *sysroot* )
    AC_MSG_RESULT([yes])
    ;;
  *)
    AC_MSG_RESULT([no])
    isysroot_dir=`echo ${CFLAGS} | tr '\t' ' ' | sed 's/^.*-isysroot *//;s/ .*//'`
    AC_MSG_WARN(-isysroot ${isysroot_dir} is added to LDFLAGS)
    LDFLAGS="-isysroot ${isysroot_dir} ${LDFLAGS}"
    ;;
  esac
  ;;
*)
  AC_MSG_RESULT([no])
  ;;
esac


# Whether to use Mac OS resource-based fonts.

# don't quote AS_HELP_STRING!
AC_ARG_WITH([old-mac-fonts],
  AS_HELP_STRING([--with-old-mac-fonts],
                 [allow Mac resource-based fonts to be used]))
if test x$with_old_mac_fonts = xyes; then
  orig_LDFLAGS="${LDFLAGS}"
  AC_MSG_CHECKING([CoreServices & ApplicationServices of Mac OS X])
  FT2_EXTRA_LIBS="-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices"
  LDFLAGS="$LDFLAGS $FT2_EXTRA_LIBS"
  AC_LINK_IFELSE([
    AC_LANG_PROGRAM([

#if defined(__GNUC__) && defined(__APPLE_CC__)
# include <Carbon/Carbon.h>
# include <ApplicationServices/ApplicationServices.h>
#else
# include <ConditionalMacros.h>
# include <Files.h>
#endif

      ],
      [

        short res = 0;


        UseResFile( res );

      ])],
    [AC_MSG_RESULT([ok])
     AC_MSG_CHECKING([OS_INLINE macro is ANSI compatible])
     orig_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS"
     AC_COMPILE_IFELSE([
       AC_LANG_PROGRAM([

#if defined(__GNUC__) && defined(__APPLE_CC__)
# include <Carbon/Carbon.h>
# include <ApplicationServices/ApplicationServices.h>
#else
# include <ConditionalMacros.h>
# include <Files.h>
#endif

         ],
         [

           /* OSHostByteOrder() is typed as OS_INLINE */
           int32_t  os_byte_order = OSHostByteOrder();


           if ( OSBigEndian != os_byte_order )
             return 1;

         ])],
       [AC_MSG_RESULT([ok])
        CFLAGS="$orig_CFLAGS"
        CFLAGS="$CFLAGS -DHAVE_ANSI_OS_INLINE=1"
       ],
       [AC_MSG_RESULT([no, ANSI incompatible])
        CFLAGS="$orig_CFLAGS"
       ])
     AC_MSG_CHECKING([type ResourceIndex])
     orig_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS"
     AC_COMPILE_IFELSE([
       AC_LANG_PROGRAM([

#if defined(__GNUC__) && defined(__APPLE_CC__)
# include <Carbon/Carbon.h>
# include <ApplicationServices/ApplicationServices.h>
#else
# include <ConditionalMacros.h>
# include <Files.h>
# include <Resources.h>
#endif

         ],
         [

           ResourceIndex i = 0;
           return i;

         ])],
       [AC_MSG_RESULT([ok])
        CFLAGS="$orig_CFLAGS"
        CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX"
       ],
       [AC_MSG_RESULT([no])
        CFLAGS="$orig_CFLAGS"
       ])],
    [AC_MSG_RESULT([not found])
     LDFLAGS="${orig_LDFLAGS}"
     CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"])
else
  case x$target_os in
  xdarwin*)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?