From cfcbc4bb9b2d96360133f6e23ead1848b1616fb8 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Tue, 2 Feb 2010 13:07:14 +0100 Subject: [PATCH] New m4 for authority/frbr --- authority-0.0.m4 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 authority-0.0.m4 diff --git a/authority-0.0.m4 b/authority-0.0.m4 new file mode 100644 index 0000000..bdc37df --- /dev/null +++ b/authority-0.0.m4 @@ -0,0 +1,51 @@ +AC_DEFUN([AUTHORITY_INIT], +[ + AC_SUBST(AUTHORITYLIB) + AC_SUBST(AUTHORITYLALIB) + AC_SUBST(AUTHORITYINC) + AC_SUBST(AUTHORITYVERSION) + authconfig=NONE + authpath=NONE + AC_ARG_WITH(auth, [ --with-auth=DIR use authority-config-0.0 in DIR (example /home/frbr-0.0)], [authpath=$withval]) + if test "x$authpath" != "xNONE"; then + authconfig=$authpath/authority-config-0.0 + else + if test "x$srcdir" = "x"; then + authsrcdir=. + else + authsrcdir=$srcdir + fi + for i in ${authsrcdir}/../../authc ${authsrcdir}/../authc-* ${authsrcdir}/../authc; do + if test -d $i; then + if test -r $i/authority-config-0.0; then + authconfig=$i/authority-config-0.0 + fi + fi + done + if test "x$authconfig" = "xNONE"; then + AC_PATH_PROG(authconfig, authority-config-0.0, NONE) + fi + fi + AC_MSG_CHECKING(for AUTHORITY) + if $authconfig --version >/dev/null 2>&1; then + AUTHORITYLIB=`$authconfig --libs $1` + AUTHORITYLALIB=`$authconfig --lalibs $1` + AUTHORITYINC=`$authconfig --cflags $1` + AUTHORITYVERSION=`$authconfig --version` + AC_MSG_RESULT([$authconfig]) + else + AC_MSG_RESULT(Not found) + AUTHORITYVERSION=NONE + fi + if test "X$AUTHORITYVERSION" != "XNONE"; then + AC_MSG_CHECKING([for AUTHORITY version]) + AC_MSG_RESULT([$AUTHORITYVERSION]) + if test "$2"; then + have_auth_version=`echo "$AUTHORITYVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'` + req_auth_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'` + if test "$have_auth_version" -lt "$req_auth_version"; then + AC_MSG_ERROR([$AUTHORITYVERSION. Requires AUTHORITY $2 or later]) + fi + fi + fi +]) -- 1.7.10.4