Loading...
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 | #!/bin/csh -f set path = ($path .) ###################################################################### # HISTORY # 1-Dec-87 Michael Young (mwyoung) at Carnegie-Mellon University # Added "-verbose" switch, so this script produces no output # in the normal case. # # 10-Oct-87 Mike Accetta (mja) at Carnegie-Mellon University # Flushed cmu_*.h and spin_locks.h # [ V5.1(XF18) ] # # 6-Apr-87 Avadis Tevanian (avie) at Carnegie-Mellon University # Use MASTER.local and MASTER.<machine>.local for generation of # configuration files in addition to MASTER and MASTER.<machine>. # # 25-Mar-87 Mike Accetta (mja) at Carnegie-Mellon University # Removed use of obsolete wb_*.h files when building the feature # list; modified to save the previous configuration file and # display the differences between it and the new file. # [ V5.1(F8) ] # # 25-Mar-87 Avadis Tevanian (avie) at Carnegie-Mellon University # If there is no /etc/machine just print out a message telling # user to use the -cpu option. I thought this script was supposed # to work even without a /etc/machine, but it doesn't... and this # is the easiest way out. # # 13-Mar-87 Mike Accetta (mja) at Carnegie-Mellon University # Added "romp_fpa.h" file to extra features for the RT. # [ V5.1(F7) ] # # 11-Mar-87 Mike Accetta (mja) at Carnegie-Mellon University # Updated to maintain the appropriate configuration features file # in the "machine" directory whenever the corresponding # configuration is generated. This replaces the old mechanism of # storing this directly in the <sys/features.h> file since it was # machine dependent and also precluded building programs for more # than one configuration from the same set of sources. # [ V5.1(F6) ] # # 21-Feb-87 Mike Accetta (mja) at Carnegie-Mellon University # Fixed to require wired-in cpu type names for only those # machines where the kernel name differs from that provided by # /etc/machine (i.e. IBMRT => ca and SUN => sun3); updated to # permit configuration descriptions in both machine indepedent # and dependent master configuration files so that attributes can # be grouped accordingly. # [ V5.1(F3) ] # # 17-Jan-87 Mike Accetta (mja) at Carnegie-Mellon University # Updated to work from any directory at the same level as # "conf"; generate configuration from both MASTER and # MASTER.<machine-type> files; added -cpu switch. # [ V5.1(F1) ] # # 18-Aug-86 Mike Accetta (mja) at Carnegie-Mellon University # Added -make switch and changed meaning of -config; upgraded to # allow multiple attributes per configuration and to define # configurations in terms of these attributes within MASTER. # # 14-Apr-83 Mike Accetta (mja) at Carnegie-Mellon University # Added -config switch to only run /etc/config without # "make depend" and "make". # ###################################################################### set prog=$0 set prog=$prog:t set nonomatch set OBJDIR=../BUILD set SOURCEDIR=. set CONFIG_DIR=$OBJROOT/SETUP/config set MASTER_CONF_DIR=. unset doconfig unset beverbose unset MACHINE unset profile unset SOC_CONFIG while ($#argv >= 1) if ("$argv[1]" =~ -*) then switch ("$argv[1]") case "-c": case "-config": set doconfig breaksw case "-cpu": if ($#argv < 2) then echo "${prog}: missing argument to ${argv[1]}" exit 1 endif set MACHINE="$argv[2]" shift breaksw case "-soc": if ($#argv < 2) then echo "${prog}: missing argument to ${argv[1]}" exit 1 endif set SOC_CONFIG="$argv[2]" shift breaksw case "-d": if ($#argv < 2) then echo "${prog}: missing argument to ${argv[1]}" exit 1 endif set OBJDIR="$argv[2]" shift breaksw case "-m": if ($#argv < 2) then echo "${prog}: missing argument to ${argv[1]}" exit 1 endif set MASTER_CONF_DIR="$argv[2]" shift breaksw case "-s": if ($#argv < 2) then echo "${prog}: missing argument to ${argv[1]}" exit 1 endif set SOURCEDIR="$argv[2]" shift breaksw case "-verbose": set beverbose breaksw case "-p": case "-profile": set profile breaksw default: echo "${prog}: ${argv[1]}: unknown switch" exit 1 breaksw endsw shift else break endif end if ($#argv == 0) set argv=(GENERIC) if (! $?MACHINE) then echo "${prog}: MACHINE not set" exit 1 endif set cpu=`echo $MACHINE | tr A-Z a-z` set ID=`echo $MACHINE | tr a-z A-Z` set MASTER_DIR=${MASTER_CONF_DIR} set MASTER = ${MASTER_DIR}/MASTER set MASTER_CPU=${MASTER}.${cpu} set MASTER_CPU_PER_SOC=${MASTER}.${cpu}.${SOC_CONFIG} if (-f $MASTER_CPU_PER_SOC) set MASTER_CPU = ${MASTER_CPU_PER_SOC} foreach SYS ($argv) set SYSID=${SYS}_${ID} set SYSCONF=$OBJDIR/config.$SYSID set BLDDIR=$OBJDIR if ($?beverbose) then echo "[ generating $SYSID from $MASTER_DIR/MASTER{,.$cpu}{,.local} ]" endif echo +$SYS \ | \ cat $MASTER $MASTER_CPU - \ $MASTER $MASTER_CPU \ | \ sed -n \ -e "/^+/{" \ -e "s;[-+];#&;gp" \ -e 't loop' \ -e ': loop' \ -e 'n' \ -e '/^#/b loop' \ -e '/^$/b loop' \ -e 's;^\([^#]*\).*#[ ]*<\(.*\)>[ ]*$;\2#\1;' \ -e 't not' \ -e 's;\([^#]*\).*;#\1;' \ -e 't not' \ -e ': not' \ -e 's;[ ]*$;;' \ -e 's;^\!\(.*\);\1#\!;' \ -e 'p' \ -e 't loop' \ -e 'b loop' \ -e '}' \ -e "/^[^#]/d" \ -e 's; ; ;g' \ -e "s;^# *\([^ ]*\)[ ]*=[ ]*\[\(.*\)\].*;\1#\2;p" \ | \ awk '-F#' '\ part == 0 && $1 != "" {\ m[$1]=m[$1] " " $2;\ next;\ }\ part == 0 && $1 == "" {\ for (i=NF;i>1;i--){\ s=substr($i,2);\ c[++na]=substr($i,1,1);\ a[na]=s;\ }\ while (na > 0){\ s=a[na];\ d=c[na--];\ if (m[s] == "") {\ f[s]=d;\ } else {\ nx=split(m[s],x," ");\ for (j=nx;j>0;j--) {\ z=x[j];\ a[++na]=z;\ c[na]=d;\ }\ }\ }\ part=1;\ next;\ }\ part != 0 {\ if ($1 != "") {\ n=split($1,x,",");\ ok=0;\ for (i=1;i<=n;i++) {\ if (f[x[i]] == "+") {\ ok=1;\ }\ }\ if (NF > 2 && ok == 0 || NF <= 2 && ok != 0) {\ print $2; \ }\ } else { \ print $2; \ }\ }\ ' >$SYSCONF.new if (-z $SYSCONF.new) then echo "${prog}: ${$SYSID}: no such configuration in $MASTER_DIR/MASTER{,.$cpu}" rm -f $SYSCONF.new endif # # These paths are used by config. # # "builddir" is the name of the directory where kernel binaries # are put. It is a single path element, never absolute, and is # always relative to "objectdir". "builddir" is used by config # solely to determine where to put files created by "config" (e.g. # the created Makefile and *.h's.) # # "objectdir" is the name of the directory which will hold "builddir". # It is a path; if relative, it is relative to the current directory # where config is run. It's sole use is to be prepended to "builddir" # to indicate where config-created files are to be placed (see above). # # "sourcedir" is the location of the sources used to build the kernel. # It is a path; if relative, it is relative to the directory specified # by the concatenation of "objectdir" and "builddir" (i.e. where the # kernel binaries are put). # echo 'builddir "."' >> $SYSCONF.new echo 'objectdir "'$OBJDIR'"' >> $SYSCONF.new set SRCDIR=`dirname $SOURCE` echo 'sourcedir "'$SRCROOT'"' >> $SYSCONF.new if (-f $SYSCONF) then diff $SYSCONF $SYSCONF.new rm -f $SYSCONF.old mv $SYSCONF $SYSCONF.old endif rm -f $SYSCONF mv $SYSCONF.new $SYSCONF if ($?doconfig) then if ($?beverbose) then echo "[ configuring $SYSID ]" endif if ($?profile) then $CONFIG_DIR/config -c $SOURCEDIR -p $SYSCONF else $CONFIG_DIR/config -c $SOURCEDIR $SYSCONF endif endif end |