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