]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1682. [port] Update configure test for (long long) printf format.
authorMark Andrews <marka@isc.org>
Thu, 1 Jul 2004 00:19:53 +0000 (00:19 +0000)
committerMark Andrews <marka@isc.org>
Thu, 1 Jul 2004 00:19:53 +0000 (00:19 +0000)
                        [RT #5066]

CHANGES
configure
configure.in

diff --git a/CHANGES b/CHANGES
index cba242cf4e3544d6073cc2f8c55da988b696e867..37fe668d5cb07c31b5311a452df5420d898d86ea 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 1683.  [bug]           dig +sigchase could leak memory. [RT #11445]
 
+1682.  [port]          Update configure test for (long long) printf format.
+                       [RT #5066]
+
 1681.  [bug]           Only set SO_REUSEADDR when a port is specified in
                        isc_socket_bind(). [RT #11742]
 
index 335ed52eec3a0e59a4cac7550166ba98d2317f89..1b86fe58ac865c625eed4e320f8404f75747eb8a 100755 (executable)
--- a/configure
+++ b/configure
@@ -14,7 +14,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 #
-# $Id: configure,v 1.284.2.19.2.22 2004/06/18 01:37:55 marka Exp $
+# $Id: configure,v 1.284.2.19.2.23 2004/07/01 00:19:53 marka Exp $
 #
 # Portions Copyright (C) 1996-2001  Nominum, Inc.
 #
@@ -29,7 +29,7 @@
 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
 # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-# From configure.in Revision: 1.294.2.23.2.26 .
+# From configure.in Revision: 1.294.2.23.2.27 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59.
 #
 
 
 
-#
 # Determine the printf format characters to use when printing
-# values of type isc_int64_t.  We make the assumption that platforms
-# where a "long long" is the same size as a "long" (e.g., Alpha/OSF1)
-# want "%ld" and everyone else can use "%lld".  Win32 uses "%I64d",
-# but that's defined elsewhere since we don't use configure on Win32.
+# values of type isc_int64_t. This will normally be "ll", but where
+# the compiler treats "long long" as a alias for "long" and printf
+# doesn't know about "long long" use "l".  Hopefully the sprintf
+# will produce a inconsistant result in the later case.  If the compiler
+# fails due to seeing "%lld" we fall back to "l".
+#
+# Win32 uses "%I64d", but that's defined elsewhere since we don't use
+# configure on Win32.
 #
 echo "$as_me:$LINENO: checking printf format modifier for 64-bit integers" >&5
 echo $ECHO_N "checking printf format modifier for 64-bit integers... $ECHO_C" >&6
@@ -25679,7 +25682,17 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-main() { exit(!(sizeof(long long int) == sizeof(long int))); }
+
+#include <stdio.h>
+main() {
+       long long int j = 0;
+       char buf[100];
+       buf[0] = 0;
+       sprintf(buf, "%lld", j);
+       exit((sizeof(long long int) != sizeof(long int))? 0 :
+            (strcmp(buf, "0") != 0));
+}
+
 _ACEOF
 rm -f conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@@ -25692,18 +25705,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:$LINENO: result: l" >&5
-echo "${ECHO_T}l" >&6
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
+  echo "$as_me:$LINENO: result: ll" >&5
+echo "${ECHO_T}ll" >&6
+       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-echo "$as_me:$LINENO: result: ll" >&5
-echo "${ECHO_T}ll" >&6
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
+echo "$as_me:$LINENO: result: l" >&5
+echo "${ECHO_T}l" >&6
+       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
 fi
 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
index d6fc3aff38ed881bb864441fc46061d70f845edf..bc040a7d6b5251d88ac4003c2cf3d1226b5dccaa 100644 (file)
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl
 esyscmd([sed "s/^/# /" COPYRIGHT])dnl
 AC_DIVERT_POP()dnl
 
-AC_REVISION($Revision: 1.294.2.23.2.26 $)
+AC_REVISION($Revision: 1.294.2.23.2.27 $)
 
 AC_INIT(lib/dns/name.c)
 AC_PREREQ(2.13)
@@ -1686,19 +1686,32 @@ AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
 AC_SUBST(ISC_EXTRA_OBJS)
 AC_SUBST(ISC_EXTRA_SRCS)
 
-#
 # Determine the printf format characters to use when printing
-# values of type isc_int64_t.  We make the assumption that platforms
-# where a "long long" is the same size as a "long" (e.g., Alpha/OSF1)
-# want "%ld" and everyone else can use "%lld".  Win32 uses "%I64d",
-# but that's defined elsewhere since we don't use configure on Win32.
+# values of type isc_int64_t. This will normally be "ll", but where
+# the compiler treats "long long" as a alias for "long" and printf
+# doesn't know about "long long" use "l".  Hopefully the sprintf
+# will produce a inconsistant result in the later case.  If the compiler
+# fails due to seeing "%lld" we fall back to "l".
+#
+# Win32 uses "%I64d", but that's defined elsewhere since we don't use
+# configure on Win32.
 #
 AC_MSG_CHECKING(printf format modifier for 64-bit integers)
-AC_TRY_RUN([main() { exit(!(sizeof(long long int) == sizeof(long int))); }],
-       [AC_MSG_RESULT(l)
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'],
+AC_TRY_RUN([
+#include <stdio.h>
+main() {
+       long long int j = 0;
+       char buf[100];
+       buf[0] = 0;
+       sprintf(buf, "%lld", j);
+       exit((sizeof(long long int) != sizeof(long int))? 0 :
+            (strcmp(buf, "0") != 0));
+} 
+],
        [AC_MSG_RESULT(ll)
        ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'],
+       [AC_MSG_RESULT(l)
+       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'],
        [AC_MSG_RESULT(assuming target platform uses ll)
        ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'])
 AC_SUBST(ISC_PLATFORM_QUADFORMAT)