From: ceriel Date: Wed, 18 Dec 1991 14:51:08 +0000 (+0000) Subject: Made installation mechanism more portable X-Git-Tag: release-5-5~528 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e35f11f20884fdc44222c8ba52fd1581f59218af;p=ack.git Made installation mechanism more portable --- diff --git a/first/.distr b/first/.distr index 200a3c3fe..ed9c6a4ef 100644 --- a/first/.distr +++ b/first/.distr @@ -1,4 +1,5 @@ create_dir +cp_dir em_path.h.src first get_answer diff --git a/first/cp_dir b/first/cp_dir new file mode 100755 index 000000000..3bc1b28a7 --- /dev/null +++ b/first/cp_dir @@ -0,0 +1,16 @@ +set -e +trap "rm -f /tmp/xx$$" 0 1 2 3 15 +case $2 in +/*) target_dir=$2 + ;; +*) target_dir=`pwd`/$2 + ;; +esac +cd $1 +tar cf /tmp/xx$$ . +if [ -d $target_dir ] +then : +else mkdir $target_dir +fi +cd $target_dir +tar xf /tmp/xx$$ diff --git a/first/first b/first/first index 3105f6915..af4aea763 100755 --- a/first/first +++ b/first/first @@ -136,7 +136,6 @@ esac echo "Your default machine to compile for is $ACM" -DISABLE_LANG= echo "Installation of the complete ACK takes a long time. Limiting the number of languages, runtime libraries, back-ends, and assemblers to be installed may save a lot of time. If you want to install everything, diff --git a/first/get_makepars b/first/get_makepars index 0c9b18bb0..94b474808 100755 --- a/first/get_makepars +++ b/first/get_makepars @@ -60,7 +60,12 @@ MACH = $MACH if [ $TARGET_HOME = $UTIL_HOME ] then - sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS/" < $FDIR/target_comp >> make_macros + if [ -f /bin/ranlib -o -f /usr/bin/ranlib -o -f /usr/ucb/ranlib ] + then + sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS/" < $FDIR/target_comp >> make_macros + else + sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros + fi if [ -f /bin/arch ] then case `/bin/arch` in @@ -78,7 +83,12 @@ else case $know_target in 1) sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS/" -e "/cc-and-mkdep.ack/s/^..//" -e "s/^CC=cc/CC=acc -m$ACM/" -e "s/^# AR=aal/AR=aal/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros ;; - *) sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS/" < $FDIR/target_comp >> make_macros + *) if [ -f /bin/ranlib -o -f /usr/bin/ranlib -o -f /usr/ucb/ranlib ] + then + sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS/" < $FDIR/target_comp >> make_macros + else + sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros + fi ;; esac sed "s/^#U/U/" < $FDIR/util_comp >> make_macros diff --git a/first/install_tail b/first/install_tail index fbc9a717c..7e7b61ae8 100644 --- a/first/install_tail +++ b/first/install_tail @@ -10,6 +10,7 @@ echo "PATH=::$CONFIG/bin:$UTIL_HOME/bin:/bin:/usr/bin:/usr/ucb; export PATH" > $ cat $SRC_HOME/TakeAction >> $CONFIG/bin/TakeAction sed '/^#PARAMS/r make_macros' < $SRC_HOME/first/mk_makefile > $CONFIG/bin/mk_makefile cp $SRC_HOME/first/create_dir $CONFIG/bin/create_dir +cp $SRC_HOME/first/cp_dir $CONFIG/bin/cp_dir chmod +x $CONFIG/bin/* $SRC_HOME/first/mk_config diff --git a/first/limit_enquire b/first/limit_enquire index 6d49a571a..bb1df736c 100644 --- a/first/limit_enquire +++ b/first/limit_enquire @@ -27,14 +27,30 @@ to disable installation of the machine-independent part" ;; esac done +OLD_DIS_LANG="$DISABLE_LANG" +DISABLE_LANG= +case X$OLD_DIS_LANG in +X) ;; +*) set $OLD_DIS_LANG + ;; +esac for i in Modula-2 Pascal Occam Basic ANSI-C C Fortran do + DEF=y + if [ $# != 0 -a X$i = X$1 ] + then + DEF=n + shift + fi while : do - echo $E_FLAG "Do you want to install $i? (y/n) $E_SFX" + echo $E_FLAG "Do you want to install $i? (y/n) [$DEF] $E_SFX" . $FDIR/get_answer + case $ANS in + '') ANS="$DEF";; + esac case X$ANS in - Xj*|Xy*|X) + Xj*|Xy*) echo "$i will be installed" echo break @@ -49,10 +65,20 @@ do esac done done +OLD_DIS_SUP="$DISABLE_SUP" DISABLE_SUP= set $MACH_LIST while test $# != 0 do + DEF=y + for i in $OLD_DIS_SUP + do + if [ X$i = X$1 ] + then + DEF=n + break + fi + done while : do case $1 in @@ -66,10 +92,13 @@ m68k4, pmds4, sun2, and mantra." m68020) echo "not installing m68020 will disable installation of sun3." ;; esac - echo $E_FLAG "Do you want to install the $1 support? (y/n) $E_SFX" + echo $E_FLAG "Do you want to install the $1 support? (y/n) [$DEF] $E_SFX" . $FDIR/get_answer + case $ANS in + '') ANS="$DEF";; + esac case X$ANS in - Xj*|Xy*|X) + Xj*|Xy*) echo "The $1 support will be installed" echo case $1 in @@ -147,7 +176,7 @@ then '') ANS="$DO_FAST" ;; esac case X$ANS in - Xj*|Xy*|X) + Xj*|Xy*) DO_FAST=y echo "The fast compilers will be installed" break diff --git a/first/lint_params b/first/lint_params index 82266fb11..c4826b389 100644 --- a/first/lint_params +++ b/first/lint_params @@ -3,16 +3,16 @@ # The current setup is for ACK lint. If you want to use the Unix lint, # put '#' signs on the next 4 lines that have ACK in them. -LINT=/usr/bin/lint # Unix lint -LINT=$(UTIL_HOME)/bin/lint # ACK lint +LINT=/usr/bin/lint# # Unix lint +LINT=$(UTIL_HOME)/bin/lint# # ACK lint -LINTOPTIONS= # options always passed to lint +LINTOPTIONS=# # options always passed to lint -LINTPREF=llib-l # prefix of unix lint libraries -LINTPREF= # ACK lint libraries do not have a prefix +LINTPREF=llib-l# # prefix of unix lint libraries +LINTPREF=# # ACK lint libraries do not have a prefix -LINTSUF=ln # suffix of Unix lint libraries -LINTSUF=llb # suffix of ACK lint libraries - -MK_LINT_LIB=lint-lib.unix # for Unix lint -MK_LINT_LIB=lint-lib.ack # for ACK lint +LINTSUF=ln# # suffix of Unix lint libraries +LINTSUF=llb# # suffix of ACK lint libraries + +MK_LINT_LIB=lint-lib.unix# # for Unix lint +MK_LINT_LIB=lint-lib.ack# # for ACK lint diff --git a/first/mk_config b/first/mk_config index 3aee9e4b7..dab032ac2 100755 --- a/first/mk_config +++ b/first/mk_config @@ -31,12 +31,6 @@ do fi done -cd $SRC_HOME/util/ceg/util -for i in make_* -do - mk_makefile $i > $CONFIG/util/ceg/util/$i -done - cd $CONFIG for i in lang/cem/cemcom.ansi lang/cem/cemcom lang/m2/comp diff --git a/first/mk_target b/first/mk_target index be17d7ac6..ee1b48234 100755 --- a/first/mk_target +++ b/first/mk_target @@ -13,9 +13,10 @@ create_dir $TARGET_HOME/modules/pkg create_dir $TARGET_HOME/modules/lib create_dir $TARGET_HOME/bin -( cd $SRC_HOME/modules/h ; tar cf - . ) | ( cd $TARGET_HOME/modules/h ; tar xf - ) +cp_dir $SRC_HOME/modules/h $TARGET_HOME/modules/h cp local.h em_path.h $TARGET_HOME/config -( cd $SRC_HOME/bin ; tar cf - . ) | ( cd $TARGET_HOME/bin ; tar xf - ) +cp_dir $SRC_HOME/bin $TARGET_HOME/bin +cp $CONFIG/bin/cp_dir $TARGET_HOME/bin/cp_dir echo "echo $SYSNAME" > $TARGET_HOME/bin/ack_sys chmod +x $TARGET_HOME/bin/ack_sys @@ -33,10 +34,10 @@ create_dir $TARGET_HOME/include create_dir $TARGET_HOME/doc cp $SRC_HOME/etc/ip_spec.t $TARGET_HOME/etc/ip_spec.t -( cd $SRC_HOME/lib ; tar cf - . ) | ( cd $TARGET_HOME/lib ; tar xf - ) -( cd $SRC_HOME/include ; tar cf - . ) | ( cd $TARGET_HOME/include ; tar xf - ) -( cd $SRC_HOME/h ; tar cf - . ) | ( cd $TARGET_HOME/h ; tar xf - ) -( cd $SRC_HOME/doc ; tar cf - . ) | ( cd $TARGET_HOME/doc ; tar xf - ) +cp_dir $SRC_HOME/lib $TARGET_HOME/lib +cp_dir $SRC_HOME/h $TARGET_HOME/h +cp_dir $SRC_HOME/doc $TARGET_HOME/doc +cp_dir $SRC_HOME/include $TARGET_HOME/include cd $TARGET_HOME find . -type f -exec chmod +w {} \; diff --git a/first/target_comp b/first/target_comp index 547587ae2..4e41566c2 100644 --- a/first/target_comp +++ b/first/target_comp @@ -1,23 +1,23 @@ # compiler set for target machine -CC=cc # compiler to be used for compiling ACK +CC=cc# # compiler to be used for compiling ACK +# always passed to $(CC) -c. COPTIONS=-O -D_EM_WSIZE=4 -D_EM_PSIZE=4 - # always passed to $(CC) -c. -CC_AND_MKDEP=cc-and-mkdep.all # when $(CC) is neither ACK or SUN, -# CC_AND_MKDEP=cc-and-mkdep.ack # when $(CC) is an ACK-derived C compiler, -# CC_AND_MKDEP=cc-and-mkdep.sun # when $(CC) is a SUN C compiler +CC_AND_MKDEP=cc-and-mkdep.all# # when $(CC) is neither ACK or SUN, +# CC_AND_MKDEP=cc-and-mkdep.ack## when $(CC) is an ACK-derived C compiler, +# CC_AND_MKDEP=cc-and-mkdep.sun## when $(CC) is a SUN C compiler -LDOPTIONS= # always passed to $(CC) when linking +LDOPTIONS=# # always passed to $(CC) when linking -SUF=o # suffix of files produced with $(CC) -c +SUF=o# # suffix of files produced with $(CC) -c -AR=ar # archiver for Unix format objects -# AR=aal # archiver for ACK .o format objects -# AR=arch # archiver for ACK .s format objects +AR=ar# # archiver for Unix format objects +# AR=aal# # archiver for ACK .o format objects +# AR=arch# # archiver for ACK .s format objects -RANLIB=ranlib # when ranlib required -# RANLIB=: # when ranlib not required +RANLIB=ranlib# # when ranlib required +# RANLIB=:# # when ranlib not required -LIBSUF=a # suffix of object libraries +LIBSUF=a# # suffix of object libraries diff --git a/first/util_comp b/first/util_comp index 37d011806..377d04664 100644 --- a/first/util_comp +++ b/first/util_comp @@ -8,16 +8,16 @@ # has already changed them, but they should be checked to be sure. UCC=$(CC) -#UCC=cc # compiler to be used +#UCC=cc# # compiler to be used UCOPTIONS=$(COPTIONS) -#UCOPTIONS=-O # always passed to $(UCC) -c. +#UCOPTIONS=-O# # always passed to $(UCC) -c. ULDOPTIONS=$(LDOPTIONS) -#ULDOPTIONS= # always passed to $(UCC) when linking +#ULDOPTIONS=# # always passed to $(UCC) when linking USUF=$(SUF) -#USUF=o # suffix of files produced with $(UCC) -c +#USUF=o# # suffix of files produced with $(UCC) -c ULIBSUF=$(LIBSUF) -#ULIBSUF=a # suffix of object libraries for $(UCC) +#ULIBSUF=a# # suffix of object libraries for $(UCC)