Autoconf macro in yazpp.m4: YAZPP_INIT.
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 14 Nov 2002 14:41:07 +0000 (14:41 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 14 Nov 2002 14:41:07 +0000 (14:41 +0000)
Fixes for libtool archives.

ChangeLog
yaz++-config.in
yazpp.m4 [new file with mode: 0644]

index c7a37a8..4e32713 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+New autoconf m4 macro in yazpp.m4.
+
+Fixes for yaz++-config for libtool archives.
+
 --- 0.5 2002/11/04 Second release
 
 Fix Windows compile.
index 1ff5a31..fa55712 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: yaz++-config.in,v 1.3 2001-03-26 14:43:49 adam Exp $
+# $Id: yaz++-config.in,v 1.4 2002-11-14 14:41:07 adam Exp $
 yazppprefix=@prefix@
 yaz_echo_cflags=no
 yaz_echo_libs=no
@@ -11,6 +11,7 @@ yazpp_src_root=@YAZPP_SRC_ROOT@
 yazpp_build_root=@YAZPP_BUILD_ROOT@
 
 yazlibs="@YAZLIB@ @LIBS@"
+yazlalibs="@YAZLALIB@ @LIBS@"
 YAZPPVERSION=@VERSION@
 
 usage()
@@ -69,8 +70,8 @@ while test $# -gt 0; do
 done
 
 if test "$yaz_echo_source" = "yes"; then
-    YAZPPLIB="-L${yazpp_build_root}/src/.libs -lyaz++ $yazlibs"
-    YAZPPLALIB="${yazpp_build_root}/src/libyaz++.la $yazlibs"
+    YAZPPLIB="-L${yazpp_build_root}/lib/.libs -lyaz++ $yazlibs"
+    YAZPPLALIB="${yazpp_build_root}/lib/libyaz++.la $yazlalibs"
     YAZPPINC="@YAZINC@ -I${yazpp_src_root}/include"
 else
 
diff --git a/yazpp.m4 b/yazpp.m4
new file mode 100644 (file)
index 0000000..468236e
--- /dev/null
+++ b/yazpp.m4
@@ -0,0 +1,42 @@
+## $Id: yazpp.m4,v 1.1 2002-11-14 14:41:07 adam Exp $
+AC_DEFUN([YAZPP_INIT],
+[
+        AC_SUBST(YAZPPLIB)
+        AC_SUBST(YAZPPLALIB)
+        AC_SUBST(YAZPPINC)
+        AC_SUBST(YAZPPVERSION)
+        yazppconfig=NONE
+        yazpppath=NONE
+        AC_ARG_WITH(yazppconfig, [  --with-yazppconfig=DIR  yaz++-config in DIR (example /home/yaz++-0.5)], [yazpppath=$withval])
+        if test "x$yazpppath" != "xNONE"; then
+                yazppconfig=$yazpppath/yaz++-config
+        else
+                if test "x$srcdir" = "x"; then
+                        yazppsrcdir=.
+                else
+                        yazppsrcdir=$srcdir
+                fi
+                for i in ${yazppsrcdir}/../yaz++-* ${yazppsrcdir}/../yaz++; do
+                        if test -d $i; then
+                                if test -r $i/yaz++-config; then
+                                        yazppconfig=$i/yaz++-config
+                                fi
+                        fi
+                done
+                if test "x$yazppconfig" = "xNONE"; then
+                        AC_PATH_PROG(yazppconfig, yaz-config, NONE)
+                fi
+        fi
+        AC_MSG_CHECKING(for YAZ++)
+        if $yazppconfig --version >/dev/null 2>&1; then
+                YAZPPLIB=`$yazppconfig --libs $1`
+                YAZPPLALIB=`$yazppconfig --lalibs $1`
+                YAZPPINC=`$yazppconfig --cflags $1`
+                YAZPPVERSION=`$yazppconfig --version`
+                AC_MSG_RESULT($yazppconfig)
+        else
+                AC_MSG_RESULT(Not found)
+                YAZVERSION=NONE
+        fi
+])
+