Hi,

This is a preventive maintenance patch to fix a dormant bug. It is
intended for the git master branch.
The xorg-server macro  XORG_DRIVER_CHECK_EXT() uses the hard-coded
executable name "pkg-config" (without a path) rather than the variable
PKG_CONFIG which is defined during configuration:


        checking for pkg-config... /usr/bin/pkg-config
        checking pkg-config is at least version 0.9.0... yes
        

The user is invited to overwrite the value of PKG_CONFIG if need be.
This feature will only work if all invocation of this program is done
through PKG_CONFIG variable. All driver modules use this macro. Output
of ./configure --help:


        Some influential environment variables:
        ...
        PKG_CONFIG  path to pkg-config utility


For reference:
========

This is the code that gets executed when the macro is expanded (example
using from driver/acecad):


        # Checks for extensions
        
        
                SAVE_CFLAGS="$CFLAGS"
                CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
                cat >conftest.$ac_ext <<_ACEOF
        /* confdefs.h.  */
        _ACEOF
        cat confdefs.h >>conftest.$ac_ext
        cat >>conftest.$ac_ext <<_ACEOF
        /* end confdefs.h.  */
        
        #include "xorg-server.h"
        #if !defined RANDR
        #error RANDR not defined
        #endif
        
        int
        main ()
        {
        
          ;
          return 0;
        }
        _ACEOF


And the result of the test for RANDR is:


        configure:12628: checking if RANDR is defined
        configure:12630: result: yes





>From bf079fa4dc34102bec3b198d63d1fa3e1bc05d59 Mon Sep 17 00:00:00 2001
From: Gaetan Nadon <[email protected]>
Date: Sun, 20 Dec 2009 13:13:57 -0500
Subject: [PATCH] macros: use PKG_CONFIG variable rather than executable name

User can defined alternate location for pkg-config.
Once option in place, all instances of pkg-config must be converted.

Signed-off-by: Gaetan Nadon <[email protected]>
---
 xorg-server.m4 |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xorg-server.m4 b/xorg-server.m4
index 2d16438..bdecf62 100644
--- a/xorg-server.m4
+++ b/xorg-server.m4
@@ -29,8 +29,9 @@ dnl
 # is defined, then add $1 to $REQUIRED_MODULES.
 
 AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
+	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 	SAVE_CFLAGS="$CFLAGS"
-	CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
+	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
 	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include "xorg-server.h"
 #if !defined $1
-- 
1.6.0.4

_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to