diff options
-rw-r--r-- | graphics/freetype2/buildlink-freetype-config.in | 37 | ||||
-rw-r--r-- | graphics/freetype2/buildlink.mk | 30 |
2 files changed, 61 insertions, 6 deletions
diff --git a/graphics/freetype2/buildlink-freetype-config.in b/graphics/freetype2/buildlink-freetype-config.in new file mode 100644 index 00000000000..a65baa2d715 --- /dev/null +++ b/graphics/freetype2/buildlink-freetype-config.in @@ -0,0 +1,37 @@ +#!/bin/sh +# +# $NetBSD: buildlink-freetype-config.in,v 1.1 2001/07/13 08:18:29 jlam Exp $ +# +# If FreeType2 is distributed as part of XFree86, then it's 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 buildlink framework and is used +# by freetype2/buildlink.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@BUILDLINK_DIR@/include/freetype2 ${includes} + ;; + --libs) + echo -L@BUILDLINK_DIR@/lib -lfreetype + ;; + esac + shift +done diff --git a/graphics/freetype2/buildlink.mk b/graphics/freetype2/buildlink.mk index 5836d7ea83e..91be591def8 100644 --- a/graphics/freetype2/buildlink.mk +++ b/graphics/freetype2/buildlink.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink.mk,v 1.6 2001/07/02 14:16:54 jlam Exp $ +# $NetBSD: buildlink.mk,v 1.7 2001/07/13 08:18:29 jlam Exp $ # # This Makefile fragment is included by packages that use freetype2. # @@ -52,19 +52,37 @@ BUILDLINK_TARGETS+= ${BUILDLINK_TARGETS.freetype2} BUILDLINK_TARGETS.freetype2= freetype2-buildlink .if ${_NEED_FREETYPE2} == "YES" -BUILDLINK_TARGETS.freetype2+= freetype2-buildlink-config-wrapper - +BUILDLINK_TARGETS.freetype2+= freetype2-buildlink-config-wrapper BUILDLINK_CONFIG.freetype2= ${LOCALBASE}/bin/freetype-config BUILDLINK_CONFIG_WRAPPER.freetype2= ${BUILDLINK_DIR}/bin/freetype-config +freetype2-buildlink-config-wrapper: _BUILDLINK_CONFIG_WRAPPER_USE + +.else +BUILDLINK_TARGETS.freetype2+= freetype2-buildlink-config +BUILDLINK_CONFIG.freetype2= ${BUILDLINK_DIR}/bin/freetype-config +BUILDLINK_CONFIG_WRAPPER.freetype2= ${BUILDLINK_CONFIG.freetype2} + +freetype2-buildlink-config: + ${_PKG_SILENT}${_PKG_DEBUG} \ + if [ ! -f ${BUILDLINK_CONFIG.freetype2} ]; then \ + ${ECHO_MSG} "Creating config script ${BUILDLINK_CONFIG.freetype2}."; \ + ${MKDIR} ${BUILDLINK_CONFIG.freetype2:H}; \ + ${SED} -e "s|@AWK@|${AWK}|g" \ + -e "s|@SED@|${SED}|g" \ + -e "s|@X11BASE@|${X11BASE}|g" \ + -e "s|@BUILDLINK_DIR@|${BUILDLINK_DIR}|g" \ + ${.CURDIR}/../../graphics/freetype2/buildlink-freetype-config.in \ + > ${BUILDLINK_CONFIG.freetype2}; \ + ${CHMOD} +x ${BUILDLINK_CONFIG.freetype2}; \ + fi +.endif # _NEED_FREETYPE2 + .if defined(USE_CONFIG_WRAPPER) && defined(GNU_CONFIGURE) FREETYPE_CONFIG?= ${BUILDLINK_CONFIG_WRAPPER.freetype2} CONFIGURE_ENV+= FREETYPE_CONFIG="${FREETYPE_CONFIG}" .endif -freetype2-buildlink-config-wrapper: _BUILDLINK_CONFIG_WRAPPER_USE -.endif # _NEED_FREETYPE2 - pre-configure: ${BUILDLINK_TARGETS.freetype2} freetype2-buildlink: _BUILDLINK_USE |