summaryrefslogtreecommitdiffstats
path: root/src/egl/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/Makefile19
-rw-r--r--src/egl/main/egl.pc.in12
2 files changed, 30 insertions, 1 deletions
diff --git a/src/egl/main/Makefile b/src/egl/main/Makefile
index 3b4ebf7fec4..82fd855b1d5 100644
--- a/src/egl/main/Makefile
+++ b/src/egl/main/Makefile
@@ -82,10 +82,27 @@ install-headers:
$(INSTALL) -m 644 $(TOP)/include/EGL/*.h \
$(DESTDIR)$(INSTALL_INC_DIR)/EGL
-install: default install-headers
+PKG_CONFIG_DIR = $(INSTALL_LIB_DIR)/pkgconfig
+
+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),' \
+ -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
+ -e 's,@EGL_PC_REQ_PRIV@,$(EGL_PC_REQ_PRIV),' \
+ -e 's,@EGL_PC_LIB_PRIV@,$(EGL_PC_LIB_PRIV),' \
+ -e 's,@EGL_PC_CFLAGS@,$(EGL_PC_CFLAGS),' \
+ -e 's,@EGL_LIB@,$(EGL_LIB),'
+
+egl.pc: egl.pc.in
+ $(gl_pcedit) $< > $@
+
+install: default install-headers egl.pc
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
$(MINSTALL) $(TOP)/$(LIB_DIR)/$(EGL_LIB_GLOB) \
$(DESTDIR)$(INSTALL_LIB_DIR)
+ $(INSTALL) -d $(DESTDIR)$(PKG_CONFIG_DIR)
+ $(INSTALL) -m 644 egl.pc $(DESTDIR)$(PKG_CONFIG_DIR)
clean:
-rm -f *.o
diff --git a/src/egl/main/egl.pc.in b/src/egl/main/egl.pc.in
new file mode 100644
index 00000000000..2855a4980a0
--- /dev/null
+++ b/src/egl/main/egl.pc.in
@@ -0,0 +1,12 @@
+prefix=@INSTALL_DIR@
+exec_prefix=${prefix}
+libdir=@INSTALL_LIB_DIR@
+includedir=@INSTALL_INC_DIR@
+
+Name: egl
+Description: Mesa EGL library
+Requires.private: @EGL_PC_REQ_PRIV@
+Version: @VERSION@
+Libs: -L${libdir} -l@EGL_LIB@
+Libs.private: @EGL_PC_LIB_PRIV@
+Cflags: -I${includedir} @EGL_PC_CFLAGS@