]> www.ginac.de Git - ginac.git/commitdiff
- added 'ginac-config' script and 'ginac.m4' macros to help making packages
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Wed, 1 Dec 1999 19:03:37 +0000 (19:03 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Wed, 1 Dec 1999 19:03:37 +0000 (19:03 +0000)
  that use GiNaC
- installation does no longer fail when HTML docs were disabled by
  configuration

21 files changed:
GiNaC.spec.in
Makefile.am
Makefile.in
autogen.sh [new file with mode: 0755]
check/Makefile.in
configure
configure.in
doc/Makefile.am
doc/Makefile.in
doc/ginac-config.1 [new file with mode: 0644]
doc/reference/Makefile.am
doc/reference/Makefile.in
doc/tutorial/Makefile.am
doc/tutorial/Makefile.in
doc/tutorial/ginac.texi
doc/tutorial/stamp-vti
doc/tutorial/version.texi
ginac-config.in [new file with mode: 0644]
ginac.m4 [new file with mode: 0644]
ginac/Makefile.in
ginsh/Makefile.in

index 5d22b8cf598903564609f2ff4bbeafb054fa5fce..1b178a117075144f803f0eec0f5aca2b3028da28 100644 (file)
@@ -1,5 +1,4 @@
-# spec file for GiNaC (not relocatable)
-
+# Note that this is NOT a relocatable package
 %define ver @VERSION@
 %define rel 1
 %define prefix /usr
@@ -63,4 +62,10 @@ rm -rf $RPM_BUILD_ROOT
 %{prefix}/info/*
 %{prefix}/man/man1/*
 %{prefix}/share/doc/GiNaC/*
+%{prefix}/share/aclocal/*
 %{prefix}/bin/*
+
+%changelog
+* Wed Dec  1 1999 Christian Bauer <Christian.Bauer@uni-mainz.de>
+
+- aclocal macros get installed
index 4262ecc4b00b330d35998c44a10926b07ef6f0ed..328100460c9c665c7606383bb2642257e5d65711 100644 (file)
@@ -3,3 +3,21 @@ SUBDIRS = ginac check ginsh doc
 
 # Requires automake 1.4
 AUTOMAKE_OPTIONS = 1.4
+
+# GiNaC runtime configuration script
+bin_SCRIPTS = ginac-config
+
+# All the rest of the distributed files
+EXTRA_DIST = autogen.sh ginac.m4
+
+# M4 macro file for inclusion with autoconf
+m4datadir = $(datadir)/aclocal
+m4data_DATA = ginac.m4
+
+# Rule to build tar-gzipped distribution package
+$(PACKAGE)-$(VERSION).tar.gz: dist
+
+# Rule to build RPM distribution package
+rpm: $(PACKAGE)-$(VERSION).tar.gz
+       cp $(PACKAGE)-$(VERSRION).tar.gz /usr/src/redhat/SOURCES
+       rpm -ba GiNaC.spec
index 8f5c366eb18ff120016c56f7efbc68778b942cc2..a6e7630faad8f9497a4ed774e3bbbfe2c64c376a 100644 (file)
@@ -68,7 +68,9 @@ DOXYGEN = @DOXYGEN@
 DVIPS = @DVIPS@
 FIG2DEV = @FIG2DEV@
 GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@
+GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@
 GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@
+GINACLIB_LIBS = @GINACLIB_LIBS@
 GINACLIB_MAJOR_VERSION = @GINACLIB_MAJOR_VERSION@
 GINACLIB_MICRO_VERSION = @GINACLIB_MICRO_VERSION@
 GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@
@@ -99,14 +101,29 @@ SUBDIRS = ginac check ginsh doc
 
 # Requires automake 1.4
 AUTOMAKE_OPTIONS = 1.4
+
+# GiNaC runtime configuration script
+bin_SCRIPTS = ginac-config
+
+# All the rest of the distributed files
+EXTRA_DIST = autogen.sh ginac.m4
+
+# M4 macro file for inclusion with autoconf
+m4datadir = $(datadir)/aclocal
+m4data_DATA = ginac.m4
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =  GiNaC.spec
+CONFIG_CLEAN_FILES =  GiNaC.spec ginac-config
+SCRIPTS =  $(bin_SCRIPTS)
+
+DATA =  $(m4data_DATA)
+
 DIST_COMMON =  README ./stamp-h.in AUTHORS COPYING ChangeLog \
 GiNaC.spec.in INSTALL Makefile.am Makefile.in NEWS acconfig.h \
 acinclude.m4 aclocal.m4 config.guess config.h.in config.sub configure \
-configure.in install-sh ltconfig ltmain.sh missing mkinstalldirs
+configure.in ginac-config.in install-sh ltconfig ltmain.sh missing \
+mkinstalldirs
 
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -159,6 +176,46 @@ distclean-hdr:
 maintainer-clean-hdr:
 GiNaC.spec: $(top_builddir)/config.status GiNaC.spec.in
        cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+ginac-config: $(top_builddir)/config.status ginac-config.in
+       cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+install-binSCRIPTS: $(bin_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       $(mkinstalldirs) $(DESTDIR)$(bindir)
+       @list='$(bin_SCRIPTS)'; for p in $$list; do \
+         if test -f $$p; then \
+           echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+           $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+         else if test -f $(srcdir)/$$p; then \
+           echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+           $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+         else :; fi; fi; \
+       done
+
+uninstall-binSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       list='$(bin_SCRIPTS)'; for p in $$list; do \
+         rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+       done
+
+install-m4dataDATA: $(m4data_DATA)
+       @$(NORMAL_INSTALL)
+       $(mkinstalldirs) $(DESTDIR)$(m4datadir)
+       @list='$(m4data_DATA)'; for p in $$list; do \
+         if test -f $(srcdir)/$$p; then \
+           echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p"; \
+           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p; \
+         else if test -f $$p; then \
+           echo " $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p"; \
+           $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p; \
+         fi; fi; \
+       done
+
+uninstall-m4dataDATA:
+       @$(NORMAL_UNINSTALL)
+       list='$(m4data_DATA)'; for p in $$list; do \
+         rm -f $(DESTDIR)$(m4datadir)/$$p; \
+       done
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run `make' without going through this Makefile.
@@ -323,23 +380,24 @@ installcheck: installcheck-recursive
 all-recursive-am: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
-install-exec-am:
+install-exec-am: install-binSCRIPTS
 install-exec: install-exec-recursive
 
-install-data-am:
+install-data-am: install-m4dataDATA
 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-binSCRIPTS uninstall-m4dataDATA
 uninstall: uninstall-recursive
-all-am: Makefile config.h
+all-am: Makefile $(SCRIPTS) $(DATA) config.h
 all-redirect: all-recursive-am
 install-strip:
        $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
 installdirs: installdirs-recursive
 installdirs-am:
+       $(mkinstalldirs)  $(DESTDIR)$(bindir) $(DESTDIR)$(m4datadir)
 
 
 mostlyclean-generic:
@@ -374,10 +432,12 @@ maintainer-clean: maintainer-clean-recursive
        -rm -f config.status
 
 .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-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 \
+uninstall-binSCRIPTS install-binSCRIPTS uninstall-m4dataDATA \
+install-m4dataDATA 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 all-recursive-am \
@@ -387,6 +447,14 @@ installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
+# Rule to build tar-gzipped distribution package
+$(PACKAGE)-$(VERSION).tar.gz: dist
+
+# Rule to build RPM distribution package
+rpm: $(PACKAGE)-$(VERSION).tar.gz
+       cp $(PACKAGE)-$(VERSRION).tar.gz /usr/src/redhat/SOURCES
+       rpm -ba GiNaC.spec
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..0e0fc0f
--- /dev/null
@@ -0,0 +1,6 @@
+#! /bin/sh
+aclocal
+autoheader
+autoconf
+automake
+./configure $*
index 8a503c7f9559879e0974fc125ef35f42433f4cd8..9189758af0aaa38175e03e81d797a33a75415126 100644 (file)
@@ -68,7 +68,9 @@ DOXYGEN = @DOXYGEN@
 DVIPS = @DVIPS@
 FIG2DEV = @FIG2DEV@
 GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@
+GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@
 GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@
+GINACLIB_LIBS = @GINACLIB_LIBS@
 GINACLIB_MAJOR_VERSION = @GINACLIB_MAJOR_VERSION@
 GINACLIB_MICRO_VERSION = @GINACLIB_MICRO_VERSION@
 GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@
index f455579dd5ab2a57c756199a5ef1f55476ef869b..4a6e3d2ccd7d4499d9621f7754c045cde6de73c5 100755 (executable)
--- a/configure
+++ b/configure
@@ -2670,10 +2670,15 @@ fi
     esac
 
 
+GINACLIB_CPPFLAGS=$CPPFLAGS
+GINACLIB_LIBS=$LIBS
+
+
+
 # Extract the first word of "doxygen", so it can be a program name with args.
 set dummy doxygen; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2677: checking for $ac_word" >&5
+echo "configure:2682: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_DOXYGEN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2709,7 +2714,7 @@ fi
 # Extract the first word of "latex", so it can be a program name with args.
 set dummy latex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2713: checking for $ac_word" >&5
+echo "configure:2718: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_LATEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2745,7 +2750,7 @@ fi
 # Extract the first word of "makeindex", so it can be a program name with args.
 set dummy makeindex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2749: checking for $ac_word" >&5
+echo "configure:2754: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MAKEINDEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2781,7 +2786,7 @@ fi
 # Extract the first word of "dvips", so it can be a program name with args.
 set dummy dvips; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2785: checking for $ac_word" >&5
+echo "configure:2790: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_DVIPS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2817,7 +2822,7 @@ fi
 # Extract the first word of "fig2dev", so it can be a program name with args.
 set dummy fig2dev; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2821: checking for $ac_word" >&5
+echo "configure:2826: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_FIG2DEV'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2972,6 +2977,7 @@ ac_given_INSTALL="$INSTALL"
 trap 'rm -fr `echo "
 Makefile
 GiNaC.spec
+ginac-config
 ginac/Makefile
 check/Makefile
 ginsh/Makefile
@@ -3058,6 +3064,8 @@ s%@CPP@%$CPP%g
 s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
 s%@YACC@%$YACC%g
 s%@GINSH_LIBS@%$GINSH_LIBS%g
+s%@GINACLIB_CPPFLAGS@%$GINACLIB_CPPFLAGS%g
+s%@GINACLIB_LIBS@%$GINACLIB_LIBS%g
 s%@DOXYGEN@%$DOXYGEN%g
 s%@LATEX@%$LATEX%g
 s%@MAKEINDEX@%$MAKEINDEX%g
@@ -3108,6 +3116,7 @@ cat >> $CONFIG_STATUS <<EOF
 
 CONFIG_FILES=\${CONFIG_FILES-"Makefile
 GiNaC.spec
+ginac-config
 ginac/Makefile
 check/Makefile
 ginsh/Makefile
@@ -3287,7 +3296,7 @@ cat >> $CONFIG_STATUS <<EOF
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-
+chmod +x ginac-config
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
index a1a3903d80aee26eca4f83c8cf9ee42009905ac7..96be9d3670070b41dfadcc5d6e01e83b704c7146 100644 (file)
@@ -93,6 +93,12 @@ dnl We need to have Bruno Haible's CLN installed (macros are in acinclude.m4):
 GINAC_CHECK_CLN_H
 GINAC_CHECK_LIBCLN
 
+dnl Expand the cppflags and libraries needed by apps using GiNaC
+GINACLIB_CPPFLAGS=$CPPFLAGS
+GINACLIB_LIBS=$LIBS
+AC_SUBST(GINACLIB_CPPFLAGS)
+AC_SUBST(GINACLIB_LIBS)
+
 dnl Check for utilities needed by the different kinds of documentation.
 dnl Documantation needs only be built when extending it, so never mind if it
 dnl cannot find those helpers:
@@ -120,17 +126,16 @@ fi
 AC_SUBST(TUTORIAL_TARGETS)
 AC_SUBST(REFERENCE_TARGETS)
 
-dnl ===========================================================================
-dnl Produce a Makefile from Makefile.in:
-dnl ===========================================================================
+dnl Output makefiles etc.
 AC_OUTPUT([
 Makefile
 GiNaC.spec
+ginac-config
 ginac/Makefile
 check/Makefile
 ginsh/Makefile
 doc/Makefile
 doc/tutorial/Makefile
 doc/reference/Makefile
-])
+], [chmod +x ginac-config])
 echo "Configuration done. Now type \"make\"."
index e5de20e3b40cf3ba4fa6f991c29a6f4928ec1378..517169486411b14533618fbd9495c238a4a67d3f 100644 (file)
@@ -1,2 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 SUBDIRS = tutorial reference
+
+# Manual pages
+man_MANS = ginac-config.1
+EXTRA_DIST = $(man_MANS)
index ce4f7fd66c81b117d8374b54f8cdb476de3b3a97..2498724b46169e857f3535e247a85fdb07d06b0f 100644 (file)
@@ -68,7 +68,9 @@ DOXYGEN = @DOXYGEN@
 DVIPS = @DVIPS@
 FIG2DEV = @FIG2DEV@
 GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@
+GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@
 GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@
+GINACLIB_LIBS = @GINACLIB_LIBS@
 GINACLIB_MAJOR_VERSION = @GINACLIB_MAJOR_VERSION@
 GINACLIB_MICRO_VERSION = @GINACLIB_MICRO_VERSION@
 GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@
@@ -96,9 +98,17 @@ VERSION = @VERSION@
 YACC = @YACC@
 
 SUBDIRS = tutorial reference
+
+# Manual pages
+man_MANS = ginac-config.1
+EXTRA_DIST = $(man_MANS)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../config.h
 CONFIG_CLEAN_FILES = 
+man1dir = $(mandir)/man1
+MANS = $(man_MANS)
+
+NROFF = nroff
 DIST_COMMON =  Makefile.am Makefile.in
 
 
@@ -116,6 +126,45 @@ Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
          && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
 
+install-man1:
+       $(mkinstalldirs) $(DESTDIR)$(man1dir)
+       @list='$(man1_MANS)'; \
+       l2='$(man_MANS)'; for i in $$l2; do \
+         case "$$i" in \
+           *.1*) list="$$list $$i" ;; \
+         esac; \
+       done; \
+       for i in $$list; do \
+         if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+         else file=$$i; fi; \
+         ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+         inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+         inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+         echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+         $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+       done
+
+uninstall-man1:
+       @list='$(man1_MANS)'; \
+       l2='$(man_MANS)'; for i in $$l2; do \
+         case "$$i" in \
+           *.1*) list="$$list $$i" ;; \
+         esac; \
+       done; \
+       for i in $$list; do \
+         ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+         inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+         inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+         echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+         rm -f $(DESTDIR)$(man1dir)/$$inst; \
+       done
+install-man: $(MANS)
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-man1
+uninstall-man:
+       @$(NORMAL_UNINSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) uninstall-man1
+
 # 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,
@@ -246,20 +295,21 @@ installcheck: installcheck-recursive
 install-exec-am:
 install-exec: install-exec-recursive
 
-install-data-am:
+install-data-am: install-man
 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-man
 uninstall: uninstall-recursive
-all-am: Makefile
+all-am: Makefile $(MANS)
 all-redirect: all-recursive
 install-strip:
        $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
 installdirs: installdirs-recursive
 installdirs-am:
+       $(mkinstalldirs)  $(DESTDIR)$(mandir)/man1
 
 
 mostlyclean-generic:
@@ -291,11 +341,11 @@ maintainer-clean-am:  maintainer-clean-tags maintainer-clean-generic \
 
 maintainer-clean: maintainer-clean-recursive
 
-.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: install-man1 uninstall-man1 install-man uninstall-man \
+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/doc/ginac-config.1 b/doc/ginac-config.1
new file mode 100644 (file)
index 0000000..109da7d
--- /dev/null
@@ -0,0 +1,66 @@
+.TH ginac-config 1 "December 1999" "GiNaC"
+.SH NAME
+ginac-config \- script to get information about the installed version of GiNaC
+.SH SYNOPSIS
+.B ginac-config
+.RI [\-\-prefix [=DIR] ]
+.RI [\-\-exec\-prefix [=DIR] ]
+[\-\-version] [\-\-libs] [\-\-cflags]
+.SH DESCRIPTION
+.B ginac-config
+is a tool that is used to configure to determine the compiler and linker
+flags that should be used to compile and link programs that use \fIGiNaC\fP.
+It is also used internally to the .m4 macros for GNU autoconf that are
+included with \fIGiNaC\fP.
+.SH OPTIONS
+.TP
+.B \-\-version
+prints the currently installed version of \fIGiNaC\fP on the standard output.
+.TP
+.B \-\-libs
+prints the linker flags that are necessary to link a \fIGiNaC\fP program.
+.TP
+.B \-\-cflags
+prints the compiler flags that are necessary to compile a \fIGiNaC\fP program.
+.TP
+.BI "\-\-prefix=" PREFIX
+If specified, use PREFIX instead of the installation prefix that \fIGiNaC\fP
+was built with when computing the output for the \-\-cflags and
+\-\-libs options. This option is also used for the exec prefix
+if \-\-exec\-prefix was not specified. This option must be specified
+before any \-\-libs or \-\-cflags options.
+.TP
+.BI "\-\-exec\-prefix=" PREFIX
+If specified, use PREFIX instead of the installation exec prefix that
+\fIGiNaC\fP was built with when computing the output for the \-\-cflags
+and \-\-libs options.  This option must be specified before any
+\-\-libs or \-\-cflags options.
+.SH AUTHOR
+.TP
+The GiNaC Group:
+.br
+Christian Bauer <Christian.Bauer@uni-mainz.de>
+.br
+Alexander Frink <Alexander.Frink@uni-mainz.de>
+.br
+Richard B. Kreckel <Richard.Kreckel@uni-mainz.de>
+.SH SEE ALSO
+GiNaC Tutorial \- An open framework for symbolic computation within the
+C++ programming language
+.SH COPYRIGHT
+Copyright \(co 1999 Johannes Gutenberg Universit\(:at Mainz, Germany
+Based on gtk-config Copyright \(co 1998 Owen Taylor
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
index 23389186838c57aed01678b003659896ef9f318b..db541b8bb3204fcef645ccbc75e9914870dc67bf 100644 (file)
@@ -51,14 +51,21 @@ CLEANFILES = *.html *.gif doxygen.css *.ps latex/*
 EXTRA_DIST = DoxyfileHTML DoxyfileTEX Doxyfooter
 
 install-data-local:
-       $(INSTALL_DATA) $(srcdir)/doxygen.css $(DESTDIR)$(ginacreferencedir)/doxygen.css
+       @if [ -f $(srcdir)/doxygen.css ]; then \
+         echo " $(INSTALL_DATA) $(srcdir)/doxygen.css $(DESTDIR)$(ginacreferencedir)/doxygen.css"; \
+         $(INSTALL_DATA) $(srcdir)/doxygen.css $(DESTDIR)$(ginacreferencedir)/doxygen.css; \
+       fi
        @for p in *.html; do \
-         echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p"; \
-         $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p; \
+         if [ -f $(srcdir)/$$p ]; then \
+           echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p"; \
+           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p; \
+         fi; \
        done
        @for p in *.gif; do \
-         echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p"; \
-         $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p; \
+         if [ -f $(srcdir)/$$p ]; then \
+           echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p"; \
+           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p; \
+         fi; \
        done
 
 uninstall-local:
index 00fa110d32d46d65e131043014d3654502d94d8a..152e777b7be0ea18850bd9a5f4e76a60931b803f 100644 (file)
@@ -71,7 +71,9 @@ DOXYGEN = @DOXYGEN@
 DVIPS = @DVIPS@
 FIG2DEV = @FIG2DEV@
 GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@
+GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@
 GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@
+GINACLIB_LIBS = @GINACLIB_LIBS@
 GINACLIB_MAJOR_VERSION = @GINACLIB_MAJOR_VERSION@
 GINACLIB_MICRO_VERSION = @GINACLIB_MICRO_VERSION@
 GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@
@@ -275,14 +277,21 @@ reference.ps: latex latex/reference.ps
        cp ${srcdir}/latex/reference.ps reference.ps
 
 install-data-local:
-       $(INSTALL_DATA) $(srcdir)/doxygen.css $(DESTDIR)$(ginacreferencedir)/doxygen.css
+       @if [ -f $(srcdir)/doxygen.css ]; then \
+         echo " $(INSTALL_DATA) $(srcdir)/doxygen.css $(DESTDIR)$(ginacreferencedir)/doxygen.css"; \
+         $(INSTALL_DATA) $(srcdir)/doxygen.css $(DESTDIR)$(ginacreferencedir)/doxygen.css; \
+       fi
        @for p in *.html; do \
-         echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p"; \
-         $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p; \
+         if [ -f $(srcdir)/$$p ]; then \
+           echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p"; \
+           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p; \
+         fi; \
        done
        @for p in *.gif; do \
-         echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p"; \
-         $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p; \
+         if [ -f $(srcdir)/$$p ]; then \
+           echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p"; \
+           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginacreferencedir)/$$p; \
+         fi; \
        done
 
 uninstall-local:
index 5eb2479909b52c687f9377b3b4b09a7fa9e5c421..a2763b1c5a3f7154a74687073170f8378752d34d 100644 (file)
@@ -41,8 +41,10 @@ EXTRA_DIST = $(FIG) $(TXT)
 
 install-data-local:
        @for p in $(PNG); do \
-         echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginactutorialdir)/$$p"; \
-         $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginactutorialdir)/$$p; \
+          if [ -f $(srcdir)/$$p ]; then \
+           echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginactutorialdir)/$$p"; \
+           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginactutorialdir)/$$p; \
+         fi; \
        done
 
 uninstall-local:
index 8c17b366ed64ee845a403e167af375a148fd0df6..c1715667d27d96ba834bc84e0feb37b64db15189 100644 (file)
@@ -70,7 +70,9 @@ DOXYGEN = @DOXYGEN@
 DVIPS = @DVIPS@
 FIG2DEV = @FIG2DEV@
 GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@
+GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@
 GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@
+GINACLIB_LIBS = @GINACLIB_LIBS@
 GINACLIB_MAJOR_VERSION = @GINACLIB_MAJOR_VERSION@
 GINACLIB_MICRO_VERSION = @GINACLIB_MICRO_VERSION@
 GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@
@@ -414,8 +416,10 @@ ginac.html: ginac.texi version.texi $(PNG)
 
 install-data-local:
        @for p in $(PNG); do \
-         echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginactutorialdir)/$$p"; \
-         $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginactutorialdir)/$$p; \
+          if [ -f $(srcdir)/$$p ]; then \
+           echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginactutorialdir)/$$p"; \
+           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(ginactutorialdir)/$$p; \
+         fi; \
        done
 
 uninstall-local:
index e6d2d1a140b9f59cf44ad63b015820763b97adb3..5e47963a71ab70dc75cb5687036f3b0bc3a7e796 100644 (file)
@@ -86,6 +86,7 @@ framework for symbolic computation within the C++ programming language.
 * Extending GiNaC::              How to extend the library.
 * A Comparison With Other CAS::  Compares GiNaC to traditional CAS.
 * Internal Structures::          Description of some internal structures.
+* Package Tools::                Configuring packages to work with GiNaC.
 * Bibliography::
 * Concept Index::
 @end menu
@@ -203,6 +204,9 @@ $ ./hello
 355687428096000*x*y+20922789888000*y^2+6402373705728000*x^2
 @end example
 
+(@xref{Package Tools}, for tools that help you when creating a software
+package that uses GiNaC.)
+
 @cindex Hermite polynomial
 Next, there is a more meaningful C++ program that calls a function which
 generates Hermite polynomials in a specified free variable.
@@ -600,6 +604,7 @@ configuration again with the same @var{PREFIX} thus creating a
 do it by hand since you now know where all the files went during
 installation.}.
 
+
 @node Basic Concepts, Expressions, Installing GiNaC, Top
 @c    node-name, next, previous, up
 @chapter Basic Concepts
@@ -642,7 +647,7 @@ ex MyEx5 = MyEx4 + 1;               // similar to above
 
 Expressions are handles to other more fundamental objects, that many
 times contain other expressions thus creating a tree of expressions
-(@xref{Internal Structures} for particular examples).  Most methods on
+(@xref{Internal Structures}, for particular examples).  Most methods on
 @code{ex} therefore run top-down through such an expression tree.  For
 example, the method @code{has()} scans recursively for occurrences of
 something inside an expression.  Thus, if you have declared @code{MyEx4}
@@ -1802,7 +1807,7 @@ Marshall Cline.  Chapter 16 covers this issue and presents an
 implementation which is pretty close to the one in GiNaC.
 
 
-@node Internal representation of products and sums, Bibliography, Expressions are reference counted, Internal Structures
+@node Internal representation of products and sums, Package Tools, Expressions are reference counted, Internal Structures
 @c    node-name, next, previous, up
 @appendixsection Internal representation of products and sums
 
@@ -1870,8 +1875,281 @@ expansion and the like are reimplemented for @code{add} and @code{mul},
 but the data structure is inherited from @code{expairseq}.
 
 
+@node Package Tools, ginac-config, Internal representation of products and sums, Top
+@c    node-name, next, previous, up
+@appendix Package Tools
+
+If you are creating a software package that uses the GiNaC library,
+setting the correct command line options for the compiler and linker
+can be difficult. GiNaC includes two tools to make this process easier.
+
+@menu
+* ginac-config::   A shell script to detect compiler and linker flags.
+* AM_PATH_GINAC::  Macro for GNU automake.
+@end menu
+
+
+@node ginac-config, AM_PATH_GINAC, Package Tools, Package Tools
+@c    node-name, next, previous, up
+@section @command{ginac-config}
+@cindex ginac-config
+
+@command{ginac-config} is a shell script that you can use to determine
+the compiler and linker command line options required to compile and
+link a program with the GiNaC library.
+
+@command{ginac-config} takes the following flags:
+
+@table @samp
+@item --version
+Prints out the version of GiNaC installed.
+@item --cppflags
+Prints '-I' flags pointing to the installed header files.
+@item --libs
+Prints out the linker flags necessary to link a program against GiNaC.
+@item --prefix[=@var{PREFIX}]
+If @var{PREFIX} is specified, overrides the configured value of @env{$prefix}.
+(And of exec-prefix, unless --exec-prefix is also specified)
+Otherwise, prints out the configured value of @env{$prefix}.
+@item --exec-prefix[=@var{PREFIX}]
+If @var{PREFIX} is specified, overrides the configured value of @env{$exec_prefix}.
+Otherwise, prints out the configured value of @env{$exec_prefix}.
+@end table
+
+Typically, @command{ginac-config} will be used within a configure script,
+as described below. It, however, can also be used directly
+from the command line to compile a simple program. For example:
+
+@example
+c++ -o simple `ginac-config --cppflags` simple.cpp `ginac-config --libs`
+@end example
+
+This command line might expand to (for example):
+
+@example
+cc -o simple -I/usr/local/include simple.cpp -L/usr/local/lib \
+  -lginac -lcln -lstdc++
+@end example
+
+Not only is the form using @command{ginac-config} easier to type, it will
+work on any system, no matter how GiNaC was configured.
+
+
+@node AM_PATH_GINAC, Configure script options, ginac-config, Package Tools
+@c    node-name, next, previous, up
+@section @samp{AM_PATH_GINAC}
+@cindex AM_PATH_GINAC
+
+For packages configured using GNU automake, GiNaC also provides
+a macro to automate the process of checking for GiNaC.
+
+@example
+AM_PATH_GINAC([@var{MINIMUM-VERSION}, [@var{ACTION-IF-FOUND} [, @var{ACTION-IF-NOT-FOUND}]]])
+@end example
+
+This macro:
+
+@itemize @bullet
+
+@item
+Determines the location of GiNaC using @command{ginac-config}, which is
+either found in the user's path, or from the environment variable
+@env{GINACLIB_CONFIG}.
+
+@item
+Tests the installed libraries to make sure that there version
+is later than @var{MINIMUM-VERSION}. (A default version will be used
+if not specified)
+
+@item
+If the required version was found, sets the @env{GINACLIB_CPPFLAGS} variable
+to the output of @command{ginac-config --cppflags} and the @env{GINACLIB_LIBS}
+variable to the output of @command{ginac-config --libs}, and calls
+@samp{AC_SUBST()} for these variables so they can be used in generated
+makefiles, and then executes @var{ACTION-IF-FOUND}.
+
+@item
+If the required version was not found, sets @env{GINACLIB_CPPFLAGS} and
+@env{GINACLIB_LIBS} to empty strings, and executes @var{ACTION-IF-NOT-FOUND}.
+
+@end itemize
+
+This macro is in file @file{ginac.m4} which is installed in
+@file{$datadir/aclocal}. Note that if automake was installed with a
+different @samp{--prefix} than GiNaC, you will either have to manually
+move @file{ginac.m4} to automake's @file{$datadir/aclocal}, or give
+aclocal the @samp{-I} option when running it.
+
+@menu
+* Configure script options::  Configuring a package that uses AM_PATH_GINAC.
+* Example package::           Example of a package using AM_PATH_GINAC.
+@end menu
+
+
+@node Configure script options, Example package, AM_PATH_GINAC, AM_PATH_GINAC
+@c    node-name, next, previous, up
+@subsection Configuring a package that uses @samp{AM_PATH_GINAC}
+
+Simply make sure that @command{ginac-config} is in your path, and run
+the configure script.
+
+Notes:
+
+@itemize @bullet
+
+@item
+The directory where the GiNaC libraries are installed needs
+to be found by your system's dynamic linker.
+  
+This is generally done by
+
+@display
+editing @file{/etc/ld.so.conf} and running @command{ldconfig}
+@end display
+
+or by
+   
+@display
+setting the environment variable @env{LD_LIBRARY_PATH},
+@end display
+
+or, as a last resort, 
+@display
+giving a @samp{-R} or @samp{-rpath} flag (depending on your linker) when
+running configure, for instance:
+
+@example
+LDFLAGS=-R/home/cbauer/lib ./configure
+@end example
+@end display
+
+@item
+You can also specify a @command{ginac-config} not in your path by
+setting the @env{GINACLIB_CONFIG} environment variable to the
+name of the executable
+
+@item
+If you move the GiNaC package from its installed location,
+you will need either need to modify @command{ginac-config} script
+manually to point to the new location or rebuild GiNaC.
+
+@end itemize
+
+Advanced note:
+
+@itemize @bullet
+@item
+configure flags
+  
+@example
+--with-ginac-prefix=@var{PREFIX}
+--with-ginac-exec-prefix=@var{PREFIX}
+@end example
+
+are provided to override the prefix and exec-prefix that were stored
+in the @command{ginac-config} shell script by GiNaC's configure. You are
+generally better off configuring GiNaC with the right path to begin with.
+@end itemize
+
+
+@node Example package, Bibliography, Configure script options, AM_PATH_GINAC
+@c    node-name, next, previous, up
+@subsection Example of a package using @samp{AM_PATH_GINAC}
+
+The following shows how to build a simple package using automake
+and the @samp{AM_PATH_GINAC} macro. The program used here is @file{simple.cpp}:
+
+@example
+#include <ginac/ginac.h>
+using namespace GiNaC;
+
+int main(void)
+@{
+    symbol x("x");
+    ex a = sin(x); 
+    cout << "Derivative of " << a << " is " << a.diff(x) << endl;
+    return 0;
+@}
+@end example
+
+You should first read the introductory portions of the automake
+Manual, if you are not already familiar with it.
+
+Two files are needed, @file{configure.in}, which is used to build the
+configure script:
+
+@example
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(simple.cpp)
+AM_INIT_AUTOMAKE(simple.cpp, 1.0.0)
+
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_LANG_CPLUSPLUS
+
+AM_PATH_GINAC(0.4.0, [
+  LIBS="$LIBS $GINACLIB_LIBS"
+  CPPFLAGS="$CFLAGS $GINACLIB_CPPFLAGS"  
+], AC_MSG_ERROR([need to have GiNaC installed]))
+
+AC_OUTPUT(Makefile)
+@end example
+
+The only command in this which is not standard for automake
+is the @samp{AM_PATH_GINAC} macro.
+
+That command does the following:
+
+@display
+If a GiNaC version greater than 0.4.0 is found, adds @env{$GINACLIB_LIBS} to 
+@env{$LIBS} and @env{$GINACLIB_CPPFLAGS} to @env{$CPPFLAGS}. Otherwise, dies
+with the error message "need to have GiNaC installed"
+@end display
+
+And the @file{Makefile.am}, which will be used to build the Makefile.
+
+@example
+## Process this file with automake to produce Makefile.in
+bin_PROGRAMS = simple
+simple_SOURCES = simple.cpp
+@end example
+
+This @file{Makefile.am}, says that we are building a single executable,
+from a single sourcefile @file{simple.cpp}. Since every program
+we are building uses GiNaC we simply added the GiNaC options
+to @env{$LIBS} and @env{$CPPFLAGS}, but in other circumstances, we might
+want to specify them on a per-program basis: for instance by
+adding the lines:
+
+@example
+simple_LDADD = $(GINACLIB_LIBS)
+INCLUDES = $(GINACLIB_CPPFLAGS)
+@end example
+
+to the @file{Makefile.am}.
+
+To try this example out, create a new directory and add the three
+files above to it.
+
+Now execute the following commands:
+
+@example
+$ automake --add-missing
+$ aclocal
+$ autoconf
+@end example
+
+You now have a package that can be built in the normal fashion
+
+@example
+$ ./configure
+$ make
+$ make install
+@end example
+
 
-@node Bibliography, Concept Index, Internal representation of products and sums, Top
+@node Bibliography, Concept Index, Example package, Top
 @c    node-name, next, previous, up
 @appendix Bibliography
 
index e176f4cfe3caa2713acfa33077e3f4ec068dacfd..468f23dedc1c5990bb965bd4edf481606c8b9e65 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 26 November 1999
+@set UPDATED 30 November 1999
 @set EDITION 0.4.0
 @set VERSION 0.4.0
index e176f4cfe3caa2713acfa33077e3f4ec068dacfd..468f23dedc1c5990bb965bd4edf481606c8b9e65 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 26 November 1999
+@set UPDATED 30 November 1999
 @set EDITION 0.4.0
 @set VERSION 0.4.0
diff --git a/ginac-config.in b/ginac-config.in
new file mode 100644 (file)
index 0000000..dd2fbaa
--- /dev/null
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+exec_prefix_set=no
+
+usage="\
+Usage: ginac-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cppflags]"
+
+if test $# -eq 0; then
+      echo "${usage}" 1>&2
+      exit 1
+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
+      if test $exec_prefix_set = no ; then
+        exec_prefix=$optarg
+      fi
+      ;;
+    --prefix)
+      echo $prefix
+      ;;
+    --exec-prefix=*)
+      exec_prefix=$optarg
+      exec_prefix_set=yes
+      ;;
+    --exec-prefix)
+      echo $exec_prefix
+      ;;
+    --version)
+      echo @GINACLIB_VERSION@
+      ;;
+    --cppflags)
+      if test @includedir@ != /usr/include ; then
+        includes=-I@includedir@
+      fi
+      echo $includes @GINACLIB_CPPFLAGS@
+      ;;
+    --libs)
+      libdirs=-L@libdir@
+      echo $libdirs -lginac @GINACLIB_LIBS@
+      ;;
+    *)
+      echo "${usage}" 1>&2
+      exit 1
+      ;;
+  esac
+  shift
+done
diff --git a/ginac.m4 b/ginac.m4
new file mode 100644 (file)
index 0000000..ebe3029
--- /dev/null
+++ b/ginac.m4
@@ -0,0 +1,166 @@
+# Configure paths for GiNaC
+# Christian Bauer 12/1/99
+# stolen from Sam Lantinga
+# stolen from Manish Singh
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_GINAC([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for GiNaC, and define GINACLIB_CPPFLAGS and GINACLIB_LIBS
+dnl
+AC_DEFUN(AM_PATH_GINAC,
+[dnl 
+dnl Get the cppflags and libraries from the ginac-config script
+dnl
+AC_ARG_WITH(ginac-prefix,[  --with-ginac-prefix=PFX Prefix where GiNaC is installed (optional)],
+            ginac_prefix="$withval", ginac_prefix="")
+AC_ARG_WITH(ginac-exec-prefix,[  --with-ginac-exec-prefix=PFX Exec prefix where GiNaC is installed (optional)],
+            ginac_exec_prefix="$withval", ginac_exec_prefix="")
+AC_ARG_ENABLE(ginactest, [  --disable-ginactest     Do not try to compile and run a test GiNaC program],
+                   , enable_ginactest=yes)
+
+  if test x$ginac_exec_prefix != x ; then
+     ginac_args="$ginac_args --exec-prefix=$ginac_exec_prefix"
+     if test x${GINACLIB_CONFIG+set} != xset ; then
+        GINACLIB_CONFIG=$ginac_exec_prefix/bin/ginac-config
+     fi
+  fi
+  if test x$ginac_prefix != x ; then
+     ginac_args="$ginac_args --prefix=$ginac_prefix"
+     if test x${GINACLIB_CONFIG+set} != xset ; then
+        GINACLIB_CONFIG=$ginac_prefix/bin/ginac-config
+     fi
+  fi
+
+  AC_PATH_PROG(GINACLIB_CONFIG, ginac-config, no)
+  min_ginac_version=ifelse([$1], ,0.4.0,$1)
+  AC_MSG_CHECKING(for GiNaC - version >= $min_ginac_version)
+  no_ginac=""
+  if test "$GINACLIB_CONFIG" = "no" ; then
+    no_ginac=yes
+  else
+    GINACLIB_CPPFLAGS=`$GINACLIB_CONFIG $ginacconf_args --cppflags`
+    GINACLIB_LIBS=`$GINACLIB_CONFIG $ginacconf_args --libs`
+
+    ginac_major_version=`$GINACLIB_CONFIG $ginac_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    ginac_minor_version=`$GINACLIB_CONFIG $ginac_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    ginac_micro_version=`$GINACLIB_CONFIG $ginac_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_ginactest" = "xyes" ; then
+      ac_save_CPPFLAGS="$CPPFLAGS"
+      ac_save_LIBS="$LIBS"
+      CPPFLAGS="$CPPFLAGS $GINACLIB_CPPFLAGS"
+      LIBS="$LIBS $GINACLIB_LIBS"
+dnl
+dnl Now check if the installed GiNaC is sufficiently new. (Also sanity
+dnl checks the results of ginac-config to some extent
+dnl
+      rm -f conf.ginactest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ginac/ginac.h>
+
+char*
+my_strdup (char *str)
+{
+  char *new_str;
+  
+  if (str)
+    {
+      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+      strcpy (new_str, str);
+    }
+  else
+    new_str = NULL;
+  
+  return new_str;
+}
+
+int main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.ginactest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = my_strdup("$min_ginac_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_ginac_version");
+     exit(1);
+   }
+
+   if (($ginac_major_version > major) ||
+      (($ginac_major_version == major) && ($ginac_minor_version > minor)) ||
+      (($ginac_major_version == major) && ($ginac_minor_version == minor) && ($ginac_micro_version >= micro)))
+    {
+      return 0;
+    }
+  else
+    {
+      printf("\n*** 'ginac-config --version' returned %d.%d.%d, but the minimum version\n", $ginac_major_version, $ginac_minor_version, $ginac_micro_version);
+      printf("*** of GiNaC required is %d.%d.%d. If ginac-config is correct, then it is\n", major, minor, micro);
+      printf("*** best to upgrade to the required version.\n");
+      printf("*** If ginac-config was wrong, set the environment variable GINACLIB_CONFIG\n");
+      printf("*** to point to the correct copy of ginac-config, and remove the file\n");
+      printf("*** config.cache before re-running configure\n");
+      return 1;
+    }
+}
+
+],, no_ginac=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CPPFLAGS="$ac_save_CPPFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_ginac" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$GINACLIB_CONFIG" = "no" ; then
+       echo "*** The ginac-config script installed by GiNaC could not be found"
+       echo "*** If GiNaC was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GINACLIB_CONFIG environment variable to the"
+       echo "*** full path to ginac-config."
+     else
+       if test -f conf.ginactest ; then
+        :
+       else
+          echo "*** Could not run GiNaC test program, checking why..."
+          CPPFLAGS="$CFLAGS $GINACLIB_CPPFLAGS"
+          LIBS="$LIBS $GINACLIB_LIBS"
+          AC_TRY_LINK([
+#include <stdio.h>
+#include <ginac/ginac.h>
+],      [ return 0; ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GiNaC or finding the wrong"
+          echo "*** version of GiNaC. If it is not finding GiNaC, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GiNaC was incorrectly installed"
+          echo "*** or that you have moved GiNaC since it was installed. In the latter case, you"
+          echo "*** may want to edit the ginac-config script: $GINACLIB_CONFIG" ])
+          CPPFLAGS="$ac_save_CPPFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GINACLIB_CPPFLAGS=""
+     GINACLIB_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GINACLIB_CPPFLAGS)
+  AC_SUBST(GINACLIB_LIBS)
+  rm -f conf.ginactest
+])
index 0f8ae530becaa1079ecad17b5354aae37785a599..0a0c330651cbedf6c266594c2e2ffc53dcfcd4ce 100644 (file)
@@ -68,7 +68,9 @@ DOXYGEN = @DOXYGEN@
 DVIPS = @DVIPS@
 FIG2DEV = @FIG2DEV@
 GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@
+GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@
 GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@
+GINACLIB_LIBS = @GINACLIB_LIBS@
 GINACLIB_MAJOR_VERSION = @GINACLIB_MAJOR_VERSION@
 GINACLIB_MICRO_VERSION = @GINACLIB_MICRO_VERSION@
 GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@
index 97771d05da0e10b2e9d12bbf4218a5aaa087b146..8bb6e4f5793cba54cbbe692df65450516e7be19a 100644 (file)
@@ -68,7 +68,9 @@ DOXYGEN = @DOXYGEN@
 DVIPS = @DVIPS@
 FIG2DEV = @FIG2DEV@
 GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@
+GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@
 GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@
+GINACLIB_LIBS = @GINACLIB_LIBS@
 GINACLIB_MAJOR_VERSION = @GINACLIB_MAJOR_VERSION@
 GINACLIB_MICRO_VERSION = @GINACLIB_MICRO_VERSION@
 GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@