| 1 | #! /bin/sh |
| 2 | # |
| 3 | # If these # comments don't work, trim them. Don't worry about any other |
| 4 | # shell scripts, Configure will trim # comments from them for you. |
| 5 | # |
| 6 | # (If you are trying to port this package to a machine without sh, |
| 7 | # I would suggest you have a look at the prototypical config_h.SH file |
| 8 | # and edit it to reflect your system. Some packages may include samples |
| 9 | # of config.h for certain machines, so you might look for one of those.) |
| 10 | # |
| 11 | # Yes, you may rip this off to use in other distribution packages. This |
| 12 | # script belongs to the public domain and cannot be copyrighted. |
| 13 | # |
| 14 | # Note: this Configure script was generated automatically by the tool |
| 15 | # called "metaconfig". Rather than working with this copy of Configure, |
| 16 | # you should use metaconfig. Perl uses a modified version of this |
| 17 | # tool, and this, together with the metaconfig units, are available |
| 18 | # in the git repository: |
| 19 | # $ git clone https://github.com/perl5-metaconfig/metaconfig metaconfig |
| 20 | # The original dist package (including metaconfig) is available on github: |
| 21 | # $ git clone https://github.com/rmanfredi/dist.git dist-git |
| 22 | # |
| 23 | # Though this script was generated by metaconfig from metaunits, it is |
| 24 | # OK to send patches against Configure itself (but not to commit them |
| 25 | # to blead). It's up to |
| 26 | # the Configure maintainers to backport the patch to the metaunits if it |
| 27 | # is accepted. Exceptions to this rule, and more information, is in |
| 28 | # Porting/pumpkin.pod. |
| 29 | |
| 30 | # Generated using [metaconfig 3.5 PL0] |
| 31 | # with additional metaconfig patches from https://github.com/Perl/metaconfig |
| 32 | |
| 33 | cat >c1$$ <<EOF |
| 34 | ARGGGHHHH!!!!! |
| 35 | |
| 36 | SCO csh still thinks true is false. Write to SCO today and tell them that next |
| 37 | year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-) |
| 38 | |
| 39 | (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All |
| 40 | we'd have to do is go in and swap the && and || tokens, wherever they are.) |
| 41 | |
| 42 | [End of diatribe. We now return you to your regularly scheduled programming...] |
| 43 | EOF |
| 44 | cat >c2$$ <<EOF |
| 45 | |
| 46 | OOPS! You naughty creature! You didn't run Configure with sh! |
| 47 | I will attempt to remedy the situation by running sh for you... |
| 48 | EOF |
| 49 | |
| 50 | true || cat c1$$ c2$$ |
| 51 | true || exec sh $0 $argv:q |
| 52 | |
| 53 | (exit $?0) || cat c2$$ |
| 54 | (exit $?0) || exec sh $0 $argv:q |
| 55 | rm -f c1$$ c2$$ |
| 56 | |
| 57 | if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then |
| 58 | cat <<EOF |
| 59 | *** |
| 60 | *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do |
| 61 | *** Configure that well. (Plan 9 is close to UNIX but not close enough.) |
| 62 | *** Please read the README.plan9 for further instructions. |
| 63 | *** Cannot continue, aborting. |
| 64 | *** |
| 65 | EOF |
| 66 | exit 1 |
| 67 | fi |
| 68 | |
| 69 | if test -f /sys/utilities/MultiView ; then |
| 70 | # AmigaOS, test -c for /dev/null is not useful |
| 71 | : |
| 72 | elif test ! -c /dev/null ; then |
| 73 | cat <<EOF |
| 74 | *** |
| 75 | *** I'm sorry, but /dev/null appears to be a file rather than a device. |
| 76 | *** Please consult your operating sytem's notes for making a device |
| 77 | *** in /dev. |
| 78 | *** Cannot continue, aborting. |
| 79 | *** |
| 80 | EOF |
| 81 | exit 1 |
| 82 | fi |
| 83 | |
| 84 | : compute my invocation name |
| 85 | me=$0 |
| 86 | case "$0" in |
| 87 | */*) |
| 88 | me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null` |
| 89 | test "$me" || me=$0 |
| 90 | ;; |
| 91 | esac |
| 92 | |
| 93 | : Proper separator for the PATH environment variable |
| 94 | p_=: |
| 95 | : On OS/2 this directory should exist if this is not floppy only system ":-]" |
| 96 | if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then |
| 97 | if test -n "$OS2_SHELL"; then |
| 98 | p_=\; |
| 99 | PATH=`cmd /c "echo %PATH%" | tr '\\\\' / ` |
| 100 | OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'` |
| 101 | is_os2=yes |
| 102 | elif test -n "$DJGPP"; then |
| 103 | case "X${MACHTYPE:-nonesuchmach}" in |
| 104 | *cygwin|*msys) ;; |
| 105 | *) p_=\; ;; |
| 106 | esac |
| 107 | fi |
| 108 | fi |
| 109 | |
| 110 | : Proper PATH setting |
| 111 | paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin' |
| 112 | paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin" |
| 113 | paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin" |
| 114 | paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin" |
| 115 | paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb" |
| 116 | paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin" |
| 117 | paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib" |
| 118 | paths="$paths /sbin /usr/sbin /usr/libexec" |
| 119 | paths="$paths /system/gnu_library/bin" |
| 120 | |
| 121 | for p in $paths |
| 122 | do |
| 123 | case "$p_$PATH$p_" in |
| 124 | *$p_$p$p_*) ;; |
| 125 | *) test -d $p && PATH=$PATH$p_$p ;; |
| 126 | esac |
| 127 | done |
| 128 | |
| 129 | PATH=.$p_$PATH |
| 130 | export PATH |
| 131 | |
| 132 | : shall we be using ksh? |
| 133 | inksh='' |
| 134 | needksh='' |
| 135 | avoidksh='' |
| 136 | newsh=/bin/ksh |
| 137 | changesh='' |
| 138 | if (PATH=.; alias -x) >/dev/null 2>&1; then |
| 139 | inksh=true |
| 140 | fi |
| 141 | if test -f /hp-ux -a -f /bin/ksh; then |
| 142 | needksh='to avoid sh bug in "here document" expansion' |
| 143 | fi |
| 144 | if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then |
| 145 | if test X`/usr/bin/uname -v` = X4; then |
| 146 | avoidksh="to avoid AIX 4's /bin/sh" |
| 147 | newsh=/usr/bin/bsh |
| 148 | fi |
| 149 | fi |
| 150 | if test -f /osf_boot -a -f /usr/sbin/setld; then |
| 151 | if test X`/usr/bin/uname -s` = XOSF1; then |
| 152 | avoidksh="to avoid Digital UNIX' ksh" |
| 153 | newsh=/bin/sh |
| 154 | unset BIN_SH |
| 155 | fi |
| 156 | fi |
| 157 | case "$inksh/$needksh" in |
| 158 | /[a-z]*) |
| 159 | ENV='' |
| 160 | changesh=true |
| 161 | reason="$needksh" |
| 162 | ;; |
| 163 | esac |
| 164 | case "$inksh/$avoidksh" in |
| 165 | true/[a-z]*) |
| 166 | changesh=true |
| 167 | reason="$avoidksh" |
| 168 | ;; |
| 169 | esac |
| 170 | case "$inksh/$needksh-$avoidksh-" in |
| 171 | true/--) |
| 172 | cat <<EOM |
| 173 | (I see you are using the Korn shell. Some ksh's blow up on $me, |
| 174 | mainly on older exotic systems. If yours does, try the Bourne shell instead.) |
| 175 | EOM |
| 176 | ;; |
| 177 | esac |
| 178 | case "$changesh" in |
| 179 | true) |
| 180 | export newsh |
| 181 | echo "(Feeding myself to $newsh $reason.)" |
| 182 | case "$0" in |
| 183 | Configure|*/Configure) exec $newsh $0 "$@";; |
| 184 | *) exec $newsh Configure "$@";; |
| 185 | esac |
| 186 | ;; |
| 187 | esac |
| 188 | test -x "${newsh}" || unset newsh |
| 189 | |
| 190 | : if needed, set CDPATH to a harmless value that is not chatty |
| 191 | : avoid bash 2.02 problems with empty CDPATH. |
| 192 | case "$CDPATH" in |
| 193 | '') ;; |
| 194 | *) case "$SHELL" in |
| 195 | *bash*) CDPATH='.' ;; |
| 196 | *) CDPATH='' ;; |
| 197 | esac |
| 198 | ;; |
| 199 | esac |
| 200 | |
| 201 | : Configure runs within the UU subdirectory |
| 202 | test -d UU || mkdir UU |
| 203 | cd UU && rm -f ./* |
| 204 | |
| 205 | ccname='' |
| 206 | ccversion='' |
| 207 | ccsymbols='' |
| 208 | cppccsymbols='' |
| 209 | cppsymbols='' |
| 210 | from='' |
| 211 | hostgenerate='' |
| 212 | hostosname='' |
| 213 | hostperl='' |
| 214 | run='' |
| 215 | targetarch='' |
| 216 | targetdir='' |
| 217 | targetenv='' |
| 218 | targethost='' |
| 219 | targetmkdir='' |
| 220 | targetport='' |
| 221 | to='' |
| 222 | usecrosscompile='' |
| 223 | extern_C='' |
| 224 | mistrustnm='' |
| 225 | usedevel='' |
| 226 | perllibs='' |
| 227 | dynamic_ext='' |
| 228 | extensions='' |
| 229 | known_extensions='' |
| 230 | nonxs_ext='' |
| 231 | static_ext='' |
| 232 | uselanginfo='' |
| 233 | useopcode='' |
| 234 | useposix='' |
| 235 | extras='' |
| 236 | d_bsd='' |
| 237 | d_eunice='' |
| 238 | d_xenix='' |
| 239 | eunicefix='' |
| 240 | ar='' |
| 241 | awk='' |
| 242 | bash='' |
| 243 | bison='' |
| 244 | byacc='' |
| 245 | cat='' |
| 246 | chgrp='' |
| 247 | chmod='' |
| 248 | chown='' |
| 249 | comm='' |
| 250 | compress='' |
| 251 | cp='' |
| 252 | cpio='' |
| 253 | cpp='' |
| 254 | csh='' |
| 255 | date='' |
| 256 | echo='' |
| 257 | egrep='' |
| 258 | emacs='' |
| 259 | expr='' |
| 260 | find='' |
| 261 | flex='' |
| 262 | gmake='' |
| 263 | grep='' |
| 264 | gzip='' |
| 265 | inews='' |
| 266 | ksh='' |
| 267 | less='' |
| 268 | line='' |
| 269 | lint='' |
| 270 | ln='' |
| 271 | lp='' |
| 272 | lpr='' |
| 273 | ls='' |
| 274 | mail='' |
| 275 | mailx='' |
| 276 | make='' |
| 277 | mkdir='' |
| 278 | more='' |
| 279 | mv='' |
| 280 | nm='' |
| 281 | nroff='' |
| 282 | perl='' |
| 283 | pg='' |
| 284 | pmake='' |
| 285 | pr='' |
| 286 | rm='' |
| 287 | rmail='' |
| 288 | sed='' |
| 289 | sendmail='' |
| 290 | shar='' |
| 291 | sleep='' |
| 292 | smail='' |
| 293 | sort='' |
| 294 | submit='' |
| 295 | tail='' |
| 296 | tar='' |
| 297 | tbl='' |
| 298 | tee='' |
| 299 | test='' |
| 300 | touch='' |
| 301 | tr='' |
| 302 | troff='' |
| 303 | uname='' |
| 304 | uniq='' |
| 305 | uuname='' |
| 306 | vi='' |
| 307 | zcat='' |
| 308 | zip='' |
| 309 | full_ar='' |
| 310 | full_sed='' |
| 311 | libswanted='' |
| 312 | hint='' |
| 313 | myuname='' |
| 314 | osname='' |
| 315 | osvers='' |
| 316 | Author='' |
| 317 | Date='' |
| 318 | Header='' |
| 319 | Id='' |
| 320 | Locker='' |
| 321 | Log='' |
| 322 | RCSfile='' |
| 323 | Revision='' |
| 324 | Source='' |
| 325 | State='' |
| 326 | sysroot='' |
| 327 | _a='' |
| 328 | _exe='' |
| 329 | _o='' |
| 330 | archobjs='' |
| 331 | exe_ext='' |
| 332 | firstmakefile='' |
| 333 | lib_ext='' |
| 334 | obj_ext='' |
| 335 | path_sep='' |
| 336 | rm_try='' |
| 337 | afs='' |
| 338 | afsroot='' |
| 339 | alignbytes='' |
| 340 | archlib='' |
| 341 | archlibexp='' |
| 342 | d_archlib='' |
| 343 | installarchlib='' |
| 344 | archname='' |
| 345 | myarchname='' |
| 346 | useversionedarchname='' |
| 347 | d_atolf='' |
| 348 | d_atoll='' |
| 349 | baserev='' |
| 350 | bin='' |
| 351 | binexp='' |
| 352 | initialinstalllocation='' |
| 353 | installbin='' |
| 354 | userelocatableinc='' |
| 355 | byteorder='' |
| 356 | cc='' |
| 357 | ccflags='' |
| 358 | cppflags='' |
| 359 | ldflags='' |
| 360 | lkflags='' |
| 361 | locincpth='' |
| 362 | optimize='' |
| 363 | cf_email='' |
| 364 | cf_by='' |
| 365 | cf_time='' |
| 366 | charbits='' |
| 367 | charsize='' |
| 368 | contains='' |
| 369 | cpp_stuff='' |
| 370 | cpplast='' |
| 371 | cppminus='' |
| 372 | cpprun='' |
| 373 | cppstdin='' |
| 374 | d__fwalk='' |
| 375 | d_accept4='' |
| 376 | d_access='' |
| 377 | d_accessx='' |
| 378 | d_acosh='' |
| 379 | d_aintl='' |
| 380 | d_alarm='' |
| 381 | asctime_r_proto='' |
| 382 | d_asctime_r='' |
| 383 | d_asinh='' |
| 384 | d_atanh='' |
| 385 | d_attribute_always_inline='' |
| 386 | d_attribute_deprecated='' |
| 387 | d_attribute_format='' |
| 388 | d_attribute_malloc='' |
| 389 | d_attribute_nonnull='' |
| 390 | d_attribute_noreturn='' |
| 391 | d_attribute_pure='' |
| 392 | d_attribute_unused='' |
| 393 | d_attribute_warn_unused_result='' |
| 394 | d_printf_format_null='' |
| 395 | d_backtrace='' |
| 396 | d_builtin_choose_expr='' |
| 397 | d_builtin_expect='' |
| 398 | d_builtin_add_overflow='' |
| 399 | d_builtin_mul_overflow='' |
| 400 | d_builtin_sub_overflow='' |
| 401 | d_c99_variadic_macros='' |
| 402 | d_casti32='' |
| 403 | castflags='' |
| 404 | d_castneg='' |
| 405 | d_cbrt='' |
| 406 | d_chown='' |
| 407 | d_chroot='' |
| 408 | d_chsize='' |
| 409 | d_class='' |
| 410 | d_clearenv='' |
| 411 | d_closedir='' |
| 412 | d_void_closedir='' |
| 413 | d_cmsghdr_s='' |
| 414 | d_copysign='' |
| 415 | d_copysignl='' |
| 416 | d_cplusplus='' |
| 417 | cryptlib='' |
| 418 | d_crypt='' |
| 419 | crypt_r_proto='' |
| 420 | d_crypt_r='' |
| 421 | d_csh='' |
| 422 | full_csh='' |
| 423 | d_ctermid='' |
| 424 | ctermid_r_proto='' |
| 425 | d_ctermid_r='' |
| 426 | ctime_r_proto='' |
| 427 | d_ctime_r='' |
| 428 | d_cuserid='' |
| 429 | d_dbminitproto='' |
| 430 | d_difftime='' |
| 431 | d_dir_dd_fd='' |
| 432 | d_dirfd='' |
| 433 | d_dladdr='' |
| 434 | d_dlerror='' |
| 435 | d_dlopen='' |
| 436 | d_dlsymun='' |
| 437 | d_dosuid='' |
| 438 | d_suidsafe='' |
| 439 | d_drand48_r='' |
| 440 | drand48_r_proto='' |
| 441 | d_drand48proto='' |
| 442 | d_dup2='' |
| 443 | d_dup3='' |
| 444 | d_eaccess='' |
| 445 | d_endgrent='' |
| 446 | d_endgrent_r='' |
| 447 | endgrent_r_proto='' |
| 448 | d_endhent='' |
| 449 | d_endhostent_r='' |
| 450 | endhostent_r_proto='' |
| 451 | d_endnent='' |
| 452 | d_endnetent_r='' |
| 453 | endnetent_r_proto='' |
| 454 | d_endpent='' |
| 455 | d_endprotoent_r='' |
| 456 | endprotoent_r_proto='' |
| 457 | d_endpwent='' |
| 458 | d_endpwent_r='' |
| 459 | endpwent_r_proto='' |
| 460 | d_endsent='' |
| 461 | d_endservent_r='' |
| 462 | endservent_r_proto='' |
| 463 | d_erf='' |
| 464 | d_erfc='' |
| 465 | d_exp2='' |
| 466 | d_expm1='' |
| 467 | d_faststdio='' |
| 468 | d_fchdir='' |
| 469 | d_fchmod='' |
| 470 | d_fchown='' |
| 471 | d_fcntl='' |
| 472 | d_fcntl_can_lock='' |
| 473 | d_fd_macros='' |
| 474 | d_fd_set='' |
| 475 | d_fds_bits='' |
| 476 | d_fdclose='' |
| 477 | d_fdim='' |
| 478 | d_fegetround='' |
| 479 | d_fgetpos='' |
| 480 | d_finite='' |
| 481 | d_finitel='' |
| 482 | d_flexfnam='' |
| 483 | d_flock='' |
| 484 | d_flockproto='' |
| 485 | d_fma='' |
| 486 | d_fmax='' |
| 487 | d_fmin='' |
| 488 | d_fork='' |
| 489 | d_fp_class='' |
| 490 | d_fp_classl='' |
| 491 | d_fpclass='' |
| 492 | d_fp_classify='' |
| 493 | d_fpclassify='' |
| 494 | d_fpclassl='' |
| 495 | d_fpgetround='' |
| 496 | d_fpos64_t='' |
| 497 | d_frexpl='' |
| 498 | d_fs_data_s='' |
| 499 | d_fchmodat='' |
| 500 | d_linkat='' |
| 501 | d_openat='' |
| 502 | d_renameat='' |
| 503 | d_unlinkat='' |
| 504 | d_fseeko='' |
| 505 | d_fsetpos='' |
| 506 | d_fstatfs='' |
| 507 | d_fsync='' |
| 508 | d_ftello='' |
| 509 | d_ftime='' |
| 510 | d_gettimeod='' |
| 511 | d_futimes='' |
| 512 | d_gai_strerror='' |
| 513 | d_Gconvert='' |
| 514 | d_getaddrinfo='' |
| 515 | d_getcwd='' |
| 516 | d_getespwnam='' |
| 517 | d_getfsstat='' |
| 518 | d_getgrent='' |
| 519 | d_getgrent_r='' |
| 520 | getgrent_r_proto='' |
| 521 | d_getgrgid_r='' |
| 522 | getgrgid_r_proto='' |
| 523 | d_getgrnam_r='' |
| 524 | getgrnam_r_proto='' |
| 525 | d_getgrps='' |
| 526 | d_gethbyaddr='' |
| 527 | d_gethbyname='' |
| 528 | d_gethent='' |
| 529 | aphostname='' |
| 530 | d_gethname='' |
| 531 | d_phostname='' |
| 532 | d_uname='' |
| 533 | d_gethostbyaddr_r='' |
| 534 | gethostbyaddr_r_proto='' |
| 535 | d_gethostbyname_r='' |
| 536 | gethostbyname_r_proto='' |
| 537 | d_gethostent_r='' |
| 538 | gethostent_r_proto='' |
| 539 | d_gethostprotos='' |
| 540 | d_getitimer='' |
| 541 | d_getlogin='' |
| 542 | d_getlogin_r='' |
| 543 | getlogin_r_proto='' |
| 544 | d_getmnt='' |
| 545 | d_getmntent='' |
| 546 | d_getnameinfo='' |
| 547 | d_getnbyaddr='' |
| 548 | d_getnbyname='' |
| 549 | d_getnent='' |
| 550 | d_getnetbyaddr_r='' |
| 551 | getnetbyaddr_r_proto='' |
| 552 | d_getnetbyname_r='' |
| 553 | getnetbyname_r_proto='' |
| 554 | d_getnetent_r='' |
| 555 | getnetent_r_proto='' |
| 556 | d_getnetprotos='' |
| 557 | d_getpagsz='' |
| 558 | d_getpent='' |
| 559 | d_getpgid='' |
| 560 | d_getpgrp2='' |
| 561 | d_bsdgetpgrp='' |
| 562 | d_getpgrp='' |
| 563 | d_getppid='' |
| 564 | d_getprior='' |
| 565 | d_getpbyname='' |
| 566 | d_getpbynumber='' |
| 567 | d_getprotobyname_r='' |
| 568 | getprotobyname_r_proto='' |
| 569 | d_getprotobynumber_r='' |
| 570 | getprotobynumber_r_proto='' |
| 571 | d_getprotoent_r='' |
| 572 | getprotoent_r_proto='' |
| 573 | d_getprotoprotos='' |
| 574 | d_getprpwnam='' |
| 575 | d_getpwent='' |
| 576 | d_getpwent_r='' |
| 577 | getpwent_r_proto='' |
| 578 | d_getpwnam_r='' |
| 579 | getpwnam_r_proto='' |
| 580 | d_getpwuid_r='' |
| 581 | getpwuid_r_proto='' |
| 582 | d_getsent='' |
| 583 | d_getservbyname_r='' |
| 584 | getservbyname_r_proto='' |
| 585 | d_getservbyport_r='' |
| 586 | getservbyport_r_proto='' |
| 587 | d_getservent_r='' |
| 588 | getservent_r_proto='' |
| 589 | d_getservprotos='' |
| 590 | d_getspnam='' |
| 591 | d_getspnam_r='' |
| 592 | getspnam_r_proto='' |
| 593 | d_getsbyname='' |
| 594 | d_getsbyport='' |
| 595 | d_gmtime_r='' |
| 596 | gmtime_r_proto='' |
| 597 | d_gnulibc='' |
| 598 | gnulibc_version='' |
| 599 | d_hasmntopt='' |
| 600 | d_htonl='' |
| 601 | d_hypot='' |
| 602 | d_ilogb='' |
| 603 | d_ilogbl='' |
| 604 | d_inetaton='' |
| 605 | d_inetntop='' |
| 606 | d_inetpton='' |
| 607 | d_int64_t='' |
| 608 | d_isascii='' |
| 609 | d_isblank='' |
| 610 | d_isfinite='' |
| 611 | d_isfinitel='' |
| 612 | d_isinf='' |
| 613 | d_isinfl='' |
| 614 | d_isless='' |
| 615 | d_isnan='' |
| 616 | d_isnanl='' |
| 617 | d_isnormal='' |
| 618 | d_j0='' |
| 619 | d_j0l='' |
| 620 | d_killpg='' |
| 621 | d_lc_monetary_2008='' |
| 622 | d_lchown='' |
| 623 | d_ldbl_dig='' |
| 624 | d_lgamma='' |
| 625 | d_lgamma_r='' |
| 626 | d_libm_lib_version='' |
| 627 | d_link='' |
| 628 | d_llrint='' |
| 629 | d_llrintl='' |
| 630 | d_llround='' |
| 631 | d_llroundl='' |
| 632 | d_localeconv_l='' |
| 633 | d_localtime_r='' |
| 634 | d_localtime_r_needs_tzset='' |
| 635 | localtime_r_proto='' |
| 636 | d_locconv='' |
| 637 | d_lockf='' |
| 638 | d_log1p='' |
| 639 | d_log2='' |
| 640 | d_logb='' |
| 641 | d_ldexpl='' |
| 642 | d_long_double_style_ieee='' |
| 643 | d_long_double_style_ieee_doubledouble='' |
| 644 | d_long_double_style_ieee_extended='' |
| 645 | d_long_double_style_ieee_std='' |
| 646 | d_long_double_style_vax='' |
| 647 | d_longdbl='' |
| 648 | longdblkind='' |
| 649 | longdblsize='' |
| 650 | d_longlong='' |
| 651 | longlongsize='' |
| 652 | d_lrint='' |
| 653 | d_lrintl='' |
| 654 | d_lround='' |
| 655 | d_lroundl='' |
| 656 | d_lseekproto='' |
| 657 | d_lstat='' |
| 658 | d_madvise='' |
| 659 | d_malloc_good_size='' |
| 660 | d_malloc_size='' |
| 661 | d_malloc_usable_size='' |
| 662 | d_mblen='' |
| 663 | d_mbrlen='' |
| 664 | d_mbrtowc='' |
| 665 | d_mbstowcs='' |
| 666 | d_mbtowc='' |
| 667 | d_memmem='' |
| 668 | d_memrchr='' |
| 669 | d_mkdir='' |
| 670 | d_mkdtemp='' |
| 671 | d_mkfifo='' |
| 672 | d_mkostemp='' |
| 673 | d_mkstemp='' |
| 674 | d_mkstemps='' |
| 675 | d_mktime='' |
| 676 | d_mmap='' |
| 677 | mmaptype='' |
| 678 | d_modfl='' |
| 679 | d_modflproto='' |
| 680 | d_mprotect='' |
| 681 | d_msg='' |
| 682 | d_msgctl='' |
| 683 | d_msgget='' |
| 684 | d_msghdr_s='' |
| 685 | d_msgrcv='' |
| 686 | d_msgsnd='' |
| 687 | d_msync='' |
| 688 | d_munmap='' |
| 689 | d_nan='' |
| 690 | d_nanosleep='' |
| 691 | d_nearbyint='' |
| 692 | d_duplocale='' |
| 693 | d_freelocale='' |
| 694 | d_newlocale='' |
| 695 | d_querylocale='' |
| 696 | d_uselocale='' |
| 697 | i_xlocale='' |
| 698 | d_nextafter='' |
| 699 | d_nexttoward='' |
| 700 | d_nice='' |
| 701 | d_nl_langinfo='' |
| 702 | d_thread_safe_nl_langinfo_l='' |
| 703 | d_off64_t='' |
| 704 | d_open3='' |
| 705 | d_fpathconf='' |
| 706 | d_pathconf='' |
| 707 | d_pause='' |
| 708 | d_pipe2='' |
| 709 | d_pipe='' |
| 710 | d_poll='' |
| 711 | d_portable='' |
| 712 | d_prctl='' |
| 713 | d_prctl_set_name='' |
| 714 | d_procselfexe='' |
| 715 | procselfexe='' |
| 716 | d_old_pthread_create_joinable='' |
| 717 | old_pthread_create_joinable='' |
| 718 | d_pthread_atfork='' |
| 719 | d_pthread_attr_setscope='' |
| 720 | d_pthread_yield='' |
| 721 | d_sched_yield='' |
| 722 | sched_yield='' |
| 723 | d_ptrdiff_t='' |
| 724 | d_qgcvt='' |
| 725 | d_random_r='' |
| 726 | random_r_proto='' |
| 727 | d_readdir64_r='' |
| 728 | readdir64_r_proto='' |
| 729 | d_readdir='' |
| 730 | d_rewinddir='' |
| 731 | d_seekdir='' |
| 732 | d_telldir='' |
| 733 | d_readdir_r='' |
| 734 | readdir_r_proto='' |
| 735 | d_readlink='' |
| 736 | d_readv='' |
| 737 | d_recvmsg='' |
| 738 | d_re_comp='' |
| 739 | d_regcmp='' |
| 740 | d_regcomp='' |
| 741 | d_remainder='' |
| 742 | d_remquo='' |
| 743 | d_rename='' |
| 744 | d_rint='' |
| 745 | d_rmdir='' |
| 746 | d_round='' |
| 747 | d_sbrkproto='' |
| 748 | d_scalbn='' |
| 749 | d_scalbnl='' |
| 750 | d_select='' |
| 751 | d_sem='' |
| 752 | d_semctl='' |
| 753 | d_semget='' |
| 754 | d_semop='' |
| 755 | d_sendmsg='' |
| 756 | d_setegid='' |
| 757 | d_seteuid='' |
| 758 | d_setgrent='' |
| 759 | d_setgrent_r='' |
| 760 | setgrent_r_proto='' |
| 761 | d_setgrps='' |
| 762 | d_sethent='' |
| 763 | d_sethostent_r='' |
| 764 | sethostent_r_proto='' |
| 765 | d_setitimer='' |
| 766 | d_setlinebuf='' |
| 767 | d_has_C_UTF8='' |
| 768 | d_setlocale='' |
| 769 | d_setlocale_accepts_any_locale_name='' |
| 770 | d_setlocale_r='' |
| 771 | setlocale_r_proto='' |
| 772 | d_setnent='' |
| 773 | d_setnetent_r='' |
| 774 | setnetent_r_proto='' |
| 775 | d_setpent='' |
| 776 | d_setpgid='' |
| 777 | d_setpgrp2='' |
| 778 | d_bsdsetpgrp='' |
| 779 | d_setpgrp='' |
| 780 | d_setprior='' |
| 781 | d_setproctitle='' |
| 782 | d_setprotoent_r='' |
| 783 | setprotoent_r_proto='' |
| 784 | d_setpwent='' |
| 785 | d_setpwent_r='' |
| 786 | setpwent_r_proto='' |
| 787 | d_setregid='' |
| 788 | d_setresgid='' |
| 789 | d_setresuid='' |
| 790 | d_setreuid='' |
| 791 | d_setrgid='' |
| 792 | d_setruid='' |
| 793 | d_setsent='' |
| 794 | d_setservent_r='' |
| 795 | setservent_r_proto='' |
| 796 | d_setsid='' |
| 797 | d_setvbuf='' |
| 798 | d_shm='' |
| 799 | d_shmat='' |
| 800 | d_shmatprototype='' |
| 801 | shmattype='' |
| 802 | d_shmctl='' |
| 803 | d_shmdt='' |
| 804 | d_shmget='' |
| 805 | d_sigaction='' |
| 806 | d_siginfo_si_addr='' |
| 807 | d_siginfo_si_band='' |
| 808 | d_siginfo_si_errno='' |
| 809 | d_siginfo_si_fd='' |
| 810 | d_siginfo_si_pid='' |
| 811 | d_siginfo_si_status='' |
| 812 | d_siginfo_si_uid='' |
| 813 | d_siginfo_si_value='' |
| 814 | d_signbit='' |
| 815 | d_sigprocmask='' |
| 816 | d_sigsetjmp='' |
| 817 | usesitecustomize='' |
| 818 | d_snprintf='' |
| 819 | d_vsnprintf='' |
| 820 | d_sockatmark='' |
| 821 | d_sockatmarkproto='' |
| 822 | d_ip_mreq='' |
| 823 | d_ip_mreq_source='' |
| 824 | d_ipv6_mreq='' |
| 825 | d_ipv6_mreq_source='' |
| 826 | d_msg_ctrunc='' |
| 827 | d_msg_dontroute='' |
| 828 | d_msg_oob='' |
| 829 | d_msg_peek='' |
| 830 | d_msg_proxy='' |
| 831 | d_oldsock='' |
| 832 | d_scm_rights='' |
| 833 | d_sin6_scope_id='' |
| 834 | d_sockaddr_in6='' |
| 835 | d_sockaddr_sa_len='' |
| 836 | d_socket='' |
| 837 | d_sockpair='' |
| 838 | sockethdr='' |
| 839 | socketlib='' |
| 840 | d_socklen_t='' |
| 841 | d_socks5_init='' |
| 842 | d_sqrtl='' |
| 843 | d_srand48_r='' |
| 844 | srand48_r_proto='' |
| 845 | d_srandom_r='' |
| 846 | srandom_r_proto='' |
| 847 | d_sresgproto='' |
| 848 | d_sresuproto='' |
| 849 | d_stat='' |
| 850 | d_statblks='' |
| 851 | d_statfs_f_flags='' |
| 852 | d_statfs_s='' |
| 853 | d_static_inline='' |
| 854 | perl_static_inline='' |
| 855 | d_fstatvfs='' |
| 856 | d_statvfs='' |
| 857 | d_stdio_cnt_lval='' |
| 858 | d_stdio_ptr_lval='' |
| 859 | d_stdio_ptr_lval_nochange_cnt='' |
| 860 | d_stdio_ptr_lval_sets_cnt='' |
| 861 | d_stdiobase='' |
| 862 | d_stdstdio='' |
| 863 | stdio_base='' |
| 864 | stdio_bufsiz='' |
| 865 | stdio_cnt='' |
| 866 | stdio_filbuf='' |
| 867 | stdio_ptr='' |
| 868 | d_strcoll='' |
| 869 | d_sysernlst='' |
| 870 | d_syserrlst='' |
| 871 | d_strerror_l='' |
| 872 | d_strerror_r='' |
| 873 | strerror_r_proto='' |
| 874 | d_strftime='' |
| 875 | d_strlcat='' |
| 876 | d_strlcpy='' |
| 877 | d_strnlen='' |
| 878 | d_strtod='' |
| 879 | d_strtod_l='' |
| 880 | d_strtol='' |
| 881 | d_strtold='' |
| 882 | d_strtold_l='' |
| 883 | d_strtoll='' |
| 884 | d_strtoq='' |
| 885 | d_strtoul='' |
| 886 | d_strtoull='' |
| 887 | d_strtouq='' |
| 888 | d_strxfrm='' |
| 889 | d_symlink='' |
| 890 | d_syscall='' |
| 891 | d_syscallproto='' |
| 892 | d_sysconf='' |
| 893 | d_system='' |
| 894 | d_tcgetpgrp='' |
| 895 | d_tcsetpgrp='' |
| 896 | d_telldirproto='' |
| 897 | d_tgamma='' |
| 898 | d_time='' |
| 899 | timetype='' |
| 900 | d_asctime64='' |
| 901 | d_ctime64='' |
| 902 | d_difftime64='' |
| 903 | d_gmtime64='' |
| 904 | d_localtime64='' |
| 905 | d_mktime64='' |
| 906 | d_timegm='' |
| 907 | clocktype='' |
| 908 | d_times='' |
| 909 | d_tmpnam_r='' |
| 910 | tmpnam_r_proto='' |
| 911 | d_towlower='' |
| 912 | d_towupper='' |
| 913 | d_trunc='' |
| 914 | d_truncate='' |
| 915 | d_truncl='' |
| 916 | d_ttyname_r='' |
| 917 | ttyname_r_proto='' |
| 918 | d_tzname='' |
| 919 | d_u32align='' |
| 920 | d_ualarm='' |
| 921 | d_umask='' |
| 922 | d_semctl_semid_ds='' |
| 923 | d_semctl_semun='' |
| 924 | d_union_semun='' |
| 925 | d_unordered='' |
| 926 | d_unsetenv='' |
| 927 | d_usleep='' |
| 928 | d_usleepproto='' |
| 929 | d_ustat='' |
| 930 | d_pseudofork='' |
| 931 | d_vfork='' |
| 932 | usevfork='' |
| 933 | d_voidsig='' |
| 934 | signal_t='' |
| 935 | d_wait4='' |
| 936 | d_waitpid='' |
| 937 | d_wcrtomb='' |
| 938 | d_wcscmp='' |
| 939 | d_wcstombs='' |
| 940 | d_wcsxfrm='' |
| 941 | d_wctomb='' |
| 942 | d_writev='' |
| 943 | default_inc_excludes_dot='' |
| 944 | dlext='' |
| 945 | bin_ELF='' |
| 946 | cccdlflags='' |
| 947 | ccdlflags='' |
| 948 | dlsrc='' |
| 949 | ld='' |
| 950 | ld_can_script='' |
| 951 | lddlflags='' |
| 952 | usedl='' |
| 953 | doublesize='' |
| 954 | dtraceobject='' |
| 955 | dtracexnolibs='' |
| 956 | ebcdic='' |
| 957 | fflushNULL='' |
| 958 | fflushall='' |
| 959 | fpossize='' |
| 960 | fpostype='' |
| 961 | gccansipedantic='' |
| 962 | gccosandvers='' |
| 963 | gccversion='' |
| 964 | gidformat='' |
| 965 | gidsign='' |
| 966 | gidsize='' |
| 967 | gidtype='' |
| 968 | groupstype='' |
| 969 | h_fcntl='' |
| 970 | h_sysfile='' |
| 971 | html1dir='' |
| 972 | html1direxp='' |
| 973 | installhtml1dir='' |
| 974 | html3dir='' |
| 975 | html3direxp='' |
| 976 | installhtml3dir='' |
| 977 | i_arpainet='' |
| 978 | i_bfd='' |
| 979 | i_crypt='' |
| 980 | db_hashtype='' |
| 981 | db_prefixtype='' |
| 982 | db_version_major='' |
| 983 | db_version_minor='' |
| 984 | db_version_patch='' |
| 985 | i_db='' |
| 986 | i_dbm='' |
| 987 | i_rpcsvcdbm='' |
| 988 | d_dirnamlen='' |
| 989 | direntrytype='' |
| 990 | i_dirent='' |
| 991 | i_dlfcn='' |
| 992 | i_execinfo='' |
| 993 | i_fcntl='' |
| 994 | i_fenv='' |
| 995 | i_fp='' |
| 996 | i_fp_class='' |
| 997 | i_gdbm='' |
| 998 | d_grpasswd='' |
| 999 | i_grp='' |
| 1000 | i_ieeefp='' |
| 1001 | i_inttypes='' |
| 1002 | i_langinfo='' |
| 1003 | i_libutil='' |
| 1004 | i_locale='' |
| 1005 | i_machcthr='' |
| 1006 | i_malloc='' |
| 1007 | i_mallocmalloc='' |
| 1008 | i_mntent='' |
| 1009 | d_gdbm_ndbm_h_uses_prototypes='' |
| 1010 | d_gdbmndbm_h_uses_prototypes='' |
| 1011 | d_ndbm='' |
| 1012 | d_ndbm_h_uses_prototypes='' |
| 1013 | i_gdbm_ndbm='' |
| 1014 | i_gdbmndbm='' |
| 1015 | i_ndbm='' |
| 1016 | i_netdb='' |
| 1017 | i_neterrno='' |
| 1018 | i_netinettcp='' |
| 1019 | i_niin='' |
| 1020 | i_sysin='' |
| 1021 | i_poll='' |
| 1022 | i_prot='' |
| 1023 | i_pthread='' |
| 1024 | d_pwage='' |
| 1025 | d_pwchange='' |
| 1026 | d_pwclass='' |
| 1027 | d_pwcomment='' |
| 1028 | d_pwexpire='' |
| 1029 | d_pwgecos='' |
| 1030 | d_pwpasswd='' |
| 1031 | d_pwquota='' |
| 1032 | i_pwd='' |
| 1033 | i_quadmath='' |
| 1034 | i_shadow='' |
| 1035 | i_socks='' |
| 1036 | i_stdbool='' |
| 1037 | i_stdint='' |
| 1038 | i_stdlib='' |
| 1039 | i_sunmath='' |
| 1040 | i_sysaccess='' |
| 1041 | i_sysdir='' |
| 1042 | i_sysfile='' |
| 1043 | d_voidtty='' |
| 1044 | i_bsdioctl='' |
| 1045 | i_sysfilio='' |
| 1046 | i_sysioctl='' |
| 1047 | i_syssockio='' |
| 1048 | i_syslog='' |
| 1049 | i_sysmman='' |
| 1050 | i_sysmode='' |
| 1051 | i_sysmount='' |
| 1052 | i_sysndir='' |
| 1053 | i_sysparam='' |
| 1054 | i_syspoll='' |
| 1055 | i_sysresrc='' |
| 1056 | i_syssecrt='' |
| 1057 | i_sysselct='' |
| 1058 | i_sysstat='' |
| 1059 | i_sysstatfs='' |
| 1060 | i_sysstatvfs='' |
| 1061 | i_systimes='' |
| 1062 | i_systypes='' |
| 1063 | i_sysuio='' |
| 1064 | i_sysun='' |
| 1065 | i_sysutsname='' |
| 1066 | i_sysvfs='' |
| 1067 | i_syswait='' |
| 1068 | i_sgtty='' |
| 1069 | i_termio='' |
| 1070 | i_termios='' |
| 1071 | d_tm_tm_gmtoff='' |
| 1072 | d_tm_tm_zone='' |
| 1073 | i_systime='' |
| 1074 | i_systimek='' |
| 1075 | i_time='' |
| 1076 | timeincl='' |
| 1077 | i_unistd='' |
| 1078 | i_ustat='' |
| 1079 | i_utime='' |
| 1080 | i_vfork='' |
| 1081 | i_wchar='' |
| 1082 | i_wctype='' |
| 1083 | d_inc_version_list='' |
| 1084 | inc_version_list='' |
| 1085 | inc_version_list_init='' |
| 1086 | doubleinfbytes='' |
| 1087 | doublenanbytes='' |
| 1088 | longdblinfbytes='' |
| 1089 | longdblnanbytes='' |
| 1090 | installprefix='' |
| 1091 | installprefixexp='' |
| 1092 | installstyle='' |
| 1093 | installusrbinperl='' |
| 1094 | intsize='' |
| 1095 | longsize='' |
| 1096 | shortsize='' |
| 1097 | issymlink='' |
| 1098 | libc='' |
| 1099 | ldlibpthname='' |
| 1100 | libperl='' |
| 1101 | shrpenv='' |
| 1102 | useshrplib='' |
| 1103 | glibpth='' |
| 1104 | incpth='' |
| 1105 | libpth='' |
| 1106 | loclibpth='' |
| 1107 | plibpth='' |
| 1108 | xlibpth='' |
| 1109 | ignore_versioned_solibs='' |
| 1110 | libs='' |
| 1111 | libsdirs='' |
| 1112 | libsfiles='' |
| 1113 | libsfound='' |
| 1114 | libspath='' |
| 1115 | lns='' |
| 1116 | d_PRIEUldbl='' |
| 1117 | d_PRIFUldbl='' |
| 1118 | d_PRIGUldbl='' |
| 1119 | d_PRIeldbl='' |
| 1120 | d_PRIfldbl='' |
| 1121 | d_PRIgldbl='' |
| 1122 | d_SCNfldbl='' |
| 1123 | d_double_has_inf='' |
| 1124 | d_double_has_nan='' |
| 1125 | d_double_has_negative_zero='' |
| 1126 | d_double_has_subnormals='' |
| 1127 | d_double_style_cray='' |
| 1128 | d_double_style_ibm='' |
| 1129 | d_double_style_ieee='' |
| 1130 | d_double_style_vax='' |
| 1131 | doublekind='' |
| 1132 | sPRIEUldbl='' |
| 1133 | sPRIFUldbl='' |
| 1134 | sPRIGUldbl='' |
| 1135 | sPRIeldbl='' |
| 1136 | sPRIfldbl='' |
| 1137 | sPRIgldbl='' |
| 1138 | sSCNfldbl='' |
| 1139 | lseeksize='' |
| 1140 | lseektype='' |
| 1141 | make_set_make='' |
| 1142 | d_mymalloc='' |
| 1143 | freetype='' |
| 1144 | mallocobj='' |
| 1145 | mallocsrc='' |
| 1146 | malloctype='' |
| 1147 | usemallocwrap='' |
| 1148 | usemymalloc='' |
| 1149 | installman1dir='' |
| 1150 | man1dir='' |
| 1151 | man1direxp='' |
| 1152 | man1ext='' |
| 1153 | installman3dir='' |
| 1154 | man3dir='' |
| 1155 | man3direxp='' |
| 1156 | man3ext='' |
| 1157 | doublemantbits='' |
| 1158 | longdblmantbits='' |
| 1159 | nvmantbits='' |
| 1160 | modetype='' |
| 1161 | multiarch='' |
| 1162 | mydomain='' |
| 1163 | myhostname='' |
| 1164 | phostname='' |
| 1165 | c='' |
| 1166 | n='' |
| 1167 | d_eofnblk='' |
| 1168 | eagain='' |
| 1169 | o_nonblock='' |
| 1170 | rd_nodata='' |
| 1171 | need_va_copy='' |
| 1172 | netdb_hlen_type='' |
| 1173 | netdb_host_type='' |
| 1174 | netdb_name_type='' |
| 1175 | netdb_net_type='' |
| 1176 | groupcat='' |
| 1177 | hostcat='' |
| 1178 | passcat='' |
| 1179 | orderlib='' |
| 1180 | ranlib='' |
| 1181 | d_perl_otherlibdirs='' |
| 1182 | otherlibdirs='' |
| 1183 | package='' |
| 1184 | spackage='' |
| 1185 | pager='' |
| 1186 | api_revision='' |
| 1187 | api_subversion='' |
| 1188 | api_version='' |
| 1189 | api_versionstring='' |
| 1190 | patchlevel='' |
| 1191 | perl_patchlevel='' |
| 1192 | revision='' |
| 1193 | subversion='' |
| 1194 | version='' |
| 1195 | version_patchlevel_string='' |
| 1196 | perl5='' |
| 1197 | perladmin='' |
| 1198 | perlpath='' |
| 1199 | d_nv_preserves_uv='' |
| 1200 | d_nv_zero_is_allbits_zero='' |
| 1201 | i16size='' |
| 1202 | i16type='' |
| 1203 | i32size='' |
| 1204 | i32type='' |
| 1205 | i64size='' |
| 1206 | i64type='' |
| 1207 | i8size='' |
| 1208 | i8type='' |
| 1209 | ivsize='' |
| 1210 | ivtype='' |
| 1211 | nv_overflows_integers_at='' |
| 1212 | nv_preserves_uv_bits='' |
| 1213 | nvsize='' |
| 1214 | nvtype='' |
| 1215 | u16size='' |
| 1216 | u16type='' |
| 1217 | u32size='' |
| 1218 | u32type='' |
| 1219 | u64size='' |
| 1220 | u64type='' |
| 1221 | u8size='' |
| 1222 | u8type='' |
| 1223 | uvsize='' |
| 1224 | uvtype='' |
| 1225 | ivdformat='' |
| 1226 | nvEUformat='' |
| 1227 | nvFUformat='' |
| 1228 | nvGUformat='' |
| 1229 | nveformat='' |
| 1230 | nvfformat='' |
| 1231 | nvgformat='' |
| 1232 | uvXUformat='' |
| 1233 | uvoformat='' |
| 1234 | uvuformat='' |
| 1235 | uvxformat='' |
| 1236 | pidtype='' |
| 1237 | prefix='' |
| 1238 | prefixexp='' |
| 1239 | installprivlib='' |
| 1240 | privlib='' |
| 1241 | privlibexp='' |
| 1242 | ptrsize='' |
| 1243 | d_PRIXU64='' |
| 1244 | d_PRId64='' |
| 1245 | d_PRIi64='' |
| 1246 | d_PRIo64='' |
| 1247 | d_PRIu64='' |
| 1248 | d_PRIx64='' |
| 1249 | sPRIXU64='' |
| 1250 | sPRId64='' |
| 1251 | sPRIi64='' |
| 1252 | sPRIo64='' |
| 1253 | sPRIu64='' |
| 1254 | sPRIx64='' |
| 1255 | d_quad='' |
| 1256 | quadkind='' |
| 1257 | quadtype='' |
| 1258 | uquadtype='' |
| 1259 | drand01='' |
| 1260 | randbits='' |
| 1261 | randfunc='' |
| 1262 | randseedtype='' |
| 1263 | seedfunc='' |
| 1264 | installscript='' |
| 1265 | scriptdir='' |
| 1266 | scriptdirexp='' |
| 1267 | selectminbits='' |
| 1268 | selecttype='' |
| 1269 | sh='' |
| 1270 | targetsh='' |
| 1271 | sig_count='' |
| 1272 | sig_name='' |
| 1273 | sig_name_init='' |
| 1274 | sig_num='' |
| 1275 | sig_num_init='' |
| 1276 | sig_size='' |
| 1277 | d_sitearch='' |
| 1278 | installsitearch='' |
| 1279 | sitearch='' |
| 1280 | sitearchexp='' |
| 1281 | installsitebin='' |
| 1282 | sitebin='' |
| 1283 | sitebinexp='' |
| 1284 | installsitehtml1dir='' |
| 1285 | sitehtml1dir='' |
| 1286 | sitehtml1direxp='' |
| 1287 | installsitehtml3dir='' |
| 1288 | sitehtml3dir='' |
| 1289 | sitehtml3direxp='' |
| 1290 | installsitelib='' |
| 1291 | sitelib='' |
| 1292 | sitelib_stem='' |
| 1293 | sitelibexp='' |
| 1294 | installsiteman1dir='' |
| 1295 | siteman1dir='' |
| 1296 | siteman1direxp='' |
| 1297 | installsiteman3dir='' |
| 1298 | siteman3dir='' |
| 1299 | siteman3direxp='' |
| 1300 | siteprefix='' |
| 1301 | siteprefixexp='' |
| 1302 | installsitescript='' |
| 1303 | sitescript='' |
| 1304 | sitescriptexp='' |
| 1305 | sizesize='' |
| 1306 | sizetype='' |
| 1307 | d_libname_unique='' |
| 1308 | so='' |
| 1309 | socksizetype='' |
| 1310 | sharpbang='' |
| 1311 | shsharp='' |
| 1312 | spitshell='' |
| 1313 | src='' |
| 1314 | ssizetype='' |
| 1315 | st_ino_sign='' |
| 1316 | st_ino_size='' |
| 1317 | startperl='' |
| 1318 | startsh='' |
| 1319 | stdchar='' |
| 1320 | d_stdio_stream_array='' |
| 1321 | stdio_stream_array='' |
| 1322 | sysman='' |
| 1323 | sGMTIME_max='' |
| 1324 | sGMTIME_min='' |
| 1325 | sLOCALTIME_max='' |
| 1326 | sLOCALTIME_min='' |
| 1327 | trnl='' |
| 1328 | uidformat='' |
| 1329 | uidsign='' |
| 1330 | uidsize='' |
| 1331 | uidtype='' |
| 1332 | archname64='' |
| 1333 | use64bitall='' |
| 1334 | use64bitint='' |
| 1335 | usecbacktrace='' |
| 1336 | dtrace='' |
| 1337 | usedtrace='' |
| 1338 | usefaststdio='' |
| 1339 | usekernprocpathname='' |
| 1340 | ccflags_uselargefiles='' |
| 1341 | ldflags_uselargefiles='' |
| 1342 | libswanted_uselargefiles='' |
| 1343 | uselargefiles='' |
| 1344 | uselongdouble='' |
| 1345 | usemorebits='' |
| 1346 | usemultiplicity='' |
| 1347 | nm_opt='' |
| 1348 | nm_so_opt='' |
| 1349 | runnm='' |
| 1350 | usenm='' |
| 1351 | usensgetexecutablepath='' |
| 1352 | useperlio='' |
| 1353 | usequadmath='' |
| 1354 | usesocks='' |
| 1355 | d_oldpthreads='' |
| 1356 | use5005threads='' |
| 1357 | useithreads='' |
| 1358 | usereentrant='' |
| 1359 | usethreads='' |
| 1360 | incpath='' |
| 1361 | mips_type='' |
| 1362 | usrinc='' |
| 1363 | d_vendorarch='' |
| 1364 | installvendorarch='' |
| 1365 | vendorarch='' |
| 1366 | vendorarchexp='' |
| 1367 | d_vendorbin='' |
| 1368 | installvendorbin='' |
| 1369 | vendorbin='' |
| 1370 | vendorbinexp='' |
| 1371 | installvendorhtml1dir='' |
| 1372 | vendorhtml1dir='' |
| 1373 | vendorhtml1direxp='' |
| 1374 | installvendorhtml3dir='' |
| 1375 | vendorhtml3dir='' |
| 1376 | vendorhtml3direxp='' |
| 1377 | d_vendorlib='' |
| 1378 | installvendorlib='' |
| 1379 | vendorlib='' |
| 1380 | vendorlib_stem='' |
| 1381 | vendorlibexp='' |
| 1382 | installvendorman1dir='' |
| 1383 | vendorman1dir='' |
| 1384 | vendorman1direxp='' |
| 1385 | installvendorman3dir='' |
| 1386 | vendorman3dir='' |
| 1387 | vendorman3direxp='' |
| 1388 | usevendorprefix='' |
| 1389 | vendorprefix='' |
| 1390 | vendorprefixexp='' |
| 1391 | d_vendorscript='' |
| 1392 | installvendorscript='' |
| 1393 | vendorscript='' |
| 1394 | vendorscriptexp='' |
| 1395 | versiononly='' |
| 1396 | yacc='' |
| 1397 | yaccflags='' |
| 1398 | CONFIG='' |
| 1399 | |
| 1400 | : Detect odd OSs |
| 1401 | define='define' |
| 1402 | undef='undef' |
| 1403 | smallmach='pdp11 i8086 z8000 i80286 iAPX286' |
| 1404 | rmlist='' |
| 1405 | |
| 1406 | : We must find out about Eunice early |
| 1407 | eunicefix=':' |
| 1408 | if test -f /etc/unixtovms; then |
| 1409 | eunicefix=/etc/unixtovms |
| 1410 | fi |
| 1411 | if test -f /etc/unixtovms.exe; then |
| 1412 | eunicefix=/etc/unixtovms.exe |
| 1413 | fi |
| 1414 | |
| 1415 | : Set executable suffix now -- needed before hints available |
| 1416 | if test -f "/libs/version.library"; then |
| 1417 | : Amiga OS |
| 1418 | _exe="" |
| 1419 | elif test -f "/system/gnu_library/bin/ar.pm"; then |
| 1420 | : Stratus VOS |
| 1421 | _exe=".pm" |
| 1422 | elif test -n "$DJGPP"; then |
| 1423 | : DOS DJGPP |
| 1424 | _exe=".exe" |
| 1425 | elif test -f /kern/cookiejar; then |
| 1426 | : MiNT |
| 1427 | _exe="" |
| 1428 | elif test -d c:/. -o -n "$is_os2" ; then |
| 1429 | : OS/2 or cygwin |
| 1430 | _exe=".exe" |
| 1431 | fi |
| 1432 | |
| 1433 | groupstype='' |
| 1434 | i_whoami='' |
| 1435 | : Possible local include directories to search. |
| 1436 | : Set locincpth to "" in a hint file to defeat local include searches. |
| 1437 | locincpth="/usr/local/include /opt/local/include /usr/gnu/include" |
| 1438 | locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include" |
| 1439 | : |
| 1440 | : no include file wanted by default |
| 1441 | inclwanted='' |
| 1442 | |
| 1443 | : Enable -DEBUGGING and -DDEBUGGING from the command line |
| 1444 | EBUGGING='' |
| 1445 | DEBUGGING='' |
| 1446 | |
| 1447 | : Trailing extension. Override this in a hint file, if needed. |
| 1448 | : Extra object files, if any, needed on this platform. |
| 1449 | archobjs='' |
| 1450 | libnames='' |
| 1451 | : change the next line if compiling for Xenix/286 on Xenix/386 |
| 1452 | xlibpth='/usr/lib/386 /lib/386' |
| 1453 | : Possible local library directories to search. |
| 1454 | loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" |
| 1455 | loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" |
| 1456 | |
| 1457 | : general looking path for locating libraries |
| 1458 | glibpth="/lib /usr/lib $xlibpth" |
| 1459 | glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib" |
| 1460 | test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth" |
| 1461 | test -f /shlib/libc.so && glibpth="/shlib $glibpth" |
| 1462 | test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64" |
| 1463 | |
| 1464 | : Private path used by Configure to find libraries. Its value |
| 1465 | : is prepended to libpth. This variable takes care of special |
| 1466 | : machines, like the mips. Usually, it should be empty. |
| 1467 | plibpth='' |
| 1468 | |
| 1469 | : default library list |
| 1470 | libswanted='' |
| 1471 | : some systems want to use only the non-versioned libso:s |
| 1472 | ignore_versioned_solibs='' |
| 1473 | ccname='' |
| 1474 | ccversion='' |
| 1475 | perllibs='' |
| 1476 | : set useposix=false in your hint file to disable the POSIX extension. |
| 1477 | useposix=true |
| 1478 | : set useopcode=false in your hint file to disable the Opcode extension. |
| 1479 | useopcode=true |
| 1480 | : set uselanginfo=false in your hint file to disable the I18N::Langinfo extension. |
| 1481 | uselanginfo=true |
| 1482 | archname64='' |
| 1483 | ccflags_uselargefiles='' |
| 1484 | ldflags_uselargefiles='' |
| 1485 | libswanted_uselargefiles='' |
| 1486 | : set usemultiplicity on the Configure command line to enable multiplicity. |
| 1487 | : set usesocks on the Configure command line to enable socks. |
| 1488 | archname='' |
| 1489 | : set usethreads on the Configure command line to enable threads. |
| 1490 | usereentrant='undef' |
| 1491 | : List of libraries we want. |
| 1492 | : If anyone needs extra -lxxx, put those in a hint file. |
| 1493 | libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld" |
| 1494 | libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD" |
| 1495 | : We probably want to search /usr/shlib before most other libraries. |
| 1496 | : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. |
| 1497 | glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` |
| 1498 | glibpth="/usr/shlib $glibpth" |
| 1499 | : Do not use vfork unless overridden by a hint file. |
| 1500 | usevfork=false |
| 1501 | |
| 1502 | : Find the basic shell for Bourne shell scripts |
| 1503 | case "$sh" in |
| 1504 | '') |
| 1505 | case "$SYSTYPE" in |
| 1506 | *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";; |
| 1507 | *) xxx='/bin/sh';; |
| 1508 | esac |
| 1509 | if test -f "$xxx"; then |
| 1510 | sh="$xxx" |
| 1511 | else |
| 1512 | : Build up a list and do a single loop so we can 'break' out. |
| 1513 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
| 1514 | for xxx in sh bash ksh pdksh ash; do |
| 1515 | for p in $pth; do |
| 1516 | try="$try ${p}/${xxx}" |
| 1517 | done |
| 1518 | done |
| 1519 | for xxx in $try; do |
| 1520 | if test -f "$xxx"; then |
| 1521 | sh="$xxx"; |
| 1522 | break |
| 1523 | elif test "X$_exe" != X -a -f "$xxx$_exe"; then |
| 1524 | sh="$xxx"; |
| 1525 | break |
| 1526 | elif test -f "$xxx.exe"; then |
| 1527 | sh="$xxx"; |
| 1528 | break |
| 1529 | fi |
| 1530 | done |
| 1531 | fi |
| 1532 | ;; |
| 1533 | esac |
| 1534 | |
| 1535 | case "$sh" in |
| 1536 | '') cat >&2 <<EOM |
| 1537 | $me: Fatal Error: I can't find a Bourne Shell anywhere. |
| 1538 | |
| 1539 | Usually it's in /bin/sh. How did you even get this far? |
| 1540 | Please contact me (Perl Maintainers) at https://github.com/Perl/perl5/issues |
| 1541 | and we'll try to straighten this all out. |
| 1542 | EOM |
| 1543 | exit 1 |
| 1544 | ;; |
| 1545 | esac |
| 1546 | |
| 1547 | : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl |
| 1548 | : default both to the same thing, cross-compilers can then set targetsh differently if they like |
| 1549 | targetsh=$sh |
| 1550 | |
| 1551 | : see if sh knows # comments |
| 1552 | if `$sh -c '#' >/dev/null 2>&1`; then |
| 1553 | shsharp=true |
| 1554 | spitshell=cat |
| 1555 | xcat=/bin/cat |
| 1556 | test -f $xcat$_exe || xcat=/usr/bin/cat |
| 1557 | if test ! -f $xcat$_exe; then |
| 1558 | for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do |
| 1559 | if test -f $p/cat$_exe; then |
| 1560 | xcat=$p/cat |
| 1561 | break |
| 1562 | fi |
| 1563 | done |
| 1564 | if test ! -f $xcat$_exe; then |
| 1565 | echo "Can't find cat anywhere!" |
| 1566 | exit 1 |
| 1567 | fi |
| 1568 | fi |
| 1569 | echo "#!$xcat" >sharp |
| 1570 | $eunicefix sharp |
| 1571 | chmod +x sharp |
| 1572 | ./sharp > today 2>/dev/null |
| 1573 | if test -s today; then |
| 1574 | sharpbang='#!' |
| 1575 | else |
| 1576 | echo "#! $xcat" > sharp |
| 1577 | $eunicefix sharp |
| 1578 | chmod +x sharp |
| 1579 | ./sharp > today 2>/dev/null |
| 1580 | if test -s today; then |
| 1581 | sharpbang='#! ' |
| 1582 | else |
| 1583 | sharpbang=': use ' |
| 1584 | fi |
| 1585 | fi |
| 1586 | else |
| 1587 | echo " " |
| 1588 | echo "Your $sh doesn't grok # comments--I will strip them later on." |
| 1589 | shsharp=false |
| 1590 | cd .. |
| 1591 | echo "exec grep -v '^[ ]*#'" >spitshell |
| 1592 | chmod +x spitshell |
| 1593 | $eunicefix spitshell |
| 1594 | spitshell=`pwd`/spitshell |
| 1595 | cd UU |
| 1596 | echo "I presume that if # doesn't work, #! won't work either!" |
| 1597 | sharpbang=': use ' |
| 1598 | fi |
| 1599 | rm -f sharp today |
| 1600 | |
| 1601 | : figure out how to guarantee sh startup |
| 1602 | case "$startsh" in |
| 1603 | '') startsh=${sharpbang}${sh} ;; |
| 1604 | *) |
| 1605 | esac |
| 1606 | cat >sharp <<EOSS |
| 1607 | $startsh |
| 1608 | set abc |
| 1609 | test "$?abc" != 1 |
| 1610 | EOSS |
| 1611 | |
| 1612 | chmod +x sharp |
| 1613 | $eunicefix sharp |
| 1614 | if ./sharp; then |
| 1615 | : echo "Yup, it does." |
| 1616 | else |
| 1617 | echo "Hmm... '$startsh' does not guarantee sh startup..." |
| 1618 | echo "You may have to fix up the shell scripts to make sure $sh runs them." |
| 1619 | fi |
| 1620 | rm -f sharp |
| 1621 | |
| 1622 | : Save command line options in file UU/cmdline.opt for later use in |
| 1623 | : generating config.sh. |
| 1624 | cat > cmdline.opt <<EOSH |
| 1625 | : Configure command line arguments. |
| 1626 | config_arg0='$0' |
| 1627 | config_args='$*' |
| 1628 | config_argc=$# |
| 1629 | EOSH |
| 1630 | argn=1 |
| 1631 | args_exp='' |
| 1632 | args_sep='' |
| 1633 | for arg in "$@"; do |
| 1634 | cat >>cmdline.opt <<EOSH |
| 1635 | config_arg$argn='$arg' |
| 1636 | EOSH |
| 1637 | cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt |
| 1638 | $arg |
| 1639 | EOC |
| 1640 | arg_exp=`cat cmdl.opt` |
| 1641 | args_exp="$args_exp$args_sep'$arg_exp'" |
| 1642 | argn=`expr $argn + 1` |
| 1643 | args_sep=' ' |
| 1644 | done |
| 1645 | rm -f cmdl.opt |
| 1646 | |
| 1647 | : produce awk script to parse command line options |
| 1648 | cat >options.awk <<'EOF' |
| 1649 | BEGIN { |
| 1650 | optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification |
| 1651 | |
| 1652 | len = length(optstr); |
| 1653 | for (i = 1; i <= len; i++) { |
| 1654 | c = substr(optstr, i, 1); |
| 1655 | if (i < len) a = substr(optstr, i + 1, 1); else a = ""; |
| 1656 | if (a == ":") { |
| 1657 | arg[c] = 1; |
| 1658 | i++; |
| 1659 | } |
| 1660 | opt[c] = 1; |
| 1661 | } |
| 1662 | } |
| 1663 | { |
| 1664 | expect = 0; |
| 1665 | str = $0; |
| 1666 | if (substr(str, 1, 1) != "-") { |
| 1667 | printf("'%s'\n", str); |
| 1668 | next; |
| 1669 | } |
| 1670 | len = length($0); |
| 1671 | for (i = 2; i <= len; i++) { |
| 1672 | c = substr(str, i, 1); |
| 1673 | if (!opt[c]) { |
| 1674 | printf("-%s\n", substr(str, i)); |
| 1675 | next; |
| 1676 | } |
| 1677 | printf("-%s\n", c); |
| 1678 | if (arg[c]) { |
| 1679 | if (i < len) |
| 1680 | printf("'%s'\n", substr(str, i + 1)); |
| 1681 | else |
| 1682 | expect = 1; |
| 1683 | next; |
| 1684 | } |
| 1685 | } |
| 1686 | } |
| 1687 | END { |
| 1688 | if (expect) |
| 1689 | print "?"; |
| 1690 | } |
| 1691 | EOF |
| 1692 | |
| 1693 | : process the command line options |
| 1694 | set X `for arg in "$@"; do echo "X$arg"; done | |
| 1695 | sed -e s/X// | awk -f options.awk` |
| 1696 | eval "set $*" |
| 1697 | shift |
| 1698 | rm -f options.awk |
| 1699 | |
| 1700 | : set up default values |
| 1701 | fastread='' |
| 1702 | reuseval=false |
| 1703 | config_sh='' |
| 1704 | alldone='' |
| 1705 | error='' |
| 1706 | silent='' |
| 1707 | extractsh='' |
| 1708 | knowitall='' |
| 1709 | rm -f optdef.sh posthint.sh |
| 1710 | cat >optdef.sh <<EOS |
| 1711 | $startsh |
| 1712 | EOS |
| 1713 | |
| 1714 | |
| 1715 | : option parsing |
| 1716 | while test $# -gt 0; do |
| 1717 | case "$1" in |
| 1718 | -d) shift; fastread=yes;; |
| 1719 | -e) shift; alldone=cont;; |
| 1720 | -f) |
| 1721 | shift |
| 1722 | cd .. |
| 1723 | if test -r "$1"; then |
| 1724 | config_sh="$1" |
| 1725 | else |
| 1726 | echo "$me: cannot read config file $1." >&2 |
| 1727 | error=true |
| 1728 | fi |
| 1729 | cd UU |
| 1730 | shift;; |
| 1731 | --help|\ |
| 1732 | -h) shift; error=true;; |
| 1733 | -r) shift; reuseval=true;; |
| 1734 | -s) shift; silent=true; realsilent=true;; |
| 1735 | -E) shift; alldone=exit;; |
| 1736 | -K) shift; knowitall=true;; |
| 1737 | -O) shift;; |
| 1738 | -S) shift; silent=true; extractsh=true;; |
| 1739 | -D) |
| 1740 | shift |
| 1741 | case "$1" in |
| 1742 | *=) |
| 1743 | echo "$me: use '-U symbol=', not '-D symbol='." >&2 |
| 1744 | echo "$me: ignoring -D $1" >&2 |
| 1745 | ;; |
| 1746 | *=*) echo "$1" | \ |
| 1747 | sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;; |
| 1748 | *) echo "$1='define'" >> optdef.sh;; |
| 1749 | esac |
| 1750 | shift |
| 1751 | ;; |
| 1752 | -U) |
| 1753 | shift |
| 1754 | case "$1" in |
| 1755 | *=) echo "$1" >> optdef.sh;; |
| 1756 | *=*) |
| 1757 | echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2 |
| 1758 | echo "$me: ignoring -U $1" >&2 |
| 1759 | ;; |
| 1760 | *) echo "$1='undef'" >> optdef.sh;; |
| 1761 | esac |
| 1762 | shift |
| 1763 | ;; |
| 1764 | -A) |
| 1765 | shift |
| 1766 | xxx='' |
| 1767 | yyy="$1" |
| 1768 | zzz='' |
| 1769 | uuu=undef |
| 1770 | case "$yyy" in |
| 1771 | *=*) zzz=`echo "$yyy"|sed 's!=.*!!'` |
| 1772 | case "$zzz" in |
| 1773 | *:*) zzz='' ;; |
| 1774 | *) xxx=append |
| 1775 | zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'` |
| 1776 | yyy=`echo "$yyy"|sed 's!=.*!!'` ;; |
| 1777 | esac |
| 1778 | ;; |
| 1779 | esac |
| 1780 | case "$xxx" in |
| 1781 | '') case "$yyy" in |
| 1782 | *:*) xxx=`echo "$yyy"|sed 's!:.*!!'` |
| 1783 | yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` |
| 1784 | zzz=`echo "$yyy"|sed 's!^[^=]*=!!'` |
| 1785 | yyy=`echo "$yyy"|sed 's!=.*!!'` ;; |
| 1786 | *) xxx=`echo "$yyy"|sed 's!:.*!!'` |
| 1787 | yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;; |
| 1788 | esac |
| 1789 | ;; |
| 1790 | esac |
| 1791 | case "$xxx" in |
| 1792 | append) |
| 1793 | echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;; |
| 1794 | clear) |
| 1795 | echo "$yyy=''" >> posthint.sh ;; |
| 1796 | define) |
| 1797 | case "$zzz" in |
| 1798 | '') zzz=define ;; |
| 1799 | esac |
| 1800 | echo "$yyy='$zzz'" >> posthint.sh ;; |
| 1801 | eval) |
| 1802 | echo "eval \"$yyy=$zzz\"" >> posthint.sh ;; |
| 1803 | prepend) |
| 1804 | echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;; |
| 1805 | undef) |
| 1806 | case "$zzz" in |
| 1807 | '') zzz="$uuu" ;; |
| 1808 | esac |
| 1809 | echo "$yyy=$zzz" >> posthint.sh ;; |
| 1810 | *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;; |
| 1811 | esac |
| 1812 | shift |
| 1813 | ;; |
| 1814 | -V) echo "$me generated by metaconfig 3.5 PL0." >&2 |
| 1815 | exit 0;; |
| 1816 | --) break;; |
| 1817 | -*) echo "$me: unknown option $1" >&2; shift; error=true;; |
| 1818 | *) break;; |
| 1819 | esac |
| 1820 | done |
| 1821 | |
| 1822 | case "$error" in |
| 1823 | true) |
| 1824 | cat >&2 <<EOM |
| 1825 | Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value] |
| 1826 | [-U symbol] [-U symbol=] [-A command:symbol...] |
| 1827 | -d : use defaults for all answers. |
| 1828 | -e : go on without questioning past the production of config.sh. |
| 1829 | -f : specify an alternate default configuration file. |
| 1830 | -h : print this help message and exit (with an error status). |
| 1831 | -r : reuse C symbols value if possible (skips costly nm extraction). |
| 1832 | -s : silent mode, only echoes questions and essential information. |
| 1833 | -D : define symbol to have some value: |
| 1834 | -D symbol symbol gets the value 'define' |
| 1835 | -D symbol=value symbol gets the value 'value' |
| 1836 | common used examples (see INSTALL for more info): |
| 1837 | -Duse64bitint use 64bit integers |
| 1838 | -Duse64bitall use 64bit integers and pointers |
| 1839 | -Dusethreads use thread support |
| 1840 | -Dinc_version_list=none do not include older perl trees in @INC |
| 1841 | -DEBUGGING=none DEBUGGING options |
| 1842 | -Dcc=gcc choose your compiler |
| 1843 | -Dprefix=/opt/perl5 choose your destination |
| 1844 | -E : stop at the end of questions, after having produced config.sh. |
| 1845 | -K : do not use unless you know what you are doing. |
| 1846 | -O : ignored for backward compatibility |
| 1847 | -S : perform variable substitutions on all .SH files (can mix with -f) |
| 1848 | -U : undefine symbol: |
| 1849 | -U symbol symbol gets the value 'undef' |
| 1850 | -U symbol= symbol gets completely empty |
| 1851 | e.g.: -Uversiononly |
| 1852 | -A : manipulate symbol after the platform specific hints have been applied: |
| 1853 | -A append:symbol=value append value to symbol |
| 1854 | -A symbol=value like append:, but with a separating space |
| 1855 | -A define:symbol=value define symbol to have value |
| 1856 | -A clear:symbol define symbol to be '' |
| 1857 | -A define:symbol define symbol to be 'define' |
| 1858 | -A eval:symbol=value define symbol to be eval of value |
| 1859 | -A prepend:symbol=value prepend value to symbol |
| 1860 | -A undef:symbol define symbol to be 'undef' |
| 1861 | -A undef:symbol= define symbol to be '' |
| 1862 | e.g.: -A prepend:libswanted='cl pthread ' |
| 1863 | -A ccflags=-DSOME_MACRO |
| 1864 | -V : print version number and exit (with a zero status). |
| 1865 | EOM |
| 1866 | exit 1 |
| 1867 | ;; |
| 1868 | esac |
| 1869 | |
| 1870 | : Sanity checks |
| 1871 | case "$fastread$alldone" in |
| 1872 | yescont|yesexit) ;; |
| 1873 | *) |
| 1874 | case "$extractsh" in |
| 1875 | true) ;; |
| 1876 | *) |
| 1877 | if test ! -t 0; then |
| 1878 | echo "Say 'sh Configure', not 'sh <Configure'" |
| 1879 | exit 1 |
| 1880 | fi |
| 1881 | ;; |
| 1882 | esac |
| 1883 | ;; |
| 1884 | esac |
| 1885 | |
| 1886 | exec 4>&1 |
| 1887 | case "$silent" in |
| 1888 | true) exec 1>/dev/null;; |
| 1889 | esac |
| 1890 | |
| 1891 | : run the defines and the undefines, if any, but leave the file out there... |
| 1892 | touch optdef.sh |
| 1893 | grep '\\' optdef.sh >/dev/null 2>&1 |
| 1894 | if test $? = 0; then |
| 1895 | echo "Configure does not support \\ in -D arguments" |
| 1896 | exit 1 |
| 1897 | fi |
| 1898 | . ./optdef.sh |
| 1899 | : create the posthint manipulation script and leave the file out there... |
| 1900 | touch posthint.sh |
| 1901 | |
| 1902 | : set package name |
| 1903 | package='perl5' |
| 1904 | first=`echo $package | sed -e 's/^\(.\).*/\1/'` |
| 1905 | last=`echo $package | sed -e 's/^.\(.*\)/\1/'` |
| 1906 | case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in |
| 1907 | ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; |
| 1908 | *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;; |
| 1909 | esac |
| 1910 | |
| 1911 | : Some greps do not return status, grrr. |
| 1912 | echo "grimblepritz" >grimble |
| 1913 | if grep blurfldyick grimble >/dev/null 2>&1 ; then |
| 1914 | contains=contains |
| 1915 | elif grep grimblepritz grimble >/dev/null 2>&1 ; then |
| 1916 | contains=grep |
| 1917 | else |
| 1918 | contains=contains |
| 1919 | fi |
| 1920 | rm -f grimble |
| 1921 | : the following should work in any shell |
| 1922 | case "$contains" in |
| 1923 | contains*) |
| 1924 | echo " " |
| 1925 | echo "AGH! Grep doesn't return a status. Attempting remedial action." |
| 1926 | cat >contains <<'EOSS' |
| 1927 | grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp |
| 1928 | EOSS |
| 1929 | chmod +x contains |
| 1930 | esac |
| 1931 | |
| 1932 | : Find the path to the source tree |
| 1933 | case "$src" in |
| 1934 | '') case "$0" in |
| 1935 | */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'` |
| 1936 | case "$src" in |
| 1937 | /*) ;; |
| 1938 | .) ;; |
| 1939 | *) src=`cd ../$src && pwd` ;; |
| 1940 | esac |
| 1941 | ;; |
| 1942 | *) src='.';; |
| 1943 | esac;; |
| 1944 | esac |
| 1945 | case "$src" in |
| 1946 | '') src=/ |
| 1947 | rsrc=/ |
| 1948 | ;; |
| 1949 | /*) rsrc="$src";; |
| 1950 | *) rsrc="../$src";; |
| 1951 | esac |
| 1952 | if test -f $rsrc/Configure && \ |
| 1953 | $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1 |
| 1954 | then |
| 1955 | : found it, so we are ok. |
| 1956 | else |
| 1957 | rsrc='' |
| 1958 | for src in . .. ../.. ../../.. ../../../..; do |
| 1959 | if test -f ../$src/Configure && \ |
| 1960 | $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1 |
| 1961 | then |
| 1962 | rsrc=../$src |
| 1963 | break |
| 1964 | fi |
| 1965 | done |
| 1966 | fi |
| 1967 | case "$rsrc" in |
| 1968 | '') |
| 1969 | cat <<EOM >&4 |
| 1970 | |
| 1971 | Sorry, I can't seem to locate the source dir for $package. Please start |
| 1972 | Configure with an explicit path -- i.e. /some/path/Configure. |
| 1973 | |
| 1974 | EOM |
| 1975 | exit 1 |
| 1976 | ;; |
| 1977 | ../.) rsrc='..';; |
| 1978 | *) |
| 1979 | echo " " |
| 1980 | echo "Sources for $package found in \"$src\"." >&4 |
| 1981 | ;; |
| 1982 | esac |
| 1983 | |
| 1984 | : script used to extract .SH files with variable substitutions |
| 1985 | cat >extract <<'EOS' |
| 1986 | PERL_CONFIG_SH=true |
| 1987 | echo "Doing variable substitutions on .SH files..." |
| 1988 | if test -f MANIFEST; then |
| 1989 | set x `awk '{print $1}' < MANIFEST | grep '\.SH$'` |
| 1990 | else |
| 1991 | echo "(Looking for .SH files under the source directory.)" |
| 1992 | set x `(cd "$src"; find . -name "*.SH" -print)` |
| 1993 | fi |
| 1994 | shift |
| 1995 | case $# in |
| 1996 | 0) set x `(cd "$src"; echo *.SH)`; shift;; |
| 1997 | esac |
| 1998 | if test ! -f "$src/$1"; then |
| 1999 | shift |
| 2000 | fi |
| 2001 | mkdir_p=' |
| 2002 | name=$1; |
| 2003 | create=""; |
| 2004 | while test $name; do |
| 2005 | if test ! -d "$name"; then |
| 2006 | create="$name $create"; |
| 2007 | name=`echo $name | sed -e "s|^[^/]*$||"`; |
| 2008 | name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`; |
| 2009 | else |
| 2010 | name=""; |
| 2011 | fi; |
| 2012 | done; |
| 2013 | for file in $create; do |
| 2014 | mkdir $file; |
| 2015 | done |
| 2016 | ' |
| 2017 | for file in $*; do |
| 2018 | case "$src" in |
| 2019 | ".") |
| 2020 | case "$file" in |
| 2021 | */*) |
| 2022 | dir=`expr X$file : 'X\(.*\)/'` |
| 2023 | file=`expr X$file : 'X.*/\(.*\)'` |
| 2024 | (cd "$dir" && . ./$file) |
| 2025 | ;; |
| 2026 | *) |
| 2027 | . ./$file |
| 2028 | ;; |
| 2029 | esac |
| 2030 | ;; |
| 2031 | *) |
| 2032 | case "$file" in |
| 2033 | */*) |
| 2034 | dir=`expr X$file : 'X\(.*\)/'` |
| 2035 | file=`expr X$file : 'X.*/\(.*\)'` |
| 2036 | (set x $dir; shift; eval $mkdir_p) |
| 2037 | sh <"$src/$dir/$file" |
| 2038 | ;; |
| 2039 | *) |
| 2040 | sh <"$src/$file" |
| 2041 | ;; |
| 2042 | esac |
| 2043 | ;; |
| 2044 | esac |
| 2045 | done |
| 2046 | if test -f "$src/config_h.SH"; then |
| 2047 | if test ! -f config.h; then |
| 2048 | : oops, they left it out of MANIFEST, probably, so do it anyway. |
| 2049 | . "$src/config_h.SH" |
| 2050 | fi |
| 2051 | fi |
| 2052 | EOS |
| 2053 | |
| 2054 | : extract files and exit if asked to do so |
| 2055 | case "$extractsh" in |
| 2056 | true) |
| 2057 | case "$realsilent" in |
| 2058 | true) ;; |
| 2059 | *) exec 1>&4;; |
| 2060 | esac |
| 2061 | case "$config_sh" in |
| 2062 | '') config_sh='config.sh';; |
| 2063 | esac |
| 2064 | echo " " |
| 2065 | echo "Fetching answers from $config_sh..." |
| 2066 | cd .. |
| 2067 | . $config_sh |
| 2068 | . UU/optdef.sh |
| 2069 | echo " " |
| 2070 | . UU/extract |
| 2071 | rm -rf UU |
| 2072 | echo "Extraction done." |
| 2073 | exit 0 |
| 2074 | ;; |
| 2075 | esac |
| 2076 | |
| 2077 | : Eunice requires " " instead of "", can you believe it |
| 2078 | echo " " |
| 2079 | : Here we go... |
| 2080 | echo "Beginning of configuration questions for $package." |
| 2081 | |
| 2082 | trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 |
| 2083 | |
| 2084 | : first determine how to suppress newline on echo command |
| 2085 | echo " " |
| 2086 | echo "Checking echo to see how to suppress newlines..." |
| 2087 | (echo "hi there\c" ; echo " ") >.echotmp |
| 2088 | if $contains c .echotmp >/dev/null 2>&1 ; then |
| 2089 | echo "...using -n." |
| 2090 | n='-n' |
| 2091 | c='' |
| 2092 | else |
| 2093 | cat <<'EOM' |
| 2094 | ...using \c |
| 2095 | EOM |
| 2096 | n='' |
| 2097 | c='\c' |
| 2098 | fi |
| 2099 | echo $n "The star should be here-->$c" |
| 2100 | echo '*' |
| 2101 | rm -f .echotmp |
| 2102 | |
| 2103 | : Now test for existence of everything in MANIFEST |
| 2104 | echo " " |
| 2105 | if test -f "$rsrc/MANIFEST"; then |
| 2106 | echo "First let's make sure your kit is complete. Checking..." >&4 |
| 2107 | awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \ |
| 2108 | (split -l 50 2>/dev/null || split -50) |
| 2109 | rm -f missing |
| 2110 | tmppwd=`pwd` |
| 2111 | for filelist in x??; do |
| 2112 | (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \ |
| 2113 | >/dev/null 2>>"$tmppwd/missing") |
| 2114 | done |
| 2115 | if test -s missing; then |
| 2116 | cat missing >&4 |
| 2117 | cat >&4 <<'EOM' |
| 2118 | |
| 2119 | THIS PACKAGE SEEMS TO BE INCOMPLETE. |
| 2120 | |
| 2121 | You have the option of continuing the configuration process, despite the |
| 2122 | distinct possibility that your kit is damaged, by typing 'y'es. If you |
| 2123 | do, don't blame me if something goes wrong. I advise you to type 'n'o |
| 2124 | and contact the author (https://github.com/Perl/perl5/issues). |
| 2125 | |
| 2126 | EOM |
| 2127 | echo $n "Continue? [n] $c" >&4 |
| 2128 | read ans |
| 2129 | case "$ans" in |
| 2130 | y*) |
| 2131 | echo "Continuing..." >&4 |
| 2132 | rm -f missing |
| 2133 | ;; |
| 2134 | *) |
| 2135 | echo "ABORTING..." >&4 |
| 2136 | kill $$ |
| 2137 | ;; |
| 2138 | esac |
| 2139 | else |
| 2140 | echo "Looks good..." |
| 2141 | fi |
| 2142 | else |
| 2143 | echo "There is no MANIFEST file. I hope your kit is complete !" |
| 2144 | fi |
| 2145 | rm -f missing x?? |
| 2146 | |
| 2147 | : Find the appropriate value for a newline for tr |
| 2148 | if test -n "$DJGPP"; then |
| 2149 | trnl='\012' |
| 2150 | fi |
| 2151 | if test X"$trnl" = X; then |
| 2152 | case "`echo foo | tr '\n' x 2>/dev/null`" in |
| 2153 | foox) trnl='\n' ;; |
| 2154 | esac |
| 2155 | fi |
| 2156 | if test X"$trnl" = X; then |
| 2157 | case "`echo foo | tr '\012' x 2>/dev/null`" in |
| 2158 | foox) trnl='\012' ;; |
| 2159 | esac |
| 2160 | fi |
| 2161 | if test X"$trnl" = X; then |
| 2162 | case "`echo foo | tr '\r\n' xy 2>/dev/null`" in |
| 2163 | fooxy) trnl='\n\r' ;; |
| 2164 | esac |
| 2165 | fi |
| 2166 | if test X"$trnl" = X; then |
| 2167 | cat <<EOM >&2 |
| 2168 | |
| 2169 | $me: Fatal Error: cannot figure out how to translate newlines with 'tr'. |
| 2170 | |
| 2171 | EOM |
| 2172 | exit 1 |
| 2173 | fi |
| 2174 | |
| 2175 | : compute the number of columns on the terminal for proper question formatting |
| 2176 | case "$COLUMNS" in |
| 2177 | '') COLUMNS='80';; |
| 2178 | esac |
| 2179 | |
| 2180 | : set up the echo used in my read |
| 2181 | myecho="case \"\$xxxm\" in |
| 2182 | '') echo $n \"\$rp $c\" >&4;; |
| 2183 | *) case \"\$rp\" in |
| 2184 | '') echo $n \"[\$xxxm] $c\";; |
| 2185 | *) |
| 2186 | if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then |
| 2187 | echo \"\$rp\" >&4 |
| 2188 | echo $n \"[\$xxxm] $c\" >&4 |
| 2189 | else |
| 2190 | echo $n \"\$rp [\$xxxm] $c\" >&4 |
| 2191 | fi |
| 2192 | ;; |
| 2193 | esac;; |
| 2194 | esac" |
| 2195 | |
| 2196 | : now set up to do reads with possible shell escape and default assignment |
| 2197 | cat <<EOSC >myread |
| 2198 | $startsh |
| 2199 | xxxm=\$dflt |
| 2200 | $myecho |
| 2201 | ans='!' |
| 2202 | case "\$fastread" in |
| 2203 | yes) case "\$dflt" in |
| 2204 | '') ;; |
| 2205 | *) ans=''; |
| 2206 | case "\$silent-\$rp" in |
| 2207 | true-) ;; |
| 2208 | *) echo " " >&4;; |
| 2209 | esac;; |
| 2210 | esac;; |
| 2211 | *) case "\$silent" in |
| 2212 | true) case "\$rp" in |
| 2213 | '') ans='';; |
| 2214 | esac;; |
| 2215 | esac;; |
| 2216 | esac |
| 2217 | while expr "X\$ans" : "X!" >/dev/null; do |
| 2218 | read answ |
| 2219 | set x \$xxxm |
| 2220 | shift |
| 2221 | aok=''; eval "ans=\\"\$answ\\"" && aok=y |
| 2222 | case "\$answ" in |
| 2223 | "!") |
| 2224 | sh 1>&4 |
| 2225 | echo " " |
| 2226 | $myecho |
| 2227 | ;; |
| 2228 | !*) |
| 2229 | set x \`expr "X\$ans" : "X!\(.*\)\$"\` |
| 2230 | shift |
| 2231 | sh 1>&4 -c "\$*" |
| 2232 | echo " " |
| 2233 | $myecho |
| 2234 | ;; |
| 2235 | "\$ans") |
| 2236 | case "\$ans" in |
| 2237 | \\&*) |
| 2238 | set x \`expr "X\$ans" : "X&\(.*\)\$"\` |
| 2239 | shift |
| 2240 | case "\$1" in |
| 2241 | -d) |
| 2242 | fastread=yes |
| 2243 | echo "(OK, I'll run with -d after this question.)" >&4 |
| 2244 | ;; |
| 2245 | -*) |
| 2246 | echo "*** Sorry, \$1 not supported yet." >&4 |
| 2247 | ;; |
| 2248 | esac |
| 2249 | $myecho |
| 2250 | ans=! |
| 2251 | ;; |
| 2252 | esac;; |
| 2253 | *) |
| 2254 | case "\$aok" in |
| 2255 | y) |
| 2256 | echo "*** Substitution done -- please confirm." |
| 2257 | xxxm="\$ans" |
| 2258 | ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\` |
| 2259 | xxxm="\$ans" |
| 2260 | ans=! |
| 2261 | ;; |
| 2262 | *) |
| 2263 | echo "*** Error -- try again." |
| 2264 | ans=! |
| 2265 | ;; |
| 2266 | esac |
| 2267 | $myecho |
| 2268 | ;; |
| 2269 | esac |
| 2270 | case "\$ans\$xxxm\$nostick" in |
| 2271 | '') |
| 2272 | ans=! |
| 2273 | $myecho |
| 2274 | ;; |
| 2275 | esac |
| 2276 | done |
| 2277 | case "\$ans" in |
| 2278 | '') ans="\$xxxm";; |
| 2279 | esac |
| 2280 | EOSC |
| 2281 | |
| 2282 | : create .config dir to save info across Configure sessions |
| 2283 | test -d ../.config || mkdir ../.config |
| 2284 | cat >../.config/README <<EOF |
| 2285 | This directory created by Configure to save information that should |
| 2286 | persist across sessions for $package. |
| 2287 | |
| 2288 | You may safely delete it if you wish. |
| 2289 | EOF |
| 2290 | |
| 2291 | : See if we are using a devel version and want that |
| 2292 | xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` |
| 2293 | case "$usedevel" in |
| 2294 | $define|true|[yY]*) |
| 2295 | usedevel="$define" ;; |
| 2296 | *) case "$xversion" in |
| 2297 | *[13579]) |
| 2298 | cat >&4 <<EOH |
| 2299 | *** WHOA THERE!!! *** |
| 2300 | |
| 2301 | This is an UNSTABLE DEVELOPMENT release. |
| 2302 | The version of this $package distribution is $xversion, that is, odd, |
| 2303 | (as opposed to even) and that signifies a development release. |
| 2304 | If you want a maintenance release, you want an even-numbered version. |
| 2305 | |
| 2306 | Do ***NOT*** install this into production use. |
| 2307 | Data corruption and crashes are possible. |
| 2308 | |
| 2309 | It is most seriously suggested that you do not continue any further |
| 2310 | unless you want to help in developing and debugging Perl. |
| 2311 | |
| 2312 | If you *still* want to build perl, you can answer 'y' now, |
| 2313 | or pass -Dusedevel to Configure. |
| 2314 | |
| 2315 | EOH |
| 2316 | rp='Do you really want to continue?' |
| 2317 | dflt='n' |
| 2318 | . ./myread |
| 2319 | case "$ans" in |
| 2320 | [yY]) echo >&4 "Okay, continuing." |
| 2321 | usedevel="$define" ;; |
| 2322 | *) echo >&4 "Okay, bye." |
| 2323 | exit 1 |
| 2324 | ;; |
| 2325 | esac |
| 2326 | ;; |
| 2327 | esac |
| 2328 | usedevel="$undef" |
| 2329 | ;; |
| 2330 | esac |
| 2331 | case "$usedevel" in |
| 2332 | $define|true|[yY]*) |
| 2333 | case "$versiononly" in |
| 2334 | '') versiononly="$define" ;; |
| 2335 | esac |
| 2336 | case "$installusrbinperl" in |
| 2337 | '') installusrbinperl="$undef" ;; |
| 2338 | esac |
| 2339 | ;; |
| 2340 | esac |
| 2341 | |
| 2342 | : general instructions |
| 2343 | needman=true |
| 2344 | firsttime=true |
| 2345 | user=`(logname) 2>/dev/null` |
| 2346 | case "$user" in |
| 2347 | '') user=`whoami 2>&1`;; |
| 2348 | esac |
| 2349 | if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then |
| 2350 | firsttime=false |
| 2351 | echo " " |
| 2352 | rp='Would you like to see the instructions?' |
| 2353 | dflt=n |
| 2354 | . ./myread |
| 2355 | case "$ans" in |
| 2356 | [yY]*) ;; |
| 2357 | *) needman=false;; |
| 2358 | esac |
| 2359 | fi |
| 2360 | if $needman; then |
| 2361 | cat <<EOH |
| 2362 | |
| 2363 | This installation shell script will examine your system and ask you questions |
| 2364 | to determine how the perl5 package should be installed. If you get |
| 2365 | stuck on a question, you may use a ! shell escape to start a subshell or |
| 2366 | execute a command. Many of the questions will have default answers in square |
| 2367 | brackets; typing carriage return will give you the default. |
| 2368 | |
| 2369 | On some of the questions which ask for file or directory names you are allowed |
| 2370 | to use the ~name construct to specify the login directory belonging to "name", |
| 2371 | even if you don't have a shell which knows about that. Questions where this is |
| 2372 | allowed will be marked "(~name ok)". |
| 2373 | |
| 2374 | EOH |
| 2375 | rp='' |
| 2376 | dflt='Type carriage return to continue' |
| 2377 | . ./myread |
| 2378 | cat <<'EOH' |
| 2379 | |
| 2380 | The prompter used in this script allows you to use shell variables and |
| 2381 | backticks in your answers. You may use $1, $2, etc... to refer to the words |
| 2382 | in the default answer, as if the default line was a set of arguments given to a |
| 2383 | script shell. This means you may also use $* to repeat the whole default line, |
| 2384 | so you do not have to re-type everything to add something to the default. |
| 2385 | |
| 2386 | Every time there is a substitution, you will have to confirm. If there is an |
| 2387 | error (e.g. an unmatched backtick), the default answer will remain unchanged |
| 2388 | and you will be prompted again. |
| 2389 | |
| 2390 | If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all |
| 2391 | the questions and use the computed defaults (or the previous answers if there |
| 2392 | was already a config.sh file). Type 'Configure -h' for a list of options. |
| 2393 | You may also start interactively and then answer '& -d' at any prompt to turn |
| 2394 | on the non-interactive behaviour for the remainder of the execution. |
| 2395 | |
| 2396 | EOH |
| 2397 | . ./myread |
| 2398 | cat <<EOH |
| 2399 | |
| 2400 | Much effort has been expended to ensure that this shell script will run on any |
| 2401 | Unix system. If despite that it blows up on yours, your best bet is to edit |
| 2402 | Configure and run it again. If you can't run Configure for some reason, |
| 2403 | you'll have to generate a config.sh file by hand. Whatever problems you |
| 2404 | have, let me (https://github.com/Perl/perl5/issues) know how I blew it. |
| 2405 | |
| 2406 | This installation script affects things in two ways: |
| 2407 | |
| 2408 | 1) it may do direct variable substitutions on some of the files included |
| 2409 | in this kit. |
| 2410 | 2) it builds a config.h file for inclusion in C programs. You may edit |
| 2411 | any of these files as the need arises after running this script. |
| 2412 | |
| 2413 | If you make a mistake on a question, there is no easy way to back up to it |
| 2414 | currently. The easiest thing to do is to edit config.sh and rerun all the SH |
| 2415 | files. Configure will offer to let you do this before it runs the SH files. |
| 2416 | |
| 2417 | EOH |
| 2418 | dflt='Type carriage return to continue' |
| 2419 | . ./myread |
| 2420 | case "$firsttime" in |
| 2421 | true) echo $user >>../.config/instruct;; |
| 2422 | esac |
| 2423 | fi |
| 2424 | |
| 2425 | : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc |
| 2426 | : This is primarily meant for cross-compile environments, and may fail to be useful in other cases |
| 2427 | if test "X$sysroot" = X; then |
| 2428 | sysroot="" |
| 2429 | else |
| 2430 | case "$cc" in |
| 2431 | *gcc*|*g++*) |
| 2432 | echo "Using $sysroot to find your headers and libraries, adding to ccflags" |
| 2433 | # _sysroot is used in places where we need --sysroot=foo |
| 2434 | # but using the rest of the flags could cause issues. |
| 2435 | _sysroot="--sysroot=$sysroot"; |
| 2436 | case "$ccflags" in |
| 2437 | *sysroot*) ;; |
| 2438 | 'undef'|*) |
| 2439 | ccflags="$ccflags $_sysroot" |
| 2440 | esac |
| 2441 | case "$ldflags" in |
| 2442 | *sysroot*) ;; |
| 2443 | 'undef'|*) |
| 2444 | ldflags="$ldflags $_sysroot" |
| 2445 | esac |
| 2446 | case "$cppflags" in |
| 2447 | *sysroot*) ;; |
| 2448 | 'undef'|*) |
| 2449 | cppflags="$cppflags $_sysroot" |
| 2450 | esac |
| 2451 | # lddlflags updated below in lddlflags section; |
| 2452 | # same with cccdlflags |
| 2453 | ;; |
| 2454 | esac |
| 2455 | |
| 2456 | # Adjust some defaults to also use $sysroot |
| 2457 | for var in xlibpth loclibpth locincpth glibpth; do |
| 2458 | eval xxx=\$$var |
| 2459 | eval $var='' |
| 2460 | for path in $xxx; do |
| 2461 | eval $var=\"\$$var $sysroot$path\" |
| 2462 | done |
| 2463 | done |
| 2464 | |
| 2465 | fi |
| 2466 | |
| 2467 | : find out where common programs are |
| 2468 | echo " " |
| 2469 | echo "Locating common programs..." >&4 |
| 2470 | cat <<EOSC >loc |
| 2471 | $startsh |
| 2472 | case \$# in |
| 2473 | 0) exit 1;; |
| 2474 | esac |
| 2475 | thing=\$1 |
| 2476 | shift |
| 2477 | dflt=\$1 |
| 2478 | shift |
| 2479 | for dir in \$*; do |
| 2480 | case "\$thing" in |
| 2481 | .) |
| 2482 | if test -d \$dir/\$thing; then |
| 2483 | echo \$dir |
| 2484 | exit 0 |
| 2485 | fi |
| 2486 | ;; |
| 2487 | *) |
| 2488 | for thisthing in \$dir/\$thing; do |
| 2489 | : just loop through to pick last item |
| 2490 | done |
| 2491 | if test -f \$thisthing; then |
| 2492 | echo \$thisthing |
| 2493 | exit 0 |
| 2494 | elif test "X$_exe" != X -a -f \$thisthing$_exe; then |
| 2495 | echo \$thisthing |
| 2496 | exit 0 |
| 2497 | elif test -f \$dir/\$thing.exe; then |
| 2498 | if test -n "$DJGPP"; then |
| 2499 | echo \$dir/\$thing.exe |
| 2500 | elif test "$eunicefix" != ":"; then |
| 2501 | : on Eunice apparently |
| 2502 | echo \$dir/\$thing |
| 2503 | fi |
| 2504 | exit 0 |
| 2505 | fi |
| 2506 | ;; |
| 2507 | esac |
| 2508 | done |
| 2509 | echo \$dflt |
| 2510 | exit 1 |
| 2511 | EOSC |
| 2512 | chmod +x loc |
| 2513 | $eunicefix loc |
| 2514 | loclist=" |
| 2515 | awk |
| 2516 | cat |
| 2517 | chmod |
| 2518 | comm |
| 2519 | cp |
| 2520 | echo |
| 2521 | expr |
| 2522 | grep |
| 2523 | ls |
| 2524 | mkdir |
| 2525 | rm |
| 2526 | sed |
| 2527 | sort |
| 2528 | touch |
| 2529 | tr |
| 2530 | uniq |
| 2531 | " |
| 2532 | trylist=" |
| 2533 | ar |
| 2534 | bison |
| 2535 | byacc |
| 2536 | cpp |
| 2537 | csh |
| 2538 | date |
| 2539 | egrep |
| 2540 | gmake |
| 2541 | gzip |
| 2542 | less |
| 2543 | ln |
| 2544 | make |
| 2545 | more |
| 2546 | nm |
| 2547 | nroff |
| 2548 | perl |
| 2549 | pg |
| 2550 | test |
| 2551 | uname |
| 2552 | zip |
| 2553 | " |
| 2554 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
| 2555 | pth="$pth $sysroot/lib $sysroot/usr/lib" |
| 2556 | for file in $loclist; do |
| 2557 | eval xxx=\$$file |
| 2558 | case "$xxx" in |
| 2559 | /*|?:[\\/]*) |
| 2560 | if test -f "$xxx"; then |
| 2561 | : ok |
| 2562 | else |
| 2563 | echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 |
| 2564 | xxx=`./loc $file $file $pth` |
| 2565 | fi |
| 2566 | ;; |
| 2567 | '') xxx=`./loc $file $file $pth`;; |
| 2568 | *) xxx=`./loc $xxx $xxx $pth`;; |
| 2569 | esac |
| 2570 | eval $file=$xxx$_exe |
| 2571 | eval _$file=$xxx |
| 2572 | case "$xxx" in |
| 2573 | /*) |
| 2574 | echo $file is in $xxx. |
| 2575 | ;; |
| 2576 | ?:[\\/]*) |
| 2577 | echo $file is in $xxx. |
| 2578 | ;; |
| 2579 | *) |
| 2580 | echo "I don't know where '$file' is, and my life depends on it." >&4 |
| 2581 | echo "Go find a public domain implementation or fix your PATH setting!" >&4 |
| 2582 | exit 1 |
| 2583 | ;; |
| 2584 | esac |
| 2585 | done |
| 2586 | echo " " |
| 2587 | echo "Don't worry if any of the following aren't found..." |
| 2588 | say=offhand |
| 2589 | for file in $trylist; do |
| 2590 | eval xxx=\$$file |
| 2591 | case "$xxx" in |
| 2592 | /*|?:[\\/]*) |
| 2593 | if test -f "$xxx"; then |
| 2594 | : ok |
| 2595 | else |
| 2596 | echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 |
| 2597 | xxx=`./loc $file $file $pth` |
| 2598 | fi |
| 2599 | ;; |
| 2600 | '') xxx=`./loc $file $file $pth`;; |
| 2601 | *) xxx=`./loc $xxx $xxx $pth`;; |
| 2602 | esac |
| 2603 | eval $file=$xxx$_exe |
| 2604 | eval _$file=$xxx |
| 2605 | case "$xxx" in |
| 2606 | /*) |
| 2607 | echo $file is in $xxx. |
| 2608 | ;; |
| 2609 | ?:[\\/]*) |
| 2610 | echo $file is in $xxx. |
| 2611 | ;; |
| 2612 | *) |
| 2613 | echo "I don't see $file out there, $say." |
| 2614 | say=either |
| 2615 | ;; |
| 2616 | esac |
| 2617 | done |
| 2618 | case "$egrep" in |
| 2619 | egrep) |
| 2620 | echo "Substituting grep for egrep." |
| 2621 | egrep=$grep |
| 2622 | _egrep=$grep |
| 2623 | ;; |
| 2624 | esac |
| 2625 | case "$less" in |
| 2626 | '') ;; |
| 2627 | *) if $less -R </dev/null >/dev/null 2>&1; then |
| 2628 | echo "Substituting less -R for less." |
| 2629 | less="$less -R" |
| 2630 | _less=$less |
| 2631 | fi |
| 2632 | ;; |
| 2633 | esac |
| 2634 | case "$ln" in |
| 2635 | ln) |
| 2636 | echo "Substituting cp for ln." |
| 2637 | ln=$cp |
| 2638 | _ln=$cp |
| 2639 | ;; |
| 2640 | esac |
| 2641 | case "$make" in |
| 2642 | make) |
| 2643 | case "$gmake" in |
| 2644 | gmake) |
| 2645 | echo "I can't find make or gmake, and my life depends on it." >&4 |
| 2646 | echo "Go find a public domain implementation or fix your PATH setting!" >&4 |
| 2647 | exit 1 |
| 2648 | ;; |
| 2649 | esac |
| 2650 | ;; |
| 2651 | esac |
| 2652 | case "$gmake" in |
| 2653 | gmake) ;; |
| 2654 | *) # We can't have osname yet. |
| 2655 | if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS |
| 2656 | # Assume that gmake, if found, is definitely GNU make |
| 2657 | # and prefer it over the system make. |
| 2658 | echo "Substituting gmake for make." |
| 2659 | make=$gmake |
| 2660 | _make=$gmake |
| 2661 | fi |
| 2662 | ;; |
| 2663 | esac |
| 2664 | case "$test" in |
| 2665 | test) |
| 2666 | echo "Hopefully test is built into your sh." |
| 2667 | ;; |
| 2668 | *) |
| 2669 | if `sh -c "PATH= test true" >/dev/null 2>&1`; then |
| 2670 | echo "Using the test built into your sh." |
| 2671 | test=test |
| 2672 | _test=test |
| 2673 | fi |
| 2674 | ;; |
| 2675 | esac |
| 2676 | case "$echo" in |
| 2677 | echo) |
| 2678 | echo "Hopefully echo is built into your sh." |
| 2679 | ;; |
| 2680 | '') ;; |
| 2681 | *) |
| 2682 | echo " " |
| 2683 | echo "Checking compatibility between $echo and builtin echo (if any)..." >&4 |
| 2684 | $echo $n "hi there$c" >foo1 |
| 2685 | echo $n "hi there$c" >foo2 |
| 2686 | if cmp foo1 foo2 >/dev/null 2>&1; then |
| 2687 | echo "They are compatible. In fact, they may be identical." |
| 2688 | else |
| 2689 | case "$n" in |
| 2690 | '-n') n='' c='\c';; |
| 2691 | *) n='-n' c='';; |
| 2692 | esac |
| 2693 | cat <<FOO |
| 2694 | They are not compatible! You are probably running ksh on a non-USG system. |
| 2695 | I'll have to use $echo instead of the builtin, since Bourne shell doesn't |
| 2696 | have echo built in and we may have to run some Bourne shell scripts. That |
| 2697 | means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous. |
| 2698 | |
| 2699 | FOO |
| 2700 | $echo $n "The star should be here-->$c" |
| 2701 | $echo "*" |
| 2702 | fi |
| 2703 | $rm -f foo1 foo2 |
| 2704 | ;; |
| 2705 | esac |
| 2706 | |
| 2707 | # This question was auctioned at YAPC::Europe-2007 in Vienna |
| 2708 | # I never promised you could answer it. I only auctioned the question. |
| 2709 | cat <<FOO |
| 2710 | The following message is sponsored by |
| 2711 | |
| 2712 | Dresden.pm<--The stars should be here. |
| 2713 | |
| 2714 | Dear Perl user, system administrator or package |
| 2715 | maintainer, the Perl community sends greetings to |
| 2716 | you. Do you (emblematical) greet back [Y/n]? n |
| 2717 | |
| 2718 | FOO |
| 2719 | |
| 2720 | : Check what type of C compiler we use |
| 2721 | cat <<EOS >trygcc |
| 2722 | $startsh |
| 2723 | EOS |
| 2724 | cat <<'EOSC' >>trygcc |
| 2725 | case "$cc" in |
| 2726 | '') ;; |
| 2727 | *) $rm -f try try.* |
| 2728 | $cat >try.c <<EOM |
| 2729 | int main(int argc, char *argv[]) { |
| 2730 | return 0; |
| 2731 | } |
| 2732 | EOM |
| 2733 | if $cc -o try $ccflags $ldflags try.c; then |
| 2734 | : |
| 2735 | else |
| 2736 | echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4 |
| 2737 | despair=yes |
| 2738 | trygcc=yes |
| 2739 | case "$cc" in |
| 2740 | *gcc*) trygcc=no ;; |
| 2741 | esac |
| 2742 | # Skip this test because it gives a false match on output like: |
| 2743 | # ./trygcc: line 23: cc: command not found |
| 2744 | # case "`$cc -v -c try.c 2>&1`" in |
| 2745 | # *gcc*) trygcc=no ;; |
| 2746 | # esac |
| 2747 | if $test X"$trygcc" = Xyes; then |
| 2748 | if gcc -o try -c try.c; then |
| 2749 | echo " " |
| 2750 | echo "You seem to have a working gcc, though." >&4 |
| 2751 | # Switching compilers may undo the work of hints files. |
| 2752 | # The most common problem is -D_REENTRANT for threads. |
| 2753 | # This heuristic catches that case, but gets false positives |
| 2754 | # if -Dusethreads was not actually specified. Better to |
| 2755 | # bail out here with a useful message than fail |
| 2756 | # mysteriously later. Should we perhaps just try to |
| 2757 | # re-invoke Configure -Dcc=gcc config_args ? |
| 2758 | if $test -f usethreads.cbu; then |
| 2759 | $cat >&4 <<EOM |
| 2760 | |
| 2761 | *** However, any setting of the C compiler flags (e.g. for thread support) |
| 2762 | *** will be lost. It may be necessary for you to restart Configure and |
| 2763 | *** add -Dcc=gcc to your Configure command line. |
| 2764 | |
| 2765 | EOM |
| 2766 | rp="Would you like to go ahead and try gcc anyway?" |
| 2767 | dflt=n |
| 2768 | else |
| 2769 | rp="Would you like to use it?" |
| 2770 | dflt=y |
| 2771 | fi |
| 2772 | if $test -f myread; then |
| 2773 | . ./myread |
| 2774 | else |
| 2775 | if $test -f UU/myread; then |
| 2776 | . ./UU/myread |
| 2777 | else |
| 2778 | echo "Cannot find myread, sorry. Aborting." >&2 |
| 2779 | exit 1 |
| 2780 | fi |
| 2781 | fi |
| 2782 | case "$ans" in |
| 2783 | [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no; |
| 2784 | esac |
| 2785 | fi |
| 2786 | fi |
| 2787 | fi |
| 2788 | $rm -f try try.* |
| 2789 | ;; |
| 2790 | esac |
| 2791 | EOSC |
| 2792 | |
| 2793 | cat <<EOS >checkcc |
| 2794 | $startsh |
| 2795 | EOS |
| 2796 | cat <<'EOSC' >>checkcc |
| 2797 | case "$cc" in |
| 2798 | '') ;; |
| 2799 | *) $rm -f try try.* |
| 2800 | $cat >try.c <<EOM |
| 2801 | int main(int argc, char *argv[]) { |
| 2802 | return 0; |
| 2803 | } |
| 2804 | EOM |
| 2805 | if $cc -o try $ccflags $ldflags try.c; then |
| 2806 | : |
| 2807 | else |
| 2808 | if $test X"$despair" = Xyes; then |
| 2809 | echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4 |
| 2810 | fi |
| 2811 | $cat >&4 <<EOM |
| 2812 | You need to find a working C compiler. |
| 2813 | Either (purchase and) install the C compiler supplied by your OS vendor, |
| 2814 | or for a free C compiler try http://gcc.gnu.org/ |
| 2815 | I cannot continue any further, aborting. |
| 2816 | EOM |
| 2817 | exit 1 |
| 2818 | fi |
| 2819 | $rm -f try try.* |
| 2820 | ;; |
| 2821 | esac |
| 2822 | EOSC |
| 2823 | |
| 2824 | : determine whether symbolic links are supported |
| 2825 | echo " " |
| 2826 | $touch blurfl |
| 2827 | if $ln -s blurfl sym > /dev/null 2>&1 ; then |
| 2828 | echo "Symbolic links are supported." >&4 |
| 2829 | lns="$ln -s" |
| 2830 | else |
| 2831 | echo "Symbolic links are NOT supported." >&4 |
| 2832 | lns="$ln" |
| 2833 | fi |
| 2834 | $rm -f blurfl sym |
| 2835 | |
| 2836 | : determine whether symbolic links are supported |
| 2837 | echo " " |
| 2838 | case "$lns" in |
| 2839 | *"ln"*" -s") |
| 2840 | echo "Checking how to test for symbolic links..." >&4 |
| 2841 | $lns blurfl sym |
| 2842 | if $test "X$issymlink" = X; then |
| 2843 | case "$newsh" in |
| 2844 | '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;; |
| 2845 | *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;; |
| 2846 | esac |
| 2847 | if test $? = 0; then |
| 2848 | issymlink="test -h" |
| 2849 | else |
| 2850 | echo "Your builtin 'test -h' may be broken." >&4 |
| 2851 | case "$test" in |
| 2852 | /*) ;; |
| 2853 | *) pth=`echo $PATH | sed -e "s/$p_/ /g"` |
| 2854 | for p in $pth |
| 2855 | do |
| 2856 | if test -f "$p/$test"; then |
| 2857 | test="$p/$test" |
| 2858 | break |
| 2859 | fi |
| 2860 | done |
| 2861 | ;; |
| 2862 | esac |
| 2863 | case "$test" in |
| 2864 | /*) |
| 2865 | echo "Trying external '$test -h'." >&4 |
| 2866 | issymlink="$test -h" |
| 2867 | if $test ! -h sym >/dev/null 2>&1; then |
| 2868 | echo "External '$test -h' is broken, too." >&4 |
| 2869 | issymlink='' |
| 2870 | fi |
| 2871 | ;; |
| 2872 | *) issymlink='' ;; |
| 2873 | esac |
| 2874 | fi |
| 2875 | fi |
| 2876 | if $test "X$issymlink" = X; then |
| 2877 | if $test -L sym 2>/dev/null; then |
| 2878 | issymlink="$test -L" |
| 2879 | echo "The builtin '$test -L' worked." >&4 |
| 2880 | fi |
| 2881 | fi |
| 2882 | if $test "X$issymlink" != X; then |
| 2883 | echo "You can test for symbolic links with '$issymlink'." >&4 |
| 2884 | else |
| 2885 | echo "I do not know how you can test for symbolic links." >&4 |
| 2886 | fi |
| 2887 | $rm -f blurfl sym |
| 2888 | ;; |
| 2889 | *) echo "No symbolic links, so not testing for their testing..." >&4 |
| 2890 | ;; |
| 2891 | esac |
| 2892 | |
| 2893 | : Make symlinks util |
| 2894 | case "$mksymlinks" in |
| 2895 | $define|true|[yY]*) |
| 2896 | case "$src" in |
| 2897 | ''|'.') echo "Cannot create symlinks in the original directory." >&4 |
| 2898 | exit 1 |
| 2899 | ;; |
| 2900 | *) case "$lns:$issymlink" in |
| 2901 | *"ln"*" -s:"*"test -"?) |
| 2902 | echo "Creating the symbolic links..." >&4 |
| 2903 | cd .. |
| 2904 | awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' | |
| 2905 | awk 'NF == 1 { |
| 2906 | dir="."; |
| 2907 | file=$1 ""; |
| 2908 | } |
| 2909 | NF == 2 { |
| 2910 | dir=$1 ""; |
| 2911 | file=$2 ""; |
| 2912 | } |
| 2913 | { |
| 2914 | print "# dir = ", dir, "file = ", file |
| 2915 | mf[dir] = mf[dir]" "source"/"dir"/"file; |
| 2916 | } END { |
| 2917 | for (d in mf) { |
| 2918 | if (d != ".") { print("mkdir -p "d) } |
| 2919 | print("ln -sf "mf[d]" "d); |
| 2920 | } |
| 2921 | }' source="$src" > UU/mksymlinks.$$ |
| 2922 | sh UU/mksymlinks.$$ |
| 2923 | rm UU/mksymlinks.$$ |
| 2924 | # Sanity check 1. |
| 2925 | if test ! -d t/base; then |
| 2926 | echo "Failed to create the subdirectories. Aborting." >&4 |
| 2927 | exit 1 |
| 2928 | fi |
| 2929 | # Sanity check 2. |
| 2930 | if test ! -f t/base/lex.t; then |
| 2931 | echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4 |
| 2932 | exit 1 |
| 2933 | fi |
| 2934 | if test ! -f win32/win32.c; then |
| 2935 | echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4 |
| 2936 | exit 1 |
| 2937 | fi |
| 2938 | cd UU |
| 2939 | ;; |
| 2940 | *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4 |
| 2941 | ;; |
| 2942 | esac |
| 2943 | ;; |
| 2944 | esac |
| 2945 | ;; |
| 2946 | esac |
| 2947 | |
| 2948 | : Check for Cross-Compilation |
| 2949 | if $test "X$targethost" = "X"; then |
| 2950 | targethost="" |
| 2951 | fi |
| 2952 | if $test "X$targetenv" = "X"; then |
| 2953 | targetenv="" |
| 2954 | fi |
| 2955 | case "$usecrosscompile" in |
| 2956 | $define|true|[yY]*) |
| 2957 | $echo "Cross-compiling..." |
| 2958 | croak='' |
| 2959 | case "$cc" in |
| 2960 | *-gcc*|*-g++*) # A cross-compiling gcc, probably. |
| 2961 | # arm-linux-androideabi-gcc -> arm-linux-androideabi |
| 2962 | # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32 |
| 2963 | targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'` |
| 2964 | ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'` |
| 2965 | # leave out ld, choosing it is more complex |
| 2966 | nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'` |
| 2967 | ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'` |
| 2968 | # We are in a weird spot. Just before us, some values |
| 2969 | # were 'saved', to be restored after the hints are |
| 2970 | # run. This means that the changes we made to ar, |
| 2971 | # nm and ranlib will get reverted. |
| 2972 | # To avoid that, we hijack the saving mechanism and |
| 2973 | # have it save our new values. |
| 2974 | for file in ar nm ranlib; do |
| 2975 | eval xxx=\$$file |
| 2976 | eval $file=$xxx$_exe |
| 2977 | eval _$file=$xxx |
| 2978 | done |
| 2979 | ;; |
| 2980 | esac |
| 2981 | case "$targetarch" in |
| 2982 | '') echo "Targetarch not defined." >&4; croak=y ;; |
| 2983 | *) echo "Using targetarch $targetarch." >&4 ;; |
| 2984 | esac |
| 2985 | case "$targethost" in |
| 2986 | '') echo "Targethost not defined." >&4; croak=n ;; |
| 2987 | *) echo "Using targethost $targethost." >&4 |
| 2988 | esac |
| 2989 | locincpth=' ' |
| 2990 | loclibpth=' ' |
| 2991 | case "$croak" in |
| 2992 | y) echo "Cannot continue, aborting." >&4; exit 1 ;; |
| 2993 | esac |
| 2994 | : compile a host miniperl and generate_uudmap, unless we got passed them |
| 2995 | if $test "X$hostperl" = X; then |
| 2996 | echo "Building host miniperl and generate_uudmap binaries" >&4 |
| 2997 | before_host=`pwd` |
| 2998 | cd .. |
| 2999 | cd $src |
| 3000 | src=`pwd` |
| 3001 | rm -rf $src/host |
| 3002 | mkdir $src/host |
| 3003 | cd $src/host |
| 3004 | $src/Configure -des -Dusedevel -Dmksymlinks |
| 3005 | $make miniperl |
| 3006 | case "$hostgenerate" in |
| 3007 | '') $make generate_uudmap |
| 3008 | hostgenerate=$src/host/generate_uudmap |
| 3009 | ;; |
| 3010 | "$undef") hostgenerate='' |
| 3011 | ;; |
| 3012 | esac |
| 3013 | hostperl=$src/host/miniperl |
| 3014 | cd $before_host |
| 3015 | fi |
| 3016 | hostosname=`$hostperl -le 'print $^O'` |
| 3017 | ;; |
| 3018 | *) |
| 3019 | usecrosscompile="$undef" |
| 3020 | ;; |
| 3021 | esac |
| 3022 | |
| 3023 | : Define -Dtargethost=somecomputer to run compiled tests on another machine |
| 3024 | case "$targethost" in |
| 3025 | '') echo "Checking for cross-compile" >&4 |
| 3026 | case "$usecrosscompile$multiarch" in |
| 3027 | *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4 |
| 3028 | if [ -f Makefile ]; then |
| 3029 | echo " " |
| 3030 | echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make." |
| 3031 | else |
| 3032 | echo "Configure done." |
| 3033 | fi |
| 3034 | exit 0 |
| 3035 | ;; |
| 3036 | *) echo "No targethost for running compiler tests against defined, running locally" >&4 |
| 3037 | run='' |
| 3038 | to=: |
| 3039 | from=: |
| 3040 | ;; |
| 3041 | esac |
| 3042 | ;; |
| 3043 | *) echo "Using targethost $targethost." >&4 |
| 3044 | case "$src" in |
| 3045 | /*) run=$src/Cross/run |
| 3046 | targetmkdir=$src/Cross/mkdir |
| 3047 | to=$src/Cross/to |
| 3048 | from=$src/Cross/from |
| 3049 | ;; |
| 3050 | *) pwd=`$test -f ../Configure & cd ..; pwd` |
| 3051 | run=$pwd/Cross/run |
| 3052 | targetmkdir=$pwd/Cross/mkdir |
| 3053 | to=$pwd/Cross/to |
| 3054 | from=$pwd/Cross/from |
| 3055 | ;; |
| 3056 | esac |
| 3057 | case "$targetrun" in |
| 3058 | '') targetrun=ssh ;; |
| 3059 | esac |
| 3060 | case "$targetto" in |
| 3061 | '') targetto=scp ;; |
| 3062 | esac |
| 3063 | case "$targetfrom" in |
| 3064 | '') targetfrom=scp ;; |
| 3065 | esac |
| 3066 | run=$run-$targetrun |
| 3067 | to=$to-$targetto |
| 3068 | from=$from-$targetfrom |
| 3069 | case "$targetdir" in |
| 3070 | '') targetdir=/tmp |
| 3071 | echo "Guessing targetdir $targetdir." >&4 |
| 3072 | ;; |
| 3073 | esac |
| 3074 | case "$targetuser" in |
| 3075 | '') targetuser=root |
| 3076 | echo "Guessing targetuser $targetuser." >&4 |
| 3077 | ;; |
| 3078 | esac |
| 3079 | case "$targetport" in |
| 3080 | '') targetport=22 |
| 3081 | echo "Guessing targetport $targetport." >&4 |
| 3082 | ;; |
| 3083 | esac |
| 3084 | case "$targetfrom" in |
| 3085 | scp) q=-q ;; |
| 3086 | *) q='' ;; |
| 3087 | esac |
| 3088 | case "$targetrun" in |
| 3089 | ssh|rsh) |
| 3090 | cat >$run <<EOF |
| 3091 | #!/bin/sh |
| 3092 | env='' |
| 3093 | case "\$1" in |
| 3094 | -cwd) |
| 3095 | shift |
| 3096 | cwd=\$1 |
| 3097 | shift |
| 3098 | ;; |
| 3099 | esac |
| 3100 | case "\$1" in |
| 3101 | -env) |
| 3102 | shift |
| 3103 | env=\$1 |
| 3104 | shift |
| 3105 | ;; |
| 3106 | esac |
| 3107 | case "\$cwd" in |
| 3108 | '') cwd=$targetdir ;; |
| 3109 | esac |
| 3110 | exe=\$1 |
| 3111 | shift |
| 3112 | $to \$exe |
| 3113 | $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@" |
| 3114 | EOF |
| 3115 | ;; |
| 3116 | adb) |
| 3117 | $touch $run |
| 3118 | ;; |
| 3119 | *) echo "Unknown targetrun '$targetrun'" >&4 |
| 3120 | exit 1 |
| 3121 | ;; |
| 3122 | esac |
| 3123 | case "$targetmkdir" in |
| 3124 | */Cross/mkdir) |
| 3125 | cat >$targetmkdir <<EOF |
| 3126 | #!/bin/sh |
| 3127 | $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@" |
| 3128 | EOF |
| 3129 | $chmod a+rx $targetmkdir |
| 3130 | ;; |
| 3131 | *) echo "Unknown targetmkdir '$targetmkdir'" >&4 |
| 3132 | exit 1 |
| 3133 | ;; |
| 3134 | esac |
| 3135 | case "$targetto" in |
| 3136 | scp|rcp) |
| 3137 | cat >$to <<EOF |
| 3138 | #!/bin/sh |
| 3139 | for f in \$@ |
| 3140 | do |
| 3141 | case "\$f" in |
| 3142 | /*) |
| 3143 | $targetmkdir \`dirname \$f\` |
| 3144 | $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1 |
| 3145 | ;; |
| 3146 | *) |
| 3147 | $targetmkdir $targetdir/\`dirname \$f\` |
| 3148 | $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1 |
| 3149 | ;; |
| 3150 | esac |
| 3151 | done |
| 3152 | exit 0 |
| 3153 | EOF |
| 3154 | ;; |
| 3155 | cp) cat >$to <<EOF |
| 3156 | #!/bin/sh |
| 3157 | for f in \$@ |
| 3158 | do |
| 3159 | case "\$f" in |
| 3160 | /*) |
| 3161 | $mkdir -p $targetdir/\`dirname \$f\` |
| 3162 | $cp \$f $targetdir/\$f || exit 1 |
| 3163 | ;; |
| 3164 | *) |
| 3165 | $targetmkdir $targetdir/\`dirname \$f\` |
| 3166 | $cp \$f $targetdir/\$f || exit 1 |
| 3167 | ;; |
| 3168 | esac |
| 3169 | done |
| 3170 | exit 0 |
| 3171 | EOF |
| 3172 | ;; |
| 3173 | *) echo "Unknown targetto '$targetto'" >&4 |
| 3174 | exit 1 |
| 3175 | ;; |
| 3176 | esac |
| 3177 | case "$targetfrom" in |
| 3178 | scp|rcp) |
| 3179 | cat >$from <<EOF |
| 3180 | #!/bin/sh |
| 3181 | for f in \$@ |
| 3182 | do |
| 3183 | $rm -f \$f |
| 3184 | $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1 |
| 3185 | done |
| 3186 | exit 0 |
| 3187 | EOF |
| 3188 | ;; |
| 3189 | cp) cat >$from <<EOF |
| 3190 | #!/bin/sh |
| 3191 | for f in \$@ |
| 3192 | do |
| 3193 | $rm -f \$f |
| 3194 | cp $targetdir/\$f . || exit 1 |
| 3195 | done |
| 3196 | exit 0 |
| 3197 | EOF |
| 3198 | ;; |
| 3199 | *) echo "Unknown targetfrom '$targetfrom'" >&4 |
| 3200 | exit 1 |
| 3201 | ;; |
| 3202 | esac |
| 3203 | if $test ! -f $run; then |
| 3204 | echo "Target 'run' script '$run' not found." >&4 |
| 3205 | else |
| 3206 | $chmod a+rx $run |
| 3207 | fi |
| 3208 | if $test ! -f $to; then |
| 3209 | echo "Target 'to' script '$to' not found." >&4 |
| 3210 | else |
| 3211 | $chmod a+rx $to |
| 3212 | fi |
| 3213 | if $test ! -f $from; then |
| 3214 | echo "Target 'from' script '$from' not found." >&4 |
| 3215 | else |
| 3216 | $chmod a+rx $from |
| 3217 | fi |
| 3218 | if $test ! -f $run -o ! -f $to -o ! -f $from; then |
| 3219 | exit 1 |
| 3220 | fi |
| 3221 | cat >&4 <<EOF |
| 3222 | Using '$run' for remote execution, |
| 3223 | and '$from' and '$to' |
| 3224 | for remote file transfer. |
| 3225 | EOF |
| 3226 | ;; |
| 3227 | *) run='' |
| 3228 | to=: |
| 3229 | from=: |
| 3230 | usecrosscompile="$undef" |
| 3231 | targetarch='' |
| 3232 | ;; |
| 3233 | esac |
| 3234 | |
| 3235 | : see whether [:lower:] and [:upper:] are supported character classes |
| 3236 | echo " " |
| 3237 | case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in |
| 3238 | ABYZ-abyz) |
| 3239 | echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 |
| 3240 | up='[:upper:]' |
| 3241 | low='[:lower:]' |
| 3242 | ;; |
| 3243 | *) # There is a discontinuity in EBCDIC between 'R' and 'S' |
| 3244 | # (0xd9 and 0xe2), therefore that is a nice testing point. |
| 3245 | if test "X$up" = X -o "X$low" = X; then |
| 3246 | case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in |
| 3247 | rs) up='[A-Z]' |
| 3248 | low='[a-z]' |
| 3249 | ;; |
| 3250 | esac |
| 3251 | fi |
| 3252 | if test "X$up" = X -o "X$low" = X; then |
| 3253 | case "`echo RS | $tr R-S r-s 2>/dev/null`" in |
| 3254 | rs) up='A-Z' |
| 3255 | low='a-z' |
| 3256 | ;; |
| 3257 | esac |
| 3258 | fi |
| 3259 | if test "X$up" = X -o "X$low" = X; then |
| 3260 | case "`echo RS | od -x 2>/dev/null`" in |
| 3261 | *D9E2*|*d9e2*) |
| 3262 | echo "Hey, this might be EBCDIC." >&4 |
| 3263 | if test "X$up" = X -o "X$low" = X; then |
| 3264 | case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in |
| 3265 | rs) up='[A-IJ-RS-Z]' |
| 3266 | low='[a-ij-rs-z]' |
| 3267 | ;; |
| 3268 | esac |
| 3269 | fi |
| 3270 | if test "X$up" = X -o "X$low" = X; then |
| 3271 | case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in |
| 3272 | rs) up='A-IJ-RS-Z' |
| 3273 | low='a-ij-rs-z' |
| 3274 | ;; |
| 3275 | esac |
| 3276 | fi |
| 3277 | ;; |
| 3278 | esac |
| 3279 | fi |
| 3280 | esac |
| 3281 | case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in |
| 3282 | rs) |
| 3283 | echo "Using $up and $low to convert case." >&4 |
| 3284 | ;; |
| 3285 | *) |
| 3286 | echo "I don't know how to translate letters from upper to lower case." >&4 |
| 3287 | echo "Your tr is not acting any way I know of." >&4 |
| 3288 | exit 1 |
| 3289 | ;; |
| 3290 | esac |
| 3291 | : set up the translation script tr, must be called with ./tr of course |
| 3292 | cat >tr <<EOSC |
| 3293 | $startsh |
| 3294 | case "\$1\$2" in |
| 3295 | '[A-Z][a-z]') exec $tr '$up' '$low';; |
| 3296 | '[a-z][A-Z]') exec $tr '$low' '$up';; |
| 3297 | esac |
| 3298 | exec $tr "\$@" |
| 3299 | EOSC |
| 3300 | chmod +x tr |
| 3301 | $eunicefix tr |
| 3302 | |
| 3303 | : Try to determine whether config.sh was made on this system |
| 3304 | case "$config_sh" in |
| 3305 | '') |
| 3306 | myuname=`$uname -a 2>/dev/null` |
| 3307 | $test -z "$myuname" && myuname=`hostname 2>/dev/null` |
| 3308 | # Downcase everything to avoid ambiguity. |
| 3309 | # Remove slashes and single quotes so we can use parts of this in |
| 3310 | # directory and file names. |
| 3311 | # Remove newlines so myuname is sane to use elsewhere. |
| 3312 | # tr '[A-Z]' '[a-z]' would not work in EBCDIC |
| 3313 | # because the A-Z/a-z are not consecutive. |
| 3314 | myuname=`echo $myuname | $sed -e "s,['/],,g" | \ |
| 3315 | ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '` |
| 3316 | newmyuname="$myuname" |
| 3317 | dflt=n |
| 3318 | case "$knowitall" in |
| 3319 | '') |
| 3320 | if test -f ../config.sh; then |
| 3321 | if $contains myuname= ../config.sh >/dev/null 2>&1; then |
| 3322 | eval "`grep myuname= ../config.sh`" |
| 3323 | fi |
| 3324 | if test "X$myuname" = "X$newmyuname"; then |
| 3325 | dflt=y |
| 3326 | fi |
| 3327 | fi |
| 3328 | ;; |
| 3329 | *) dflt=y;; |
| 3330 | esac |
| 3331 | |
| 3332 | : Get old answers from old config file if Configure was run on the |
| 3333 | : same system, otherwise use the hints. |
| 3334 | hint=default |
| 3335 | cd .. |
| 3336 | if test -f config.sh; then |
| 3337 | echo " " |
| 3338 | rp="I see a config.sh file. Shall I use it to set the defaults?" |
| 3339 | . UU/myread |
| 3340 | case "$ans" in |
| 3341 | n*|N*) echo "OK, I'll ignore it." |
| 3342 | mv config.sh config.sh.old |
| 3343 | myuname="$newmyuname" |
| 3344 | ;; |
| 3345 | *) echo "Fetching default answers from your old config.sh file..." >&4 |
| 3346 | tmp_n="$n" |
| 3347 | tmp_c="$c" |
| 3348 | tmp_sh="$sh" |
| 3349 | . ./config.sh |
| 3350 | cp config.sh UU |
| 3351 | n="$tmp_n" |
| 3352 | c="$tmp_c" |
| 3353 | : Older versions did not always set $sh. Catch re-use of such |
| 3354 | : an old config.sh. |
| 3355 | case "$sh" in |
| 3356 | '') sh="$tmp_sh" ;; |
| 3357 | esac |
| 3358 | hint=previous |
| 3359 | ;; |
| 3360 | esac |
| 3361 | fi |
| 3362 | . ./UU/checkcc |
| 3363 | if test ! -f config.sh; then |
| 3364 | $cat <<EOM |
| 3365 | |
| 3366 | First time through, eh? I have some defaults handy for some systems |
| 3367 | that need some extra help getting the Configure answers right: |
| 3368 | |
| 3369 | EOM |
| 3370 | (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4 |
| 3371 | dflt='' |
| 3372 | : Half the following guesses are probably wrong... If you have better |
| 3373 | : tests or hints, please send them to https://github.com/Perl/perl5/issues |
| 3374 | : The metaconfig authors would also appreciate a copy... |
| 3375 | $test -f /irix && osname=irix |
| 3376 | $test -f /xenix && osname=sco_xenix |
| 3377 | $test -f /dynix && osname=dynix |
| 3378 | $test -f /dnix && osname=dnix |
| 3379 | $test -f /lynx.os && osname=lynxos |
| 3380 | $test -f /unicos && osname=unicos && osvers=`$uname -r` |
| 3381 | $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r` |
| 3382 | $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r` |
| 3383 | $test -f /bin/mips && /bin/mips && osname=mips |
| 3384 | $test -d /usr/apollo/bin && osname=apollo |
| 3385 | $test -f /etc/saf/_sactab && osname=svr4 |
| 3386 | $test -d /usr/include/minix && osname=minix && osvers=`$uname -r` |
| 3387 | $test -f /system/gnu_library/bin/ar.pm && osname=vos |
| 3388 | $test -f /sys/utilities/MultiView && osname=amigaos |
| 3389 | if $test -d /MachTen -o -d /MachTen_Folder; then |
| 3390 | osname=machten |
| 3391 | if $test -x /sbin/version; then |
| 3392 | osvers=`/sbin/version | $awk '{print $2}' | |
| 3393 | $sed -e 's/[A-Za-z]$//'` |
| 3394 | elif $test -x /usr/etc/version; then |
| 3395 | osvers=`/usr/etc/version | $awk '{print $2}' | |
| 3396 | $sed -e 's/[A-Za-z]$//'` |
| 3397 | else |
| 3398 | osvers="$2.$3" |
| 3399 | fi |
| 3400 | fi |
| 3401 | |
| 3402 | $test -f /sys/posix.dll && |
| 3403 | $test -f /usr/bin/what && |
| 3404 | set X `/usr/bin/what /sys/posix.dll` && |
| 3405 | $test "$3" = UWIN && |
| 3406 | osname=uwin && |
| 3407 | osvers="$5" |
| 3408 | |
| 3409 | if $test -f $uname; then |
| 3410 | set X $myuname |
| 3411 | shift |
| 3412 | |
| 3413 | case "$5" in |
| 3414 | fps*) osname=fps ;; |
| 3415 | mips*) |
| 3416 | case "$4" in |
| 3417 | umips) osname=umips ;; |
| 3418 | *) osname=mips ;; |
| 3419 | esac;; |
| 3420 | [23]100) osname=mips ;; |
| 3421 | i386*) |
| 3422 | tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'` |
| 3423 | if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then |
| 3424 | osname='sco' |
| 3425 | osvers=$tmp |
| 3426 | elif $test -f /etc/kconfig; then |
| 3427 | osname=isc |
| 3428 | if test "$lns" = "$ln -s"; then |
| 3429 | osvers=4 |
| 3430 | elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then |
| 3431 | osvers=3 |
| 3432 | elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then |
| 3433 | osvers=2 |
| 3434 | fi |
| 3435 | fi |
| 3436 | tmp='' |
| 3437 | ;; |
| 3438 | pc*) |
| 3439 | if test -n "$DJGPP"; then |
| 3440 | osname=dos |
| 3441 | osvers=djgpp |
| 3442 | fi |
| 3443 | ;; |
| 3444 | esac |
| 3445 | |
| 3446 | case "$1" in |
| 3447 | aix) osname=aix |
| 3448 | tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` |
| 3449 | case "$tmp" in |
| 3450 | # oslevel can fail with: |
| 3451 | # oslevel: Unable to acquire lock. |
| 3452 | *not\ found) osvers="$4"."$3" ;; |
| 3453 | '<3240'|'<>3240') osvers=3.2.0 ;; |
| 3454 | '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; |
| 3455 | '=3250'|'>3250') osvers=3.2.5 ;; |
| 3456 | *) osvers=$tmp;; |
| 3457 | esac |
| 3458 | ;; |
| 3459 | bitrig) osname=bitrig |
| 3460 | osvers="$3" |
| 3461 | ;; |
| 3462 | bsd386) osname=bsd386 |
| 3463 | osvers=`$uname -r` |
| 3464 | ;; |
| 3465 | cygwin*) osname=cygwin |
| 3466 | osvers="$3" |
| 3467 | ;; |
| 3468 | *dc.osx) osname=dcosx |
| 3469 | osvers="$3" |
| 3470 | ;; |
| 3471 | dnix) osname=dnix |
| 3472 | osvers="$3" |
| 3473 | ;; |
| 3474 | domainos) osname=apollo |
| 3475 | osvers="$3" |
| 3476 | ;; |
| 3477 | dgux) osname=dgux |
| 3478 | osvers="$3" |
| 3479 | ;; |
| 3480 | dragonfly) osname=dragonfly |
| 3481 | osvers="$3" |
| 3482 | ;; |
| 3483 | dynixptx*) osname=dynixptx |
| 3484 | osvers=`echo "$4"|sed 's/^v//'` |
| 3485 | ;; |
| 3486 | freebsd) osname=freebsd |
| 3487 | osvers="$3" ;; |
| 3488 | genix) osname=genix ;; |
| 3489 | gnu) osname=gnu |
| 3490 | osvers="$3" ;; |
| 3491 | hp*) osname=hpux |
| 3492 | osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'` |
| 3493 | ;; |
| 3494 | irix*) osname=irix |
| 3495 | case "$3" in |
| 3496 | 4*) osvers=4 ;; |
| 3497 | 5*) osvers=5 ;; |
| 3498 | *) osvers="$3" ;; |
| 3499 | esac |
| 3500 | ;; |
| 3501 | linux) osname=linux |
| 3502 | case "$3" in |
| 3503 | *) osvers="$3" ;; |
| 3504 | esac |
| 3505 | $test -f /system/lib/libandroid.so && osname=linux-android |
| 3506 | ;; |
| 3507 | MiNT) osname=mint |
| 3508 | ;; |
| 3509 | minix) osname=minix |
| 3510 | osvers=`$uname -r` |
| 3511 | ;; |
| 3512 | netbsd*) osname=netbsd |
| 3513 | osvers="$3" |
| 3514 | ;; |
| 3515 | news-os) osvers="$3" |
| 3516 | case "$3" in |
| 3517 | 4*) osname=newsos4 ;; |
| 3518 | *) osname=newsos ;; |
| 3519 | esac |
| 3520 | ;; |
| 3521 | nonstop-ux) osname=nonstopux ;; |
| 3522 | openbsd) osname=openbsd |
| 3523 | osvers="$3" |
| 3524 | ;; |
| 3525 | os2) osname=os2 |
| 3526 | osvers="$4" |
| 3527 | ;; |
| 3528 | POSIX-BC | posix-bc ) osname=posix-bc |
| 3529 | osvers="$3" |
| 3530 | ;; |
| 3531 | powerux | power_ux | powermax_os | powermaxos | \ |
| 3532 | powerunix | power_unix) osname=powerux |
| 3533 | osvers="$3" |
| 3534 | ;; |
| 3535 | qnx) osname=qnx |
| 3536 | osvers="$4" |
| 3537 | ;; |
| 3538 | solaris) osname=solaris |
| 3539 | case "$3" in |
| 3540 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; |
| 3541 | *) osvers="$3" ;; |
| 3542 | esac |
| 3543 | ;; |
| 3544 | sunos) osname=sunos |
| 3545 | case "$3" in |
| 3546 | 5*) osname=solaris |
| 3547 | osvers=`echo $3 | $sed 's/^5/2/g'` ;; |
| 3548 | *) osvers="$3" ;; |
| 3549 | esac |
| 3550 | ;; |
| 3551 | titanos) osname=titanos |
| 3552 | case "$3" in |
| 3553 | 1*) osvers=1 ;; |
| 3554 | 2*) osvers=2 ;; |
| 3555 | 3*) osvers=3 ;; |
| 3556 | 4*) osvers=4 ;; |
| 3557 | *) osvers="$3" ;; |
| 3558 | esac |
| 3559 | ;; |
| 3560 | ultrix) osname=ultrix |
| 3561 | osvers="$3" |
| 3562 | ;; |
| 3563 | osf1|mls+) case "$5" in |
| 3564 | alpha) |
| 3565 | osname=dec_osf |
| 3566 | osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'` |
| 3567 | case "$osvers" in |
| 3568 | [1-9].[0-9]*) ;; |
| 3569 | *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;; |
| 3570 | esac |
| 3571 | ;; |
| 3572 | hp*) osname=hp_osf1 ;; |
| 3573 | mips) osname=mips_osf1 ;; |
| 3574 | esac |
| 3575 | ;; |
| 3576 | # UnixWare 7.1.2 is known as Open UNIX 8 |
| 3577 | openunix|unixware) osname=svr5 |
| 3578 | osvers="$4" |
| 3579 | ;; |
| 3580 | uts) osname=uts |
| 3581 | osvers="$3" |
| 3582 | ;; |
| 3583 | vos) osvers="$3" |
| 3584 | ;; |
| 3585 | $2) case "$osname" in |
| 3586 | *isc*) ;; |
| 3587 | *freebsd*) ;; |
| 3588 | svr*) |
| 3589 | : svr4.x or possibly later |
| 3590 | case "svr$3" in |
| 3591 | ${osname}*) |
| 3592 | osname=svr$3 |
| 3593 | osvers=$4 |
| 3594 | ;; |
| 3595 | esac |
| 3596 | case "$osname" in |
| 3597 | svr4.0) |
| 3598 | : Check for ESIX |
| 3599 | if test -f /stand/boot ; then |
| 3600 | eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot` |
| 3601 | if test -n "$INITPROG" -a -f "$INITPROG"; then |
| 3602 | isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'` |
| 3603 | if test -n "$isesix"; then |
| 3604 | osname=esix4 |
| 3605 | fi |
| 3606 | fi |
| 3607 | fi |
| 3608 | ;; |
| 3609 | esac |
| 3610 | ;; |
| 3611 | *) if test -f /etc/systemid; then |
| 3612 | osname=sco |
| 3613 | set `echo $3 | $sed 's/\./ /g'` $4 |
| 3614 | if $test -f $src/hints/sco_$1_$2_$3.sh; then |
| 3615 | osvers=$1.$2.$3 |
| 3616 | elif $test -f $src/hints/sco_$1_$2.sh; then |
| 3617 | osvers=$1.$2 |
| 3618 | elif $test -f $src/hints/sco_$1.sh; then |
| 3619 | osvers=$1 |
| 3620 | fi |
| 3621 | else |
| 3622 | case "$osname" in |
| 3623 | '') : Still unknown. Probably a generic Sys V. |
| 3624 | osname="sysv" |
| 3625 | osvers="$3" |
| 3626 | ;; |
| 3627 | esac |
| 3628 | fi |
| 3629 | ;; |
| 3630 | esac |
| 3631 | ;; |
| 3632 | *) case "$osname" in |
| 3633 | '') : Still unknown. Probably a generic BSD. |
| 3634 | osname="$1" |
| 3635 | osvers="$3" |
| 3636 | ;; |
| 3637 | esac |
| 3638 | ;; |
| 3639 | esac |
| 3640 | else |
| 3641 | if test -f /vmunix -a -f $src/hints/news_os.sh; then |
| 3642 | (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1 |
| 3643 | if $contains news-os UU/kernel.what >/dev/null 2>&1; then |
| 3644 | osname=news_os |
| 3645 | fi |
| 3646 | $rm -f UU/kernel.what |
| 3647 | elif test -d c:/. -o -n "$is_os2" ; then |
| 3648 | set X $myuname |
| 3649 | osname=os2 |
| 3650 | osvers="$5" |
| 3651 | fi |
| 3652 | fi |
| 3653 | |
| 3654 | case "$targetarch" in |
| 3655 | '') ;; |
| 3656 | *) hostarch=$osname |
| 3657 | case "$targetarch" in |
| 3658 | nto*|*-nto-*) |
| 3659 | # Will load qnx.sh, which should change osname to nto |
| 3660 | osname=qnx |
| 3661 | osvers='' |
| 3662 | ;; |
| 3663 | *linux-android*) |
| 3664 | # Catch arm-linux-androideabi, mipsel-linux-android, |
| 3665 | # and i686-linux-android |
| 3666 | osname=linux-android |
| 3667 | osvers='' |
| 3668 | ;; |
| 3669 | *linux*) |
| 3670 | # Something like arm-linux-gnueabihf is really just |
| 3671 | # plain linux. |
| 3672 | osname=linux |
| 3673 | osvers='' |
| 3674 | ;; |
| 3675 | *solaris*|*sunos*) |
| 3676 | osname=solaris |
| 3677 | # XXX perhaps we should just assume |
| 3678 | # osvers to be 2, or maybe take the value |
| 3679 | # from targetarch. Using $run before the |
| 3680 | # hints are run is somewhat icky. |
| 3681 | set X `$run $uname -a 2>/dev/null` |
| 3682 | shift |
| 3683 | case "$3" in |
| 3684 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; |
| 3685 | *) osvers="$3" ;; |
| 3686 | esac |
| 3687 | ;; |
| 3688 | *) |
| 3689 | osname=`echo $targetarch|sed 's,^[^-]*-,,'` |
| 3690 | osvers='' |
| 3691 | ;; |
| 3692 | esac |
| 3693 | ;; |
| 3694 | esac |
| 3695 | |
| 3696 | : Now look for a hint file osname_osvers, unless one has been |
| 3697 | : specified already. |
| 3698 | case "$hintfile" in |
| 3699 | ''|' ') |
| 3700 | file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'` |
| 3701 | : Also try without trailing minor version numbers. |
| 3702 | xfile=`echo $file | $sed -e 's%_[^_]*$%%'` |
| 3703 | xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'` |
| 3704 | xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'` |
| 3705 | xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'` |
| 3706 | case "$file" in |
| 3707 | '') dflt=none ;; |
| 3708 | *) case "$osvers" in |
| 3709 | '') dflt=$file |
| 3710 | ;; |
| 3711 | *) if $test -f $src/hints/$file.sh ; then |
| 3712 | dflt=$file |
| 3713 | elif $test -f $src/hints/$xfile.sh ; then |
| 3714 | dflt=$xfile |
| 3715 | elif $test -f $src/hints/$xxfile.sh ; then |
| 3716 | dflt=$xxfile |
| 3717 | elif $test -f $src/hints/$xxxfile.sh ; then |
| 3718 | dflt=$xxxfile |
| 3719 | elif $test -f $src/hints/$xxxxfile.sh ; then |
| 3720 | dflt=$xxxxfile |
| 3721 | elif $test -f "$src/hints/${osname}.sh" ; then |
| 3722 | dflt="${osname}" |
| 3723 | else |
| 3724 | dflt=none |
| 3725 | fi |
| 3726 | ;; |
| 3727 | esac |
| 3728 | ;; |
| 3729 | esac |
| 3730 | if $test -f Policy.sh ; then |
| 3731 | case "$dflt" in |
| 3732 | *Policy*) ;; |
| 3733 | none) dflt="Policy" ;; |
| 3734 | *) dflt="Policy $dflt" ;; |
| 3735 | esac |
| 3736 | fi |
| 3737 | ;; |
| 3738 | *) |
| 3739 | dflt=`echo $hintfile | $sed 's/\.sh$//'` |
| 3740 | ;; |
| 3741 | esac |
| 3742 | |
| 3743 | if $test -f Policy.sh ; then |
| 3744 | $cat <<EOM |
| 3745 | |
| 3746 | There's also a Policy hint file available, which should make the |
| 3747 | site-specific (policy) questions easier to answer. |
| 3748 | EOM |
| 3749 | |
| 3750 | fi |
| 3751 | |
| 3752 | $cat <<EOM |
| 3753 | |
| 3754 | You may give one or more space-separated answers, or "none" if appropriate. |
| 3755 | If you have a handcrafted Policy.sh file or a Policy.sh file generated by a |
| 3756 | previous run of Configure, you may specify it as well as or instead of |
| 3757 | OS-specific hints. If hints are provided for your OS, you should use them: |
| 3758 | although Perl can probably be built without hints on many platforms, using |
| 3759 | hints often improve performance and may enable features that Configure can't |
| 3760 | set up on its own. If there are no hints that match your OS, specify "none"; |
| 3761 | DO NOT give a wrong version or a wrong OS. |
| 3762 | |
| 3763 | EOM |
| 3764 | |
| 3765 | rp="Which of these apply, if any?" |
| 3766 | . UU/myread |
| 3767 | tans=$ans |
| 3768 | for file in $tans; do |
| 3769 | if $test X$file = XPolicy -a -f Policy.sh; then |
| 3770 | . Policy.sh |
| 3771 | $cat Policy.sh >> UU/config.sh |
| 3772 | elif $test -f $src/hints/$file.sh; then |
| 3773 | . $src/hints/$file.sh |
| 3774 | $cat $src/hints/$file.sh >> UU/config.sh |
| 3775 | elif $test X"$tans" = X -o X"$tans" = Xnone ; then |
| 3776 | : nothing |
| 3777 | else |
| 3778 | : Give one chance to correct a possible typo. |
| 3779 | echo "$file.sh does not exist" |
| 3780 | dflt=$file |
| 3781 | rp="hint to use instead?" |
| 3782 | . UU/myread |
| 3783 | for file in $ans; do |
| 3784 | if $test -f "$src/hints/$file.sh"; then |
| 3785 | . $src/hints/$file.sh |
| 3786 | $cat $src/hints/$file.sh >> UU/config.sh |
| 3787 | elif $test X$ans = X -o X$ans = Xnone ; then |
| 3788 | : nothing |
| 3789 | else |
| 3790 | echo "$file.sh does not exist -- ignored." |
| 3791 | fi |
| 3792 | done |
| 3793 | fi |
| 3794 | done |
| 3795 | |
| 3796 | hint=recommended |
| 3797 | : Remember our hint file for later. |
| 3798 | if $test -f "$src/hints/$file.sh" ; then |
| 3799 | hintfile="$file" |
| 3800 | else |
| 3801 | hintfile='' |
| 3802 | fi |
| 3803 | fi |
| 3804 | cd UU |
| 3805 | ;; |
| 3806 | *) |
| 3807 | echo " " |
| 3808 | echo "Fetching default answers from $config_sh..." >&4 |
| 3809 | tmp_n="$n" |
| 3810 | tmp_c="$c" |
| 3811 | cd .. |
| 3812 | cp $config_sh config.sh 2>/dev/null |
| 3813 | chmod +w config.sh |
| 3814 | . ./config.sh |
| 3815 | cd UU |
| 3816 | cp ../config.sh . |
| 3817 | n="$tmp_n" |
| 3818 | c="$tmp_c" |
| 3819 | hint=previous |
| 3820 | ;; |
| 3821 | esac |
| 3822 | . ./optdef.sh |
| 3823 | |
| 3824 | : Restore computed paths |
| 3825 | for file in $loclist $trylist; do |
| 3826 | eval $file="\$_$file" |
| 3827 | done |
| 3828 | |
| 3829 | cat << EOM |
| 3830 | |
| 3831 | Configure uses the operating system name and version to set some defaults. |
| 3832 | The default value is probably right if the name rings a bell. Otherwise, |
| 3833 | since spelling matters for me, either accept the default or answer "none" |
| 3834 | to leave it blank. |
| 3835 | |
| 3836 | EOM |
| 3837 | case "$osname" in |
| 3838 | ''|' ') |
| 3839 | case "$hintfile" in |
| 3840 | ''|' '|none) dflt=none ;; |
| 3841 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;; |
| 3842 | esac |
| 3843 | ;; |
| 3844 | *) dflt="$osname" ;; |
| 3845 | esac |
| 3846 | rp="Operating system name?" |
| 3847 | . ./myread |
| 3848 | case "$ans" in |
| 3849 | none) osname='' ;; |
| 3850 | *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;; |
| 3851 | esac |
| 3852 | echo " " |
| 3853 | case "$osvers" in |
| 3854 | ''|' ') |
| 3855 | case "$hintfile" in |
| 3856 | ''|' '|none) dflt=none ;; |
| 3857 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'` |
| 3858 | dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'` |
| 3859 | case "$dflt" in |
| 3860 | ''|' ') dflt=none ;; |
| 3861 | esac |
| 3862 | ;; |
| 3863 | esac |
| 3864 | ;; |
| 3865 | *) dflt="$osvers" ;; |
| 3866 | esac |
| 3867 | rp="Operating system version?" |
| 3868 | . ./myread |
| 3869 | case "$ans" in |
| 3870 | none) osvers='' ;; |
| 3871 | *) osvers="$ans" ;; |
| 3872 | esac |
| 3873 | |
| 3874 | |
| 3875 | . ./posthint.sh |
| 3876 | |
| 3877 | : who configured the system |
| 3878 | cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1` |
| 3879 | case "$cf_by" in |
| 3880 | "") |
| 3881 | cf_by=`(logname) 2>/dev/null` |
| 3882 | case "$cf_by" in |
| 3883 | "") |
| 3884 | cf_by=`(whoami) 2>/dev/null` |
| 3885 | case "$cf_by" in |
| 3886 | "") cf_by=unknown ;; |
| 3887 | esac ;; |
| 3888 | esac ;; |
| 3889 | esac |
| 3890 | |
| 3891 | : decide how portable to be. Allow command line overrides. |
| 3892 | case "$d_portable" in |
| 3893 | "$undef") ;; |
| 3894 | *) d_portable="$define" ;; |
| 3895 | esac |
| 3896 | |
| 3897 | : set up shell script to do ~ expansion |
| 3898 | cat >filexp <<EOSS |
| 3899 | $startsh |
| 3900 | : expand filename |
| 3901 | case "\$1" in |
| 3902 | \~/*|\~) |
| 3903 | echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|" |
| 3904 | ;; |
| 3905 | \~*) |
| 3906 | if $test -f /bin/csh; then |
| 3907 | /bin/csh -f -c "glob \$1" |
| 3908 | failed=\$? |
| 3909 | echo "" |
| 3910 | exit \$failed |
| 3911 | else |
| 3912 | name=\`$expr x\$1 : '..\([^/]*\)'\` |
| 3913 | dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\` |
| 3914 | if $test ! -d "\$dir"; then |
| 3915 | me=\`basename \$0\` |
| 3916 | echo "\$me: can't locate home directory for: \$name" >&2 |
| 3917 | exit 1 |
| 3918 | fi |
| 3919 | case "\$1" in |
| 3920 | */*) |
| 3921 | echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` |
| 3922 | ;; |
| 3923 | *) |
| 3924 | echo \$dir |
| 3925 | ;; |
| 3926 | esac |
| 3927 | fi |
| 3928 | ;; |
| 3929 | *) |
| 3930 | echo \$1 |
| 3931 | ;; |
| 3932 | esac |
| 3933 | EOSS |
| 3934 | chmod +x filexp |
| 3935 | $eunicefix filexp |
| 3936 | |
| 3937 | : now set up to get a file name |
| 3938 | cat <<EOS >getfile |
| 3939 | $startsh |
| 3940 | EOS |
| 3941 | cat <<'EOSC' >>getfile |
| 3942 | tilde='' |
| 3943 | fullpath='' |
| 3944 | already='' |
| 3945 | skip='' |
| 3946 | none_ok='' |
| 3947 | exp_file='' |
| 3948 | nopath_ok='' |
| 3949 | orig_rp="$rp" |
| 3950 | orig_dflt="$dflt" |
| 3951 | case "$gfpth" in |
| 3952 | '') gfpth='.' ;; |
| 3953 | esac |
| 3954 | |
| 3955 | case "$fn" in |
| 3956 | *\(*) |
| 3957 | : getfile will accept an answer from the comma-separated list |
| 3958 | : enclosed in parentheses even if it does not meet other criteria. |
| 3959 | expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok |
| 3960 | fn=`echo $fn | sed 's/(.*)//'` |
| 3961 | ;; |
| 3962 | esac |
| 3963 | |
| 3964 | case "$fn" in |
| 3965 | *:*) |
| 3966 | loc_file=`expr $fn : '.*:\(.*\)'` |
| 3967 | fn=`expr $fn : '\(.*\):.*'` |
| 3968 | ;; |
| 3969 | esac |
| 3970 | |
| 3971 | case "$fn" in |
| 3972 | *~*) tilde=true;; |
| 3973 | esac |
| 3974 | case "$fn" in |
| 3975 | */*) fullpath=true;; |
| 3976 | esac |
| 3977 | case "$fn" in |
| 3978 | *+*) skip=true;; |
| 3979 | esac |
| 3980 | case "$fn" in |
| 3981 | *n*) none_ok=true;; |
| 3982 | esac |
| 3983 | case "$fn" in |
| 3984 | *e*) exp_file=true;; |
| 3985 | esac |
| 3986 | case "$fn" in |
| 3987 | *p*) nopath_ok=true;; |
| 3988 | esac |
| 3989 | |
| 3990 | case "$fn" in |
| 3991 | *f*) type='File';; |
| 3992 | *d*) type='Directory';; |
| 3993 | *l*) type='Locate';; |
| 3994 | esac |
| 3995 | |
| 3996 | what="$type" |
| 3997 | case "$what" in |
| 3998 | Locate) what='File';; |
| 3999 | esac |
| 4000 | |
| 4001 | case "$exp_file" in |
| 4002 | '') |
| 4003 | case "$d_portable" in |
| 4004 | "$define") ;; |
| 4005 | *) exp_file=true;; |
| 4006 | esac |
| 4007 | ;; |
| 4008 | esac |
| 4009 | |
| 4010 | cd .. |
| 4011 | while test "$type"; do |
| 4012 | redo='' |
| 4013 | rp="$orig_rp" |
| 4014 | dflt="$orig_dflt" |
| 4015 | case "$tilde" in |
| 4016 | true) rp="$rp (~name ok)";; |
| 4017 | esac |
| 4018 | . UU/myread |
| 4019 | if test -f UU/getfile.ok && \ |
| 4020 | $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 |
| 4021 | then |
| 4022 | value="$ans" |
| 4023 | ansexp="$ans" |
| 4024 | break |
| 4025 | fi |
| 4026 | case "$ans" in |
| 4027 | none) |
| 4028 | value='' |
| 4029 | ansexp='' |
| 4030 | case "$none_ok" in |
| 4031 | true) type='';; |
| 4032 | esac |
| 4033 | ;; |
| 4034 | *) |
| 4035 | case "$tilde" in |
| 4036 | '') value="$ans" |
| 4037 | ansexp="$ans";; |
| 4038 | *) |
| 4039 | value=`UU/filexp $ans` |
| 4040 | case $? in |
| 4041 | 0) |
| 4042 | if test "$ans" != "$value"; then |
| 4043 | echo "(That expands to $value on this system.)" |
| 4044 | fi |
| 4045 | ;; |
| 4046 | *) value="$ans";; |
| 4047 | esac |
| 4048 | ansexp="$value" |
| 4049 | case "$exp_file" in |
| 4050 | '') value="$ans";; |
| 4051 | esac |
| 4052 | ;; |
| 4053 | esac |
| 4054 | case "$fullpath" in |
| 4055 | true) |
| 4056 | case "$ansexp" in |
| 4057 | /*) value="$ansexp" ;; |
| 4058 | [a-zA-Z]:/*) value="$ansexp" ;; |
| 4059 | *) |
| 4060 | redo=true |
| 4061 | case "$already" in |
| 4062 | true) |
| 4063 | echo "I shall only accept a full path name, as in /bin/ls." >&4 |
| 4064 | echo "Use a ! shell escape if you wish to check pathnames." >&4 |
| 4065 | ;; |
| 4066 | *) |
| 4067 | echo "Please give a full path name, starting with slash." >&4 |
| 4068 | case "$tilde" in |
| 4069 | true) |
| 4070 | echo "Note that using ~name is ok provided it expands well." >&4 |
| 4071 | already=true |
| 4072 | ;; |
| 4073 | esac |
| 4074 | esac |
| 4075 | ;; |
| 4076 | esac |
| 4077 | ;; |
| 4078 | esac |
| 4079 | case "$redo" in |
| 4080 | '') |
| 4081 | case "$type" in |
| 4082 | File) |
| 4083 | for fp in $gfpth; do |
| 4084 | if test "X$fp" = X.; then |
| 4085 | pf="$ansexp" |
| 4086 | else |
| 4087 | pf="$fp/$ansexp" |
| 4088 | fi |
| 4089 | if test -f "$pf"; then |
| 4090 | type='' |
| 4091 | elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1 |
| 4092 | then |
| 4093 | echo "($value is not a plain file, but that's ok.)" |
| 4094 | type='' |
| 4095 | fi |
| 4096 | if test X"$type" = X; then |
| 4097 | value="$pf" |
| 4098 | break |
| 4099 | fi |
| 4100 | done |
| 4101 | ;; |
| 4102 | Directory) |
| 4103 | for fp in $gfpth; do |
| 4104 | if test "X$fp" = X.; then |
| 4105 | dir="$ans" |
| 4106 | direxp="$ansexp" |
| 4107 | else |
| 4108 | dir="$fp/$ansexp" |
| 4109 | direxp="$fp/$ansexp" |
| 4110 | fi |
| 4111 | if test -d "$direxp"; then |
| 4112 | type='' |
| 4113 | value="$dir" |
| 4114 | break |
| 4115 | fi |
| 4116 | done |
| 4117 | ;; |
| 4118 | Locate) |
| 4119 | if test -d "$ansexp"; then |
| 4120 | echo "(Looking for $loc_file in directory $value.)" |
| 4121 | value="$value/$loc_file" |
| 4122 | ansexp="$ansexp/$loc_file" |
| 4123 | fi |
| 4124 | if test -f "$ansexp"; then |
| 4125 | type='' |
| 4126 | fi |
| 4127 | case "$nopath_ok" in |
| 4128 | true) case "$value" in |
| 4129 | */*) ;; |
| 4130 | *) echo "Assuming $value will be in people's path." |
| 4131 | type='' |
| 4132 | ;; |
| 4133 | esac |
| 4134 | ;; |
| 4135 | esac |
| 4136 | ;; |
| 4137 | esac |
| 4138 | |
| 4139 | case "$skip" in |
| 4140 | true) type=''; |
| 4141 | esac |
| 4142 | |
| 4143 | case "$type" in |
| 4144 | '') ;; |
| 4145 | *) |
| 4146 | if test "$fastread" = yes; then |
| 4147 | dflt=y |
| 4148 | else |
| 4149 | dflt=n |
| 4150 | fi |
| 4151 | rp="$what $value doesn't exist. Use that name anyway?" |
| 4152 | . UU/myread |
| 4153 | dflt='' |
| 4154 | case "$ans" in |
| 4155 | y*) type='';; |
| 4156 | *) echo " ";; |
| 4157 | esac |
| 4158 | ;; |
| 4159 | esac |
| 4160 | ;; |
| 4161 | esac |
| 4162 | ;; |
| 4163 | esac |
| 4164 | done |
| 4165 | cd UU |
| 4166 | ans="$value" |
| 4167 | rp="$orig_rp" |
| 4168 | dflt="$orig_dflt" |
| 4169 | rm -f getfile.ok |
| 4170 | test "X$gfpthkeep" != Xy && gfpth="" |
| 4171 | EOSC |
| 4172 | |
| 4173 | : determine root of directory hierarchy where package will be installed. |
| 4174 | case "$prefix" in |
| 4175 | '') dflt=`./loc . /usr/local /usr/local /local /opt /usr` |
| 4176 | ;; |
| 4177 | *) dflt="$prefix" |
| 4178 | ;; |
| 4179 | esac |
| 4180 | $cat <<EOM |
| 4181 | |
| 4182 | By default, $package will be installed in $dflt/bin, manual pages |
| 4183 | under $dflt/man, etc..., i.e. with $dflt as prefix for all |
| 4184 | installation directories. Typically this is something like /usr/local. |
| 4185 | If you wish to have binaries under /usr/bin but other parts of the |
| 4186 | installation under /usr/local, that's ok: you will be prompted |
| 4187 | separately for each of the installation directories, the prefix being |
| 4188 | only used to set the defaults. |
| 4189 | |
| 4190 | EOM |
| 4191 | fn=d~ |
| 4192 | rp='Installation prefix to use?' |
| 4193 | . ./getfile |
| 4194 | oldprefix='' |
| 4195 | case "$prefix" in |
| 4196 | '') ;; |
| 4197 | *) case "$ans" in |
| 4198 | "$prefix") ;; |
| 4199 | *) oldprefix="$prefix";; |
| 4200 | esac |
| 4201 | ;; |
| 4202 | esac |
| 4203 | |
| 4204 | case "$ans" in |
| 4205 | *?/) prefix=`echo "$ans" | sed 's/.$//'` |
| 4206 | ;; |
| 4207 | *) prefix="$ans" |
| 4208 | esac |
| 4209 | |
| 4210 | case "$ansexp" in |
| 4211 | *?/) prefixexp=`echo "$ansexp" | sed 's/.$//'` |
| 4212 | ;; |
| 4213 | *) prefixexp="$ansexp" |
| 4214 | esac |
| 4215 | |
| 4216 | : allow them to override the AFS root |
| 4217 | case "$afsroot" in |
| 4218 | '') afsroot=/afs ;; |
| 4219 | *) afsroot=$afsroot ;; |
| 4220 | esac |
| 4221 | |
| 4222 | : is AFS running? |
| 4223 | echo " " |
| 4224 | case "$afs" in |
| 4225 | $define|true) afs=true ;; |
| 4226 | $undef|false) afs=false ;; |
| 4227 | *) if $test -d $afsroot; then |
| 4228 | afs=true |
| 4229 | else |
| 4230 | afs=false |
| 4231 | fi |
| 4232 | ;; |
| 4233 | esac |
| 4234 | if $afs; then |
| 4235 | echo "AFS may be running... I'll be extra cautious then..." >&4 |
| 4236 | else |
| 4237 | echo "AFS does not seem to be running..." >&4 |
| 4238 | fi |
| 4239 | |
| 4240 | : determine installation prefix for where package is to be installed. |
| 4241 | if $afs; then |
| 4242 | $cat <<EOM |
| 4243 | |
| 4244 | Since you are running AFS, I need to distinguish the directory in which |
| 4245 | files will reside from the directory in which they are installed (and from |
| 4246 | which they are presumably copied to the former directory by occult means). |
| 4247 | |
| 4248 | EOM |
| 4249 | case "$installprefix" in |
| 4250 | '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;; |
| 4251 | *) dflt="$installprefix";; |
| 4252 | esac |
| 4253 | else |
| 4254 | $cat <<EOM |
| 4255 | |
| 4256 | In some special cases, particularly when building $package for distribution, |
| 4257 | it is convenient to distinguish the directory in which files should be |
| 4258 | installed from the directory ($prefix) in which they will |
| 4259 | eventually reside. For most users, these two directories are the same. |
| 4260 | |
| 4261 | EOM |
| 4262 | case "$installprefix" in |
| 4263 | '') dflt=$prefix ;; |
| 4264 | *) dflt=$installprefix;; |
| 4265 | esac |
| 4266 | fi |
| 4267 | fn=d~ |
| 4268 | rp='What installation prefix should I use for installing files?' |
| 4269 | . ./getfile |
| 4270 | installprefix="$ans" |
| 4271 | installprefixexp="$ansexp" |
| 4272 | |
| 4273 | : Perform the prefixexp/installprefixexp correction if necessary |
| 4274 | cat <<EOS >installprefix |
| 4275 | $startsh |
| 4276 | EOS |
| 4277 | cat <<'EOSC' >>installprefix |
| 4278 | : Change installation prefix, if necessary. |
| 4279 | if $test X"$prefix" != X"$installprefix"; then |
| 4280 | eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`" |
| 4281 | else |
| 4282 | eval "install${prefixvar}=\"\$${prefixvar}exp\"" |
| 4283 | fi |
| 4284 | EOSC |
| 4285 | chmod +x installprefix |
| 4286 | $eunicefix installprefix |
| 4287 | |
| 4288 | : Set variables such as privlib and privlibexp from the output of ./getfile |
| 4289 | : performing the prefixexp/installprefixexp correction if necessary. |
| 4290 | cat <<EOS >setprefixvar |
| 4291 | $startsh |
| 4292 | EOS |
| 4293 | cat <<'EOSC' >>setprefixvar |
| 4294 | eval "${prefixvar}=\"\$ans\"" |
| 4295 | eval "${prefixvar}exp=\"\$ansexp\"" |
| 4296 | . ./installprefix |
| 4297 | EOSC |
| 4298 | chmod +x setprefixvar |
| 4299 | $eunicefix setprefixvar |
| 4300 | |
| 4301 | : set up the script used to warn in case of inconsistency |
| 4302 | cat <<EOS >whoa |
| 4303 | $startsh |
| 4304 | EOS |
| 4305 | cat <<'EOSC' >>whoa |
| 4306 | dflt=y |
| 4307 | case "$hint" in |
| 4308 | recommended) |
| 4309 | case "$hintfile" in |
| 4310 | '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4 |
| 4311 | ;; |
| 4312 | *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4 |
| 4313 | echo "the $hint value for \$$var on this machine was \"$was\"!" >&4 |
| 4314 | ;; |
| 4315 | esac |
| 4316 | ;; |
| 4317 | *) echo " " |
| 4318 | echo "*** WHOA THERE!!! ***" >&4 |
| 4319 | echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 |
| 4320 | ;; |
| 4321 | esac |
| 4322 | rp=" Keep the $hint value?" |
| 4323 | . ./myread |
| 4324 | case "$ans" in |
| 4325 | y) td=$was; tu=$was;; |
| 4326 | esac |
| 4327 | EOSC |
| 4328 | |
| 4329 | : function used to set '$1' to '$val' |
| 4330 | setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; |
| 4331 | case "$val$was" in |
| 4332 | $define$undef) . ./whoa; eval "$var=\$td";; |
| 4333 | $undef$define) . ./whoa; eval "$var=\$tu";; |
| 4334 | *) eval "$var=$val";; |
| 4335 | esac' |
| 4336 | |
| 4337 | : get the patchlevel |
| 4338 | echo " " |
| 4339 | echo "Getting the current patchlevel..." >&4 |
| 4340 | if $test -r $rsrc/patchlevel.h;then |
| 4341 | revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h` |
| 4342 | patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` |
| 4343 | subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` |
| 4344 | api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h` |
| 4345 | api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h` |
| 4346 | api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` |
| 4347 | perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'` |
| 4348 | else |
| 4349 | revision=0 |
| 4350 | patchlevel=0 |
| 4351 | subversion=0 |
| 4352 | api_revision=0 |
| 4353 | api_version=0 |
| 4354 | api_subversion=0 |
| 4355 | perl_patchlevel=0 |
| 4356 | $echo "(You do not have patchlevel.h. Eek.)" |
| 4357 | fi |
| 4358 | : Define a handy string here to avoid duplication in myconfig.SH and configpm. |
| 4359 | version_patchlevel_string="version $patchlevel subversion $subversion" |
| 4360 | case "$perl_patchlevel" in |
| 4361 | 0|'') ;; |
| 4362 | *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'` |
| 4363 | version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" |
| 4364 | ;; |
| 4365 | esac |
| 4366 | |
| 4367 | $echo "(You have $package $version_patchlevel_string.)" |
| 4368 | |
| 4369 | case "$osname" in |
| 4370 | dos|vms) |
| 4371 | : XXX Should be a Configure test for double-dots in filenames. |
| 4372 | version=`echo $revision $patchlevel $subversion | \ |
| 4373 | $awk '{ printf "%d_%d_%d", $1, $2, $3 }'` |
| 4374 | api_versionstring=`echo $api_revision $api_version $api_subversion | \ |
| 4375 | $awk '{ printf "%d_%d_%d", $1, $2, $3 }'` |
| 4376 | ;; |
| 4377 | *) |
| 4378 | version=`echo $revision $patchlevel $subversion | \ |
| 4379 | $awk '{ printf "%d.%d.%d", $1, $2, $3 }'` |
| 4380 | api_versionstring=`echo $api_revision $api_version $api_subversion | \ |
| 4381 | $awk '{ printf "%d.%d.%d", $1, $2, $3 }'` |
| 4382 | ;; |
| 4383 | esac |
| 4384 | : Special case the 5.005_xx maintenance series, which used 5.005 |
| 4385 | : without any subversion label as a subdirectory in $sitelib |
| 4386 | if test "${api_revision}${api_version}${api_subversion}" = "550"; then |
| 4387 | api_versionstring='5.005' |
| 4388 | fi |
| 4389 | |
| 4390 | : Do we want threads support and if so, what type |
| 4391 | case "$usethreads" in |
| 4392 | $define|true|[yY]*) dflt='y';; |
| 4393 | *) # Catch case where user specified ithreads or 5005threads but |
| 4394 | # forgot -Dusethreads (A.D. 4/2002) |
| 4395 | case "$useithreads$use5005threads" in |
| 4396 | *$define*) dflt='y';; |
| 4397 | *) dflt='n';; |
| 4398 | esac |
| 4399 | ;; |
| 4400 | esac |
| 4401 | cat <<EOM |
| 4402 | |
| 4403 | Perl can be built to offer a form of threading support on some systems |
| 4404 | To do so, Configure can be run with -Dusethreads. |
| 4405 | |
| 4406 | Note that Perl built with threading support runs slightly slower |
| 4407 | and uses slightly more memory than plain Perl. |
| 4408 | |
| 4409 | If this doesn't make any sense to you, just accept the default '$dflt'. |
| 4410 | EOM |
| 4411 | rp='Build a threading Perl?' |
| 4412 | . ./myread |
| 4413 | case "$ans" in |
| 4414 | y|Y) val="$define" ;; |
| 4415 | *) val="$undef" ;; |
| 4416 | esac |
| 4417 | set usethreads |
| 4418 | eval $setvar |
| 4419 | |
| 4420 | if $test $patchlevel -lt 9; then |
| 4421 | case "$usethreads" in |
| 4422 | $define) |
| 4423 | : Default to ithreads unless overridden on command line or with |
| 4424 | : old config.sh |
| 4425 | dflt='y' |
| 4426 | case "$use5005threads" in |
| 4427 | $define|true|[yY]*) |
| 4428 | echo "5.005 threads are no longer supported" |
| 4429 | exit 1 |
| 4430 | ;; |
| 4431 | esac |
| 4432 | case "$useithreads" in |
| 4433 | $undef|false|[nN]*) dflt='n';; |
| 4434 | esac |
| 4435 | rp='Use the newer interpreter-based ithreads?' |
| 4436 | . ./myread |
| 4437 | case "$ans" in |
| 4438 | y|Y) val="$define" ;; |
| 4439 | *) val="$undef" ;; |
| 4440 | esac |
| 4441 | set useithreads |
| 4442 | eval $setvar |
| 4443 | : Now set use5005threads to the opposite value. |
| 4444 | case "$useithreads" in |
| 4445 | $define) val="$undef" ;; |
| 4446 | *) val="$define" ;; |
| 4447 | esac |
| 4448 | set use5005threads |
| 4449 | eval $setvar |
| 4450 | ;; |
| 4451 | *) |
| 4452 | useithreads="$undef" |
| 4453 | use5005threads="$undef" |
| 4454 | ;; |
| 4455 | esac |
| 4456 | |
| 4457 | case "$useithreads$use5005threads" in |
| 4458 | "$define$define") |
| 4459 | $cat >&4 <<EOM |
| 4460 | |
| 4461 | You cannot have both the ithreads and the 5.005 threads enabled |
| 4462 | at the same time. Disabling the 5.005 threads since they are |
| 4463 | much less stable than the ithreads. |
| 4464 | |
| 4465 | EOM |
| 4466 | use5005threads="$undef" |
| 4467 | ;; |
| 4468 | esac |
| 4469 | |
| 4470 | else |
| 4471 | : perl-5.9.x and later |
| 4472 | |
| 4473 | if test X"$usethreads" = "X$define"; then |
| 4474 | case "$use5005threads" in |
| 4475 | $define|true|[yY]*) |
| 4476 | $cat >&4 <<EOM |
| 4477 | |
| 4478 | 5.005 threads has been removed for 5.10. Perl will be built using ithreads. |
| 4479 | |
| 4480 | EOM |
| 4481 | ;; |
| 4482 | esac |
| 4483 | fi |
| 4484 | |
| 4485 | use5005threads="$undef" |
| 4486 | useithreads="$usethreads" |
| 4487 | fi |
| 4488 | |
| 4489 | case "$d_oldpthreads" in |
| 4490 | '') : Configure tests would be welcome here. For now, assume undef. |
| 4491 | val="$undef" ;; |
| 4492 | *) val="$d_oldpthreads" ;; |
| 4493 | esac |
| 4494 | set d_oldpthreads |
| 4495 | eval $setvar |
| 4496 | |
| 4497 | |
| 4498 | : Look for a hint-file generated 'call-back-unit'. If the |
| 4499 | : user has specified that a threading perl is to be built, |
| 4500 | : we may need to set or change some other defaults. |
| 4501 | if $test -f usethreads.cbu; then |
| 4502 | echo "Your platform has some specific hints regarding threaded builds, using them..." |
| 4503 | . ./usethreads.cbu |
| 4504 | else |
| 4505 | case "$usethreads" in |
| 4506 | "$define"|true|[yY]*) |
| 4507 | $cat <<EOM |
| 4508 | (Your platform does not have any specific hints for threaded builds. |
| 4509 | Assuming POSIX threads, then.) |
| 4510 | EOM |
| 4511 | ;; |
| 4512 | esac |
| 4513 | fi |
| 4514 | |
| 4515 | : Check if multiplicity is required |
| 4516 | cat <<EOM |
| 4517 | |
| 4518 | Perl can be built so that multiple Perl interpreters can coexist |
| 4519 | within the same Perl executable. |
| 4520 | EOM |
| 4521 | |
| 4522 | case "$useithreads" in |
| 4523 | $define) |
| 4524 | cat <<EOM |
| 4525 | This multiple interpreter support is required for interpreter-based threads. |
| 4526 | EOM |
| 4527 | val="$define" |
| 4528 | ;; |
| 4529 | *) case "$usemultiplicity" in |
| 4530 | $define|true|[yY]*) dflt='y';; |
| 4531 | *) dflt='n';; |
| 4532 | esac |
| 4533 | echo " " |
| 4534 | echo "If this doesn't make any sense to you, just accept the default '$dflt'." |
| 4535 | rp='Build Perl for multiplicity?' |
| 4536 | . ./myread |
| 4537 | case "$ans" in |
| 4538 | y|Y) val="$define" ;; |
| 4539 | *) val="$undef" ;; |
| 4540 | esac |
| 4541 | ;; |
| 4542 | esac |
| 4543 | set usemultiplicity |
| 4544 | eval $setvar |
| 4545 | |
| 4546 | : Check if morebits is requested |
| 4547 | case "$usemorebits" in |
| 4548 | "$define"|true|[yY]*) |
| 4549 | use64bitint="$define" |
| 4550 | uselongdouble="$define" |
| 4551 | usemorebits="$define" |
| 4552 | ;; |
| 4553 | *) usemorebits="$undef" |
| 4554 | ;; |
| 4555 | esac |
| 4556 | |
| 4557 | : Determine the C compiler to be used |
| 4558 | echo " " |
| 4559 | case "$cc" in |
| 4560 | '') dflt=cc;; |
| 4561 | *) dflt="$cc";; |
| 4562 | esac |
| 4563 | rp="Use which C compiler?" |
| 4564 | . ./myread |
| 4565 | cc="$ans" |
| 4566 | |
| 4567 | : See whether they have no cc but they do have gcc |
| 4568 | . ./trygcc |
| 4569 | if $test -f cc.cbu; then |
| 4570 | . ./cc.cbu |
| 4571 | fi |
| 4572 | . ./checkcc |
| 4573 | |
| 4574 | : make some quick guesses about what we are up against |
| 4575 | echo " " |
| 4576 | $echo $n "Hmm... $c" |
| 4577 | echo exit 1 >bsd |
| 4578 | echo exit 1 >usg |
| 4579 | echo exit 1 >v7 |
| 4580 | echo exit 1 >osf1 |
| 4581 | echo exit 1 >eunice |
| 4582 | echo exit 1 >xenix |
| 4583 | echo exit 1 >venix |
| 4584 | echo exit 1 >os2 |
| 4585 | d_bsd="$undef" |
| 4586 | $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null |
| 4587 | if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1 |
| 4588 | then |
| 4589 | echo "Looks kind of like an OSF/1 system, but we'll see..." |
| 4590 | echo exit 0 >osf1 |
| 4591 | elif test `echo abc | $tr a-z A-Z` = Abc ; then |
| 4592 | xxx=`./loc addbib blurfl $pth` |
| 4593 | if $test -f $xxx; then |
| 4594 | echo "Looks kind of like a USG system with BSD features, but we'll see..." |
| 4595 | echo exit 0 >bsd |
| 4596 | echo exit 0 >usg |
| 4597 | else |
| 4598 | if $contains SIGTSTP foo >/dev/null 2>&1 ; then |
| 4599 | echo "Looks kind of like an extended USG system, but we'll see..." |
| 4600 | else |
| 4601 | echo "Looks kind of like a USG system, but we'll see..." |
| 4602 | fi |
| 4603 | echo exit 0 >usg |
| 4604 | fi |
| 4605 | elif $contains SIGTSTP foo >/dev/null 2>&1 ; then |
| 4606 | echo "Looks kind of like a BSD system, but we'll see..." |
| 4607 | d_bsd="$define" |
| 4608 | echo exit 0 >bsd |
| 4609 | else |
| 4610 | echo "Looks kind of like a Version 7 system, but we'll see..." |
| 4611 | echo exit 0 >v7 |
| 4612 | fi |
| 4613 | case "$eunicefix" in |
| 4614 | *unixtovms*) |
| 4615 | $cat <<'EOI' |
| 4616 | There is, however, a strange, musty smell in the air that reminds me of |
| 4617 | something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. |
| 4618 | EOI |
| 4619 | echo exit 0 >eunice |
| 4620 | d_eunice="$define" |
| 4621 | : it so happens the Eunice I know will not run shell scripts in Unix format |
| 4622 | ;; |
| 4623 | *) |
| 4624 | echo " " |
| 4625 | echo "Congratulations. You aren't running Eunice." |
| 4626 | d_eunice="$undef" |
| 4627 | ;; |
| 4628 | esac |
| 4629 | : Detect OS2. The p_ variable is set above in the Head.U unit. |
| 4630 | : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses |
| 4631 | : semicolon as a patch separator |
| 4632 | case "$p_" in |
| 4633 | :) ;; |
| 4634 | *) |
| 4635 | $cat <<'EOI' |
| 4636 | I have the feeling something is not exactly right, however...don't tell me... |
| 4637 | lemme think...does HAL ring a bell?...no, of course, you're only running OS/2! |
| 4638 | (Or you may be running DOS with DJGPP.) |
| 4639 | EOI |
| 4640 | echo exit 0 >os2 |
| 4641 | ;; |
| 4642 | esac |
| 4643 | if test -f /xenix; then |
| 4644 | echo "Actually, this looks more like a XENIX system..." |
| 4645 | echo exit 0 >xenix |
| 4646 | d_xenix="$define" |
| 4647 | else |
| 4648 | echo " " |
| 4649 | echo "It's not Xenix..." |
| 4650 | d_xenix="$undef" |
| 4651 | fi |
| 4652 | chmod +x xenix |
| 4653 | $eunicefix xenix |
| 4654 | if test -f /venix; then |
| 4655 | echo "Actually, this looks more like a VENIX system..." |
| 4656 | echo exit 0 >venix |
| 4657 | else |
| 4658 | echo " " |
| 4659 | if ./xenix; then |
| 4660 | : null |
| 4661 | else |
| 4662 | echo "Nor is it Venix..." |
| 4663 | fi |
| 4664 | fi |
| 4665 | chmod +x bsd usg v7 osf1 eunice xenix venix os2 |
| 4666 | $eunicefix bsd usg v7 osf1 eunice xenix venix os2 |
| 4667 | $rm -f foo |
| 4668 | |
| 4669 | : Check if we are using GNU gcc and what its version is |
| 4670 | echo " " |
| 4671 | echo "Checking for GNU cc in disguise and/or its version number..." >&4 |
| 4672 | $cat >try.c <<EOM |
| 4673 | #include <stdio.h> |
| 4674 | int main() { |
| 4675 | #if defined(__GNUC__) && !defined(__INTEL_COMPILER) |
| 4676 | #ifdef __VERSION__ |
| 4677 | printf("%s\n", __VERSION__); |
| 4678 | #else |
| 4679 | printf("%s\n", "1"); |
| 4680 | #endif |
| 4681 | #endif |
| 4682 | return(0); |
| 4683 | } |
| 4684 | EOM |
| 4685 | if $cc -o try $ccflags $ldflags try.c; then |
| 4686 | gccversion=`$run ./try` |
| 4687 | case "$gccversion" in |
| 4688 | '') echo "You are not using GNU cc." ;; |
| 4689 | *) echo "You are using GNU cc $gccversion." |
| 4690 | ccname=gcc |
| 4691 | ;; |
| 4692 | esac |
| 4693 | else |
| 4694 | echo " " |
| 4695 | echo "*** WHOA THERE!!! ***" >&4 |
| 4696 | echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 |
| 4697 | case "$knowitall" in |
| 4698 | '') |
| 4699 | echo " You'd better start hunting for one and let me know about it." >&4 |
| 4700 | exit 1 |
| 4701 | ;; |
| 4702 | esac |
| 4703 | fi |
| 4704 | $rm -f try try.* |
| 4705 | case "$gccversion" in |
| 4706 | 1.*) cpp=`./loc gcc-cpp $cpp $pth` ;; |
| 4707 | esac |
| 4708 | case "$gccversion" in |
| 4709 | '') gccosandvers='' ;; |
| 4710 | *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'` |
| 4711 | gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"` |
| 4712 | gccshortvers='' |
| 4713 | case "$gccosandvers" in |
| 4714 | $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr |
| 4715 | $osname$osvers) ;; # looking good |
| 4716 | $osname*) cat <<EOM >&4 |
| 4717 | |
| 4718 | *** WHOA THERE!!! *** |
| 4719 | |
| 4720 | Your gcc has not been compiled for the exact release of |
| 4721 | your operating system ($gccosandvers versus $osname$osvers). |
| 4722 | |
| 4723 | In general it is a good idea to keep gcc synchronized with |
| 4724 | the operating system because otherwise serious problems |
| 4725 | may ensue when trying to compile software, like Perl. |
| 4726 | |
| 4727 | I'm trying to be optimistic here, though, and will continue. |
| 4728 | If later during the configuration and build icky compilation |
| 4729 | problems appear (headerfile conflicts being the most common |
| 4730 | manifestation), I suggest reinstalling the gcc to match |
| 4731 | your operating system release. |
| 4732 | |
| 4733 | EOM |
| 4734 | ;; |
| 4735 | *) gccosandvers='' ;; # failed to parse, better be silent |
| 4736 | esac |
| 4737 | ;; |
| 4738 | esac |
| 4739 | case "$ccname" in |
| 4740 | '') ccname="$cc" ;; |
| 4741 | esac |
| 4742 | |
| 4743 | # gcc 3.* complain about adding -Idirectories that they already know about, |
| 4744 | # so we will take those off from locincpth. |
| 4745 | case "$gccversion" in |
| 4746 | 3.*) |
| 4747 | echo "main(){}">try.c |
| 4748 | for incdir in $locincpth; do |
| 4749 | warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \ |
| 4750 | grep '^c[cp]p*[01]: warning: changing search order '` |
| 4751 | if test "X$warn" != X; then |
| 4752 | locincpth=`echo " $locincpth " | sed "s! $incdir ! !"` |
| 4753 | fi |
| 4754 | done |
| 4755 | $rm -f try try.* |
| 4756 | esac |
| 4757 | |
| 4758 | # gcc 4.9 by default does some optimizations that break perl. |
| 4759 | # see ticket 121505. |
| 4760 | # |
| 4761 | # The -fwrapv disables those optimizations (and probably others,) so |
| 4762 | # for gcc 4.9 (and later, since the optimizations probably won't go |
| 4763 | # away), add -fwrapv unless the user requests -fno-wrapv, which |
| 4764 | # disables -fwrapv, or if the user requests -fsanitize=undefined, |
| 4765 | # which turns the overflows -fwrapv ignores into runtime errors. |
| 4766 | case "$gccversion" in |
| 4767 | 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*) |
| 4768 | case "$ccflags" in |
| 4769 | *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;; |
| 4770 | *) ccflags="$ccflags -fwrapv" ;; |
| 4771 | esac |
| 4772 | esac |
| 4773 | |
| 4774 | : What should the include directory be ? |
| 4775 | : Use sysroot if set, so findhdr looks in the right place. |
| 4776 | echo " " |
| 4777 | $echo $n "Hmm... $c" |
| 4778 | dflt="$sysroot/usr/include" |
| 4779 | incpath='' |
| 4780 | mips_type='' |
| 4781 | if $test -f /bin/mips && /bin/mips; then |
| 4782 | echo "Looks like a MIPS system..." |
| 4783 | $cat >usr.c <<'EOCP' |
| 4784 | #ifdef SYSTYPE_BSD43 |
| 4785 | /bsd43 |
| 4786 | #endif |
| 4787 | EOCP |
| 4788 | if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then |
| 4789 | dflt='/bsd43/usr/include' |
| 4790 | incpath='/bsd43' |
| 4791 | mips_type='BSD 4.3' |
| 4792 | else |
| 4793 | mips_type='System V' |
| 4794 | fi |
| 4795 | $rm -f usr.c usr.out |
| 4796 | echo "and you're compiling with the $mips_type compiler and libraries." |
| 4797 | xxx_prompt=y |
| 4798 | echo "exit 0" >mips |
| 4799 | else |
| 4800 | echo "Doesn't look like a MIPS system." |
| 4801 | xxx_prompt=n |
| 4802 | echo "exit 1" >mips |
| 4803 | fi |
| 4804 | chmod +x mips |
| 4805 | $eunicefix mips |
| 4806 | case "$usrinc" in |
| 4807 | '') ;; |
| 4808 | *) dflt="$usrinc";; |
| 4809 | esac |
| 4810 | case "$xxx_prompt" in |
| 4811 | y) fn=d/ |
| 4812 | echo " " |
| 4813 | rp='Where are the include files you want to use?' |
| 4814 | . ./getfile |
| 4815 | usrinc="$ans" |
| 4816 | ;; |
| 4817 | *) usrinc="$dflt" |
| 4818 | ;; |
| 4819 | esac |
| 4820 | |
| 4821 | : see how we invoke the C preprocessor |
| 4822 | echo " " |
| 4823 | echo "Now, how can we feed standard input to your C preprocessor..." >&4 |
| 4824 | cat <<'EOT' >testcpp.c |
| 4825 | #define ABC abc |
| 4826 | #define XYZ xyz |
| 4827 | ABC.XYZ |
| 4828 | EOT |
| 4829 | cd .. |
| 4830 | if test ! -f cppstdin; then |
| 4831 | if test "X$osname" = "Xaix" -a "X$gccversion" = X; then |
| 4832 | # AIX cc -E doesn't show the absolute headerfile |
| 4833 | # locations but we'll cheat by using the -M flag. |
| 4834 | echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin |
| 4835 | else |
| 4836 | echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin |
| 4837 | fi |
| 4838 | else |
| 4839 | echo "Keeping your $hint cppstdin wrapper." |
| 4840 | fi |
| 4841 | chmod 755 cppstdin |
| 4842 | wrapper=`pwd`/cppstdin |
| 4843 | ok='false' |
| 4844 | cd UU |
| 4845 | |
| 4846 | if $test "X$cppstdin" != "X" && \ |
| 4847 | $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \ |
| 4848 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 |
| 4849 | then |
| 4850 | echo "You used to use $cppstdin $cppminus so we'll use that again." |
| 4851 | case "$cpprun" in |
| 4852 | '') echo "But let's see if we can live without a wrapper..." ;; |
| 4853 | *) |
| 4854 | if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \ |
| 4855 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 |
| 4856 | then |
| 4857 | echo "(And we'll use $cpprun $cpplast to preprocess directly.)" |
| 4858 | ok='true' |
| 4859 | else |
| 4860 | echo "(However, $cpprun $cpplast does not work, let's see...)" |
| 4861 | fi |
| 4862 | ;; |
| 4863 | esac |
| 4864 | else |
| 4865 | case "$cppstdin" in |
| 4866 | '') ;; |
| 4867 | *) |
| 4868 | echo "Good old $cppstdin $cppminus does not seem to be of any help..." |
| 4869 | ;; |
| 4870 | esac |
| 4871 | fi |
| 4872 | |
| 4873 | if $ok; then |
| 4874 | : nothing |
| 4875 | elif echo 'Maybe "'"$cc"' -E" will work...'; \ |
| 4876 | $cc -E <testcpp.c >testcpp.out 2>&1; \ |
| 4877 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
| 4878 | echo "Yup, it does." |
| 4879 | x_cpp="$cc $cppflags -E" |
| 4880 | x_minus=''; |
| 4881 | elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ |
| 4882 | $cc -E - <testcpp.c >testcpp.out 2>&1; \ |
| 4883 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
| 4884 | echo "Yup, it does." |
| 4885 | x_cpp="$cc $cppflags -E" |
| 4886 | x_minus='-'; |
| 4887 | elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ |
| 4888 | $cc -P <testcpp.c >testcpp.out 2>&1; \ |
| 4889 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
| 4890 | echo "Yipee, that works!" |
| 4891 | x_cpp="$cc $cppflags -P" |
| 4892 | x_minus=''; |
| 4893 | elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ |
| 4894 | $cc -P - <testcpp.c >testcpp.out 2>&1; \ |
| 4895 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
| 4896 | echo "At long last!" |
| 4897 | x_cpp="$cc $cppflags -P" |
| 4898 | x_minus='-'; |
| 4899 | elif echo 'No such luck, maybe "'$cpp'" will work...'; \ |
| 4900 | $cpp <testcpp.c >testcpp.out 2>&1; \ |
| 4901 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
| 4902 | echo "It works!" |
| 4903 | x_cpp="$cpp $cppflags" |
| 4904 | x_minus=''; |
| 4905 | elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ |
| 4906 | $cpp - <testcpp.c >testcpp.out 2>&1; \ |
| 4907 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
| 4908 | echo "Hooray, it works! I was beginning to wonder." |
| 4909 | x_cpp="$cpp $cppflags" |
| 4910 | x_minus='-'; |
| 4911 | elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ |
| 4912 | $wrapper <testcpp.c >testcpp.out 2>&1; \ |
| 4913 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
| 4914 | x_cpp="$wrapper" |
| 4915 | x_minus='' |
| 4916 | echo "Eureka!" |
| 4917 | else |
| 4918 | dflt='' |
| 4919 | rp="No dice. I can't find a C preprocessor. Name one:" |
| 4920 | . ./myread |
| 4921 | x_cpp="$ans" |
| 4922 | x_minus='' |
| 4923 | $x_cpp <testcpp.c >testcpp.out 2>&1 |
| 4924 | if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
| 4925 | echo "OK, that will do." >&4 |
| 4926 | else |
| 4927 | echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 |
| 4928 | exit 1 |
| 4929 | fi |
| 4930 | fi |
| 4931 | |
| 4932 | case "$ok" in |
| 4933 | false) |
| 4934 | cppstdin="$x_cpp" |
| 4935 | cppminus="$x_minus" |
| 4936 | cpprun="$x_cpp" |
| 4937 | cpplast="$x_minus" |
| 4938 | set X $x_cpp |
| 4939 | shift |
| 4940 | case "$1" in |
| 4941 | "$cpp") |
| 4942 | echo "Perhaps can we force $cc -E using a wrapper..." |
| 4943 | if $wrapper <testcpp.c >testcpp.out 2>&1; \ |
| 4944 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 |
| 4945 | then |
| 4946 | echo "Yup, we can." |
| 4947 | cppstdin="$wrapper" |
| 4948 | cppminus=''; |
| 4949 | else |
| 4950 | echo "Nope, we'll have to live without it..." |
| 4951 | fi |
| 4952 | ;; |
| 4953 | esac |
| 4954 | case "$cpprun" in |
| 4955 | "$wrapper") |
| 4956 | cpprun='' |
| 4957 | cpplast='' |
| 4958 | ;; |
| 4959 | esac |
| 4960 | ;; |
| 4961 | esac |
| 4962 | |
| 4963 | case "$cppstdin" in |
| 4964 | "$wrapper"|'cppstdin') ;; |
| 4965 | *) $rm -f $wrapper;; |
| 4966 | esac |
| 4967 | $rm -f testcpp.c testcpp.out |
| 4968 | |
| 4969 | : Adjust cppfilter for path component separator |
| 4970 | case "$osname" in |
| 4971 | vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is > |
| 4972 | os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \ |
| 4973 | *) cppfilter='' ;; |
| 4974 | esac |
| 4975 | |
| 4976 | : Use gcc to determine libpth and incpth |
| 4977 | # If using gcc or clang, we can get better values for libpth, incpth |
| 4978 | # and usrinc directly from the compiler. |
| 4979 | # Note that ccname for clang is also gcc. |
| 4980 | case "$ccname" in |
| 4981 | gcc) |
| 4982 | $echo 'extern int foo;' > try.c |
| 4983 | set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'` |
| 4984 | shift |
| 4985 | if $test $# -gt 0; then |
| 4986 | incpth="$incpth $*" |
| 4987 | incpth="`$echo $incpth|$sed 's/^ //'`" |
| 4988 | for i in $*; do |
| 4989 | j="`$echo $i|$sed 's,/include$,/lib,'`" |
| 4990 | if $test -d $j; then |
| 4991 | libpth="$libpth $j" |
| 4992 | fi |
| 4993 | done |
| 4994 | libpth="`$echo $libpth|$sed 's/^ //'`" |
| 4995 | for xxx in $libpth $loclibpth $plibpth $glibpth; do |
| 4996 | if $test -d $xxx; then |
| 4997 | case " $libpth " in |
| 4998 | *" $xxx "*) ;; |
| 4999 | *) libpth="$libpth $xxx";; |
| 5000 | esac |
| 5001 | fi |
| 5002 | done |
| 5003 | fi |
| 5004 | $rm -f try.c |
| 5005 | case "$usrinc" in |
| 5006 | '') for i in $incpth; do |
| 5007 | if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then |
| 5008 | usrinc="$i" |
| 5009 | break |
| 5010 | fi |
| 5011 | done |
| 5012 | ;; |
| 5013 | esac |
| 5014 | |
| 5015 | case "$usecrosscompile" in |
| 5016 | $define|true|[yY]*) |
| 5017 | case "$incpth" in |
| 5018 | '') echo "Incpth not defined." >&4; croak=y ;; |
| 5019 | *) echo "Using incpth '$incpth'." >&4 ;; |
| 5020 | esac |
| 5021 | case "$libpth" in |
| 5022 | '') echo "Libpth not defined." >&4; croak=y ;; |
| 5023 | *) echo "Using libpth '$libpth'." >&4 ;; |
| 5024 | esac |
| 5025 | case "$usrinc" in |
| 5026 | '') echo "Usrinc not defined." >&4; croak=y ;; |
| 5027 | *) echo "Using usrinc $usrinc." >&4 ;; |
| 5028 | esac |
| 5029 | case "$croak" in |
| 5030 | y) |
| 5031 | if test "X$sysroot" = X; then |
| 5032 | echo "Cannot continue, aborting." >&4; exit 1 |
| 5033 | else |
| 5034 | echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4 |
| 5035 | fi |
| 5036 | ;; |
| 5037 | esac |
| 5038 | ;; |
| 5039 | esac |
| 5040 | ;; |
| 5041 | esac |
| 5042 | |
| 5043 | : Default value for incpth is just usrinc |
| 5044 | case "$incpth" in |
| 5045 | '') incpth="$usrinc";; |
| 5046 | esac |
| 5047 | |
| 5048 | : Set private lib path |
| 5049 | case "$plibpth" in |
| 5050 | '') if ./mips; then |
| 5051 | plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib" |
| 5052 | fi;; |
| 5053 | esac |
| 5054 | case "$libpth" in |
| 5055 | ' ') dlist='';; |
| 5056 | '') dlist="$loclibpth $plibpth $glibpth";; |
| 5057 | *) dlist="$libpth";; |
| 5058 | esac |
| 5059 | |
| 5060 | : Now check and see which directories actually exist, avoiding duplicates |
| 5061 | for xxx in $dlist |
| 5062 | do |
| 5063 | if $test -d $xxx; then |
| 5064 | case " $libpth " in |
| 5065 | *" $xxx "*) ;; |
| 5066 | *) libpth="$libpth $xxx";; |
| 5067 | esac |
| 5068 | fi |
| 5069 | done |
| 5070 | $cat <<'EOM' |
| 5071 | |
| 5072 | Some systems have incompatible or broken versions of libraries. Among |
| 5073 | the directories listed in the question below, please remove any you |
| 5074 | know not to be holding relevant libraries, and add any that are needed. |
| 5075 | Say "none" for none. |
| 5076 | |
| 5077 | EOM |
| 5078 | |
| 5079 | if test "X$sysroot" != X; then |
| 5080 | $cat <<EOM |
| 5081 | You have set sysroot to $sysroot, please supply the directories excluding sysroot |
| 5082 | |
| 5083 | EOM |
| 5084 | fi |
| 5085 | |
| 5086 | case "$libpth" in |
| 5087 | '') dflt='none';; |
| 5088 | *) |
| 5089 | set X $libpth |
| 5090 | shift |
| 5091 | dflt=${1+"$@"} |
| 5092 | ;; |
| 5093 | esac |
| 5094 | rp="Directories to use for library searches?" |
| 5095 | . ./myread |
| 5096 | case "$ans" in |
| 5097 | none) libpth=' ';; |
| 5098 | *) libpth="$ans";; |
| 5099 | esac |
| 5100 | |
| 5101 | : compute shared library extension |
| 5102 | case "$so" in |
| 5103 | '') |
| 5104 | if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then |
| 5105 | dflt='sl' |
| 5106 | else |
| 5107 | dflt='so' |
| 5108 | fi |
| 5109 | ;; |
| 5110 | *) dflt="$so";; |
| 5111 | esac |
| 5112 | $cat <<EOM |
| 5113 | |
| 5114 | On some systems, shared libraries may be available. Answer 'none' if |
| 5115 | you want to suppress searching of shared libraries for the remainder |
| 5116 | of this configuration. |
| 5117 | |
| 5118 | EOM |
| 5119 | rp='What is the file extension used for shared libraries?' |
| 5120 | . ./myread |
| 5121 | so="$ans" |
| 5122 | |
| 5123 | : Does target system insist that shared library basenames are unique |
| 5124 | $cat << EOM |
| 5125 | |
| 5126 | Some dynamic loaders assume that the *basename* of shared library filenames |
| 5127 | are globally unique. We'll default this to undef as we assume your system |
| 5128 | is not this weird. Set to defined if you're on one of them. |
| 5129 | |
| 5130 | EOM |
| 5131 | |
| 5132 | dflt='n' |
| 5133 | rp='Make shared library basenames unique?' |
| 5134 | . ./myread |
| 5135 | case "$ans" in |
| 5136 | y|Y) val="$define" ;; |
| 5137 | *) val="$undef" ;; |
| 5138 | esac |
| 5139 | set d_libname_unique |
| 5140 | eval $setvar |
| 5141 | |
| 5142 | : Define several unixisms. |
| 5143 | : Hints files or command line option can be used to override them. |
| 5144 | : The convoluted testing is in case hints files set either the old |
| 5145 | : or the new name. |
| 5146 | case "$_exe" in |
| 5147 | '') case "$exe_ext" in |
| 5148 | '') ;; |
| 5149 | *) _exe="$exe_ext" ;; |
| 5150 | esac |
| 5151 | ;; |
| 5152 | esac |
| 5153 | case "$_a" in |
| 5154 | '') case "$lib_ext" in |
| 5155 | '') _a='.a';; |
| 5156 | *) _a="$lib_ext" ;; |
| 5157 | esac |
| 5158 | ;; |
| 5159 | esac |
| 5160 | case "$_o" in |
| 5161 | '') case "$obj_ext" in |
| 5162 | '') _o='.o';; |
| 5163 | *) _o="$obj_ext";; |
| 5164 | esac |
| 5165 | ;; |
| 5166 | esac |
| 5167 | case "$p_" in |
| 5168 | '') case "$path_sep" in |
| 5169 | '') p_=':';; |
| 5170 | *) p_="$path_sep";; |
| 5171 | esac |
| 5172 | ;; |
| 5173 | esac |
| 5174 | exe_ext=$_exe |
| 5175 | lib_ext=$_a |
| 5176 | obj_ext=$_o |
| 5177 | path_sep=$p_ |
| 5178 | |
| 5179 | rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*" |
| 5180 | |
| 5181 | : Which makefile gets called first. This is used by make depend. |
| 5182 | case "$firstmakefile" in |
| 5183 | '') firstmakefile='makefile';; |
| 5184 | esac |
| 5185 | |
| 5186 | : Check is we will use socks |
| 5187 | case "$usesocks" in |
| 5188 | $define|true|[yY]*) dflt='y';; |
| 5189 | *) dflt='n';; |
| 5190 | esac |
| 5191 | cat <<EOM |
| 5192 | |
| 5193 | Perl can be built to use the SOCKS proxy protocol library. To do so, |
| 5194 | Configure must be run with -Dusesocks. If you use SOCKS you also need |
| 5195 | to use the PerlIO abstraction layer, this will be implicitly selected. |
| 5196 | |
| 5197 | If this doesn't make any sense to you, just accept the default '$dflt'. |
| 5198 | EOM |
| 5199 | rp='Build Perl for SOCKS?' |
| 5200 | . ./myread |
| 5201 | case "$ans" in |
| 5202 | y|Y) val="$define" ;; |
| 5203 | *) val="$undef" ;; |
| 5204 | esac |
| 5205 | set usesocks |
| 5206 | eval $setvar |
| 5207 | |
| 5208 | : Check for uselongdouble support |
| 5209 | case "$ccflags" in |
| 5210 | *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;; |
| 5211 | esac |
| 5212 | |
| 5213 | case "$uselongdouble" in |
| 5214 | $define|true|[yY]*) dflt='y';; |
| 5215 | *) dflt='n';; |
| 5216 | esac |
| 5217 | cat <<EOM |
| 5218 | |
| 5219 | Perl can be built to take advantage of long doubles which |
| 5220 | (if available) may give more accuracy and range for floating point numbers. |
| 5221 | |
| 5222 | If this doesn't make any sense to you, just accept the default '$dflt'. |
| 5223 | EOM |
| 5224 | rp='Try to use long doubles if available?' |
| 5225 | . ./myread |
| 5226 | case "$ans" in |
| 5227 | y|Y) val="$define" ;; |
| 5228 | *) val="$undef" ;; |
| 5229 | esac |
| 5230 | set uselongdouble |
| 5231 | eval $setvar |
| 5232 | |
| 5233 | case "$uselongdouble" in |
| 5234 | true|[yY]*) uselongdouble="$define" ;; |
| 5235 | esac |
| 5236 | |
| 5237 | : Look for a hint-file generated 'call-back-unit'. If the |
| 5238 | : user has specified that long doubles should be used, |
| 5239 | : we may need to set or change some other defaults. |
| 5240 | if $test -f uselongdouble.cbu; then |
| 5241 | echo "Your platform has some specific hints regarding long doubles, using them..." |
| 5242 | . ./uselongdouble.cbu |
| 5243 | else |
| 5244 | case "$uselongdouble" in |
| 5245 | $define) |
| 5246 | $cat <<EOM |
| 5247 | (Your platform does not have any specific hints for long doubles.) |
| 5248 | EOM |
| 5249 | ;; |
| 5250 | esac |
| 5251 | fi |
| 5252 | |
| 5253 | : Check if quadmath is requested |
| 5254 | case "$usequadmath" in |
| 5255 | "$define"|true|[yY]*) usequadmath="$define" ;; |
| 5256 | *) usequadmath="$undef" ;; |
| 5257 | esac |
| 5258 | |
| 5259 | : Fail if both uselongdouble and usequadmath are requested |
| 5260 | case "$usequadmath:$uselongdouble" in |
| 5261 | define:define) |
| 5262 | $cat <<EOM >&4 |
| 5263 | |
| 5264 | *** You requested the use of the quadmath library and use |
| 5265 | *** of long doubles. |
| 5266 | *** |
| 5267 | *** Please select one or the other. |
| 5268 | EOM |
| 5269 | exit 1 |
| 5270 | ;; |
| 5271 | esac |
| 5272 | |
| 5273 | : Looking for optional libraries |
| 5274 | echo " " |
| 5275 | echo "Checking for optional libraries..." >&4 |
| 5276 | case "$libs" in |
| 5277 | ' '|'') dflt='';; |
| 5278 | *) dflt="$libs";; |
| 5279 | esac |
| 5280 | case "$libswanted" in |
| 5281 | '') libswanted='c_s';; |
| 5282 | esac |
| 5283 | case "$usesocks" in |
| 5284 | "$define") libswanted="$libswanted socks5 socks5_sh" ;; |
| 5285 | esac |
| 5286 | case "$usecbacktrace" in |
| 5287 | "$define") libswanted="$libswanted bfd" ;; |
| 5288 | esac |
| 5289 | case "$usequadmath" in |
| 5290 | "$define") libswanted="$libswanted quadmath" ;; |
| 5291 | esac |
| 5292 | libsfound='' |
| 5293 | libsfiles='' |
| 5294 | libsdirs='' |
| 5295 | libspath='' |
| 5296 | for thisdir in $libpth $xlibpth; do |
| 5297 | test -d $thisdir && libspath="$libspath $thisdir" |
| 5298 | done |
| 5299 | for thislib in $libswanted; do |
| 5300 | for thisdir in $libspath; do |
| 5301 | xxx='' |
| 5302 | if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then |
| 5303 | xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'` |
| 5304 | $test -f "$xxx" && eval $libscheck |
| 5305 | $test -f "$xxx" && libstyle=shared |
| 5306 | xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'` |
| 5307 | $test -f "$xxx" && eval $libscheck |
| 5308 | $test -f "$xxx" && libstyle=shared |
| 5309 | fi |
| 5310 | if test ! -f "$xxx"; then |
| 5311 | xxx=$thisdir/lib$thislib.$so |
| 5312 | $test -f "$xxx" && eval $libscheck |
| 5313 | $test -f "$xxx" && libstyle=shared |
| 5314 | fi |
| 5315 | if test ! -f "$xxx"; then |
| 5316 | xxx=$thisdir/lib$thislib$_a |
| 5317 | $test -f "$xxx" && eval $libscheck |
| 5318 | $test -f "$xxx" && libstyle=static |
| 5319 | fi |
| 5320 | if test ! -f "$xxx"; then |
| 5321 | xxx=$thisdir/$thislib$_a |
| 5322 | $test -f "$xxx" && eval $libscheck |
| 5323 | $test -f "$xxx" && libstyle=static |
| 5324 | fi |
| 5325 | if test ! -f "$xxx"; then |
| 5326 | xxx=$thisdir/lib${thislib}_s$_a |
| 5327 | $test -f "$xxx" && eval $libscheck |
| 5328 | $test -f "$xxx" && libstyle=static |
| 5329 | $test -f "$xxx" && thislib=${thislib}_s |
| 5330 | fi |
| 5331 | if test ! -f "$xxx"; then |
| 5332 | xxx=$thisdir/Slib$thislib$_a |
| 5333 | $test -f "$xxx" && eval $libscheck |
| 5334 | $test -f "$xxx" && libstyle=static |
| 5335 | fi |
| 5336 | if $test -f "$xxx"; then |
| 5337 | case "$libstyle" in |
| 5338 | shared) echo "Found -l$thislib (shared)." ;; |
| 5339 | static) echo "Found -l$thislib." ;; |
| 5340 | *) echo "Found -l$thislib ($libstyle)." ;; |
| 5341 | esac |
| 5342 | case " $dflt " in |
| 5343 | *"-l$thislib "*);; |
| 5344 | *) dflt="$dflt -l$thislib" |
| 5345 | libsfound="$libsfound $xxx" |
| 5346 | yyy=`basename $xxx` |
| 5347 | libsfiles="$libsfiles $yyy" |
| 5348 | yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"` |
| 5349 | case " $libsdirs " in |
| 5350 | *" $yyy "*) ;; |
| 5351 | *) libsdirs="$libsdirs $yyy" ;; |
| 5352 | esac |
| 5353 | ;; |
| 5354 | esac |
| 5355 | break |
| 5356 | fi |
| 5357 | done |
| 5358 | if $test ! -f "$xxx"; then |
| 5359 | echo "No -l$thislib." |
| 5360 | fi |
| 5361 | done |
| 5362 | set X $dflt |
| 5363 | shift |
| 5364 | dflt="$*" |
| 5365 | case "$libs" in |
| 5366 | '') dflt="$dflt";; |
| 5367 | *) dflt="$libs";; |
| 5368 | esac |
| 5369 | case "$dflt" in |
| 5370 | ' '|'') dflt='none';; |
| 5371 | esac |
| 5372 | |
| 5373 | $cat <<EOM |
| 5374 | |
| 5375 | In order to compile $package on your machine, a number of libraries |
| 5376 | are usually needed. Include any other special libraries here as well. |
| 5377 | Say "none" for none. The default list is almost always right. |
| 5378 | EOM |
| 5379 | |
| 5380 | echo " " |
| 5381 | rp="What libraries to use?" |
| 5382 | . ./myread |
| 5383 | case "$ans" in |
| 5384 | none) libs=' ';; |
| 5385 | *) libs="$ans";; |
| 5386 | esac |
| 5387 | |
| 5388 | : determine optimization, if desired, or use for debug flag also |
| 5389 | case "$optimize" in |
| 5390 | ' '|$undef) dflt='none';; |
| 5391 | '') dflt='-O';; |
| 5392 | *) dflt="$optimize";; |
| 5393 | esac |
| 5394 | $cat <<EOH |
| 5395 | |
| 5396 | By default, $package compiles with the -O flag to use the optimizer. |
| 5397 | Alternately, you might want to use the symbolic debugger, which uses |
| 5398 | the -g flag (on traditional Unix systems). Either flag can be |
| 5399 | specified here. To use neither flag, specify the word "none". |
| 5400 | |
| 5401 | EOH |
| 5402 | rp="What optimizer/debugger flag should be used?" |
| 5403 | . ./myread |
| 5404 | optimize="$ans" |
| 5405 | case "$optimize" in |
| 5406 | 'none') optimize=" ";; |
| 5407 | esac |
| 5408 | |
| 5409 | : Check what DEBUGGING is required from the command line |
| 5410 | : -DEBUGGING or -DDEBUGGING or |
| 5411 | : -DEBUGGING=both = -g + -DDEBUGGING |
| 5412 | : -DEBUGGING=-g or -Doptimize=-g = -g |
| 5413 | : -DEBUGGING=none or -UDEBUGGING = |
| 5414 | : -DEBUGGING=old or -DEBUGGING=default = ? $optimize |
| 5415 | case "$EBUGGING" in |
| 5416 | '') ;; |
| 5417 | *) DEBUGGING=$EBUGGING ;; |
| 5418 | esac |
| 5419 | |
| 5420 | case "$DEBUGGING" in |
| 5421 | -g|both|$define) |
| 5422 | case "$optimize" in |
| 5423 | *-g*) ;; |
| 5424 | *) optimize="$optimize -g" ;; |
| 5425 | esac ;; |
| 5426 | none|$undef) |
| 5427 | case "$optimize" in |
| 5428 | *-g*) set `echo "X $optimize " | sed 's/ -g / /'` |
| 5429 | shift |
| 5430 | optimize="$*" |
| 5431 | ;; |
| 5432 | esac ;; |
| 5433 | esac |
| 5434 | |
| 5435 | dflt='' |
| 5436 | case "$DEBUGGING" in |
| 5437 | both|$define) dflt='-DDEBUGGING' |
| 5438 | esac |
| 5439 | |
| 5440 | : argument order is deliberate, as the flag will start with - which set could |
| 5441 | : think is an option |
| 5442 | checkccflag='check=$1; flag=$2; callback=$3; |
| 5443 | echo " "; |
| 5444 | echo "Checking if your compiler accepts $flag" 2>&1; |
| 5445 | [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot"; |
| 5446 | echo "int main(void) { return 0; }" > gcctest.c; |
| 5447 | if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then |
| 5448 | echo "Yes, it does." 2>&1; |
| 5449 | if $test -s gcctest.out ; then |
| 5450 | echo "But your platform does not like it:"; |
| 5451 | cat gcctest.out; |
| 5452 | else |
| 5453 | case "$ccflags" in |
| 5454 | *$check*) |
| 5455 | echo "Leaving current flags $ccflags alone." 2>&1 |
| 5456 | ;; |
| 5457 | *) dflt="$dflt $flag"; |
| 5458 | eval $callback |
| 5459 | ;; |
| 5460 | esac |
| 5461 | fi |
| 5462 | else |
| 5463 | echo "Nope, it does not, but that is ok." 2>&1; |
| 5464 | fi |
| 5465 | ' |
| 5466 | |
| 5467 | : We will not override a previous value, but we might want to |
| 5468 | : augment a hint file |
| 5469 | case "$hint" in |
| 5470 | default|recommended) |
| 5471 | case "$gccversion" in |
| 5472 | 1.*) dflt="$dflt -fpcc-struct-return" ;; |
| 5473 | esac |
| 5474 | case "$optimize:$DEBUGGING" in |
| 5475 | *-g*:old) dflt="$dflt -DDEBUGGING";; |
| 5476 | esac |
| 5477 | case "$gccversion" in |
| 5478 | 2.*) if $test -d /etc/conf/kconfig.d && |
| 5479 | $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 |
| 5480 | then |
| 5481 | # Interactive Systems (ISC) POSIX mode. |
| 5482 | dflt="$dflt -posix" |
| 5483 | fi |
| 5484 | ;; |
| 5485 | esac |
| 5486 | case "$gccversion" in |
| 5487 | 1.*) ;; |
| 5488 | 2.[0-8]*) ;; |
| 5489 | ?*) set strict-aliasing -fno-strict-aliasing |
| 5490 | eval $checkccflag |
| 5491 | ;; |
| 5492 | esac |
| 5493 | # For gcc, adding -pipe speeds up compilations for some, but apparently |
| 5494 | # some assemblers can't read from stdin. (It also slows down compilations |
| 5495 | # in other cases, but those are apparently rarer these days.) AD 5/2004. |
| 5496 | case "$gccversion" in |
| 5497 | ?*) set pipe -pipe |
| 5498 | eval $checkccflag |
| 5499 | ;; |
| 5500 | esac |
| 5501 | |
| 5502 | # on x86_64 (at least) we require an extra library (libssp) in the |
| 5503 | # link command line. This library is not named, so I infer that it is |
| 5504 | # an implementation detail that may change. Hence the safest approach |
| 5505 | # is to add the flag to the flags passed to the compiler at link time, |
| 5506 | # as that way the compiler can do the right implementation dependant |
| 5507 | # thing. (NWC) |
| 5508 | case "$osname" in |
| 5509 | amigaos) ;; # -fstack-protector builds but doesn't work |
| 5510 | *) case "$gccversion" in |
| 5511 | ?*) set stack-protector-strong -fstack-protector-strong |
| 5512 | eval $checkccflag |
| 5513 | case "$dflt" in |
| 5514 | *-fstack-protector-strong*) ;; # It got added. |
| 5515 | *) # Try the plain/older -fstack-protector. |
| 5516 | set stack-protector -fstack-protector |
| 5517 | eval $checkccflag |
| 5518 | ;; |
| 5519 | esac |
| 5520 | ;; |
| 5521 | esac |
| 5522 | ;; |
| 5523 | esac |
| 5524 | ;; |
| 5525 | esac |
| 5526 | |
| 5527 | case "$mips_type" in |
| 5528 | *BSD*|'') inclwanted="$locincpth $usrinc";; |
| 5529 | *) inclwanted="$locincpth $inclwanted $usrinc/bsd";; |
| 5530 | esac |
| 5531 | for thisincl in $inclwanted; do |
| 5532 | if $test -d $thisincl; then |
| 5533 | if $test x$thisincl != x$usrinc; then |
| 5534 | case "$dflt" in |
| 5535 | *" -I$thisincl "*);; |
| 5536 | *) dflt="$dflt -I$thisincl ";; |
| 5537 | esac |
| 5538 | fi |
| 5539 | fi |
| 5540 | done |
| 5541 | |
| 5542 | inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then |
| 5543 | xxx=true; |
| 5544 | elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then |
| 5545 | xxx=true; |
| 5546 | else |
| 5547 | xxx=false; |
| 5548 | fi; |
| 5549 | if $xxx; then |
| 5550 | case "$dflt" in |
| 5551 | *$2*);; |
| 5552 | *) dflt="$dflt -D$2";; |
| 5553 | esac; |
| 5554 | fi' |
| 5555 | |
| 5556 | set signal.h LANGUAGE_C; eval $inctest |
| 5557 | |
| 5558 | case "$usesocks" in |
| 5559 | $define) |
| 5560 | ccflags="$ccflags -DSOCKS" |
| 5561 | ;; |
| 5562 | esac |
| 5563 | |
| 5564 | case "$hint" in |
| 5565 | default|recommended) dflt="$ccflags $dflt" ;; |
| 5566 | *) dflt="$ccflags";; |
| 5567 | esac |
| 5568 | |
| 5569 | case "$dflt" in |
| 5570 | ''|' ') dflt=none;; |
| 5571 | esac |
| 5572 | |
| 5573 | $cat <<EOH |
| 5574 | |
| 5575 | Your C compiler may want other flags. For this question you should include |
| 5576 | -I/whatever and -DWHATEVER flags and any other flags used by the C compiler, |
| 5577 | but you should NOT include libraries or ld flags like -lwhatever. If you |
| 5578 | want $package to honor its debug switch, you should include -DDEBUGGING here. |
| 5579 | Your C compiler might also need additional flags, such as -D_POSIX_SOURCE. |
| 5580 | |
| 5581 | To use no flags, specify the word "none". |
| 5582 | |
| 5583 | EOH |
| 5584 | set X $dflt |
| 5585 | shift |
| 5586 | dflt=${1+"$@"} |
| 5587 | rp="Any additional cc flags?" |
| 5588 | . ./myread |
| 5589 | case "$ans" in |
| 5590 | none) ccflags='';; |
| 5591 | *) ccflags="$ans";; |
| 5592 | esac |
| 5593 | |
| 5594 | : the following weeds options from ccflags that are of no interest to cpp |
| 5595 | case "$cppflags" in |
| 5596 | '') cppflags="$ccflags" ;; |
| 5597 | *) set X $ccflags; shift |
| 5598 | case " $cppflags " in |
| 5599 | *" $1 "*) ;; # Try to avoid doubling the cppflags. |
| 5600 | *) cppflags="$cppflags $ccflags" ;; |
| 5601 | esac |
| 5602 | ;; |
| 5603 | esac |
| 5604 | case "$gccversion" in |
| 5605 | 1.*) cppflags="$cppflags -D__GNUC__" |
| 5606 | esac |
| 5607 | case "$mips_type" in |
| 5608 | '');; |
| 5609 | *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";; |
| 5610 | esac |
| 5611 | case "$cppflags" in |
| 5612 | '');; |
| 5613 | *) |
| 5614 | echo " " |
| 5615 | echo "Let me guess what the preprocessor flags are..." >&4 |
| 5616 | set X $cppflags |
| 5617 | shift |
| 5618 | cppflags='' |
| 5619 | $cat >cpp.c <<'EOM' |
| 5620 | #define BLURFL foo |
| 5621 | |
| 5622 | BLURFL xx LFRULB |
| 5623 | EOM |
| 5624 | previous='' |
| 5625 | for flag in $* |
| 5626 | do |
| 5627 | case "$flag" in |
| 5628 | -*) ftry="$flag";; |
| 5629 | *) ftry="$previous $flag";; |
| 5630 | esac |
| 5631 | if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \ |
| 5632 | >cpp1.out 2>/dev/null && \ |
| 5633 | $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \ |
| 5634 | >cpp2.out 2>/dev/null && \ |
| 5635 | $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ |
| 5636 | $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 |
| 5637 | then |
| 5638 | cppflags="$cppflags $ftry" |
| 5639 | previous='' |
| 5640 | else |
| 5641 | previous="$flag" |
| 5642 | fi |
| 5643 | done |
| 5644 | set X $cppflags |
| 5645 | shift |
| 5646 | cppflags=${1+"$@"} |
| 5647 | case "$cppflags" in |
| 5648 | *-*) echo "They appear to be: $cppflags";; |
| 5649 | esac |
| 5650 | $rm -f cpp.c cpp?.out |
| 5651 | ;; |
| 5652 | esac |
| 5653 | |
| 5654 | : flags used in final linking phase |
| 5655 | case "$ldflags" in |
| 5656 | '') if ./venix; then |
| 5657 | dflt='-i -z' |
| 5658 | else |
| 5659 | dflt='' |
| 5660 | fi |
| 5661 | case "$ccflags" in |
| 5662 | *-posix*) dflt="$dflt -posix" ;; |
| 5663 | esac |
| 5664 | ;; |
| 5665 | *) dflt="$ldflags";; |
| 5666 | esac |
| 5667 | # See note above about -fstack-protector |
| 5668 | case "$ccflags" in |
| 5669 | *-fstack-protector-strong*) |
| 5670 | case "$dflt" in |
| 5671 | *-fstack-protector-strong*) ;; # Don't add it again |
| 5672 | *) dflt="$dflt -fstack-protector-strong" ;; |
| 5673 | esac |
| 5674 | ;; |
| 5675 | *-fstack-protector*) |
| 5676 | case "$dflt" in |
| 5677 | *-fstack-protector*) ;; # Don't add it again |
| 5678 | *) dflt="$dflt -fstack-protector" ;; |
| 5679 | esac |
| 5680 | ;; |
| 5681 | esac |
| 5682 | |
| 5683 | : Try to guess additional flags to pick up local libraries. |
| 5684 | for thislibdir in $libpth; do |
| 5685 | case " $loclibpth " in |
| 5686 | *" $thislibdir "*) |
| 5687 | case "$dflt " in |
| 5688 | *"-L$thislibdir "*) ;; |
| 5689 | *) dflt="$dflt -L$thislibdir" ;; |
| 5690 | esac |
| 5691 | ;; |
| 5692 | esac |
| 5693 | done |
| 5694 | |
| 5695 | case "$dflt" in |
| 5696 | '') dflt='none' ;; |
| 5697 | esac |
| 5698 | |
| 5699 | $cat <<EOH |
| 5700 | |
| 5701 | Your C linker may need flags. For this question you should |
| 5702 | include -L/whatever and any other flags used by the C linker, but you |
| 5703 | should NOT include libraries like -lwhatever. |
| 5704 | |
| 5705 | Make sure you include the appropriate -L/path flags if your C linker |
| 5706 | does not normally search all of the directories you specified above, |
| 5707 | namely |
| 5708 | $libpth |
| 5709 | To use no flags, specify the word "none". |
| 5710 | |
| 5711 | EOH |
| 5712 | |
| 5713 | rp="Any additional ld flags (NOT including libraries)?" |
| 5714 | . ./myread |
| 5715 | case "$ans" in |
| 5716 | none) ldflags='';; |
| 5717 | *) ldflags="$ans";; |
| 5718 | esac |
| 5719 | rmlist="$rmlist pdp11" |
| 5720 | |
| 5721 | : coherency check |
| 5722 | echo " " |
| 5723 | echo "Checking your choice of C compiler and flags for coherency..." >&4 |
| 5724 | $cat > try.c <<'EOF' |
| 5725 | #include <stdio.h> |
| 5726 | int main() { printf("Ok\n"); return(0); } |
| 5727 | EOF |
| 5728 | set X $cc -o try $optimize $ccflags $ldflags try.c $libs |
| 5729 | shift |
| 5730 | $cat >try.msg <<'EOM' |
| 5731 | I've tried to compile and run the following simple program: |
| 5732 | |
| 5733 | EOM |
| 5734 | $cat try.c >> try.msg |
| 5735 | |
| 5736 | $cat >> try.msg <<EOM |
| 5737 | |
| 5738 | I used the command: |
| 5739 | |
| 5740 | $* |
| 5741 | $run ./try |
| 5742 | |
| 5743 | and I got the following output: |
| 5744 | |
| 5745 | EOM |
| 5746 | dflt=y |
| 5747 | if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then |
| 5748 | if $sh -c "$run ./try " >>try.msg 2>&1; then |
| 5749 | xxx=`$run ./try` |
| 5750 | case "$xxx" in |
| 5751 | "Ok") dflt=n ;; |
| 5752 | *) echo 'The program compiled OK, but produced no output.' >> try.msg ;; |
| 5753 | esac |
| 5754 | else |
| 5755 | echo "The program compiled OK, but exited with status $?." >>try.msg |
| 5756 | rp="You have a problem. Shall I abort Configure" |
| 5757 | dflt=y |
| 5758 | fi |
| 5759 | else |
| 5760 | echo "I can't compile the test program." >>try.msg |
| 5761 | rp="You have a BIG problem. Shall I abort Configure" |
| 5762 | dflt=y |
| 5763 | fi |
| 5764 | case "$dflt" in |
| 5765 | y) |
| 5766 | $cat try.msg >&4 |
| 5767 | case "$knowitall" in |
| 5768 | '') |
| 5769 | echo "(The supplied flags or libraries might be incorrect.)" |
| 5770 | ;; |
| 5771 | *) dflt=n;; |
| 5772 | esac |
| 5773 | echo " " |
| 5774 | . ./myread |
| 5775 | case "$ans" in |
| 5776 | n*|N*) ;; |
| 5777 | *) echo "Ok. Stopping Configure." >&4 |
| 5778 | exit 1 |
| 5779 | ;; |
| 5780 | esac |
| 5781 | ;; |
| 5782 | n) echo "OK, that should do.";; |
| 5783 | esac |
| 5784 | $rm_try gcctest gcctest.out |
| 5785 | |
| 5786 | : define a shorthand compile call |
| 5787 | compile=' |
| 5788 | mc_file=$1; |
| 5789 | shift; |
| 5790 | case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then |
| 5791 | cat >&4 <<EOM |
| 5792 | Internal Configure script bug - compiler test file ${mc_file}.c is missing. |
| 5793 | Please report this to https://github.com/Perl/perl5/issues |
| 5794 | EOM |
| 5795 | exit 1; |
| 5796 | fi; |
| 5797 | esac; |
| 5798 | $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;' |
| 5799 | : define a shorthand compile call for compilations that should be ok. |
| 5800 | compile_ok=' |
| 5801 | mc_file=$1; |
| 5802 | shift; |
| 5803 | $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;' |
| 5804 | |
| 5805 | : stub, used only to satisfy other units |
| 5806 | i_stdlib='define' |
| 5807 | |
| 5808 | : check for lengths of integral types |
| 5809 | echo " " |
| 5810 | case "$intsize" in |
| 5811 | '') |
| 5812 | echo "Checking to see how big your integers are..." >&4 |
| 5813 | $cat >try.c <<EOCP |
| 5814 | #include <stdio.h> |
| 5815 | #$i_stdlib I_STDLIB |
| 5816 | #ifdef I_STDLIB |
| 5817 | #include <stdlib.h> |
| 5818 | #endif |
| 5819 | int main() |
| 5820 | { |
| 5821 | printf("intsize=%d;\n", (int)sizeof(int)); |
| 5822 | printf("longsize=%d;\n", (int)sizeof(long)); |
| 5823 | printf("shortsize=%d;\n", (int)sizeof(short)); |
| 5824 | exit(0); |
| 5825 | } |
| 5826 | EOCP |
| 5827 | set try |
| 5828 | if eval $compile_ok && $run ./try > /dev/null; then |
| 5829 | eval `$run ./try` |
| 5830 | echo "Your integers are $intsize bytes long." |
| 5831 | echo "Your long integers are $longsize bytes long." |
| 5832 | echo "Your short integers are $shortsize bytes long." |
| 5833 | else |
| 5834 | $cat >&4 <<EOM |
| 5835 | ! |
| 5836 | Help! I can't compile and run the intsize test program: please enlighten me! |
| 5837 | (This is probably a misconfiguration in your system or libraries, and |
| 5838 | you really ought to fix it. Still, I'll try anyway.) |
| 5839 | ! |
| 5840 | EOM |
| 5841 | dflt=4 |
| 5842 | rp="What is the size of an integer (in bytes)?" |
| 5843 | . ./myread |
| 5844 | intsize="$ans" |
| 5845 | dflt=$intsize |
| 5846 | rp="What is the size of a long integer (in bytes)?" |
| 5847 | . ./myread |
| 5848 | longsize="$ans" |
| 5849 | dflt=2 |
| 5850 | rp="What is the size of a short integer (in bytes)?" |
| 5851 | . ./myread |
| 5852 | shortsize="$ans" |
| 5853 | fi |
| 5854 | ;; |
| 5855 | esac |
| 5856 | $rm_try |
| 5857 | |
| 5858 | : check for long long |
| 5859 | echo " " |
| 5860 | echo "Checking to see if you have long long..." >&4 |
| 5861 | echo 'int main() { long long x = 7; return 0; }' > try.c |
| 5862 | set try |
| 5863 | if eval $compile; then |
| 5864 | val="$define" |
| 5865 | echo "You have long long." |
| 5866 | else |
| 5867 | val="$undef" |
| 5868 | echo "You do not have long long." |
| 5869 | fi |
| 5870 | $rm_try |
| 5871 | set d_longlong |
| 5872 | eval $setvar |
| 5873 | |
| 5874 | : check for length of long long |
| 5875 | case "${d_longlong}${longlongsize}" in |
| 5876 | $define) |
| 5877 | echo " " |
| 5878 | echo "Checking to see how big your long longs are..." >&4 |
| 5879 | $cat >try.c <<'EOCP' |
| 5880 | #include <stdio.h> |
| 5881 | int main() |
| 5882 | { |
| 5883 | printf("%d\n", (int)sizeof(long long)); |
| 5884 | return(0); |
| 5885 | } |
| 5886 | EOCP |
| 5887 | set try |
| 5888 | if eval $compile_ok; then |
| 5889 | longlongsize=`$run ./try` |
| 5890 | echo "Your long longs are $longlongsize bytes long." |
| 5891 | else |
| 5892 | dflt='8' |
| 5893 | echo " " |
| 5894 | echo "(I can't seem to compile the test program. Guessing...)" |
| 5895 | rp="What is the size of a long long (in bytes)?" |
| 5896 | . ./myread |
| 5897 | longlongsize="$ans" |
| 5898 | fi |
| 5899 | if $test "X$longsize" = "X$longlongsize"; then |
| 5900 | echo "(That isn't any different from an ordinary long.)" |
| 5901 | fi |
| 5902 | ;; |
| 5903 | esac |
| 5904 | $rm_try |
| 5905 | |
| 5906 | : determine filename position in cpp output |
| 5907 | echo " " |
| 5908 | echo "Computing filename position in cpp output for #include directives..." >&4 |
| 5909 | case "$osname" in |
| 5910 | amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh). |
| 5911 | esac |
| 5912 | case "$fieldn" in |
| 5913 | '') |
| 5914 | case "$osname" in |
| 5915 | vos) testaccess=-e ;; |
| 5916 | *) testaccess=-r ;; |
| 5917 | esac |
| 5918 | echo '#include <stdio.h>' > foo.c |
| 5919 | $cat >fieldn <<EOF |
| 5920 | $startsh |
| 5921 | $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \ |
| 5922 | $grep '^[ ]*#.*stdio\.h' | \ |
| 5923 | while read cline; do |
| 5924 | pos=1 |
| 5925 | set \$cline |
| 5926 | while $test \$# -gt 0; do |
| 5927 | if $test $testaccess \`echo \$1 | $tr -d '"'\`; then |
| 5928 | echo "\$pos" |
| 5929 | exit 0 |
| 5930 | fi |
| 5931 | shift |
| 5932 | pos=\`expr \$pos + 1\` |
| 5933 | done |
| 5934 | done |
| 5935 | EOF |
| 5936 | chmod +x fieldn |
| 5937 | fieldn=`./fieldn` |
| 5938 | $rm -f foo.c fieldn |
| 5939 | ;; |
| 5940 | esac |
| 5941 | case $fieldn in |
| 5942 | '') pos='???';; |
| 5943 | 1) pos=first;; |
| 5944 | 2) pos=second;; |
| 5945 | 3) pos=third;; |
| 5946 | *) pos="${fieldn}th";; |
| 5947 | esac |
| 5948 | echo "Your cpp writes the filename in the $pos field of the line." |
| 5949 | |
| 5950 | : locate header file |
| 5951 | $cat >findhdr <<EOF |
| 5952 | $startsh |
| 5953 | wanted=\$1 |
| 5954 | name='' |
| 5955 | for usrincdir in $incpth |
| 5956 | do |
| 5957 | if test -f \$usrincdir/\$wanted; then |
| 5958 | echo "\$usrincdir/\$wanted" |
| 5959 | exit 0 |
| 5960 | fi |
| 5961 | done |
| 5962 | awkprg='{ print \$$fieldn }' |
| 5963 | echo "#include <\$wanted>" > foo\$\$.c |
| 5964 | $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ |
| 5965 | $cppfilter $grep "^[ ]*#.*\$wanted" | \ |
| 5966 | while read cline; do |
| 5967 | name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` |
| 5968 | case "\$name" in |
| 5969 | *[/\\\\]\$wanted) echo "\$name"; exit 1;; |
| 5970 | *[\\\\/]\$wanted) echo "\$name"; exit 1;; |
| 5971 | *) exit 2;; |
| 5972 | esac; |
| 5973 | done; |
| 5974 | # |
| 5975 | # status = 0: grep returned 0 lines, case statement not executed |
| 5976 | # status = 1: headerfile found |
| 5977 | # status = 2: while loop executed, no headerfile found |
| 5978 | # |
| 5979 | status=\$? |
| 5980 | $rm -f foo\$\$.c; |
| 5981 | if test \$status -eq 1; then |
| 5982 | exit 0; |
| 5983 | fi |
| 5984 | exit 1 |
| 5985 | EOF |
| 5986 | chmod +x findhdr |
| 5987 | |
| 5988 | : define an alternate in-header-list? function |
| 5989 | inhdr='echo " "; td=$define; tu=$undef; yyy=$@; |
| 5990 | cont=true; xxf="echo \"<\$1> found.\" >&4"; |
| 5991 | case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";; |
| 5992 | *) xxnf="echo \"<\$1> NOT found, ...\" >&4";; |
| 5993 | esac; |
| 5994 | case $# in 4) instead=instead;; *) instead="at last";; esac; |
| 5995 | while $test "$cont"; do |
| 5996 | xxx=`./findhdr $1` |
| 5997 | var=$2; eval "was=\$$2"; |
| 5998 | if $test "$xxx" && $test -r "$xxx"; |
| 5999 | then eval $xxf; |
| 6000 | eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td"; |
| 6001 | cont=""; |
| 6002 | else eval $xxnf; |
| 6003 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi; |
| 6004 | set $yyy; shift; shift; yyy=$@; |
| 6005 | case $# in 0) cont="";; |
| 6006 | 2) xxf="echo \"but I found <\$1> $instead.\" >&4"; |
| 6007 | xxnf="echo \"and I did not find <\$1> either.\" >&4";; |
| 6008 | *) xxf="echo \"but I found <\$1\> instead.\" >&4"; |
| 6009 | xxnf="echo \"there is no <\$1>, ...\" >&4";; |
| 6010 | esac; |
| 6011 | done; |
| 6012 | while $test "$yyy"; |
| 6013 | do set $yyy; var=$2; eval "was=\$$2"; |
| 6014 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; |
| 6015 | set $yyy; shift; shift; yyy=$@; |
| 6016 | done' |
| 6017 | |
| 6018 | : see if inttypes.h is available |
| 6019 | : we want a real compile instead of Inhdr because some systems |
| 6020 | : have an inttypes.h which includes non-existent headers |
| 6021 | echo " " |
| 6022 | $cat >try.c <<EOCP |
| 6023 | #include <inttypes.h> |
| 6024 | int main() { |
| 6025 | static int32_t foo32 = 0x12345678; |
| 6026 | } |
| 6027 | EOCP |
| 6028 | set try |
| 6029 | if eval $compile; then |
| 6030 | echo "<inttypes.h> found." >&4 |
| 6031 | val="$define" |
| 6032 | else |
| 6033 | echo "<inttypes.h> NOT found." >&4 |
| 6034 | val="$undef" |
| 6035 | fi |
| 6036 | $rm_try |
| 6037 | set i_inttypes |
| 6038 | eval $setvar |
| 6039 | |
| 6040 | : check for int64_t |
| 6041 | echo " " |
| 6042 | echo "Checking to see if you have int64_t..." >&4 |
| 6043 | $cat >try.c <<EOCP |
| 6044 | #include <sys/types.h> |
| 6045 | #$i_inttypes I_INTTYPES |
| 6046 | #ifdef I_INTTYPES |
| 6047 | #include <inttypes.h> |
| 6048 | #endif |
| 6049 | int main() { int64_t x = 7; } |
| 6050 | EOCP |
| 6051 | set try |
| 6052 | if eval $compile; then |
| 6053 | val="$define" |
| 6054 | echo "You have int64_t." |
| 6055 | else |
| 6056 | val="$undef" |
| 6057 | echo "You do not have int64_t." |
| 6058 | fi |
| 6059 | $rm_try |
| 6060 | set d_int64_t |
| 6061 | eval $setvar |
| 6062 | |
| 6063 | : Check if 64bit ints have a quad type |
| 6064 | echo " " |
| 6065 | echo "Checking which 64-bit integer type we could use..." >&4 |
| 6066 | |
| 6067 | case "$intsize" in |
| 6068 | 8) val=int |
| 6069 | set quadtype |
| 6070 | eval $setvar |
| 6071 | val='"unsigned int"' |
| 6072 | set uquadtype |
| 6073 | eval $setvar |
| 6074 | quadkind=1 |
| 6075 | ;; |
| 6076 | *) case "$longsize" in |
| 6077 | 8) val=long |
| 6078 | set quadtype |
| 6079 | eval $setvar |
| 6080 | val='"unsigned long"' |
| 6081 | set uquadtype |
| 6082 | eval $setvar |
| 6083 | quadkind=2 |
| 6084 | ;; |
| 6085 | *) case "$d_longlong:$longlongsize" in |
| 6086 | define:8) |
| 6087 | val='"long long"' |
| 6088 | set quadtype |
| 6089 | eval $setvar |
| 6090 | val='"unsigned long long"' |
| 6091 | set uquadtype |
| 6092 | eval $setvar |
| 6093 | quadkind=3 |
| 6094 | ;; |
| 6095 | *) case "$d_int64_t" in |
| 6096 | define) |
| 6097 | val=int64_t |
| 6098 | set quadtype |
| 6099 | eval $setvar |
| 6100 | val=uint64_t |
| 6101 | set uquadtype |
| 6102 | eval $setvar |
| 6103 | quadkind=4 |
| 6104 | ;; |
| 6105 | esac |
| 6106 | ;; |
| 6107 | esac |
| 6108 | ;; |
| 6109 | esac |
| 6110 | ;; |
| 6111 | esac |
| 6112 | |
| 6113 | case "$quadtype" in |
| 6114 | '') echo "Alas, no 64-bit integer types in sight." >&4 |
| 6115 | d_quad="$undef" |
| 6116 | ;; |
| 6117 | *) echo "We could use '$quadtype' for 64-bit integers." >&4 |
| 6118 | d_quad="$define" |
| 6119 | ;; |
| 6120 | esac |
| 6121 | |
| 6122 | : Do we want 64bit support |
| 6123 | case "$uselonglong" in |
| 6124 | "$define"|true|[yY]*) |
| 6125 | cat <<EOM >&4 |
| 6126 | |
| 6127 | *** Configure -Duselonglong is deprecated, using -Duse64bitint instead. |
| 6128 | EOM |
| 6129 | use64bitint="$define" |
| 6130 | ;; |
| 6131 | esac |
| 6132 | case "$use64bits" in |
| 6133 | "$define"|true|[yY]*) |
| 6134 | cat <<EOM >&4 |
| 6135 | |
| 6136 | *** Configure -Duse64bits is deprecated, using -Duse64bitint instead. |
| 6137 | EOM |
| 6138 | use64bitint="$define" |
| 6139 | ;; |
| 6140 | esac |
| 6141 | case "$use64bitints" in |
| 6142 | "$define"|true|[yY]*) |
| 6143 | cat <<EOM >&4 |
| 6144 | |
| 6145 | *** There is no Configure -Duse64bitints, using -Duse64bitint instead. |
| 6146 | EOM |
| 6147 | use64bitint="$define" |
| 6148 | ;; |
| 6149 | esac |
| 6150 | case "$use64bitsint" in |
| 6151 | "$define"|true|[yY]*) |
| 6152 | cat <<EOM >&4 |
| 6153 | |
| 6154 | *** There is no Configure -Duse64bitsint, using -Duse64bitint instead. |
| 6155 | EOM |
| 6156 | use64bitint="$define" |
| 6157 | ;; |
| 6158 | esac |
| 6159 | case "$uselonglongs" in |
| 6160 | "$define"|true|[yY]*) |
| 6161 | cat <<EOM >&4 |
| 6162 | |
| 6163 | *** There is no Configure -Duselonglongs, using -Duse64bitint instead. |
| 6164 | EOM |
| 6165 | use64bitint="$define" |
| 6166 | ;; |
| 6167 | esac |
| 6168 | case "$use64bitsall" in |
| 6169 | "$define"|true|[yY]*) |
| 6170 | cat <<EOM >&4 |
| 6171 | |
| 6172 | *** There is no Configure -Duse64bitsall, using -Duse64bitall instead. |
| 6173 | EOM |
| 6174 | use64bitall="$define" |
| 6175 | ;; |
| 6176 | esac |
| 6177 | |
| 6178 | case "$ccflags" in |
| 6179 | *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";; |
| 6180 | esac |
| 6181 | case "$use64bitall" in |
| 6182 | "$define"|true|[yY]*) use64bitint="$define" ;; |
| 6183 | esac |
| 6184 | |
| 6185 | case "$longsize" in |
| 6186 | 8) cat <<EOM |
| 6187 | |
| 6188 | You have natively 64-bit long integers. |
| 6189 | EOM |
| 6190 | val="$define" |
| 6191 | ;; |
| 6192 | *) case "$use64bitint" in |
| 6193 | "$define"|true|[yY]*) dflt='y';; |
| 6194 | *) dflt='n';; |
| 6195 | esac |
| 6196 | case "$d_quad" in |
| 6197 | "$define") ;; |
| 6198 | *) dflt='n' ;; |
| 6199 | esac |
| 6200 | cat <<EOM |
| 6201 | |
| 6202 | Perl can be built to take advantage of 64-bit integer types |
| 6203 | on some systems. To do so, Configure can be run with -Duse64bitint. |
| 6204 | Choosing this option will most probably introduce binary incompatibilities. |
| 6205 | |
| 6206 | If this doesn't make any sense to you, just accept the default '$dflt'. |
| 6207 | (The default has been chosen based on your configuration.) |
| 6208 | EOM |
| 6209 | rp='Try to use 64-bit integers, if available?' |
| 6210 | . ./myread |
| 6211 | case "$ans" in |
| 6212 | [yY]*) val="$define" ;; |
| 6213 | *) val="$undef" ;; |
| 6214 | esac |
| 6215 | ;; |
| 6216 | esac |
| 6217 | set use64bitint |
| 6218 | eval $setvar |
| 6219 | |
| 6220 | case "$use64bitall" in |
| 6221 | "$define"|true|[yY]*) dflt='y' ;; |
| 6222 | *) case "$longsize" in |
| 6223 | 8) dflt='y' ;; |
| 6224 | *) dflt='n' ;; |
| 6225 | esac |
| 6226 | ;; |
| 6227 | esac |
| 6228 | cat <<EOM |
| 6229 | |
| 6230 | You may also choose to try maximal 64-bitness. It means using as much |
| 6231 | 64-bitness as possible on the platform. This in turn means even more |
| 6232 | binary incompatibilities. On the other hand, your platform may not |
| 6233 | have any more 64-bitness available than what you already have chosen. |
| 6234 | |
| 6235 | If this doesn't make any sense to you, just accept the default '$dflt'. |
| 6236 | (The default has been chosen based on your configuration.) |
| 6237 | EOM |
| 6238 | rp='Try to use maximal 64-bit support, if available?' |
| 6239 | . ./myread |
| 6240 | case "$ans" in |
| 6241 | [yY]*) val="$define" ;; |
| 6242 | *) val="$undef" ;; |
| 6243 | esac |
| 6244 | set use64bitall |
| 6245 | eval $setvar |
| 6246 | case "$use64bitall" in |
| 6247 | "$define") |
| 6248 | case "$use64bitint" in |
| 6249 | "$undef") |
| 6250 | cat <<EOM |
| 6251 | |
| 6252 | Since you have chosen a maximally 64-bit build, I'm also turning on |
| 6253 | the use of 64-bit integers. |
| 6254 | EOM |
| 6255 | use64bitint="$define" ;; |
| 6256 | esac |
| 6257 | ;; |
| 6258 | esac |
| 6259 | |
| 6260 | : Look for a hint-file generated 'call-back-unit'. If the |
| 6261 | : user has specified that a 64-bit perl is to be built, |
| 6262 | : we may need to set or change some other defaults. |
| 6263 | if $test -f use64bitint.cbu; then |
| 6264 | echo "Your platform has some specific hints regarding 64-bit integers, using them..." |
| 6265 | . ./use64bitint.cbu |
| 6266 | fi |
| 6267 | case "$use64bitint" in |
| 6268 | "$define"|true|[yY]*) |
| 6269 | : This test was common to all the OpenBSD forks, and seems harmless for |
| 6270 | : other platforms: |
| 6271 | echo " " |
| 6272 | echo "Checking if your C library has broken 64-bit functions..." >&4 |
| 6273 | cat >try.c <<EOCP |
| 6274 | #include <stdio.h> |
| 6275 | typedef $uquadtype myULL; |
| 6276 | int main (void) |
| 6277 | { |
| 6278 | struct { |
| 6279 | double d; |
| 6280 | myULL u; |
| 6281 | } *p, test[] = { |
| 6282 | {4294967303.15, 4294967303ULL}, |
| 6283 | {4294967294.2, 4294967294ULL}, |
| 6284 | {4294967295.7, 4294967295ULL}, |
| 6285 | {0.0, 0ULL} |
| 6286 | }; |
| 6287 | for (p = test; p->u; p++) { |
| 6288 | myULL x = (myULL)p->d; |
| 6289 | if (x != p->u) { |
| 6290 | printf("buggy\n"); |
| 6291 | return 0; |
| 6292 | } |
| 6293 | } |
| 6294 | printf("ok\n"); |
| 6295 | return 0; |
| 6296 | } |
| 6297 | EOCP |
| 6298 | set try |
| 6299 | if eval $compile_ok; then |
| 6300 | libcquad=`$run ./try` |
| 6301 | echo "Your C library's 64-bit functions are $libcquad." |
| 6302 | else |
| 6303 | echo "(I can't seem to compile the test program.)" |
| 6304 | echo "Assuming that your C library's 64-bit functions are ok." |
| 6305 | libcquad="ok" |
| 6306 | fi |
| 6307 | $rm_try |
| 6308 | |
| 6309 | case "$libcquad" in |
| 6310 | buggy*) |
| 6311 | cat >&4 <<EOM |
| 6312 | |
| 6313 | *** You have a C library with broken 64-bit functions. |
| 6314 | *** 64-bit support does not work reliably in this configuration. |
| 6315 | *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits. |
| 6316 | *** Cannot continue, aborting. |
| 6317 | |
| 6318 | EOM |
| 6319 | exit 1 |
| 6320 | ;; |
| 6321 | esac |
| 6322 | case "$longsize" in |
| 6323 | 4) case "$archname64" in |
| 6324 | '') archname64=64int ;; |
| 6325 | esac |
| 6326 | ;; |
| 6327 | esac |
| 6328 | ;; |
| 6329 | esac |
| 6330 | |
| 6331 | : Look for a hint-file generated 'call-back-unit'. If the |
| 6332 | : user has specified that a maximally 64-bit perl is to be built, |
| 6333 | : we may need to set or change some other defaults. |
| 6334 | if $test -f use64bitall.cbu; then |
| 6335 | echo "Your platform has some specific hints regarding 64-bit builds, using them..." |
| 6336 | . ./use64bitall.cbu |
| 6337 | fi |
| 6338 | case "$use64bitall" in |
| 6339 | "$define"|true|[yY]*) |
| 6340 | case "$longsize" in |
| 6341 | 4) case "$archname64" in |
| 6342 | ''|64int) archname64=64all ;; |
| 6343 | esac |
| 6344 | ;; |
| 6345 | esac |
| 6346 | ;; |
| 6347 | esac |
| 6348 | |
| 6349 | case "$d_quad:$use64bitint" in |
| 6350 | $undef:$define) |
| 6351 | cat >&4 <<EOF |
| 6352 | |
| 6353 | *** You have chosen to use 64-bit integers, |
| 6354 | *** but none can be found. |
| 6355 | *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits. |
| 6356 | *** Cannot continue, aborting. |
| 6357 | |
| 6358 | EOF |
| 6359 | exit 1 |
| 6360 | ;; |
| 6361 | esac |
| 6362 | |
| 6363 | : Check if we are using the GNU C library |
| 6364 | echo " " |
| 6365 | echo "Checking for GNU C Library..." >&4 |
| 6366 | cat >try.c <<'EOCP' |
| 6367 | /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__ |
| 6368 | alone are insufficient to distinguish different versions, such as |
| 6369 | 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in |
| 6370 | libc version 2.1.0. A. Dougherty, June 3, 2002. |
| 6371 | */ |
| 6372 | #include <stdio.h> |
| 6373 | int main(void) |
| 6374 | { |
| 6375 | #ifdef __GLIBC__ |
| 6376 | # ifdef __GLIBC_MINOR__ |
| 6377 | # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus) |
| 6378 | # include <gnu/libc-version.h> |
| 6379 | printf("%s\n", gnu_get_libc_version()); |
| 6380 | # else |
| 6381 | printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__); |
| 6382 | # endif |
| 6383 | # else |
| 6384 | printf("%d\n", __GLIBC__); |
| 6385 | # endif |
| 6386 | return 0; |
| 6387 | #else |
| 6388 | return 1; |
| 6389 | #endif |
| 6390 | } |
| 6391 | EOCP |
| 6392 | set try |
| 6393 | if eval $compile_ok && $run ./try > glibc.ver; then |
| 6394 | val="$define" |
| 6395 | gnulibc_version=`$cat glibc.ver` |
| 6396 | echo "You are using the GNU C Library version $gnulibc_version" |
| 6397 | else |
| 6398 | val="$undef" |
| 6399 | gnulibc_version='' |
| 6400 | echo "You are not using the GNU C Library" |
| 6401 | fi |
| 6402 | $rm_try glibc.ver |
| 6403 | set d_gnulibc |
| 6404 | eval $setvar |
| 6405 | |
| 6406 | : see if nm is to be used to determine whether a symbol is defined or not |
| 6407 | case "$usenm" in |
| 6408 | '') |
| 6409 | dflt='' |
| 6410 | case "$d_gnulibc" in |
| 6411 | "$define") |
| 6412 | echo " " |
| 6413 | echo "nm probably won't work on the GNU C Library." >&4 |
| 6414 | dflt=n |
| 6415 | ;; |
| 6416 | esac |
| 6417 | case "$dflt" in |
| 6418 | '') |
| 6419 | if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then |
| 6420 | echo " " |
| 6421 | echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4 |
| 6422 | echo "'nm' won't be sufficient on this system." >&4 |
| 6423 | dflt=n |
| 6424 | fi |
| 6425 | ;; |
| 6426 | esac |
| 6427 | case "$dflt" in |
| 6428 | '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null` |
| 6429 | if $test $dflt -gt 20; then |
| 6430 | dflt=y |
| 6431 | else |
| 6432 | dflt=n |
| 6433 | fi |
| 6434 | ;; |
| 6435 | esac |
| 6436 | ;; |
| 6437 | *) |
| 6438 | case "$usenm" in |
| 6439 | true|$define) dflt=y;; |
| 6440 | *) dflt=n;; |
| 6441 | esac |
| 6442 | ;; |
| 6443 | esac |
| 6444 | $cat <<EOM |
| 6445 | |
| 6446 | I can use $nm to extract the symbols from your C libraries. This |
| 6447 | is a time consuming task which may generate huge output on the disk (up |
| 6448 | to 3 megabytes) but that should make the symbols extraction faster. The |
| 6449 | alternative is to skip the 'nm' extraction part and to compile a small |
| 6450 | test program instead to determine whether each symbol is present. If |
| 6451 | you have a fast C compiler and/or if your 'nm' output cannot be parsed, |
| 6452 | this may be the best solution. |
| 6453 | |
| 6454 | You probably shouldn't let me use 'nm' if you are using the GNU C Library. |
| 6455 | |
| 6456 | EOM |
| 6457 | rp="Shall I use $nm to extract C symbols from the libraries?" |
| 6458 | . ./myread |
| 6459 | case "$ans" in |
| 6460 | [Nn]*) usenm=false;; |
| 6461 | *) usenm=true;; |
| 6462 | esac |
| 6463 | |
| 6464 | runnm=$usenm |
| 6465 | case "$reuseval" in |
| 6466 | true) runnm=false;; |
| 6467 | esac |
| 6468 | |
| 6469 | : nm options which may be necessary |
| 6470 | case "$nm_opt" in |
| 6471 | '') if $test -f /mach_boot; then |
| 6472 | nm_opt='' # Mach |
| 6473 | elif $test -d /usr/ccs/lib; then |
| 6474 | nm_opt='-p' # Solaris (and SunOS?) |
| 6475 | elif $test -f /dgux; then |
| 6476 | nm_opt='-p' # DG-UX |
| 6477 | elif $test -f /lib64/rld; then |
| 6478 | nm_opt='-p' # 64-bit Irix |
| 6479 | else |
| 6480 | nm_opt='' |
| 6481 | fi;; |
| 6482 | esac |
| 6483 | |
| 6484 | : nm options which may be necessary for shared libraries but illegal |
| 6485 | : for archive libraries. Thank you, Linux. |
| 6486 | case "$nm_so_opt" in |
| 6487 | '') case "$myuname" in |
| 6488 | *linux*|gnu*) |
| 6489 | if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then |
| 6490 | nm_so_opt='--dynamic' |
| 6491 | fi |
| 6492 | ;; |
| 6493 | esac |
| 6494 | ;; |
| 6495 | esac |
| 6496 | |
| 6497 | : Figure out where the libc is located |
| 6498 | case "$runnm" in |
| 6499 | true) |
| 6500 | : get list of predefined functions in a handy place |
| 6501 | echo " " |
| 6502 | case "$libc" in |
| 6503 | '') libc=unknown |
| 6504 | case "$libs" in |
| 6505 | *-lc_s*) libc=`./loc libc_s$_a $libc $libpth` |
| 6506 | esac |
| 6507 | ;; |
| 6508 | esac |
| 6509 | case "$libs" in |
| 6510 | '') ;; |
| 6511 | *) for thislib in $libs; do |
| 6512 | case "$thislib" in |
| 6513 | -lc|-lc_s) |
| 6514 | : Handle C library specially below. |
| 6515 | ;; |
| 6516 | -l*) |
| 6517 | thislib=`echo $thislib | $sed -e 's/^-l//'` |
| 6518 | if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then |
| 6519 | : |
| 6520 | elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then |
| 6521 | : |
| 6522 | elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then |
| 6523 | : |
| 6524 | elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then |
| 6525 | : |
| 6526 | elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then |
| 6527 | : |
| 6528 | elif try=`./loc $thislib X $libpth`; $test -f "$try"; then |
| 6529 | : |
| 6530 | elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then |
| 6531 | : |
| 6532 | else |
| 6533 | try='' |
| 6534 | fi |
| 6535 | libnames="$libnames $try" |
| 6536 | ;; |
| 6537 | *) libnames="$libnames $thislib" ;; |
| 6538 | esac |
| 6539 | done |
| 6540 | ;; |
| 6541 | esac |
| 6542 | xxx=normal |
| 6543 | case "$libc" in |
| 6544 | unknown) |
| 6545 | set /lib/libc.$so |
| 6546 | for xxx in $libpth; do |
| 6547 | $test -r $1 || set $xxx/libc.$so |
| 6548 | : The messy sed command sorts on library version numbers. |
| 6549 | $test -r $1 || \ |
| 6550 | set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \ |
| 6551 | tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e ' |
| 6552 | h |
| 6553 | s/[0-9][0-9]*/0000&/g |
| 6554 | s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g |
| 6555 | G |
| 6556 | s/\n/ /' | \ |
| 6557 | $sort | $sed -e 's/^.* //'` |
| 6558 | eval set \$$# |
| 6559 | done |
| 6560 | $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so |
| 6561 | $test -r $1 || set $sysroot/lib/libsys_s$_a |
| 6562 | ;; |
| 6563 | *) |
| 6564 | set blurfl |
| 6565 | ;; |
| 6566 | esac |
| 6567 | if $test -r "$1"; then |
| 6568 | echo "Your (shared) C library seems to be in $1." |
| 6569 | libc="$1" |
| 6570 | elif $test -r /lib/libc && $test -r /lib/clib; then |
| 6571 | echo "Your C library seems to be in both /lib/clib and /lib/libc." |
| 6572 | xxx=apollo |
| 6573 | libc='/lib/clib /lib/libc' |
| 6574 | if $test -r /lib/syslib; then |
| 6575 | echo "(Your math library is in /lib/syslib.)" |
| 6576 | libc="$libc /lib/syslib" |
| 6577 | fi |
| 6578 | elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then |
| 6579 | echo "Your C library seems to be in $libc, as you said before." |
| 6580 | elif $test -r $incpath/usr/lib/libc$_a; then |
| 6581 | libc=$incpath/usr/lib/libc$_a; |
| 6582 | echo "Your C library seems to be in $libc. That's fine." |
| 6583 | elif $test -r /lib/libc$_a; then |
| 6584 | libc=/lib/libc$_a; |
| 6585 | echo "Your C library seems to be in $libc. You're normal." |
| 6586 | else |
| 6587 | if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then |
| 6588 | : |
| 6589 | elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then |
| 6590 | libnames="$libnames "`./loc clib blurfl/dyick $libpth` |
| 6591 | elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then |
| 6592 | : |
| 6593 | elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then |
| 6594 | : |
| 6595 | elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then |
| 6596 | : |
| 6597 | else |
| 6598 | tans=`./loc Llibc$_a blurfl/dyick $xlibpth` |
| 6599 | fi |
| 6600 | if $test -r "$tans"; then |
| 6601 | echo "Your C library seems to be in $tans, of all places." |
| 6602 | libc=$tans |
| 6603 | else |
| 6604 | libc='blurfl' |
| 6605 | fi |
| 6606 | fi |
| 6607 | if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then |
| 6608 | dflt="$libc" |
| 6609 | cat <<EOM |
| 6610 | |
| 6611 | If the guess above is wrong (which it might be if you're using a strange |
| 6612 | compiler, or your machine supports multiple models), you can override it here. |
| 6613 | |
| 6614 | EOM |
| 6615 | else |
| 6616 | dflt='' |
| 6617 | echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath |
| 6618 | cat >&4 <<EOM |
| 6619 | I can't seem to find your C library. I've looked in the following places: |
| 6620 | |
| 6621 | EOM |
| 6622 | $sed 's/^/ /' libpath |
| 6623 | cat <<EOM |
| 6624 | |
| 6625 | None of these seems to contain your C library. I need to get its name... |
| 6626 | |
| 6627 | EOM |
| 6628 | fi |
| 6629 | fn=f |
| 6630 | rp='Where is your C library?' |
| 6631 | . ./getfile |
| 6632 | libc="$ans" |
| 6633 | |
| 6634 | echo " " |
| 6635 | echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames |
| 6636 | set X `cat libnames` |
| 6637 | shift |
| 6638 | xxx=files |
| 6639 | case $# in 1) xxx=file; esac |
| 6640 | echo "Extracting names from the following $xxx for later perusal:" >&4 |
| 6641 | echo " " |
| 6642 | $sed 's/^/ /' libnames >&4 |
| 6643 | echo " " |
| 6644 | $echo $n "This may take a while...$c" >&4 |
| 6645 | |
| 6646 | for file in $*; do |
| 6647 | case $file in |
| 6648 | *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;; |
| 6649 | *) $nm $nm_opt $file 2>/dev/null;; |
| 6650 | esac |
| 6651 | done >libc.tmp |
| 6652 | |
| 6653 | $echo $n ".$c" |
| 6654 | $grep fprintf libc.tmp > libc.ptf |
| 6655 | xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4' |
| 6656 | xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4' |
| 6657 | xxx='[ADTSIWi]' |
| 6658 | if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\ |
| 6659 | eval $xscan;\ |
| 6660 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6661 | eval $xrun |
| 6662 | elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\ |
| 6663 | eval $xscan;\ |
| 6664 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6665 | eval $xrun |
| 6666 | elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\ |
| 6667 | eval $xscan;\ |
| 6668 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6669 | eval $xrun |
| 6670 | elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\ |
| 6671 | eval $xscan;\ |
| 6672 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6673 | eval $xrun |
| 6674 | elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\ |
| 6675 | eval $xscan;\ |
| 6676 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6677 | eval $xrun |
| 6678 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\ |
| 6679 | eval $xscan;\ |
| 6680 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6681 | eval $xrun |
| 6682 | elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ |
| 6683 | -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\ |
| 6684 | eval $xscan;\ |
| 6685 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6686 | eval $xrun |
| 6687 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\ |
| 6688 | eval $xscan;\ |
| 6689 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6690 | eval $xrun |
| 6691 | elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\ |
| 6692 | eval $xscan;\ |
| 6693 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6694 | eval $xrun |
| 6695 | elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\ |
| 6696 | eval $xscan;\ |
| 6697 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6698 | eval $xrun |
| 6699 | elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\ |
| 6700 | eval $xscan;\ |
| 6701 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6702 | eval $xrun |
| 6703 | elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ |
| 6704 | eval $xscan;\ |
| 6705 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6706 | eval $xrun |
| 6707 | elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\ |
| 6708 | eval $xscan;\ |
| 6709 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6710 | eval $xrun |
| 6711 | elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\ |
| 6712 | eval $xscan;\ |
| 6713 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
| 6714 | eval $xrun |
| 6715 | else |
| 6716 | $nm -p $* 2>/dev/null >libc.tmp |
| 6717 | $grep fprintf libc.tmp > libc.ptf |
| 6718 | if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\ |
| 6719 | eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1 |
| 6720 | then |
| 6721 | nm_opt='-p' |
| 6722 | eval $xrun |
| 6723 | else |
| 6724 | echo " " |
| 6725 | echo "$nm didn't seem to work right. Trying $ar instead..." >&4 |
| 6726 | com='' |
| 6727 | if $ar t $libc > libc.tmp && \ |
| 6728 | $contains '^fprintf$' libc.tmp >/dev/null 2>&1 |
| 6729 | then |
| 6730 | for thisname in $libnames $libc; do |
| 6731 | $ar t $thisname >>libc.tmp |
| 6732 | done |
| 6733 | $sed -e "s/\\$_o\$//" < libc.tmp > libc.list |
| 6734 | echo "Ok." >&4 |
| 6735 | elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then |
| 6736 | for thisname in $libnames $libc; do |
| 6737 | $ar tv $thisname >>libc.tmp |
| 6738 | emximp -o tmp.imp $thisname \ |
| 6739 | 2>/dev/null && \ |
| 6740 | $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \ |
| 6741 | < tmp.imp >>libc.tmp |
| 6742 | $rm -f tmp.imp |
| 6743 | done |
| 6744 | $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list |
| 6745 | echo "Ok." >&4 |
| 6746 | else |
| 6747 | echo "$ar didn't seem to work right." >&4 |
| 6748 | echo "Maybe this is a Cray...trying bld instead..." >&4 |
| 6749 | if bld t $libc | \ |
| 6750 | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list && |
| 6751 | $test -s libc.list |
| 6752 | then |
| 6753 | for thisname in $libnames; do |
| 6754 | bld t $libnames | \ |
| 6755 | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list |
| 6756 | $ar t $thisname >>libc.tmp |
| 6757 | done |
| 6758 | echo "Ok." >&4 |
| 6759 | else |
| 6760 | echo "That didn't work either. Giving up." >&4 |
| 6761 | exit 1 |
| 6762 | fi |
| 6763 | fi |
| 6764 | fi |
| 6765 | fi |
| 6766 | nm_extract="$com" |
| 6767 | case "$PASE" in |
| 6768 | define) |
| 6769 | echo " " |
| 6770 | echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4 |
| 6771 | dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list |
| 6772 | ;; |
| 6773 | *) if $test -f /lib/syscalls.exp; then |
| 6774 | echo " " |
| 6775 | echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 |
| 6776 | $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \ |
| 6777 | /lib/syscalls.exp >>libc.list |
| 6778 | fi |
| 6779 | ;; |
| 6780 | esac |
| 6781 | ;; |
| 6782 | esac |
| 6783 | $rm -f libnames libpath |
| 6784 | |
| 6785 | : Check if we are using C++ |
| 6786 | echo " " |
| 6787 | echo "Checking for C++..." >&4 |
| 6788 | $cat >try.c <<'EOCP' |
| 6789 | #include <stdio.h> |
| 6790 | int main(void) |
| 6791 | { |
| 6792 | #ifdef __cplusplus |
| 6793 | return 0; |
| 6794 | #else |
| 6795 | return 1; |
| 6796 | #endif |
| 6797 | } |
| 6798 | EOCP |
| 6799 | set try |
| 6800 | if eval $compile_ok && $run ./try; then |
| 6801 | val="$define" |
| 6802 | echo "You are using a C++ compiler." |
| 6803 | else |
| 6804 | val="$undef" |
| 6805 | echo "You are not using a C++ compiler." |
| 6806 | fi |
| 6807 | $rm_try cplusplus$$ |
| 6808 | set d_cplusplus |
| 6809 | eval $setvar |
| 6810 | |
| 6811 | : is a C symbol defined? |
| 6812 | csym='tlook=$1; |
| 6813 | case "$3" in |
| 6814 | -v) tf=libc.tmp; tdc="";; |
| 6815 | -a) tf=libc.tmp; tdc="[]";; |
| 6816 | *) tlook="^$1\$"; tf=libc.list; tdc="()";; |
| 6817 | esac; |
| 6818 | case "$d_cplusplus" in |
| 6819 | $define) extern_C="extern \"C\"" ;; |
| 6820 | *) extern_C="extern" ;; |
| 6821 | esac; |
| 6822 | tx=yes; |
| 6823 | case "$reuseval-$4" in |
| 6824 | true-) ;; |
| 6825 | true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; |
| 6826 | esac; |
| 6827 | case "$tx" in |
| 6828 | yes) |
| 6829 | tval=false; |
| 6830 | if $test "$runnm" = true; then |
| 6831 | if $contains $tlook $tf >/dev/null 2>&1; then |
| 6832 | tval=true; |
| 6833 | elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then |
| 6834 | echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c; |
| 6835 | $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true; |
| 6836 | $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; }; |
| 6837 | $rm_try; |
| 6838 | fi; |
| 6839 | else |
| 6840 | echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c; |
| 6841 | $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true; |
| 6842 | $rm_try; |
| 6843 | fi; |
| 6844 | ;; |
| 6845 | *) |
| 6846 | case "$tval" in |
| 6847 | $define) tval=true;; |
| 6848 | *) tval=false;; |
| 6849 | esac; |
| 6850 | ;; |
| 6851 | esac; |
| 6852 | eval "$2=$tval"' |
| 6853 | |
| 6854 | : define an is-in-libc? function |
| 6855 | inlibc='echo " "; td=$define; tu=$undef; |
| 6856 | sym=$1; var=$2; eval "was=\$$2"; |
| 6857 | tx=yes; |
| 6858 | case "$reuseval$was" in |
| 6859 | true) ;; |
| 6860 | true*) tx=no;; |
| 6861 | esac; |
| 6862 | case "$tx" in |
| 6863 | yes) |
| 6864 | set $sym tres -f; |
| 6865 | eval $csym; |
| 6866 | case "$tres" in |
| 6867 | true) |
| 6868 | echo "$sym() found." >&4; |
| 6869 | case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";; |
| 6870 | *) |
| 6871 | echo "$sym() NOT found." >&4; |
| 6872 | case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";; |
| 6873 | esac;; |
| 6874 | *) |
| 6875 | case "$was" in |
| 6876 | $define) echo "$sym() found." >&4;; |
| 6877 | *) echo "$sym() NOT found." >&4;; |
| 6878 | esac;; |
| 6879 | esac' |
| 6880 | |
| 6881 | : check for length of double |
| 6882 | echo " " |
| 6883 | case "$doublesize" in |
| 6884 | '') |
| 6885 | echo "Checking to see how big your double precision numbers are..." >&4 |
| 6886 | $cat >try.c <<EOCP |
| 6887 | #include <stdio.h> |
| 6888 | #$i_stdlib I_STDLIB |
| 6889 | #ifdef I_STDLIB |
| 6890 | #include <stdlib.h> |
| 6891 | #endif |
| 6892 | int main() |
| 6893 | { |
| 6894 | printf("%d\n", (int)sizeof(double)); |
| 6895 | exit(0); |
| 6896 | } |
| 6897 | EOCP |
| 6898 | set try |
| 6899 | if eval $compile_ok; then |
| 6900 | doublesize=`$run ./try` |
| 6901 | echo "Your double is $doublesize bytes long." |
| 6902 | else |
| 6903 | dflt='8' |
| 6904 | echo "(I can't seem to compile the test program. Guessing...)" |
| 6905 | rp="What is the size of a double precision number (in bytes)?" |
| 6906 | . ./myread |
| 6907 | doublesize="$ans" |
| 6908 | fi |
| 6909 | ;; |
| 6910 | esac |
| 6911 | $rm_try |
| 6912 | |
| 6913 | : check for long doubles |
| 6914 | echo " " |
| 6915 | echo "Checking to see if you have long double..." >&4 |
| 6916 | echo 'int main() { long double x = 7.0; }' > try.c |
| 6917 | set try |
| 6918 | if eval $compile; then |
| 6919 | val="$define" |
| 6920 | echo "You have long double." |
| 6921 | else |
| 6922 | val="$undef" |
| 6923 | echo "You do not have long double." |
| 6924 | fi |
| 6925 | $rm_try |
| 6926 | set d_longdbl |
| 6927 | eval $setvar |
| 6928 | |
| 6929 | : see if ldexpl exists |
| 6930 | set ldexpl d_ldexpl |
| 6931 | eval $inlibc |
| 6932 | |
| 6933 | : check for length of long double |
| 6934 | case "${d_longdbl}${longdblsize}" in |
| 6935 | $define) |
| 6936 | echo " " |
| 6937 | echo "Checking to see how big your long doubles are..." >&4 |
| 6938 | $cat >try.c <<'EOCP' |
| 6939 | #include <stdio.h> |
| 6940 | int main() |
| 6941 | { |
| 6942 | printf("%d\n", sizeof(long double)); |
| 6943 | } |
| 6944 | EOCP |
| 6945 | set try |
| 6946 | set try |
| 6947 | if eval $compile; then |
| 6948 | longdblsize=`$run ./try` |
| 6949 | echo "Your long doubles are $longdblsize bytes long." |
| 6950 | else |
| 6951 | dflt='8' |
| 6952 | echo " " |
| 6953 | echo "(I can't seem to compile the test program. Guessing...)" >&4 |
| 6954 | rp="What is the size of a long double (in bytes)?" |
| 6955 | . ./myread |
| 6956 | longdblsize="$ans" |
| 6957 | fi |
| 6958 | if $test "X$doublesize" = "X$longdblsize"; then |
| 6959 | echo "That isn't any different from an ordinary double." |
| 6960 | echo "I'll keep your setting anyway, but you may see some" |
| 6961 | echo "harmless compilation warnings." |
| 6962 | fi |
| 6963 | ;; |
| 6964 | esac |
| 6965 | $rm_try |
| 6966 | |
| 6967 | $echo "Checking the kind of long doubles you have..." >&4 |
| 6968 | case "$d_longdbl" in |
| 6969 | define) |
| 6970 | $cat <<EOP >try.c |
| 6971 | #$i_stdlib I_STDLIB |
| 6972 | #define LONGDBLSIZE $longdblsize |
| 6973 | #define DOUBLESIZE $doublesize |
| 6974 | #include <float.h> |
| 6975 | #ifdef I_STDLIB |
| 6976 | #include <stdlib.h> |
| 6977 | #endif |
| 6978 | #include <stdio.h> |
| 6979 | static const long double d = -0.1L; |
| 6980 | int main() { |
| 6981 | unsigned const char* b = (unsigned const char*)(&d); |
| 6982 | #if DOUBLESIZE == LONGDBLSIZE |
| 6983 | printf("0\n"); /* if it floats like double */ |
| 6984 | exit(0); |
| 6985 | #endif |
| 6986 | #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16 |
| 6987 | if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) { |
| 6988 | /* IEEE 754 128-bit little-endian */ |
| 6989 | printf("1\n"); |
| 6990 | exit(0); |
| 6991 | } |
| 6992 | if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) { |
| 6993 | /* IEEE 128-bit big-endian, e.g. solaris sparc */ |
| 6994 | printf("2\n"); |
| 6995 | exit(0); |
| 6996 | } |
| 6997 | #endif |
| 6998 | /* For alignment 32-bit platforms have the 80 bits in 12 bytes, |
| 6999 | * while 64-bits platforms have it in 16 bytes. The trailing bytes |
| 7000 | * cannot be trusted. */ |
| 7001 | #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12) |
| 7002 | if (b[0] == 0xCD && b[9] == 0xBF) { |
| 7003 | /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86) |
| 7004 | * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding. |
| 7005 | * Also known as "extended precision". */ |
| 7006 | printf("3\n"); |
| 7007 | exit(0); |
| 7008 | } |
| 7009 | if (b[0] == 0xBF && b[9] == 0xCD) { |
| 7010 | /* Is there ever big-endian 80-bit, really? |
| 7011 | * |
| 7012 | * The Motorola 68881 had another "extended precision" format: |
| 7013 | * sign:1 exp:15 zero:16 integer:1 mantissa:63 |
| 7014 | * for total of 96 bits of bytes. The zero bits were unused. |
| 7015 | * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details. |
| 7016 | * If it ever becomes relevant, this format should be allocated |
| 7017 | * a new doublekind code since it's quite different from the Intel x87. |
| 7018 | */ |
| 7019 | printf("4\n"); |
| 7020 | exit(0); |
| 7021 | } |
| 7022 | #endif |
| 7023 | #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16 |
| 7024 | /* software "double double", the 106 is 53+53. |
| 7025 | * but irix thinks it is 107. */ |
| 7026 | if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) { |
| 7027 | /* double double 128-bit fully little-endian, |
| 7028 | * little-endian doubles in little-endian order, |
| 7029 | * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */ |
| 7030 | printf("5\n"); |
| 7031 | exit(0); |
| 7032 | } |
| 7033 | if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) { |
| 7034 | /* double double 128-bit fully big-endian, |
| 7035 | * big-endian doubles in big-endian order, |
| 7036 | * e.g. PPC/Power and MIPS: |
| 7037 | * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */ |
| 7038 | printf("6\n"); |
| 7039 | exit(0); |
| 7040 | } |
| 7041 | if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) { |
| 7042 | /* double double 128-bit mixed endian. |
| 7043 | * little-endian doubles in big-endian order, |
| 7044 | * e.g. ppc64el, |
| 7045 | * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */ |
| 7046 | printf("7\n"); |
| 7047 | exit(0); |
| 7048 | } |
| 7049 | if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) { |
| 7050 | /* double double 128-bit mixed endian, |
| 7051 | * big-endian doubles in little-endian order, |
| 7052 | * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */ |
| 7053 | printf("8\n"); |
| 7054 | exit(0); |
| 7055 | } |
| 7056 | #endif |
| 7057 | /* We are largely making this up because it may well be |
| 7058 | * that the VAX format H was never made available to C, |
| 7059 | * only to Fortran. */ |
| 7060 | #if LONGDBLSIZE == 16 && defined(__vax__) |
| 7061 | if (b[0] == 0xFD && b[15] == 0x99) { |
| 7062 | /* VAX format H, PDP-11 mixed endian. */ |
| 7063 | printf("9\n"); |
| 7064 | exit(0); |
| 7065 | } |
| 7066 | #endif |
| 7067 | printf("-1\n"); /* unknown */ |
| 7068 | exit(0); |
| 7069 | } |
| 7070 | EOP |
| 7071 | set try |
| 7072 | if eval $compile; then |
| 7073 | longdblkind=`$run ./try` |
| 7074 | else |
| 7075 | longdblkind=-1 |
| 7076 | fi |
| 7077 | ;; |
| 7078 | *) longdblkind=0 ;; |
| 7079 | esac |
| 7080 | case "$longdblkind" in |
| 7081 | 0) echo "Your long doubles are doubles." >&4 ;; |
| 7082 | 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;; |
| 7083 | 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;; |
| 7084 | 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;; |
| 7085 | 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;; |
| 7086 | 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;; |
| 7087 | 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;; |
| 7088 | 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;; |
| 7089 | 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;; |
| 7090 | 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;; |
| 7091 | *) echo "Cannot figure out your long double." >&4 ;; |
| 7092 | esac |
| 7093 | d_long_double_style_ieee=$undef |
| 7094 | d_long_double_style_ieee_std=$undef |
| 7095 | d_long_double_style_ieee_extended=$undef |
| 7096 | d_long_double_style_ieee_doubledouble=$undef |
| 7097 | d_long_double_style_vax=$undef |
| 7098 | case "$longdblkind" in |
| 7099 | 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;; |
| 7100 | esac |
| 7101 | case "$longdblkind" in |
| 7102 | 1|2) d_long_double_style_ieee_std=$define ;; |
| 7103 | esac |
| 7104 | case "$longdblkind" in |
| 7105 | 3|4) d_long_double_style_ieee_extended=$define ;; |
| 7106 | esac |
| 7107 | case "$longdblkind" in |
| 7108 | 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;; |
| 7109 | esac |
| 7110 | case "$longdblkind" in |
| 7111 | 9) d_long_double_style_vax=$define ;; |
| 7112 | esac |
| 7113 | $rm_try |
| 7114 | |
| 7115 | : determine the architecture name |
| 7116 | echo " " |
| 7117 | if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then |
| 7118 | tarch=`arch`"-$osname" |
| 7119 | elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then |
| 7120 | if uname -m > tmparch 2>&1 ; then |
| 7121 | tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ |
| 7122 | -e 's/$/'"-$osname/" tmparch` |
| 7123 | else |
| 7124 | tarch="$osname" |
| 7125 | fi |
| 7126 | $rm -f tmparch |
| 7127 | else |
| 7128 | tarch="$osname" |
| 7129 | fi |
| 7130 | case "$myarchname" in |
| 7131 | ''|"$tarch") ;; |
| 7132 | *) |
| 7133 | echo "(Your architecture name used to be $myarchname.)" |
| 7134 | archname='' |
| 7135 | ;; |
| 7136 | esac |
| 7137 | case "$targetarch" in |
| 7138 | '') ;; |
| 7139 | *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;; |
| 7140 | esac |
| 7141 | myarchname="$tarch" |
| 7142 | case "$archname" in |
| 7143 | '') dflt="$tarch";; |
| 7144 | *) dflt="$archname";; |
| 7145 | esac |
| 7146 | rp='What is your architecture name' |
| 7147 | . ./myread |
| 7148 | archname="$ans" |
| 7149 | |
| 7150 | : optionally add API version to the architecture for versioned archlibs |
| 7151 | case "$useversionedarchname" in |
| 7152 | $define|true|[yY]*) dflt='y';; |
| 7153 | *) dflt='n';; |
| 7154 | esac |
| 7155 | rp='Add the Perl API version to your archname?' |
| 7156 | . ./myread |
| 7157 | case "$ans" in |
| 7158 | y|Y) useversionedarchname="$define" ;; |
| 7159 | *) useversionedarchname="$undef" ;; |
| 7160 | esac |
| 7161 | case "$useversionedarchname" in |
| 7162 | $define) |
| 7163 | case "$archname" in |
| 7164 | *-$api_versionstring) |
| 7165 | echo "...and architecture name already has -$api_versionstring" >&4 |
| 7166 | ;; |
| 7167 | *) |
| 7168 | archname="$archname-$api_versionstring" |
| 7169 | echo "...setting architecture name to $archname." >&4 |
| 7170 | ;; |
| 7171 | esac |
| 7172 | ;; |
| 7173 | esac |
| 7174 | |
| 7175 | case "$usethreads" in |
| 7176 | $define) |
| 7177 | echo "Threads selected." >&4 |
| 7178 | case "$archname" in |
| 7179 | *-thread*) echo "...and architecture name already has -thread." >&4 |
| 7180 | ;; |
| 7181 | *) archname="$archname-thread" |
| 7182 | echo "...setting architecture name to $archname." >&4 |
| 7183 | ;; |
| 7184 | esac |
| 7185 | ;; |
| 7186 | esac |
| 7187 | case "$usemultiplicity" in |
| 7188 | $define) |
| 7189 | echo "Multiplicity selected." >&4 |
| 7190 | case "$archname" in |
| 7191 | *-multi*) echo "...and architecture name already has -multi." >&4 |
| 7192 | ;; |
| 7193 | *) archname="$archname-multi" |
| 7194 | echo "...setting architecture name to $archname." >&4 |
| 7195 | ;; |
| 7196 | esac |
| 7197 | ;; |
| 7198 | esac |
| 7199 | case "$use64bitint$use64bitall" in |
| 7200 | *"$define"*) |
| 7201 | case "$archname64" in |
| 7202 | '') |
| 7203 | echo "This architecture is naturally 64-bit, not changing architecture name." >&4 |
| 7204 | ;; |
| 7205 | *) |
| 7206 | case "$use64bitint" in |
| 7207 | "$define") echo "64 bit integers selected." >&4 ;; |
| 7208 | esac |
| 7209 | case "$use64bitall" in |
| 7210 | "$define") echo "Maximal 64 bitness selected." >&4 ;; |
| 7211 | esac |
| 7212 | case "$archname" in |
| 7213 | *-$archname64*) echo "...and architecture name already has $archname64." >&4 |
| 7214 | ;; |
| 7215 | *) archname="$archname-$archname64" |
| 7216 | echo "...setting architecture name to $archname." >&4 |
| 7217 | ;; |
| 7218 | esac |
| 7219 | ;; |
| 7220 | esac |
| 7221 | esac |
| 7222 | case "$uselongdouble" in |
| 7223 | $define) |
| 7224 | echo "Long doubles selected." >&4 |
| 7225 | case "$longdblsize" in |
| 7226 | $doublesize) |
| 7227 | echo "...but long doubles are equal to doubles, not changing architecture name." >&4 |
| 7228 | ;; |
| 7229 | *) |
| 7230 | case "$archname" in |
| 7231 | *-ld*) echo "...and architecture name already has -ld." >&4 |
| 7232 | ;; |
| 7233 | *) archname="$archname-ld" |
| 7234 | echo "...setting architecture name to $archname." >&4 |
| 7235 | ;; |
| 7236 | esac |
| 7237 | ;; |
| 7238 | esac |
| 7239 | ;; |
| 7240 | esac |
| 7241 | case "$usequadmath" in |
| 7242 | $define) |
| 7243 | echo "quadmath selected." >&4 |
| 7244 | case "$archname" in |
| 7245 | *-quadmath*) echo "...and architecture name already has -quadmath." >&4 |
| 7246 | ;; |
| 7247 | *) archname="$archname-quadmath" |
| 7248 | echo "...setting architecture name to $archname." >&4 |
| 7249 | ;; |
| 7250 | esac |
| 7251 | ;; |
| 7252 | esac |
| 7253 | if $test -f archname.cbu; then |
| 7254 | echo "Your platform has some specific hints for architecture name, using them..." |
| 7255 | . ./archname.cbu |
| 7256 | fi |
| 7257 | |
| 7258 | : set the prefixit variable, to compute a suitable default value |
| 7259 | prefixit='case "$3" in |
| 7260 | ""|none) |
| 7261 | case "$oldprefix" in |
| 7262 | "") eval "$1=\"\$$2\"";; |
| 7263 | *) |
| 7264 | case "$3" in |
| 7265 | "") eval "$1=";; |
| 7266 | none) |
| 7267 | eval "tp=\"\$$2\""; |
| 7268 | case "$tp" in |
| 7269 | ""|" "|none) eval "$1=\"\$$2\"";; |
| 7270 | *) eval "$1=";; |
| 7271 | esac;; |
| 7272 | esac;; |
| 7273 | esac;; |
| 7274 | *) |
| 7275 | eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; |
| 7276 | case "$tp" in |
| 7277 | --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; |
| 7278 | /*-$oldprefix/*|\~*-$oldprefix/*) |
| 7279 | eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; |
| 7280 | *) eval "$1=\"\$$2\"";; |
| 7281 | esac;; |
| 7282 | esac' |
| 7283 | |
| 7284 | : determine installation style |
| 7285 | : For now, try to deduce it from prefix unless it is already set. |
| 7286 | : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7. |
| 7287 | case "$installstyle" in |
| 7288 | '') case "$prefix" in |
| 7289 | *perl*) dflt='lib';; |
| 7290 | *) dflt='lib/perl5' ;; |
| 7291 | esac |
| 7292 | ;; |
| 7293 | *) dflt="$installstyle" ;; |
| 7294 | esac |
| 7295 | : Probably not worth prompting for this since we prompt for all |
| 7296 | : the directories individually, and the prompt would be too long and |
| 7297 | : confusing anyway. |
| 7298 | installstyle=$dflt |
| 7299 | |
| 7300 | : determine where public executables go |
| 7301 | echo " " |
| 7302 | set dflt bin bin |
| 7303 | eval $prefixit |
| 7304 | fn=d~ |
| 7305 | rp='Pathname where the public executables will reside?' |
| 7306 | . ./getfile |
| 7307 | if $test "X$ansexp" != "X$binexp"; then |
| 7308 | installbin='' |
| 7309 | fi |
| 7310 | prefixvar=bin |
| 7311 | : XXX Bug? -- ignores Configure -Dinstallprefix setting. |
| 7312 | : XXX If this is fixed, also fix the "start perl" hunk below, which relies on |
| 7313 | : this via initialinstalllocation |
| 7314 | . ./setprefixvar |
| 7315 | |
| 7316 | case "$userelocatableinc" in |
| 7317 | $define|true|[yY]*) dflt='y' ;; |
| 7318 | *) dflt='n' ;; |
| 7319 | esac |
| 7320 | cat <<EOM |
| 7321 | |
| 7322 | Would you like to build Perl so that the installation is relocatable, so that |
| 7323 | library paths in @INC are determined relative to the path of the perl binary? |
| 7324 | This is not advised for system Perl installs, or if you need to run setid |
| 7325 | scripts or scripts under taint mode. |
| 7326 | |
| 7327 | If this doesn't make any sense to you, just accept the default '$dflt'. |
| 7328 | EOM |
| 7329 | rp='Use relocatable @INC?' |
| 7330 | . ./myread |
| 7331 | case "$ans" in |
| 7332 | y|Y) val="$define" ;; |
| 7333 | *) val="$undef" ;; |
| 7334 | esac |
| 7335 | set userelocatableinc |
| 7336 | eval $setvar |
| 7337 | |
| 7338 | initialinstalllocation="$binexp" |
| 7339 | : Default prefix is now "up one level from where the binaries are" |
| 7340 | case "$userelocatableinc" in |
| 7341 | $define|true|[yY]*) |
| 7342 | bin=".../" |
| 7343 | binexp=".../" |
| 7344 | prefix=".../.." |
| 7345 | prefixexp=".../.." |
| 7346 | installprefixexp=".../.." |
| 7347 | ;; |
| 7348 | esac |
| 7349 | |
| 7350 | : determine where private library files go |
| 7351 | : Usual default is /usr/local/lib/perl5/$version. |
| 7352 | : Also allow things like /opt/perl/lib/$version, since |
| 7353 | : /opt/perl/lib/perl5... would be redundant. |
| 7354 | : The default "style" setting is made in installstyle.U |
| 7355 | case "$installstyle" in |
| 7356 | *lib/perl5*) set dflt privlib lib/$package/$version ;; |
| 7357 | *) set dflt privlib lib/$version ;; |
| 7358 | esac |
| 7359 | eval $prefixit |
| 7360 | $cat <<EOM |
| 7361 | |
| 7362 | There are some auxiliary files for $package that need to be put into a |
| 7363 | private library directory that is accessible by everyone. |
| 7364 | |
| 7365 | EOM |
| 7366 | fn=$binexp |
| 7367 | fn=d~+ |
| 7368 | rp='Pathname where the private library files will reside?' |
| 7369 | . ./getfile |
| 7370 | prefixvar=privlib |
| 7371 | . ./setprefixvar |
| 7372 | |
| 7373 | : set the prefixup variable, to restore leading tilda escape |
| 7374 | prefixup='case "$prefixexp" in |
| 7375 | "$prefix") ;; |
| 7376 | *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; |
| 7377 | esac' |
| 7378 | |
| 7379 | : determine where public architecture dependent libraries go |
| 7380 | set archlib archlib |
| 7381 | eval $prefixit |
| 7382 | : privlib default is /usr/local/lib/$package/$version |
| 7383 | : archlib default is /usr/local/lib/$package/$version/$archname |
| 7384 | : privlib may have an optional trailing /share. |
| 7385 | tdflt=`echo $privlib | $sed 's,/share$,,'` |
| 7386 | tdflt=$tdflt/$archname |
| 7387 | case "$archlib" in |
| 7388 | '') dflt=$tdflt |
| 7389 | ;; |
| 7390 | *) dflt="$archlib" |
| 7391 | ;; |
| 7392 | esac |
| 7393 | $cat <<EOM |
| 7394 | |
| 7395 | $spackage contains architecture-dependent library files. If you are |
| 7396 | sharing libraries in a heterogeneous environment, you might store |
| 7397 | these files in a separate location. Otherwise, you can just include |
| 7398 | them with the rest of the public library files. |
| 7399 | |
| 7400 | EOM |
| 7401 | fn=$binexp |
| 7402 | fn=d+~ |
| 7403 | rp='Where do you want to put the public architecture-dependent libraries?' |
| 7404 | . ./getfile |
| 7405 | prefixvar=archlib |
| 7406 | . ./setprefixvar |
| 7407 | if $test X"$archlib" = X"$privlib"; then |
| 7408 | d_archlib="$undef" |
| 7409 | else |
| 7410 | d_archlib="$define" |
| 7411 | fi |
| 7412 | |
| 7413 | : see if setuid scripts can be secure |
| 7414 | $cat <<EOM |
| 7415 | |
| 7416 | Some kernels have a bug that prevents setuid #! scripts from being |
| 7417 | secure. Some sites have disabled setuid #! scripts because of this. |
| 7418 | |
| 7419 | First let's decide if your kernel supports secure setuid #! scripts. |
| 7420 | (If setuid #! scripts would be secure but have been disabled anyway, |
| 7421 | don't say that they are secure if asked.) |
| 7422 | |
| 7423 | EOM |
| 7424 | |
| 7425 | val="$undef" |
| 7426 | if $test -d /dev/fd; then |
| 7427 | echo "#!$ls" >reflect |
| 7428 | chmod +x,u+s reflect |
| 7429 | ./reflect >flect 2>&1 |
| 7430 | if $contains "/dev/fd" flect >/dev/null; then |
| 7431 | echo "Congratulations, your kernel has secure setuid scripts!" >&4 |
| 7432 | val="$define" |
| 7433 | else |
| 7434 | $cat <<EOM |
| 7435 | If you are not sure if they are secure, I can check but I'll need a |
| 7436 | username and password different from the one you are using right now. |
| 7437 | If you don't have such a username or don't want me to test, simply |
| 7438 | enter 'none'. |
| 7439 | |
| 7440 | EOM |
| 7441 | rp='Other username to test security of setuid scripts with?' |
| 7442 | dflt='none' |
| 7443 | . ./myread |
| 7444 | case "$ans" in |
| 7445 | n|none) |
| 7446 | case "$d_suidsafe" in |
| 7447 | '') echo "I'll assume setuid scripts are *not* secure." >&4 |
| 7448 | dflt=n;; |
| 7449 | "$undef") |
| 7450 | echo "Well, the $hint value is *not* secure." >&4 |
| 7451 | dflt=n;; |
| 7452 | *) echo "Well, the $hint value *is* secure." >&4 |
| 7453 | dflt=y;; |
| 7454 | esac |
| 7455 | ;; |
| 7456 | *) |
| 7457 | $rm -f reflect flect |
| 7458 | echo "#!$ls" >reflect |
| 7459 | chmod +x,u+s reflect |
| 7460 | echo >flect |
| 7461 | chmod a+w flect |
| 7462 | echo '"su" will (probably) prompt you for '"$ans's password." |
| 7463 | su $ans -c './reflect >flect' |
| 7464 | if $contains "/dev/fd" flect >/dev/null; then |
| 7465 | echo "Okay, it looks like setuid scripts are secure." >&4 |
| 7466 | dflt=y |
| 7467 | else |
| 7468 | echo "I don't think setuid scripts are secure." >&4 |
| 7469 | dflt=n |
| 7470 | fi |
| 7471 | ;; |
| 7472 | esac |
| 7473 | rp='Does your kernel have *secure* setuid scripts?' |
| 7474 | . ./myread |
| 7475 | case "$ans" in |
| 7476 | [yY]*) val="$define";; |
| 7477 | *) val="$undef";; |
| 7478 | esac |
| 7479 | fi |
| 7480 | else |
| 7481 | echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 |
| 7482 | echo "(That's for file descriptors, not floppy disks.)" |
| 7483 | val="$undef" |
| 7484 | fi |
| 7485 | set d_suidsafe |
| 7486 | eval $setvar |
| 7487 | |
| 7488 | $rm -f reflect flect |
| 7489 | |
| 7490 | : now see if they want to do setuid emulation |
| 7491 | if $test $patchlevel -lt 11; then |
| 7492 | echo " " |
| 7493 | val="$undef" |
| 7494 | case "$d_suidsafe" in |
| 7495 | "$define") |
| 7496 | val="$undef" |
| 7497 | echo "No need to emulate SUID scripts since they are secure here." >&4 |
| 7498 | ;; |
| 7499 | *) |
| 7500 | $cat <<EOM |
| 7501 | Some systems have disabled setuid scripts, especially systems where |
| 7502 | setuid scripts cannot be secure. On systems where setuid scripts have |
| 7503 | been disabled, the setuid/setgid bits on scripts are currently |
| 7504 | useless. It is possible for $package to detect those bits and emulate |
| 7505 | setuid/setgid in a secure fashion. This emulation will only work if |
| 7506 | setuid scripts have been disabled in your kernel. |
| 7507 | |
| 7508 | EOM |
| 7509 | case "$d_dosuid" in |
| 7510 | "$define") dflt=y ;; |
| 7511 | *) dflt=n ;; |
| 7512 | esac |
| 7513 | rp="Do you want to do setuid/setgid emulation?" |
| 7514 | . ./myread |
| 7515 | case "$ans" in |
| 7516 | [yY]*) val="$define";; |
| 7517 | *) val="$undef";; |
| 7518 | esac |
| 7519 | ;; |
| 7520 | esac |
| 7521 | set d_dosuid |
| 7522 | eval $setvar |
| 7523 | else |
| 7524 | case "$d_dosuid" in |
| 7525 | "$define") |
| 7526 | cat >&4 <<EOH |
| 7527 | |
| 7528 | SUID emulation has been removed for 5.12 |
| 7529 | Please re-run Configure without -Dd_dosuid |
| 7530 | |
| 7531 | EOH |
| 7532 | exit 1; |
| 7533 | ;; |
| 7534 | esac |
| 7535 | d_dosuid=undef |
| 7536 | fi |
| 7537 | |
| 7538 | : Find perl5.005 or later. |
| 7539 | echo "Looking for a previously installed perl5.005 or later... " |
| 7540 | case "$perl5" in |
| 7541 | '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do |
| 7542 | : Check if this perl is recent and can load a simple module |
| 7543 | if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then |
| 7544 | perl5=$tdir/perl |
| 7545 | break; |
| 7546 | elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then |
| 7547 | perl5=$tdir/perl5 |
| 7548 | break; |
| 7549 | fi |
| 7550 | done |
| 7551 | ;; |
| 7552 | *) perl5="$perl5" |
| 7553 | ;; |
| 7554 | esac |
| 7555 | case "$perl5" in |
| 7556 | '') echo "None found. That's ok.";; |
| 7557 | *) echo "Using $perl5." ;; |
| 7558 | esac |
| 7559 | |
| 7560 | : Set the siteprefix variables |
| 7561 | $cat <<EOM |
| 7562 | |
| 7563 | After $package is installed, you may wish to install various |
| 7564 | add-on modules and utilities. Typically, these add-ons will |
| 7565 | be installed under $prefix with the rest |
| 7566 | of this package. However, you may wish to install such add-ons |
| 7567 | elsewhere under a different prefix. |
| 7568 | |
| 7569 | If you do not wish to put everything under a single prefix, that's |
| 7570 | ok. You will be prompted for the individual locations; this siteprefix |
| 7571 | is only used to suggest the defaults. |
| 7572 | |
| 7573 | The default should be fine for most people. |
| 7574 | |
| 7575 | EOM |
| 7576 | fn=d~+ |
| 7577 | rp='Installation prefix to use for add-on modules and utilities?' |
| 7578 | : XXX Here might be another good place for an installstyle setting. |
| 7579 | case "$siteprefix" in |
| 7580 | '') dflt=$prefix ;; |
| 7581 | *) dflt=$siteprefix ;; |
| 7582 | esac |
| 7583 | . ./getfile |
| 7584 | : XXX Prefixit unit does not yet support siteprefix and vendorprefix |
| 7585 | oldsiteprefix='' |
| 7586 | case "$siteprefix" in |
| 7587 | '') ;; |
| 7588 | *) case "$ans" in |
| 7589 | "$prefix") ;; |
| 7590 | *) oldsiteprefix="$prefix";; |
| 7591 | esac |
| 7592 | ;; |
| 7593 | esac |
| 7594 | siteprefix="$ans" |
| 7595 | siteprefixexp="$ansexp" |
| 7596 | |
| 7597 | : determine where site specific libraries go. |
| 7598 | : Usual default is /usr/local/lib/perl5/site_perl/$version |
| 7599 | : The default "style" setting is made in installstyle.U |
| 7600 | : XXX No longer works with Prefixit stuff. |
| 7601 | prog=`echo $package | $sed 's/-*[0-9.]*$//'` |
| 7602 | case "$sitelib" in |
| 7603 | '') case "$installstyle" in |
| 7604 | *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;; |
| 7605 | *) dflt=$siteprefix/lib/site_$prog/$version ;; |
| 7606 | esac |
| 7607 | ;; |
| 7608 | *) dflt="$sitelib" |
| 7609 | ;; |
| 7610 | esac |
| 7611 | $cat <<EOM |
| 7612 | |
| 7613 | The installation process will create a directory for |
| 7614 | site-specific extensions and modules. Most users find it convenient |
| 7615 | to place all site-specific files in this directory rather than in the |
| 7616 | main distribution directory. |
| 7617 | |
| 7618 | EOM |
| 7619 | fn=d~+ |
| 7620 | rp='Pathname for the site-specific library files?' |
| 7621 | . ./getfile |
| 7622 | prefixvar=sitelib |
| 7623 | . ./setprefixvar |
| 7624 | sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` |
| 7625 | |
| 7626 | : Determine list of previous versions to include in @INC |
| 7627 | $cat > getverlist <<EOPL |
| 7628 | #!$perl5 -w |
| 7629 | use File::Basename; |
| 7630 | \$api_versionstring = "$api_versionstring"; |
| 7631 | \$version = "$version"; |
| 7632 | \$stem = "$sitelib_stem"; |
| 7633 | \$archname = "$archname"; |
| 7634 | EOPL |
| 7635 | $cat >> getverlist <<'EOPL' |
| 7636 | # The list found is store twice for each entry: the original name, and |
| 7637 | # the binary broken down version as pack "sss", so sorting is easy and |
| 7638 | # unambiguous. This will work for all versions that have a maximum of |
| 7639 | # three digit groups, separate by '.'s or '_'s. Names are extended with |
| 7640 | # ".0.0" to ensure at least three elements for the pack. |
| 7641 | # -- H.Merijn Brand (m)'06 23-10-2006 |
| 7642 | |
| 7643 | # Can't have leading @ because metaconfig interprets it as a command! |
| 7644 | ;@inc_version_list=(); |
| 7645 | # XXX Redo to do opendir/readdir? |
| 7646 | if (-d $stem) { |
| 7647 | chdir($stem); |
| 7648 | ;@candidates = map { |
| 7649 | [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*"); |
| 7650 | ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates; |
| 7651 | } |
| 7652 | else { |
| 7653 | ;@candidates = (); |
| 7654 | } |
| 7655 | |
| 7656 | ($pversion, $aversion, $vsn5005) = map { |
| 7657 | pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005"; |
| 7658 | foreach $d (@candidates) { |
| 7659 | if ($d->[1] lt $pversion) { |
| 7660 | if ($d->[1] ge $aversion) { |
| 7661 | unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]); |
| 7662 | } |
| 7663 | elsif ($d->[1] ge $vsn5005) { |
| 7664 | unshift(@inc_version_list, grep { -d } $d->[0]); |
| 7665 | } |
| 7666 | } |
| 7667 | else { |
| 7668 | # Skip newer version. I.e. don't look in |
| 7669 | # 5.7.0 if we're installing 5.6.1. |
| 7670 | } |
| 7671 | } |
| 7672 | |
| 7673 | if (@inc_version_list) { |
| 7674 | print join(' ', @inc_version_list); |
| 7675 | } |
| 7676 | else { |
| 7677 | # Blank space to preserve value for next Configure run. |
| 7678 | print " "; |
| 7679 | } |
| 7680 | EOPL |
| 7681 | chmod +x getverlist |
| 7682 | case "$inc_version_list" in |
| 7683 | '') if test -x "$perl5$exe_ext"; then |
| 7684 | dflt=`$perl5 getverlist` |
| 7685 | else |
| 7686 | dflt='none' |
| 7687 | fi |
| 7688 | ;; |
| 7689 | $undef) dflt='none' ;; |
| 7690 | *) eval dflt=\"$inc_version_list\" ;; |
| 7691 | esac |
| 7692 | case "$dflt" in |
| 7693 | ''|' ') dflt=none ;; |
| 7694 | esac |
| 7695 | case "$dflt" in |
| 7696 | 5.005) dflt=none ;; |
| 7697 | esac |
| 7698 | $cat <<EOM |
| 7699 | |
| 7700 | In order to ease the process of upgrading, this version of perl |
| 7701 | can be configured to use modules built and installed with earlier |
| 7702 | versions of perl that were installed under $prefix. Specify here |
| 7703 | the list of earlier versions that this version of perl should check. |
| 7704 | If Configure detected no earlier versions of perl installed under |
| 7705 | $prefix, then the list will be empty. Answer 'none' to tell perl |
| 7706 | to not search earlier versions. |
| 7707 | |
| 7708 | The default should almost always be sensible, so if you're not sure, |
| 7709 | just accept the default. |
| 7710 | EOM |
| 7711 | |
| 7712 | rp='List of earlier versions to include in @INC?' |
| 7713 | . ./myread |
| 7714 | case "$ans" in |
| 7715 | [Nn]one|''|' '|$undef) inc_version_list=' ' ;; |
| 7716 | *) inc_version_list="$ans" ;; |
| 7717 | esac |
| 7718 | case "$inc_version_list" in |
| 7719 | ''|' ') |
| 7720 | inc_version_list_init='0' |
| 7721 | d_inc_version_list="$undef" |
| 7722 | ;; |
| 7723 | *) inc_version_list_init=`echo $inc_version_list | |
| 7724 | $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'` |
| 7725 | d_inc_version_list="$define" |
| 7726 | ;; |
| 7727 | esac |
| 7728 | $rm -f getverlist |
| 7729 | |
| 7730 | : see if malloc/malloc.h has to be included |
| 7731 | set malloc/malloc.h i_mallocmalloc |
| 7732 | eval $inhdr |
| 7733 | |
| 7734 | : see if this is a malloc.h system |
| 7735 | : we want a real compile instead of Inhdr because some systems have a |
| 7736 | : malloc.h that just gives a compile error saying to use stdlib.h instead |
| 7737 | echo " " |
| 7738 | $cat >try.c <<EOCP |
| 7739 | #include <stdlib.h> |
| 7740 | #include <malloc.h> |
| 7741 | #$i_mallocmalloc I_MALLOCMALLOC |
| 7742 | #ifdef I_MALLOCMALLOC |
| 7743 | # include <malloc/malloc.h> |
| 7744 | #endif |
| 7745 | |
| 7746 | int main () { return 0; } |
| 7747 | EOCP |
| 7748 | set try |
| 7749 | if eval $compile; then |
| 7750 | echo "<malloc.h> found." >&4 |
| 7751 | val="$define" |
| 7752 | else |
| 7753 | echo "<malloc.h> NOT found." >&4 |
| 7754 | val="$undef" |
| 7755 | fi |
| 7756 | $rm_try |
| 7757 | set i_malloc |
| 7758 | eval $setvar |
| 7759 | |
| 7760 | : check for length of pointer |
| 7761 | echo " " |
| 7762 | case "$ptrsize" in |
| 7763 | '') |
| 7764 | echo "Checking to see how big your pointers are..." >&4 |
| 7765 | $cat >try.c <<EOCP |
| 7766 | #include <stdio.h> |
| 7767 | #$i_stdlib I_STDLIB |
| 7768 | #ifdef I_STDLIB |
| 7769 | #include <stdlib.h> |
| 7770 | #endif |
| 7771 | int main() |
| 7772 | { |
| 7773 | printf("%d\n", (int)sizeof(void *)); |
| 7774 | exit(0); |
| 7775 | } |
| 7776 | EOCP |
| 7777 | set try |
| 7778 | if eval $compile_ok; then |
| 7779 | ptrsize=`$run ./try` |
| 7780 | echo "Your pointers are $ptrsize bytes long." |
| 7781 | else |
| 7782 | dflt='4' |
| 7783 | echo "(I can't seem to compile the test program. Guessing...)" >&4 |
| 7784 | rp="What is the size of a pointer (in bytes)?" |
| 7785 | . ./myread |
| 7786 | ptrsize="$ans" |
| 7787 | fi |
| 7788 | ;; |
| 7789 | esac |
| 7790 | $rm_try |
| 7791 | case "$use64bitall" in |
| 7792 | "$define"|true|[yY]*) |
| 7793 | case "$ptrsize" in |
| 7794 | 4) cat <<EOM >&4 |
| 7795 | |
| 7796 | *** You have chosen a maximally 64-bit build, |
| 7797 | *** but your pointers are only 4 bytes wide. |
| 7798 | *** Please rerun Configure without -Duse64bitall. |
| 7799 | EOM |
| 7800 | case "$d_quad" in |
| 7801 | define) |
| 7802 | cat <<EOM >&4 |
| 7803 | *** Since you have quads, you could possibly try with -Duse64bitint. |
| 7804 | EOM |
| 7805 | ;; |
| 7806 | esac |
| 7807 | cat <<EOM >&4 |
| 7808 | *** Cannot continue, aborting. |
| 7809 | |
| 7810 | EOM |
| 7811 | |
| 7812 | exit 1 |
| 7813 | ;; |
| 7814 | esac |
| 7815 | ;; |
| 7816 | esac |
| 7817 | |
| 7818 | : determine whether to use malloc wrapping |
| 7819 | echo " " |
| 7820 | case "$usemallocwrap" in |
| 7821 | [yY]*|true|$define) dflt='y' ;; |
| 7822 | [nN]*|false|$undef) dflt='n' ;; |
| 7823 | *) case "$usedevel" in |
| 7824 | [yY]*|true|$define) dflt='y' ;; |
| 7825 | *) dflt='n' ;; |
| 7826 | esac |
| 7827 | ;; |
| 7828 | esac |
| 7829 | rp="Do you wish to wrap malloc calls to protect against potential overflows?" |
| 7830 | . ./myread |
| 7831 | usemallocwrap="$ans" |
| 7832 | case "$ans" in |
| 7833 | y*|true) |
| 7834 | usemallocwrap="$define" ;; |
| 7835 | *) |
| 7836 | usemallocwrap="$undef" ;; |
| 7837 | esac |
| 7838 | |
| 7839 | : determine which malloc to compile in |
| 7840 | echo " " |
| 7841 | case "$usemymalloc" in |
| 7842 | [yY]*|true|$define) dflt='y' ;; |
| 7843 | [nN]*|false|$undef) dflt='n' ;; |
| 7844 | *) case "$ptrsize" in |
| 7845 | 4) dflt='y' ;; |
| 7846 | *) dflt='n' ;; |
| 7847 | esac |
| 7848 | if test "$useithreads" = "$define"; then dflt='n'; fi |
| 7849 | ;; |
| 7850 | esac |
| 7851 | rp="Do you wish to attempt to use the malloc that comes with $package?" |
| 7852 | . ./myread |
| 7853 | usemymalloc="$ans" |
| 7854 | case "$ans" in |
| 7855 | y*|true) |
| 7856 | usemymalloc='y' |
| 7857 | mallocsrc='malloc.c' |
| 7858 | mallocobj="malloc$_o" |
| 7859 | d_mymalloc="$define" |
| 7860 | case "$libs" in |
| 7861 | *-lmalloc*) |
| 7862 | : Remove malloc from list of libraries to use |
| 7863 | echo "Removing unneeded -lmalloc from library list" >&4 |
| 7864 | set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` |
| 7865 | shift |
| 7866 | libs="$*" |
| 7867 | echo "libs = $libs" >&4 |
| 7868 | ;; |
| 7869 | esac |
| 7870 | ;; |
| 7871 | *) |
| 7872 | usemymalloc='n' |
| 7873 | mallocsrc='' |
| 7874 | mallocobj='' |
| 7875 | d_mymalloc="$undef" |
| 7876 | ;; |
| 7877 | esac |
| 7878 | |
| 7879 | : compute the return types of malloc and free |
| 7880 | echo " " |
| 7881 | $cat >malloc.c <<END |
| 7882 | #$i_malloc I_MALLOC |
| 7883 | #$i_stdlib I_STDLIB |
| 7884 | #include <stdio.h> |
| 7885 | #include <sys/types.h> |
| 7886 | #ifdef I_MALLOC |
| 7887 | #include <malloc.h> |
| 7888 | #endif |
| 7889 | #ifdef I_STDLIB |
| 7890 | #include <stdlib.h> |
| 7891 | #endif |
| 7892 | #ifdef TRY_MALLOC |
| 7893 | void *malloc(); |
| 7894 | #endif |
| 7895 | #ifdef TRY_FREE |
| 7896 | void free(); |
| 7897 | #endif |
| 7898 | END |
| 7899 | case "$malloctype" in |
| 7900 | '') |
| 7901 | if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then |
| 7902 | malloctype='void *' |
| 7903 | else |
| 7904 | malloctype='char *' |
| 7905 | fi |
| 7906 | ;; |
| 7907 | esac |
| 7908 | echo "Your system wants malloc to return '$malloctype', it would seem." >&4 |
| 7909 | |
| 7910 | case "$freetype" in |
| 7911 | '') |
| 7912 | if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then |
| 7913 | freetype='void' |
| 7914 | else |
| 7915 | freetype='int' |
| 7916 | fi |
| 7917 | ;; |
| 7918 | esac |
| 7919 | echo "Your system uses $freetype free(), it would seem." >&4 |
| 7920 | $rm -f malloc.[co] |
| 7921 | : determine where site specific architecture-dependent libraries go. |
| 7922 | : sitelib default is /usr/local/lib/perl5/site_perl/$version |
| 7923 | : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname |
| 7924 | : sitelib may have an optional trailing /share. |
| 7925 | case "$sitearch" in |
| 7926 | '') dflt=`echo $sitelib | $sed 's,/share$,,'` |
| 7927 | dflt="$dflt/$archname" |
| 7928 | ;; |
| 7929 | *) dflt="$sitearch" |
| 7930 | ;; |
| 7931 | esac |
| 7932 | set sitearch sitearch none |
| 7933 | eval $prefixit |
| 7934 | $cat <<EOM |
| 7935 | |
| 7936 | The installation process will also create a directory for |
| 7937 | architecture-dependent site-specific extensions and modules. |
| 7938 | |
| 7939 | EOM |
| 7940 | fn=d~+ |
| 7941 | rp='Pathname for the site-specific architecture-dependent library files?' |
| 7942 | . ./getfile |
| 7943 | prefixvar=sitearch |
| 7944 | . ./setprefixvar |
| 7945 | if $test X"$sitearch" = X"$sitelib"; then |
| 7946 | d_sitearch="$undef" |
| 7947 | else |
| 7948 | d_sitearch="$define" |
| 7949 | fi |
| 7950 | |
| 7951 | : Set the vendorprefix variables |
| 7952 | $cat <<EOM |
| 7953 | |
| 7954 | The installation process will also create a directory for |
| 7955 | vendor-supplied add-ons. Vendors who supply perl with their system |
| 7956 | may find it convenient to place all vendor-supplied files in this |
| 7957 | directory rather than in the main distribution directory. This will |
| 7958 | ease upgrades between binary-compatible maintenance versions of perl. |
| 7959 | |
| 7960 | Of course you may also use these directories in whatever way you see |
| 7961 | fit. For example, you might use them to access modules shared over a |
| 7962 | company-wide network. |
| 7963 | |
| 7964 | The default answer should be fine for most people. |
| 7965 | This causes further questions about vendor add-ons to be skipped |
| 7966 | and no vendor-specific directories will be configured for perl. |
| 7967 | |
| 7968 | EOM |
| 7969 | rp='Do you want to configure vendor-specific add-on directories?' |
| 7970 | case "$usevendorprefix" in |
| 7971 | define|true|[yY]*) dflt=y ;; |
| 7972 | *) : User may have set vendorprefix directly on Configure command line. |
| 7973 | case "$vendorprefix" in |
| 7974 | ''|' ') dflt=n ;; |
| 7975 | *) dflt=y ;; |
| 7976 | esac |
| 7977 | ;; |
| 7978 | esac |
| 7979 | . ./myread |
| 7980 | case "$ans" in |
| 7981 | [yY]*) fn=d~+ |
| 7982 | rp='Installation prefix to use for vendor-supplied add-ons?' |
| 7983 | case "$vendorprefix" in |
| 7984 | '') dflt="$prefix" ;; |
| 7985 | *) dflt=$vendorprefix ;; |
| 7986 | esac |
| 7987 | . ./getfile |
| 7988 | : XXX Prefixit unit does not yet support siteprefix and vendorprefix |
| 7989 | oldvendorprefix='' |
| 7990 | case "$vendorprefix" in |
| 7991 | '') ;; |
| 7992 | *) case "$ans" in |
| 7993 | "$prefix") ;; |
| 7994 | *) oldvendorprefix="$prefix";; |
| 7995 | esac |
| 7996 | ;; |
| 7997 | esac |
| 7998 | usevendorprefix="$define" |
| 7999 | vendorprefix="$ans" |
| 8000 | vendorprefixexp="$ansexp" |
| 8001 | ;; |
| 8002 | *) usevendorprefix="$undef" |
| 8003 | vendorprefix='' |
| 8004 | vendorprefixexp='' |
| 8005 | ;; |
| 8006 | esac |
| 8007 | |
| 8008 | : Set the vendorlib variables |
| 8009 | case "$vendorprefix" in |
| 8010 | '') d_vendorlib="$undef" |
| 8011 | vendorlib='' |
| 8012 | vendorlibexp='' |
| 8013 | ;; |
| 8014 | *) d_vendorlib="$define" |
| 8015 | : determine where vendor-supplied modules go. |
| 8016 | : Usual default is /usr/local/lib/perl5/vendor_perl/$version |
| 8017 | case "$vendorlib" in |
| 8018 | '') |
| 8019 | prog=`echo $package | $sed 's/-*[0-9.]*$//'` |
| 8020 | case "$installstyle" in |
| 8021 | *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;; |
| 8022 | *) dflt=$vendorprefix/lib/vendor_$prog/$version ;; |
| 8023 | esac |
| 8024 | ;; |
| 8025 | *) dflt="$vendorlib" |
| 8026 | ;; |
| 8027 | esac |
| 8028 | fn=d~+ |
| 8029 | rp='Pathname for the vendor-supplied library files?' |
| 8030 | . ./getfile |
| 8031 | vendorlib="$ans" |
| 8032 | vendorlibexp="$ansexp" |
| 8033 | ;; |
| 8034 | esac |
| 8035 | vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"` |
| 8036 | prefixvar=vendorlib |
| 8037 | . ./installprefix |
| 8038 | |
| 8039 | : Set the vendorarch variables |
| 8040 | case "$vendorprefix" in |
| 8041 | '') d_vendorarch="$undef" |
| 8042 | vendorarch='' |
| 8043 | vendorarchexp='' |
| 8044 | ;; |
| 8045 | *) d_vendorarch="$define" |
| 8046 | : determine where vendor-supplied architecture-dependent libraries go. |
| 8047 | : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version |
| 8048 | : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname |
| 8049 | : vendorlib may have an optional trailing /share. |
| 8050 | case "$vendorarch" in |
| 8051 | '') dflt=`echo $vendorlib | $sed 's,/share$,,'` |
| 8052 | dflt="$dflt/$archname" |
| 8053 | ;; |
| 8054 | *) dflt="$vendorarch" ;; |
| 8055 | esac |
| 8056 | fn=d~+ |
| 8057 | rp='Pathname for vendor-supplied architecture-dependent files?' |
| 8058 | . ./getfile |
| 8059 | vendorarch="$ans" |
| 8060 | vendorarchexp="$ansexp" |
| 8061 | ;; |
| 8062 | esac |
| 8063 | prefixvar=vendorarch |
| 8064 | . ./installprefix |
| 8065 | if $test X"$vendorarch" = X"$vendorlib"; then |
| 8066 | d_vendorarch="$undef" |
| 8067 | else |
| 8068 | d_vendorarch="$define" |
| 8069 | fi |
| 8070 | |
| 8071 | : Final catch-all directories to search |
| 8072 | $cat <<EOM |
| 8073 | |
| 8074 | Lastly, you can have perl look in other directories for extensions and |
| 8075 | modules in addition to those already specified. |
| 8076 | These directories will be searched after |
| 8077 | $sitearch |
| 8078 | $sitelib |
| 8079 | EOM |
| 8080 | test X"$vendorlib" != "X" && echo ' ' $vendorlib |
| 8081 | test X"$vendorarch" != "X" && echo ' ' $vendorarch |
| 8082 | echo ' ' |
| 8083 | case "$otherlibdirs" in |
| 8084 | ''|' ') dflt='none' ;; |
| 8085 | *) dflt="$otherlibdirs" ;; |
| 8086 | esac |
| 8087 | $cat <<EOM |
| 8088 | Enter a colon-separated set of extra paths to include in perl's @INC |
| 8089 | search path, or enter 'none' for no extra paths. |
| 8090 | |
| 8091 | EOM |
| 8092 | |
| 8093 | rp='Colon-separated list of additional directories for perl to search?' |
| 8094 | . ./myread |
| 8095 | case "$ans" in |
| 8096 | ' '|''|none) otherlibdirs=' ' ;; |
| 8097 | *) otherlibdirs="$ans" ;; |
| 8098 | esac |
| 8099 | case "$otherlibdirs" in |
| 8100 | ' ') val=$undef ;; |
| 8101 | *) val=$define ;; |
| 8102 | esac |
| 8103 | set d_perl_otherlibdirs |
| 8104 | eval $setvar |
| 8105 | |
| 8106 | : DTrace support |
| 8107 | dflt_dtrace='/usr/sbin/dtrace' |
| 8108 | $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace' |
| 8109 | |
| 8110 | cat <<EOM |
| 8111 | |
| 8112 | Perl can be built to support DTrace on platforms that support it. |
| 8113 | DTrace is a diagnosis and performance analysis tool from Sun. |
| 8114 | |
| 8115 | If this doesn't make any sense to you, just accept the default. |
| 8116 | EOM |
| 8117 | |
| 8118 | while $test 1 ; do |
| 8119 | case "$usedtrace" in |
| 8120 | $define|true|[yY]*) |
| 8121 | dflt='y' |
| 8122 | ;; |
| 8123 | $undef|false|[nN]*) |
| 8124 | dflt='n' |
| 8125 | dflt_dtrace="" |
| 8126 | ;; |
| 8127 | ?*) |
| 8128 | dflt='y' |
| 8129 | dflt_dtrace=$usedtrace |
| 8130 | ;; |
| 8131 | *) |
| 8132 | dflt='n' |
| 8133 | ;; |
| 8134 | esac |
| 8135 | |
| 8136 | rp='Support DTrace if available?' |
| 8137 | . ./myread |
| 8138 | case "$ans" in |
| 8139 | y|Y) val="$define" ;; |
| 8140 | *) val="$undef" ;; |
| 8141 | esac |
| 8142 | set usedtrace |
| 8143 | eval $setvar |
| 8144 | |
| 8145 | test "X$usedtrace" != "X$define" && break |
| 8146 | |
| 8147 | echo " " |
| 8148 | rp='Where is the dtrace executable?' |
| 8149 | dflt=$dflt_dtrace |
| 8150 | . ./getfile |
| 8151 | val="$ans" |
| 8152 | set dtrace |
| 8153 | eval $setvar |
| 8154 | |
| 8155 | if $test -f $dtrace |
| 8156 | then |
| 8157 | if $dtrace -h -s ../perldtrace.d \ |
| 8158 | -o perldtrace.tmp >/dev/null 2>&1 \ |
| 8159 | && rm -f perldtrace.tmp |
| 8160 | then |
| 8161 | echo " " |
| 8162 | echo "Good: your $dtrace knows about the -h flag." |
| 8163 | else |
| 8164 | cat >&2 <<EOM |
| 8165 | |
| 8166 | *** $me: Fatal Error: $dtrace doesn't support -h flag |
| 8167 | *** |
| 8168 | *** Your installed dtrace doesn't support the -h switch to compile a D |
| 8169 | *** program into a C header. Can't continue. |
| 8170 | |
| 8171 | EOM |
| 8172 | exit 1 |
| 8173 | fi |
| 8174 | break; |
| 8175 | fi |
| 8176 | |
| 8177 | case "$fastread" in |
| 8178 | yes) |
| 8179 | cat >&2 <<EOM |
| 8180 | |
| 8181 | *** $me: Fatal Error: $dtrace not found. |
| 8182 | *** Can't continue. |
| 8183 | |
| 8184 | EOM |
| 8185 | exit 1 |
| 8186 | ;; |
| 8187 | *) |
| 8188 | echo "*** $dtrace was not found." |
| 8189 | echo " " |
| 8190 | ;; |
| 8191 | esac |
| 8192 | done |
| 8193 | |
| 8194 | : See if we want extra modules installed |
| 8195 | echo " " |
| 8196 | case "$extras" in |
| 8197 | '') dflt='n';; |
| 8198 | *) dflt='y';; |
| 8199 | esac |
| 8200 | cat <<EOM |
| 8201 | Perl can be built with extra modules or bundles of modules which |
| 8202 | will be fetched from the CPAN and installed alongside Perl. |
| 8203 | |
| 8204 | Notice that you will need access to the CPAN; either via the Internet, |
| 8205 | or a local copy, for example a CD-ROM or a local CPAN mirror. (You will |
| 8206 | be asked later to configure the CPAN.pm module which will in turn do |
| 8207 | the installation of the rest of the extra modules or bundles.) |
| 8208 | |
| 8209 | Notice also that if the modules require any external software such as |
| 8210 | libraries and headers (the libz library and the zlib.h header for the |
| 8211 | Compress::Zlib module, for example) you MUST have any such software |
| 8212 | already installed, this configuration process will NOT install such |
| 8213 | things for you. |
| 8214 | |
| 8215 | If this doesn't make any sense to you, just accept the default '$dflt'. |
| 8216 | EOM |
| 8217 | rp='Install any extra modules (y or n)?' |
| 8218 | . ./myread |
| 8219 | case "$ans" in |
| 8220 | y|Y) |
| 8221 | cat <<EOM |
| 8222 | |
| 8223 | Please list any extra modules or bundles to be installed from CPAN, |
| 8224 | with spaces between the names. The names can be in any format the |
| 8225 | 'install' command of CPAN.pm will understand. (Answer 'none', |
| 8226 | without the quotes, to install no extra modules or bundles.) |
| 8227 | EOM |
| 8228 | rp='Extras?' |
| 8229 | dflt="$extras" |
| 8230 | . ./myread |
| 8231 | extras="$ans" |
| 8232 | esac |
| 8233 | case "$extras" in |
| 8234 | ''|'none') |
| 8235 | val='' |
| 8236 | $rm -f ../extras.lst |
| 8237 | ;; |
| 8238 | *) echo "(Saving the list of extras for later...)" |
| 8239 | echo "$extras" > ../extras.lst |
| 8240 | val="'$extras'" |
| 8241 | ;; |
| 8242 | esac |
| 8243 | set extras |
| 8244 | eval $setvar |
| 8245 | echo " " |
| 8246 | |
| 8247 | : determine where html pages for programs go |
| 8248 | set html1dir html1dir none |
| 8249 | eval $prefixit |
| 8250 | $cat <<EOM |
| 8251 | |
| 8252 | If you wish to install html files for programs in $spackage, indicate |
| 8253 | the appropriate directory here. To skip installing html files, |
| 8254 | answer "none". |
| 8255 | EOM |
| 8256 | case "$html1dir" in |
| 8257 | ''|none|$undef|' ') dflt=none ;; |
| 8258 | *) dflt=$html1dir ;; |
| 8259 | esac |
| 8260 | fn=dn+~ |
| 8261 | rp="Directory for the main $spackage html pages?" |
| 8262 | . ./getfile |
| 8263 | prefixvar=html1dir |
| 8264 | . ./setprefixvar |
| 8265 | : Use ' ' for none so value is preserved next time through Configure |
| 8266 | $test X"$html1dir" = "X" && html1dir=' ' |
| 8267 | |
| 8268 | : determine where html pages for libraries and modules go |
| 8269 | set html3dir html3dir none |
| 8270 | eval $prefixit |
| 8271 | $cat <<EOM |
| 8272 | |
| 8273 | If you wish to install html files for modules associated with $spackage, |
| 8274 | indicate the appropriate directory here. To skip installing html files, |
| 8275 | answer "none". |
| 8276 | EOM |
| 8277 | : There is no obvious default. If they have specified html1dir, then |
| 8278 | : try to key off that, possibly changing .../html1 into .../html3. |
| 8279 | case "$html3dir" in |
| 8280 | '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;; |
| 8281 | *) dflt=$html3dir ;; |
| 8282 | esac |
| 8283 | fn=dn+~ |
| 8284 | rp="Directory for the $spackage module html pages?" |
| 8285 | . ./getfile |
| 8286 | prefixvar=html3dir |
| 8287 | . ./setprefixvar |
| 8288 | : Use ' ' for none so value is preserved next time through Configure |
| 8289 | $test X"$html3dir" = "X" && html3dir=' ' |
| 8290 | |
| 8291 | : determine whether to install perl also as /usr/bin/perl |
| 8292 | |
| 8293 | echo " " |
| 8294 | if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then |
| 8295 | $cat <<EOM |
| 8296 | Many scripts expect perl to be installed as /usr/bin/perl. |
| 8297 | |
| 8298 | If you want to, I can install the perl you are about to compile |
| 8299 | as /usr/bin/perl (in addition to $bin/perl). |
| 8300 | EOM |
| 8301 | if test -f /usr/bin/perl; then |
| 8302 | $cat <<EOM |
| 8303 | |
| 8304 | However, please note that because you already have a /usr/bin/perl, |
| 8305 | overwriting that with a new Perl would very probably cause problems. |
| 8306 | Therefore I'm assuming you don't want to do that (unless you insist). |
| 8307 | |
| 8308 | EOM |
| 8309 | case "$installusrbinperl" in |
| 8310 | "$define"|[yY]*) dflt='y';; |
| 8311 | *) dflt='n';; |
| 8312 | esac |
| 8313 | else |
| 8314 | $cat <<EOM |
| 8315 | |
| 8316 | Since you don't have a /usr/bin/perl I'm assuming creating one is okay. |
| 8317 | |
| 8318 | EOM |
| 8319 | case "$installusrbinperl" in |
| 8320 | "$undef"|[nN]*) dflt='n';; |
| 8321 | *) dflt='y';; |
| 8322 | esac |
| 8323 | fi |
| 8324 | rp="Do you want to install perl as /usr/bin/perl?" |
| 8325 | . ./myread |
| 8326 | case "$ans" in |
| 8327 | [yY]*) val="$define";; |
| 8328 | *) val="$undef" ;; |
| 8329 | esac |
| 8330 | else |
| 8331 | val="$undef" |
| 8332 | fi |
| 8333 | set installusrbinperl |
| 8334 | eval $setvar |
| 8335 | |
| 8336 | : see if dlopen exists |
| 8337 | xxx_runnm="$runnm" |
| 8338 | xxx_ccflags="$ccflags" |
| 8339 | runnm=false |
| 8340 | : with g++ one needs -shared to get is-in-libc to work for dlopen |
| 8341 | case "$gccversion" in |
| 8342 | '') ;; |
| 8343 | *Clang*) ;; |
| 8344 | *) case "$d_cplusplus" in |
| 8345 | "$define") ccflags="$ccflags -shared" ;; |
| 8346 | esac |
| 8347 | ;; |
| 8348 | esac |
| 8349 | set dlopen d_dlopen |
| 8350 | eval $inlibc |
| 8351 | runnm="$xxx_runnm" |
| 8352 | ccflags="$xxx_ccflags" |
| 8353 | |
| 8354 | : see if this is a unistd.h system |
| 8355 | set unistd.h i_unistd |
| 8356 | eval $inhdr |
| 8357 | |
| 8358 | : determine which dynamic loading, if any, to compile in |
| 8359 | echo " " |
| 8360 | dldir="ext/DynaLoader" |
| 8361 | case "$usedl" in |
| 8362 | $define|y|true) |
| 8363 | dflt='y' |
| 8364 | usedl="$define" |
| 8365 | ;; |
| 8366 | $undef|n|false) |
| 8367 | dflt='n' |
| 8368 | usedl="$undef" |
| 8369 | ;; |
| 8370 | *) |
| 8371 | dflt='n' |
| 8372 | case "$d_dlopen" in |
| 8373 | $define) dflt='y' ;; |
| 8374 | esac |
| 8375 | : Does a dl_xxx.xs file exist for this operating system |
| 8376 | $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y' |
| 8377 | ;; |
| 8378 | esac |
| 8379 | rp="Do you wish to use dynamic loading?" |
| 8380 | . ./myread |
| 8381 | usedl="$ans" |
| 8382 | bin_ELF="$undef" |
| 8383 | case "$ans" in |
| 8384 | y*) usedl="$define" |
| 8385 | case "$dlsrc" in |
| 8386 | '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then |
| 8387 | dflt="$dldir/dl_${osname}.xs" |
| 8388 | elif $test "$d_dlopen" = "$define" ; then |
| 8389 | dflt="$dldir/dl_dlopen.xs" |
| 8390 | else |
| 8391 | dflt='' |
| 8392 | fi |
| 8393 | ;; |
| 8394 | *) dflt="$dldir/$dlsrc" |
| 8395 | ;; |
| 8396 | esac |
| 8397 | echo "The following dynamic loading files are available:" |
| 8398 | : Can not go over to $dldir because getfile has path hard-coded in. |
| 8399 | tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir" |
| 8400 | rp="Source file to use for dynamic loading" |
| 8401 | fn="fne" |
| 8402 | gfpth="$src" |
| 8403 | . ./getfile |
| 8404 | usedl="$define" |
| 8405 | : emulate basename |
| 8406 | dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'` |
| 8407 | |
| 8408 | $cat << EOM |
| 8409 | |
| 8410 | Some systems may require passing special flags to $cc -c to |
| 8411 | compile modules that will be used to create a shared library. |
| 8412 | To use no flags, say "none". |
| 8413 | |
| 8414 | EOM |
| 8415 | case "$cccdlflags" in |
| 8416 | '') case "$gccversion" in |
| 8417 | '') case "$osname" in |
| 8418 | hpux) dflt='+z' ;; |
| 8419 | irix*) dflt='-KPIC' ;; |
| 8420 | svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;; |
| 8421 | sunos) dflt='-pic' ;; |
| 8422 | *) dflt='none' ;; |
| 8423 | esac |
| 8424 | ;; |
| 8425 | *) case "$osname" in |
| 8426 | darwin) dflt='none' ;; |
| 8427 | *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;; |
| 8428 | *) dflt='-fpic' ;; |
| 8429 | esac ;; |
| 8430 | esac ;; |
| 8431 | ' ') dflt='none' ;; |
| 8432 | *) dflt="$cccdlflags" ;; |
| 8433 | esac |
| 8434 | |
| 8435 | case "$dflt" in |
| 8436 | none) dflt='' ;; |
| 8437 | esac |
| 8438 | |
| 8439 | # If -Dsysroot was specified, now's the time to add it |
| 8440 | # to cccdlflags |
| 8441 | if test "X$sysroot" != X; then |
| 8442 | case "$gccversion" in |
| 8443 | '') ;; |
| 8444 | *) case "$dflt" in |
| 8445 | *sysroot*) ;; |
| 8446 | 'undef'|*) |
| 8447 | dflt="$dflt --sysroot=$sysroot" ;; |
| 8448 | esac |
| 8449 | ;; |
| 8450 | esac |
| 8451 | fi |
| 8452 | |
| 8453 | case "$dflt" in |
| 8454 | '') dflt='none';; |
| 8455 | esac |
| 8456 | |
| 8457 | rp="Any special flags to pass to $cc -c to compile shared library modules?" |
| 8458 | . ./myread |
| 8459 | case "$ans" in |
| 8460 | none) cccdlflags=' ' ;; |
| 8461 | *) cccdlflags="$ans" ;; |
| 8462 | esac |
| 8463 | |
| 8464 | cat << EOM |
| 8465 | |
| 8466 | Some systems use ld to create libraries that can be dynamically loaded, |
| 8467 | while other systems (such as those using ELF) use $cc. |
| 8468 | |
| 8469 | EOM |
| 8470 | |
| 8471 | : Determine if this is ELF |
| 8472 | $cat >try.c <<EOM |
| 8473 | /* Test for whether ELF binaries are produced */ |
| 8474 | #include <fcntl.h> |
| 8475 | #$i_stdlib I_STDLIB |
| 8476 | #ifdef I_STDLIB |
| 8477 | #include <stdlib.h> |
| 8478 | #endif |
| 8479 | #$i_unistd I_UNISTD |
| 8480 | #ifdef I_UNISTD |
| 8481 | #include <unistd.h> |
| 8482 | #endif |
| 8483 | int main() { |
| 8484 | char b[4]; |
| 8485 | int i = open("a.out",O_RDONLY); |
| 8486 | if(i == -1) |
| 8487 | exit(1); /* fail */ |
| 8488 | if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') |
| 8489 | exit(0); /* succeed (yes, it is ELF) */ |
| 8490 | exit(1); /* fail */ |
| 8491 | } |
| 8492 | EOM |
| 8493 | if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then |
| 8494 | bin_ELF="$define" |
| 8495 | fi |
| 8496 | $rm_try |
| 8497 | |
| 8498 | case "$ld" in |
| 8499 | '') if $test $bin_ELF = "$define"; then |
| 8500 | cat <<EOM |
| 8501 | You appear to have ELF support. I'll use $cc to build dynamic libraries. |
| 8502 | EOM |
| 8503 | dflt="$cc" |
| 8504 | else |
| 8505 | echo "I'll use ld to build dynamic libraries." |
| 8506 | dflt='ld' |
| 8507 | fi |
| 8508 | ;; |
| 8509 | *) dflt="$ld" |
| 8510 | ;; |
| 8511 | esac |
| 8512 | |
| 8513 | rp="What command should be used to create dynamic libraries?" |
| 8514 | . ./myread |
| 8515 | ld="$ans" |
| 8516 | |
| 8517 | cat << EOM |
| 8518 | |
| 8519 | Some systems may require passing special flags to $ld to create a |
| 8520 | library that can be dynamically loaded. If your ld flags include |
| 8521 | -L/other/path options to locate libraries outside your loader's normal |
| 8522 | search path, you may need to specify those -L options here as well. To |
| 8523 | use no flags, say "none". |
| 8524 | |
| 8525 | EOM |
| 8526 | case "$lddlflags" in |
| 8527 | '') case "$osname" in |
| 8528 | haiku) dflt='-shared' ;; |
| 8529 | hpux) dflt='-b'; |
| 8530 | case "$gccversion" in |
| 8531 | '') dflt="$dflt +vnocompatwarnings" ;; |
| 8532 | esac |
| 8533 | ;; |
| 8534 | *linux*|irix*|gnu*) dflt="-shared $optimize" ;; |
| 8535 | solaris) # See [perl #66604]. |
| 8536 | # On Solaris 11, gcc -m64 on amd64 |
| 8537 | # appears not to understand -G. gcc versions at |
| 8538 | # least as old as 3.4.3 support -shared, so just |
| 8539 | # use that with Solaris 11 and later, but keep |
| 8540 | # the old behavior for older Solaris versions. |
| 8541 | case "$gccversion" in |
| 8542 | '') dflt='-G' ;; |
| 8543 | *) case "$osvers" in |
| 8544 | 2.?|2.10) dflt='-G' ;; |
| 8545 | *) dflt='-shared' ;; |
| 8546 | esac |
| 8547 | ;; |
| 8548 | esac |
| 8549 | ;; |
| 8550 | sunos) dflt='-assert nodefinitions' ;; |
| 8551 | svr4*|esix*|nonstopux) dflt="-G $ldflags" ;; |
| 8552 | *) dflt='none' ;; |
| 8553 | esac |
| 8554 | ;; |
| 8555 | *) dflt="$lddlflags" ;; |
| 8556 | esac |
| 8557 | |
| 8558 | : Only do this for gcc, since, for example, qcc has no concept |
| 8559 | : of --sysroot. |
| 8560 | if $test "X$sysroot" != X; then |
| 8561 | case "$gccversion" in |
| 8562 | '') ;; |
| 8563 | *) dflt="$dflt --sysroot=$sysroot" ;; |
| 8564 | esac |
| 8565 | fi |
| 8566 | |
| 8567 | : Try to guess additional flags to pick up local libraries. |
| 8568 | : Be careful not to append to a plain 'none' |
| 8569 | case "$dflt" in |
| 8570 | none) dflt='' ;; |
| 8571 | esac |
| 8572 | for thisflag in $ldflags; do |
| 8573 | case "$thisflag" in |
| 8574 | -L*|-R*|-Wl,-R*) |
| 8575 | case " $dflt " in |
| 8576 | *" $thisflag "*) ;; |
| 8577 | *) dflt="$dflt $thisflag" ;; |
| 8578 | esac |
| 8579 | ;; |
| 8580 | esac |
| 8581 | done |
| 8582 | |
| 8583 | case "$dflt" in |
| 8584 | ''|' ') dflt='none' ;; |
| 8585 | esac |
| 8586 | |
| 8587 | case "$ldflags" in |
| 8588 | *-fstack-protector-strong*) |
| 8589 | case "$dflt" in |
| 8590 | *-fstack-protector-strong*) ;; # Don't add it again |
| 8591 | *) dflt="$dflt -fstack-protector-strong" ;; |
| 8592 | esac |
| 8593 | ;; |
| 8594 | *-fstack-protector*) |
| 8595 | case "$dflt" in |
| 8596 | *-fstack-protector*) ;; # Don't add it again |
| 8597 | *) dflt="$dflt -fstack-protector" ;; |
| 8598 | esac |
| 8599 | ;; |
| 8600 | esac |
| 8601 | |
| 8602 | rp="Any special flags to pass to $ld to create a dynamically loaded library?" |
| 8603 | . ./myread |
| 8604 | case "$ans" in |
| 8605 | none) lddlflags=' ' ;; |
| 8606 | *) lddlflags="$ans" ;; |
| 8607 | esac |
| 8608 | |
| 8609 | cat <<EOM |
| 8610 | |
| 8611 | Some systems may require passing special flags to $cc to indicate that |
| 8612 | the resulting executable will use dynamic linking. To use no flags, |
| 8613 | say "none". |
| 8614 | |
| 8615 | EOM |
| 8616 | case "$ccdlflags" in |
| 8617 | '') case "$osname" in |
| 8618 | *linux*|hpux|gnu*) dflt='-Wl,-E' ;; |
| 8619 | sunos) dflt='none' ;; |
| 8620 | *) dflt='none' ;; |
| 8621 | esac ;; |
| 8622 | ' ') dflt='none' ;; |
| 8623 | *) dflt="$ccdlflags" ;; |
| 8624 | esac |
| 8625 | rp="Any special flags to pass to $cc to use dynamic linking?" |
| 8626 | . ./myread |
| 8627 | case "$ans" in |
| 8628 | none) ccdlflags=' ' ;; |
| 8629 | *) ccdlflags="$ans" ;; |
| 8630 | esac |
| 8631 | ;; |
| 8632 | |
| 8633 | *) usedl="$undef" |
| 8634 | ld='ld' |
| 8635 | dlsrc='dl_none.xs' |
| 8636 | lddlflags='' |
| 8637 | ccdlflags='' |
| 8638 | ;; |
| 8639 | esac |
| 8640 | |
| 8641 | ld_can_script="$undef" |
| 8642 | case "$bin_ELF$usedl" in |
| 8643 | $define$define) |
| 8644 | # Abuse try.h and a.out names for neat cleanup |
| 8645 | $cat >try.c <<EOM |
| 8646 | void foo() {} |
| 8647 | void bar() {} |
| 8648 | EOM |
| 8649 | $cat >try.h <<EOM |
| 8650 | LIBTEST_42 { |
| 8651 | global: |
| 8652 | foo; |
| 8653 | local: *; |
| 8654 | }; |
| 8655 | EOM |
| 8656 | if $cc $cccdlflags $ccdlflags $ccflags \ |
| 8657 | $ldflags $lddlflags -o a.out try.c \ |
| 8658 | -Wl,--version-script=try.h >/dev/null 2>&1 \ |
| 8659 | && $test -s a.out ; then |
| 8660 | echo "ld supports scripting" >&4 |
| 8661 | ld_can_script="$define" |
| 8662 | else |
| 8663 | echo "ld does not support scripting" >&4 |
| 8664 | fi |
| 8665 | $rm_try |
| 8666 | ;; |
| 8667 | esac |
| 8668 | |
| 8669 | : Do we want a shared libperl? |
| 8670 | also='' |
| 8671 | case "$usedl" in |
| 8672 | $undef) |
| 8673 | # No dynamic loading being used, so don't bother even to prompt. |
| 8674 | useshrplib='false' |
| 8675 | ;; |
| 8676 | *) case "$useshrplib" in |
| 8677 | '') case "$osname" in |
| 8678 | svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*) |
| 8679 | dflt=y |
| 8680 | also='Building a shared libperl is required for dynamic loading to work on your system.' |
| 8681 | ;; |
| 8682 | *) dflt=n |
| 8683 | ;; |
| 8684 | esac |
| 8685 | ;; |
| 8686 | $define|true|[Yy]*) |
| 8687 | dflt=y |
| 8688 | ;; |
| 8689 | *) dflt=n |
| 8690 | ;; |
| 8691 | esac |
| 8692 | $cat << EOM |
| 8693 | |
| 8694 | The perl executable is normally obtained by linking perlmain.c with |
| 8695 | libperl${_a}, any static extensions (usually just DynaLoader), and |
| 8696 | any other libraries needed on this system (such as -lm, etc.). Since |
| 8697 | your system supports dynamic loading, it is probably possible to build |
| 8698 | a shared libperl.$so. If you will have more than one executable linked |
| 8699 | to libperl.$so, this will significantly reduce the size of each |
| 8700 | executable, but it may have a noticeable effect on performance. The |
| 8701 | default is probably sensible for your system. |
| 8702 | $also |
| 8703 | |
| 8704 | EOM |
| 8705 | rp="Build a shared libperl.$so (y/n)" |
| 8706 | . ./myread |
| 8707 | case "$ans" in |
| 8708 | true|$define|[Yy]*) |
| 8709 | useshrplib='true' ;; |
| 8710 | *) useshrplib='false' ;; |
| 8711 | esac |
| 8712 | ;; |
| 8713 | esac |
| 8714 | |
| 8715 | case "$useshrplib" in |
| 8716 | true) |
| 8717 | case "$userelocatableinc" in |
| 8718 | true|define) |
| 8719 | echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4 |
| 8720 | echo "See INSTALL for an explanation why that won't work." >&4 |
| 8721 | exit 4 |
| 8722 | ;; |
| 8723 | esac |
| 8724 | case "$libperl" in |
| 8725 | '') |
| 8726 | # Figure out a good name for libperl.so. Since it gets stored in |
| 8727 | # a version-specific architecture-dependent library, the version |
| 8728 | # number isn't really that important, except for making cc/ld happy. |
| 8729 | # |
| 8730 | # A name such as libperl.so.10.1 |
| 8731 | majmin="libperl.$so.$patchlevel.$subversion" |
| 8732 | # A name such as libperl.so.100 |
| 8733 | majonly=`echo $patchlevel $subversion | |
| 8734 | $awk '{printf "%d%02d", $1, $2}'` |
| 8735 | majonly=libperl.$so.$majonly |
| 8736 | # I'd prefer to keep the os-specific stuff here to a minimum, and |
| 8737 | # rely on figuring it out from the naming of libc. |
| 8738 | case "${osname}${osvers}" in |
| 8739 | *linux*|gnu*) # ld won't link with a bare -lperl otherwise. |
| 8740 | dflt=libperl.$so |
| 8741 | ;; |
| 8742 | cygwin*) # ld links now against the dll directly |
| 8743 | majmin="cygperl5_${patchlevel}_${subversion}.${so}" |
| 8744 | majonly=`echo $patchlevel $subversion | |
| 8745 | $awk '{printf "%03d%03d", $1, $2}'` |
| 8746 | majonly=cygperl5.$majonly.$so |
| 8747 | dflt=$majmin |
| 8748 | ;; |
| 8749 | *) # Try to guess based on whether libc has major.minor. |
| 8750 | case "$libc" in |
| 8751 | *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;; |
| 8752 | *libc.$so.[0-9]*) dflt=$majonly ;; |
| 8753 | *) dflt=libperl.$so ;; |
| 8754 | esac |
| 8755 | ;; |
| 8756 | esac |
| 8757 | ;; |
| 8758 | *) dflt=$libperl |
| 8759 | ;; |
| 8760 | esac |
| 8761 | cat << EOM |
| 8762 | |
| 8763 | I need to select a good name for the shared libperl. If your system uses |
| 8764 | library names with major and minor numbers, then you might want something |
| 8765 | like $majmin. Alternatively, if your system uses a single version |
| 8766 | number for shared libraries, then you might want to use $majonly. |
| 8767 | Or, your system might be quite happy with a simple libperl.$so. |
| 8768 | |
| 8769 | Since the shared libperl will get installed into a version-specific |
| 8770 | architecture-dependent directory, the version number of the shared perl |
| 8771 | library probably isn't important, so the default should be o.k. |
| 8772 | |
| 8773 | EOM |
| 8774 | rp='What name do you want to give to the shared libperl?' |
| 8775 | . ./myread |
| 8776 | libperl=$ans |
| 8777 | echo "Ok, I'll use $libperl" |
| 8778 | ;; |
| 8779 | *) |
| 8780 | libperl="libperl${_a}" |
| 8781 | ;; |
| 8782 | esac |
| 8783 | |
| 8784 | # Detect old use of shrpdir via undocumented Configure -Dshrpdir |
| 8785 | case "$shrpdir" in |
| 8786 | '') ;; |
| 8787 | *) $cat >&4 <<EOM |
| 8788 | WARNING: Use of the shrpdir variable for the installation location of |
| 8789 | the shared $libperl is not supported. It was never documented and |
| 8790 | will not work in this version. Let me (https://github.com/Perl/perl5/issues) |
| 8791 | know of any problems this may cause. |
| 8792 | |
| 8793 | EOM |
| 8794 | case "$shrpdir" in |
| 8795 | "$archlibexp/CORE") |
| 8796 | $cat >&4 <<EOM |
| 8797 | But your current setting of $shrpdir is |
| 8798 | the default anyway, so it's harmless. |
| 8799 | EOM |
| 8800 | ;; |
| 8801 | *) |
| 8802 | $cat >&4 <<EOM |
| 8803 | Further, your current attempted setting of $shrpdir |
| 8804 | conflicts with the value of $archlibexp/CORE |
| 8805 | that installperl will use. |
| 8806 | EOM |
| 8807 | ;; |
| 8808 | esac |
| 8809 | ;; |
| 8810 | esac |
| 8811 | |
| 8812 | # How will the perl executable find the installed shared $libperl? |
| 8813 | # Add $xxx to ccdlflags. |
| 8814 | # If we can't figure out a command-line option, use $shrpenv to |
| 8815 | # set env LD_RUN_PATH. The main perl makefile uses this. |
| 8816 | shrpdir=$archlibexp/CORE |
| 8817 | xxx='' |
| 8818 | tmp_shrpenv='' |
| 8819 | if "$useshrplib"; then |
| 8820 | case "$osname" in |
| 8821 | aix) |
| 8822 | # We'll set it in Makefile.SH... |
| 8823 | ;; |
| 8824 | solaris) |
| 8825 | xxx="-R $shrpdir" |
| 8826 | ;; |
| 8827 | freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig) |
| 8828 | xxx="-Wl,-R$shrpdir" |
| 8829 | ;; |
| 8830 | bsdos|linux|irix*|dec_osf|gnu*|haiku) |
| 8831 | xxx="-Wl,-rpath,$shrpdir" |
| 8832 | ;; |
| 8833 | hpux*) |
| 8834 | # hpux doesn't like the default, either. |
| 8835 | tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\"" |
| 8836 | ;; |
| 8837 | cygwin) |
| 8838 | # cygwin needs only ldlibpth |
| 8839 | ;; |
| 8840 | *) |
| 8841 | tmp_shrpenv="env LD_RUN_PATH=$shrpdir" |
| 8842 | ;; |
| 8843 | esac |
| 8844 | case "$xxx" in |
| 8845 | '') ;; |
| 8846 | *) |
| 8847 | # Only add $xxx if it isn't already in ccdlflags. |
| 8848 | case " $ccdlflags " in |
| 8849 | *" $xxx "*) ;; |
| 8850 | *) ccdlflags="$ccdlflags $xxx" |
| 8851 | cat <<EOM >&4 |
| 8852 | |
| 8853 | Adding $xxx to the flags |
| 8854 | passed to $ld so that the perl executable will find the |
| 8855 | installed shared $libperl. |
| 8856 | |
| 8857 | EOM |
| 8858 | ;; |
| 8859 | esac |
| 8860 | ;; |
| 8861 | esac |
| 8862 | fi |
| 8863 | # Fix ccdlflags in AIX for building external extensions. |
| 8864 | # (For building Perl itself bare -bE:perl.exp is needed, |
| 8865 | # Makefile.SH takes care of this.) |
| 8866 | case "$osname" in |
| 8867 | aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;; |
| 8868 | esac |
| 8869 | # Respect a hint or command-line value. |
| 8870 | case "$shrpenv" in |
| 8871 | '') shrpenv="$tmp_shrpenv" ;; |
| 8872 | esac |
| 8873 | case "$ldlibpthname" in |
| 8874 | '') ldlibpthname=LD_LIBRARY_PATH ;; |
| 8875 | none) ldlibpthname='' ;; |
| 8876 | esac |
| 8877 | |
| 8878 | : determine where manual pages are on this system |
| 8879 | echo " " |
| 8880 | case "$sysman" in |
| 8881 | '') |
| 8882 | syspath='/usr/share/man/man1 /usr/man/man1' |
| 8883 | syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1" |
| 8884 | syspath="$syspath /usr/man/u_man/man1" |
| 8885 | syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" |
| 8886 | syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" |
| 8887 | syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" |
| 8888 | sysman=`./loc . /usr/man/man1 $syspath` |
| 8889 | ;; |
| 8890 | esac |
| 8891 | if $test -d "$sysman"; then |
| 8892 | echo "System manual is in $sysman." >&4 |
| 8893 | else |
| 8894 | echo "Could not find manual pages in source form." >&4 |
| 8895 | fi |
| 8896 | |
| 8897 | : determine where manual pages go |
| 8898 | set man1dir man1dir none |
| 8899 | eval $prefixit |
| 8900 | $cat <<EOM |
| 8901 | |
| 8902 | $spackage has manual pages available in source form. |
| 8903 | EOM |
| 8904 | case "$nroff" in |
| 8905 | nroff) |
| 8906 | echo "However, you don't have nroff, so they're probably useless to you." |
| 8907 | case "$man1dir" in |
| 8908 | '') man1dir="none";; |
| 8909 | esac;; |
| 8910 | esac |
| 8911 | echo "If you don't want the manual sources installed, answer 'none'." |
| 8912 | case "$man1dir" in |
| 8913 | ' ') dflt=none |
| 8914 | ;; |
| 8915 | '') |
| 8916 | lookpath="$prefixexp/share/man/man1" |
| 8917 | lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1" |
| 8918 | lookpath="$lookpath $prefixexp/man/p_man/man1" |
| 8919 | lookpath="$lookpath $prefixexp/man/u_man/man1" |
| 8920 | lookpath="$lookpath $prefixexp/man/man.1" |
| 8921 | case "$sysman" in |
| 8922 | */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;; |
| 8923 | *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;; |
| 8924 | esac |
| 8925 | set dflt |
| 8926 | eval $prefixup |
| 8927 | ;; |
| 8928 | *) dflt="$man1dir" |
| 8929 | ;; |
| 8930 | esac |
| 8931 | echo " " |
| 8932 | fn=dn+~ |
| 8933 | rp="Where do the main $spackage manual pages (source) go?" |
| 8934 | . ./getfile |
| 8935 | if $test "X$man1direxp" != "X$ansexp"; then |
| 8936 | installman1dir='' |
| 8937 | fi |
| 8938 | prefixvar=man1dir |
| 8939 | . ./setprefixvar |
| 8940 | |
| 8941 | case "$man1dir" in |
| 8942 | '') man1dir=' ' |
| 8943 | installman1dir='';; |
| 8944 | esac |
| 8945 | |
| 8946 | : What suffix to use on installed man pages |
| 8947 | |
| 8948 | case "$man1dir" in |
| 8949 | ' ') |
| 8950 | man1ext='0' |
| 8951 | ;; |
| 8952 | *) |
| 8953 | rp="What suffix should be used for the main $spackage man pages?" |
| 8954 | case "$man1ext" in |
| 8955 | '') case "$man1dir" in |
| 8956 | *1) dflt=1 ;; |
| 8957 | *1p) dflt=1p ;; |
| 8958 | *1pm) dflt=1pm ;; |
| 8959 | *l) dflt=l;; |
| 8960 | *n) dflt=n;; |
| 8961 | *o) dflt=o;; |
| 8962 | *p) dflt=p;; |
| 8963 | *C) dflt=C;; |
| 8964 | *L) dflt=L;; |
| 8965 | *L1) dflt=L1;; |
| 8966 | *) dflt=1;; |
| 8967 | esac |
| 8968 | ;; |
| 8969 | *) dflt="$man1ext";; |
| 8970 | esac |
| 8971 | . ./myread |
| 8972 | man1ext="$ans" |
| 8973 | ;; |
| 8974 | esac |
| 8975 | |
| 8976 | : see if we can have long filenames |
| 8977 | echo " " |
| 8978 | first=123456789abcdef |
| 8979 | $rm -f $first |
| 8980 | if (echo hi >$first) 2>/dev/null; then |
| 8981 | if $test -f 123456789abcde; then |
| 8982 | echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 |
| 8983 | val="$undef" |
| 8984 | else |
| 8985 | echo 'You can have filenames longer than 14 characters.'>&4 |
| 8986 | val="$define" |
| 8987 | fi |
| 8988 | else |
| 8989 | $cat <<'EOM' |
| 8990 | You can't have filenames longer than 14 chars. |
| 8991 | You can't even think about them! |
| 8992 | EOM |
| 8993 | val="$undef" |
| 8994 | fi |
| 8995 | set d_flexfnam |
| 8996 | eval $setvar |
| 8997 | $rm -rf 123456789abcde* |
| 8998 | |
| 8999 | : determine where library module manual pages go |
| 9000 | set man3dir man3dir none |
| 9001 | eval $prefixit |
| 9002 | $cat <<EOM |
| 9003 | |
| 9004 | $spackage has manual pages for many of the library modules. |
| 9005 | EOM |
| 9006 | |
| 9007 | case "$nroff" in |
| 9008 | nroff) |
| 9009 | $cat <<'EOM' |
| 9010 | However, you don't have nroff, so they're probably useless to you. |
| 9011 | EOM |
| 9012 | case "$man3dir" in |
| 9013 | '') man3dir="none";; |
| 9014 | esac;; |
| 9015 | esac |
| 9016 | |
| 9017 | case "$d_flexfnam" in |
| 9018 | undef) |
| 9019 | $cat <<'EOM' |
| 9020 | However, your system can't handle the long file names like File::Basename.3. |
| 9021 | EOM |
| 9022 | case "$man3dir" in |
| 9023 | '') man3dir="none";; |
| 9024 | esac;; |
| 9025 | esac |
| 9026 | |
| 9027 | echo "If you don't want the manual sources installed, answer 'none'." |
| 9028 | prog=`echo $package | $sed 's/-*[0-9.]*$//'` |
| 9029 | case "$man3dir" in |
| 9030 | '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` |
| 9031 | if $test -d "$privlib/man/man3"; then |
| 9032 | cat <<EOM >&4 |
| 9033 | |
| 9034 | WARNING: Previous versions of perl installed man3 pages into |
| 9035 | $privlib/man/man3. This version will suggest a |
| 9036 | new default of $dflt. |
| 9037 | EOM |
| 9038 | tdflt=$dflt |
| 9039 | dflt='n' |
| 9040 | rp='Do you wish to preserve the old behavior?(y/n)' |
| 9041 | . ./myread |
| 9042 | case "$ans" in |
| 9043 | y*) dflt="$privlib/man/man3" ;; |
| 9044 | *) dflt=$tdflt ;; |
| 9045 | esac |
| 9046 | fi |
| 9047 | ;; |
| 9048 | *) dflt="$man3dir" ;; |
| 9049 | esac |
| 9050 | case "$dflt" in |
| 9051 | ' ') dflt=none ;; |
| 9052 | esac |
| 9053 | echo " " |
| 9054 | fn=dn+~ |
| 9055 | rp="Where do the $package library man pages (source) go?" |
| 9056 | . ./getfile |
| 9057 | prefixvar=man3dir |
| 9058 | . ./setprefixvar |
| 9059 | |
| 9060 | case "$man3dir" in |
| 9061 | '') man3dir=' ' |
| 9062 | installman3dir='';; |
| 9063 | esac |
| 9064 | |
| 9065 | : What suffix to use on installed man pages |
| 9066 | case "$man3dir" in |
| 9067 | ' ') |
| 9068 | man3ext='0' |
| 9069 | ;; |
| 9070 | *) |
| 9071 | rp="What suffix should be used for the $package library man pages?" |
| 9072 | case "$man3ext" in |
| 9073 | '') case "$man3dir" in |
| 9074 | *3) dflt=3 ;; |
| 9075 | *3p) dflt=3p ;; |
| 9076 | *3pm) dflt=3pm ;; |
| 9077 | *l) dflt=l;; |
| 9078 | *n) dflt=n;; |
| 9079 | *o) dflt=o;; |
| 9080 | *p) dflt=p;; |
| 9081 | *C) dflt=C;; |
| 9082 | *L) dflt=L;; |
| 9083 | *L3) dflt=L3;; |
| 9084 | *) dflt=3;; |
| 9085 | esac |
| 9086 | ;; |
| 9087 | *) dflt="$man3ext";; |
| 9088 | esac |
| 9089 | . ./myread |
| 9090 | man3ext="$ans" |
| 9091 | ;; |
| 9092 | esac |
| 9093 | |
| 9094 | : see if we have to deal with yellow pages, now NIS. |
| 9095 | if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then |
| 9096 | case "$hostcat" in |
| 9097 | nidump*) ;; |
| 9098 | *) |
| 9099 | case "$hostcat" in |
| 9100 | *ypcat*) dflt=y;; |
| 9101 | '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then |
| 9102 | dflt=y |
| 9103 | else |
| 9104 | dflt=n |
| 9105 | fi;; |
| 9106 | *) dflt=n;; |
| 9107 | esac |
| 9108 | echo " " |
| 9109 | rp='Are you getting the hosts file via yellow pages?' |
| 9110 | . ./myread |
| 9111 | case "$ans" in |
| 9112 | y*) hostcat='ypcat hosts';; |
| 9113 | *) hostcat='cat /etc/hosts';; |
| 9114 | esac |
| 9115 | ;; |
| 9116 | esac |
| 9117 | fi |
| 9118 | case "$hostcat" in |
| 9119 | '') test -f /etc/hosts && hostcat='cat /etc/hosts';; |
| 9120 | esac |
| 9121 | case "$groupcat" in |
| 9122 | '') test -f /etc/group && groupcat='cat /etc/group';; |
| 9123 | esac |
| 9124 | case "$passcat" in |
| 9125 | '') test -f /etc/passwd && passcat='cat /etc/passwd';; |
| 9126 | esac |
| 9127 | |
| 9128 | : now get the host name |
| 9129 | echo " " |
| 9130 | echo "Figuring out host name..." >&4 |
| 9131 | case "$myhostname" in |
| 9132 | '') cont=true |
| 9133 | echo 'Maybe "hostname" will work...' |
| 9134 | if tans=`sh -c hostname 2>&1` ; then |
| 9135 | myhostname=$tans |
| 9136 | phostname=hostname |
| 9137 | cont='' |
| 9138 | fi |
| 9139 | ;; |
| 9140 | *) cont='';; |
| 9141 | esac |
| 9142 | if $test "$cont"; then |
| 9143 | if ./xenix; then |
| 9144 | echo 'Oh, dear. Maybe "/etc/systemid" is the key...' |
| 9145 | if tans=`cat /etc/systemid 2>&1` ; then |
| 9146 | myhostname=$tans |
| 9147 | phostname='cat /etc/systemid' |
| 9148 | echo "Whadyaknow. Xenix always was a bit strange..." |
| 9149 | cont='' |
| 9150 | fi |
| 9151 | elif $test -r /etc/systemid; then |
| 9152 | echo "(What is a non-Xenix system doing with /etc/systemid?)" |
| 9153 | fi |
| 9154 | fi |
| 9155 | if $test "$cont"; then |
| 9156 | echo 'No, maybe "uuname -l" will work...' |
| 9157 | if tans=`sh -c 'uuname -l' 2>&1` ; then |
| 9158 | myhostname=$tans |
| 9159 | phostname='uuname -l' |
| 9160 | else |
| 9161 | echo 'Strange. Maybe "uname -n" will work...' |
| 9162 | if tans=`sh -c 'uname -n' 2>&1` ; then |
| 9163 | myhostname=$tans |
| 9164 | phostname='uname -n' |
| 9165 | else |
| 9166 | echo 'Oh well, maybe I can mine it out of whoami.h...' |
| 9167 | if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then |
| 9168 | myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'` |
| 9169 | phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h" |
| 9170 | else |
| 9171 | case "$myhostname" in |
| 9172 | '') echo "Does this machine have an identity crisis or something?" |
| 9173 | phostname='';; |
| 9174 | *) |
| 9175 | echo "Well, you said $myhostname before..." |
| 9176 | phostname='echo $myhostname';; |
| 9177 | esac |
| 9178 | fi |
| 9179 | fi |
| 9180 | fi |
| 9181 | fi |
| 9182 | case "$myhostname" in |
| 9183 | '') myhostname=noname ;; |
| 9184 | esac |
| 9185 | : you do not want to know about this |
| 9186 | set $myhostname |
| 9187 | myhostname=$1 |
| 9188 | |
| 9189 | : verify guess |
| 9190 | if $test "$myhostname" ; then |
| 9191 | dflt=y |
| 9192 | rp='Your host name appears to be "'$myhostname'".'" Right?" |
| 9193 | . ./myread |
| 9194 | case "$ans" in |
| 9195 | y*) ;; |
| 9196 | *) myhostname='';; |
| 9197 | esac |
| 9198 | fi |
| 9199 | |
| 9200 | : bad guess or no guess |
| 9201 | while $test "X$myhostname" = X ; do |
| 9202 | dflt='' |
| 9203 | rp="Please type the (one word) name of your host:" |
| 9204 | . ./myread |
| 9205 | myhostname="$ans" |
| 9206 | done |
| 9207 | |
| 9208 | : translate upper to lower if necessary |
| 9209 | case "$myhostname" in |
| 9210 | *[A-Z]*) |
| 9211 | echo "(Normalizing case in your host name)" |
| 9212 | myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'` |
| 9213 | ;; |
| 9214 | esac |
| 9215 | |
| 9216 | case "$myhostname" in |
| 9217 | *.*) |
| 9218 | dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"` |
| 9219 | myhostname=`expr "X$myhostname" : "X\([^.]*\)\."` |
| 9220 | echo "(Trimming domain name from host name--host name is now $myhostname)" |
| 9221 | ;; |
| 9222 | *) case "$mydomain" in |
| 9223 | '') |
| 9224 | { |
| 9225 | test "X$hostcat" = "Xypcat hosts" && |
| 9226 | ypmatch "$myhostname" hosts 2>/dev/null |\ |
| 9227 | $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \ |
| 9228 | $test -s hosts |
| 9229 | } || { |
| 9230 | test "X$hostcat" != "X" && |
| 9231 | $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ / |
| 9232 | /[ ]$myhostname[ . ]/p" > hosts |
| 9233 | } |
| 9234 | tmp_re="[ . ]" |
| 9235 | if $test -f hosts; then |
| 9236 | $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ } |
| 9237 | END { print sum }" hosts` = x1 || tmp_re="[ ]" |
| 9238 | dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \ |
| 9239 | hosts | $sort | $uniq | \ |
| 9240 | $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"` |
| 9241 | case `$echo X$dflt` in |
| 9242 | X*\ *) echo "(Several hosts in the database matched hostname)" |
| 9243 | dflt=. |
| 9244 | ;; |
| 9245 | X.) echo "(You do not have fully-qualified names in the hosts database)" |
| 9246 | ;; |
| 9247 | esac |
| 9248 | else |
| 9249 | echo "(I cannot locate a hosts database anywhere)" |
| 9250 | dflt=. |
| 9251 | fi |
| 9252 | case "$dflt" in |
| 9253 | .) |
| 9254 | tans=`./loc resolv.conf X /etc /usr/etc` |
| 9255 | if $test -f "$tans"; then |
| 9256 | echo "(Attempting domain name extraction from $tans)" |
| 9257 | dflt=.`$sed -n -e 's/ / /g' \ |
| 9258 | -e 's/^search *\([^ ]*\).*/\1/p' $tans \ |
| 9259 | -e 1q 2>/dev/null` |
| 9260 | case "$dflt" in |
| 9261 | .) dflt=.`$sed -n -e 's/ / /g' \ |
| 9262 | -e 's/^domain *\([^ ]*\).*/\1/p' $tans \ |
| 9263 | -e 1q 2>/dev/null` |
| 9264 | ;; |
| 9265 | esac |
| 9266 | fi |
| 9267 | ;; |
| 9268 | esac |
| 9269 | case "$dflt" in |
| 9270 | .) echo "(No help from resolv.conf either -- attempting clever guess)" |
| 9271 | dflt=.`sh -c domainname 2>/dev/null` |
| 9272 | case "$dflt" in |
| 9273 | '') dflt='.';; |
| 9274 | .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;; |
| 9275 | esac |
| 9276 | ;; |
| 9277 | esac |
| 9278 | case "$dflt$osname" in |
| 9279 | .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')" |
| 9280 | dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null` |
| 9281 | ;; |
| 9282 | esac |
| 9283 | case "$dflt" in |
| 9284 | .) echo "(Lost all hope -- silly guess then)" |
| 9285 | dflt='.nonet' |
| 9286 | ;; |
| 9287 | esac |
| 9288 | $rm -f hosts |
| 9289 | ;; |
| 9290 | *) dflt="$mydomain";; |
| 9291 | esac;; |
| 9292 | esac |
| 9293 | echo " " |
| 9294 | rp="What is your domain name?" |
| 9295 | . ./myread |
| 9296 | tans="$ans" |
| 9297 | case "$ans" in |
| 9298 | '') ;; |
| 9299 | .*) ;; |
| 9300 | *) tans=".$tans";; |
| 9301 | esac |
| 9302 | mydomain="$tans" |
| 9303 | |
| 9304 | : translate upper to lower if necessary |
| 9305 | case "$mydomain" in |
| 9306 | *[A-Z]*) |
| 9307 | echo "(Normalizing case in your domain name)" |
| 9308 | mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'` |
| 9309 | ;; |
| 9310 | esac |
| 9311 | |
| 9312 | : a little sanity check here |
| 9313 | case "$phostname" in |
| 9314 | '') ;; |
| 9315 | *) |
| 9316 | case `$phostname | ./tr '[A-Z]' '[a-z]'` in |
| 9317 | $myhostname$mydomain|$myhostname) ;; |
| 9318 | *) |
| 9319 | case "$phostname" in |
| 9320 | sed*) |
| 9321 | echo "(That doesn't agree with your whoami.h file, by the way.)" |
| 9322 | ;; |
| 9323 | *) |
| 9324 | echo "(That doesn't agree with your $phostname command, by the way.)" |
| 9325 | ;; |
| 9326 | esac |
| 9327 | ;; |
| 9328 | esac |
| 9329 | ;; |
| 9330 | esac |
| 9331 | |
| 9332 | : determine the e-mail address of the user who is running us |
| 9333 | $cat <<EOM |
| 9334 | |
| 9335 | I need to get your e-mail address in Internet format if possible, i.e. |
| 9336 | something like user@host.domain. Please answer accurately since I have |
| 9337 | no easy means to double check it. The default value provided below |
| 9338 | is most probably close to reality but may not be valid from outside |
| 9339 | your organization... |
| 9340 | |
| 9341 | EOM |
| 9342 | cont=x |
| 9343 | while test "$cont"; do |
| 9344 | case "$MAILDOMAIN" in |
| 9345 | '') |
| 9346 | if $test -s /etc/mailname; then |
| 9347 | maildomain=`$cat /etc/mailname` |
| 9348 | else |
| 9349 | maildomain="$myhostname$mydomain" |
| 9350 | fi |
| 9351 | ;; |
| 9352 | *) maildomain="$MAILDOMAIN";; |
| 9353 | esac |
| 9354 | case "$cf_email" in |
| 9355 | '') dflt="$cf_by@$maildomain";; |
| 9356 | *) dflt="$cf_email";; |
| 9357 | esac |
| 9358 | rp='What is your e-mail address?' |
| 9359 | . ./myread |
| 9360 | cf_email="$ans" |
| 9361 | case "$cf_email" in |
| 9362 | *@*.*) cont='' ;; |
| 9363 | *) |
| 9364 | rp='Address does not look like an Internet one. Use it anyway?' |
| 9365 | case "$fastread" in |
| 9366 | yes) dflt=y ;; |
| 9367 | *) dflt=n ;; |
| 9368 | esac |
| 9369 | . ./myread |
| 9370 | case "$ans" in |
| 9371 | y*) cont='' ;; |
| 9372 | *) echo " " ;; |
| 9373 | esac |
| 9374 | ;; |
| 9375 | esac |
| 9376 | done |
| 9377 | |
| 9378 | : Ask e-mail of administrator |
| 9379 | $cat <<EOM |
| 9380 | |
| 9381 | If you or somebody else will be maintaining perl at your site, please |
| 9382 | fill in the correct e-mail address here so that they may be contacted |
| 9383 | if necessary. Currently, the "perlbug" program included with perl |
| 9384 | will send mail to this address in addition to perlbug@perl.org. You may |
| 9385 | enter "none" for no administrator. |
| 9386 | |
| 9387 | EOM |
| 9388 | case "$perladmin" in |
| 9389 | '') dflt="$cf_email";; |
| 9390 | *) dflt="$perladmin";; |
| 9391 | esac |
| 9392 | rp='Perl administrator e-mail address' |
| 9393 | . ./myread |
| 9394 | perladmin="$ans" |
| 9395 | |
| 9396 | : determine whether to use a version number suffix for installed binaries |
| 9397 | echo " " |
| 9398 | $cat <<EOM |
| 9399 | Do you want to use a version number suffix for installed binaries? This |
| 9400 | will install 'perl$version' instead of 'perl', and likewise for other |
| 9401 | binaries like 'perldoc' and 'cpan'. This allows many versions of perl |
| 9402 | to be installed side-by-side. Unless you are a developer, you probably |
| 9403 | do *not* want to do this. |
| 9404 | EOM |
| 9405 | case "$versiononly" in |
| 9406 | "$define"|[Yy]*|true) dflt='y' ;; |
| 9407 | *) dflt='n'; |
| 9408 | esac |
| 9409 | rp="Do you want to use a version number suffix for installed binaries?" |
| 9410 | . ./myread |
| 9411 | case "$ans" in |
| 9412 | [yY]*) val="$define";; |
| 9413 | *) val="$undef" ;; |
| 9414 | esac |
| 9415 | set versiononly |
| 9416 | eval $setvar |
| 9417 | |
| 9418 | case "$versiononly" in |
| 9419 | "$define") inc_version_list='' |
| 9420 | inc_version_list_init=0 |
| 9421 | ;; |
| 9422 | esac |
| 9423 | |
| 9424 | : figure out how to guarantee perl startup |
| 9425 | : XXX Note that this currently takes advantage of the bug that binexp ignores |
| 9426 | : the Configure -Dinstallprefix setting, which in turn means that under |
| 9427 | : relocatable @INC, initialinstalllocation is what binexp started as. |
| 9428 | case "$startperl" in |
| 9429 | '') |
| 9430 | case "$sharpbang" in |
| 9431 | *!) |
| 9432 | $cat <<EOH |
| 9433 | |
| 9434 | I can use the #! construct to start perl on your system. This will |
| 9435 | make startup of perl scripts faster, but may cause problems if you |
| 9436 | want to share those scripts and perl is not in a standard place |
| 9437 | ($initialinstalllocation/perl) on all your platforms. The alternative |
| 9438 | is to force a shell by starting the script with a single ':' character. |
| 9439 | |
| 9440 | EOH |
| 9441 | case "$versiononly" in |
| 9442 | "$define") dflt="$initialinstalllocation/perl$version";; |
| 9443 | *) dflt="$initialinstalllocation/perl";; |
| 9444 | esac |
| 9445 | rp='What shall I put after the #! to start up perl ("none" to not use #!)?' |
| 9446 | . ./myread |
| 9447 | case "$ans" in |
| 9448 | none) startperl=": # use perl";; |
| 9449 | *) startperl="#!$ans" |
| 9450 | if $test 30 -lt `echo "$ans" | wc -c`; then |
| 9451 | $cat >&4 <<EOM |
| 9452 | |
| 9453 | WARNING: Some systems limit the #! command to 32 characters. |
| 9454 | If you experience difficulty running Perl scripts with #!, try |
| 9455 | installing Perl in a directory with a shorter pathname. |
| 9456 | |
| 9457 | EOM |
| 9458 | fi ;; |
| 9459 | esac |
| 9460 | ;; |
| 9461 | *) startperl=": # use perl" |
| 9462 | ;; |
| 9463 | esac |
| 9464 | ;; |
| 9465 | esac |
| 9466 | echo "I'll use $startperl to start perl scripts." |
| 9467 | |
| 9468 | : figure best path for perl in scripts |
| 9469 | case "$perlpath" in |
| 9470 | '') |
| 9471 | case "$versiononly" in |
| 9472 | "$define") perlpath="$initialinstalllocation/perl$version";; |
| 9473 | *) perlpath="$initialinstalllocation/perl";; |
| 9474 | esac |
| 9475 | case "$startperl" in |
| 9476 | *!*) ;; |
| 9477 | *) |
| 9478 | $cat <<EOH |
| 9479 | |
| 9480 | I will use the "eval 'exec'" idiom to start Perl on your system. |
| 9481 | I can use the full path of your Perl binary for this purpose, but |
| 9482 | doing so may cause problems if you want to share those scripts and |
| 9483 | Perl is not always in a standard place ($initialinstalllocation/perl). |
| 9484 | |
| 9485 | EOH |
| 9486 | dflt="$initialinstalllocation/perl" |
| 9487 | rp="What path shall I use in \"eval 'exec'\"?" |
| 9488 | . ./myread |
| 9489 | perlpath="$ans" |
| 9490 | ;; |
| 9491 | esac |
| 9492 | ;; |
| 9493 | esac |
| 9494 | case "$startperl" in |
| 9495 | *!*) ;; |
| 9496 | *) echo "I'll use $perlpath in \"eval 'exec'\"" ;; |
| 9497 | esac |
| 9498 | |
| 9499 | : determine where public executable scripts go |
| 9500 | set scriptdir scriptdir |
| 9501 | eval $prefixit |
| 9502 | case "$scriptdir" in |
| 9503 | '') |
| 9504 | dflt="$bin" |
| 9505 | : guess some guesses |
| 9506 | $test -d /usr/share/scripts && dflt=/usr/share/scripts |
| 9507 | $test -d /usr/share/bin && dflt=/usr/share/bin |
| 9508 | $test -d /usr/local/script && dflt=/usr/local/script |
| 9509 | $test -d /usr/local/scripts && dflt=/usr/local/scripts |
| 9510 | $test -d $prefixexp/script && dflt=$prefixexp/script |
| 9511 | set dflt |
| 9512 | eval $prefixup |
| 9513 | ;; |
| 9514 | *) dflt="$scriptdir" |
| 9515 | ;; |
| 9516 | esac |
| 9517 | $cat <<EOM |
| 9518 | |
| 9519 | Some installations have a separate directory just for executable scripts so |
| 9520 | that they can mount it across multiple architectures but keep the scripts in |
| 9521 | one spot. You might, for example, have a subdirectory of /usr/share for this. |
| 9522 | Or you might just lump your scripts in with all your other executables. |
| 9523 | |
| 9524 | EOM |
| 9525 | fn=d~ |
| 9526 | rp='Where do you keep publicly executable scripts?' |
| 9527 | . ./getfile |
| 9528 | if $test "X$ansexp" != "X$scriptdirexp"; then |
| 9529 | installscript='' |
| 9530 | fi |
| 9531 | installscriptdir='' |
| 9532 | prefixvar=scriptdir |
| 9533 | . ./setprefixvar |
| 9534 | : A little fix up for an irregularly named variable. |
| 9535 | installscript="$installscriptdir" |
| 9536 | |
| 9537 | : determine where add-on public executables go |
| 9538 | case "$sitebin" in |
| 9539 | '') dflt=$siteprefix/bin ;; |
| 9540 | *) dflt=$sitebin ;; |
| 9541 | esac |
| 9542 | fn=d~ |
| 9543 | rp='Pathname where the add-on public executables should be installed?' |
| 9544 | . ./getfile |
| 9545 | prefixvar=sitebin |
| 9546 | . ./setprefixvar |
| 9547 | |
| 9548 | : determine where add-on html pages go |
| 9549 | : There is no standard location, so try to copy the previously-selected |
| 9550 | : directory structure for the core html pages. |
| 9551 | case "$sitehtml1dir" in |
| 9552 | '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;; |
| 9553 | *) dflt=$sitehtml1dir ;; |
| 9554 | esac |
| 9555 | case "$dflt" in |
| 9556 | ''|' ') dflt=none ;; |
| 9557 | esac |
| 9558 | fn=dn+~ |
| 9559 | rp='Pathname where the site-specific html pages should be installed?' |
| 9560 | . ./getfile |
| 9561 | prefixvar=sitehtml1dir |
| 9562 | . ./setprefixvar |
| 9563 | |
| 9564 | : determine where add-on library html pages go |
| 9565 | : There is no standard location, so try to copy the previously-selected |
| 9566 | : directory structure for the core html pages. |
| 9567 | case "$sitehtml3dir" in |
| 9568 | '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;; |
| 9569 | *) dflt=$sitehtml3dir ;; |
| 9570 | esac |
| 9571 | case "$dflt" in |
| 9572 | ''|' ') dflt=none ;; |
| 9573 | esac |
| 9574 | fn=dn+~ |
| 9575 | rp='Pathname where the site-specific library html pages should be installed?' |
| 9576 | . ./getfile |
| 9577 | prefixvar=sitehtml3dir |
| 9578 | . ./setprefixvar |
| 9579 | |
| 9580 | : determine where add-on manual pages go |
| 9581 | case "$siteman1dir" in |
| 9582 | '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;; |
| 9583 | *) dflt=$siteman1dir ;; |
| 9584 | esac |
| 9585 | case "$dflt" in |
| 9586 | ''|' ') dflt=none ;; |
| 9587 | esac |
| 9588 | fn=dn+~ |
| 9589 | rp='Pathname where the site-specific manual pages should be installed?' |
| 9590 | . ./getfile |
| 9591 | prefixvar=siteman1dir |
| 9592 | . ./setprefixvar |
| 9593 | |
| 9594 | : determine where add-on library man pages go |
| 9595 | case "$siteman3dir" in |
| 9596 | '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;; |
| 9597 | *) dflt=$siteman3dir ;; |
| 9598 | esac |
| 9599 | case "$dflt" in |
| 9600 | ''|' ') dflt=none ;; |
| 9601 | esac |
| 9602 | fn=dn+~ |
| 9603 | rp='Pathname where the site-specific library manual pages should be installed?' |
| 9604 | . ./getfile |
| 9605 | prefixvar=siteman3dir |
| 9606 | . ./setprefixvar |
| 9607 | |
| 9608 | : determine where add-on public executable scripts go |
| 9609 | case "$sitescript" in |
| 9610 | '') dflt=$siteprefix/script |
| 9611 | $test -d $dflt || dflt=$sitebin ;; |
| 9612 | *) dflt="$sitescript" ;; |
| 9613 | esac |
| 9614 | fn=d~+ |
| 9615 | rp='Pathname where add-on public executable scripts should be installed?' |
| 9616 | . ./getfile |
| 9617 | prefixvar=sitescript |
| 9618 | . ./setprefixvar |
| 9619 | |
| 9620 | : see if backtrace exists |
| 9621 | set backtrace d_backtrace |
| 9622 | eval $inlibc |
| 9623 | |
| 9624 | : Check if C backtrace is actually supported. |
| 9625 | case "$usecbacktrace" in |
| 9626 | "") usecbacktrace=$undef ;; |
| 9627 | [yY]*|true|$define) |
| 9628 | case "$d_backtrace" in |
| 9629 | [yY]*|true|$define) |
| 9630 | ;; |
| 9631 | *) |
| 9632 | echo "This system does not support backtrace" >&4 |
| 9633 | usecbacktrace=$undef |
| 9634 | ;; |
| 9635 | esac |
| 9636 | ;; |
| 9637 | esac |
| 9638 | |
| 9639 | : Check if faststdio is requested and available |
| 9640 | case "$usefaststdio" in |
| 9641 | $define|true|[yY]*|'') |
| 9642 | xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` |
| 9643 | case "$xversion" in |
| 9644 | [68]) dflt='y' ;; |
| 9645 | *) dflt='n' ;; |
| 9646 | esac |
| 9647 | ;; |
| 9648 | *) dflt='n';; |
| 9649 | esac |
| 9650 | cat <<EOM |
| 9651 | |
| 9652 | Perl can be built to use 'fast stdio', which means using the stdio |
| 9653 | library but also directly manipulating the stdio buffers to enable |
| 9654 | faster I/O. Using stdio is better for backward compatibility (especially |
| 9655 | for Perl extensions), but on the other hand since Perl 5.8 the 'perlio' |
| 9656 | interface has been preferred instead of stdio. |
| 9657 | |
| 9658 | If this doesn't make any sense to you, just accept the default '$dflt'. |
| 9659 | EOM |
| 9660 | rp='Use the "fast stdio" if available?' |
| 9661 | . ./myread |
| 9662 | case "$ans" in |
| 9663 | y|Y) val="$define" ;; |
| 9664 | *) val="$undef" ;; |
| 9665 | esac |
| 9666 | set usefaststdio |
| 9667 | eval $setvar |
| 9668 | |
| 9669 | : define an is-a-typedef? function |
| 9670 | typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; |
| 9671 | case "$inclist" in |
| 9672 | "") inclist="sys/types.h";; |
| 9673 | esac; |
| 9674 | eval "varval=\$$var"; |
| 9675 | case "$varval" in |
| 9676 | "") |
| 9677 | $rm -f temp.c; |
| 9678 | for inc in $inclist; do |
| 9679 | echo "#include <$inc>" >>temp.c; |
| 9680 | done; |
| 9681 | echo "#ifdef $type" >> temp.c; |
| 9682 | echo "printf(\"We have $type\");" >> temp.c; |
| 9683 | echo "#endif" >> temp.c; |
| 9684 | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; |
| 9685 | if $contains $type temp.E >/dev/null 2>&1; then |
| 9686 | eval "$var=\$type"; |
| 9687 | else |
| 9688 | eval "$var=\$def"; |
| 9689 | fi; |
| 9690 | $rm -f temp.?;; |
| 9691 | *) eval "$var=\$varval";; |
| 9692 | esac' |
| 9693 | |
| 9694 | : define an is-a-typedef? function that prompts if the type is not available. |
| 9695 | typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; |
| 9696 | case "$inclist" in |
| 9697 | "") inclist="sys/types.h";; |
| 9698 | esac; |
| 9699 | eval "varval=\$$var"; |
| 9700 | case "$varval" in |
| 9701 | "") |
| 9702 | $rm -f temp.c; |
| 9703 | for inc in $inclist; do |
| 9704 | echo "#include <$inc>" >>temp.c; |
| 9705 | done; |
| 9706 | echo "#ifdef $type" >> temp.c; |
| 9707 | echo "printf(\"We have $type\");" >> temp.c; |
| 9708 | echo "#endif" >> temp.c; |
| 9709 | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; |
| 9710 | echo " " ; |
| 9711 | echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./"; |
| 9712 | if $contains $type temp.E >/dev/null 2>&1; then |
| 9713 | echo "$type found." >&4; |
| 9714 | eval "$var=\$type"; |
| 9715 | else |
| 9716 | echo "$type NOT found." >&4; |
| 9717 | dflt="$def"; |
| 9718 | . ./myread ; |
| 9719 | eval "$var=\$ans"; |
| 9720 | fi; |
| 9721 | $rm -f temp.?;; |
| 9722 | *) eval "$var=\$varval";; |
| 9723 | esac' |
| 9724 | |
| 9725 | : see what type lseek is declared as in the kernel |
| 9726 | rp="What is the type used for lseek's offset on this system?" |
| 9727 | set off_t lseektype long stdio.h sys/types.h |
| 9728 | eval $typedef_ask |
| 9729 | |
| 9730 | echo " " |
| 9731 | echo "Checking to see how big your file offsets are..." >&4 |
| 9732 | $cat >try.c <<EOCP |
| 9733 | #include <sys/types.h> |
| 9734 | #include <stdio.h> |
| 9735 | int main() |
| 9736 | { |
| 9737 | printf("%d\n", (int)sizeof($lseektype)); |
| 9738 | return(0); |
| 9739 | } |
| 9740 | EOCP |
| 9741 | set try |
| 9742 | if eval $compile_ok; then |
| 9743 | lseeksize=`$run ./try` |
| 9744 | echo "Your file offsets are $lseeksize bytes long." |
| 9745 | else |
| 9746 | dflt=$longsize |
| 9747 | echo " " |
| 9748 | echo "(I can't seem to compile the test program. Guessing...)" |
| 9749 | rp="What is the size of your file offsets (in bytes)?" |
| 9750 | . ./myread |
| 9751 | lseeksize="$ans" |
| 9752 | fi |
| 9753 | $rm_try |
| 9754 | |
| 9755 | : see what type file positions are declared as in the library |
| 9756 | rp="What is the type for file position used by fsetpos()?" |
| 9757 | set fpos_t fpostype long stdio.h sys/types.h |
| 9758 | eval $typedef_ask |
| 9759 | |
| 9760 | : Check size for Fpos_t |
| 9761 | echo " " |
| 9762 | case "$fpostype" in |
| 9763 | *_t) zzz="$fpostype" ;; |
| 9764 | *) zzz="fpos_t" ;; |
| 9765 | esac |
| 9766 | echo "Checking the size of $zzz..." >&4 |
| 9767 | cat > try.c <<EOCP |
| 9768 | #include <sys/types.h> |
| 9769 | #include <stdio.h> |
| 9770 | #$i_stdlib I_STDLIB |
| 9771 | #ifdef I_STDLIB |
| 9772 | #include <stdlib.h> |
| 9773 | #endif |
| 9774 | int main() { |
| 9775 | printf("%d\n", (int)sizeof($fpostype)); |
| 9776 | exit(0); |
| 9777 | } |
| 9778 | EOCP |
| 9779 | set try |
| 9780 | if eval $compile_ok; then |
| 9781 | yyy=`$run ./try` |
| 9782 | case "$yyy" in |
| 9783 | '') fpossize=4 |
| 9784 | echo "(I can't execute the test program--guessing $fpossize.)" >&4 |
| 9785 | ;; |
| 9786 | *) fpossize=$yyy |
| 9787 | echo "Your $zzz is $fpossize bytes long." |
| 9788 | ;; |
| 9789 | esac |
| 9790 | else |
| 9791 | dflt="$longsize" |
| 9792 | echo " " >&4 |
| 9793 | echo "(I can't compile the test program. Guessing...)" >&4 |
| 9794 | rp="What is the size of your file positions (in bytes)?" |
| 9795 | . ./myread |
| 9796 | fpossize="$ans" |
| 9797 | fi |
| 9798 | |
| 9799 | : Check for large file support |
| 9800 | # Backward compatibility (uselfs is deprecated). |
| 9801 | case "$uselfs" in |
| 9802 | "$define"|true|[yY]*) |
| 9803 | cat <<EOM >&4 |
| 9804 | |
| 9805 | *** Configure -Duselfs is deprecated, using -Duselargefiles instead. |
| 9806 | EOM |
| 9807 | uselargefiles="$define" |
| 9808 | ;; |
| 9809 | esac |
| 9810 | |
| 9811 | case "$lseeksize:$fpossize" in |
| 9812 | 8:8) cat <<EOM |
| 9813 | |
| 9814 | You can have files larger than 2 gigabytes. |
| 9815 | EOM |
| 9816 | val="$define" ;; |
| 9817 | *) case "$uselargefiles" in |
| 9818 | "$undef"|false|[nN]*) dflt='n' ;; |
| 9819 | *) dflt='y' ;; |
| 9820 | esac |
| 9821 | cat <<EOM |
| 9822 | |
| 9823 | Perl can be built to understand large files (files larger than 2 gigabytes) |
| 9824 | on some systems. To do so, Configure can be run with -Duselargefiles. |
| 9825 | |
| 9826 | If this doesn't make any sense to you, just accept the default '$dflt'. |
| 9827 | EOM |
| 9828 | rp='Try to understand large files, if available?' |
| 9829 | . ./myread |
| 9830 | case "$ans" in |
| 9831 | y|Y) val="$define" ;; |
| 9832 | *) val="$undef" ;; |
| 9833 | esac |
| 9834 | ;; |
| 9835 | esac |
| 9836 | set uselargefiles |
| 9837 | eval $setvar |
| 9838 | : Look for a hint-file generated 'call-back-unit'. If the |
| 9839 | : user has specified that a large files perl is to be built, |
| 9840 | : we may need to set or change some other defaults. |
| 9841 | if $test -f uselargefiles.cbu; then |
| 9842 | echo "Your platform has some specific hints regarding large file builds, using them..." |
| 9843 | . ./uselargefiles.cbu |
| 9844 | fi |
| 9845 | case "$uselargefiles" in |
| 9846 | "$define") |
| 9847 | if $test -f uselargefiles.cbu; then |
| 9848 | echo " " |
| 9849 | echo "Rechecking to see how big your file offsets are..." >&4 |
| 9850 | $cat >try.c <<EOCP |
| 9851 | #include <sys/types.h> |
| 9852 | #include <stdio.h> |
| 9853 | int main() |
| 9854 | { |
| 9855 | printf("%d\n", (int)sizeof($lseektype)); |
| 9856 | return(0); |
| 9857 | } |
| 9858 | EOCP |
| 9859 | set try |
| 9860 | if eval $compile_ok; then |
| 9861 | lseeksize=`$run ./try` |
| 9862 | $echo "Your file offsets are now $lseeksize bytes long." |
| 9863 | else |
| 9864 | dflt="$lseeksize" |
| 9865 | echo " " |
| 9866 | echo "(I can't seem to compile the test program. Guessing...)" |
| 9867 | rp="What is the size of your file offsets (in bytes)?" |
| 9868 | . ./myread |
| 9869 | lseeksize="$ans" |
| 9870 | fi |
| 9871 | case "$fpostype" in |
| 9872 | *_t) zzz="$fpostype" ;; |
| 9873 | *) zzz="fpos_t" ;; |
| 9874 | esac |
| 9875 | $echo $n "Rechecking the size of $zzz...$c" >&4 |
| 9876 | $cat > try.c <<EOCP |
| 9877 | #include <sys/types.h> |
| 9878 | #include <stdio.h> |
| 9879 | #$i_stdlib I_STDLIB |
| 9880 | #ifdef I_STDLIB |
| 9881 | #include <stdlib.h> |
| 9882 | #endif |
| 9883 | int main() { |
| 9884 | printf("%d\n", (int)sizeof($fpostype)); |
| 9885 | return(0); |
| 9886 | } |
| 9887 | EOCP |
| 9888 | set try |
| 9889 | if eval $compile_ok; then |
| 9890 | yyy=`$run ./try` |
| 9891 | dflt="$lseeksize" |
| 9892 | case "$yyy" in |
| 9893 | '') echo " " |
| 9894 | echo "(I can't execute the test program--guessing $fpossize.)" >&4 |
| 9895 | ;; |
| 9896 | *) fpossize=$yyy |
| 9897 | echo " $fpossize bytes." >&4 |
| 9898 | ;; |
| 9899 | esac |
| 9900 | else |
| 9901 | dflt="$fpossize" |
| 9902 | echo " " |
| 9903 | echo "(I can't compile the test program. Guessing...)" >&4 |
| 9904 | rp="What is the size of your file positions (in bytes)?" |
| 9905 | . ./myread |
| 9906 | fpossize="$ans" |
| 9907 | fi |
| 9908 | $rm_try |
| 9909 | fi |
| 9910 | ;; |
| 9911 | esac |
| 9912 | |
| 9913 | : Check if we want perlio |
| 9914 | useperlio="$define" |
| 9915 | |
| 9916 | : Set the vendorbin variables |
| 9917 | case "$vendorprefix" in |
| 9918 | '') d_vendorbin="$undef" |
| 9919 | vendorbin='' |
| 9920 | vendorbinexp='' |
| 9921 | ;; |
| 9922 | *) d_vendorbin="$define" |
| 9923 | : determine where vendor-supplied executables go. |
| 9924 | case "$vendorbin" in |
| 9925 | '') dflt=$vendorprefix/bin ;; |
| 9926 | *) dflt="$vendorbin" ;; |
| 9927 | esac |
| 9928 | fn=d~+ |
| 9929 | rp='Pathname for the vendor-supplied executables directory?' |
| 9930 | . ./getfile |
| 9931 | vendorbin="$ans" |
| 9932 | vendorbinexp="$ansexp" |
| 9933 | ;; |
| 9934 | esac |
| 9935 | prefixvar=vendorbin |
| 9936 | . ./installprefix |
| 9937 | |
| 9938 | : Set the vendorhtml1dir variables |
| 9939 | case "$vendorprefix" in |
| 9940 | '') vendorhtml1dir='' |
| 9941 | vendorhtml1direxp='' |
| 9942 | ;; |
| 9943 | *) : determine where vendor-supplied html pages go. |
| 9944 | : There is no standard location, so try to copy the previously-selected |
| 9945 | : directory structure for the core html pages. |
| 9946 | : XXX Better default suggestions would be welcome. |
| 9947 | case "$vendorhtml1dir" in |
| 9948 | '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;; |
| 9949 | *) dflt=$vendorhtml1dir ;; |
| 9950 | esac |
| 9951 | case "$dflt" in |
| 9952 | ''|' ') dflt=none ;; |
| 9953 | esac |
| 9954 | fn=dn+~ |
| 9955 | rp='Pathname for the vendor-supplied html pages?' |
| 9956 | . ./getfile |
| 9957 | vendorhtml1dir="$ans" |
| 9958 | vendorhtml1direxp="$ansexp" |
| 9959 | ;; |
| 9960 | esac |
| 9961 | : Use ' ' for none so value is preserved next time through Configure |
| 9962 | $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' ' |
| 9963 | prefixvar=vendorhtml1dir |
| 9964 | . ./installprefix |
| 9965 | |
| 9966 | : Set the vendorhtml3dir variables |
| 9967 | case "$vendorprefix" in |
| 9968 | '') vendorhtml3dir='' |
| 9969 | vendorhtml3direxp='' |
| 9970 | ;; |
| 9971 | *) : determine where vendor-supplied module html pages go. |
| 9972 | : There is no standard location, so try to copy the previously-selected |
| 9973 | : directory structure for the core html pages. |
| 9974 | : XXX Better default suggestions would be welcome. |
| 9975 | case "$vendorhtml3dir" in |
| 9976 | '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;; |
| 9977 | *) dflt=$vendorhtml3dir ;; |
| 9978 | esac |
| 9979 | case "$dflt" in |
| 9980 | ''|' ') dflt=none ;; |
| 9981 | esac |
| 9982 | fn=dn+~ |
| 9983 | rp='Pathname for the vendor-supplied html pages?' |
| 9984 | . ./getfile |
| 9985 | vendorhtml3dir="$ans" |
| 9986 | vendorhtml3direxp="$ansexp" |
| 9987 | ;; |
| 9988 | esac |
| 9989 | : Use ' ' for none so value is preserved next time through Configure |
| 9990 | $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' ' |
| 9991 | prefixvar=vendorhtml3dir |
| 9992 | . ./installprefix |
| 9993 | |
| 9994 | : Set the vendorman1dir variables |
| 9995 | case "$vendorprefix" in |
| 9996 | '') vendorman1dir='' |
| 9997 | vendorman1direxp='' |
| 9998 | ;; |
| 9999 | *) : determine where vendor-supplied manual pages go. |
| 10000 | case "$vendorman1dir" in |
| 10001 | '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;; |
| 10002 | *) dflt=$vendorman1dir ;; |
| 10003 | esac |
| 10004 | case "$dflt" in |
| 10005 | ''|' ') dflt=none ;; |
| 10006 | esac |
| 10007 | fn=nd~+ |
| 10008 | rp='Pathname for the vendor-supplied manual section 1 pages?' |
| 10009 | . ./getfile |
| 10010 | vendorman1dir="$ans" |
| 10011 | vendorman1direxp="$ansexp" |
| 10012 | ;; |
| 10013 | esac |
| 10014 | : Use ' ' for none so value is preserved next time through Configure |
| 10015 | $test X"$vendorman1dir" = "X" && vendorman1dir=' ' |
| 10016 | prefixvar=vendorman1dir |
| 10017 | . ./installprefix |
| 10018 | |
| 10019 | : Set the vendorman3dir variables |
| 10020 | case "$vendorprefix" in |
| 10021 | '') vendorman3dir='' |
| 10022 | vendorman3direxp='' |
| 10023 | ;; |
| 10024 | *) : determine where vendor-supplied module manual pages go. |
| 10025 | case "$vendorman3dir" in |
| 10026 | '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;; |
| 10027 | *) dflt=$vendorman3dir ;; |
| 10028 | esac |
| 10029 | case "$dflt" in |
| 10030 | ''|' ') dflt=none ;; |
| 10031 | esac |
| 10032 | fn=nd~+ |
| 10033 | rp='Pathname for the vendor-supplied manual section 3 pages?' |
| 10034 | . ./getfile |
| 10035 | vendorman3dir="$ans" |
| 10036 | vendorman3direxp="$ansexp" |
| 10037 | ;; |
| 10038 | esac |
| 10039 | : Use ' ' for none so value is preserved next time through Configure |
| 10040 | $test X"$vendorman3dir" = "X" && vendorman3dir=' ' |
| 10041 | prefixvar=vendorman3dir |
| 10042 | . ./installprefix |
| 10043 | |
| 10044 | : Set the vendorscript variables |
| 10045 | case "$vendorprefix" in |
| 10046 | '') d_vendorscript="$undef" |
| 10047 | vendorscript='' |
| 10048 | vendorscriptexp='' |
| 10049 | ;; |
| 10050 | *) d_vendorscript="$define" |
| 10051 | : determine where vendor-supplied scripts go. |
| 10052 | case "$vendorscript" in |
| 10053 | '') dflt=$vendorprefix/script |
| 10054 | $test -d $dflt || dflt=$vendorbin ;; |
| 10055 | *) dflt="$vendorscript" ;; |
| 10056 | esac |
| 10057 | $cat <<EOM |
| 10058 | |
| 10059 | The installation process will create a directory for |
| 10060 | vendor-supplied scripts. |
| 10061 | |
| 10062 | EOM |
| 10063 | fn=d~+ |
| 10064 | rp='Pathname for the vendor-supplied scripts directory?' |
| 10065 | . ./getfile |
| 10066 | vendorscript="$ans" |
| 10067 | vendorscriptexp="$ansexp" |
| 10068 | ;; |
| 10069 | esac |
| 10070 | prefixvar=vendorscript |
| 10071 | . ./installprefix |
| 10072 | |
| 10073 | : see if qgcvt exists |
| 10074 | set qgcvt d_qgcvt |
| 10075 | eval $inlibc |
| 10076 | |
| 10077 | : Check what kind of doubles your system has |
| 10078 | $echo "Checking the kind of doubles you have..." >&4 |
| 10079 | $cat >try.c <<EOP |
| 10080 | #$i_stdlib I_STDLIB |
| 10081 | #define DOUBLESIZE $doublesize |
| 10082 | #ifdef I_STDLIB |
| 10083 | #include <stdlib.h> |
| 10084 | #endif |
| 10085 | #include <stdio.h> |
| 10086 | static const double d = -0.1; |
| 10087 | int main() { |
| 10088 | unsigned const char* b = (unsigned const char*)(&d); |
| 10089 | #if DOUBLESIZE == 4 |
| 10090 | if (b[0] == 0xCD && b[3] == 0xBD) { |
| 10091 | /* IEEE 754 32-bit little-endian */ |
| 10092 | printf("1\n"); |
| 10093 | exit(0); |
| 10094 | } |
| 10095 | if (b[0] == 0xBD && b[3] == 0xCD) { |
| 10096 | /* IEEE 754 32-bit big-endian */ |
| 10097 | printf("2\n"); |
| 10098 | exit(0); |
| 10099 | } |
| 10100 | if (b[0] == 0xCC && b[3] == 0xCC) { |
| 10101 | /* VAX format F, 32-bit PDP-style mixed endian. */ |
| 10102 | printf("9\n"); |
| 10103 | exit(0); |
| 10104 | } |
| 10105 | if (b[0] == 0xC0 && b[3] == 0x9A) { |
| 10106 | /* IBM single 32-bit */ |
| 10107 | printf("12\n"); |
| 10108 | exit(0); |
| 10109 | } |
| 10110 | #endif |
| 10111 | #if DOUBLESIZE == 8 |
| 10112 | if (b[0] == 0x9A && b[7] == 0xBF) { |
| 10113 | /* IEEE 754 64-bit little-endian */ |
| 10114 | printf("3\n"); |
| 10115 | exit(0); |
| 10116 | } |
| 10117 | if (b[0] == 0xBF && b[7] == 0x9A) { |
| 10118 | /* IEEE 754 64-bit big-endian */ |
| 10119 | printf("4\n"); |
| 10120 | exit(0); |
| 10121 | } |
| 10122 | if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) { |
| 10123 | /* ARM mixed endian: two little-endian 32-bit floats, in big endian order: |
| 10124 | * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0) |
| 10125 | * 99 99 b9 bf 9a 99 99 99 */ |
| 10126 | printf("7\n"); |
| 10127 | exit(0); |
| 10128 | } |
| 10129 | if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) { |
| 10130 | /* The opposite of case 7, mixed endian: two big-endian 32-bit floats, |
| 10131 | * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0) |
| 10132 | * 99 99 99 9a bf b9 99 99 */ |
| 10133 | printf("8\n"); |
| 10134 | exit(0); |
| 10135 | } |
| 10136 | if (b[0] == 0xCC && b[7] == 0xCC) { |
| 10137 | /* VAX format D, 64-bit PDP-style mixed endian. */ |
| 10138 | printf("10\n"); |
| 10139 | exit(0); |
| 10140 | } |
| 10141 | if (b[0] == 0xD9 && b[7] == 0x99) { |
| 10142 | /* VAX format G, 64-bit PDP-style mixed endian. */ |
| 10143 | printf("11\n"); |
| 10144 | exit(0); |
| 10145 | } |
| 10146 | if (b[0] == 0xC0 && b[7] == 0x9A) { |
| 10147 | /* IBM double 64-bit */ |
| 10148 | printf("13\n"); |
| 10149 | exit(0); |
| 10150 | } |
| 10151 | if (b[0] == 0xBF && b[7] == 0xCD) { |
| 10152 | /* CRAY single 64-bit */ |
| 10153 | printf("14\n"); |
| 10154 | exit(0); |
| 10155 | } |
| 10156 | #endif |
| 10157 | #if DOUBLESIZE == 16 |
| 10158 | if (b[0] == 0x9A && b[15] == 0xBF) { |
| 10159 | /* IEEE 754 128-bit little-endian */ |
| 10160 | printf("5\n"); |
| 10161 | exit(0); |
| 10162 | } |
| 10163 | if (b[0] == 0xBF && b[15] == 0x9A) { |
| 10164 | /* IEEE 754 128-bit big-endian */ |
| 10165 | printf("6\n"); |
| 10166 | exit(0); |
| 10167 | } |
| 10168 | #endif |
| 10169 | /* Then there are old mainframe/miniframe formats like IBM and CRAY. |
| 10170 | * Whether those environments can still build Perl is debatable. */ |
| 10171 | printf("-1\n"); /* unknown */ |
| 10172 | exit(0); |
| 10173 | } |
| 10174 | EOP |
| 10175 | set try |
| 10176 | if eval $compile; then |
| 10177 | doublekind=`$run ./try` |
| 10178 | else |
| 10179 | doublekind=-1 |
| 10180 | fi |
| 10181 | case "$doublekind" in |
| 10182 | 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;; |
| 10183 | 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;; |
| 10184 | 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;; |
| 10185 | 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;; |
| 10186 | 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;; |
| 10187 | 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;; |
| 10188 | 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;; |
| 10189 | 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;; |
| 10190 | 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;; |
| 10191 | 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;; |
| 10192 | 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;; |
| 10193 | 12) echo "You have IBM short 32-bit doubles." >&4 ;; |
| 10194 | 13) echo "You have IBM long 64-bit doubles." >&4 ;; |
| 10195 | 14) echo "You have Cray single 64-bit doubles." >&4 ;; |
| 10196 | *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;; |
| 10197 | esac |
| 10198 | d_double_style_ieee=$undef |
| 10199 | d_double_style_vax=$undef |
| 10200 | d_double_style_ibm=$undef |
| 10201 | d_double_style_cray=$undef |
| 10202 | case "$doublekind" in |
| 10203 | 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;; |
| 10204 | 9|10|11) d_double_style_vax=$define ;; |
| 10205 | 12|13) d_double_style_ibm=$define ;; |
| 10206 | 14) d_double_style_cray=$define ;; |
| 10207 | esac |
| 10208 | case "$d_double_style_ieee" in |
| 10209 | $define) |
| 10210 | d_double_has_inf=$define |
| 10211 | d_double_has_nan=$define |
| 10212 | d_double_has_negative_zero=$define |
| 10213 | d_double_has_subnormals=$define |
| 10214 | ;; |
| 10215 | *) |
| 10216 | d_double_has_inf=$undef |
| 10217 | d_double_has_nan=$undef |
| 10218 | d_double_has_negative_zero=$undef |
| 10219 | d_double_has_subnormals=$undef |
| 10220 | ;; |
| 10221 | esac |
| 10222 | $rm_try |
| 10223 | |
| 10224 | : Check print/scan long double stuff |
| 10225 | echo " " |
| 10226 | |
| 10227 | if $test X"$d_longdbl" = X"$define"; then |
| 10228 | |
| 10229 | echo "Checking how to print long doubles..." >&4 |
| 10230 | |
| 10231 | if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then |
| 10232 | $cat >try.c <<'EOCP' |
| 10233 | #include <sys/types.h> |
| 10234 | #include <stdio.h> |
| 10235 | int main() { |
| 10236 | double d = 123.456; |
| 10237 | printf("%.3f\n", d); |
| 10238 | } |
| 10239 | EOCP |
| 10240 | set try |
| 10241 | if eval $compile; then |
| 10242 | yyy=`$run ./try` |
| 10243 | case "$yyy" in |
| 10244 | 123.456) |
| 10245 | sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"'; |
| 10246 | sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"'; |
| 10247 | echo "We will use %f." |
| 10248 | ;; |
| 10249 | esac |
| 10250 | fi |
| 10251 | fi |
| 10252 | |
| 10253 | if $test X"$sPRIfldbl" = X; then |
| 10254 | $cat >try.c <<'EOCP' |
| 10255 | #include <sys/types.h> |
| 10256 | #include <stdio.h> |
| 10257 | int main() { |
| 10258 | long double d = 123.456; |
| 10259 | printf("%.3Lf\n", d); |
| 10260 | } |
| 10261 | EOCP |
| 10262 | set try |
| 10263 | if eval $compile; then |
| 10264 | yyy=`$run ./try` |
| 10265 | case "$yyy" in |
| 10266 | 123.456) |
| 10267 | sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"'; |
| 10268 | sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"'; |
| 10269 | echo "We will use %Lf." |
| 10270 | ;; |
| 10271 | esac |
| 10272 | fi |
| 10273 | fi |
| 10274 | |
| 10275 | if $test X"$sPRIfldbl" = X; then |
| 10276 | $cat >try.c <<'EOCP' |
| 10277 | #include <sys/types.h> |
| 10278 | #include <stdio.h> |
| 10279 | int main() { |
| 10280 | long double d = 123.456; |
| 10281 | printf("%.3llf\n", d); |
| 10282 | } |
| 10283 | EOCP |
| 10284 | set try |
| 10285 | if eval $compile; then |
| 10286 | yyy=`$run ./try` |
| 10287 | case "$yyy" in |
| 10288 | 123.456) |
| 10289 | sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"'; |
| 10290 | sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"'; |
| 10291 | echo "We will use %llf." |
| 10292 | ;; |
| 10293 | esac |
| 10294 | fi |
| 10295 | fi |
| 10296 | |
| 10297 | if $test X"$sPRIfldbl" = X; then |
| 10298 | $cat >try.c <<'EOCP' |
| 10299 | #include <sys/types.h> |
| 10300 | #include <stdio.h> |
| 10301 | int main() { |
| 10302 | long double d = 123.456; |
| 10303 | printf("%.3lf\n", d); |
| 10304 | } |
| 10305 | EOCP |
| 10306 | set try |
| 10307 | if eval $compile; then |
| 10308 | yyy=`$run ./try` |
| 10309 | case "$yyy" in |
| 10310 | 123.456) |
| 10311 | sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"'; |
| 10312 | sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"'; |
| 10313 | echo "We will use %lf." |
| 10314 | ;; |
| 10315 | esac |
| 10316 | fi |
| 10317 | fi |
| 10318 | |
| 10319 | if $test X"$sPRIfldbl" = X; then |
| 10320 | echo "Cannot figure out how to print long doubles." >&4 |
| 10321 | else |
| 10322 | sSCNfldbl=$sPRIfldbl # expect consistency |
| 10323 | fi |
| 10324 | |
| 10325 | $rm_try |
| 10326 | |
| 10327 | fi # d_longdbl |
| 10328 | |
| 10329 | case "$sPRIfldbl" in |
| 10330 | '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef"; |
| 10331 | d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef"; |
| 10332 | d_SCNfldbl="$undef"; |
| 10333 | ;; |
| 10334 | *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define"; |
| 10335 | d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define"; |
| 10336 | d_SCNfldbl="$define"; |
| 10337 | ;; |
| 10338 | esac |
| 10339 | |
| 10340 | : Before committing on uselongdouble, see whether that looks sane. |
| 10341 | if $test "$uselongdouble" = "$define"; then |
| 10342 | message="" |
| 10343 | echo " " |
| 10344 | echo "Checking if your long double math functions work right..." >&4 |
| 10345 | $cat > try.c <<EOF |
| 10346 | #include <math.h> |
| 10347 | #include <stdio.h> |
| 10348 | int main() { |
| 10349 | printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L))); |
| 10350 | } |
| 10351 | EOF |
| 10352 | case "$osname:$gccversion" in |
| 10353 | aix:) saveccflags="$ccflags" |
| 10354 | ccflags="$ccflags -qlongdouble" ;; # to avoid core dump |
| 10355 | esac |
| 10356 | set try |
| 10357 | if eval $compile_ok; then |
| 10358 | yyy=`$run ./try` |
| 10359 | fi |
| 10360 | case "$yyy" in |
| 10361 | 3) echo "Your long double math functions are working correctly." >&4 ;; |
| 10362 | *) echo "Your long double math functions are broken, not using long doubles." >&4 |
| 10363 | uselongdouble=$undef |
| 10364 | ;; |
| 10365 | esac |
| 10366 | $rm_try |
| 10367 | case "$osname:$gccversion" in |
| 10368 | aix:) ccflags="$saveccflags" ;; # restore |
| 10369 | esac |
| 10370 | fi |
| 10371 | |
| 10372 | : Check how to convert floats to strings. |
| 10373 | |
| 10374 | if test "X$d_Gconvert" = X; then |
| 10375 | |
| 10376 | echo " " |
| 10377 | echo "Checking for an efficient way to convert floats to strings." |
| 10378 | echo " " > try.c |
| 10379 | case "$uselongdouble" in |
| 10380 | "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;; |
| 10381 | esac |
| 10382 | case "$d_longdbl" in |
| 10383 | "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;; |
| 10384 | esac |
| 10385 | case "$d_PRIgldbl" in |
| 10386 | "$define") echo "#define HAS_PRIgldbl" >>try.c ;; |
| 10387 | esac |
| 10388 | $cat >>try.c <<EOP |
| 10389 | #ifdef TRY_gconvert |
| 10390 | #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b)) |
| 10391 | const char *myname = "gconvert"; |
| 10392 | #endif |
| 10393 | #ifdef TRY_gcvt |
| 10394 | #define Gconvert(x,n,t,b) gcvt((x),(n),(b)) |
| 10395 | const char *myname = "gcvt"; |
| 10396 | #endif |
| 10397 | #ifdef TRY_qgcvt |
| 10398 | #define Gconvert(x,n,t,b) qgcvt((x),(n),(b)) |
| 10399 | const char *myname = "qgcvt"; |
| 10400 | #define DOUBLETYPE long double |
| 10401 | #endif |
| 10402 | #ifdef TRY_sprintf |
| 10403 | #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) |
| 10404 | #ifdef HAS_PRIgldbl |
| 10405 | #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x)) |
| 10406 | #else |
| 10407 | #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x)) |
| 10408 | #endif |
| 10409 | #else |
| 10410 | #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) |
| 10411 | #endif |
| 10412 | const char *myname = "sprintf"; |
| 10413 | #endif |
| 10414 | |
| 10415 | #ifndef DOUBLETYPE |
| 10416 | #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) |
| 10417 | #define DOUBLETYPE long double |
| 10418 | #else |
| 10419 | #define DOUBLETYPE double |
| 10420 | #endif |
| 10421 | #endif |
| 10422 | |
| 10423 | #include <stdio.h> |
| 10424 | |
| 10425 | #$i_stdlib I_STDLIB |
| 10426 | #ifdef I_STDLIB |
| 10427 | #include <stdlib.h> |
| 10428 | #endif |
| 10429 | #include <string.h> |
| 10430 | |
| 10431 | void checkit(const char *expect, char *got) |
| 10432 | { |
| 10433 | if (strcmp(expect, got)) { |
| 10434 | printf("%s oddity: Expected %s, got %s\n", |
| 10435 | myname, expect, got); |
| 10436 | exit(1); |
| 10437 | } |
| 10438 | } |
| 10439 | |
| 10440 | int main() |
| 10441 | { |
| 10442 | char buf[64]; |
| 10443 | buf[63] = '\0'; |
| 10444 | |
| 10445 | /* This must be 1st test on (which?) platform */ |
| 10446 | /* Alan Burlison <AlanBurlsin@unn.unisys.com> */ |
| 10447 | Gconvert((DOUBLETYPE)0.1, 8, 0, buf); |
| 10448 | checkit("0.1", buf); |
| 10449 | |
| 10450 | Gconvert((DOUBLETYPE)0.01, 8, 0, buf); |
| 10451 | checkit("0.01", buf); |
| 10452 | |
| 10453 | Gconvert((DOUBLETYPE)0.001, 8, 0, buf); |
| 10454 | checkit("0.001", buf); |
| 10455 | |
| 10456 | Gconvert((DOUBLETYPE)0.0001, 8, 0, buf); |
| 10457 | checkit("0.0001", buf); |
| 10458 | |
| 10459 | Gconvert((DOUBLETYPE)0.00009, 8, 0, buf); |
| 10460 | if (strlen(buf) > 5) |
| 10461 | checkit("9e-005", buf); /* for Microsoft ?? */ |
| 10462 | else |
| 10463 | checkit("9e-05", buf); |
| 10464 | |
| 10465 | Gconvert((DOUBLETYPE)1.0, 8, 0, buf); |
| 10466 | checkit("1", buf); |
| 10467 | |
| 10468 | Gconvert((DOUBLETYPE)1.1, 8, 0, buf); |
| 10469 | checkit("1.1", buf); |
| 10470 | |
| 10471 | Gconvert((DOUBLETYPE)1.01, 8, 0, buf); |
| 10472 | checkit("1.01", buf); |
| 10473 | |
| 10474 | Gconvert((DOUBLETYPE)1.001, 8, 0, buf); |
| 10475 | checkit("1.001", buf); |
| 10476 | |
| 10477 | Gconvert((DOUBLETYPE)1.0001, 8, 0, buf); |
| 10478 | checkit("1.0001", buf); |
| 10479 | |
| 10480 | Gconvert((DOUBLETYPE)1.00001, 8, 0, buf); |
| 10481 | checkit("1.00001", buf); |
| 10482 | |
| 10483 | Gconvert((DOUBLETYPE)1.000001, 8, 0, buf); |
| 10484 | checkit("1.000001", buf); |
| 10485 | |
| 10486 | Gconvert((DOUBLETYPE)0.0, 8, 0, buf); |
| 10487 | checkit("0", buf); |
| 10488 | |
| 10489 | Gconvert((DOUBLETYPE)-1.0, 8, 0, buf); |
| 10490 | checkit("-1", buf); |
| 10491 | |
| 10492 | /* Some Linux gcvt's give 1.e+5 here. */ |
| 10493 | Gconvert((DOUBLETYPE)100000.0, 8, 0, buf); |
| 10494 | checkit("100000", buf); |
| 10495 | |
| 10496 | /* Some Linux gcvt's give -1.e+5 here. */ |
| 10497 | Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf); |
| 10498 | checkit("-100000", buf); |
| 10499 | |
| 10500 | Gconvert((DOUBLETYPE)123.456, 8, 0, buf); |
| 10501 | checkit("123.456", buf); |
| 10502 | |
| 10503 | /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */ |
| 10504 | Gconvert((DOUBLETYPE)1e34, 8, 0, buf); |
| 10505 | /* 34 should be enough to scare even long double |
| 10506 | * places into using the e notation. */ |
| 10507 | if (strlen(buf) > 5) |
| 10508 | checkit("1e+034", buf); /* for Microsoft */ |
| 10509 | else |
| 10510 | checkit("1e+34", buf); |
| 10511 | |
| 10512 | /* For Perl, if you add additional tests here, also add them to |
| 10513 | * t/base/num.t for benefit of platforms not using Configure or |
| 10514 | * overriding d_Gconvert */ |
| 10515 | |
| 10516 | exit(0); |
| 10517 | } |
| 10518 | EOP |
| 10519 | : first add preferred functions to our list |
| 10520 | xxx_list="" |
| 10521 | for xxx_convert in $gconvert_preference; do |
| 10522 | case $xxx_convert in |
| 10523 | gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;; |
| 10524 | *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;; |
| 10525 | esac |
| 10526 | done |
| 10527 | : then add any others |
| 10528 | for xxx_convert in gconvert gcvt sprintf; do |
| 10529 | case "$xxx_list" in |
| 10530 | *$xxx_convert*) ;; |
| 10531 | *) xxx_list="$xxx_list $xxx_convert" ;; |
| 10532 | esac |
| 10533 | done |
| 10534 | |
| 10535 | case "$d_longdbl$uselongdouble" in |
| 10536 | "$define$define") |
| 10537 | : again, add preferred functions to our list first |
| 10538 | xxx_ld_list="" |
| 10539 | for xxx_convert in $gconvert_ld_preference; do |
| 10540 | case $xxx_convert in |
| 10541 | qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;; |
| 10542 | *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;; |
| 10543 | esac |
| 10544 | done |
| 10545 | : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt |
| 10546 | for xxx_convert in qgcvt sprintf $xxx_list; do |
| 10547 | case "$xxx_ld_list" in |
| 10548 | $xxx_convert*|*" $xxx_convert"*) ;; |
| 10549 | *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;; |
| 10550 | esac |
| 10551 | done |
| 10552 | : if sprintf cannot do long doubles, move it to the end |
| 10553 | if test "$d_PRIgldbl" != "$define"; then |
| 10554 | xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf" |
| 10555 | fi |
| 10556 | : if no qgcvt, remove it |
| 10557 | if test "$d_qgcvt" != "$define"; then |
| 10558 | xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`" |
| 10559 | fi |
| 10560 | : use the ld_list |
| 10561 | xxx_list="$xxx_ld_list" |
| 10562 | ;; |
| 10563 | esac |
| 10564 | |
| 10565 | for xxx_convert in $xxx_list; do |
| 10566 | echo "Trying $xxx_convert..." |
| 10567 | $rm -f try try$_o core |
| 10568 | set try -DTRY_$xxx_convert |
| 10569 | if eval $compile; then |
| 10570 | echo "$xxx_convert() found." >&4 |
| 10571 | if $run ./try; then |
| 10572 | echo "I'll use $xxx_convert to convert floats into a string." >&4 |
| 10573 | break; |
| 10574 | else |
| 10575 | echo "...But $xxx_convert didn't work as I expected." |
| 10576 | xxx_convert='' |
| 10577 | fi |
| 10578 | else |
| 10579 | echo "$xxx_convert NOT found." >&4 |
| 10580 | xxx_convert='' |
| 10581 | fi |
| 10582 | done |
| 10583 | |
| 10584 | if test X$xxx_convert = X; then |
| 10585 | echo "*** WHOA THERE!!! ***" >&4 |
| 10586 | echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4 |
| 10587 | xxx_convert=sprintf |
| 10588 | fi |
| 10589 | |
| 10590 | case "$xxx_convert" in |
| 10591 | gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;; |
| 10592 | gcvt) d_Gconvert='gcvt((x),(n),(b))' ;; |
| 10593 | qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;; |
| 10594 | *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in |
| 10595 | "$define$define$define") |
| 10596 | d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;; |
| 10597 | "$define$define$undef") |
| 10598 | d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;; |
| 10599 | *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;; |
| 10600 | esac |
| 10601 | ;; |
| 10602 | esac |
| 10603 | |
| 10604 | fi |
| 10605 | $rm_try |
| 10606 | |
| 10607 | : see if _fwalk exists |
| 10608 | set fwalk d__fwalk |
| 10609 | eval $inlibc |
| 10610 | |
| 10611 | : see if accept4 exists |
| 10612 | set accept4 d_accept4 |
| 10613 | eval $inlibc |
| 10614 | |
| 10615 | : Initialize h_fcntl |
| 10616 | h_fcntl=false |
| 10617 | |
| 10618 | : Initialize h_sysfile |
| 10619 | h_sysfile=false |
| 10620 | |
| 10621 | : access call always available on UNIX |
| 10622 | set access d_access |
| 10623 | eval $inlibc |
| 10624 | |
| 10625 | : locate the flags for 'access()' |
| 10626 | case "$d_access" in |
| 10627 | "$define") |
| 10628 | echo " " |
| 10629 | $cat >access.c <<EOCP |
| 10630 | #include <sys/types.h> |
| 10631 | #ifdef I_FCNTL |
| 10632 | #include <fcntl.h> |
| 10633 | #endif |
| 10634 | #ifdef I_SYS_FILE |
| 10635 | #include <sys/file.h> |
| 10636 | #endif |
| 10637 | #ifdef I_UNISTD |
| 10638 | #include <unistd.h> |
| 10639 | #endif |
| 10640 | #$i_stdlib I_STDLIB |
| 10641 | #ifdef I_STDLIB |
| 10642 | #include <stdlib.h> |
| 10643 | #endif |
| 10644 | int main() { |
| 10645 | exit(R_OK); |
| 10646 | } |
| 10647 | EOCP |
| 10648 | : check sys/file.h first, no particular reason here |
| 10649 | if $test `./findhdr sys/file.h` && \ |
| 10650 | $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then |
| 10651 | h_sysfile=true; |
| 10652 | echo "<sys/file.h> defines the *_OK access constants." >&4 |
| 10653 | elif $test `./findhdr fcntl.h` && \ |
| 10654 | $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then |
| 10655 | h_fcntl=true; |
| 10656 | echo "<fcntl.h> defines the *_OK access constants." >&4 |
| 10657 | elif $test `./findhdr unistd.h` && \ |
| 10658 | $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then |
| 10659 | echo "<unistd.h> defines the *_OK access constants." >&4 |
| 10660 | else |
| 10661 | echo "I can't find the four *_OK access constants--I'll use mine." >&4 |
| 10662 | fi |
| 10663 | ;; |
| 10664 | esac |
| 10665 | $rm -f access* |
| 10666 | |
| 10667 | : see if accessx exists |
| 10668 | set accessx d_accessx |
| 10669 | eval $inlibc |
| 10670 | |
| 10671 | : see if acosh exists |
| 10672 | set acosh d_acosh |
| 10673 | eval $inlibc |
| 10674 | |
| 10675 | : see if aintl exists |
| 10676 | set aintl d_aintl |
| 10677 | eval $inlibc |
| 10678 | |
| 10679 | : see if alarm exists |
| 10680 | set alarm d_alarm |
| 10681 | eval $inlibc |
| 10682 | |
| 10683 | : see if 64bit time functions exists |
| 10684 | |
| 10685 | set ctime64 d_ctime64 |
| 10686 | eval $inlibc |
| 10687 | |
| 10688 | set localtime64 d_localtime64 |
| 10689 | eval $inlibc |
| 10690 | |
| 10691 | set gmtime64 d_gmtime64 |
| 10692 | eval $inlibc |
| 10693 | |
| 10694 | set mktime64 d_mktime64 |
| 10695 | eval $inlibc |
| 10696 | |
| 10697 | set difftime64 d_difftime64 |
| 10698 | eval $inlibc |
| 10699 | |
| 10700 | set asctime64 d_asctime64 |
| 10701 | eval $inlibc |
| 10702 | |
| 10703 | : see if POSIX threads are available |
| 10704 | set pthread.h i_pthread |
| 10705 | eval $inhdr |
| 10706 | |
| 10707 | : define a function to check prototypes |
| 10708 | $cat > protochk <<EOSH |
| 10709 | $startsh |
| 10710 | cc="$cc" |
| 10711 | optimize="$optimize" |
| 10712 | ccflags="$ccflags" |
| 10713 | define="$define" |
| 10714 | rm_try="$rm_try" |
| 10715 | usethreads=$usethreads |
| 10716 | i_pthread=$i_pthread |
| 10717 | pthread_h_first=$pthread_h_first |
| 10718 | EOSH |
| 10719 | |
| 10720 | $cat >> protochk <<'EOSH' |
| 10721 | |
| 10722 | $rm_try |
| 10723 | foo="$1" |
| 10724 | shift |
| 10725 | while test $# -ge 2; do |
| 10726 | case "$1" in |
| 10727 | $define) echo "#include <$2>" >> try.c ;; |
| 10728 | literal) echo "$2" >> try.c ;; |
| 10729 | esac |
| 10730 | # Extra magic for the benefit of systems that need pthread.h |
| 10731 | # to be included early to correctly detect threadsafe functions. |
| 10732 | # Such functions must guarantee themselves, though, that the usethreads |
| 10733 | # and i_pthread have been defined, before calling protochk. |
| 10734 | if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then |
| 10735 | echo "#include <pthread.h>" >> try.c |
| 10736 | pthread_h_done=yes |
| 10737 | fi |
| 10738 | shift 2 |
| 10739 | done |
| 10740 | cat >> try.c <<'EOCP' |
| 10741 | #define _(args) args |
| 10742 | EOCP |
| 10743 | echo "$foo" >> try.c |
| 10744 | echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c |
| 10745 | $cc $optimize $ccflags -c try.c > /dev/null 2>&1 |
| 10746 | status=$? |
| 10747 | $rm_try |
| 10748 | exit $status |
| 10749 | EOSH |
| 10750 | chmod +x protochk |
| 10751 | $eunicefix protochk |
| 10752 | |
| 10753 | : Define hasproto macro for Configure internal use |
| 10754 | hasproto='varname=$1; func=$2; shift; shift; |
| 10755 | while $test $# -ge 2; do |
| 10756 | case "$1" in |
| 10757 | $define) echo "#include <$2>";; |
| 10758 | literal) echo "$2" ;; |
| 10759 | esac ; |
| 10760 | shift 2; |
| 10761 | done > try.c; |
| 10762 | $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null; |
| 10763 | if $contains "$func.*(" tryout.c >/dev/null 2>&1; then |
| 10764 | echo "$func() prototype found."; |
| 10765 | val="$define"; |
| 10766 | else |
| 10767 | echo "$func() prototype NOT found."; |
| 10768 | val="$undef"; |
| 10769 | fi; |
| 10770 | set $varname; |
| 10771 | eval $setvar; |
| 10772 | $rm_try tryout.c' |
| 10773 | |
| 10774 | : see if sys/types.h has to be included |
| 10775 | set sys/types.h i_systypes |
| 10776 | eval $inhdr |
| 10777 | |
| 10778 | : see if sys/select.h has to be included |
| 10779 | set sys/select.h i_sysselct |
| 10780 | eval $inhdr |
| 10781 | |
| 10782 | : Define hasfield macro for Configure internal use |
| 10783 | hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift; |
| 10784 | while $test $# -ge 2; do |
| 10785 | case "$1" in |
| 10786 | $define) echo "#include <$2>";; |
| 10787 | esac ; |
| 10788 | shift 2; |
| 10789 | done > try.c; |
| 10790 | echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c; |
| 10791 | set try; |
| 10792 | if eval $compile; then |
| 10793 | val="$define"; |
| 10794 | else |
| 10795 | val="$undef"; |
| 10796 | fi; |
| 10797 | set $varname; |
| 10798 | eval $setvar; |
| 10799 | $rm_try' |
| 10800 | |
| 10801 | : see if we should include sys/time.h |
| 10802 | echo " " |
| 10803 | i_time='define' |
| 10804 | if test "X$timeincl" = X; then |
| 10805 | echo "Testing to see if we should include <sys/time.h>." >&4 |
| 10806 | $echo $n "I'm now running the test program...$c" |
| 10807 | $cat >try.c <<EOCP |
| 10808 | #include <sys/types.h> |
| 10809 | #include <time.h> |
| 10810 | #ifdef I_SYSTIME |
| 10811 | #ifdef SYSTIMEKERNEL |
| 10812 | #define KERNEL |
| 10813 | #endif |
| 10814 | #include <sys/time.h> |
| 10815 | #endif |
| 10816 | #ifdef I_SYSSELECT |
| 10817 | #include <sys/select.h> |
| 10818 | #endif |
| 10819 | #$i_stdlib I_STDLIB |
| 10820 | #ifdef I_STDLIB |
| 10821 | #include <stdlib.h> |
| 10822 | #endif |
| 10823 | int main() |
| 10824 | { |
| 10825 | struct tm foo; |
| 10826 | #ifdef S_TIMEVAL |
| 10827 | struct timeval bar; |
| 10828 | #endif |
| 10829 | #ifdef S_TIMEZONE |
| 10830 | struct timezone tzp; |
| 10831 | #endif |
| 10832 | if (foo.tm_sec == foo.tm_sec) |
| 10833 | exit(0); |
| 10834 | #ifdef S_TIMEVAL |
| 10835 | if (bar.tv_sec == bar.tv_sec) |
| 10836 | exit(0); |
| 10837 | #endif |
| 10838 | exit(1); |
| 10839 | } |
| 10840 | EOCP |
| 10841 | flags='' |
| 10842 | for s_timezone in '-DS_TIMEZONE' ''; do |
| 10843 | sysselect='' |
| 10844 | for s_timeval in '-DS_TIMEVAL' ''; do |
| 10845 | for i_systimek in '' '-DSYSTIMEKERNEL'; do |
| 10846 | for i_systime in '-DI_SYSTIME' ''; do |
| 10847 | case "$flags" in |
| 10848 | '') $echo $n ".$c" |
| 10849 | set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone |
| 10850 | if eval $compile; then |
| 10851 | set X $i_systime $i_systimek $sysselect $s_timeval |
| 10852 | shift |
| 10853 | flags="$*" |
| 10854 | echo " " |
| 10855 | $echo $n "Succeeded with $flags$c" |
| 10856 | fi |
| 10857 | ;; |
| 10858 | esac |
| 10859 | done |
| 10860 | done |
| 10861 | done |
| 10862 | done |
| 10863 | timeincl='' |
| 10864 | echo " " |
| 10865 | case "$flags" in |
| 10866 | *SYSTIMEKERNEL*) i_systimek="$define" |
| 10867 | timeincl=`./findhdr sys/time.h` |
| 10868 | echo "We'll include <sys/time.h> with KERNEL defined." >&4;; |
| 10869 | *) i_systimek="$undef";; |
| 10870 | esac |
| 10871 | case "$flags" in |
| 10872 | *I_SYSTIME*) i_systime="$define" |
| 10873 | timeincl=`./findhdr sys/time.h`" $timeincl" |
| 10874 | echo "We'll include <sys/time.h>." >&4;; |
| 10875 | *) i_systime="$undef";; |
| 10876 | esac |
| 10877 | $rm_try |
| 10878 | fi |
| 10879 | : see if struct tm knows about tm_zone |
| 10880 | case "$i_systime$i_time" in |
| 10881 | *$define*) |
| 10882 | echo " " |
| 10883 | echo "Checking to see if your struct tm has tm_zone field..." >&4 |
| 10884 | set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h |
| 10885 | eval $hasfield |
| 10886 | ;; |
| 10887 | *) val="$undef" |
| 10888 | set d_tm_tm_zone |
| 10889 | eval $setvar |
| 10890 | ;; |
| 10891 | esac |
| 10892 | case "$d_tm_tm_zone" in |
| 10893 | "$define") echo "Yes, it does." ;; |
| 10894 | *) echo "No, it doesn't." ;; |
| 10895 | esac |
| 10896 | : see if struct tm knows about tm_gmtoff |
| 10897 | case "$i_systime$i_time" in |
| 10898 | *$define*) |
| 10899 | echo " " |
| 10900 | echo "Checking to see if your struct tm has tm_gmtoff field..." >&4 |
| 10901 | set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h |
| 10902 | eval $hasfield |
| 10903 | ;; |
| 10904 | *) val="$undef" |
| 10905 | set d_tm_tm_gmtoff |
| 10906 | eval $setvar |
| 10907 | ;; |
| 10908 | esac |
| 10909 | case "$d_tm_tm_gmtoff" in |
| 10910 | "$define") echo "Yes, it does." ;; |
| 10911 | *) echo "No, it doesn't." ;; |
| 10912 | esac |
| 10913 | |
| 10914 | : see if asctime_r exists |
| 10915 | set asctime_r d_asctime_r |
| 10916 | eval $inlibc |
| 10917 | case "$d_asctime_r" in |
| 10918 | "$define") |
| 10919 | hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h" |
| 10920 | case "$d_asctime_r_proto:$usethreads" in |
| 10921 | ":define") d_asctime_r_proto=define |
| 10922 | set d_asctime_r_proto asctime_r $hdrs |
| 10923 | eval $hasproto ;; |
| 10924 | *) ;; |
| 10925 | esac |
| 10926 | case "$d_asctime_r_proto" in |
| 10927 | define) |
| 10928 | case "$asctime_r_proto" in |
| 10929 | ''|0) try='char* asctime_r(const struct tm*, char*);' |
| 10930 | ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;; |
| 10931 | esac |
| 10932 | case "$asctime_r_proto" in |
| 10933 | ''|0) try='char* asctime_r(const struct tm*, char*, int);' |
| 10934 | ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;; |
| 10935 | esac |
| 10936 | case "$asctime_r_proto" in |
| 10937 | ''|0) try='int asctime_r(const struct tm*, char*);' |
| 10938 | ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;; |
| 10939 | esac |
| 10940 | case "$asctime_r_proto" in |
| 10941 | ''|0) try='int asctime_r(const struct tm*, char*, int);' |
| 10942 | ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;; |
| 10943 | esac |
| 10944 | case "$asctime_r_proto" in |
| 10945 | ''|0) d_asctime_r=undef |
| 10946 | asctime_r_proto=0 |
| 10947 | echo "Disabling asctime_r, cannot determine prototype." >&4 ;; |
| 10948 | * ) case "$asctime_r_proto" in |
| 10949 | REENTRANT_PROTO*) ;; |
| 10950 | *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;; |
| 10951 | esac |
| 10952 | echo "Prototype: $try" ;; |
| 10953 | esac |
| 10954 | ;; |
| 10955 | *) case "$usethreads" in |
| 10956 | define) echo "asctime_r has no prototype, not using it." >&4 ;; |
| 10957 | esac |
| 10958 | d_asctime_r=undef |
| 10959 | asctime_r_proto=0 |
| 10960 | ;; |
| 10961 | esac |
| 10962 | ;; |
| 10963 | *) asctime_r_proto=0 |
| 10964 | ;; |
| 10965 | esac |
| 10966 | |
| 10967 | : see if asinh exists |
| 10968 | set asinh d_asinh |
| 10969 | eval $inlibc |
| 10970 | |
| 10971 | : see if atanh exists |
| 10972 | set atanh d_atanh |
| 10973 | eval $inlibc |
| 10974 | |
| 10975 | : see if atolf exists |
| 10976 | set atolf d_atolf |
| 10977 | eval $inlibc |
| 10978 | |
| 10979 | : see if atoll exists |
| 10980 | set atoll d_atoll |
| 10981 | eval $inlibc |
| 10982 | |
| 10983 | : Look for GCC-style attribute format |
| 10984 | case "$d_attribute_format" in |
| 10985 | '') |
| 10986 | echo " " |
| 10987 | echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4 |
| 10988 | $cat >attrib.c <<'EOCP' |
| 10989 | #include <stdio.h> |
| 10990 | void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2))); |
| 10991 | EOCP |
| 10992 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then |
| 10993 | if $contains 'warning' attrib.out >/dev/null 2>&1; then |
| 10994 | echo "Your C compiler doesn't support __attribute__((format))." |
| 10995 | val="$undef" |
| 10996 | else |
| 10997 | echo "Your C compiler supports __attribute__((format))." |
| 10998 | val="$define" |
| 10999 | fi |
| 11000 | else |
| 11001 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
| 11002 | val="$undef" |
| 11003 | fi |
| 11004 | ;; |
| 11005 | *) val="$d_attribute_format" ;; |
| 11006 | esac |
| 11007 | set d_attribute_format |
| 11008 | eval $setvar |
| 11009 | $rm -f attrib* |
| 11010 | |
| 11011 | : Look for GCC-style attribute format with null format allowed |
| 11012 | case "$d_printf_format_null" in |
| 11013 | '') case "$d_attribute_format" in |
| 11014 | $define) |
| 11015 | echo " " |
| 11016 | echo "Checking whether your compiler allows __printf__ format to be null ..." >&4 |
| 11017 | $cat >attrib.c <<EOCP |
| 11018 | #include <stdio.h> |
| 11019 | #$i_stdlib I_STDLIB |
| 11020 | #ifdef I_STDLIB |
| 11021 | #include <stdlib.h> |
| 11022 | #endif |
| 11023 | #$i_inttypes I_INTTYPES |
| 11024 | #ifdef I_INTTYPES |
| 11025 | #include <inttypes.h> |
| 11026 | #endif |
| 11027 | #ifndef INTPTR_MAX |
| 11028 | #define intptr_t int |
| 11029 | #endif |
| 11030 | int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2))); |
| 11031 | int null_printf (char* pat,...) { return (int)(intptr_t)pat; } |
| 11032 | int main () { exit(null_printf(NULL)); } |
| 11033 | EOCP |
| 11034 | if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then |
| 11035 | : run the executable in case it produces a run-time warning |
| 11036 | if $run ./attrib >>attrib.out 2>&1; then |
| 11037 | if $contains 'warning' attrib.out >/dev/null 2>&1; then |
| 11038 | echo "Your C compiler doesn't allow __printf__ format to be null." |
| 11039 | val="$undef" |
| 11040 | else |
| 11041 | echo "Your C compiler allows __printf__ format to be null." |
| 11042 | val="$define" |
| 11043 | fi |
| 11044 | else |
| 11045 | echo "Your C compiler executable failed with __printf__ format null." |
| 11046 | val="$undef" |
| 11047 | fi |
| 11048 | else |
| 11049 | echo "Your C compiler fails with __printf__ format null." |
| 11050 | val="$undef" |
| 11051 | fi |
| 11052 | ;; |
| 11053 | *) val="$undef" ;; |
| 11054 | esac |
| 11055 | ;; |
| 11056 | *) val="$d_printf_format_null" ;; |
| 11057 | esac |
| 11058 | set d_printf_format_null |
| 11059 | eval $setvar |
| 11060 | $rm -f attrib* |
| 11061 | |
| 11062 | : Look for GCC-style attribute malloc |
| 11063 | case "$d_attribute_malloc" in |
| 11064 | '') |
| 11065 | echo " " |
| 11066 | echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4 |
| 11067 | $cat >attrib.c <<'EOCP' |
| 11068 | #include <stdio.h> |
| 11069 | char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc)); |
| 11070 | EOCP |
| 11071 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then |
| 11072 | if $contains 'warning' attrib.out >/dev/null 2>&1; then |
| 11073 | echo "Your C compiler doesn't support __attribute__((malloc))." |
| 11074 | val="$undef" |
| 11075 | else |
| 11076 | echo "Your C compiler supports __attribute__((malloc))." |
| 11077 | val="$define" |
| 11078 | fi |
| 11079 | else |
| 11080 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
| 11081 | val="$undef" |
| 11082 | fi |
| 11083 | ;; |
| 11084 | *) val="$d_attribute_malloc" ;; |
| 11085 | esac |
| 11086 | set d_attribute_malloc |
| 11087 | eval $setvar |
| 11088 | $rm -f attrib* |
| 11089 | |
| 11090 | : Look for GCC-style attribute nonnull |
| 11091 | case "$d_attribute_nonnull" in |
| 11092 | '') |
| 11093 | echo " " |
| 11094 | echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4 |
| 11095 | $cat >attrib.c <<'EOCP' |
| 11096 | #include <stdio.h> |
| 11097 | void do_something (char *some_pointer,...) __attribute__((nonnull(1))); |
| 11098 | EOCP |
| 11099 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then |
| 11100 | if $contains 'warning' attrib.out >/dev/null 2>&1; then |
| 11101 | echo "Your C compiler doesn't support __attribute__((nonnull))." |
| 11102 | val="$undef" |
| 11103 | else |
| 11104 | echo "Your C compiler supports __attribute__((nonnull))." |
| 11105 | val="$define" |
| 11106 | fi |
| 11107 | else |
| 11108 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
| 11109 | val="$undef" |
| 11110 | fi |
| 11111 | ;; |
| 11112 | *) val="$d_attribute_nonnull" ;; |
| 11113 | esac |
| 11114 | set d_attribute_nonnull |
| 11115 | eval $setvar |
| 11116 | $rm -f attrib* |
| 11117 | |
| 11118 | : Look for GCC-style attribute noreturn |
| 11119 | case "$d_attribute_noreturn" in |
| 11120 | '') |
| 11121 | echo " " |
| 11122 | echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4 |
| 11123 | $cat >attrib.c <<'EOCP' |
| 11124 | #include <stdio.h> |
| 11125 | void fall_over_dead( void ) __attribute__((noreturn)); |
| 11126 | EOCP |
| 11127 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then |
| 11128 | if $contains 'warning' attrib.out >/dev/null 2>&1; then |
| 11129 | echo "Your C compiler doesn't support __attribute__((noreturn))." |
| 11130 | val="$undef" |
| 11131 | else |
| 11132 | echo "Your C compiler supports __attribute__((noreturn))." |
| 11133 | val="$define" |
| 11134 | fi |
| 11135 | else |
| 11136 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
| 11137 | val="$undef" |
| 11138 | fi |
| 11139 | ;; |
| 11140 | *) val="$d_attribute_noreturn" ;; |
| 11141 | esac |
| 11142 | set d_attribute_noreturn |
| 11143 | eval $setvar |
| 11144 | $rm -f attrib* |
| 11145 | |
| 11146 | : Look for GCC-style attribute pure |
| 11147 | case "$d_attribute_pure" in |
| 11148 | '') |
| 11149 | echo " " |
| 11150 | echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4 |
| 11151 | $cat >attrib.c <<'EOCP' |
| 11152 | #include <stdio.h> |
| 11153 | int square( int n ) __attribute__((pure)); |
| 11154 | EOCP |
| 11155 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then |
| 11156 | if $contains 'warning' attrib.out >/dev/null 2>&1; then |
| 11157 | echo "Your C compiler doesn't support __attribute__((pure))." |
| 11158 | val="$undef" |
| 11159 | else |
| 11160 | echo "Your C compiler supports __attribute__((pure))." |
| 11161 | val="$define" |
| 11162 | fi |
| 11163 | else |
| 11164 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
| 11165 | val="$undef" |
| 11166 | fi |
| 11167 | ;; |
| 11168 | *) val="$d_attribute_pure" ;; |
| 11169 | esac |
| 11170 | set d_attribute_pure |
| 11171 | eval $setvar |
| 11172 | $rm -f attrib* |
| 11173 | |
| 11174 | : Look for GCC-style attribute unused |
| 11175 | case "$d_attribute_unused" in |
| 11176 | '') |
| 11177 | echo " " |
| 11178 | echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4 |
| 11179 | $cat >attrib.c <<'EOCP' |
| 11180 | #include <stdio.h> |
| 11181 | int do_something( int dummy __attribute__((unused)), int n ); |
| 11182 | EOCP |
| 11183 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then |
| 11184 | if $contains 'warning' attrib.out >/dev/null 2>&1; then |
| 11185 | echo "Your C compiler doesn't support __attribute__((unused))." |
| 11186 | val="$undef" |
| 11187 | else |
| 11188 | echo "Your C compiler supports __attribute__((unused))." |
| 11189 | val="$define" |
| 11190 | fi |
| 11191 | else |
| 11192 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
| 11193 | val="$undef" |
| 11194 | fi |
| 11195 | ;; |
| 11196 | *) val="$d_attribute_unused" ;; |
| 11197 | esac |
| 11198 | set d_attribute_unused |
| 11199 | eval $setvar |
| 11200 | $rm -f attrib* |
| 11201 | |
| 11202 | : Look for GCC-style attribute deprecated |
| 11203 | case "$d_attribute_deprecated" in |
| 11204 | '') |
| 11205 | echo " " |
| 11206 | echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4 |
| 11207 | $cat >attrib.c <<'EOCP' |
| 11208 | #include <stdio.h> |
| 11209 | int I_am_deprecated(void) __attribute__((deprecated)); |
| 11210 | EOCP |
| 11211 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then |
| 11212 | if $contains 'warning' attrib.out >/dev/null 2>&1; then |
| 11213 | echo "Your C compiler doesn't support __attribute__((deprecated))." |
| 11214 | val="$undef" |
| 11215 | else |
| 11216 | echo "Your C compiler supports __attribute__((deprecated))." |
| 11217 | val="$define" |
| 11218 | fi |
| 11219 | else |
| 11220 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
| 11221 | val="$undef" |
| 11222 | fi |
| 11223 | ;; |
| 11224 | *) val="$d_attribute_deprecated" ;; |
| 11225 | esac |
| 11226 | set d_attribute_deprecated |
| 11227 | eval $setvar |
| 11228 | $rm -f attrib* |
| 11229 | |
| 11230 | : Look for GCC-style attribute warn_unused_result |
| 11231 | case "$d_attribute_warn_unused_result" in |
| 11232 | '') |
| 11233 | echo " " |
| 11234 | echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4 |
| 11235 | $cat >attrib.c <<'EOCP' |
| 11236 | #include <stdio.h> |
| 11237 | int I_will_not_be_ignored(void) __attribute__((warn_unused_result)); |
| 11238 | EOCP |
| 11239 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then |
| 11240 | if $contains 'warning' attrib.out >/dev/null 2>&1; then |
| 11241 | echo "Your C compiler doesn't support __attribute__((warn_unused_result))." |
| 11242 | val="$undef" |
| 11243 | else |
| 11244 | echo "Your C compiler supports __attribute__((warn_unused_result))." |
| 11245 | val="$define" |
| 11246 | fi |
| 11247 | else |
| 11248 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
| 11249 | val="$undef" |
| 11250 | fi |
| 11251 | ;; |
| 11252 | *) val="$d_attribute_warn_unused_result" ;; |
| 11253 | esac |
| 11254 | set d_attribute_warn_unused_result |
| 11255 | eval $setvar |
| 11256 | $rm -f attrib* |
| 11257 | |
| 11258 | : Look for GCC-style attribute always_inline |
| 11259 | case "$d_attribute_always_inline" in |
| 11260 | '') |
| 11261 | echo " " |
| 11262 | echo "Checking whether your compiler can handle __attribute__((always_inline)) ..." >&4 |
| 11263 | $cat >attrib.c <<'EOCP' |
| 11264 | #include <stdio.h> |
| 11265 | static __inline__ __attribute__((always_inline)) int I_will_always_be_inlined(void); |
| 11266 | EOCP |
| 11267 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then |
| 11268 | if $contains 'warning' attrib.out >/dev/null 2>&1; then |
| 11269 | echo "Your C compiler doesn't support __attribute__((always_inline))." |
| 11270 | val="$undef" |
| 11271 | else |
| 11272 | echo "Your C compiler supports __attribute__((always_inline))." |
| 11273 | val="$define" |
| 11274 | fi |
| 11275 | else |
| 11276 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
| 11277 | val="$undef" |
| 11278 | fi |
| 11279 | ;; |
| 11280 | *) val="$d_attribute_always_inline" ;; |
| 11281 | esac |
| 11282 | set d_attribute_always_inline |
| 11283 | eval $setvar |
| 11284 | $rm -f attrib* |
| 11285 | |
| 11286 | : see if getpgrp exists |
| 11287 | set getpgrp d_getpgrp |
| 11288 | eval $inlibc |
| 11289 | |
| 11290 | case "$d_getpgrp" in |
| 11291 | "$define") |
| 11292 | echo " " |
| 11293 | echo "Checking to see which flavor of getpgrp is in use..." |
| 11294 | $cat >try.c <<EOP |
| 11295 | #include <stdio.h> |
| 11296 | #$i_unistd I_UNISTD |
| 11297 | #include <sys/types.h> |
| 11298 | #ifdef I_UNISTD |
| 11299 | # include <unistd.h> |
| 11300 | #endif |
| 11301 | #$i_stdlib I_STDLIB |
| 11302 | #ifdef I_STDLIB |
| 11303 | #include <stdlib.h> |
| 11304 | #endif |
| 11305 | int main() |
| 11306 | { |
| 11307 | if (getuid() == 0) { |
| 11308 | printf("(I see you are running Configure as super-user...)\n"); |
| 11309 | setuid(1); |
| 11310 | } |
| 11311 | #ifdef TRY_BSD_PGRP |
| 11312 | if (getpgrp(1) == 0) |
| 11313 | exit(0); |
| 11314 | #else |
| 11315 | if (getpgrp() > 0) |
| 11316 | exit(0); |
| 11317 | #endif |
| 11318 | exit(1); |
| 11319 | } |
| 11320 | EOP |
| 11321 | if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then |
| 11322 | echo "You have to use getpgrp(pid) instead of getpgrp()." >&4 |
| 11323 | val="$define" |
| 11324 | elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then |
| 11325 | echo "You have to use getpgrp() instead of getpgrp(pid)." >&4 |
| 11326 | val="$undef" |
| 11327 | else |
| 11328 | echo "I can't seem to compile and run the test program." |
| 11329 | if ./usg; then |
| 11330 | xxx="a USG one, i.e. you use getpgrp()." |
| 11331 | else |
| 11332 | # SVR4 systems can appear rather BSD-ish. |
| 11333 | case "$i_unistd" in |
| 11334 | $undef) |
| 11335 | xxx="a BSD one, i.e. you use getpgrp(pid)." |
| 11336 | val="$define" |
| 11337 | ;; |
| 11338 | $define) |
| 11339 | xxx="probably a USG one, i.e. you use getpgrp()." |
| 11340 | val="$undef" |
| 11341 | ;; |
| 11342 | esac |
| 11343 | fi |
| 11344 | echo "Assuming your getpgrp is $xxx" >&4 |
| 11345 | fi |
| 11346 | ;; |
| 11347 | *) val="$undef";; |
| 11348 | esac |
| 11349 | set d_bsdgetpgrp |
| 11350 | eval $setvar |
| 11351 | $rm_try |
| 11352 | |
| 11353 | : see if setpgrp exists |
| 11354 | set setpgrp d_setpgrp |
| 11355 | eval $inlibc |
| 11356 | |
| 11357 | case "$d_setpgrp" in |
| 11358 | "$define") |
| 11359 | echo " " |
| 11360 | echo "Checking to see which flavor of setpgrp is in use..." |
| 11361 | $cat >try.c <<EOP |
| 11362 | #include <stdio.h> |
| 11363 | #$i_unistd I_UNISTD |
| 11364 | #include <sys/types.h> |
| 11365 | #ifdef I_UNISTD |
| 11366 | # include <unistd.h> |
| 11367 | #endif |
| 11368 | #$i_stdlib I_STDLIB |
| 11369 | #ifdef I_STDLIB |
| 11370 | #include <stdlib.h> |
| 11371 | #endif |
| 11372 | int main() |
| 11373 | { |
| 11374 | if (getuid() == 0) { |
| 11375 | printf("(I see you are running Configure as super-user...)\n"); |
| 11376 | setuid(1); |
| 11377 | } |
| 11378 | #ifdef TRY_BSD_PGRP |
| 11379 | if (-1 == setpgrp(1, 1)) |
| 11380 | exit(0); |
| 11381 | #else |
| 11382 | if (setpgrp() != -1) |
| 11383 | exit(0); |
| 11384 | #endif |
| 11385 | exit(1); |
| 11386 | } |
| 11387 | EOP |
| 11388 | if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then |
| 11389 | echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4 |
| 11390 | val="$define" |
| 11391 | elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then |
| 11392 | echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4 |
| 11393 | val="$undef" |
| 11394 | else |
| 11395 | echo "(I can't seem to compile and run the test program.)" |
| 11396 | if ./usg; then |
| 11397 | xxx="a USG one, i.e. you use setpgrp()." |
| 11398 | else |
| 11399 | # SVR4 systems can appear rather BSD-ish. |
| 11400 | case "$i_unistd" in |
| 11401 | $undef) |
| 11402 | xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)." |
| 11403 | val="$define" |
| 11404 | ;; |
| 11405 | $define) |
| 11406 | xxx="probably a USG one, i.e. you use setpgrp()." |
| 11407 | val="$undef" |
| 11408 | ;; |
| 11409 | esac |
| 11410 | fi |
| 11411 | echo "Assuming your setpgrp is $xxx" >&4 |
| 11412 | fi |
| 11413 | ;; |
| 11414 | *) val="$undef";; |
| 11415 | esac |
| 11416 | set d_bsdsetpgrp |
| 11417 | eval $setvar |
| 11418 | $rm_try |
| 11419 | |
| 11420 | : Look for GCC-style __builtin_add_overflow |
| 11421 | case "$d_builtin_add_overflow" in |
| 11422 | '') |
| 11423 | echo " " |
| 11424 | echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4 |
| 11425 | $cat >try.c <<'EOCP' |
| 11426 | int main(void) { |
| 11427 | const unsigned int uint_max = ~0u; |
| 11428 | int target_int = 0; |
| 11429 | if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) { |
| 11430 | return 1; |
| 11431 | } |
| 11432 | if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) { |
| 11433 | return 1; |
| 11434 | } |
| 11435 | if (!__builtin_add_overflow(uint_max, -1, &target_int)) { |
| 11436 | return 1; |
| 11437 | } |
| 11438 | return 0; |
| 11439 | } |
| 11440 | EOCP |
| 11441 | set try |
| 11442 | if eval $compile && $run ./try; then |
| 11443 | echo "Your C compiler supports __builtin_add_overflow." |
| 11444 | val="$define" |
| 11445 | else |
| 11446 | echo "Your C compiler doesn't seem to understand __builtin_add_overflow." |
| 11447 | val="$undef" |
| 11448 | fi |
| 11449 | ;; |
| 11450 | *) val="$d_builtin_add_overflow" ;; |
| 11451 | esac |
| 11452 | |
| 11453 | set d_builtin_add_overflow |
| 11454 | eval $setvar |
| 11455 | $rm_try |
| 11456 | |
| 11457 | : Look for GCC-style __builtin_sub_overflow |
| 11458 | case "$d_builtin_sub_overflow" in |
| 11459 | '') |
| 11460 | echo " " |
| 11461 | echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4 |
| 11462 | $cat >try.c <<'EOCP' |
| 11463 | int main(void) { |
| 11464 | const unsigned int uint_max = ~0u; |
| 11465 | int target_int = 0; |
| 11466 | if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) { |
| 11467 | return 1; |
| 11468 | } |
| 11469 | if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) { |
| 11470 | return 1; |
| 11471 | } |
| 11472 | if (!__builtin_sub_overflow(uint_max, 1, &target_int)) { |
| 11473 | return 1; |
| 11474 | } |
| 11475 | return 0; |
| 11476 | } |
| 11477 | EOCP |
| 11478 | set try |
| 11479 | if eval $compile && $run ./try; then |
| 11480 | echo "Your C compiler supports __builtin_sub_overflow." |
| 11481 | val="$define" |
| 11482 | else |
| 11483 | echo "Your C compiler doesn't seem to understand __builtin_sub_overflow." |
| 11484 | val="$undef" |
| 11485 | fi |
| 11486 | ;; |
| 11487 | *) val="$d_builtin_sub_overflow" ;; |
| 11488 | esac |
| 11489 | |
| 11490 | set d_builtin_sub_overflow |
| 11491 | eval $setvar |
| 11492 | $rm_try |
| 11493 | |
| 11494 | : Look for GCC-style __builtin_mul_overflow |
| 11495 | case "$d_builtin_mul_overflow" in |
| 11496 | '') |
| 11497 | echo " " |
| 11498 | echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4 |
| 11499 | $cat >try.c <<'EOCP' |
| 11500 | int main(void) { |
| 11501 | const unsigned int uint_max = ~0u; |
| 11502 | int target_int = 0; |
| 11503 | if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) { |
| 11504 | return 1; |
| 11505 | } |
| 11506 | if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) { |
| 11507 | return 1; |
| 11508 | } |
| 11509 | if (!__builtin_mul_overflow(uint_max, 1, &target_int)) { |
| 11510 | return 1; |
| 11511 | } |
| 11512 | return 0; |
| 11513 | } |
| 11514 | EOCP |
| 11515 | set try |
| 11516 | if eval $compile && $run ./try; then |
| 11517 | echo "Your C compiler supports __builtin_mul_overflow." |
| 11518 | val="$define" |
| 11519 | else |
| 11520 | echo "Your C compiler doesn't seem to understand __builtin_mul_overflow." |
| 11521 | val="$undef" |
| 11522 | fi |
| 11523 | ;; |
| 11524 | *) val="$d_builtin_mul_overflow" ;; |
| 11525 | esac |
| 11526 | |
| 11527 | set d_builtin_mul_overflow |
| 11528 | eval $setvar |
| 11529 | $rm_try |
| 11530 | |
| 11531 | : Look for GCC-style __builtin_choose_expr |
| 11532 | case "$d_builtin_choose_expr" in |
| 11533 | '') |
| 11534 | echo " " |
| 11535 | echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4 |
| 11536 | $cat >try.c <<'EOCP' |
| 11537 | #include <assert.h> |
| 11538 | #include <stdlib.h> |
| 11539 | #include <stdio.h> |
| 11540 | |
| 11541 | #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) ) |
| 11542 | |
| 11543 | int main(void) { |
| 11544 | assert( SYRINX(1) == 2112 ); |
| 11545 | assert( SYRINX(1) != 5150 ); |
| 11546 | assert( SYRINX(0) == 5150 ); |
| 11547 | assert( SYRINX(0) != 2112 ); |
| 11548 | puts( "All good!" ); |
| 11549 | exit(0); |
| 11550 | } |
| 11551 | |
| 11552 | EOCP |
| 11553 | set try |
| 11554 | if eval $compile && $run ./try; then |
| 11555 | echo "Your C compiler supports __builtin_choose_expr." |
| 11556 | val="$define" |
| 11557 | else |
| 11558 | echo "Your C compiler doesn't seem to understand __builtin_choose_expr." |
| 11559 | val="$undef" |
| 11560 | fi |
| 11561 | ;; |
| 11562 | *) val="$d_builtin_choose_expr" ;; |
| 11563 | esac |
| 11564 | |
| 11565 | set d_builtin_choose_expr |
| 11566 | eval $setvar |
| 11567 | $rm_try |
| 11568 | |
| 11569 | : Look for GCC-style __builtin_expect |
| 11570 | case "$d_builtin_expect" in |
| 11571 | '') |
| 11572 | echo " " |
| 11573 | echo "Checking whether your compiler can handle __builtin_expect ..." >&4 |
| 11574 | $cat >try.c <<'EOCP' |
| 11575 | int main(void) { |
| 11576 | int n = 50; |
| 11577 | if ( __builtin_expect(n, 0) ) n = 1; |
| 11578 | /* Remember shell exit code truth is 0, C truth is non-zero */ |
| 11579 | return !(n == 1); |
| 11580 | } |
| 11581 | EOCP |
| 11582 | set try |
| 11583 | if eval $compile && $run ./try; then |
| 11584 | echo "Your C compiler supports __builtin_expect." |
| 11585 | val="$define" |
| 11586 | else |
| 11587 | echo "Your C compiler doesn't seem to understand __builtin_expect." |
| 11588 | val="$undef" |
| 11589 | fi |
| 11590 | ;; |
| 11591 | *) val="$d_builtin_expect" ;; |
| 11592 | esac |
| 11593 | |
| 11594 | set d_builtin_expect |
| 11595 | eval $setvar |
| 11596 | $rm_try |
| 11597 | |
| 11598 | : see if the Compiler supports C99 variadic macros |
| 11599 | echo "Checking for C99 variadic macros." >&4 |
| 11600 | $cat >try.c <<EOCP |
| 11601 | #include <stdio.h> |
| 11602 | #include <stdarg.h> |
| 11603 | |
| 11604 | #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__) |
| 11605 | |
| 11606 | int main() { |
| 11607 | char buf[20]; |
| 11608 | foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail"); |
| 11609 | puts(buf); |
| 11610 | return 0; |
| 11611 | } |
| 11612 | EOCP |
| 11613 | set try |
| 11614 | if eval $compile && $run ./try 2>&1 >/dev/null; then |
| 11615 | case "`$run ./try`" in |
| 11616 | "123 456 789") |
| 11617 | echo "You have C99 variadic macros." >&4 |
| 11618 | d_c99_variadic_macros="$define" |
| 11619 | ;; |
| 11620 | *) |
| 11621 | echo "You don't have functional C99 variadic macros." >&4 |
| 11622 | d_c99_variadic_macros="$undef" |
| 11623 | ;; |
| 11624 | esac |
| 11625 | else |
| 11626 | echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4 |
| 11627 | d_c99_variadic_macros="$undef" |
| 11628 | fi |
| 11629 | $rm_try |
| 11630 | |
| 11631 | : see if signal is declared as pointer to function returning int or void |
| 11632 | echo " " |
| 11633 | xxx=`./findhdr signal.h` |
| 11634 | $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null |
| 11635 | if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then |
| 11636 | echo "You have int (*signal())() instead of void." >&4 |
| 11637 | val="$undef" |
| 11638 | elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then |
| 11639 | echo "You have void (*signal())()." >&4 |
| 11640 | val="$define" |
| 11641 | elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then |
| 11642 | echo "You have int (*signal())() instead of void." >&4 |
| 11643 | val="$undef" |
| 11644 | elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then |
| 11645 | echo "You have void (*signal())()." >&4 |
| 11646 | val="$define" |
| 11647 | else |
| 11648 | case "$d_voidsig" in |
| 11649 | '') |
| 11650 | echo "I can't determine whether signal handler returns void or int..." >&4 |
| 11651 | dflt=void |
| 11652 | rp="What type does your signal handler return?" |
| 11653 | . ./myread |
| 11654 | case "$ans" in |
| 11655 | v*) val="$define";; |
| 11656 | *) val="$undef";; |
| 11657 | esac;; |
| 11658 | "$define") |
| 11659 | echo "As you already told me, signal handler returns void." >&4 |
| 11660 | val="$define" |
| 11661 | ;; |
| 11662 | *) echo "As you already told me, signal handler returns int." >&4 |
| 11663 | val="$undef" |
| 11664 | ;; |
| 11665 | esac |
| 11666 | fi |
| 11667 | set d_voidsig |
| 11668 | eval $setvar |
| 11669 | case "$d_voidsig" in |
| 11670 | "$define") signal_t="void";; |
| 11671 | *) signal_t="int";; |
| 11672 | esac |
| 11673 | $rm -f $$.tmp |
| 11674 | |
| 11675 | : check for ability to cast large floats to 32-bit ints. |
| 11676 | echo " " |
| 11677 | echo 'Checking whether your C compiler can cast large floats to int32.' >&4 |
| 11678 | if $test "$intsize" -ge 4; then |
| 11679 | xxx=int |
| 11680 | else |
| 11681 | xxx=long |
| 11682 | fi |
| 11683 | $cat >try.c <<EOCP |
| 11684 | #include <stdio.h> |
| 11685 | #$i_stdlib I_STDLIB |
| 11686 | #ifdef I_STDLIB |
| 11687 | #include <stdlib.h> |
| 11688 | #endif |
| 11689 | #include <sys/types.h> |
| 11690 | #include <signal.h> |
| 11691 | $signal_t blech(int s) { exit(3); } |
| 11692 | int main() |
| 11693 | { |
| 11694 | $xxx i32; |
| 11695 | double f, g; |
| 11696 | int result = 0; |
| 11697 | char str[16]; |
| 11698 | signal(SIGFPE, blech); |
| 11699 | |
| 11700 | /* Don't let compiler optimize the test away. Store the number |
| 11701 | in a writable string for gcc to pass to sscanf under HP-UX. |
| 11702 | */ |
| 11703 | sprintf(str, "2147483647"); |
| 11704 | sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */ |
| 11705 | g = 10 * f; |
| 11706 | i32 = ($xxx) g; |
| 11707 | |
| 11708 | /* x86 processors will probably give 0x8000 0000, which is a |
| 11709 | sign change. We don't want that. We want to mimic SPARC |
| 11710 | behavior here, which is to preserve the sign and give |
| 11711 | back 0x7fff ffff. |
| 11712 | */ |
| 11713 | if (i32 != ($xxx) f) |
| 11714 | result |= 1; |
| 11715 | exit(result); |
| 11716 | } |
| 11717 | EOCP |
| 11718 | set try |
| 11719 | if eval $compile_ok; then |
| 11720 | $run ./try 2>/dev/null |
| 11721 | yyy=$? |
| 11722 | else |
| 11723 | echo "(I can't seem to compile the test program--assuming it can't)" |
| 11724 | yyy=1 |
| 11725 | fi |
| 11726 | case "$yyy" in |
| 11727 | 0) val="$define" |
| 11728 | echo "Yup, it can." |
| 11729 | ;; |
| 11730 | *) val="$undef" |
| 11731 | echo "Nope, it can't." |
| 11732 | ;; |
| 11733 | esac |
| 11734 | set d_casti32 |
| 11735 | eval $setvar |
| 11736 | $rm_try |
| 11737 | |
| 11738 | : check for ability to cast negative floats to unsigned |
| 11739 | echo " " |
| 11740 | echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4 |
| 11741 | $cat >try.c <<EOCP |
| 11742 | #include <stdio.h> |
| 11743 | #$i_stdlib I_STDLIB |
| 11744 | #ifdef I_STDLIB |
| 11745 | #include <stdlib.h> |
| 11746 | #endif |
| 11747 | #include <sys/types.h> |
| 11748 | #include <signal.h> |
| 11749 | $signal_t blech(int s) { exit(7); } |
| 11750 | $signal_t blech_in_list(int s) { exit(4); } |
| 11751 | unsigned long dummy_long(unsigned long p) { return p; } |
| 11752 | unsigned int dummy_int(unsigned int p) { return p; } |
| 11753 | unsigned short dummy_short(unsigned short p) { return p; } |
| 11754 | int main() |
| 11755 | { |
| 11756 | double f; |
| 11757 | unsigned long along; |
| 11758 | unsigned int aint; |
| 11759 | unsigned short ashort; |
| 11760 | int result = 0; |
| 11761 | char str[16]; |
| 11762 | |
| 11763 | /* Frustrate gcc-2.7.2's optimizer which failed this test with |
| 11764 | a direct f = -123. assignment. gcc-2.8.0 reportedly |
| 11765 | optimized the whole file away |
| 11766 | */ |
| 11767 | /* Store the number in a writable string for gcc to pass to |
| 11768 | sscanf under HP-UX. |
| 11769 | */ |
| 11770 | sprintf(str, "-123"); |
| 11771 | sscanf(str, "%lf", &f); /* f = -123.; */ |
| 11772 | |
| 11773 | signal(SIGFPE, blech); |
| 11774 | along = (unsigned long)f; |
| 11775 | aint = (unsigned int)f; |
| 11776 | ashort = (unsigned short)f; |
| 11777 | if (along != (unsigned long)-123) |
| 11778 | result |= 1; |
| 11779 | if (aint != (unsigned int)-123) |
| 11780 | result |= 1; |
| 11781 | if (ashort != (unsigned short)-123) |
| 11782 | result |= 1; |
| 11783 | sprintf(str, "1073741824."); |
| 11784 | sscanf(str, "%lf", &f); /* f = (double)0x40000000; */ |
| 11785 | f = f + f; |
| 11786 | along = 0; |
| 11787 | along = (unsigned long)f; |
| 11788 | if (along != 0x80000000) |
| 11789 | result |= 2; |
| 11790 | f -= 1.; |
| 11791 | along = 0; |
| 11792 | along = (unsigned long)f; |
| 11793 | if (along != 0x7fffffff) |
| 11794 | result |= 1; |
| 11795 | f += 2.; |
| 11796 | along = 0; |
| 11797 | along = (unsigned long)f; |
| 11798 | if (along != 0x80000001) |
| 11799 | result |= 2; |
| 11800 | if (result) |
| 11801 | exit(result); |
| 11802 | signal(SIGFPE, blech_in_list); |
| 11803 | sprintf(str, "123."); |
| 11804 | sscanf(str, "%lf", &f); /* f = 123.; */ |
| 11805 | along = dummy_long((unsigned long)f); |
| 11806 | aint = dummy_int((unsigned int)f); |
| 11807 | ashort = dummy_short((unsigned short)f); |
| 11808 | if (along != (unsigned long)123) |
| 11809 | result |= 4; |
| 11810 | if (aint != (unsigned int)123) |
| 11811 | result |= 4; |
| 11812 | if (ashort != (unsigned short)123) |
| 11813 | result |= 4; |
| 11814 | exit(result); |
| 11815 | |
| 11816 | } |
| 11817 | EOCP |
| 11818 | set try |
| 11819 | if eval $compile_ok; then |
| 11820 | $run ./try 2>/dev/null |
| 11821 | castflags=$? |
| 11822 | else |
| 11823 | echo "(I can't seem to compile the test program--assuming it can't)" |
| 11824 | castflags=7 |
| 11825 | fi |
| 11826 | case "$castflags" in |
| 11827 | 0) val="$define" |
| 11828 | echo "Yup, it can." |
| 11829 | ;; |
| 11830 | *) val="$undef" |
| 11831 | echo "Nope, it can't." |
| 11832 | ;; |
| 11833 | esac |
| 11834 | set d_castneg |
| 11835 | eval $setvar |
| 11836 | $rm_try |
| 11837 | |
| 11838 | : see if cbrt exists |
| 11839 | set cbrt d_cbrt |
| 11840 | eval $inlibc |
| 11841 | |
| 11842 | : see if chown exists |
| 11843 | set chown d_chown |
| 11844 | eval $inlibc |
| 11845 | |
| 11846 | : see if chroot exists |
| 11847 | set chroot d_chroot |
| 11848 | eval $inlibc |
| 11849 | |
| 11850 | : see if chsize exists |
| 11851 | set chsize d_chsize |
| 11852 | eval $inlibc |
| 11853 | |
| 11854 | : see if class exists |
| 11855 | set class d_class |
| 11856 | eval $inlibc |
| 11857 | |
| 11858 | : see if clearenv exists |
| 11859 | set clearenv d_clearenv |
| 11860 | eval $inlibc |
| 11861 | |
| 11862 | : Define hasstruct macro for Configure internal use |
| 11863 | hasstruct='varname=$1; struct=$2; shift; shift; |
| 11864 | while $test $# -ge 2; do |
| 11865 | case "$1" in |
| 11866 | $define) echo "#include <$2>";; |
| 11867 | esac ; |
| 11868 | shift 2; |
| 11869 | done > try.c; |
| 11870 | echo "int main () { struct $struct foo; }" >> try.c; |
| 11871 | set try; |
| 11872 | if eval $compile; then |
| 11873 | val="$define"; |
| 11874 | else |
| 11875 | val="$undef"; |
| 11876 | fi; |
| 11877 | set $varname; |
| 11878 | eval $setvar; |
| 11879 | $rm_try' |
| 11880 | |
| 11881 | : see whether socket exists |
| 11882 | socketlib='' |
| 11883 | sockethdr='' |
| 11884 | echo " " |
| 11885 | $echo $n "Hmm... $c" >&4 |
| 11886 | if set socket val -f d_socket; eval $csym; $val; then |
| 11887 | echo "Looks like you have Berkeley networking support." >&4 |
| 11888 | d_socket="$define" |
| 11889 | if set setsockopt val -f; eval $csym; $val; then |
| 11890 | d_oldsock="$undef" |
| 11891 | else |
| 11892 | echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4 |
| 11893 | d_oldsock="$define" |
| 11894 | fi |
| 11895 | else |
| 11896 | if $contains socklib libc.list >/dev/null 2>&1; then |
| 11897 | echo "Looks like you have Berkeley networking support." >&4 |
| 11898 | d_socket="$define" |
| 11899 | : we will have to assume that it supports the 4.2 BSD interface |
| 11900 | d_oldsock="$undef" |
| 11901 | else |
| 11902 | echo "You don't have Berkeley networking in libc$_a..." >&4 |
| 11903 | if test "X$d_socket" = "X$define"; then |
| 11904 | echo "...but you seem to believe that you have sockets." >&4 |
| 11905 | else |
| 11906 | for net in net socket |
| 11907 | do |
| 11908 | if test -f $sysroot/usr/lib/lib$net$_a; then |
| 11909 | ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \ |
| 11910 | $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list |
| 11911 | if $contains socket libc.list >/dev/null 2>&1; then |
| 11912 | d_socket="$define" |
| 11913 | socketlib="-l$net" |
| 11914 | case "$net" in |
| 11915 | net) |
| 11916 | echo "...but the Wollongong group seems to have hacked it in." >&4 |
| 11917 | sockethdr="-I$sysroot/usr/netinclude" |
| 11918 | ;; |
| 11919 | esac |
| 11920 | echo "Found Berkeley sockets interface in lib$net." >&4 |
| 11921 | if $contains setsockopt libc.list >/dev/null 2>&1; then |
| 11922 | d_oldsock="$undef" |
| 11923 | else |
| 11924 | echo "...using the old BSD 4.1c interface, rather than 4.2." >&4 |
| 11925 | d_oldsock="$define" |
| 11926 | fi |
| 11927 | break |
| 11928 | fi |
| 11929 | fi |
| 11930 | done |
| 11931 | if test "X$d_socket" != "X$define"; then |
| 11932 | echo "or anywhere else I see." >&4 |
| 11933 | d_socket="$undef" |
| 11934 | d_oldsock="$undef" |
| 11935 | fi |
| 11936 | fi |
| 11937 | fi |
| 11938 | fi |
| 11939 | |
| 11940 | : see if socketpair exists |
| 11941 | set socketpair d_sockpair |
| 11942 | eval $inlibc |
| 11943 | |
| 11944 | |
| 11945 | echo " " |
| 11946 | echo "Checking the availability sa_len in the sock struct ..." >&4 |
| 11947 | $cat >try.c <<EOF |
| 11948 | #include <sys/types.h> |
| 11949 | #include <sys/socket.h> |
| 11950 | int main() { |
| 11951 | struct sockaddr sa; |
| 11952 | return (sa.sa_len); |
| 11953 | } |
| 11954 | EOF |
| 11955 | val="$undef" |
| 11956 | set try; if eval $compile; then |
| 11957 | val="$define" |
| 11958 | fi |
| 11959 | set d_sockaddr_sa_len; eval $setvar |
| 11960 | $rm_try |
| 11961 | |
| 11962 | echo " " |
| 11963 | echo "Checking the availability struct sockaddr_in6 ..." >&4 |
| 11964 | $cat >try.c <<EOF |
| 11965 | #include <sys/types.h> |
| 11966 | #include <sys/socket.h> |
| 11967 | #include <netinet/in.h> |
| 11968 | int main() { |
| 11969 | struct sockaddr_in6 sin6; |
| 11970 | return (sin6.sin6_family); |
| 11971 | } |
| 11972 | EOF |
| 11973 | val="$undef" |
| 11974 | set try; if eval $compile; then |
| 11975 | val="$define" |
| 11976 | fi |
| 11977 | set d_sockaddr_in6; eval $setvar |
| 11978 | $rm_try |
| 11979 | |
| 11980 | echo " " |
| 11981 | echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4 |
| 11982 | $cat >try.c <<EOF |
| 11983 | #include <sys/types.h> |
| 11984 | #include <sys/socket.h> |
| 11985 | #include <netinet/in.h> |
| 11986 | int main() { |
| 11987 | struct sockaddr_in6 sin6; |
| 11988 | return (sin6.sin6_scope_id); |
| 11989 | } |
| 11990 | EOF |
| 11991 | val="$undef" |
| 11992 | set try; if eval $compile; then |
| 11993 | val="$define" |
| 11994 | fi |
| 11995 | set d_sin6_scope_id; eval $setvar |
| 11996 | $rm_try |
| 11997 | |
| 11998 | echo " " |
| 11999 | echo "Checking the availability struct ip_mreq ..." >&4 |
| 12000 | $cat >try.c <<EOF |
| 12001 | #include <sys/types.h> |
| 12002 | #include <sys/socket.h> |
| 12003 | #include <netinet/in.h> |
| 12004 | int main() { |
| 12005 | struct ip_mreq mreq; |
| 12006 | return (mreq.imr_multiaddr.s_addr); |
| 12007 | } |
| 12008 | EOF |
| 12009 | val="$undef" |
| 12010 | set try; if eval $compile; then |
| 12011 | val="$define" |
| 12012 | fi |
| 12013 | set d_ip_mreq; eval $setvar |
| 12014 | $rm_try |
| 12015 | |
| 12016 | echo " " |
| 12017 | echo "Checking the availability struct ip_mreq_source ..." >&4 |
| 12018 | $cat >try.c <<EOF |
| 12019 | #include <sys/types.h> |
| 12020 | #include <sys/socket.h> |
| 12021 | #include <netinet/in.h> |
| 12022 | int main() { |
| 12023 | struct ip_mreq_source mreq; |
| 12024 | return (mreq.imr_multiaddr.s_addr); |
| 12025 | } |
| 12026 | EOF |
| 12027 | val="$undef" |
| 12028 | set try; if eval $compile; then |
| 12029 | val="$define" |
| 12030 | fi |
| 12031 | set d_ip_mreq_source; eval $setvar |
| 12032 | $rm_try |
| 12033 | |
| 12034 | echo " " |
| 12035 | echo "Checking the availability struct ipv6_mreq ..." >&4 |
| 12036 | $cat >try.c <<EOF |
| 12037 | #include <sys/types.h> |
| 12038 | #include <sys/socket.h> |
| 12039 | #include <netinet/in.h> |
| 12040 | int main() { |
| 12041 | struct ipv6_mreq mreq; |
| 12042 | return (mreq.ipv6mr_interface); |
| 12043 | } |
| 12044 | EOF |
| 12045 | val="$undef" |
| 12046 | set try; if eval $compile; then |
| 12047 | val="$define" |
| 12048 | fi |
| 12049 | set d_ipv6_mreq; eval $setvar |
| 12050 | $rm_try |
| 12051 | |
| 12052 | echo " " |
| 12053 | echo "Checking the availability struct ipv6_mreq_source ..." >&4 |
| 12054 | $cat >try.c <<EOF |
| 12055 | #include <sys/types.h> |
| 12056 | #include <sys/socket.h> |
| 12057 | #include <netinet/in.h> |
| 12058 | int main() { |
| 12059 | struct ipv6_mreq_source mreq; |
| 12060 | return (mreq.imr_multiaddr.s_addr); |
| 12061 | } |
| 12062 | EOF |
| 12063 | val="$undef" |
| 12064 | set try; if eval $compile; then |
| 12065 | val="$define" |
| 12066 | fi |
| 12067 | set d_ipv6_mreq_source; eval $setvar |
| 12068 | $rm_try |
| 12069 | |
| 12070 | echo " " |
| 12071 | echo "Checking the availability of certain socket constants..." >&4 |
| 12072 | for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do |
| 12073 | enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'` |
| 12074 | $cat >try.c <<EOF |
| 12075 | #include <sys/types.h> |
| 12076 | #include <sys/socket.h> |
| 12077 | int main() { |
| 12078 | int i = $ENUM; |
| 12079 | } |
| 12080 | EOF |
| 12081 | val="$undef" |
| 12082 | set try; if eval $compile; then |
| 12083 | val="$define" |
| 12084 | fi |
| 12085 | set d_${enum}; eval $setvar |
| 12086 | $rm_try |
| 12087 | done |
| 12088 | |
| 12089 | : see if this is a sys/uio.h system |
| 12090 | set sys/uio.h i_sysuio |
| 12091 | eval $inhdr |
| 12092 | |
| 12093 | : Check for cmsghdr support |
| 12094 | echo " " |
| 12095 | echo "Checking to see if your system supports struct cmsghdr..." >&4 |
| 12096 | set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h |
| 12097 | eval $hasstruct |
| 12098 | case "$d_cmsghdr_s" in |
| 12099 | "$define") echo "Yes, it does." ;; |
| 12100 | *) echo "No, it doesn't." ;; |
| 12101 | esac |
| 12102 | |
| 12103 | : see if copysign exists |
| 12104 | set copysign d_copysign |
| 12105 | eval $inlibc |
| 12106 | |
| 12107 | : see if copysignl exists |
| 12108 | set copysignl d_copysignl |
| 12109 | eval $inlibc |
| 12110 | |
| 12111 | : see if crypt exists |
| 12112 | echo " " |
| 12113 | set crypt d_crypt |
| 12114 | eval $inlibc |
| 12115 | case "$d_crypt" in |
| 12116 | $define) cryptlib='' ;; |
| 12117 | *) if set crypt val -f d_crypt; eval $csym; $val; then |
| 12118 | echo 'crypt() found.' >&4 |
| 12119 | val="$define" |
| 12120 | cryptlib='' |
| 12121 | else |
| 12122 | cryptlib=`./loc Slibcrypt$_a "" $xlibpth` |
| 12123 | if $test -z "$cryptlib"; then |
| 12124 | cryptlib=`./loc Mlibcrypt$_a "" $xlibpth` |
| 12125 | else |
| 12126 | cryptlib=-lcrypt |
| 12127 | fi |
| 12128 | if $test -z "$cryptlib"; then |
| 12129 | cryptlib=`./loc Llibcrypt$_a "" $xlibpth` |
| 12130 | else |
| 12131 | cryptlib=-lcrypt |
| 12132 | fi |
| 12133 | if $test -z "$cryptlib"; then |
| 12134 | cryptlib=`./loc libcrypt$_a "" $libpth` |
| 12135 | else |
| 12136 | cryptlib=-lcrypt |
| 12137 | fi |
| 12138 | if $test -z "$cryptlib"; then |
| 12139 | echo 'crypt() NOT found.' >&4 |
| 12140 | val="$undef" |
| 12141 | else |
| 12142 | val="$define" |
| 12143 | fi |
| 12144 | fi |
| 12145 | set d_crypt |
| 12146 | eval $setvar |
| 12147 | ;; |
| 12148 | esac |
| 12149 | |
| 12150 | : see if this is a crypt.h system |
| 12151 | set crypt.h i_crypt |
| 12152 | eval $inhdr |
| 12153 | |
| 12154 | : see if crypt_r exists |
| 12155 | set crypt_r d_crypt_r |
| 12156 | eval $inlibc |
| 12157 | case "$d_crypt_r" in |
| 12158 | "$define") |
| 12159 | hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h" |
| 12160 | case "$d_crypt_r_proto:$usethreads" in |
| 12161 | ":define") d_crypt_r_proto=define |
| 12162 | set d_crypt_r_proto crypt_r $hdrs |
| 12163 | eval $hasproto ;; |
| 12164 | *) ;; |
| 12165 | esac |
| 12166 | case "$d_crypt_r_proto" in |
| 12167 | define) |
| 12168 | case "$crypt_r_proto" in |
| 12169 | ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);' |
| 12170 | ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;; |
| 12171 | esac |
| 12172 | case "$crypt_r_proto" in |
| 12173 | ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);' |
| 12174 | ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;; |
| 12175 | esac |
| 12176 | case "$crypt_r_proto" in |
| 12177 | ''|0) d_crypt_r=undef |
| 12178 | crypt_r_proto=0 |
| 12179 | echo "Disabling crypt_r, cannot determine prototype." >&4 ;; |
| 12180 | * ) case "$crypt_r_proto" in |
| 12181 | REENTRANT_PROTO*) ;; |
| 12182 | *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;; |
| 12183 | esac |
| 12184 | echo "Prototype: $try" ;; |
| 12185 | esac |
| 12186 | ;; |
| 12187 | *) case "$usethreads" in |
| 12188 | define) echo "crypt_r has no prototype, not using it." >&4 ;; |
| 12189 | esac |
| 12190 | d_crypt_r=undef |
| 12191 | crypt_r_proto=0 |
| 12192 | ;; |
| 12193 | esac |
| 12194 | ;; |
| 12195 | *) crypt_r_proto=0 |
| 12196 | ;; |
| 12197 | esac |
| 12198 | |
| 12199 | : get csh whereabouts |
| 12200 | case "$csh" in |
| 12201 | 'csh') val="$undef" ;; |
| 12202 | *) val="$define" ;; |
| 12203 | esac |
| 12204 | set d_csh |
| 12205 | eval $setvar |
| 12206 | : Respect a hint or command line value for full_csh. |
| 12207 | case "$full_csh" in |
| 12208 | '') full_csh=$csh ;; |
| 12209 | esac |
| 12210 | |
| 12211 | : see if ctermid exists |
| 12212 | set ctermid d_ctermid |
| 12213 | eval $inlibc |
| 12214 | |
| 12215 | : see if ctermid_r exists |
| 12216 | set ctermid_r d_ctermid_r |
| 12217 | eval $inlibc |
| 12218 | case "$d_ctermid_r" in |
| 12219 | "$define") |
| 12220 | hdrs="$i_systypes sys/types.h define stdio.h " |
| 12221 | case "$d_ctermid_r_proto:$usethreads" in |
| 12222 | ":define") d_ctermid_r_proto=define |
| 12223 | set d_ctermid_r_proto ctermid_r $hdrs |
| 12224 | eval $hasproto ;; |
| 12225 | *) ;; |
| 12226 | esac |
| 12227 | case "$d_ctermid_r_proto" in |
| 12228 | define) |
| 12229 | case "$ctermid_r_proto" in |
| 12230 | ''|0) try='char* ctermid_r(char*);' |
| 12231 | ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;; |
| 12232 | esac |
| 12233 | case "$ctermid_r_proto" in |
| 12234 | ''|0) d_ctermid_r=undef |
| 12235 | ctermid_r_proto=0 |
| 12236 | echo "Disabling ctermid_r, cannot determine prototype." >&4 ;; |
| 12237 | * ) case "$ctermid_r_proto" in |
| 12238 | REENTRANT_PROTO*) ;; |
| 12239 | *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;; |
| 12240 | esac |
| 12241 | echo "Prototype: $try" ;; |
| 12242 | esac |
| 12243 | ;; |
| 12244 | *) case "$usethreads" in |
| 12245 | define) echo "ctermid_r has no prototype, not using it." >&4 ;; |
| 12246 | esac |
| 12247 | d_ctermid_r=undef |
| 12248 | ctermid_r_proto=0 |
| 12249 | ;; |
| 12250 | esac |
| 12251 | ;; |
| 12252 | *) ctermid_r_proto=0 |
| 12253 | ;; |
| 12254 | esac |
| 12255 | |
| 12256 | : see if ctime_r exists |
| 12257 | set ctime_r d_ctime_r |
| 12258 | eval $inlibc |
| 12259 | case "$d_ctime_r" in |
| 12260 | "$define") |
| 12261 | hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h" |
| 12262 | case "$d_ctime_r_proto:$usethreads" in |
| 12263 | ":define") d_ctime_r_proto=define |
| 12264 | set d_ctime_r_proto ctime_r $hdrs |
| 12265 | eval $hasproto ;; |
| 12266 | *) ;; |
| 12267 | esac |
| 12268 | case "$d_ctime_r_proto" in |
| 12269 | define) |
| 12270 | case "$ctime_r_proto" in |
| 12271 | ''|0) try='char* ctime_r(const time_t*, char*);' |
| 12272 | ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;; |
| 12273 | esac |
| 12274 | case "$ctime_r_proto" in |
| 12275 | ''|0) try='char* ctime_r(const time_t*, char*, int);' |
| 12276 | ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;; |
| 12277 | esac |
| 12278 | case "$ctime_r_proto" in |
| 12279 | ''|0) try='int ctime_r(const time_t*, char*);' |
| 12280 | ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;; |
| 12281 | esac |
| 12282 | case "$ctime_r_proto" in |
| 12283 | ''|0) try='int ctime_r(const time_t*, char*, int);' |
| 12284 | ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;; |
| 12285 | esac |
| 12286 | case "$ctime_r_proto" in |
| 12287 | ''|0) d_ctime_r=undef |
| 12288 | ctime_r_proto=0 |
| 12289 | echo "Disabling ctime_r, cannot determine prototype." >&4 ;; |
| 12290 | * ) case "$ctime_r_proto" in |
| 12291 | REENTRANT_PROTO*) ;; |
| 12292 | *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;; |
| 12293 | esac |
| 12294 | echo "Prototype: $try" ;; |
| 12295 | esac |
| 12296 | ;; |
| 12297 | *) case "$usethreads" in |
| 12298 | define) echo "ctime_r has no prototype, not using it." >&4 ;; |
| 12299 | esac |
| 12300 | d_ctime_r=undef |
| 12301 | ctime_r_proto=0 |
| 12302 | ;; |
| 12303 | esac |
| 12304 | ;; |
| 12305 | *) ctime_r_proto=0 |
| 12306 | ;; |
| 12307 | esac |
| 12308 | |
| 12309 | : see if cuserid exists |
| 12310 | set cuserid d_cuserid |
| 12311 | eval $inlibc |
| 12312 | |
| 12313 | : see if dbm.h is available |
| 12314 | : see if dbmclose exists |
| 12315 | set dbmclose d_dbmclose |
| 12316 | eval $inlibc |
| 12317 | |
| 12318 | case "$d_dbmclose" in |
| 12319 | $define) |
| 12320 | set dbm.h i_dbm |
| 12321 | eval $inhdr |
| 12322 | case "$i_dbm" in |
| 12323 | $define) |
| 12324 | val="$undef" |
| 12325 | set i_rpcsvcdbm |
| 12326 | eval $setvar |
| 12327 | ;; |
| 12328 | *) set rpcsvc/dbm.h i_rpcsvcdbm |
| 12329 | eval $inhdr |
| 12330 | ;; |
| 12331 | esac |
| 12332 | ;; |
| 12333 | *) echo "We won't be including <dbm.h>" |
| 12334 | val="$undef" |
| 12335 | set i_dbm |
| 12336 | eval $setvar |
| 12337 | val="$undef" |
| 12338 | set i_rpcsvcdbm |
| 12339 | eval $setvar |
| 12340 | ;; |
| 12341 | esac |
| 12342 | |
| 12343 | : see if prototype for dbminit is available |
| 12344 | echo " " |
| 12345 | set d_dbminitproto dbminit $i_dbm dbm.h |
| 12346 | eval $hasproto |
| 12347 | |
| 12348 | : see if difftime exists |
| 12349 | set difftime d_difftime |
| 12350 | eval $inlibc |
| 12351 | |
| 12352 | : see if this is a dirent system |
| 12353 | echo " " |
| 12354 | if xinc=`./findhdr dirent.h`; $test "$xinc"; then |
| 12355 | val="$define" |
| 12356 | echo "<dirent.h> found." >&4 |
| 12357 | else |
| 12358 | val="$undef" |
| 12359 | if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then |
| 12360 | echo "<sys/dir.h> found." >&4 |
| 12361 | echo " " |
| 12362 | else |
| 12363 | xinc=`./findhdr sys/ndir.h` |
| 12364 | fi |
| 12365 | echo "<dirent.h> NOT found." >&4 |
| 12366 | fi |
| 12367 | set i_dirent |
| 12368 | eval $setvar |
| 12369 | |
| 12370 | : Look for type of directory structure. |
| 12371 | echo " " |
| 12372 | $cppstdin $cppflags $cppminus < "$xinc" > try.c |
| 12373 | |
| 12374 | case "$direntrytype" in |
| 12375 | ''|' ') |
| 12376 | case "$i_dirent" in |
| 12377 | $define) guess1='struct dirent' ;; |
| 12378 | *) guess1='struct direct' ;; |
| 12379 | esac |
| 12380 | ;; |
| 12381 | *) guess1="$direntrytype" |
| 12382 | ;; |
| 12383 | esac |
| 12384 | |
| 12385 | case "$guess1" in |
| 12386 | 'struct dirent') guess2='struct direct' ;; |
| 12387 | *) guess2='struct dirent' ;; |
| 12388 | esac |
| 12389 | |
| 12390 | if $contains "$guess1" try.c >/dev/null 2>&1; then |
| 12391 | direntrytype="$guess1" |
| 12392 | echo "Your directory entries are $direntrytype." >&4 |
| 12393 | elif $contains "$guess2" try.c >/dev/null 2>&1; then |
| 12394 | direntrytype="$guess2" |
| 12395 | echo "Your directory entries seem to be $direntrytype." >&4 |
| 12396 | else |
| 12397 | echo "I don't recognize your system's directory entries." >&4 |
| 12398 | rp="What type is used for directory entries on this system?" |
| 12399 | dflt="$guess1" |
| 12400 | . ./myread |
| 12401 | direntrytype="$ans" |
| 12402 | fi |
| 12403 | $rm_try |
| 12404 | |
| 12405 | : see if the directory entry stores field length |
| 12406 | echo " " |
| 12407 | $cppstdin $cppflags $cppminus < "$xinc" > try.c |
| 12408 | if $contains 'd_namlen' try.c >/dev/null 2>&1; then |
| 12409 | echo "Good, your directory entry keeps length information in d_namlen." >&4 |
| 12410 | val="$define" |
| 12411 | else |
| 12412 | echo "Your directory entry does not know about the d_namlen field." >&4 |
| 12413 | val="$undef" |
| 12414 | fi |
| 12415 | set d_dirnamlen |
| 12416 | eval $setvar |
| 12417 | $rm_try |
| 12418 | |
| 12419 | : Look for DIR.dd_fd |
| 12420 | case "$i_dirent" in |
| 12421 | "$define") |
| 12422 | echo "Checking to see if DIR has a dd_fd member variable" >&4 |
| 12423 | $cat >try.c <<EOCP |
| 12424 | #$i_stdlib I_STDLIB |
| 12425 | #ifdef I_STDLIB |
| 12426 | #include <stdlib.h> |
| 12427 | #endif |
| 12428 | #include <dirent.h> |
| 12429 | |
| 12430 | int main() { |
| 12431 | DIR dir; |
| 12432 | dir.dd_fd = 1; |
| 12433 | return 0; |
| 12434 | } |
| 12435 | EOCP |
| 12436 | val=$undef |
| 12437 | set try |
| 12438 | if eval $compile; then |
| 12439 | echo "Yes, it does." |
| 12440 | val="$define" |
| 12441 | else |
| 12442 | echo "No, it does not." |
| 12443 | val="$undef" |
| 12444 | fi |
| 12445 | ;; |
| 12446 | *) |
| 12447 | echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4 |
| 12448 | val="$undef" |
| 12449 | ;; |
| 12450 | esac |
| 12451 | set d_dir_dd_fd |
| 12452 | eval $setvar |
| 12453 | $rm_try |
| 12454 | |
| 12455 | : see if this is an sysdir system |
| 12456 | set sys/dir.h i_sysdir |
| 12457 | eval $inhdr |
| 12458 | |
| 12459 | : see if this is an sysndir system |
| 12460 | set sys/ndir.h i_sysndir |
| 12461 | eval $inhdr |
| 12462 | |
| 12463 | : Look for dirfd |
| 12464 | echo " " |
| 12465 | $cat >dirfd.c <<EOM |
| 12466 | #include <stdio.h> |
| 12467 | #$i_stdlib I_STDLIB |
| 12468 | #ifdef I_STDLIB |
| 12469 | #include <stdlib.h> |
| 12470 | #endif |
| 12471 | #$i_dirent I_DIRENT /**/ |
| 12472 | #$i_sysdir I_SYS_DIR /**/ |
| 12473 | #$i_sysndir I_SYS_NDIR /**/ |
| 12474 | #$i_systypes I_SYS_TYPES /**/ |
| 12475 | #if defined(I_SYS_TYPES) |
| 12476 | #include <sys/types.h> |
| 12477 | #endif |
| 12478 | #if defined(I_DIRENT) |
| 12479 | #include <dirent.h> |
| 12480 | #else |
| 12481 | #ifdef I_SYS_NDIR |
| 12482 | #include <sys/ndir.h> |
| 12483 | #else |
| 12484 | #ifdef I_SYS_DIR |
| 12485 | #include <sys/dir.h> |
| 12486 | #endif |
| 12487 | #endif |
| 12488 | #endif |
| 12489 | int main() { |
| 12490 | DIR *dirp = opendir("."); |
| 12491 | if (dirfd(dirp) >= 0) |
| 12492 | exit(0); |
| 12493 | else |
| 12494 | exit(1); |
| 12495 | } |
| 12496 | EOM |
| 12497 | val=$undef |
| 12498 | set dirfd |
| 12499 | if eval $compile; then |
| 12500 | val="$define" |
| 12501 | fi |
| 12502 | case "$val" in |
| 12503 | $define) echo "dirfd() found." >&4 ;; |
| 12504 | *) echo "dirfd() NOT found." >&4 ;; |
| 12505 | esac |
| 12506 | set d_dirfd |
| 12507 | eval $setvar |
| 12508 | $rm -f dirfd* |
| 12509 | |
| 12510 | : see if dladdr exists |
| 12511 | set dladdr d_dladdr |
| 12512 | eval $inlibc |
| 12513 | |
| 12514 | : see if dlerror exists |
| 12515 | xxx_runnm="$runnm" |
| 12516 | runnm=false |
| 12517 | set dlerror d_dlerror |
| 12518 | eval $inlibc |
| 12519 | runnm="$xxx_runnm" |
| 12520 | |
| 12521 | : see if dlfcn is available |
| 12522 | set dlfcn.h i_dlfcn |
| 12523 | eval $inhdr |
| 12524 | |
| 12525 | : Check what extension to use for shared libs |
| 12526 | case "$usedl" in |
| 12527 | $define|y|true) |
| 12528 | $cat << EOM |
| 12529 | |
| 12530 | On a few systems, the dynamically loaded modules that perl generates and uses |
| 12531 | will need a different extension than shared libs. The default will probably |
| 12532 | be appropriate. |
| 12533 | |
| 12534 | EOM |
| 12535 | case "$dlext" in |
| 12536 | '') dflt="$so" ;; |
| 12537 | *) dflt="$dlext" ;; |
| 12538 | esac |
| 12539 | rp='What is the extension of dynamically loaded modules' |
| 12540 | . ./myread |
| 12541 | dlext="$ans" |
| 12542 | ;; |
| 12543 | *) |
| 12544 | dlext="none" |
| 12545 | ;; |
| 12546 | esac |
| 12547 | |
| 12548 | : Check if dlsym need a leading underscore |
| 12549 | echo " " |
| 12550 | val="$undef" |
| 12551 | |
| 12552 | case "$dlsrc" in |
| 12553 | dl_dlopen.xs) |
| 12554 | echo "Checking whether your dlsym() needs a leading underscore ..." >&4 |
| 12555 | $cat >dyna.c <<'EOM' |
| 12556 | fred () { } |
| 12557 | EOM |
| 12558 | |
| 12559 | $cat >fred.c<<EOM |
| 12560 | |
| 12561 | #include <stdio.h> |
| 12562 | #$i_stdlib I_STDLIB |
| 12563 | #ifdef I_STDLIB |
| 12564 | #include <stdlib.h> |
| 12565 | #endif |
| 12566 | #$i_dlfcn I_DLFCN |
| 12567 | #ifdef I_DLFCN |
| 12568 | #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */ |
| 12569 | #else |
| 12570 | #include <sys/types.h> |
| 12571 | #include <nlist.h> |
| 12572 | #include <link.h> |
| 12573 | #endif |
| 12574 | |
| 12575 | extern int fred() ; |
| 12576 | |
| 12577 | int main() |
| 12578 | { |
| 12579 | void * handle ; |
| 12580 | void * symbol ; |
| 12581 | #ifndef RTLD_LAZY |
| 12582 | int mode = 1 ; |
| 12583 | #else |
| 12584 | int mode = RTLD_LAZY ; |
| 12585 | #endif |
| 12586 | handle = dlopen("./dyna.$dlext", mode) ; |
| 12587 | if (handle == NULL) { |
| 12588 | printf ("1\n") ; |
| 12589 | fflush (stdout) ; |
| 12590 | exit(0); |
| 12591 | } |
| 12592 | symbol = dlsym(handle, "fred") ; |
| 12593 | if (symbol == NULL) { |
| 12594 | /* try putting a leading underscore */ |
| 12595 | symbol = dlsym(handle, "_fred") ; |
| 12596 | if (symbol == NULL) { |
| 12597 | printf ("2\n") ; |
| 12598 | fflush (stdout) ; |
| 12599 | exit(0); |
| 12600 | } |
| 12601 | printf ("3\n") ; |
| 12602 | } |
| 12603 | else |
| 12604 | printf ("4\n") ; |
| 12605 | fflush (stdout) ; |
| 12606 | exit(0); |
| 12607 | } |
| 12608 | EOM |
| 12609 | : Call the object file tmp-dyna.o in case dlext=o. |
| 12610 | if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && |
| 12611 | mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 && |
| 12612 | $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 && |
| 12613 | $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then |
| 12614 | xxx=`$run ./fred` |
| 12615 | case $xxx in |
| 12616 | 1) echo "Test program failed using dlopen." >&4 |
| 12617 | echo "Perhaps you should not use dynamic loading." >&4;; |
| 12618 | 2) echo "Test program failed using dlsym." >&4 |
| 12619 | echo "Perhaps you should not use dynamic loading." >&4;; |
| 12620 | 3) echo "dlsym needs a leading underscore" >&4 |
| 12621 | val="$define" ;; |
| 12622 | 4) echo "dlsym doesn't need a leading underscore." >&4;; |
| 12623 | esac |
| 12624 | else |
| 12625 | echo "I can't compile and run the test program." >&4 |
| 12626 | echo "I'm guessing that dlsym doesn't need a leading underscore." >&4 |
| 12627 | fi |
| 12628 | ;; |
| 12629 | esac |
| 12630 | |
| 12631 | $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.* |
| 12632 | |
| 12633 | set d_dlsymun |
| 12634 | eval $setvar |
| 12635 | |
| 12636 | : see if drand48_r exists |
| 12637 | set drand48_r d_drand48_r |
| 12638 | eval $inlibc |
| 12639 | case "$d_drand48_r" in |
| 12640 | "$define") |
| 12641 | hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h" |
| 12642 | case "$d_drand48_r_proto:$usethreads" in |
| 12643 | ":define") d_drand48_r_proto=define |
| 12644 | set d_drand48_r_proto drand48_r $hdrs |
| 12645 | eval $hasproto ;; |
| 12646 | *) ;; |
| 12647 | esac |
| 12648 | case "$d_drand48_r_proto" in |
| 12649 | define) |
| 12650 | case "$drand48_r_proto" in |
| 12651 | ''|0) try='int drand48_r(struct drand48_data*, double*);' |
| 12652 | ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;; |
| 12653 | esac |
| 12654 | case "$drand48_r_proto" in |
| 12655 | ''|0) d_drand48_r=undef |
| 12656 | drand48_r_proto=0 |
| 12657 | echo "Disabling drand48_r, cannot determine prototype." >&4 ;; |
| 12658 | * ) case "$drand48_r_proto" in |
| 12659 | REENTRANT_PROTO*) ;; |
| 12660 | *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;; |
| 12661 | esac |
| 12662 | echo "Prototype: $try" ;; |
| 12663 | esac |
| 12664 | ;; |
| 12665 | *) case "$usethreads" in |
| 12666 | define) echo "drand48_r has no prototype, not using it." >&4 ;; |
| 12667 | esac |
| 12668 | d_drand48_r=undef |
| 12669 | drand48_r_proto=0 |
| 12670 | ;; |
| 12671 | esac |
| 12672 | ;; |
| 12673 | *) drand48_r_proto=0 |
| 12674 | ;; |
| 12675 | esac |
| 12676 | |
| 12677 | : see if prototype for drand48 is available |
| 12678 | echo " " |
| 12679 | set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h |
| 12680 | eval $hasproto |
| 12681 | |
| 12682 | : see if dup2 exists |
| 12683 | set dup2 d_dup2 |
| 12684 | eval $inlibc |
| 12685 | |
| 12686 | : see if dup3 exists |
| 12687 | set dup3 d_dup3 |
| 12688 | eval $inlibc |
| 12689 | |
| 12690 | : see if this is an xlocale.h system |
| 12691 | set xlocale.h i_xlocale |
| 12692 | eval $inhdr |
| 12693 | |
| 12694 | : see if newlocale exists |
| 12695 | set newlocale d_newlocale |
| 12696 | eval $inlibc |
| 12697 | |
| 12698 | : see if freelocale exists |
| 12699 | set freelocale d_freelocale |
| 12700 | eval $inlibc |
| 12701 | |
| 12702 | : see if uselocale exists |
| 12703 | set uselocale d_uselocale |
| 12704 | eval $inlibc |
| 12705 | |
| 12706 | : see if duplocale exists |
| 12707 | set duplocale d_duplocale |
| 12708 | eval $inlibc |
| 12709 | |
| 12710 | : see if querylocale exists |
| 12711 | set querylocale d_querylocale |
| 12712 | eval $inlibc |
| 12713 | |
| 12714 | : see if eaccess exists |
| 12715 | set eaccess d_eaccess |
| 12716 | eval $inlibc |
| 12717 | |
| 12718 | : see if endgrent exists |
| 12719 | set endgrent d_endgrent |
| 12720 | eval $inlibc |
| 12721 | |
| 12722 | : see if this is an grp system |
| 12723 | set grp.h i_grp |
| 12724 | eval $inhdr |
| 12725 | |
| 12726 | case "$i_grp" in |
| 12727 | $define) |
| 12728 | xxx=`./findhdr grp.h` |
| 12729 | $cppstdin $cppflags $cppminus < $xxx >$$.h |
| 12730 | |
| 12731 | if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then |
| 12732 | val="$define" |
| 12733 | else |
| 12734 | val="$undef" |
| 12735 | fi |
| 12736 | set d_grpasswd |
| 12737 | eval $setvar |
| 12738 | |
| 12739 | $rm -f $$.h |
| 12740 | ;; |
| 12741 | *) |
| 12742 | val="$undef"; |
| 12743 | set d_grpasswd; eval $setvar |
| 12744 | ;; |
| 12745 | esac |
| 12746 | |
| 12747 | : see if endgrent_r exists |
| 12748 | set endgrent_r d_endgrent_r |
| 12749 | eval $inlibc |
| 12750 | case "$d_endgrent_r" in |
| 12751 | "$define") |
| 12752 | hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h" |
| 12753 | case "$d_endgrent_r_proto:$usethreads" in |
| 12754 | ":define") d_endgrent_r_proto=define |
| 12755 | set d_endgrent_r_proto endgrent_r $hdrs |
| 12756 | eval $hasproto ;; |
| 12757 | *) ;; |
| 12758 | esac |
| 12759 | case "$d_endgrent_r_proto" in |
| 12760 | define) |
| 12761 | case "$endgrent_r_proto" in |
| 12762 | ''|0) try='int endgrent_r(FILE**);' |
| 12763 | ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;; |
| 12764 | esac |
| 12765 | case "$endgrent_r_proto" in |
| 12766 | ''|0) try='void endgrent_r(FILE**);' |
| 12767 | ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;; |
| 12768 | esac |
| 12769 | case "$endgrent_r_proto" in |
| 12770 | ''|0) d_endgrent_r=undef |
| 12771 | endgrent_r_proto=0 |
| 12772 | echo "Disabling endgrent_r, cannot determine prototype." >&4 ;; |
| 12773 | * ) case "$endgrent_r_proto" in |
| 12774 | REENTRANT_PROTO*) ;; |
| 12775 | *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;; |
| 12776 | esac |
| 12777 | echo "Prototype: $try" ;; |
| 12778 | esac |
| 12779 | ;; |
| 12780 | *) case "$usethreads" in |
| 12781 | define) echo "endgrent_r has no prototype, not using it." >&4 ;; |
| 12782 | esac |
| 12783 | d_endgrent_r=undef |
| 12784 | endgrent_r_proto=0 |
| 12785 | ;; |
| 12786 | esac |
| 12787 | ;; |
| 12788 | *) endgrent_r_proto=0 |
| 12789 | ;; |
| 12790 | esac |
| 12791 | |
| 12792 | : see if endhostent exists |
| 12793 | set endhostent d_endhent |
| 12794 | eval $inlibc |
| 12795 | |
| 12796 | : see if this is a netdb.h system |
| 12797 | set netdb.h i_netdb |
| 12798 | eval $inhdr |
| 12799 | |
| 12800 | : see if endhostent_r exists |
| 12801 | set endhostent_r d_endhostent_r |
| 12802 | eval $inlibc |
| 12803 | case "$d_endhostent_r" in |
| 12804 | "$define") |
| 12805 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 12806 | case "$d_endhostent_r_proto:$usethreads" in |
| 12807 | ":define") d_endhostent_r_proto=define |
| 12808 | set d_endhostent_r_proto endhostent_r $hdrs |
| 12809 | eval $hasproto ;; |
| 12810 | *) ;; |
| 12811 | esac |
| 12812 | case "$d_endhostent_r_proto" in |
| 12813 | define) |
| 12814 | case "$endhostent_r_proto" in |
| 12815 | ''|0) try='int endhostent_r(struct hostent_data*);' |
| 12816 | ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;; |
| 12817 | esac |
| 12818 | case "$endhostent_r_proto" in |
| 12819 | ''|0) try='void endhostent_r(struct hostent_data*);' |
| 12820 | ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;; |
| 12821 | esac |
| 12822 | case "$endhostent_r_proto" in |
| 12823 | ''|0) d_endhostent_r=undef |
| 12824 | endhostent_r_proto=0 |
| 12825 | echo "Disabling endhostent_r, cannot determine prototype." >&4 ;; |
| 12826 | * ) case "$endhostent_r_proto" in |
| 12827 | REENTRANT_PROTO*) ;; |
| 12828 | *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;; |
| 12829 | esac |
| 12830 | echo "Prototype: $try" ;; |
| 12831 | esac |
| 12832 | ;; |
| 12833 | *) case "$usethreads" in |
| 12834 | define) echo "endhostent_r has no prototype, not using it." >&4 ;; |
| 12835 | esac |
| 12836 | d_endhostent_r=undef |
| 12837 | endhostent_r_proto=0 |
| 12838 | ;; |
| 12839 | esac |
| 12840 | ;; |
| 12841 | *) endhostent_r_proto=0 |
| 12842 | ;; |
| 12843 | esac |
| 12844 | |
| 12845 | : see if endnetent exists |
| 12846 | set endnetent d_endnent |
| 12847 | eval $inlibc |
| 12848 | |
| 12849 | : see if endnetent_r exists |
| 12850 | set endnetent_r d_endnetent_r |
| 12851 | eval $inlibc |
| 12852 | case "$d_endnetent_r" in |
| 12853 | "$define") |
| 12854 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 12855 | case "$d_endnetent_r_proto:$usethreads" in |
| 12856 | ":define") d_endnetent_r_proto=define |
| 12857 | set d_endnetent_r_proto endnetent_r $hdrs |
| 12858 | eval $hasproto ;; |
| 12859 | *) ;; |
| 12860 | esac |
| 12861 | case "$d_endnetent_r_proto" in |
| 12862 | define) |
| 12863 | case "$endnetent_r_proto" in |
| 12864 | ''|0) try='int endnetent_r(struct netent_data*);' |
| 12865 | ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;; |
| 12866 | esac |
| 12867 | case "$endnetent_r_proto" in |
| 12868 | ''|0) try='void endnetent_r(struct netent_data*);' |
| 12869 | ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;; |
| 12870 | esac |
| 12871 | case "$endnetent_r_proto" in |
| 12872 | ''|0) d_endnetent_r=undef |
| 12873 | endnetent_r_proto=0 |
| 12874 | echo "Disabling endnetent_r, cannot determine prototype." >&4 ;; |
| 12875 | * ) case "$endnetent_r_proto" in |
| 12876 | REENTRANT_PROTO*) ;; |
| 12877 | *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;; |
| 12878 | esac |
| 12879 | echo "Prototype: $try" ;; |
| 12880 | esac |
| 12881 | ;; |
| 12882 | *) case "$usethreads" in |
| 12883 | define) echo "endnetent_r has no prototype, not using it." >&4 ;; |
| 12884 | esac |
| 12885 | d_endnetent_r=undef |
| 12886 | endnetent_r_proto=0 |
| 12887 | ;; |
| 12888 | esac |
| 12889 | ;; |
| 12890 | *) endnetent_r_proto=0 |
| 12891 | ;; |
| 12892 | esac |
| 12893 | |
| 12894 | : see if endprotoent exists |
| 12895 | set endprotoent d_endpent |
| 12896 | eval $inlibc |
| 12897 | |
| 12898 | : see if endprotoent_r exists |
| 12899 | set endprotoent_r d_endprotoent_r |
| 12900 | eval $inlibc |
| 12901 | case "$d_endprotoent_r" in |
| 12902 | "$define") |
| 12903 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 12904 | case "$d_endprotoent_r_proto:$usethreads" in |
| 12905 | ":define") d_endprotoent_r_proto=define |
| 12906 | set d_endprotoent_r_proto endprotoent_r $hdrs |
| 12907 | eval $hasproto ;; |
| 12908 | *) ;; |
| 12909 | esac |
| 12910 | case "$d_endprotoent_r_proto" in |
| 12911 | define) |
| 12912 | case "$endprotoent_r_proto" in |
| 12913 | ''|0) try='int endprotoent_r(struct protoent_data*);' |
| 12914 | ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;; |
| 12915 | esac |
| 12916 | case "$endprotoent_r_proto" in |
| 12917 | ''|0) try='void endprotoent_r(struct protoent_data*);' |
| 12918 | ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;; |
| 12919 | esac |
| 12920 | case "$endprotoent_r_proto" in |
| 12921 | ''|0) d_endprotoent_r=undef |
| 12922 | endprotoent_r_proto=0 |
| 12923 | echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;; |
| 12924 | * ) case "$endprotoent_r_proto" in |
| 12925 | REENTRANT_PROTO*) ;; |
| 12926 | *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;; |
| 12927 | esac |
| 12928 | echo "Prototype: $try" ;; |
| 12929 | esac |
| 12930 | ;; |
| 12931 | *) case "$usethreads" in |
| 12932 | define) echo "endprotoent_r has no prototype, not using it." >&4 ;; |
| 12933 | esac |
| 12934 | d_endprotoent_r=undef |
| 12935 | endprotoent_r_proto=0 |
| 12936 | ;; |
| 12937 | esac |
| 12938 | ;; |
| 12939 | *) endprotoent_r_proto=0 |
| 12940 | ;; |
| 12941 | esac |
| 12942 | |
| 12943 | : see if endpwent exists |
| 12944 | set endpwent d_endpwent |
| 12945 | eval $inlibc |
| 12946 | |
| 12947 | : see if this is a pwd.h system |
| 12948 | set pwd.h i_pwd |
| 12949 | eval $inhdr |
| 12950 | |
| 12951 | case "$i_pwd" in |
| 12952 | $define) |
| 12953 | xxx=`./findhdr pwd.h` |
| 12954 | $cppstdin $cppflags $cppminus < $xxx >$$.h |
| 12955 | |
| 12956 | if $contains 'pw_quota' $$.h >/dev/null 2>&1; then |
| 12957 | val="$define" |
| 12958 | else |
| 12959 | val="$undef" |
| 12960 | fi |
| 12961 | set d_pwquota |
| 12962 | eval $setvar |
| 12963 | |
| 12964 | if $contains 'pw_age' $$.h >/dev/null 2>&1; then |
| 12965 | val="$define" |
| 12966 | else |
| 12967 | val="$undef" |
| 12968 | fi |
| 12969 | set d_pwage |
| 12970 | eval $setvar |
| 12971 | |
| 12972 | if $contains 'pw_change' $$.h >/dev/null 2>&1; then |
| 12973 | val="$define" |
| 12974 | else |
| 12975 | val="$undef" |
| 12976 | fi |
| 12977 | set d_pwchange |
| 12978 | eval $setvar |
| 12979 | |
| 12980 | if $contains 'pw_class' $$.h >/dev/null 2>&1; then |
| 12981 | val="$define" |
| 12982 | else |
| 12983 | val="$undef" |
| 12984 | fi |
| 12985 | set d_pwclass |
| 12986 | eval $setvar |
| 12987 | |
| 12988 | if $contains 'pw_expire' $$.h >/dev/null 2>&1; then |
| 12989 | val="$define" |
| 12990 | else |
| 12991 | val="$undef" |
| 12992 | fi |
| 12993 | set d_pwexpire |
| 12994 | eval $setvar |
| 12995 | |
| 12996 | if $contains 'pw_comment' $$.h >/dev/null 2>&1; then |
| 12997 | val="$define" |
| 12998 | else |
| 12999 | val="$undef" |
| 13000 | fi |
| 13001 | set d_pwcomment |
| 13002 | eval $setvar |
| 13003 | |
| 13004 | if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then |
| 13005 | val="$define" |
| 13006 | else |
| 13007 | val="$undef" |
| 13008 | fi |
| 13009 | set d_pwgecos |
| 13010 | eval $setvar |
| 13011 | |
| 13012 | if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then |
| 13013 | val="$define" |
| 13014 | else |
| 13015 | val="$undef" |
| 13016 | fi |
| 13017 | set d_pwpasswd |
| 13018 | eval $setvar |
| 13019 | |
| 13020 | $rm -f $$.h |
| 13021 | ;; |
| 13022 | *) |
| 13023 | val="$undef"; |
| 13024 | set d_pwquota; eval $setvar |
| 13025 | set d_pwage; eval $setvar |
| 13026 | set d_pwchange; eval $setvar |
| 13027 | set d_pwclass; eval $setvar |
| 13028 | set d_pwexpire; eval $setvar |
| 13029 | set d_pwcomment; eval $setvar |
| 13030 | set d_pwgecos; eval $setvar |
| 13031 | set d_pwpasswd; eval $setvar |
| 13032 | ;; |
| 13033 | esac |
| 13034 | |
| 13035 | : see if endpwent_r exists |
| 13036 | set endpwent_r d_endpwent_r |
| 13037 | eval $inlibc |
| 13038 | case "$d_endpwent_r" in |
| 13039 | "$define") |
| 13040 | hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h" |
| 13041 | case "$d_endpwent_r_proto:$usethreads" in |
| 13042 | ":define") d_endpwent_r_proto=define |
| 13043 | set d_endpwent_r_proto endpwent_r $hdrs |
| 13044 | eval $hasproto ;; |
| 13045 | *) ;; |
| 13046 | esac |
| 13047 | case "$d_endpwent_r_proto" in |
| 13048 | define) |
| 13049 | case "$endpwent_r_proto" in |
| 13050 | ''|0) try='int endpwent_r(FILE**);' |
| 13051 | ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;; |
| 13052 | esac |
| 13053 | case "$endpwent_r_proto" in |
| 13054 | ''|0) try='void endpwent_r(FILE**);' |
| 13055 | ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;; |
| 13056 | esac |
| 13057 | case "$endpwent_r_proto" in |
| 13058 | ''|0) d_endpwent_r=undef |
| 13059 | endpwent_r_proto=0 |
| 13060 | echo "Disabling endpwent_r, cannot determine prototype." >&4 ;; |
| 13061 | * ) case "$endpwent_r_proto" in |
| 13062 | REENTRANT_PROTO*) ;; |
| 13063 | *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;; |
| 13064 | esac |
| 13065 | echo "Prototype: $try" ;; |
| 13066 | esac |
| 13067 | ;; |
| 13068 | *) case "$usethreads" in |
| 13069 | define) echo "endpwent_r has no prototype, not using it." >&4 ;; |
| 13070 | esac |
| 13071 | d_endpwent_r=undef |
| 13072 | endpwent_r_proto=0 |
| 13073 | ;; |
| 13074 | esac |
| 13075 | ;; |
| 13076 | *) endpwent_r_proto=0 |
| 13077 | ;; |
| 13078 | esac |
| 13079 | |
| 13080 | : see if endservent exists |
| 13081 | set endservent d_endsent |
| 13082 | eval $inlibc |
| 13083 | |
| 13084 | : see if endservent_r exists |
| 13085 | set endservent_r d_endservent_r |
| 13086 | eval $inlibc |
| 13087 | case "$d_endservent_r" in |
| 13088 | "$define") |
| 13089 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 13090 | case "$d_endservent_r_proto:$usethreads" in |
| 13091 | ":define") d_endservent_r_proto=define |
| 13092 | set d_endservent_r_proto endservent_r $hdrs |
| 13093 | eval $hasproto ;; |
| 13094 | *) ;; |
| 13095 | esac |
| 13096 | case "$d_endservent_r_proto" in |
| 13097 | define) |
| 13098 | case "$endservent_r_proto" in |
| 13099 | ''|0) try='int endservent_r(struct servent_data*);' |
| 13100 | ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;; |
| 13101 | esac |
| 13102 | case "$endservent_r_proto" in |
| 13103 | ''|0) try='void endservent_r(struct servent_data*);' |
| 13104 | ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;; |
| 13105 | esac |
| 13106 | case "$endservent_r_proto" in |
| 13107 | ''|0) d_endservent_r=undef |
| 13108 | endservent_r_proto=0 |
| 13109 | echo "Disabling endservent_r, cannot determine prototype." >&4 ;; |
| 13110 | * ) case "$endservent_r_proto" in |
| 13111 | REENTRANT_PROTO*) ;; |
| 13112 | *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;; |
| 13113 | esac |
| 13114 | echo "Prototype: $try" ;; |
| 13115 | esac |
| 13116 | ;; |
| 13117 | *) case "$usethreads" in |
| 13118 | define) echo "endservent_r has no prototype, not using it." >&4 ;; |
| 13119 | esac |
| 13120 | d_endservent_r=undef |
| 13121 | endservent_r_proto=0 |
| 13122 | ;; |
| 13123 | esac |
| 13124 | ;; |
| 13125 | *) endservent_r_proto=0 |
| 13126 | ;; |
| 13127 | esac |
| 13128 | |
| 13129 | : Locate the flags for 'open()' |
| 13130 | echo " " |
| 13131 | $cat >try.c <<EOCP |
| 13132 | #include <sys/types.h> |
| 13133 | #ifdef I_FCNTL |
| 13134 | #include <fcntl.h> |
| 13135 | #endif |
| 13136 | #ifdef I_SYS_FILE |
| 13137 | #include <sys/file.h> |
| 13138 | #endif |
| 13139 | #$i_stdlib I_STDLIB |
| 13140 | #ifdef I_STDLIB |
| 13141 | #include <stdlib.h> |
| 13142 | #endif |
| 13143 | int main() { |
| 13144 | if(O_RDONLY); |
| 13145 | #ifdef O_TRUNC |
| 13146 | exit(0); |
| 13147 | #else |
| 13148 | exit(1); |
| 13149 | #endif |
| 13150 | } |
| 13151 | EOCP |
| 13152 | : check sys/file.h first to get FREAD on Sun |
| 13153 | if $test `./findhdr sys/file.h` && \ |
| 13154 | set try -DI_SYS_FILE && eval $compile; then |
| 13155 | h_sysfile=true; |
| 13156 | echo "<sys/file.h> defines the O_* constants..." >&4 |
| 13157 | if $run ./try; then |
| 13158 | echo "and you have the 3 argument form of open()." >&4 |
| 13159 | val="$define" |
| 13160 | else |
| 13161 | echo "but not the 3 argument form of open(). Oh, well." >&4 |
| 13162 | val="$undef" |
| 13163 | fi |
| 13164 | elif $test `./findhdr fcntl.h` && \ |
| 13165 | set try -DI_FCNTL && eval $compile; then |
| 13166 | h_fcntl=true; |
| 13167 | echo "<fcntl.h> defines the O_* constants..." >&4 |
| 13168 | if $run ./try; then |
| 13169 | echo "and you have the 3 argument form of open()." >&4 |
| 13170 | val="$define" |
| 13171 | else |
| 13172 | echo "but not the 3 argument form of open(). Oh, well." >&4 |
| 13173 | val="$undef" |
| 13174 | fi |
| 13175 | else |
| 13176 | val="$undef" |
| 13177 | echo "I can't find the O_* constant definitions! You got problems." >&4 |
| 13178 | fi |
| 13179 | set d_open3 |
| 13180 | eval $setvar |
| 13181 | $rm_try |
| 13182 | |
| 13183 | : see if this is a sys/file.h system |
| 13184 | val='' |
| 13185 | set sys/file.h val |
| 13186 | eval $inhdr |
| 13187 | |
| 13188 | : do we need to include sys/file.h ? |
| 13189 | case "$val" in |
| 13190 | "$define") |
| 13191 | echo " " |
| 13192 | if $h_sysfile; then |
| 13193 | val="$define" |
| 13194 | echo "We'll be including <sys/file.h>." >&4 |
| 13195 | else |
| 13196 | val="$undef" |
| 13197 | echo "We won't be including <sys/file.h>." >&4 |
| 13198 | fi |
| 13199 | ;; |
| 13200 | *) |
| 13201 | h_sysfile=false |
| 13202 | ;; |
| 13203 | esac |
| 13204 | set i_sysfile |
| 13205 | eval $setvar |
| 13206 | |
| 13207 | : see if fcntl.h is there |
| 13208 | val='' |
| 13209 | set fcntl.h val |
| 13210 | eval $inhdr |
| 13211 | |
| 13212 | : see if we can include fcntl.h |
| 13213 | case "$val" in |
| 13214 | "$define") |
| 13215 | echo " " |
| 13216 | if $h_fcntl; then |
| 13217 | val="$define" |
| 13218 | echo "We'll be including <fcntl.h>." >&4 |
| 13219 | else |
| 13220 | val="$undef" |
| 13221 | if $h_sysfile; then |
| 13222 | echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4 |
| 13223 | else |
| 13224 | echo "We won't be including <fcntl.h>." >&4 |
| 13225 | fi |
| 13226 | fi |
| 13227 | ;; |
| 13228 | *) |
| 13229 | h_fcntl=false |
| 13230 | val="$undef" |
| 13231 | ;; |
| 13232 | esac |
| 13233 | set i_fcntl |
| 13234 | eval $setvar |
| 13235 | |
| 13236 | : see if fork exists |
| 13237 | set fork d_fork |
| 13238 | eval $inlibc |
| 13239 | |
| 13240 | : see if pipe exists |
| 13241 | set pipe d_pipe |
| 13242 | eval $inlibc |
| 13243 | |
| 13244 | : check for non-blocking I/O stuff |
| 13245 | case "$h_sysfile" in |
| 13246 | true) echo "#include <sys/file.h>" > head.c;; |
| 13247 | *) |
| 13248 | case "$h_fcntl" in |
| 13249 | true) echo "#include <fcntl.h>" > head.c;; |
| 13250 | *) echo "#include <sys/fcntl.h>" > head.c;; |
| 13251 | esac |
| 13252 | ;; |
| 13253 | esac |
| 13254 | echo " " |
| 13255 | echo "Figuring out the flag used by open() for non-blocking I/O..." >&4 |
| 13256 | case "$o_nonblock" in |
| 13257 | '') |
| 13258 | $cat head.c > try.c |
| 13259 | $cat >>try.c <<EOCP |
| 13260 | #include <stdio.h> |
| 13261 | #$i_stdlib I_STDLIB |
| 13262 | #ifdef I_STDLIB |
| 13263 | #include <stdlib.h> |
| 13264 | #endif |
| 13265 | #$i_fcntl I_FCNTL |
| 13266 | #ifdef I_FCNTL |
| 13267 | #include <fcntl.h> |
| 13268 | #endif |
| 13269 | int main() { |
| 13270 | #ifdef O_NONBLOCK |
| 13271 | printf("O_NONBLOCK\n"); |
| 13272 | exit(0); |
| 13273 | #endif |
| 13274 | #ifdef O_NDELAY |
| 13275 | printf("O_NDELAY\n"); |
| 13276 | exit(0); |
| 13277 | #endif |
| 13278 | #ifdef FNDELAY |
| 13279 | printf("FNDELAY\n"); |
| 13280 | exit(0); |
| 13281 | #endif |
| 13282 | exit(0); |
| 13283 | } |
| 13284 | EOCP |
| 13285 | set try |
| 13286 | if eval $compile_ok; then |
| 13287 | o_nonblock=`$run ./try` |
| 13288 | case "$o_nonblock" in |
| 13289 | '') echo "I can't figure it out, assuming O_NONBLOCK will do.";; |
| 13290 | *) echo "Seems like we can use $o_nonblock.";; |
| 13291 | esac |
| 13292 | else |
| 13293 | echo "(I can't compile the test program; pray O_NONBLOCK is right!)" |
| 13294 | fi |
| 13295 | ;; |
| 13296 | *) echo "Using $hint value $o_nonblock.";; |
| 13297 | esac |
| 13298 | $rm_try |
| 13299 | |
| 13300 | echo " " |
| 13301 | echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4 |
| 13302 | case "$eagain" in |
| 13303 | '') |
| 13304 | case "$d_fork:$d_pipe:$d_alarm" in |
| 13305 | define:define:define) |
| 13306 | $cat head.c > try.c |
| 13307 | $cat >>try.c <<EOCP |
| 13308 | #include <errno.h> |
| 13309 | #include <sys/types.h> |
| 13310 | #include <signal.h> |
| 13311 | #include <stdio.h> |
| 13312 | #$i_stdlib I_STDLIB |
| 13313 | #ifdef I_STDLIB |
| 13314 | #include <stdlib.h> |
| 13315 | #endif |
| 13316 | #$i_fcntl I_FCNTL |
| 13317 | #ifdef I_FCNTL |
| 13318 | #include <fcntl.h> |
| 13319 | #endif |
| 13320 | #define MY_O_NONBLOCK $o_nonblock |
| 13321 | #ifndef errno /* XXX need better Configure test */ |
| 13322 | extern int errno; |
| 13323 | #endif |
| 13324 | #$i_unistd I_UNISTD |
| 13325 | #ifdef I_UNISTD |
| 13326 | #include <unistd.h> |
| 13327 | #endif |
| 13328 | #include <string.h> |
| 13329 | $signal_t blech(int x) { exit(3); } |
| 13330 | EOCP |
| 13331 | $cat >> try.c <<'EOCP' |
| 13332 | int main() |
| 13333 | { |
| 13334 | int pd[2]; |
| 13335 | int pu[2]; |
| 13336 | char buf[1]; |
| 13337 | char string[100]; |
| 13338 | int ret; |
| 13339 | |
| 13340 | ret = pipe(pd); /* Down: child -> parent */ |
| 13341 | if (ret != 0) |
| 13342 | exit(3); |
| 13343 | ret = pipe(pu); /* Up: parent -> child */ |
| 13344 | if (ret != 0) |
| 13345 | exit(3); |
| 13346 | if (0 != fork()) { |
| 13347 | close(pd[1]); /* Parent reads from pd[0] */ |
| 13348 | close(pu[0]); /* Parent writes (blocking) to pu[1] */ |
| 13349 | #ifdef F_SETFL |
| 13350 | if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK)) |
| 13351 | exit(1); |
| 13352 | #else |
| 13353 | exit(4); |
| 13354 | #endif |
| 13355 | signal(SIGALRM, blech); |
| 13356 | alarm(5); |
| 13357 | if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */ |
| 13358 | exit(2); |
| 13359 | sprintf(string, "%d\n", ret); |
| 13360 | ret = write(2, string, strlen(string)); |
| 13361 | if (ret != strlen(string)) |
| 13362 | exit(3); |
| 13363 | alarm(0); |
| 13364 | #ifdef EAGAIN |
| 13365 | if (errno == EAGAIN) { |
| 13366 | printf("EAGAIN\n"); |
| 13367 | goto ok; |
| 13368 | } |
| 13369 | #endif |
| 13370 | #ifdef EWOULDBLOCK |
| 13371 | if (errno == EWOULDBLOCK) |
| 13372 | printf("EWOULDBLOCK\n"); |
| 13373 | #endif |
| 13374 | ok: |
| 13375 | ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */ |
| 13376 | if (ret != 1) |
| 13377 | exit(3); |
| 13378 | sleep(2); /* Give it time to close our pipe */ |
| 13379 | alarm(5); |
| 13380 | ret = read(pd[0], buf, 1); /* Should read EOF */ |
| 13381 | alarm(0); |
| 13382 | sprintf(string, "%d\n", ret); |
| 13383 | ret = write(4, string, strlen(string)); |
| 13384 | if (ret != strlen(string)) |
| 13385 | exit(3); |
| 13386 | exit(0); |
| 13387 | } |
| 13388 | |
| 13389 | close(pd[0]); /* We write to pd[1] */ |
| 13390 | close(pu[1]); /* We read from pu[0] */ |
| 13391 | ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */ |
| 13392 | if (ret != 1) |
| 13393 | exit(3); |
| 13394 | close(pd[1]); /* Pipe pd is now fully closed! */ |
| 13395 | exit(0); /* Bye bye, thank you for playing! */ |
| 13396 | } |
| 13397 | EOCP |
| 13398 | set try |
| 13399 | if eval $compile_ok; then |
| 13400 | echo "$startsh" >mtry |
| 13401 | echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry |
| 13402 | chmod +x mtry |
| 13403 | $run ./mtry >/dev/null 2>&1 |
| 13404 | case $? in |
| 13405 | 0) eagain=`$cat try.out`;; |
| 13406 | 1) echo "Could not perform non-blocking setting!";; |
| 13407 | 2) echo "I did a successful read() for something that was not there!";; |
| 13408 | 3) echo "Hmm... non-blocking I/O does not seem to be working!";; |
| 13409 | 4) echo "Could not find F_SETFL!";; |
| 13410 | *) echo "Something terribly wrong happened during testing.";; |
| 13411 | esac |
| 13412 | rd_nodata=`$cat try.ret` |
| 13413 | echo "A read() system call with no data present returns $rd_nodata." |
| 13414 | case "$rd_nodata" in |
| 13415 | 0|-1) ;; |
| 13416 | *) |
| 13417 | echo "(That's peculiar, fixing that to be -1.)" |
| 13418 | rd_nodata=-1 |
| 13419 | ;; |
| 13420 | esac |
| 13421 | case "$eagain" in |
| 13422 | '') |
| 13423 | echo "Forcing errno EAGAIN on read() with no data available." |
| 13424 | eagain=EAGAIN |
| 13425 | ;; |
| 13426 | *) |
| 13427 | echo "Your read() sets errno to $eagain when no data is available." |
| 13428 | ;; |
| 13429 | esac |
| 13430 | status=`$cat try.err` |
| 13431 | case "$status" in |
| 13432 | 0) echo "And it correctly returns 0 to signal EOF.";; |
| 13433 | -1) echo "But it also returns -1 to signal EOF, so be careful!";; |
| 13434 | *) echo "However, your read() returns '$status' on EOF??";; |
| 13435 | esac |
| 13436 | val="$define" |
| 13437 | if test "$status" = "$rd_nodata"; then |
| 13438 | echo "WARNING: you can't distinguish between EOF and no data!" |
| 13439 | val="$undef" |
| 13440 | fi |
| 13441 | else |
| 13442 | echo "I can't compile the test program--assuming errno EAGAIN will do." |
| 13443 | eagain=EAGAIN |
| 13444 | fi |
| 13445 | ;; |
| 13446 | *) echo "Can't figure out how to test this--assuming errno EAGAIN will do." |
| 13447 | eagain=EAGAIN |
| 13448 | val="$define" |
| 13449 | ;; |
| 13450 | esac |
| 13451 | set d_eofnblk |
| 13452 | eval $setvar |
| 13453 | ;; |
| 13454 | *) |
| 13455 | echo "Using $hint value $eagain." |
| 13456 | echo "Your read() returns $rd_nodata when no data is present." |
| 13457 | case "$d_eofnblk" in |
| 13458 | "$define") echo "And you can see EOF because read() returns 0.";; |
| 13459 | "$undef") echo "But you can't see EOF status from read() returned value.";; |
| 13460 | *) |
| 13461 | echo "(Assuming you can't see EOF status from read anyway.)" |
| 13462 | d_eofnblk=$undef |
| 13463 | ;; |
| 13464 | esac |
| 13465 | ;; |
| 13466 | esac |
| 13467 | $rm_try head.c mtry |
| 13468 | |
| 13469 | : see if erf exists |
| 13470 | set erf d_erf |
| 13471 | eval $inlibc |
| 13472 | |
| 13473 | : see if erfc exists |
| 13474 | set erfc d_erfc |
| 13475 | eval $inlibc |
| 13476 | |
| 13477 | : see if exp2 exists |
| 13478 | set exp2 d_exp2 |
| 13479 | eval $inlibc |
| 13480 | |
| 13481 | : see if expm1 exists |
| 13482 | set expm1 d_expm1 |
| 13483 | eval $inlibc |
| 13484 | |
| 13485 | : see if _ptr and _cnt from stdio act std |
| 13486 | echo " " |
| 13487 | |
| 13488 | if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then |
| 13489 | echo "(Looks like you have stdio.h from BSD.)" |
| 13490 | case "$stdio_ptr" in |
| 13491 | '') stdio_ptr='((fp)->_p)' |
| 13492 | ptr_lval=$define |
| 13493 | ;; |
| 13494 | *) ptr_lval=$d_stdio_ptr_lval;; |
| 13495 | esac |
| 13496 | case "$stdio_cnt" in |
| 13497 | '') stdio_cnt='((fp)->_r)' |
| 13498 | cnt_lval=$define |
| 13499 | ;; |
| 13500 | *) cnt_lval=$d_stdio_cnt_lval;; |
| 13501 | esac |
| 13502 | case "$stdio_base" in |
| 13503 | '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';; |
| 13504 | esac |
| 13505 | case "$stdio_bufsiz" in |
| 13506 | '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';; |
| 13507 | esac |
| 13508 | elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then |
| 13509 | echo "(Looks like you have stdio.h from Linux.)" |
| 13510 | case "$stdio_ptr" in |
| 13511 | '') stdio_ptr='((fp)->_IO_read_ptr)' |
| 13512 | ptr_lval=$define |
| 13513 | ;; |
| 13514 | *) ptr_lval=$d_stdio_ptr_lval;; |
| 13515 | esac |
| 13516 | case "$stdio_cnt" in |
| 13517 | '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)' |
| 13518 | cnt_lval=$undef |
| 13519 | ;; |
| 13520 | *) cnt_lval=$d_stdio_cnt_lval;; |
| 13521 | esac |
| 13522 | case "$stdio_base" in |
| 13523 | '') stdio_base='((fp)->_IO_read_base)';; |
| 13524 | esac |
| 13525 | case "$stdio_bufsiz" in |
| 13526 | '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';; |
| 13527 | esac |
| 13528 | else |
| 13529 | case "$stdio_ptr" in |
| 13530 | '') stdio_ptr='((fp)->_ptr)' |
| 13531 | ptr_lval=$define |
| 13532 | ;; |
| 13533 | *) ptr_lval=$d_stdio_ptr_lval;; |
| 13534 | esac |
| 13535 | case "$stdio_cnt" in |
| 13536 | '') stdio_cnt='((fp)->_cnt)' |
| 13537 | cnt_lval=$define |
| 13538 | ;; |
| 13539 | *) cnt_lval=$d_stdio_cnt_lval;; |
| 13540 | esac |
| 13541 | case "$stdio_base" in |
| 13542 | '') stdio_base='((fp)->_base)';; |
| 13543 | esac |
| 13544 | case "$stdio_bufsiz" in |
| 13545 | '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';; |
| 13546 | esac |
| 13547 | fi |
| 13548 | |
| 13549 | : test whether _ptr and _cnt really work |
| 13550 | echo "Checking how std your stdio is..." >&4 |
| 13551 | $cat >try.c <<EOP |
| 13552 | #include <stdio.h> |
| 13553 | #$i_stdlib I_STDLIB |
| 13554 | #ifdef I_STDLIB |
| 13555 | #include <stdlib.h> |
| 13556 | #endif |
| 13557 | #define FILE_ptr(fp) $stdio_ptr |
| 13558 | #define FILE_cnt(fp) $stdio_cnt |
| 13559 | int main() { |
| 13560 | FILE *fp = fopen("try.c", "r"); |
| 13561 | char c = getc(fp); |
| 13562 | if ( |
| 13563 | 18 <= FILE_cnt(fp) && |
| 13564 | strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0 |
| 13565 | ) |
| 13566 | exit(0); |
| 13567 | exit(1); |
| 13568 | } |
| 13569 | EOP |
| 13570 | val="$undef" |
| 13571 | set try |
| 13572 | if eval $compile && $to try.c; then |
| 13573 | if $run ./try; then |
| 13574 | echo "Your stdio acts pretty std." |
| 13575 | val="$define" |
| 13576 | else |
| 13577 | echo "Your stdio isn't very std." |
| 13578 | fi |
| 13579 | else |
| 13580 | echo "Your stdio doesn't appear very std." |
| 13581 | fi |
| 13582 | $rm_try |
| 13583 | |
| 13584 | # glibc 2.2.90 and above apparently change stdio streams so Perl's |
| 13585 | # direct buffer manipulation no longer works. The Configure tests |
| 13586 | # should be changed to correctly detect this, but until then, |
| 13587 | # the following check should at least let perl compile and run. |
| 13588 | # (This quick fix should be updated before 5.8.1.) |
| 13589 | # To be defensive, reject all unknown versions, and all versions > 2.2.9. |
| 13590 | # A. Dougherty, June 3, 2002. |
| 13591 | case "$d_gnulibc" in |
| 13592 | $define) |
| 13593 | case "$gnulibc_version" in |
| 13594 | 2.[01]*) ;; |
| 13595 | 2.2) ;; |
| 13596 | 2.2.[0-9]) ;; |
| 13597 | *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers." |
| 13598 | val="$undef" |
| 13599 | ;; |
| 13600 | esac |
| 13601 | ;; |
| 13602 | esac |
| 13603 | set d_stdstdio |
| 13604 | eval $setvar |
| 13605 | |
| 13606 | : Can _ptr be used as an lvalue? |
| 13607 | case "$d_stdstdio$ptr_lval" in |
| 13608 | $define$define) val=$define ;; |
| 13609 | *) val=$undef ;; |
| 13610 | esac |
| 13611 | set d_stdio_ptr_lval |
| 13612 | eval $setvar |
| 13613 | |
| 13614 | : Can _cnt be used as an lvalue? |
| 13615 | case "$d_stdstdio$cnt_lval" in |
| 13616 | $define$define) val=$define ;; |
| 13617 | *) val=$undef ;; |
| 13618 | esac |
| 13619 | set d_stdio_cnt_lval |
| 13620 | eval $setvar |
| 13621 | |
| 13622 | |
| 13623 | : test whether setting _ptr sets _cnt as a side effect |
| 13624 | d_stdio_ptr_lval_sets_cnt="$undef" |
| 13625 | d_stdio_ptr_lval_nochange_cnt="$undef" |
| 13626 | case "$d_stdio_ptr_lval$d_stdstdio" in |
| 13627 | $define$define) |
| 13628 | echo "Checking to see what happens if we set the stdio ptr..." >&4 |
| 13629 | $cat >try.c <<EOP |
| 13630 | #include <stdio.h> |
| 13631 | /* Can we scream? */ |
| 13632 | /* Eat dust sed :-) */ |
| 13633 | /* In the buffer space, no one can hear you scream. */ |
| 13634 | #$i_stdlib I_STDLIB |
| 13635 | #ifdef I_STDLIB |
| 13636 | #include <stdlib.h> |
| 13637 | #endif |
| 13638 | #define FILE_ptr(fp) $stdio_ptr |
| 13639 | #define FILE_cnt(fp) $stdio_cnt |
| 13640 | #include <sys/types.h> |
| 13641 | int main() { |
| 13642 | FILE *fp = fopen("try.c", "r"); |
| 13643 | int c; |
| 13644 | char *ptr; |
| 13645 | size_t cnt; |
| 13646 | if (!fp) { |
| 13647 | puts("Fail even to read"); |
| 13648 | exit(1); |
| 13649 | } |
| 13650 | c = getc(fp); /* Read away the first # */ |
| 13651 | if (c == EOF) { |
| 13652 | puts("Fail even to read"); |
| 13653 | exit(1); |
| 13654 | } |
| 13655 | if (!( |
| 13656 | 18 <= FILE_cnt(fp) && |
| 13657 | strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0 |
| 13658 | )) { |
| 13659 | puts("Fail even to read"); |
| 13660 | exit (1); |
| 13661 | } |
| 13662 | ptr = (char*) FILE_ptr(fp); |
| 13663 | cnt = (size_t)FILE_cnt(fp); |
| 13664 | |
| 13665 | FILE_ptr(fp) += 42; |
| 13666 | |
| 13667 | if ((char*)FILE_ptr(fp) != (ptr + 42)) { |
| 13668 | printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42)); |
| 13669 | exit (1); |
| 13670 | } |
| 13671 | if (FILE_cnt(fp) <= 20) { |
| 13672 | printf ("Fail (<20 chars to test)"); |
| 13673 | exit (1); |
| 13674 | } |
| 13675 | if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) { |
| 13676 | puts("Fail compare"); |
| 13677 | exit (1); |
| 13678 | } |
| 13679 | if (cnt == FILE_cnt(fp)) { |
| 13680 | puts("Pass_unchanged"); |
| 13681 | exit (0); |
| 13682 | } |
| 13683 | if (FILE_cnt(fp) == (cnt - 42)) { |
| 13684 | puts("Pass_changed"); |
| 13685 | exit (0); |
| 13686 | } |
| 13687 | printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp)); |
| 13688 | return 1; |
| 13689 | |
| 13690 | } |
| 13691 | EOP |
| 13692 | set try |
| 13693 | if eval $compile && $to try.c; then |
| 13694 | case `$run ./try` in |
| 13695 | Pass_changed) |
| 13696 | echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4 |
| 13697 | d_stdio_ptr_lval_sets_cnt="$define" ;; |
| 13698 | Pass_unchanged) |
| 13699 | echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4 |
| 13700 | d_stdio_ptr_lval_nochange_cnt="$define" ;; |
| 13701 | Fail*) |
| 13702 | echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;; |
| 13703 | *) |
| 13704 | echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;; |
| 13705 | esac |
| 13706 | else |
| 13707 | echo "It seems we can't set ptr in your stdio. Nevermind." >&4 |
| 13708 | fi |
| 13709 | $rm_try |
| 13710 | ;; |
| 13711 | esac |
| 13712 | |
| 13713 | : see if _base is also standard |
| 13714 | val="$undef" |
| 13715 | case "$d_stdstdio" in |
| 13716 | $define) |
| 13717 | $cat >try.c <<EOP |
| 13718 | #include <stdio.h> |
| 13719 | #$i_stdlib I_STDLIB |
| 13720 | #ifdef I_STDLIB |
| 13721 | #include <stdlib.h> |
| 13722 | #endif |
| 13723 | #define FILE_base(fp) $stdio_base |
| 13724 | #define FILE_bufsiz(fp) $stdio_bufsiz |
| 13725 | int main() { |
| 13726 | FILE *fp = fopen("try.c", "r"); |
| 13727 | char c = getc(fp); |
| 13728 | if ( |
| 13729 | 19 <= FILE_bufsiz(fp) && |
| 13730 | strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0 |
| 13731 | ) |
| 13732 | exit(0); |
| 13733 | exit(1); |
| 13734 | } |
| 13735 | EOP |
| 13736 | set try |
| 13737 | if eval $compile && $to try.c; then |
| 13738 | if $run ./try; then |
| 13739 | echo "And its _base field acts std." |
| 13740 | val="$define" |
| 13741 | else |
| 13742 | echo "But its _base field isn't std." |
| 13743 | fi |
| 13744 | else |
| 13745 | echo "However, it seems to be lacking the _base field." |
| 13746 | fi |
| 13747 | $rm_try |
| 13748 | ;; |
| 13749 | esac |
| 13750 | set d_stdiobase |
| 13751 | eval $setvar |
| 13752 | |
| 13753 | : see if fast_stdio exists |
| 13754 | val="$undef" |
| 13755 | case "$d_stdstdio:$d_stdio_ptr_lval" in |
| 13756 | "$define:$define") |
| 13757 | case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in |
| 13758 | *$define*) |
| 13759 | echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4 |
| 13760 | val="$define" |
| 13761 | ;; |
| 13762 | esac |
| 13763 | ;; |
| 13764 | esac |
| 13765 | set d_faststdio |
| 13766 | eval $setvar |
| 13767 | |
| 13768 | : see if fchdir exists |
| 13769 | set fchdir d_fchdir |
| 13770 | eval $inlibc |
| 13771 | |
| 13772 | : see if fchmod exists |
| 13773 | set fchmod d_fchmod |
| 13774 | eval $inlibc |
| 13775 | |
| 13776 | : check for openat, unlinkat, renameat, linkat, fchmodat |
| 13777 | set openat d_openat |
| 13778 | eval $inlibc |
| 13779 | |
| 13780 | set unlinkat d_unlinkat |
| 13781 | eval $inlibc |
| 13782 | |
| 13783 | set renameat d_renameat |
| 13784 | eval $inlibc |
| 13785 | |
| 13786 | set linkat d_linkat |
| 13787 | eval $inlibc |
| 13788 | |
| 13789 | set fchmodat d_fchmodat |
| 13790 | eval $inlibc |
| 13791 | |
| 13792 | : see if fchown exists |
| 13793 | set fchown d_fchown |
| 13794 | eval $inlibc |
| 13795 | |
| 13796 | : see if this is an fcntl system |
| 13797 | set fcntl d_fcntl |
| 13798 | eval $inlibc |
| 13799 | |
| 13800 | : See if fcntl-based locking works. |
| 13801 | echo " " |
| 13802 | $cat >try.c <<EOCP |
| 13803 | #$i_stdlib I_STDLIB |
| 13804 | #ifdef I_STDLIB |
| 13805 | #include <stdlib.h> |
| 13806 | #endif |
| 13807 | #include <unistd.h> |
| 13808 | #include <fcntl.h> |
| 13809 | #include <signal.h> |
| 13810 | $signal_t blech(int x) { exit(3); } |
| 13811 | int main() { |
| 13812 | #if defined(F_SETLK) && defined(F_SETLKW) |
| 13813 | struct flock flock; |
| 13814 | int retval, fd; |
| 13815 | fd = open("try.c", O_RDONLY); |
| 13816 | flock.l_type = F_RDLCK; |
| 13817 | flock.l_whence = SEEK_SET; |
| 13818 | flock.l_start = flock.l_len = 0; |
| 13819 | signal(SIGALRM, blech); |
| 13820 | alarm(10); |
| 13821 | retval = fcntl(fd, F_SETLK, &flock); |
| 13822 | close(fd); |
| 13823 | (retval < 0 ? exit(2) : exit(0)); |
| 13824 | #else |
| 13825 | exit(2); |
| 13826 | #endif |
| 13827 | } |
| 13828 | EOCP |
| 13829 | echo "Checking if fcntl-based file locking works... " |
| 13830 | case "$d_fcntl" in |
| 13831 | "$define") |
| 13832 | set try |
| 13833 | if eval $compile_ok; then |
| 13834 | if $run ./try; then |
| 13835 | echo "Yes, it seems to work." |
| 13836 | val="$define" |
| 13837 | else |
| 13838 | echo "Nope, it didn't work." |
| 13839 | val="$undef" |
| 13840 | case "$?" in |
| 13841 | 3) $cat >&4 <<EOM |
| 13842 | *** |
| 13843 | *** I had to forcibly timeout from fcntl(..., F_SETLK, ...). |
| 13844 | *** This is (almost) impossible. |
| 13845 | *** If your NFS lock daemons are not feeling well, something like |
| 13846 | *** this may happen, please investigate. Cannot continue, aborting. |
| 13847 | *** |
| 13848 | EOM |
| 13849 | exit 1 |
| 13850 | ;; |
| 13851 | esac |
| 13852 | fi |
| 13853 | else |
| 13854 | echo "I'm unable to compile the test program, so I'll assume not." |
| 13855 | val="$undef" |
| 13856 | fi |
| 13857 | ;; |
| 13858 | *) val="$undef"; |
| 13859 | echo "Nope, since you don't even have fcntl()." |
| 13860 | ;; |
| 13861 | esac |
| 13862 | set d_fcntl_can_lock |
| 13863 | eval $setvar |
| 13864 | $rm_try |
| 13865 | |
| 13866 | : check for fd_set items |
| 13867 | $cat <<EOM |
| 13868 | |
| 13869 | Checking to see how well your C compiler handles fd_set and friends ... |
| 13870 | EOM |
| 13871 | $cat >try.c <<EOCP |
| 13872 | #$i_stdlib I_STDLIB |
| 13873 | #ifdef I_STDLIB |
| 13874 | #include <stdlib.h> |
| 13875 | #endif |
| 13876 | #$i_systime I_SYS_TIME |
| 13877 | #$i_sysselct I_SYS_SELECT |
| 13878 | #$d_socket HAS_SOCKET |
| 13879 | #include <sys/types.h> |
| 13880 | #ifdef HAS_SOCKET |
| 13881 | #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ |
| 13882 | #endif |
| 13883 | #ifdef I_SYS_TIME |
| 13884 | #include <sys/time.h> |
| 13885 | #endif |
| 13886 | #ifdef I_SYS_SELECT |
| 13887 | #include <sys/select.h> |
| 13888 | #endif |
| 13889 | int main() { |
| 13890 | fd_set fds; |
| 13891 | |
| 13892 | #ifdef TRYBITS |
| 13893 | if(fds.fds_bits); |
| 13894 | #endif |
| 13895 | |
| 13896 | #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO) |
| 13897 | exit(0); |
| 13898 | #else |
| 13899 | exit(1); |
| 13900 | #endif |
| 13901 | } |
| 13902 | EOCP |
| 13903 | set try -DTRYBITS |
| 13904 | if eval $compile; then |
| 13905 | d_fds_bits="$define" |
| 13906 | d_fd_set="$define" |
| 13907 | echo "Well, your system knows about the normal fd_set typedef..." >&4 |
| 13908 | if $run ./try; then |
| 13909 | echo "and you have the normal fd_set macros (just as I'd expect)." >&4 |
| 13910 | d_fd_macros="$define" |
| 13911 | else |
| 13912 | $cat >&4 <<'EOM' |
| 13913 | but not the normal fd_set macros! Gaaack! I'll have to cover for you. |
| 13914 | EOM |
| 13915 | d_fd_macros="$undef" |
| 13916 | fi |
| 13917 | else |
| 13918 | $cat <<'EOM' |
| 13919 | Hmm, your compiler has some difficulty with fd_set. Checking further... |
| 13920 | EOM |
| 13921 | set try |
| 13922 | if eval $compile; then |
| 13923 | d_fds_bits="$undef" |
| 13924 | d_fd_set="$define" |
| 13925 | echo "Well, your system has some sort of fd_set available..." >&4 |
| 13926 | if $run ./try; then |
| 13927 | echo "and you have the normal fd_set macros." >&4 |
| 13928 | d_fd_macros="$define" |
| 13929 | else |
| 13930 | $cat <<'EOM' |
| 13931 | but not the normal fd_set macros! Gross! More work for me... |
| 13932 | EOM |
| 13933 | d_fd_macros="$undef" |
| 13934 | fi |
| 13935 | else |
| 13936 | echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4 |
| 13937 | d_fd_set="$undef" |
| 13938 | d_fds_bits="$undef" |
| 13939 | d_fd_macros="$undef" |
| 13940 | fi |
| 13941 | fi |
| 13942 | $rm_try |
| 13943 | |
| 13944 | : see if fdclose exists |
| 13945 | set fdclose d_fdclose |
| 13946 | eval $inlibc |
| 13947 | |
| 13948 | : see if fdim exists |
| 13949 | set fdim d_fdim |
| 13950 | eval $inlibc |
| 13951 | |
| 13952 | : see if fegetround exists |
| 13953 | set fegetround d_fegetround |
| 13954 | eval $inlibc |
| 13955 | |
| 13956 | : see if fgetpos exists |
| 13957 | set fgetpos d_fgetpos |
| 13958 | eval $inlibc |
| 13959 | |
| 13960 | : see if finite exists |
| 13961 | set finite d_finite |
| 13962 | eval $inlibc |
| 13963 | |
| 13964 | : see if finitel exists |
| 13965 | set finitel d_finitel |
| 13966 | eval $inlibc |
| 13967 | |
| 13968 | : see if flock exists |
| 13969 | set flock d_flock |
| 13970 | eval $inlibc |
| 13971 | |
| 13972 | : see if prototype for flock is available |
| 13973 | echo " " |
| 13974 | set d_flockproto flock $i_sysfile sys/file.h |
| 13975 | eval $hasproto |
| 13976 | |
| 13977 | : see if fma exists |
| 13978 | set fma d_fma |
| 13979 | eval $inlibc |
| 13980 | |
| 13981 | : see if fmax exists |
| 13982 | set fmax d_fmax |
| 13983 | eval $inlibc |
| 13984 | |
| 13985 | : see if fmin exists |
| 13986 | set fmin d_fmin |
| 13987 | eval $inlibc |
| 13988 | |
| 13989 | : see if fp_class exists |
| 13990 | set fp_class d_fp_class |
| 13991 | eval $inlibc |
| 13992 | |
| 13993 | : check for fpclassify |
| 13994 | echo "Checking to see if you have fpclassify..." >&4 |
| 13995 | $cat >try.c <<EOCP |
| 13996 | #include <math.h> |
| 13997 | int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; } |
| 13998 | EOCP |
| 13999 | set try |
| 14000 | if eval $compile; then |
| 14001 | val="$define" |
| 14002 | echo "You have fpclassify." |
| 14003 | else |
| 14004 | val="$undef" |
| 14005 | echo "You do not have fpclassify." |
| 14006 | fi |
| 14007 | $rm_try |
| 14008 | set d_fpclassify |
| 14009 | eval $setvar |
| 14010 | |
| 14011 | : see if fp_classify exists |
| 14012 | set fp_classify d_fp_classify |
| 14013 | eval $inlibc |
| 14014 | |
| 14015 | : see if fp_classl exists |
| 14016 | set fp_classl d_fp_classl |
| 14017 | eval $inlibc |
| 14018 | |
| 14019 | : see if pathconf exists |
| 14020 | set pathconf d_pathconf |
| 14021 | eval $inlibc |
| 14022 | |
| 14023 | : see if fpathconf exists |
| 14024 | set fpathconf d_fpathconf |
| 14025 | eval $inlibc |
| 14026 | |
| 14027 | : see if fpclass exists |
| 14028 | set fpclass d_fpclass |
| 14029 | eval $inlibc |
| 14030 | |
| 14031 | : see if fpclassl exists |
| 14032 | set fpclassl d_fpclassl |
| 14033 | eval $inlibc |
| 14034 | |
| 14035 | : see if fpgetround exists |
| 14036 | set fpgetround d_fpgetround |
| 14037 | eval $inlibc |
| 14038 | |
| 14039 | : check for fpos64_t |
| 14040 | echo " " |
| 14041 | echo "Checking to see if you have fpos64_t..." >&4 |
| 14042 | $cat >try.c <<EOCP |
| 14043 | #include <stdio.h> |
| 14044 | int main() { fpos64_t x = 7; } |
| 14045 | EOCP |
| 14046 | set try |
| 14047 | if eval $compile; then |
| 14048 | val="$define" |
| 14049 | echo "You have fpos64_t." |
| 14050 | else |
| 14051 | val="$undef" |
| 14052 | echo "You do not have fpos64_t." |
| 14053 | case "$fpossize" in |
| 14054 | 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;; |
| 14055 | esac |
| 14056 | fi |
| 14057 | $rm_try |
| 14058 | set d_fpos64_t |
| 14059 | eval $setvar |
| 14060 | |
| 14061 | : see if frexpl exists |
| 14062 | set frexpl d_frexpl |
| 14063 | eval $inlibc |
| 14064 | |
| 14065 | : see if this is a sys/param system |
| 14066 | set sys/param.h i_sysparam |
| 14067 | eval $inhdr |
| 14068 | |
| 14069 | : see if this is a sys/mount.h system |
| 14070 | set sys/mount.h i_sysmount |
| 14071 | eval $inhdr |
| 14072 | |
| 14073 | : Check for fs_data_s |
| 14074 | echo " " |
| 14075 | echo "Checking to see if your system supports struct fs_data..." >&4 |
| 14076 | set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h |
| 14077 | eval $hasstruct |
| 14078 | case "$d_fs_data_s" in |
| 14079 | "$define") echo "Yes, it does." ;; |
| 14080 | *) echo "No, it doesn't." ;; |
| 14081 | esac |
| 14082 | |
| 14083 | : see if fseeko exists |
| 14084 | set fseeko d_fseeko |
| 14085 | eval $inlibc |
| 14086 | case "$longsize" in |
| 14087 | 8) echo "(Your long is 64 bits, so you could use fseek.)" ;; |
| 14088 | esac |
| 14089 | |
| 14090 | : see if fsetpos exists |
| 14091 | set fsetpos d_fsetpos |
| 14092 | eval $inlibc |
| 14093 | |
| 14094 | : see if fstatfs exists |
| 14095 | set fstatfs d_fstatfs |
| 14096 | eval $inlibc |
| 14097 | |
| 14098 | : see if statvfs exists |
| 14099 | set statvfs d_statvfs |
| 14100 | eval $inlibc |
| 14101 | |
| 14102 | : see if fstatvfs exists |
| 14103 | set fstatvfs d_fstatvfs |
| 14104 | eval $inlibc |
| 14105 | |
| 14106 | : see if fsync exists |
| 14107 | set fsync d_fsync |
| 14108 | eval $inlibc |
| 14109 | |
| 14110 | : see if ftello exists |
| 14111 | set ftello d_ftello |
| 14112 | eval $inlibc |
| 14113 | case "$longsize" in |
| 14114 | 8) echo "(Your long is 64 bits, so you could use ftell.)" ;; |
| 14115 | esac |
| 14116 | |
| 14117 | : check for a working futimes |
| 14118 | d_futimes="$undef" |
| 14119 | echo " " |
| 14120 | echo "Checking if you have a working futimes()" >&4 |
| 14121 | $cat >try.c <<EOCP |
| 14122 | #include <stdio.h> |
| 14123 | #include <stdlib.h> |
| 14124 | #include <sys/time.h> |
| 14125 | #include <errno.h> |
| 14126 | #include <fcntl.h> |
| 14127 | #include <stdlib.h> |
| 14128 | |
| 14129 | int main () |
| 14130 | { |
| 14131 | int fd, rv; |
| 14132 | fd = open ("try.c", O_RDWR); |
| 14133 | if (-1 == fd) exit (1); |
| 14134 | rv = futimes (fd, NULL); |
| 14135 | exit (rv == -1 ? errno : 0); |
| 14136 | } |
| 14137 | EOCP |
| 14138 | set try |
| 14139 | if eval $compile; then |
| 14140 | `$run ./try` |
| 14141 | rc=$? |
| 14142 | case "$rc" in |
| 14143 | 0) echo "Yes, you have" >&4 |
| 14144 | d_futimes="$define" |
| 14145 | ;; |
| 14146 | *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4 |
| 14147 | ;; |
| 14148 | esac |
| 14149 | else |
| 14150 | echo "No, it does not (probably harmless)" >&4 |
| 14151 | fi |
| 14152 | $rm_try |
| 14153 | |
| 14154 | : look for gai_strerror |
| 14155 | echo " " |
| 14156 | $cat >try.c <<'EOCP' |
| 14157 | #include <sys/types.h> |
| 14158 | #include <sys/socket.h> |
| 14159 | #include <netdb.h> |
| 14160 | int main () |
| 14161 | { |
| 14162 | return (gai_strerror (0) ? 0 : 1); |
| 14163 | } |
| 14164 | EOCP |
| 14165 | set try |
| 14166 | val="$undef" |
| 14167 | if eval $compile; then |
| 14168 | `$run ./try` |
| 14169 | case "$?" in |
| 14170 | 0) echo "A working gai_strerror() found." >&4 |
| 14171 | val="$define" ;; |
| 14172 | *) echo "gai_strerror() found, but it doesn't work" >&4 |
| 14173 | ;; |
| 14174 | esac |
| 14175 | else |
| 14176 | echo "gai_strerror() NOT found." >&4 |
| 14177 | fi |
| 14178 | set d_gai_strerror |
| 14179 | eval $setvar |
| 14180 | $rm_try |
| 14181 | |
| 14182 | : see if ndbm.h is available |
| 14183 | set ndbm.h i_ndbm |
| 14184 | eval $inhdr |
| 14185 | : Compatibility location for RedHat 7.1 |
| 14186 | set gdbm/ndbm.h i_gdbmndbm |
| 14187 | eval $inhdr |
| 14188 | : Compatibility location for Debian 4.0 |
| 14189 | set gdbm-ndbm.h i_gdbm_ndbm |
| 14190 | eval $inhdr |
| 14191 | |
| 14192 | val="$undef" |
| 14193 | if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then |
| 14194 | : see if dbm_open exists |
| 14195 | set dbm_open d_dbm_open |
| 14196 | eval $inlibc |
| 14197 | case "$d_dbm_open" in |
| 14198 | $undef) |
| 14199 | i_ndbm="$undef" |
| 14200 | i_gdbmndbm="$undef" |
| 14201 | i_gdbm_ndbm="$undef" |
| 14202 | echo "We won't be including <ndbm.h>" |
| 14203 | val="$undef" |
| 14204 | ;; |
| 14205 | *) val="$define" |
| 14206 | ;; |
| 14207 | esac |
| 14208 | fi |
| 14209 | set d_ndbm |
| 14210 | eval $setvar |
| 14211 | |
| 14212 | ndbm_hdr_protochk='name=$1; hdr=$2; |
| 14213 | eval "ihdr=\$""i_$name"; |
| 14214 | val="$undef"; |
| 14215 | if $test "$ihdr" = "$define"; then |
| 14216 | $echo "Checking if your <$hdr> uses prototypes..." >&4; |
| 14217 | case "$d_cplusplus" in |
| 14218 | $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;; |
| 14219 | *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;; |
| 14220 | esac; |
| 14221 | case "$val" in |
| 14222 | $define) $echo "Your <$hdr> seems to have prototypes";; |
| 14223 | *) $echo "Your <$hdr> does not seem to have prototypes";; |
| 14224 | esac; |
| 14225 | fi; |
| 14226 | set "d_${name}_h_uses_prototypes"; |
| 14227 | eval $setvar' |
| 14228 | |
| 14229 | set ndbm ndbm.h |
| 14230 | eval $ndbm_hdr_protochk |
| 14231 | set gdbmndbm gdbm/ndbm.h |
| 14232 | eval $ndbm_hdr_protochk |
| 14233 | set gdbm_ndbm gdbm-ndbm.h |
| 14234 | eval $ndbm_hdr_protochk |
| 14235 | |
| 14236 | : see if getaddrinfo exists |
| 14237 | set getaddrinfo d_getaddrinfo |
| 14238 | eval $inlibc |
| 14239 | |
| 14240 | : see if getcwd exists |
| 14241 | set getcwd d_getcwd |
| 14242 | eval $inlibc |
| 14243 | |
| 14244 | : see if getespwnam exists |
| 14245 | set getespwnam d_getespwnam |
| 14246 | eval $inlibc |
| 14247 | |
| 14248 | : see if getfsstat exists |
| 14249 | set getfsstat d_getfsstat |
| 14250 | eval $inlibc |
| 14251 | |
| 14252 | : see if getgrent exists |
| 14253 | set getgrent d_getgrent |
| 14254 | eval $inlibc |
| 14255 | |
| 14256 | : see if getgrent_r exists |
| 14257 | set getgrent_r d_getgrent_r |
| 14258 | eval $inlibc |
| 14259 | case "$d_getgrent_r" in |
| 14260 | "$define") |
| 14261 | hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h" |
| 14262 | case "$d_getgrent_r_proto:$usethreads" in |
| 14263 | ":define") d_getgrent_r_proto=define |
| 14264 | set d_getgrent_r_proto getgrent_r $hdrs |
| 14265 | eval $hasproto ;; |
| 14266 | *) ;; |
| 14267 | esac |
| 14268 | case "$d_getgrent_r_proto" in |
| 14269 | define) |
| 14270 | case "$getgrent_r_proto" in |
| 14271 | ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);' |
| 14272 | ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;; |
| 14273 | esac |
| 14274 | case "$getgrent_r_proto" in |
| 14275 | ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);' |
| 14276 | ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;; |
| 14277 | esac |
| 14278 | case "$getgrent_r_proto" in |
| 14279 | ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);' |
| 14280 | ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;; |
| 14281 | esac |
| 14282 | case "$getgrent_r_proto" in |
| 14283 | ''|0) try='struct group* getgrent_r(struct group*, char*, int);' |
| 14284 | ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;; |
| 14285 | esac |
| 14286 | case "$getgrent_r_proto" in |
| 14287 | ''|0) try='int getgrent_r(struct group*, char*, int);' |
| 14288 | ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;; |
| 14289 | esac |
| 14290 | case "$getgrent_r_proto" in |
| 14291 | ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);' |
| 14292 | ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;; |
| 14293 | esac |
| 14294 | case "$getgrent_r_proto" in |
| 14295 | ''|0) d_getgrent_r=undef |
| 14296 | getgrent_r_proto=0 |
| 14297 | echo "Disabling getgrent_r, cannot determine prototype." >&4 ;; |
| 14298 | * ) case "$getgrent_r_proto" in |
| 14299 | REENTRANT_PROTO*) ;; |
| 14300 | *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;; |
| 14301 | esac |
| 14302 | echo "Prototype: $try" ;; |
| 14303 | esac |
| 14304 | ;; |
| 14305 | *) case "$usethreads" in |
| 14306 | define) echo "getgrent_r has no prototype, not using it." >&4 ;; |
| 14307 | esac |
| 14308 | d_getgrent_r=undef |
| 14309 | getgrent_r_proto=0 |
| 14310 | ;; |
| 14311 | esac |
| 14312 | ;; |
| 14313 | *) getgrent_r_proto=0 |
| 14314 | ;; |
| 14315 | esac |
| 14316 | |
| 14317 | : see if getgrgid_r exists |
| 14318 | set getgrgid_r d_getgrgid_r |
| 14319 | eval $inlibc |
| 14320 | case "$d_getgrgid_r" in |
| 14321 | "$define") |
| 14322 | hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h" |
| 14323 | case "$d_getgrgid_r_proto:$usethreads" in |
| 14324 | ":define") d_getgrgid_r_proto=define |
| 14325 | set d_getgrgid_r_proto getgrgid_r $hdrs |
| 14326 | eval $hasproto ;; |
| 14327 | *) ;; |
| 14328 | esac |
| 14329 | case "$d_getgrgid_r_proto" in |
| 14330 | define) |
| 14331 | case "$getgrgid_r_proto" in |
| 14332 | ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);' |
| 14333 | ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;; |
| 14334 | esac |
| 14335 | case "$getgrgid_r_proto" in |
| 14336 | ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);' |
| 14337 | ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;; |
| 14338 | esac |
| 14339 | case "$getgrgid_r_proto" in |
| 14340 | ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);' |
| 14341 | ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;; |
| 14342 | esac |
| 14343 | case "$getgrgid_r_proto" in |
| 14344 | ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);' |
| 14345 | ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;; |
| 14346 | esac |
| 14347 | case "$getgrgid_r_proto" in |
| 14348 | ''|0) d_getgrgid_r=undef |
| 14349 | getgrgid_r_proto=0 |
| 14350 | echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;; |
| 14351 | * ) case "$getgrgid_r_proto" in |
| 14352 | REENTRANT_PROTO*) ;; |
| 14353 | *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;; |
| 14354 | esac |
| 14355 | echo "Prototype: $try" ;; |
| 14356 | esac |
| 14357 | ;; |
| 14358 | *) case "$usethreads" in |
| 14359 | define) echo "getgrgid_r has no prototype, not using it." >&4 ;; |
| 14360 | esac |
| 14361 | d_getgrgid_r=undef |
| 14362 | getgrgid_r_proto=0 |
| 14363 | ;; |
| 14364 | esac |
| 14365 | ;; |
| 14366 | *) getgrgid_r_proto=0 |
| 14367 | ;; |
| 14368 | esac |
| 14369 | |
| 14370 | : see if getgrnam_r exists |
| 14371 | set getgrnam_r d_getgrnam_r |
| 14372 | eval $inlibc |
| 14373 | case "$d_getgrnam_r" in |
| 14374 | "$define") |
| 14375 | hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h" |
| 14376 | case "$d_getgrnam_r_proto:$usethreads" in |
| 14377 | ":define") d_getgrnam_r_proto=define |
| 14378 | set d_getgrnam_r_proto getgrnam_r $hdrs |
| 14379 | eval $hasproto ;; |
| 14380 | *) ;; |
| 14381 | esac |
| 14382 | case "$d_getgrnam_r_proto" in |
| 14383 | define) |
| 14384 | case "$getgrnam_r_proto" in |
| 14385 | ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);' |
| 14386 | ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;; |
| 14387 | esac |
| 14388 | case "$getgrnam_r_proto" in |
| 14389 | ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);' |
| 14390 | ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;; |
| 14391 | esac |
| 14392 | case "$getgrnam_r_proto" in |
| 14393 | ''|0) try='struct group* getgrnam_r(const char*, char*, int);' |
| 14394 | ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;; |
| 14395 | esac |
| 14396 | case "$getgrnam_r_proto" in |
| 14397 | ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);' |
| 14398 | ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;; |
| 14399 | esac |
| 14400 | case "$getgrnam_r_proto" in |
| 14401 | ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);' |
| 14402 | ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;; |
| 14403 | esac |
| 14404 | case "$getgrnam_r_proto" in |
| 14405 | ''|0) d_getgrnam_r=undef |
| 14406 | getgrnam_r_proto=0 |
| 14407 | echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;; |
| 14408 | * ) case "$getgrnam_r_proto" in |
| 14409 | REENTRANT_PROTO*) ;; |
| 14410 | *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;; |
| 14411 | esac |
| 14412 | echo "Prototype: $try" ;; |
| 14413 | esac |
| 14414 | ;; |
| 14415 | *) case "$usethreads" in |
| 14416 | define) echo "getgrnam_r has no prototype, not using it." >&4 ;; |
| 14417 | esac |
| 14418 | d_getgrnam_r=undef |
| 14419 | getgrnam_r_proto=0 |
| 14420 | ;; |
| 14421 | esac |
| 14422 | ;; |
| 14423 | *) getgrnam_r_proto=0 |
| 14424 | ;; |
| 14425 | esac |
| 14426 | |
| 14427 | : see if gethostbyaddr exists |
| 14428 | set gethostbyaddr d_gethbyaddr |
| 14429 | eval $inlibc |
| 14430 | |
| 14431 | : see if gethostbyname exists |
| 14432 | set gethostbyname d_gethbyname |
| 14433 | eval $inlibc |
| 14434 | |
| 14435 | : see if gethostent exists |
| 14436 | set gethostent d_gethent |
| 14437 | eval $inlibc |
| 14438 | |
| 14439 | : see how we will look up host name |
| 14440 | echo " " |
| 14441 | call='' |
| 14442 | if set gethostname val -f d_gethname; eval $csym; $val; then |
| 14443 | echo 'gethostname() found.' >&4 |
| 14444 | d_gethname="$define" |
| 14445 | call=gethostname |
| 14446 | fi |
| 14447 | if set uname val -f d_uname; eval $csym; $val; then |
| 14448 | if ./xenix; then |
| 14449 | $cat <<'EOM' |
| 14450 | uname() was found, but you're running xenix, and older versions of xenix |
| 14451 | have a broken uname(). If you don't really know whether your xenix is old |
| 14452 | enough to have a broken system call, use the default answer. |
| 14453 | |
| 14454 | EOM |
| 14455 | dflt=y |
| 14456 | case "$d_uname" in |
| 14457 | "$define") dflt=n;; |
| 14458 | esac |
| 14459 | rp='Is your uname() broken?' |
| 14460 | . ./myread |
| 14461 | case "$ans" in |
| 14462 | n*) d_uname="$define"; call=uname;; |
| 14463 | esac |
| 14464 | else |
| 14465 | echo 'uname() found.' >&4 |
| 14466 | d_uname="$define" |
| 14467 | case "$call" in |
| 14468 | '') call=uname ;; |
| 14469 | esac |
| 14470 | fi |
| 14471 | fi |
| 14472 | case "$d_gethname" in |
| 14473 | '') d_gethname="$undef";; |
| 14474 | esac |
| 14475 | case "$d_uname" in |
| 14476 | '') d_uname="$undef";; |
| 14477 | esac |
| 14478 | case "$d_uname$d_gethname" in |
| 14479 | *define*) |
| 14480 | dflt=n |
| 14481 | cat <<EOM |
| 14482 | |
| 14483 | Every now and then someone has a $call() that lies about the hostname |
| 14484 | but can't be fixed for political or economic reasons. If you wish, I can |
| 14485 | pretend $call() isn't there and maybe compute hostname at run-time |
| 14486 | thanks to the '$phostname' command. |
| 14487 | |
| 14488 | EOM |
| 14489 | rp="Shall I ignore $call() from now on?" |
| 14490 | . ./myread |
| 14491 | case "$ans" in |
| 14492 | y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";; |
| 14493 | esac;; |
| 14494 | esac |
| 14495 | case "$phostname" in |
| 14496 | '') aphostname='';; |
| 14497 | *) case "$aphostname" in |
| 14498 | /*) ;; |
| 14499 | *) set X $phostname |
| 14500 | shift |
| 14501 | file=$1 |
| 14502 | shift |
| 14503 | file=`./loc $file $file $pth` |
| 14504 | aphostname=`echo $file $*` |
| 14505 | ;; |
| 14506 | esac |
| 14507 | ;; |
| 14508 | esac |
| 14509 | case "$d_uname$d_gethname" in |
| 14510 | *define*) ;; |
| 14511 | *) |
| 14512 | case "$phostname" in |
| 14513 | '') |
| 14514 | echo "There will be no way for $package to get your hostname." >&4;; |
| 14515 | *) |
| 14516 | echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4 |
| 14517 | ;; |
| 14518 | esac;; |
| 14519 | esac |
| 14520 | case "$d_phostname" in |
| 14521 | '') d_phostname="$undef";; |
| 14522 | esac |
| 14523 | |
| 14524 | : see if gethostbyaddr_r exists |
| 14525 | set gethostbyaddr_r d_gethostbyaddr_r |
| 14526 | eval $inlibc |
| 14527 | case "$d_gethostbyaddr_r" in |
| 14528 | "$define") |
| 14529 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 14530 | case "$d_gethostbyaddr_r_proto:$usethreads" in |
| 14531 | ":define") d_gethostbyaddr_r_proto=define |
| 14532 | set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs |
| 14533 | eval $hasproto ;; |
| 14534 | *) ;; |
| 14535 | esac |
| 14536 | case "$d_gethostbyaddr_r_proto" in |
| 14537 | define) |
| 14538 | case "$gethostbyaddr_r_proto" in |
| 14539 | ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);' |
| 14540 | ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;; |
| 14541 | esac |
| 14542 | case "$gethostbyaddr_r_proto" in |
| 14543 | ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);' |
| 14544 | ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;; |
| 14545 | esac |
| 14546 | case "$gethostbyaddr_r_proto" in |
| 14547 | ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);' |
| 14548 | ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;; |
| 14549 | esac |
| 14550 | case "$gethostbyaddr_r_proto" in |
| 14551 | ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);' |
| 14552 | ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;; |
| 14553 | esac |
| 14554 | case "$gethostbyaddr_r_proto" in |
| 14555 | ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);' |
| 14556 | ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;; |
| 14557 | esac |
| 14558 | case "$gethostbyaddr_r_proto" in |
| 14559 | ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);' |
| 14560 | ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;; |
| 14561 | esac |
| 14562 | case "$gethostbyaddr_r_proto" in |
| 14563 | ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);' |
| 14564 | ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;; |
| 14565 | esac |
| 14566 | case "$gethostbyaddr_r_proto" in |
| 14567 | ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);' |
| 14568 | ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;; |
| 14569 | esac |
| 14570 | case "$gethostbyaddr_r_proto" in |
| 14571 | ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);' |
| 14572 | ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;; |
| 14573 | esac |
| 14574 | case "$gethostbyaddr_r_proto" in |
| 14575 | ''|0) try='int gethostbyaddr_r(const char*, int, int);' |
| 14576 | ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;; |
| 14577 | esac |
| 14578 | case "$gethostbyaddr_r_proto" in |
| 14579 | ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);' |
| 14580 | ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;; |
| 14581 | esac |
| 14582 | case "$gethostbyaddr_r_proto" in |
| 14583 | ''|0) d_gethostbyaddr_r=undef |
| 14584 | gethostbyaddr_r_proto=0 |
| 14585 | echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;; |
| 14586 | * ) case "$gethostbyaddr_r_proto" in |
| 14587 | REENTRANT_PROTO*) ;; |
| 14588 | *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;; |
| 14589 | esac |
| 14590 | echo "Prototype: $try" ;; |
| 14591 | esac |
| 14592 | ;; |
| 14593 | *) case "$usethreads" in |
| 14594 | define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;; |
| 14595 | esac |
| 14596 | d_gethostbyaddr_r=undef |
| 14597 | gethostbyaddr_r_proto=0 |
| 14598 | ;; |
| 14599 | esac |
| 14600 | ;; |
| 14601 | *) gethostbyaddr_r_proto=0 |
| 14602 | ;; |
| 14603 | esac |
| 14604 | |
| 14605 | : see if gethostbyname_r exists |
| 14606 | set gethostbyname_r d_gethostbyname_r |
| 14607 | eval $inlibc |
| 14608 | case "$d_gethostbyname_r" in |
| 14609 | "$define") |
| 14610 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 14611 | case "$d_gethostbyname_r_proto:$usethreads" in |
| 14612 | ":define") d_gethostbyname_r_proto=define |
| 14613 | set d_gethostbyname_r_proto gethostbyname_r $hdrs |
| 14614 | eval $hasproto ;; |
| 14615 | *) ;; |
| 14616 | esac |
| 14617 | case "$d_gethostbyname_r_proto" in |
| 14618 | define) |
| 14619 | case "$gethostbyname_r_proto" in |
| 14620 | ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);' |
| 14621 | ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;; |
| 14622 | esac |
| 14623 | case "$gethostbyname_r_proto" in |
| 14624 | ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);' |
| 14625 | ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;; |
| 14626 | esac |
| 14627 | case "$gethostbyname_r_proto" in |
| 14628 | ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);' |
| 14629 | ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;; |
| 14630 | esac |
| 14631 | case "$gethostbyname_r_proto" in |
| 14632 | ''|0) d_gethostbyname_r=undef |
| 14633 | gethostbyname_r_proto=0 |
| 14634 | echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;; |
| 14635 | * ) case "$gethostbyname_r_proto" in |
| 14636 | REENTRANT_PROTO*) ;; |
| 14637 | *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;; |
| 14638 | esac |
| 14639 | echo "Prototype: $try" ;; |
| 14640 | esac |
| 14641 | ;; |
| 14642 | *) case "$usethreads" in |
| 14643 | define) echo "gethostbyname_r has no prototype, not using it." >&4 ;; |
| 14644 | esac |
| 14645 | d_gethostbyname_r=undef |
| 14646 | gethostbyname_r_proto=0 |
| 14647 | ;; |
| 14648 | esac |
| 14649 | ;; |
| 14650 | *) gethostbyname_r_proto=0 |
| 14651 | ;; |
| 14652 | esac |
| 14653 | |
| 14654 | : see if gethostent_r exists |
| 14655 | set gethostent_r d_gethostent_r |
| 14656 | eval $inlibc |
| 14657 | case "$d_gethostent_r" in |
| 14658 | "$define") |
| 14659 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 14660 | case "$d_gethostent_r_proto:$usethreads" in |
| 14661 | ":define") d_gethostent_r_proto=define |
| 14662 | set d_gethostent_r_proto gethostent_r $hdrs |
| 14663 | eval $hasproto ;; |
| 14664 | *) ;; |
| 14665 | esac |
| 14666 | case "$d_gethostent_r_proto" in |
| 14667 | define) |
| 14668 | case "$gethostent_r_proto" in |
| 14669 | ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);' |
| 14670 | ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;; |
| 14671 | esac |
| 14672 | case "$gethostent_r_proto" in |
| 14673 | ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);' |
| 14674 | ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;; |
| 14675 | esac |
| 14676 | case "$gethostent_r_proto" in |
| 14677 | ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);' |
| 14678 | ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;; |
| 14679 | esac |
| 14680 | case "$gethostent_r_proto" in |
| 14681 | ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);' |
| 14682 | ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;; |
| 14683 | esac |
| 14684 | case "$gethostent_r_proto" in |
| 14685 | ''|0) try='int gethostent_r(struct hostent*, char*, int);' |
| 14686 | ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;; |
| 14687 | esac |
| 14688 | case "$gethostent_r_proto" in |
| 14689 | ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);' |
| 14690 | ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;; |
| 14691 | esac |
| 14692 | case "$gethostent_r_proto" in |
| 14693 | ''|0) d_gethostent_r=undef |
| 14694 | gethostent_r_proto=0 |
| 14695 | echo "Disabling gethostent_r, cannot determine prototype." >&4 ;; |
| 14696 | * ) case "$gethostent_r_proto" in |
| 14697 | REENTRANT_PROTO*) ;; |
| 14698 | *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;; |
| 14699 | esac |
| 14700 | echo "Prototype: $try" ;; |
| 14701 | esac |
| 14702 | ;; |
| 14703 | *) case "$usethreads" in |
| 14704 | define) echo "gethostent_r has no prototype, not using it." >&4 ;; |
| 14705 | esac |
| 14706 | d_gethostent_r=undef |
| 14707 | gethostent_r_proto=0 |
| 14708 | ;; |
| 14709 | esac |
| 14710 | ;; |
| 14711 | *) gethostent_r_proto=0 |
| 14712 | ;; |
| 14713 | esac |
| 14714 | |
| 14715 | : see if prototypes for various gethostxxx netdb.h functions are available |
| 14716 | echo " " |
| 14717 | set d_gethostprotos gethostent $i_netdb netdb.h |
| 14718 | eval $hasproto |
| 14719 | |
| 14720 | : see if getitimer exists |
| 14721 | set getitimer d_getitimer |
| 14722 | eval $inlibc |
| 14723 | |
| 14724 | : see if getlogin exists |
| 14725 | set getlogin d_getlogin |
| 14726 | eval $inlibc |
| 14727 | |
| 14728 | : see if getlogin_r exists |
| 14729 | set getlogin_r d_getlogin_r |
| 14730 | eval $inlibc |
| 14731 | case "$d_getlogin_r" in |
| 14732 | "$define") |
| 14733 | hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h" |
| 14734 | case "$d_getlogin_r_proto:$usethreads" in |
| 14735 | ":define") d_getlogin_r_proto=define |
| 14736 | set d_getlogin_r_proto getlogin_r $hdrs |
| 14737 | eval $hasproto ;; |
| 14738 | *) ;; |
| 14739 | esac |
| 14740 | case "$d_getlogin_r_proto" in |
| 14741 | define) |
| 14742 | case "$getlogin_r_proto" in |
| 14743 | ''|0) try='int getlogin_r(char*, size_t);' |
| 14744 | ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;; |
| 14745 | esac |
| 14746 | case "$getlogin_r_proto" in |
| 14747 | ''|0) try='int getlogin_r(char*, int);' |
| 14748 | ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;; |
| 14749 | esac |
| 14750 | case "$getlogin_r_proto" in |
| 14751 | ''|0) try='char* getlogin_r(char*, size_t);' |
| 14752 | ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;; |
| 14753 | esac |
| 14754 | case "$getlogin_r_proto" in |
| 14755 | ''|0) try='char* getlogin_r(char*, int);' |
| 14756 | ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;; |
| 14757 | esac |
| 14758 | case "$getlogin_r_proto" in |
| 14759 | ''|0) d_getlogin_r=undef |
| 14760 | getlogin_r_proto=0 |
| 14761 | echo "Disabling getlogin_r, cannot determine prototype." >&4 ;; |
| 14762 | * ) case "$getlogin_r_proto" in |
| 14763 | REENTRANT_PROTO*) ;; |
| 14764 | *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;; |
| 14765 | esac |
| 14766 | echo "Prototype: $try" ;; |
| 14767 | esac |
| 14768 | ;; |
| 14769 | *) case "$usethreads" in |
| 14770 | define) echo "getlogin_r has no prototype, not using it." >&4 ;; |
| 14771 | esac |
| 14772 | d_getlogin_r=undef |
| 14773 | getlogin_r_proto=0 |
| 14774 | ;; |
| 14775 | esac |
| 14776 | ;; |
| 14777 | *) getlogin_r_proto=0 |
| 14778 | ;; |
| 14779 | esac |
| 14780 | |
| 14781 | : see if getmnt exists |
| 14782 | set getmnt d_getmnt |
| 14783 | eval $inlibc |
| 14784 | |
| 14785 | : see if getmntent exists |
| 14786 | set getmntent d_getmntent |
| 14787 | eval $inlibc |
| 14788 | |
| 14789 | : see if getnameinfo exists |
| 14790 | set getnameinfo d_getnameinfo |
| 14791 | eval $inlibc |
| 14792 | |
| 14793 | : see if getnetbyaddr exists |
| 14794 | set getnetbyaddr d_getnbyaddr |
| 14795 | eval $inlibc |
| 14796 | |
| 14797 | : see if getnetbyname exists |
| 14798 | set getnetbyname d_getnbyname |
| 14799 | eval $inlibc |
| 14800 | |
| 14801 | : see if getnetent exists |
| 14802 | set getnetent d_getnent |
| 14803 | eval $inlibc |
| 14804 | |
| 14805 | : see if getnetbyaddr_r exists |
| 14806 | set getnetbyaddr_r d_getnetbyaddr_r |
| 14807 | eval $inlibc |
| 14808 | case "$d_getnetbyaddr_r" in |
| 14809 | "$define") |
| 14810 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 14811 | case "$d_getnetbyaddr_r_proto:$usethreads" in |
| 14812 | ":define") d_getnetbyaddr_r_proto=define |
| 14813 | set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs |
| 14814 | eval $hasproto ;; |
| 14815 | *) ;; |
| 14816 | esac |
| 14817 | case "$d_getnetbyaddr_r_proto" in |
| 14818 | define) |
| 14819 | case "$getnetbyaddr_r_proto" in |
| 14820 | ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);' |
| 14821 | ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;; |
| 14822 | esac |
| 14823 | case "$getnetbyaddr_r_proto" in |
| 14824 | ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);' |
| 14825 | ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;; |
| 14826 | esac |
| 14827 | case "$getnetbyaddr_r_proto" in |
| 14828 | ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);' |
| 14829 | ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;; |
| 14830 | esac |
| 14831 | case "$getnetbyaddr_r_proto" in |
| 14832 | ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);' |
| 14833 | ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;; |
| 14834 | esac |
| 14835 | case "$getnetbyaddr_r_proto" in |
| 14836 | ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);' |
| 14837 | ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;; |
| 14838 | esac |
| 14839 | case "$getnetbyaddr_r_proto" in |
| 14840 | ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);' |
| 14841 | ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;; |
| 14842 | esac |
| 14843 | case "$getnetbyaddr_r_proto" in |
| 14844 | ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);' |
| 14845 | ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;; |
| 14846 | esac |
| 14847 | case "$getnetbyaddr_r_proto" in |
| 14848 | ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);' |
| 14849 | ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;; |
| 14850 | esac |
| 14851 | case "$getnetbyaddr_r_proto" in |
| 14852 | ''|0) d_getnetbyaddr_r=undef |
| 14853 | getnetbyaddr_r_proto=0 |
| 14854 | echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;; |
| 14855 | * ) case "$getnetbyaddr_r_proto" in |
| 14856 | REENTRANT_PROTO*) ;; |
| 14857 | *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;; |
| 14858 | esac |
| 14859 | echo "Prototype: $try" ;; |
| 14860 | esac |
| 14861 | ;; |
| 14862 | *) case "$usethreads" in |
| 14863 | define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;; |
| 14864 | esac |
| 14865 | d_getnetbyaddr_r=undef |
| 14866 | getnetbyaddr_r_proto=0 |
| 14867 | ;; |
| 14868 | esac |
| 14869 | ;; |
| 14870 | *) getnetbyaddr_r_proto=0 |
| 14871 | ;; |
| 14872 | esac |
| 14873 | |
| 14874 | : see if getnetbyname_r exists |
| 14875 | set getnetbyname_r d_getnetbyname_r |
| 14876 | eval $inlibc |
| 14877 | case "$d_getnetbyname_r" in |
| 14878 | "$define") |
| 14879 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 14880 | case "$d_getnetbyname_r_proto:$usethreads" in |
| 14881 | ":define") d_getnetbyname_r_proto=define |
| 14882 | set d_getnetbyname_r_proto getnetbyname_r $hdrs |
| 14883 | eval $hasproto ;; |
| 14884 | *) ;; |
| 14885 | esac |
| 14886 | case "$d_getnetbyname_r_proto" in |
| 14887 | define) |
| 14888 | case "$getnetbyname_r_proto" in |
| 14889 | ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);' |
| 14890 | ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;; |
| 14891 | esac |
| 14892 | case "$getnetbyname_r_proto" in |
| 14893 | ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);' |
| 14894 | ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;; |
| 14895 | esac |
| 14896 | case "$getnetbyname_r_proto" in |
| 14897 | ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);' |
| 14898 | ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;; |
| 14899 | esac |
| 14900 | case "$getnetbyname_r_proto" in |
| 14901 | ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);' |
| 14902 | ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;; |
| 14903 | esac |
| 14904 | case "$getnetbyname_r_proto" in |
| 14905 | ''|0) d_getnetbyname_r=undef |
| 14906 | getnetbyname_r_proto=0 |
| 14907 | echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;; |
| 14908 | * ) case "$getnetbyname_r_proto" in |
| 14909 | REENTRANT_PROTO*) ;; |
| 14910 | *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;; |
| 14911 | esac |
| 14912 | echo "Prototype: $try" ;; |
| 14913 | esac |
| 14914 | ;; |
| 14915 | *) case "$usethreads" in |
| 14916 | define) echo "getnetbyname_r has no prototype, not using it." >&4 ;; |
| 14917 | esac |
| 14918 | d_getnetbyname_r=undef |
| 14919 | getnetbyname_r_proto=0 |
| 14920 | ;; |
| 14921 | esac |
| 14922 | ;; |
| 14923 | *) getnetbyname_r_proto=0 |
| 14924 | ;; |
| 14925 | esac |
| 14926 | |
| 14927 | : see if getnetent_r exists |
| 14928 | set getnetent_r d_getnetent_r |
| 14929 | eval $inlibc |
| 14930 | case "$d_getnetent_r" in |
| 14931 | "$define") |
| 14932 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 14933 | case "$d_getnetent_r_proto:$usethreads" in |
| 14934 | ":define") d_getnetent_r_proto=define |
| 14935 | set d_getnetent_r_proto getnetent_r $hdrs |
| 14936 | eval $hasproto ;; |
| 14937 | *) ;; |
| 14938 | esac |
| 14939 | case "$d_getnetent_r_proto" in |
| 14940 | define) |
| 14941 | case "$getnetent_r_proto" in |
| 14942 | ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);' |
| 14943 | ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;; |
| 14944 | esac |
| 14945 | case "$getnetent_r_proto" in |
| 14946 | ''|0) try='int getnetent_r(struct netent*, char*, int, int*);' |
| 14947 | ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;; |
| 14948 | esac |
| 14949 | case "$getnetent_r_proto" in |
| 14950 | ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);' |
| 14951 | ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;; |
| 14952 | esac |
| 14953 | case "$getnetent_r_proto" in |
| 14954 | ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);' |
| 14955 | ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;; |
| 14956 | esac |
| 14957 | case "$getnetent_r_proto" in |
| 14958 | ''|0) try='int getnetent_r(struct netent*, char*, int);' |
| 14959 | ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;; |
| 14960 | esac |
| 14961 | case "$getnetent_r_proto" in |
| 14962 | ''|0) try='int getnetent_r(struct netent*, struct netent_data*);' |
| 14963 | ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;; |
| 14964 | esac |
| 14965 | case "$getnetent_r_proto" in |
| 14966 | ''|0) d_getnetent_r=undef |
| 14967 | getnetent_r_proto=0 |
| 14968 | echo "Disabling getnetent_r, cannot determine prototype." >&4 ;; |
| 14969 | * ) case "$getnetent_r_proto" in |
| 14970 | REENTRANT_PROTO*) ;; |
| 14971 | *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;; |
| 14972 | esac |
| 14973 | echo "Prototype: $try" ;; |
| 14974 | esac |
| 14975 | ;; |
| 14976 | *) case "$usethreads" in |
| 14977 | define) echo "getnetent_r has no prototype, not using it." >&4 ;; |
| 14978 | esac |
| 14979 | d_getnetent_r=undef |
| 14980 | getnetent_r_proto=0 |
| 14981 | ;; |
| 14982 | esac |
| 14983 | ;; |
| 14984 | *) getnetent_r_proto=0 |
| 14985 | ;; |
| 14986 | esac |
| 14987 | |
| 14988 | : see if prototypes for various getnetxxx netdb.h functions are available |
| 14989 | echo " " |
| 14990 | set d_getnetprotos getnetent $i_netdb netdb.h |
| 14991 | eval $hasproto |
| 14992 | |
| 14993 | : see if getpagesize exists |
| 14994 | set getpagesize d_getpagsz |
| 14995 | eval $inlibc |
| 14996 | |
| 14997 | : Optional checks for getprotobyname and getprotobynumber |
| 14998 | |
| 14999 | : see if getprotobyname exists |
| 15000 | set getprotobyname d_getpbyname |
| 15001 | eval $inlibc |
| 15002 | |
| 15003 | : see if getprotobynumber exists |
| 15004 | set getprotobynumber d_getpbynumber |
| 15005 | eval $inlibc |
| 15006 | |
| 15007 | : see if getprotoent exists |
| 15008 | set getprotoent d_getpent |
| 15009 | eval $inlibc |
| 15010 | |
| 15011 | : see if getpgid exists |
| 15012 | set getpgid d_getpgid |
| 15013 | eval $inlibc |
| 15014 | |
| 15015 | : see if getpgrp2 exists |
| 15016 | set getpgrp2 d_getpgrp2 |
| 15017 | eval $inlibc |
| 15018 | |
| 15019 | : see if getppid exists |
| 15020 | set getppid d_getppid |
| 15021 | eval $inlibc |
| 15022 | |
| 15023 | : see if getpriority exists |
| 15024 | set getpriority d_getprior |
| 15025 | eval $inlibc |
| 15026 | |
| 15027 | : see if getprotobyname_r exists |
| 15028 | set getprotobyname_r d_getprotobyname_r |
| 15029 | eval $inlibc |
| 15030 | case "$d_getprotobyname_r" in |
| 15031 | "$define") |
| 15032 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 15033 | case "$d_getprotobyname_r_proto:$usethreads" in |
| 15034 | ":define") d_getprotobyname_r_proto=define |
| 15035 | set d_getprotobyname_r_proto getprotobyname_r $hdrs |
| 15036 | eval $hasproto ;; |
| 15037 | *) ;; |
| 15038 | esac |
| 15039 | case "$d_getprotobyname_r_proto" in |
| 15040 | define) |
| 15041 | case "$getprotobyname_r_proto" in |
| 15042 | ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);' |
| 15043 | ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;; |
| 15044 | esac |
| 15045 | case "$getprotobyname_r_proto" in |
| 15046 | ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);' |
| 15047 | ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;; |
| 15048 | esac |
| 15049 | case "$getprotobyname_r_proto" in |
| 15050 | ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);' |
| 15051 | ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;; |
| 15052 | esac |
| 15053 | case "$getprotobyname_r_proto" in |
| 15054 | ''|0) d_getprotobyname_r=undef |
| 15055 | getprotobyname_r_proto=0 |
| 15056 | echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;; |
| 15057 | * ) case "$getprotobyname_r_proto" in |
| 15058 | REENTRANT_PROTO*) ;; |
| 15059 | *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;; |
| 15060 | esac |
| 15061 | echo "Prototype: $try" ;; |
| 15062 | esac |
| 15063 | ;; |
| 15064 | *) case "$usethreads" in |
| 15065 | define) echo "getprotobyname_r has no prototype, not using it." >&4 ;; |
| 15066 | esac |
| 15067 | d_getprotobyname_r=undef |
| 15068 | getprotobyname_r_proto=0 |
| 15069 | ;; |
| 15070 | esac |
| 15071 | ;; |
| 15072 | *) getprotobyname_r_proto=0 |
| 15073 | ;; |
| 15074 | esac |
| 15075 | |
| 15076 | : see if getprotobynumber_r exists |
| 15077 | set getprotobynumber_r d_getprotobynumber_r |
| 15078 | eval $inlibc |
| 15079 | case "$d_getprotobynumber_r" in |
| 15080 | "$define") |
| 15081 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 15082 | case "$d_getprotobynumber_r_proto:$usethreads" in |
| 15083 | ":define") d_getprotobynumber_r_proto=define |
| 15084 | set d_getprotobynumber_r_proto getprotobynumber_r $hdrs |
| 15085 | eval $hasproto ;; |
| 15086 | *) ;; |
| 15087 | esac |
| 15088 | case "$d_getprotobynumber_r_proto" in |
| 15089 | define) |
| 15090 | case "$getprotobynumber_r_proto" in |
| 15091 | ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);' |
| 15092 | ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;; |
| 15093 | esac |
| 15094 | case "$getprotobynumber_r_proto" in |
| 15095 | ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);' |
| 15096 | ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;; |
| 15097 | esac |
| 15098 | case "$getprotobynumber_r_proto" in |
| 15099 | ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);' |
| 15100 | ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;; |
| 15101 | esac |
| 15102 | case "$getprotobynumber_r_proto" in |
| 15103 | ''|0) d_getprotobynumber_r=undef |
| 15104 | getprotobynumber_r_proto=0 |
| 15105 | echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;; |
| 15106 | * ) case "$getprotobynumber_r_proto" in |
| 15107 | REENTRANT_PROTO*) ;; |
| 15108 | *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;; |
| 15109 | esac |
| 15110 | echo "Prototype: $try" ;; |
| 15111 | esac |
| 15112 | ;; |
| 15113 | *) case "$usethreads" in |
| 15114 | define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;; |
| 15115 | esac |
| 15116 | d_getprotobynumber_r=undef |
| 15117 | getprotobynumber_r_proto=0 |
| 15118 | ;; |
| 15119 | esac |
| 15120 | ;; |
| 15121 | *) getprotobynumber_r_proto=0 |
| 15122 | ;; |
| 15123 | esac |
| 15124 | |
| 15125 | : see if getprotoent_r exists |
| 15126 | set getprotoent_r d_getprotoent_r |
| 15127 | eval $inlibc |
| 15128 | case "$d_getprotoent_r" in |
| 15129 | "$define") |
| 15130 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 15131 | case "$d_getprotoent_r_proto:$usethreads" in |
| 15132 | ":define") d_getprotoent_r_proto=define |
| 15133 | set d_getprotoent_r_proto getprotoent_r $hdrs |
| 15134 | eval $hasproto ;; |
| 15135 | *) ;; |
| 15136 | esac |
| 15137 | case "$d_getprotoent_r_proto" in |
| 15138 | define) |
| 15139 | case "$getprotoent_r_proto" in |
| 15140 | ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);' |
| 15141 | ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;; |
| 15142 | esac |
| 15143 | case "$getprotoent_r_proto" in |
| 15144 | ''|0) try='int getprotoent_r(struct protoent*, char*, int);' |
| 15145 | ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;; |
| 15146 | esac |
| 15147 | case "$getprotoent_r_proto" in |
| 15148 | ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);' |
| 15149 | ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;; |
| 15150 | esac |
| 15151 | case "$getprotoent_r_proto" in |
| 15152 | ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);' |
| 15153 | ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;; |
| 15154 | esac |
| 15155 | case "$getprotoent_r_proto" in |
| 15156 | ''|0) d_getprotoent_r=undef |
| 15157 | getprotoent_r_proto=0 |
| 15158 | echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;; |
| 15159 | * ) case "$getprotoent_r_proto" in |
| 15160 | REENTRANT_PROTO*) ;; |
| 15161 | *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;; |
| 15162 | esac |
| 15163 | echo "Prototype: $try" ;; |
| 15164 | esac |
| 15165 | ;; |
| 15166 | *) case "$usethreads" in |
| 15167 | define) echo "getprotoent_r has no prototype, not using it." >&4 ;; |
| 15168 | esac |
| 15169 | d_getprotoent_r=undef |
| 15170 | getprotoent_r_proto=0 |
| 15171 | ;; |
| 15172 | esac |
| 15173 | ;; |
| 15174 | *) getprotoent_r_proto=0 |
| 15175 | ;; |
| 15176 | esac |
| 15177 | |
| 15178 | : see if prototypes for various getprotoxxx netdb.h functions are available |
| 15179 | echo " " |
| 15180 | set d_getprotoprotos getprotoent $i_netdb netdb.h |
| 15181 | eval $hasproto |
| 15182 | |
| 15183 | : see if getprpwnam exists |
| 15184 | set getprpwnam d_getprpwnam |
| 15185 | eval $inlibc |
| 15186 | |
| 15187 | : see if getpwent exists |
| 15188 | set getpwent d_getpwent |
| 15189 | eval $inlibc |
| 15190 | |
| 15191 | : see if getpwent_r exists |
| 15192 | set getpwent_r d_getpwent_r |
| 15193 | eval $inlibc |
| 15194 | case "$d_getpwent_r" in |
| 15195 | "$define") |
| 15196 | hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h" |
| 15197 | case "$d_getpwent_r_proto:$usethreads" in |
| 15198 | ":define") d_getpwent_r_proto=define |
| 15199 | set d_getpwent_r_proto getpwent_r $hdrs |
| 15200 | eval $hasproto ;; |
| 15201 | *) ;; |
| 15202 | esac |
| 15203 | case "$d_getpwent_r_proto" in |
| 15204 | define) |
| 15205 | case "$getpwent_r_proto" in |
| 15206 | ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);' |
| 15207 | ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;; |
| 15208 | esac |
| 15209 | case "$getpwent_r_proto" in |
| 15210 | ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);' |
| 15211 | ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;; |
| 15212 | esac |
| 15213 | case "$getpwent_r_proto" in |
| 15214 | ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);' |
| 15215 | ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;; |
| 15216 | esac |
| 15217 | case "$getpwent_r_proto" in |
| 15218 | ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);' |
| 15219 | ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;; |
| 15220 | esac |
| 15221 | case "$getpwent_r_proto" in |
| 15222 | ''|0) try='int getpwent_r(struct passwd*, char*, int);' |
| 15223 | ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;; |
| 15224 | esac |
| 15225 | case "$getpwent_r_proto" in |
| 15226 | ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);' |
| 15227 | ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;; |
| 15228 | esac |
| 15229 | case "$getpwent_r_proto" in |
| 15230 | ''|0) d_getpwent_r=undef |
| 15231 | getpwent_r_proto=0 |
| 15232 | echo "Disabling getpwent_r, cannot determine prototype." >&4 ;; |
| 15233 | * ) case "$getpwent_r_proto" in |
| 15234 | REENTRANT_PROTO*) ;; |
| 15235 | *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;; |
| 15236 | esac |
| 15237 | echo "Prototype: $try" ;; |
| 15238 | esac |
| 15239 | ;; |
| 15240 | *) case "$usethreads" in |
| 15241 | define) echo "getpwent_r has no prototype, not using it." >&4 ;; |
| 15242 | esac |
| 15243 | d_getpwent_r=undef |
| 15244 | getpwent_r_proto=0 |
| 15245 | ;; |
| 15246 | esac |
| 15247 | ;; |
| 15248 | *) getpwent_r_proto=0 |
| 15249 | ;; |
| 15250 | esac |
| 15251 | |
| 15252 | : see if getpwnam_r exists |
| 15253 | set getpwnam_r d_getpwnam_r |
| 15254 | eval $inlibc |
| 15255 | case "$d_getpwnam_r" in |
| 15256 | "$define") |
| 15257 | hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h" |
| 15258 | case "$d_getpwnam_r_proto:$usethreads" in |
| 15259 | ":define") d_getpwnam_r_proto=define |
| 15260 | set d_getpwnam_r_proto getpwnam_r $hdrs |
| 15261 | eval $hasproto ;; |
| 15262 | *) ;; |
| 15263 | esac |
| 15264 | case "$d_getpwnam_r_proto" in |
| 15265 | define) |
| 15266 | case "$getpwnam_r_proto" in |
| 15267 | ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);' |
| 15268 | ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;; |
| 15269 | esac |
| 15270 | case "$getpwnam_r_proto" in |
| 15271 | ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);' |
| 15272 | ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;; |
| 15273 | esac |
| 15274 | case "$getpwnam_r_proto" in |
| 15275 | ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);' |
| 15276 | ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;; |
| 15277 | esac |
| 15278 | case "$getpwnam_r_proto" in |
| 15279 | ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);' |
| 15280 | ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;; |
| 15281 | esac |
| 15282 | case "$getpwnam_r_proto" in |
| 15283 | ''|0) d_getpwnam_r=undef |
| 15284 | getpwnam_r_proto=0 |
| 15285 | echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;; |
| 15286 | * ) case "$getpwnam_r_proto" in |
| 15287 | REENTRANT_PROTO*) ;; |
| 15288 | *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;; |
| 15289 | esac |
| 15290 | echo "Prototype: $try" ;; |
| 15291 | esac |
| 15292 | ;; |
| 15293 | *) case "$usethreads" in |
| 15294 | define) echo "getpwnam_r has no prototype, not using it." >&4 ;; |
| 15295 | esac |
| 15296 | d_getpwnam_r=undef |
| 15297 | getpwnam_r_proto=0 |
| 15298 | ;; |
| 15299 | esac |
| 15300 | ;; |
| 15301 | *) getpwnam_r_proto=0 |
| 15302 | ;; |
| 15303 | esac |
| 15304 | |
| 15305 | : see if getpwuid_r exists |
| 15306 | set getpwuid_r d_getpwuid_r |
| 15307 | eval $inlibc |
| 15308 | case "$d_getpwuid_r" in |
| 15309 | "$define") |
| 15310 | hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h" |
| 15311 | case "$d_getpwuid_r_proto:$usethreads" in |
| 15312 | ":define") d_getpwuid_r_proto=define |
| 15313 | set d_getpwuid_r_proto getpwuid_r $hdrs |
| 15314 | eval $hasproto ;; |
| 15315 | *) ;; |
| 15316 | esac |
| 15317 | case "$d_getpwuid_r_proto" in |
| 15318 | define) |
| 15319 | case "$getpwuid_r_proto" in |
| 15320 | ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);' |
| 15321 | ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;; |
| 15322 | esac |
| 15323 | case "$getpwuid_r_proto" in |
| 15324 | ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);' |
| 15325 | ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;; |
| 15326 | esac |
| 15327 | case "$getpwuid_r_proto" in |
| 15328 | ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);' |
| 15329 | ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;; |
| 15330 | esac |
| 15331 | case "$getpwuid_r_proto" in |
| 15332 | ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);' |
| 15333 | ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;; |
| 15334 | esac |
| 15335 | case "$getpwuid_r_proto" in |
| 15336 | ''|0) d_getpwuid_r=undef |
| 15337 | getpwuid_r_proto=0 |
| 15338 | echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;; |
| 15339 | * ) case "$getpwuid_r_proto" in |
| 15340 | REENTRANT_PROTO*) ;; |
| 15341 | *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;; |
| 15342 | esac |
| 15343 | echo "Prototype: $try" ;; |
| 15344 | esac |
| 15345 | ;; |
| 15346 | *) case "$usethreads" in |
| 15347 | define) echo "getpwuid_r has no prototype, not using it." >&4 ;; |
| 15348 | esac |
| 15349 | d_getpwuid_r=undef |
| 15350 | getpwuid_r_proto=0 |
| 15351 | ;; |
| 15352 | esac |
| 15353 | ;; |
| 15354 | *) getpwuid_r_proto=0 |
| 15355 | ;; |
| 15356 | esac |
| 15357 | |
| 15358 | : Optional checks for getsbyname and getsbyport |
| 15359 | |
| 15360 | : see if getservbyname exists |
| 15361 | set getservbyname d_getsbyname |
| 15362 | eval $inlibc |
| 15363 | |
| 15364 | : see if getservbyport exists |
| 15365 | set getservbyport d_getsbyport |
| 15366 | eval $inlibc |
| 15367 | |
| 15368 | : see if getservent exists |
| 15369 | set getservent d_getsent |
| 15370 | eval $inlibc |
| 15371 | |
| 15372 | : see if getservbyname_r exists |
| 15373 | set getservbyname_r d_getservbyname_r |
| 15374 | eval $inlibc |
| 15375 | case "$d_getservbyname_r" in |
| 15376 | "$define") |
| 15377 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 15378 | case "$d_getservbyname_r_proto:$usethreads" in |
| 15379 | ":define") d_getservbyname_r_proto=define |
| 15380 | set d_getservbyname_r_proto getservbyname_r $hdrs |
| 15381 | eval $hasproto ;; |
| 15382 | *) ;; |
| 15383 | esac |
| 15384 | case "$d_getservbyname_r_proto" in |
| 15385 | define) |
| 15386 | case "$getservbyname_r_proto" in |
| 15387 | ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);' |
| 15388 | ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;; |
| 15389 | esac |
| 15390 | case "$getservbyname_r_proto" in |
| 15391 | ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);' |
| 15392 | ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;; |
| 15393 | esac |
| 15394 | case "$getservbyname_r_proto" in |
| 15395 | ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);' |
| 15396 | ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;; |
| 15397 | esac |
| 15398 | case "$getservbyname_r_proto" in |
| 15399 | ''|0) d_getservbyname_r=undef |
| 15400 | getservbyname_r_proto=0 |
| 15401 | echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;; |
| 15402 | * ) case "$getservbyname_r_proto" in |
| 15403 | REENTRANT_PROTO*) ;; |
| 15404 | *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;; |
| 15405 | esac |
| 15406 | echo "Prototype: $try" ;; |
| 15407 | esac |
| 15408 | ;; |
| 15409 | *) case "$usethreads" in |
| 15410 | define) echo "getservbyname_r has no prototype, not using it." >&4 ;; |
| 15411 | esac |
| 15412 | d_getservbyname_r=undef |
| 15413 | getservbyname_r_proto=0 |
| 15414 | ;; |
| 15415 | esac |
| 15416 | ;; |
| 15417 | *) getservbyname_r_proto=0 |
| 15418 | ;; |
| 15419 | esac |
| 15420 | |
| 15421 | : see if getservbyport_r exists |
| 15422 | set getservbyport_r d_getservbyport_r |
| 15423 | eval $inlibc |
| 15424 | case "$d_getservbyport_r" in |
| 15425 | "$define") |
| 15426 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 15427 | case "$d_getservbyport_r_proto:$usethreads" in |
| 15428 | ":define") d_getservbyport_r_proto=define |
| 15429 | set d_getservbyport_r_proto getservbyport_r $hdrs |
| 15430 | eval $hasproto ;; |
| 15431 | *) ;; |
| 15432 | esac |
| 15433 | case "$d_getservbyport_r_proto" in |
| 15434 | define) |
| 15435 | case "$getservbyport_r_proto" in |
| 15436 | ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);' |
| 15437 | ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;; |
| 15438 | esac |
| 15439 | case "$getservbyport_r_proto" in |
| 15440 | ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);' |
| 15441 | ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;; |
| 15442 | esac |
| 15443 | case "$getservbyport_r_proto" in |
| 15444 | ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);' |
| 15445 | ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;; |
| 15446 | esac |
| 15447 | case "$getservbyport_r_proto" in |
| 15448 | ''|0) d_getservbyport_r=undef |
| 15449 | getservbyport_r_proto=0 |
| 15450 | echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;; |
| 15451 | * ) case "$getservbyport_r_proto" in |
| 15452 | REENTRANT_PROTO*) ;; |
| 15453 | *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;; |
| 15454 | esac |
| 15455 | echo "Prototype: $try" ;; |
| 15456 | esac |
| 15457 | ;; |
| 15458 | *) case "$usethreads" in |
| 15459 | define) echo "getservbyport_r has no prototype, not using it." >&4 ;; |
| 15460 | esac |
| 15461 | d_getservbyport_r=undef |
| 15462 | getservbyport_r_proto=0 |
| 15463 | ;; |
| 15464 | esac |
| 15465 | ;; |
| 15466 | *) getservbyport_r_proto=0 |
| 15467 | ;; |
| 15468 | esac |
| 15469 | |
| 15470 | : see if getservent_r exists |
| 15471 | set getservent_r d_getservent_r |
| 15472 | eval $inlibc |
| 15473 | case "$d_getservent_r" in |
| 15474 | "$define") |
| 15475 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 15476 | case "$d_getservent_r_proto:$usethreads" in |
| 15477 | ":define") d_getservent_r_proto=define |
| 15478 | set d_getservent_r_proto getservent_r $hdrs |
| 15479 | eval $hasproto ;; |
| 15480 | *) ;; |
| 15481 | esac |
| 15482 | case "$d_getservent_r_proto" in |
| 15483 | define) |
| 15484 | case "$getservent_r_proto" in |
| 15485 | ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);' |
| 15486 | ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;; |
| 15487 | esac |
| 15488 | case "$getservent_r_proto" in |
| 15489 | ''|0) try='int getservent_r(struct servent*, char*, int);' |
| 15490 | ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;; |
| 15491 | esac |
| 15492 | case "$getservent_r_proto" in |
| 15493 | ''|0) try='struct servent* getservent_r(struct servent*, char*, int);' |
| 15494 | ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;; |
| 15495 | esac |
| 15496 | case "$getservent_r_proto" in |
| 15497 | ''|0) try='int getservent_r(struct servent*, struct servent_data*);' |
| 15498 | ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;; |
| 15499 | esac |
| 15500 | case "$getservent_r_proto" in |
| 15501 | ''|0) d_getservent_r=undef |
| 15502 | getservent_r_proto=0 |
| 15503 | echo "Disabling getservent_r, cannot determine prototype." >&4 ;; |
| 15504 | * ) case "$getservent_r_proto" in |
| 15505 | REENTRANT_PROTO*) ;; |
| 15506 | *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;; |
| 15507 | esac |
| 15508 | echo "Prototype: $try" ;; |
| 15509 | esac |
| 15510 | ;; |
| 15511 | *) case "$usethreads" in |
| 15512 | define) echo "getservent_r has no prototype, not using it." >&4 ;; |
| 15513 | esac |
| 15514 | d_getservent_r=undef |
| 15515 | getservent_r_proto=0 |
| 15516 | ;; |
| 15517 | esac |
| 15518 | ;; |
| 15519 | *) getservent_r_proto=0 |
| 15520 | ;; |
| 15521 | esac |
| 15522 | |
| 15523 | : see if prototypes for various getservxxx netdb.h functions are available |
| 15524 | echo " " |
| 15525 | set d_getservprotos getservent $i_netdb netdb.h |
| 15526 | eval $hasproto |
| 15527 | |
| 15528 | : see if getspnam exists |
| 15529 | set getspnam d_getspnam |
| 15530 | eval $inlibc |
| 15531 | |
| 15532 | : see if this is a shadow.h system |
| 15533 | set shadow.h i_shadow |
| 15534 | eval $inhdr |
| 15535 | |
| 15536 | : see if getspnam_r exists |
| 15537 | set getspnam_r d_getspnam_r |
| 15538 | eval $inlibc |
| 15539 | case "$d_getspnam_r" in |
| 15540 | "$define") |
| 15541 | hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h" |
| 15542 | case "$d_getspnam_r_proto:$usethreads" in |
| 15543 | ":define") d_getspnam_r_proto=define |
| 15544 | set d_getspnam_r_proto getspnam_r $hdrs |
| 15545 | eval $hasproto ;; |
| 15546 | *) ;; |
| 15547 | esac |
| 15548 | case "$d_getspnam_r_proto" in |
| 15549 | define) |
| 15550 | case "$getspnam_r_proto" in |
| 15551 | ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);' |
| 15552 | ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;; |
| 15553 | esac |
| 15554 | case "$getspnam_r_proto" in |
| 15555 | ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);' |
| 15556 | ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;; |
| 15557 | esac |
| 15558 | case "$getspnam_r_proto" in |
| 15559 | ''|0) d_getspnam_r=undef |
| 15560 | getspnam_r_proto=0 |
| 15561 | echo "Disabling getspnam_r, cannot determine prototype." >&4 ;; |
| 15562 | * ) case "$getspnam_r_proto" in |
| 15563 | REENTRANT_PROTO*) ;; |
| 15564 | *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;; |
| 15565 | esac |
| 15566 | echo "Prototype: $try" ;; |
| 15567 | esac |
| 15568 | ;; |
| 15569 | *) case "$usethreads" in |
| 15570 | define) echo "getspnam_r has no prototype, not using it." >&4 ;; |
| 15571 | esac |
| 15572 | d_getspnam_r=undef |
| 15573 | getspnam_r_proto=0 |
| 15574 | ;; |
| 15575 | esac |
| 15576 | ;; |
| 15577 | *) getspnam_r_proto=0 |
| 15578 | ;; |
| 15579 | esac |
| 15580 | |
| 15581 | : see if gettimeofday or ftime exists |
| 15582 | set gettimeofday d_gettimeod |
| 15583 | eval $inlibc |
| 15584 | case "$d_gettimeod" in |
| 15585 | "$undef") |
| 15586 | set ftime d_ftime |
| 15587 | eval $inlibc |
| 15588 | ;; |
| 15589 | *) |
| 15590 | val="$undef"; set d_ftime; eval $setvar |
| 15591 | ;; |
| 15592 | esac |
| 15593 | case "$d_gettimeod$d_ftime" in |
| 15594 | "$undef$undef") |
| 15595 | echo " " |
| 15596 | echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4 |
| 15597 | ;; |
| 15598 | esac |
| 15599 | |
| 15600 | : see if gmtime_r exists |
| 15601 | set gmtime_r d_gmtime_r |
| 15602 | eval $inlibc |
| 15603 | case "$d_gmtime_r" in |
| 15604 | "$define") |
| 15605 | hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h" |
| 15606 | case "$d_gmtime_r_proto:$usethreads" in |
| 15607 | ":define") d_gmtime_r_proto=define |
| 15608 | set d_gmtime_r_proto gmtime_r $hdrs |
| 15609 | eval $hasproto ;; |
| 15610 | *) ;; |
| 15611 | esac |
| 15612 | case "$d_gmtime_r_proto" in |
| 15613 | define) |
| 15614 | case "$gmtime_r_proto" in |
| 15615 | ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);' |
| 15616 | ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;; |
| 15617 | esac |
| 15618 | case "$gmtime_r_proto" in |
| 15619 | ''|0) try='int gmtime_r(const time_t*, struct tm*);' |
| 15620 | ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;; |
| 15621 | esac |
| 15622 | case "$gmtime_r_proto" in |
| 15623 | ''|0) d_gmtime_r=undef |
| 15624 | gmtime_r_proto=0 |
| 15625 | echo "Disabling gmtime_r, cannot determine prototype." >&4 ;; |
| 15626 | * ) case "$gmtime_r_proto" in |
| 15627 | REENTRANT_PROTO*) ;; |
| 15628 | *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;; |
| 15629 | esac |
| 15630 | echo "Prototype: $try" ;; |
| 15631 | esac |
| 15632 | ;; |
| 15633 | *) case "$usethreads" in |
| 15634 | define) echo "gmtime_r has no prototype, not using it." >&4 ;; |
| 15635 | esac |
| 15636 | d_gmtime_r=undef |
| 15637 | gmtime_r_proto=0 |
| 15638 | ;; |
| 15639 | esac |
| 15640 | ;; |
| 15641 | *) gmtime_r_proto=0 |
| 15642 | ;; |
| 15643 | esac |
| 15644 | |
| 15645 | : see if hasmntopt exists |
| 15646 | set hasmntopt d_hasmntopt |
| 15647 | eval $inlibc |
| 15648 | |
| 15649 | : see if this is a netinet/in.h or sys/in.h system |
| 15650 | set netinet/in.h i_niin sys/in.h i_sysin |
| 15651 | eval $inhdr |
| 15652 | |
| 15653 | : see if arpa/inet.h has to be included |
| 15654 | set arpa/inet.h i_arpainet |
| 15655 | eval $inhdr |
| 15656 | |
| 15657 | : see if htonl --and friends-- exists |
| 15658 | val='' |
| 15659 | set htonl val |
| 15660 | eval $inlibc |
| 15661 | |
| 15662 | : Maybe they are macros. |
| 15663 | case "$val" in |
| 15664 | $undef) |
| 15665 | $cat >htonl.c <<EOM |
| 15666 | #include <stdio.h> |
| 15667 | #include <sys/types.h> |
| 15668 | #$i_niin I_NETINET_IN |
| 15669 | #$i_sysin I_SYS_IN |
| 15670 | #$i_arpainet I_ARPA_INET |
| 15671 | #ifdef I_NETINET_IN |
| 15672 | #include <netinet/in.h> |
| 15673 | #endif |
| 15674 | #ifdef I_SYS_IN |
| 15675 | #include <sys/in.h> |
| 15676 | #endif |
| 15677 | #ifdef I_ARPA_INET |
| 15678 | #include <arpa/inet.h> |
| 15679 | #endif |
| 15680 | #ifdef htonl |
| 15681 | printf("Defined as a macro."); |
| 15682 | #endif |
| 15683 | EOM |
| 15684 | $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null |
| 15685 | if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then |
| 15686 | val="$define" |
| 15687 | echo "But it seems to be defined as a macro." >&4 |
| 15688 | fi |
| 15689 | $rm -f htonl.? |
| 15690 | ;; |
| 15691 | esac |
| 15692 | set d_htonl |
| 15693 | eval $setvar |
| 15694 | |
| 15695 | : see if hypot exists |
| 15696 | set hypot d_hypot |
| 15697 | eval $inlibc |
| 15698 | |
| 15699 | : see if ilogb exists |
| 15700 | set ilogb d_ilogb |
| 15701 | eval $inlibc |
| 15702 | |
| 15703 | : see if ilogbl exists |
| 15704 | set ilogbl d_ilogbl |
| 15705 | eval $inlibc |
| 15706 | |
| 15707 | : check whether inet_aton exists |
| 15708 | set inet_aton d_inetaton |
| 15709 | eval $inlibc |
| 15710 | |
| 15711 | : see if inet_ntop exists |
| 15712 | set inet_ntop d_inetntop |
| 15713 | eval $inlibc |
| 15714 | |
| 15715 | : see if inet_pton exists |
| 15716 | set inet_pton d_inetpton |
| 15717 | eval $inlibc |
| 15718 | |
| 15719 | : Look for isascii |
| 15720 | echo " " |
| 15721 | $cat >isascii.c <<EOCP |
| 15722 | #include <stdio.h> |
| 15723 | #include <ctype.h> |
| 15724 | #$i_stdlib I_STDLIB |
| 15725 | #ifdef I_STDLIB |
| 15726 | #include <stdlib.h> |
| 15727 | #endif |
| 15728 | int main() { |
| 15729 | int c = 'A'; |
| 15730 | if (isascii(c)) |
| 15731 | exit(0); |
| 15732 | else |
| 15733 | exit(1); |
| 15734 | } |
| 15735 | EOCP |
| 15736 | set isascii |
| 15737 | if eval $compile; then |
| 15738 | echo "isascii() found." >&4 |
| 15739 | val="$define" |
| 15740 | else |
| 15741 | echo "isascii() NOT found." >&4 |
| 15742 | val="$undef" |
| 15743 | fi |
| 15744 | set d_isascii |
| 15745 | eval $setvar |
| 15746 | $rm -f isascii* |
| 15747 | |
| 15748 | : Look for isblank |
| 15749 | echo " " |
| 15750 | $cat >isblank.c <<'EOCP' |
| 15751 | #include <stdio.h> |
| 15752 | #include <ctype.h> |
| 15753 | int main() { |
| 15754 | int c = ' '; |
| 15755 | if (isblank(c)) |
| 15756 | return 0 ; |
| 15757 | else |
| 15758 | return 1 ; |
| 15759 | } |
| 15760 | EOCP |
| 15761 | if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then |
| 15762 | echo "isblank() found." >&4 |
| 15763 | val="$define" |
| 15764 | else |
| 15765 | echo "isblank() NOT found." >&4 |
| 15766 | val="$undef" |
| 15767 | fi |
| 15768 | set d_isblank |
| 15769 | eval $setvar |
| 15770 | $rm -f isblank* |
| 15771 | |
| 15772 | : check for isfinite |
| 15773 | echo "Checking to see if you have isfinite..." >&4 |
| 15774 | $cat >try.c <<EOCP |
| 15775 | #include <math.h> |
| 15776 | int main() { return isfinite(0.0); } |
| 15777 | EOCP |
| 15778 | set try |
| 15779 | if eval $compile; then |
| 15780 | val="$define" |
| 15781 | echo "You have isfinite." |
| 15782 | else |
| 15783 | val="$undef" |
| 15784 | echo "You do not have isfinite." |
| 15785 | fi |
| 15786 | $rm_try |
| 15787 | set d_isfinite |
| 15788 | eval $setvar |
| 15789 | |
| 15790 | : see if isfinitel exists |
| 15791 | set isfinitel d_isfinitel |
| 15792 | eval $inlibc |
| 15793 | |
| 15794 | : check for isinf |
| 15795 | echo "Checking to see if you have isinf..." >&4 |
| 15796 | $cat >try.c <<EOCP |
| 15797 | #include <math.h> |
| 15798 | int main() { return isinf(0.0); } |
| 15799 | EOCP |
| 15800 | set try |
| 15801 | if eval $compile; then |
| 15802 | val="$define" |
| 15803 | echo "You have isinf." |
| 15804 | else |
| 15805 | val="$undef" |
| 15806 | echo "You do not have isinf." |
| 15807 | fi |
| 15808 | $rm_try |
| 15809 | set d_isinf |
| 15810 | eval $setvar |
| 15811 | |
| 15812 | : see if isinfl exists |
| 15813 | set isinfl d_isinfl |
| 15814 | eval $inlibc |
| 15815 | |
| 15816 | : check for isless |
| 15817 | echo "Checking to see if you have isless..." >&4 |
| 15818 | $cat >try.c <<EOCP |
| 15819 | #include <math.h> |
| 15820 | int main() { return isless(2.0, 1.0); } |
| 15821 | EOCP |
| 15822 | set try |
| 15823 | if eval $compile; then |
| 15824 | val="$define" |
| 15825 | echo "You have isless." |
| 15826 | else |
| 15827 | val="$undef" |
| 15828 | echo "You do not have isless." |
| 15829 | fi |
| 15830 | $rm_try |
| 15831 | set d_isless |
| 15832 | eval $setvar |
| 15833 | |
| 15834 | : check for isnan |
| 15835 | echo "Checking to see if you have isnan..." >&4 |
| 15836 | $cat >try.c <<EOCP |
| 15837 | #include <math.h> |
| 15838 | int main() { return isnan(0.0); } |
| 15839 | EOCP |
| 15840 | set try |
| 15841 | if eval $compile; then |
| 15842 | val="$define" |
| 15843 | echo "You have isnan." |
| 15844 | else |
| 15845 | val="$undef" |
| 15846 | echo "You do not have isnan." |
| 15847 | fi |
| 15848 | $rm_try |
| 15849 | set d_isnan |
| 15850 | eval $setvar |
| 15851 | |
| 15852 | : see if isnanl exists |
| 15853 | set isnanl d_isnanl |
| 15854 | eval $inlibc |
| 15855 | |
| 15856 | : check for isnormal |
| 15857 | echo "Checking to see if you have isnormal..." >&4 |
| 15858 | $cat >try.c <<EOCP |
| 15859 | #include <math.h> |
| 15860 | int main() { return isnormal(0.0); } |
| 15861 | EOCP |
| 15862 | set try |
| 15863 | if eval $compile; then |
| 15864 | val="$define" |
| 15865 | echo "You have isnormal." |
| 15866 | else |
| 15867 | val="$undef" |
| 15868 | echo "You do not have isnormal." |
| 15869 | fi |
| 15870 | $rm_try |
| 15871 | set d_isnormal |
| 15872 | eval $setvar |
| 15873 | |
| 15874 | : see if j0 exists |
| 15875 | set j0 d_j0 |
| 15876 | eval $inlibc |
| 15877 | |
| 15878 | : see if j0l exists |
| 15879 | set j0l d_j0l |
| 15880 | eval $inlibc |
| 15881 | |
| 15882 | : see if killpg exists |
| 15883 | set killpg d_killpg |
| 15884 | eval $inlibc |
| 15885 | |
| 15886 | : see if localeconv exists |
| 15887 | set localeconv d_locconv |
| 15888 | eval $inlibc |
| 15889 | |
| 15890 | : see if libc has the POSIX.1-2008 currency locale rules |
| 15891 | case "$d_locconv:$d_lc_monetary_2008" in |
| 15892 | $define:) |
| 15893 | $cat >try.c <<EOCP |
| 15894 | #include <locale.h> |
| 15895 | int main() { |
| 15896 | struct lconv *lc = localeconv(); |
| 15897 | char int_p_cs_precedes = lc->int_p_cs_precedes; |
| 15898 | return 0; |
| 15899 | } |
| 15900 | EOCP |
| 15901 | set try |
| 15902 | if eval $compile; then |
| 15903 | d_lc_monetary_2008="$define" |
| 15904 | else |
| 15905 | d_lc_monetary_2008="$undef" |
| 15906 | fi; |
| 15907 | $rm_try |
| 15908 | ;; |
| 15909 | esac |
| 15910 | |
| 15911 | : see if lchown exists |
| 15912 | echo " " |
| 15913 | $cat > try.c <<EOCP |
| 15914 | #include <pwd.h> |
| 15915 | #include <stdio.h> |
| 15916 | #include <stdlib.h> |
| 15917 | #$i_unistd I_UNISTD |
| 15918 | #ifdef I_UNISTD |
| 15919 | # include <unistd.h> |
| 15920 | #endif |
| 15921 | int main(int argc, char *argv[]) |
| 15922 | { |
| 15923 | if (lchown("./try.c", -1, getgid()) == -1) { |
| 15924 | exit(EXIT_FAILURE); |
| 15925 | } |
| 15926 | exit(EXIT_SUCCESS); |
| 15927 | } |
| 15928 | EOCP |
| 15929 | set try |
| 15930 | if eval $compile && ./try; then |
| 15931 | $echo "lchown() found." >&4 |
| 15932 | val="$define" |
| 15933 | else |
| 15934 | $echo "lchown() NOT found." >&4 |
| 15935 | val="$undef" |
| 15936 | fi |
| 15937 | set d_lchown |
| 15938 | eval $setvar |
| 15939 | $rm_try |
| 15940 | |
| 15941 | : See if number of significant digits in a double precision number is known |
| 15942 | echo " " |
| 15943 | $cat >ldbl_dig.c <<EOM |
| 15944 | #include <limits.h> |
| 15945 | #include <float.h> |
| 15946 | #ifdef LDBL_DIG |
| 15947 | printf("Contains LDBL_DIG"); |
| 15948 | #endif |
| 15949 | EOM |
| 15950 | $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null |
| 15951 | if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then |
| 15952 | echo "LDBL_DIG found." >&4 |
| 15953 | val="$define" |
| 15954 | else |
| 15955 | echo "LDBL_DIG NOT found." >&4 |
| 15956 | val="$undef" |
| 15957 | fi |
| 15958 | $rm -f ldbl_dig.? |
| 15959 | set d_ldbl_dig |
| 15960 | eval $setvar |
| 15961 | |
| 15962 | : see if lgamma exists |
| 15963 | set lgamma d_lgamma |
| 15964 | eval $inlibc |
| 15965 | |
| 15966 | : see if lgamma_r exists |
| 15967 | set lgamma_r d_lgamma_r |
| 15968 | eval $inlibc |
| 15969 | |
| 15970 | : check to see if math.h defines _LIB_VERSION |
| 15971 | d_libm_lib_version="$undef" |
| 15972 | echo " " |
| 15973 | echo "Checking to see if your libm supports _LIB_VERSION..." >&4 |
| 15974 | $cat >try.c <<EOCP |
| 15975 | #include <unistd.h> |
| 15976 | #include <math.h> |
| 15977 | int main (int argc, char *argv[]) |
| 15978 | { |
| 15979 | printf ("%d\n", _LIB_VERSION); |
| 15980 | return (0); |
| 15981 | } /* main */ |
| 15982 | EOCP |
| 15983 | set try |
| 15984 | if eval $compile; then |
| 15985 | foo=`$run ./try` |
| 15986 | echo "Yes, it does ($foo)" >&4 |
| 15987 | d_libm_lib_version="$define" |
| 15988 | else |
| 15989 | echo "No, it does not (probably harmless)" >&4 |
| 15990 | fi |
| 15991 | $rm_try |
| 15992 | |
| 15993 | : see if link exists |
| 15994 | set link d_link |
| 15995 | eval $inlibc |
| 15996 | |
| 15997 | : see if llrint exists |
| 15998 | set llrint d_llrint |
| 15999 | eval $inlibc |
| 16000 | |
| 16001 | : see if llrintl exists |
| 16002 | set llrintl d_llrintl |
| 16003 | eval $inlibc |
| 16004 | |
| 16005 | : see if llround exists |
| 16006 | set llround d_llround |
| 16007 | eval $inlibc |
| 16008 | |
| 16009 | : see if llroundl exists |
| 16010 | set llroundl d_llroundl |
| 16011 | eval $inlibc |
| 16012 | |
| 16013 | : see if localeconv_l exists |
| 16014 | set localeconv_l d_localeconv_l |
| 16015 | eval $inlibc |
| 16016 | |
| 16017 | : see if localtime_r exists |
| 16018 | set localtime_r d_localtime_r |
| 16019 | eval $inlibc |
| 16020 | case "$d_localtime_r" in |
| 16021 | "$define") |
| 16022 | hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h" |
| 16023 | case "$d_localtime_r_proto:$usethreads" in |
| 16024 | ":define") d_localtime_r_proto=define |
| 16025 | set d_localtime_r_proto localtime_r $hdrs |
| 16026 | eval $hasproto ;; |
| 16027 | *) ;; |
| 16028 | esac |
| 16029 | case "$d_localtime_r_proto" in |
| 16030 | define) |
| 16031 | case "$localtime_r_proto" in |
| 16032 | ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);' |
| 16033 | ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;; |
| 16034 | esac |
| 16035 | case "$localtime_r_proto" in |
| 16036 | ''|0) try='int localtime_r(const time_t*, struct tm*);' |
| 16037 | ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;; |
| 16038 | esac |
| 16039 | case "$localtime_r_proto" in |
| 16040 | ''|0) d_localtime_r=undef |
| 16041 | localtime_r_proto=0 |
| 16042 | echo "Disabling localtime_r, cannot determine prototype." >&4 ;; |
| 16043 | * ) case "$localtime_r_proto" in |
| 16044 | REENTRANT_PROTO*) ;; |
| 16045 | *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;; |
| 16046 | esac |
| 16047 | echo "Prototype: $try" ;; |
| 16048 | esac |
| 16049 | ;; |
| 16050 | *) case "$usethreads" in |
| 16051 | define) echo "localtime_r has no prototype, not using it." >&4 ;; |
| 16052 | esac |
| 16053 | d_localtime_r=undef |
| 16054 | localtime_r_proto=0 |
| 16055 | ;; |
| 16056 | esac |
| 16057 | ;; |
| 16058 | *) localtime_r_proto=0 |
| 16059 | ;; |
| 16060 | esac |
| 16061 | |
| 16062 | : see if localtime_r calls tzset |
| 16063 | case "$localtime_r_proto" in |
| 16064 | REENTRANT_PROTO*) |
| 16065 | $cat >try.c <<EOCP |
| 16066 | /* Does our libc's localtime_r call tzset ? |
| 16067 | * return 0 if so, 1 otherwise. |
| 16068 | */ |
| 16069 | #$i_systypes I_SYS_TYPES |
| 16070 | #$i_unistd I_UNISTD |
| 16071 | #$i_time I_TIME |
| 16072 | #$i_stdlib I_STDLIB |
| 16073 | #$i_malloc I_MALLOC |
| 16074 | #ifdef I_SYS_TYPES |
| 16075 | # include <sys/types.h> |
| 16076 | #endif |
| 16077 | #ifdef I_UNISTD |
| 16078 | # include <unistd.h> |
| 16079 | #endif |
| 16080 | #ifdef I_TIME |
| 16081 | # include <time.h> |
| 16082 | #endif |
| 16083 | #ifdef I_STDLIB |
| 16084 | #include <stdlib.h> |
| 16085 | #endif |
| 16086 | #include <string.h> |
| 16087 | #ifdef I_MALLOC |
| 16088 | # include <malloc.h> |
| 16089 | #endif |
| 16090 | int main() |
| 16091 | { |
| 16092 | time_t t = time(0L); |
| 16093 | char w_tz[]="TZ" "=GMT+5", |
| 16094 | e_tz[]="TZ" "=GMT-5", |
| 16095 | *tz_e = (char*)malloc(16), |
| 16096 | *tz_w = (char*)malloc(16); |
| 16097 | struct tm tm_e, tm_w; |
| 16098 | memset(&tm_e,'\0',sizeof(struct tm)); |
| 16099 | memset(&tm_w,'\0',sizeof(struct tm)); |
| 16100 | strcpy(tz_e,e_tz); |
| 16101 | strcpy(tz_w,w_tz); |
| 16102 | |
| 16103 | putenv(tz_e); |
| 16104 | localtime_r(&t, &tm_e); |
| 16105 | |
| 16106 | putenv(tz_w); |
| 16107 | localtime_r(&t, &tm_w); |
| 16108 | |
| 16109 | if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 ) |
| 16110 | return 1; |
| 16111 | return 0; |
| 16112 | } |
| 16113 | EOCP |
| 16114 | set try |
| 16115 | if eval $compile; then |
| 16116 | if $run ./try; then |
| 16117 | d_localtime_r_needs_tzset=undef; |
| 16118 | else |
| 16119 | d_localtime_r_needs_tzset=define; |
| 16120 | fi; |
| 16121 | else |
| 16122 | d_localtime_r_needs_tzset=undef; |
| 16123 | fi; |
| 16124 | ;; |
| 16125 | *) |
| 16126 | d_localtime_r_needs_tzset=undef; |
| 16127 | ;; |
| 16128 | esac |
| 16129 | $rm_try |
| 16130 | |
| 16131 | : see if lockf exists |
| 16132 | set lockf d_lockf |
| 16133 | eval $inlibc |
| 16134 | |
| 16135 | : see if log1p exists |
| 16136 | set log1p d_log1p |
| 16137 | eval $inlibc |
| 16138 | |
| 16139 | : see if log2 exists |
| 16140 | set log2 d_log2 |
| 16141 | eval $inlibc |
| 16142 | |
| 16143 | : see if logb exists |
| 16144 | set logb d_logb |
| 16145 | eval $inlibc |
| 16146 | |
| 16147 | : see if lrint exists |
| 16148 | set lrint d_lrint |
| 16149 | eval $inlibc |
| 16150 | |
| 16151 | : see if lrintl exists |
| 16152 | set lrintl d_lrintl |
| 16153 | eval $inlibc |
| 16154 | |
| 16155 | : see if lround exists |
| 16156 | set lround d_lround |
| 16157 | eval $inlibc |
| 16158 | |
| 16159 | : see if lroundl exists |
| 16160 | set lroundl d_lroundl |
| 16161 | eval $inlibc |
| 16162 | |
| 16163 | : see if prototype for lseek is available |
| 16164 | echo " " |
| 16165 | set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h |
| 16166 | eval $hasproto |
| 16167 | |
| 16168 | : see if lstat exists |
| 16169 | set lstat d_lstat |
| 16170 | eval $inlibc |
| 16171 | |
| 16172 | : see if madvise exists |
| 16173 | set madvise d_madvise |
| 16174 | eval $inlibc |
| 16175 | |
| 16176 | : see if malloc_size exists |
| 16177 | set malloc_size d_malloc_size |
| 16178 | eval $inlibc |
| 16179 | |
| 16180 | : see if malloc_size_good exists |
| 16181 | set malloc_good_size d_malloc_good_size |
| 16182 | eval $inlibc |
| 16183 | |
| 16184 | : see if malloc_usable_size exists |
| 16185 | set malloc_usable_size d_malloc_usable_size |
| 16186 | eval $inlibc |
| 16187 | |
| 16188 | : see if mblen exists |
| 16189 | set mblen d_mblen |
| 16190 | eval $inlibc |
| 16191 | |
| 16192 | : see if mbrlen exists |
| 16193 | set mbrlen d_mbrlen |
| 16194 | eval $inlibc |
| 16195 | |
| 16196 | : see if mbrtowc exists |
| 16197 | set mbrtowc d_mbrtowc |
| 16198 | eval $inlibc |
| 16199 | |
| 16200 | : see if mbstowcs exists |
| 16201 | set mbstowcs d_mbstowcs |
| 16202 | eval $inlibc |
| 16203 | |
| 16204 | : see if mbtowc exists |
| 16205 | set mbtowc d_mbtowc |
| 16206 | eval $inlibc |
| 16207 | |
| 16208 | : see if memmem exists |
| 16209 | : We need both a prototype in string.h and the symbol in libc. |
| 16210 | echo " " |
| 16211 | d_memmem_proto='' |
| 16212 | xx1="#$d_gnulibc HAS_GNULIBC" |
| 16213 | xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)' |
| 16214 | xx3='# define _GNU_SOURCE' |
| 16215 | xx4='#endif' |
| 16216 | set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h |
| 16217 | eval $hasproto |
| 16218 | case "$d_memmem_proto" in |
| 16219 | define) # see if memmem exists |
| 16220 | set memmem d_memmem |
| 16221 | eval $inlibc |
| 16222 | ;; |
| 16223 | *) val=$undef |
| 16224 | set d_memmem |
| 16225 | eval $setvar |
| 16226 | ;; |
| 16227 | esac |
| 16228 | |
| 16229 | : see if memrchr exists |
| 16230 | : We need both a prototype in string.h and the symbol in libc. |
| 16231 | echo " " |
| 16232 | d_memrchr_proto='' |
| 16233 | xx1="#$d_gnulibc HAS_GNULIBC" |
| 16234 | xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)' |
| 16235 | xx3='# define _GNU_SOURCE' |
| 16236 | xx4='#endif' |
| 16237 | set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h |
| 16238 | eval $hasproto |
| 16239 | case "$d_memrchr_proto" in |
| 16240 | define) # see if memrchr exists |
| 16241 | set memrchr d_memrchr |
| 16242 | eval $inlibc |
| 16243 | ;; |
| 16244 | *) val=$undef |
| 16245 | set d_memrchr |
| 16246 | eval $setvar |
| 16247 | ;; |
| 16248 | esac |
| 16249 | |
| 16250 | : see if mkdir exists |
| 16251 | set mkdir d_mkdir |
| 16252 | eval $inlibc |
| 16253 | |
| 16254 | : see if mkdtemp exists |
| 16255 | set mkdtemp d_mkdtemp |
| 16256 | eval $inlibc |
| 16257 | |
| 16258 | : see if mkfifo exists |
| 16259 | set mkfifo d_mkfifo |
| 16260 | eval $inlibc |
| 16261 | |
| 16262 | : see if mkostemp exists |
| 16263 | set mkostemp d_mkostemp |
| 16264 | eval $inlibc |
| 16265 | |
| 16266 | : see if mkstemp exists |
| 16267 | set mkstemp d_mkstemp |
| 16268 | eval $inlibc |
| 16269 | |
| 16270 | : see if mkstemps exists |
| 16271 | set mkstemps d_mkstemps |
| 16272 | eval $inlibc |
| 16273 | |
| 16274 | : see if mktime exists |
| 16275 | set mktime d_mktime |
| 16276 | eval $inlibc |
| 16277 | |
| 16278 | : see if sys/mman.h has to be included |
| 16279 | set sys/mman.h i_sysmman |
| 16280 | eval $inhdr |
| 16281 | |
| 16282 | : see if mmap exists |
| 16283 | set mmap d_mmap |
| 16284 | eval $inlibc |
| 16285 | : see what shmat returns |
| 16286 | : default to something harmless |
| 16287 | mmaptype='void *' |
| 16288 | case "$i_sysmman$d_mmap" in |
| 16289 | "$define$define") |
| 16290 | $cat >mmap.c <<'END' |
| 16291 | #include <sys/mman.h> |
| 16292 | void *mmap(); |
| 16293 | END |
| 16294 | if $cc $ccflags -c mmap.c >/dev/null 2>&1; then |
| 16295 | mmaptype='void *' |
| 16296 | else |
| 16297 | mmaptype='caddr_t' |
| 16298 | fi |
| 16299 | echo "and it returns ($mmaptype)." >&4 |
| 16300 | ;; |
| 16301 | esac |
| 16302 | |
| 16303 | : see if sqrtl exists |
| 16304 | set sqrtl d_sqrtl |
| 16305 | eval $inlibc |
| 16306 | |
| 16307 | : see if scalbnl exists |
| 16308 | set scalbnl d_scalbnl |
| 16309 | eval $inlibc |
| 16310 | |
| 16311 | : see if truncl exists |
| 16312 | set truncl d_truncl |
| 16313 | eval $inlibc |
| 16314 | |
| 16315 | : see if modfl exists |
| 16316 | set modfl d_modfl |
| 16317 | eval $inlibc |
| 16318 | |
| 16319 | : see if prototype for modfl is available |
| 16320 | echo " " |
| 16321 | set d_modflproto modfl define math.h |
| 16322 | eval $hasproto |
| 16323 | |
| 16324 | if $test "$uselongdouble" = "$define"; then |
| 16325 | message="" |
| 16326 | if $test "$d_sqrtl" != "$define"; then |
| 16327 | message="$message sqrtl" |
| 16328 | fi |
| 16329 | if $test "$d_modfl" != "$define"; then |
| 16330 | if $test "$d_truncl:$d_copysignl" = "$define:$define"; then |
| 16331 | echo "You have both truncl and copysignl, so I can emulate modfl." |
| 16332 | else |
| 16333 | if $test "$d_aintl:$d_copysignl" = "$define:$define"; then |
| 16334 | echo "You have both aintl and copysignl, so I can emulate modfl." |
| 16335 | else |
| 16336 | message="$message modfl" |
| 16337 | fi |
| 16338 | fi |
| 16339 | fi |
| 16340 | if $test "$d_frexpl" != "$define"; then |
| 16341 | if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then |
| 16342 | echo "You have both ilogbl and scalbnl, so I can emulate frexpl." |
| 16343 | else |
| 16344 | message="$message frexpl" |
| 16345 | fi |
| 16346 | fi |
| 16347 | if $test "$d_ldexpl" != "$define"; then |
| 16348 | message="$message ldexpl" |
| 16349 | fi |
| 16350 | |
| 16351 | if $test "$message" != ""; then |
| 16352 | $cat <<EOM >&4 |
| 16353 | |
| 16354 | *** You requested the use of long doubles but you do not seem to have |
| 16355 | *** the following mathematical functions needed for long double support: |
| 16356 | *** $message |
| 16357 | *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits. |
| 16358 | *** Cannot continue, aborting. |
| 16359 | |
| 16360 | EOM |
| 16361 | |
| 16362 | exit 1 |
| 16363 | fi |
| 16364 | fi |
| 16365 | |
| 16366 | : see if mprotect exists |
| 16367 | set mprotect d_mprotect |
| 16368 | eval $inlibc |
| 16369 | |
| 16370 | : see if msgctl exists |
| 16371 | set msgctl d_msgctl |
| 16372 | eval $inlibc |
| 16373 | |
| 16374 | : see if msgget exists |
| 16375 | set msgget d_msgget |
| 16376 | eval $inlibc |
| 16377 | |
| 16378 | : see if msgsnd exists |
| 16379 | set msgsnd d_msgsnd |
| 16380 | eval $inlibc |
| 16381 | |
| 16382 | : see if msgrcv exists |
| 16383 | set msgrcv d_msgrcv |
| 16384 | eval $inlibc |
| 16385 | |
| 16386 | : see how much of the 'msg*(2)' library is present. |
| 16387 | h_msg=true |
| 16388 | echo " " |
| 16389 | case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in |
| 16390 | *"$undef"*) h_msg=false;; |
| 16391 | esac |
| 16392 | case "$osname" in |
| 16393 | freebsd) |
| 16394 | case "`ipcs 2>&1`" in |
| 16395 | "SVID messages"*"not configured"*) |
| 16396 | echo "Your $osname does not have the msg*(2) configured." >&4 |
| 16397 | h_msg=false |
| 16398 | val="$undef" |
| 16399 | set msgctl d_msgctl |
| 16400 | eval $setvar |
| 16401 | set msgget d_msgget |
| 16402 | eval $setvar |
| 16403 | set msgsnd d_msgsnd |
| 16404 | eval $setvar |
| 16405 | set msgrcv d_msgrcv |
| 16406 | eval $setvar |
| 16407 | ;; |
| 16408 | esac |
| 16409 | ;; |
| 16410 | esac |
| 16411 | : we could also check for sys/ipc.h ... |
| 16412 | if $h_msg && $test `./findhdr sys/msg.h`; then |
| 16413 | echo "You have the full msg*(2) library." >&4 |
| 16414 | val="$define" |
| 16415 | else |
| 16416 | echo "You don't have the full msg*(2) library." >&4 |
| 16417 | val="$undef" |
| 16418 | fi |
| 16419 | set d_msg |
| 16420 | eval $setvar |
| 16421 | |
| 16422 | : Check for msghdr_s |
| 16423 | echo " " |
| 16424 | echo "Checking to see if your system supports struct msghdr..." >&4 |
| 16425 | set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h |
| 16426 | eval $hasstruct |
| 16427 | case "$d_msghdr_s" in |
| 16428 | "$define") echo "Yes, it does." ;; |
| 16429 | *) echo "No, it doesn't." ;; |
| 16430 | esac |
| 16431 | |
| 16432 | : see if msync exists |
| 16433 | set msync d_msync |
| 16434 | eval $inlibc |
| 16435 | |
| 16436 | : see if munmap exists |
| 16437 | set munmap d_munmap |
| 16438 | eval $inlibc |
| 16439 | |
| 16440 | : see if nan exists |
| 16441 | set nan d_nan |
| 16442 | eval $inlibc |
| 16443 | |
| 16444 | : see if nanosleep exists |
| 16445 | set nanosleep d_nanosleep |
| 16446 | eval $inlibc |
| 16447 | |
| 16448 | : see if nearbyint exists |
| 16449 | set nearbyint d_nearbyint |
| 16450 | eval $inlibc |
| 16451 | |
| 16452 | : see if nextafter exists |
| 16453 | set nextafter d_nextafter |
| 16454 | eval $inlibc |
| 16455 | |
| 16456 | : see if nexttoward exists |
| 16457 | set nexttoward d_nexttoward |
| 16458 | eval $inlibc |
| 16459 | |
| 16460 | : see if nice exists |
| 16461 | set nice d_nice |
| 16462 | eval $inlibc |
| 16463 | |
| 16464 | : see if this is a langinfo.h system |
| 16465 | set langinfo.h i_langinfo |
| 16466 | eval $inhdr |
| 16467 | |
| 16468 | : see if nl_langinfo exists |
| 16469 | set nl_langinfo d_nl_langinfo |
| 16470 | eval $inlibc |
| 16471 | |
| 16472 | : see if this is a quadmath.h system |
| 16473 | set quadmath.h i_quadmath |
| 16474 | eval $inhdr |
| 16475 | |
| 16476 | : Check basic sizes |
| 16477 | echo " " |
| 16478 | $echo "Choosing the C types to be used for Perl's internal types..." >&4 |
| 16479 | |
| 16480 | case "$use64bitint:$d_quad:$quadtype" in |
| 16481 | define:define:?*) |
| 16482 | ivtype="$quadtype" |
| 16483 | uvtype="$uquadtype" |
| 16484 | ivsize=8 |
| 16485 | uvsize=8 |
| 16486 | ;; |
| 16487 | *) ivtype="long" |
| 16488 | uvtype="unsigned long" |
| 16489 | ivsize=$longsize |
| 16490 | uvsize=$longsize |
| 16491 | ;; |
| 16492 | esac |
| 16493 | |
| 16494 | case "$uselongdouble:$d_longdbl" in |
| 16495 | define:define) |
| 16496 | nvtype="long double" |
| 16497 | nvsize=$longdblsize |
| 16498 | ;; |
| 16499 | *) nvtype=double |
| 16500 | nvsize=$doublesize |
| 16501 | ;; |
| 16502 | esac |
| 16503 | |
| 16504 | case "$usequadmath:$i_quadmath" in |
| 16505 | define:define) |
| 16506 | nvtype="__float128" |
| 16507 | nvsize=16 |
| 16508 | case "$libs" in |
| 16509 | *quadmath*) ;; |
| 16510 | *) $cat <<EOM >&4 |
| 16511 | |
| 16512 | *** You requested the use of the quadmath library, but you |
| 16513 | *** do not seem to have the quadmath library installed. |
| 16514 | *** Cannot continue, aborting. |
| 16515 | EOM |
| 16516 | exit 1 |
| 16517 | ;; |
| 16518 | esac |
| 16519 | ;; |
| 16520 | define:*) $cat <<EOM >&4 |
| 16521 | |
| 16522 | *** You requested the use of the quadmath library, but you |
| 16523 | *** do not seem to have the required header, <quadmath.h>. |
| 16524 | EOM |
| 16525 | case "$gccversion" in |
| 16526 | [23].*|4.[0-5]*) |
| 16527 | $cat <<EOM >&4 |
| 16528 | *** Your gcc looks a bit old: |
| 16529 | *** $gccversion |
| 16530 | EOM |
| 16531 | ;; |
| 16532 | '') |
| 16533 | $cat <<EOM >&4 |
| 16534 | *** You are not running a gcc. |
| 16535 | EOM |
| 16536 | ;; |
| 16537 | esac |
| 16538 | $cat <<EOM >&4 |
| 16539 | *** For the quadmath library you need at least gcc 4.6. |
| 16540 | *** Cannot continue, aborting. |
| 16541 | EOM |
| 16542 | exit 1 |
| 16543 | ;; |
| 16544 | esac |
| 16545 | |
| 16546 | $echo "(IV will be "$ivtype", $ivsize bytes)" |
| 16547 | $echo "(UV will be "$uvtype", $uvsize bytes)" |
| 16548 | $echo "(NV will be "$nvtype", $nvsize bytes)" |
| 16549 | |
| 16550 | $cat >try.c <<EOCP |
| 16551 | #$i_inttypes I_INTTYPES |
| 16552 | #ifdef I_INTTYPES |
| 16553 | #include <inttypes.h> |
| 16554 | #endif |
| 16555 | #include <stdio.h> |
| 16556 | int main() { |
| 16557 | #ifdef INT8 |
| 16558 | int8_t i = INT8_MAX; |
| 16559 | uint8_t u = UINT8_MAX; |
| 16560 | printf("int8_t\n"); |
| 16561 | #endif |
| 16562 | #ifdef INT16 |
| 16563 | int16_t i = INT16_MAX; |
| 16564 | uint16_t u = UINT16_MAX; |
| 16565 | printf("int16_t\n"); |
| 16566 | #endif |
| 16567 | #ifdef INT32 |
| 16568 | int32_t i = INT32_MAX; |
| 16569 | uint32_t u = UINT32_MAX; |
| 16570 | printf("int32_t\n"); |
| 16571 | #endif |
| 16572 | } |
| 16573 | EOCP |
| 16574 | |
| 16575 | i8type="signed char" |
| 16576 | u8type="unsigned char" |
| 16577 | i8size=1 |
| 16578 | u8size=1 |
| 16579 | |
| 16580 | case "$i16type" in |
| 16581 | '') case "$shortsize" in |
| 16582 | 2) i16type=short |
| 16583 | u16type="unsigned short" |
| 16584 | i16size=$shortsize |
| 16585 | u16size=$shortsize |
| 16586 | ;; |
| 16587 | esac |
| 16588 | ;; |
| 16589 | esac |
| 16590 | case "$i16type" in |
| 16591 | '') set try -DINT16 |
| 16592 | if eval $compile; then |
| 16593 | case "`$run ./try`" in |
| 16594 | int16_t) |
| 16595 | i16type=int16_t |
| 16596 | u16type=uint16_t |
| 16597 | i16size=2 |
| 16598 | u16size=2 |
| 16599 | ;; |
| 16600 | esac |
| 16601 | fi |
| 16602 | ;; |
| 16603 | esac |
| 16604 | case "$i16type" in |
| 16605 | '') if $test $shortsize -ge 2; then |
| 16606 | i16type=short |
| 16607 | u16type="unsigned short" |
| 16608 | i16size=$shortsize |
| 16609 | u16size=$shortsize |
| 16610 | fi |
| 16611 | ;; |
| 16612 | esac |
| 16613 | |
| 16614 | case "$i32type" in |
| 16615 | '') case "$longsize" in |
| 16616 | 4) i32type=long |
| 16617 | u32type="unsigned long" |
| 16618 | i32size=$longsize |
| 16619 | u32size=$longsize |
| 16620 | ;; |
| 16621 | *) case "$intsize" in |
| 16622 | 4) i32type=int |
| 16623 | u32type="unsigned int" |
| 16624 | i32size=$intsize |
| 16625 | u32size=$intsize |
| 16626 | ;; |
| 16627 | esac |
| 16628 | ;; |
| 16629 | esac |
| 16630 | ;; |
| 16631 | esac |
| 16632 | case "$i32type" in |
| 16633 | '') set try -DINT32 |
| 16634 | if eval $compile; then |
| 16635 | case "`$run ./try`" in |
| 16636 | int32_t) |
| 16637 | i32type=int32_t |
| 16638 | u32type=uint32_t |
| 16639 | i32size=4 |
| 16640 | u32size=4 |
| 16641 | ;; |
| 16642 | esac |
| 16643 | fi |
| 16644 | ;; |
| 16645 | esac |
| 16646 | case "$i32type" in |
| 16647 | '') if $test $intsize -ge 4; then |
| 16648 | i32type=int |
| 16649 | u32type="unsigned int" |
| 16650 | i32size=$intsize |
| 16651 | u32size=$intsize |
| 16652 | fi |
| 16653 | ;; |
| 16654 | esac |
| 16655 | |
| 16656 | case "$i64type" in |
| 16657 | '') case "$d_quad:$quadtype" in |
| 16658 | define:?*) |
| 16659 | i64type="$quadtype" |
| 16660 | u64type="$uquadtype" |
| 16661 | i64size=8 |
| 16662 | u64size=8 |
| 16663 | ;; |
| 16664 | esac |
| 16665 | ;; |
| 16666 | esac |
| 16667 | |
| 16668 | $echo "Checking how many bits of your UVs your NVs can preserve..." >&4 |
| 16669 | $cat <<EOP >try.c |
| 16670 | #include <stdio.h> |
| 16671 | #$i_stdlib I_STDLIB |
| 16672 | #ifdef I_STDLIB |
| 16673 | #include <stdlib.h> |
| 16674 | #endif |
| 16675 | #include <sys/types.h> |
| 16676 | #include <signal.h> |
| 16677 | #ifdef SIGFPE |
| 16678 | /* volatile so that the compiler has to store it out to memory */ |
| 16679 | volatile int bletched = 0; |
| 16680 | $signal_t blech(int s) { bletched = 1; } |
| 16681 | #endif |
| 16682 | int main() { |
| 16683 | $uvtype u = 0; |
| 16684 | $nvtype d; |
| 16685 | int n = 8 * $uvsize; |
| 16686 | int i; |
| 16687 | #ifdef SIGFPE |
| 16688 | signal(SIGFPE, blech); |
| 16689 | #endif |
| 16690 | |
| 16691 | for (i = 0; i < n; i++) { |
| 16692 | u = u << 1 | ($uvtype)1; |
| 16693 | d = ($nvtype)u; |
| 16694 | if (($uvtype)d != u) |
| 16695 | break; |
| 16696 | if (d <= 0) |
| 16697 | break; |
| 16698 | d = ($nvtype)(u - 1); |
| 16699 | if (($uvtype)d != (u - 1)) |
| 16700 | break; |
| 16701 | #ifdef SIGFPE |
| 16702 | if (bletched) |
| 16703 | break; |
| 16704 | #endif |
| 16705 | } |
| 16706 | printf("%d\n", ((i == n) ? -n : i)); |
| 16707 | exit(0); |
| 16708 | } |
| 16709 | EOP |
| 16710 | set try |
| 16711 | |
| 16712 | d_nv_preserves_uv="$undef" |
| 16713 | if eval $compile; then |
| 16714 | nv_preserves_uv_bits="`$run ./try`" |
| 16715 | fi |
| 16716 | case "$nv_preserves_uv_bits" in |
| 16717 | \-[1-9]*) |
| 16718 | nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits` |
| 16719 | $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1 |
| 16720 | d_nv_preserves_uv="$define" |
| 16721 | ;; |
| 16722 | [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1 |
| 16723 | d_nv_preserves_uv="$undef" ;; |
| 16724 | *) $echo "Can't figure out how many bits your NVs preserve." 2>&1 |
| 16725 | nv_preserves_uv_bits="0" ;; |
| 16726 | esac |
| 16727 | $rm_try |
| 16728 | |
| 16729 | $echo "Checking to find the largest integer value your NVs can hold..." >&4 |
| 16730 | $cat <<EOP >try.c |
| 16731 | #include <stdio.h> |
| 16732 | |
| 16733 | typedef $nvtype NV; |
| 16734 | |
| 16735 | int |
| 16736 | main() { |
| 16737 | NV value = 2; |
| 16738 | int count = 1; |
| 16739 | |
| 16740 | while(count < 256) { |
| 16741 | /* volatile so that the compiler has to store it out to memory */ |
| 16742 | volatile NV up = value + 1.0; |
| 16743 | volatile NV negated = -value; |
| 16744 | volatile NV down = negated - 1.0; |
| 16745 | volatile NV got_up = up - value; |
| 16746 | int up_good = got_up == 1.0; |
| 16747 | int got_down = down - negated; |
| 16748 | int down_good = got_down == -1.0; |
| 16749 | |
| 16750 | if (down_good != up_good) { |
| 16751 | fprintf(stderr, |
| 16752 | "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n", |
| 16753 | up_good, (double) got_up, down_good, (double) got_down, |
| 16754 | count, (double) value); |
| 16755 | return 1; |
| 16756 | } |
| 16757 | if (!up_good) { |
| 16758 | while (1) { |
| 16759 | if (count > 8) { |
| 16760 | count -= 8; |
| 16761 | fputs("256.0", stdout); |
| 16762 | } else { |
| 16763 | count--; |
| 16764 | fputs("2.0", stdout); |
| 16765 | } |
| 16766 | if (!count) { |
| 16767 | puts(""); |
| 16768 | return 0; |
| 16769 | } |
| 16770 | fputs("*", stdout); |
| 16771 | } |
| 16772 | } |
| 16773 | value *= 2; |
| 16774 | ++count; |
| 16775 | } |
| 16776 | fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n", |
| 16777 | count, (double) value); |
| 16778 | return 1; |
| 16779 | } |
| 16780 | EOP |
| 16781 | set try |
| 16782 | |
| 16783 | nv_overflows_integers_at='0' |
| 16784 | if eval $compile; then |
| 16785 | xxx="`$run ./try`" |
| 16786 | case "$?" in |
| 16787 | 0) |
| 16788 | case "$xxx" in |
| 16789 | 2*) cat >&4 <<EOM |
| 16790 | The largest integer your NVs can preserve is equal to $xxx |
| 16791 | EOM |
| 16792 | nv_overflows_integers_at="$xxx" |
| 16793 | ;; |
| 16794 | *) cat >&4 <<EOM |
| 16795 | Cannot determine the largest integer value your NVs can hold, unexpected output |
| 16796 | '$xxx' |
| 16797 | EOM |
| 16798 | ;; |
| 16799 | esac |
| 16800 | ;; |
| 16801 | *) cat >&4 <<EOM |
| 16802 | Cannot determine the largest integer value your NVs can hold |
| 16803 | EOM |
| 16804 | ;; |
| 16805 | esac |
| 16806 | fi |
| 16807 | $rm_try |
| 16808 | |
| 16809 | $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4 |
| 16810 | $cat <<EOP >try.c |
| 16811 | #include <stdio.h> |
| 16812 | #$i_stdlib I_STDLIB |
| 16813 | #ifdef I_STDLIB |
| 16814 | #include <stdlib.h> |
| 16815 | #endif |
| 16816 | #include <string.h> |
| 16817 | #include <sys/types.h> |
| 16818 | #include <signal.h> |
| 16819 | #ifdef SIGFPE |
| 16820 | /* volatile so that the compiler has to store it out to memory */ |
| 16821 | volatile int bletched = 0; |
| 16822 | $signal_t blech(int s) { bletched = 1; } |
| 16823 | #endif |
| 16824 | |
| 16825 | int checkit($nvtype d, const char *where) { |
| 16826 | void *v = &d; |
| 16827 | unsigned char *p = (unsigned char *)v; |
| 16828 | unsigned char *end = p + sizeof(d); |
| 16829 | int fail = 0; |
| 16830 | |
| 16831 | while (p < end) |
| 16832 | fail += *p++; |
| 16833 | |
| 16834 | if (!fail) |
| 16835 | return 0; |
| 16836 | |
| 16837 | p = (unsigned char *)v; |
| 16838 | printf("No - %s: 0x", where); |
| 16839 | while (p < end) |
| 16840 | printf ("%02X", *p++); |
| 16841 | printf("\n"); |
| 16842 | return 1; |
| 16843 | } |
| 16844 | |
| 16845 | int main(int argc, char **argv) { |
| 16846 | $nvtype d = 0.0; |
| 16847 | int fail = 0; |
| 16848 | fail += checkit(d, "0.0"); |
| 16849 | |
| 16850 | /* The compiler shouldn't be assuming that bletched is 0 */ |
| 16851 | d = bletched; |
| 16852 | |
| 16853 | fail += checkit(d, "bleched"); |
| 16854 | |
| 16855 | #ifdef SIGFPE |
| 16856 | signal(SIGFPE, blech); |
| 16857 | #endif |
| 16858 | |
| 16859 | /* Paranoia - the compiler should have no way of knowing that ANSI says |
| 16860 | that argv[argc] will always be NULL. Actually, if it did assume this it |
| 16861 | would be buggy, as this is C and main() can be called from elsewhere in |
| 16862 | the program. */ |
| 16863 | d = argv[argc] ? 1 : 0; |
| 16864 | |
| 16865 | if (d) { |
| 16866 | printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d); |
| 16867 | } |
| 16868 | |
| 16869 | fail += checkit(d, "ternary"); |
| 16870 | |
| 16871 | memset(&d, sizeof(d), argv[argc] ? 1 : 0); |
| 16872 | |
| 16873 | if (d != 0.0) { |
| 16874 | printf("No - memset doesn't give 0.0\n"); |
| 16875 | /* This might just blow up: */ |
| 16876 | printf("(gives %g)\n", d); |
| 16877 | return 1; |
| 16878 | } |
| 16879 | |
| 16880 | #ifdef SIGFPE |
| 16881 | if (bletched) { |
| 16882 | printf("No - something bleched\n"); |
| 16883 | return 1; |
| 16884 | } |
| 16885 | #endif |
| 16886 | if (fail) { |
| 16887 | printf("No - %d fail(s)\n", fail); |
| 16888 | return 1; |
| 16889 | } |
| 16890 | printf("Yes\n"); |
| 16891 | return 0; |
| 16892 | } |
| 16893 | EOP |
| 16894 | set try |
| 16895 | |
| 16896 | d_nv_zero_is_allbits_zero="$undef" |
| 16897 | if eval $compile; then |
| 16898 | xxx="`$run ./try`" |
| 16899 | case "$?" in |
| 16900 | 0) |
| 16901 | case "$xxx" in |
| 16902 | Yes) cat >&4 <<EOM |
| 16903 | 0.0 is represented as all bits zero in memory |
| 16904 | EOM |
| 16905 | d_nv_zero_is_allbits_zero="$define" |
| 16906 | ;; |
| 16907 | *) cat >&4 <<EOM |
| 16908 | 0.0 is not represented as all bits zero in memory |
| 16909 | EOM |
| 16910 | d_nv_zero_is_allbits_zero="$undef" |
| 16911 | ;; |
| 16912 | esac |
| 16913 | ;; |
| 16914 | *) cat >&4 <<EOM |
| 16915 | 0.0 is not represented as all bits zero in memory |
| 16916 | EOM |
| 16917 | d_nv_zero_is_allbits_zero="$undef" |
| 16918 | ;; |
| 16919 | esac |
| 16920 | fi |
| 16921 | $rm_try |
| 16922 | |
| 16923 | : check for off64_t |
| 16924 | echo " " |
| 16925 | echo "Checking to see if you have off64_t..." >&4 |
| 16926 | $cat >try.c <<EOCP |
| 16927 | #include <sys/types.h> |
| 16928 | #include <unistd.h> |
| 16929 | int main() { off64_t x = 7; } |
| 16930 | EOCP |
| 16931 | set try |
| 16932 | if eval $compile; then |
| 16933 | val="$define" |
| 16934 | echo "You have off64_t." |
| 16935 | else |
| 16936 | val="$undef" |
| 16937 | echo "You do not have off64_t." |
| 16938 | case "$lseeksize" in |
| 16939 | 8) echo "(Your off_t is 64 bits, so you could use that.)" ;; |
| 16940 | esac |
| 16941 | fi |
| 16942 | $rm_try |
| 16943 | set d_off64_t |
| 16944 | eval $setvar |
| 16945 | |
| 16946 | : how to create joinable pthreads |
| 16947 | if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then |
| 16948 | echo " " |
| 16949 | echo "Checking what constant to use for creating joinable pthreads..." >&4 |
| 16950 | $cat >try.c <<'EOCP' |
| 16951 | #include <pthread.h> |
| 16952 | int main() { |
| 16953 | int detachstate = JOINABLE; |
| 16954 | } |
| 16955 | EOCP |
| 16956 | set try -DJOINABLE=PTHREAD_CREATE_JOINABLE |
| 16957 | if eval $compile; then |
| 16958 | echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4 |
| 16959 | val="$undef" # Yes, undef. |
| 16960 | set d_old_pthread_create_joinable |
| 16961 | eval $setvar |
| 16962 | val="" |
| 16963 | set old_pthread_create_joinable |
| 16964 | eval $setvar |
| 16965 | else |
| 16966 | set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED |
| 16967 | if eval $compile; then |
| 16968 | echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4 |
| 16969 | val="$define" |
| 16970 | set d_old_pthread_create_joinable |
| 16971 | eval $setvar |
| 16972 | val=PTHREAD_CREATE_UNDETACHED |
| 16973 | set old_pthread_create_joinable |
| 16974 | eval $setvar |
| 16975 | else |
| 16976 | set try -DJOINABLE=__UNDETACHED |
| 16977 | if eval $compile; then |
| 16978 | echo "You seem to use __UNDETACHED." >&4 |
| 16979 | val="$define" |
| 16980 | set d_old_pthread_create_joinable |
| 16981 | eval $setvar |
| 16982 | val=__UNDETACHED |
| 16983 | set old_pthread_create_joinable |
| 16984 | eval $setvar |
| 16985 | else |
| 16986 | echo "Egads, nothing obvious found. Guessing that you use 0." >&4 |
| 16987 | val="$define" |
| 16988 | set d_old_pthread_create_joinable |
| 16989 | eval $setvar |
| 16990 | val=0 |
| 16991 | set old_pthread_create_joinable |
| 16992 | eval $setvar |
| 16993 | fi |
| 16994 | fi |
| 16995 | fi |
| 16996 | $rm_try |
| 16997 | else |
| 16998 | d_old_pthread_create_joinable="$undef" |
| 16999 | old_pthread_create_joinable="" |
| 17000 | fi |
| 17001 | |
| 17002 | : see if pause exists |
| 17003 | set pause d_pause |
| 17004 | eval $inlibc |
| 17005 | |
| 17006 | : see if pipe2 exists |
| 17007 | set pipe2 d_pipe2 |
| 17008 | eval $inlibc |
| 17009 | |
| 17010 | : see if poll exists |
| 17011 | set poll d_poll |
| 17012 | eval $inlibc |
| 17013 | |
| 17014 | : see if prctl exists |
| 17015 | set prctl d_prctl |
| 17016 | eval $inlibc |
| 17017 | |
| 17018 | : see if prctl supports PR_SET_NAME |
| 17019 | d_prctl_set_name=$undef |
| 17020 | case $d_prctl in |
| 17021 | $define) |
| 17022 | $cat >try.c <<EOM |
| 17023 | #ifdef __ANDROID__ |
| 17024 | #include <unistd.h> |
| 17025 | #endif |
| 17026 | #include <sys/prctl.h> |
| 17027 | |
| 17028 | int main (int argc, char *argv[]) |
| 17029 | { |
| 17030 | return (prctl (PR_SET_NAME, "Test")); |
| 17031 | } /* main */ |
| 17032 | EOM |
| 17033 | set try |
| 17034 | if eval $compile_ok && $run ./try; then |
| 17035 | echo "Your prctl (PR_SET_NAME, ...) works" |
| 17036 | d_prctl_set_name=$define |
| 17037 | fi |
| 17038 | $rm_try |
| 17039 | ;; |
| 17040 | esac |
| 17041 | |
| 17042 | : see if readlink exists |
| 17043 | set readlink d_readlink |
| 17044 | eval $inlibc |
| 17045 | |
| 17046 | : Check if there is a /proc symlink to the abs path of |
| 17047 | : the executing program. We will honor hints of d_procselfexe=$undef |
| 17048 | : or procselfexe being non-empty, otherwise will try to determine both |
| 17049 | : if we have readlink. |
| 17050 | : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is |
| 17051 | : referenced, and AmigaOS does not have a proc filesystem anyway. |
| 17052 | echo " " |
| 17053 | val="$undef" |
| 17054 | if $test "X$d_procselfexe" = Xundef; then |
| 17055 | procselfexe='' |
| 17056 | elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then |
| 17057 | val="$define" |
| 17058 | elif $test "X$d_readlink" = Xdefine; then |
| 17059 | : NetBSD first as /proc/self is a symlink to /proc/curproc, |
| 17060 | : and it feels more tidy to avoid an extra level of symlink |
| 17061 | set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out |
| 17062 | while test $# -gt 0; do |
| 17063 | type=$1; try=$2 |
| 17064 | shift; shift |
| 17065 | if $issymlink $try; then |
| 17066 | $ls -l $try > reflect |
| 17067 | if $contains /`basename $ls` reflect >/dev/null 2>&1; then |
| 17068 | echo "You have $type-like $try." |
| 17069 | procselfexe='"'$try'"' |
| 17070 | val="$define" |
| 17071 | : This will break out of the loop |
| 17072 | set X; shift |
| 17073 | fi |
| 17074 | fi |
| 17075 | done |
| 17076 | fi |
| 17077 | $rm -f reflect |
| 17078 | set d_procselfexe |
| 17079 | eval $setvar |
| 17080 | |
| 17081 | : backward compatibility for d_hvfork |
| 17082 | if test X$d_hvfork != X; then |
| 17083 | d_vfork="$d_hvfork" |
| 17084 | d_hvfork='' |
| 17085 | fi |
| 17086 | : see if there is a vfork |
| 17087 | val='' |
| 17088 | set vfork val |
| 17089 | eval $inlibc |
| 17090 | |
| 17091 | d_pseudofork=$undef |
| 17092 | |
| 17093 | : Ok, but do we want to use it. vfork is reportedly unreliable in |
| 17094 | : perl on Solaris 2.x, and probably elsewhere. |
| 17095 | case "$val" in |
| 17096 | $define) |
| 17097 | echo " " |
| 17098 | case "$usevfork" in |
| 17099 | false) dflt='n';; |
| 17100 | *) dflt='y';; |
| 17101 | esac |
| 17102 | cat <<'EOM' |
| 17103 | |
| 17104 | Perl can only use a vfork() that doesn't suffer from strict |
| 17105 | restrictions on calling functions or modifying global data in |
| 17106 | the child. For example, glibc-2.1 contains such a vfork() |
| 17107 | that is unsuitable. If your system provides a proper fork() |
| 17108 | call, chances are that you do NOT want perl to use vfork(). |
| 17109 | |
| 17110 | EOM |
| 17111 | rp="Do you still want to use vfork()?" |
| 17112 | . ./myread |
| 17113 | case "$ans" in |
| 17114 | y|Y) ;; |
| 17115 | *) |
| 17116 | echo "Ok, we won't use vfork()." |
| 17117 | val="$undef" |
| 17118 | ;; |
| 17119 | esac |
| 17120 | ;; |
| 17121 | esac |
| 17122 | set d_vfork |
| 17123 | eval $setvar |
| 17124 | case "$d_vfork" in |
| 17125 | $define) usevfork='true';; |
| 17126 | *) usevfork='false';; |
| 17127 | esac |
| 17128 | |
| 17129 | : see whether the pthread_atfork exists |
| 17130 | $cat >try.c <<EOP |
| 17131 | #include <pthread.h> |
| 17132 | #include <stdio.h> |
| 17133 | int main() { |
| 17134 | #ifdef PTHREAD_ATFORK |
| 17135 | pthread_atfork(NULL,NULL,NULL); |
| 17136 | #endif |
| 17137 | } |
| 17138 | EOP |
| 17139 | |
| 17140 | : see if pthread_atfork exists |
| 17141 | set try -DPTHREAD_ATFORK |
| 17142 | if eval $compile; then |
| 17143 | val="$define" |
| 17144 | else |
| 17145 | val="$undef" |
| 17146 | fi |
| 17147 | case "$usethreads" in |
| 17148 | $define) |
| 17149 | case "$val" in |
| 17150 | $define) echo 'pthread_atfork found.' >&4 ;; |
| 17151 | *) echo 'pthread_atfork NOT found.' >&4 ;; |
| 17152 | esac |
| 17153 | esac |
| 17154 | set d_pthread_atfork |
| 17155 | eval $setvar |
| 17156 | |
| 17157 | : see if pthread_attr_setscope exists |
| 17158 | set pthread_attr_setscope d_pthread_attr_setscope |
| 17159 | eval $inlibc |
| 17160 | |
| 17161 | : see whether the various POSIXish _yields exist |
| 17162 | $cat >try.c <<EOP |
| 17163 | #include <pthread.h> |
| 17164 | #include <stdio.h> |
| 17165 | int main() { |
| 17166 | #ifdef SCHED_YIELD |
| 17167 | sched_yield(); |
| 17168 | #else |
| 17169 | #ifdef PTHREAD_YIELD |
| 17170 | pthread_yield(); |
| 17171 | #else |
| 17172 | #ifdef PTHREAD_YIELD_NULL |
| 17173 | pthread_yield(NULL); |
| 17174 | #endif |
| 17175 | #endif |
| 17176 | #endif |
| 17177 | } |
| 17178 | EOP |
| 17179 | : see if sched_yield exists |
| 17180 | set try -DSCHED_YIELD |
| 17181 | if eval $compile; then |
| 17182 | val="$define" |
| 17183 | sched_yield='sched_yield()' |
| 17184 | else |
| 17185 | val="$undef" |
| 17186 | fi |
| 17187 | case "$usethreads" in |
| 17188 | $define) |
| 17189 | case "$val" in |
| 17190 | $define) echo 'sched_yield() found.' >&4 ;; |
| 17191 | *) echo 'sched_yield() NOT found.' >&4 ;; |
| 17192 | esac |
| 17193 | esac |
| 17194 | set d_sched_yield |
| 17195 | eval $setvar |
| 17196 | |
| 17197 | : see if pthread_yield exists |
| 17198 | set try -DPTHREAD_YIELD |
| 17199 | if eval $compile; then |
| 17200 | val="$define" |
| 17201 | case "$sched_yield" in |
| 17202 | '') sched_yield='pthread_yield()' ;; |
| 17203 | esac |
| 17204 | else |
| 17205 | set try -DPTHREAD_YIELD_NULL |
| 17206 | if eval $compile; then |
| 17207 | val="$define" |
| 17208 | case "$sched_yield" in |
| 17209 | '') sched_yield='pthread_yield(NULL)' ;; |
| 17210 | esac |
| 17211 | else |
| 17212 | val="$undef" |
| 17213 | fi |
| 17214 | fi |
| 17215 | case "$usethreads" in |
| 17216 | $define) |
| 17217 | case "$val" in |
| 17218 | $define) echo 'pthread_yield() found.' >&4 ;; |
| 17219 | *) echo 'pthread_yield() NOT found.' >&4 ;; |
| 17220 | esac |
| 17221 | ;; |
| 17222 | esac |
| 17223 | set d_pthread_yield |
| 17224 | eval $setvar |
| 17225 | case "$sched_yield" in |
| 17226 | '') sched_yield=undef ;; |
| 17227 | esac |
| 17228 | $rm_try |
| 17229 | |
| 17230 | : check for ptrdiff_t |
| 17231 | echo " " |
| 17232 | echo "Checking to see if you have ptrdiff_t..." >&4 |
| 17233 | $cat >try.c <<EOCP |
| 17234 | #include <stddef.h> |
| 17235 | int main() { ptrdiff_t x = 7; } |
| 17236 | EOCP |
| 17237 | set try |
| 17238 | if eval $compile; then |
| 17239 | val="$define" |
| 17240 | echo "You have ptrdiff_t." |
| 17241 | else |
| 17242 | val="$undef" |
| 17243 | echo "You do not have ptrdiff_t." |
| 17244 | fi |
| 17245 | $rm_try |
| 17246 | set d_ptrdiff_t |
| 17247 | eval $setvar |
| 17248 | |
| 17249 | : see if random_r exists |
| 17250 | set random_r d_random_r |
| 17251 | eval $inlibc |
| 17252 | case "$d_random_r" in |
| 17253 | "$define") |
| 17254 | hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h" |
| 17255 | case "$d_random_r_proto:$usethreads" in |
| 17256 | ":define") d_random_r_proto=define |
| 17257 | set d_random_r_proto random_r $hdrs |
| 17258 | eval $hasproto ;; |
| 17259 | *) ;; |
| 17260 | esac |
| 17261 | case "$d_random_r_proto" in |
| 17262 | define) |
| 17263 | case "$random_r_proto" in |
| 17264 | ''|0) try='int random_r(int*, struct random_data*);' |
| 17265 | ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;; |
| 17266 | esac |
| 17267 | case "$random_r_proto" in |
| 17268 | ''|0) try='int random_r(long*, struct random_data*);' |
| 17269 | ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;; |
| 17270 | esac |
| 17271 | case "$random_r_proto" in |
| 17272 | ''|0) try='int random_r(struct random_data*, int32_t*);' |
| 17273 | ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;; |
| 17274 | esac |
| 17275 | case "$random_r_proto" in |
| 17276 | ''|0) d_random_r=undef |
| 17277 | random_r_proto=0 |
| 17278 | echo "Disabling random_r, cannot determine prototype." >&4 ;; |
| 17279 | * ) case "$random_r_proto" in |
| 17280 | REENTRANT_PROTO*) ;; |
| 17281 | *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;; |
| 17282 | esac |
| 17283 | echo "Prototype: $try" ;; |
| 17284 | esac |
| 17285 | ;; |
| 17286 | *) case "$usethreads" in |
| 17287 | define) echo "random_r has no prototype, not using it." >&4 ;; |
| 17288 | esac |
| 17289 | d_random_r=undef |
| 17290 | random_r_proto=0 |
| 17291 | ;; |
| 17292 | esac |
| 17293 | ;; |
| 17294 | *) random_r_proto=0 |
| 17295 | ;; |
| 17296 | esac |
| 17297 | |
| 17298 | : see if readdir and friends exist |
| 17299 | set readdir d_readdir |
| 17300 | eval $inlibc |
| 17301 | set seekdir d_seekdir |
| 17302 | eval $inlibc |
| 17303 | set telldir d_telldir |
| 17304 | eval $inlibc |
| 17305 | set rewinddir d_rewinddir |
| 17306 | eval $inlibc |
| 17307 | |
| 17308 | : see if readdir64_r exists |
| 17309 | set readdir64_r d_readdir64_r |
| 17310 | eval $inlibc |
| 17311 | case "$d_readdir64_r" in |
| 17312 | "$define") |
| 17313 | hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h" |
| 17314 | case "$d_readdir64_r_proto:$usethreads" in |
| 17315 | ":define") d_readdir64_r_proto=define |
| 17316 | set d_readdir64_r_proto readdir64_r $hdrs |
| 17317 | eval $hasproto ;; |
| 17318 | *) ;; |
| 17319 | esac |
| 17320 | case "$d_readdir64_r_proto" in |
| 17321 | define) |
| 17322 | case "$readdir64_r_proto" in |
| 17323 | ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);' |
| 17324 | ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;; |
| 17325 | esac |
| 17326 | case "$readdir64_r_proto" in |
| 17327 | ''|0) try='int readdir64_r(DIR*, struct dirent64*);' |
| 17328 | ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;; |
| 17329 | esac |
| 17330 | case "$readdir64_r_proto" in |
| 17331 | ''|0) d_readdir64_r=undef |
| 17332 | readdir64_r_proto=0 |
| 17333 | echo "Disabling readdir64_r, cannot determine prototype." >&4 ;; |
| 17334 | * ) case "$readdir64_r_proto" in |
| 17335 | REENTRANT_PROTO*) ;; |
| 17336 | *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;; |
| 17337 | esac |
| 17338 | echo "Prototype: $try" ;; |
| 17339 | esac |
| 17340 | ;; |
| 17341 | *) case "$usethreads" in |
| 17342 | define) echo "readdir64_r has no prototype, not using it." >&4 ;; |
| 17343 | esac |
| 17344 | d_readdir64_r=undef |
| 17345 | readdir64_r_proto=0 |
| 17346 | ;; |
| 17347 | esac |
| 17348 | ;; |
| 17349 | *) readdir64_r_proto=0 |
| 17350 | ;; |
| 17351 | esac |
| 17352 | |
| 17353 | : see if readdir_r exists |
| 17354 | set readdir_r d_readdir_r |
| 17355 | eval $inlibc |
| 17356 | case "$d_readdir_r" in |
| 17357 | "$define") |
| 17358 | hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h" |
| 17359 | case "$d_readdir_r_proto:$usethreads" in |
| 17360 | ":define") d_readdir_r_proto=define |
| 17361 | set d_readdir_r_proto readdir_r $hdrs |
| 17362 | eval $hasproto ;; |
| 17363 | *) ;; |
| 17364 | esac |
| 17365 | case "$d_readdir_r_proto" in |
| 17366 | define) |
| 17367 | case "$readdir_r_proto" in |
| 17368 | ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);' |
| 17369 | ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;; |
| 17370 | esac |
| 17371 | case "$readdir_r_proto" in |
| 17372 | ''|0) try='int readdir_r(DIR*, struct dirent*);' |
| 17373 | ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;; |
| 17374 | esac |
| 17375 | case "$readdir_r_proto" in |
| 17376 | ''|0) d_readdir_r=undef |
| 17377 | readdir_r_proto=0 |
| 17378 | echo "Disabling readdir_r, cannot determine prototype." >&4 ;; |
| 17379 | * ) case "$readdir_r_proto" in |
| 17380 | REENTRANT_PROTO*) ;; |
| 17381 | *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;; |
| 17382 | esac |
| 17383 | echo "Prototype: $try" ;; |
| 17384 | esac |
| 17385 | ;; |
| 17386 | *) case "$usethreads" in |
| 17387 | define) echo "readdir_r has no prototype, not using it." >&4 ;; |
| 17388 | esac |
| 17389 | d_readdir_r=undef |
| 17390 | readdir_r_proto=0 |
| 17391 | ;; |
| 17392 | esac |
| 17393 | ;; |
| 17394 | *) readdir_r_proto=0 |
| 17395 | ;; |
| 17396 | esac |
| 17397 | |
| 17398 | : see if readv exists |
| 17399 | set readv d_readv |
| 17400 | eval $inlibc |
| 17401 | |
| 17402 | : see if recvmsg exists |
| 17403 | set recvmsg d_recvmsg |
| 17404 | eval $inlibc |
| 17405 | |
| 17406 | : see if regcomp, regcmp, or re_comp exist, for regular pattern matching |
| 17407 | echo " " |
| 17408 | if set regcomp val -f d_regcomp; eval $csym; $val; then |
| 17409 | echo 'regcomp() found.' >&4 |
| 17410 | d_regcomp="$define" |
| 17411 | d_regcmp="$undef" |
| 17412 | d_re_comp="$undef" |
| 17413 | elif set regcmp val -f d_regcmp; eval $csym; $val; then |
| 17414 | echo 'regcmp() found.' >&4 |
| 17415 | d_regcmp="$define" |
| 17416 | d_regcomp="$undef" |
| 17417 | d_re_comp="$undef" |
| 17418 | elif set re_comp val -f d_re_comp; eval $csym; $val; then |
| 17419 | echo 're_comp() found, assuming re_exec() also exists.' >&4 |
| 17420 | d_re_comp="$define" |
| 17421 | d_regcomp="$undef" |
| 17422 | d_regcmp="$undef" |
| 17423 | else |
| 17424 | $cat >&4 <<EOM |
| 17425 | No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching. |
| 17426 | EOM |
| 17427 | d_regcmp="$undef" |
| 17428 | d_re_comp="$undef" |
| 17429 | d_regcomp="$undef" |
| 17430 | fi |
| 17431 | |
| 17432 | : see if remainder exists |
| 17433 | set remainder d_remainder |
| 17434 | eval $inlibc |
| 17435 | |
| 17436 | : see if remquo exists |
| 17437 | set remquo d_remquo |
| 17438 | eval $inlibc |
| 17439 | |
| 17440 | : see if rename exists |
| 17441 | set rename d_rename |
| 17442 | eval $inlibc |
| 17443 | |
| 17444 | : see if rint exists |
| 17445 | set rint d_rint |
| 17446 | eval $inlibc |
| 17447 | |
| 17448 | : see if rmdir exists |
| 17449 | set rmdir d_rmdir |
| 17450 | eval $inlibc |
| 17451 | |
| 17452 | : see if round exists |
| 17453 | set round d_round |
| 17454 | eval $inlibc |
| 17455 | |
| 17456 | : see if prototype for sbrk is available |
| 17457 | echo " " |
| 17458 | set d_sbrkproto sbrk $i_unistd unistd.h |
| 17459 | eval $hasproto |
| 17460 | |
| 17461 | : see if scalbn exists |
| 17462 | set scalbn d_scalbn |
| 17463 | eval $inlibc |
| 17464 | |
| 17465 | : see if select exists |
| 17466 | set select d_select |
| 17467 | eval $inlibc |
| 17468 | |
| 17469 | : see if semctl exists |
| 17470 | set semctl d_semctl |
| 17471 | eval $inlibc |
| 17472 | |
| 17473 | : see if semget exists |
| 17474 | set semget d_semget |
| 17475 | eval $inlibc |
| 17476 | |
| 17477 | : see if semop exists |
| 17478 | set semop d_semop |
| 17479 | eval $inlibc |
| 17480 | |
| 17481 | : see how much of the 'sem*(2)' library is present. |
| 17482 | h_sem=true |
| 17483 | echo " " |
| 17484 | case "$d_semctl$d_semget$d_semop" in |
| 17485 | *"$undef"*) h_sem=false;; |
| 17486 | esac |
| 17487 | case "$osname" in |
| 17488 | freebsd) |
| 17489 | case "`ipcs 2>&1`" in |
| 17490 | "SVID messages"*"not configured"*) |
| 17491 | echo "Your $osname does not have the sem*(2) configured." >&4 |
| 17492 | h_sem=false |
| 17493 | val="$undef" |
| 17494 | set semctl d_semctl |
| 17495 | eval $setvar |
| 17496 | set semget d_semget |
| 17497 | eval $setvar |
| 17498 | set semop d_semop |
| 17499 | eval $setvar |
| 17500 | ;; |
| 17501 | esac |
| 17502 | ;; |
| 17503 | esac |
| 17504 | : we could also check for sys/ipc.h ... |
| 17505 | if $h_sem && $test `./findhdr sys/sem.h`; then |
| 17506 | echo "You have the full sem*(2) library." >&4 |
| 17507 | val="$define" |
| 17508 | else |
| 17509 | echo "You don't have the full sem*(2) library." >&4 |
| 17510 | val="$undef" |
| 17511 | fi |
| 17512 | set d_sem |
| 17513 | eval $setvar |
| 17514 | |
| 17515 | : see whether sys/sem.h defines union semun |
| 17516 | echo " " |
| 17517 | $cat > try.c <<'END' |
| 17518 | #include <sys/types.h> |
| 17519 | #include <sys/ipc.h> |
| 17520 | #include <sys/sem.h> |
| 17521 | int main () { union semun semun; semun.buf = 0; } |
| 17522 | END |
| 17523 | set try |
| 17524 | if eval $compile; then |
| 17525 | echo "You have union semun in <sys/sem.h>." >&4 |
| 17526 | val="$define" |
| 17527 | else |
| 17528 | echo "You do not have union semun in <sys/sem.h>." >&4 |
| 17529 | val="$undef" |
| 17530 | fi |
| 17531 | $rm_try |
| 17532 | set d_union_semun |
| 17533 | eval $setvar |
| 17534 | |
| 17535 | : see how to do semctl IPC_STAT |
| 17536 | case "$d_sem" in |
| 17537 | $define) |
| 17538 | echo " " |
| 17539 | $cat > tryh.h <<END |
| 17540 | #ifndef S_IRUSR |
| 17541 | # ifdef S_IREAD |
| 17542 | # define S_IRUSR S_IREAD |
| 17543 | # define S_IWUSR S_IWRITE |
| 17544 | # define S_IXUSR S_IEXEC |
| 17545 | # else |
| 17546 | # define S_IRUSR 0400 |
| 17547 | # define S_IWUSR 0200 |
| 17548 | # define S_IXUSR 0100 |
| 17549 | # endif |
| 17550 | # define S_IRGRP (S_IRUSR>>3) |
| 17551 | # define S_IWGRP (S_IWUSR>>3) |
| 17552 | # define S_IXGRP (S_IXUSR>>3) |
| 17553 | # define S_IROTH (S_IRUSR>>6) |
| 17554 | # define S_IWOTH (S_IWUSR>>6) |
| 17555 | # define S_IXOTH (S_IXUSR>>6) |
| 17556 | #endif |
| 17557 | #ifndef S_IRWXU |
| 17558 | # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR) |
| 17559 | # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP) |
| 17560 | # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH) |
| 17561 | #endif |
| 17562 | END |
| 17563 | : see whether semctl IPC_STAT can use union semun |
| 17564 | case "$d_semctl_semun" in |
| 17565 | '') |
| 17566 | val="$undef" |
| 17567 | $cat > try.c <<END |
| 17568 | #include <sys/types.h> |
| 17569 | #include <sys/ipc.h> |
| 17570 | #include <sys/sem.h> |
| 17571 | #include <sys/stat.h> |
| 17572 | #include <stdio.h> |
| 17573 | #include <errno.h> |
| 17574 | #include "tryh.h" |
| 17575 | #ifndef errno |
| 17576 | extern int errno; |
| 17577 | #endif |
| 17578 | #$d_union_semun HAS_UNION_SEMUN |
| 17579 | int main() { |
| 17580 | union semun |
| 17581 | #ifndef HAS_UNION_SEMUN |
| 17582 | { |
| 17583 | int val; |
| 17584 | struct semid_ds *buf; |
| 17585 | unsigned short *array; |
| 17586 | } |
| 17587 | #endif |
| 17588 | arg; |
| 17589 | int sem, st; |
| 17590 | |
| 17591 | #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT) |
| 17592 | sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT); |
| 17593 | if (sem > -1) { |
| 17594 | struct semid_ds argbuf; |
| 17595 | arg.buf = &argbuf; |
| 17596 | # ifdef IPC_STAT |
| 17597 | st = semctl(sem, 0, IPC_STAT, arg); |
| 17598 | if (st == 0) |
| 17599 | printf("semun\n"); |
| 17600 | else |
| 17601 | # endif /* IPC_STAT */ |
| 17602 | printf("semctl IPC_STAT failed: errno = %d\n", errno); |
| 17603 | # ifdef IPC_RMID |
| 17604 | if (semctl(sem, 0, IPC_RMID, arg) != 0) |
| 17605 | # endif /* IPC_RMID */ |
| 17606 | printf("semctl IPC_RMID failed: errno = %d\n", errno); |
| 17607 | } else |
| 17608 | #endif /* IPC_PRIVATE && ... */ |
| 17609 | printf("semget failed: errno = %d\n", errno); |
| 17610 | return 0; |
| 17611 | } |
| 17612 | END |
| 17613 | set try |
| 17614 | if eval $compile; then |
| 17615 | xxx=`$run ./try` |
| 17616 | case "$xxx" in |
| 17617 | semun) val="$define" ;; |
| 17618 | esac |
| 17619 | fi |
| 17620 | $rm_try |
| 17621 | set d_semctl_semun |
| 17622 | eval $setvar |
| 17623 | ;; |
| 17624 | esac |
| 17625 | case "$d_semctl_semun" in |
| 17626 | $define) |
| 17627 | echo "You can use union semun for semctl IPC_STAT." >&4 |
| 17628 | also='also' |
| 17629 | ;; |
| 17630 | *) echo "You cannot use union semun for semctl IPC_STAT." >&4 |
| 17631 | also='' |
| 17632 | ;; |
| 17633 | esac |
| 17634 | |
| 17635 | : see whether semctl IPC_STAT can use struct semid_ds pointer |
| 17636 | case "$d_semctl_semid_ds" in |
| 17637 | '') |
| 17638 | val="$undef" |
| 17639 | $cat > try.c <<'END' |
| 17640 | #include <sys/types.h> |
| 17641 | #include <sys/ipc.h> |
| 17642 | #include <sys/sem.h> |
| 17643 | #include <sys/stat.h> |
| 17644 | #include "tryh.h" |
| 17645 | #include <stdio.h> |
| 17646 | #include <errno.h> |
| 17647 | #ifndef errno |
| 17648 | extern int errno; |
| 17649 | #endif |
| 17650 | int main() { |
| 17651 | union semun |
| 17652 | #ifndef HAS_UNION_SEMUN |
| 17653 | { |
| 17654 | int val; |
| 17655 | struct semid_ds *buf; |
| 17656 | unsigned short *array; |
| 17657 | } |
| 17658 | #endif |
| 17659 | arg; |
| 17660 | struct semid_ds argbuf; |
| 17661 | int sem, st; |
| 17662 | |
| 17663 | #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT) |
| 17664 | sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT); |
| 17665 | if (sem > -1) { |
| 17666 | arg.buf = &argbuf; |
| 17667 | # ifdef IPC_STAT |
| 17668 | st = semctl(sem, 0, IPC_STAT, arg); |
| 17669 | if (st == 0) |
| 17670 | printf("semid_ds\n"); |
| 17671 | else |
| 17672 | # endif /* IPC_STAT */ |
| 17673 | printf("semctl IPC_STAT failed: errno = %d\n", errno); |
| 17674 | # ifdef IPC_RMID |
| 17675 | if (semctl(sem, 0, IPC_RMID, arg) != 0) |
| 17676 | # endif /* IPC_RMID */ |
| 17677 | printf("semctl IPC_RMID failed: errno = %d\n", errno); |
| 17678 | } else |
| 17679 | #endif /* IPC_PRIVATE && ... */ |
| 17680 | printf("semget failed: errno = %d\n", errno); |
| 17681 | |
| 17682 | return 0; |
| 17683 | } |
| 17684 | END |
| 17685 | set try |
| 17686 | if eval $compile; then |
| 17687 | xxx=`$run ./try` |
| 17688 | case "$xxx" in |
| 17689 | semid_ds) val="$define" ;; |
| 17690 | esac |
| 17691 | fi |
| 17692 | $rm_try |
| 17693 | set d_semctl_semid_ds |
| 17694 | eval $setvar |
| 17695 | ;; |
| 17696 | esac |
| 17697 | case "$d_semctl_semid_ds" in |
| 17698 | $define) |
| 17699 | echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4 |
| 17700 | ;; |
| 17701 | *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4 |
| 17702 | ;; |
| 17703 | esac |
| 17704 | ;; |
| 17705 | *) val="$undef" |
| 17706 | |
| 17707 | # We do not have the full sem*(2) library, so assume we can not |
| 17708 | # use either. |
| 17709 | |
| 17710 | set d_semctl_semun |
| 17711 | eval $setvar |
| 17712 | |
| 17713 | set d_semctl_semid_ds |
| 17714 | eval $setvar |
| 17715 | ;; |
| 17716 | esac |
| 17717 | $rm_try tryh.h |
| 17718 | |
| 17719 | : see if sendmsg exists |
| 17720 | set sendmsg d_sendmsg |
| 17721 | eval $inlibc |
| 17722 | |
| 17723 | : see if setegid exists |
| 17724 | set setegid d_setegid |
| 17725 | eval $inlibc |
| 17726 | |
| 17727 | : see if seteuid exists |
| 17728 | set seteuid d_seteuid |
| 17729 | eval $inlibc |
| 17730 | |
| 17731 | : see if setgrent exists |
| 17732 | set setgrent d_setgrent |
| 17733 | eval $inlibc |
| 17734 | |
| 17735 | : see if setgrent_r exists |
| 17736 | set setgrent_r d_setgrent_r |
| 17737 | eval $inlibc |
| 17738 | case "$d_setgrent_r" in |
| 17739 | "$define") |
| 17740 | hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h" |
| 17741 | case "$d_setgrent_r_proto:$usethreads" in |
| 17742 | ":define") d_setgrent_r_proto=define |
| 17743 | set d_setgrent_r_proto setgrent_r $hdrs |
| 17744 | eval $hasproto ;; |
| 17745 | *) ;; |
| 17746 | esac |
| 17747 | case "$d_setgrent_r_proto" in |
| 17748 | define) |
| 17749 | case "$setgrent_r_proto" in |
| 17750 | ''|0) try='int setgrent_r(FILE**);' |
| 17751 | ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;; |
| 17752 | esac |
| 17753 | case "$setgrent_r_proto" in |
| 17754 | ''|0) try='void setgrent_r(FILE**);' |
| 17755 | ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;; |
| 17756 | esac |
| 17757 | case "$setgrent_r_proto" in |
| 17758 | ''|0) d_setgrent_r=undef |
| 17759 | setgrent_r_proto=0 |
| 17760 | echo "Disabling setgrent_r, cannot determine prototype." >&4 ;; |
| 17761 | * ) case "$setgrent_r_proto" in |
| 17762 | REENTRANT_PROTO*) ;; |
| 17763 | *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;; |
| 17764 | esac |
| 17765 | echo "Prototype: $try" ;; |
| 17766 | esac |
| 17767 | ;; |
| 17768 | *) case "$usethreads" in |
| 17769 | define) echo "setgrent_r has no prototype, not using it." >&4 ;; |
| 17770 | esac |
| 17771 | d_setgrent_r=undef |
| 17772 | setgrent_r_proto=0 |
| 17773 | ;; |
| 17774 | esac |
| 17775 | ;; |
| 17776 | *) setgrent_r_proto=0 |
| 17777 | ;; |
| 17778 | esac |
| 17779 | |
| 17780 | : see if sethostent exists |
| 17781 | set sethostent d_sethent |
| 17782 | eval $inlibc |
| 17783 | |
| 17784 | : see if sethostent_r exists |
| 17785 | set sethostent_r d_sethostent_r |
| 17786 | eval $inlibc |
| 17787 | case "$d_sethostent_r" in |
| 17788 | "$define") |
| 17789 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 17790 | case "$d_sethostent_r_proto:$usethreads" in |
| 17791 | ":define") d_sethostent_r_proto=define |
| 17792 | set d_sethostent_r_proto sethostent_r $hdrs |
| 17793 | eval $hasproto ;; |
| 17794 | *) ;; |
| 17795 | esac |
| 17796 | case "$d_sethostent_r_proto" in |
| 17797 | define) |
| 17798 | case "$sethostent_r_proto" in |
| 17799 | ''|0) try='int sethostent_r(int, struct hostent_data*);' |
| 17800 | ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;; |
| 17801 | esac |
| 17802 | case "$sethostent_r_proto" in |
| 17803 | ''|0) try='void sethostent_r(int, struct hostent_data*);' |
| 17804 | ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;; |
| 17805 | esac |
| 17806 | case "$sethostent_r_proto" in |
| 17807 | ''|0) d_sethostent_r=undef |
| 17808 | sethostent_r_proto=0 |
| 17809 | echo "Disabling sethostent_r, cannot determine prototype." >&4 ;; |
| 17810 | * ) case "$sethostent_r_proto" in |
| 17811 | REENTRANT_PROTO*) ;; |
| 17812 | *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;; |
| 17813 | esac |
| 17814 | echo "Prototype: $try" ;; |
| 17815 | esac |
| 17816 | ;; |
| 17817 | *) case "$usethreads" in |
| 17818 | define) echo "sethostent_r has no prototype, not using it." >&4 ;; |
| 17819 | esac |
| 17820 | d_sethostent_r=undef |
| 17821 | sethostent_r_proto=0 |
| 17822 | ;; |
| 17823 | esac |
| 17824 | ;; |
| 17825 | *) sethostent_r_proto=0 |
| 17826 | ;; |
| 17827 | esac |
| 17828 | |
| 17829 | : see if setitimer exists |
| 17830 | set setitimer d_setitimer |
| 17831 | eval $inlibc |
| 17832 | |
| 17833 | : see if setlinebuf exists |
| 17834 | set setlinebuf d_setlinebuf |
| 17835 | eval $inlibc |
| 17836 | |
| 17837 | : see if locale.h is available |
| 17838 | set locale.h i_locale |
| 17839 | eval $inhdr |
| 17840 | |
| 17841 | : see if this system has wctype.h |
| 17842 | set wctype.h i_wctype |
| 17843 | eval $inhdr |
| 17844 | |
| 17845 | : see if towupper exists |
| 17846 | set towupper d_towupper |
| 17847 | eval $inlibc |
| 17848 | |
| 17849 | : check for setlocale function and behavior |
| 17850 | $cat <<EOM |
| 17851 | |
| 17852 | Checking to see if you have setlocale() and its behavior |
| 17853 | EOM |
| 17854 | $cat >try.c <<EOCP |
| 17855 | #include <stdlib.h> |
| 17856 | #include <string.h> |
| 17857 | #$i_locale I_LOCALE |
| 17858 | #ifdef I_LOCALE |
| 17859 | # include <locale.h> |
| 17860 | #endif |
| 17861 | #$i_wctype I_WCTYPE |
| 17862 | #ifdef I_WCTYPE |
| 17863 | # include <wctype.h> |
| 17864 | #endif |
| 17865 | |
| 17866 | int main() { |
| 17867 | const char * invalid_name = "\a"; /* This is really invalid! */ |
| 17868 | int accepts_any_locale_name = 0; |
| 17869 | int has_C_UTF8 = 0; |
| 17870 | unsigned char bad_setlocale = 255; |
| 17871 | |
| 17872 | /* If LC_CTYPE isn't defined the compilation will fail, and locales will be |
| 17873 | * disabled. It's hard to imagine an instance where meaningful locale |
| 17874 | * handling could be done without LC_CTYPE */ |
| 17875 | const char * name = setlocale(LC_CTYPE, "C"); |
| 17876 | |
| 17877 | if (name == NULL || strcmp(name, "C") != 0) { |
| 17878 | exit(bad_setlocale); |
| 17879 | } |
| 17880 | |
| 17881 | name = setlocale(LC_CTYPE, invalid_name); |
| 17882 | if (name != NULL) { |
| 17883 | |
| 17884 | /* Let it pass if it accepts the name but gives back one of the C |
| 17885 | * locales */ |
| 17886 | if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) { |
| 17887 | accepts_any_locale_name = 1; |
| 17888 | } |
| 17889 | } |
| 17890 | |
| 17891 | name = setlocale(LC_CTYPE, "C.UTF-8"); |
| 17892 | if (name != NULL) { |
| 17893 | unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF; |
| 17894 | |
| 17895 | #$d_towupper HAS_TOWUPPER |
| 17896 | #ifdef HAS_TOWUPPER |
| 17897 | |
| 17898 | /* We assume that if the machine doesn't have the C99 towupper, it |
| 17899 | * doesn't have C.UTF-8, even if we successfully changed locales to |
| 17900 | * include it. This seems safer even on platforms that didn't accept |
| 17901 | * the really invalid name */ |
| 17902 | |
| 17903 | if (towupper(y_with_diaeresis) == 0x178) { |
| 17904 | has_C_UTF8 = 1; |
| 17905 | } |
| 17906 | |
| 17907 | #endif |
| 17908 | |
| 17909 | } |
| 17910 | |
| 17911 | #if 0 |
| 17912 | |
| 17913 | /* Currently unused code to determine if LC_ALL with disparate values uses |
| 17914 | * category = value pairs or positional, and to determine the separator |
| 17915 | * between the categories. We could add code so that if the separator were |
| 17916 | * > '9', we subtract 10; similarly for 'Z' and 'z', and then just about |
| 17917 | * every possible ASCII separator would fit in the 5 bits available in the |
| 17918 | * exit code. This would not be true in EBCDIC. And then if LC_ALL is |
| 17919 | * positional, we probably would want to know the order of the categories. |
| 17920 | * Using a file between the C program and the shell script would really be |
| 17921 | * require to do that */ |
| 17922 | #ifdef LC_ALL |
| 17923 | |
| 17924 | unsigned char min_separator = ' ' - 1; |
| 17925 | unsigned char separator = min_separator; |
| 17926 | int uses_name_value_pair_names = 0; |
| 17927 | |
| 17928 | name = setlocale(LC_ALL, "C"); |
| 17929 | if (name == NULL || strcmp(name, "C") != 0) { |
| 17930 | exit(bad_setlocale); |
| 17931 | } |
| 17932 | |
| 17933 | if (has_C_UTF8) { |
| 17934 | char * pos; |
| 17935 | |
| 17936 | name = setlocale(LC_CTYPE, "C.UTF-8"); |
| 17937 | if (name == NULL) { |
| 17938 | exit(bad_setlocale); |
| 17939 | } |
| 17940 | name = setlocale(LC_ALL, NULL); |
| 17941 | if (name == NULL) { |
| 17942 | exit(bad_setlocale); |
| 17943 | } |
| 17944 | |
| 17945 | pos = strstr(name, "LC_CTYPE" "=C.UTF-8"); |
| 17946 | if (pos != NULL) { |
| 17947 | uses_name_value_pair_names = 1; |
| 17948 | if (pos == name) { |
| 17949 | separator = name[sizeof("LC_CTYPE=C.UTF-8") - 1]; |
| 17950 | } |
| 17951 | else { |
| 17952 | separator = *(pos - 1); |
| 17953 | } |
| 17954 | } |
| 17955 | else { |
| 17956 | pos = strstr(name, "C.UTF-8"); |
| 17957 | if (pos == NULL) { |
| 17958 | /* bad */ |
| 17959 | } |
| 17960 | else if (pos == name) { |
| 17961 | separator = name[sizeof("C.UTF-8") - 1]; |
| 17962 | } |
| 17963 | else { |
| 17964 | separator = *(pos - 1); |
| 17965 | } |
| 17966 | } |
| 17967 | } |
| 17968 | |
| 17969 | #endif |
| 17970 | #endif |
| 17971 | |
| 17972 | exit( 0 /* (separator - min_separator) << 3 |
| 17973 | | uses_name_value_pair_names << 2 |
| 17974 | */ |
| 17975 | | has_C_UTF8 << 1 |
| 17976 | | accepts_any_locale_name); |
| 17977 | |
| 17978 | } |
| 17979 | EOCP |
| 17980 | set try |
| 17981 | if eval $compile; then |
| 17982 | echo "Your system has setlocale()..." >&4 |
| 17983 | $run ./try |
| 17984 | case $? in |
| 17985 | 0) echo "and it seems sane" >&4 |
| 17986 | d_setlocale="$define" |
| 17987 | d_setlocale_accepts_any_locale_name="$undef" |
| 17988 | d_has_C_UTF8="false" |
| 17989 | ;; |
| 17990 | 1) echo "and it seems sane, but accepts any locale name as valid" >&4 |
| 17991 | d_setlocale="$define" |
| 17992 | d_setlocale_accepts_any_locale_name="$define" |
| 17993 | d_has_C_UTF8="false" |
| 17994 | ;; |
| 17995 | 2) echo "and it seems sane" >&4 |
| 17996 | d_setlocale="$define" |
| 17997 | d_setlocale_accepts_any_locale_name="$undef" |
| 17998 | d_has_C_UTF8="true" |
| 17999 | ;; |
| 18000 | 3) echo "and it seems sane, but accepts any locale name as valid" >&4 |
| 18001 | d_setlocale="$define" |
| 18002 | d_setlocale_accepts_any_locale_name="$define" |
| 18003 | d_has_C_UTF8="true" |
| 18004 | ;; |
| 18005 | *) echo "but it doesn't seem to work, so we won't use it." >&4 |
| 18006 | d_setlocale="$undef" |
| 18007 | d_setlocale_accepts_any_locale_name="$undef" |
| 18008 | d_has_C_UTF8="false" |
| 18009 | ;; |
| 18010 | esac |
| 18011 | else |
| 18012 | echo "your system does not have setlocale()" >&4 |
| 18013 | d_setlocale="$undef" |
| 18014 | d_setlocale_accepts_any_locale_name="$undef" |
| 18015 | d_has_C_UTF8="false" |
| 18016 | fi |
| 18017 | $rm_try |
| 18018 | |
| 18019 | : see if setlocale_r exists |
| 18020 | set setlocale_r d_setlocale_r |
| 18021 | eval $inlibc |
| 18022 | case "$d_setlocale_r" in |
| 18023 | "$define") |
| 18024 | hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h" |
| 18025 | case "$d_setlocale_r_proto:$usethreads" in |
| 18026 | ":define") d_setlocale_r_proto=define |
| 18027 | set d_setlocale_r_proto setlocale_r $hdrs |
| 18028 | eval $hasproto ;; |
| 18029 | *) ;; |
| 18030 | esac |
| 18031 | case "$d_setlocale_r_proto" in |
| 18032 | define) |
| 18033 | case "$setlocale_r_proto" in |
| 18034 | ''|0) try='int setlocale_r(int, const char*, char*, int);' |
| 18035 | ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;; |
| 18036 | esac |
| 18037 | case "$setlocale_r_proto" in |
| 18038 | ''|0) d_setlocale_r=undef |
| 18039 | setlocale_r_proto=0 |
| 18040 | echo "Disabling setlocale_r, cannot determine prototype." >&4 ;; |
| 18041 | * ) case "$setlocale_r_proto" in |
| 18042 | REENTRANT_PROTO*) ;; |
| 18043 | *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;; |
| 18044 | esac |
| 18045 | echo "Prototype: $try" ;; |
| 18046 | esac |
| 18047 | ;; |
| 18048 | *) case "$usethreads" in |
| 18049 | define) echo "setlocale_r has no prototype, not using it." >&4 ;; |
| 18050 | esac |
| 18051 | d_setlocale_r=undef |
| 18052 | setlocale_r_proto=0 |
| 18053 | ;; |
| 18054 | esac |
| 18055 | ;; |
| 18056 | *) setlocale_r_proto=0 |
| 18057 | ;; |
| 18058 | esac |
| 18059 | |
| 18060 | : see if setnetent exists |
| 18061 | set setnetent d_setnent |
| 18062 | eval $inlibc |
| 18063 | |
| 18064 | : see if setnetent_r exists |
| 18065 | set setnetent_r d_setnetent_r |
| 18066 | eval $inlibc |
| 18067 | case "$d_setnetent_r" in |
| 18068 | "$define") |
| 18069 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 18070 | case "$d_setnetent_r_proto:$usethreads" in |
| 18071 | ":define") d_setnetent_r_proto=define |
| 18072 | set d_setnetent_r_proto setnetent_r $hdrs |
| 18073 | eval $hasproto ;; |
| 18074 | *) ;; |
| 18075 | esac |
| 18076 | case "$d_setnetent_r_proto" in |
| 18077 | define) |
| 18078 | case "$setnetent_r_proto" in |
| 18079 | ''|0) try='int setnetent_r(int, struct netent_data*);' |
| 18080 | ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;; |
| 18081 | esac |
| 18082 | case "$setnetent_r_proto" in |
| 18083 | ''|0) try='void setnetent_r(int, struct netent_data*);' |
| 18084 | ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;; |
| 18085 | esac |
| 18086 | case "$setnetent_r_proto" in |
| 18087 | ''|0) d_setnetent_r=undef |
| 18088 | setnetent_r_proto=0 |
| 18089 | echo "Disabling setnetent_r, cannot determine prototype." >&4 ;; |
| 18090 | * ) case "$setnetent_r_proto" in |
| 18091 | REENTRANT_PROTO*) ;; |
| 18092 | *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;; |
| 18093 | esac |
| 18094 | echo "Prototype: $try" ;; |
| 18095 | esac |
| 18096 | ;; |
| 18097 | *) case "$usethreads" in |
| 18098 | define) echo "setnetent_r has no prototype, not using it." >&4 ;; |
| 18099 | esac |
| 18100 | d_setnetent_r=undef |
| 18101 | setnetent_r_proto=0 |
| 18102 | ;; |
| 18103 | esac |
| 18104 | ;; |
| 18105 | *) setnetent_r_proto=0 |
| 18106 | ;; |
| 18107 | esac |
| 18108 | |
| 18109 | : see if setprotoent exists |
| 18110 | set setprotoent d_setpent |
| 18111 | eval $inlibc |
| 18112 | |
| 18113 | : see if setpgid exists |
| 18114 | set setpgid d_setpgid |
| 18115 | eval $inlibc |
| 18116 | |
| 18117 | : see if setpgrp2 exists |
| 18118 | set setpgrp2 d_setpgrp2 |
| 18119 | eval $inlibc |
| 18120 | |
| 18121 | : see if setpriority exists |
| 18122 | set setpriority d_setprior |
| 18123 | eval $inlibc |
| 18124 | |
| 18125 | : see if setproctitle exists |
| 18126 | set setproctitle d_setproctitle |
| 18127 | eval $inlibc |
| 18128 | |
| 18129 | : see if setprotoent_r exists |
| 18130 | set setprotoent_r d_setprotoent_r |
| 18131 | eval $inlibc |
| 18132 | case "$d_setprotoent_r" in |
| 18133 | "$define") |
| 18134 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 18135 | case "$d_setprotoent_r_proto:$usethreads" in |
| 18136 | ":define") d_setprotoent_r_proto=define |
| 18137 | set d_setprotoent_r_proto setprotoent_r $hdrs |
| 18138 | eval $hasproto ;; |
| 18139 | *) ;; |
| 18140 | esac |
| 18141 | case "$d_setprotoent_r_proto" in |
| 18142 | define) |
| 18143 | case "$setprotoent_r_proto" in |
| 18144 | ''|0) try='int setprotoent_r(int, struct protoent_data*);' |
| 18145 | ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;; |
| 18146 | esac |
| 18147 | case "$setprotoent_r_proto" in |
| 18148 | ''|0) try='void setprotoent_r(int, struct protoent_data*);' |
| 18149 | ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;; |
| 18150 | esac |
| 18151 | case "$setprotoent_r_proto" in |
| 18152 | ''|0) d_setprotoent_r=undef |
| 18153 | setprotoent_r_proto=0 |
| 18154 | echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;; |
| 18155 | * ) case "$setprotoent_r_proto" in |
| 18156 | REENTRANT_PROTO*) ;; |
| 18157 | *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;; |
| 18158 | esac |
| 18159 | echo "Prototype: $try" ;; |
| 18160 | esac |
| 18161 | ;; |
| 18162 | *) case "$usethreads" in |
| 18163 | define) echo "setprotoent_r has no prototype, not using it." >&4 ;; |
| 18164 | esac |
| 18165 | d_setprotoent_r=undef |
| 18166 | setprotoent_r_proto=0 |
| 18167 | ;; |
| 18168 | esac |
| 18169 | ;; |
| 18170 | *) setprotoent_r_proto=0 |
| 18171 | ;; |
| 18172 | esac |
| 18173 | |
| 18174 | : see if setpwent exists |
| 18175 | set setpwent d_setpwent |
| 18176 | eval $inlibc |
| 18177 | |
| 18178 | : see if setpwent_r exists |
| 18179 | set setpwent_r d_setpwent_r |
| 18180 | eval $inlibc |
| 18181 | case "$d_setpwent_r" in |
| 18182 | "$define") |
| 18183 | hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h" |
| 18184 | case "$d_setpwent_r_proto:$usethreads" in |
| 18185 | ":define") d_setpwent_r_proto=define |
| 18186 | set d_setpwent_r_proto setpwent_r $hdrs |
| 18187 | eval $hasproto ;; |
| 18188 | *) ;; |
| 18189 | esac |
| 18190 | case "$d_setpwent_r_proto" in |
| 18191 | define) |
| 18192 | case "$setpwent_r_proto" in |
| 18193 | ''|0) try='int setpwent_r(FILE**);' |
| 18194 | ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;; |
| 18195 | esac |
| 18196 | case "$setpwent_r_proto" in |
| 18197 | ''|0) try='void setpwent_r(FILE**);' |
| 18198 | ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;; |
| 18199 | esac |
| 18200 | case "$setpwent_r_proto" in |
| 18201 | ''|0) d_setpwent_r=undef |
| 18202 | setpwent_r_proto=0 |
| 18203 | echo "Disabling setpwent_r, cannot determine prototype." >&4 ;; |
| 18204 | * ) case "$setpwent_r_proto" in |
| 18205 | REENTRANT_PROTO*) ;; |
| 18206 | *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;; |
| 18207 | esac |
| 18208 | echo "Prototype: $try" ;; |
| 18209 | esac |
| 18210 | ;; |
| 18211 | *) case "$usethreads" in |
| 18212 | define) echo "setpwent_r has no prototype, not using it." >&4 ;; |
| 18213 | esac |
| 18214 | d_setpwent_r=undef |
| 18215 | setpwent_r_proto=0 |
| 18216 | ;; |
| 18217 | esac |
| 18218 | ;; |
| 18219 | *) setpwent_r_proto=0 |
| 18220 | ;; |
| 18221 | esac |
| 18222 | |
| 18223 | : see if setregid exists |
| 18224 | set setregid d_setregid |
| 18225 | eval $inlibc |
| 18226 | set setresgid d_setresgid |
| 18227 | eval $inlibc |
| 18228 | |
| 18229 | : see if setreuid exists |
| 18230 | set setreuid d_setreuid |
| 18231 | eval $inlibc |
| 18232 | set setresuid d_setresuid |
| 18233 | eval $inlibc |
| 18234 | |
| 18235 | : see if setrgid exists |
| 18236 | set setrgid d_setrgid |
| 18237 | eval $inlibc |
| 18238 | |
| 18239 | : see if setruid exists |
| 18240 | set setruid d_setruid |
| 18241 | eval $inlibc |
| 18242 | |
| 18243 | : see if setservent exists |
| 18244 | set setservent d_setsent |
| 18245 | eval $inlibc |
| 18246 | |
| 18247 | : see if setservent_r exists |
| 18248 | set setservent_r d_setservent_r |
| 18249 | eval $inlibc |
| 18250 | case "$d_setservent_r" in |
| 18251 | "$define") |
| 18252 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" |
| 18253 | case "$d_setservent_r_proto:$usethreads" in |
| 18254 | ":define") d_setservent_r_proto=define |
| 18255 | set d_setservent_r_proto setservent_r $hdrs |
| 18256 | eval $hasproto ;; |
| 18257 | *) ;; |
| 18258 | esac |
| 18259 | case "$d_setservent_r_proto" in |
| 18260 | define) |
| 18261 | case "$setservent_r_proto" in |
| 18262 | ''|0) try='int setservent_r(int, struct servent_data*);' |
| 18263 | ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;; |
| 18264 | esac |
| 18265 | case "$setservent_r_proto" in |
| 18266 | ''|0) try='void setservent_r(int, struct servent_data*);' |
| 18267 | ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;; |
| 18268 | esac |
| 18269 | case "$setservent_r_proto" in |
| 18270 | ''|0) d_setservent_r=undef |
| 18271 | setservent_r_proto=0 |
| 18272 | echo "Disabling setservent_r, cannot determine prototype." >&4 ;; |
| 18273 | * ) case "$setservent_r_proto" in |
| 18274 | REENTRANT_PROTO*) ;; |
| 18275 | *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;; |
| 18276 | esac |
| 18277 | echo "Prototype: $try" ;; |
| 18278 | esac |
| 18279 | ;; |
| 18280 | *) case "$usethreads" in |
| 18281 | define) echo "setservent_r has no prototype, not using it." >&4 ;; |
| 18282 | esac |
| 18283 | d_setservent_r=undef |
| 18284 | setservent_r_proto=0 |
| 18285 | ;; |
| 18286 | esac |
| 18287 | ;; |
| 18288 | *) setservent_r_proto=0 |
| 18289 | ;; |
| 18290 | esac |
| 18291 | |
| 18292 | : see if setsid exists |
| 18293 | set setsid d_setsid |
| 18294 | eval $inlibc |
| 18295 | |
| 18296 | : see if setvbuf exists |
| 18297 | set setvbuf d_setvbuf |
| 18298 | eval $inlibc |
| 18299 | |
| 18300 | : see if shmctl exists |
| 18301 | set shmctl d_shmctl |
| 18302 | eval $inlibc |
| 18303 | |
| 18304 | : see if shmget exists |
| 18305 | set shmget d_shmget |
| 18306 | eval $inlibc |
| 18307 | |
| 18308 | : see if shmat exists |
| 18309 | set shmat d_shmat |
| 18310 | eval $inlibc |
| 18311 | : see what shmat returns |
| 18312 | case "$d_shmat" in |
| 18313 | "$define") |
| 18314 | $cat >shmat.c <<'END' |
| 18315 | #include <sys/shm.h> |
| 18316 | void *shmat(); |
| 18317 | END |
| 18318 | if $cc $ccflags -c shmat.c >/dev/null 2>&1; then |
| 18319 | shmattype='void *' |
| 18320 | else |
| 18321 | shmattype='char *' |
| 18322 | fi |
| 18323 | echo "and it returns ($shmattype)." >&4 |
| 18324 | : see if a prototype for shmat is available |
| 18325 | xxx=`./findhdr sys/shm.h` |
| 18326 | $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null |
| 18327 | if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then |
| 18328 | val="$define" |
| 18329 | else |
| 18330 | val="$undef" |
| 18331 | fi |
| 18332 | $rm -f shmat.[co] |
| 18333 | ;; |
| 18334 | *) |
| 18335 | val="$undef" |
| 18336 | ;; |
| 18337 | esac |
| 18338 | set d_shmatprototype |
| 18339 | eval $setvar |
| 18340 | |
| 18341 | : see if shmdt exists |
| 18342 | set shmdt d_shmdt |
| 18343 | eval $inlibc |
| 18344 | |
| 18345 | : see how much of the 'shm*(2)' library is present. |
| 18346 | h_shm=true |
| 18347 | echo " " |
| 18348 | case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in |
| 18349 | *"$undef"*) h_shm=false;; |
| 18350 | esac |
| 18351 | case "$osname" in |
| 18352 | freebsd) |
| 18353 | case "`ipcs 2>&1`" in |
| 18354 | "SVID shared memory"*"not configured"*) |
| 18355 | echo "Your $osname does not have the shm*(2) configured." >&4 |
| 18356 | h_shm=false |
| 18357 | val="$undef" |
| 18358 | set shmctl d_shmctl |
| 18359 | eval $setvar |
| 18360 | set shmget d_shmget |
| 18361 | eval $setvar |
| 18362 | set shmat d_shmat |
| 18363 | eval $setvar |
| 18364 | set shmdt d_shmdt |
| 18365 | eval $setvar |
| 18366 | ;; |
| 18367 | esac |
| 18368 | ;; |
| 18369 | esac |
| 18370 | : we could also check for sys/ipc.h ... |
| 18371 | if $h_shm && $test `./findhdr sys/shm.h`; then |
| 18372 | echo "You have the full shm*(2) library." >&4 |
| 18373 | val="$define" |
| 18374 | else |
| 18375 | echo "You don't have the full shm*(2) library." >&4 |
| 18376 | val="$undef" |
| 18377 | fi |
| 18378 | set d_shm |
| 18379 | eval $setvar |
| 18380 | |
| 18381 | : see if we have sigaction |
| 18382 | echo " " |
| 18383 | if set sigaction val -f d_sigaction; eval $csym; $val; then |
| 18384 | echo 'sigaction() found.' >&4 |
| 18385 | $cat > try.c <<EOP |
| 18386 | #include <stdio.h> |
| 18387 | #include <sys/types.h> |
| 18388 | #include <signal.h> |
| 18389 | #$i_stdlib I_STDLIB |
| 18390 | #ifdef I_STDLIB |
| 18391 | #include <stdlib.h> |
| 18392 | #endif |
| 18393 | int main() |
| 18394 | { |
| 18395 | struct sigaction act, oact; |
| 18396 | act.sa_flags = 0; |
| 18397 | oact.sa_handler = 0; |
| 18398 | /* so that act and oact are used */ |
| 18399 | exit(act.sa_flags == 0 && oact.sa_handler == 0); |
| 18400 | } |
| 18401 | EOP |
| 18402 | set try |
| 18403 | if eval $compile_ok; then |
| 18404 | val="$define" |
| 18405 | else |
| 18406 | echo "But you don't seem to have a usable struct sigaction." >&4 |
| 18407 | val="$undef" |
| 18408 | fi |
| 18409 | else |
| 18410 | echo 'sigaction NOT found.' >&4 |
| 18411 | val="$undef" |
| 18412 | fi |
| 18413 | set d_sigaction; eval $setvar |
| 18414 | $rm_try |
| 18415 | |
| 18416 | : see what type pids are declared as in the kernel |
| 18417 | rp="What is the type of process ids on this system?" |
| 18418 | set pid_t pidtype int stdio.h sys/types.h |
| 18419 | eval $typedef_ask |
| 18420 | |
| 18421 | : see what type uids are declared as in the kernel |
| 18422 | echo " " |
| 18423 | echo "Looking for the type for user ids returned by getuid()." |
| 18424 | set uid_t uidtype xxx stdio.h sys/types.h |
| 18425 | eval $typedef |
| 18426 | case "$uidtype" in |
| 18427 | xxx) |
| 18428 | xxx=`./findhdr sys/user.h` |
| 18429 | set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short |
| 18430 | case $1 in |
| 18431 | unsigned) dflt="$1 $2" ;; |
| 18432 | *) dflt="$1" ;; |
| 18433 | esac |
| 18434 | ;; |
| 18435 | *) dflt="$uidtype";; |
| 18436 | esac |
| 18437 | case "$uidtype" in |
| 18438 | uid_t) echo "uid_t found." ;; |
| 18439 | *) rp="What is the type for user ids returned by getuid()?" |
| 18440 | . ./myread |
| 18441 | uidtype="$ans" |
| 18442 | ;; |
| 18443 | esac |
| 18444 | |
| 18445 | : Define hasfield_t macro for Configure internal use |
| 18446 | hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift; |
| 18447 | while $test $# -ge 2; do |
| 18448 | case "$1" in |
| 18449 | $define) echo "#include <$2>";; |
| 18450 | esac ; |
| 18451 | shift 2; |
| 18452 | done > try.c; |
| 18453 | echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c; |
| 18454 | set try; |
| 18455 | if eval $compile; then |
| 18456 | val="$define"; |
| 18457 | else |
| 18458 | val="$undef"; |
| 18459 | fi; |
| 18460 | set $varname; |
| 18461 | eval $setvar; |
| 18462 | $rm_try' |
| 18463 | |
| 18464 | : see what siginfo fields we have |
| 18465 | case "$d_sigaction" in |
| 18466 | "$define") |
| 18467 | echo "Checking if your siginfo_t has si_errno field...">&4 |
| 18468 | set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h |
| 18469 | eval $hasfield_t; |
| 18470 | |
| 18471 | echo "Checking if your siginfo_t has si_pid field...">&4 |
| 18472 | set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h |
| 18473 | eval $hasfield_t; |
| 18474 | |
| 18475 | echo "Checking if your siginfo_t has si_uid field...">&4 |
| 18476 | set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h |
| 18477 | eval $hasfield_t; |
| 18478 | |
| 18479 | echo "Checking if your siginfo_t has si_addr field...">&4 |
| 18480 | set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h |
| 18481 | eval $hasfield_t; |
| 18482 | |
| 18483 | echo "Checking if your siginfo_t has si_status field...">&4 |
| 18484 | set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h |
| 18485 | eval $hasfield_t; |
| 18486 | |
| 18487 | echo "Checking if your siginfo_t has si_band field...">&4 |
| 18488 | set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h |
| 18489 | eval $hasfield_t; |
| 18490 | |
| 18491 | echo "Checking if your siginfo_t has si_value field...">&4 |
| 18492 | set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h |
| 18493 | eval $hasfield_t; |
| 18494 | |
| 18495 | echo "Checking if your siginfo_t has si_fd field...">&4 |
| 18496 | set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h |
| 18497 | eval $hasfield_t; |
| 18498 | |
| 18499 | ;; |
| 18500 | *) |
| 18501 | d_siginfo_si_errno="$undef" |
| 18502 | d_siginfo_si_pid="$undef" |
| 18503 | d_siginfo_si_uid="$undef" |
| 18504 | d_siginfo_si_addr="$undef" |
| 18505 | d_siginfo_si_status="$undef" |
| 18506 | d_siginfo_si_band="$undef" |
| 18507 | d_siginfo_si_value="$undef" |
| 18508 | d_siginfo_si_fd="$undef" |
| 18509 | ;; |
| 18510 | esac |
| 18511 | |
| 18512 | : see if this is a sunmath.h system |
| 18513 | set sunmath.h i_sunmath |
| 18514 | eval $inhdr |
| 18515 | |
| 18516 | : see if signbit exists |
| 18517 | $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4 |
| 18518 | $cat >try.c <<EOCP |
| 18519 | #$i_sunmath I_SUNMATH |
| 18520 | #include <math.h> |
| 18521 | #ifdef I_SUNMATH /* Solaris special math library */ |
| 18522 | # include <sunmath.h> |
| 18523 | #endif |
| 18524 | #define NV $nvtype |
| 18525 | int main(int argc, char **argv) |
| 18526 | { |
| 18527 | NV x = 0.0; |
| 18528 | NV y = -1.0; |
| 18529 | if ((signbit(x) == 0) && (signbit(y) != 0)) |
| 18530 | return 0; |
| 18531 | else |
| 18532 | return 1; |
| 18533 | } |
| 18534 | EOCP |
| 18535 | val="$undef" |
| 18536 | set try |
| 18537 | if eval $compile; then |
| 18538 | if $run ./try; then |
| 18539 | $echo "Yes." >&4 |
| 18540 | val="$define" |
| 18541 | else |
| 18542 | $echo "Signbit seems to be available, but doesn't work as I expected." |
| 18543 | $echo "I won't use it." >&4 |
| 18544 | val="$undef" |
| 18545 | fi |
| 18546 | else |
| 18547 | $echo "Nope." >&4 |
| 18548 | dflt="$undef" |
| 18549 | fi |
| 18550 | set d_signbit |
| 18551 | eval $setvar |
| 18552 | $rm_try |
| 18553 | |
| 18554 | : see if sigprocmask exists |
| 18555 | set sigprocmask d_sigprocmask |
| 18556 | eval $inlibc |
| 18557 | |
| 18558 | : see if sigsetjmp exists |
| 18559 | echo " " |
| 18560 | case "$d_sigsetjmp" in |
| 18561 | '') |
| 18562 | $cat >try.c <<EOP |
| 18563 | #include <setjmp.h> |
| 18564 | #$i_stdlib I_STDLIB |
| 18565 | #ifdef I_STDLIB |
| 18566 | #include <stdlib.h> |
| 18567 | #endif |
| 18568 | sigjmp_buf env; |
| 18569 | int set = 1; |
| 18570 | int main() |
| 18571 | { |
| 18572 | if (sigsetjmp(env,1)) |
| 18573 | exit(set); |
| 18574 | set = 0; |
| 18575 | siglongjmp(env, 1); |
| 18576 | exit(1); |
| 18577 | } |
| 18578 | EOP |
| 18579 | set try |
| 18580 | if eval $compile; then |
| 18581 | if $run ./try >/dev/null 2>&1; then |
| 18582 | echo "POSIX sigsetjmp found." >&4 |
| 18583 | val="$define" |
| 18584 | else |
| 18585 | $cat >&4 <<EOM |
| 18586 | Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!! |
| 18587 | I'll ignore them. |
| 18588 | EOM |
| 18589 | val="$undef" |
| 18590 | fi |
| 18591 | else |
| 18592 | echo "sigsetjmp not found." >&4 |
| 18593 | val="$undef" |
| 18594 | fi |
| 18595 | ;; |
| 18596 | *) val="$d_sigsetjmp" |
| 18597 | case "$d_sigsetjmp" in |
| 18598 | $define) echo "POSIX sigsetjmp found." >&4;; |
| 18599 | $undef) echo "sigsetjmp not found." >&4;; |
| 18600 | esac |
| 18601 | ;; |
| 18602 | esac |
| 18603 | set d_sigsetjmp |
| 18604 | eval $setvar |
| 18605 | $rm_try |
| 18606 | |
| 18607 | : see if snprintf exists |
| 18608 | set snprintf d_snprintf |
| 18609 | eval $inlibc |
| 18610 | |
| 18611 | : see if vsnprintf exists |
| 18612 | set vsnprintf d_vsnprintf |
| 18613 | eval $inlibc |
| 18614 | |
| 18615 | case "$d_snprintf-$d_vsnprintf" in |
| 18616 | "$define-$define") |
| 18617 | $cat <<EOM |
| 18618 | Checking whether your snprintf() and vsnprintf() work okay... |
| 18619 | EOM |
| 18620 | $cat >try.c <<'EOCP' |
| 18621 | /* v?snprintf testing logic courtesy of Russ Allbery. |
| 18622 | * According to C99: |
| 18623 | * - if the buffer is too short it still must be \0-terminated |
| 18624 | * - if the buffer is too short the potentially required length |
| 18625 | * must be returned and not -1 |
| 18626 | * - if the buffer is NULL the potentially required length |
| 18627 | * must be returned and not -1 or core dump |
| 18628 | */ |
| 18629 | #include <stdio.h> |
| 18630 | #include <stdarg.h> |
| 18631 | |
| 18632 | char buf[2]; |
| 18633 | |
| 18634 | int test (char *format, ...) |
| 18635 | { |
| 18636 | va_list args; |
| 18637 | int count; |
| 18638 | |
| 18639 | va_start (args, format); |
| 18640 | count = vsnprintf (buf, sizeof buf, format, args); |
| 18641 | va_end (args); |
| 18642 | return count; |
| 18643 | } |
| 18644 | |
| 18645 | int main () |
| 18646 | { |
| 18647 | return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0' |
| 18648 | && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1); |
| 18649 | } |
| 18650 | EOCP |
| 18651 | set try |
| 18652 | if eval $compile; then |
| 18653 | `$run ./try` |
| 18654 | case "$?" in |
| 18655 | 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;; |
| 18656 | *) cat <<EOM >&4 |
| 18657 | Your snprintf() and snprintf() don't seem to be working okay. |
| 18658 | EOM |
| 18659 | d_snprintf="$undef" |
| 18660 | d_vsnprintf="$undef" |
| 18661 | ;; |
| 18662 | esac |
| 18663 | else |
| 18664 | echo "(I can't seem to compile the test program--assuming they don't)" |
| 18665 | d_snprintf="$undef" |
| 18666 | d_vsnprintf="$undef" |
| 18667 | fi |
| 18668 | $rm_try |
| 18669 | ;; |
| 18670 | esac |
| 18671 | |
| 18672 | : see if sockatmark exists |
| 18673 | set sockatmark d_sockatmark |
| 18674 | eval $inlibc |
| 18675 | |
| 18676 | : see if prototype for sockatmark is available |
| 18677 | echo " " |
| 18678 | set d_sockatmarkproto sockatmark $d_socket sys/socket.h |
| 18679 | eval $hasproto |
| 18680 | |
| 18681 | : see if socks5_init exists |
| 18682 | set socks5_init d_socks5_init |
| 18683 | eval $inlibc |
| 18684 | |
| 18685 | : see if srand48_r exists |
| 18686 | set srand48_r d_srand48_r |
| 18687 | eval $inlibc |
| 18688 | case "$d_srand48_r" in |
| 18689 | "$define") |
| 18690 | hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h" |
| 18691 | case "$d_srand48_r_proto:$usethreads" in |
| 18692 | ":define") d_srand48_r_proto=define |
| 18693 | set d_srand48_r_proto srand48_r $hdrs |
| 18694 | eval $hasproto ;; |
| 18695 | *) ;; |
| 18696 | esac |
| 18697 | case "$d_srand48_r_proto" in |
| 18698 | define) |
| 18699 | case "$srand48_r_proto" in |
| 18700 | ''|0) try='int srand48_r(long, struct drand48_data*);' |
| 18701 | ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;; |
| 18702 | esac |
| 18703 | case "$srand48_r_proto" in |
| 18704 | ''|0) d_srand48_r=undef |
| 18705 | srand48_r_proto=0 |
| 18706 | echo "Disabling srand48_r, cannot determine prototype." >&4 ;; |
| 18707 | * ) case "$srand48_r_proto" in |
| 18708 | REENTRANT_PROTO*) ;; |
| 18709 | *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;; |
| 18710 | esac |
| 18711 | echo "Prototype: $try" ;; |
| 18712 | esac |
| 18713 | ;; |
| 18714 | *) case "$usethreads" in |
| 18715 | define) echo "srand48_r has no prototype, not using it." >&4 ;; |
| 18716 | esac |
| 18717 | d_srand48_r=undef |
| 18718 | srand48_r_proto=0 |
| 18719 | ;; |
| 18720 | esac |
| 18721 | ;; |
| 18722 | *) srand48_r_proto=0 |
| 18723 | ;; |
| 18724 | esac |
| 18725 | |
| 18726 | : see if srandom_r exists |
| 18727 | set srandom_r d_srandom_r |
| 18728 | eval $inlibc |
| 18729 | case "$d_srandom_r" in |
| 18730 | "$define") |
| 18731 | hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h" |
| 18732 | case "$d_srandom_r_proto:$usethreads" in |
| 18733 | ":define") d_srandom_r_proto=define |
| 18734 | set d_srandom_r_proto srandom_r $hdrs |
| 18735 | eval $hasproto ;; |
| 18736 | *) ;; |
| 18737 | esac |
| 18738 | case "$d_srandom_r_proto" in |
| 18739 | define) |
| 18740 | case "$srandom_r_proto" in |
| 18741 | ''|0) try='int srandom_r(unsigned int, struct random_data*);' |
| 18742 | ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;; |
| 18743 | esac |
| 18744 | case "$srandom_r_proto" in |
| 18745 | ''|0) d_srandom_r=undef |
| 18746 | srandom_r_proto=0 |
| 18747 | echo "Disabling srandom_r, cannot determine prototype." >&4 ;; |
| 18748 | * ) case "$srandom_r_proto" in |
| 18749 | REENTRANT_PROTO*) ;; |
| 18750 | *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;; |
| 18751 | esac |
| 18752 | echo "Prototype: $try" ;; |
| 18753 | esac |
| 18754 | ;; |
| 18755 | *) case "$usethreads" in |
| 18756 | define) echo "srandom_r has no prototype, not using it." >&4 ;; |
| 18757 | esac |
| 18758 | d_srandom_r=undef |
| 18759 | srandom_r_proto=0 |
| 18760 | ;; |
| 18761 | esac |
| 18762 | ;; |
| 18763 | *) srandom_r_proto=0 |
| 18764 | ;; |
| 18765 | esac |
| 18766 | |
| 18767 | : see if prototype for setresgid is available |
| 18768 | echo " " |
| 18769 | set d_sresgproto setresgid $i_unistd unistd.h |
| 18770 | eval $hasproto |
| 18771 | |
| 18772 | : see if prototype for setresuid is available |
| 18773 | echo " " |
| 18774 | set d_sresuproto setresuid $i_unistd unistd.h |
| 18775 | eval $hasproto |
| 18776 | |
| 18777 | : see if stat exists |
| 18778 | set stat d_stat |
| 18779 | eval $inlibc |
| 18780 | |
| 18781 | : see if sys/stat.h is available |
| 18782 | set sys/stat.h i_sysstat |
| 18783 | eval $inhdr |
| 18784 | |
| 18785 | : see if stat knows about block sizes |
| 18786 | echo " " |
| 18787 | echo "Checking to see if your struct stat has st_blocks field..." >&4 |
| 18788 | set d_statblks stat st_blocks $i_sysstat sys/stat.h |
| 18789 | eval $hasfield |
| 18790 | |
| 18791 | : see if this is a sys/vfs.h system |
| 18792 | set sys/vfs.h i_sysvfs |
| 18793 | eval $inhdr |
| 18794 | |
| 18795 | : see if this is a sys/statfs.h system |
| 18796 | set sys/statfs.h i_sysstatfs |
| 18797 | eval $inhdr |
| 18798 | |
| 18799 | : Check for statfs_s |
| 18800 | echo " " |
| 18801 | echo "Checking to see if your system supports struct statfs..." >&4 |
| 18802 | set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h |
| 18803 | eval $hasstruct |
| 18804 | case "$d_statfs_s" in |
| 18805 | "$define") echo "Yes, it does." ;; |
| 18806 | *) echo "No, it doesn't." ;; |
| 18807 | esac |
| 18808 | |
| 18809 | : see if struct statfs knows about f_flags |
| 18810 | case "$d_statfs_s" in |
| 18811 | define) |
| 18812 | echo " " |
| 18813 | echo "Checking to see if your struct statfs has f_flags field..." >&4 |
| 18814 | set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h |
| 18815 | eval $hasfield |
| 18816 | ;; |
| 18817 | *) val="$undef" |
| 18818 | set d_statfs_f_flags |
| 18819 | eval $setvar |
| 18820 | ;; |
| 18821 | esac |
| 18822 | case "$d_statfs_f_flags" in |
| 18823 | "$define") echo "Yes, it does." ;; |
| 18824 | *) echo "No, it doesn't." ;; |
| 18825 | esac |
| 18826 | |
| 18827 | : see what flavor, if any, of static inline is supported |
| 18828 | echo " " |
| 18829 | echo "Checking to see if your system supports static inline..." |
| 18830 | $cat > try.c <<'EOCP' |
| 18831 | #include <stdlib.h> |
| 18832 | extern int f_via_a(int x); |
| 18833 | extern int f_via_b(int x); |
| 18834 | int main(int argc, char **argv) |
| 18835 | { |
| 18836 | int y; |
| 18837 | |
| 18838 | y = f_via_a(0); |
| 18839 | #ifdef USE_B |
| 18840 | y = f_via_b(0); |
| 18841 | #endif |
| 18842 | if (y == 42) { |
| 18843 | return EXIT_SUCCESS; |
| 18844 | } |
| 18845 | else { |
| 18846 | return EXIT_FAILURE; |
| 18847 | } |
| 18848 | } |
| 18849 | EOCP |
| 18850 | $cat > a.c <<'EOCP' |
| 18851 | static INLINE int f(int x) { |
| 18852 | int y; |
| 18853 | y = x + 42; |
| 18854 | return y; |
| 18855 | } |
| 18856 | |
| 18857 | int f_via_a(int x) |
| 18858 | { |
| 18859 | return f(x); |
| 18860 | } |
| 18861 | EOCP |
| 18862 | $cat > b.c <<'EOCP' |
| 18863 | extern int f(int x); |
| 18864 | |
| 18865 | int f_via_b(int x) |
| 18866 | { |
| 18867 | return f(x); |
| 18868 | } |
| 18869 | EOCP |
| 18870 | |
| 18871 | # Respect a hint (or previous) value for perl_static_inline, if there is one. |
| 18872 | case "$perl_static_inline" in |
| 18873 | '') # Check the various possibilities, and break out on success. |
| 18874 | # For gcc, prefer __inline__, which will still permit |
| 18875 | # cflags.SH to add in -ansi. |
| 18876 | case "$gccversion" in |
| 18877 | '') xxx="inline __inline__ __inline _inline";; |
| 18878 | *) xxx="__inline__ inline __inline _inline";; |
| 18879 | esac |
| 18880 | for inline in $xxx; do |
| 18881 | set try -DINLINE=$inline a.c |
| 18882 | if eval $compile && $run ./try; then |
| 18883 | # Now make sure there is no external linkage of static |
| 18884 | # functions |
| 18885 | set try -DINLINE=$inline -DUSE_B a.c b.c |
| 18886 | if eval $compile && $run ./try; then |
| 18887 | $echo "Your compiler supports static $inline, " >&4 |
| 18888 | $echo "but it also creates an external definition," >&4 |
| 18889 | $echo "so I won't use it." >&4 |
| 18890 | val=$undef |
| 18891 | else |
| 18892 | $echo "Your compiler supports static $inline." >&4 |
| 18893 | val=$define |
| 18894 | perl_static_inline="static $inline"; |
| 18895 | break; |
| 18896 | fi |
| 18897 | else |
| 18898 | $echo "Your compiler does NOT support static $inline." >&4 |
| 18899 | val="$undef" |
| 18900 | fi |
| 18901 | done |
| 18902 | ;; |
| 18903 | *inline*) # Some variant of inline exists. |
| 18904 | echo "Keeping your $hint value of $perl_static_inline." |
| 18905 | val=$define |
| 18906 | ;; |
| 18907 | static) # No inline capabilities |
| 18908 | echo "Keeping your $hint value of $perl_static_inline." |
| 18909 | val=$undef |
| 18910 | ;; |
| 18911 | *) # Unrecognized previous value -- blindly trust the supplied |
| 18912 | # value and hope it makes sense. Use old value for |
| 18913 | # d_static_inline, if there is one. |
| 18914 | echo "Keeping your $hint value of $perl_static_inline." |
| 18915 | case "$d_static_inline" in |
| 18916 | '') val=$define ;; |
| 18917 | *) val=$d_static_inline ;; |
| 18918 | esac |
| 18919 | ;; |
| 18920 | esac |
| 18921 | # Fallback to plain 'static' if nothing worked. |
| 18922 | case "$perl_static_inline" in |
| 18923 | '') |
| 18924 | perl_static_inline="static" |
| 18925 | val=$undef |
| 18926 | ;; |
| 18927 | esac |
| 18928 | set d_static_inline |
| 18929 | eval $setvar |
| 18930 | $rm -f a.[co] b.[co] |
| 18931 | $rm_try |
| 18932 | |
| 18933 | : Check stream access |
| 18934 | $cat >&4 <<EOM |
| 18935 | Checking how to access stdio streams by file descriptor number... |
| 18936 | EOM |
| 18937 | case "$stdio_stream_array" in |
| 18938 | '') $cat >try.c <<EOCP |
| 18939 | #include <stdio.h> |
| 18940 | int main() { |
| 18941 | if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin) |
| 18942 | printf("yes\n"); |
| 18943 | } |
| 18944 | EOCP |
| 18945 | for s in _iob __iob __sF |
| 18946 | do |
| 18947 | set try -DSTDIO_STREAM_ARRAY=$s |
| 18948 | if eval $compile; then |
| 18949 | case "`$run ./try`" in |
| 18950 | yes) stdio_stream_array=$s; break ;; |
| 18951 | esac |
| 18952 | fi |
| 18953 | done |
| 18954 | $rm_try |
| 18955 | esac |
| 18956 | case "$stdio_stream_array" in |
| 18957 | '') $cat >&4 <<EOM |
| 18958 | I can't figure out how to access stdio streams by file descriptor number. |
| 18959 | EOM |
| 18960 | d_stdio_stream_array="$undef" |
| 18961 | ;; |
| 18962 | *) $cat >&4 <<EOM |
| 18963 | You can access stdio streams by file descriptor number by the $stdio_stream_array array. |
| 18964 | EOM |
| 18965 | d_stdio_stream_array="$define" |
| 18966 | ;; |
| 18967 | esac |
| 18968 | |
| 18969 | : see if strcoll exists |
| 18970 | set strcoll d_strcoll |
| 18971 | eval $inlibc |
| 18972 | |
| 18973 | : see if strerror_l exists |
| 18974 | set strerror_l d_strerror_l |
| 18975 | eval $inlibc |
| 18976 | |
| 18977 | : see if strerror_r exists |
| 18978 | set strerror_r d_strerror_r |
| 18979 | eval $inlibc |
| 18980 | case "$d_strerror_r" in |
| 18981 | "$define") |
| 18982 | hdrs="$i_systypes sys/types.h define stdio.h define string.h" |
| 18983 | case "$d_strerror_r_proto:$usethreads" in |
| 18984 | ":define") d_strerror_r_proto=define |
| 18985 | set d_strerror_r_proto strerror_r $hdrs |
| 18986 | eval $hasproto ;; |
| 18987 | *) ;; |
| 18988 | esac |
| 18989 | case "$d_strerror_r_proto" in |
| 18990 | define) |
| 18991 | case "$strerror_r_proto" in |
| 18992 | ''|0) try='int strerror_r(int, char*, size_t);' |
| 18993 | ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;; |
| 18994 | esac |
| 18995 | case "$strerror_r_proto" in |
| 18996 | ''|0) try='int strerror_r(int, char*, int);' |
| 18997 | ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;; |
| 18998 | esac |
| 18999 | case "$strerror_r_proto" in |
| 19000 | ''|0) try='char* strerror_r(int, char*, size_t);' |
| 19001 | ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;; |
| 19002 | esac |
| 19003 | case "$strerror_r_proto" in |
| 19004 | ''|0) d_strerror_r=undef |
| 19005 | strerror_r_proto=0 |
| 19006 | echo "Disabling strerror_r, cannot determine prototype." >&4 ;; |
| 19007 | * ) case "$strerror_r_proto" in |
| 19008 | REENTRANT_PROTO*) ;; |
| 19009 | *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;; |
| 19010 | esac |
| 19011 | echo "Prototype: $try" ;; |
| 19012 | esac |
| 19013 | ;; |
| 19014 | *) case "$usethreads" in |
| 19015 | define) echo "strerror_r has no prototype, not using it." >&4 ;; |
| 19016 | esac |
| 19017 | d_strerror_r=undef |
| 19018 | strerror_r_proto=0 |
| 19019 | ;; |
| 19020 | esac |
| 19021 | ;; |
| 19022 | *) strerror_r_proto=0 |
| 19023 | ;; |
| 19024 | esac |
| 19025 | |
| 19026 | : see if strftime exists |
| 19027 | set strftime d_strftime |
| 19028 | eval $inlibc |
| 19029 | |
| 19030 | : see if strlcat exists |
| 19031 | : We need both a prototype in string.h and the symbol in libc. |
| 19032 | echo " " |
| 19033 | d_strlcat_proto='' |
| 19034 | xx1="#$d_gnulibc HAS_GNULIBC" |
| 19035 | xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)' |
| 19036 | xx3='# define _GNU_SOURCE' |
| 19037 | xx4='#endif' |
| 19038 | set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h |
| 19039 | eval $hasproto |
| 19040 | case "$d_strlcat_proto" in |
| 19041 | define) # see if strlcat exists |
| 19042 | set strlcat d_strlcat |
| 19043 | eval $inlibc |
| 19044 | ;; |
| 19045 | *) val=$undef |
| 19046 | set d_strlcat |
| 19047 | eval $setvar |
| 19048 | ;; |
| 19049 | esac |
| 19050 | |
| 19051 | : see if strlcpy exists |
| 19052 | : We need both a prototype in string.h and the symbol in libc. |
| 19053 | echo " " |
| 19054 | d_strlcpy_proto='' |
| 19055 | xx1="#$d_gnulibc HAS_GNULIBC" |
| 19056 | xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)' |
| 19057 | xx3='# define _GNU_SOURCE' |
| 19058 | xx4='#endif' |
| 19059 | set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h |
| 19060 | eval $hasproto |
| 19061 | case "$d_strlcpy_proto" in |
| 19062 | define) # see if strlcpy exists |
| 19063 | set strlcpy d_strlcpy |
| 19064 | eval $inlibc |
| 19065 | ;; |
| 19066 | *) val=$undef |
| 19067 | set d_strlcpy |
| 19068 | eval $setvar |
| 19069 | ;; |
| 19070 | esac |
| 19071 | |
| 19072 | : see if strnlen exists |
| 19073 | set strnlen d_strnlen |
| 19074 | eval $inlibc |
| 19075 | |
| 19076 | : see if strtod exists |
| 19077 | set strtod d_strtod |
| 19078 | eval $inlibc |
| 19079 | |
| 19080 | : see if strtod_l exists |
| 19081 | set strtod_l d_strtod_l |
| 19082 | eval $inlibc |
| 19083 | |
| 19084 | : see if strtol exists |
| 19085 | set strtol d_strtol |
| 19086 | eval $inlibc |
| 19087 | |
| 19088 | : see if strtold exists |
| 19089 | set strtold d_strtold |
| 19090 | eval $inlibc |
| 19091 | |
| 19092 | : see if strtold_l exists |
| 19093 | set strtold_l d_strtold_l |
| 19094 | eval $inlibc |
| 19095 | |
| 19096 | : see if strtoll exists |
| 19097 | set strtoll d_strtoll |
| 19098 | eval $inlibc |
| 19099 | |
| 19100 | case "$d_longlong-$d_strtoll" in |
| 19101 | "$define-$define") |
| 19102 | $cat <<EOM |
| 19103 | Checking whether your strtoll() works okay... |
| 19104 | EOM |
| 19105 | $cat >try.c <<'EOCP' |
| 19106 | #include <errno.h> |
| 19107 | #ifdef __hpux |
| 19108 | #define strtoll __strtoll |
| 19109 | #endif |
| 19110 | #ifdef __EMX__ |
| 19111 | #define strtoll _strtoll |
| 19112 | #endif |
| 19113 | #include <stdio.h> |
| 19114 | #include <stdlib.h> |
| 19115 | static int bad = 0; |
| 19116 | void check(const char *s, long long ell, int een) { |
| 19117 | long long gll; |
| 19118 | errno = 0; |
| 19119 | gll = strtoll(s, 0, 10); |
| 19120 | if (!((gll == ell) && (errno == een))) |
| 19121 | bad++; |
| 19122 | } |
| 19123 | int main() { |
| 19124 | check(" 1", 1LL, 0); |
| 19125 | check(" 0", 0LL, 0); |
| 19126 | check("-1", -1LL, 0); |
| 19127 | check("-9223372036854775808", -9223372036854775808LL, 0); |
| 19128 | check("-9223372036854775808", -9223372036854775808LL, 0); |
| 19129 | check(" 9223372036854775807", 9223372036854775807LL, 0); |
| 19130 | check("-9223372036854775808", -9223372036854775808LL, 0); |
| 19131 | check(" 9223372036854775808", 9223372036854775807LL, ERANGE); |
| 19132 | check("-9223372036854775809", -9223372036854775808LL, ERANGE); |
| 19133 | if (!bad) |
| 19134 | printf("ok\n"); |
| 19135 | } |
| 19136 | EOCP |
| 19137 | set try |
| 19138 | if eval $compile; then |
| 19139 | yyy=`$run ./try` |
| 19140 | case "$yyy" in |
| 19141 | ok) echo "Your strtoll() seems to be working okay." ;; |
| 19142 | *) cat <<EOM >&4 |
| 19143 | Your strtoll() doesn't seem to be working okay. |
| 19144 | EOM |
| 19145 | d_strtoll="$undef" |
| 19146 | ;; |
| 19147 | esac |
| 19148 | else |
| 19149 | echo "(I can't seem to compile the test program--assuming it doesn't)" |
| 19150 | d_strtoll="$undef" |
| 19151 | fi |
| 19152 | ;; |
| 19153 | esac |
| 19154 | |
| 19155 | : see if strtoq exists |
| 19156 | set strtoq d_strtoq |
| 19157 | eval $inlibc |
| 19158 | |
| 19159 | : see if strtoul exists |
| 19160 | set strtoul d_strtoul |
| 19161 | eval $inlibc |
| 19162 | |
| 19163 | case "$d_strtoul" in |
| 19164 | "$define") |
| 19165 | $cat <<EOM |
| 19166 | Checking whether your strtoul() works okay... |
| 19167 | EOM |
| 19168 | $cat >try.c <<'EOCP' |
| 19169 | #include <stdlib.h> |
| 19170 | #include <errno.h> |
| 19171 | #include <stdio.h> |
| 19172 | static int bad = 0; |
| 19173 | void check(const char *s, unsigned long eul, int een) { |
| 19174 | unsigned long gul; |
| 19175 | errno = 0; |
| 19176 | gul = strtoul(s, 0, 10); |
| 19177 | if (!((gul == eul) && (errno == een))) |
| 19178 | bad++; |
| 19179 | } |
| 19180 | int main() { |
| 19181 | check(" 1", 1L, 0); |
| 19182 | check(" 0", 0L, 0); |
| 19183 | EOCP |
| 19184 | case "$longsize" in |
| 19185 | 8) |
| 19186 | $cat >>try.c <<'EOCP' |
| 19187 | check("18446744073709551615", 18446744073709551615UL, 0); |
| 19188 | check("18446744073709551616", 18446744073709551615UL, ERANGE); |
| 19189 | #if 0 /* strtoul() for /^-/ strings is undefined. */ |
| 19190 | check("-1", 18446744073709551615UL, 0); |
| 19191 | check("-18446744073709551614", 2, 0); |
| 19192 | check("-18446744073709551615", 1, 0); |
| 19193 | check("-18446744073709551616", 18446744073709551615UL, ERANGE); |
| 19194 | check("-18446744073709551617", 18446744073709551615UL, ERANGE); |
| 19195 | #endif |
| 19196 | EOCP |
| 19197 | ;; |
| 19198 | 4) |
| 19199 | $cat >>try.c <<'EOCP' |
| 19200 | check("4294967295", 4294967295UL, 0); |
| 19201 | check("4294967296", 4294967295UL, ERANGE); |
| 19202 | #if 0 /* strtoul() for /^-/ strings is undefined. */ |
| 19203 | check("-1", 4294967295UL, 0); |
| 19204 | check("-4294967294", 2, 0); |
| 19205 | check("-4294967295", 1, 0); |
| 19206 | check("-4294967296", 4294967295UL, ERANGE); |
| 19207 | check("-4294967297", 4294967295UL, ERANGE); |
| 19208 | #endif |
| 19209 | EOCP |
| 19210 | ;; |
| 19211 | *) |
| 19212 | : Should we write these tests to be more portable by sprintf-ing |
| 19213 | : ~0 and then manipulating that char string as input for strtol? |
| 19214 | ;; |
| 19215 | esac |
| 19216 | $cat >>try.c <<'EOCP' |
| 19217 | if (!bad) |
| 19218 | printf("ok\n"); |
| 19219 | return 0; |
| 19220 | } |
| 19221 | EOCP |
| 19222 | set try |
| 19223 | if eval $compile; then |
| 19224 | case "`$run ./try`" in |
| 19225 | ok) echo "Your strtoul() seems to be working okay." ;; |
| 19226 | *) cat <<EOM >&4 |
| 19227 | Your strtoul() doesn't seem to be working okay. |
| 19228 | EOM |
| 19229 | d_strtoul="$undef" |
| 19230 | ;; |
| 19231 | esac |
| 19232 | else |
| 19233 | echo "(I can't seem to compile the test program--assuming it doesn't)" |
| 19234 | d_strtoul="$undef" |
| 19235 | fi |
| 19236 | ;; |
| 19237 | esac |
| 19238 | |
| 19239 | : see if strtoull exists |
| 19240 | set strtoull d_strtoull |
| 19241 | eval $inlibc |
| 19242 | |
| 19243 | case "$d_longlong-$d_strtoull" in |
| 19244 | "$define-$define") |
| 19245 | $cat <<EOM |
| 19246 | Checking whether your strtoull() works okay... |
| 19247 | EOM |
| 19248 | $cat >try.c <<'EOCP' |
| 19249 | #include <stdlib.h> |
| 19250 | #include <errno.h> |
| 19251 | #ifdef __hpux |
| 19252 | #define strtoull __strtoull |
| 19253 | #endif |
| 19254 | #include <stdio.h> |
| 19255 | static int bad = 0; |
| 19256 | void check(const char *s, long long eull, int een) { |
| 19257 | long long gull; |
| 19258 | errno = 0; |
| 19259 | gull = strtoull(s, 0, 10); |
| 19260 | if (!((gull == eull) && (errno == een))) |
| 19261 | bad++; |
| 19262 | } |
| 19263 | int main() { |
| 19264 | check(" 1", 1LL, 0); |
| 19265 | check(" 0", 0LL, 0); |
| 19266 | check("18446744073709551615", 18446744073709551615ULL, 0); |
| 19267 | check("18446744073709551616", 18446744073709551615ULL, ERANGE); |
| 19268 | #if 0 /* strtoull() for /^-/ strings is undefined. */ |
| 19269 | check("-1", 18446744073709551615ULL, 0); |
| 19270 | check("-18446744073709551614", 2LL, 0); |
| 19271 | check("-18446744073709551615", 1LL, 0); |
| 19272 | check("-18446744073709551616", 18446744073709551615ULL, ERANGE); |
| 19273 | check("-18446744073709551617", 18446744073709551615ULL, ERANGE); |
| 19274 | #endif |
| 19275 | if (!bad) |
| 19276 | printf("ok\n"); |
| 19277 | } |
| 19278 | EOCP |
| 19279 | set try |
| 19280 | if eval $compile; then |
| 19281 | case "`$run ./try`" in |
| 19282 | ok) echo "Your strtoull() seems to be working okay." ;; |
| 19283 | *) cat <<EOM >&4 |
| 19284 | Your strtoull() doesn't seem to be working okay. |
| 19285 | EOM |
| 19286 | d_strtoull="$undef" |
| 19287 | ;; |
| 19288 | esac |
| 19289 | else |
| 19290 | echo "(I can't seem to compile the test program--assuming it doesn't)" |
| 19291 | d_strtoull="$undef" |
| 19292 | fi |
| 19293 | ;; |
| 19294 | esac |
| 19295 | |
| 19296 | : see if strtouq exists |
| 19297 | set strtouq d_strtouq |
| 19298 | eval $inlibc |
| 19299 | |
| 19300 | case "$d_strtouq" in |
| 19301 | "$define") |
| 19302 | $cat <<EOM |
| 19303 | Checking whether your strtouq() works okay... |
| 19304 | EOM |
| 19305 | $cat >try.c <<'EOCP' |
| 19306 | #include <stdlib.h> |
| 19307 | #include <errno.h> |
| 19308 | #include <stdio.h> |
| 19309 | static int bad = 0; |
| 19310 | void check(const char *s, unsigned long long eull, int een) { |
| 19311 | unsigned long long gull; |
| 19312 | errno = 0; |
| 19313 | gull = strtouq(s, 0, 10); |
| 19314 | if (!((gull == eull) && (errno == een))) |
| 19315 | bad++; |
| 19316 | } |
| 19317 | int main() { |
| 19318 | check(" 1", 1LL, 0); |
| 19319 | check(" 0", 0LL, 0); |
| 19320 | check("18446744073709551615", 18446744073709551615ULL, 0); |
| 19321 | check("18446744073709551616", 18446744073709551615ULL, ERANGE); |
| 19322 | #if 0 /* strtouq() for /^-/ strings is undefined. */ |
| 19323 | check("-1", 18446744073709551615ULL, 0); |
| 19324 | check("-18446744073709551614", 2LL, 0); |
| 19325 | check("-18446744073709551615", 1LL, 0); |
| 19326 | check("-18446744073709551616", 18446744073709551615ULL, ERANGE); |
| 19327 | check("-18446744073709551617", 18446744073709551615ULL, ERANGE); |
| 19328 | #endif |
| 19329 | if (!bad) |
| 19330 | printf("ok\n"); |
| 19331 | return 0; |
| 19332 | } |
| 19333 | EOCP |
| 19334 | set try |
| 19335 | if eval $compile; then |
| 19336 | case "`$run ./try`" in |
| 19337 | ok) echo "Your strtouq() seems to be working okay." ;; |
| 19338 | *) cat <<EOM >&4 |
| 19339 | Your strtouq() doesn't seem to be working okay. |
| 19340 | EOM |
| 19341 | d_strtouq="$undef" |
| 19342 | ;; |
| 19343 | esac |
| 19344 | else |
| 19345 | echo "(I can't seem to compile the test program--assuming it doesn't)" |
| 19346 | d_strtouq="$undef" |
| 19347 | fi |
| 19348 | ;; |
| 19349 | esac |
| 19350 | |
| 19351 | : see if strxfrm exists |
| 19352 | set strxfrm d_strxfrm |
| 19353 | eval $inlibc |
| 19354 | |
| 19355 | : see if symlink exists |
| 19356 | set symlink d_symlink |
| 19357 | eval $inlibc |
| 19358 | |
| 19359 | : see if syscall exists |
| 19360 | set syscall d_syscall |
| 19361 | eval $inlibc |
| 19362 | |
| 19363 | : see if prototype for syscall is available |
| 19364 | echo " " |
| 19365 | set d_syscallproto syscall $i_unistd unistd.h |
| 19366 | eval $hasproto |
| 19367 | |
| 19368 | : see if sysconf exists |
| 19369 | set sysconf d_sysconf |
| 19370 | eval $inlibc |
| 19371 | |
| 19372 | : see if sys_errlist[] exists |
| 19373 | echo " " |
| 19374 | if test "X$d_syserrlst" = X; then |
| 19375 | if set sys_errlist val -a d_syserrlst; eval $csym; $val; then |
| 19376 | echo "You have sys_errlist[], so we could roll our own strerror." |
| 19377 | d_syserrlst="$define" |
| 19378 | else |
| 19379 | echo "You don't have sys_errlist[], so strerror() is welcome." |
| 19380 | d_syserrlst="$undef" |
| 19381 | fi |
| 19382 | fi |
| 19383 | |
| 19384 | : see if system exists |
| 19385 | set system d_system |
| 19386 | eval $inlibc |
| 19387 | |
| 19388 | : see if tcgetpgrp exists |
| 19389 | set tcgetpgrp d_tcgetpgrp |
| 19390 | eval $inlibc |
| 19391 | |
| 19392 | : see if tcsetpgrp exists |
| 19393 | set tcsetpgrp d_tcsetpgrp |
| 19394 | eval $inlibc |
| 19395 | |
| 19396 | : see if prototype for telldir is available |
| 19397 | echo " " |
| 19398 | set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h |
| 19399 | eval $hasproto |
| 19400 | |
| 19401 | : see if tgamma exists |
| 19402 | set tgamma d_tgamma |
| 19403 | eval $inlibc |
| 19404 | |
| 19405 | : check for thread_safe_nl_langinfo_l item |
| 19406 | $cat <<EOM |
| 19407 | |
| 19408 | Checking to see if you have nl_langinfo_l() and that it is thread-safe |
| 19409 | EOM |
| 19410 | $cat >try.c <<EOCP |
| 19411 | #$i_stdlib I_STDLIB |
| 19412 | #ifdef I_STDLIB |
| 19413 | # include <stdlib.h> |
| 19414 | #endif |
| 19415 | #include <string.h> |
| 19416 | #$i_langinfo I_LANGINFO |
| 19417 | #ifdef I_LANGINFO |
| 19418 | # include <langinfo.h> |
| 19419 | #endif |
| 19420 | #$i_pthread I_PTHREAD |
| 19421 | #ifdef I_PTHREAD |
| 19422 | # include <pthread.h> |
| 19423 | #endif |
| 19424 | #$i_locale I_LOCALE |
| 19425 | #ifdef I_LOCALE |
| 19426 | # include <locale.h> |
| 19427 | #endif |
| 19428 | |
| 19429 | void * |
| 19430 | thread_start(void * arg) |
| 19431 | { |
| 19432 | nl_langinfo(RADIXCHAR); |
| 19433 | } |
| 19434 | |
| 19435 | int main() { |
| 19436 | char * main_buffer; |
| 19437 | char save_main_buffer[1000]; |
| 19438 | pthread_t subthread; |
| 19439 | pthread_attr_t attr; |
| 19440 | |
| 19441 | main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0)); |
| 19442 | |
| 19443 | /* If too large for our generous allowance, just assume we don't have |
| 19444 | * it. */ |
| 19445 | if (strlen(main_buffer) >= sizeof(save_main_buffer)) { |
| 19446 | exit(1); |
| 19447 | } |
| 19448 | |
| 19449 | strcpy(save_main_buffer, main_buffer); |
| 19450 | |
| 19451 | if (pthread_attr_init(&attr) != 0) { |
| 19452 | exit(1); |
| 19453 | } |
| 19454 | |
| 19455 | if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) { |
| 19456 | exit(1); |
| 19457 | } |
| 19458 | |
| 19459 | if (pthread_join(subthread, NULL) != 0) { |
| 19460 | exit(1); |
| 19461 | } |
| 19462 | |
| 19463 | exit(! (strcmp(main_buffer, save_main_buffer) == 0)); |
| 19464 | } |
| 19465 | EOCP |
| 19466 | case "$usethreads" in |
| 19467 | define) |
| 19468 | set try |
| 19469 | if eval $compile; then |
| 19470 | echo "Your system has nl_langinfo_l()..." >&4 |
| 19471 | if $run ./try; then |
| 19472 | echo "and it is thread-safe (just as I'd hoped)." >&4 |
| 19473 | d_thread_safe_nl_langinfo_l="$define" |
| 19474 | echo "$d_thread_safe_nl_langinfo_l" >&4 |
| 19475 | else |
| 19476 | echo "but it isn't thread-safe, so we won't use it." >&4 |
| 19477 | fi |
| 19478 | else |
| 19479 | echo "your system does not have nl_langinfo_l()" >&4 |
| 19480 | fi |
| 19481 | ;; |
| 19482 | *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4 |
| 19483 | esac |
| 19484 | if test X"$d_thread_safe_nl_langinfo_l" = X; then |
| 19485 | d_thread_safe_nl_langinfo_l="$undef" |
| 19486 | fi |
| 19487 | $rm_try |
| 19488 | |
| 19489 | : see if time exists |
| 19490 | echo " " |
| 19491 | if test "X$d_time" = X -o X"$timetype" = X; then |
| 19492 | if set time val -f d_time; eval $csym; $val; then |
| 19493 | echo 'time() found.' >&4 |
| 19494 | val="$define" |
| 19495 | rp="What is the type returned by time() on this system?" |
| 19496 | set time_t timetype long stdio.h sys/types.h |
| 19497 | eval $typedef_ask |
| 19498 | else |
| 19499 | echo 'time() not found, hope that will do.' >&4 |
| 19500 | val="$undef" |
| 19501 | timetype='int'; |
| 19502 | fi |
| 19503 | set d_time |
| 19504 | eval $setvar |
| 19505 | fi |
| 19506 | |
| 19507 | : see if timegm exists |
| 19508 | set timegm d_timegm |
| 19509 | eval $inlibc |
| 19510 | |
| 19511 | : see if this is a sys/times.h system |
| 19512 | set sys/times.h i_systimes |
| 19513 | eval $inhdr |
| 19514 | |
| 19515 | : see if times exists |
| 19516 | echo " " |
| 19517 | if set times val -f d_times; eval $csym; $val; then |
| 19518 | echo 'times() found.' >&4 |
| 19519 | d_times="$define" |
| 19520 | inc='' |
| 19521 | case "$i_systimes" in |
| 19522 | "$define") inc='sys/times.h';; |
| 19523 | esac |
| 19524 | rp="What is the type returned by times() on this system?" |
| 19525 | set clock_t clocktype long stdio.h sys/types.h $inc |
| 19526 | eval $typedef_ask |
| 19527 | else |
| 19528 | echo 'times() NOT found, hope that will do.' >&4 |
| 19529 | d_times="$undef" |
| 19530 | clocktype='int' |
| 19531 | fi |
| 19532 | |
| 19533 | : see if tmpnam_r exists |
| 19534 | set tmpnam_r d_tmpnam_r |
| 19535 | eval $inlibc |
| 19536 | case "$d_tmpnam_r" in |
| 19537 | "$define") |
| 19538 | hdrs="$i_systypes sys/types.h define stdio.h " |
| 19539 | case "$d_tmpnam_r_proto:$usethreads" in |
| 19540 | ":define") d_tmpnam_r_proto=define |
| 19541 | set d_tmpnam_r_proto tmpnam_r $hdrs |
| 19542 | eval $hasproto ;; |
| 19543 | *) ;; |
| 19544 | esac |
| 19545 | case "$d_tmpnam_r_proto" in |
| 19546 | define) |
| 19547 | case "$tmpnam_r_proto" in |
| 19548 | ''|0) try='char* tmpnam_r(char*);' |
| 19549 | ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;; |
| 19550 | esac |
| 19551 | case "$tmpnam_r_proto" in |
| 19552 | ''|0) d_tmpnam_r=undef |
| 19553 | tmpnam_r_proto=0 |
| 19554 | echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;; |
| 19555 | * ) case "$tmpnam_r_proto" in |
| 19556 | REENTRANT_PROTO*) ;; |
| 19557 | *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;; |
| 19558 | esac |
| 19559 | echo "Prototype: $try" ;; |
| 19560 | esac |
| 19561 | ;; |
| 19562 | *) case "$usethreads" in |
| 19563 | define) echo "tmpnam_r has no prototype, not using it." >&4 ;; |
| 19564 | esac |
| 19565 | d_tmpnam_r=undef |
| 19566 | tmpnam_r_proto=0 |
| 19567 | ;; |
| 19568 | esac |
| 19569 | ;; |
| 19570 | *) tmpnam_r_proto=0 |
| 19571 | ;; |
| 19572 | esac |
| 19573 | |
| 19574 | : see if towlower exists |
| 19575 | set towlower d_towlower |
| 19576 | eval $inlibc |
| 19577 | |
| 19578 | : see if trunc exists |
| 19579 | set trunc d_trunc |
| 19580 | eval $inlibc |
| 19581 | |
| 19582 | : see if truncate exists |
| 19583 | set truncate d_truncate |
| 19584 | eval $inlibc |
| 19585 | |
| 19586 | : see if ttyname_r exists |
| 19587 | set ttyname_r d_ttyname_r |
| 19588 | eval $inlibc |
| 19589 | case "$d_ttyname_r" in |
| 19590 | "$define") |
| 19591 | hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h" |
| 19592 | case "$d_ttyname_r_proto:$usethreads" in |
| 19593 | ":define") d_ttyname_r_proto=define |
| 19594 | set d_ttyname_r_proto ttyname_r $hdrs |
| 19595 | eval $hasproto ;; |
| 19596 | *) ;; |
| 19597 | esac |
| 19598 | case "$d_ttyname_r_proto" in |
| 19599 | define) |
| 19600 | case "$ttyname_r_proto" in |
| 19601 | ''|0) try='int ttyname_r(int, char*, size_t);' |
| 19602 | ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;; |
| 19603 | esac |
| 19604 | case "$ttyname_r_proto" in |
| 19605 | ''|0) try='int ttyname_r(int, char*, int);' |
| 19606 | ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;; |
| 19607 | esac |
| 19608 | case "$ttyname_r_proto" in |
| 19609 | ''|0) try='char* ttyname_r(int, char*, int);' |
| 19610 | ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;; |
| 19611 | esac |
| 19612 | case "$ttyname_r_proto" in |
| 19613 | ''|0) d_ttyname_r=undef |
| 19614 | ttyname_r_proto=0 |
| 19615 | echo "Disabling ttyname_r, cannot determine prototype." >&4 ;; |
| 19616 | * ) case "$ttyname_r_proto" in |
| 19617 | REENTRANT_PROTO*) ;; |
| 19618 | *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;; |
| 19619 | esac |
| 19620 | echo "Prototype: $try" ;; |
| 19621 | esac |
| 19622 | ;; |
| 19623 | *) case "$usethreads" in |
| 19624 | define) echo "ttyname_r has no prototype, not using it." >&4 ;; |
| 19625 | esac |
| 19626 | d_ttyname_r=undef |
| 19627 | ttyname_r_proto=0 |
| 19628 | ;; |
| 19629 | esac |
| 19630 | ;; |
| 19631 | *) ttyname_r_proto=0 |
| 19632 | ;; |
| 19633 | esac |
| 19634 | |
| 19635 | : see if tzname[] exists |
| 19636 | echo " " |
| 19637 | if set tzname val -a d_tzname; eval $csym; $val; then |
| 19638 | val="$define" |
| 19639 | echo 'tzname[] found.' >&4 |
| 19640 | else |
| 19641 | val="$undef" |
| 19642 | echo 'tzname[] NOT found.' >&4 |
| 19643 | fi |
| 19644 | set d_tzname |
| 19645 | eval $setvar |
| 19646 | |
| 19647 | : Check if is a multiplatform env |
| 19648 | case "$osname" in |
| 19649 | darwin) multiarch="$define" ;; |
| 19650 | esac |
| 19651 | case "$multiarch" in |
| 19652 | ''|[nN]*) multiarch="$undef" ;; |
| 19653 | esac |
| 19654 | |
| 19655 | : check for ordering of bytes in a UV |
| 19656 | echo " " |
| 19657 | case "$multiarch" in |
| 19658 | *$define*) |
| 19659 | $cat <<EOM |
| 19660 | You seem to be doing a multiarchitecture build, |
| 19661 | skipping the byteorder check. |
| 19662 | |
| 19663 | EOM |
| 19664 | byteorder='ffff' |
| 19665 | ;; |
| 19666 | *) |
| 19667 | case "$byteorder" in |
| 19668 | '') |
| 19669 | $cat <<'EOM' |
| 19670 | In the following, larger digits indicate more significance. A big-endian |
| 19671 | machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A |
| 19672 | little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other |
| 19673 | machines may have weird orders like 3412. A Cray will report 87654321, |
| 19674 | an Alpha will report 12345678. If the test program works the default is |
| 19675 | probably right. |
| 19676 | I'm now running the test program... |
| 19677 | EOM |
| 19678 | $cat >try.c <<EOCP |
| 19679 | #include <stdio.h> |
| 19680 | #$i_stdlib I_STDLIB |
| 19681 | #ifdef I_STDLIB |
| 19682 | #include <stdlib.h> |
| 19683 | #endif |
| 19684 | #include <sys/types.h> |
| 19685 | typedef $uvtype UV; |
| 19686 | int main() |
| 19687 | { |
| 19688 | int i; |
| 19689 | union { |
| 19690 | UV l; |
| 19691 | char c[$uvsize]; |
| 19692 | } u; |
| 19693 | |
| 19694 | if ($uvsize > 4) |
| 19695 | u.l = (((UV)0x08070605) << 32) | (UV)0x04030201; |
| 19696 | else |
| 19697 | u.l = (UV)0x04030201; |
| 19698 | for (i = 0; i < $uvsize; i++) |
| 19699 | printf("%c", u.c[i]+'0'); |
| 19700 | printf("\n"); |
| 19701 | exit(0); |
| 19702 | } |
| 19703 | EOCP |
| 19704 | xxx_prompt=y |
| 19705 | set try |
| 19706 | if eval $compile && $run ./try > /dev/null; then |
| 19707 | dflt=`$run ./try` |
| 19708 | case "$dflt" in |
| 19709 | [1-4][1-4][1-4][1-4]|12345678|87654321) |
| 19710 | echo "(The test program ran ok.)" |
| 19711 | echo "byteorder=$dflt" |
| 19712 | xxx_prompt=n |
| 19713 | ;; |
| 19714 | ????|????????) echo "(The test program ran ok.)" ;; |
| 19715 | *) echo "(The test program didn't run right for some reason.)" ;; |
| 19716 | esac |
| 19717 | else |
| 19718 | dflt='4321' |
| 19719 | cat <<'EOM' |
| 19720 | (I can't seem to compile the test program. Guessing big-endian...) |
| 19721 | EOM |
| 19722 | fi |
| 19723 | case "$xxx_prompt" in |
| 19724 | y) |
| 19725 | rp="What is the order of bytes in $uvtype?" |
| 19726 | . ./myread |
| 19727 | byteorder="$ans" |
| 19728 | ;; |
| 19729 | *) byteorder=$dflt |
| 19730 | ;; |
| 19731 | esac |
| 19732 | ;; |
| 19733 | esac |
| 19734 | $rm_try |
| 19735 | ;; |
| 19736 | esac |
| 19737 | |
| 19738 | : Checking 32bit alignedness |
| 19739 | $cat <<EOM |
| 19740 | |
| 19741 | Checking to see whether you can access character data unalignedly... |
| 19742 | EOM |
| 19743 | case "$d_u32align" in |
| 19744 | '') $cat >try.c <<EOCP |
| 19745 | #include <stdio.h> |
| 19746 | #$i_stdlib I_STDLIB |
| 19747 | #ifdef I_STDLIB |
| 19748 | #include <stdlib.h> |
| 19749 | #endif |
| 19750 | #define U32 $u32type |
| 19751 | #define BYTEORDER 0x$byteorder |
| 19752 | #define U8 $u8type |
| 19753 | #include <signal.h> |
| 19754 | #ifdef SIGBUS |
| 19755 | $signal_t bletch(int s) { exit(4); } |
| 19756 | #endif |
| 19757 | int main() { |
| 19758 | #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321 |
| 19759 | volatile U8 buf[8]; |
| 19760 | volatile U32 *up; |
| 19761 | int i; |
| 19762 | |
| 19763 | if (sizeof(U32) != 4) { |
| 19764 | printf("sizeof(U32) is not 4, but %d\n", sizeof(U32)); |
| 19765 | exit(1); |
| 19766 | } |
| 19767 | |
| 19768 | fflush(stdout); |
| 19769 | |
| 19770 | #ifdef SIGBUS |
| 19771 | signal(SIGBUS, bletch); |
| 19772 | #endif |
| 19773 | |
| 19774 | buf[0] = 0; |
| 19775 | buf[1] = 0; |
| 19776 | buf[2] = 0; |
| 19777 | buf[3] = 1; |
| 19778 | buf[4] = 0; |
| 19779 | buf[5] = 0; |
| 19780 | buf[6] = 0; |
| 19781 | buf[7] = 1; |
| 19782 | |
| 19783 | for (i = 0; i < 4; i++) { |
| 19784 | up = (U32*)(buf + i); |
| 19785 | if (! ((*up == 1 << (8*i)) || /* big-endian */ |
| 19786 | (*up == 1 << (8*(3-i))) /* little-endian */ |
| 19787 | ) |
| 19788 | ) |
| 19789 | { |
| 19790 | printf("read failed (%x)\n", *up); |
| 19791 | exit(2); |
| 19792 | } |
| 19793 | } |
| 19794 | |
| 19795 | /* write test */ |
| 19796 | for (i = 0; i < 4; i++) { |
| 19797 | up = (U32*)(buf + i); |
| 19798 | *up = 0xBeef; |
| 19799 | if (*up != 0xBeef) { |
| 19800 | printf("write failed (%x)\n", *up); |
| 19801 | exit(3); |
| 19802 | } |
| 19803 | } |
| 19804 | |
| 19805 | exit(0); |
| 19806 | #else |
| 19807 | printf("1\n"); |
| 19808 | exit(1); |
| 19809 | #endif |
| 19810 | return 0; |
| 19811 | } |
| 19812 | EOCP |
| 19813 | set try |
| 19814 | if eval $compile_ok; then |
| 19815 | echo "(Testing for character data alignment may crash the test. That's okay.)" >&4 |
| 19816 | $run ./try 2>&1 >/dev/null |
| 19817 | case "$?" in |
| 19818 | 0) cat >&4 <<EOM |
| 19819 | You can access character data pretty unalignedly. |
| 19820 | EOM |
| 19821 | d_u32align="$undef" |
| 19822 | ;; |
| 19823 | *) cat >&4 <<EOM |
| 19824 | It seems that you must access character data in an aligned manner. |
| 19825 | EOM |
| 19826 | d_u32align="$define" |
| 19827 | ;; |
| 19828 | esac |
| 19829 | else |
| 19830 | rp='Can you access character data at unaligned addresses?' |
| 19831 | dflt='n' |
| 19832 | . ./myread |
| 19833 | case "$ans" in |
| 19834 | [yY]*) d_u32align="$undef" ;; |
| 19835 | *) d_u32align="$define" ;; |
| 19836 | esac |
| 19837 | fi |
| 19838 | $rm_try |
| 19839 | ;; |
| 19840 | esac |
| 19841 | |
| 19842 | : see if ualarm exists |
| 19843 | set ualarm d_ualarm |
| 19844 | eval $inlibc |
| 19845 | |
| 19846 | : see if umask exists |
| 19847 | set umask d_umask |
| 19848 | eval $inlibc |
| 19849 | |
| 19850 | : see if unordered exists |
| 19851 | set unordered d_unordered |
| 19852 | eval $inlibc |
| 19853 | |
| 19854 | : see if unsetenv exists |
| 19855 | set unsetenv d_unsetenv |
| 19856 | eval $inlibc |
| 19857 | |
| 19858 | : see if usleep exists |
| 19859 | set usleep d_usleep |
| 19860 | eval $inlibc |
| 19861 | |
| 19862 | : see if prototype for usleep is available |
| 19863 | echo " " |
| 19864 | set d_usleepproto usleep $i_unistd unistd.h |
| 19865 | eval $hasproto |
| 19866 | |
| 19867 | : see if ustat exists |
| 19868 | set ustat d_ustat |
| 19869 | eval $inlibc |
| 19870 | |
| 19871 | : see if closedir exists |
| 19872 | set closedir d_closedir |
| 19873 | eval $inlibc |
| 19874 | |
| 19875 | case "$d_closedir" in |
| 19876 | "$define") |
| 19877 | echo " " |
| 19878 | echo "Checking whether closedir() returns a status..." >&4 |
| 19879 | cat > try.c <<EOM |
| 19880 | #$i_dirent I_DIRENT /**/ |
| 19881 | #$i_sysdir I_SYS_DIR /**/ |
| 19882 | #$i_sysndir I_SYS_NDIR /**/ |
| 19883 | #$i_systypes I_SYS_TYPES /**/ |
| 19884 | |
| 19885 | #if defined(I_SYS_TYPES) |
| 19886 | #include <sys/types.h> |
| 19887 | #endif |
| 19888 | #if defined(I_DIRENT) |
| 19889 | #include <dirent.h> |
| 19890 | #else |
| 19891 | #ifdef I_SYS_NDIR |
| 19892 | #include <sys/ndir.h> |
| 19893 | #else |
| 19894 | #ifdef I_SYS_DIR |
| 19895 | #include <sys/dir.h> |
| 19896 | #endif |
| 19897 | #endif |
| 19898 | #endif |
| 19899 | int main() { return closedir(opendir(".")); } |
| 19900 | EOM |
| 19901 | set try |
| 19902 | if eval $compile_ok; then |
| 19903 | if $run ./try > /dev/null 2>&1 ; then |
| 19904 | echo "Yes, it does." |
| 19905 | val="$undef" |
| 19906 | else |
| 19907 | echo "No, it doesn't." |
| 19908 | val="$define" |
| 19909 | fi |
| 19910 | else |
| 19911 | echo "(I can't seem to compile the test program--assuming it doesn't)" |
| 19912 | val="$define" |
| 19913 | fi |
| 19914 | ;; |
| 19915 | *) |
| 19916 | val="$undef"; |
| 19917 | ;; |
| 19918 | esac |
| 19919 | set d_void_closedir |
| 19920 | eval $setvar |
| 19921 | $rm_try |
| 19922 | |
| 19923 | : see if there is a wait4 |
| 19924 | set wait4 d_wait4 |
| 19925 | eval $inlibc |
| 19926 | |
| 19927 | : see if waitpid exists |
| 19928 | set waitpid d_waitpid |
| 19929 | eval $inlibc |
| 19930 | |
| 19931 | : see if wcrtomb exists |
| 19932 | set wcrtomb d_wcrtomb |
| 19933 | eval $inlibc |
| 19934 | |
| 19935 | : look for wcscmp |
| 19936 | echo " " |
| 19937 | $cat >try.c <<'EOCP' |
| 19938 | #include <stdio.h> |
| 19939 | #include <wchar.h> |
| 19940 | int main () |
| 19941 | { |
| 19942 | wchar_t *s = L" "; |
| 19943 | return (wcscmp (s, s) ? 1 : 0); |
| 19944 | } |
| 19945 | EOCP |
| 19946 | set try |
| 19947 | val="$undef" |
| 19948 | if eval $compile; then |
| 19949 | `$run ./try` |
| 19950 | case "$?" in |
| 19951 | 0) echo "A working wcscmp() found." >&4 |
| 19952 | val="$define" ;; |
| 19953 | *) echo "wcscmp() found, but it doesn't work" >&4 |
| 19954 | ;; |
| 19955 | esac |
| 19956 | else |
| 19957 | echo "wcscmp() NOT found." >&4 |
| 19958 | fi |
| 19959 | set d_wcscmp |
| 19960 | eval $setvar |
| 19961 | $rm_try |
| 19962 | |
| 19963 | : see if wcstombs exists |
| 19964 | set wcstombs d_wcstombs |
| 19965 | eval $inlibc |
| 19966 | |
| 19967 | : look for wcsxfrm |
| 19968 | echo " " |
| 19969 | $cat >try.c <<'EOCP' |
| 19970 | #include <errno.h> |
| 19971 | #include <wchar.h> |
| 19972 | int main () |
| 19973 | { |
| 19974 | wchar_t dst[4], *src = L" "; |
| 19975 | errno = 0; |
| 19976 | return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1); |
| 19977 | } |
| 19978 | EOCP |
| 19979 | set try |
| 19980 | val="$undef" |
| 19981 | if eval $compile; then |
| 19982 | `$run ./try` |
| 19983 | case "$?" in |
| 19984 | 0) echo "A working wcsxfrm() found." >&4 |
| 19985 | val="$define" ;; |
| 19986 | *) echo "wcsxfrm() found, but it doesn't work" >&4 |
| 19987 | ;; |
| 19988 | esac |
| 19989 | else |
| 19990 | echo "wcsxfrm() NOT found." >&4 |
| 19991 | fi |
| 19992 | set d_wcsxfrm |
| 19993 | eval $setvar |
| 19994 | $rm_try |
| 19995 | |
| 19996 | : see if wctomb exists |
| 19997 | set wctomb d_wctomb |
| 19998 | eval $inlibc |
| 19999 | |
| 20000 | : see if writev exists |
| 20001 | set writev d_writev |
| 20002 | eval $inlibc |
| 20003 | |
| 20004 | : check for alignment requirements |
| 20005 | echo " " |
| 20006 | case "$alignbytes" in |
| 20007 | '') echo "Checking alignment constraints..." >&4 |
| 20008 | $cat >try.c <<EOCP |
| 20009 | #include <stdio.h> |
| 20010 | struct foobar { |
| 20011 | char foo; |
| 20012 | $nvtype bar; |
| 20013 | } try_algn; |
| 20014 | int main() |
| 20015 | { |
| 20016 | printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo)); |
| 20017 | return(0); |
| 20018 | } |
| 20019 | EOCP |
| 20020 | set try |
| 20021 | if eval $compile_ok; then |
| 20022 | dflt=`$run ./try` |
| 20023 | else |
| 20024 | dflt='8' |
| 20025 | echo "(I can't seem to compile the test program...)" |
| 20026 | fi |
| 20027 | case "$multiarch" in |
| 20028 | *$define*) |
| 20029 | : The usual safe value is 8, but Darwin with -Duselongdouble |
| 20030 | : needs 16. Hence, we will take 8 as a minimum, but allow |
| 20031 | : Configure to pick a larger value if needed. |
| 20032 | if $test "$dflt" -lt 8; then |
| 20033 | dflt='8' |
| 20034 | echo "Setting alignment to 8 for multiarch support.">&4 |
| 20035 | fi |
| 20036 | ;; |
| 20037 | esac |
| 20038 | ;; |
| 20039 | *) dflt="$alignbytes" |
| 20040 | ;; |
| 20041 | esac |
| 20042 | rp="Doubles must be aligned on a how-many-byte boundary?" |
| 20043 | . ./myread |
| 20044 | alignbytes="$ans" |
| 20045 | $rm_try |
| 20046 | |
| 20047 | : set the base revision |
| 20048 | baserev=5.0 |
| 20049 | |
| 20050 | : length of character in bytes. Is always 1, otherwise it is not C |
| 20051 | : This used to be a test using sizeof |
| 20052 | charsize=1 |
| 20053 | |
| 20054 | : Check for the number of bits in a character |
| 20055 | case "$charbits" in |
| 20056 | '') echo "Checking how long a character is (in bits)..." >&4 |
| 20057 | $cat >try.c <<EOCP |
| 20058 | #include <stdio.h> |
| 20059 | int main () |
| 20060 | { |
| 20061 | int n; |
| 20062 | unsigned char c; |
| 20063 | for (c = 1, n = 0; c; c <<= 1, n++) ; |
| 20064 | printf ("%d\n", n); |
| 20065 | return (0); |
| 20066 | } |
| 20067 | EOCP |
| 20068 | set try |
| 20069 | if eval $compile_ok; then |
| 20070 | dflt=`$run ./try` |
| 20071 | else |
| 20072 | dflt='8' |
| 20073 | echo "(I can't seem to compile the test program. Guessing...)" |
| 20074 | fi |
| 20075 | ;; |
| 20076 | *) |
| 20077 | dflt="$charbits" |
| 20078 | ;; |
| 20079 | esac |
| 20080 | rp="What is the length of a character (in bits)?" |
| 20081 | . ./myread |
| 20082 | charbits="$ans" |
| 20083 | $rm_try |
| 20084 | case "$charbits" in |
| 20085 | 8) ;; |
| 20086 | *) cat >&4 << EOM |
| 20087 | Your system has an unsigned character size of $charbits bits, which |
| 20088 | is rather unusual (normally it is 8 bits). Perl likely will not work |
| 20089 | correctly on your system, with subtle bugs in various places. |
| 20090 | EOM |
| 20091 | rp='Do you really want to continue?' |
| 20092 | dflt='n' |
| 20093 | . ./myread |
| 20094 | case "$ans" in |
| 20095 | [yY]) echo >&4 "Okay, continuing." ;; |
| 20096 | *) exit 1 ;; |
| 20097 | esac |
| 20098 | esac |
| 20099 | |
| 20100 | : how do we concatenate cpp tokens here? |
| 20101 | echo " " |
| 20102 | echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4 |
| 20103 | $cat >cpp_stuff.c <<'EOCP' |
| 20104 | #define RCAT(a,b)a/**/b |
| 20105 | #define ACAT(a,b)a ## b |
| 20106 | RCAT(Rei,ser) |
| 20107 | ACAT(Cir,cus) |
| 20108 | EOCP |
| 20109 | $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1 |
| 20110 | if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then |
| 20111 | echo "Oh! Smells like ANSI's been here." >&4 |
| 20112 | echo "We can catify or stringify, separately or together!" |
| 20113 | cpp_stuff=42 |
| 20114 | elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then |
| 20115 | echo "Ah, yes! The good old days!" >&4 |
| 20116 | echo "However, in the good old days we don't know how to stringify and" |
| 20117 | echo "catify at the same time." |
| 20118 | cpp_stuff=1 |
| 20119 | else |
| 20120 | $cat >&4 <<EOM |
| 20121 | Hmm, I don't seem to be able to concatenate tokens with your cpp. |
| 20122 | You're going to have to edit the values of CAT[2-5] in config.h... |
| 20123 | EOM |
| 20124 | cpp_stuff="/* Help! How do we handle cpp_stuff? */*/" |
| 20125 | fi |
| 20126 | $rm -f cpp_stuff.* |
| 20127 | |
| 20128 | : see if this is a db.h system |
| 20129 | set db.h i_db |
| 20130 | eval $inhdr |
| 20131 | |
| 20132 | case "$i_db" in |
| 20133 | $define) |
| 20134 | : Check db version. |
| 20135 | echo " " |
| 20136 | echo "Checking Berkeley DB version ..." >&4 |
| 20137 | $cat >try.c <<EOCP |
| 20138 | #include <sys/types.h> |
| 20139 | #include <stdio.h> |
| 20140 | #$i_stdlib I_STDLIB |
| 20141 | #ifdef I_STDLIB |
| 20142 | #include <stdlib.h> |
| 20143 | #endif |
| 20144 | #include <db.h> |
| 20145 | int main(int argc, char *argv[]) |
| 20146 | { |
| 20147 | #ifdef DB_VERSION_MAJOR /* DB version >= 2 */ |
| 20148 | int Major, Minor, Patch ; |
| 20149 | unsigned long Version ; |
| 20150 | (void)db_version(&Major, &Minor, &Patch) ; |
| 20151 | if (argc == 2) { |
| 20152 | printf("%d %d %d %d %d %d\n", |
| 20153 | DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, |
| 20154 | Major, Minor, Patch); |
| 20155 | exit(0); |
| 20156 | } |
| 20157 | printf("You have Berkeley DB Version 2 or greater.\n"); |
| 20158 | |
| 20159 | printf("db.h is from Berkeley DB Version %d.%d.%d\n", |
| 20160 | DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH); |
| 20161 | printf("libdb is from Berkeley DB Version %d.%d.%d\n", |
| 20162 | Major, Minor, Patch) ; |
| 20163 | |
| 20164 | /* check that db.h & libdb are compatible */ |
| 20165 | if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) { |
| 20166 | printf("db.h and libdb are incompatible.\n") ; |
| 20167 | exit(3); |
| 20168 | } |
| 20169 | |
| 20170 | printf("db.h and libdb are compatible.\n") ; |
| 20171 | |
| 20172 | Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000 |
| 20173 | + DB_VERSION_PATCH ; |
| 20174 | |
| 20175 | /* needs to be >= 2.3.4 */ |
| 20176 | if (Version < 2003004) { |
| 20177 | /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */ |
| 20178 | printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ; |
| 20179 | exit(2); |
| 20180 | } |
| 20181 | |
| 20182 | exit(0); |
| 20183 | #else |
| 20184 | #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC) |
| 20185 | if (argc == 2) { |
| 20186 | printf("1 0 0\n"); |
| 20187 | exit(0); |
| 20188 | } |
| 20189 | printf("You have Berkeley DB Version 1.\n"); |
| 20190 | exit(0); /* DB version < 2: the coast is clear. */ |
| 20191 | #else |
| 20192 | exit(1); /* <db.h> not Berkeley DB? */ |
| 20193 | #endif |
| 20194 | #endif |
| 20195 | } |
| 20196 | EOCP |
| 20197 | set try |
| 20198 | if eval $compile_ok && $run ./try; then |
| 20199 | echo 'Looks OK.' >&4 |
| 20200 | set `$run ./try 1` |
| 20201 | db_version_major=$1 |
| 20202 | db_version_minor=$2 |
| 20203 | db_version_patch=$3 |
| 20204 | else |
| 20205 | echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4 |
| 20206 | i_db=$undef |
| 20207 | case " $libs " in |
| 20208 | *"-ldb "*) |
| 20209 | : Remove db from list of libraries to use |
| 20210 | echo "Removing unusable -ldb from library list" >&4 |
| 20211 | set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'` |
| 20212 | shift |
| 20213 | libs="$*" |
| 20214 | echo "libs = $libs" >&4 |
| 20215 | ;; |
| 20216 | esac |
| 20217 | fi |
| 20218 | $rm_try |
| 20219 | ;; |
| 20220 | esac |
| 20221 | |
| 20222 | case "$i_db" in |
| 20223 | define) |
| 20224 | : Check the return type needed for hash |
| 20225 | echo " " |
| 20226 | echo "Checking return type needed for hash for Berkeley DB ..." >&4 |
| 20227 | $cat >try.c <<EOCP |
| 20228 | #include <sys/types.h> |
| 20229 | #include <db.h> |
| 20230 | |
| 20231 | #ifndef DB_VERSION_MAJOR |
| 20232 | u_int32_t hash_cb (const void* ptr, size_t size) |
| 20233 | { |
| 20234 | return 0; |
| 20235 | } |
| 20236 | HASHINFO info; |
| 20237 | int main() |
| 20238 | { |
| 20239 | info.hash = hash_cb; |
| 20240 | } |
| 20241 | #endif |
| 20242 | EOCP |
| 20243 | if $cc $ccflags -c try.c >try.out 2>&1 ; then |
| 20244 | if $contains warning try.out >>/dev/null 2>&1 ; then |
| 20245 | db_hashtype='int' |
| 20246 | else |
| 20247 | db_hashtype='u_int32_t' |
| 20248 | fi |
| 20249 | else |
| 20250 | : XXX Maybe we should just give up here. |
| 20251 | db_hashtype=u_int32_t |
| 20252 | $cat try.out >&4 |
| 20253 | echo "Help: I can't seem to compile the db test program." >&4 |
| 20254 | echo "Something's wrong, but I'll assume you use $db_hashtype." >&4 |
| 20255 | fi |
| 20256 | $rm_try |
| 20257 | echo "Your version of Berkeley DB uses $db_hashtype for hash." |
| 20258 | ;; |
| 20259 | *) db_hashtype=u_int32_t |
| 20260 | ;; |
| 20261 | esac |
| 20262 | case "$i_db" in |
| 20263 | define) |
| 20264 | : Check the return type needed for prefix |
| 20265 | echo " " |
| 20266 | echo "Checking return type needed for prefix for Berkeley DB ..." >&4 |
| 20267 | cat >try.c <<EOCP |
| 20268 | #include <sys/types.h> |
| 20269 | #include <db.h> |
| 20270 | |
| 20271 | #ifndef DB_VERSION_MAJOR |
| 20272 | size_t prefix_cb (const DBT *key1, const DBT *key2) |
| 20273 | { |
| 20274 | return 0; |
| 20275 | } |
| 20276 | BTREEINFO info; |
| 20277 | int main() |
| 20278 | { |
| 20279 | info.prefix = prefix_cb; |
| 20280 | } |
| 20281 | #endif |
| 20282 | EOCP |
| 20283 | if $cc $ccflags -c try.c >try.out 2>&1 ; then |
| 20284 | if $contains warning try.out >>/dev/null 2>&1 ; then |
| 20285 | db_prefixtype='int' |
| 20286 | else |
| 20287 | db_prefixtype='size_t' |
| 20288 | fi |
| 20289 | else |
| 20290 | db_prefixtype='size_t' |
| 20291 | : XXX Maybe we should just give up here. |
| 20292 | $cat try.out >&4 |
| 20293 | echo "Help: I can't seem to compile the db test program." >&4 |
| 20294 | echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4 |
| 20295 | fi |
| 20296 | $rm_try |
| 20297 | echo "Your version of Berkeley DB uses $db_prefixtype for prefix." |
| 20298 | ;; |
| 20299 | *) db_prefixtype='size_t' |
| 20300 | ;; |
| 20301 | esac |
| 20302 | |
| 20303 | : Include . in @INC |
| 20304 | $cat <<EOM |
| 20305 | |
| 20306 | Historically Perl has provided a final fallback of the current working |
| 20307 | directory '.' when searching for a library. This, however, can lead to |
| 20308 | problems when a Perl program which loads optional modules is called from |
| 20309 | a shared directory. This can lead to executing unexpected code. |
| 20310 | |
| 20311 | EOM |
| 20312 | |
| 20313 | # When changing to exclude by default: |
| 20314 | case "$default_inc_excludes_dot" in |
| 20315 | $undef|false|[nN]*) dflt="n" ;; |
| 20316 | *) dflt="y" ;; |
| 20317 | esac |
| 20318 | # To turn exclude off by default: |
| 20319 | #case "$default_inc_excludes_dot" in |
| 20320 | # $define|true|[yY]*) dflt="y" ;; |
| 20321 | # *) dflt="n" ;; |
| 20322 | #esac |
| 20323 | |
| 20324 | rp='Exclude '.' from @INC by default? ' |
| 20325 | . ./myread |
| 20326 | case "$ans" in |
| 20327 | [nN]|undef) default_inc_excludes_dot="$undef" ;; |
| 20328 | *) default_inc_excludes_dot="$define" ;; |
| 20329 | esac |
| 20330 | |
| 20331 | : Check what kind of inf/nan your system has |
| 20332 | $echo "Checking the kind of infinities and nans you have..." >&4 |
| 20333 | $echo "(The following tests may crash. That's okay.)" >&4 |
| 20334 | $cat >try.c <<EOP |
| 20335 | #define DOUBLESIZE $doublesize |
| 20336 | #$d_longdbl HAS_LONG_DOUBLE |
| 20337 | #ifdef HAS_LONG_DOUBLE |
| 20338 | #define LONG_DOUBLESIZE $longdblsize |
| 20339 | #define LONG_DOUBLEKIND $longdblkind |
| 20340 | #endif |
| 20341 | #include <math.h> |
| 20342 | #include <string.h> |
| 20343 | #include <stdio.h> |
| 20344 | /* Note that whether the sign bit is on or off |
| 20345 | * for NaN depends on the CPU/FPU, and possibly |
| 20346 | * can be affected by the build toolchain. |
| 20347 | * |
| 20348 | * For example for older MIPS and HP-PA 2.0 the quiet NaN is: |
| 20349 | * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff |
| 20350 | * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
| 20351 | * (respectively) as opposed to the more usual |
| 20352 | * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
| 20353 | * |
| 20354 | * Pre-IEEE-754 floating point format do not even have inf/nan support |
| 20355 | * at all. They might have a "max" value (DBL_MAX), which may be deadly |
| 20356 | * to even mention, causing immediate SIGFPE or equivalent: this is |
| 20357 | * the case with VAX floating point, for example. |
| 20358 | */ |
| 20359 | static void bytes(void *v, unsigned int n) { |
| 20360 | unsigned char *p = (unsigned char *)v; |
| 20361 | int i; |
| 20362 | for (i = 0; i < n; i++) { |
| 20363 | printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n"); |
| 20364 | } |
| 20365 | } |
| 20366 | int main(int argc, char *argv[]) { |
| 20367 | /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double) |
| 20368 | * because some compilers are 'smart' and not only warn but refuse to |
| 20369 | * compile such 'illegal' values. */ |
| 20370 | double dinf = exp(1e9); |
| 20371 | double dnan = sqrt(-1.0); |
| 20372 | #ifdef HAS_LONG_DOUBLE |
| 20373 | long double ldinf = (long double)exp(1e9); |
| 20374 | long double ldnan = (long double)sqrt(-1.0); |
| 20375 | # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4 |
| 20376 | /* the 80-bit long doubles might have garbage in their excess bytes */ |
| 20377 | memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10); |
| 20378 | memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10); |
| 20379 | # endif |
| 20380 | if (argc == 2) { |
| 20381 | switch (argv[1][0]) { |
| 20382 | case '1': bytes(&dinf, sizeof(dinf)); break; |
| 20383 | case '2': bytes(&dnan, sizeof(dnan)); break; |
| 20384 | case '3': bytes(&ldinf, sizeof(ldinf)); break; |
| 20385 | case '4': bytes(&ldnan, sizeof(ldnan)); break; |
| 20386 | #endif |
| 20387 | } |
| 20388 | } |
| 20389 | return 0; |
| 20390 | } |
| 20391 | EOP |
| 20392 | set try |
| 20393 | if eval $compile; then |
| 20394 | doubleinfbytes=`$run ./try 1` |
| 20395 | doublenanbytes=`$run ./try 2` |
| 20396 | case "$d_longdbl" in |
| 20397 | $define) |
| 20398 | longdblinfbytes=`$run ./try 3` |
| 20399 | longdblnanbytes=`$run ./try 4` |
| 20400 | ;; |
| 20401 | esac |
| 20402 | else |
| 20403 | # Defaults in case the above test program failed. |
| 20404 | case "$doublekind" in |
| 20405 | 1) # IEEE 754 32-bit LE |
| 20406 | doubleinfbytes='0x00, 0x00, 0xf0, 0x7f' |
| 20407 | doublenanbytes='0x00, 0x00, 0xf8, 0x7f' |
| 20408 | ;; |
| 20409 | 2) # IEEE 754 32-bit BE |
| 20410 | doubleinfbytes='0x7f, 0xf0, 0x00, 0x00' |
| 20411 | doublenanbytes='0x7f, 0xf8, 0x00, 0x00' |
| 20412 | ;; |
| 20413 | 3) # IEEE 754 64-bit LE |
| 20414 | doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' |
| 20415 | doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' |
| 20416 | ;; |
| 20417 | 4) # IEEE 754 64-bit BE |
| 20418 | doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20419 | doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20420 | ;; |
| 20421 | 5) # IEEE 754 128-bit LE |
| 20422 | doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' |
| 20423 | doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' |
| 20424 | ;; |
| 20425 | 6) # IEEE 754 128-bit BE |
| 20426 | doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20427 | doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20428 | ;; |
| 20429 | 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE |
| 20430 | doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00' |
| 20431 | doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00' |
| 20432 | ;; |
| 20433 | 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE |
| 20434 | doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00' |
| 20435 | doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00' |
| 20436 | ;; |
| 20437 | 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan. |
| 20438 | doubleinfbytes=$undef |
| 20439 | doublenanbytes=$undef |
| 20440 | ;; |
| 20441 | *) # No idea. |
| 20442 | doubleinfbytes=$undef |
| 20443 | doublenanbytes=$undef |
| 20444 | ;; |
| 20445 | esac |
| 20446 | case "$longdblkind" in |
| 20447 | 1) # IEEE 754 128-bit LE |
| 20448 | longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f' |
| 20449 | longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f' |
| 20450 | ;; |
| 20451 | 2) # IEEE 754 128-bit BE |
| 20452 | longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20453 | longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20454 | ;; |
| 20455 | 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86) |
| 20456 | case "$longdblsize" in |
| 20457 | 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8) |
| 20458 | longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00' |
| 20459 | longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00' |
| 20460 | ;; |
| 20461 | 16) # x86_64 |
| 20462 | longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20463 | longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20464 | ;; |
| 20465 | *) # No idea. |
| 20466 | longdblinfbytes=$undef |
| 20467 | longdblnanbytes=$undef |
| 20468 | ;; |
| 20469 | esac |
| 20470 | ;; |
| 20471 | 4) # IEEE 754 80-bit BE, 12 or 16 bytes |
| 20472 | case "$longdblsize" in |
| 20473 | 12) # 32-bit system |
| 20474 | longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20475 | longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20476 | ;; |
| 20477 | 16) # 64-bit system |
| 20478 | longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20479 | longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20480 | ;; |
| 20481 | *) # No idea. |
| 20482 | longdblinfbytes=$undef |
| 20483 | longdblnanbytes=$undef |
| 20484 | ;; |
| 20485 | esac |
| 20486 | ;; |
| 20487 | 5) # 128-bit LE-LE "double double" |
| 20488 | longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f' |
| 20489 | longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f' |
| 20490 | ;; |
| 20491 | 6) # 128-bit BE-BE "double double" |
| 20492 | longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20493 | longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20494 | ;; |
| 20495 | 7) # 128-bit LE-BE "double double" |
| 20496 | longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20497 | longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20498 | ;; |
| 20499 | 8) # 128-bit BE-LE "double double" |
| 20500 | longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20501 | longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00' |
| 20502 | ;; |
| 20503 | 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan. |
| 20504 | longdblinfbytes=$undef |
| 20505 | longdblnanbytes=$undef |
| 20506 | ;; |
| 20507 | *) # No idea. |
| 20508 | longdblinfbytes=$undef |
| 20509 | longdblnanbytes=$undef |
| 20510 | ;; |
| 20511 | esac |
| 20512 | fi |
| 20513 | # In case the program crashed the values are empty, turn them undef. |
| 20514 | case "$doubleinfbytes" in |
| 20515 | '') doubleinfbytes=$undef ;; |
| 20516 | esac |
| 20517 | case "$doublenanbytes" in |
| 20518 | '') doublenanbytes=$undef ;; |
| 20519 | esac |
| 20520 | case "$longdblinfbytes" in |
| 20521 | '') longdblinfbytes=$undef ;; |
| 20522 | esac |
| 20523 | case "$longdblnanbytes" in |
| 20524 | '') longdblnanbytes=$undef ;; |
| 20525 | esac |
| 20526 | $rm_try |
| 20527 | |
| 20528 | : Check the length of the double mantissa |
| 20529 | $echo "Checking how many mantissa bits your doubles have..." >&4 |
| 20530 | $cat >try.c <<EOP |
| 20531 | #$i_sunmath I_SUNMATH |
| 20532 | #include <float.h> |
| 20533 | #ifdef I_SUNMATH |
| 20534 | # include <sunmath.h> |
| 20535 | #endif |
| 20536 | #ifdef DBL_MANT_DIG |
| 20537 | # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */ |
| 20538 | #endif |
| 20539 | #include <stdio.h> |
| 20540 | int main(int argc, char *argv[]) { |
| 20541 | #ifdef BITS |
| 20542 | printf("%d\n", BITS); |
| 20543 | #endif |
| 20544 | return 0; |
| 20545 | } |
| 20546 | EOP |
| 20547 | set try |
| 20548 | if eval $compile; then |
| 20549 | doublemantbits=`$run ./try` |
| 20550 | else |
| 20551 | doublemantbits="$undef" |
| 20552 | fi |
| 20553 | $rm_try |
| 20554 | |
| 20555 | : Check the length of the longdouble mantissa |
| 20556 | $echo "Checking how many mantissa bits your long doubles have..." >&4 |
| 20557 | $cat >try.c <<EOP |
| 20558 | #$i_sunmath I_SUNMATH |
| 20559 | #include <float.h> |
| 20560 | #ifdef I_SUNMATH |
| 20561 | # include <sunmath.h> |
| 20562 | #endif |
| 20563 | #$d_longdbl HAS_LONG_DOUBLE |
| 20564 | #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG) |
| 20565 | # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */ |
| 20566 | /* This format has no implicit bit. Beware, however, that for |
| 20567 | * this format the bare LDBL_MANT_DIG is misleading for inf/nan: |
| 20568 | * the top three bits are used for inf (100) / qnan (11x) / snan (101), |
| 20569 | * and the top bit must have been one since 387, zero is plain invalid. |
| 20570 | * For normal fp values, the LDBL_MANT_DIG is fine, though. */ |
| 20571 | # define BITS LDBL_MANT_DIG |
| 20572 | # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */ |
| 20573 | /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some |
| 20574 | * reason e.g. Irix thinks 107. But in any case, we want only |
| 20575 | * the number of real bits, the implicit bits are of no interest. */ |
| 20576 | # define BITS 2 * (DBL_MANT_DIG - 1) |
| 20577 | # else |
| 20578 | # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */ |
| 20579 | # endif |
| 20580 | #endif |
| 20581 | #include <stdio.h> |
| 20582 | int main(int argc, char *argv[]) { |
| 20583 | #ifdef BITS |
| 20584 | printf("%d\n", BITS); |
| 20585 | #endif |
| 20586 | return 0; |
| 20587 | } |
| 20588 | EOP |
| 20589 | set try |
| 20590 | if eval $compile; then |
| 20591 | longdblmantbits=`$run ./try` |
| 20592 | else |
| 20593 | longdblmantbits="$undef" |
| 20594 | fi |
| 20595 | $rm_try |
| 20596 | |
| 20597 | : Check the length of the NV mantissa |
| 20598 | $echo "Checking how many mantissa bits your NVs have..." >&4 |
| 20599 | if test "X$usequadmath" = "X$define"; then |
| 20600 | nvmantbits=112 # 128-1-15 |
| 20601 | else |
| 20602 | if test "X$nvsize" = "X$doublesize"; then |
| 20603 | nvmantbits="$doublemantbits" |
| 20604 | else |
| 20605 | if test "X$nvsize" = "X$longdblsize"; then |
| 20606 | nvmantbits="$longdblmantbits" |
| 20607 | else |
| 20608 | nvmantbits="$undef" |
| 20609 | fi |
| 20610 | fi |
| 20611 | fi |
| 20612 | |
| 20613 | : How can we generate normalized random numbers ? |
| 20614 | echo " " |
| 20615 | echo "Using our internal random number implementation..." >&4 |
| 20616 | |
| 20617 | case "$ccflags" in |
| 20618 | *-Dmy_rand=*|*-Dmy_srand=*) |
| 20619 | echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4 |
| 20620 | ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`" |
| 20621 | ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`" |
| 20622 | ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`" |
| 20623 | ;; |
| 20624 | esac |
| 20625 | |
| 20626 | randfunc=Perl_drand48 |
| 20627 | drand01="Perl_drand48()" |
| 20628 | seedfunc="Perl_drand48_init" |
| 20629 | randbits=48 |
| 20630 | randseedtype=U32 |
| 20631 | |
| 20632 | : Probe whether dtrace builds an object, as newer Illumos requires an input |
| 20633 | : object file that uses at least one of the probes defined in the .d file |
| 20634 | case "$usedtrace" in |
| 20635 | $define) |
| 20636 | case "$dtracexnolibs" in |
| 20637 | $define|true|[yY]*) |
| 20638 | dtracexnolibs=$define |
| 20639 | $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h |
| 20640 | ;; |
| 20641 | ' '|'') |
| 20642 | if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then |
| 20643 | dtracexnolibs=$define |
| 20644 | echo "Your dtrace accepts -xnolibs" |
| 20645 | elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then |
| 20646 | dtracexnolibs=$undef |
| 20647 | echo "Your dtrace doesn't accept -xnolibs" |
| 20648 | else |
| 20649 | echo "Your dtrace doesn't work at all, try building without dtrace support" >&4 |
| 20650 | exit 1 |
| 20651 | fi |
| 20652 | ;; |
| 20653 | *) |
| 20654 | dtracexnolibs=$undef |
| 20655 | $dtrace -h -s ../perldtrace.d -o perldtrace.h |
| 20656 | ;; |
| 20657 | esac |
| 20658 | case $dtracexnolibs in |
| 20659 | $define) xnolibs=-xnolibs ;; |
| 20660 | *) xnolibs= ;; |
| 20661 | esac |
| 20662 | |
| 20663 | case "$dtraceobject" in |
| 20664 | $define|true|[yY]*) |
| 20665 | dtraceobject=$define |
| 20666 | ;; |
| 20667 | ' '|'') |
| 20668 | $cat >try.c <<EOM |
| 20669 | #include "perldtrace.h" |
| 20670 | int main(void) { |
| 20671 | PERL_LOADED_FILE("dummy"); |
| 20672 | return 0; |
| 20673 | } |
| 20674 | EOM |
| 20675 | dtraceobject=$undef |
| 20676 | if $cc -c -o try.o $optimize $ccflags try.c \ |
| 20677 | && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then |
| 20678 | dtraceobject=$define |
| 20679 | echo "Your dtrace builds an object file" |
| 20680 | fi |
| 20681 | ;; |
| 20682 | *) dtraceobject=$undef ;; |
| 20683 | esac |
| 20684 | $rm_try perldtrace.o perldtrace.h |
| 20685 | esac |
| 20686 | |
| 20687 | : Determine if this is an EBCDIC system |
| 20688 | echo " " |
| 20689 | echo "Determining whether or not we are on an EBCDIC system..." >&4 |
| 20690 | $cat >try.c <<'EOM' |
| 20691 | int main() |
| 20692 | { |
| 20693 | if ('M'==0xd4) return 0; |
| 20694 | return 1; |
| 20695 | } |
| 20696 | EOM |
| 20697 | |
| 20698 | val=$undef |
| 20699 | set try |
| 20700 | if eval $compile_ok; then |
| 20701 | if $run ./try; then |
| 20702 | echo "You seem to speak EBCDIC." >&4 |
| 20703 | val="$define" |
| 20704 | else |
| 20705 | echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4 |
| 20706 | fi |
| 20707 | else |
| 20708 | echo "I'm unable to compile the test program." >&4 |
| 20709 | echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4 |
| 20710 | fi |
| 20711 | $rm_try |
| 20712 | set ebcdic |
| 20713 | eval $setvar |
| 20714 | |
| 20715 | : Check how to flush |
| 20716 | echo " " |
| 20717 | $cat >&4 <<EOM |
| 20718 | Checking how to flush all pending stdio output... |
| 20719 | EOM |
| 20720 | # I only know how to find the first 32 possibly open files on SunOS. |
| 20721 | # See also hints/sunos_4_1.sh and util.c --AD |
| 20722 | case "$osname" in |
| 20723 | sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;; |
| 20724 | esac |
| 20725 | $cat >>try.c <<EOCP |
| 20726 | #include <stdio.h> |
| 20727 | #$i_stdlib I_STDLIB |
| 20728 | #ifdef I_STDLIB |
| 20729 | #include <stdlib.h> |
| 20730 | #endif |
| 20731 | #$i_unistd I_UNISTD |
| 20732 | #ifdef I_UNISTD |
| 20733 | # include <unistd.h> |
| 20734 | #endif |
| 20735 | #$d_sysconf HAS_SYSCONF |
| 20736 | #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY |
| 20737 | #ifdef HAS_STDIO_STREAM_ARRAY |
| 20738 | # define STDIO_STREAM_ARRAY $stdio_stream_array |
| 20739 | #endif |
| 20740 | int main() { |
| 20741 | FILE* p; |
| 20742 | unlink("try.out"); |
| 20743 | p = fopen("try.out", "w"); |
| 20744 | #ifdef TRY_FPUTC |
| 20745 | fputc('x', p); |
| 20746 | #else |
| 20747 | # ifdef TRY_FPRINTF |
| 20748 | fprintf(p, "x"); |
| 20749 | # endif |
| 20750 | #endif |
| 20751 | #ifdef TRY_FFLUSH_NULL |
| 20752 | fflush(NULL); |
| 20753 | #endif |
| 20754 | #ifdef TRY_FFLUSH_ALL |
| 20755 | { |
| 20756 | long open_max = -1; |
| 20757 | # ifdef PERL_FFLUSH_ALL_FOPEN_MAX |
| 20758 | open_max = PERL_FFLUSH_ALL_FOPEN_MAX; |
| 20759 | # else |
| 20760 | # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX) |
| 20761 | open_max = sysconf(_SC_OPEN_MAX); |
| 20762 | # else |
| 20763 | # ifdef FOPEN_MAX |
| 20764 | open_max = FOPEN_MAX; |
| 20765 | # else |
| 20766 | # ifdef OPEN_MAX |
| 20767 | open_max = OPEN_MAX; |
| 20768 | # else |
| 20769 | # ifdef _NFILE |
| 20770 | open_max = _NFILE; |
| 20771 | # endif |
| 20772 | # endif |
| 20773 | # endif |
| 20774 | # endif |
| 20775 | # endif |
| 20776 | # ifdef HAS_STDIO_STREAM_ARRAY |
| 20777 | if (open_max > 0) { |
| 20778 | long i; |
| 20779 | for (i = 0; i < open_max; i++) |
| 20780 | if (STDIO_STREAM_ARRAY[i]._file >= 0 && |
| 20781 | STDIO_STREAM_ARRAY[i]._file < open_max && |
| 20782 | STDIO_STREAM_ARRAY[i]._flag) |
| 20783 | fflush(&STDIO_STREAM_ARRAY[i]); |
| 20784 | } |
| 20785 | } |
| 20786 | # endif |
| 20787 | #endif |
| 20788 | _exit(42); |
| 20789 | } |
| 20790 | EOCP |
| 20791 | : first we have to find out how _not_ to flush |
| 20792 | $to try.c |
| 20793 | if $test "X$fflushNULL" = X -o "X$fflushall" = X; then |
| 20794 | output='' |
| 20795 | set try -DTRY_FPUTC |
| 20796 | if eval $compile; then |
| 20797 | $run ./try 2>/dev/null |
| 20798 | code="$?" |
| 20799 | $from try.out |
| 20800 | if $test ! -s try.out -a "X$code" = X42; then |
| 20801 | output=-DTRY_FPUTC |
| 20802 | fi |
| 20803 | fi |
| 20804 | case "$output" in |
| 20805 | '') |
| 20806 | set try -DTRY_FPRINTF |
| 20807 | if eval $compile; then |
| 20808 | $run ./try 2>/dev/null |
| 20809 | code="$?" |
| 20810 | $from try.out |
| 20811 | if $test ! -s try.out -a "X$code" = X42; then |
| 20812 | output=-DTRY_FPRINTF |
| 20813 | fi |
| 20814 | fi |
| 20815 | ;; |
| 20816 | esac |
| 20817 | fi |
| 20818 | : check for fflush NULL behavior |
| 20819 | case "$fflushNULL" in |
| 20820 | '') set try -DTRY_FFLUSH_NULL $output |
| 20821 | if eval $compile; then |
| 20822 | $run ./try 2>/dev/null |
| 20823 | code="$?" |
| 20824 | $from try.out |
| 20825 | if $test -s try.out -a "X$code" = X42; then |
| 20826 | fflushNULL="`$cat try.out`" |
| 20827 | else |
| 20828 | if $test "X$code" != X42; then |
| 20829 | $cat >&4 <<EOM |
| 20830 | (If this test failed, don't worry, we'll try another method shortly.) |
| 20831 | EOM |
| 20832 | fi |
| 20833 | fi |
| 20834 | fi |
| 20835 | $rm -f core try.core core.try.* |
| 20836 | case "$fflushNULL" in |
| 20837 | x) $cat >&4 <<EOM |
| 20838 | Your fflush(NULL) works okay for output streams. |
| 20839 | Let's see if it clobbers input pipes... |
| 20840 | EOM |
| 20841 | # As of mid-March 2000 all versions of Solaris appear to have a stdio |
| 20842 | # bug that improperly flushes the input end of pipes. So we avoid the |
| 20843 | # autoflush on fork/system/exec support for now. :-( |
| 20844 | $cat >tryp.c <<EOCP |
| 20845 | #include <stdio.h> |
| 20846 | int |
| 20847 | main(int argc, char **argv) |
| 20848 | { |
| 20849 | char buf[1024]; |
| 20850 | int i; |
| 20851 | char *bp = buf; |
| 20852 | while (1) { |
| 20853 | while ((i = getc(stdin)) != -1 |
| 20854 | && (*bp++ = i) != '\n' |
| 20855 | && bp < &buf[1024]) |
| 20856 | /* DO NOTHING */ ; |
| 20857 | *bp = '\0'; |
| 20858 | fprintf(stdout, "%s", buf); |
| 20859 | fflush(NULL); |
| 20860 | if (i == -1) |
| 20861 | return 0; |
| 20862 | bp = buf; |
| 20863 | } |
| 20864 | } |
| 20865 | EOCP |
| 20866 | fflushNULL="$define" |
| 20867 | set tryp |
| 20868 | if eval $compile; then |
| 20869 | $rm -f tryp.out |
| 20870 | # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set) |
| 20871 | if $test "X$targethost" != X; then |
| 20872 | $to tryp.c |
| 20873 | $to tryp |
| 20874 | $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out |
| 20875 | else |
| 20876 | $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out |
| 20877 | fi |
| 20878 | if cmp tryp.c tryp.out >/dev/null 2>&1; then |
| 20879 | $cat >&4 <<EOM |
| 20880 | fflush(NULL) seems to behave okay with input streams. |
| 20881 | EOM |
| 20882 | fflushNULL="$define" |
| 20883 | else |
| 20884 | $cat >&4 <<EOM |
| 20885 | Ouch, fflush(NULL) clobbers input pipes! We will not use it. |
| 20886 | EOM |
| 20887 | fflushNULL="$undef" |
| 20888 | fi |
| 20889 | fi |
| 20890 | $rm -f core tryp.c tryp.core core.tryp.* |
| 20891 | ;; |
| 20892 | '') $cat >&4 <<EOM |
| 20893 | Your fflush(NULL) isn't working (contrary to ANSI C). |
| 20894 | EOM |
| 20895 | fflushNULL="$undef" |
| 20896 | ;; |
| 20897 | *) $cat >&4 <<EOM |
| 20898 | Cannot figure out whether your fflush(NULL) works or not. |
| 20899 | I'm assuming it doesn't (contrary to ANSI C). |
| 20900 | EOM |
| 20901 | fflushNULL="$undef" |
| 20902 | ;; |
| 20903 | esac |
| 20904 | ;; |
| 20905 | $define|true|[yY]*) |
| 20906 | fflushNULL="$define" |
| 20907 | ;; |
| 20908 | *) |
| 20909 | fflushNULL="$undef" |
| 20910 | ;; |
| 20911 | esac |
| 20912 | : check explicit looping only if NULL did not work, and if the pipe |
| 20913 | : bug does not show up on an explicit flush too |
| 20914 | case "$fflushNULL" in |
| 20915 | "$undef") |
| 20916 | $cat >tryp.c <<EOCP |
| 20917 | #include <stdio.h> |
| 20918 | int |
| 20919 | main(int argc, char **argv) |
| 20920 | { |
| 20921 | char buf[1024]; |
| 20922 | int i; |
| 20923 | char *bp = buf; |
| 20924 | while (1) { |
| 20925 | while ((i = getc(stdin)) != -1 |
| 20926 | && (*bp++ = i) != '\n' |
| 20927 | && bp < &buf[1024]) |
| 20928 | /* DO NOTHING */ ; |
| 20929 | *bp = '\0'; |
| 20930 | fprintf(stdout, "%s", buf); |
| 20931 | fflush(stdin); |
| 20932 | if (i == -1) |
| 20933 | return 0; |
| 20934 | bp = buf; |
| 20935 | } |
| 20936 | } |
| 20937 | EOCP |
| 20938 | set tryp |
| 20939 | if eval $compile; then |
| 20940 | $rm -f tryp.out |
| 20941 | if $test "X$targethost" != X; then |
| 20942 | $to tryp.c |
| 20943 | $to tryp |
| 20944 | $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out |
| 20945 | else |
| 20946 | $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out |
| 20947 | fi |
| 20948 | if cmp tryp.c tryp.out >/dev/null 2>&1; then |
| 20949 | $cat >&4 <<EOM |
| 20950 | Good, at least fflush(stdin) seems to behave okay when stdin is a pipe. |
| 20951 | EOM |
| 20952 | : now check for fflushall behaviour |
| 20953 | case "$fflushall" in |
| 20954 | '') set try -DTRY_FFLUSH_ALL $output |
| 20955 | if eval $compile; then |
| 20956 | $cat >&4 <<EOM |
| 20957 | (Now testing the other method--but note that this also may fail.) |
| 20958 | EOM |
| 20959 | $run ./try 2>/dev/null |
| 20960 | code=$? |
| 20961 | $from try.out |
| 20962 | if $test -s try.out -a "X$code" = X42; then |
| 20963 | fflushall="`$cat try.out`" |
| 20964 | fi |
| 20965 | fi |
| 20966 | $rm_try |
| 20967 | case "$fflushall" in |
| 20968 | x) $cat >&4 <<EOM |
| 20969 | Whew. Flushing explicitly all the stdio streams works. |
| 20970 | EOM |
| 20971 | fflushall="$define" |
| 20972 | ;; |
| 20973 | '') $cat >&4 <<EOM |
| 20974 | Sigh. Flushing explicitly all the stdio streams doesn't work. |
| 20975 | EOM |
| 20976 | fflushall="$undef" |
| 20977 | ;; |
| 20978 | *) $cat >&4 <<EOM |
| 20979 | Cannot figure out whether flushing stdio streams explicitly works or not. |
| 20980 | I'm assuming it doesn't. |
| 20981 | EOM |
| 20982 | fflushall="$undef" |
| 20983 | ;; |
| 20984 | esac |
| 20985 | ;; |
| 20986 | "$define"|true|[yY]*) |
| 20987 | fflushall="$define" |
| 20988 | ;; |
| 20989 | *) |
| 20990 | fflushall="$undef" |
| 20991 | ;; |
| 20992 | esac |
| 20993 | else |
| 20994 | $cat >&4 <<EOM |
| 20995 | All is futile. Even fflush(stdin) clobbers input pipes! |
| 20996 | EOM |
| 20997 | fflushall="$undef" |
| 20998 | fi |
| 20999 | else |
| 21000 | fflushall="$undef" |
| 21001 | fi |
| 21002 | $rm -f core tryp.c tryp.core core.tryp.* |
| 21003 | ;; |
| 21004 | *) fflushall="$undef" |
| 21005 | ;; |
| 21006 | esac |
| 21007 | |
| 21008 | case "$fflushNULL$fflushall" in |
| 21009 | undefundef) |
| 21010 | $cat <<EOM |
| 21011 | OK, I give up. I cannot figure out how to flush pending stdio output. |
| 21012 | We won't be flushing handles at all before fork/exec/popen. |
| 21013 | EOM |
| 21014 | ;; |
| 21015 | esac |
| 21016 | $rm_try tryp |
| 21017 | |
| 21018 | : Store the full pathname to the ar program for use in the C program |
| 21019 | : Respect a hint or command line value for full_ar. |
| 21020 | case "$full_ar" in |
| 21021 | '') full_ar=$ar ;; |
| 21022 | esac |
| 21023 | |
| 21024 | : Store the full pathname to the sed program for use in the C program |
| 21025 | full_sed=$sed |
| 21026 | |
| 21027 | : see what type gids are declared as in the kernel |
| 21028 | echo " " |
| 21029 | echo "Looking for the type for group ids returned by getgid()." |
| 21030 | set gid_t gidtype xxx stdio.h sys/types.h |
| 21031 | eval $typedef |
| 21032 | case "$gidtype" in |
| 21033 | xxx) |
| 21034 | xxx=`./findhdr sys/user.h` |
| 21035 | set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short |
| 21036 | case $1 in |
| 21037 | unsigned) dflt="$1 $2" ;; |
| 21038 | *) dflt="$1" ;; |
| 21039 | esac |
| 21040 | ;; |
| 21041 | *) dflt="$gidtype";; |
| 21042 | esac |
| 21043 | case "$gidtype" in |
| 21044 | gid_t) echo "gid_t found." ;; |
| 21045 | *) rp="What is the type for group ids returned by getgid()?" |
| 21046 | . ./myread |
| 21047 | gidtype="$ans" |
| 21048 | ;; |
| 21049 | esac |
| 21050 | |
| 21051 | : Check the size of GID |
| 21052 | echo " " |
| 21053 | case "$gidtype" in |
| 21054 | *_t) zzz="$gidtype" ;; |
| 21055 | *) zzz="gid" ;; |
| 21056 | esac |
| 21057 | echo "Checking the size of $zzz..." >&4 |
| 21058 | cat > try.c <<EOCP |
| 21059 | #include <sys/types.h> |
| 21060 | #include <stdio.h> |
| 21061 | #$i_stdlib I_STDLIB |
| 21062 | #ifdef I_STDLIB |
| 21063 | #include <stdlib.h> |
| 21064 | #endif |
| 21065 | int main() { |
| 21066 | printf("%d\n", (int)sizeof($gidtype)); |
| 21067 | exit(0); |
| 21068 | } |
| 21069 | EOCP |
| 21070 | set try |
| 21071 | if eval $compile_ok; then |
| 21072 | yyy=`$run ./try` |
| 21073 | case "$yyy" in |
| 21074 | '') gidsize=4 |
| 21075 | echo "(I can't execute the test program--guessing $gidsize.)" >&4 |
| 21076 | ;; |
| 21077 | *) gidsize=$yyy |
| 21078 | echo "Your $zzz is $gidsize bytes long." |
| 21079 | ;; |
| 21080 | esac |
| 21081 | else |
| 21082 | gidsize=4 |
| 21083 | echo "(I can't compile the test program--guessing $gidsize.)" >&4 |
| 21084 | fi |
| 21085 | |
| 21086 | : Check if GID is signed |
| 21087 | echo " " |
| 21088 | case "$gidtype" in |
| 21089 | *_t) zzz="$gidtype" ;; |
| 21090 | *) zzz="gid" ;; |
| 21091 | esac |
| 21092 | echo "Checking the sign of $zzz..." >&4 |
| 21093 | cat > try.c <<EOCP |
| 21094 | #include <sys/types.h> |
| 21095 | #include <stdio.h> |
| 21096 | int main() { |
| 21097 | $gidtype foo = -1; |
| 21098 | if (foo < 0) |
| 21099 | printf("-1\n"); |
| 21100 | else |
| 21101 | printf("1\n"); |
| 21102 | } |
| 21103 | EOCP |
| 21104 | set try |
| 21105 | if eval $compile; then |
| 21106 | yyy=`$run ./try` |
| 21107 | case "$yyy" in |
| 21108 | '') gidsign=1 |
| 21109 | echo "(I can't execute the test program--guessing unsigned.)" >&4 |
| 21110 | ;; |
| 21111 | *) gidsign=$yyy |
| 21112 | case "$gidsign" in |
| 21113 | 1) echo "Your $zzz is unsigned." ;; |
| 21114 | -1) echo "Your $zzz is signed." ;; |
| 21115 | esac |
| 21116 | ;; |
| 21117 | esac |
| 21118 | else |
| 21119 | gidsign=1 |
| 21120 | echo "(I can't compile the test program--guessing unsigned.)" >&4 |
| 21121 | fi |
| 21122 | |
| 21123 | : Check 64bit sizes |
| 21124 | echo " " |
| 21125 | |
| 21126 | if $test X"$quadtype" != X; then |
| 21127 | |
| 21128 | echo "Checking how to print 64-bit integers..." >&4 |
| 21129 | |
| 21130 | if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then |
| 21131 | $cat >try.c <<'EOCP' |
| 21132 | #include <sys/types.h> |
| 21133 | #include <stdio.h> |
| 21134 | int main() { |
| 21135 | int q = 12345678901; |
| 21136 | printf("%ld\n", q); |
| 21137 | } |
| 21138 | EOCP |
| 21139 | set try |
| 21140 | if eval $compile; then |
| 21141 | yyy=`$run ./try` |
| 21142 | case "$yyy" in |
| 21143 | 12345678901) |
| 21144 | sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"'; |
| 21145 | sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"'; |
| 21146 | echo "We will use %d." |
| 21147 | ;; |
| 21148 | esac |
| 21149 | fi |
| 21150 | fi |
| 21151 | |
| 21152 | if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then |
| 21153 | $cat >try.c <<'EOCP' |
| 21154 | #include <sys/types.h> |
| 21155 | #include <stdio.h> |
| 21156 | int main() { |
| 21157 | long q = 12345678901; |
| 21158 | printf("%ld\n", q); |
| 21159 | } |
| 21160 | EOCP |
| 21161 | set try |
| 21162 | if eval $compile; then |
| 21163 | yyy=`$run ./try` |
| 21164 | case "$yyy" in |
| 21165 | 12345678901) |
| 21166 | sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"'; |
| 21167 | sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"'; |
| 21168 | echo "We will use %ld." |
| 21169 | ;; |
| 21170 | esac |
| 21171 | fi |
| 21172 | fi |
| 21173 | |
| 21174 | if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then |
| 21175 | $cat >try.c <<'EOCP' |
| 21176 | #include <sys/types.h> |
| 21177 | #include <inttypes.h> |
| 21178 | #include <stdio.h> |
| 21179 | int main() { |
| 21180 | int64_t q = 12345678901; |
| 21181 | printf("%" PRId64 "\n", q); |
| 21182 | } |
| 21183 | EOCP |
| 21184 | set try |
| 21185 | if eval $compile; then |
| 21186 | yyy=`$run ./try` |
| 21187 | case "$yyy" in |
| 21188 | 12345678901) |
| 21189 | sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64; |
| 21190 | sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64; |
| 21191 | echo "We will use the C9X style." |
| 21192 | ;; |
| 21193 | esac |
| 21194 | fi |
| 21195 | fi |
| 21196 | |
| 21197 | if $test X"$sPRId64" = X -a X"$quadtype" != X; then |
| 21198 | $cat >try.c <<EOCP |
| 21199 | #include <sys/types.h> |
| 21200 | #include <stdio.h> |
| 21201 | int main() { |
| 21202 | $quadtype q = 12345678901; |
| 21203 | printf("%Ld\n", q); |
| 21204 | } |
| 21205 | EOCP |
| 21206 | set try |
| 21207 | if eval $compile; then |
| 21208 | yyy=`$run ./try` |
| 21209 | case "$yyy" in |
| 21210 | 12345678901) |
| 21211 | sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"'; |
| 21212 | sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"'; |
| 21213 | echo "We will use %Ld." |
| 21214 | ;; |
| 21215 | esac |
| 21216 | fi |
| 21217 | fi |
| 21218 | |
| 21219 | if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then |
| 21220 | $cat >try.c <<'EOCP' |
| 21221 | #include <sys/types.h> |
| 21222 | #include <stdio.h> |
| 21223 | int main() { |
| 21224 | long long q = 12345678901LL; /* AIX cc requires the LL suffix. */ |
| 21225 | printf("%lld\n", q); |
| 21226 | } |
| 21227 | EOCP |
| 21228 | set try |
| 21229 | if eval $compile; then |
| 21230 | yyy=`$run ./try` |
| 21231 | case "$yyy" in |
| 21232 | 12345678901) |
| 21233 | sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"'; |
| 21234 | sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"'; |
| 21235 | echo "We will use the %lld style." |
| 21236 | ;; |
| 21237 | esac |
| 21238 | fi |
| 21239 | fi |
| 21240 | |
| 21241 | if $test X"$sPRId64" = X -a X"$quadtype" != X; then |
| 21242 | $cat >try.c <<EOCP |
| 21243 | #include <sys/types.h> |
| 21244 | #include <stdio.h> |
| 21245 | int main() { |
| 21246 | $quadtype q = 12345678901; |
| 21247 | printf("%qd\n", q); |
| 21248 | } |
| 21249 | EOCP |
| 21250 | set try |
| 21251 | if eval $compile; then |
| 21252 | yyy=`$run ./try` |
| 21253 | case "$yyy" in |
| 21254 | 12345678901) |
| 21255 | sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"'; |
| 21256 | sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"'; |
| 21257 | echo "We will use %qd." |
| 21258 | ;; |
| 21259 | esac |
| 21260 | fi |
| 21261 | fi |
| 21262 | |
| 21263 | if $test X"$sPRId64" = X; then |
| 21264 | echo "Cannot figure out how to print 64-bit integers." >&4 |
| 21265 | fi |
| 21266 | $rm_try |
| 21267 | |
| 21268 | fi |
| 21269 | |
| 21270 | case "$sPRId64" in |
| 21271 | '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef"; |
| 21272 | d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef"; |
| 21273 | ;; |
| 21274 | *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define"; |
| 21275 | d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define"; |
| 21276 | ;; |
| 21277 | esac |
| 21278 | |
| 21279 | : Check format strings for internal types |
| 21280 | echo " " |
| 21281 | $echo "Checking the format strings to be used for Perl's internal types..." >&4 |
| 21282 | |
| 21283 | if $test X"$ivsize" = X8; then |
| 21284 | ivdformat="$sPRId64" |
| 21285 | uvuformat="$sPRIu64" |
| 21286 | uvoformat="$sPRIo64" |
| 21287 | uvxformat="$sPRIx64" |
| 21288 | uvXUformat="$sPRIXU64" |
| 21289 | else |
| 21290 | if $test X"$ivsize" = X"$longsize"; then |
| 21291 | ivdformat='"ld"' |
| 21292 | uvuformat='"lu"' |
| 21293 | uvoformat='"lo"' |
| 21294 | uvxformat='"lx"' |
| 21295 | uvXUformat='"lX"' |
| 21296 | else |
| 21297 | if $test X"$ivsize" = X"$intsize"; then |
| 21298 | ivdformat='"d"' |
| 21299 | uvuformat='"u"' |
| 21300 | uvoformat='"o"' |
| 21301 | uvxformat='"x"' |
| 21302 | uvXUformat='"X"' |
| 21303 | else |
| 21304 | : far out |
| 21305 | if $test X"$ivsize" = X"$shortsize"; then |
| 21306 | ivdformat='"hd"' |
| 21307 | uvuformat='"hu"' |
| 21308 | uvoformat='"ho"' |
| 21309 | uvxformat='"hx"' |
| 21310 | uvXUformat='"hX"' |
| 21311 | fi |
| 21312 | fi |
| 21313 | fi |
| 21314 | fi |
| 21315 | |
| 21316 | if $test X"$usequadmath" = X"$define"; then |
| 21317 | nveformat='"Qe"' |
| 21318 | nvfformat='"Qf"' |
| 21319 | nvgformat='"Qg"' |
| 21320 | nvEUformat='"QE"' |
| 21321 | nvFUformat='"QF"' |
| 21322 | nvGUformat='"QG"' |
| 21323 | else |
| 21324 | if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then |
| 21325 | nveformat="$sPRIeldbl" |
| 21326 | nvfformat="$sPRIfldbl" |
| 21327 | nvgformat="$sPRIgldbl" |
| 21328 | nvEUformat="$sPRIEUldbl" |
| 21329 | nvFUformat="$sPRIFUldbl" |
| 21330 | nvGUformat="$sPRIGUldbl" |
| 21331 | else |
| 21332 | nveformat='"e"' |
| 21333 | nvfformat='"f"' |
| 21334 | nvgformat='"g"' |
| 21335 | nvEUformat='"E"' |
| 21336 | nvFUformat='"F"' |
| 21337 | nvGUformat='"G"' |
| 21338 | fi |
| 21339 | fi |
| 21340 | |
| 21341 | case "$ivdformat" in |
| 21342 | '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4 |
| 21343 | exit 1 |
| 21344 | ;; |
| 21345 | esac |
| 21346 | |
| 21347 | : Check format string for GID |
| 21348 | |
| 21349 | echo " " |
| 21350 | $echo "Checking the format string to be used for gids..." >&4 |
| 21351 | |
| 21352 | case "$gidsign" in |
| 21353 | -1) if $test X"$gidsize" = X"$ivsize"; then |
| 21354 | gidformat="$ivdformat" |
| 21355 | else |
| 21356 | if $test X"$gidsize" = X"$longsize"; then |
| 21357 | gidformat='"ld"' |
| 21358 | else |
| 21359 | if $test X"$gidsize" = X"$intsize"; then |
| 21360 | gidformat='"d"' |
| 21361 | else |
| 21362 | if $test X"$gidsize" = X"$shortsize"; then |
| 21363 | gidformat='"hd"' |
| 21364 | fi |
| 21365 | fi |
| 21366 | fi |
| 21367 | fi |
| 21368 | ;; |
| 21369 | *) if $test X"$gidsize" = X"$uvsize"; then |
| 21370 | gidformat="$uvuformat" |
| 21371 | else |
| 21372 | if $test X"$gidsize" = X"$longsize"; then |
| 21373 | gidformat='"lu"' |
| 21374 | else |
| 21375 | if $test X"$gidsize" = X"$intsize"; then |
| 21376 | gidformat='"u"' |
| 21377 | else |
| 21378 | if $test X"$gidsize" = X"$shortsize"; then |
| 21379 | gidformat='"hu"' |
| 21380 | fi |
| 21381 | fi |
| 21382 | fi |
| 21383 | fi |
| 21384 | ;; |
| 21385 | esac |
| 21386 | |
| 21387 | : see if getgroups exists |
| 21388 | set getgroups d_getgrps |
| 21389 | eval $inlibc |
| 21390 | |
| 21391 | : see if setgroups exists |
| 21392 | set setgroups d_setgrps |
| 21393 | eval $inlibc |
| 21394 | |
| 21395 | : Find type of 2nd arg to 'getgroups()' and 'setgroups()' |
| 21396 | echo " " |
| 21397 | case "$d_getgrps$d_setgrps" in |
| 21398 | *define*) |
| 21399 | case "$groupstype" in |
| 21400 | '') dflt="$gidtype" ;; |
| 21401 | *) dflt="$groupstype" ;; |
| 21402 | esac |
| 21403 | $cat <<EOM |
| 21404 | What type of pointer is the second argument to getgroups() and setgroups()? |
| 21405 | Usually this is the same as group ids, $gidtype, but not always. |
| 21406 | |
| 21407 | EOM |
| 21408 | rp='What type pointer is the second argument to getgroups() and setgroups()?' |
| 21409 | . ./myread |
| 21410 | groupstype="$ans" |
| 21411 | ;; |
| 21412 | *) groupstype="$gidtype";; |
| 21413 | esac |
| 21414 | |
| 21415 | : check whether make sets MAKE |
| 21416 | echo " " |
| 21417 | echo "Checking if your $make program sets \$(MAKE)..." >&4 |
| 21418 | case "$make_set_make" in |
| 21419 | '') |
| 21420 | $sed 's/^X //' > testmake.mak << 'EOF' |
| 21421 | Xall: |
| 21422 | X @echo 'maketemp="$(MAKE)"' |
| 21423 | EOF |
| 21424 | case "`$make -f testmake.mak 2>/dev/null`" in |
| 21425 | *maketemp=*) make_set_make='#' ;; |
| 21426 | *) make_set_make="MAKE=$make" ;; |
| 21427 | esac |
| 21428 | $rm -f testmake.mak |
| 21429 | ;; |
| 21430 | esac |
| 21431 | case "$make_set_make" in |
| 21432 | '#') echo "Yup, it does.";; |
| 21433 | *) echo "Nope, it doesn't.";; |
| 21434 | esac |
| 21435 | |
| 21436 | : see what type is used for mode_t |
| 21437 | rp="What is the type used for file modes for system calls (e.g. fchmod())?" |
| 21438 | set mode_t modetype int stdio.h sys/types.h |
| 21439 | eval $typedef_ask |
| 21440 | |
| 21441 | : see if we need va_copy |
| 21442 | echo " " |
| 21443 | $cat >try.c <<EOCP |
| 21444 | #include <stdarg.h> |
| 21445 | #include <stdio.h> |
| 21446 | #include <stdlib.h> |
| 21447 | #include <signal.h> |
| 21448 | |
| 21449 | int |
| 21450 | ivfprintf(FILE *f, const char *fmt, va_list *valp) |
| 21451 | { |
| 21452 | return vfprintf(f, fmt, *valp); |
| 21453 | } |
| 21454 | |
| 21455 | int |
| 21456 | myvfprintf(FILE *f, const char *fmt, va_list val) |
| 21457 | { |
| 21458 | return ivfprintf(f, fmt, &val); |
| 21459 | } |
| 21460 | |
| 21461 | int |
| 21462 | myprintf(char *fmt, ...) |
| 21463 | { |
| 21464 | va_list val; |
| 21465 | va_start(val, fmt); |
| 21466 | return myvfprintf(stdout, fmt, val); |
| 21467 | } |
| 21468 | |
| 21469 | int |
| 21470 | main(int ac, char **av) |
| 21471 | { |
| 21472 | signal(SIGSEGV, exit); |
| 21473 | |
| 21474 | myprintf("%s%cs all right, then\n", "that", '\''); |
| 21475 | exit(0); |
| 21476 | } |
| 21477 | EOCP |
| 21478 | set try |
| 21479 | if eval $compile && $run ./try 2>&1 >/dev/null; then |
| 21480 | case "`$run ./try`" in |
| 21481 | "that's all right, then") |
| 21482 | okay=yes |
| 21483 | ;; |
| 21484 | esac |
| 21485 | fi |
| 21486 | case "$okay" in |
| 21487 | yes) echo "It seems that you don't need va_copy()." >&4 |
| 21488 | need_va_copy="$undef" |
| 21489 | ;; |
| 21490 | *) echo "It seems that va_copy() or similar will be needed." >&4 |
| 21491 | need_va_copy="$define" |
| 21492 | ;; |
| 21493 | esac |
| 21494 | $rm_try |
| 21495 | |
| 21496 | : see what type is used for size_t |
| 21497 | rp="What is the type used for the length parameter for string functions?" |
| 21498 | set size_t sizetype 'unsigned int' stdio.h sys/types.h |
| 21499 | eval $typedef_ask |
| 21500 | |
| 21501 | : check for type of arguments to gethostbyaddr. |
| 21502 | if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then |
| 21503 | case "$d_gethbyaddr" in |
| 21504 | $define) |
| 21505 | $cat <<EOM |
| 21506 | |
| 21507 | Checking to see what type of arguments are accepted by gethostbyaddr(). |
| 21508 | EOM |
| 21509 | hdrs="$define sys/types.h |
| 21510 | $d_socket sys/socket.h |
| 21511 | $i_niin netinet/in.h |
| 21512 | $i_netdb netdb.h |
| 21513 | $i_unistd unistd.h" |
| 21514 | : The first arg can 'char *' or 'void *' |
| 21515 | : The second arg is some of integral type |
| 21516 | for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do |
| 21517 | for yyy in size_t long int; do |
| 21518 | case "$netdb_host_type" in |
| 21519 | '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);" |
| 21520 | if ./protochk "$try" $hdrs; then |
| 21521 | echo "Your system accepts $xxx for the first arg." |
| 21522 | echo "...and $yyy for the second arg." |
| 21523 | netdb_host_type="$xxx" |
| 21524 | netdb_hlen_type="$yyy" |
| 21525 | fi |
| 21526 | ;; |
| 21527 | esac |
| 21528 | done |
| 21529 | done |
| 21530 | : In case none of those worked, prompt the user. |
| 21531 | case "$netdb_host_type" in |
| 21532 | '') rp='What is the type for the 1st argument to gethostbyaddr?' |
| 21533 | dflt='char *' |
| 21534 | . ./myread |
| 21535 | netdb_host_type=$ans |
| 21536 | rp='What is the type for the 2nd argument to gethostbyaddr?' |
| 21537 | dflt="$sizetype" |
| 21538 | . ./myread |
| 21539 | netdb_hlen_type=$ans |
| 21540 | ;; |
| 21541 | esac |
| 21542 | ;; |
| 21543 | *) : no gethostbyaddr, so pick harmless defaults |
| 21544 | netdb_host_type='char *' |
| 21545 | netdb_hlen_type="$sizetype" |
| 21546 | ;; |
| 21547 | esac |
| 21548 | # Remove the "const" if needed. -- but then we'll have a |
| 21549 | # prototype clash! |
| 21550 | # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'` |
| 21551 | fi |
| 21552 | |
| 21553 | : check for type of argument to gethostbyname. |
| 21554 | if test "X$netdb_name_type" = X ; then |
| 21555 | case "$d_gethbyname" in |
| 21556 | $define) |
| 21557 | $cat <<EOM |
| 21558 | |
| 21559 | Checking to see what type of argument is accepted by gethostbyname(). |
| 21560 | EOM |
| 21561 | hdrs="$define sys/types.h |
| 21562 | $d_socket sys/socket.h |
| 21563 | $i_niin netinet/in.h |
| 21564 | $i_netdb netdb.h |
| 21565 | $i_unistd unistd.h" |
| 21566 | for xxx in "const char *" "char *"; do |
| 21567 | case "$netdb_name_type" in |
| 21568 | '') try="$extern_C struct hostent *gethostbyname($xxx);" |
| 21569 | if ./protochk "$try" $hdrs; then |
| 21570 | echo "Your system accepts $xxx." |
| 21571 | netdb_name_type="$xxx" |
| 21572 | fi |
| 21573 | ;; |
| 21574 | esac |
| 21575 | done |
| 21576 | : In case none of those worked, prompt the user. |
| 21577 | case "$netdb_name_type" in |
| 21578 | '') rp='What is the type for the 1st argument to gethostbyname?' |
| 21579 | dflt='char *' |
| 21580 | . ./myread |
| 21581 | netdb_name_type=$ans |
| 21582 | ;; |
| 21583 | esac |
| 21584 | ;; |
| 21585 | *) : no gethostbyname, so pick harmless default |
| 21586 | netdb_name_type='char *' |
| 21587 | ;; |
| 21588 | esac |
| 21589 | fi |
| 21590 | |
| 21591 | : check for type of 1st argument to getnetbyaddr. |
| 21592 | if test "X$netdb_net_type" = X ; then |
| 21593 | case "$d_getnbyaddr" in |
| 21594 | $define) |
| 21595 | $cat <<EOM |
| 21596 | |
| 21597 | Checking to see what type of 1st argument is accepted by getnetbyaddr(). |
| 21598 | EOM |
| 21599 | hdrs="$define sys/types.h |
| 21600 | $d_socket sys/socket.h |
| 21601 | $i_niin netinet/in.h |
| 21602 | $i_netdb netdb.h |
| 21603 | $i_unistd unistd.h" |
| 21604 | for xxx in in_addr_t "unsigned long" long "unsigned int" int; do |
| 21605 | case "$netdb_net_type" in |
| 21606 | '') try="$extern_C struct netent *getnetbyaddr($xxx, int);" |
| 21607 | if ./protochk "$try" $hdrs; then |
| 21608 | echo "Your system accepts $xxx." |
| 21609 | netdb_net_type="$xxx" |
| 21610 | fi |
| 21611 | ;; |
| 21612 | esac |
| 21613 | done |
| 21614 | : In case none of those worked, prompt the user. |
| 21615 | case "$netdb_net_type" in |
| 21616 | '') rp='What is the type for the 1st argument to getnetbyaddr?' |
| 21617 | dflt='long' |
| 21618 | . ./myread |
| 21619 | netdb_net_type=$ans |
| 21620 | ;; |
| 21621 | esac |
| 21622 | ;; |
| 21623 | *) : no getnetbyaddr, so pick harmless default |
| 21624 | netdb_net_type='long' |
| 21625 | ;; |
| 21626 | esac |
| 21627 | fi |
| 21628 | : locate the preferred pager for this system |
| 21629 | fn=f/ |
| 21630 | case "$pager" in |
| 21631 | '') |
| 21632 | dflt='' |
| 21633 | case "$pg" in |
| 21634 | /*) dflt=$pg;; |
| 21635 | [a-zA-Z]:/*) dflt=$pg;; |
| 21636 | esac |
| 21637 | case "$more" in |
| 21638 | /*) dflt=$more;; |
| 21639 | [a-zA-Z]:/*) dflt=$more;; |
| 21640 | esac |
| 21641 | case "$less" in |
| 21642 | /*) dflt=$less;; |
| 21643 | [a-zA-Z]:/*) dflt=$less;; |
| 21644 | esac |
| 21645 | case "$dflt" in |
| 21646 | '') dflt=/usr/ucb/more;; |
| 21647 | esac |
| 21648 | ;; |
| 21649 | *) dflt="$pager" |
| 21650 | ;; |
| 21651 | esac |
| 21652 | fn="f/($dflt)" |
| 21653 | echo " " |
| 21654 | rp='What pager is used on your system?' |
| 21655 | . ./getfile |
| 21656 | pager="$ans" |
| 21657 | |
| 21658 | : see if ar generates random libraries by itself |
| 21659 | echo " " |
| 21660 | echo "Checking how to generate random libraries on your machine..." >&4 |
| 21661 | echo 'int bar1() { return bar2(); }' > bar1.c |
| 21662 | echo 'int bar2() { return 2; }' > bar2.c |
| 21663 | $cat > foo.c <<EOP |
| 21664 | #$i_stdlib I_STDLIB |
| 21665 | #ifdef I_STDLIB |
| 21666 | #include <stdlib.h> |
| 21667 | #endif |
| 21668 | int main() { printf("%d\n", bar1()); exit(0); } |
| 21669 | EOP |
| 21670 | $cc $ccflags -c bar1.c >/dev/null 2>&1 |
| 21671 | $cc $ccflags -c bar2.c >/dev/null 2>&1 |
| 21672 | $cc $ccflags -c foo.c >/dev/null 2>&1 |
| 21673 | $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1 |
| 21674 | if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 && |
| 21675 | $run ./foobar >/dev/null 2>&1; then |
| 21676 | echo "$ar appears to generate random libraries itself." |
| 21677 | orderlib=false |
| 21678 | if [ "X$ranlib" = "X" ]; then |
| 21679 | ranlib=":" |
| 21680 | fi |
| 21681 | elif $ar s bar$_a >/dev/null 2>&1 && |
| 21682 | $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 && |
| 21683 | $run ./foobar >/dev/null 2>&1; then |
| 21684 | echo "a table of contents needs to be added with '$ar s'." |
| 21685 | orderlib=false |
| 21686 | ranlib="$ar s" |
| 21687 | elif $ar ts bar$_a >/dev/null 2>&1 && |
| 21688 | $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 && |
| 21689 | $run ./foobar >/dev/null 2>&1; then |
| 21690 | echo "a table of contents needs to be added with '$ar ts'." |
| 21691 | orderlib=false |
| 21692 | ranlib="$ar ts" |
| 21693 | else |
| 21694 | case "$ranlib" in |
| 21695 | :) ranlib='';; |
| 21696 | '') |
| 21697 | ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin` |
| 21698 | $test -f $ranlib || ranlib='' |
| 21699 | ;; |
| 21700 | esac |
| 21701 | if $test -n "$ranlib"; then |
| 21702 | echo "your system has '$ranlib'; we'll use that." |
| 21703 | orderlib=false |
| 21704 | else |
| 21705 | echo "your system doesn't seem to support random libraries" |
| 21706 | echo "so we'll use lorder and tsort to order the libraries." |
| 21707 | orderlib=true |
| 21708 | ranlib=":" |
| 21709 | fi |
| 21710 | fi |
| 21711 | $rm -f foo* bar* |
| 21712 | |
| 21713 | : Check the max offset that gmtime and localtime accept |
| 21714 | echo "Checking max offsets that gmtime () accepts" |
| 21715 | |
| 21716 | case "$sGMTIME_min/$sGMTIME_max" in |
| 21717 | 0/0|/) |
| 21718 | $cat >try.c <<EOCP |
| 21719 | #include <sys/types.h> |
| 21720 | #include <stdio.h> |
| 21721 | #include <time.h> |
| 21722 | |
| 21723 | int i; |
| 21724 | struct tm *tmp; |
| 21725 | time_t pt; |
| 21726 | |
| 21727 | void gm_check (time_t t, int min_year, int max_year) |
| 21728 | { |
| 21729 | tmp = gmtime (&t); |
| 21730 | if ( tmp == NULL || |
| 21731 | /* Check tm_year overflow */ |
| 21732 | tmp->tm_year < min_year || tmp->tm_year > max_year) |
| 21733 | tmp = NULL; |
| 21734 | else |
| 21735 | pt = t; |
| 21736 | } /* gm_check */ |
| 21737 | |
| 21738 | int check_max () |
| 21739 | { |
| 21740 | tmp = NULL; |
| 21741 | pt = 0; |
| 21742 | #ifdef MAXLONG |
| 21743 | gm_check (MAXLONG, 69, 0x7fffffff); |
| 21744 | #endif |
| 21745 | if (tmp == NULL || tmp->tm_year < 0) { |
| 21746 | for (i = 63; i >= 0; i--) { |
| 21747 | time_t x = pt | ((time_t)1 << i); |
| 21748 | if (x < 0 || x < pt) continue; |
| 21749 | gm_check (x, 69, 0x7fffffff); |
| 21750 | } |
| 21751 | } |
| 21752 | printf ("sGMTIME_max=%ld\n", pt); |
| 21753 | return (0); |
| 21754 | } /* check_max */ |
| 21755 | |
| 21756 | int check_min () |
| 21757 | { |
| 21758 | tmp = NULL; |
| 21759 | pt = 0; |
| 21760 | #ifdef MINLONG |
| 21761 | gm_check (MINLONG, -1900, 70); |
| 21762 | #endif |
| 21763 | if (tmp == NULL) { |
| 21764 | for (i = 36; i >= 0; i--) { |
| 21765 | time_t x = pt - ((time_t)1 << i); |
| 21766 | if (x > 0) continue; |
| 21767 | gm_check (x, -1900, 70); |
| 21768 | } |
| 21769 | } |
| 21770 | printf ("sGMTIME_min=%ld\n", pt); |
| 21771 | return (0); |
| 21772 | } /* check_min */ |
| 21773 | |
| 21774 | int main (int argc, char *argv[]) |
| 21775 | { |
| 21776 | /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */ |
| 21777 | check_max (); |
| 21778 | check_min (); |
| 21779 | return (0); |
| 21780 | } /* main */ |
| 21781 | EOCP |
| 21782 | set try |
| 21783 | if eval $compile; then |
| 21784 | eval `$run ./try 2>/dev/null` |
| 21785 | else |
| 21786 | echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4 |
| 21787 | fi |
| 21788 | $rm_try |
| 21789 | ;; |
| 21790 | esac |
| 21791 | |
| 21792 | echo "Checking max offsets that localtime () accepts" |
| 21793 | |
| 21794 | case "$sLOCALTIME_min/$sLOCALTIME_max" in |
| 21795 | 0/0|/) |
| 21796 | $cat >try.c <<EOCP |
| 21797 | #include <sys/types.h> |
| 21798 | #include <stdio.h> |
| 21799 | #include <time.h> |
| 21800 | |
| 21801 | int i; |
| 21802 | struct tm *tmp; |
| 21803 | time_t pt; |
| 21804 | |
| 21805 | void local_check (time_t t, int min_year, int max_year) |
| 21806 | { |
| 21807 | if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL) |
| 21808 | tmp = NULL; |
| 21809 | else |
| 21810 | tmp = localtime (&t); |
| 21811 | if ( tmp == NULL || |
| 21812 | /* Check tm_year overflow */ |
| 21813 | tmp->tm_year < min_year || tmp->tm_year > max_year) |
| 21814 | tmp = NULL; |
| 21815 | else |
| 21816 | pt = t; |
| 21817 | } /* local_check */ |
| 21818 | |
| 21819 | int check_max () |
| 21820 | { |
| 21821 | tmp = NULL; |
| 21822 | pt = 0; |
| 21823 | #ifdef MAXLONG |
| 21824 | local_check (MAXLONG, 69, 0x7fffffff); |
| 21825 | #endif |
| 21826 | if (tmp == NULL || tmp->tm_year < 0) { |
| 21827 | for (i = 63; i >= 0; i--) { |
| 21828 | time_t x = pt | ((time_t)1 << i); |
| 21829 | if (x < 0 || x < pt) continue; |
| 21830 | local_check (x, 69, 0x7fffffff); |
| 21831 | } |
| 21832 | } |
| 21833 | printf ("sLOCALTIME_max=%ld\n", pt); |
| 21834 | return (0); |
| 21835 | } /* check_max */ |
| 21836 | |
| 21837 | int check_min () |
| 21838 | { |
| 21839 | tmp = NULL; |
| 21840 | pt = 0; |
| 21841 | #ifdef MINLONG |
| 21842 | local_check (MINLONG, -1900, 70); |
| 21843 | #endif |
| 21844 | if (tmp == NULL) { |
| 21845 | for (i = 36; i >= 0; i--) { |
| 21846 | time_t x = pt - ((time_t)1 << i); |
| 21847 | if (x > 0) continue; |
| 21848 | local_check (x, -1900, 70); |
| 21849 | } |
| 21850 | } |
| 21851 | printf ("sLOCALTIME_min=%ld\n", pt); |
| 21852 | return (0); |
| 21853 | } /* check_min */ |
| 21854 | |
| 21855 | int main (int argc, char *argv[]) |
| 21856 | { |
| 21857 | check_max (); |
| 21858 | check_min (); |
| 21859 | return (0); |
| 21860 | } /* main */ |
| 21861 | EOCP |
| 21862 | set try |
| 21863 | if eval $compile; then |
| 21864 | eval `$run ./try 2>/dev/null` |
| 21865 | else |
| 21866 | echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4 |
| 21867 | fi |
| 21868 | $rm_try |
| 21869 | ;; |
| 21870 | esac |
| 21871 | |
| 21872 | : check for type of arguments to select. |
| 21873 | case "$selecttype" in |
| 21874 | '') case "$d_select" in |
| 21875 | $define) |
| 21876 | echo " " |
| 21877 | $cat <<EOM |
| 21878 | Checking to see what type of arguments are accepted by select(). |
| 21879 | EOM |
| 21880 | hdrs="$define sys/types.h |
| 21881 | $i_systime sys/time.h |
| 21882 | $i_sysselct sys/select.h |
| 21883 | $d_socket sys/socket.h" |
| 21884 | : The first arg can be int, unsigned, or size_t |
| 21885 | : The last arg may or may not be 'const' |
| 21886 | val='' |
| 21887 | : void pointer has been seen but using that |
| 21888 | : breaks the selectminbits test |
| 21889 | for xxx in 'fd_set *' 'int *'; do |
| 21890 | for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do |
| 21891 | for tmo in 'struct timeval *' 'const struct timeval *'; do |
| 21892 | case "$val" in |
| 21893 | '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));" |
| 21894 | if ./protochk "$try" $hdrs; then |
| 21895 | echo "Your system accepts $xxx." |
| 21896 | val="$xxx" |
| 21897 | fi |
| 21898 | ;; |
| 21899 | esac |
| 21900 | done |
| 21901 | done |
| 21902 | done |
| 21903 | case "$val" in |
| 21904 | '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?' |
| 21905 | case "$d_fd_set" in |
| 21906 | $define) dflt="fd_set *" ;; |
| 21907 | *) dflt="int *" ;; |
| 21908 | esac |
| 21909 | . ./myread |
| 21910 | val=$ans |
| 21911 | ;; |
| 21912 | esac |
| 21913 | selecttype="$val" |
| 21914 | ;; |
| 21915 | *) : no select, so pick a harmless default |
| 21916 | selecttype='int *' |
| 21917 | ;; |
| 21918 | esac |
| 21919 | ;; |
| 21920 | esac |
| 21921 | |
| 21922 | : check for the select 'width' |
| 21923 | case "$selectminbits" in |
| 21924 | '') safebits=`expr $ptrsize \* 8` |
| 21925 | case "$d_select" in |
| 21926 | $define) |
| 21927 | $cat <<EOM |
| 21928 | |
| 21929 | Checking to see on how many bits at a time your select() operates... |
| 21930 | EOM |
| 21931 | $cat >try.c <<EOCP |
| 21932 | #include <sys/types.h> |
| 21933 | #$i_time I_TIME |
| 21934 | #$i_systime I_SYS_TIME |
| 21935 | #$i_systimek I_SYS_TIME_KERNEL |
| 21936 | #ifdef I_TIME |
| 21937 | # include <time.h> |
| 21938 | #endif |
| 21939 | #ifdef I_SYS_TIME |
| 21940 | # ifdef I_SYS_TIME_KERNEL |
| 21941 | # define KERNEL |
| 21942 | # endif |
| 21943 | # include <sys/time.h> |
| 21944 | # ifdef I_SYS_TIME_KERNEL |
| 21945 | # undef KERNEL |
| 21946 | # endif |
| 21947 | #endif |
| 21948 | #$i_sysselct I_SYS_SELECT |
| 21949 | #ifdef I_SYS_SELECT |
| 21950 | #include <sys/select.h> |
| 21951 | #endif |
| 21952 | #$d_socket HAS_SOCKET |
| 21953 | #ifdef HAS_SOCKET |
| 21954 | # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ |
| 21955 | #endif |
| 21956 | #include <stdio.h> |
| 21957 | #$i_stdlib I_STDLIB |
| 21958 | #ifdef I_STDLIB |
| 21959 | #include <stdlib.h> |
| 21960 | #endif |
| 21961 | $selecttype b; |
| 21962 | #define S sizeof(*(b)) |
| 21963 | #define MINBITS 64 |
| 21964 | #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8) |
| 21965 | #define NBITS (NBYTES * 8) |
| 21966 | int main() { |
| 21967 | char *s = (char *)malloc(NBYTES); |
| 21968 | struct timeval t; |
| 21969 | int i; |
| 21970 | FILE* fp; |
| 21971 | int fd; |
| 21972 | |
| 21973 | if (!s) |
| 21974 | exit(1); |
| 21975 | fclose(stdin); |
| 21976 | fp = fopen("try.c", "r"); |
| 21977 | if (fp == 0) |
| 21978 | exit(2); |
| 21979 | fd = fileno(fp); |
| 21980 | if (fd < 0) |
| 21981 | exit(3); |
| 21982 | b = ($selecttype)s; |
| 21983 | for (i = 0; i < NBITS; i++) |
| 21984 | FD_SET(i, b); |
| 21985 | t.tv_sec = 0; |
| 21986 | t.tv_usec = 0; |
| 21987 | select(fd + 1, b, 0, 0, &t); |
| 21988 | for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--); |
| 21989 | free(s); |
| 21990 | printf("%d\n", i + 1); |
| 21991 | return 0; |
| 21992 | } |
| 21993 | EOCP |
| 21994 | set try |
| 21995 | if eval $compile_ok; then |
| 21996 | selectminbits=`$run ./try 2>/dev/null` |
| 21997 | case "$selectminbits" in |
| 21998 | '') cat >&4 <<EOM |
| 21999 | Cannot figure out on how many bits at a time your select() operates. |
| 22000 | I'll play safe and guess it is $safebits bits. |
| 22001 | EOM |
| 22002 | selectminbits=$safebits |
| 22003 | bits="$safebits bits" |
| 22004 | ;; |
| 22005 | 1) bits="1 bit" ;; |
| 22006 | *) bits="$selectminbits bits" ;; |
| 22007 | esac |
| 22008 | echo "Your select() operates on $bits at a time." >&4 |
| 22009 | else |
| 22010 | rp='What is the minimum number of bits your select() operates on?' |
| 22011 | case "$byteorder" in |
| 22012 | 12345678) dflt=64 ;; |
| 22013 | 1234) dflt=32 ;; |
| 22014 | *) dflt=1 ;; |
| 22015 | esac |
| 22016 | . ./myread |
| 22017 | val=$ans |
| 22018 | selectminbits="$val" |
| 22019 | fi |
| 22020 | $rm_try |
| 22021 | ;; |
| 22022 | *) : no select, so pick a harmless default |
| 22023 | selectminbits=$safebits |
| 22024 | ;; |
| 22025 | esac |
| 22026 | ;; |
| 22027 | esac |
| 22028 | |
| 22029 | : Trace out the files included by signal.h, then look for SIGxxx names. |
| 22030 | case "$sig_num_init" in |
| 22031 | '') |
| 22032 | if [ "X$fieldn" = X ]; then |
| 22033 | : Just make some guesses. We check them later. |
| 22034 | xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h" |
| 22035 | else |
| 22036 | xxx=`echo '#include <signal.h>' | |
| 22037 | $cppstdin $cppminus $cppflags 2>/dev/null | |
| 22038 | $grep '^[ ]*#.*include' | |
| 22039 | $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\ |
| 22040 | $sed 's!\\\\\\\\!/!g' | $sort | $uniq` |
| 22041 | fi |
| 22042 | xxxfiles='' |
| 22043 | for xx in $xxx /dev/null ; do |
| 22044 | $test -f "$xx" && xxxfiles="$xxxfiles $xx" |
| 22045 | done |
| 22046 | case "$xxxfiles" in |
| 22047 | '') xxxfiles=`./findhdr signal.h` ;; |
| 22048 | esac |
| 22049 | xxx=`awk ' |
| 22050 | $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ { |
| 22051 | print substr($2, 4, 20) |
| 22052 | } |
| 22053 | $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ { |
| 22054 | print substr($3, 4, 20) |
| 22055 | }' $xxxfiles` |
| 22056 | : Append some common names just in case the awk scan failed. |
| 22057 | xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE" |
| 22058 | xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE" |
| 22059 | xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP" |
| 22060 | xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2" |
| 22061 | xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ" |
| 22062 | |
| 22063 | : generate a few handy files for later |
| 22064 | $cat > signal.c <<EOCP |
| 22065 | #include <sys/types.h> |
| 22066 | #include <signal.h> |
| 22067 | #$i_stdlib I_STDLIB |
| 22068 | #ifdef I_STDLIB |
| 22069 | #include <stdlib.h> |
| 22070 | #endif |
| 22071 | #include <stdio.h> |
| 22072 | int main() { |
| 22073 | |
| 22074 | /* Strange style to avoid deeply-nested #if/#else/#endif */ |
| 22075 | #ifndef NSIG |
| 22076 | # ifdef _NSIG |
| 22077 | # define NSIG (_NSIG) |
| 22078 | # endif |
| 22079 | #endif |
| 22080 | |
| 22081 | #ifndef NSIG |
| 22082 | # ifdef SIGMAX |
| 22083 | # define NSIG (SIGMAX+1) |
| 22084 | # endif |
| 22085 | #endif |
| 22086 | |
| 22087 | #ifndef NSIG |
| 22088 | # ifdef SIG_MAX |
| 22089 | # define NSIG (SIG_MAX+1) |
| 22090 | # endif |
| 22091 | #endif |
| 22092 | |
| 22093 | #ifndef NSIG |
| 22094 | # ifdef _SIG_MAX |
| 22095 | # define NSIG (_SIG_MAX+1) |
| 22096 | # endif |
| 22097 | #endif |
| 22098 | |
| 22099 | #ifndef NSIG |
| 22100 | # ifdef MAXSIG |
| 22101 | # define NSIG (MAXSIG+1) |
| 22102 | # endif |
| 22103 | #endif |
| 22104 | |
| 22105 | #ifndef NSIG |
| 22106 | # ifdef MAX_SIG |
| 22107 | # define NSIG (MAX_SIG+1) |
| 22108 | # endif |
| 22109 | #endif |
| 22110 | |
| 22111 | #ifndef NSIG |
| 22112 | # ifdef SIGARRAYSIZE |
| 22113 | # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */ |
| 22114 | # endif |
| 22115 | #endif |
| 22116 | |
| 22117 | #ifndef NSIG |
| 22118 | # ifdef _sys_nsig |
| 22119 | # define NSIG (_sys_nsig) /* Solaris 2.5 */ |
| 22120 | # endif |
| 22121 | #endif |
| 22122 | |
| 22123 | /* Default to some arbitrary number that's big enough to get most |
| 22124 | of the common signals. |
| 22125 | */ |
| 22126 | #ifndef NSIG |
| 22127 | # define NSIG 50 |
| 22128 | #endif |
| 22129 | |
| 22130 | printf("NSIG %d\n", NSIG); |
| 22131 | |
| 22132 | #ifndef JUST_NSIG |
| 22133 | |
| 22134 | EOCP |
| 22135 | |
| 22136 | echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk ' |
| 22137 | { |
| 22138 | printf "#ifdef SIG"; printf $1; printf "\n" |
| 22139 | printf "printf(\""; printf $1; printf " %%d\\n\",SIG"; |
| 22140 | printf $1; printf ");\n" |
| 22141 | printf "#endif\n" |
| 22142 | } |
| 22143 | END { |
| 22144 | printf "#endif /* JUST_NSIG */\n"; |
| 22145 | printf "exit(0);\n}\n"; |
| 22146 | } |
| 22147 | ' >>signal.c |
| 22148 | $cat >signal.awk <<'EOP' |
| 22149 | BEGIN { ndups = 0 } |
| 22150 | $1 ~ /^NSIG$/ { nsig = $2 } |
| 22151 | ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) { |
| 22152 | if ($2 > maxsig) { maxsig = $2 } |
| 22153 | if (sig_name[$2]) { |
| 22154 | dup_name[ndups] = $1 |
| 22155 | dup_num[ndups] = $2 |
| 22156 | ndups++ |
| 22157 | } |
| 22158 | else { |
| 22159 | sig_name[$2] = $1 |
| 22160 | sig_num[$2] = $2 |
| 22161 | } |
| 22162 | } |
| 22163 | END { |
| 22164 | if (nsig == 0) { |
| 22165 | nsig = maxsig + 1 |
| 22166 | } |
| 22167 | printf("NSIG %d\n", nsig); |
| 22168 | for (n = 1; n < nsig; n++) { |
| 22169 | if (sig_name[n]) { |
| 22170 | printf("%s %d\n", sig_name[n], sig_num[n]) |
| 22171 | } |
| 22172 | else { |
| 22173 | printf("NUM%d %d\n", n, n) |
| 22174 | } |
| 22175 | } |
| 22176 | for (n = 0; n < ndups; n++) { |
| 22177 | printf("%s %d\n", dup_name[n], dup_num[n]) |
| 22178 | } |
| 22179 | } |
| 22180 | EOP |
| 22181 | $cat >signal_cmd <<EOS |
| 22182 | $startsh |
| 22183 | if $test -s signal.lst; then |
| 22184 | echo "Using your existing signal.lst file" |
| 22185 | exit 0 |
| 22186 | fi |
| 22187 | xxx="$xxx" |
| 22188 | EOS |
| 22189 | $cat >>signal_cmd <<'EOS' |
| 22190 | |
| 22191 | set signal |
| 22192 | if eval $compile_ok; then |
| 22193 | $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\ |
| 22194 | $uniq | $awk -f signal.awk >signal.lst |
| 22195 | else |
| 22196 | echo "(I can't seem be able to compile the whole test program)" >&4 |
| 22197 | echo "(I'll try it in little pieces.)" >&4 |
| 22198 | set signal -DJUST_NSIG |
| 22199 | if eval $compile_ok; then |
| 22200 | $run ./signal$_exe > signal.nsg |
| 22201 | $cat signal.nsg |
| 22202 | else |
| 22203 | echo "I can't seem to figure out how many signals you have." >&4 |
| 22204 | echo "Guessing 50." >&4 |
| 22205 | echo 'NSIG 50' > signal.nsg |
| 22206 | fi |
| 22207 | : Now look at all the signal names, one at a time. |
| 22208 | for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do |
| 22209 | $cat > signal.c <<EOCP |
| 22210 | #include <sys/types.h> |
| 22211 | #include <signal.h> |
| 22212 | #include <stdio.h> |
| 22213 | int main() { |
| 22214 | printf("$xx %d\n", SIG${xx}); |
| 22215 | return 0; |
| 22216 | } |
| 22217 | EOCP |
| 22218 | set signal |
| 22219 | if eval $compile; then |
| 22220 | echo "SIG${xx} found." |
| 22221 | $run ./signal$_exe >> signal.ls1 |
| 22222 | else |
| 22223 | echo "SIG${xx} NOT found." |
| 22224 | fi |
| 22225 | done |
| 22226 | if $test -s signal.ls1; then |
| 22227 | $cat signal.nsg signal.ls1 | |
| 22228 | $sort -n | $uniq | $awk -f signal.awk >signal.lst |
| 22229 | fi |
| 22230 | |
| 22231 | fi |
| 22232 | if $test -s signal.lst; then |
| 22233 | : |
| 22234 | else |
| 22235 | echo "(AAK! I can't compile the test programs -- Guessing)" >&4 |
| 22236 | echo 'kill -l' >signal |
| 22237 | set X `csh -f <signal` |
| 22238 | $rm -f signal |
| 22239 | shift |
| 22240 | case $# in |
| 22241 | 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;; |
| 22242 | esac |
| 22243 | echo $@ | $tr ' ' $trnl | \ |
| 22244 | $awk '{ printf "%s %d\n", $1, ++s; } |
| 22245 | END { printf "NSIG %d\n", ++s }' >signal.lst |
| 22246 | fi |
| 22247 | $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1 |
| 22248 | EOS |
| 22249 | chmod a+x signal_cmd |
| 22250 | $eunicefix signal_cmd |
| 22251 | ;; |
| 22252 | esac |
| 22253 | |
| 22254 | : generate list of signal names |
| 22255 | case "$sig_num_init" in |
| 22256 | '') |
| 22257 | echo " " |
| 22258 | case "$sig_name_init" in |
| 22259 | '') doinit=yes ;; |
| 22260 | *) case "$sig_num_init" in |
| 22261 | ''|*,*) doinit=yes ;; |
| 22262 | esac ;; |
| 22263 | esac |
| 22264 | case "$doinit" in |
| 22265 | yes) |
| 22266 | echo "Generating a list of signal names and numbers..." >&4 |
| 22267 | . ./signal_cmd |
| 22268 | sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst` |
| 22269 | sig_name=`$awk 'BEGIN { printf "ZERO " } |
| 22270 | !/^NSIG/ { printf "%s ", $1 }' signal.lst` |
| 22271 | sig_num=`$awk 'BEGIN { printf "0 " } |
| 22272 | !/^NSIG/ { printf "%d ", $2 }' signal.lst` |
| 22273 | sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } |
| 22274 | !/^NSIG/ { printf "\"%s\", ", $1 } |
| 22275 | END { printf "0\n" }' signal.lst` |
| 22276 | sig_num_init=`$awk 'BEGIN { printf "0, " } |
| 22277 | !/^NSIG/ { printf "%d, ", $2} |
| 22278 | END { printf "0\n"}' signal.lst` |
| 22279 | ;; |
| 22280 | esac |
| 22281 | echo "The following $sig_count signals are available:" |
| 22282 | echo " " |
| 22283 | echo $sig_name | $awk \ |
| 22284 | 'BEGIN { linelen = 0 } |
| 22285 | { |
| 22286 | for (i = 1; i <= NF; i++) { |
| 22287 | name = "SIG" $i " " |
| 22288 | linelen = linelen + length(name) |
| 22289 | if (linelen > 70) { |
| 22290 | printf "\n" |
| 22291 | linelen = length(name) |
| 22292 | } |
| 22293 | printf "%s", name |
| 22294 | } |
| 22295 | printf "\n" |
| 22296 | }' |
| 22297 | sig_size=`echo $sig_name | awk '{print NF}'` |
| 22298 | $rm -f signal signal.c signal.awk signal.lst signal_cmd |
| 22299 | ;; |
| 22300 | esac |
| 22301 | |
| 22302 | : Check size of size |
| 22303 | echo " " |
| 22304 | case "$sizetype" in |
| 22305 | *_t) zzz="$sizetype" ;; |
| 22306 | *) zzz="filesize" ;; |
| 22307 | esac |
| 22308 | echo "Checking the size of $zzz..." >&4 |
| 22309 | cat > try.c <<EOCP |
| 22310 | #include <sys/types.h> |
| 22311 | #include <stdio.h> |
| 22312 | #$i_stdlib I_STDLIB |
| 22313 | #ifdef I_STDLIB |
| 22314 | #include <stdlib.h> |
| 22315 | #endif |
| 22316 | int main() { |
| 22317 | printf("%d\n", (int)sizeof($sizetype)); |
| 22318 | exit(0); |
| 22319 | } |
| 22320 | EOCP |
| 22321 | set try |
| 22322 | if eval $compile_ok; then |
| 22323 | yyy=`$run ./try` |
| 22324 | case "$yyy" in |
| 22325 | '') sizesize=4 |
| 22326 | echo "(I can't execute the test program--guessing $sizesize.)" >&4 |
| 22327 | ;; |
| 22328 | *) sizesize=$yyy |
| 22329 | echo "Your $zzz size is $sizesize bytes." |
| 22330 | ;; |
| 22331 | esac |
| 22332 | else |
| 22333 | sizesize=4 |
| 22334 | echo "(I can't compile the test program--guessing $sizesize.)" >&4 |
| 22335 | fi |
| 22336 | |
| 22337 | : check for socklen_t |
| 22338 | echo " " |
| 22339 | echo "Checking to see if you have socklen_t..." >&4 |
| 22340 | $cat >try.c <<EOCP |
| 22341 | #include <sys/types.h> |
| 22342 | #$d_socket HAS_SOCKET |
| 22343 | #ifdef HAS_SOCKET |
| 22344 | #include <sys/socket.h> |
| 22345 | #endif |
| 22346 | int main() { socklen_t x = 16; } |
| 22347 | EOCP |
| 22348 | set try |
| 22349 | if eval $compile; then |
| 22350 | val="$define" |
| 22351 | echo "You have socklen_t." |
| 22352 | else |
| 22353 | val="$undef" |
| 22354 | echo "You do not have socklen_t." |
| 22355 | case "$sizetype" in |
| 22356 | size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;; |
| 22357 | esac |
| 22358 | fi |
| 22359 | $rm_try |
| 22360 | set d_socklen_t |
| 22361 | eval $setvar |
| 22362 | |
| 22363 | : see if this is a socks.h system |
| 22364 | set socks.h i_socks |
| 22365 | eval $inhdr |
| 22366 | |
| 22367 | : check for type of the size argument to socket calls |
| 22368 | case "$d_socket" in |
| 22369 | "$define") |
| 22370 | $cat <<EOM |
| 22371 | |
| 22372 | Checking to see what type is the last argument of accept(). |
| 22373 | EOM |
| 22374 | yyy='' |
| 22375 | case "$d_socklen_t" in |
| 22376 | "$define") yyy="$yyy socklen_t" |
| 22377 | esac |
| 22378 | yyy="$yyy $sizetype int long unsigned" |
| 22379 | for xxx in $yyy; do |
| 22380 | case "$socksizetype" in |
| 22381 | '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);" |
| 22382 | case "$usesocks" in |
| 22383 | "$define") |
| 22384 | if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then |
| 22385 | echo "Your system accepts '$xxx *' for the last argument of accept()." |
| 22386 | socksizetype="$xxx" |
| 22387 | fi |
| 22388 | ;; |
| 22389 | *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then |
| 22390 | echo "Your system accepts '$xxx *' for the last argument of accept()." |
| 22391 | socksizetype="$xxx" |
| 22392 | fi |
| 22393 | ;; |
| 22394 | esac |
| 22395 | ;; |
| 22396 | esac |
| 22397 | done |
| 22398 | : In case none of those worked, prompt the user. |
| 22399 | case "$socksizetype" in |
| 22400 | '') rp='What is the type for socket address structure sizes?' |
| 22401 | dflt='int' |
| 22402 | . ./myread |
| 22403 | socksizetype=$ans |
| 22404 | ;; |
| 22405 | esac |
| 22406 | ;; |
| 22407 | *) : no sockets, so pick relatively harmless default |
| 22408 | socksizetype='int' |
| 22409 | ;; |
| 22410 | esac |
| 22411 | |
| 22412 | : see what type is used for signed size_t |
| 22413 | set ssize_t ssizetype int stdio.h sys/types.h |
| 22414 | eval $typedef |
| 22415 | dflt="$ssizetype" |
| 22416 | $cat > try.c <<EOM |
| 22417 | #include <stdio.h> |
| 22418 | #$i_stdlib I_STDLIB |
| 22419 | #ifdef I_STDLIB |
| 22420 | #include <stdlib.h> |
| 22421 | #endif |
| 22422 | #include <sys/types.h> |
| 22423 | #define Size_t $sizetype |
| 22424 | #define SSize_t $dflt |
| 22425 | int main() |
| 22426 | { |
| 22427 | if (sizeof(Size_t) == sizeof(SSize_t)) |
| 22428 | printf("$dflt\n"); |
| 22429 | else if (sizeof(Size_t) == sizeof(int)) |
| 22430 | printf("int\n"); |
| 22431 | else |
| 22432 | printf("long\n"); |
| 22433 | exit(0); |
| 22434 | } |
| 22435 | EOM |
| 22436 | echo " " |
| 22437 | set try |
| 22438 | if eval $compile_ok && $run ./try > /dev/null; then |
| 22439 | ssizetype=`$run ./try` |
| 22440 | echo "I'll be using $ssizetype for functions returning a byte count." >&4 |
| 22441 | else |
| 22442 | $cat >&4 <<EOM |
| 22443 | Help! I can't compile and run the ssize_t test program: please enlighten me! |
| 22444 | (This is probably a misconfiguration in your system or libraries, and |
| 22445 | you really ought to fix it. Still, I'll try anyway.) |
| 22446 | |
| 22447 | I need a type that is the same size as $sizetype, but is guaranteed to |
| 22448 | be signed. Common values are ssize_t, int and long. |
| 22449 | |
| 22450 | EOM |
| 22451 | rp="What signed type is the same size as $sizetype?" |
| 22452 | . ./myread |
| 22453 | ssizetype="$ans" |
| 22454 | fi |
| 22455 | $rm_try |
| 22456 | |
| 22457 | : Check the size of st_ino |
| 22458 | $echo " " |
| 22459 | $echo "Checking the size of st_ino..." >&4 |
| 22460 | $cat > try.c <<EOCP |
| 22461 | #include <sys/stat.h> |
| 22462 | #include <stdio.h> |
| 22463 | #$i_stdlib I_STDLIB |
| 22464 | #ifdef I_STDLIB |
| 22465 | #include <stdlib.h> |
| 22466 | #endif |
| 22467 | int main() { |
| 22468 | struct stat st; |
| 22469 | printf("%d\n", (int)sizeof(st.st_ino)); |
| 22470 | exit(0); |
| 22471 | } |
| 22472 | EOCP |
| 22473 | set try |
| 22474 | if eval $compile_ok; then |
| 22475 | val=`$run ./try` |
| 22476 | case "$val" in |
| 22477 | '') st_ino_size=4 |
| 22478 | $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4 |
| 22479 | ;; |
| 22480 | *) st_ino_size=$val |
| 22481 | $echo "Your st_ino is $st_ino_size bytes long." |
| 22482 | ;; |
| 22483 | esac |
| 22484 | else |
| 22485 | st_ino_size=4 |
| 22486 | $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4 |
| 22487 | fi |
| 22488 | $rm_try |
| 22489 | |
| 22490 | : Check if st_ino is signed |
| 22491 | $echo " " |
| 22492 | $echo "Checking the sign of st_ino..." >&4 |
| 22493 | $cat > try.c <<EOCP |
| 22494 | #include <sys/stat.h> |
| 22495 | #include <stdio.h> |
| 22496 | int main() { |
| 22497 | struct stat foo; |
| 22498 | foo.st_ino = -1; |
| 22499 | if (foo.st_ino < 0) |
| 22500 | printf("-1\n"); |
| 22501 | else |
| 22502 | printf("1\n"); |
| 22503 | } |
| 22504 | EOCP |
| 22505 | set try |
| 22506 | if eval $compile; then |
| 22507 | val=`$run ./try` |
| 22508 | case "$val" in |
| 22509 | '') st_ino_sign=1 |
| 22510 | $echo "(I can't execute the test program--guessing unsigned.)" >&4 |
| 22511 | ;; |
| 22512 | *) st_ino_sign=$val |
| 22513 | case "$st_ino_sign" in |
| 22514 | 1) $echo "Your st_ino is unsigned." ;; |
| 22515 | -1) $echo "Your st_ino is signed." ;; |
| 22516 | esac |
| 22517 | ;; |
| 22518 | esac |
| 22519 | else |
| 22520 | st_ino_sign=1 |
| 22521 | $echo "(I can't compile the test program--guessing unsigned.)" >&4 |
| 22522 | fi |
| 22523 | $rm_try |
| 22524 | |
| 22525 | : see what type of char stdio uses. |
| 22526 | echo " " |
| 22527 | echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh |
| 22528 | if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then |
| 22529 | echo "Your stdio uses unsigned chars." >&4 |
| 22530 | stdchar="unsigned char" |
| 22531 | else |
| 22532 | echo "Your stdio uses signed chars." >&4 |
| 22533 | stdchar="char" |
| 22534 | fi |
| 22535 | $rm -f stdioh |
| 22536 | |
| 22537 | : Check size of UID |
| 22538 | echo " " |
| 22539 | case "$uidtype" in |
| 22540 | *_t) zzz="$uidtype" ;; |
| 22541 | *) zzz="uid" ;; |
| 22542 | esac |
| 22543 | echo "Checking the size of $zzz..." >&4 |
| 22544 | cat > try.c <<EOCP |
| 22545 | #include <sys/types.h> |
| 22546 | #include <stdio.h> |
| 22547 | #$i_stdlib I_STDLIB |
| 22548 | #ifdef I_STDLIB |
| 22549 | #include <stdlib.h> |
| 22550 | #endif |
| 22551 | int main() { |
| 22552 | printf("%d\n", (int)sizeof($uidtype)); |
| 22553 | exit(0); |
| 22554 | } |
| 22555 | EOCP |
| 22556 | set try |
| 22557 | if eval $compile_ok; then |
| 22558 | yyy=`$run ./try` |
| 22559 | case "$yyy" in |
| 22560 | '') uidsize=4 |
| 22561 | echo "(I can't execute the test program--guessing $uidsize.)" >&4 |
| 22562 | ;; |
| 22563 | *) uidsize=$yyy |
| 22564 | echo "Your $zzz is $uidsize bytes long." |
| 22565 | ;; |
| 22566 | esac |
| 22567 | else |
| 22568 | uidsize=4 |
| 22569 | echo "(I can't compile the test program--guessing $uidsize.)" >&4 |
| 22570 | fi |
| 22571 | |
| 22572 | : Check if UID is signed |
| 22573 | echo " " |
| 22574 | case "$uidtype" in |
| 22575 | *_t) zzz="$uidtype" ;; |
| 22576 | *) zzz="uid" ;; |
| 22577 | esac |
| 22578 | echo "Checking the sign of $zzz..." >&4 |
| 22579 | cat > try.c <<EOCP |
| 22580 | #include <sys/types.h> |
| 22581 | #include <stdio.h> |
| 22582 | int main() { |
| 22583 | $uidtype foo = -1; |
| 22584 | if (foo < 0) |
| 22585 | printf("-1\n"); |
| 22586 | else |
| 22587 | printf("1\n"); |
| 22588 | } |
| 22589 | EOCP |
| 22590 | set try |
| 22591 | if eval $compile; then |
| 22592 | yyy=`$run ./try` |
| 22593 | case "$yyy" in |
| 22594 | '') uidsign=1 |
| 22595 | echo "(I can't execute the test program--guessing unsigned.)" >&4 |
| 22596 | ;; |
| 22597 | *) uidsign=$yyy |
| 22598 | case "$uidsign" in |
| 22599 | 1) echo "Your $zzz is unsigned." ;; |
| 22600 | -1) echo "Your $zzz is signed." ;; |
| 22601 | esac |
| 22602 | ;; |
| 22603 | esac |
| 22604 | else |
| 22605 | uidsign=1 |
| 22606 | echo "(I can't compile the test program--guessing unsigned.)" >&4 |
| 22607 | fi |
| 22608 | |
| 22609 | : Check format string for UID |
| 22610 | echo " " |
| 22611 | $echo "Checking the format string to be used for uids..." >&4 |
| 22612 | |
| 22613 | case "$uidsign" in |
| 22614 | -1) if $test X"$uidsize" = X"$ivsize"; then |
| 22615 | uidformat="$ivdformat" |
| 22616 | else |
| 22617 | if $test X"$uidsize" = X"$longsize"; then |
| 22618 | uidformat='"ld"' |
| 22619 | else |
| 22620 | if $test X"$uidsize" = X"$intsize"; then |
| 22621 | uidformat='"d"' |
| 22622 | else |
| 22623 | if $test X"$uidsize" = X"$shortsize"; then |
| 22624 | uidformat='"hd"' |
| 22625 | fi |
| 22626 | fi |
| 22627 | fi |
| 22628 | fi |
| 22629 | ;; |
| 22630 | *) if $test X"$uidsize" = X"$uvsize"; then |
| 22631 | uidformat="$uvuformat" |
| 22632 | else |
| 22633 | if $test X"$uidsize" = X"$longsize"; then |
| 22634 | uidformat='"lu"' |
| 22635 | else |
| 22636 | if $test X"$uidsize" = X"$intsize"; then |
| 22637 | uidformat='"u"' |
| 22638 | else |
| 22639 | if $test X"$uidsize" = X"$shortsize"; then |
| 22640 | uidformat='"hu"' |
| 22641 | fi |
| 22642 | fi |
| 22643 | fi |
| 22644 | fi |
| 22645 | ;; |
| 22646 | esac |
| 22647 | |
| 22648 | : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program |
| 22649 | echo " " |
| 22650 | echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4 |
| 22651 | $cat >try.c <<'EOM' |
| 22652 | /* Intentionally a long probe as I'd like to sanity check that the exact |
| 22653 | approach is going to work, as thinking it will work, but only having it |
| 22654 | part working at runtime is worse than not having it. */ |
| 22655 | |
| 22656 | #include <sys/types.h> |
| 22657 | #include <sys/sysctl.h> |
| 22658 | #include <sys/param.h> |
| 22659 | #include <stdio.h> |
| 22660 | #include <string.h> |
| 22661 | #include <stdlib.h> |
| 22662 | #include <unistd.h> |
| 22663 | |
| 22664 | int |
| 22665 | main(int argc, char **argv) { |
| 22666 | char *buffer; |
| 22667 | char *argv_leaf = strrchr(argv[0], '/'); |
| 22668 | char *buffer_leaf; |
| 22669 | size_t size = 0; |
| 22670 | int mib[4]; |
| 22671 | |
| 22672 | mib[0] = CTL_KERN; |
| 22673 | mib[1] = KERN_PROC; |
| 22674 | mib[2] = KERN_PROC_PATHNAME; |
| 22675 | mib[3] = -1; |
| 22676 | |
| 22677 | if (!argv_leaf) { |
| 22678 | fprintf(stderr, "Can't locate / in '%s'\n", argv[0]); |
| 22679 | return 1; |
| 22680 | } |
| 22681 | |
| 22682 | if (sysctl(mib, 4, NULL, &size, NULL, 0)) { |
| 22683 | perror("sysctl"); |
| 22684 | return 2; |
| 22685 | } |
| 22686 | |
| 22687 | if (size < strlen(argv_leaf) + 1) { |
| 22688 | fprintf(stderr, "size %lu is too short for a path\n", |
| 22689 | (unsigned long) size); |
| 22690 | return 3; |
| 22691 | } |
| 22692 | |
| 22693 | if (size > MAXPATHLEN * MAXPATHLEN) { |
| 22694 | fprintf(stderr, "size %lu is too long for a path\n", |
| 22695 | (unsigned long) size); |
| 22696 | return 4; |
| 22697 | } |
| 22698 | |
| 22699 | buffer = (char *)malloc(size); |
| 22700 | if (!buffer) { |
| 22701 | perror("malloc"); |
| 22702 | return 5; |
| 22703 | } |
| 22704 | |
| 22705 | if (sysctl(mib, 4, buffer, &size, NULL, 0)) { |
| 22706 | perror("sysctl"); |
| 22707 | return 6; |
| 22708 | } |
| 22709 | |
| 22710 | if (strlen(buffer) + 1 != size) { |
| 22711 | fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n", |
| 22712 | (unsigned long)size, (unsigned long)strlen(buffer) + 1); |
| 22713 | return 7; |
| 22714 | } |
| 22715 | |
| 22716 | |
| 22717 | if (*buffer != '/') { |
| 22718 | fprintf(stderr, "Not an absolute path: '%s'\n", buffer); |
| 22719 | return 8; |
| 22720 | } |
| 22721 | |
| 22722 | if (strstr(buffer, "/./")) { |
| 22723 | fprintf(stderr, "Contains /./: '%s'\n", buffer); |
| 22724 | return 9; |
| 22725 | } |
| 22726 | |
| 22727 | if (strstr(buffer, "/../")) { |
| 22728 | fprintf(stderr, "Contains /../: '%s'\n", buffer); |
| 22729 | return 10; |
| 22730 | } |
| 22731 | |
| 22732 | buffer_leaf = strrchr(buffer, '/'); |
| 22733 | if (strcmp(buffer_leaf, argv_leaf) != 0) { |
| 22734 | fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer); |
| 22735 | return 11; |
| 22736 | } |
| 22737 | |
| 22738 | free(buffer); |
| 22739 | |
| 22740 | return 0; |
| 22741 | } |
| 22742 | EOM |
| 22743 | |
| 22744 | val=$undef |
| 22745 | set try |
| 22746 | if eval $compile; then |
| 22747 | if $run ./try; then |
| 22748 | echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4 |
| 22749 | val="$define" |
| 22750 | else |
| 22751 | echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4 |
| 22752 | val="$undef" |
| 22753 | fi |
| 22754 | else |
| 22755 | echo "I'm unable to compile the test program." >&4 |
| 22756 | echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4 |
| 22757 | val="$undef" |
| 22758 | fi |
| 22759 | $rm_try |
| 22760 | set usekernprocpathname |
| 22761 | eval $setvar |
| 22762 | |
| 22763 | : Determine if we can use _NSGetExecutablePath to find executing program |
| 22764 | echo " " |
| 22765 | echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4 |
| 22766 | $cat >try.c <<'EOM' |
| 22767 | /* Intentionally a long probe as I'd like to sanity check that the exact |
| 22768 | approach is going to work, as thinking it will work, but only having it |
| 22769 | part working at runtime is worse than not having it. */ |
| 22770 | #include <mach-o/dyld.h> |
| 22771 | #include <stdio.h> |
| 22772 | #include <stdlib.h> |
| 22773 | #include <sys/param.h> |
| 22774 | #include <string.h> |
| 22775 | |
| 22776 | int |
| 22777 | main(int argc, char **argv) { |
| 22778 | char buf[1]; |
| 22779 | uint32_t size = sizeof(buf); |
| 22780 | int result; |
| 22781 | char *buffer; |
| 22782 | char *tidied; |
| 22783 | char *argv_leaf = strrchr(argv[0], '/'); |
| 22784 | char *tidied_leaf; |
| 22785 | |
| 22786 | if (!argv_leaf) { |
| 22787 | fprintf(stderr, "Can't locate / in '%s'\n", argv[0]); |
| 22788 | return 1; |
| 22789 | } |
| 22790 | |
| 22791 | _NSGetExecutablePath(buf, &size); |
| 22792 | if (size > MAXPATHLEN * MAXPATHLEN) { |
| 22793 | fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n", |
| 22794 | (unsigned int) size); |
| 22795 | return 2; |
| 22796 | } |
| 22797 | |
| 22798 | buffer = (char *)malloc(size); |
| 22799 | if (!buffer) { |
| 22800 | perror("malloc"); |
| 22801 | return 3; |
| 22802 | } |
| 22803 | |
| 22804 | result = _NSGetExecutablePath(buffer, &size); |
| 22805 | if (result != 0) { |
| 22806 | fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n", |
| 22807 | result, (unsigned int) size); |
| 22808 | return 4; |
| 22809 | } |
| 22810 | |
| 22811 | tidied = realpath(buffer, NULL); |
| 22812 | if (!tidied) { |
| 22813 | perror("realpath"); |
| 22814 | return 5; |
| 22815 | } |
| 22816 | |
| 22817 | free(buffer); |
| 22818 | |
| 22819 | if (*tidied != '/') { |
| 22820 | fprintf(stderr, "Not an absolute path: '%s'\n", tidied); |
| 22821 | return 6; |
| 22822 | } |
| 22823 | |
| 22824 | if (strstr(tidied, "/./")) { |
| 22825 | fprintf(stderr, "Contains /./: '%s'\n", tidied); |
| 22826 | return 7; |
| 22827 | } |
| 22828 | |
| 22829 | if (strstr(tidied, "/../")) { |
| 22830 | fprintf(stderr, "Contains /../: '%s'\n", tidied); |
| 22831 | return 8; |
| 22832 | } |
| 22833 | |
| 22834 | tidied_leaf = strrchr(tidied, '/'); |
| 22835 | if (strcmp(tidied_leaf, argv_leaf) != 0) { |
| 22836 | fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied); |
| 22837 | return 9; |
| 22838 | } |
| 22839 | |
| 22840 | free(tidied); |
| 22841 | |
| 22842 | return 0; |
| 22843 | } |
| 22844 | EOM |
| 22845 | |
| 22846 | val=$undef |
| 22847 | set try |
| 22848 | if eval $compile; then |
| 22849 | if $run ./try; then |
| 22850 | echo "You can use _NSGetExecutablePath to find the executing program." >&4 |
| 22851 | val="$define" |
| 22852 | else |
| 22853 | echo "Nope, _NSGetExecutablePath doesn't work here." >&4 |
| 22854 | fi |
| 22855 | else |
| 22856 | echo "I'm unable to compile the test program." >&4 |
| 22857 | echo "I'll assume no _NSGetExecutablePath here." >&4 |
| 22858 | fi |
| 22859 | $rm_try |
| 22860 | set usensgetexecutablepath |
| 22861 | eval $setvar |
| 22862 | |
| 22863 | : Check if site customization support was requested |
| 22864 | case "$usesitecustomize" in |
| 22865 | $define|true|[Yy]*) |
| 22866 | usesitecustomize="$define" |
| 22867 | ;; |
| 22868 | *) |
| 22869 | usesitecustomize="$undef" |
| 22870 | ;; |
| 22871 | esac |
| 22872 | |
| 22873 | : determine compiler compiler |
| 22874 | case "$yacc" in |
| 22875 | '') |
| 22876 | dflt=yacc;; |
| 22877 | *) |
| 22878 | dflt="$yacc";; |
| 22879 | esac |
| 22880 | echo " " |
| 22881 | comp='yacc' |
| 22882 | if $test -f "$byacc$_exe"; then |
| 22883 | dflt="$byacc" |
| 22884 | comp="byacc or $comp" |
| 22885 | fi |
| 22886 | if $test -f "$bison$_exe"; then |
| 22887 | comp="$comp or bison -y" |
| 22888 | fi |
| 22889 | rp="Which compiler compiler ($comp) shall I use?" |
| 22890 | . ./myread |
| 22891 | yacc="$ans" |
| 22892 | case "$yacc" in |
| 22893 | *bis*) |
| 22894 | case "$yacc" in |
| 22895 | *-y*) ;; |
| 22896 | *) |
| 22897 | yacc="$yacc -y" |
| 22898 | echo "(Adding -y option to bison to get yacc-compatible behavior.)" |
| 22899 | ;; |
| 22900 | esac |
| 22901 | ;; |
| 22902 | esac |
| 22903 | |
| 22904 | : see if this is a bfd.h system |
| 22905 | set bfd.h i_bfd |
| 22906 | eval $inhdr |
| 22907 | |
| 22908 | : see if this is an execinfo.h system |
| 22909 | set execinfo.h i_execinfo |
| 22910 | eval $inhdr |
| 22911 | |
| 22912 | : see if this is a fenv.h system |
| 22913 | set fenv.h i_fenv |
| 22914 | eval $inhdr |
| 22915 | |
| 22916 | : see if this is a fp.h system |
| 22917 | set fp.h i_fp |
| 22918 | eval $inhdr |
| 22919 | |
| 22920 | : see if this is a fp_class.h system |
| 22921 | set fp_class.h i_fp_class |
| 22922 | eval $inhdr |
| 22923 | |
| 22924 | : see if gdbm.h is available |
| 22925 | set gdbm.h t_gdbm |
| 22926 | eval $inhdr |
| 22927 | case "$t_gdbm" in |
| 22928 | $define) |
| 22929 | : see if gdbm_open exists |
| 22930 | set gdbm_open d_gdbm_open |
| 22931 | eval $inlibc |
| 22932 | case "$d_gdbm_open" in |
| 22933 | $undef) |
| 22934 | t_gdbm="$undef" |
| 22935 | echo "We won't be including <gdbm.h>" |
| 22936 | ;; |
| 22937 | esac |
| 22938 | ;; |
| 22939 | esac |
| 22940 | val="$t_gdbm" |
| 22941 | set i_gdbm |
| 22942 | eval $setvar |
| 22943 | |
| 22944 | : see if this is a ieeefp.h system |
| 22945 | case "$i_ieeefp" in |
| 22946 | '' ) set ieeefp.h i_ieeefp |
| 22947 | eval $inhdr |
| 22948 | ;; |
| 22949 | esac |
| 22950 | |
| 22951 | : see if this is a libutil.h system |
| 22952 | set libutil.h i_libutil |
| 22953 | eval $inhdr |
| 22954 | |
| 22955 | : see if mach cthreads are available |
| 22956 | if test "X$usethreads" = "X$define"; then |
| 22957 | set mach/cthreads.h i_machcthr |
| 22958 | eval $inhdr |
| 22959 | else |
| 22960 | i_machcthr="$undef" |
| 22961 | fi |
| 22962 | |
| 22963 | : see if this is a mntent.h system |
| 22964 | set mntent.h i_mntent |
| 22965 | eval $inhdr |
| 22966 | |
| 22967 | : see if net/errno.h is available |
| 22968 | val='' |
| 22969 | set net/errno.h val |
| 22970 | eval $inhdr |
| 22971 | |
| 22972 | : Unfortunately, it causes problems on some systems. Arrgh. |
| 22973 | case "$val" in |
| 22974 | $define) |
| 22975 | cat > try.c <<'EOM' |
| 22976 | #include <stdio.h> |
| 22977 | #include <errno.h> |
| 22978 | #include <net/errno.h> |
| 22979 | int func() |
| 22980 | { |
| 22981 | return ENOTSOCK; |
| 22982 | } |
| 22983 | EOM |
| 22984 | if $cc $ccflags -c try.c >/dev/null 2>&1; then |
| 22985 | echo "We'll be including <net/errno.h>." >&4 |
| 22986 | else |
| 22987 | echo "We won't be including <net/errno.h>." >&4 |
| 22988 | val="$undef" |
| 22989 | fi |
| 22990 | $rm_try |
| 22991 | ;; |
| 22992 | esac |
| 22993 | set i_neterrno |
| 22994 | eval $setvar |
| 22995 | |
| 22996 | : see if netinet/tcp.h is available |
| 22997 | set netinet/tcp.h i_netinettcp |
| 22998 | eval $inhdr |
| 22999 | |
| 23000 | : see if this is a poll.h system |
| 23001 | set poll.h i_poll |
| 23002 | eval $inhdr |
| 23003 | |
| 23004 | : see if this is a prot.h system |
| 23005 | set prot.h i_prot |
| 23006 | eval $inhdr |
| 23007 | |
| 23008 | : Preprocessor symbols |
| 23009 | echo " " |
| 23010 | $echo "Guessing which symbols your C compiler and preprocessor define..." >&4 |
| 23011 | $cat <<'EOSH' > Cppsym.know |
| 23012 | a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42 |
| 23013 | AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000 |
| 23014 | AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc |
| 23015 | arch_pwr ardent ARM ARM32 atarist att386 att3b |
| 23016 | BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4 |
| 23017 | BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull |
| 23018 | byteorder byte_order |
| 23019 | c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent |
| 23020 | convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN |
| 23021 | DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX |
| 23022 | ELF encore EPI EXTENSIONS |
| 23023 | FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD |
| 23024 | GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR |
| 23025 | GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN |
| 23026 | H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700 |
| 23027 | hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 |
| 23028 | hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf |
| 23029 | i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64 |
| 23030 | iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64 |
| 23031 | INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium |
| 23032 | ksr1 |
| 23033 | LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API |
| 23034 | LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN |
| 23035 | LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna |
| 23036 | luna88k Lynx |
| 23037 | M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen |
| 23038 | MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020 |
| 23039 | mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 |
| 23040 | merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM |
| 23041 | MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS |
| 23042 | MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286 |
| 23043 | M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5 |
| 23044 | M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX |
| 23045 | n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900 |
| 23046 | news3700 news700 news800 news900 NeXT NLS nonstopux ns16000 |
| 23047 | ns32000 ns32016 ns32332 ns32k nsc32000 |
| 23048 | OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE |
| 23049 | PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC |
| 23050 | plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE |
| 23051 | POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr |
| 23052 | QK_USER QNX |
| 23053 | R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT |
| 23054 | S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix |
| 23055 | SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony |
| 23056 | sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum |
| 23057 | stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4 |
| 23058 | SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43 |
| 23059 | SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 |
| 23060 | SYSV4 SYSV5 sysV68 sysV88 |
| 23061 | Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200 |
| 23062 | TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700 |
| 23063 | tower32_800 tower32_850 tss |
| 23064 | u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB |
| 23065 | UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD |
| 23066 | USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE |
| 23067 | USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309 |
| 23068 | USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98 |
| 23069 | USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN |
| 23070 | uxpm uxps |
| 23071 | vax venix VMESA vms |
| 23072 | x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 |
| 23073 | XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED |
| 23074 | z8000 zarch |
| 23075 | EOSH |
| 23076 | # Maybe put other stuff here too. |
| 23077 | ./tr '-' '_' <<EOSH >>Cppsym.know |
| 23078 | $osname |
| 23079 | EOSH |
| 23080 | ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a |
| 23081 | ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b |
| 23082 | $cat Cppsym.know > Cppsym.c |
| 23083 | $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know |
| 23084 | $rm -f Cppsym.a Cppsym.b Cppsym.c |
| 23085 | cat <<EOSH > Cppsym |
| 23086 | $startsh |
| 23087 | if $test \$# -gt 0; then |
| 23088 | echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got |
| 23089 | if $test -s Cppsym.got; then |
| 23090 | $rm -f Cppsym.got |
| 23091 | exit 0 |
| 23092 | fi |
| 23093 | $rm -f Cppsym.got |
| 23094 | exit 1 |
| 23095 | else |
| 23096 | $tr " " "$trnl" | ./Cppsym.try |
| 23097 | exit 0 |
| 23098 | fi |
| 23099 | EOSH |
| 23100 | chmod +x Cppsym |
| 23101 | $eunicefix Cppsym |
| 23102 | cat <<EOSH > Cppsym.try |
| 23103 | $startsh |
| 23104 | cat <<'EOCP' > try.c |
| 23105 | #include <stdio.h> |
| 23106 | #if cpp_stuff == 1 |
| 23107 | #define STRINGIFY(a) "a" |
| 23108 | #endif |
| 23109 | #if cpp_stuff == 42 |
| 23110 | #define StGiFy(a) #a |
| 23111 | #define STRINGIFY(a) StGiFy(a) |
| 23112 | #endif |
| 23113 | #if $cpp_stuff != 1 && $cpp_stuff != 42 |
| 23114 | # include "Bletch: How does this C preprocessor stringify macros?" |
| 23115 | #endif |
| 23116 | int main() { |
| 23117 | EOCP |
| 23118 | $awk \\ |
| 23119 | EOSH |
| 23120 | cat <<'EOSH' >> Cppsym.try |
| 23121 | 'length($1) > 0 { |
| 23122 | printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1 |
| 23123 | printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1 |
| 23124 | printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1 |
| 23125 | printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1 |
| 23126 | }' >> try.c |
| 23127 | echo 'return 0;}' >> try.c |
| 23128 | EOSH |
| 23129 | cat <<EOSH >> Cppsym.try |
| 23130 | ccflags="$ccflags" |
| 23131 | case "$osname-$gccversion" in |
| 23132 | irix-) ccflags="\$ccflags -woff 1178" ;; |
| 23133 | os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;; |
| 23134 | esac |
| 23135 | $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g' |
| 23136 | EOSH |
| 23137 | chmod +x Cppsym.try |
| 23138 | $eunicefix Cppsym.try |
| 23139 | ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true |
| 23140 | : Add in any Linux cpp "predefined macros": |
| 23141 | case "$osname::$gccversion" in |
| 23142 | *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*) |
| 23143 | tHdrH=_tmpHdr |
| 23144 | rm -f $tHdrH'.h' $tHdrH |
| 23145 | touch $tHdrH'.h' |
| 23146 | # Filter out macro arguments, such as Linux's __INT8_C(c) |
| 23147 | if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then |
| 23148 | sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real' |
| 23149 | if [ -s $tHdrH'_cppsym.real' ]; then |
| 23150 | cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true |
| 23151 | fi |
| 23152 | fi |
| 23153 | rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real' |
| 23154 | ;; |
| 23155 | esac |
| 23156 | : now check the C compiler for additional symbols |
| 23157 | postprocess_cc_v='' |
| 23158 | case "$osname" in |
| 23159 | aix) postprocess_cc_v="|$tr , ' '" ;; |
| 23160 | esac |
| 23161 | $cat >ccsym <<EOS |
| 23162 | $startsh |
| 23163 | $cat >tmp.c <<EOF |
| 23164 | extern int foo; |
| 23165 | EOF |
| 23166 | for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\` |
| 23167 | do |
| 23168 | case "\$i" in |
| 23169 | -D*) echo "\$i" | $sed 's/^-D//';; |
| 23170 | -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';; |
| 23171 | esac |
| 23172 | done |
| 23173 | $rm_try |
| 23174 | EOS |
| 23175 | postprocess_cc_v='' |
| 23176 | chmod +x ccsym |
| 23177 | $eunicefix ccsym |
| 23178 | ./ccsym > ccsym1.raw |
| 23179 | if $test -s ccsym1.raw; then |
| 23180 | $sort ccsym1.raw | $uniq >ccsym.raw |
| 23181 | else |
| 23182 | mv ccsym1.raw ccsym.raw |
| 23183 | fi |
| 23184 | |
| 23185 | $awk '/\=/ { print $0; next } |
| 23186 | { print $0"=1" }' ccsym.raw >ccsym.list |
| 23187 | $comm -13 Cppsym.true ccsym.list >ccsym.own |
| 23188 | $comm -12 Cppsym.true ccsym.list >ccsym.com |
| 23189 | $comm -23 Cppsym.true ccsym.list >ccsym.cpp |
| 23190 | also='' |
| 23191 | if $test -z ccsym.raw; then |
| 23192 | echo "Your C compiler doesn't seem to define any symbols!" >&4 |
| 23193 | echo " " |
| 23194 | echo "However, your C preprocessor defines the following symbols:" |
| 23195 | $cat Cppsym.true |
| 23196 | ccsymbols='' |
| 23197 | cppsymbols=`$cat Cppsym.true` |
| 23198 | cppsymbols=`echo $cppsymbols` |
| 23199 | cppccsymbols="$cppsymbols" |
| 23200 | else |
| 23201 | if $test -s ccsym.com; then |
| 23202 | echo "Your C compiler and pre-processor define these symbols:" |
| 23203 | $sed -e 's/\(..*\)=.*/\1/' ccsym.com |
| 23204 | also='also ' |
| 23205 | symbols='ones' |
| 23206 | cppccsymbols=`$cat ccsym.com` |
| 23207 | cppccsymbols=`echo $cppccsymbols` |
| 23208 | $test "$silent" || sleep 1 |
| 23209 | fi |
| 23210 | if $test -s ccsym.cpp; then |
| 23211 | $test "$also" && echo " " |
| 23212 | echo "Your C pre-processor ${also}defines the following symbols:" |
| 23213 | $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp |
| 23214 | also='further ' |
| 23215 | cppsymbols=`$cat ccsym.cpp` |
| 23216 | cppsymbols=`echo $cppsymbols` |
| 23217 | $test "$silent" || sleep 1 |
| 23218 | fi |
| 23219 | if $test -s ccsym.own; then |
| 23220 | $test "$also" && echo " " |
| 23221 | echo "Your C compiler ${also}defines the following cpp symbols:" |
| 23222 | $sed -e 's/\(..*\)=1/\1/' ccsym.own |
| 23223 | $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true |
| 23224 | ccsymbols=`$cat ccsym.own` |
| 23225 | ccsymbols=`echo $ccsymbols` |
| 23226 | $test "$silent" || sleep 1 |
| 23227 | fi |
| 23228 | fi |
| 23229 | |
| 23230 | : add -D_FORTIFY_SOURCE if feasible and not already there |
| 23231 | case "$gccversion" in |
| 23232 | [456789].*|[1-9][0-9]*) case "$optimize$ccflags" in |
| 23233 | *-O*) case "$ccflags$cppsymbols" in |
| 23234 | *_FORTIFY_SOURCE=*) # Don't add it again. |
| 23235 | echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4 |
| 23236 | ;; |
| 23237 | *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4 |
| 23238 | ccflags="$ccflags -D_FORTIFY_SOURCE=2" |
| 23239 | ;; |
| 23240 | esac |
| 23241 | ;; |
| 23242 | *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4 |
| 23243 | ;; |
| 23244 | esac |
| 23245 | ;; |
| 23246 | *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4 |
| 23247 | ;; |
| 23248 | esac |
| 23249 | |
| 23250 | : script used to emit important warnings |
| 23251 | cat >warn <<EOS |
| 23252 | $startsh |
| 23253 | if test \$# -gt 0; then |
| 23254 | echo "\$@" >msg |
| 23255 | else |
| 23256 | cat >msg |
| 23257 | fi |
| 23258 | echo "*** WARNING:" >&4 |
| 23259 | sed -e 's/^/*** /' <msg >&4 |
| 23260 | echo "*** " >&4 |
| 23261 | cat msg >>config.msg |
| 23262 | echo " " >>config.msg |
| 23263 | rm -f msg |
| 23264 | EOS |
| 23265 | chmod +x warn |
| 23266 | $eunicefix warn |
| 23267 | |
| 23268 | : see if this is a termio system |
| 23269 | val="$undef" |
| 23270 | val2="$undef" |
| 23271 | val3="$undef" |
| 23272 | if $test `./findhdr termios.h`; then |
| 23273 | set tcsetattr i_termios |
| 23274 | eval $inlibc |
| 23275 | val3="$i_termios" |
| 23276 | fi |
| 23277 | echo " " |
| 23278 | case "$val3" in |
| 23279 | "$define") echo "You have POSIX termios.h... good!" >&4;; |
| 23280 | *) if ./Cppsym pyr; then |
| 23281 | case "`$run /bin/universe`" in |
| 23282 | ucb) if $test `./findhdr sgtty.h`; then |
| 23283 | val2="$define" |
| 23284 | echo "<sgtty.h> found." >&4 |
| 23285 | else |
| 23286 | echo "System is pyramid with BSD universe." |
| 23287 | ./warn "<sgtty.h> not found--you could have problems." |
| 23288 | fi;; |
| 23289 | *) if $test `./findhdr termio.h`; then |
| 23290 | val="$define" |
| 23291 | echo "<termio.h> found." >&4 |
| 23292 | else |
| 23293 | echo "System is pyramid with USG universe." |
| 23294 | ./warn "<termio.h> not found--you could have problems." |
| 23295 | fi;; |
| 23296 | esac |
| 23297 | elif ./usg; then |
| 23298 | if $test `./findhdr termio.h`; then |
| 23299 | echo "<termio.h> found." >&4 |
| 23300 | val="$define" |
| 23301 | elif $test `./findhdr sgtty.h`; then |
| 23302 | echo "<sgtty.h> found." >&4 |
| 23303 | val2="$define" |
| 23304 | else |
| 23305 | ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!" |
| 23306 | fi |
| 23307 | else |
| 23308 | if $test `./findhdr sgtty.h`; then |
| 23309 | echo "<sgtty.h> found." >&4 |
| 23310 | val2="$define" |
| 23311 | elif $test `./findhdr termio.h`; then |
| 23312 | echo "<termio.h> found." >&4 |
| 23313 | val="$define" |
| 23314 | else |
| 23315 | ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!" |
| 23316 | fi |
| 23317 | fi;; |
| 23318 | esac |
| 23319 | set i_termio; eval $setvar |
| 23320 | val=$val2; set i_sgtty; eval $setvar |
| 23321 | val=$val3; set i_termios; eval $setvar |
| 23322 | |
| 23323 | : see if stdbool is available |
| 23324 | : we want a real compile instead of Inhdr because some Solaris systems |
| 23325 | : have stdbool.h, but it can only be used if the compiler indicates it |
| 23326 | : is sufficiently c99-compliant. |
| 23327 | echo " " |
| 23328 | $cat >try.c <<EOCP |
| 23329 | #include <stdio.h> |
| 23330 | #include <stdbool.h> |
| 23331 | int func(bool x) |
| 23332 | { |
| 23333 | return x ? 1 : 0; |
| 23334 | } |
| 23335 | int main(int argc, char **argv) |
| 23336 | { |
| 23337 | return func(0); |
| 23338 | } |
| 23339 | EOCP |
| 23340 | set try |
| 23341 | if eval $compile; then |
| 23342 | echo "<stdbool.h> found." >&4 |
| 23343 | val="$define" |
| 23344 | else |
| 23345 | echo "<stdbool.h> NOT found." >&4 |
| 23346 | val="$undef" |
| 23347 | fi |
| 23348 | $rm_try |
| 23349 | set i_stdbool |
| 23350 | eval $setvar |
| 23351 | |
| 23352 | : see if stdint is available |
| 23353 | set stdint.h i_stdint |
| 23354 | eval $inhdr |
| 23355 | |
| 23356 | : see if sys/access.h is available |
| 23357 | set sys/access.h i_sysaccess |
| 23358 | eval $inhdr |
| 23359 | |
| 23360 | : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl |
| 23361 | set sys/filio.h i_sysfilio |
| 23362 | eval $inhdr |
| 23363 | echo " " |
| 23364 | if $test `./findhdr sys/ioctl.h`; then |
| 23365 | val="$define" |
| 23366 | echo '<sys/ioctl.h> found.' >&4 |
| 23367 | else |
| 23368 | val="$undef" |
| 23369 | if $test $i_sysfilio = "$define"; then |
| 23370 | echo '<sys/ioctl.h> NOT found.' >&4 |
| 23371 | else |
| 23372 | $test $i_sgtty = "$define" && xxx="sgtty.h" |
| 23373 | $test $i_termio = "$define" && xxx="termio.h" |
| 23374 | $test $i_termios = "$define" && xxx="termios.h" |
| 23375 | echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4 |
| 23376 | fi |
| 23377 | fi |
| 23378 | set i_sysioctl |
| 23379 | eval $setvar |
| 23380 | |
| 23381 | : see if socket ioctl defs are in sys/sockio.h |
| 23382 | echo " " |
| 23383 | xxx=`./findhdr sys/sockio.h` |
| 23384 | if $test "$xxx"; then |
| 23385 | if $contains SIOCATMARK $xxx >/dev/null 2>&1; then |
| 23386 | val="$define" |
| 23387 | echo "You have socket ioctls defined in <sys/sockio.h>." >&4 |
| 23388 | else |
| 23389 | val="$undef" |
| 23390 | echo "No socket ioctls found in <sys/sockio.h>." >&4 |
| 23391 | fi |
| 23392 | else |
| 23393 | val="$undef" |
| 23394 | $cat <<EOM |
| 23395 | <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>. |
| 23396 | EOM |
| 23397 | fi |
| 23398 | set i_syssockio |
| 23399 | eval $setvar |
| 23400 | |
| 23401 | : see if this is a syslog.h system |
| 23402 | set syslog.h i_syslog |
| 23403 | eval $inhdr |
| 23404 | |
| 23405 | : see if this is a sys/mode.h system |
| 23406 | set sys/mode.h i_sysmode |
| 23407 | eval $inhdr |
| 23408 | |
| 23409 | : see if there is a sys/poll.h file |
| 23410 | set sys/poll.h i_syspoll |
| 23411 | eval $inhdr |
| 23412 | |
| 23413 | : see if sys/resource.h has to be included |
| 23414 | set sys/resource.h i_sysresrc |
| 23415 | eval $inhdr |
| 23416 | |
| 23417 | : see if sys/security.h is available |
| 23418 | set sys/security.h i_syssecrt |
| 23419 | eval $inhdr |
| 23420 | |
| 23421 | : see if this is a sys/statvfs.h system |
| 23422 | set sys/statvfs.h i_sysstatvfs |
| 23423 | eval $inhdr |
| 23424 | |
| 23425 | : see if this is a sys/un.h system |
| 23426 | set sys/un.h i_sysun |
| 23427 | eval $inhdr |
| 23428 | |
| 23429 | : see if this is a sys/utsname.h system |
| 23430 | set sys/utsname.h i_sysutsname |
| 23431 | eval $inhdr |
| 23432 | |
| 23433 | : see if this is a syswait system |
| 23434 | set sys/wait.h i_syswait |
| 23435 | eval $inhdr |
| 23436 | |
| 23437 | : see if this is a ustat.h system |
| 23438 | set ustat.h i_ustat |
| 23439 | eval $inhdr |
| 23440 | |
| 23441 | : see if this is an utime system |
| 23442 | set utime.h i_utime |
| 23443 | eval $inhdr |
| 23444 | |
| 23445 | : see if this is a vfork system |
| 23446 | case "$d_vfork" in |
| 23447 | "$define") |
| 23448 | set vfork.h i_vfork |
| 23449 | eval $inhdr |
| 23450 | ;; |
| 23451 | *) |
| 23452 | i_vfork="$undef" |
| 23453 | ;; |
| 23454 | esac |
| 23455 | |
| 23456 | : see if wchar.h is present |
| 23457 | set wchar.h i_wchar |
| 23458 | eval $inhdr |
| 23459 | |
| 23460 | : Check extensions |
| 23461 | echo " " |
| 23462 | echo "Looking for extensions..." >&4 |
| 23463 | : If we are using the old config.sh, nonxs_extensions and xs_extensions may |
| 23464 | : contain old or inaccurate or duplicate values. |
| 23465 | nonxs_extensions='' |
| 23466 | xs_extensions='' |
| 23467 | : We do not use find because it might not be available. |
| 23468 | : We do not just use MANIFEST because the user may have dropped |
| 23469 | : some additional extensions into the source tree and expect them |
| 23470 | : to be built. |
| 23471 | |
| 23472 | : Function to recursively find available extensions, ignoring DynaLoader |
| 23473 | : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness |
| 23474 | : In 5.10.1 and later, extensions are stored in directories |
| 23475 | : like File-Glob instead of the older File/Glob/. |
| 23476 | find_extensions=' |
| 23477 | for xxx in *; do |
| 23478 | case "$xxx" in |
| 23479 | DynaLoader|dynaload) ;; |
| 23480 | *) |
| 23481 | this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`; |
| 23482 | case "$this_ext" in |
| 23483 | Scalar/List/Utils) this_ext="List/Util" ;; |
| 23484 | PathTools) this_ext="Cwd" ;; |
| 23485 | esac; |
| 23486 | echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp"; |
| 23487 | if $contains " $this_ext " "$tdir/$$.tmp"; then |
| 23488 | echo >&4; |
| 23489 | echo "Duplicate directories detected for extension $xxx" >&4; |
| 23490 | echo "Configure cannot correctly recover from this - shall I abort?" >&4; |
| 23491 | case "$knowitall" in |
| 23492 | "") dflt=y;; |
| 23493 | *) dflt=n;; |
| 23494 | esac; |
| 23495 | . ../UU/myread; |
| 23496 | case "$ans" in |
| 23497 | n*|N*) ;; |
| 23498 | *) echo >&4; |
| 23499 | echo "Ok. Stopping Configure." >&4; |
| 23500 | echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4; |
| 23501 | exit 1;; |
| 23502 | esac; |
| 23503 | echo "Ok. You will need to correct config.sh before running make." >&4; |
| 23504 | fi; |
| 23505 | $ls -1 "$xxx" > "$tdir/$$.tmp"; |
| 23506 | if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then |
| 23507 | xs_extensions="$xs_extensions $this_ext"; |
| 23508 | elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then |
| 23509 | xs_extensions="$xs_extensions $this_ext"; |
| 23510 | elif $test -d "$xxx"; then |
| 23511 | nonxs_extensions="$nonxs_extensions $this_ext"; |
| 23512 | fi; |
| 23513 | $rm -f "$tdir/$$.tmp"; |
| 23514 | ;; |
| 23515 | esac; |
| 23516 | done' |
| 23517 | tdir=`pwd` |
| 23518 | cd "$rsrc/cpan" |
| 23519 | set X |
| 23520 | shift |
| 23521 | eval $find_extensions |
| 23522 | cd "$rsrc/dist" |
| 23523 | set X |
| 23524 | shift |
| 23525 | eval $find_extensions |
| 23526 | cd "$rsrc/ext" |
| 23527 | set X |
| 23528 | shift |
| 23529 | eval $find_extensions |
| 23530 | set X $xs_extensions |
| 23531 | shift |
| 23532 | xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '` |
| 23533 | set X $nonxs_extensions |
| 23534 | shift |
| 23535 | nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '` |
| 23536 | cd "$tdir" |
| 23537 | known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '` |
| 23538 | |
| 23539 | : Now see which are supported on this system. |
| 23540 | avail_ext='' |
| 23541 | for xxx in $xs_extensions ; do |
| 23542 | case "$xxx" in |
| 23543 | Amiga*) |
| 23544 | case "$osname" in |
| 23545 | amigaos) avail_ext="$avail_ext $xxx" ;; |
| 23546 | esac |
| 23547 | ;; |
| 23548 | DB_File|db_file) |
| 23549 | case "$i_db" in |
| 23550 | $define) avail_ext="$avail_ext $xxx" ;; |
| 23551 | esac |
| 23552 | ;; |
| 23553 | GDBM_File|gdbm_fil) |
| 23554 | case "$i_gdbm" in |
| 23555 | $define) avail_ext="$avail_ext $xxx" ;; |
| 23556 | esac |
| 23557 | ;; |
| 23558 | IPC/SysV|ipc/sysv) |
| 23559 | : XXX Do we need a useipcsysv variable here |
| 23560 | case "${d_msg}${d_sem}${d_shm}" in |
| 23561 | *"${define}"*) avail_ext="$avail_ext $xxx" ;; |
| 23562 | esac |
| 23563 | ;; |
| 23564 | NDBM_File|ndbm_fil) |
| 23565 | case "$d_ndbm" in |
| 23566 | $define) |
| 23567 | case "$osname-$use64bitint" in |
| 23568 | hpux-define) |
| 23569 | case "$libs" in |
| 23570 | *-lndbm*) avail_ext="$avail_ext $xxx" ;; |
| 23571 | esac |
| 23572 | ;; |
| 23573 | *) avail_ext="$avail_ext $xxx" ;; |
| 23574 | esac |
| 23575 | ;; |
| 23576 | esac |
| 23577 | ;; |
| 23578 | ODBM_File|odbm_fil) |
| 23579 | case "${i_dbm}${i_rpcsvcdbm}" in |
| 23580 | *"${define}"*) |
| 23581 | case "$d_cplusplus" in |
| 23582 | define) ;; # delete as a function name will not work |
| 23583 | *) case "$osname-$use64bitint" in |
| 23584 | hpux-define) |
| 23585 | case "$libs" in |
| 23586 | *-ldbm*) avail_ext="$avail_ext $xxx" ;; |
| 23587 | esac |
| 23588 | ;; |
| 23589 | *) avail_ext="$avail_ext $xxx" ;; |
| 23590 | esac |
| 23591 | ;; |
| 23592 | esac |
| 23593 | ;; |
| 23594 | esac |
| 23595 | ;; |
| 23596 | Opcode|opcode) |
| 23597 | case "$useopcode" in |
| 23598 | true|define|y) avail_ext="$avail_ext $xxx" ;; |
| 23599 | esac |
| 23600 | ;; |
| 23601 | POSIX|posix) |
| 23602 | case "$useposix" in |
| 23603 | true|define|y) avail_ext="$avail_ext $xxx" ;; |
| 23604 | esac |
| 23605 | ;; |
| 23606 | Socket|socket) |
| 23607 | case "$d_socket" in |
| 23608 | true|$define|y) avail_ext="$avail_ext $xxx" ;; |
| 23609 | esac |
| 23610 | ;; |
| 23611 | I18N/Langinfo|langinfo) |
| 23612 | case "$uselanginfo" in |
| 23613 | true|define|y) avail_ext="$avail_ext $xxx" ;; |
| 23614 | esac |
| 23615 | ;; |
| 23616 | Sys/Syslog|sys/syslog) |
| 23617 | case $osname in |
| 23618 | amigaos) ;; # not really very useful on AmigaOS |
| 23619 | *) |
| 23620 | : XXX syslog requires socket |
| 23621 | case "$d_socket" in |
| 23622 | true|$define|y) avail_ext="$avail_ext $xxx" ;; |
| 23623 | esac |
| 23624 | ;; |
| 23625 | esac |
| 23626 | ;; |
| 23627 | Thread|thread) |
| 23628 | case "$usethreads" in |
| 23629 | true|$define|y) |
| 23630 | case "$use5005threads" in |
| 23631 | $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;; |
| 23632 | esac |
| 23633 | esac |
| 23634 | ;; |
| 23635 | threads|threads/shared) |
| 23636 | # threads and threads::shared are special cases. |
| 23637 | # To stop people from asking "Perl 5.8.0 was supposed |
| 23638 | # to have this new fancy threads implementation but my |
| 23639 | # perl doesn't have it" and from people trying to |
| 23640 | # (re)install the threads module using CPAN.pm and |
| 23641 | # CPAN.pm then offering to reinstall Perl 5.8.0, |
| 23642 | # the threads.pm and threads/shared.pm will always be |
| 23643 | # there, croaking informatively ("you need to rebuild |
| 23644 | # all of Perl with threads, sorry") when threads haven't |
| 23645 | # been compiled in. |
| 23646 | # --jhi |
| 23647 | avail_ext="$avail_ext $xxx" |
| 23648 | ;; |
| 23649 | VMS*) |
| 23650 | ;; |
| 23651 | Win32*) |
| 23652 | case "$osname" in |
| 23653 | cygwin) avail_ext="$avail_ext $xxx" ;; |
| 23654 | esac |
| 23655 | ;; |
| 23656 | XS/APItest|xs/apitest) |
| 23657 | # This is just for testing. Skip it unless we have dynamic loading. |
| 23658 | |
| 23659 | case "$usedl" in |
| 23660 | $define) avail_ext="$avail_ext $xxx" ;; |
| 23661 | esac |
| 23662 | ;; |
| 23663 | XS/Typemap|xs/typemap) |
| 23664 | # This is just for testing. Skip it unless we have dynamic loading. |
| 23665 | case "$usedl" in |
| 23666 | $define) avail_ext="$avail_ext $xxx" ;; |
| 23667 | esac |
| 23668 | ;; |
| 23669 | *) avail_ext="$avail_ext $xxx" |
| 23670 | ;; |
| 23671 | esac |
| 23672 | done |
| 23673 | |
| 23674 | set X $avail_ext |
| 23675 | shift |
| 23676 | avail_ext="$*" |
| 23677 | |
| 23678 | case "$onlyextensions" in |
| 23679 | '') ;; |
| 23680 | *) keepextensions='' |
| 23681 | echo "You have requested that only certain extensions be included..." >&4 |
| 23682 | for i in $onlyextensions; do |
| 23683 | case " $avail_ext " in |
| 23684 | *" $i "*) |
| 23685 | echo "Keeping extension $i." |
| 23686 | keepextensions="$keepextensions $i" |
| 23687 | ;; |
| 23688 | *) echo "Ignoring extension $i." ;; |
| 23689 | esac |
| 23690 | done |
| 23691 | avail_ext="$keepextensions" |
| 23692 | ;; |
| 23693 | esac |
| 23694 | |
| 23695 | case "$noextensions" in |
| 23696 | '') ;; |
| 23697 | *) keepextensions='' |
| 23698 | echo "You have requested that certain extensions be ignored..." >&4 |
| 23699 | for i in $avail_ext; do |
| 23700 | case " $noextensions " in |
| 23701 | *" $i "*) echo "Ignoring extension $i." ;; |
| 23702 | *) echo "Keeping extension $i."; |
| 23703 | keepextensions="$keepextensions $i" |
| 23704 | ;; |
| 23705 | esac |
| 23706 | done |
| 23707 | avail_ext="$keepextensions" |
| 23708 | ;; |
| 23709 | esac |
| 23710 | |
| 23711 | : Now see which nonxs extensions are supported on this system. |
| 23712 | : For now assume all are. |
| 23713 | nonxs_ext='' |
| 23714 | for xxx in $nonxs_extensions ; do |
| 23715 | case "$xxx" in |
| 23716 | VMS*) |
| 23717 | ;; |
| 23718 | *) nonxs_ext="$nonxs_ext $xxx" |
| 23719 | ;; |
| 23720 | esac |
| 23721 | done |
| 23722 | |
| 23723 | set X $nonxs_ext |
| 23724 | shift |
| 23725 | nonxs_ext="$*" |
| 23726 | |
| 23727 | case $usedl in |
| 23728 | $define) |
| 23729 | $cat <<EOM |
| 23730 | A number of extensions are supplied with $package. You may choose to |
| 23731 | compile these extensions for dynamic loading (the default), compile |
| 23732 | them into the $package executable (static loading), or not include |
| 23733 | them at all. Answer "none" to include no extensions. |
| 23734 | Note that DynaLoader is always built and need not be mentioned here. |
| 23735 | |
| 23736 | EOM |
| 23737 | case "$dynamic_ext" in |
| 23738 | '') |
| 23739 | : Exclude those listed in static_ext |
| 23740 | dflt='' |
| 23741 | for xxx in $avail_ext; do |
| 23742 | case " $static_ext " in |
| 23743 | *" $xxx "*) ;; |
| 23744 | *) dflt="$dflt $xxx" ;; |
| 23745 | esac |
| 23746 | done |
| 23747 | set X $dflt |
| 23748 | shift |
| 23749 | dflt="$*" |
| 23750 | ;; |
| 23751 | *) dflt="$dynamic_ext" |
| 23752 | # Perhaps we are reusing an old out-of-date config.sh. |
| 23753 | case "$hint" in |
| 23754 | previous) |
| 23755 | if test X"$dynamic_ext" != X"$avail_ext"; then |
| 23756 | $cat <<EOM |
| 23757 | NOTICE: Your previous config.sh list may be incorrect. |
| 23758 | The extensions now available to you are |
| 23759 | ${avail_ext} |
| 23760 | but the default list from your previous config.sh is |
| 23761 | ${dynamic_ext} |
| 23762 | |
| 23763 | EOM |
| 23764 | fi |
| 23765 | ;; |
| 23766 | esac |
| 23767 | ;; |
| 23768 | esac |
| 23769 | case "$dflt" in |
| 23770 | '') dflt=none;; |
| 23771 | esac |
| 23772 | rp="What extensions do you wish to load dynamically?" |
| 23773 | . ./myread |
| 23774 | case "$ans" in |
| 23775 | none) dynamic_ext=' ' ;; |
| 23776 | *) dynamic_ext="$ans" ;; |
| 23777 | esac |
| 23778 | |
| 23779 | case "$static_ext" in |
| 23780 | '') |
| 23781 | : Exclude those already listed in dynamic linking |
| 23782 | dflt='' |
| 23783 | for xxx in $avail_ext; do |
| 23784 | case " $dynamic_ext " in |
| 23785 | *" $xxx "*) ;; |
| 23786 | *) dflt="$dflt $xxx" ;; |
| 23787 | esac |
| 23788 | done |
| 23789 | set X $dflt |
| 23790 | shift |
| 23791 | dflt="$*" |
| 23792 | ;; |
| 23793 | *) dflt="$static_ext" |
| 23794 | ;; |
| 23795 | esac |
| 23796 | |
| 23797 | case "$dflt" in |
| 23798 | '') dflt=none;; |
| 23799 | esac |
| 23800 | rp="What extensions do you wish to load statically?" |
| 23801 | . ./myread |
| 23802 | case "$ans" in |
| 23803 | none) static_ext=' ' ;; |
| 23804 | *) static_ext="$ans" ;; |
| 23805 | esac |
| 23806 | ;; |
| 23807 | *) |
| 23808 | $cat <<EOM |
| 23809 | A number of extensions are supplied with $package. Answer "none" |
| 23810 | to include no extensions. |
| 23811 | Note that DynaLoader is always built and need not be mentioned here. |
| 23812 | |
| 23813 | EOM |
| 23814 | case "$static_ext" in |
| 23815 | '') dflt="$avail_ext" ;; |
| 23816 | *) dflt="$static_ext" |
| 23817 | # Perhaps we are reusing an old out-of-date config.sh. |
| 23818 | case "$hint" in |
| 23819 | previous) |
| 23820 | if test X"$static_ext" != X"$avail_ext"; then |
| 23821 | $cat <<EOM |
| 23822 | NOTICE: Your previous config.sh list may be incorrect. |
| 23823 | The extensions now available to you are |
| 23824 | ${avail_ext} |
| 23825 | but the default list from your previous config.sh is |
| 23826 | ${static_ext} |
| 23827 | |
| 23828 | EOM |
| 23829 | fi |
| 23830 | ;; |
| 23831 | esac |
| 23832 | ;; |
| 23833 | esac |
| 23834 | : Exclude those that are not xs extensions |
| 23835 | case "$dflt" in |
| 23836 | '') dflt=none;; |
| 23837 | esac |
| 23838 | rp="What extensions do you wish to include?" |
| 23839 | . ./myread |
| 23840 | case "$ans" in |
| 23841 | none) static_ext=' ' ;; |
| 23842 | *) static_ext="$ans" ;; |
| 23843 | esac |
| 23844 | ;; |
| 23845 | esac |
| 23846 | # |
| 23847 | # Encode is a special case. If we are building Encode as a static |
| 23848 | # extension, we need to explicitly list its subextensions as well. |
| 23849 | # For other nested extensions, this is handled automatically by |
| 23850 | # the appropriate Makefile.PL. |
| 23851 | case " $static_ext " in |
| 23852 | *" Encode "*) # Add the subextensions of Encode |
| 23853 | cd "$rsrc/cpan" |
| 23854 | for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do |
| 23855 | static_ext="$static_ext Encode/$xxx" |
| 23856 | known_extensions="$known_extensions Encode/$xxx" |
| 23857 | done |
| 23858 | cd "$tdir" |
| 23859 | ;; |
| 23860 | esac |
| 23861 | |
| 23862 | set X $dynamic_ext $static_ext $nonxs_ext |
| 23863 | shift |
| 23864 | extensions="$*" |
| 23865 | |
| 23866 | # Sanity check: We require an extension suitable for use with |
| 23867 | # AnyDBM_File, as well as Fcntl and IO. (Failure to have these |
| 23868 | # should show up as failures in the test suite, but it's helpful to |
| 23869 | # catch them now.) The 'extensions' list is normally sorted |
| 23870 | # alphabetically, so we need to accept either |
| 23871 | # DB_File ... Fcntl ... IO .... |
| 23872 | # or something like |
| 23873 | # Fcntl ... NDBM_File ... IO .... |
| 23874 | case " $extensions" in |
| 23875 | *"_File "*" Fcntl "*" IO "*) ;; # DB_File |
| 23876 | *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File |
| 23877 | *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File |
| 23878 | *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4 |
| 23879 | echo "WARNING: The Perl you are building will be quite crippled." >& 4 |
| 23880 | ;; |
| 23881 | esac |
| 23882 | |
| 23883 | : Remove libraries needed only for extensions |
| 23884 | : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary. |
| 23885 | : The exception is SunOS 4.x, which needs them. |
| 23886 | case "${osname}X${osvers}" in |
| 23887 | sunos*X4*) |
| 23888 | perllibs="$libs" |
| 23889 | ;; |
| 23890 | *) case "$usedl" in |
| 23891 | $define|true|[yY]*) |
| 23892 | set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` |
| 23893 | shift |
| 23894 | perllibs="$*" |
| 23895 | ;; |
| 23896 | *) perllibs="$libs" |
| 23897 | ;; |
| 23898 | esac |
| 23899 | ;; |
| 23900 | esac |
| 23901 | |
| 23902 | : Remove build directory name from cppstdin so it can be used from |
| 23903 | : either the present location or the final installed location. |
| 23904 | echo " " |
| 23905 | : Get out of the UU directory to get correct path name. |
| 23906 | cd .. |
| 23907 | case "$cppstdin" in |
| 23908 | `pwd`/cppstdin) |
| 23909 | echo "Stripping down cppstdin path name" |
| 23910 | cppstdin=cppstdin |
| 23911 | ;; |
| 23912 | esac |
| 23913 | cd UU |
| 23914 | |
| 23915 | : end of configuration questions |
| 23916 | echo " " |
| 23917 | echo "End of configuration questions." |
| 23918 | echo " " |
| 23919 | |
| 23920 | : back to where it started |
| 23921 | if test -d ../UU; then |
| 23922 | cd .. |
| 23923 | fi |
| 23924 | |
| 23925 | : configuration may be unconditionally patched via a 'config.arch' file |
| 23926 | if $test -f config.arch; then |
| 23927 | echo "I see a config.arch file, loading it." >&4 |
| 23928 | . ./config.arch |
| 23929 | fi |
| 23930 | |
| 23931 | : configuration may be patched via a 'config.over' file |
| 23932 | if $test -f config.over; then |
| 23933 | echo " " |
| 23934 | dflt=y |
| 23935 | rp='I see a config.over file. Do you wish to load it?' |
| 23936 | . UU/myread |
| 23937 | case "$ans" in |
| 23938 | n*) echo "OK, I'll ignore it.";; |
| 23939 | *) . ./config.over |
| 23940 | echo "Configuration override changes have been loaded." |
| 23941 | ;; |
| 23942 | esac |
| 23943 | fi |
| 23944 | |
| 23945 | : in case they want portability, strip down executable paths |
| 23946 | case "$d_portable" in |
| 23947 | "$define") |
| 23948 | echo " " |
| 23949 | echo "Stripping down executable paths..." >&4 |
| 23950 | for file in $loclist $trylist; do |
| 23951 | eval temp=\$$file |
| 23952 | eval $file=`basename $temp` |
| 23953 | done |
| 23954 | ;; |
| 23955 | esac |
| 23956 | |
| 23957 | : create config.sh file |
| 23958 | echo " " |
| 23959 | echo "Creating config.sh..." >&4 |
| 23960 | $spitshell <<EOT >config.sh |
| 23961 | $startsh |
| 23962 | # |
| 23963 | # This file was produced by running the Configure script. It holds all the |
| 23964 | # definitions figured out by Configure. Should you modify one of these values, |
| 23965 | # do not forget to propagate your changes by running "Configure -der". You may |
| 23966 | # instead choose to run each of the .SH files by yourself, or "Configure -S". |
| 23967 | # |
| 23968 | |
| 23969 | # Package name : $package |
| 23970 | # Source directory : $src |
| 23971 | # Configuration time: $cf_time |
| 23972 | # Configured by : $cf_by |
| 23973 | # Target system : $myuname |
| 23974 | |
| 23975 | EOT |
| 23976 | : Add in command line options if available |
| 23977 | $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh |
| 23978 | |
| 23979 | $spitshell <<EOT >>config.sh |
| 23980 | |
| 23981 | Author='$Author' |
| 23982 | Date='$Date' |
| 23983 | Header='$Header' |
| 23984 | Id='$Id' |
| 23985 | Locker='$Locker' |
| 23986 | Log='$Log' |
| 23987 | RCSfile='$RCSfile' |
| 23988 | Revision='$Revision' |
| 23989 | Source='$Source' |
| 23990 | State='$State' |
| 23991 | _a='$_a' |
| 23992 | _exe='$_exe' |
| 23993 | _o='$_o' |
| 23994 | afs='$afs' |
| 23995 | afsroot='$afsroot' |
| 23996 | alignbytes='$alignbytes' |
| 23997 | aphostname='$aphostname' |
| 23998 | api_revision='$api_revision' |
| 23999 | api_subversion='$api_subversion' |
| 24000 | api_version='$api_version' |
| 24001 | api_versionstring='$api_versionstring' |
| 24002 | ar='$ar' |
| 24003 | archlib='$archlib' |
| 24004 | archlibexp='$archlibexp' |
| 24005 | archname64='$archname64' |
| 24006 | archname='$archname' |
| 24007 | archobjs='$archobjs' |
| 24008 | asctime_r_proto='$asctime_r_proto' |
| 24009 | awk='$awk' |
| 24010 | baserev='$baserev' |
| 24011 | bash='$bash' |
| 24012 | bin='$bin' |
| 24013 | bin_ELF='$bin_ELF' |
| 24014 | binexp='$binexp' |
| 24015 | bison='$bison' |
| 24016 | byacc='$byacc' |
| 24017 | byteorder='$byteorder' |
| 24018 | c='$c' |
| 24019 | castflags='$castflags' |
| 24020 | cat='$cat' |
| 24021 | cc='$cc' |
| 24022 | cccdlflags='$cccdlflags' |
| 24023 | ccdlflags='$ccdlflags' |
| 24024 | ccflags='$ccflags' |
| 24025 | ccflags_uselargefiles='$ccflags_uselargefiles' |
| 24026 | ccname='$ccname' |
| 24027 | ccsymbols='$ccsymbols' |
| 24028 | ccversion='$ccversion' |
| 24029 | cf_by='$cf_by' |
| 24030 | cf_email='$cf_email' |
| 24031 | cf_time='$cf_time' |
| 24032 | charbits='$charbits' |
| 24033 | charsize='$charsize' |
| 24034 | chgrp='$chgrp' |
| 24035 | chmod='$chmod' |
| 24036 | chown='$chown' |
| 24037 | clocktype='$clocktype' |
| 24038 | comm='$comm' |
| 24039 | compress='$compress' |
| 24040 | contains='$contains' |
| 24041 | cp='$cp' |
| 24042 | cpio='$cpio' |
| 24043 | cpp='$cpp' |
| 24044 | cpp_stuff='$cpp_stuff' |
| 24045 | cppccsymbols='$cppccsymbols' |
| 24046 | cppflags='$cppflags' |
| 24047 | cpplast='$cpplast' |
| 24048 | cppminus='$cppminus' |
| 24049 | cpprun='$cpprun' |
| 24050 | cppstdin='$cppstdin' |
| 24051 | cppsymbols='$cppsymbols' |
| 24052 | crypt_r_proto='$crypt_r_proto' |
| 24053 | cryptlib='$cryptlib' |
| 24054 | csh='$csh' |
| 24055 | ctermid_r_proto='$ctermid_r_proto' |
| 24056 | ctime_r_proto='$ctime_r_proto' |
| 24057 | d_Gconvert='$d_Gconvert' |
| 24058 | d_PRIEUldbl='$d_PRIEUldbl' |
| 24059 | d_PRIFUldbl='$d_PRIFUldbl' |
| 24060 | d_PRIGUldbl='$d_PRIGUldbl' |
| 24061 | d_PRIXU64='$d_PRIXU64' |
| 24062 | d_PRId64='$d_PRId64' |
| 24063 | d_PRIeldbl='$d_PRIeldbl' |
| 24064 | d_PRIfldbl='$d_PRIfldbl' |
| 24065 | d_PRIgldbl='$d_PRIgldbl' |
| 24066 | d_PRIi64='$d_PRIi64' |
| 24067 | d_PRIo64='$d_PRIo64' |
| 24068 | d_PRIu64='$d_PRIu64' |
| 24069 | d_PRIx64='$d_PRIx64' |
| 24070 | d_SCNfldbl='$d_SCNfldbl' |
| 24071 | d__fwalk='$d__fwalk' |
| 24072 | d_accept4='$d_accept4' |
| 24073 | d_access='$d_access' |
| 24074 | d_accessx='$d_accessx' |
| 24075 | d_acosh='$d_acosh' |
| 24076 | d_aintl='$d_aintl' |
| 24077 | d_alarm='$d_alarm' |
| 24078 | d_archlib='$d_archlib' |
| 24079 | d_asctime64='$d_asctime64' |
| 24080 | d_asctime_r='$d_asctime_r' |
| 24081 | d_asinh='$d_asinh' |
| 24082 | d_atanh='$d_atanh' |
| 24083 | d_atolf='$d_atolf' |
| 24084 | d_atoll='$d_atoll' |
| 24085 | d_attribute_always_inline='$d_attribute_always_inline' |
| 24086 | d_attribute_deprecated='$d_attribute_deprecated' |
| 24087 | d_attribute_format='$d_attribute_format' |
| 24088 | d_attribute_malloc='$d_attribute_malloc' |
| 24089 | d_attribute_nonnull='$d_attribute_nonnull' |
| 24090 | d_attribute_noreturn='$d_attribute_noreturn' |
| 24091 | d_attribute_pure='$d_attribute_pure' |
| 24092 | d_attribute_unused='$d_attribute_unused' |
| 24093 | d_attribute_warn_unused_result='$d_attribute_warn_unused_result' |
| 24094 | d_backtrace='$d_backtrace' |
| 24095 | d_bsd='$d_bsd' |
| 24096 | d_bsdgetpgrp='$d_bsdgetpgrp' |
| 24097 | d_bsdsetpgrp='$d_bsdsetpgrp' |
| 24098 | d_builtin_add_overflow='$d_builtin_add_overflow' |
| 24099 | d_builtin_choose_expr='$d_builtin_choose_expr' |
| 24100 | d_builtin_expect='$d_builtin_expect' |
| 24101 | d_builtin_mul_overflow='$d_builtin_mul_overflow' |
| 24102 | d_builtin_sub_overflow='$d_builtin_sub_overflow' |
| 24103 | d_c99_variadic_macros='$d_c99_variadic_macros' |
| 24104 | d_casti32='$d_casti32' |
| 24105 | d_castneg='$d_castneg' |
| 24106 | d_cbrt='$d_cbrt' |
| 24107 | d_chown='$d_chown' |
| 24108 | d_chroot='$d_chroot' |
| 24109 | d_chsize='$d_chsize' |
| 24110 | d_class='$d_class' |
| 24111 | d_clearenv='$d_clearenv' |
| 24112 | d_closedir='$d_closedir' |
| 24113 | d_cmsghdr_s='$d_cmsghdr_s' |
| 24114 | d_copysign='$d_copysign' |
| 24115 | d_copysignl='$d_copysignl' |
| 24116 | d_cplusplus='$d_cplusplus' |
| 24117 | d_crypt='$d_crypt' |
| 24118 | d_crypt_r='$d_crypt_r' |
| 24119 | d_csh='$d_csh' |
| 24120 | d_ctermid='$d_ctermid' |
| 24121 | d_ctermid_r='$d_ctermid_r' |
| 24122 | d_ctime64='$d_ctime64' |
| 24123 | d_ctime_r='$d_ctime_r' |
| 24124 | d_cuserid='$d_cuserid' |
| 24125 | d_dbminitproto='$d_dbminitproto' |
| 24126 | d_difftime64='$d_difftime64' |
| 24127 | d_difftime='$d_difftime' |
| 24128 | d_dir_dd_fd='$d_dir_dd_fd' |
| 24129 | d_dirfd='$d_dirfd' |
| 24130 | d_dirnamlen='$d_dirnamlen' |
| 24131 | d_dladdr='$d_dladdr' |
| 24132 | d_dlerror='$d_dlerror' |
| 24133 | d_dlopen='$d_dlopen' |
| 24134 | d_dlsymun='$d_dlsymun' |
| 24135 | d_dosuid='$d_dosuid' |
| 24136 | d_double_has_inf='$d_double_has_inf' |
| 24137 | d_double_has_nan='$d_double_has_nan' |
| 24138 | d_double_has_negative_zero='$d_double_has_negative_zero' |
| 24139 | d_double_has_subnormals='$d_double_has_subnormals' |
| 24140 | d_double_style_cray='$d_double_style_cray' |
| 24141 | d_double_style_ibm='$d_double_style_ibm' |
| 24142 | d_double_style_ieee='$d_double_style_ieee' |
| 24143 | d_double_style_vax='$d_double_style_vax' |
| 24144 | d_drand48_r='$d_drand48_r' |
| 24145 | d_drand48proto='$d_drand48proto' |
| 24146 | d_dup2='$d_dup2' |
| 24147 | d_dup3='$d_dup3' |
| 24148 | d_duplocale='$d_duplocale' |
| 24149 | d_eaccess='$d_eaccess' |
| 24150 | d_endgrent='$d_endgrent' |
| 24151 | d_endgrent_r='$d_endgrent_r' |
| 24152 | d_endhent='$d_endhent' |
| 24153 | d_endhostent_r='$d_endhostent_r' |
| 24154 | d_endnent='$d_endnent' |
| 24155 | d_endnetent_r='$d_endnetent_r' |
| 24156 | d_endpent='$d_endpent' |
| 24157 | d_endprotoent_r='$d_endprotoent_r' |
| 24158 | d_endpwent='$d_endpwent' |
| 24159 | d_endpwent_r='$d_endpwent_r' |
| 24160 | d_endsent='$d_endsent' |
| 24161 | d_endservent_r='$d_endservent_r' |
| 24162 | d_eofnblk='$d_eofnblk' |
| 24163 | d_erf='$d_erf' |
| 24164 | d_erfc='$d_erfc' |
| 24165 | d_eunice='$d_eunice' |
| 24166 | d_exp2='$d_exp2' |
| 24167 | d_expm1='$d_expm1' |
| 24168 | d_faststdio='$d_faststdio' |
| 24169 | d_fchdir='$d_fchdir' |
| 24170 | d_fchmod='$d_fchmod' |
| 24171 | d_fchmodat='$d_fchmodat' |
| 24172 | d_fchown='$d_fchown' |
| 24173 | d_fcntl='$d_fcntl' |
| 24174 | d_fcntl_can_lock='$d_fcntl_can_lock' |
| 24175 | d_fd_macros='$d_fd_macros' |
| 24176 | d_fd_set='$d_fd_set' |
| 24177 | d_fdclose='$d_fdclose' |
| 24178 | d_fdim='$d_fdim' |
| 24179 | d_fds_bits='$d_fds_bits' |
| 24180 | d_fegetround='$d_fegetround' |
| 24181 | d_fgetpos='$d_fgetpos' |
| 24182 | d_finite='$d_finite' |
| 24183 | d_finitel='$d_finitel' |
| 24184 | d_flexfnam='$d_flexfnam' |
| 24185 | d_flock='$d_flock' |
| 24186 | d_flockproto='$d_flockproto' |
| 24187 | d_fma='$d_fma' |
| 24188 | d_fmax='$d_fmax' |
| 24189 | d_fmin='$d_fmin' |
| 24190 | d_fork='$d_fork' |
| 24191 | d_fp_class='$d_fp_class' |
| 24192 | d_fp_classify='$d_fp_classify' |
| 24193 | d_fp_classl='$d_fp_classl' |
| 24194 | d_fpathconf='$d_fpathconf' |
| 24195 | d_fpclass='$d_fpclass' |
| 24196 | d_fpclassify='$d_fpclassify' |
| 24197 | d_fpclassl='$d_fpclassl' |
| 24198 | d_fpgetround='$d_fpgetround' |
| 24199 | d_fpos64_t='$d_fpos64_t' |
| 24200 | d_freelocale='$d_freelocale' |
| 24201 | d_frexpl='$d_frexpl' |
| 24202 | d_fs_data_s='$d_fs_data_s' |
| 24203 | d_fseeko='$d_fseeko' |
| 24204 | d_fsetpos='$d_fsetpos' |
| 24205 | d_fstatfs='$d_fstatfs' |
| 24206 | d_fstatvfs='$d_fstatvfs' |
| 24207 | d_fsync='$d_fsync' |
| 24208 | d_ftello='$d_ftello' |
| 24209 | d_ftime='$d_ftime' |
| 24210 | d_futimes='$d_futimes' |
| 24211 | d_gai_strerror='$d_gai_strerror' |
| 24212 | d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes' |
| 24213 | d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes' |
| 24214 | d_getaddrinfo='$d_getaddrinfo' |
| 24215 | d_getcwd='$d_getcwd' |
| 24216 | d_getespwnam='$d_getespwnam' |
| 24217 | d_getfsstat='$d_getfsstat' |
| 24218 | d_getgrent='$d_getgrent' |
| 24219 | d_getgrent_r='$d_getgrent_r' |
| 24220 | d_getgrgid_r='$d_getgrgid_r' |
| 24221 | d_getgrnam_r='$d_getgrnam_r' |
| 24222 | d_getgrps='$d_getgrps' |
| 24223 | d_gethbyaddr='$d_gethbyaddr' |
| 24224 | d_gethbyname='$d_gethbyname' |
| 24225 | d_gethent='$d_gethent' |
| 24226 | d_gethname='$d_gethname' |
| 24227 | d_gethostbyaddr_r='$d_gethostbyaddr_r' |
| 24228 | d_gethostbyname_r='$d_gethostbyname_r' |
| 24229 | d_gethostent_r='$d_gethostent_r' |
| 24230 | d_gethostprotos='$d_gethostprotos' |
| 24231 | d_getitimer='$d_getitimer' |
| 24232 | d_getlogin='$d_getlogin' |
| 24233 | d_getlogin_r='$d_getlogin_r' |
| 24234 | d_getmnt='$d_getmnt' |
| 24235 | d_getmntent='$d_getmntent' |
| 24236 | d_getnameinfo='$d_getnameinfo' |
| 24237 | d_getnbyaddr='$d_getnbyaddr' |
| 24238 | d_getnbyname='$d_getnbyname' |
| 24239 | d_getnent='$d_getnent' |
| 24240 | d_getnetbyaddr_r='$d_getnetbyaddr_r' |
| 24241 | d_getnetbyname_r='$d_getnetbyname_r' |
| 24242 | d_getnetent_r='$d_getnetent_r' |
| 24243 | d_getnetprotos='$d_getnetprotos' |
| 24244 | d_getpagsz='$d_getpagsz' |
| 24245 | d_getpbyname='$d_getpbyname' |
| 24246 | d_getpbynumber='$d_getpbynumber' |
| 24247 | d_getpent='$d_getpent' |
| 24248 | d_getpgid='$d_getpgid' |
| 24249 | d_getpgrp2='$d_getpgrp2' |
| 24250 | d_getpgrp='$d_getpgrp' |
| 24251 | d_getppid='$d_getppid' |
| 24252 | d_getprior='$d_getprior' |
| 24253 | d_getprotobyname_r='$d_getprotobyname_r' |
| 24254 | d_getprotobynumber_r='$d_getprotobynumber_r' |
| 24255 | d_getprotoent_r='$d_getprotoent_r' |
| 24256 | d_getprotoprotos='$d_getprotoprotos' |
| 24257 | d_getprpwnam='$d_getprpwnam' |
| 24258 | d_getpwent='$d_getpwent' |
| 24259 | d_getpwent_r='$d_getpwent_r' |
| 24260 | d_getpwnam_r='$d_getpwnam_r' |
| 24261 | d_getpwuid_r='$d_getpwuid_r' |
| 24262 | d_getsbyname='$d_getsbyname' |
| 24263 | d_getsbyport='$d_getsbyport' |
| 24264 | d_getsent='$d_getsent' |
| 24265 | d_getservbyname_r='$d_getservbyname_r' |
| 24266 | d_getservbyport_r='$d_getservbyport_r' |
| 24267 | d_getservent_r='$d_getservent_r' |
| 24268 | d_getservprotos='$d_getservprotos' |
| 24269 | d_getspnam='$d_getspnam' |
| 24270 | d_getspnam_r='$d_getspnam_r' |
| 24271 | d_gettimeod='$d_gettimeod' |
| 24272 | d_gmtime64='$d_gmtime64' |
| 24273 | d_gmtime_r='$d_gmtime_r' |
| 24274 | d_gnulibc='$d_gnulibc' |
| 24275 | d_grpasswd='$d_grpasswd' |
| 24276 | d_has_C_UTF8='$d_has_C_UTF8' |
| 24277 | d_hasmntopt='$d_hasmntopt' |
| 24278 | d_htonl='$d_htonl' |
| 24279 | d_hypot='$d_hypot' |
| 24280 | d_ilogb='$d_ilogb' |
| 24281 | d_ilogbl='$d_ilogbl' |
| 24282 | d_inc_version_list='$d_inc_version_list' |
| 24283 | d_inetaton='$d_inetaton' |
| 24284 | d_inetntop='$d_inetntop' |
| 24285 | d_inetpton='$d_inetpton' |
| 24286 | d_int64_t='$d_int64_t' |
| 24287 | d_ip_mreq='$d_ip_mreq' |
| 24288 | d_ip_mreq_source='$d_ip_mreq_source' |
| 24289 | d_ipv6_mreq='$d_ipv6_mreq' |
| 24290 | d_ipv6_mreq_source='$d_ipv6_mreq_source' |
| 24291 | d_isascii='$d_isascii' |
| 24292 | d_isblank='$d_isblank' |
| 24293 | d_isfinite='$d_isfinite' |
| 24294 | d_isfinitel='$d_isfinitel' |
| 24295 | d_isinf='$d_isinf' |
| 24296 | d_isinfl='$d_isinfl' |
| 24297 | d_isless='$d_isless' |
| 24298 | d_isnan='$d_isnan' |
| 24299 | d_isnanl='$d_isnanl' |
| 24300 | d_isnormal='$d_isnormal' |
| 24301 | d_j0='$d_j0' |
| 24302 | d_j0l='$d_j0l' |
| 24303 | d_killpg='$d_killpg' |
| 24304 | d_lc_monetary_2008='$d_lc_monetary_2008' |
| 24305 | d_lchown='$d_lchown' |
| 24306 | d_ldbl_dig='$d_ldbl_dig' |
| 24307 | d_ldexpl='$d_ldexpl' |
| 24308 | d_lgamma='$d_lgamma' |
| 24309 | d_lgamma_r='$d_lgamma_r' |
| 24310 | d_libm_lib_version='$d_libm_lib_version' |
| 24311 | d_libname_unique='$d_libname_unique' |
| 24312 | d_link='$d_link' |
| 24313 | d_linkat='$d_linkat' |
| 24314 | d_llrint='$d_llrint' |
| 24315 | d_llrintl='$d_llrintl' |
| 24316 | d_llround='$d_llround' |
| 24317 | d_llroundl='$d_llroundl' |
| 24318 | d_localeconv_l='$d_localeconv_l' |
| 24319 | d_localtime64='$d_localtime64' |
| 24320 | d_localtime_r='$d_localtime_r' |
| 24321 | d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset' |
| 24322 | d_locconv='$d_locconv' |
| 24323 | d_lockf='$d_lockf' |
| 24324 | d_log1p='$d_log1p' |
| 24325 | d_log2='$d_log2' |
| 24326 | d_logb='$d_logb' |
| 24327 | d_long_double_style_ieee='$d_long_double_style_ieee' |
| 24328 | d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble' |
| 24329 | d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended' |
| 24330 | d_long_double_style_ieee_std='$d_long_double_style_ieee_std' |
| 24331 | d_long_double_style_vax='$d_long_double_style_vax' |
| 24332 | d_longdbl='$d_longdbl' |
| 24333 | d_longlong='$d_longlong' |
| 24334 | d_lrint='$d_lrint' |
| 24335 | d_lrintl='$d_lrintl' |
| 24336 | d_lround='$d_lround' |
| 24337 | d_lroundl='$d_lroundl' |
| 24338 | d_lseekproto='$d_lseekproto' |
| 24339 | d_lstat='$d_lstat' |
| 24340 | d_madvise='$d_madvise' |
| 24341 | d_malloc_good_size='$d_malloc_good_size' |
| 24342 | d_malloc_size='$d_malloc_size' |
| 24343 | d_malloc_usable_size='$d_malloc_usable_size' |
| 24344 | d_mblen='$d_mblen' |
| 24345 | d_mbrlen='$d_mbrlen' |
| 24346 | d_mbrtowc='$d_mbrtowc' |
| 24347 | d_mbstowcs='$d_mbstowcs' |
| 24348 | d_mbtowc='$d_mbtowc' |
| 24349 | d_memmem='$d_memmem' |
| 24350 | d_memrchr='$d_memrchr' |
| 24351 | d_mkdir='$d_mkdir' |
| 24352 | d_mkdtemp='$d_mkdtemp' |
| 24353 | d_mkfifo='$d_mkfifo' |
| 24354 | d_mkostemp='$d_mkostemp' |
| 24355 | d_mkstemp='$d_mkstemp' |
| 24356 | d_mkstemps='$d_mkstemps' |
| 24357 | d_mktime64='$d_mktime64' |
| 24358 | d_mktime='$d_mktime' |
| 24359 | d_mmap='$d_mmap' |
| 24360 | d_modfl='$d_modfl' |
| 24361 | d_modflproto='$d_modflproto' |
| 24362 | d_mprotect='$d_mprotect' |
| 24363 | d_msg='$d_msg' |
| 24364 | d_msg_ctrunc='$d_msg_ctrunc' |
| 24365 | d_msg_dontroute='$d_msg_dontroute' |
| 24366 | d_msg_oob='$d_msg_oob' |
| 24367 | d_msg_peek='$d_msg_peek' |
| 24368 | d_msg_proxy='$d_msg_proxy' |
| 24369 | d_msgctl='$d_msgctl' |
| 24370 | d_msgget='$d_msgget' |
| 24371 | d_msghdr_s='$d_msghdr_s' |
| 24372 | d_msgrcv='$d_msgrcv' |
| 24373 | d_msgsnd='$d_msgsnd' |
| 24374 | d_msync='$d_msync' |
| 24375 | d_munmap='$d_munmap' |
| 24376 | d_mymalloc='$d_mymalloc' |
| 24377 | d_nan='$d_nan' |
| 24378 | d_nanosleep='$d_nanosleep' |
| 24379 | d_ndbm='$d_ndbm' |
| 24380 | d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes' |
| 24381 | d_nearbyint='$d_nearbyint' |
| 24382 | d_newlocale='$d_newlocale' |
| 24383 | d_nextafter='$d_nextafter' |
| 24384 | d_nexttoward='$d_nexttoward' |
| 24385 | d_nice='$d_nice' |
| 24386 | d_nl_langinfo='$d_nl_langinfo' |
| 24387 | d_nv_preserves_uv='$d_nv_preserves_uv' |
| 24388 | d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero' |
| 24389 | d_off64_t='$d_off64_t' |
| 24390 | d_old_pthread_create_joinable='$d_old_pthread_create_joinable' |
| 24391 | d_oldpthreads='$d_oldpthreads' |
| 24392 | d_oldsock='$d_oldsock' |
| 24393 | d_open3='$d_open3' |
| 24394 | d_openat='$d_openat' |
| 24395 | d_pathconf='$d_pathconf' |
| 24396 | d_pause='$d_pause' |
| 24397 | d_perl_otherlibdirs='$d_perl_otherlibdirs' |
| 24398 | d_phostname='$d_phostname' |
| 24399 | d_pipe2='$d_pipe2' |
| 24400 | d_pipe='$d_pipe' |
| 24401 | d_poll='$d_poll' |
| 24402 | d_portable='$d_portable' |
| 24403 | d_prctl='$d_prctl' |
| 24404 | d_prctl_set_name='$d_prctl_set_name' |
| 24405 | d_printf_format_null='$d_printf_format_null' |
| 24406 | d_procselfexe='$d_procselfexe' |
| 24407 | d_pseudofork='$d_pseudofork' |
| 24408 | d_pthread_atfork='$d_pthread_atfork' |
| 24409 | d_pthread_attr_setscope='$d_pthread_attr_setscope' |
| 24410 | d_pthread_yield='$d_pthread_yield' |
| 24411 | d_ptrdiff_t='$d_ptrdiff_t' |
| 24412 | d_pwage='$d_pwage' |
| 24413 | d_pwchange='$d_pwchange' |
| 24414 | d_pwclass='$d_pwclass' |
| 24415 | d_pwcomment='$d_pwcomment' |
| 24416 | d_pwexpire='$d_pwexpire' |
| 24417 | d_pwgecos='$d_pwgecos' |
| 24418 | d_pwpasswd='$d_pwpasswd' |
| 24419 | d_pwquota='$d_pwquota' |
| 24420 | d_qgcvt='$d_qgcvt' |
| 24421 | d_quad='$d_quad' |
| 24422 | d_querylocale='$d_querylocale' |
| 24423 | d_random_r='$d_random_r' |
| 24424 | d_re_comp='$d_re_comp' |
| 24425 | d_readdir64_r='$d_readdir64_r' |
| 24426 | d_readdir='$d_readdir' |
| 24427 | d_readdir_r='$d_readdir_r' |
| 24428 | d_readlink='$d_readlink' |
| 24429 | d_readv='$d_readv' |
| 24430 | d_recvmsg='$d_recvmsg' |
| 24431 | d_regcmp='$d_regcmp' |
| 24432 | d_regcomp='$d_regcomp' |
| 24433 | d_remainder='$d_remainder' |
| 24434 | d_remquo='$d_remquo' |
| 24435 | d_rename='$d_rename' |
| 24436 | d_renameat='$d_renameat' |
| 24437 | d_rewinddir='$d_rewinddir' |
| 24438 | d_rint='$d_rint' |
| 24439 | d_rmdir='$d_rmdir' |
| 24440 | d_round='$d_round' |
| 24441 | d_sbrkproto='$d_sbrkproto' |
| 24442 | d_scalbn='$d_scalbn' |
| 24443 | d_scalbnl='$d_scalbnl' |
| 24444 | d_sched_yield='$d_sched_yield' |
| 24445 | d_scm_rights='$d_scm_rights' |
| 24446 | d_seekdir='$d_seekdir' |
| 24447 | d_select='$d_select' |
| 24448 | d_sem='$d_sem' |
| 24449 | d_semctl='$d_semctl' |
| 24450 | d_semctl_semid_ds='$d_semctl_semid_ds' |
| 24451 | d_semctl_semun='$d_semctl_semun' |
| 24452 | d_semget='$d_semget' |
| 24453 | d_semop='$d_semop' |
| 24454 | d_sendmsg='$d_sendmsg' |
| 24455 | d_setegid='$d_setegid' |
| 24456 | d_seteuid='$d_seteuid' |
| 24457 | d_setgrent='$d_setgrent' |
| 24458 | d_setgrent_r='$d_setgrent_r' |
| 24459 | d_setgrps='$d_setgrps' |
| 24460 | d_sethent='$d_sethent' |
| 24461 | d_sethostent_r='$d_sethostent_r' |
| 24462 | d_setitimer='$d_setitimer' |
| 24463 | d_setlinebuf='$d_setlinebuf' |
| 24464 | d_setlocale='$d_setlocale' |
| 24465 | d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name' |
| 24466 | d_setlocale_r='$d_setlocale_r' |
| 24467 | d_setnent='$d_setnent' |
| 24468 | d_setnetent_r='$d_setnetent_r' |
| 24469 | d_setpent='$d_setpent' |
| 24470 | d_setpgid='$d_setpgid' |
| 24471 | d_setpgrp2='$d_setpgrp2' |
| 24472 | d_setpgrp='$d_setpgrp' |
| 24473 | d_setprior='$d_setprior' |
| 24474 | d_setproctitle='$d_setproctitle' |
| 24475 | d_setprotoent_r='$d_setprotoent_r' |
| 24476 | d_setpwent='$d_setpwent' |
| 24477 | d_setpwent_r='$d_setpwent_r' |
| 24478 | d_setregid='$d_setregid' |
| 24479 | d_setresgid='$d_setresgid' |
| 24480 | d_setresuid='$d_setresuid' |
| 24481 | d_setreuid='$d_setreuid' |
| 24482 | d_setrgid='$d_setrgid' |
| 24483 | d_setruid='$d_setruid' |
| 24484 | d_setsent='$d_setsent' |
| 24485 | d_setservent_r='$d_setservent_r' |
| 24486 | d_setsid='$d_setsid' |
| 24487 | d_setvbuf='$d_setvbuf' |
| 24488 | d_shm='$d_shm' |
| 24489 | d_shmat='$d_shmat' |
| 24490 | d_shmatprototype='$d_shmatprototype' |
| 24491 | d_shmctl='$d_shmctl' |
| 24492 | d_shmdt='$d_shmdt' |
| 24493 | d_shmget='$d_shmget' |
| 24494 | d_sigaction='$d_sigaction' |
| 24495 | d_siginfo_si_addr='$d_siginfo_si_addr' |
| 24496 | d_siginfo_si_band='$d_siginfo_si_band' |
| 24497 | d_siginfo_si_errno='$d_siginfo_si_errno' |
| 24498 | d_siginfo_si_fd='$d_siginfo_si_fd' |
| 24499 | d_siginfo_si_pid='$d_siginfo_si_pid' |
| 24500 | d_siginfo_si_status='$d_siginfo_si_status' |
| 24501 | d_siginfo_si_uid='$d_siginfo_si_uid' |
| 24502 | d_siginfo_si_value='$d_siginfo_si_value' |
| 24503 | d_signbit='$d_signbit' |
| 24504 | d_sigprocmask='$d_sigprocmask' |
| 24505 | d_sigsetjmp='$d_sigsetjmp' |
| 24506 | d_sin6_scope_id='$d_sin6_scope_id' |
| 24507 | d_sitearch='$d_sitearch' |
| 24508 | d_snprintf='$d_snprintf' |
| 24509 | d_sockaddr_in6='$d_sockaddr_in6' |
| 24510 | d_sockaddr_sa_len='$d_sockaddr_sa_len' |
| 24511 | d_sockatmark='$d_sockatmark' |
| 24512 | d_sockatmarkproto='$d_sockatmarkproto' |
| 24513 | d_socket='$d_socket' |
| 24514 | d_socklen_t='$d_socklen_t' |
| 24515 | d_sockpair='$d_sockpair' |
| 24516 | d_socks5_init='$d_socks5_init' |
| 24517 | d_sqrtl='$d_sqrtl' |
| 24518 | d_srand48_r='$d_srand48_r' |
| 24519 | d_srandom_r='$d_srandom_r' |
| 24520 | d_sresgproto='$d_sresgproto' |
| 24521 | d_sresuproto='$d_sresuproto' |
| 24522 | d_stat='$d_stat' |
| 24523 | d_statblks='$d_statblks' |
| 24524 | d_statfs_f_flags='$d_statfs_f_flags' |
| 24525 | d_statfs_s='$d_statfs_s' |
| 24526 | d_static_inline='$d_static_inline' |
| 24527 | d_statvfs='$d_statvfs' |
| 24528 | d_stdio_cnt_lval='$d_stdio_cnt_lval' |
| 24529 | d_stdio_ptr_lval='$d_stdio_ptr_lval' |
| 24530 | d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt' |
| 24531 | d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt' |
| 24532 | d_stdio_stream_array='$d_stdio_stream_array' |
| 24533 | d_stdiobase='$d_stdiobase' |
| 24534 | d_stdstdio='$d_stdstdio' |
| 24535 | d_strcoll='$d_strcoll' |
| 24536 | d_strerror_l='$d_strerror_l' |
| 24537 | d_strerror_r='$d_strerror_r' |
| 24538 | d_strftime='$d_strftime' |
| 24539 | d_strlcat='$d_strlcat' |
| 24540 | d_strlcpy='$d_strlcpy' |
| 24541 | d_strnlen='$d_strnlen' |
| 24542 | d_strtod='$d_strtod' |
| 24543 | d_strtod_l='$d_strtod_l' |
| 24544 | d_strtol='$d_strtol' |
| 24545 | d_strtold='$d_strtold' |
| 24546 | d_strtold_l='$d_strtold_l' |
| 24547 | d_strtoll='$d_strtoll' |
| 24548 | d_strtoq='$d_strtoq' |
| 24549 | d_strtoul='$d_strtoul' |
| 24550 | d_strtoull='$d_strtoull' |
| 24551 | d_strtouq='$d_strtouq' |
| 24552 | d_strxfrm='$d_strxfrm' |
| 24553 | d_suidsafe='$d_suidsafe' |
| 24554 | d_symlink='$d_symlink' |
| 24555 | d_syscall='$d_syscall' |
| 24556 | d_syscallproto='$d_syscallproto' |
| 24557 | d_sysconf='$d_sysconf' |
| 24558 | d_sysernlst='$d_sysernlst' |
| 24559 | d_syserrlst='$d_syserrlst' |
| 24560 | d_system='$d_system' |
| 24561 | d_tcgetpgrp='$d_tcgetpgrp' |
| 24562 | d_tcsetpgrp='$d_tcsetpgrp' |
| 24563 | d_telldir='$d_telldir' |
| 24564 | d_telldirproto='$d_telldirproto' |
| 24565 | d_tgamma='$d_tgamma' |
| 24566 | d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l' |
| 24567 | d_time='$d_time' |
| 24568 | d_timegm='$d_timegm' |
| 24569 | d_times='$d_times' |
| 24570 | d_tm_tm_gmtoff='$d_tm_tm_gmtoff' |
| 24571 | d_tm_tm_zone='$d_tm_tm_zone' |
| 24572 | d_tmpnam_r='$d_tmpnam_r' |
| 24573 | d_towlower='$d_towlower' |
| 24574 | d_towupper='$d_towupper' |
| 24575 | d_trunc='$d_trunc' |
| 24576 | d_truncate='$d_truncate' |
| 24577 | d_truncl='$d_truncl' |
| 24578 | d_ttyname_r='$d_ttyname_r' |
| 24579 | d_tzname='$d_tzname' |
| 24580 | d_u32align='$d_u32align' |
| 24581 | d_ualarm='$d_ualarm' |
| 24582 | d_umask='$d_umask' |
| 24583 | d_uname='$d_uname' |
| 24584 | d_union_semun='$d_union_semun' |
| 24585 | d_unlinkat='$d_unlinkat' |
| 24586 | d_unordered='$d_unordered' |
| 24587 | d_unsetenv='$d_unsetenv' |
| 24588 | d_uselocale='$d_uselocale' |
| 24589 | d_usleep='$d_usleep' |
| 24590 | d_usleepproto='$d_usleepproto' |
| 24591 | d_ustat='$d_ustat' |
| 24592 | d_vendorarch='$d_vendorarch' |
| 24593 | d_vendorbin='$d_vendorbin' |
| 24594 | d_vendorlib='$d_vendorlib' |
| 24595 | d_vendorscript='$d_vendorscript' |
| 24596 | d_vfork='$d_vfork' |
| 24597 | d_void_closedir='$d_void_closedir' |
| 24598 | d_voidsig='$d_voidsig' |
| 24599 | d_voidtty='$d_voidtty' |
| 24600 | d_vsnprintf='$d_vsnprintf' |
| 24601 | d_wait4='$d_wait4' |
| 24602 | d_waitpid='$d_waitpid' |
| 24603 | d_wcrtomb='$d_wcrtomb' |
| 24604 | d_wcscmp='$d_wcscmp' |
| 24605 | d_wcstombs='$d_wcstombs' |
| 24606 | d_wcsxfrm='$d_wcsxfrm' |
| 24607 | d_wctomb='$d_wctomb' |
| 24608 | d_writev='$d_writev' |
| 24609 | d_xenix='$d_xenix' |
| 24610 | date='$date' |
| 24611 | db_hashtype='$db_hashtype' |
| 24612 | db_prefixtype='$db_prefixtype' |
| 24613 | db_version_major='$db_version_major' |
| 24614 | db_version_minor='$db_version_minor' |
| 24615 | db_version_patch='$db_version_patch' |
| 24616 | default_inc_excludes_dot='$default_inc_excludes_dot' |
| 24617 | direntrytype='$direntrytype' |
| 24618 | dlext='$dlext' |
| 24619 | dlsrc='$dlsrc' |
| 24620 | doubleinfbytes='$doubleinfbytes' |
| 24621 | doublekind='$doublekind' |
| 24622 | doublemantbits='$doublemantbits' |
| 24623 | doublenanbytes='$doublenanbytes' |
| 24624 | doublesize='$doublesize' |
| 24625 | drand01='$drand01' |
| 24626 | drand48_r_proto='$drand48_r_proto' |
| 24627 | dtrace='$dtrace' |
| 24628 | dtraceobject='$dtraceobject' |
| 24629 | dtracexnolibs='$dtracexnolibs' |
| 24630 | dynamic_ext='$dynamic_ext' |
| 24631 | eagain='$eagain' |
| 24632 | ebcdic='$ebcdic' |
| 24633 | echo='$echo' |
| 24634 | egrep='$egrep' |
| 24635 | emacs='$emacs' |
| 24636 | endgrent_r_proto='$endgrent_r_proto' |
| 24637 | endhostent_r_proto='$endhostent_r_proto' |
| 24638 | endnetent_r_proto='$endnetent_r_proto' |
| 24639 | endprotoent_r_proto='$endprotoent_r_proto' |
| 24640 | endpwent_r_proto='$endpwent_r_proto' |
| 24641 | endservent_r_proto='$endservent_r_proto' |
| 24642 | eunicefix='$eunicefix' |
| 24643 | exe_ext='$exe_ext' |
| 24644 | expr='$expr' |
| 24645 | extensions='$extensions' |
| 24646 | extern_C='$extern_C' |
| 24647 | extras='$extras' |
| 24648 | fflushNULL='$fflushNULL' |
| 24649 | fflushall='$fflushall' |
| 24650 | find='$find' |
| 24651 | firstmakefile='$firstmakefile' |
| 24652 | flex='$flex' |
| 24653 | fpossize='$fpossize' |
| 24654 | fpostype='$fpostype' |
| 24655 | freetype='$freetype' |
| 24656 | from='$from' |
| 24657 | full_ar='$full_ar' |
| 24658 | full_csh='$full_csh' |
| 24659 | full_sed='$full_sed' |
| 24660 | gccansipedantic='$gccansipedantic' |
| 24661 | gccosandvers='$gccosandvers' |
| 24662 | gccversion='$gccversion' |
| 24663 | getgrent_r_proto='$getgrent_r_proto' |
| 24664 | getgrgid_r_proto='$getgrgid_r_proto' |
| 24665 | getgrnam_r_proto='$getgrnam_r_proto' |
| 24666 | gethostbyaddr_r_proto='$gethostbyaddr_r_proto' |
| 24667 | gethostbyname_r_proto='$gethostbyname_r_proto' |
| 24668 | gethostent_r_proto='$gethostent_r_proto' |
| 24669 | getlogin_r_proto='$getlogin_r_proto' |
| 24670 | getnetbyaddr_r_proto='$getnetbyaddr_r_proto' |
| 24671 | getnetbyname_r_proto='$getnetbyname_r_proto' |
| 24672 | getnetent_r_proto='$getnetent_r_proto' |
| 24673 | getprotobyname_r_proto='$getprotobyname_r_proto' |
| 24674 | getprotobynumber_r_proto='$getprotobynumber_r_proto' |
| 24675 | getprotoent_r_proto='$getprotoent_r_proto' |
| 24676 | getpwent_r_proto='$getpwent_r_proto' |
| 24677 | getpwnam_r_proto='$getpwnam_r_proto' |
| 24678 | getpwuid_r_proto='$getpwuid_r_proto' |
| 24679 | getservbyname_r_proto='$getservbyname_r_proto' |
| 24680 | getservbyport_r_proto='$getservbyport_r_proto' |
| 24681 | getservent_r_proto='$getservent_r_proto' |
| 24682 | getspnam_r_proto='$getspnam_r_proto' |
| 24683 | gidformat='$gidformat' |
| 24684 | gidsign='$gidsign' |
| 24685 | gidsize='$gidsize' |
| 24686 | gidtype='$gidtype' |
| 24687 | glibpth='$glibpth' |
| 24688 | gmake='$gmake' |
| 24689 | gmtime_r_proto='$gmtime_r_proto' |
| 24690 | gnulibc_version='$gnulibc_version' |
| 24691 | grep='$grep' |
| 24692 | groupcat='$groupcat' |
| 24693 | groupstype='$groupstype' |
| 24694 | gzip='$gzip' |
| 24695 | h_fcntl='$h_fcntl' |
| 24696 | h_sysfile='$h_sysfile' |
| 24697 | hint='$hint' |
| 24698 | hostcat='$hostcat' |
| 24699 | hostgenerate='$hostgenerate' |
| 24700 | hostosname='$hostosname' |
| 24701 | hostperl='$hostperl' |
| 24702 | html1dir='$html1dir' |
| 24703 | html1direxp='$html1direxp' |
| 24704 | html3dir='$html3dir' |
| 24705 | html3direxp='$html3direxp' |
| 24706 | i16size='$i16size' |
| 24707 | i16type='$i16type' |
| 24708 | i32size='$i32size' |
| 24709 | i32type='$i32type' |
| 24710 | i64size='$i64size' |
| 24711 | i64type='$i64type' |
| 24712 | i8size='$i8size' |
| 24713 | i8type='$i8type' |
| 24714 | i_arpainet='$i_arpainet' |
| 24715 | i_bfd='$i_bfd' |
| 24716 | i_bsdioctl='$i_bsdioctl' |
| 24717 | i_crypt='$i_crypt' |
| 24718 | i_db='$i_db' |
| 24719 | i_dbm='$i_dbm' |
| 24720 | i_dirent='$i_dirent' |
| 24721 | i_dlfcn='$i_dlfcn' |
| 24722 | i_execinfo='$i_execinfo' |
| 24723 | i_fcntl='$i_fcntl' |
| 24724 | i_fenv='$i_fenv' |
| 24725 | i_fp='$i_fp' |
| 24726 | i_fp_class='$i_fp_class' |
| 24727 | i_gdbm='$i_gdbm' |
| 24728 | i_gdbm_ndbm='$i_gdbm_ndbm' |
| 24729 | i_gdbmndbm='$i_gdbmndbm' |
| 24730 | i_grp='$i_grp' |
| 24731 | i_ieeefp='$i_ieeefp' |
| 24732 | i_inttypes='$i_inttypes' |
| 24733 | i_langinfo='$i_langinfo' |
| 24734 | i_libutil='$i_libutil' |
| 24735 | i_locale='$i_locale' |
| 24736 | i_machcthr='$i_machcthr' |
| 24737 | i_malloc='$i_malloc' |
| 24738 | i_mallocmalloc='$i_mallocmalloc' |
| 24739 | i_mntent='$i_mntent' |
| 24740 | i_ndbm='$i_ndbm' |
| 24741 | i_netdb='$i_netdb' |
| 24742 | i_neterrno='$i_neterrno' |
| 24743 | i_netinettcp='$i_netinettcp' |
| 24744 | i_niin='$i_niin' |
| 24745 | i_poll='$i_poll' |
| 24746 | i_prot='$i_prot' |
| 24747 | i_pthread='$i_pthread' |
| 24748 | i_pwd='$i_pwd' |
| 24749 | i_quadmath='$i_quadmath' |
| 24750 | i_rpcsvcdbm='$i_rpcsvcdbm' |
| 24751 | i_sgtty='$i_sgtty' |
| 24752 | i_shadow='$i_shadow' |
| 24753 | i_socks='$i_socks' |
| 24754 | i_stdbool='$i_stdbool' |
| 24755 | i_stdint='$i_stdint' |
| 24756 | i_stdlib='$i_stdlib' |
| 24757 | i_sunmath='$i_sunmath' |
| 24758 | i_sysaccess='$i_sysaccess' |
| 24759 | i_sysdir='$i_sysdir' |
| 24760 | i_sysfile='$i_sysfile' |
| 24761 | i_sysfilio='$i_sysfilio' |
| 24762 | i_sysin='$i_sysin' |
| 24763 | i_sysioctl='$i_sysioctl' |
| 24764 | i_syslog='$i_syslog' |
| 24765 | i_sysmman='$i_sysmman' |
| 24766 | i_sysmode='$i_sysmode' |
| 24767 | i_sysmount='$i_sysmount' |
| 24768 | i_sysndir='$i_sysndir' |
| 24769 | i_sysparam='$i_sysparam' |
| 24770 | i_syspoll='$i_syspoll' |
| 24771 | i_sysresrc='$i_sysresrc' |
| 24772 | i_syssecrt='$i_syssecrt' |
| 24773 | i_sysselct='$i_sysselct' |
| 24774 | i_syssockio='$i_syssockio' |
| 24775 | i_sysstat='$i_sysstat' |
| 24776 | i_sysstatfs='$i_sysstatfs' |
| 24777 | i_sysstatvfs='$i_sysstatvfs' |
| 24778 | i_systime='$i_systime' |
| 24779 | i_systimek='$i_systimek' |
| 24780 | i_systimes='$i_systimes' |
| 24781 | i_systypes='$i_systypes' |
| 24782 | i_sysuio='$i_sysuio' |
| 24783 | i_sysun='$i_sysun' |
| 24784 | i_sysutsname='$i_sysutsname' |
| 24785 | i_sysvfs='$i_sysvfs' |
| 24786 | i_syswait='$i_syswait' |
| 24787 | i_termio='$i_termio' |
| 24788 | i_termios='$i_termios' |
| 24789 | i_time='$i_time' |
| 24790 | i_unistd='$i_unistd' |
| 24791 | i_ustat='$i_ustat' |
| 24792 | i_utime='$i_utime' |
| 24793 | i_vfork='$i_vfork' |
| 24794 | i_wchar='$i_wchar' |
| 24795 | i_wctype='$i_wctype' |
| 24796 | i_xlocale='$i_xlocale' |
| 24797 | ignore_versioned_solibs='$ignore_versioned_solibs' |
| 24798 | inc_version_list='$inc_version_list' |
| 24799 | inc_version_list_init='$inc_version_list_init' |
| 24800 | incpath='$incpath' |
| 24801 | incpth='$incpth' |
| 24802 | inews='$inews' |
| 24803 | initialinstalllocation='$initialinstalllocation' |
| 24804 | installarchlib='$installarchlib' |
| 24805 | installbin='$installbin' |
| 24806 | installhtml1dir='$installhtml1dir' |
| 24807 | installhtml3dir='$installhtml3dir' |
| 24808 | installman1dir='$installman1dir' |
| 24809 | installman3dir='$installman3dir' |
| 24810 | installprefix='$installprefix' |
| 24811 | installprefixexp='$installprefixexp' |
| 24812 | installprivlib='$installprivlib' |
| 24813 | installscript='$installscript' |
| 24814 | installsitearch='$installsitearch' |
| 24815 | installsitebin='$installsitebin' |
| 24816 | installsitehtml1dir='$installsitehtml1dir' |
| 24817 | installsitehtml3dir='$installsitehtml3dir' |
| 24818 | installsitelib='$installsitelib' |
| 24819 | installsiteman1dir='$installsiteman1dir' |
| 24820 | installsiteman3dir='$installsiteman3dir' |
| 24821 | installsitescript='$installsitescript' |
| 24822 | installstyle='$installstyle' |
| 24823 | installusrbinperl='$installusrbinperl' |
| 24824 | installvendorarch='$installvendorarch' |
| 24825 | installvendorbin='$installvendorbin' |
| 24826 | installvendorhtml1dir='$installvendorhtml1dir' |
| 24827 | installvendorhtml3dir='$installvendorhtml3dir' |
| 24828 | installvendorlib='$installvendorlib' |
| 24829 | installvendorman1dir='$installvendorman1dir' |
| 24830 | installvendorman3dir='$installvendorman3dir' |
| 24831 | installvendorscript='$installvendorscript' |
| 24832 | intsize='$intsize' |
| 24833 | issymlink='$issymlink' |
| 24834 | ivdformat='$ivdformat' |
| 24835 | ivsize='$ivsize' |
| 24836 | ivtype='$ivtype' |
| 24837 | known_extensions='$known_extensions' |
| 24838 | ksh='$ksh' |
| 24839 | ld='$ld' |
| 24840 | ld_can_script='$ld_can_script' |
| 24841 | lddlflags='$lddlflags' |
| 24842 | ldflags='$ldflags' |
| 24843 | ldflags_uselargefiles='$ldflags_uselargefiles' |
| 24844 | ldlibpthname='$ldlibpthname' |
| 24845 | less='$less' |
| 24846 | lib_ext='$lib_ext' |
| 24847 | libc='$libc' |
| 24848 | libperl='$libperl' |
| 24849 | libpth='$libpth' |
| 24850 | libs='$libs' |
| 24851 | libsdirs='$libsdirs' |
| 24852 | libsfiles='$libsfiles' |
| 24853 | libsfound='$libsfound' |
| 24854 | libspath='$libspath' |
| 24855 | libswanted='$libswanted' |
| 24856 | libswanted_uselargefiles='$libswanted_uselargefiles' |
| 24857 | line='$line' |
| 24858 | lint='$lint' |
| 24859 | lkflags='$lkflags' |
| 24860 | ln='$ln' |
| 24861 | lns='$lns' |
| 24862 | localtime_r_proto='$localtime_r_proto' |
| 24863 | locincpth='$locincpth' |
| 24864 | loclibpth='$loclibpth' |
| 24865 | longdblinfbytes='$longdblinfbytes' |
| 24866 | longdblkind='$longdblkind' |
| 24867 | longdblmantbits='$longdblmantbits' |
| 24868 | longdblnanbytes='$longdblnanbytes' |
| 24869 | longdblsize='$longdblsize' |
| 24870 | longlongsize='$longlongsize' |
| 24871 | longsize='$longsize' |
| 24872 | lp='$lp' |
| 24873 | lpr='$lpr' |
| 24874 | ls='$ls' |
| 24875 | lseeksize='$lseeksize' |
| 24876 | lseektype='$lseektype' |
| 24877 | mail='$mail' |
| 24878 | mailx='$mailx' |
| 24879 | make='$make' |
| 24880 | make_set_make='$make_set_make' |
| 24881 | mallocobj='$mallocobj' |
| 24882 | mallocsrc='$mallocsrc' |
| 24883 | malloctype='$malloctype' |
| 24884 | man1dir='$man1dir' |
| 24885 | man1direxp='$man1direxp' |
| 24886 | man1ext='$man1ext' |
| 24887 | man3dir='$man3dir' |
| 24888 | man3direxp='$man3direxp' |
| 24889 | man3ext='$man3ext' |
| 24890 | mips_type='$mips_type' |
| 24891 | mistrustnm='$mistrustnm' |
| 24892 | mkdir='$mkdir' |
| 24893 | mmaptype='$mmaptype' |
| 24894 | modetype='$modetype' |
| 24895 | more='$more' |
| 24896 | multiarch='$multiarch' |
| 24897 | mv='$mv' |
| 24898 | myarchname='$myarchname' |
| 24899 | mydomain='$mydomain' |
| 24900 | myhostname='$myhostname' |
| 24901 | myuname='$myuname' |
| 24902 | n='$n' |
| 24903 | need_va_copy='$need_va_copy' |
| 24904 | netdb_hlen_type='$netdb_hlen_type' |
| 24905 | netdb_host_type='$netdb_host_type' |
| 24906 | netdb_name_type='$netdb_name_type' |
| 24907 | netdb_net_type='$netdb_net_type' |
| 24908 | nm='$nm' |
| 24909 | nm_opt='$nm_opt' |
| 24910 | nm_so_opt='$nm_so_opt' |
| 24911 | nonxs_ext='$nonxs_ext' |
| 24912 | nroff='$nroff' |
| 24913 | nvEUformat='$nvEUformat' |
| 24914 | nvFUformat='$nvFUformat' |
| 24915 | nvGUformat='$nvGUformat' |
| 24916 | nv_overflows_integers_at='$nv_overflows_integers_at' |
| 24917 | nv_preserves_uv_bits='$nv_preserves_uv_bits' |
| 24918 | nveformat='$nveformat' |
| 24919 | nvfformat='$nvfformat' |
| 24920 | nvgformat='$nvgformat' |
| 24921 | nvmantbits='$nvmantbits' |
| 24922 | nvsize='$nvsize' |
| 24923 | nvtype='$nvtype' |
| 24924 | o_nonblock='$o_nonblock' |
| 24925 | obj_ext='$obj_ext' |
| 24926 | old_pthread_create_joinable='$old_pthread_create_joinable' |
| 24927 | optimize='$optimize' |
| 24928 | orderlib='$orderlib' |
| 24929 | osname='$osname' |
| 24930 | osvers='$osvers' |
| 24931 | otherlibdirs='$otherlibdirs' |
| 24932 | package='$package' |
| 24933 | pager='$pager' |
| 24934 | passcat='$passcat' |
| 24935 | patchlevel='$patchlevel' |
| 24936 | path_sep='$path_sep' |
| 24937 | perl5='$perl5' |
| 24938 | perl='$perl' |
| 24939 | perl_patchlevel='$perl_patchlevel' |
| 24940 | perl_static_inline='$perl_static_inline' |
| 24941 | perladmin='$perladmin' |
| 24942 | perllibs='$perllibs' |
| 24943 | perlpath='$perlpath' |
| 24944 | pg='$pg' |
| 24945 | phostname='$phostname' |
| 24946 | pidtype='$pidtype' |
| 24947 | plibpth='$plibpth' |
| 24948 | pmake='$pmake' |
| 24949 | pr='$pr' |
| 24950 | prefix='$prefix' |
| 24951 | prefixexp='$prefixexp' |
| 24952 | privlib='$privlib' |
| 24953 | privlibexp='$privlibexp' |
| 24954 | procselfexe='$procselfexe' |
| 24955 | ptrsize='$ptrsize' |
| 24956 | quadkind='$quadkind' |
| 24957 | quadtype='$quadtype' |
| 24958 | randbits='$randbits' |
| 24959 | randfunc='$randfunc' |
| 24960 | random_r_proto='$random_r_proto' |
| 24961 | randseedtype='$randseedtype' |
| 24962 | ranlib='$ranlib' |
| 24963 | rd_nodata='$rd_nodata' |
| 24964 | readdir64_r_proto='$readdir64_r_proto' |
| 24965 | readdir_r_proto='$readdir_r_proto' |
| 24966 | revision='$revision' |
| 24967 | rm='$rm' |
| 24968 | rm_try='$rm_try' |
| 24969 | rmail='$rmail' |
| 24970 | run='$run' |
| 24971 | runnm='$runnm' |
| 24972 | sGMTIME_max='$sGMTIME_max' |
| 24973 | sGMTIME_min='$sGMTIME_min' |
| 24974 | sLOCALTIME_max='$sLOCALTIME_max' |
| 24975 | sLOCALTIME_min='$sLOCALTIME_min' |
| 24976 | sPRIEUldbl='$sPRIEUldbl' |
| 24977 | sPRIFUldbl='$sPRIFUldbl' |
| 24978 | sPRIGUldbl='$sPRIGUldbl' |
| 24979 | sPRIXU64='$sPRIXU64' |
| 24980 | sPRId64='$sPRId64' |
| 24981 | sPRIeldbl='$sPRIeldbl' |
| 24982 | sPRIfldbl='$sPRIfldbl' |
| 24983 | sPRIgldbl='$sPRIgldbl' |
| 24984 | sPRIi64='$sPRIi64' |
| 24985 | sPRIo64='$sPRIo64' |
| 24986 | sPRIu64='$sPRIu64' |
| 24987 | sPRIx64='$sPRIx64' |
| 24988 | sSCNfldbl='$sSCNfldbl' |
| 24989 | sched_yield='$sched_yield' |
| 24990 | scriptdir='$scriptdir' |
| 24991 | scriptdirexp='$scriptdirexp' |
| 24992 | sed='$sed' |
| 24993 | seedfunc='$seedfunc' |
| 24994 | selectminbits='$selectminbits' |
| 24995 | selecttype='$selecttype' |
| 24996 | sendmail='$sendmail' |
| 24997 | setgrent_r_proto='$setgrent_r_proto' |
| 24998 | sethostent_r_proto='$sethostent_r_proto' |
| 24999 | setlocale_r_proto='$setlocale_r_proto' |
| 25000 | setnetent_r_proto='$setnetent_r_proto' |
| 25001 | setprotoent_r_proto='$setprotoent_r_proto' |
| 25002 | setpwent_r_proto='$setpwent_r_proto' |
| 25003 | setservent_r_proto='$setservent_r_proto' |
| 25004 | sh='$sh' |
| 25005 | shar='$shar' |
| 25006 | sharpbang='$sharpbang' |
| 25007 | shmattype='$shmattype' |
| 25008 | shortsize='$shortsize' |
| 25009 | shrpenv='$shrpenv' |
| 25010 | shsharp='$shsharp' |
| 25011 | sig_count='$sig_count' |
| 25012 | sig_name='$sig_name' |
| 25013 | sig_name_init='$sig_name_init' |
| 25014 | sig_num='$sig_num' |
| 25015 | sig_num_init='$sig_num_init' |
| 25016 | sig_size='$sig_size' |
| 25017 | signal_t='$signal_t' |
| 25018 | sitearch='$sitearch' |
| 25019 | sitearchexp='$sitearchexp' |
| 25020 | sitebin='$sitebin' |
| 25021 | sitebinexp='$sitebinexp' |
| 25022 | sitehtml1dir='$sitehtml1dir' |
| 25023 | sitehtml1direxp='$sitehtml1direxp' |
| 25024 | sitehtml3dir='$sitehtml3dir' |
| 25025 | sitehtml3direxp='$sitehtml3direxp' |
| 25026 | sitelib='$sitelib' |
| 25027 | sitelib_stem='$sitelib_stem' |
| 25028 | sitelibexp='$sitelibexp' |
| 25029 | siteman1dir='$siteman1dir' |
| 25030 | siteman1direxp='$siteman1direxp' |
| 25031 | siteman3dir='$siteman3dir' |
| 25032 | siteman3direxp='$siteman3direxp' |
| 25033 | siteprefix='$siteprefix' |
| 25034 | siteprefixexp='$siteprefixexp' |
| 25035 | sitescript='$sitescript' |
| 25036 | sitescriptexp='$sitescriptexp' |
| 25037 | sizesize='$sizesize' |
| 25038 | sizetype='$sizetype' |
| 25039 | sleep='$sleep' |
| 25040 | smail='$smail' |
| 25041 | so='$so' |
| 25042 | sockethdr='$sockethdr' |
| 25043 | socketlib='$socketlib' |
| 25044 | socksizetype='$socksizetype' |
| 25045 | sort='$sort' |
| 25046 | spackage='$spackage' |
| 25047 | spitshell='$spitshell' |
| 25048 | srand48_r_proto='$srand48_r_proto' |
| 25049 | srandom_r_proto='$srandom_r_proto' |
| 25050 | src='$src' |
| 25051 | ssizetype='$ssizetype' |
| 25052 | st_ino_sign='$st_ino_sign' |
| 25053 | st_ino_size='$st_ino_size' |
| 25054 | startperl='$startperl' |
| 25055 | startsh='$startsh' |
| 25056 | static_ext='$static_ext' |
| 25057 | stdchar='$stdchar' |
| 25058 | stdio_base='$stdio_base' |
| 25059 | stdio_bufsiz='$stdio_bufsiz' |
| 25060 | stdio_cnt='$stdio_cnt' |
| 25061 | stdio_filbuf='$stdio_filbuf' |
| 25062 | stdio_ptr='$stdio_ptr' |
| 25063 | stdio_stream_array='$stdio_stream_array' |
| 25064 | strerror_r_proto='$strerror_r_proto' |
| 25065 | submit='$submit' |
| 25066 | subversion='$subversion' |
| 25067 | sysman='$sysman' |
| 25068 | sysroot='$sysroot' |
| 25069 | tail='$tail' |
| 25070 | tar='$tar' |
| 25071 | targetarch='$targetarch' |
| 25072 | targetdir='$targetdir' |
| 25073 | targetenv='$targetenv' |
| 25074 | targethost='$targethost' |
| 25075 | targetmkdir='$targetmkdir' |
| 25076 | targetport='$targetport' |
| 25077 | targetsh='$targetsh' |
| 25078 | tbl='$tbl' |
| 25079 | tee='$tee' |
| 25080 | test='$test' |
| 25081 | timeincl='$timeincl' |
| 25082 | timetype='$timetype' |
| 25083 | tmpnam_r_proto='$tmpnam_r_proto' |
| 25084 | to='$to' |
| 25085 | touch='$touch' |
| 25086 | tr='$tr' |
| 25087 | trnl='$trnl' |
| 25088 | troff='$troff' |
| 25089 | ttyname_r_proto='$ttyname_r_proto' |
| 25090 | u16size='$u16size' |
| 25091 | u16type='$u16type' |
| 25092 | u32size='$u32size' |
| 25093 | u32type='$u32type' |
| 25094 | u64size='$u64size' |
| 25095 | u64type='$u64type' |
| 25096 | u8size='$u8size' |
| 25097 | u8type='$u8type' |
| 25098 | uidformat='$uidformat' |
| 25099 | uidsign='$uidsign' |
| 25100 | uidsize='$uidsize' |
| 25101 | uidtype='$uidtype' |
| 25102 | uname='$uname' |
| 25103 | uniq='$uniq' |
| 25104 | uquadtype='$uquadtype' |
| 25105 | use5005threads='$use5005threads' |
| 25106 | use64bitall='$use64bitall' |
| 25107 | use64bitint='$use64bitint' |
| 25108 | usecbacktrace='$usecbacktrace' |
| 25109 | usecrosscompile='$usecrosscompile' |
| 25110 | usedevel='$usedevel' |
| 25111 | usedl='$usedl' |
| 25112 | usedtrace='$usedtrace' |
| 25113 | usefaststdio='$usefaststdio' |
| 25114 | useithreads='$useithreads' |
| 25115 | usekernprocpathname='$usekernprocpathname' |
| 25116 | uselanginfo='$uselanginfo' |
| 25117 | uselargefiles='$uselargefiles' |
| 25118 | uselongdouble='$uselongdouble' |
| 25119 | usemallocwrap='$usemallocwrap' |
| 25120 | usemorebits='$usemorebits' |
| 25121 | usemultiplicity='$usemultiplicity' |
| 25122 | usemymalloc='$usemymalloc' |
| 25123 | usenm='$usenm' |
| 25124 | usensgetexecutablepath='$usensgetexecutablepath' |
| 25125 | useopcode='$useopcode' |
| 25126 | useperlio='$useperlio' |
| 25127 | useposix='$useposix' |
| 25128 | usequadmath='$usequadmath' |
| 25129 | usereentrant='$usereentrant' |
| 25130 | userelocatableinc='$userelocatableinc' |
| 25131 | useshrplib='$useshrplib' |
| 25132 | usesitecustomize='$usesitecustomize' |
| 25133 | usesocks='$usesocks' |
| 25134 | usethreads='$usethreads' |
| 25135 | usevendorprefix='$usevendorprefix' |
| 25136 | useversionedarchname='$useversionedarchname' |
| 25137 | usevfork='$usevfork' |
| 25138 | usrinc='$usrinc' |
| 25139 | uuname='$uuname' |
| 25140 | uvXUformat='$uvXUformat' |
| 25141 | uvoformat='$uvoformat' |
| 25142 | uvsize='$uvsize' |
| 25143 | uvtype='$uvtype' |
| 25144 | uvuformat='$uvuformat' |
| 25145 | uvxformat='$uvxformat' |
| 25146 | vendorarch='$vendorarch' |
| 25147 | vendorarchexp='$vendorarchexp' |
| 25148 | vendorbin='$vendorbin' |
| 25149 | vendorbinexp='$vendorbinexp' |
| 25150 | vendorhtml1dir='$vendorhtml1dir' |
| 25151 | vendorhtml1direxp='$vendorhtml1direxp' |
| 25152 | vendorhtml3dir='$vendorhtml3dir' |
| 25153 | vendorhtml3direxp='$vendorhtml3direxp' |
| 25154 | vendorlib='$vendorlib' |
| 25155 | vendorlib_stem='$vendorlib_stem' |
| 25156 | vendorlibexp='$vendorlibexp' |
| 25157 | vendorman1dir='$vendorman1dir' |
| 25158 | vendorman1direxp='$vendorman1direxp' |
| 25159 | vendorman3dir='$vendorman3dir' |
| 25160 | vendorman3direxp='$vendorman3direxp' |
| 25161 | vendorprefix='$vendorprefix' |
| 25162 | vendorprefixexp='$vendorprefixexp' |
| 25163 | vendorscript='$vendorscript' |
| 25164 | vendorscriptexp='$vendorscriptexp' |
| 25165 | version='$version' |
| 25166 | version_patchlevel_string='$version_patchlevel_string' |
| 25167 | versiononly='$versiononly' |
| 25168 | vi='$vi' |
| 25169 | xlibpth='$xlibpth' |
| 25170 | yacc='$yacc' |
| 25171 | yaccflags='$yaccflags' |
| 25172 | zcat='$zcat' |
| 25173 | zip='$zip' |
| 25174 | EOT |
| 25175 | |
| 25176 | : add special variables |
| 25177 | $test -f $src/patchlevel.h && \ |
| 25178 | awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh |
| 25179 | echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh |
| 25180 | echo "PERL_CONFIG_SH=true" >>config.sh |
| 25181 | |
| 25182 | : propagate old symbols |
| 25183 | if $test -f UU/config.sh; then |
| 25184 | <UU/config.sh $sort | $uniq >UU/oldconfig.sh |
| 25185 | $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \ |
| 25186 | config.sh config.sh UU/oldconfig.sh |\ |
| 25187 | $sort | $uniq -u >UU/oldsyms |
| 25188 | set X `$cat UU/oldsyms` |
| 25189 | shift |
| 25190 | case $# in |
| 25191 | 0) ;; |
| 25192 | *) |
| 25193 | $cat <<EOM |
| 25194 | Hmm...You had some extra variables I don't know about...I'll try to keep 'em... |
| 25195 | EOM |
| 25196 | echo ": Variables propagated from previous config.sh file." >>config.sh |
| 25197 | for sym in `$cat UU/oldsyms`; do |
| 25198 | echo " Propagating $hint variable "'$'"$sym..." |
| 25199 | eval 'tmp="$'"${sym}"'"' |
| 25200 | echo "$tmp" | \ |
| 25201 | sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh |
| 25202 | done |
| 25203 | ;; |
| 25204 | esac |
| 25205 | fi |
| 25206 | |
| 25207 | : preserve RCS keywords in files with variable substitution, grrr |
| 25208 | Id='$Id' |
| 25209 | |
| 25210 | : Finish up by extracting the .SH files |
| 25211 | case "$alldone" in |
| 25212 | exit) |
| 25213 | echo "Stopping at your request, leaving temporary files around." |
| 25214 | exit 0 |
| 25215 | ;; |
| 25216 | cont) |
| 25217 | ;; |
| 25218 | '') |
| 25219 | dflt='' |
| 25220 | nostick=true |
| 25221 | $cat <<EOM |
| 25222 | |
| 25223 | If you'd like to make any changes to the config.sh file before I begin |
| 25224 | to configure things, do it as a shell escape now (e.g. !vi config.sh). |
| 25225 | |
| 25226 | EOM |
| 25227 | rp="Press return or use a shell escape to edit config.sh:" |
| 25228 | . UU/myread |
| 25229 | nostick='' |
| 25230 | case "$ans" in |
| 25231 | '') ;; |
| 25232 | *) : in case they cannot read |
| 25233 | sh 1>&4 -c "$ans";; |
| 25234 | esac |
| 25235 | ;; |
| 25236 | esac |
| 25237 | |
| 25238 | : if this fails, just run all the .SH files by hand |
| 25239 | . ./config.sh |
| 25240 | |
| 25241 | echo " " |
| 25242 | exec 1>&4 |
| 25243 | pwd=`pwd` |
| 25244 | . ./UU/extract |
| 25245 | cd "$pwd" |
| 25246 | |
| 25247 | if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then |
| 25248 | dflt=y |
| 25249 | case "$silent" in |
| 25250 | true) ;; |
| 25251 | *) |
| 25252 | $cat <<EOM |
| 25253 | |
| 25254 | Now you need to generate make dependencies by running "$make depend". |
| 25255 | You might prefer to run it in background: "$make depend > makedepend.out &" |
| 25256 | It can take a while, so you might not want to run it right now. |
| 25257 | |
| 25258 | EOM |
| 25259 | ;; |
| 25260 | esac |
| 25261 | rp="Run $make depend now?" |
| 25262 | . UU/myread |
| 25263 | case "$ans" in |
| 25264 | y*) |
| 25265 | $make depend && echo "Now you must run '$make'." |
| 25266 | ;; |
| 25267 | *) |
| 25268 | echo "You must run '$make depend' then '$make'." |
| 25269 | ;; |
| 25270 | esac |
| 25271 | elif test -f [Mm]akefile; then |
| 25272 | echo " " |
| 25273 | echo "Now you must run a $make." |
| 25274 | else |
| 25275 | echo "Configure done." |
| 25276 | fi |
| 25277 | |
| 25278 | if $test -f Policy.sh; then |
| 25279 | $cat <<EOM |
| 25280 | |
| 25281 | If you compile $package on a different machine or from a different object |
| 25282 | directory, copy the Policy.sh file from this object directory to the |
| 25283 | new one before you run Configure -- this will help you with most of |
| 25284 | the policy defaults. |
| 25285 | |
| 25286 | EOM |
| 25287 | fi |
| 25288 | if $test -f UU/config.msg; then |
| 25289 | echo "Hmm. I also noted the following information while running:" |
| 25290 | echo " " |
| 25291 | $cat UU/config.msg >&4 |
| 25292 | fi |
| 25293 | $rm -f kit*isdone ark*isdone |
| 25294 | $rm -rf UU |
| 25295 | |
| 25296 | : End of Configure |
| 25297 | |