pkg-config support
authorDan Nicholson <dbn.lists@gmail.com>
Wed, 12 Sep 2007 16:03:05 +0000 (10:03 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Wed, 12 Sep 2007 16:03:05 +0000 (10:03 -0600)
.gitignore
src/glu/Makefile
src/glu/glu.pc.in [new file with mode: 0644]
src/glut/glx/Makefile
src/glut/glx/glut.pc.in [new file with mode: 0644]
src/glw/Makefile
src/glw/glw.pc.in [new file with mode: 0644]
src/mesa/Makefile
src/mesa/gl.pc.in [new file with mode: 0644]

index 033e6e10bdea49f660a9cc6ef31dda07fec1edcc..c128ba86092652e5ba4ac00fcfef6a56301df8c4 100644 (file)
@@ -2,6 +2,7 @@
 *.o
 *.so
 *.sw[a-z]
+*.pc
 *~
 depend
 depend.bak
index b8c55db6d0aeab15bf766d559f94cfd814c00195..836baa684cb730e16a822938baded5d84bcf8c60 100644 (file)
@@ -13,9 +13,19 @@ default: $(TOP)/configs/current
                (cd $$dir ; $(MAKE)) ; \
        done
 
-install:
+# GLU pkg-config file
+pcedit = sed \
+       -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
+       -e 's,@LIB_DIR@,$(LIB_DIR),' \
+       -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),'
+glu.pc: glu.pc.in
+       $(pcedit) $< > $@
+
+install: glu.pc
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+       $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
        $(INSTALL) $(TOP)/$(LIB_DIR)/libGLU.* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+       $(INSTALL) -m 644 glu.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
 
 clean:
        @for dir in $(SUBDIRS) ; do \
diff --git a/src/glu/glu.pc.in b/src/glu/glu.pc.in
new file mode 100644 (file)
index 0000000..5d6e52a
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@INSTALL_DIR@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/@LIB_DIR@
+includedir=${prefix}/include
+
+Name: glu
+Description: Mesa OpenGL Utility library
+Requires: gl
+Version: @VERSION@
+Libs: -L${libdir} -lGLU
+Cflags: -I${includedir}
index b236c6fad3524ef7f2bf3801d281712568dbc4a5..5a224c9af59e907431c8243bc91d610788f7f38b 100644 (file)
@@ -96,11 +96,21 @@ $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
                $(GLUT_LIB_DEPS) $(OBJECTS)
 
 
-install:
+# glut pkgconfig file
+pcedit = sed \
+       -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
+       -e 's,@LIB_DIR@,$(LIB_DIR),' \
+       -e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),'
+glut.pc: glut.pc.in
+       $(pcedit) $< > $@
+
+install: glut.pc
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+       $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
        $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_DIR)/include/GL
        $(INSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+       $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
 
 
 clean:
diff --git a/src/glut/glx/glut.pc.in b/src/glut/glx/glut.pc.in
new file mode 100644 (file)
index 0000000..f732f29
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@INSTALL_DIR@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/@LIB_DIR@
+includedir=${prefix}/include
+
+Name: glut
+Description: Mesa OpenGL Utility Toolkit library
+Requires: gl glu
+Version: @VERSION@
+Libs: -L${libdir} -lglut
+Cflags: -I${includedir}
index 778ffb02189543a19d9f2cf7134858ecb449cdec..c32fc0ccad827af37964b0700e6bc723f450ff37 100644 (file)
@@ -25,11 +25,21 @@ OBJECTS = $(GLW_SOURCES:.c=.o)
 
 default: $(TOP)/$(LIB_DIR)/$(GLW_LIB_NAME)
 
-install:
+# GLU pkg-config file
+pcedit = sed \
+       -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
+       -e 's,@LIB_DIR@,$(LIB_DIR),' \
+       -e 's,@VERSION@,$(MAJOR).$(MINOR).$(TINY),'
+glw.pc: glw.pc.in
+       $(pcedit) $< > $@
+
+install: glw.pc
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+       $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
        $(INSTALL) -m 644 *.h $(DESTDIR)$(INSTALL_DIR)/include/GL
        $(INSTALL) $(TOP)/$(LIB_DIR)/libGLw.* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+       $(INSTALL) -m 644 glw.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
 
 clean:
        -rm depend depend.bak
diff --git a/src/glw/glw.pc.in b/src/glw/glw.pc.in
new file mode 100644 (file)
index 0000000..951e2dc
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@INSTALL_DIR@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/@LIB_DIR@
+includedir=${prefix}/include
+
+Name: glw
+Description: Mesa OpenGL widget library
+Requires: gl
+Version: @VERSION@
+Libs: -L${libdir} -lGLU
+Cflags: -I${includedir}
index a50e826701b797645dcd00ed2adab80266ea574f..c05b1959575d61ac3acd482f7626d02a04aa367b 100644 (file)
@@ -133,6 +133,15 @@ $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECT
        fi
 
 
+######################################################################
+# libGL pkg-config file
+pcedit = sed \
+       -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
+       -e 's,@LIB_DIR@,$(LIB_DIR),' \
+       -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),'
+gl.pc: gl.pc.in
+       $(pcedit) $< > $@
+
 ######################################################################
 # Generic stuff
 
@@ -148,13 +157,15 @@ subdirs:
        @ (cd x86-64 ; $(MAKE))
 
 
-install: default
+install: default gl.pc
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+       $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
        $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(DESTDIR)$(INSTALL_DIR)/include/GL
        @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
                $(INSTALL) $(TOP)/$(LIB_DIR)/libGL* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
        fi
+       $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
        @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \
                $(INSTALL) $(TOP)/$(LIB_DIR)/libOSMesa* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
        fi
diff --git a/src/mesa/gl.pc.in b/src/mesa/gl.pc.in
new file mode 100644 (file)
index 0000000..4b144ff
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@INSTALL_DIR@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/@LIB_DIR@
+includedir=${prefix}/include
+
+Name: gl
+Description: Mesa OpenGL library
+Requires:
+Version: @VERSION@
+Libs: -L${libdir} -lGL
+Cflags: -I${includedir}