diff --git a/ChangeLog b/ChangeLog index d233ac6..b02fc87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-04-02 Alexei Sheplyakov + + Debian Bug#412103: + * cln.pc.in: list -lgmp in Libs.private instead of in Libs. + * doc/cln.tex: Undocument cln-config, properly document pkg-config. + * cln-config.1.in: Remove. + * cln-config.in: Remove. + * cln.m4: Remove. + * configure.ac: Don't output cln-config and cln-config.1. + 2006-12-24 Bruno Haible Make autoconfiguration work with gcc-4.3 snapshots. diff --git a/cln-config.1.in b/cln-config.1.in deleted file mode 100644 index 0155c15..0000000 --- a/cln-config.1.in +++ /dev/null @@ -1,54 +0,0 @@ -.TH cln-config 1 "November, 2000" "CLN @CL_VERSION@" "GNU" -.SH NAME -cln-config \- script to get information about the installed version of the CLN library -.SH SYNOPSIS -[\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version] [\-\-libs] [\-\-cppflags] -.SH DESCRIPTION -.PP -.B cln-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 CLN. -.SH OPTIONS -.TP -.B \-\-version -Print the currently installed version of CLN on the standard output. -.TP -.B \-\-libs -Print the linker flags that are necessary to link a CLN program. -.TP -.B \-\-cppflags -Print the compiler flags that are necessary to compile a CLN program. -.TP -.B \-\-prefix=PREFIX -If specified, use PREFIX instead of the installation prefix that CLN 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 CLN -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 AUTHORS -.br -Richard Kreckel -.br -Bruno Haible -.SH COPYRIGHT -CLN is Copyright \(co Bruno Haible 1988-2002 - -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/cln-config.in b/cln-config.in deleted file mode 100644 index 1b9edde..0000000 --- a/cln-config.in +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -exec_prefix_set=no - -usage="\ -Usage: cln-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 @CL_VERSION@ - ;; - --cppflags) - if test @includedir@ != /usr/include ; then - includes=-I@includedir@ - fi - echo $includes @CPPFLAGS@ - ;; - --libs) - libdirs=-L@libdir@ - echo $libdirs -lcln @LIBS@ - ;; - *) - echo "${usage}" 1>&2 - exit 1 - ;; - esac - shift -done diff --git a/cln.m4 b/cln.m4 deleted file mode 100644 index e012b9b..0000000 --- a/cln.m4 +++ /dev/null @@ -1,157 +0,0 @@ -# Configure paths for the CLN library -# Richard Kreckel 12/4/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 AC_PATH_CLN([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for installed CLN library, and define CLN_CPPFLAGS and CLN_LIBS -dnl -AC_DEFUN([AC_PATH_CLN], -[dnl -dnl Get the cppflags and libraries from the cln-config script -dnl -AC_ARG_WITH(cln-prefix,[ --with-cln-prefix=PFX Prefix where CLN is installed (optional)], - cln_config_prefix="$withval", cln_config_prefix="") -AC_ARG_WITH(cln-exec-prefix,[ --with-cln-exec-prefix=PFX Exec prefix where CLN is installed (optional)], - cln_config_exec_prefix="$withval", cln_config_exec_prefix="") -AC_ARG_ENABLE(clntest, [ --disable-clntest Do not try to compile and run a test CLN program], - , enable_clntest=yes) - -if test x$cln_config_exec_prefix != x ; then - cln_config_args="$cln_config_args --exec-prefix=$cln_config_exec_prefix" - if test x${CLN_CONFIG+set} != xset ; then - CLN_CONFIG=$cln_config_exec_prefix/bin/cln-config - fi -fi -if test x$cln_config_prefix != x ; then - cln_config_args="$cln_config_args --prefix=$cln_config_prefix" - if test x${CLN_CONFIG+set} != xset ; then - CLN_CONFIG=$cln_config_prefix/bin/cln-config - fi -fi - -AC_PATH_PROG(CLN_CONFIG, cln-config, no) -cln_min_version=ifelse([$1], ,1.1.0,$1) -AC_MSG_CHECKING(for CLN - version >= $cln_min_version) -if test "$CLN_CONFIG" = "no" ; then - AC_MSG_RESULT(no) - echo "*** The cln-config script installed by CLN could not be found" - echo "*** If CLN was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the CLN_CONFIG environment variable to the" - echo "*** full path to cln-config." - ifelse([$3], , :, [$3]) -else -dnl Parse required version and the result of cln-config. - cln_min_major_version=`echo $cln_min_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - cln_min_minor_version=`echo $cln_min_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - cln_min_micro_version=`echo $cln_min_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - CLN_CPPFLAGS=`$CLN_CONFIG $cln_config_args --cppflags` - CLN_LIBS=`$CLN_CONFIG $cln_config_args --libs` - cln_config_version=`$CLN_CONFIG $cln_config_args --version` - cln_config_major_version=`echo $cln_config_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - cln_config_minor_version=`echo $cln_config_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - cln_config_micro_version=`echo $cln_config_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` -dnl Check if the installed CLN is sufficiently new according to cln-config. - if test \( $cln_config_major_version -lt $cln_min_major_version \) -o \ - \( $cln_config_major_version -eq $cln_min_major_version -a $cln_config_minor_version -lt $cln_min_minor_version \) -o \ - \( $cln_config_major_version -eq $cln_min_major_version -a $cln_config_minor_version -eq $cln_min_minor_version -a $cln_config_micro_version -lt $cln_min_micro_version \); then - echo -e "\n*** 'cln-config --version' returned $cln_config_major_version.$cln_config_minor_version.$cln_config_micro_version, but the minimum version" - echo "*** of CLN required is $cln_min_major_version.$cln_min_minor_version.$cln_min_micro_version. If cln-config is correct, then it is" - echo "*** best to upgrade to the required version." - echo "*** If cln-config was wrong, set the environment variable CLN_CONFIG" - echo "*** to point to the correct copy of cln-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 cln-config -dnl match the version of the headers and the version built into the library, too? - no_cln="" - if test "x$enable_clntest" = "xyes" ; then - ac_save_CPPFLAGS="$CPPFLAGS" - ac_save_LIBS="$LIBS" - CPPFLAGS="$CPPFLAGS $CLN_CPPFLAGS" - LIBS="$LIBS $CLN_LIBS" - rm -f conf.clntest - AC_TRY_RUN([ -#include -#include -#include - -/* we do not #include 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(void) -{ - system("touch conf.clntest"); - - if ((CL_VERSION_MAJOR != $cln_config_major_version) || - (CL_VERSION_MINOR != $cln_config_minor_version) || - (CL_VERSION_PATCHLEVEL != $cln_config_micro_version)) { - printf("\n*** 'cln-config --version' returned %d.%d.%d, but the header file I found\n", $cln_config_major_version, $cln_config_minor_version, $cln_config_micro_version); - printf("*** corresponds to %d.%d.%d. This mismatch suggests your installation of CLN\n", CL_VERSION_MAJOR, CL_VERSION_MINOR, CL_VERSION_PATCHLEVEL); - printf("*** is corrupted or you have specified some wrong -I compiler flags.\n"); - printf("*** Please inquire and consider reinstalling CLN.\n"); - return 1; - } - if ((cln::version_major != $cln_config_major_version) || - (cln::version_minor != $cln_config_minor_version) || - (cln::version_patchlevel != $cln_config_micro_version)) { - printf("\n*** 'cln-config --version' returned %d.%d.%d, but the library I found\n", $cln_config_major_version, $cln_config_minor_version, $cln_config_micro_version); - printf("*** corresponds to %d.%d.%d. This mismatch suggests your installation of CLN\n", cln::version_major, cln::version_minor, cln::version_patchlevel); - printf("*** is corrupted or you have specified some wrong -L compiler flags.\n"); - printf("*** Please inquire and consider reinstalling CLN.\n"); - return 1; - } - return 0; -} -],, no_cln=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CPPFLAGS="$ac_save_CPPFLAGS" - LIBS="$ac_save_LIBS" - fi - if test "x$no_cln" = x ; then - AC_MSG_RESULT([yes, $cln_config_version]) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test ! -f conf.clntest ; then - echo "*** Could not run CLN test program, checking why..." - CPPFLAGS="$CFLAGS $CLN_CPPFLAGS" - LIBS="$LIBS $CLN_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return 0; ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding CLN or finding the wrong" - echo "*** version of CLN. If it is not finding CLN, 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 CLN was incorrectly installed" - echo "*** or that you have moved CLN since it was installed. In the latter case, you" - echo "*** may want to edit the cln-config script: $CLN_CONFIG." ]) - CPPFLAGS="$ac_save_CPPFLAGS" - LIBS="$ac_save_LIBS" - fi - CLN_CPPFLAGS="" - CLN_LIBS="" - ifelse([$3], , :, [$3]) - fi - fi -fi -AC_SUBST(CLN_CPPFLAGS) -AC_SUBST(CLN_LIBS) -rm -f conf.clntest -]) diff --git a/cln.pc.in b/cln.pc.in index bacb801..9c6314f 100644 --- a/cln.pc.in +++ b/cln.pc.in @@ -6,5 +6,6 @@ includedir=@includedir@ Name: cln Description: Class Library for Numbers Version: @CL_VERSION@ -Libs: -L${libdir} -lcln @LIBS@ -Cflags: -I${includedir} @CPPFLAGS@ +Libs: -L${libdir} -lcln +Libs.private: @LIBS@ +Cflags: -I${includedir} diff --git a/configure.ac b/configure.ac index 2b17ce6..bae9d18 100644 --- a/configure.ac +++ b/configure.ac @@ -189,4 +189,4 @@ changequote([,])dnl cp "$srcdir/$f" "$f" fi done -AC_OUTPUT([Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile cln-config cln-config.1 cln.spec cln.pc], [chmod +x cln-config]) +AC_OUTPUT([Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile cln.spec cln.pc]) diff --git a/doc/cln.tex b/doc/cln.tex index 82c8e99..197e900 100644 --- a/doc/cln.tex +++ b/doc/cln.tex @@ -34,8 +34,8 @@ This file documents @sc{cln}, a Class Library for Numbers. Published by Bruno Haible, @code{} and Richard B. Kreckel, @code{}. -Copyright (C) Bruno Haible 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006. -Copyright (C) Richard B. Kreckel 2000, 2001, 2002, 2003, 2004, 2005, 2006. +Copyright (C) Bruno Haible 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007. +Copyright (C) Richard B. Kreckel 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -69,9 +69,9 @@ by the author. @author by Bruno Haible @page @vskip 0pt plus 1filll -Copyright @copyright{} Bruno Haible 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005. +Copyright @copyright{} Bruno Haible 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007. @sp 0 -Copyright @copyright{} Richard Kreckel 2000, 2001, 2002, 2003, 2004, 2005. +Copyright @copyright{} Richard Kreckel 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007. @sp 2 Published by Bruno Haible, @code{} and @@ -348,7 +348,7 @@ or no CXXFLAGS at all. (If CXXFLAGS is not set, CLN will use @code{-O}.) If you use @code{g++} 3.x, I recommend adding @samp{-finline-limit=1000} to the CXXFLAGS. This is essential for good code. -If you use @code{g++} gcc-2.95.x or gcc-3.x , I recommend adding +If you use @code{g++} gcc-2.95.x or gcc-3.x, I recommend adding @samp{-fno-exceptions} to the CXXFLAGS. This will likely generate better code. If you use @code{g++} from gcc-3.0.4 or older on Sparc, add either @@ -3367,73 +3367,33 @@ need special flags for compiling. The library has been installed to a public directory as well (normally @code{/usr/local/lib}), hence when linking a CLN application it is sufficient to give the flag @code{-lcln}. -Since CLN version 1.1, there are two tools to make the creation of -software packages that use CLN easier: -@itemize @bullet -@item -@cindex @code{cln-config} -@code{cln-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 CLN. Start it with @code{--help} to learn about its options -or consult the manpage that comes with it. -@item -@cindex @code{AC_PATH_CLN} -@code{AC_PATH_CLN} is for packages configured using GNU automake. -The synopsis is: +@cindex @code{pkg-config} +To make the creation of software packages that use CLN easier, the +@code{pkg-config} utility can be used. CLN provides all the necessary +metainformation in a file called @code{cln.pc} (installed in +@code{/usr/local/lib/pkgconfig} by default). A program using CLN can +be compiled and linked using @footnote{If you installed CLN to +non-standard location @var{prefix}, you need to set the +@env{PKG_CONFIG_PATH} environment variable to @var{prefix}/lib/pkgconfig +for this to work.} +@example +g++ `pkg-config --libs cln` `pkg-config --cflags cln` prog.cc -o prog +@end example + +Software using GNU autoconf can check for CLN with the +@code{PKG_CHECK_MODULES} macro supplied with @code{pkg-config}. @example -@code{AC_PATH_CLN([@var{MIN-VERSION}, [@var{ACTION-IF-FOUND} [, @var{ACTION-IF-NOT-FOUND}]]])} +PKG_CHECK_MODULES([CLN], [cln >= @var{MIN-VERSION}]) @end example -This macro determines the location of CLN using @code{cln-config}, which -is either found in the user's path, or from the environment variable -@code{CLN_CONFIG}. It tests the installed libraries to make sure that -their version is not earlier than @var{MIN-VERSION} (a default version -will be used if not specified). If the required version was found, sets -the @env{CLN_CPPFLAGS} and the @env{CLN_LIBS} variables. This -macro is in the file @file{cln.m4} which is installed in -@file{$datadir/aclocal}. Note that if automake was installed with a -different @samp{--prefix} than CLN, you will either have to manually -move @file{cln.m4} to automake's @file{$datadir/aclocal}, or give -aclocal the @samp{-I} option when running it. Here is a possible example -to be included in your package's @file{configure.ac}: +This will check for CLN version at least @var{MIN-VERSION}. If the +required version was found, the variables @var{CLN_CFLAGS} and +@var{CLN_LIBS} are set. Otherwise the configure script aborts. If this +is not the desired behaviour, use the following code instead +@footnote{See the @code{pkg-config} documentation for more details.} @example -AC_PATH_CLN(1.1.0, [ - LIBS="$LIBS $CLN_LIBS" - CPPFLAGS="$CPPFLAGS $CLN_CPPFLAGS" -], AC_MSG_ERROR([No suitable installed version of CLN could be found.])) +PKG_CHECK_MODULES([CLN], [cln >= @var{MIN-VERSION}], [], + [AC_MSG_WARNING([No suitable version of CLN can be found])]) @end example -@end itemize - - -@section Compatibility to old CLN versions -@cindex namespace -@cindex compatibility - -As of CLN version 1.1 all non-macro identifiers were hidden in namespace -@code{cln} in order to avoid potential name clashes with other C++ -libraries. If you have an old application, you will have to manually -port it to the new scheme. The following principles will help during -the transition: -@itemize @bullet -@item -All headers are now in a separate subdirectory. Instead of including -@code{cl_}@var{something}@code{.h}, include -@code{cln/}@var{something}@code{.h} now. -@item -All public identifiers (typenames and functions) have lost their -@code{cl_} prefix. Exceptions are all the typenames of number types, -(cl_N, cl_I, cl_MI, @dots{}), rings, symbolic types (cl_string, -cl_symbol) and polynomials (cl_UP_@var{type}). (This is because their -names would not be mnemonic enough once the namespace @code{cln} is -imported. Even in a namespace we favor @code{cl_N} over @code{N}.) -@item -All public @emph{functions} that had by a @code{cl_} in their name still -carry that @code{cl_} if it is intrinsic part of a typename (as in -@code{cl_I_to_int ()}). -@end itemize -When developing other libraries, please keep in mind not to import the -namespace @code{cln} in one of your public header files by saying -@code{using namespace cln;}. This would propagate to other applications -and can cause name clashes there. @section Include files