[PATCH] xft-config via pkg-config

Enrico Weigelt weigelt at metux.de
Mon Oct 3 15:06:24 PDT 2005


Hi folks,


I've hacked up xft-config to be now just a wrapper around 
pkg-config. So it's no longer necessary to generate it.

The patch is against libXft-2.1.7.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service
  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact at metux.de
---------------------------------------------------------------------
  Realtime Forex/Stock Exchange trading powered by postgresSQL :))
                                            http://www.fxignal.net/
---------------------------------------------------------------------
-------------- next part --------------
diff -ruN libXft-2.1.7.orig/xft-config.in libXft-2.1.7/xft-config.in
--- libXft-2.1.7.orig/xft-config.in	Wed Sep  3 23:21:46 2003
+++ libXft-2.1.7/xft-config.in	Mon Oct  3 23:46:42 2005
@@ -1,24 +1,27 @@
 #! /bin/sh
 
-prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-libdir="@libdir@"
-includedir="@includedir@"
-version="@VERSION@"
-freetypelibs="@FREETYPE_LIBS@"
-freetypecflags="@FREETYPE_CFLAGS@"
-fontconfiglibs="@FONTCONFIG_LIBS@"
-fontconfigcflags="@FONTCONFIG_CFLAGS@"
-xrenderlibs="@XRENDER_LIBS@"
-xrendercflags="@XRENDER_CFLAGS@"
+PACKAGE="xft"
+
+if [ ! "$PKG_CONFIG" ]; then
+    PKG_CONFIG=pkg-config
+fi
+
+if [ ! "$PKG_CONFIG_PATH" ]; then
+    PKG_CONFIG_PATH="$SYSROOT/usr/lib/pkgconfig/"
+fi
+
+export PKG_CONFIG_PATH
+export SYSROOT
 
 usage()
 {
   cat <<EOF
-Usage: xft-config [OPTIONS] [LIBRARIES]
+Usage: $0 [OPTIONS] [LIBRARIES]
 Options:
  [--prefix[=DIR]]
  [--exec-prefix[=DIR]]
+ [--prefix]
+ [--exec-prefix]
  [--version]
  [--libs]
  [--cflags]
@@ -38,29 +41,27 @@
 
   case $1 in
   --prefix=*)
-    prefix=$optarg
-    local_prefix=yes
+    PRE_PARAMS="$PRE_PARAMS --define-variable=prefix=$optarg"
     ;;
   --prefix)
-    echo_prefix=yes
+    PARAMS="$PARAMS --variable=prefix"
     ;;
   --exec-prefix=*)
-    exec_prefix=$optarg
-    exec_prefix_set=yes
-    local_prefix=yes
+    PRE_PARAMS="$PRE_PARAMS --define-variable=exec_prefix=$optarg"
     ;;
   --exec-prefix)
-    echo_exec_prefix=yes
+    PARAMS="$PARAMS --variable=exec_prefix"
     ;;
   --version)
-    echo $version
+    $PKG_CONFIG --modversion $PACKAGE
     exit 0
     ;;
   --cflags)
-    echo_cflags=yes
+    PARAMS="$PARAMS --cflags"
     ;;
   --libs)
-    echo_libs=yes
+    PARAMS="$PARAMS --libs"
+    OUTPUT_ADD="-lXft -lX11"
     ;;
   *)
     usage 1 1>&2
@@ -69,32 +70,5 @@
   shift
 done
 
-if test "$local_prefix" = "yes" ; then
-    if test "$exec_prefix_set" != "yes" ; then
-      exec_prefix=$prefix
-    fi
-fi
-
-if test "$echo_prefix" = "yes" ; then
- echo $prefix
-fi
-
-if test "$echo_exec_prefix" = "yes" ; then
- echo $exec_prefix
-fi
-
-if test "$echo_cflags" = "yes" ; then
- cflags="-I${includedir} ${freetypecflags} ${fontconfigcflags} ${xrendercflags}"
- echo $cflags
-fi
-
-if test "$echo_libs" = "yes" ; then
- libs="-lXft -lX11 ${freetypelibs} ${fontconfiglibs} ${xrenderlibs}"
- if test "${libdir}" != "/usr/lib" ; then
-  echo -L${libdir} $libs
- else
-  echo $libs
- fi
-fi
-
-# EOF
+OUT=`$PKG_CONFIG $PRE_PARAMS $PARAMS $PACKAGE | sed -e 's/\n//g;'`
+echo "$OUT $OUTPUT_ADD"


More information about the xorg-modular mailing list