[GiNaC-devel] [PATCH] build scripts: drop ginac-config and ginac.m4, use pkg-config instead. [ginac-1.3]

Alexei Sheplyakov varg at theor.jinr.ru
Thu Mar 22 12:03:17 CET 2007


---
 GiNaC.spec.in               |    3 -
 Makefile.am                 |   14 +----
 configure.ac                |    3 -
 debian/control              |    2 +-
 debian/libginac-dev.install |    3 -
 ginac-config.1.in           |   64 -----------------
 ginac-config.in             |   57 ---------------
 ginac.m4                    |  160 -------------------------------------------
 8 files changed, 2 insertions(+), 304 deletions(-)

diff --git a/GiNaC.spec.in b/GiNaC.spec.in
index 38f7acc..3413d32 100644
--- a/GiNaC.spec.in
+++ b/GiNaC.spec.in
@@ -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)
diff --git a/Makefile.am b/Makefile.am
index b30fe2d..0a4dca8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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
diff --git a/configure.ac b/configure.ac
index c6e6d5b..ea59ac4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,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
@@ -159,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
diff --git a/debian/control b/debian/control
index f27de2e..4dc627c 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: ginac
 Section: math
 Priority: optional
 Maintainer: Richard Kreckel <kreckel at 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
diff --git a/debian/libginac-dev.install b/debian/libginac-dev.install
index 19a09d2..c3bd40a 100644
--- a/debian/libginac-dev.install
+++ b/debian/libginac-dev.install
@@ -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*
diff --git a/ginac-config.1.in b/ginac-config.1.in
deleted file mode 100644
index bedeb32..0000000
--- a/ginac-config.1.in
+++ /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 at uni-mainz.de>
-.br
-Alexander Frink <Alexander.Frink at uni-mainz.de>
-.br
-Richard Kreckel <Richard.Kreckel at uni-mainz.de>
-.br
-Jens Vollinga <vollinga at 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
index dd2fbaa..0000000
--- a/ginac-config.in
+++ /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 at includedir@
-      fi
-      echo $includes @GINACLIB_CPPFLAGS@
-      ;;
-    --libs)
-      libdirs=-L at 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
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
-])
-- 
1.4.4.4

-- 
All science is either physics or stamp collecting.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/ginac-devel/attachments/20070322/34cc5ce7/attachment.pgp


More information about the GiNaC-devel mailing list