From 71e208bafe9ca5e1c189fae3f251cc84034e5959 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Mon, 24 Nov 2008 11:01:57 -0800 Subject: 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. --- src/mesa/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa/Makefile') diff --git a/src/mesa/Makefile b/src/mesa/Makefile index ba65ce695f..42a8673f4d 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -92,7 +92,10 @@ pcedit = sed \ -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ - -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' + -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \ + -e 's,@GL_PC_REQ_PRIV@,$(GL_PC_REQ_PRIV),' \ + -e 's,@GL_PC_LIB_PRIV@,$(GL_PC_LIB_PRIV),' \ + -e 's,@GL_PC_CFLAGS@,$(GL_PC_CFLAGS),' gl.pc: gl.pc.in $(pcedit) $< > $@ -- cgit v1.2.3 From 8be02fc8c67433bd2647f59abece5e8111859e40 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Sun, 14 Dec 2008 09:35:29 -0800 Subject: Add OSMesa pkg-config file This makes the GLU .pc file a little simpler, too. --- configs/autoconf.in | 3 ++- configs/default | 3 ++- configure.ac | 9 ++++++--- src/glu/Makefile | 1 - src/glu/glu.pc.in | 2 +- src/mesa/Makefile | 20 +++++++++++++++++--- src/mesa/osmesa.pc.in | 12 ++++++++++++ 7 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 src/mesa/osmesa.pc.in (limited to 'src/mesa/Makefile') diff --git a/configs/autoconf.in b/configs/autoconf.in index afd9f6a0c7..4a89716ab6 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -113,7 +113,6 @@ 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@ @@ -122,3 +121,5 @@ 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@ +OSMESA_PC_REQ = @OSMESA_PC_REQ@ +OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@ diff --git a/configs/default b/configs/default index 52ad61cb92..7b79cf2c1b 100644 --- a/configs/default +++ b/configs/default @@ -107,7 +107,6 @@ 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 = @@ -116,3 +115,5 @@ GLUT_PC_CFLAGS = GLW_PC_REQ_PRIV = GLW_PC_LIB_PRIV = GLW_PC_CFLAGS = +OSMESA_PC_REQ = +OSMESA_PC_LIB_PRIV = diff --git a/configure.ac b/configure.ac index 8026d9dca1..97cb298d39 100644 --- a/configure.ac +++ b/configure.ac @@ -801,6 +801,7 @@ osmesa) OSMESA_LIB_DEPS="" fi OSMESA_MESA_DEPS="" + OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS" ;; *) # Link OSMesa to libGL otherwise @@ -811,13 +812,17 @@ osmesa) else OSMESA_MESA_DEPS="" fi + OSMESA_PC_REQ="gl" ;; esac if test "$enable_static" = no; then OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS $OS_LIBS" fi +OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV $OS_LIBS" AC_SUBST([OSMESA_LIB_DEPS]) AC_SUBST([OSMESA_MESA_DEPS]) +AC_SUBST([OSMESA_PC_REQ]) +AC_SUBST([OSMESA_PC_LIB_PRIV]) dnl dnl GLU configuration @@ -840,8 +845,7 @@ 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)' + GLU_PC_REQ="osmesa" if test "$enable_static" = no; then GLU_MESA_DEPS='-l$(OSMESA_LIB)' else @@ -871,7 +875,6 @@ 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]) diff --git a/src/glu/Makefile b/src/glu/Makefile index 4351d23599..e519dfeec4 100644 --- a/src/glu/Makefile +++ b/src/glu/Makefile @@ -21,7 +21,6 @@ pcedit = sed \ -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \ -e 's,@GLU_PC_REQ@,$(GLU_PC_REQ),' \ -e 's,@GLU_PC_REQ_PRIV@,$(GLU_PC_REQ_PRIV),' \ - -e 's,@GLU_PC_LIB@,$(GLU_PC_LIB),' \ -e 's,@GLU_PC_LIB_PRIV@,$(GLU_PC_LIB_PRIV),' \ -e 's,@GLU_PC_CFLAGS@,$(GLU_PC_CFLAGS),' glu.pc: glu.pc.in diff --git a/src/glu/glu.pc.in b/src/glu/glu.pc.in index 2c9bd955b8..bc2517e90e 100644 --- a/src/glu/glu.pc.in +++ b/src/glu/glu.pc.in @@ -8,6 +8,6 @@ Description: Mesa OpenGL Utility library Requires: @GLU_PC_REQ@ Requires.private: @GLU_PC_REQ_PRIV@ Version: @VERSION@ -Libs: -L${libdir} -lGLU @GLU_PC_LIB@ +Libs: -L${libdir} -lGLU Libs.private: @GLU_PC_LIB_PRIV@ Cflags: -I${includedir} @GLU_PC_CFLAGS@ diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 42a8673f4d..6b4057030e 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -88,7 +88,7 @@ install: default done -pcedit = sed \ +gl_pcedit = sed \ -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ @@ -98,7 +98,19 @@ pcedit = sed \ -e 's,@GL_PC_CFLAGS@,$(GL_PC_CFLAGS),' gl.pc: gl.pc.in - $(pcedit) $< > $@ + $(gl_pcedit) $< > $@ + +osmesa_pcedit = sed \ + -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ + -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ + -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ + -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \ + -e 's,@OSMESA_LIB@,$(OSMESA_LIB),' \ + -e 's,@OSMESA_PC_REQ@,$(OSMESA_PC_REQ),' \ + -e 's,@OSMESA_PC_LIB_PRIV@,$(OSMESA_PC_LIB_PRIV),' + +osmesa.pc: osmesa.pc.in + $(osmesa_pcedit) $< > $@ install-headers: $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL @@ -112,10 +124,12 @@ install-libgl: default gl.pc install-headers $(DESTDIR)$(INSTALL_LIB_DIR) $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig -install-osmesa: default +install-osmesa: default osmesa.pc $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig $(INSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_GLOB) \ $(DESTDIR)$(INSTALL_LIB_DIR) + $(INSTALL) -m 644 osmesa.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig install-dri: default cd drivers/dri && $(MAKE) install diff --git a/src/mesa/osmesa.pc.in b/src/mesa/osmesa.pc.in new file mode 100644 index 0000000000..05327f40aa --- /dev/null +++ b/src/mesa/osmesa.pc.in @@ -0,0 +1,12 @@ +prefix=@INSTALL_DIR@ +exec_prefix=${prefix} +libdir=@INSTALL_LIB_DIR@ +includedir=@INSTALL_INC_DIR@ + +Name: osmesa +Description: Mesa Off-screen Rendering library +Requires: @OSMESA_PC_REQ@ +Version: @VERSION@ +Libs: -L${libdir} -l@OSMESA_LIB@ +Libs.private: @OSMESA_PC_LIB_PRIV@ +Cflags: -I${includedir} -- cgit v1.2.3