Support #1962
Updated by O'Neil Delpratt 6 months ago
Reported by Tony Graham: >From the 'pkg-config' page at [1]: pkg-config is a helper tool used when compiling applications and libraries. See also "Guide to pkg-config" at [2]. If Saxon/C is to play nicely with other Linux, etc., packages, you may want to look at producing a 'pkg-config' file to make it easier for people building the other packages -- particularly but not limited to people building using Autotools -- to find how to refer to Saxon/C when compiling and linking. Here's what I've been faking as 'saxon-c.pc': ---- ~~~ prefix=/usr/local/src/saxon-c/Saxonica/Saxon-HEC0.1 exec_prefix=${prefix} libdir=${exec_prefix} pkgincludedir=${prefix}/Saxon-C-API Name: Saxon/C Description: Saxon/C Version: 0.1 Libs: -L${libdir} -lsaxon Cflags: -I${pkgincludedir} -I/usr/lib/jvm/java-6-openjdk-amd64/include ~~~ ---- and here's what I've put in 'configure.ac' for xmlroff: ---- ~~~ # # Checks for Saxon/C # SAXON_C_PACKAGES=saxon-c SAXON_C_REQUIRED_VERSION=0.1 AH_TEMPLATE([ENABLE_SAXON_C], [Enable support for Saxon/C XSLT 2.0 processor.]) AC_ARG_ENABLE(saxon_c, AC_HELP_STRING([--enable-saxon-c], [build Saxon/C XSLT processor capability (default=yes)]), enable_saxon_c_arg="$enableval", enable_saxon_c_arg=yes) if test "x$enable_saxon_c_arg" != "xyes" ; then enable_saxon_c_arg=no fi enable_saxon_c=false SAXON_C_REQUIRES="" have_saxon_c=false if test "x$enable_saxon_c_arg" = "xyes" ; then # # Check for Saxon/C support requirement # have_saxon_c=false PKG_CHECK_MODULES(SAXON_C, $SAXON_C_PACKAGES >= $SAXON_C_REQUIRED_VERSION, have_saxon_c=true, if $have_saxon_c; then enable_saxon_c=true AC_DEFINE(ENABLE_SAXON_C,1) else AC_DEFINE(ENABLE_SAXON_C,0) SAXON_C_LIBS="" SAXON_C_CFLAGS="" fi fi AC_SUBST(SAXON_C_ENABLED, [$enable_saxon_c]) AC_SUBST(SAXON_C_REQUIRES) AC_SUBST(SAXON_C_LIBS) AC_SUBST(SAXON_C_CFLAGS) AC_SUBST(ENABLE_SAXON_C, [$enable_saxon_c]) AM_CONDITIONAL(ENABLE_SAXON_C, [$enable_saxon_c]) ~~~ ---- Tony Graham tgraham@mentea.net Consultant http://www.mentea.net Mentea 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- XML, XSL-FO and XSLT consulting, training and programming Chair, Print and Page Layout Community Group @ W3C [1] http://www.freedesktop.org/wiki/Software/pkg-config/ [2] http://people.freedesktop.org/~dbn/pkg-config-guide.html