configure

来自「基于4个mips核的noc设计」· 代码 · 共 1,619 行 · 第 1/4 页

TXT
1,619
字号
## The rules are:# 1. You aren't allowed to specify --host, --target, and undefs at the#    same time.# 2. Host defaults to undefs.# 3. If undefs is not specified, then host defaults to the current host,#    as determined by config.guess.# 4. Target defaults to undefs.# 5. If undefs is not specified, then target defaults to host.case "${fatal}" in"")	# Make sure that host, target & undefs aren't all specified at the	# same time.	case $host_alias---$target_alias---$undefs in	NOHOST---*---* | *---NOTARGET---* | *---*---NOUNDEFS)		;;	*) echo '***' Can only configure for one host and one target at a time.  1>&2	   fatal=yes	   break 2		;;	esac	# Now, do defaulting for host.	case $host_alias in	NOHOST)		case $undefs in		NOUNDEFS)			# Neither --host option nor undefs were present.			# Call config.guess.			guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`			if host_alias=`${config_shell} ${guesssys}`			then				# If the string we are going to use for				# the target is a prefix of the string				# we just guessed for the host, then				# assume we are running native, and force				# the same string for both target and host.				case $target_alias in				NOTARGET) ;;				*)					if expr $host_alias : $target_alias >/dev/null					then						host_alias=$target_alias					fi					;;				esac				echo "Configuring for a ${host_alias} host." 1>&2				arguments="--host=$host_alias $arguments"			else				echo 'Config.guess failed to determine the host type.  You need to specify one.' 1>&2				fatal=yes			fi			;;		*)			host_alias=$undefs			arguments="--host=$host_alias $arguments"			undefs=NOUNDEFS			;;		esac	esac	# Do defaulting for target.  If --target option isn't present, default	# to undefs.  If undefs isn't present, default to host.	case $target_alias in	NOTARGET)		case $undefs in		NOUNDEFS)			target_alias=$host_alias			;;		*)			target_alias=$undefs			arguments="--target=$target_alias $arguments"			;;		esac	esac	;;*) ;;esacif [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then	exec 1>&2	echo Usage: configure [OPTIONS] [HOST]	echo	echo Options: [defaults in brackets]	echo ' --prefix=MYDIR		 install into MYDIR [/usr/local]'	echo ' --exec-prefix=MYDIR	 install host-dependent files into MYDIR [/usr/local]'	echo ' --help			 print this message [normal config]'	echo ' --build=BUILD		 configure for building on BUILD [BUILD=HOST]'	echo ' --host=HOST		 configure for HOST [determined via config.guess]'	echo ' --norecursion		 configure this directory only [recurse]'	echo ' --program-prefix=FOO	 prepend FOO to installed program names [""]'	echo ' --program-suffix=FOO	 append FOO to installed program names [""]'	echo ' --program-transform-name=P transform installed names by sed pattern P [""]'	echo ' --site=SITE		 configure with site-specific makefile for SITE'	echo ' --srcdir=DIR		 find the sources in DIR [. or ..]'	echo ' --target=TARGET	 configure for TARGET [TARGET=HOST]'	echo ' --tmpdir=TMPDIR	 create temporary files in TMPDIR [/tmp]'	echo ' --nfp			 configure for software floating point [hard float]'	echo ' --with-FOO, --with-FOO=BAR package FOO is available (parameter BAR)'	echo ' --without-FOO		 package FOO is NOT available'	echo ' --enable-FOO, --enable-FOO=BAR include feature FOO (parameter BAR)'	echo ' --disable-FOO		 do not include feature FOO'	echo	echo 'Where HOST and TARGET are something like "sparc-sunos", "mips-sgi-irix5", etc.'	echo	if [ -r config.status ] ; then		cat config.status	fi	exit 1ficonfigsub=`echo ${progname} | sed 's/configure$/config.sub/'`moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`## the sed command below emulates the dirname commandtopsrcdir=`cd \`echo ${progname} | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'\`; pwd`# this is a hack.  sun4 must always be a valid host alias or this will fail.if ${config_shell} ${configsub} sun4 >/dev/null 2>&1 ; then        trueelse        echo '***' cannot find config.sub.  1>&2        exit 1fitouch config.junkif ${config_shell} ${moveifchange} config.junk config.trash ; then        trueelse        echo '***' cannot find move-if-change.  1>&2        exit 1firm -f config.junk config.trashcase "${srcdir}" in"")        if [ -r configure.in ] ; then                srcdir=.        else                if [ -r ${progname}.in ] ; then                        srcdir=`echo ${progname} | sed 's:/configure$::'`                else                        echo '***' "Can't find configure.in.  Try using --srcdir=some_dir"  1>&2                        exit 1                fi        fi        ;;*)	# Set srcdir to "." if that's what it is.	# This is important for multilib support.	if [ ! -d ${srcdir} ] ; then		echo "Invalid source directory ${srcdir}" >&2		exit 1	fi	pwd=`pwd`	srcpwd=`cd ${srcdir} ; pwd`	if [ "${pwd}" = "${srcpwd}" ] ; then		srcdir=.	fiesac### warn about some conflicting configurations.case "${srcdir}" in".") ;;*)        if [ -f ${srcdir}/config.status ] ; then                echo '***' Cannot configure here in \"${PWD=`pwd`}\" when \"${srcdir}\" is currently configured. 1>&2                exit 1        fiesac# default exec_prefixcase "${exec_prefixoption}" in"") exec_prefix="\$(prefix)" ;;*) ;;esac# Define the trigger file to make sure configure will re-run whenever# the gcc version number changes.if [ "${with_gcc_version_trigger+set}" = set ]; then    gcc_version_trigger="$with_gcc_version_trigger"    gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'`else    # If gcc's sources are available, define the trigger file.    if [ -f ${topsrcdir}/gcc/version.c ] ; then	gcc_version_trigger=${topsrcdir}/gcc/version.c	gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'`	case "$arguments" in	  *--with-gcc-version-trigger=$gcc_version_trigger* )	    ;;	  * )	    # Make sure configure.in knows about this.	    arguments="--with-gcc-version-trigger=$gcc_version_trigger $arguments"	    ;;	esac	withoptions="--with-gcc-version-trigger=$gcc_version_trigger $withoptions"    fifi### break up ${srcdir}/configure.in.case "`grep '^# per\-host:' ${srcdir}/configure.in`" in"")        echo '***' ${srcdir}/configure.in has no \"per-host:\" line. 1>&2	# Check for a directory that's been converted to use autoconf since	# it was last configured.	if grep AC_OUTPUT ${srcdir}/configure.in >/dev/null ; then	  echo '***' Hmm, looks like this directory has been autoconfiscated. 1>&2	  if [ -r ${srcdir}/configure ] ; then	    echo '***' Running the local configure script. 1>&2	    case "${cache_file}" in	    "") cache_file_option= ;;	    *)  cache_file_option="--cache-file=${cache_file}" ;;	    esac	    srcdiroption="--srcdir=${srcdir}"	    case "${build_alias}" in	    "") buildopt= ;;	    *)  buildopt="--build=${build_alias}" ;;	    esac	    eval exec ${config_shell} ${srcdir}/configure ${verbose} \		${buildopt} --host=${host_alias} --target=${target_alias} \		${prefixoption} ${tmpdiroption} ${exec_prefixoption} \		${srcdiroption} ${diroptions} \		${program_prefixoption} ${program_suffixoption} \		${program_transform_nameoption} ${site_option} \		${withoptions} ${withoutoptions} \		${enableoptions} ${disableoptions} ${floating_pointoption} \		${cache_file_option} ${removing} ${other_options} ${redirect}	  else	    echo '***' There is no configure script present though. 1>&2	  fi	fi        exit 1        ;;*) ;;esaccase "`grep '^# per\-target:' ${srcdir}/configure.in`" in"")        echo '***' ${srcdir}/configure.in has no \"per-target:\" line. 1>&2        exit 1        ;;*) ;;esaccase "${TMPDIR}" in"") TMPDIR=/tmp ; export TMPDIR ;;*) ;;esac# keep this filename short for &%*%$*# 14 char file names and 8+3 file namestmpfile=${TMPDIR}/cNf$$# Note that under many versions of sh a trap handler for 0 will *override* any# exit status you explicitly specify!  At this point, the only non-error exit# is at the end of the script; these actions are duplicated there, minus# the "exit 1".  Don't use "exit 0" anywhere after this without resetting the# trap handler, or you'll lose.trap "rm -f Makefile.tem ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos; exit 1" 0 1 2 15# split ${srcdir}/configure.in into common, per-host, per-target,# and post-target parts.  Post-target is optional.sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.comsed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hstif grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then  sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt  sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.poselse  sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt  echo >${tmpfile}.posfi### do common part of configure.in# If the language specific compiler does not exist, but the "gcc" directory does,# we will skip this directory; in this case the sub-directory's common part# of configure.in will create a small shell script "skip-this-dir" containing# commands to completely clean up any temporary or created files.. ${tmpfile}.comif test -f skip-this-dir; then	# Perform the same cleanup as the trap handler, minus the "exit 1" of course,	# and reset the trap handler.	trap 0	rm -f Makefile* ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos	# Execute the final clean-up actions	${config_shell} skip-this-dir	# and stop configuring this directory.	exit 0fi# some sanity checks on configure.incase "${srctrigger}" in"")        echo '***' srctrigger not set in ${PWD=`pwd`}/configure.in.  1>&2        exit 1        ;;*) ;;esaccase "${build_alias}" in"")	if result=`${config_shell} ${configsub} ${host_alias}` ; then	    build_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`	    build_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`	    build_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`	    build=${build_cpu}-${build_vendor}-${build_os}	    build_alias=${host_alias}	fi	;;*)	if result=`${config_shell} ${configsub} ${build_alias}` ; then	    buildopt="--build=${build_alias}"	    build_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`	    build_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`	    build_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`	    build=${build_cpu}-${build_vendor}-${build_os}	else	    echo "Unrecognized build system name ${build_alias}." 1>&2	    exit 1	fi	;;esacif result=`${config_shell} ${configsub} ${host_alias}` ; then    trueelse    echo "Unrecognized host system name ${host_alias}." 1>&2    exit 1fihost_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`host_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`host_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`host=${host_cpu}-${host_vendor}-${host_os}. ${tmpfile}.hstif result=`${config_shell} ${configsub} ${target_alias}` ; then    trueelse    echo "Unrecognized target system name ${target_alias}." 1>&2    exit 1fitarget_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`target_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`target_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`target=${target_cpu}-${target_vendor}-${target_os}. ${tmpfile}.tgt# Find the source files, if location was not specified.case "${srcdir}" in"")        srcdirdefaulted=1        srcdir=.        if [ ! -r ${srctrigger} ] ; then                srcdir=..        fi        ;;*) ;;esacif [ ! -r ${srcdir}/${srctrigger} ] ; then        case "${srcdirdefaulted}" in        "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/${srcdir}" 1>&2 ;;        *)  echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`pwd`}/. or ${PWD=`pwd`}/.." 1>&2 ;;        esac        echo '***' \(At least ${srctrigger} is missing.\) 1>&2        exit 1fi# Some systems (e.g., one of the i386-aix systems the gas testers are# using) don't handle "\$" correctly, so don't use it here.tooldir='$(exec_prefix)'/${target_alias}if [ "${host_alias}" != "${target_alias}" ] ; then    if [ "${program_prefixoption}" = "" ] ; then        if [ "${program_suffixoption}" = "" ] ; then             if [ "${program_transform_nameoption}" = "" ] ; then                program_prefix=${target_alias}- ;            fi        fi    fifi# Merge program_prefix and program_suffix onto program_transform_name.# (program_suffix used to use $, but it's hard to preserve $ through both# make and sh.)if [ "${program_suffix}" != "" ] ; then    program_transform_name="-e s,\\\\(.*\\\\),\\\\1${program_suffix}, ${program_transform_name}"fiif [ "${program_prefix}" != "" ] ; then    program_transform_name="-e s,^,${program_prefix}, ${program_transform_name}"fi# If CC and CXX are not set in the environment, and the Makefile# exists, try to extract them from it.  This is to handle running# ./config.status by hand.if [ -z "${CC}" ] && [ -r Makefile ]; then  sed -n -e ':loop/\\$/ N

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?