summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-06-07 17:53:40 +1000
committerDarren Tucker <dtucker@zip.com.au>2005-06-07 17:53:40 +1000
commit431f022263a59595dd7894181515832828a950f9 (patch)
treec09a57c17992b0e48ed1c12673142af89b428416
parentc0e014d5beaceed128ef5f8672a6567035ee7c9c (diff)
- (dtucker) [configure.ac] Continue the hunt for LLONG_MIN and LLONG_MAX:
in today's episode we attempt to coax it from limits.h where it may be hiding, failing that we take the DIY approach. Tested by tim@
-rw-r--r--ChangeLog7
-rw-r--r--configure.ac66
2 files changed, 71 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 2046df86c..efebb2820 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
120050607
2 - (dtucker) [configure.ac] Continue the hunt for LLONG_MIN and LLONG_MAX:
3 in today's episode we attempt to coax it from limits.h where it may be
4 hiding, failing that we take the DIY approach. Tested by tim@
5
120050603 620050603
2 - (dtucker) [configure.ac] Only try gcc -std=gnu99 if LLONG_MAX isn't 7 - (dtucker) [configure.ac] Only try gcc -std=gnu99 if LLONG_MAX isn't
3 defined, and check that it helps before keeping it in CFLAGS. Some old 8 defined, and check that it helps before keeping it in CFLAGS. Some old
@@ -2681,4 +2686,4 @@
2681 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 2686 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
2682 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 2687 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
2683 2688
2684$Id: ChangeLog,v 1.3812 2005/06/03 09:33:10 dtucker Exp $ 2689$Id: ChangeLog,v 1.3813 2005/06/07 07:53:40 dtucker Exp $
diff --git a/configure.ac b/configure.ac
index 00fc858ef..62a11fa1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.274 2005/06/03 09:33:10 dtucker Exp $ 1# $Id: configure.ac,v 1.275 2005/06/07 07:53:40 dtucker Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -96,6 +96,70 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
96 fi 96 fi
97fi 97fi
98 98
99if test -z "$have_llong_max"; then
100 AC_MSG_CHECKING([for max value of long long])
101 AC_RUN_IFELSE(
102 [AC_LANG_SOURCE([[
103#include <stdio.h>
104/* Why is this so damn hard? */
105#ifdef __GNUC__
106# undef __GNUC__
107#endif
108#define __USE_ISOC99
109#include <limits.h>
110#define DATA "conftest.llminmax"
111int main(void) {
112 FILE *f;
113 long long i, llmin, llmax = 0;
114
115 if((f = fopen(DATA,"w")) == NULL)
116 exit(1);
117
118#if defined(LLONG_MIN) && defined(LLONG_MAX)
119 fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
120 llmin = LLONG_MIN;
121 llmax = LLONG_MAX;
122#else
123 fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n");
124 /* This will work on one's complement and two's complement */
125 for (i = 1; i > llmax; i <<= 1, i++)
126 llmax = i;
127 llmin = llmax + 1LL; /* wrap */
128#endif
129
130 /* Sanity check */
131 if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
132 || llmax - 1 > llmax) {
133 fprintf(f, "unknown unknown\n");
134 exit(2);
135 }
136
137 if (fprintf(f ,"%lld %lld", llmin, llmax) < 0)
138 exit(3);
139
140 exit(0);
141}
142 ]])],
143 [
144 llong_min=`$AWK '{print $1}' conftest.llminmax`
145 llong_max=`$AWK '{print $2}' conftest.llminmax`
146 AC_MSG_RESULT($llong_max)
147 AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL],
148 [max value of long long calculated by configure])
149 AC_MSG_CHECKING([for min value of long long])
150 AC_MSG_RESULT($llong_min)
151 AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL],
152 [min value of long long calculated by configure])
153 ],
154 [
155 AC_MSG_RESULT(not found)
156 ],
157 [
158 AC_MSG_WARN([cross compiling: not checking])
159 ]
160 )
161fi
162
99AC_ARG_WITH(rpath, 163AC_ARG_WITH(rpath,
100 [ --without-rpath Disable auto-added -R linker paths], 164 [ --without-rpath Disable auto-added -R linker paths],
101 [ 165 [