From a93dba43242402e51da48a643accde72bc9f4df5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 14 Feb 2018 13:28:21 +0100 Subject: [PATCH] add pkg-config example in extension skeleton --- ext/ext_skel | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ext/ext_skel b/ext/ext_skel index d1b8a2874c..09a003c92e 100755 --- a/ext/ext_skel +++ b/ext/ext_skel @@ -127,6 +127,24 @@ dnl [ --enable-$extname Enable $extname support]) if test "\$PHP_$EXTNAME" != "no"; then dnl Write more examples of tests here... + dnl # get library FOO build options from pkg-config output + dnl AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + dnl AC_MSG_CHECKING(for libfoo) + dnl if test -x "\$PKG_CONFIG" && \$PKG_CONFIG --exists foo; then + dnl if \$PKG_CONFIG foo --atleast-version 1.2.3; then + dnl LIBFOO_CFLAGS=\`\$PKG_CONFIG foo --cflags\` + dnl LIBFOO_LIBDIR=\`\$PKG_CONFIG foo --libs\` + dnl LIBFOO_VERSON=\`\$PKG_CONFIG foo --modversion\` + dnl AC_MSG_RESULT(from pkgconfig: version \$LIBFOO_VERSON) + dnl else + dnl AC_MSG_ERROR(system libfoo is too old: version 1.2.3 required) + dnl fi + dnl else + dnl AC_MSG_ERROR(pkg-config not found) + dnl fi + dnl PHP_EVAL_LIBLINE(\$LIBFOO_LIBDIR, ${EXTNAME}_SHARED_LIBADD) + dnl PHP_EVAL_INCLINE(\$LIBFOO_CFLAGS) + dnl # --with-$extname -> check with-path dnl SEARCH_PATH="/usr/local /usr" # you might want to change this dnl SEARCH_FOR="/include/$extname.h" # you most likely want to change this -- 2.40.0