Make `freetype-config' a wrapper of `pkg-config' if possible.
Based on ideas taken from http://pkgs.fedoraproject.org/cgit/rpms/freetype.git/tree/freetype-multilib.patch http://pkgs.fedoraproject.org/cgit/rpms/freetype.git/tree/freetype-2.5.3-freetype-config-prefix.patch * builds/unix/freetype-config.in: Rewritten. Use `pkg-config' to set output variables if program is available. * docs/CHANGES, docs/freetype-config.1: Updated.
This commit is contained in:
parent
790428905d
commit
1c513fbb88
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2017-02-04 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
Make `freetype-config' a wrapper of `pkg-config' if possible.
|
||||||
|
|
||||||
|
Based on ideas taken from
|
||||||
|
|
||||||
|
http://pkgs.fedoraproject.org/cgit/rpms/freetype.git/tree/freetype-multilib.patch
|
||||||
|
http://pkgs.fedoraproject.org/cgit/rpms/freetype.git/tree/freetype-2.5.3-freetype-config-prefix.patch
|
||||||
|
|
||||||
|
* builds/unix/freetype-config.in: Rewritten. Use `pkg-config' to
|
||||||
|
set output variables if program is available.
|
||||||
|
|
||||||
|
* docs/CHANGES, docs/freetype-config.1: Updated.
|
||||||
|
|
||||||
2017-02-04 Werner Lemberg <wl@gnu.org>
|
2017-02-04 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
* builds/unix/unix-def.in (freetype-config): Fix permissions.
|
* builds/unix/unix-def.in (freetype-config): Fix permissions.
|
||||||
|
|
|
@ -12,11 +12,55 @@
|
||||||
LC_ALL=C
|
LC_ALL=C
|
||||||
export LC_ALL
|
export LC_ALL
|
||||||
|
|
||||||
prefix="%prefix%"
|
|
||||||
exec_prefix="%exec_prefix%"
|
# if `pkg-config' is available, use values from `freetype.pc'
|
||||||
exec_prefix_set="no"
|
pkg-config --version >/dev/null 2>&1
|
||||||
includedir="%includedir%"
|
if test $? -eq 0 ; then
|
||||||
libdir="%libdir%"
|
# 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
|
||||||
|
|
||||||
|
prefix=`pkg-config --variable prefix freetype2`
|
||||||
|
exec_prefix=`pkg-config --variable exec_prefix freetype2`
|
||||||
|
|
||||||
|
includedir=`pkg-config --variable includedir freetype2`
|
||||||
|
libdir=`pkg-config --variable libdir freetype2`
|
||||||
|
|
||||||
|
version=`pkg-config --modversion freetype2`
|
||||||
|
|
||||||
|
cflags=`pkg-config --cflags freetype2`
|
||||||
|
dynamic_libs=`pkg-config --libs freetype2`
|
||||||
|
static_libs=`pkg-config --static --libs freetype2`
|
||||||
|
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||"`
|
||||||
|
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
|
@ -39,14 +83,17 @@ Options:
|
||||||
library
|
library
|
||||||
--static make command line options display flags
|
--static make command line options display flags
|
||||||
for static linking
|
for static linking
|
||||||
|
--help display this help and exit
|
||||||
EOF
|
EOF
|
||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if test $# -eq 0 ; then
|
if test $# -eq 0 ; then
|
||||||
usage 1 1>&2
|
usage 1 1>&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
while test $# -gt 0 ; do
|
while test $# -gt 0 ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-*=*)
|
-*=*)
|
||||||
|
@ -74,8 +121,8 @@ while test $# -gt 0 ; do
|
||||||
echo_exec_prefix=yes
|
echo_exec_prefix=yes
|
||||||
;;
|
;;
|
||||||
--version)
|
--version)
|
||||||
echo %ft_version%
|
echo_version=yes
|
||||||
exit 0
|
break
|
||||||
;;
|
;;
|
||||||
--ftversion)
|
--ftversion)
|
||||||
echo_ft_version=yes
|
echo_ft_version=yes
|
||||||
|
@ -92,6 +139,9 @@ while test $# -gt 0 ; do
|
||||||
--static)
|
--static)
|
||||||
show_static=yes
|
show_static=yes
|
||||||
;;
|
;;
|
||||||
|
--help)
|
||||||
|
usage 0
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage 1 1>&2
|
usage 1 1>&2
|
||||||
;;
|
;;
|
||||||
|
@ -99,12 +149,27 @@ while test $# -gt 0 ; do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
if test "$local_prefix" = "yes" ; then
|
if test "$local_prefix" = "yes" ; then
|
||||||
if test "$exec_prefix_set" != "yes" ; then
|
if test "$exec_prefix_set" != "yes" ; then
|
||||||
exec_prefix=$prefix
|
exec_prefix=$prefix
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
if test "$echo_prefix" = "yes" ; then
|
if test "$echo_prefix" = "yes" ; then
|
||||||
echo ${SYSROOT}$prefix
|
echo ${SYSROOT}$prefix
|
||||||
fi
|
fi
|
||||||
|
@ -113,15 +178,6 @@ if test "$echo_exec_prefix" = "yes" ; then
|
||||||
echo ${SYSROOT}$exec_prefix
|
echo ${SYSROOT}$exec_prefix
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$exec_prefix_set" = "yes" ; then
|
|
||||||
libdir=$exec_prefix/lib
|
|
||||||
else
|
|
||||||
if test "$local_prefix" = "yes" ; then
|
|
||||||
includedir=$prefix/include
|
|
||||||
libdir=$prefix/lib
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$echo_ft_version" = "yes" ; then
|
if test "$echo_ft_version" = "yes" ; then
|
||||||
major=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
|
major=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
|
||||||
| grep FREETYPE_MAJOR \
|
| grep FREETYPE_MAJOR \
|
||||||
|
@ -136,26 +192,20 @@ if test "$echo_ft_version" = "yes" ; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$echo_cflags" = "yes" ; then
|
if test "$echo_cflags" = "yes" ; then
|
||||||
echo -I${SYSROOT}$includedir/freetype2
|
echo $cflags | sed "s|$orig_includedir/freetype2|$includedir/freetype2|"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$echo_libs" = "yes" ; then
|
if test "$echo_libs" = "yes" ; then
|
||||||
libs="-lfreetype"
|
|
||||||
staticlibs="%LIBSSTATIC_CONFIG%"
|
|
||||||
if test "$show_static" = "yes" ; then
|
if test "$show_static" = "yes" ; then
|
||||||
libs="$staticlibs"
|
libs="$libs_L $static_libs"
|
||||||
fi
|
|
||||||
if test "${SYSROOT}$libdir" != "/usr/lib" &&
|
|
||||||
test "${SYSROOT}$libdir" != "/usr/lib64"; then
|
|
||||||
echo -L${SYSROOT}$libdir $libs
|
|
||||||
else
|
else
|
||||||
echo $libs
|
libs="$libs_L $dynamic_libs"
|
||||||
fi
|
fi
|
||||||
|
echo $libs | sed "s|$orig_libdir|$libdir|"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$echo_libtool" = "yes" ; then
|
if test "$echo_libtool" = "yes" ; then
|
||||||
convlib="libfreetype.la"
|
echo ${SYSROOT}$libdir/libfreetype.la
|
||||||
echo ${SYSROOT}$libdir/$convlib
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
|
|
@ -47,6 +47,9 @@ CHANGES BETWEEN 2.7.1 and 2.7.2
|
||||||
. Language, encoding, and name IDs have been updated to OpenType
|
. Language, encoding, and name IDs have been updated to OpenType
|
||||||
version 1.8.1.
|
version 1.8.1.
|
||||||
|
|
||||||
|
- The `freetype-config' script is now a wrapper of `pkg-config' if
|
||||||
|
this program is available in the path.
|
||||||
|
|
||||||
|
|
||||||
======================================================================
|
======================================================================
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,14 @@ FreeType library version installed on the system, such as the
|
||||||
installation (directory path) prefix or the FreeType version number.
|
installation (directory path) prefix or the FreeType version number.
|
||||||
.
|
.
|
||||||
.PP
|
.PP
|
||||||
|
If
|
||||||
|
.BR pkg-config (1)
|
||||||
|
is found in the path,
|
||||||
|
.B freetype-config
|
||||||
|
acts as a wrapper for
|
||||||
|
.BR pkg-config .
|
||||||
|
.
|
||||||
|
.PP
|
||||||
This program is part of the FreeType package.
|
This program is part of the FreeType package.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
|
@ -50,7 +58,8 @@ Return the executable prefix value of the installed FreeType library
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-ftversion
|
.B \-\-ftversion
|
||||||
Return the FreeType version number.
|
Return the FreeType version number, directly derived from file
|
||||||
|
`freetype.h'.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-version
|
.B \-\-version
|
||||||
|
@ -72,32 +81,61 @@ Return compiler flags for compiling against the installed FreeType library.
|
||||||
.B \-\-static
|
.B \-\-static
|
||||||
Make command line options display flags for static linking.
|
Make command line options display flags for static linking.
|
||||||
.
|
.
|
||||||
|
.TP
|
||||||
|
.B \-\-help
|
||||||
|
Show help and exit.
|
||||||
|
.
|
||||||
.
|
.
|
||||||
.SS Path override options
|
.SS Path override options
|
||||||
.
|
.
|
||||||
These affect any selected output option, except the libtool version
|
These affect any selected output option, except the libtool version
|
||||||
returned by `--version'.
|
returned by
|
||||||
|
.BR \-\-version .
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
.BI \-\-prefix= PREFIX
|
.BI \-\-prefix= PREFIX
|
||||||
Override `--prefix' value with
|
Override
|
||||||
|
.B \-\-prefix
|
||||||
|
value with
|
||||||
.IR PREFIX .
|
.IR PREFIX .
|
||||||
.
|
.
|
||||||
|
This also sets
|
||||||
|
.BI \-\-exec-prefix= PREFIX
|
||||||
|
if option
|
||||||
|
.B \-\-exec-prefix
|
||||||
|
is not explicitly given.
|
||||||
|
.
|
||||||
.TP
|
.TP
|
||||||
.BI \-\-exec-prefix= EPREFIX
|
.BI \-\-exec-prefix= EPREFIX
|
||||||
Override `--exec-prefix' value with
|
Override
|
||||||
|
.B \-\-exec-prefix
|
||||||
|
value with
|
||||||
.IR EPREFIX .
|
.IR EPREFIX .
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
In case the libraries FreeType links to are located in non-standard
|
In case the libraries FreeType links to are located in non-standard
|
||||||
directories, the output from option
|
directories, and
|
||||||
|
.BR pkg-config (1)
|
||||||
|
is not available, the output from option
|
||||||
.B \-\-libs
|
.B \-\-libs
|
||||||
might be incomplete.
|
might be incomplete.
|
||||||
|
.
|
||||||
It is thus recommended to use the
|
It is thus recommended to use the
|
||||||
.BR pkg-config (1)
|
.BR pkg-config (1)
|
||||||
interface instead, which is able to correctly resolve all dependencies.
|
interface instead, which is able to correctly resolve all dependencies.
|
||||||
.
|
.
|
||||||
|
.PP
|
||||||
|
Setting
|
||||||
|
.B \-\-exec-prefix
|
||||||
|
(either explicitly or implicitly) might return incorrect results if
|
||||||
|
combined with option
|
||||||
|
.BR \-\-static .
|
||||||
|
.
|
||||||
|
The same problem can occur if you set the
|
||||||
|
.B SYSROOT
|
||||||
|
environment variable.
|
||||||
|
.
|
||||||
.
|
.
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
.
|
.
|
||||||
|
|
Loading…
Reference in New Issue