summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure48
1 files changed, 21 insertions, 27 deletions
diff --git a/configure b/configure
index e570a7a..92a5737 100755
--- a/configure
+++ b/configure
@@ -53,6 +53,7 @@ case "$1" in
53 -l* | --l*) libdir="$2"; shift; shift;; 53 -l* | --l*) libdir="$2"; shift; shift;;
54 -i* | --i*) includedir="$2"; shift; shift;; 54 -i* | --i*) includedir="$2"; shift; shift;;
55 -s* | --s*) shared=1; shift;; 55 -s* | --s*) shared=1; shift;;
56 *) echo "unknown option: $1"; echo "$0 --help for help"; exit 1;;
56 esac 57 esac
57done 58done
58 59
@@ -76,6 +77,8 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
76 CFLAGS="$cflags" 77 CFLAGS="$cflags"
77 case `(uname -s || echo unknown) 2>/dev/null` in 78 case `(uname -s || echo unknown) 2>/dev/null` in
78 Linux | linux) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};; 79 Linux | linux) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
80 CYGWIN* | Cygwin* | cygwin* )
81 EXE='.exe';;
79 QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 82 QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
80 # (alain.bonnefoy@icbt.com) 83 # (alain.bonnefoy@icbt.com)
81 LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"};; 84 LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"};;
@@ -188,11 +191,8 @@ fi
188 191
189cat > $test.c <<EOF 192cat > $test.c <<EOF
190#include <stdio.h> 193#include <stdio.h>
191#include <stdlib.h> 194#include <stdarg.h>
192 195#include "zconf.h"
193#if (defined(__MSDOS__) || defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)) && !defined(STDC)
194# define STDC
195#endif
196 196
197int main() 197int main()
198{ 198{
@@ -205,7 +205,7 @@ int main()
205EOF 205EOF
206 206
207if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then 207if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
208 echo "Checking whether to use vsnprintf() or snprintf()... using vsnprintf()" 208 echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()"
209 209
210 cat > $test.c <<EOF 210 cat > $test.c <<EOF
211#include <stdio.h> 211#include <stdio.h>
@@ -228,7 +228,7 @@ int main()
228} 228}
229EOF 229EOF
230 230
231 if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then 231 if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
232 echo "Checking for vsnprintf() in stdio.h... Yes." 232 echo "Checking for vsnprintf() in stdio.h... Yes."
233 233
234 cat >$test.c <<EOF 234 cat >$test.c <<EOF
@@ -237,14 +237,14 @@ EOF
237 237
238int mytest(char *fmt, ...) 238int mytest(char *fmt, ...)
239{ 239{
240 int i; 240 int n;
241 char buf[20]; 241 char buf[20];
242 va_list ap; 242 va_list ap;
243 243
244 va_start(ap, fmt); 244 va_start(ap, fmt);
245 i = vsnprintf(buf, sizeof(buf), fmt, ap); 245 n = vsnprintf(buf, sizeof(buf), fmt, ap);
246 va_end(ap); 246 va_end(ap);
247 return 0; 247 return n;
248} 248}
249 249
250int main() 250int main()
@@ -275,14 +275,14 @@ EOF
275 275
276int mytest(char *fmt, ...) 276int mytest(char *fmt, ...)
277{ 277{
278 int i; 278 int n;
279 char buf[20]; 279 char buf[20];
280 va_list ap; 280 va_list ap;
281 281
282 va_start(ap, fmt); 282 va_start(ap, fmt);
283 i = vsprintf(buf, fmt, ap); 283 n = vsprintf(buf, fmt, ap);
284 va_end(ap); 284 va_end(ap);
285 return 0; 285 return n;
286} 286}
287 287
288int main() 288int main()
@@ -302,11 +302,10 @@ EOF
302 fi 302 fi
303 fi 303 fi
304else 304else
305 echo "Checking whether to use vsnprintf() or snprintf()... using snprintf()" 305 echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()"
306 306
307 cat >$test.c <<EOF 307 cat >$test.c <<EOF
308#include <stdio.h> 308#include <stdio.h>
309#include <stdarg.h>
310 309
311int mytest() 310int mytest()
312{ 311{
@@ -322,20 +321,17 @@ int main()
322} 321}
323EOF 322EOF
324 323
325 if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then 324 if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
326 echo "Checking for snprintf() in stdio.h... Yes." 325 echo "Checking for snprintf() in stdio.h... Yes."
327 326
328 cat >$test.c <<EOF 327 cat >$test.c <<EOF
329#include <stdio.h> 328#include <stdio.h>
330#include <stdarg.h>
331 329
332int mytest(char *fmt, ...) 330int mytest()
333{ 331{
334 int i;
335 char buf[20]; 332 char buf[20];
336 333
337 i = snprintf(buf, sizeof(buf), "%s", "foo"); 334 return snprintf(buf, sizeof(buf), "%s", "foo");
338 return 0;
339} 335}
340 336
341int main() 337int main()
@@ -362,15 +358,12 @@ EOF
362 358
363 cat >$test.c <<EOF 359 cat >$test.c <<EOF
364#include <stdio.h> 360#include <stdio.h>
365#include <stdarg.h>
366 361
367int mytest(char *fmt, ...) 362int mytest()
368{ 363{
369 int i;
370 char buf[20]; 364 char buf[20];
371 365
372 i = sprintf(buf, "%s", "foo"); 366 return sprintf(buf, "%s", "foo");
373 return 0;
374} 367}
375 368
376int main() 369int main()
@@ -428,7 +421,7 @@ case $CFLAGS in
428 fi;; 421 fi;;
429esac 422esac
430 423
431rm -f $test.[co] $test$shared_ext 424rm -f $test.[co] $test $test$shared_ext
432 425
433# udpate Makefile 426# udpate Makefile
434sed < Makefile.in " 427sed < Makefile.in "
@@ -442,6 +435,7 @@ sed < Makefile.in "
442/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM# 435/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
443/^AR *=/s#=.*#=$AR# 436/^AR *=/s#=.*#=$AR#
444/^RANLIB *=/s#=.*#=$RANLIB# 437/^RANLIB *=/s#=.*#=$RANLIB#
438/^EXE *=/s#=.*#=$EXE#
445/^prefix *=/s#=.*#=$prefix# 439/^prefix *=/s#=.*#=$prefix#
446/^exec_prefix *=/s#=.*#=$exec_prefix# 440/^exec_prefix *=/s#=.*#=$exec_prefix#
447/^libdir *=/s#=.*#=$libdir# 441/^libdir *=/s#=.*#=$libdir#