2001-12-16 09:17:33 +01:00
|
|
|
#! /bin/sh
|
2005-06-05 01:04:30 +02:00
|
|
|
#
|
2018-01-02 09:33:57 +01:00
|
|
|
# Copyright 2000-2018 by
|
2005-06-05 01:04:30 +02:00
|
|
|
# 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.
|
2000-11-09 19:23:30 +01:00
|
|
|
|
2013-02-01 23:45:04 +01:00
|
|
|
LC_ALL=C
|
|
|
|
export LC_ALL
|
|
|
|
|
2017-02-04 20:30:40 +01:00
|
|
|
|
2017-02-04 20:33:53 +01:00
|
|
|
# if `pkg-config' is available, use values from `freetype2.pc'
|
2017-06-20 12:24:05 +02:00
|
|
|
%PKG_CONFIG% --atleast-pkgconfig-version 0.24 >/dev/null 2>&1
|
2017-02-04 20:30:40 +01:00
|
|
|
if test $? -eq 0 ; then
|
|
|
|
# note that option `--variable' is not affected by the
|
|
|
|
# PKG_CONFIG_SYSROOT_DIR environment variable
|
|
|
|
if test "x$SYSROOT" != "x" ; then
|
|
|
|
PKG_CONFIG_SYSROOT_DIR="$SYSROOT"
|
|
|
|
export PKG_CONFIG_SYSROOT_DIR
|
|
|
|
fi
|
|
|
|
|
2017-06-20 12:24:05 +02:00
|
|
|
prefix=`%PKG_CONFIG% --variable prefix freetype2`
|
|
|
|
exec_prefix=`%PKG_CONFIG% --variable exec_prefix freetype2`
|
2017-02-04 20:30:40 +01:00
|
|
|
|
2017-06-20 12:24:05 +02:00
|
|
|
includedir=`%PKG_CONFIG% --variable includedir freetype2`
|
|
|
|
libdir=`%PKG_CONFIG% --variable libdir freetype2`
|
2017-02-04 20:30:40 +01:00
|
|
|
|
2017-06-20 12:24:05 +02:00
|
|
|
version=`%PKG_CONFIG% --modversion freetype2`
|
2017-02-04 20:30:40 +01:00
|
|
|
|
2017-06-20 12:24:05 +02:00
|
|
|
cflags=`%PKG_CONFIG% --cflags freetype2`
|
|
|
|
dynamic_libs=`%PKG_CONFIG% --libs freetype2`
|
|
|
|
static_libs=`%PKG_CONFIG% --static --libs freetype2`
|
2017-02-04 20:30:40 +01:00
|
|
|
else
|
|
|
|
prefix="%prefix%"
|
|
|
|
exec_prefix="%exec_prefix%"
|
|
|
|
|
|
|
|
includedir="%includedir%"
|
|
|
|
libdir="%libdir%"
|
|
|
|
|
|
|
|
version=%ft_version%
|
|
|
|
|
|
|
|
cflags="-I${SYSROOT}$includedir/freetype2"
|
|
|
|
dynamic_libs="-lfreetype"
|
|
|
|
static_libs="%LIBSSTATIC_CONFIG%"
|
|
|
|
if test "${SYSROOT}$libdir" != "/usr/lib" &&
|
|
|
|
test "${SYSROOT}$libdir" != "/usr/lib64" ; then
|
|
|
|
libs_L="-L${SYSROOT}$libdir"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
orig_prefix=$prefix
|
|
|
|
orig_exec_prefix=$exec_prefix
|
|
|
|
|
|
|
|
orig_includedir=$includedir
|
|
|
|
orig_libdir=$libdir
|
|
|
|
|
|
|
|
include_suffix=`echo $includedir | sed "s|$prefix||"`
|
|
|
|
lib_suffix=`echo $libdir | sed "s|$exec_prefix||"`
|
|
|
|
|
2000-11-09 19:23:30 +01:00
|
|
|
|
|
|
|
usage()
|
|
|
|
{
|
2000-11-10 23:43:37 +01:00
|
|
|
cat <<EOF
|
2004-04-17 20:58:43 +02:00
|
|
|
Usage: freetype-config [OPTION]...
|
|
|
|
Get FreeType compilation and linking information.
|
|
|
|
|
2000-11-09 19:23:30 +01:00
|
|
|
Options:
|
2004-04-17 20:58:43 +02:00
|
|
|
--prefix display \`--prefix' value used for building the
|
|
|
|
FreeType library
|
|
|
|
--prefix=PREFIX override \`--prefix' value with PREFIX
|
|
|
|
--exec-prefix display \`--exec-prefix' value used for building
|
|
|
|
the FreeType library
|
|
|
|
--exec-prefix=EPREFIX override \`--exec-prefix' value with EPREFIX
|
|
|
|
--version display libtool version of the FreeType library
|
2005-02-10 09:18:27 +01:00
|
|
|
--ftversion display FreeType version number
|
2004-04-17 20:58:43 +02:00
|
|
|
--libs display flags for linking with the FreeType library
|
|
|
|
--libtool display library name for linking with libtool
|
|
|
|
--cflags display flags for compiling with the FreeType
|
|
|
|
library
|
Rewrite library option handling in `configure'; improve `freetype-config'.
o Introduce `auto' value for `--with-XXX' library options; this is
now the default.
o First use `pkg-config' for library detection, then fall back to
other tests.
* builds/unix/configure.raw (--with-zlib, --with-bzip2, --with-png,
--with-harfbuzz): Rewrite.
Use new `xxx_reqpriv', `xxx_libpriv', and `xxx_libstaticconf'
variables to collect data for `freetype2.pc' and `freetype-config'.
(FT2_EXTRA_LIBS): Renamed to ...
(ft2_extra_libs): This since it gets no longer substituted.
(REQUIRES_PRIVATE, LIBS_PRIVATE, LIBS_CONFIG, LIBSSTATIC_CONFIG):
New output variables, replacing `XXX_PKG' and `LIBXXX'.
Add notice at the end of `configure' showing the library
configuration.
* builds/unix/freetype-config.in (--static): New command line
option.
(libs): Updated.
(staticlibs): New variable, to be used if `--static' is given.
* builds/doc/freetype-config.1: Document `--static'.
* builds/unix/freetype2.in, builds/unix/unix-def.in: Updated.
2014-03-03 07:13:45 +01:00
|
|
|
--static make command line options display flags
|
|
|
|
for static linking
|
2017-02-04 20:30:40 +01:00
|
|
|
--help display this help and exit
|
2000-11-09 19:23:30 +01:00
|
|
|
EOF
|
2000-11-10 23:43:37 +01:00
|
|
|
exit $1
|
2000-11-09 19:23:30 +01:00
|
|
|
}
|
|
|
|
|
2017-02-04 20:30:40 +01:00
|
|
|
|
2002-01-13 07:36:02 +01:00
|
|
|
if test $# -eq 0 ; then
|
2000-11-10 23:43:37 +01:00
|
|
|
usage 1 1>&2
|
2000-11-09 19:23:30 +01:00
|
|
|
fi
|
|
|
|
|
2017-02-04 20:30:40 +01:00
|
|
|
|
2002-01-13 07:36:02 +01:00
|
|
|
while test $# -gt 0 ; do
|
2000-11-09 19:23:30 +01:00
|
|
|
case "$1" in
|
2004-02-08 23:45:48 +01:00
|
|
|
-*=*)
|
|
|
|
optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
optarg=
|
|
|
|
;;
|
2000-11-09 19:23:30 +01:00
|
|
|
esac
|
|
|
|
|
|
|
|
case $1 in
|
2000-11-10 23:43:37 +01:00
|
|
|
--prefix=*)
|
|
|
|
prefix=$optarg
|
2001-01-12 06:32:04 +01:00
|
|
|
local_prefix=yes
|
2000-11-10 23:43:37 +01:00
|
|
|
;;
|
|
|
|
--prefix)
|
|
|
|
echo_prefix=yes
|
|
|
|
;;
|
|
|
|
--exec-prefix=*)
|
|
|
|
exec_prefix=$optarg
|
|
|
|
exec_prefix_set=yes
|
2001-01-12 06:32:04 +01:00
|
|
|
local_prefix=yes
|
2000-11-10 23:43:37 +01:00
|
|
|
;;
|
|
|
|
--exec-prefix)
|
|
|
|
echo_exec_prefix=yes
|
|
|
|
;;
|
|
|
|
--version)
|
2017-02-04 20:30:40 +01:00
|
|
|
echo_version=yes
|
|
|
|
break
|
2000-11-10 23:43:37 +01:00
|
|
|
;;
|
2005-02-10 09:18:27 +01:00
|
|
|
--ftversion)
|
2009-02-04 08:59:16 +01:00
|
|
|
echo_ft_version=yes
|
2005-02-10 09:18:27 +01:00
|
|
|
;;
|
2000-11-10 23:43:37 +01:00
|
|
|
--cflags)
|
|
|
|
echo_cflags=yes
|
|
|
|
;;
|
|
|
|
--libs)
|
|
|
|
echo_libs=yes
|
|
|
|
;;
|
2000-11-12 03:55:25 +01:00
|
|
|
--libtool)
|
|
|
|
echo_libtool=yes
|
|
|
|
;;
|
Rewrite library option handling in `configure'; improve `freetype-config'.
o Introduce `auto' value for `--with-XXX' library options; this is
now the default.
o First use `pkg-config' for library detection, then fall back to
other tests.
* builds/unix/configure.raw (--with-zlib, --with-bzip2, --with-png,
--with-harfbuzz): Rewrite.
Use new `xxx_reqpriv', `xxx_libpriv', and `xxx_libstaticconf'
variables to collect data for `freetype2.pc' and `freetype-config'.
(FT2_EXTRA_LIBS): Renamed to ...
(ft2_extra_libs): This since it gets no longer substituted.
(REQUIRES_PRIVATE, LIBS_PRIVATE, LIBS_CONFIG, LIBSSTATIC_CONFIG):
New output variables, replacing `XXX_PKG' and `LIBXXX'.
Add notice at the end of `configure' showing the library
configuration.
* builds/unix/freetype-config.in (--static): New command line
option.
(libs): Updated.
(staticlibs): New variable, to be used if `--static' is given.
* builds/doc/freetype-config.1: Document `--static'.
* builds/unix/freetype2.in, builds/unix/unix-def.in: Updated.
2014-03-03 07:13:45 +01:00
|
|
|
--static)
|
|
|
|
show_static=yes
|
|
|
|
;;
|
2017-02-04 20:30:40 +01:00
|
|
|
--help)
|
|
|
|
usage 0
|
|
|
|
;;
|
2000-11-10 23:43:37 +01:00
|
|
|
*)
|
|
|
|
usage 1 1>&2
|
|
|
|
;;
|
2000-11-09 19:23:30 +01:00
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2017-02-04 20:30:40 +01:00
|
|
|
|
2001-01-12 06:32:04 +01:00
|
|
|
if test "$local_prefix" = "yes" ; then
|
2004-02-08 23:45:48 +01:00
|
|
|
if test "$exec_prefix_set" != "yes" ; then
|
|
|
|
exec_prefix=$prefix
|
|
|
|
fi
|
2000-11-10 23:43:37 +01:00
|
|
|
fi
|
|
|
|
|
2017-02-04 20:30:40 +01:00
|
|
|
if test "$local_prefix" = "yes" ; then
|
|
|
|
includedir=${prefix}${include_suffix}
|
|
|
|
if test "$exec_prefix_set" = "yes" ; then
|
|
|
|
libdir=${exec_prefix}${lib_suffix}
|
|
|
|
else
|
|
|
|
libdir=${prefix}${lib_suffix}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if test "$echo_version" = "yes" ; then
|
|
|
|
echo $version
|
|
|
|
fi
|
|
|
|
|
2002-01-13 07:36:02 +01:00
|
|
|
if test "$echo_prefix" = "yes" ; then
|
2009-12-22 00:25:38 +01:00
|
|
|
echo ${SYSROOT}$prefix
|
2000-11-09 19:23:30 +01:00
|
|
|
fi
|
2001-12-11 14:38:52 +01:00
|
|
|
|
2002-01-13 07:36:02 +01:00
|
|
|
if test "$echo_exec_prefix" = "yes" ; then
|
2009-12-22 00:25:38 +01:00
|
|
|
echo ${SYSROOT}$exec_prefix
|
2004-02-08 23:45:48 +01:00
|
|
|
fi
|
|
|
|
|
2009-02-04 08:59:16 +01:00
|
|
|
if test "$echo_ft_version" = "yes" ; then
|
Another adjustment to header locations.
This change is a result of a discussion thread on freetype-devel
http://lists.nongnu.org/archive/html/freetype-devel/2015-06/msg00041.html
Re-introduce the `freetype2' subdirectory for all FreeType header
files after installation, and rename the `freetype2' subdirectory in
the git repository to `freetype'.
* include/freetype2: Renamed to...
* include/freetype: This.
* CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS,
PRIVATE_HEADERS): Updated.
Update creation of `ftconfig.h'.
Install generated `ftconfig.h'.
* Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated.
* builds/amiga/include/config/ftconfig.h, builds/freetype.mk
(PUBLIC_DIR), builds/symbian/bld.inf, builds/toplevel.mk (work),
builds/unix/freetype2.in: Updated.
* builds/unix/freetype-config.in: Updated.
* builds/unix/configure.raw: Don't check for `rmdir'.
* builds/unix/unix-def.in (DELDIR): Use `rm -rf', which is portable
according to the autoconf info manual.
* builds/unix/install.mk (install, uninstall,
distclean_project_unix): Update and simplify.
* builds/wince/*, builds/windows/*: Updated.
* devel/ft2build.h, include/ft2build.h: Updated.
* include/freetype2/config/ftheader.h,
include/freetype2/internal/ftserv.h,
include/freetype2/internal/internal.h: Update all header file
macros.
* src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated.
* docs/*: Updated.
2015-06-25 13:04:57 +02:00
|
|
|
major=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
|
2009-02-04 08:59:16 +01:00
|
|
|
| grep FREETYPE_MAJOR \
|
|
|
|
| sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
|
Another adjustment to header locations.
This change is a result of a discussion thread on freetype-devel
http://lists.nongnu.org/archive/html/freetype-devel/2015-06/msg00041.html
Re-introduce the `freetype2' subdirectory for all FreeType header
files after installation, and rename the `freetype2' subdirectory in
the git repository to `freetype'.
* include/freetype2: Renamed to...
* include/freetype: This.
* CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS,
PRIVATE_HEADERS): Updated.
Update creation of `ftconfig.h'.
Install generated `ftconfig.h'.
* Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated.
* builds/amiga/include/config/ftconfig.h, builds/freetype.mk
(PUBLIC_DIR), builds/symbian/bld.inf, builds/toplevel.mk (work),
builds/unix/freetype2.in: Updated.
* builds/unix/freetype-config.in: Updated.
* builds/unix/configure.raw: Don't check for `rmdir'.
* builds/unix/unix-def.in (DELDIR): Use `rm -rf', which is portable
according to the autoconf info manual.
* builds/unix/install.mk (install, uninstall,
distclean_project_unix): Update and simplify.
* builds/wince/*, builds/windows/*: Updated.
* devel/ft2build.h, include/ft2build.h: Updated.
* include/freetype2/config/ftheader.h,
include/freetype2/internal/ftserv.h,
include/freetype2/internal/internal.h: Update all header file
macros.
* src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated.
* docs/*: Updated.
2015-06-25 13:04:57 +02:00
|
|
|
minor=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
|
2009-02-04 08:59:16 +01:00
|
|
|
| grep FREETYPE_MINOR \
|
|
|
|
| sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
|
Another adjustment to header locations.
This change is a result of a discussion thread on freetype-devel
http://lists.nongnu.org/archive/html/freetype-devel/2015-06/msg00041.html
Re-introduce the `freetype2' subdirectory for all FreeType header
files after installation, and rename the `freetype2' subdirectory in
the git repository to `freetype'.
* include/freetype2: Renamed to...
* include/freetype: This.
* CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS,
PRIVATE_HEADERS): Updated.
Update creation of `ftconfig.h'.
Install generated `ftconfig.h'.
* Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated.
* builds/amiga/include/config/ftconfig.h, builds/freetype.mk
(PUBLIC_DIR), builds/symbian/bld.inf, builds/toplevel.mk (work),
builds/unix/freetype2.in: Updated.
* builds/unix/freetype-config.in: Updated.
* builds/unix/configure.raw: Don't check for `rmdir'.
* builds/unix/unix-def.in (DELDIR): Use `rm -rf', which is portable
according to the autoconf info manual.
* builds/unix/install.mk (install, uninstall,
distclean_project_unix): Update and simplify.
* builds/wince/*, builds/windows/*: Updated.
* devel/ft2build.h, include/ft2build.h: Updated.
* include/freetype2/config/ftheader.h,
include/freetype2/internal/ftserv.h,
include/freetype2/internal/internal.h: Update all header file
macros.
* src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated.
* docs/*: Updated.
2015-06-25 13:04:57 +02:00
|
|
|
patch=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
|
2009-02-04 08:59:16 +01:00
|
|
|
| grep FREETYPE_PATCH \
|
|
|
|
| sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
|
|
|
|
echo $major.$minor.$patch
|
|
|
|
fi
|
|
|
|
|
2002-01-13 07:36:02 +01:00
|
|
|
if test "$echo_cflags" = "yes" ; then
|
2017-02-04 20:30:40 +01:00
|
|
|
echo $cflags | sed "s|$orig_includedir/freetype2|$includedir/freetype2|"
|
2000-11-09 19:23:30 +01:00
|
|
|
fi
|
2001-12-11 14:38:52 +01:00
|
|
|
|
2002-01-13 07:36:02 +01:00
|
|
|
if test "$echo_libs" = "yes" ; then
|
Rewrite library option handling in `configure'; improve `freetype-config'.
o Introduce `auto' value for `--with-XXX' library options; this is
now the default.
o First use `pkg-config' for library detection, then fall back to
other tests.
* builds/unix/configure.raw (--with-zlib, --with-bzip2, --with-png,
--with-harfbuzz): Rewrite.
Use new `xxx_reqpriv', `xxx_libpriv', and `xxx_libstaticconf'
variables to collect data for `freetype2.pc' and `freetype-config'.
(FT2_EXTRA_LIBS): Renamed to ...
(ft2_extra_libs): This since it gets no longer substituted.
(REQUIRES_PRIVATE, LIBS_PRIVATE, LIBS_CONFIG, LIBSSTATIC_CONFIG):
New output variables, replacing `XXX_PKG' and `LIBXXX'.
Add notice at the end of `configure' showing the library
configuration.
* builds/unix/freetype-config.in (--static): New command line
option.
(libs): Updated.
(staticlibs): New variable, to be used if `--static' is given.
* builds/doc/freetype-config.1: Document `--static'.
* builds/unix/freetype2.in, builds/unix/unix-def.in: Updated.
2014-03-03 07:13:45 +01:00
|
|
|
if test "$show_static" = "yes" ; then
|
2017-02-04 20:30:40 +01:00
|
|
|
libs="$libs_L $static_libs"
|
2004-02-08 23:45:48 +01:00
|
|
|
else
|
2017-02-04 20:30:40 +01:00
|
|
|
libs="$libs_L $dynamic_libs"
|
2004-02-08 23:45:48 +01:00
|
|
|
fi
|
2017-02-04 20:30:40 +01:00
|
|
|
echo $libs | sed "s|$orig_libdir|$libdir|"
|
2000-11-09 19:23:30 +01:00
|
|
|
fi
|
2001-12-11 14:38:52 +01:00
|
|
|
|
2002-01-13 07:36:02 +01:00
|
|
|
if test "$echo_libtool" = "yes" ; then
|
2017-02-04 20:30:40 +01:00
|
|
|
echo ${SYSROOT}$libdir/libfreetype.la
|
2000-11-12 03:55:25 +01:00
|
|
|
fi
|
2000-11-09 19:23:30 +01:00
|
|
|
|
2000-11-10 23:43:37 +01:00
|
|
|
# EOF
|