]> www.ginac.de Git - ginac.git/commitdiff
* Use pkg-config for detecting CLN, advertise it in the manual and drop
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Thu, 29 Mar 2007 05:30:21 +0000 (05:30 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Thu, 29 Mar 2007 05:30:21 +0000 (05:30 +0000)
  ginac-config and ginac.m4. [Alexei Sheplyakov]

GiNaC.spec.in
Makefile.am
configure.ac
debian/control
debian/libginac-dev.install
doc/tutorial/ginac.texi
ginac-config.1.in [deleted file]
ginac-config.in [deleted file]
ginac.m4 [deleted file]
ginac.pc.in
ginac/Makefile.am

index 38f7acc2d031712c1fd9150f34019ace1ddc1c53..3413d328c84250dbd937a73ed090c3966e0ad6c4 100644 (file)
@@ -92,9 +92,6 @@ fi
 %{_libdir}/pkgconfig/ginac.pc
 %{_includedir}/ginac
 %{_infodir}/*.info*
-%{_mandir}/man1/ginac-config.1*
-%{_bindir}/ginac-config
-%{_datadir}/aclocal/ginac.m4
 
 %files utils
 %defattr(-,root,root)
index b30fe2d2731adb502b6dd94a55eb28db75061607..0a4dca80db872753fdfc7b1214fa671bb2e9cc2a 100644 (file)
@@ -2,25 +2,13 @@
 SUBDIRS = ginac check ginsh tools doc
 DIST_SUBDIRS = ginac check ginsh tools doc
 
-# GiNaC runtime configuration script
-bin_SCRIPTS = ginac-config
-BUILT_SOURCES = ginac-config
-ginac-config: ginac-config.in
-
-# Man pages
-man_MANS = ginac-config.1
-
-# M4 macro file for inclusion with autoconf
-m4datadir = $(datadir)/aclocal
-m4data_DATA = ginac.m4
-
 # pkg-config metadata
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = ginac.pc
 $(pkgconfig_DATA): config.status
 
 # All the rest of the distributed files
-EXTRA_DIST = ginac.m4 ginac.pc GiNaC.spec depcomp
+EXTRA_DIST = ginac.pc GiNaC.spec
 
 # Rule to build tar-bzipped distribution package
 $(PACKAGE)-$(VERSION).tar.gz: dist
index 993087d4a17a15d1de89f74e73e4b116d4824b93..7ee2cd9469092edc58c9f1f0fceb6a4c13756c83 100644 (file)
@@ -117,18 +117,12 @@ if test "x$CONFIG_RUSAGE" = "xno"; then
 fi
 
 dnl We need to have Bruno Haible's CLN installed.
-dnl (CLN versions >= 1.1.0 must have installed cln.m4 at a visible place,
-dnl which provides this macro):
-AC_PATH_CLN(1.1.0, [
-  LIBS="$LIBS $CLN_LIBS"
-  CPPFLAGS="$CPPFLAGS $CLN_CPPFLAGS"
-], GINAC_ERROR([No suitable installed version of CLN could be found.]))
-
-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 (pkg-config must have installed pkg.m4 at a visible place, which provides
+dnl this macro. CLN >= 1.1.6 must have installed cln.pc at a visible place,
+dnl which provides the actual dependency information.)
+PKG_CHECK_MODULES(CLN, cln >= 1.1.6)
+LIBS="$LIBS $CLN_LIBS"
+CPPFLAGS="$CPPFLAGS $CLN_CFLAGS"
 
 dnl Check for utilities needed by the different kinds of documentation.
 dnl Documentation needs only be built when extending it, so never mind if it
@@ -147,8 +141,6 @@ dnl Output makefiles etc.
 AC_CONFIG_FILES([
 Makefile
 GiNaC.spec
-ginac-config
-ginac-config.1
 ginac.pc
 ginac/Makefile
 ginac/version.h
@@ -165,7 +157,6 @@ doc/reference/DoxyfileTEX
 doc/reference/DoxyfilePDF
 doc/reference/Doxyfooter
 ])
-AC_CONFIG_COMMANDS([default],[[chmod +x ginac-config]],[[]])
 AC_OUTPUT
 dnl Display a final warning if there has been a GINAC_ERROR or a GINAC_WARNING
 GINAC_CHECK_ERRORS
index f27de2ef06b54ac366ea6f1f106342b57f825b32..4dc627cd56476c7786f1851d229184ee6c9bc6e3 100644 (file)
@@ -2,7 +2,7 @@ Source: ginac
 Section: math
 Priority: optional
 Maintainer: Richard Kreckel <kreckel@ginac.de>
-Build-Depends: cdbs (>= 0.4.28), debhelper (>= 5), libcln-dev, libgmp3-dev, libreadline5-dev
+Build-Depends: cdbs (>= 0.4.28), debhelper (>= 5), libcln-dev, libgmp3-dev, libreadline5-dev, pkg-config (>= 0.18)
 Standards-Version: 3.6.2
 
 Package: libginac1.3c2a
index 19a09d275cf541586e8e6109536e6cd77517b29f..c3bd40aed34b4ee7de30257cb5e036f50e7821a5 100644 (file)
@@ -2,8 +2,5 @@ debian/tmp/usr/lib/libginac.la
 debian/tmp/usr/lib/libginac.a
 debian/tmp/usr/lib/libginac.so
 debian/tmp/usr/include/ginac/*
-debian/tmp/usr/bin/ginac-config
-debian/tmp/usr/share/aclocal/ginac.m4
 debian/tmp/usr/lib/pkgconfig/ginac.pc
 debian/tmp/usr/share/info/ginac*
-debian/tmp/usr/share/man/man1/ginac-config*
index 2668355f77b628719f6962952653eed4608b7f19..7c8f69b90745ad8aafad0fb0067929ee9bf91ad5 100644 (file)
@@ -478,9 +478,10 @@ met.  First of all, you need to have a C++-compiler adhering to the
 ANSI-standard @cite{ISO/IEC 14882:1998(E)}.  We used GCC for development
 so if you have a different compiler you are on your own.  For the
 configuration to succeed you need a Posix compliant shell installed in
-@file{/bin/sh}, GNU @command{bash} is fine.  Perl is needed by the built
-process as well, since some of the source files are automatically
-generated by Perl scripts.  Last but not least, the CLN library
+@file{/bin/sh}, GNU @command{bash} is fine. The pkg-config utility is
+required for the configuration, it can be downloaded from
+@uref{http://pkg-config.freedesktop.org}.
+Last but not least, the CLN library
 is used extensively and needs to be installed on your system.
 Please get it from @uref{ftp://ftpthep.physik.uni-mainz.de/pub/gnu/}
 (it is covered by GPL) and install it prior to trying to install
@@ -553,7 +554,7 @@ warning levels.  If omitted, it defaults to @option{-g
 the file @file{configure.ac}.  It is only distributed in packaged
 releases of GiNaC.  If you got the naked sources, e.g. from CVS, you
 must generate @command{configure} along with the various
-@file{Makefile.in} by using the @command{autogen.sh} script.  This will
+@file{Makefile.in} by using the @command{autoreconf} utility.  This will
 require a fair amount of support from your local toolchain, though.}
 
 The whole process is illustrated in the following two
@@ -8304,78 +8305,38 @@ 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
+@node Package Tools, Configure script options, 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 @code{--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 using backquotes to compile a simple program. For
-example:
-
+setting the correct command line options for the compiler and linker can
+be difficult.  The @command{pkg-config} utility makes this process
+easier.  GiNaC supplies all necessary data in @file{ginac.pc} (installed
+into @code{/usr/local/lib/pkgconfig} by default). To compile a simple
+program use @footnote{If GiNaC is installed into some non-standard
+directory @var{prefix} one should set the @var{PKG_CONFIG_PATH}
+environment variable to @var{prefix}/lib/pkgconfig for this to work.}
 @example
-c++ -o simple `ginac-config --cppflags` simple.cpp `ginac-config --libs`
+g++ -o simple `pkg-config --cflags --libs ginac` simple.cpp
 @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++
+g++ -o simple -lginac -lcln simple.cpp
 @end example
 
-Not only is the form using @command{ginac-config} easier to type, it will
+Not only is the form using @command{pkg-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.
+For packages configured using GNU automake, @command{pkg-config} also
+provides the @code{PKG_CHECK_MODULES} macro to automate the process of
+checking for libraries
 
 @example
-AM_PATH_GINAC([@var{MINIMUM-VERSION}, [@var{ACTION-IF-FOUND}
-              [, @var{ACTION-IF-NOT-FOUND}]]])
+PKG_CHECK_MODULES(MYAPP, ginac >= MINIMUM_VERSION, 
+                  [@var{ACTION-IF-FOUND}],
+                  [@var{ACTION-IF-NOT-FOUND}])
 @end example
 
 This macro:
@@ -8383,113 +8344,91 @@ 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}.
+Determines the location of GiNaC using data from @file{ginac.pc}, which is
+either found in the default @command{pkg-config} search path, or from 
+the environment variable @env{PKG_CONFIG_PATH}.
 
 @item
 Tests the installed libraries to make sure that their version
-is later than @var{MINIMUM-VERSION}. (A default version will be used
-if not specified)
+is later than @var{MINIMUM-VERSION}.
 
 @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
+If the required version was found, sets the @env{MYAPP_CFLAGS} variable
+to the output of @command{pkg-config --cflags ginac} and the @env{MYAPP_LIBS}
+variable to the output of @command{pkg-config --libs ginac}, 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}.
+If the required version was not found, 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.
+* Configure script options::  Configuring a package that uses GiNaC
+* Example package::           Example of a package using GiNaC
 @end menu
 
 
-@node Configure script options, Example package, AM_PATH_GINAC, AM_PATH_GINAC
+@node Configure script options, Example package, Package Tools, Package Tools 
 @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.
+@subsection Configuring a package that uses GiNaC
 
-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
+to be found by your system's dynamic linkers (both compile- and run-time
+ones).  See the documentation of your system linker for details.  Also
+make sure that @file{ginac.pc} is in @command{pkg-config}'s search path,
+@xref{pkg-config, ,pkg-config, *manpages*}.
 
-@display
-editing @file{/etc/ld.so.conf} and running @command{ldconfig}
-@end display
+The short summary below describes how to do this on a GNU/Linux
+system.
 
-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:
+Suppose GiNaC is installed into the directory @samp{PREFIX}. To tell
+the linkers where to find the library one should
 
+@itemize @bullet
+@item
+edit @file{/etc/ld.so.conf} and run @command{ldconfig}. For example,
 @example
-LDFLAGS=-R/home/cbauer/lib ./configure
+# echo PREFIX/lib >> /etc/ld.so.conf
+# ldconfig
 @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
+or set the environment variables @env{LD_LIBRARY_PATH} and @env{LD_RUN_PATH}
+@example
+$ export LD_LIBRARY_PATH=PREFIX/lib
+$ export LD_RUN_PATH=PREFIX/lib
+@end example
 
 @item
-If you move the GiNaC package from its installed location,
-you will either need to modify @command{ginac-config} script
-manually to point to the new location or rebuild GiNaC.
+or give a @samp{-L} and @samp{--rpath} flags when running configure,
+for instance:
 
+@example
+$ LDFLAGS='-Wl,-LPREFIX/lib -Wl,--rpath=PREFIX/lib' ./configure
+@end example
 @end itemize
 
-Advanced note:
-
-@itemize @bullet
-@item
-configure flags
-  
+To tell @command{pkg-config} where the @file{ginac.pc} file is,
+set the @env{PKG_CONFIG_PATH} environment variable:
 @example
---with-ginac-prefix=@var{PREFIX}
---with-ginac-exec-prefix=@var{PREFIX}
+$ export PKG_CONFIG_PATH=PREFIX/lib/pkgconfig
 @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
+Finally, run the @command{configure} script
+@example
+$ ./configure 
+@end example
 
+@c There are many other ways to do the same, @xref{Options, ,Command Line Options, ld, GNU ld manual}.
 
-@node Example package, Bibliography, Configure script options, AM_PATH_GINAC
+@node Example package, Bibliography, Configure script options, Package Tools
 @c    node-name, next, previous, up
-@subsection Example of a package using @samp{AM_PATH_GINAC}
+@subsection Example of a package using 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}:
+and the @samp{PKG_CHECK_MODULES} macro. The program used here is @file{simple.cpp}:
 
 @example
 #include <iostream>
@@ -8508,33 +8447,39 @@ int main()
 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
+Two files are needed, @file{configure.ac}, 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)
+dnl Process this file with autoreconf to produce a configure script.
+AC_INIT([simple], 1.0.0, bogus@@example.net)
+AC_CONFIG_SRCDIR(simple.cpp)
+AM_INIT_AUTOMAKE([foreign 1.8])
 
 AC_PROG_CXX
 AC_PROG_INSTALL
-AC_LANG_CPLUSPLUS
+AC_LANG([C++])
 
-AM_PATH_GINAC(0.9.0, [
-  LIBS="$LIBS $GINACLIB_LIBS"
-  CPPFLAGS="$CPPFLAGS $GINACLIB_CPPFLAGS"  
-], AC_MSG_ERROR([need to have GiNaC installed]))
+PKG_CHECK_MODULES(SIMPLE, ginac >= 1.3.7)
 
 AC_OUTPUT(Makefile)
 @end example
 
-The only command in this which is not standard for automake
-is the @samp{AM_PATH_GINAC} macro.
+The @samp{PKG_CHECK_MODULES} macro does the following: If a GiNaC version
+greater or equal than 1.3.7 is found, then it defines @var{SIMPLE_CFLAGS}
+and @var{SIMPLE_LIBS}. Otherwise, it dies with the error message like
+@example
+configure: error: Package requirements (ginac >= 1.3.7) were not met:
+
+Requested 'ginac >= 1.3.7' but version of GiNaC is 1.3.5
 
-That command does the following: If a GiNaC version greater or equal
-than 0.7.0 is found, then it adds @env{$GINACLIB_LIBS} to @env{$LIBS}
-and @env{$GINACLIB_CPPFLAGS} to @env{$CPPFLAGS}. Otherwise, it dies with
-the error message `need to have GiNaC installed'
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables SIMPLE_CFLAGS
+and SIMPLE_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+@end example
 
 And the @file{Makefile.am}, which will be used to build the Makefile.
 
@@ -8542,31 +8487,24 @@ And the @file{Makefile.am}, which will be used to build the Makefile.
 ## Process this file with automake to produce Makefile.in
 bin_PROGRAMS = simple
 simple_SOURCES = simple.cpp
+simple_CPPFLAGS = $(SIMPLE_CFLAGS)
+simple_LDADD = $(SIMPLE_LIBS)
 @end example
 
 This @file{Makefile.am}, says that we are building a single executable,
 from a single source file @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}.
+we are building uses GiNaC we could have simply added @var{SIMPLE_CFLAGS}
+to @var{CPPFLAGS} and @var{SIMPLE_LIBS} to @var{LIBS}. However, it is
+more flexible to specify libraries and complier options on a per-program
+basis.
 
 To try this example out, create a new directory and add the three
 files above to it.
 
-Now execute the following commands:
+Now execute the following command:
 
 @example
-$ automake --add-missing
-$ aclocal
-$ autoconf
+$ autoreconf -i
 @end example
 
 You now have a package that can be built in the normal fashion
diff --git a/ginac-config.1.in b/ginac-config.1.in
deleted file mode 100644 (file)
index bedeb32..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-.TH ginac-config 1 "November, 2000" "GiNaC @VERSION@" "The GiNaC Group"
-.SH NAME
-ginac-config \- script to get information about the installed version of GiNaC
-.SH SYNOPSIS
-[\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version] [\-\-libs] [\-\-cppflags]
-.SH DESCRIPTION
-.PP
-.B ginac-config
-is a tool that is used to determine the compiler and linker flags that
-should be used to compile and link programs that use GiNaC. It is also used
-internally to the .m4 macros for GNU autoconf that are included with GiNaC.
-.SH OPTIONS
-.TP
-.B \-\-version
-Print the currently installed version of GiNaC on the standard output.
-.TP
-.B \-\-libs
-Print the linker flags that are necessary to link a GiNaC program.
-.TP
-.B \-\-cppflags
-Print the compiler flags that are necessary to compile a GiNaC program.
-.TP
-.B \-\-prefix=PREFIX
-If specified, use PREFIX instead of the installation prefix that GiNaC was
-built with when computing the output for the \-\-cppflags 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
-\-\-cppflags options.
-.TP
-.B \-\-exec\-prefix=PREFIX
-If specified, use PREFIX instead of the installation exec prefix that GiNaC
-was built with when computing the output for the \-\-cppflags and \-\-libs
-options.  This option must be specified before any \-\-libs or \-\-cppflags
-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 Kreckel <Richard.Kreckel@uni-mainz.de>
-.br
-Jens Vollinga <vollinga@thep.physik.uni-mainz.de>
-.SH SEE ALSO
-GiNaC Tutorial \- An open framework for symbolic computation within the
-C++ programming language
-.SH COPYRIGHT
-Copyright \(co 1999-2007 Johannes Gutenberg Universit\(:at Mainz, Germany
-
-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.
diff --git a/ginac-config.in b/ginac-config.in
deleted file mode 100644 (file)
index dd2fbaa..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/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
deleted file mode 100644 (file)
index 3e36e00..0000000
--- a/ginac.m4
+++ /dev/null
@@ -1,160 +0,0 @@
-# Configure paths for GiNaC
-# Richard Kreckel 12/12/2000
-# borrowed from Christian Bauer
-# 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, AC_HELP_STRING([--with-ginac-prefix=PFX], [Prefix where GiNaC is installed (optional)]),
-            ginac_prefix="$withval", ginac_prefix="")
-AC_ARG_WITH(ginac-exec-prefix, AC_HELP_STRING([--with-ginac-exec-prefix=PFX], [Exec prefix where GiNaC is installed (optional)]),
-            ginac_exec_prefix="$withval", ginac_exec_prefix="")
-AC_ARG_ENABLE(ginactest, AC_HELP_STRING([--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)
-ginac_min_version=ifelse([$1], ,0.7.0,$1)
-AC_MSG_CHECKING(for GiNaC - version >= $ginac_min_version)
-if test "$GINACLIB_CONFIG" = "no" ; then
-    AC_MSG_RESULT(no)
-    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."
-    ifelse([$3], , :, [$3])
-else
-dnl Parse required version and the result of ginac-config.
-    ginac_min_major_version=`echo $ginac_min_version | \
-            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-    ginac_min_minor_version=`echo $ginac_min_version | \
-            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-    ginac_min_micro_version=`echo $ginac_min_version | \
-            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-    GINACLIB_CPPFLAGS=`$GINACLIB_CONFIG $ginac_args --cppflags`
-    GINACLIB_LIBS=`$GINACLIB_CONFIG $ginac_args --libs`
-    ginac_config_version=`$GINACLIB_CONFIG $ginac_args --version`
-    ginac_config_major_version=`echo $ginac_config_version | \
-            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-    ginac_config_minor_version=`echo $ginac_config_version | \
-            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-    ginac_config_micro_version=`echo $ginac_config_version | \
-            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-dnl Check if the installed GiNaC is sufficiently new according to ginac-config.
-    if test \( $ginac_config_major_version -lt $ginac_min_major_version \) -o \
-            \( $ginac_config_major_version -eq $ginac_min_major_version -a $ginac_config_minor_version -lt $ginac_min_minor_version \) -o \
-            \( $ginac_config_major_version -eq $ginac_min_major_version -a $ginac_config_minor_version -eq $ginac_min_minor_version -a $ginac_config_micro_version -lt $ginac_min_micro_version \); then
-        echo -e "\n*** 'ginac-config --version' returned $ginac_config_major_version.$ginac_config_minor_version.$ginac_config_micro_version, but the minimum version"
-        echo "*** of GiNaC required is $ginac_min_major_version.$ginac_min_minor_version.$ginac_min_micro_version. If ginac-config is correct, then it is"
-        echo "*** best to upgrade to the required version."
-        echo "*** If ginac-config was wrong, set the environment variable GINACLIB_CONFIG"
-        echo "*** to point to the correct copy of ginac-config, and remove the file"
-        echo "*** config.cache before re-running configure."
-        ifelse([$3], , :, [$3])
-    else
-dnl The versions match so far.  Now do a sanity check: Does the result of ginac-config
-dnl match the version of the headers and the version built into the library, too?
-        no_ginac=""
-        if test "x$enable_ginactest" = "xyes" ; then
-            ac_save_CPPFLAGS="$CPPFLAGS"
-            ac_save_LIBS="$LIBS"
-            CPPFLAGS="$CPPFLAGS $GINACLIB_CPPFLAGS"
-            LIBS="$LIBS $GINACLIB_LIBS"
-            rm -f conf.ginactest
-            AC_TRY_RUN([
-#include <stdio.h>
-#include <string.h>
-#include <ginac/version.h>
-
-/* we do not #include <stdlib.h> because autoconf in C++ mode inserts a
-   prototype for exit() that conflicts with the one in stdlib.h */
-extern "C" int system(const char *);
-
-int main()
-{
-    int major, minor, micro;
-    char *tmp_version;
-
-    system("touch conf.ginactest");
-
-    if ((GINACLIB_MAJOR_VERSION != $ginac_config_major_version) ||
-        (GINACLIB_MINOR_VERSION != $ginac_config_minor_version) ||
-        (GINACLIB_MICRO_VERSION != $ginac_config_micro_version)) {
-        printf("\n*** 'ginac-config --version' returned %d.%d.%d, but the header file I found\n", $ginac_config_major_version, $ginac_config_minor_version, $ginac_config_micro_version);
-        printf("*** corresponds to %d.%d.%d. This mismatch suggests your installation of GiNaC\n", GINACLIB_MAJOR_VERSION, GINACLIB_MINOR_VERSION, GINACLIB_MICRO_VERSION);
-        printf("*** is corrupted or you have specified some wrong -I compiler flags.\n");
-        printf("*** Please inquire and consider reinstalling GiNaC.\n");
-        return 1;
-    }
-    if ((GiNaC::version_major != $ginac_config_major_version) ||
-        (GiNaC::version_minor != $ginac_config_minor_version) ||
-        (GiNaC::version_micro != $ginac_config_micro_version)) {
-        printf("\n*** 'ginac-config --version' returned %d.%d.%d, but the library I found\n", $ginac_config_major_version, $ginac_config_minor_version, $ginac_config_micro_version);
-        printf("*** corresponds to %d.%d.%d. This mismatch suggests your installation of GiNaC\n", GiNaC::version_major, GiNaC::version_minor, GiNaC::version_micro);
-        printf("*** is corrupted or you have specified some wrong -L compiler flags.\n");
-        printf("*** Please inquire and consider reinstalling GiNaC.\n");
-        return 1;
-    }
-    return 0;
-}
-],, no_ginac=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-            CPPFLAGS="$ac_save_CPPFLAGS"
-            LIBS="$ac_save_LIBS"
-        fi
-        if test "x$no_ginac" = x ; then
-            AC_MSG_RESULT([yes, $ginac_config_version])
-            ifelse([$2], , :, [$2])
-        else
-            AC_MSG_RESULT(no)
-            if test ! -f conf.ginactest ; then
-                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/version.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 "*** 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
-            GINACLIB_CPPFLAGS=""
-            GINACLIB_LIBS=""
-            ifelse([$3], , :, [$3])
-        fi
-    fi
-fi
-AC_SUBST(GINACLIB_CPPFLAGS)
-AC_SUBST(GINACLIB_LIBS)
-rm -f conf.ginactest
-])
index 47aeacc6471aecbaa9cc087a4ab3647ec9700dc0..352ba5d11dc52ff0c5884cb503403408d9859447 100644 (file)
@@ -6,9 +6,6 @@ includedir=@includedir@
 Name: GiNaC
 Description: C++ library for symbolic calculations
 Version: @VERSION@
-# uncomment this when a pkg-config'd cln exists
-# CAUTION: this will merge in the cln libs and cflags which are already in
-#          GINACLIB_LIBS and GINACLIB_CPPFLAGS
-#Requires: cln >= 1.1.0
-Libs: -L${libdir} -lginac @GINACLIB_LIBS@
-Cflags: -I${includedir} @GINACLIB_CPPFLAGS@
+Requires: cln >= 1.1.6
+Libs: -L${libdir} -lginac
+Cflags: -I${includedir}
index 0236f9b2db26746fbd4d403fcd31d3e4a2860c3c..4c0e87f17416e143ebb484417a5cabe30860b696 100644 (file)
@@ -11,6 +11,7 @@ libginac_la_SOURCES = add.cpp archive.cpp basic.cpp clifford.cpp color.cpp \
   utils.cpp wildcard.cpp input_parser.yy input_lexer.ll \
   input_lexer.h remember.h tostring.h utils.h
 libginac_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -release $(LT_RELEASE)
+libginac_la_LIBADD = $(DL_LIBS)
 ginacincludedir = $(includedir)/ginac
 ginacinclude_HEADERS = ginac.h add.h archive.h assertion.h basic.h class_info.h \
   clifford.h color.h constant.h container.h ex.h expair.h expairseq.h exprseq.h \