EXTRA_DIST = Doxyfile.in NEWS README LICENSE \
m4/yazpp.m4 m4/yaz.m4 m4/ax_boost.m4 \
- buildconf.sh metaproxy.spec
+ buildconf.sh metaproxy.spec metaproxy-config.in
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure
AC_DEFINE_UNQUOTED([VERSION_SHA1], "$SHA1", [SHA-1 from Git])
AC_CONFIG_FILES([
+ metaproxy-config
Doxyfile
Makefile
include/Makefile include/metaproxy/Makefile
doc/common/Makefile
doc/common/print.dsl
etc/Makefile
+],[
+ sed s%echo_source=yes%echo_source=no%g < metaproxy-config > src/metaproxy-config && chmod +x metaproxy-config src/metaproxy-config
+
])
AC_OUTPUT
debian/tmp/usr/include/metaproxy
debian/tmp/usr/lib/libmetaproxy*.a
debian/tmp/usr/lib/libmetaproxy*.so
+debian/tmp/usr/bin/metaproxy-config
--- /dev/null
+#!/bin/sh
+prefix=@prefix@
+echo_cflags=no
+echo_libs=no
+echo_help=no
+echo_tabs=no
+echo_source=yes
+echo_lalibs=no
+src_root=@abs_top_srcdir@
+build_root=@abs_top_builddir@
+
+libs="@YAZPPLIB@ @LIBS@"
+lalibs="@YAZPPLALIB@ @LIBS@"
+VERSION=@VERSION@
+
+usage()
+{
+ cat <<EOF
+Usage: metaproxy-config [OPTIONS] [LIBRARIES]
+Options:
+ [--prefix[=DIR]]
+ [--version]
+ [--libs]
+ [--lalibs]
+ [--cflags]
+EOF
+ exit $1
+}
+
+if test $# -eq 0; then
+ echo_help=yes
+fi
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --prefix=*)
+ prefix=$optarg
+ ;;
+ --prefix)
+ echo $prefix
+ exit 0
+ ;;
+ --version)
+ echo $VERSION
+ exit 0
+ ;;
+ --cflags)
+ echo_cflags=yes
+ ;;
+ --libs)
+ echo_libs=yes
+ ;;
+ --tabs)
+ echo_tabs=yes
+ ;;
+ --lalibs)
+ echo_lalibs=yes
+ ;;
+ -*)
+ echo_help=yes
+ ;;
+ esac
+ shift
+done
+
+INC="@YAZPPINC@"
+
+if test "$echo_source" = "yes"; then
+ LIB="-L${build_root}/src/.libs -lmetaproxy $libs"
+ LALIB="${build_root}/src/libmetaproxy.la $lalibs"
+ INC="-I${src_root}/include $INC"
+else
+ LIB="-lmetaproxy $libs"
+ if test "$prefix" != "/usr"; then
+ LIB="-L${prefix}/lib $LIB"
+ fi
+ LALIB=$LIB
+ if test "$prefix" != "/usr"; then
+ INC="-I${prefix}/include $INC"
+ fi
+fi
+
+if test "$echo_help" = "yes"; then
+ usage 1 1>&2
+fi
+if test "$echo_cflags" = "yes"; then
+ echo $INC
+fi
+if test "$echo_libs" = "yes"; then
+ echo $LIB
+fi
+if test "$echo_lalibs" = "yes"; then
+ echo $LALIB
+fi