From 180d8e06b6f1e7fe34b1a80ca1edde0dddf113f1 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 11 Oct 2000 10:40:56 +0000 Subject: [PATCH] Work on yaz-config creation. Added yaz.m4. --- Makefile.am | 9 +++- Makefile.in | 54 ++++++++++++++++++------ configure | 12 ++++-- configure.in | 9 +++- include/Makefile.in | 9 ++-- lib/Makefile.am | 8 ++-- lib/Makefile.in | 6 +-- lib/yaz-config.in | 89 ---------------------------------------- yaz-config.in | 114 ++++++++++++++++++++++++++++++++++++++++++++++++--- yaz.m4 | 48 ++++++++++++++++++++++ yaz.spec | 1 + 11 files changed, 232 insertions(+), 127 deletions(-) delete mode 100755 lib/yaz-config.in create mode 100644 yaz.m4 diff --git a/Makefile.am b/Makefile.am index a31690c..31fb0f2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.9 2000-10-02 12:31:43 adam Exp $ +## $Id: Makefile.am,v 1.10 2000-10-11 10:40:56 adam Exp $ AUTOMAKE_OPTIONS = foreign @@ -6,8 +6,13 @@ DIST_SUBDIRS=util odr z39.50 asn ill zutil comstack ccl tab retrieval server lib SUBDIRS = @SUBDIRS_VAR@ +aclocaldir=$(datadir)/aclocal + +aclocal_DATA = yaz.m4 + SPEC_FILE=$(PACKAGE).spec -EXTRA_DIST=$(SPEC_FILE) README LICENSE CHANGELOG TODO windows.txt +EXTRA_DIST=$(SPEC_FILE) README LICENSE CHANGELOG TODO windows.txt \ + yaz-config.in yaz.m4 dist-hook: cd doc; make diff --git a/Makefile.in b/Makefile.in index de7e3e7..7b4740b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -85,11 +85,18 @@ DIST_SUBDIRS = util odr z39.50 asn ill zutil comstack ccl tab retrieval server l SUBDIRS = @SUBDIRS_VAR@ +aclocaldir = $(datadir)/aclocal + +aclocal_DATA = yaz.m4 + SPEC_FILE = $(PACKAGE).spec -EXTRA_DIST = $(SPEC_FILE) README LICENSE CHANGELOG TODO windows.txt +EXTRA_DIST = $(SPEC_FILE) README LICENSE CHANGELOG TODO windows.txt yaz-config.in yaz.m4 + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = yaz-config +DATA = $(aclocal_DATA) + DIST_COMMON = README Makefile.am Makefile.in TODO aclocal.m4 \ config.guess config.sub configure configure.in install-sh ltconfig \ ltmain.sh missing mkinstalldirs yaz-config.in @@ -118,6 +125,25 @@ $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCI yaz-config: $(top_builddir)/config.status yaz-config.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status +install-aclocalDATA: $(aclocal_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(aclocaldir) + @list='$(aclocal_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(aclocaldir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(aclocaldir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(aclocaldir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(aclocaldir)/$$p; \ + fi; fi; \ + done + +uninstall-aclocalDATA: + @$(NORMAL_UNINSTALL) + list='$(aclocal_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(aclocaldir)/$$p; \ + done + # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, @@ -125,6 +151,8 @@ yaz-config: $(top_builddir)/config.status yaz-config.in # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. +@SET_MAKE@ + all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @@ -151,11 +179,10 @@ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ done; \ - rev="$$rev ."; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ @@ -281,20 +308,21 @@ installcheck: installcheck-recursive install-exec-am: install-exec: install-exec-recursive -install-data-am: +install-data-am: install-aclocalDATA install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive -uninstall-am: +uninstall-am: uninstall-aclocalDATA uninstall: uninstall-recursive -all-am: Makefile +all-am: Makefile $(DATA) all-redirect: all-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(aclocaldir) mostlyclean-generic: @@ -328,11 +356,11 @@ maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ maintainer-clean: maintainer-clean-recursive -rm -f config.status -.PHONY: install-data-recursive uninstall-data-recursive \ -install-exec-recursive uninstall-exec-recursive installdirs-recursive \ -uninstalldirs-recursive all-recursive check-recursive \ -installcheck-recursive info-recursive dvi-recursive \ -mostlyclean-recursive distclean-recursive clean-recursive \ +.PHONY: uninstall-aclocalDATA install-aclocalDATA install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ diff --git a/configure b/configure index 6d632f7..25ba5c6 100755 --- a/configure +++ b/configure @@ -2344,6 +2344,10 @@ fi YAZ_SRC_ROOT=`pwd` SUBDIRS_VAR="util odr $ASNMODULE $ILLMODULE zutil comstack ccl tab retrieval server include lib client ztest" +if test -f lib/yaz-config.in; then + rm lib/yaz-config.in +fi +sed s%yaz_echo_source=yes%yaz_echo_source=no%g < yaz-config.in >lib/yaz-config.in trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -2477,7 +2481,8 @@ client/Makefile ztest/Makefile doc/Makefile yaz-config -lib/yaz-config" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +lib/yaz-config +" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then @@ -2667,7 +2673,7 @@ cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -chmod +x lib/yaz-config yaz-config +chmod +x yaz-config lib/yaz-config exit 0 EOF chmod +x $CONFIG_STATUS diff --git a/configure.in b/configure.in index 32f0360..16c7a51 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl YAZ Toolkit, Index Data 1994-2000 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.36 2000-10-03 13:26:24 adam Exp $ +dnl $Id: configure.in,v 1.37 2000-10-11 10:40:56 adam Exp $ AC_INIT(include/yaz/yaz-version.h) AM_INIT_AUTOMAKE(yaz, 1.7) dnl @@ -127,6 +127,10 @@ YAZ_SRC_ROOT=`pwd` dnl SUBDIRS_VAR="util odr $ASNMODULE $ILLMODULE zutil comstack ccl tab retrieval server include lib client ztest" AC_SUBST(SUBDIRS_VAR) +if test -f lib/yaz-config.in; then + rm lib/yaz-config.in +fi +sed s%yaz_echo_source=yes%yaz_echo_source=no%g < yaz-config.in >lib/yaz-config.in dnl dnl ------ Makefiles dnl @@ -150,4 +154,5 @@ client/Makefile ztest/Makefile doc/Makefile yaz-config -lib/yaz-config],[chmod +x lib/yaz-config yaz-config]) +lib/yaz-config +],[chmod +x yaz-config lib/yaz-config]) diff --git a/include/Makefile.in b/include/Makefile.in index 67e11b7..995b628 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -108,6 +108,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. +@SET_MAKE@ + all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @@ -134,11 +136,10 @@ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ done; \ - rev="$$rev ."; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ diff --git a/lib/Makefile.am b/lib/Makefile.am index a2eb3cd..0d7d94c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,11 +1,7 @@ -## $Id: Makefile.am,v 1.6 2000-06-19 09:49:35 adam Exp $ +## $Id: Makefile.am,v 1.7 2000-10-11 10:40:56 adam Exp $ lib_LTLIBRARIES = libyaz.la -bin_SCRIPTS = yaz-config - -EXTRA_DIST = yaz-config.in - # If the line below is omitted the LINK variable is # not set in Makefile.in and it will NOT work .. EXTRA_libyaz_la_SOURCES=x.c @@ -15,6 +11,8 @@ libyaz_la_SOURCES= LDFLAGS=-version-info 0:0:0 +bin_SCRIPTS = yaz-config + libyaz_la_LIBADD=../odr/libodr.la ../$(ASNMODULE)/libasn.la \ ../comstack/libcomstack.la ../server/libserver.la \ ../zutil/libzutil.la ../util/libutil.la ../ccl/libccl.la \ diff --git a/lib/Makefile.in b/lib/Makefile.in index c7d41b0..10266ee 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -81,10 +81,6 @@ YAZ_SRC_ROOT = @YAZ_SRC_ROOT@ lib_LTLIBRARIES = libyaz.la -bin_SCRIPTS = yaz-config - -EXTRA_DIST = yaz-config.in - # If the line below is omitted the LINK variable is # not set in Makefile.in and it will NOT work .. EXTRA_libyaz_la_SOURCES = x.c @@ -94,6 +90,8 @@ libyaz_la_SOURCES = LDFLAGS = -version-info 0:0:0 +bin_SCRIPTS = yaz-config + libyaz_la_LIBADD = ../odr/libodr.la ../$(ASNMODULE)/libasn.la ../comstack/libcomstack.la ../server/libserver.la ../zutil/libzutil.la ../util/libutil.la ../ccl/libccl.la ../retrieval/libret.la $(ILLLIB) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/lib/yaz-config.in b/lib/yaz-config.in deleted file mode 100755 index c215aee..0000000 --- a/lib/yaz-config.in +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh -# $Id: yaz-config.in,v 1.6 2000-10-02 12:31:43 adam Exp $ -yazprefix=@prefix@ -yaz_echo_cflags=no -yaz_echo_libs=no -yaz_echo_help=no -yaz_echo_tabs=no - -yazlibs="@LIBS@" -YAZVERSION=@VERSION@ - -usage() -{ - cat <&2 -fi -if test "$yaz_echo_cflags" = "yes"; then - echo $YAZINC -fi -if test "$yaz_echo_libs" = "yes"; then - echo $YAZLIB -fi -if test "$yaz_echo_tabs" = "yes"; then - echo $YAZTAB -fi diff --git a/yaz-config.in b/yaz-config.in index 70241cb..b047e6d 100644 --- a/yaz-config.in +++ b/yaz-config.in @@ -1,7 +1,111 @@ #!/bin/sh -# yaz-config for source tree +# $Id: yaz-config.in,v 1.2 2000-10-11 10:40:56 adam Exp $ +yazprefix=@prefix@ +yaz_echo_cflags=no +yaz_echo_libs=no +yaz_echo_help=no +yaz_echo_tabs=no +yaz_echo_source=yes +yaz_echo_lalibs=no +yaz_src_root=@YAZ_SRC_ROOT@ + +yazlibs="@LIBS@" YAZVERSION=@VERSION@ -YAZBIN="@YAZ_SRC_ROOT@/bin" -YAZTAB="@YAZ_SRC_ROOT@/tab" -YAZLIB="-L@YAZ_SRC_ROOT@/lib/.libs -lyaz" -YAZINC="-I@YAZ_SRC_ROOT@/include" + +usage() +{ + cat <&2 +fi +if test "$yaz_echo_cflags" = "yes"; then + echo $YAZINC +fi +if test "$yaz_echo_libs" = "yes"; then + echo $YAZLIB +fi +if test "$yaz_echo_tabs" = "yes"; then + echo $YAZTAB +fi +if test "$yaz_echo_lalibs" = "yes"; then + echo $YAZLALIB +fi diff --git a/yaz.m4 b/yaz.m4 new file mode 100644 index 0000000..bd6cf14 --- /dev/null +++ b/yaz.m4 @@ -0,0 +1,48 @@ +## $Id: yaz.m4,v 1.1 2000-10-11 10:40:56 adam Exp $ +## +# Use this m4 funciton for autoconf if you use YAZ in your own +# configure script. +# YAZ_INIT + +AC_DEFUN([YAZ_INIT], +[ + AC_SUBST(YAZLIB) + AC_SUBST(YAZLALIB) + AC_SUBST(YAZINC) + AC_SUBST(YAZVERSION) + yazconfig=NONE + yazpath=NONE + AC_ARG_WITH(yazconfig, [ --with-yazconfig=DIR yaz-config in DIR (example /home/yaz-1.7)], [yazpath=$withval]) + if test "x$yazpath" != "xNONE"; then + yazconfig=$yazpath/yaz-config + else + for i in ../yaz* ../yaz; do + if test -d $i; then + if test -r $i/yaz-config; then + yazconfig=$i/yaz-config + fi + fi + done + if test "x$yazconfig" = "xNONE"; then + AC_PATH_PROG(yazconfig, yaz-config, NONE) + fi + fi + AC_MSG_CHECKING(for YAZ) + 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 + AC_MSG_RESULT($yazconfig) + else + AC_MSG_RESULT(Not found) + YAZVERSION=NONE + fi +]) + diff --git a/yaz.spec b/yaz.spec index be0fd80..c44a49e 100644 --- a/yaz.spec +++ b/yaz.spec @@ -42,3 +42,4 @@ cd doc; make prefix=$RPM_BUILD_ROOT/usr install /usr/lib/libyaz.so.0.0.0 /usr/include/yaz /usr/share/yaz/doc +/usr/share/aclocal/yaz.m4 -- 1.7.10.4