1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748
|
#!/bin/sh
#
# Configure -- configure lslk
#
# See the LSLK_HLP here document for usage.
#
# When configuring for a particular dialect, <target-dialect>, this script
# requires that the subdirectory ./dialects/<target-dialect> contain a
# shell script, named $LSLK_MK, that places its source modules in this
# directory.
#
# $Id: Configure,v 1.22 2001/01/08 18:27:29 abe Exp $
LSLK_F="dmnt.c dlock.c dlock1.c dstore.c dlslk.h dproto.h kernelbase.h machine.h machine.h.old new_machine.h"
LSLK_HLP=/tmp/cfghlp.$$
#LSLK_LOCALSUFFIX may be introduced through the environment to select a local
# version of a Makefile. It is used as a suffix to $LSLK_MKF.
LSLK_MK=Mksrc
#LSLK_MKC is the dialect's Mksrc create command -- default "ln -s".
# LSLK_MKFC may be introduced though the environment to change the name
# used for the created make file.
if test "X$LSLK_MKFC" = "X" # {
then
LSLK_MKFC=Makefile
fi # }
LSLK_MKF=Makefile
LSLK_VF=version
# Make sure no other variable important to Makefile construction is
# already set in the environment.
#
# $LSLK_CC C compiler name (default = none)
# $LSLK_CCV C compiler version (default = none)
# $LSLK_CFGD depend options
# $LSLK_CFGDN depend file name
# $LSLK_CFGF C flags -- e.g., -D's
# $LSLK_CFGL loader flags -- e.g., -l's
# $LSLK_DEBUG Makefile's DEBUG string
# $LSLK_DINC include flags -- -I's
# $LSLK_LOCALSUFFIX local suffix for Makefile -- e.g., PUCC for
# Purdue University Computing Center's special
# Makefile
# $LSLK_SCRIPT_CALL Customize and Inventory scripts call status
# $LSLK_TMP1 internal temporary
# $LSLK_TMPC /tmp temporary C source file name
# $LSLK_VERS UNIX dialect version
LSLK_CC=""
LSLK_CCV=""
LSLK_CFGD=""
LSLK_CFGDN=""
LSLK_CFGF=""
LSLK_CFGL=""
LSLK_DEBUG=""
LSLK_DINC=""
LSLK_DOC=""
LSLK_SCRIPT_CALL="yes"
LSLK_TMP1=""
LSLK_TMPC=./lslk_Configure_tmp_$$
LSLK_VERS=""
# Make sure the help file is removed before an abnormal exit.
trap 'rm -f $LSLK_HLP; exit 1' 1 2 3 15
rm -f $LSLK_HLP
cat > $LSLK_HLP << LSLK_HLP
Usage: Configure <options> <target-dialect>
<options> may be:
-clean : clean up previous configuration
-h|-help : display help information
-n : avoid customization and inventory check
<target-dialect> may be:
aix : IBM AIX
desosf : DEC OSF/1, Digital UNIX, Tru64 UNIX 2.0, 3.0, 3.2, 4.0,
and 5.[01]
digunix|du : DEC OSF/1, Digital UNIX, Tru64 UNIX 2.0, 3.0, 3.2, 4.0,
and 5.[01]
linux : Linux
ptx : Sequent PTX 2.1.9, 4.2.1, 4.3, and 4.4
osr|sco : SCO Open Desktop or Open Server 3.0 and 5.0.[024]
solaris : Solaris 2.[12345], 2.5.1, and 2.[67] using gcc
solariscc : Solaris 2.[12345], 2.5.1, and 2.[67] using Sun's cc
sunos : SunOS 4.1.[34], using gcc
sunoscc : SunOS 4.1.[34], using Sun's cc
tru64 : DEC OSF/1, Digital UNIX, Tru64 UNIX 2.0, 3.0, 3.2, 4.0,
and 5.[01]
LSLK_HLP
LSLK_TGT="no-target"
args=$#
while test $args -gt 0
do
case $1 in # {
-clean)
if test -r $LSLK_MKFC # {
then
make -f $LSLK_MKFC clean
fi # }
rm -f $LSLK_F $LSLK_MKFC $LSLK_HLP version.h dialects/osr/osr_*
echo rm -f $LSLK_F $LSLK_MKFC version.h
rm -f dialects/du/du5_sys_malloc.h
echo "rm -f dialects.du.du5_sys_malloc.h"
rm -f $LSLK_HLP
exit 0
;;
-h|-help) cat $LSLK_HLP
rm -f $LSLK_HLP
exit 0
;;
-n*)
LSLK_SCRIPT_CALL="no"
;;
*)
if test $LSLK_TGT != no-target # {
then
echo "Only one dialect may be configured at a time."
echo 'Both "$LSLK_TGT" and "$1" were specified.'
cat $LSLK_HLP
rm -f $LSLK_HLP
exit 1
else # }{
LSLK_TGT=$1
fi # }
;;
esac # }
shift
args=`expr $args - 1`
done
case $LSLK_TGT in # {
no-target)
echo "No target dialect was specified."
cat $LSLK_HLP
rm -f $LSLK_HLP
exit 1
;;
# Configure for IBM AIX.
aix)
if test -x /usr/bin/oslevel # {
then
echo "Determining AIX version with /usr/bin/oslevel."
echo "This may take a while, depending on your maintenance level."
LSLK_CFGF=`/usr/bin/oslevel | sed 's/[^0-9]*\(.*\)/\1/' | sed 's/\.//g'`
echo "Oslevel reports the version is $LSLK_CFGF."
else # }{
LSLK_CFGF=`uname -rv | awk '{printf "%d%d00\n",\$2,\$1}'`
echo "WARNING: can't execute /usr/bin/oslevel; uname -rv reports the"
echo " version is $LSLK_CFGF; edit CFGF in the Makefile to correct"
echo " the terminating 00; it should be 10 X the last AIX "
echo " version component -- e.g., 50 for AIX 3.2.5."
fi # }
LSLK_CFGF="-DAIXV=$LSLK_CFGF"
LSLK_CFGL=""
LSLK_DIALECT_DIR=aix
rm -f ${LSLK_TMPC}.*
echo "main(){}" > ${LSLK_TMPC}.c
cc -c ${LSLK_TMPC}.c -o ${LSLK_TMPC}.o -qlist > /dev/null 2>&1
LSLK_CCV=`head -1 ${LSLK_TMPC}.lst | sed 's/\(.**\) ---.*/\1/'`
rm ${LSLK_TMPC}.*
;;
# Configure for DEC OSF/1, Digital UNIX, and Tru64 UNIX.
decosf|digunix|du|tru64)
LSLK_CC=cc
case `uname -r` in # {
V2.0)
LSLK_DUV=20000
;;
V3.0)
LSLK_DUV=30000
;;
V3.2)
LSLK_DUV=30200
;;
?4.0)
LSLK_DUV=40000
;;
?5.0)
LSLK_DUV=50000
;;
?5.1)
LSLK_DUV=50100
;;
*)
echo "WARNING: unknown version; assuming version is 2.0"
LSLK_DUV=20000
;;
esac # }
echo "Determining the ADVFS version -- this may take a while."
LSLK_ADVFSV=`/usr/sbin/setld -i | grep "^OSFADVFSBIN[0-9]" | sed 's/\([^ ]*\).*/\1/' | sort -u | tail -1 | sed 's/OSFADVFSBIN//'`
case $LSLK_ADVFSV in # {
1*)
LSLK_ADVFSV=100
echo "The ADVFS version is 1."
;;
2*)
LSLK_ADVFSV=200
echo "The ADVFS version is 2."
;;
3*)
LSLK_ADVFSV=300
echo "The ADVFS version is 3."
;;
4*)
LSLK_ADVFSV=400
echo "The ADVFS version is 4."
;;
5*)
LSLK_ADVFSV=500
echo "The ADVFS version is 5."
;;
*)
echo "The ADVFS version is unknown; it will be assumed to be 1."
LSLK_ADVFSV=100
;;
esac # }
LSLK_CFGF="-DDUV=${LSLK_DUV} -DADVFSV=${LSLK_ADVFSV}"
LSLK_CFGL="-lmld"
LSLK_HOST=`uname -n`
if test "${LSLK_DUV}" -lt 40000 # {
then
LSLK_SYSDIR=/sys
else # }{
LSLK_SYSDIR=/usr/sys
fi # }
LSLK_CDIR=`expr $LSLK_HOST : '\([^\.]*\)\..*$'`
if test "X$LSLK_CDIR" = "X" # {
then
LSLK_CDIR=$LSLK_HOST
fi # }
LSLK_CDIR=`echo $LSLK_CDIR | tr a-z A-Z`
LSLK_LOOP=1
while test $LSLK_LOOP = 1
do
if test -d ${LSLK_SYSDIR}/$LSLK_CDIR # {
then
echo "Using header files in ${LSLK_SYSDIR}/$LSLK_CDIR"
LSLK_LOOP=0
else # }{
cat << .CAT_MARK
Please enter the name of the subdirectory in $LSLK_SYSDIR that contains the
configuration files for this host. Usually its name would be $LSLK_CDIR, but
that subdirectory doesn't seem to exist. The lslk compilation needs header
files specific to this machine's configuration found in that directory. Lslk
may be able to use the BINARY subdirectory, if it exists. you can tell lslk
to use BINARY if you can't find anything else appropriate.
.CAT_MARK
echo "$LSLK_SYSDIR contains:"
echo ""
ls -CF $LSLK_SYSDIR
echo ""
echo -n "Configuration subdirectory name? "
read LSLK_CDIR LSLK_EXCESS
if test "X$LSLK_CDIR" = "X" -o ! -d ${LSLK_SYSDIR}/$LSLK_CDIR # {
then
echo ""
echo Cannot access directory ${LSLK_SYSDIR}/$LSLK_CDIR.
fi # }
fi # }
done
LSLK_DINC="-I/usr/sys/include -I${LSLK_SYSDIR}/$LSLK_CDIR"
if test $LSLK_DUV -ge 50000 # {
then
# Make du5_sys_malloc.h for Tru64 UNIX and above. Disable some compiler
# warning messages to compensate for errors in Tru64 UNIX 5 RPC and XDR
# header files.
LSLK_TMP1=/usr/include/sys/malloc.h
if test -r $LSLK_TMP1 # {
then
LSLK_TMP2=dialects/du/du5_sys_malloc.h
rm -f $LSLK_TMP2
echo "#if !defined(MANUFACTURED_DU5_SYS_MALLOC_H)" > $LSLK_TMP2
echo "/* By lsof Configure:" `date` " */" >> $LSLK_TMP2
echo "#define MANUFACTURED_DU5_SYS_MALLOC_H" >> $LSLK_TMP2
grep "^#define[ ]MALLOC_NUM_BUCKETS" $LSLK_TMP1 >> $LSLK_TMP2
echo "struct percpukmembuckets {" >> $LSLK_TMP2
sed '1,/^struct percpukmembuckets/d' $LSLK_TMP1 | sed -n '1,/^};/p' >> $LSLK_TMP2
echo "#endif" >> $LSLK_TMP2
LSLK_CFGF="$LSLK_CFGF -I`pwd`/dialects/du"
fi # }
fi # }
LSLK_DIALECT_DIR=du
;;
# Configure for Linux.
linux)
LSLK_CC=gcc
LSLK_CFGF=`uname -r|sed 's/\./ /g'|awk '{printf "%d%d%02d",\$1,\$2,\$3}'`
LSLK_CFGF="-DLINUXV=$LSLK_CFGF"
cat /proc/locks > /dev/null 2>&1
LSLK_CFGL=""
if test -r /proc/locks # {
then
# Configure for /proc-based Linux lslk.
LSLK_DIALECT_DIR=linux/proc
else # }{
# Configure for /dev/kmem-based Linux lslk.
if test -r /usr/src/linux/include/linux/autoconf.h # {
then
egrep "^#define[ ]*CONFIG_KERNEL_ELF" /usr/src/linux/include/linux/autoconf.h > /dev/null
if test $? -eq 0 # {
then
LSLK_CFGF="$LSLK_CFGF -DKERN_LD_ELF"
fi # }
fi # }
LSLK_DIALECT_DIR=linux/kmem
fi # }
;;
# Configure for Sequent PTX 4.x.
ptx)
LSLK_VERS=`uname -v|awk -F. '{printf "%d%d%d",substr($1,2), $2, $3}'`
if test $LSLK_VERS -ge 400 # {
then
# PTX 4.x tests
if test $LSLK_VERS -lt 410 # {
then
LSLK_CFGL="-lelf -linet -lnsl -lseq"
else # }{
LSLK_CFGL="-lelf -lnsl -lseq -lsocket"
fi # }
else # }{
# PTX 2.x
LSLK_CFGL="-linet -lnsl -lseq"
fi # }
LSLK_CFGF="-DPTXV=$LSLK_VERS $LSLK_CFGF"
if test -r /usr/include/sys/vx_inode.h # {
then
LSLK_CFGF="$LSLK_CFGF -DHASVXFS"
fi # }
LSLK_DIALECT_DIR=ptx
;;
# Configure for SCO OpenServer.
osr|sco)
case "`LANG=C_C.C uname -X 2>/dev/null | grep Release | sed 's/Release = \(.*\)/\1/'`" in # {
3.2v4.2)
LSLK_CFGF="-nointl"
LSLK_CFGL="-lsocket -lc_s"
LSLK_DEBUG="-Ox"
LSLK_VERS="42"
;;
3.2v5.0.*)
LSLK_CFGF="-belf"
LSLK_CFGL="-lsocket"
LSLK_DEBUG="-O3 -Kspace"
LSLK_VERS="500"
;;
*)
echo Unknown SCO Unix release: `uname -X | grep Release`
echo Assuming 3.2v4.2
LSLK_CFGF="-nointl"
LSLK_CFGL="-lsocket -lc_s"
LSLK_DEBUG="-Ox"
LSLK_MKC="cp"
LSLK_VERS="42"
;;
esac # }
LSLK_CFGF="-DOSRV=${LSLK_VERS} $LSLK_CFGF"
/bin/nm /lib/libc.a | grep statlstat > /dev/null 2>&1
if test $? -eq 0 # {
then
LSLK_CFGF="$LSLK_CFGF -DHAS_STATLSTAT"
fi # }
if test -r /usr/include/sys/fs/nfs/rnode.h # {
then
LSLK_CFGF="$LSLK_CFGF -DHAS_NFS"
fi # }
if test ! -r /usr/include/netdb.h # {
then
LSLK_DINC="-I./dialects/osr/include"
fi # }
if test $LSLK_VERS -eq 500 # {
then
grep "^#if !defined(INKERNEL) && !defined(_KERNEL) && defined(__STAT_TYPES__)$" /usr/include/sys/net/memory.h >> /dev/null
if test $? -ne 0 # {
then
echo "Applying __STAT_TYPES__ patch to <sys/net/memory.h>"
rm -rf ./dialects/osr/osr_${LSLK_VERS}
mkdir ./dialects/osr/osr_${LSLK_VERS}
mkdir ./dialects/osr/osr_${LSLK_VERS}/sys
mkdir ./dialects/osr/osr_${LSLK_VERS}/sys/net
sed '/^#if !defined(INKERNEL) && !defined(_KERNEL)$/s/$/ \&\& defined(__STAT_TYPES__)/' < /usr/include/sys/net/memory.h > ./dialects/osr/osr_${LSLK_VERS}/sys/net/memory.h
LSLK_DINC="$LSLK_DINC -I./dialects/osr/osr_${LSLK_VERS}"
fi # }
fi # }
LSLK_DIALECT_DIR=osr
;;
# Configure for Sun Solaris 2.x.
solaris*)
if test "X$LSLK_TGT" = "Xsolariscc" # {
then
LSLK_CC=cc
LSLK_TGT="solaris"
else # }{
LSLK_CC=gcc
fi # }
case "`uname -r`" in # {
5.[0-2])
echo "Lslk is untested for Solaris versions below 2.3, so Configure"
echo "is assuming this is Solaris 2.3."
LSLK_VERS="20300"
;;
5.3)
LSLK_VERS="20300"
;;
5.4)
LSLK_VERS="20400"
;;
5.5)
LSLK_VERS="20500"
;;
5.5.1)
LSLK_VERS="20501"
;;
5.6)
LSLK_VERS="20600"
;;
5.7)
LSLK_VERS="70000"
;;
5.8)
LSLK_VERS="80000"
;;
*)
echo Unknown Solaris version: `uname -r`
echo "Configure is assuming this is Solaris 2.6."
LSLK_VERS="20600"
;;
esac # }
LSLK_CFGF="-Dsolaris=$LSLK_VERS"
# Determine kernel bit size for Solaris 7 and 8.
if test $LSLK_VERS -ge 70000 # {
then
/bin/isainfo -kv | grep 64 > /dev/null
if test $? -eq 0 # {
then
echo $LSLK_CC | grep gcc > /dev/null
if test $? -eq 0 # {
then
# Test gcc for 64 bit support.
echo "Testing $LSLK_CC for 64 bit support"
rm -f ${LSLK_TMPC}.*
echo "main(){}" > ${LSLK_TMPC}.c
LSLK_TMP1=""
# First try gcc's -m64 option -- it's the most current possibility.
$LSLK_CC ${LSLK_TMPC}.c -m64 -o ${LSLK_TMPC}.x > /dev/null 2>&1
if test $? -eq 0 # {
then
/bin/file ${LSLK_TMPC}.x | /bin/grep 64 > /dev/null
if test $? -eq 0 # {
then
LSLK_TMP1="-m64"
fi # }
fi # }
rm -f ${LSLK_TMPC}.*
if test "X$LSLK_TMP1" = "X" # {
then
# Try using the older -mcpu=v9 option with gcc instead of -m64.
echo "main(){}" > ${LSLK_TMPC}.c
$LSLK_CC ${LSLK_TMPC}.c -mcpu=v9 -o ${LSLK_TMPC}.x > /dev/null 2>&1
if test $? -eq 0 # {
then
/bin/file ${LSLK_TMPC}.x | /bin/grep 64 > /dev/null
if test $? -eq 0 # {
then
LSLK_TMP1="-mcpu=v9"
fi # }
fi # }
rm -f ${LSLK_TMPC}.*
fi # }
if test "X$LSLK_TMP1" = "X" # {
then
echo ""
echo "!!!WARNING!!!=========!!!WARNING!!!=========!!!WARNING!!!"
echo "! !"
echo "! LSLK NEEDS TO BE CONFIGURED FOR A 64 BIT KERNEL, BUT !"
echo "! THIS GCC DOESN'T SUPPORT THE BUILDING OF 64 BIT !"
echo "! SOLARIS EXECUTABLES. LSLK WILL BE CONFIGURED FOR A !"
echo "! 32 BIT echo KERNEL. !"
echo "! !"
echo "!!!WARNING!!!=========!!!WARNING!!!=========!!!WARNING!!!"
echo ""
else
echo ""
echo "*********************************"
echo "* Configuring for 64 bit kernel *"
echo "*********************************"
echo ""
LSLK_CFGF="$LSLK_CFGF $LSLK_TMP1"
LSLK_CINFO="64 bit kernel"
fi # }
else
# Test Sun compiler for 64 bit support.
echo "Testing $LSLK_CC for 64 bit support"
rm -f ${LSLK_TMPC}.*
echo "main(){}" > ${LSLK_TMPC}.c
LSLK_TMP1=0
$LSLK_CC ${LSLK_TMPC}.c -xarch=v9 -o ${LSLK_TMPC}.x > /dev/null 2>&1
if test $? -eq 0 # {
then
/bin/file ${LSLK_TMPC}.x | /bin/grep 64 > /dev/null
if test $? -eq 0 # {
then
LSLK_TMP1=1
fi # }
fi # }
rm -f ${LSLK_TMPC}.*
if test $LSLK_TMP1 -eq 1 # {
then
LSLK_CFGF="$LSLK_CFGF -xarch=v9"
echo ""
echo "*********************************"
echo "* Configuring for 64 bit kernel *"
echo "*********************************"
echo ""
LSLK_CINFO="64 bit kernel"
else
echo ""
echo "!!!WARNING!!!==========!!!WARNING!!!==========!!!WARNING!!!"
echo "! !"
echo "! LSLK NEEDS TO BE CONFIGURED FOR A 64 BIT KERNEL, BUT |"
echo "! THE VERSION OF SUN C AVAILABLE DOESN'T SUPPORT THE !"
echo "! -xarch=v9 FLAG. LSLK WILL BE CONFIGURED FOR A 32 BIT !"
echo "! KERNEL. !"
echo "! !"
echo "!!!WARNING!!!==========!!!WARNING!!!==========!!!WARNING!!!"
echo ""
fi # }
fi # }
else
echo ""
echo "*********************************"
echo "* Configuring for 32 bit kernel *"
echo "*********************************"
echo ""
LSLK_CINFO="32 bit kernel"
fi # }
fi # }
LSLK_CFGL="-lkvm -lelf -lnsl"
LSLK_DIALECT_DIR=solaris
if test "X$LSLK_LOCALSUFFIX" = "XPUCC" # {
then
LSLK_DOC="\${DESTDIR}/usr/local/man"
fi # }
;;
# Configure for Sun SunOS (Solaris 1.x).
sunos*)
if test "X$LSLK_TGT" = "Xsunos" # {
then
LSLK_CC=gcc
LSLK_CFGF="-ansi"
else # }{
LSLK_CC=cc
rm -f ${LSLK_TMPC}.*
echo "main() { const x; }" > ${LSLK_TMPC}.c
cc -c ${LSLK_TMPC}.c -o ${LSLK_TMPC}.o > /dev/null 2>&1
if test $? -ne 0 # {
then
LSLK_CFGF="-DNOCONST"
fi # }
rm -f ${LSLK_TMPC}.*
fi # }
LSLK_CFGL="-lkvm"
LSLK_DIALECT_DIR=sunos
if test "X$LSLK_LOCALSUFFIX" = "XPUCC" # {
then
LSLK_DOC="\${DESTDIR}/usr/man"
fi # }
;;
*)
echo "Can't configure for $LSLK_TGT."
cat $LSLK_HLP
rm -f $LSLK_HLP
exit 1
;;
esac # }
# Do an inventory of the distribution, as required.
if test "X$LSLK_SCRIPT_CALL" = "Xyes" -a ! -r ./.neverInv # {
then
if test ! -x ./Inventory # {
then
echo "Can't find or execute Inventory script."
rm -f $LSLK_HLP
exit 1
fi # }
./Inventory
fi # }
# Make sure target directory exists.
if test ! -d ./dialects/$LSLK_DIALECT_DIR # {
then
echo "Can't configure for $LSLK_TGT -- ./dialects/$LSLK_DIALECT_DIR doesn't exist."
rm -f $LSLK_HLP
exit 1
fi # }
# Make sure $LSLK_MK exists in the target directory.
if test ! -r ./dialects/$LSLK_DIALECT_DIR/$LSLK_MK # {
then
echo "Can't configure for $LSLK_TGT -- ./dialects/$LSLK_DIALECT_DIR/$LSLK_MK doesn't exist."
rm -f $LSLK_HLP
exit 1
fi # }
# Make sure $LSLK_MKF (or $LSLK_MKF.$LSLK_LOCALSUFFIX) exists in the
# target directory.
if test "X$LSLK_LOCALSUFFIX" != "X" # {
then
LSLK_REST=$LSLK_MKF.$LSLK_LOCALSUFFIX
else # }{
LSLK_REST=$LSLK_MKF
fi # }
if test ! -r ./dialects/$LSLK_DIALECT_DIR/$LSLK_REST # {
then
echo "Can't configure for $LSLK_TGT -- ./dialects/$LSLK_DIALECT_DIR/$LSLK_REST doesn't exist."
rm -f $LSLK_HLP
exit 1
fi # }
# Make sure $LSLK_VF exists. Extract the version number from it.
if test ! -r $LSLK_VF # {
then
echo "Version number file, ./$LSLK_VF, does not exist."
rm -f $LSLK_HLP
exit 1
else # }{
LSLK_VN=`sed "s/.ds VN \(.*\)/\1/" < version`
fi # }
# Clean up in advance.
rm -f $LSLK_F $LSLK_MKFC
echo rm -f $LSLK_F $LSLK_MKFC
# Make the dialect sources.
if test "X$LSLK_MKC" = "X" # {
then
LSLK_MKC="ln -s"
fi # }
LSLK_MKC=$LSLK_MKC ./dialects/$LSLK_DIALECT_DIR/$LSLK_MK $LSLK_TGT
# Make $LSLK_MKFC.
echo "# $LSLK_TGT Makefile for lslk version $LSLK_VN" > $LSLK_MKFC
echo "" >> $LSLK_MKFC
if test "X$LSLK_CC" != "X" # {
then
echo "CC= $LSLK_CC" >> $LSLK_MKFC
else # }{
echo "CC= cc" >> $LSLK_MKFC
fi # }
if test "X$LSLK_CCV" != "X" # {
then
echo "CCV= $LSLK_CCV" >> $LSLK_MKFC
else # }{
if test "X$LSLK_CC" = "Xgcc" # {
then
LSLK_CCV=`gcc -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'`
echo "CCV= $LSLK_CCV" >> $LSLK_MKFC
fi # }
fi # }
echo "" >> $LSLK_MKFC
if test "X$LSLK_CFGD" != "X" # {
then
echo "CFGD= $LSLK_CFGD" >> $LSLK_MKFC
fi # }
if test "X$LSLK_CFGDN" != "X" # {
then
echo "CFGDN= $LSLK_CFGDN" >> $LSLK_MKFC
fi # }
echo "CFGF= $LSLK_CFGF" >> $LSLK_MKFC
echo "CFGL= $LSLK_CFGL" >> $LSLK_MKFC
if test "X$LSLK_DEBUG" != "X" # {
then
echo "DEBUG= $LSLK_DEBUG" >> $LSLK_MKFC
fi # }
echo "" >> $LSLK_MKFC
if test "X$LSLK_DINC" != "X" # {
then
echo "DINC= $LSLK_DINC" >> $LSLK_MKFC
echo "" >> $LSLK_MKFC
fi # }
if test "X$LSLK_DOC" != "X" # {
then
echo "DOC=$LSLK_DOC" >> $LSLK_MKFC
fi # }
echo "" >> $LSLK_MKFC
cat ./dialects/$LSLK_DIALECT_DIR/$LSLK_REST >> $LSLK_MKFC
echo $LSLK_MKFC created.
rm -f $LSLK_HLP
exit 0
|