|
|
1.1 ! root 1: : 'Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1984, 1985.' ! 2: ! 3: echo "Configuration questions for the B system." ! 4: ! 5: : 'Determine if echo -n works' ! 6: echo -n "bleep" >.bleep ! 7: if grep n .bleep >/dev/null 2>&1 ! 8: then ! 9: n="" ! 10: else ! 11: n="-n" ! 12: fi ! 13: rm -f .bleep ! 14: ! 15: : 'What machine?' ! 16: echo " " ! 17: echo $n "Figuring out what machine you have " ! 18: echo $n "..." ! 19: cat >machine.c <<EOF ! 20: #include <stdio.h> ! 21: main() { ! 22: #ifdef vax ! 23: printf("vax\n"); ! 24: #else ! 25: #ifdef pdp ! 26: printf("pdp\n"); ! 27: #else ! 28: #ifdef PDP ! 29: printf("pdp\n"); ! 30: #else ! 31: printf("other\n"); ! 32: #endif ! 33: #endif ! 34: #endif ! 35: } ! 36: EOF ! 37: cc machine.c -o machine ! 38: machine=`machine` ! 39: rm -f machine* ! 40: echo " " ! 41: case $machine in ! 42: vax) ! 43: echo "This machine appears to be a VAX." ! 44: echo $n "Is this true? " ! 45: read ans ! 46: case $ans in ! 47: n*|N*|f*|F*) machine="other" ! 48: ;; ! 49: *) bint="bint" ! 50: ;; ! 51: esac ! 52: ;; ! 53: pdp) ! 54: echo "This machine appears to be a PDP." ! 55: echo $n "Is this true? " ! 56: read ans ! 57: case $ans in ! 58: n*|N*|f*|F*) machine="other" ! 59: ;; ! 60: *) bint="bsmall" ! 61: ;; ! 62: esac ! 63: ;; ! 64: esac ! 65: case $machine in ! 66: other) ! 67: echo "Your machine does not appear to be a VAX or PDP." ! 68: echo $n "Is this a small machine (less than 190K code space)? " ! 69: read ans ! 70: case $ans in ! 71: y*|Y*) bint="bsmall" ! 72: ;; ! 73: *) bint="bint" ! 74: ;; ! 75: esac ! 76: echo " " ! 77: echo "Since your machine may not be a VAX or PDP, you might have to edit" ! 78: echo "the configuration file for the B interpreter '$bint'." ! 79: echo "Check the remarks in b0con.h and README in ./src/$bint." ! 80: ;; ! 81: esac ! 82: ! 83: case $bint in ! 84: "bsmall") ! 85: echo " " ! 86: echo "Since you have a small system, we can only use the old" ! 87: echo "version of the B interpreter, named $bint." ! 88: echo "See the file ./src/bsmall/README for details." ! 89: echo " " ! 90: echo "The B editor is too big in its full glory." ! 91: echo "Therefore all kinds of features will be turned off in an" ! 92: echo "attempt to make it fit." ! 93: echo "See ./src/bed/feat.h for details." ! 94: ;; ! 95: esac ! 96: ! 97: : 'What unix?' ! 98: echo " " ! 99: echo $n "Finding out about your brand of unix " ! 100: echo $n "..." ! 101: cat >unix.c <<EOF ! 102: #include <stdio.h> ! 103: #include <signal.h> ! 104: main() { ! 105: #ifdef SIGCHLD ! 106: #ifdef SIGVTALRM ! 107: printf("BSD4_2\n"); ! 108: #else ! 109: printf("BSD\n"); ! 110: #endif ! 111: #else ! 112: #ifdef SIGCLD ! 113: printf("ATT\n"); ! 114: #else ! 115: printf("unknown\n"); /* Version 7 we hope ... */ ! 116: #endif ! 117: #endif ! 118: } ! 119: EOF ! 120: cc unix.c -o unix ! 121: unix=`unix` ! 122: rm -f unix* ! 123: ! 124: echo " " ! 125: case $unix in ! 126: BSD4_2) ! 127: echo "You appear to be running Berkeley's BSD unix, version 4.2 (or later)." ! 128: echo $n "Is this true? " ! 129: read ans ! 130: case $ans in ! 131: n*|N*|f*|F*) unix="unknown";; ! 132: esac ! 133: ;; ! 134: BSD) ! 135: echo "You appear to be running Berkeley's BSD unix." ! 136: echo $n "Is this true? " ! 137: read ans ! 138: case $ans in ! 139: n*|N*|f*|F*) unix="unknown";; ! 140: esac ! 141: ;; ! 142: ATT) ! 143: echo "You appear to be running ATT's System III or System V unix." ! 144: echo $n "Is this true? " ! 145: read ans ! 146: case $ans in ! 147: n*|N*|f*|F*) unix="unknown";; ! 148: esac ! 149: ;; ! 150: esac ! 151: ! 152: case $machine in ! 153: pdp|other) ! 154: case $unix in ! 155: unknown) ! 156: echo $n "Are you running PWB Unix? " ! 157: read ans ! 158: case $ans in ! 159: y*|Y*) unix="PWB";; ! 160: esac ! 161: ;; ! 162: esac ! 163: esac ! 164: ! 165: case $unix in ! 166: unknown) ! 167: echo " " ! 168: echo "We cannot find out what type of unix you are running." ! 169: echo "See ./src/bed/unix.h, ./src/bed/feat.h, /src/$bint/README" ! 170: echo "and ./src/$bint/b0con.h in case of problems." ! 171: ;; ! 172: esac ! 173: ! 174: : 'Floating point arithmetic ok?' ! 175: echo " " ! 176: cat >float.c <<EOF ! 177: #include <stdio.h> ! 178: double dadd(a, b) double a, b; { ! 179: return a+b; ! 180: } ! 181: main() { ! 182: double a, b, c; ! 183: double dadd(); ! 184: a = 3.14; ! 185: b = 2.7 * a; ! 186: c = dadd(a, b); ! 187: exit(0); ! 188: } ! 189: EOF ! 190: cc -O float.c -o float >/dev/null 2>&1 ! 191: if sh 2>/dev/null <<EOF ! 192: if float ! 193: then exit 0 ! 194: else exit 1 ! 195: fi ! 196: EOF ! 197: then ! 198: echo "Your floating point seems to be alright." ! 199: fflag="" ! 200: else ! 201: echo "Your C compiler seems to need a special flag for" ! 202: echo "loading (probably software) floating point routines." ! 203: echo $n "What flag is needed (default -f) " ! 204: read fflag ! 205: case $fflag in ! 206: '') fflag="-f";; ! 207: esac ! 208: cc -O $fflag float.c -o float >/dev/null 2>&1 ! 209: until sh 2>/dev/null <<EOF ! 210: if float ! 211: then exit 0 ! 212: else exit 1 ! 213: fi ! 214: EOF ! 215: do ! 216: echo "This flag doesn't seem to work." ! 217: echo "Try again (default -f) " ! 218: read fflag ! 219: case $fflag in ! 220: '') fflag="-f";; ! 221: esac ! 222: cc -O $fflag float.c -o float >/dev/null 2>&1 ! 223: done ! 224: fi ! 225: rm -f float* core ! 226: ! 227: : 'termio system?' ! 228: if test -r /usr/include/termio.h ! 229: then ! 230: termio="yes" ! 231: echo " " ! 232: echo "Termio.h found." ! 233: else ! 234: termio="no" ! 235: if test ! -r /usr/include/sgtty.h ! 236: then ! 237: echo " " ! 238: echo "Neither termio.h nor sgtty.h found." ! 239: echo "See ./src/bed/unix.h in case of problems." ! 240: fi ! 241: fi ! 242: ! 243: : 'termcap library for B editor' ! 244: echo " " ! 245: echo $n "Searching for your termcap-like library routines " ! 246: echo $n "... " ! 247: if test -r /lib/libtermcap.a -o -r /usr/lib/libtermcap.a ! 248: then ! 249: termlib="-ltermcap" ! 250: echo "termcap library found." ! 251: elif test -r /usr/local/lib/libtermcap.a ! 252: then ! 253: termlib="/usr/local/lib/libtermcap.a" ! 254: echo "local termcap library found." ! 255: elif test -r /lib/libtermlib.a -o -r /usr/lib/libtermlib.a ! 256: then ! 257: termlib="-ltermlib" ! 258: echo "termlib library found." ! 259: elif test -r /usr/local/lib/libtermlib.a ! 260: then ! 261: termlib="/usr/local/lib/libtermlib.a" ! 262: echo "local termlib library found." ! 263: elif test -r /lib/libcurses.a -o -r /usr/lib/libcurses.a ! 264: then ! 265: termlib="-lcurses" ! 266: echo "terminfo library found." ! 267: elif test -r /usr/local/lib/libcurses.a ! 268: then ! 269: termlib="/usr/local/lib/libcurses.a" ! 270: echo "local terminfo library found." ! 271: else ! 272: : 'changed for 4.3 BSD release' ! 273: termlib="ask_it" ! 274: fi ! 275: while test "$termlib" = "ask_it" -o "$termlib" = "try_again"; do ! 276: case $termlib in ! 277: ask_it) ! 278: echo " " ! 279: echo "Please specify where the termcap-like routines are kept" ! 280: echo $n " (either full pathname or -lxxx option) " ! 281: ;; ! 282: try_again) ! 283: echo $n "Please try again (full pathname or -lyyy option) " ! 284: ;; ! 285: esac ! 286: read termlib ! 287: case $termlib in ! 288: -l*) ! 289: echo "Hope $termlib will do the job." ! 290: ;; ! 291: /*) ! 292: if test -r $termlib ! 293: then ! 294: echo "Ok, we will try that one." ! 295: else ! 296: echo "$termlib does not appear to exist." ! 297: termlib="try_again" ! 298: fi ! 299: ;; ! 300: *) ! 301: echo "$termlib is not a valid library specification." ! 302: termlib="try_again" ! 303: ;; ! 304: esac ! 305: done ! 306: ! 307: : 'termcap database, commented out for 4.3 BSD' ! 308: #echo " " ! 309: #if test -r /etc/termcap ! 310: #then ! 311: # termcap="yes" ! 312: # echo "Termcap database found." ! 313: #else ! 314: # termcap="no" ! 315: # echo "No termcap database found; we will install our own, to be used" ! 316: # echo "when your TERMCAP environment variable is not set." ! 317: #fi ! 318: ! 319: ! 320: : 'Shall we make B public?' ! 321: public="no" ! 322: echo " " ! 323: echo $n "Will you want to make B publically available? " ! 324: read ans ! 325: case $ans in ! 326: y*|Y*) ! 327: public="yes" ! 328: if test -r answers ! 329: then ! 330: . answers ! 331: else ! 332: bdef="/usr/new" ! 333: libdef="/usr/new/lib/B" ! 334: man1def="/usr/man/mann" ! 335: man5def="/usr/man/mann" ! 336: fi ! 337: bdir='blurfl' ! 338: while test ! -d "$bdir" ; do ! 339: case $bdir in ! 340: blurfl) ! 341: echo " " ! 342: echo "Please type the full pathname of a directory" ! 343: echo "in which you have write permission," ! 344: echo "and where you want the 'b' command file installed" ! 345: echo $n " (default $bdef) " ! 346: ;; ! 347: *) echo "$bdir does not appear to exist." ! 348: echo $n "Are you sure you typed the right name? " ! 349: read ans ! 350: case $ans in ! 351: y*|Y*) echo "Don't forget to make $bdir before 'make install'." ! 352: break ! 353: ;; ! 354: *) echo " " ! 355: echo $n "Please try again (default $bdef) " ! 356: ;; ! 357: esac ! 358: ;; ! 359: esac ! 360: read bdir ! 361: case $bdir in ! 362: "") bdir=$bdef;; ! 363: esac ! 364: done ! 365: libdir='blurfl' ! 366: while test ! -d "$libdir" ; do ! 367: case $libdir in ! 368: blurfl) ! 369: echo " " ! 370: echo "Please type the full pathname of the directory" ! 371: echo "where you want to install the auxiliary binaries" ! 372: echo "and datafiles needed by the B system" ! 373: echo $n " (default $libdef) " ! 374: ;; ! 375: *) echo "$libdir does not appear to exist." ! 376: echo $n "Are you sure you typed the right name? " ! 377: read ans ! 378: case $ans in ! 379: *|Y*) echo "Don't forget to make $libdir before 'make install'." ! 380: break ! 381: ;; ! 382: *) echo " " ! 383: echo $n "Please try again (default $libdef) " ! 384: ;; ! 385: esac ! 386: ;; ! 387: esac ! 388: read libdir ! 389: case $libdir in ! 390: "") libdir=$libdef;; ! 391: esac ! 392: done ! 393: man1dir='blurfl' ! 394: while test ! -d "$man1dir" ; do ! 395: case $man1dir in ! 396: blurfl) ! 397: echo " " ! 398: echo "Please type the full pathname of the directory" ! 399: echo "where you want to install the 'b.1' manual page" ! 400: echo $n " (default $man1def) " ! 401: ;; ! 402: *) echo "$man1dir does not appear to exist." ! 403: echo $n "Are you sure you typed the right name? " ! 404: read ans ! 405: case $ans in ! 406: y*|Y*) echo "Don't forget to make $man1dir before 'make install'." ! 407: break ! 408: ;; ! 409: *) echo " " ! 410: echo $n "Please try again (default $man1def) " ! 411: ;; ! 412: esac ! 413: ;; ! 414: esac ! 415: read man1dir ! 416: case $man1dir in ! 417: "") man1dir=$man1def;; ! 418: esac ! 419: done ! 420: man5dir='blurfl' ! 421: while test ! -d "$man5dir" ; do ! 422: case $man5dir in ! 423: blurfl) ! 424: echo " " ! 425: echo "Please type the full pathname of the directory" ! 426: echo "where you want to install the 'bterminal.5' manual page" ! 427: echo $n " (default $man5def) " ! 428: ;; ! 429: *) echo "$man5dir does not appear to exist." ! 430: echo $n "Are you sure you typed the right name? " ! 431: read ans ! 432: case $ans in ! 433: y*|Y*) echo "Don't forget to make $man5dir before 'make install'." ! 434: break ! 435: ;; ! 436: *) echo " " ! 437: echo $n "Please try again (default $man5def) " ! 438: ;; ! 439: esac ! 440: echo $n "Please try again " ! 441: ;; ! 442: esac ! 443: read man5dir ! 444: case $man5dir in ! 445: "") man5dir=$man5def;; ! 446: esac ! 447: done ! 448: ! 449: cat >answers <<EOF ! 450: bdef="$bdir" ! 451: libdef="$libdir" ! 452: man1def="$man1dir" ! 453: man5def="$man5dir" ! 454: EOF ! 455: ;; ! 456: esac ! 457: echo " " ! 458: echo "End of configuration questions for the B system." ! 459: ! 460: : 'Getting generic copies of makefiles and shellfiles.' ! 461: : 'Since some tar_s leave the owner of the tape as the owner of the files' ! 462: : 'this will make sure the edit scripts will not fail.' ! 463: ! 464: makefiles="./Makefile src/b/Makefile src/bed/Makefile src/bint/Makefile src/bsmall/Makefile" ! 465: shellfiles="src/b/b.sh src/b/b_p.sh" ! 466: ! 467: editor="ed -" ! 468: ! 469: cat >mf.head <<EOF ! 470: # This file was generated and edited by the Setup command. ! 471: # To make lasting changes edit the file Makefile.gen and run Setup again. ! 472: # ! 473: EOF ! 474: for f in $makefiles ! 475: do ! 476: cat mf.head $f.gen >$f ! 477: chmod 644 $f ! 478: done ! 479: rm -f mf.head ! 480: ! 481: for f in $shellfiles ! 482: do ! 483: cp $f.gen $f ! 484: chmod 755 $f ! 485: done ! 486: ! 487: echo " " ! 488: echo $n "Editing Appropriate files ... " ! 489: ! 490: case $machine in ! 491: pdp) ! 492: f=src/bed/Makefile ! 493: $editor $f <<EOF ! 494: /^LDFLAGS=/s?LDFLAGS=.*?LDFLAGS= -i? ! 495: w ! 496: q ! 497: EOF ! 498: f=src/bsmall/Makefile ! 499: $editor $f <<EOF ! 500: /^LDFLAGS=/s?LDFLAGS=.*?LDFLAGS= -i? ! 501: w ! 502: q ! 503: EOF ! 504: ;; ! 505: esac ! 506: ! 507: : 'Not all CFLAGS are used by all sources.' ! 508: : 'But for convenience and future use, we put them into all source Makefiles.' ! 509: ! 510: cflags="-O $fflag -DNDEBUG" ! 511: ! 512: for f in Makefile src/b/b.sh src/bed/Makefile ! 513: do ! 514: $editor $f <<EOF ! 515: /^BINT=/s?BINT=.*?BINT=$bint? ! 516: w ! 517: q ! 518: EOF ! 519: done ! 520: ! 521: case $bint in ! 522: bsmall) ! 523: f=Makefile ! 524: $editor $f <<EOF ! 525: /examples$/s?make .*examples?make smallexamples? ! 526: w ! 527: q ! 528: EOF ! 529: cflags="$cflags -DSMALLSYS" ! 530: ;; ! 531: esac ! 532: ! 533: case $unix in ! 534: BSD|BSD4_2|PWB) ! 535: cflags="$cflags -D$unix" ! 536: ;; ! 537: ATT) ! 538: cflags="$cflags -Dindex=strchr -Drindex=strrchr" ! 539: ;; ! 540: esac ! 541: ! 542: case $termio in ! 543: yes) ! 544: cflags="$cflags -DTERMIO" ! 545: ;; ! 546: esac ! 547: ! 548: for f in src/b/Makefile src/bed/Makefile src/$bint/Makefile ! 549: do ! 550: $editor $f <<EOF ! 551: /^CFLAGS=/s?CFLAGS=.*?CFLAGS= $cflags? ! 552: w ! 553: q ! 554: EOF ! 555: done ! 556: ! 557: case $termlib in ! 558: -l*|/*) ! 559: f=src/bed/Makefile ! 560: $editor $f <<EOF ! 561: /^TERMLIB=/s?.*?TERMLIB= $termlib? ! 562: /^OWNTLIB=/s?.*?OWNTLIB=? ! 563: w ! 564: q ! 565: EOF ! 566: ;; ! 567: libtermcap.a) ! 568: f=src/bed/Makefile ! 569: $editor $f <<EOF ! 570: /^TERMLIB=/s?.*?TERMLIB=? ! 571: /^OWNTLIB=/s?.*?OWNTLIB= libtermcap.a? ! 572: w ! 573: q ! 574: EOF ! 575: ;; ! 576: esac ! 577: ! 578: #case $termcap in ! 579: #no) ! 580: # f=src/b/Makefile ! 581: # $editor $f <<"EOF" ! 582: # /^install:/s?.*?install: all ldest termcap? ! 583: # w ! 584: # q ! 585: #EOF ! 586: # ;; ! 587: #esac ! 588: ! 589: case $public in ! 590: yes) ! 591: f=Makefile ! 592: $editor $f <<EOF ! 593: /^BDIR=/s?BDIR=.*?BDIR=$bdir? ! 594: /^MAN1DIR=/s?MAN1DIR=.*?MAN1DIR=$man1dir? ! 595: /^MAN5DIR=/s?MAN5DIR=.*?MAN5DIR=$man5dir? ! 596: /^LIBDIR=/s?LIBDIR=.*?LIBDIR=$libdir? ! 597: w ! 598: q ! 599: EOF ! 600: ;; ! 601: esac ! 602: ! 603: echo "done." ! 604: ! 605: echo " " ! 606: echo "This completes the setup of the B system." ! 607: echo "You can now try 'make all'."
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.