pkgsrc/graphics/freetype2/buildlink2-freetype-config.in
jlam e2afa97f51 Merge changes in packages from the buildlink2 branch that have
buildlink2.mk files back into the main trunk.  This provides sufficient
buildlink2 infrastructure to start merging other packages from the
buildlink2 branch that have already been converted to use the buildlink2
framework.
2002-08-25 18:38:05 +00:00

37 lines
1 KiB
Bash

#!/bin/sh
#
# $NetBSD: buildlink2-freetype-config.in,v 1.2 2002/08/25 18:39:01 jlam Exp $
#
# If FreeType2 is distributed as part of XFree86, then it may be missing a
# freetype-config script that emits the preprocessor and linker flags
# necessary to find the FreeType2 headers and libraries. This script
# provides that functionality within the buildlink2 framework and is used
# by freetype2/buildlink2.mk.
while [ $# -gt 0 ]
do
case "$1" in
-*=*) optarg=`echo "$1" | @SED@ 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*|--prefix|--exec-prefix=*|--exec-prefix)
echo @X11BASE@
;;
--version)
freetype_h=@X11BASE@/include/freetype2/freetype/freetype.h
major=`@AWK@ '/.*#define.*FREETYPE_MAJOR/ { print $3 }' ${freetype_h}`
minor=`@AWK@ '/.*#define.*FREETYPE_MINOR/ { print $3 }' ${freetype_h}`
echo ${major}.${minor}
exit 0
;;
--cflags)
echo -I@X11BASE@/include/freetype2 ${includes}
;;
--libs)
echo -L@X11BASE@/lib -Wl,-R@X11BASE@/lib -lfreetype
;;
esac
shift
done