📄 configure
字号:
;; esac esacdone# Find the source files, if location was not specified.if [ x$srcdir = x ]then srcdirdefaulted=1 srcdir=. if [ ! -r tree.c ] then srcdir=.. fifiif [ ! -r ${srcdir}/grant.c ]then if [ x$srcdirdefaulted = x ] then echo "$progname: Can't find CHILL frontend sources in \`${srcdir}'" 1>&2 else echo "$progname: Can't find CHILL frontend sources in \`.' or \`..'" 1>&2 fi exit 1fi# Make sure that scripts are executable[ -w ${srcdir} -a -f ${srcdir}/regression.sh ] && \ chmod +x ${srcdir}/regression.sh [ -w ${srcdir} -a -f ${srcdir}/regression.prpt ] && \ chmod +x ${srcdir}/regression.prpt[ -w ${srcdir} -a -f ${srcdir}/regression.awk3 ] && \ chmod +x ${srcdir}/regression.awk3if [ -r ${srcdir}/config.status ] && [ x$srcdir != x. ]then echo "$progname: \`configure' has been run in \`${srcdir}'" 1>&2 exit 1fihost_xmake_file=host_truncate_target=# Complain if an arg is missingif [ x$build = x ]then # If host was specified, always use it for build also to avoid # confusion. If someone wants a cross compiler where build != host, # then they must specify build explicitly. Since this case is # extremely rare, it does not matter that it is slightly inconvenient. if [ x$host != x ] then build=$host # This way of testing the result of a command substitution is # defined by Posix.2 (section 3.9.1) as well as traditional shells. elif build=`${srcdir}/../config.guess` then echo "This appears to be a ${build} system." 1>&2 elif [ x$target != x ] then echo 'Config.guess failed to determine the host type. Defaulting to target.' build=$target else echo 'Config.guess failed to determine the host type. You need to specify one.' 1>&2 echo "\Usage: `basename $progname` [--host=HOST] [--build=BUILD] [--prefix=DIR] [--gxx-include-dir=DIR] [--local-pref=DIR] [--exec-pref=DIR] [--with-gnu-as] [--with-gnu-ld] [--with-stabs] [--with-elf] [--nfp] TARGET" 1>&2 echo "Where HOST, TARGET and BUILD are three-part configuration names " 1>&2 if [ -r config.status ] then tail +2 config.status 1>&2 fi exit 1 fifi# If $host was not specified, use $build.if [ x$host = x ]then host=$buildfi# If $target was not specified, use $host.if [ x$target = x ]then target=$hostfi# Validate the specs, and canonicalize them.canon_build=`/bin/sh $srcdir/../config.sub $build` || exit 1canon_host=`/bin/sh $srcdir/../config.sub $host` || exit 1canon_target=`/bin/sh $srcdir/../config.sub $target` || exit 1rm -f config.bakif [ -f config.status ]; then mv -f config.status config.bak; fi## For the current directory and all of the designated SUBDIRS,# do the rest of the script...#if [ ! -d testsuite ] ; then mkdir testsuite; fi_SUBDIRS=for d in $SUBDIRS; do [ -d $srcdir/$d ] && _SUBDIRS="$_SUBDIRS $d"donesavesrcdir=$srcdirSTARTDIR=`pwd`for subdir in $_SUBDIRSdo tmake_file= host_xmake_file= oldsrcdir=$savesrcdir # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed. invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'` # Re-adjust the path # Also create a .gdbinit file which runs the one in srcdir # and tells GDB to look there for source files. case $oldsrcdir in ".") srcdir=. ;; /*) # absolute path srcdir=${oldsrcdir}/${subdir} ;; *) # otherwise relative srcdir=${invsubdir}${oldsrcdir}/${subdir} ;; esac if [ -r ${oldsrcdir}/${subdir}/.gdbinit -a ${oldsrcdir} != "." ] ; then cat > ${subdir}/.gdbinit <<EOFdir .dir ${srcdir}source ${srcdir}/.gdbinitEOF fi case $oldsrcdir in /*) ;; *) oldsrcdir=${invsubdir}${oldsrcdir} ;; esac mainsrcdir=${oldsrcdir}/.. test -d $subdir || mkdir $subdir cd $subdir # # Create Makefile.tem from Makefile.in. # Make it set VPATH if necessary so that the sources are found. # Also change its value of srcdir. rm -f Makefile.tem echo "VPATH = ${srcdir}" \ | cat - ${srcdir}/Makefile.in \ | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.tem # Conditionalize the makefile for this host machine. if [ -f ${mainsrcdir}/config/${host_xmake_file} ] then rm -f Makefile.xx sed -e "/####host/ r ${mainsrcdir}/config/${host_xmake_file}" Makefile.tem > Makefile.xx echo "Merged ${host_xmake_file}." rm -f Makefile.tem mv Makefile.xx Makefile.tem else # Say in the makefile that there is no host_xmake_file, # by using a name which (when interpreted relative to $srcdir/config) # will duplicate another dependency: $srcdir/Makefile.in. host_xmake_file=../Makefile.in fi # Define variables host_canonical, build_canonical, and target_canonical # because some Cygnus local changes in the Makefile depend on them. echo host_canonical = ${canon_host} > Makefile.xx echo target_canonical = ${canon_target} >> Makefile.xx echo build_canonical = ${canon_build} >> Makefile.xx cat Makefile.tem >> Makefile.xx mv Makefile.xx Makefile.tem # Conditionalize the makefile for this target machine. if [ -f ${mainsrcdir}/config/${tmake_file} ] then rm -f Makefile.xx sed -e "/####target/ r ${mainsrcdir}/config/${tmake_file}" Makefile.tem > Makefile.xx echo "Merged ${tmake_file}." rm -f Makefile.tem mv Makefile.xx Makefile.tem else # Say in the makefile that there is no tmake_file, # by using a name which (when interpreted relative to $srcdir/config) # will duplicate another dependency: $srcdir/Makefile.in. tmake_file=../Makefile.in fi # CYGNUS LOCAL # Conditionalize the makefile for this site. if [ -f ${mainsrcdir}/config/ms-${site} ] then rm -f Makefile.xx sed -e "/####site/ r ${mainsrcdir}/config/ms-${site}" Makefile.tem > Makefile.xx echo "Merged ms-${site}." rm -f Makefile.tem mv Makefile.xx Makefile.tem fi # CYGNUS LOCAL # If this is a cross compilation, and we have newlib in the build # tree, then define inhibit_libc in LIBGCC2_CFLAGS. This will cause # __eprintf to be left out of libgcc.a, but that's OK because newlib # has its own version of assert.h. if [ x$host != x$target ]; then sed -e 's/^\(LIBGCC2_CFLAGS[ ]*=[ ]*\)/\1-Dinhibit_libc /' Makefile.tem > Makefile.tem2 rm -f Makefile.tem mv Makefile.tem2 Makefile.tem fi # Remove all formfeeds, since some Makes get confused by them. # Also arrange to give the variables `target', `host_xmake_file', # `tmake_file', `prefix', `local_prefix', `exec_prefix', `FIXINCLUDES' # and `INSTALL_HEADERS_DIR' values in the Makefile from the values # they have in this script. # CYGNUS LOCAL: FLOAT_H, CROSS_FLOAT_H, objdir rm -f Makefile.xx sed -e "s///" -e "s/^target=.*$/target=${target}/" \ -e "s|^xmake_file=.*$|xmake_file=${host_xmake_file}|" \ -e "s|^tmake_file=.*$|tmake_file=${tmake_file}|" \ -e "s|^version=.*$|version=${version}|" \ -e "s|^prefix[ ]*=.*|prefix = $prefix|" \ -e "s|^local_prefix[ ]*=.*|local_prefix = $local_prefix|" \ -e "s|^exec_prefix[ ]*=.*|exec_prefix = $exec_prefix|" \ -e "s|^objdir[ ]*=.*|objdir=`pwd`|" \ Makefile.tem > Makefile.xx rm -f Makefile.tem mv Makefile.xx Makefile.tem # Install Makefile for real, after making final changes. # Define macro CROSS_COMPILE in compilation if this is a cross-compiler. # Also use all.cross instead of all.internal, and add cross-make to Makefile. if [ x$canon_host = x$canon_target ] then rm -f Makefile if [ x$canon_host = x$canon_build ] then mv Makefile.tem Makefile else # When building gcc with a cross-compiler, we need to fix a # few things. echo "build= $build" > Makefile sed -e "/####build/ r ${mainsrcdir}/build-make" Makefile.tem >> Makefile rm -f Makefile.tem Makefile.xx fi else rm -f Makefile echo "CROSS=-DCROSS_COMPILE" > Makefile sed -e "/####cross/ r ${mainsrcdir}/cross-make" Makefile.tem >> Makefile rm -f Makefile.tem Makefile.xx fi echo "Created \`$subdir/Makefile'." if [ xx${vint} != xx ] then vintmsg=" (vint)" fi # Describe the chosen configuration in config.status. # Make that file a shellscript which will reestablish the same configuration. rm -f config.bak if [ -f config.status ]; then mv -f config.status config.bak; fi echo "#!/bin/sh # This directory was configured as follows:cd $invsubdir; ${progname}" $arguments > config.new echo echo host=$canon_host target=$canon_target build=$canon_build >> config.new chmod a+x config.new # If we aren't executing the configure script in . if [ x$subdir != x. ] then if [ -f $srcdir/configure ] then echo "Running \`${CONFIG_SHELL-sh} $srcdir/configure $arguments\'" ${CONFIG_SHELL-sh} $srcdir/configure $arguments echo "${srcdir}/configure" $arguments >> config.new echo echo host=$canon_host target=$canon_target build=$canon_build >> config.new fi fi if [ -f config.bak ] && cmp config.bak config.new >/dev/null 2>/dev/null; then mv -f config.bak config.status rm -f config.new else mv -f config.new config.status rm -f config.bak fi cd $STARTDIRdone # end of current-dir SUBDIRS loop srcdir=$savesrcdir# Describe the chosen configuration in config.status.# Make that file a shellscript which will reestablish the same configuration.echo "#!/bin/sh# This directory was configured as follows:${progname}" $arguments > config.newecho echo host=$canon_host target=$canon_target build=$canon_build >> config.newchmod a+x config.newif [ -f config.bak ] && cmp config.bak config.new >/dev/null 2>/dev/null;then mv -f config.bak config.status rm -f config.newelse mv -f config.new config.status rm -f config.bakfiexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -