diff --git a/.gitignore b/.gitignore index 195a82c..0655cc2 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,4 @@ win/x64 win/x85 win/Debug cglm-test-ios* +/cglm.pc diff --git a/cglm.pc.in b/cglm.pc.in new file mode 100644 index 0000000..b80b401 --- /dev/null +++ b/cglm.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: @PACKAGE_NAME@ +Description: OpenGL Mathematics (glm) for C +URL: https://github.com/recp/cglm +Version: @PACKAGE_VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -lcglm @LIBS@ diff --git a/configure.ac b/configure.ac index 9a26778..8ee6f0d 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,10 @@ AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/]) AC_CONFIG_HEADERS([config.h]) +# Dependencies for pkg-config. +PKG_PROG_PKG_CONFIG +PKG_INSTALLDIR + # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O @@ -53,6 +57,6 @@ AC_TYPE_UINT8_T # Checks for library functions. AC_FUNC_ERROR_AT_LINE -AC_CONFIG_FILES([makefile]) +AC_CONFIG_FILES([makefile cglm.pc]) AC_OUTPUT diff --git a/makefile.am b/makefile.am index 962e1d3..922aefe 100644 --- a/makefile.am +++ b/makefile.am @@ -154,6 +154,8 @@ test_tests_SOURCES=\ test/src/test_affine.c \ test/src/test_bezier.c +pkgconfig_DATA=cglm.pc + # When running configure with --prefix, $VPATH references # the source directory that post-build.sh is in. When not # using a prefix, $VPATH will be unset, so we need to fall