Mesa (gallium-0.2): Add more package metadata to the pkg-config files
Alan Hourihane
alanh at kemper.freedesktop.org
Mon Dec 15 11:16:59 UTC 2008
Module: Mesa
Branch: gallium-0.2
Commit: 71e208bafe9ca5e1c189fae3f251cc84034e5959
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=71e208bafe9ca5e1c189fae3f251cc84034e5959
Author: Dan Nicholson <dbn.lists at gmail.com>
Date: Mon Nov 24 11:01:57 2008 -0800
Add more package metadata to the pkg-config files
The pkg-config files have been filled in more thoroughly to allow users
to use mesa more effectively. By adding metadata to Requires.private,
Libs.private and Cflags, we can ensure that all the libraries and
headers will be found in all situations. However, the full substitutions
are only done when using the configure script.
This also fixes the glu pkg-config file to account for using GL or
OSMesa.
Fixes bug 18161.
---
configs/autoconf.in | 17 ++++++++++++++++
configs/default | 16 +++++++++++++++
configure.ac | 41 ++++++++++++++++++++++++++++++++++++++++
src/glu/Makefile | 7 +++++-
src/glu/glu.pc.in | 8 ++++--
src/glut/glx/Makefile | 5 +++-
src/glut/glx/glut.pc.in | 4 ++-
src/glut/mini/Makefile | 5 +++-
src/glut/mini/glut.pc.in | 4 ++-
src/glw/Makefile | 5 +++-
src/glw/glw.pc.in | 4 ++-
src/mesa/Makefile | 5 +++-
src/mesa/drivers/dri/Makefile | 3 +-
src/mesa/drivers/dri/dri.pc.in | 1 +
src/mesa/gl.pc.in | 5 ++-
15 files changed, 116 insertions(+), 14 deletions(-)
diff --git a/configs/autoconf.in b/configs/autoconf.in
index a3eaed5..afd9f6a 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -105,3 +105,20 @@ DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
+
+# pkg-config substitutions
+GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
+GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
+GL_PC_CFLAGS = @GL_PC_CFLAGS@
+DRI_PC_REQ_PRIV = @DRI_PC_REQ_PRIV@
+GLU_PC_REQ = @GLU_PC_REQ@
+GLU_PC_REQ_PRIV = @GLU_PC_REQ_PRIV@
+GLU_PC_LIB = @GLU_PC_LIB@
+GLU_PC_LIB_PRIV = @GLU_PC_LIB_PRIV@
+GLU_PC_CFLAGS = @GLU_PC_CFLAGS@
+GLUT_PC_REQ_PRIV = @GLUT_PC_REQ_PRIV@
+GLUT_PC_LIB_PRIV = @GLUT_PC_LIB_PRIV@
+GLUT_PC_CFLAGS = @GLUT_PC_CFLAGS@
+GLW_PC_REQ_PRIV = @GLW_PC_REQ_PRIV@
+GLW_PC_LIB_PRIV = @GLW_PC_LIB_PRIV@
+GLW_PC_CFLAGS = @GLW_PC_CFLAGS@
diff --git a/configs/default b/configs/default
index 21fa0d7..52ad61c 100644
--- a/configs/default
+++ b/configs/default
@@ -100,3 +100,19 @@ DRI_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/dri
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
+# pkg-config substitutions
+GL_PC_REQ_PRIV =
+GL_PC_LIB_PRIV =
+GL_PC_CFLAGS =
+DRI_PC_REQ_PRIV =
+GLU_PC_REQ = gl
+GLU_PC_REQ_PRIV =
+GLU_PC_LIB =
+GLU_PC_LIB_PRIV =
+GLU_PC_CFLAGS =
+GLUT_PC_REQ_PRIV =
+GLUT_PC_LIB_PRIV =
+GLUT_PC_CFLAGS =
+GLW_PC_REQ_PRIV =
+GLW_PC_LIB_PRIV =
+GLW_PC_CFLAGS =
diff --git a/configure.ac b/configure.ac
index 66e080e..8026d9d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -507,14 +507,18 @@ case "$mesa_driver" in
xlib)
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([XLIBGL], [x11 xext])
+ GL_PC_REQ_PRIV="x11 xext"
X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
GL_LIB_DEPS="$XLIBGL_LIBS"
else
# should check these...
X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
+ GL_PC_LIB_PRIV="$GL_LIB_DEPS"
+ GL_PC_CFLAGS="$X11_INCLUDES"
fi
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $OS_LIBS"
+ GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread $OS_LIBS"
# if static, move the external libraries to the programs
# and empty the libraries for libGL
@@ -532,6 +536,8 @@ dri)
# Check for libdrm
PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
+ GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
+ DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
# find the DRI deps for libGL
if test "$x11_pkgconfig" = yes; then
@@ -542,16 +548,20 @@ dri)
fi
PKG_CHECK_MODULES([DRIGL], [$dri_modules])
+ GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
GL_LIB_DEPS="$DRIGL_LIBS"
else
# should check these...
X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
+ GL_PC_LIB_PRIV="$GL_LIB_DEPS"
+ GL_PC_CFLAGS="$X11_INCLUDES"
# XCB can only be used from pkg-config
if test "$enable_xcb" = yes; then
PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
+ GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
fi
@@ -559,6 +569,7 @@ dri)
# need DRM libs, -lpthread, etc.
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS $OS_LIBS"
+ GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS $OS_LIBS"
;;
osmesa)
# No libGL for osmesa
@@ -566,6 +577,10 @@ osmesa)
;;
esac
AC_SUBST([GL_LIB_DEPS])
+AC_SUBST([GL_PC_REQ_PRIV])
+AC_SUBST([GL_PC_LIB_PRIV])
+AC_SUBST([GL_PC_CFLAGS])
+AC_SUBST([DRI_PC_REQ_PRIV])
dnl
dnl More X11 setup
@@ -825,6 +840,8 @@ if test "x$enable_glu" = xyes; then
# Link libGLU to libOSMesa instead of libGL
GLU_LIB_DEPS=""
+ GLU_PC_LIB='-L$(INSTALL_LIB_DIR) -l$(OSMESA_LIB)'
+ GLU_PC_CFLAGS='-I$(INSTALL_INC_DIR)'
if test "$enable_static" = no; then
GLU_MESA_DEPS='-l$(OSMESA_LIB)'
else
@@ -833,6 +850,8 @@ if test "x$enable_glu" = xyes; then
;;
*)
# If static, empty GLU_LIB_DEPS and add libs for programs to link
+ GLU_PC_REQ="gl"
+ GLU_PC_LIB_PRIV="-lm"
if test "$enable_static" = no; then
GLU_LIB_DEPS="-lm"
GLU_MESA_DEPS='-l$(GL_LIB)'
@@ -847,8 +866,14 @@ fi
if test "$enable_static" = no; then
GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
fi
+GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
AC_SUBST([GLU_LIB_DEPS])
AC_SUBST([GLU_MESA_DEPS])
+AC_SUBST([GLU_PC_REQ])
+AC_SUBST([GLU_PC_REQ_PRIV])
+AC_SUBST([GLU_PC_LIB])
+AC_SUBST([GLU_PC_LIB_PRIV])
+AC_SUBST([GLU_PC_CFLAGS])
dnl
dnl GLw configuration
@@ -873,10 +898,13 @@ if test "x$enable_glw" = xyes; then
SRC_DIRS="$SRC_DIRS glw"
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([GLW],[x11 xt])
+ GLW_PC_REQ_PRIV="x11 xt"
GLW_LIB_DEPS="$GLW_LIBS"
else
# should check these...
GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
+ GLW_PC_LIB_PRIV="$GLW_LIB_DEPS"
+ GLW_PC_CFLAGS="$X11_INCLUDES"
fi
GLW_SOURCES="GLwDrawA.c"
@@ -895,9 +923,12 @@ if test "x$enable_glw" = xyes; then
fi
# MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
+ GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
+ GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
fi
# If static, empty GLW_LIB_DEPS and add libs for programs to link
+ GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV $OS_LIBS"
if test "$enable_static" = no; then
GLW_MESA_DEPS='-l$(GL_LIB)'
GLW_LIB_DEPS="$GLW_LIB_DEPS $OS_LIBS"
@@ -911,6 +942,9 @@ AC_SUBST([GLW_LIB_DEPS])
AC_SUBST([GLW_MESA_DEPS])
AC_SUBST([GLW_SOURCES])
AC_SUBST([MOTIF_CFLAGS])
+AC_SUBST([GLW_PC_REQ_PRIV])
+AC_SUBST([GLW_PC_LIB_PRIV])
+AC_SUBST([GLW_PC_CFLAGS])
dnl
dnl GLUT configuration
@@ -945,12 +979,16 @@ if test "x$enable_glut" = xyes; then
fi
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
+ GLUT_PC_REQ_PRIV="x11 xmu xi"
GLUT_LIB_DEPS="$GLUT_LIBS"
else
# should check these...
GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
+ GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
+ GLUT_PC_CFLAGS="$X11_INCLUDES"
fi
GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm $OS_LIBS"
+ GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm $OS_LIBS"
# If glut is available, we can build most programs
if test "$with_demos" = yes; then
@@ -969,6 +1007,9 @@ fi
AC_SUBST([GLUT_LIB_DEPS])
AC_SUBST([GLUT_MESA_DEPS])
AC_SUBST([GLUT_CFLAGS])
+AC_SUBST([GLUT_PC_REQ_PRIV])
+AC_SUBST([GLUT_PC_LIB_PRIV])
+AC_SUBST([GLUT_PC_CFLAGS])
dnl
dnl Program library dependencies
diff --git a/src/glu/Makefile b/src/glu/Makefile
index b025a90..4351d23 100644
--- a/src/glu/Makefile
+++ b/src/glu/Makefile
@@ -18,7 +18,12 @@ pcedit = sed \
-e 's, at INSTALL_DIR@,$(INSTALL_DIR),' \
-e 's, at INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-e 's, at INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
- -e 's, at VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),'
+ -e 's, at VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
+ -e 's, at GLU_PC_REQ@,$(GLU_PC_REQ),' \
+ -e 's, at GLU_PC_REQ_PRIV@,$(GLU_PC_REQ_PRIV),' \
+ -e 's, at GLU_PC_LIB@,$(GLU_PC_LIB),' \
+ -e 's, at GLU_PC_LIB_PRIV@,$(GLU_PC_LIB_PRIV),' \
+ -e 's, at GLU_PC_CFLAGS@,$(GLU_PC_CFLAGS),'
glu.pc: glu.pc.in
$(pcedit) $< > $@
diff --git a/src/glu/glu.pc.in b/src/glu/glu.pc.in
index 8606b9b..2c9bd95 100644
--- a/src/glu/glu.pc.in
+++ b/src/glu/glu.pc.in
@@ -5,7 +5,9 @@ includedir=@INSTALL_INC_DIR@
Name: glu
Description: Mesa OpenGL Utility library
-Requires: gl
+Requires: @GLU_PC_REQ@
+Requires.private: @GLU_PC_REQ_PRIV@
Version: @VERSION@
-Libs: -L${libdir} -lGLU
-Cflags: -I${includedir}
+Libs: -L${libdir} -lGLU @GLU_PC_LIB@
+Libs.private: @GLU_PC_LIB_PRIV@
+Cflags: -I${includedir} @GLU_PC_CFLAGS@
diff --git a/src/glut/glx/Makefile b/src/glut/glx/Makefile
index 7f886f7..c8f0097 100644
--- a/src/glut/glx/Makefile
+++ b/src/glut/glx/Makefile
@@ -103,7 +103,10 @@ pcedit = sed \
-e 's, at INSTALL_DIR@,$(INSTALL_DIR),' \
-e 's, at INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-e 's, at INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
- -e 's, at VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),'
+ -e 's, at VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),' \
+ -e 's, at GLUT_PC_REQ_PRIV@,$(GLUT_PC_REQ_PRIV),' \
+ -e 's, at GLUT_PC_LIB_PRIV@,$(GLUT_PC_LIB_PRIV),' \
+ -e 's, at GLUT_PC_CFLAGS@,$(GLUT_PC_CFLAGS),'
glut.pc: glut.pc.in
$(pcedit) $< > $@
diff --git a/src/glut/glx/glut.pc.in b/src/glut/glx/glut.pc.in
index e8638fe..ae0689d 100644
--- a/src/glut/glx/glut.pc.in
+++ b/src/glut/glx/glut.pc.in
@@ -6,6 +6,8 @@ includedir=@INSTALL_INC_DIR@
Name: glut
Description: Mesa OpenGL Utility Toolkit library
Requires: gl glu
+Requires.private: @GLUT_PC_REQ_PRIV@
Version: @VERSION@
Libs: -L${libdir} -lglut
-Cflags: -I${includedir}
+Libs.private: @GLUT_PC_LIB_PRIV@
+Cflags: -I${includedir} @GLUT_PC_CFLAGS@
diff --git a/src/glut/mini/Makefile b/src/glut/mini/Makefile
index e47d09e..112a250 100644
--- a/src/glut/mini/Makefile
+++ b/src/glut/mini/Makefile
@@ -77,7 +77,10 @@ pcedit = sed \
-e 's, at INSTALL_DIR@,$(INSTALL_DIR),' \
-e 's, at INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-e 's, at INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
- -e 's, at VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),'
+ -e 's, at VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),' \
+ -e 's, at GLUT_PC_REQ_PRIV@,$(GLUT_PC_REQ_PRIV),' \
+ -e 's, at GLUT_PC_LIB_PRIV@,$(GLUT_PC_LIB_PRIV),' \
+ -e 's, at GLUT_PC_CFLAGS@,$(GLUT_PC_CFLAGS),'
glut.pc: glut.pc.in
$(pcedit) $< > $@
diff --git a/src/glut/mini/glut.pc.in b/src/glut/mini/glut.pc.in
index e8638fe..ae0689d 100644
--- a/src/glut/mini/glut.pc.in
+++ b/src/glut/mini/glut.pc.in
@@ -6,6 +6,8 @@ includedir=@INSTALL_INC_DIR@
Name: glut
Description: Mesa OpenGL Utility Toolkit library
Requires: gl glu
+Requires.private: @GLUT_PC_REQ_PRIV@
Version: @VERSION@
Libs: -L${libdir} -lglut
-Cflags: -I${includedir}
+Libs.private: @GLUT_PC_LIB_PRIV@
+Cflags: -I${includedir} @GLUT_PC_CFLAGS@
diff --git a/src/glw/Makefile b/src/glw/Makefile
index 753c4b7..cf412b2 100644
--- a/src/glw/Makefile
+++ b/src/glw/Makefile
@@ -30,7 +30,10 @@ pcedit = sed \
-e 's, at INSTALL_DIR@,$(INSTALL_DIR),' \
-e 's, at INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-e 's, at INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
- -e 's, at VERSION@,$(MAJOR).$(MINOR).$(TINY),'
+ -e 's, at VERSION@,$(MAJOR).$(MINOR).$(TINY),' \
+ -e 's, at GLW_PC_REQ_PRIV@,$(GLW_PC_REQ_PRIV),' \
+ -e 's, at GLW_PC_LIB_PRIV@,$(GLW_PC_LIB_PRIV),' \
+ -e 's, at GLW_PC_CFLAGS@,$(GLW_PC_CFLAGS),'
glw.pc: glw.pc.in
$(pcedit) $< > $@
diff --git a/src/glw/glw.pc.in b/src/glw/glw.pc.in
index 25f3f73..5493093 100644
--- a/src/glw/glw.pc.in
+++ b/src/glw/glw.pc.in
@@ -6,6 +6,8 @@ includedir=@INSTALL_INC_DIR@
Name: glw
Description: Mesa OpenGL widget library
Requires: gl
+Requires.private: @GLW_PC_REQ_PRIV@
Version: @VERSION@
Libs: -L${libdir} -lGLw
-Cflags: -I${includedir}
+Libs.private: @GLW_PC_LIB_PRIV@
+Cflags: -I${includedir} @GLW_PC_CFLAGS@
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index ba65ce6..42a8673 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -92,7 +92,10 @@ pcedit = sed \
-e 's, at INSTALL_DIR@,$(INSTALL_DIR),' \
-e 's, at INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-e 's, at INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
- -e 's, at VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),'
+ -e 's, at VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
+ -e 's, at GL_PC_REQ_PRIV@,$(GL_PC_REQ_PRIV),' \
+ -e 's, at GL_PC_LIB_PRIV@,$(GL_PC_LIB_PRIV),' \
+ -e 's, at GL_PC_CFLAGS@,$(GL_PC_CFLAGS),'
gl.pc: gl.pc.in
$(pcedit) $< > $@
diff --git a/src/mesa/drivers/dri/Makefile b/src/mesa/drivers/dri/Makefile
index eef6882..9e49fb1 100644
--- a/src/mesa/drivers/dri/Makefile
+++ b/src/mesa/drivers/dri/Makefile
@@ -25,7 +25,8 @@ pcedit = sed \
-e 's, at INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-e 's, at INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
-e 's, at VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
- -e 's, at DRI_DRIVER_DIR@,$(DRI_DRIVER_SEARCH_DIR),'
+ -e 's, at DRI_DRIVER_DIR@,$(DRI_DRIVER_SEARCH_DIR),' \
+ -e 's, at DRI_PC_REQ_PRIV@,$(DRI_PC_REQ_PRIV),'
dri.pc: dri.pc.in
$(pcedit) $< > $@
diff --git a/src/mesa/drivers/dri/dri.pc.in b/src/mesa/drivers/dri/dri.pc.in
index c47ee9c..695aa6c 100644
--- a/src/mesa/drivers/dri/dri.pc.in
+++ b/src/mesa/drivers/dri/dri.pc.in
@@ -7,4 +7,5 @@ dridriverdir=@DRI_DRIVER_DIR@
Name: dri
Description: Direct Rendering Infrastructure
Version: @VERSION@
+Requires.private: @DRI_PC_REQ_PRIV@
Cflags: -I${includedir}
diff --git a/src/mesa/gl.pc.in b/src/mesa/gl.pc.in
index 1927880..0462b9f 100644
--- a/src/mesa/gl.pc.in
+++ b/src/mesa/gl.pc.in
@@ -5,7 +5,8 @@ includedir=@INSTALL_INC_DIR@
Name: gl
Description: Mesa OpenGL library
-Requires:
+Requires.private: @GL_PC_REQ_PRIV@
Version: @VERSION@
Libs: -L${libdir} -lGL
-Cflags: -I${includedir}
+Libs.private: @GL_PC_LIB_PRIV@
+Cflags: -I${includedir} @GL_PC_CFLAGS@
More information about the mesa-commit
mailing list