mapi: Install .pc file for OpenVG.
authorChia-I Wu <olv@lunarg.com>
Thu, 6 May 2010 03:03:00 +0000 (11:03 +0800)
committerChia-I Wu <olv@lunarg.com>
Sat, 8 May 2010 06:55:57 +0000 (14:55 +0800)
src/mapi/vgapi/Makefile
src/mapi/vgapi/vg.pc.in [new file with mode: 0644]

index 8e07ac5dca32593a9ca229d04ede29cc2de9d7d7..702db03d1542aae9e526cbce53d4dff8d1f51ec0 100644 (file)
@@ -48,17 +48,35 @@ vgapi_tmp.h: vgapi.csv $(MAPI)/mapi_abi.py
 
 .PHONY: clean
 clean:
+       -rm -f vg.pc
        -rm -f $(TOP)/$(LIB_DIR)/$(VG_LIB_NAME)
        -rm -f libvgapi.a
        -rm -f $(VGAPI_OBJECTS)
        -rm -f depend depend.bak
        -rm -f $(GENERATED_SOURCES)
 
+pcedit = \
+       -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,@VG_PC_REQ_PRIV@,$(VG_PC_REQ_PRIV),' \
+       -e 's,@VG_PC_LIB_PRIV@,$(VG_PC_LIB_PRIV),' \
+       -e 's,@VG_PC_CFLAGS@,$(VG_PC_CFLAGS),' \
+       -e 's,@VG_LIB@,$(VG_LIB),'
+
+vg.pc: vg.pc.in
+       @sed $(pcedit) $< > $@
+
+install-pc: vg.pc
+       $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
+       $(INSTALL) -m 644 $< $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
+
 install-headers:
        $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/VG
        $(INSTALL) -m 644 $(TOP)/include/VG/*.h $(DESTDIR)$(INSTALL_INC_DIR)/VG
 
-install: default install-headers
+install: default install-headers install-pc
        $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
        $(MINSTALL) $(TOP)/$(LIB_DIR)/$(VG_LIB_GLOB) \
                $(DESTDIR)$(INSTALL_LIB_DIR)
diff --git a/src/mapi/vgapi/vg.pc.in b/src/mapi/vgapi/vg.pc.in
new file mode 100644 (file)
index 0000000..63e9af8
--- /dev/null
@@ -0,0 +1,12 @@
+prefix=@INSTALL_DIR@
+exec_prefix=${prefix}
+libdir=@INSTALL_LIB_DIR@
+includedir=@INSTALL_INC_DIR@
+
+Name: vg
+Description: Mesa OpenVG 1.0 library
+Requires.private: @VG_PC_REQ_PRIV@
+Version: @VERSION@
+Libs: -L${libdir} -l@VG_LIB@
+Libs.private: @VG_PC_LIB_PRIV@
+Cflags: -I${includedir} @VG_PC_CFLAGS@