]> www.ginac.de Git - cln.git/commitdiff
* autoconf/aclocal.m4 (CL_GMP_SET_UINTD): New macro...
authorRichard Kreckel <kreckel@ginac.de>
Thu, 16 Nov 2000 18:39:55 +0000 (18:39 +0000)
committerRichard Kreckel <kreckel@ginac.de>
Thu, 16 Nov 2000 18:39:55 +0000 (18:39 +0000)
        * configure.in: ...used here.
        * include/cln/config.h.in: Put in macros defined by CL_GMP_SET_UINTD...
        * include/cln/types.h: ...used here.
        * autoconf/acgeneral.m4, autoconf/aclocal.m4: Adhere to FHS.

ChangeLog
NEWS
autoconf/acgeneral.m4
autoconf/aclocal.m4
configure.in
doc/Makefile.in
include/cln/config.h.in
include/cln/types.h

index 487d7dd014d29decd270690e60159019c54a7709..9316b7d503bda74cbda6f23859cd895e8a2a5c77 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-11-16  Richard Kreckel  <kreckel@ginac.de>
+
+        * autoconf/aclocal.m4 (CL_GMP_SET_UINTD): New macro...
+        * configure.in: ...used here.
+        * include/cln/config.h.in: Put in macros defined by CL_GMP_SET_UINTD...
+        * include/cln/types.h: ...used here.
+        * autoconf/acgeneral.m4, autoconf/aclocal.m4: Adhere to FHS.
+
 2000-11-13  Richard Kreckel  <kreckel@ginac.de>
 
         * src/base/digitseq/cl_asm.h: Test if (intDsize==32) for MIPS and HPPA,
diff --git a/NEWS b/NEWS
index 5ecb74c8359ae13efb10e4574bcb835e4308c58a..cd52890fd6fc56e0bf5cec5f5b01622aad95fc68 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-2000-06-xx, version 1.1.0
+2000-11-xx, version 1.1.0
 =========================
 
 Functional changes
@@ -22,7 +22,10 @@ Implementation changes
 * Adjusted several break-even points to make better use of a faster libgmp and
   better match present-day CPUs.
 
-* Fix compilation errors with gcc-2.96.
+* Fix several errors for architectures with 64-bit wide words.
+  (Others than Alpha.)
+
+* Fix compilation errors with current GCC3.0 snapshots.
 
 
 2000-01-13, version 1.0.3
index 78fb5946c0a7871f0ac3cb24e910bf0d6567f8e9..c17e1cbc2536348986c12a22c539bf5a0e501f03 100644 (file)
@@ -50,6 +50,7 @@ dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
 dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
 dnl
 dnl Changed by Bruno Haible, 18 January 1999
+dnl Changed more by Richard Kreckel, 16 November 2000
 dnl
 divert(-1)dnl Throw away output until AC_INIT is called.
 changequote([, ])
@@ -204,8 +205,8 @@ localstatedir='${prefix}/var'
 libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+infodir='${datadir}/info'
+mandir='${datadir}/man'
 
 # Initialize some other variables.
 subdirs=
index dcd1d84c3b9c1dbe8d3f650e1827d6d1a1947457..e53abcf8d13043215f09958e2e75482d900958c5 100644 (file)
@@ -956,3 +956,26 @@ AC_DEFUN(CL_GMP_CHECK,
     AC_TRY_LINK([#include <gmp.h>],[mpn_divexact_by3(0,0,0)],
 cl_cv_new_libgmp="yes", cl_cv_new_libgmp="no"; LIBS=$SAVELIBS)
 ])])
+
+# What is sizeof(mp_limb_t)?  (It has to match sizeof(uintD) later.)
+AC_DEFUN(CL_GMP_SET_UINTD,
+[AC_CACHE_CHECK([how large gmp demands uintD to be], cl_cv_gmp_set_uintd, [
+    AC_TRY_RUN([#include <stdio.h>
+#include <gmp.h>
+int main() {
+    FILE *f=fopen("conftestval", "w");
+    if (!f) return(1);
+    if (sizeof(mp_limb_t) > sizeof(long))
+        fprintf(f, "long long");
+    else if (sizeof(mp_limb_t) == sizeof(long))
+        fprintf(f, "long");
+    else if (sizeof(mp_limb_t) == sizeof(int))
+        fprintf(f, "int");
+    else return(1);
+    return(0);
+}], cl_cv_gmp_set_uintd=`cat conftestval`; \
+    cl_gmp_demands="GMP_DEMANDS_UINTD_`echo ${cl_cv_gmp_set_uintd} | sed -e 'y/ gilnot/_GILNOT/'`"; 
+    AC_DEFINE_UNQUOTED($cl_gmp_demands),
+    AC_MSG_ERROR([CLN can't handle the result]),dnl
+    AC_MSG_ERROR([cross-compiling - cannot determine]))
+])])
index e38db7d07ff8b8fb5f568420702b53284cb0b7a1..84e4f0a385cb53fc9afa07744d1a10fd7f6d2df3 100644 (file)
@@ -95,7 +95,7 @@ dnl release version for cln/config.h, so it can be tested by the preprocessor
 AC_DEFINE_UNQUOTED(CL_VERSION_MAJOR, $CL_VERSION_MAJOR)
 AC_DEFINE_UNQUOTED(CL_VERSION_MINOR, $CL_VERSION_MINOR)
 AC_DEFINE_UNQUOTED(CL_VERSION_PATCHLEVEL, $CL_VERSION_PATCHLEVEL)
-dnl concateneted release version
+dnl concatenated release version
 CL_VERSION=$CL_VERSION_MAJOR.$CL_VERSION_MINOR.$CL_VERSION_PATCHLEVEL
 AC_DEFINE_UNQUOTED(CL_VERSION, $CL_VERSION)
 AC_SUBST(CL_VERSION)
@@ -145,7 +145,6 @@ dnl           checks for compiler characteristics
 dnl
 CL_CHAR_UNSIGNED
                       dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
-test -d 'include' || mkdir 'include'
 CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cln/intparam.h,cl_cv_file_intparam_h)
                       dnl builds include/cln/intparam.h
 CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cln/floatparam.h,cl_cv_file_floatparam_h)
@@ -164,6 +163,7 @@ if test "$with_gmp" = yes; then
   fi
 fi
 if test "$with_gmp" = yes; then
+  CL_GMP_SET_UINTD
   AC_DEFINE(CL_USE_GMP)
 else
   AC_MSG_WARN([disabling external GNU MP library])
index 6430021970ab56db188c37ef2f3f32ee8c04d8c2..fd3902cde47986eefb6b61f6d40704d73b0f8129 100644 (file)
@@ -78,17 +78,17 @@ $(PACKAGE)_toc.html : $(srcdir)/$(PACKAGE).texi
 
 
 install : all force
+       if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
        if [ ! -d $(infodir) ] ; then mkdir $(infodir) ; fi
        $(INSTALL_DATA) $(srcdir)/$(PACKAGE).info $(infodir)/$(PACKAGE).info
-       if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
        if [ ! -d $(htmldir) ] ; then mkdir $(htmldir) ; fi
        $(INSTALL_DATA) $(srcdir)/$(PACKAGE)_*.html $(htmldir)
        if [ ! -d $(dvidir) ] ; then mkdir $(dvidir) ; fi
        $(INSTALL_DATA) $(srcdir)/$(PACKAGE).dvi $(dvidir)/$(PACKAGE).dvi
 
 installdirs : force
-       if [ ! -d $(infodir) ] ; then mkdir $(infodir) ; fi
        if [ ! -d $(datadir) ] ; then mkdir $(datadir) ; fi
+       if [ ! -d $(infodir) ] ; then mkdir $(infodir) ; fi
        if [ ! -d $(htmldir) ] ; then mkdir $(htmldir) ; fi
        if [ ! -d $(dvidir) ] ; then mkdir $(dvidir) ; fi
 
index 58b0f04de314268c491a4fed4086003b133e0af7..ef87e313da9923e0404a650d008dbfc498fdf933 100644 (file)
 /* Define if you have <unistd.h>. */
 #undef HAVE_UNISTD_H
 
+/* CL_GMP_SET_UINTD */
+/* Define one of the following so sizeof(uintD) matches sizeof(mp_limb_t). */
+#undef GMP_DEMANDS_UINTD_LONG_LONG
+#undef GMP_DEMANDS_UINTD_LONG
+#undef GMP_DEMANDS_UINTD_INT
+
 
 /* functions and declarations */
 
index 71912081ed95d4053f343bfa8736f321109d15f6..876ebcc3c05d6c5a769b90cc5a8c9a3a406283af 100644 (file)
   typedef long           sintP;
   typedef unsigned long  uintP;
 
-// Largest integer type which can be manipulated as efficiently as a pointer.
-// This is normally the same as the hardware register size.
-// Assumption: cl_word_size >= intPsize
-  #ifdef HAVE_FAST_LONGLONG
-    #define cl_word_size  64
-  #else
-    #define cl_word_size  32
-  #endif
-
 // Numbers in the heap are stored as "digit" sequences.
 // A digit is an unsigned int with intDsize bits.
-// intDsize should be 8 or 16 or 32 or 64.
-  #if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) || defined(__ia64__)))
-    #define intDsize 64
-    #define intDDsize 128  // = 2*intDsize
-    #define log2_intDsize  6  // = log2(intDsize)
-  #else
-    #define intDsize 32
-    #define intDDsize 64  // = 2*intDsize
-    #define log2_intDsize  5  // = log2(intDsize)
-  #endif
-  #if (intDsize==8)
-    typedef sint8  sintD;
-    typedef uint8  uintD;
-  #endif
-  #if (intDsize==16)
-    typedef sint16  sintD;
-    typedef uint16  uintD;
-  #endif
-  #if (intDsize==32)
-    typedef sint32  sintD;
-    typedef uint32  uintD;
+// intDsize should be 8 or 16 or 32 or 64 and it should match mp_limb_t,
+// if CLN is sitting on top of GMP.
+  #if defined(GMP_DEMANDS_UINTD_LONG_LONG)
+    #define HAVE_FAST_LONGLONG
+    #define intDsize long_long_bitsize
+    typedef long long sintD;
+    typedef unsigned long long uintD;
+  #elif defined(GMP_DEMANDS_UINTD_LONG)
+    #define intDsize long_bitsize
+    typedef long sintD;
+    typedef unsigned long uintD;
+  #elif defined(GMP_DEMANDS_UINTD_INT)
+    #define intDsize int_bitsize
+    typedef int sintD;
+    typedef unsigned int uintD;
+  #else  // we are not using GMP, so just guess something reasonable
+    #if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) || defined(__ia64__)))
+      #define intDsize 64
+      typedef sint64  sintD;
+      typedef uint64  uintD;
+    #else
+      #define intDsize 32
+      typedef sint32  sintD;
+      typedef uint32  uintD;
+    #endif
   #endif
   #if (intDsize==64)
-    typedef sint64  sintD;
-    typedef uint64  uintD;
+    #define intDDsize 128    // = 2*intDsize
+    #define log2_intDsize 6  // = log2(intDsize)
+  #elif (intDsize==32)
+    #define intDDsize 64     // = 2*intDsize
+    #define log2_intDsize 5  // = log2(intDsize)
+  #elif (intDsize==16)
+    #define intDDsize 32     // = 2*intDsize
+    #define log2_intDsize 4  // = log2(intDsize)
+  #elif (intDsize==8)
+    #define intDDsize 16     // = 2*intDsize
+    #define log2_intDsize 3  // = log2(intDsize)
+  #else
+    #error "What is intDsize again?"
   #endif
 // HAVE_DD means that there are unsigned ints with 2*intDsize bits.
   #if (intDDsize <= (defined(HAVE_FAST_LONGLONG) ? 64 : 32))
     #define HAVE_DD 0
   #endif
 
+// Largest integer type which can be manipulated as efficiently as a pointer.
+// This is normally the same as the hardware register size.
+// Assumption: cl_word_size >= intPsize
+  #ifdef HAVE_FAST_LONGLONG
+    #define cl_word_size  64
+  #else
+    #define cl_word_size  32
+  #endif
+
 #endif /* _CL_TYPES_H */