| 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. Rather than |
|---|
| 15 | # working with this copy of Configure, you may wish to get metaconfig. |
|---|
| 16 | # The dist-3.0 package (which contains metaconfig) was posted in |
|---|
| 17 | # comp.sources.misc and is available on CPAN under authors/id/RAM so |
|---|
| 18 | # you may fetch it yourself from your nearest archive site.) |
|---|
| 19 | # |
|---|
| 20 | |
|---|
| 21 | # $Id: Configure 1.21.1.4.1.1.1.1.1.1.1.7.1.14 Mon, 28 Jun 2004 09:33:37 -0500 dunemush $ |
|---|
| 22 | # |
|---|
| 23 | # Generated on Mon Jun 28 09:20:55 CDT 2004 [metaconfig 3.0 PL70] |
|---|
| 24 | |
|---|
| 25 | cat >/tmp/c1$$ <<EOF |
|---|
| 26 | ARGGGHHHH!!!!! |
|---|
| 27 | |
|---|
| 28 | SCO csh still thinks true is false. Write to SCO today and tell them that next |
|---|
| 29 | year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-) |
|---|
| 30 | |
|---|
| 31 | (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All |
|---|
| 32 | we'd have to do is go in and swap the && and || tokens, wherever they are.) |
|---|
| 33 | |
|---|
| 34 | [End of diatribe. We now return you to your regularly scheduled programming...] |
|---|
| 35 | EOF |
|---|
| 36 | cat >/tmp/c2$$ <<EOF |
|---|
| 37 | |
|---|
| 38 | OOPS! You naughty creature! You didn't run Configure with sh! |
|---|
| 39 | I will attempt to remedy the situation by running sh for you... |
|---|
| 40 | EOF |
|---|
| 41 | |
|---|
| 42 | true || cat /tmp/c1$$ /tmp/c2$$ |
|---|
| 43 | true || exec sh $0 $argv:q |
|---|
| 44 | |
|---|
| 45 | (exit $?0) || cat /tmp/c2$$ |
|---|
| 46 | (exit $?0) || exec sh $0 $argv:q |
|---|
| 47 | rm -f /tmp/c1$$ /tmp/c2$$ |
|---|
| 48 | |
|---|
| 49 | : compute my invocation name |
|---|
| 50 | me=$0 |
|---|
| 51 | case "$0" in |
|---|
| 52 | */*) |
|---|
| 53 | me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null` |
|---|
| 54 | test "$me" || me=$0 |
|---|
| 55 | ;; |
|---|
| 56 | esac |
|---|
| 57 | |
|---|
| 58 | : Proper PATH separator |
|---|
| 59 | p_=: |
|---|
| 60 | : On OS/2 this directory should exist if this is not floppy only system :-] |
|---|
| 61 | if test -d c:/.; then |
|---|
| 62 | : Check for cygwin32 emulation |
|---|
| 63 | case "x$OSTYPE$OS" in |
|---|
| 64 | x*msys*Windows*) |
|---|
| 65 | echo 'Running on Windows? Using the MinGW MSys tools...' |
|---|
| 66 | ;; |
|---|
| 67 | x*win32*) |
|---|
| 68 | echo 'Running on Windows? Assuming cygwin32 emulation tools...' |
|---|
| 69 | ;; |
|---|
| 70 | x*windows*) |
|---|
| 71 | echo 'Running on Windows? Assuming cygwin32 emulation tools...' |
|---|
| 72 | ;; |
|---|
| 73 | x*cygwin*) |
|---|
| 74 | echo 'Looks like cygwin32...' |
|---|
| 75 | ;; |
|---|
| 76 | x*) |
|---|
| 77 | p_=\; |
|---|
| 78 | PATH=`cmd /c "echo %PATH%" | tr '\\\\' / ` |
|---|
| 79 | OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'` |
|---|
| 80 | ;; |
|---|
| 81 | esac |
|---|
| 82 | fi |
|---|
| 83 | |
|---|
| 84 | : Proper PATH setting |
|---|
| 85 | paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin' |
|---|
| 86 | paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin" |
|---|
| 87 | paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin" |
|---|
| 88 | paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin" |
|---|
| 89 | paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb" |
|---|
| 90 | paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin" |
|---|
| 91 | paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib" |
|---|
| 92 | paths="$paths /sbin /usr/sbin /usr/libexec /gnuwin32/b18/H-i386-cygwin32/bin" |
|---|
| 93 | |
|---|
| 94 | case "x$OSTYPE$OS" in |
|---|
| 95 | x*msys*Windows*) |
|---|
| 96 | PATH='/usr/local/bin:/mingw/bin:/bin:/perl/bin' |
|---|
| 97 | ;; |
|---|
| 98 | x*) |
|---|
| 99 | for p in $paths |
|---|
| 100 | do |
|---|
| 101 | case "$p_$PATH$p_" in |
|---|
| 102 | *$p_$p$p_*) ;; |
|---|
| 103 | *) test -d $p && PATH=$PATH$p_$p ;; |
|---|
| 104 | esac |
|---|
| 105 | done |
|---|
| 106 | |
|---|
| 107 | PATH=.$p_$PATH |
|---|
| 108 | export PATH |
|---|
| 109 | ;; |
|---|
| 110 | esac |
|---|
| 111 | |
|---|
| 112 | : shall we be using ksh? |
|---|
| 113 | inksh='' |
|---|
| 114 | needksh='' |
|---|
| 115 | avoidksh='' |
|---|
| 116 | newsh=/bin/ksh |
|---|
| 117 | changesh='' |
|---|
| 118 | if (PATH=.; alias -x) >/dev/null 2>&1; then |
|---|
| 119 | inksh=true |
|---|
| 120 | fi |
|---|
| 121 | if test -f /hp-ux -a -f /bin/ksh; then |
|---|
| 122 | needksh='to avoid sh bug in "here document" expansion' |
|---|
| 123 | fi |
|---|
| 124 | if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then |
|---|
| 125 | if test X`/usr/bin/uname -v` = X4; then |
|---|
| 126 | avoidksh="to avoid AIX 4's /bin/sh" |
|---|
| 127 | newsh=/usr/bin/bsh |
|---|
| 128 | fi |
|---|
| 129 | fi |
|---|
| 130 | case "$inksh/$needksh" in |
|---|
| 131 | /[a-z]*) |
|---|
| 132 | unset ENV |
|---|
| 133 | changesh=true |
|---|
| 134 | reason="$needksh" |
|---|
| 135 | ;; |
|---|
| 136 | esac |
|---|
| 137 | case "$inksh/$avoidksh" in |
|---|
| 138 | true/[a-z]*) |
|---|
| 139 | changesh=true |
|---|
| 140 | reason="$avoidksh" |
|---|
| 141 | ;; |
|---|
| 142 | esac |
|---|
| 143 | case "$inksh/$needksh-$avoidksh-" in |
|---|
| 144 | true/--) |
|---|
| 145 | cat <<EOM |
|---|
| 146 | (I see you are using the Korn shell. Some ksh's blow up on $me, |
|---|
| 147 | mainly on older exotic systems. If yours does, try the Bourne shell instead.) |
|---|
| 148 | EOM |
|---|
| 149 | ;; |
|---|
| 150 | esac |
|---|
| 151 | case "$changesh" in |
|---|
| 152 | true) |
|---|
| 153 | echo "(Feeding myself to $newsh $reason.)" |
|---|
| 154 | case "$0" in |
|---|
| 155 | Configure|*/Configure) exec $newsh $0 "$@";; |
|---|
| 156 | *) exec $newsh Configure "$@";; |
|---|
| 157 | esac |
|---|
| 158 | ;; |
|---|
| 159 | esac |
|---|
| 160 | |
|---|
| 161 | : Configure runs within the UU subdirectory |
|---|
| 162 | test -d UU || mkdir UU |
|---|
| 163 | unset CDPATH |
|---|
| 164 | cd UU && rm -f ./* |
|---|
| 165 | |
|---|
| 166 | d_bsd='' |
|---|
| 167 | d_eunice='' |
|---|
| 168 | d_xenix='' |
|---|
| 169 | eunicefix='' |
|---|
| 170 | Mcc='' |
|---|
| 171 | ar='' |
|---|
| 172 | awk='' |
|---|
| 173 | bash='' |
|---|
| 174 | bison='' |
|---|
| 175 | byacc='' |
|---|
| 176 | cat='' |
|---|
| 177 | chgrp='' |
|---|
| 178 | chmod='' |
|---|
| 179 | chown='' |
|---|
| 180 | comm='' |
|---|
| 181 | compress='' |
|---|
| 182 | cp='' |
|---|
| 183 | cpio='' |
|---|
| 184 | cpp='' |
|---|
| 185 | csh='' |
|---|
| 186 | date='' |
|---|
| 187 | echo='' |
|---|
| 188 | egrep='' |
|---|
| 189 | emacs='' |
|---|
| 190 | expr='' |
|---|
| 191 | find='' |
|---|
| 192 | flex='' |
|---|
| 193 | gcc='' |
|---|
| 194 | grep='' |
|---|
| 195 | gzip='' |
|---|
| 196 | inews='' |
|---|
| 197 | ksh='' |
|---|
| 198 | less='' |
|---|
| 199 | line='' |
|---|
| 200 | lint='' |
|---|
| 201 | ln='' |
|---|
| 202 | lp='' |
|---|
| 203 | lpr='' |
|---|
| 204 | ls='' |
|---|
| 205 | mail='' |
|---|
| 206 | mailx='' |
|---|
| 207 | make='' |
|---|
| 208 | mkdir='' |
|---|
| 209 | more='' |
|---|
| 210 | mv='' |
|---|
| 211 | nroff='' |
|---|
| 212 | perl='' |
|---|
| 213 | pg='' |
|---|
| 214 | pmake='' |
|---|
| 215 | pr='' |
|---|
| 216 | rm='' |
|---|
| 217 | rmail='' |
|---|
| 218 | sed='' |
|---|
| 219 | sendmail='' |
|---|
| 220 | shar='' |
|---|
| 221 | sleep='' |
|---|
| 222 | smail='' |
|---|
| 223 | sort='' |
|---|
| 224 | submit='' |
|---|
| 225 | tail='' |
|---|
| 226 | tar='' |
|---|
| 227 | tbl='' |
|---|
| 228 | test='' |
|---|
| 229 | touch='' |
|---|
| 230 | tr='' |
|---|
| 231 | troff='' |
|---|
| 232 | uname='' |
|---|
| 233 | uniq='' |
|---|
| 234 | uptime='' |
|---|
| 235 | uuname='' |
|---|
| 236 | vi='' |
|---|
| 237 | zcat='' |
|---|
| 238 | zip='' |
|---|
| 239 | hint='' |
|---|
| 240 | myuname='' |
|---|
| 241 | osname='' |
|---|
| 242 | osvers='' |
|---|
| 243 | Author='' |
|---|
| 244 | Date='' |
|---|
| 245 | Header='' |
|---|
| 246 | Id='' |
|---|
| 247 | Locker='' |
|---|
| 248 | Log='' |
|---|
| 249 | RCSfile='' |
|---|
| 250 | Revision='' |
|---|
| 251 | Source='' |
|---|
| 252 | State='' |
|---|
| 253 | archobjs='' |
|---|
| 254 | firstmakefile='' |
|---|
| 255 | cc='' |
|---|
| 256 | gccversion='' |
|---|
| 257 | ccflags='' |
|---|
| 258 | cppflags='' |
|---|
| 259 | ldflags='' |
|---|
| 260 | lkflags='' |
|---|
| 261 | locincpth='' |
|---|
| 262 | optimize='' |
|---|
| 263 | warnings='' |
|---|
| 264 | cdecl='' |
|---|
| 265 | cf_email='' |
|---|
| 266 | cf_by='' |
|---|
| 267 | cf_time='' |
|---|
| 268 | contains='' |
|---|
| 269 | cpplast='' |
|---|
| 270 | cppminus='' |
|---|
| 271 | cpprun='' |
|---|
| 272 | cppstdin='' |
|---|
| 273 | d_gettblsz='' |
|---|
| 274 | nofile='' |
|---|
| 275 | tablesize='' |
|---|
| 276 | d_access='' |
|---|
| 277 | d_argsinfp='' |
|---|
| 278 | d_assert='' |
|---|
| 279 | d_attribut='' |
|---|
| 280 | d_bcopy='' |
|---|
| 281 | d_bindtextdomain='' |
|---|
| 282 | d_bzero='' |
|---|
| 283 | d_const='' |
|---|
| 284 | cryptlib='' |
|---|
| 285 | d_crypt='' |
|---|
| 286 | i_crypt='' |
|---|
| 287 | d_force_ipv4='' |
|---|
| 288 | d_fpsetmask='' |
|---|
| 289 | d_fpsetround='' |
|---|
| 290 | i_floatingpoint='' |
|---|
| 291 | d_gaistr='' |
|---|
| 292 | d_getadinf='' |
|---|
| 293 | d_getdate='' |
|---|
| 294 | d_gethbynm2='' |
|---|
| 295 | d_getnminf='' |
|---|
| 296 | d_getpagsz='' |
|---|
| 297 | pagesize='' |
|---|
| 298 | d_getprior='' |
|---|
| 299 | d_gettext='' |
|---|
| 300 | d_gnulibc='' |
|---|
| 301 | d_huge='' |
|---|
| 302 | d_huge_val='' |
|---|
| 303 | d_int_max='' |
|---|
| 304 | d_maxdouble='' |
|---|
| 305 | d_maxint='' |
|---|
| 306 | d_ieee='' |
|---|
| 307 | d_in2p='' |
|---|
| 308 | d_internet='' |
|---|
| 309 | d_ipv6='' |
|---|
| 310 | d_itimer='' |
|---|
| 311 | d_keepsig='' |
|---|
| 312 | d_memcpy='' |
|---|
| 313 | d_memmove='' |
|---|
| 314 | d_memset='' |
|---|
| 315 | d_newstyle='' |
|---|
| 316 | d_open3='' |
|---|
| 317 | d_portable='' |
|---|
| 318 | d_lrand48='' |
|---|
| 319 | d_rand='' |
|---|
| 320 | d_random='' |
|---|
| 321 | d_rename='' |
|---|
| 322 | d_rlimit='' |
|---|
| 323 | d_rusage='' |
|---|
| 324 | d_select='' |
|---|
| 325 | d_sendmail='' |
|---|
| 326 | d_setlocale='' |
|---|
| 327 | d_setpgid='' |
|---|
| 328 | d_bsdsetpgrp='' |
|---|
| 329 | d_setpgrp='' |
|---|
| 330 | d_setprior='' |
|---|
| 331 | d_sigaction='' |
|---|
| 332 | d_sigchld='' |
|---|
| 333 | d_sigcld='' |
|---|
| 334 | d_signalproto='' |
|---|
| 335 | d_sigprocmask='' |
|---|
| 336 | d_snprintf='' |
|---|
| 337 | d_oldsock='' |
|---|
| 338 | d_socket='' |
|---|
| 339 | d_sockpair='' |
|---|
| 340 | sockethdr='' |
|---|
| 341 | socketlib='' |
|---|
| 342 | d_socklen='' |
|---|
| 343 | d_strccmp='' |
|---|
| 344 | d_index='' |
|---|
| 345 | d_strchr='' |
|---|
| 346 | d_strcoll='' |
|---|
| 347 | d_strdup='' |
|---|
| 348 | d_strxfrm='' |
|---|
| 349 | d_sysconf='' |
|---|
| 350 | d_sysctl='' |
|---|
| 351 | d_sysctlbyname='' |
|---|
| 352 | d_tcl='' |
|---|
| 353 | i_tcl='' |
|---|
| 354 | d_textdomain='' |
|---|
| 355 | d_timelocal='' |
|---|
| 356 | d_toupper='' |
|---|
| 357 | d_uint32_t='' |
|---|
| 358 | d_uptime='' |
|---|
| 359 | d_urandom='' |
|---|
| 360 | d_uwait3='' |
|---|
| 361 | d_uwait='' |
|---|
| 362 | d_voidsig='' |
|---|
| 363 | signal_t='' |
|---|
| 364 | d_volatile='' |
|---|
| 365 | d_vsnprintf='' |
|---|
| 366 | d_waitpid='' |
|---|
| 367 | h_fcntl='' |
|---|
| 368 | h_sysfile='' |
|---|
| 369 | i_arpainet='' |
|---|
| 370 | i_arpanameser='' |
|---|
| 371 | i_errno='' |
|---|
| 372 | i_syserrno='' |
|---|
| 373 | i_fcntl='' |
|---|
| 374 | i_libintl='' |
|---|
| 375 | i_limits='' |
|---|
| 376 | i_locale='' |
|---|
| 377 | i_malloc='' |
|---|
| 378 | i_memory='' |
|---|
| 379 | i_netdb='' |
|---|
| 380 | i_niin='' |
|---|
| 381 | i_sysin='' |
|---|
| 382 | i_setjmp='' |
|---|
| 383 | i_stddef='' |
|---|
| 384 | i_stdint='' |
|---|
| 385 | i_stdlib='' |
|---|
| 386 | i_string='' |
|---|
| 387 | strings='' |
|---|
| 388 | i_sysfile='' |
|---|
| 389 | d_voidtty='' |
|---|
| 390 | i_bsdioctl='' |
|---|
| 391 | i_sysfilio='' |
|---|
| 392 | i_sysioctl='' |
|---|
| 393 | i_syssockio='' |
|---|
| 394 | i_sysmman='' |
|---|
| 395 | i_syspage='' |
|---|
| 396 | i_sysparam='' |
|---|
| 397 | i_sysresrc='' |
|---|
| 398 | i_sysselct='' |
|---|
| 399 | i_syssock='' |
|---|
| 400 | i_sysstat='' |
|---|
| 401 | i_systypes='' |
|---|
| 402 | i_sysvlimit='' |
|---|
| 403 | i_syswait='' |
|---|
| 404 | i_sgtty='' |
|---|
| 405 | i_termio='' |
|---|
| 406 | i_termios='' |
|---|
| 407 | i_systime='' |
|---|
| 408 | i_systimek='' |
|---|
| 409 | i_time='' |
|---|
| 410 | timeincl='' |
|---|
| 411 | i_unistd='' |
|---|
| 412 | i_values='' |
|---|
| 413 | i_stdarg='' |
|---|
| 414 | i_varargs='' |
|---|
| 415 | i_varhdr='' |
|---|
| 416 | install='' |
|---|
| 417 | installdir='' |
|---|
| 418 | libc='' |
|---|
| 419 | glibpth='' |
|---|
| 420 | libpth='' |
|---|
| 421 | loclibpth='' |
|---|
| 422 | plibpth='' |
|---|
| 423 | xlibpth='' |
|---|
| 424 | libs='' |
|---|
| 425 | d_openssl='' |
|---|
| 426 | libssl='' |
|---|
| 427 | lns='' |
|---|
| 428 | mailer='' |
|---|
| 429 | make_set_make='' |
|---|
| 430 | d_mymalloc='' |
|---|
| 431 | freetype='' |
|---|
| 432 | mallocobj='' |
|---|
| 433 | mallocsrc='' |
|---|
| 434 | malloctype='' |
|---|
| 435 | usemymalloc='' |
|---|
| 436 | mydomain='' |
|---|
| 437 | myhostname='' |
|---|
| 438 | phostname='' |
|---|
| 439 | c='' |
|---|
| 440 | n='' |
|---|
| 441 | d_berknames='' |
|---|
| 442 | d_passnames='' |
|---|
| 443 | d_usgnames='' |
|---|
| 444 | nametype='' |
|---|
| 445 | groupcat='' |
|---|
| 446 | hostcat='' |
|---|
| 447 | passcat='' |
|---|
| 448 | package='' |
|---|
| 449 | spackage='' |
|---|
| 450 | pidtype='' |
|---|
| 451 | prototype='' |
|---|
| 452 | sh='' |
|---|
| 453 | sizetype='' |
|---|
| 454 | so='' |
|---|
| 455 | d_keepalive='' |
|---|
| 456 | sharpbang='' |
|---|
| 457 | shsharp='' |
|---|
| 458 | spitshell='' |
|---|
| 459 | src='' |
|---|
| 460 | startsh='' |
|---|
| 461 | sysman='' |
|---|
| 462 | nm_opt='' |
|---|
| 463 | nm_so_opt='' |
|---|
| 464 | runnm='' |
|---|
| 465 | usenm='' |
|---|
| 466 | incpath='' |
|---|
| 467 | mips='' |
|---|
| 468 | mips_type='' |
|---|
| 469 | usrinc='' |
|---|
| 470 | defvoidused='' |
|---|
| 471 | voidflags='' |
|---|
| 472 | CONFIG='' |
|---|
| 473 | |
|---|
| 474 | define='define' |
|---|
| 475 | undef='undef' |
|---|
| 476 | smallmach='pdp11 i8086 z8000 i80286 iAPX286' |
|---|
| 477 | rmlist='' |
|---|
| 478 | |
|---|
| 479 | : We must find out about Eunice early |
|---|
| 480 | eunicefix=':' |
|---|
| 481 | if test -f /etc/unixtovms; then |
|---|
| 482 | eunicefix=/etc/unixtovms |
|---|
| 483 | fi |
|---|
| 484 | if test -f /etc/unixtovms.exe; then |
|---|
| 485 | eunicefix=/etc/unixtovms.exe |
|---|
| 486 | fi |
|---|
| 487 | |
|---|
| 488 | : list of known cpp symbols, sorted alphabetically |
|---|
| 489 | al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2" |
|---|
| 490 | al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH" |
|---|
| 491 | al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS" |
|---|
| 492 | al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM" |
|---|
| 493 | al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX" |
|---|
| 494 | al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX" |
|---|
| 495 | al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4" |
|---|
| 496 | al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300" |
|---|
| 497 | al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek" |
|---|
| 498 | al="$al VMS Xenix286" |
|---|
| 499 | al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI" |
|---|
| 500 | al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET" |
|---|
| 501 | al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3" |
|---|
| 502 | al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000" |
|---|
| 503 | al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4" |
|---|
| 504 | al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS" |
|---|
| 505 | al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__" |
|---|
| 506 | al="$al __DGUX__ __DPX2__ __H3050R __H3050RX" |
|---|
| 507 | al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__" |
|---|
| 508 | al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__" |
|---|
| 509 | al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__" |
|---|
| 510 | al="$al __SVR4_2__ __UMAXV__" |
|---|
| 511 | al="$al ____386BSD____ __alpha __alpha__ __amiga" |
|---|
| 512 | al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__" |
|---|
| 513 | al="$al __host_mips__" |
|---|
| 514 | al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500" |
|---|
| 515 | al="$al __hp9000s500 __hp9000s700 __hp9000s800" |
|---|
| 516 | al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__" |
|---|
| 517 | al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__" |
|---|
| 518 | al="$al __m68k __m68k__ __m88100__ __m88k __m88k__" |
|---|
| 519 | al="$al __mc68000 __mc68000__ __mc68020 __mc68020__" |
|---|
| 520 | al="$al __mc68030 __mc68030__ __mc68040 __mc68040__" |
|---|
| 521 | al="$al __mc88100 __mc88100__ __mips __mips__" |
|---|
| 522 | al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__" |
|---|
| 523 | al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__" |
|---|
| 524 | al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__" |
|---|
| 525 | al="$al _host_mips _mips _unix" |
|---|
| 526 | al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent" |
|---|
| 527 | al="$al apollo ardent att386 att3b" |
|---|
| 528 | al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull" |
|---|
| 529 | al="$al cadmus clipper concurrent convex cray ctix" |
|---|
| 530 | al="$al dmert encore gcos gcx gimpel gould" |
|---|
| 531 | al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800" |
|---|
| 532 | al="$al hp9000 hp9000s300 hp9000s400 hp9000s500" |
|---|
| 533 | al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux" |
|---|
| 534 | al="$al i186 i286 i386 i486 i8086" |
|---|
| 535 | al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k" |
|---|
| 536 | al="$al ksr1 linux luna luna88k m68k m88100 m88k" |
|---|
| 537 | al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030" |
|---|
| 538 | al="$al mc68040 mc68060 mc68k mc68k32 mc700" |
|---|
| 539 | al="$al mc88000 mc88100 merlin mert mips mvs n16" |
|---|
| 540 | al="$al ncl_el ncl_mr" |
|---|
| 541 | al="$al news1500 news1700 news1800 news1900 news3700" |
|---|
| 542 | al="$al news700 news800 news900 ns16000 ns32000" |
|---|
| 543 | al="$al ns32016 ns32332 ns32k nsc32000 os osf" |
|---|
| 544 | al="$al parisc pc532 pdp11 plexus posix pyr" |
|---|
| 545 | al="$al riscix riscos scs sequent sgi sinix sony sony_news" |
|---|
| 546 | al="$al sonyrisc sparc sparclite spectrum stardent stratos" |
|---|
| 547 | al="$al sun sun3 sun386 svr4 sysV68 sysV88" |
|---|
| 548 | al="$al titan tower tower32 tower32_200 tower32_600 tower32_700" |
|---|
| 549 | al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200" |
|---|
| 550 | al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms" |
|---|
| 551 | al="$al xenix z8000" |
|---|
| 552 | |
|---|
| 553 | : No trailing extension on UNIX executables |
|---|
| 554 | _exe='' |
|---|
| 555 | : Extra object files, if any, needed on this platform. |
|---|
| 556 | archobjs='' |
|---|
| 557 | gccversion='' |
|---|
| 558 | : change the next line if compiling for Xenix/286 on Xenix/386 |
|---|
| 559 | xlibpth='/usr/lib/386 /lib/386' |
|---|
| 560 | |
|---|
| 561 | : Possible local library directories to search. |
|---|
| 562 | loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" |
|---|
| 563 | loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" |
|---|
| 564 | |
|---|
| 565 | : general looking path for locating libraries |
|---|
| 566 | glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large" |
|---|
| 567 | glibpth="$glibpth /lib /usr/lib $xlibpth" |
|---|
| 568 | glibpth="$glibpth /lib/large /usr/lib/small /lib/small" |
|---|
| 569 | glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib" |
|---|
| 570 | |
|---|
| 571 | : Private path used by Configure to find libraries. Its value |
|---|
| 572 | : is prepended to libpth. This variable takes care of special |
|---|
| 573 | : machines, like the mips. Usually, it should be empty. |
|---|
| 574 | plibpth='' |
|---|
| 575 | |
|---|
| 576 | large='' |
|---|
| 577 | : full support for void wanted by default |
|---|
| 578 | defvoidused=15 |
|---|
| 579 | |
|---|
| 580 | : Possible local include directories to search. |
|---|
| 581 | : Set locincpth to "" in a hint file to defeat local include searches. |
|---|
| 582 | locincpth="/usr/local/include /opt/local/include /usr/gnu/include" |
|---|
| 583 | locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include" |
|---|
| 584 | locincpth="$locincpth /usr/kerberos/include" |
|---|
| 585 | : |
|---|
| 586 | : no include file wanted by default |
|---|
| 587 | inclwanted='' |
|---|
| 588 | |
|---|
| 589 | : default library list |
|---|
| 590 | libswanted='' |
|---|
| 591 | defvoidused=15 |
|---|
| 592 | libswanted='nsl socket m c crypt bind resolv ld dl tcl intl' |
|---|
| 593 | |
|---|
| 594 | : Find the basic shell for Bourne shell scripts |
|---|
| 595 | case "$sh" in |
|---|
| 596 | '') |
|---|
| 597 | case "$SYSTYPE" in |
|---|
| 598 | *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";; |
|---|
| 599 | *) xxx='/bin/sh';; |
|---|
| 600 | esac |
|---|
| 601 | if test -f "$xxx"; then |
|---|
| 602 | sh="$xxx" |
|---|
| 603 | else |
|---|
| 604 | : Build up a list and do a single loop so we can 'break' out. |
|---|
| 605 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
|---|
| 606 | for xxx in sh bash ksh pdksh ash; do |
|---|
| 607 | for p in $pth; do |
|---|
| 608 | try="$try ${p}/${xxx}" |
|---|
| 609 | done |
|---|
| 610 | done |
|---|
| 611 | for xxx in $try; do |
|---|
| 612 | if test -f "$xxx"; then |
|---|
| 613 | sh="$xxx"; |
|---|
| 614 | break |
|---|
| 615 | elif test -f "$xxx.exe"; then |
|---|
| 616 | sh="$xxx"; |
|---|
| 617 | break |
|---|
| 618 | fi |
|---|
| 619 | done |
|---|
| 620 | fi |
|---|
| 621 | ;; |
|---|
| 622 | esac |
|---|
| 623 | |
|---|
| 624 | case "$sh" in |
|---|
| 625 | '') cat <<EOM >&2 |
|---|
| 626 | $me: Fatal Error: I can't find a Bourne Shell anywhere. |
|---|
| 627 | |
|---|
| 628 | Usually it's in /bin/sh. How did you even get this far? |
|---|
| 629 | Please contact me (Javelin) at dunemush@pennmush.org and |
|---|
| 630 | we'll try to straighten this all out. |
|---|
| 631 | EOM |
|---|
| 632 | exit 1 |
|---|
| 633 | ;; |
|---|
| 634 | esac |
|---|
| 635 | |
|---|
| 636 | : see if sh knows # comments |
|---|
| 637 | if `$sh -c '#' >/dev/null 2>&1`; then |
|---|
| 638 | shsharp=true |
|---|
| 639 | spitshell=cat |
|---|
| 640 | xcat=/bin/cat |
|---|
| 641 | test -f $xcat || xcat=/usr/bin/cat |
|---|
| 642 | echo "#!$xcat" >try |
|---|
| 643 | $eunicefix try |
|---|
| 644 | chmod +x try |
|---|
| 645 | ./try > today |
|---|
| 646 | if test -s today; then |
|---|
| 647 | sharpbang='#!' |
|---|
| 648 | else |
|---|
| 649 | echo "#! $xcat" > try |
|---|
| 650 | $eunicefix try |
|---|
| 651 | chmod +x try |
|---|
| 652 | ./try > today |
|---|
| 653 | if test -s today; then |
|---|
| 654 | sharpbang='#! ' |
|---|
| 655 | else |
|---|
| 656 | sharpbang=': use ' |
|---|
| 657 | fi |
|---|
| 658 | fi |
|---|
| 659 | else |
|---|
| 660 | echo " " |
|---|
| 661 | echo "Your $sh doesn't grok # comments--I will strip them later on." |
|---|
| 662 | shsharp=false |
|---|
| 663 | cd .. |
|---|
| 664 | echo "exec grep -v '^[ ]*#'" >spitshell |
|---|
| 665 | chmod +x spitshell |
|---|
| 666 | $eunicefix spitshell |
|---|
| 667 | spitshell=`pwd`/spitshell |
|---|
| 668 | cd UU |
|---|
| 669 | echo "I presume that if # doesn't work, #! won't work either!" |
|---|
| 670 | sharpbang=': use ' |
|---|
| 671 | fi |
|---|
| 672 | rm -f try today |
|---|
| 673 | |
|---|
| 674 | : figure out how to guarantee sh startup |
|---|
| 675 | case "$startsh" in |
|---|
| 676 | '') startsh=${sharpbang}${sh} ;; |
|---|
| 677 | *) |
|---|
| 678 | esac |
|---|
| 679 | cat >try <<EOSS |
|---|
| 680 | $startsh |
|---|
| 681 | set abc |
|---|
| 682 | test "$?abc" != 1 |
|---|
| 683 | EOSS |
|---|
| 684 | |
|---|
| 685 | chmod +x try |
|---|
| 686 | $eunicefix try |
|---|
| 687 | if ./try; then |
|---|
| 688 | : echo "Yup, it does." |
|---|
| 689 | else |
|---|
| 690 | echo "Hmm... '$startsh' does not guarantee sh startup..." |
|---|
| 691 | echo "You may have to fix up the shell scripts to make sure $sh runs them." |
|---|
| 692 | fi |
|---|
| 693 | rm -f try |
|---|
| 694 | |
|---|
| 695 | : produce awk script to parse command line options |
|---|
| 696 | cat >options.awk <<'EOF' |
|---|
| 697 | BEGIN { |
|---|
| 698 | optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification |
|---|
| 699 | |
|---|
| 700 | len = length(optstr); |
|---|
| 701 | for (i = 1; i <= len; i++) { |
|---|
| 702 | c = substr(optstr, i, 1); |
|---|
| 703 | if (i < len) a = substr(optstr, i + 1, 1); else a = ""; |
|---|
| 704 | if (a == ":") { |
|---|
| 705 | arg[c] = 1; |
|---|
| 706 | i++; |
|---|
| 707 | } |
|---|
| 708 | opt[c] = 1; |
|---|
| 709 | } |
|---|
| 710 | } |
|---|
| 711 | { |
|---|
| 712 | expect = 0; |
|---|
| 713 | str = $0; |
|---|
| 714 | if (substr(str, 1, 1) != "-") { |
|---|
| 715 | printf("'%s'\n", str); |
|---|
| 716 | next; |
|---|
| 717 | } |
|---|
| 718 | len = length($0); |
|---|
| 719 | for (i = 2; i <= len; i++) { |
|---|
| 720 | c = substr(str, i, 1); |
|---|
| 721 | if (!opt[c]) { |
|---|
| 722 | printf("-%s\n", substr(str, i)); |
|---|
| 723 | next; |
|---|
| 724 | } |
|---|
| 725 | printf("-%s\n", c); |
|---|
| 726 | if (arg[c]) { |
|---|
| 727 | if (i < len) |
|---|
| 728 | printf("'%s'\n", substr(str, i + 1)); |
|---|
| 729 | else |
|---|
| 730 | expect = 1; |
|---|
| 731 | next; |
|---|
| 732 | } |
|---|
| 733 | } |
|---|
| 734 | } |
|---|
| 735 | END { |
|---|
| 736 | if (expect) |
|---|
| 737 | print "?"; |
|---|
| 738 | } |
|---|
| 739 | EOF |
|---|
| 740 | |
|---|
| 741 | : process the command line options |
|---|
| 742 | set X `for arg in "$@"; do echo "X$arg"; done | |
|---|
| 743 | sed -e s/X// | awk -f options.awk` |
|---|
| 744 | eval "set $*" |
|---|
| 745 | shift |
|---|
| 746 | rm -f options.awk |
|---|
| 747 | |
|---|
| 748 | : set up default values |
|---|
| 749 | fastread='' |
|---|
| 750 | reuseval=false |
|---|
| 751 | config_sh='' |
|---|
| 752 | alldone='' |
|---|
| 753 | error='' |
|---|
| 754 | silent='' |
|---|
| 755 | extractsh='' |
|---|
| 756 | override='' |
|---|
| 757 | knowitall='' |
|---|
| 758 | rm -f optdef.sh |
|---|
| 759 | cat >optdef.sh <<EOS |
|---|
| 760 | $startsh |
|---|
| 761 | EOS |
|---|
| 762 | |
|---|
| 763 | |
|---|
| 764 | : option parsing |
|---|
| 765 | while test $# -gt 0; do |
|---|
| 766 | case "$1" in |
|---|
| 767 | -d) shift; fastread=yes;; |
|---|
| 768 | -e) shift; alldone=cont;; |
|---|
| 769 | -f) |
|---|
| 770 | shift |
|---|
| 771 | cd .. |
|---|
| 772 | if test -r "$1"; then |
|---|
| 773 | config_sh="$1" |
|---|
| 774 | else |
|---|
| 775 | echo "$me: cannot read config file $1." >&2 |
|---|
| 776 | error=true |
|---|
| 777 | fi |
|---|
| 778 | cd UU |
|---|
| 779 | shift;; |
|---|
| 780 | -h) shift; error=true;; |
|---|
| 781 | -r) shift; reuseval=true;; |
|---|
| 782 | -s) shift; silent=true; realsilent=true;; |
|---|
| 783 | -E) shift; alldone=exit;; |
|---|
| 784 | -K) shift; knowitall=true;; |
|---|
| 785 | -O) shift; override=true;; |
|---|
| 786 | -S) shift; silent=true; extractsh=true;; |
|---|
| 787 | -D) |
|---|
| 788 | shift |
|---|
| 789 | case "$1" in |
|---|
| 790 | *=) |
|---|
| 791 | echo "$me: use '-U symbol=', not '-D symbol='." >&2 |
|---|
| 792 | echo "$me: ignoring -D $1" >&2 |
|---|
| 793 | ;; |
|---|
| 794 | *=*) echo "$1" | \ |
|---|
| 795 | sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;; |
|---|
| 796 | *) echo "$1='define'" >> optdef.sh;; |
|---|
| 797 | esac |
|---|
| 798 | shift |
|---|
| 799 | ;; |
|---|
| 800 | -U) |
|---|
| 801 | shift |
|---|
| 802 | case "$1" in |
|---|
| 803 | *=) echo "$1" >> optdef.sh;; |
|---|
| 804 | *=*) |
|---|
| 805 | echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2 |
|---|
| 806 | echo "$me: ignoring -U $1" >&2 |
|---|
| 807 | ;; |
|---|
| 808 | *) echo "$1='undef'" >> optdef.sh;; |
|---|
| 809 | esac |
|---|
| 810 | shift |
|---|
| 811 | ;; |
|---|
| 812 | -V) echo "$me generated by metaconfig 3.0 PL70." >&2 |
|---|
| 813 | exit 0;; |
|---|
| 814 | --) break;; |
|---|
| 815 | -*) echo "$me: unknown option $1" >&2; shift; error=true;; |
|---|
| 816 | *) break;; |
|---|
| 817 | esac |
|---|
| 818 | done |
|---|
| 819 | |
|---|
| 820 | case "$error" in |
|---|
| 821 | true) |
|---|
| 822 | cat >&2 <<EOM |
|---|
| 823 | Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value] |
|---|
| 824 | [-U symbol] [-U symbol=] |
|---|
| 825 | -d : use defaults for all answers. |
|---|
| 826 | -e : go on without questioning past the production of config.sh. |
|---|
| 827 | -f : specify an alternate default configuration file. |
|---|
| 828 | -h : print this help message and exit (with an error status). |
|---|
| 829 | -r : reuse C symbols value if possible (skips costly nm extraction). |
|---|
| 830 | -s : silent mode, only echoes questions and essential information. |
|---|
| 831 | -D : define symbol to have some value: |
|---|
| 832 | -D symbol symbol gets the value 'define' |
|---|
| 833 | -D symbol=value symbol gets the value 'value' |
|---|
| 834 | -E : stop at the end of questions, after having produced config.sh. |
|---|
| 835 | -K : do not use unless you know what you are doing. |
|---|
| 836 | -O : let -D and -U override definitions from loaded configuration file. |
|---|
| 837 | -S : perform variable substitutions on all .SH files (can mix with -f) |
|---|
| 838 | -U : undefine symbol: |
|---|
| 839 | -U symbol symbol gets the value 'undef' |
|---|
| 840 | -U symbol= symbol gets completely empty |
|---|
| 841 | -V : print version number and exit (with a zero status). |
|---|
| 842 | EOM |
|---|
| 843 | exit 1 |
|---|
| 844 | ;; |
|---|
| 845 | esac |
|---|
| 846 | |
|---|
| 847 | : Sanity checks |
|---|
| 848 | case "$fastread$alldone" in |
|---|
| 849 | yescont|yesexit) ;; |
|---|
| 850 | *) |
|---|
| 851 | if test ! -t 0; then |
|---|
| 852 | echo "Say 'sh Configure', not 'sh <Configure'" |
|---|
| 853 | exit 1 |
|---|
| 854 | fi |
|---|
| 855 | ;; |
|---|
| 856 | esac |
|---|
| 857 | |
|---|
| 858 | exec 4>&1 |
|---|
| 859 | case "$silent" in |
|---|
| 860 | true) exec 1>/dev/null;; |
|---|
| 861 | esac |
|---|
| 862 | |
|---|
| 863 | : run the defines and the undefines, if any, but leave the file out there... |
|---|
| 864 | touch optdef.sh |
|---|
| 865 | . ./optdef.sh |
|---|
| 866 | |
|---|
| 867 | : set package name |
|---|
| 868 | package=pennmush |
|---|
| 869 | |
|---|
| 870 | : Some greps do not return status, grrr. |
|---|
| 871 | echo "grimblepritz" >grimble |
|---|
| 872 | if grep blurfldyick grimble >/dev/null 2>&1 ; then |
|---|
| 873 | contains=contains |
|---|
| 874 | elif grep grimblepritz grimble >/dev/null 2>&1 ; then |
|---|
| 875 | contains=grep |
|---|
| 876 | else |
|---|
| 877 | contains=contains |
|---|
| 878 | fi |
|---|
| 879 | rm -f grimble |
|---|
| 880 | : the following should work in any shell |
|---|
| 881 | case "$contains" in |
|---|
| 882 | contains*) |
|---|
| 883 | echo " " |
|---|
| 884 | echo "AGH! Grep doesn't return a status. Attempting remedial action." |
|---|
| 885 | cat >contains <<'EOSS' |
|---|
| 886 | grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp |
|---|
| 887 | EOSS |
|---|
| 888 | chmod +x contains |
|---|
| 889 | esac |
|---|
| 890 | |
|---|
| 891 | : first determine how to suppress newline on echo command |
|---|
| 892 | echo " " |
|---|
| 893 | echo "Checking echo to see how to suppress newlines..." |
|---|
| 894 | (echo "hi there\c" ; echo " ") >.echotmp |
|---|
| 895 | if $contains c .echotmp >/dev/null 2>&1 ; then |
|---|
| 896 | echo "...using -n." |
|---|
| 897 | n='-n' |
|---|
| 898 | c='' |
|---|
| 899 | else |
|---|
| 900 | cat <<'EOM' |
|---|
| 901 | ...using \c |
|---|
| 902 | EOM |
|---|
| 903 | n='' |
|---|
| 904 | c='\c' |
|---|
| 905 | fi |
|---|
| 906 | echo $n "The star should be here-->$c" |
|---|
| 907 | echo '*' |
|---|
| 908 | rm -f .echotmp |
|---|
| 909 | |
|---|
| 910 | : compute the number of columns on the terminal for proper question formatting |
|---|
| 911 | case "$COLUMNS" in |
|---|
| 912 | '') COLUMNS='80';; |
|---|
| 913 | esac |
|---|
| 914 | |
|---|
| 915 | : set up the echo used in my read |
|---|
| 916 | myecho="case \"\$xxxm\" in |
|---|
| 917 | '') echo $n \"\$rp $c\" >&4;; |
|---|
| 918 | *) case \"\$rp\" in |
|---|
| 919 | '') echo $n \"[\$xxxm] $c\";; |
|---|
| 920 | *) |
|---|
| 921 | if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then |
|---|
| 922 | echo \"\$rp\" >&4 |
|---|
| 923 | echo $n \"[\$xxxm] $c\" >&4 |
|---|
| 924 | else |
|---|
| 925 | echo $n \"\$rp [\$xxxm] $c\" >&4 |
|---|
| 926 | fi |
|---|
| 927 | ;; |
|---|
| 928 | esac;; |
|---|
| 929 | esac" |
|---|
| 930 | |
|---|
| 931 | : now set up to do reads with possible shell escape and default assignment |
|---|
| 932 | cat <<EOSC >myread |
|---|
| 933 | $startsh |
|---|
| 934 | xxxm=\$dflt |
|---|
| 935 | $myecho |
|---|
| 936 | ans='!' |
|---|
| 937 | case "\$fastread" in |
|---|
| 938 | yes) case "\$dflt" in |
|---|
| 939 | '') ;; |
|---|
| 940 | *) ans=''; |
|---|
| 941 | case "\$silent-\$rp" in |
|---|
| 942 | true-) ;; |
|---|
| 943 | *) echo " " >&4;; |
|---|
| 944 | esac;; |
|---|
| 945 | esac;; |
|---|
| 946 | *) case "\$silent" in |
|---|
| 947 | true) case "\$rp" in |
|---|
| 948 | '') ans='';; |
|---|
| 949 | esac;; |
|---|
| 950 | esac;; |
|---|
| 951 | esac |
|---|
| 952 | while expr "X\$ans" : "X!" >/dev/null; do |
|---|
| 953 | read answ |
|---|
| 954 | set x \$xxxm |
|---|
| 955 | shift |
|---|
| 956 | aok=''; eval "ans=\\"\$answ\\"" && aok=y |
|---|
| 957 | case "\$answ" in |
|---|
| 958 | "!") |
|---|
| 959 | sh 1>&4 |
|---|
| 960 | echo " " |
|---|
| 961 | $myecho |
|---|
| 962 | ;; |
|---|
| 963 | !*) |
|---|
| 964 | set x \`expr "X\$ans" : "X!\(.*\)\$"\` |
|---|
| 965 | shift |
|---|
| 966 | sh 1>&4 -c "\$*" |
|---|
| 967 | echo " " |
|---|
| 968 | $myecho |
|---|
| 969 | ;; |
|---|
| 970 | "\$ans") |
|---|
| 971 | case "\$ans" in |
|---|
| 972 | \\&*) |
|---|
| 973 | set x \`expr "X\$ans" : "X&\(.*\)\$"\` |
|---|
| 974 | shift |
|---|
| 975 | case "\$1" in |
|---|
| 976 | -d) |
|---|
| 977 | fastread=yes |
|---|
| 978 | echo "(OK, I'll run with -d after this question.)" >&4 |
|---|
| 979 | ;; |
|---|
| 980 | -*) |
|---|
| 981 | echo "*** Sorry, \$1 not supported yet." >&4 |
|---|
| 982 | ;; |
|---|
| 983 | esac |
|---|
| 984 | $myecho |
|---|
| 985 | ans=! |
|---|
| 986 | ;; |
|---|
| 987 | esac;; |
|---|
| 988 | *) |
|---|
| 989 | case "\$aok" in |
|---|
| 990 | y) |
|---|
| 991 | echo "*** Substitution done -- please confirm." |
|---|
| 992 | xxxm="\$ans" |
|---|
| 993 | ans=\`echo $n "\$ans$c" | tr '\012' ' '\` |
|---|
| 994 | xxxm="\$ans" |
|---|
| 995 | ans=! |
|---|
| 996 | ;; |
|---|
| 997 | *) |
|---|
| 998 | echo "*** Error -- try again." |
|---|
| 999 | ans=! |
|---|
| 1000 | ;; |
|---|
| 1001 | esac |
|---|
| 1002 | $myecho |
|---|
| 1003 | ;; |
|---|
| 1004 | esac |
|---|
| 1005 | case "\$ans\$xxxm\$nostick" in |
|---|
| 1006 | '') |
|---|
| 1007 | ans=! |
|---|
| 1008 | $myecho |
|---|
| 1009 | ;; |
|---|
| 1010 | esac |
|---|
| 1011 | done |
|---|
| 1012 | case "\$ans" in |
|---|
| 1013 | '') ans="\$xxxm";; |
|---|
| 1014 | esac |
|---|
| 1015 | EOSC |
|---|
| 1016 | |
|---|
| 1017 | : Find the path to the source tree |
|---|
| 1018 | case "$src" in |
|---|
| 1019 | '') src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;; |
|---|
| 1020 | esac |
|---|
| 1021 | case "$src" in |
|---|
| 1022 | '') |
|---|
| 1023 | src=. |
|---|
| 1024 | rsrc=.. |
|---|
| 1025 | ;; |
|---|
| 1026 | /*) rsrc="$src/..";; |
|---|
| 1027 | *) rsrc="../$src";; |
|---|
| 1028 | esac |
|---|
| 1029 | if test -f $rsrc/Configure && \ |
|---|
| 1030 | $contains "^package=$package" $rsrc/Configure >/dev/null 2>&1 |
|---|
| 1031 | then |
|---|
| 1032 | : found it, so we are ok. |
|---|
| 1033 | else |
|---|
| 1034 | rsrc='' |
|---|
| 1035 | for src in . .. ../.. ../../.. ../../../..; do |
|---|
| 1036 | if test -f ../$src/Configure && \ |
|---|
| 1037 | $contains "^package=$package" ../$src/Configure >/dev/null 2>&1 |
|---|
| 1038 | then |
|---|
| 1039 | rsrc=../$src |
|---|
| 1040 | break |
|---|
| 1041 | fi |
|---|
| 1042 | done |
|---|
| 1043 | fi |
|---|
| 1044 | case "$rsrc" in |
|---|
| 1045 | '') |
|---|
| 1046 | echo " " |
|---|
| 1047 | dflt= |
|---|
| 1048 | rp="Directory where sources for $package are located?" |
|---|
| 1049 | . ./myread |
|---|
| 1050 | src="$ans" |
|---|
| 1051 | rsrc="$src" |
|---|
| 1052 | if test -f $rsrc/Configure && \ |
|---|
| 1053 | $contains "^package=$package" $rsrc/Configure >/dev/null 2>&1 |
|---|
| 1054 | then |
|---|
| 1055 | echo "Ok, I've found them under $src" |
|---|
| 1056 | else |
|---|
| 1057 | echo "Sorry, I can't seem to be able to locate $package sources." >&4 |
|---|
| 1058 | exit 1 |
|---|
| 1059 | fi |
|---|
| 1060 | ;; |
|---|
| 1061 | ../.) ;; |
|---|
| 1062 | *) |
|---|
| 1063 | echo " " |
|---|
| 1064 | echo "Sources for $package found in $src" >&4 |
|---|
| 1065 | ;; |
|---|
| 1066 | esac |
|---|
| 1067 | |
|---|
| 1068 | : script used to extract .SH files with variable substitutions |
|---|
| 1069 | cat >extract <<'EOS' |
|---|
| 1070 | CONFIG=true |
|---|
| 1071 | echo "Doing variable substitutions on .SH files..." |
|---|
| 1072 | if test -f $src/MANIFEST; then |
|---|
| 1073 | set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH'` |
|---|
| 1074 | else |
|---|
| 1075 | echo "(Looking for .SH files under the source directory.)" |
|---|
| 1076 | set x `(cd $src; find . -name "*.SH" -print)` |
|---|
| 1077 | fi |
|---|
| 1078 | shift |
|---|
| 1079 | case $# in |
|---|
| 1080 | 0) set x `(cd $src; echo *.SH)`; shift;; |
|---|
| 1081 | esac |
|---|
| 1082 | if test ! -f $src/$1; then |
|---|
| 1083 | shift |
|---|
| 1084 | fi |
|---|
| 1085 | mkdir_p=' |
|---|
| 1086 | name=$1; |
|---|
| 1087 | create=""; |
|---|
| 1088 | while test $name; do |
|---|
| 1089 | if test ! -d "$name"; then |
|---|
| 1090 | create="$name $create"; |
|---|
| 1091 | name=`echo $name | sed -e "s|^[^/]*$||"`; |
|---|
| 1092 | name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`; |
|---|
| 1093 | else |
|---|
| 1094 | name=""; |
|---|
| 1095 | fi; |
|---|
| 1096 | done; |
|---|
| 1097 | for file in $create; do |
|---|
| 1098 | mkdir $file; |
|---|
| 1099 | done |
|---|
| 1100 | ' |
|---|
| 1101 | for file in $*; do |
|---|
| 1102 | case "$src" in |
|---|
| 1103 | ".") |
|---|
| 1104 | case "$file" in |
|---|
| 1105 | */*) |
|---|
| 1106 | dir=`expr X$file : 'X\(.*\)/'` |
|---|
| 1107 | file=`expr X$file : 'X.*/\(.*\)'` |
|---|
| 1108 | (cd $dir && . ./$file) |
|---|
| 1109 | ;; |
|---|
| 1110 | *) |
|---|
| 1111 | . ./$file |
|---|
| 1112 | ;; |
|---|
| 1113 | esac |
|---|
| 1114 | ;; |
|---|
| 1115 | *) |
|---|
| 1116 | case "$file" in |
|---|
| 1117 | */*) |
|---|
| 1118 | dir=`expr X$file : 'X\(.*\)/'` |
|---|
| 1119 | file=`expr X$file : 'X.*/\(.*\)'` |
|---|
| 1120 | (set x $dir; shift; eval $mkdir_p) |
|---|
| 1121 | sh <$src/$dir/$file |
|---|
| 1122 | ;; |
|---|
| 1123 | *) |
|---|
| 1124 | sh <$src/$file |
|---|
| 1125 | ;; |
|---|
| 1126 | esac |
|---|
| 1127 | ;; |
|---|
| 1128 | esac |
|---|
| 1129 | done |
|---|
| 1130 | if test -f $src/config_h.SH; then |
|---|
| 1131 | if test ! -f config.h; then |
|---|
| 1132 | : oops, they left it out of MANIFEST, probably, so do it anyway. |
|---|
| 1133 | . $src/config_h.SH |
|---|
| 1134 | fi |
|---|
| 1135 | fi |
|---|
| 1136 | EOS |
|---|
| 1137 | |
|---|
| 1138 | : extract files and exit if asked to do so |
|---|
| 1139 | case "$extractsh" in |
|---|
| 1140 | true) |
|---|
| 1141 | case "$realsilent" in |
|---|
| 1142 | true) ;; |
|---|
| 1143 | *) exec 1>&4;; |
|---|
| 1144 | esac |
|---|
| 1145 | case "$config_sh" in |
|---|
| 1146 | '') config_sh='config.sh'; config="$rsrc/config.sh";; |
|---|
| 1147 | /*) config="$config_sh";; |
|---|
| 1148 | *) config="$rsrc/$config_sh";; |
|---|
| 1149 | esac |
|---|
| 1150 | echo " " |
|---|
| 1151 | echo "Fetching answers from $config_sh..." |
|---|
| 1152 | . $config |
|---|
| 1153 | test "$override" && . ./optdef.sh |
|---|
| 1154 | echo " " |
|---|
| 1155 | cd .. |
|---|
| 1156 | . UU/extract |
|---|
| 1157 | rm -rf UU |
|---|
| 1158 | echo "Done." |
|---|
| 1159 | exit 0 |
|---|
| 1160 | ;; |
|---|
| 1161 | esac |
|---|
| 1162 | |
|---|
| 1163 | : Eunice requires " " instead of "", can you believe it |
|---|
| 1164 | echo " " |
|---|
| 1165 | : Here we go... |
|---|
| 1166 | echo "Beginning of configuration questions for $package." |
|---|
| 1167 | |
|---|
| 1168 | trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 |
|---|
| 1169 | |
|---|
| 1170 | : Now test for existence of everything in MANIFEST |
|---|
| 1171 | echo " " |
|---|
| 1172 | if test -f $rsrc/MANIFEST; then |
|---|
| 1173 | echo "First let's make sure your kit is complete. Checking..." >&4 |
|---|
| 1174 | awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50 |
|---|
| 1175 | rm -f missing |
|---|
| 1176 | tmppwd=`pwd` |
|---|
| 1177 | for filelist in x??; do |
|---|
| 1178 | (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing) |
|---|
| 1179 | done |
|---|
| 1180 | if test -s missing; then |
|---|
| 1181 | cat missing >&4 |
|---|
| 1182 | cat >&4 <<'EOM' |
|---|
| 1183 | |
|---|
| 1184 | THIS PACKAGE SEEMS TO BE INCOMPLETE. |
|---|
| 1185 | |
|---|
| 1186 | You have the option of continuing the configuration process, despite the |
|---|
| 1187 | distinct possibility that your kit is damaged, by typing 'y'es. If you |
|---|
| 1188 | do, don't blame me if something goes wrong. I advise you to type 'n'o |
|---|
| 1189 | and contact the author (dunemush@pennmush.org). |
|---|
| 1190 | |
|---|
| 1191 | EOM |
|---|
| 1192 | echo $n "Continue? [n] $c" >&4 |
|---|
| 1193 | read ans |
|---|
| 1194 | case "$ans" in |
|---|
| 1195 | y*) |
|---|
| 1196 | echo "Continuing..." >&4 |
|---|
| 1197 | rm -f missing |
|---|
| 1198 | ;; |
|---|
| 1199 | *) |
|---|
| 1200 | echo "ABORTING..." >&4 |
|---|
| 1201 | kill $$ |
|---|
| 1202 | ;; |
|---|
| 1203 | esac |
|---|
| 1204 | else |
|---|
| 1205 | echo "Looks good..." |
|---|
| 1206 | fi |
|---|
| 1207 | else |
|---|
| 1208 | echo "There is no MANIFEST file. I hope your kit is complete !" |
|---|
| 1209 | fi |
|---|
| 1210 | rm -f missing x?? |
|---|
| 1211 | |
|---|
| 1212 | : create .config dir to save info across Configure sessions |
|---|
| 1213 | test -d ../.config || mkdir ../.config |
|---|
| 1214 | cat >../.config/README <<EOF |
|---|
| 1215 | This directory created by Configure to save information that should |
|---|
| 1216 | persist across sessions for $package. |
|---|
| 1217 | |
|---|
| 1218 | You may safely delete it if you wish. |
|---|
| 1219 | EOF |
|---|
| 1220 | |
|---|
| 1221 | : general instructions |
|---|
| 1222 | needman=true |
|---|
| 1223 | firsttime=true |
|---|
| 1224 | user=`(logname) 2>/dev/null` |
|---|
| 1225 | case "$user" in |
|---|
| 1226 | '') user=`whoami 2>&1`;; |
|---|
| 1227 | esac |
|---|
| 1228 | if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then |
|---|
| 1229 | firsttime=false |
|---|
| 1230 | echo " " |
|---|
| 1231 | rp='Would you like to see the instructions?' |
|---|
| 1232 | dflt=n |
|---|
| 1233 | . ./myread |
|---|
| 1234 | case "$ans" in |
|---|
| 1235 | [yY]*) ;; |
|---|
| 1236 | *) needman=false;; |
|---|
| 1237 | esac |
|---|
| 1238 | fi |
|---|
| 1239 | if $needman; then |
|---|
| 1240 | cat <<EOH |
|---|
| 1241 | |
|---|
| 1242 | This installation shell script will examine your system and ask you questions |
|---|
| 1243 | to determine how the pennmush package should be installed. If you get |
|---|
| 1244 | stuck on a question, you may use a ! shell escape to start a subshell or |
|---|
| 1245 | execute a command. Many of the questions will have default answers in square |
|---|
| 1246 | brackets; typing carriage return will give you the default. |
|---|
| 1247 | |
|---|
| 1248 | On some of the questions which ask for file or directory names you are allowed |
|---|
| 1249 | to use the ~name construct to specify the login directory belonging to "name", |
|---|
| 1250 | even if you don't have a shell which knows about that. Questions where this is |
|---|
| 1251 | allowed will be marked "(~name ok)". |
|---|
| 1252 | |
|---|
| 1253 | EOH |
|---|
| 1254 | rp='' |
|---|
| 1255 | dflt='Type carriage return to continue' |
|---|
| 1256 | . ./myread |
|---|
| 1257 | cat <<'EOH' |
|---|
| 1258 | |
|---|
| 1259 | The prompter used in this script allows you to use shell variables and |
|---|
| 1260 | backticks in your answers. You may use $1, $2, etc... to refer to the words |
|---|
| 1261 | in the default answer, as if the default line was a set of arguments given to a |
|---|
| 1262 | script shell. This means you may also use $* to repeat the whole default line, |
|---|
| 1263 | so you do not have to re-type everything to add something to the default. |
|---|
| 1264 | |
|---|
| 1265 | Everytime there is a substitution, you will have to confirm. If there is an |
|---|
| 1266 | error (e.g. an unmatched backtick), the default answer will remain unchanged |
|---|
| 1267 | and you will be prompted again. |
|---|
| 1268 | |
|---|
| 1269 | If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all |
|---|
| 1270 | the questions and use the computed defaults (or the previous answers if there |
|---|
| 1271 | was already a config.sh file). Type 'Configure -h' for a list of options. |
|---|
| 1272 | You may also start interactively and then answer '& -d' at any prompt to turn |
|---|
| 1273 | on the non-interactive behaviour for the remaining of the execution. |
|---|
| 1274 | |
|---|
| 1275 | EOH |
|---|
| 1276 | . ./myread |
|---|
| 1277 | cat <<EOH |
|---|
| 1278 | |
|---|
| 1279 | Much effort has been expended to ensure that this shell script will run on any |
|---|
| 1280 | Unix system. If despite that it blows up on yours, your best bet is to edit |
|---|
| 1281 | Configure and run it again. If you can't run Configure for some reason, |
|---|
| 1282 | you'll have to generate a config.sh file by hand. Whatever problems you |
|---|
| 1283 | have, let me (dunemush@pennmush.org) know how I blew it. |
|---|
| 1284 | |
|---|
| 1285 | This installation script affects things in two ways: |
|---|
| 1286 | |
|---|
| 1287 | 1) it may do direct variable substitutions on some of the files included |
|---|
| 1288 | in this kit. |
|---|
| 1289 | 2) it builds a config.h file for inclusion in C programs. You may edit |
|---|
| 1290 | any of these files as the need arises after running this script. |
|---|
| 1291 | |
|---|
| 1292 | If you make a mistake on a question, there is no easy way to back up to it |
|---|
| 1293 | currently. The easiest thing to do is to edit config.sh and rerun all the SH |
|---|
| 1294 | files. Configure will offer to let you do this before it runs the SH files. |
|---|
| 1295 | |
|---|
| 1296 | EOH |
|---|
| 1297 | dflt='Type carriage return to continue' |
|---|
| 1298 | . ./myread |
|---|
| 1299 | case "$firsttime" in |
|---|
| 1300 | true) echo $user >>../.config/instruct;; |
|---|
| 1301 | esac |
|---|
| 1302 | fi |
|---|
| 1303 | |
|---|
| 1304 | : find out where common programs are |
|---|
| 1305 | echo " " |
|---|
| 1306 | echo "Locating common programs..." >&4 |
|---|
| 1307 | cat <<EOSC >loc |
|---|
| 1308 | $startsh |
|---|
| 1309 | case \$# in |
|---|
| 1310 | 0) exit 1;; |
|---|
| 1311 | esac |
|---|
| 1312 | thing=\$1 |
|---|
| 1313 | shift |
|---|
| 1314 | dflt=\$1 |
|---|
| 1315 | shift |
|---|
| 1316 | for dir in \$*; do |
|---|
| 1317 | case "\$thing" in |
|---|
| 1318 | .) |
|---|
| 1319 | if test -d \$dir/\$thing; then |
|---|
| 1320 | echo \$dir |
|---|
| 1321 | exit 0 |
|---|
| 1322 | fi |
|---|
| 1323 | ;; |
|---|
| 1324 | *) |
|---|
| 1325 | for thisthing in \$dir/\$thing; do |
|---|
| 1326 | : just loop through to pick last item |
|---|
| 1327 | done |
|---|
| 1328 | if test -f \$thisthing; then |
|---|
| 1329 | echo \$thisthing |
|---|
| 1330 | exit 0 |
|---|
| 1331 | elif test -f \$dir/\$thing.exe; then |
|---|
| 1332 | : on Eunice apparently |
|---|
| 1333 | echo \$dir/\$thing |
|---|
| 1334 | exit 0 |
|---|
| 1335 | fi |
|---|
| 1336 | ;; |
|---|
| 1337 | esac |
|---|
| 1338 | done |
|---|
| 1339 | echo \$dflt |
|---|
| 1340 | exit 1 |
|---|
| 1341 | EOSC |
|---|
| 1342 | chmod +x loc |
|---|
| 1343 | $eunicefix loc |
|---|
| 1344 | loclist=" |
|---|
| 1345 | awk |
|---|
| 1346 | cat |
|---|
| 1347 | chmod |
|---|
| 1348 | comm |
|---|
| 1349 | cp |
|---|
| 1350 | echo |
|---|
| 1351 | expr |
|---|
| 1352 | grep |
|---|
| 1353 | make |
|---|
| 1354 | mkdir |
|---|
| 1355 | rm |
|---|
| 1356 | sed |
|---|
| 1357 | sort |
|---|
| 1358 | touch |
|---|
| 1359 | tr |
|---|
| 1360 | uniq |
|---|
| 1361 | " |
|---|
| 1362 | trylist=" |
|---|
| 1363 | Mcc |
|---|
| 1364 | cpp |
|---|
| 1365 | date |
|---|
| 1366 | ln |
|---|
| 1367 | mail |
|---|
| 1368 | perl |
|---|
| 1369 | rmail |
|---|
| 1370 | sendmail |
|---|
| 1371 | smail |
|---|
| 1372 | test |
|---|
| 1373 | uname |
|---|
| 1374 | uptime |
|---|
| 1375 | " |
|---|
| 1376 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
|---|
| 1377 | pth="$pth /lib /usr/lib" |
|---|
| 1378 | for file in $loclist; do |
|---|
| 1379 | eval xxx=\$$file |
|---|
| 1380 | case "$xxx" in |
|---|
| 1381 | /*|?:[\\/]*) |
|---|
| 1382 | if test -f "$xxx"; then |
|---|
| 1383 | : ok |
|---|
| 1384 | else |
|---|
| 1385 | echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 |
|---|
| 1386 | xxx=`./loc $file $file $pth` |
|---|
| 1387 | fi |
|---|
| 1388 | ;; |
|---|
| 1389 | '') xxx=`./loc $file $file $pth`;; |
|---|
| 1390 | *) xxx=`./loc $xxx $xxx $pth`;; |
|---|
| 1391 | esac |
|---|
| 1392 | eval $file=$xxx |
|---|
| 1393 | eval _$file=$xxx |
|---|
| 1394 | case "$xxx" in |
|---|
| 1395 | /*) |
|---|
| 1396 | echo $file is in $xxx. |
|---|
| 1397 | ;; |
|---|
| 1398 | ?:[\\/]*) |
|---|
| 1399 | echo $file is in $xxx. |
|---|
| 1400 | ;; |
|---|
| 1401 | *) |
|---|
| 1402 | echo "I don't know where '$file' is, and my life depends on it." >&4 |
|---|
| 1403 | echo "Go find a public domain implementation or fix your PATH setting!" >&4 |
|---|
| 1404 | exit 1 |
|---|
| 1405 | ;; |
|---|
| 1406 | esac |
|---|
| 1407 | done |
|---|
| 1408 | echo " " |
|---|
| 1409 | echo "Don't worry if any of the following aren't found..." |
|---|
| 1410 | say=offhand |
|---|
| 1411 | for file in $trylist; do |
|---|
| 1412 | eval xxx=\$$file |
|---|
| 1413 | case "$xxx" in |
|---|
| 1414 | /*|?:[\\/]*) |
|---|
| 1415 | if test -f "$xxx"; then |
|---|
| 1416 | : ok |
|---|
| 1417 | else |
|---|
| 1418 | echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 |
|---|
| 1419 | xxx=`./loc $file $file $pth` |
|---|
| 1420 | fi |
|---|
| 1421 | ;; |
|---|
| 1422 | '') xxx=`./loc $file $file $pth`;; |
|---|
| 1423 | *) xxx=`./loc $xxx $xxx $pth`;; |
|---|
| 1424 | esac |
|---|
| 1425 | eval $file=$xxx |
|---|
| 1426 | eval _$file=$xxx |
|---|
| 1427 | case "$xxx" in |
|---|
| 1428 | /*) |
|---|
| 1429 | echo $file is in $xxx. |
|---|
| 1430 | ;; |
|---|
| 1431 | ?:[\\/]*) |
|---|
| 1432 | echo $file is in $xxx. |
|---|
| 1433 | ;; |
|---|
| 1434 | *) |
|---|
| 1435 | echo "I don't see $file out there, $say." |
|---|
| 1436 | say=either |
|---|
| 1437 | ;; |
|---|
| 1438 | esac |
|---|
| 1439 | done |
|---|
| 1440 | case "$egrep" in |
|---|
| 1441 | egrep) |
|---|
| 1442 | echo "Substituting grep for egrep." |
|---|
| 1443 | egrep=$grep |
|---|
| 1444 | ;; |
|---|
| 1445 | esac |
|---|
| 1446 | case "$ln" in |
|---|
| 1447 | ln) |
|---|
| 1448 | echo "Substituting cp for ln." |
|---|
| 1449 | ln=$cp |
|---|
| 1450 | ;; |
|---|
| 1451 | esac |
|---|
| 1452 | case "$test" in |
|---|
| 1453 | test) |
|---|
| 1454 | echo "Hopefully test is built into your sh." |
|---|
| 1455 | ;; |
|---|
| 1456 | *) |
|---|
| 1457 | if `sh -c "PATH= test true" >/dev/null 2>&1`; then |
|---|
| 1458 | echo "Using the test built into your sh." |
|---|
| 1459 | test=test |
|---|
| 1460 | _test=test |
|---|
| 1461 | fi |
|---|
| 1462 | ;; |
|---|
| 1463 | esac |
|---|
| 1464 | case "$echo" in |
|---|
| 1465 | echo) |
|---|
| 1466 | echo "Hopefully echo is built into your sh." |
|---|
| 1467 | ;; |
|---|
| 1468 | '') ;; |
|---|
| 1469 | *) |
|---|
| 1470 | echo " " |
|---|
| 1471 | echo "Checking compatibility between $echo and builtin echo (if any)..." >&4 |
|---|
| 1472 | $echo $n "hi there$c" >foo1 |
|---|
| 1473 | echo $n "hi there$c" >foo2 |
|---|
| 1474 | if cmp foo1 foo2 >/dev/null 2>&1; then |
|---|
| 1475 | echo "They are compatible. In fact, they may be identical." |
|---|
| 1476 | else |
|---|
| 1477 | case "$n" in |
|---|
| 1478 | '-n') n='' c='\c';; |
|---|
| 1479 | *) n='-n' c='';; |
|---|
| 1480 | esac |
|---|
| 1481 | cat <<FOO |
|---|
| 1482 | They are not compatible! You are probably running ksh on a non-USG syst |
|---|