-fi
-echo $ac_n "checking for YAZ""... $ac_c" 1>&6
-echo "configure:1376: checking for YAZ" >&5
-if test -r $yazconfig; then
- . $yazconfig
- echo "$ac_t""$yazconfig" 1>&6
-else
- echo "$ac_t""Not found" 1>&6
-fi
+ echo $ac_n "checking for YAZ""... $ac_c" 1>&6
+echo "configure:1370: checking for YAZ" >&5
+ if $yazconfig --version >/dev/null 2>&1; then
+ YAZLIB=`$yazconfig --libs`
+ # if this is empty, it's a simple version YAZ 1.6 script
+ # so we have to source it instead...
+ if test "X$YAZLIB" = "X"; then
+ . $yazconfig
+ else
+ YAZLALIB=`$yazconfig --lalibs`
+ YAZINC=`$yazconfig --cflags`
+ YAZVERSION=`$yazconfig --version`
+ fi
+ echo "$ac_t""$yazconfig" 1>&6
+ else
+ echo "$ac_t""Not found" 1>&6
+ YAZVERSION=NONE
+ fi
+
+