configure

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

TXT
1,619
字号
            # Conditionalize for this site.            rm -f ${Makefile}              case "${site}" in              "") mv ${subdir}/Makefile.tem ${Makefile} ;;              *)                      site_makefile_frag=${srcdir}/config/ms-${site}                      if [ -f ${site_makefile_frag} ] ; then                              sed -e "/^####/  r ${site_makefile_frag}" ${subdir}/Makefile.tem \                                      > ${Makefile}                      else                              mv ${subdir}/Makefile.tem ${Makefile}                              site_makefile_frag=                      fi                      ;;            esac            # working copy now in ${Makefile}            # Conditionalize the makefile for this host.            rm -f ${subdir}/Makefile.tem            case "${host_makefile_frag}" in              "") mv ${Makefile} ${subdir}/Makefile.tem ;;              *)                      if [ ! -f ${host_makefile_frag} ] ; then                              host_makefile_frag=${srcdir}/${host_makefile_frag}                      fi                      if [ -f ${host_makefile_frag} ] ; then                              sed -e "/^####/  r ${host_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem                      else                              echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2                              echo '***' is missing in ${PWD=`pwd`}. 1>&2                              mv ${Makefile} ${subdir}/Makefile.tem                      fi            esac            # working copy now in ${subdir)/Makefile.tem            # Conditionalize the makefile for this target.            rm -f ${Makefile}            case "${target_makefile_frag}" in              "") mv ${subdir}/Makefile.tem ${Makefile} ;;              *)                      if [ ! -f ${target_makefile_frag} ] ; then                              target_makefile_frag=${srcdir}/${target_makefile_frag}                      fi                      if [ -f ${target_makefile_frag} ] ; then                              sed -e "/^####/  r ${target_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}                      else                              mv ${subdir}/Makefile.tem ${Makefile}                              target_makefile_frag=                      fi                      ;;            esac            # working copy now in ${Makefile}            # Emit the default values of this package's macros.            rm -f ${subdir}/Makefile.tem            case "${package_makefile_frag}" in              "") mv ${Makefile} ${subdir}/Makefile.tem ;;              *)                      if [ ! -f ${package_makefile_frag} ] ; then                              package_makefile_frag=${srcdir}/${package_makefile_frag}                      fi                      if [ -f ${package_makefile_frag} ] ; then                              sed -e "/^####/  r ${package_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem                      else                              echo '***' Expected package makefile fragment \"${package_makefile_rules_frag}\" 1>&2                              echo '***' is missing in ${PWD=`pwd`}. 1>&2                              mv ${Makefile} ${subdir}/Makefile.tem                      fi            esac            # real copy now in ${subdir}/Makefile.tem            # prepend warning about editting, and a bunch of variables.            rm -f ${Makefile}            cat > ${Makefile} <<EOF# ${NO_EDIT}VPATH = ${makesrcdir}links = ${configlinks}host_alias = ${host_alias}host_cpu = ${host_cpu}host_vendor = ${host_vendor}host_os = ${host_os}host_canonical = ${host_cpu}-${host_vendor}-${host_os}target_alias = ${target_alias}target_cpu = ${target_cpu}target_vendor = ${target_vendor}target_os = ${target_os}target_canonical = ${target_cpu}-${target_vendor}-${target_os}EOF	    case "${build}" in	      "") ;;	      *)  cat >> ${Makefile} << EOFbuild_alias = ${build_alias}build_cpu = ${build_cpu}build_vendor = ${build_vendor}build_os = ${build_os}build_canonical = ${build_cpu}-${build_vendor}-${build_os}EOF	    esac            case "${package_makefile_frag}" in              "") ;;              /*) echo package_makefile_frag = ${package_makefile_frag} >>${Makefile} ;;              *)  echo package_makefile_frag = ${invsubdir}${package_makefile_frag} >>${Makefile} ;;            esac            case "${target_makefile_frag}" in              "") ;;              /*) echo target_makefile_frag = ${target_makefile_frag} >>${Makefile} ;;              *)  echo target_makefile_frag = ${invsubdir}${target_makefile_frag} >>${Makefile} ;;            esac            case "${host_makefile_frag}" in              "") ;;              /*) echo host_makefile_frag = ${host_makefile_frag} >>${Makefile} ;;              *)  echo host_makefile_frag = ${invsubdir}${host_makefile_frag} >>${Makefile} ;;            esac            if [ "${site_makefile_frag}" != "" ] ; then                echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}            fi 	    # record if we want to build shared libs.	    if test -z "${enable_shared}"; then	        echo enable_shared = no >> ${Makefile}	    else	        echo enable_shared = ${enable_shared} >> ${Makefile}	    fi	    # record if we want to rumtime library stuff installed in libsubdir.	    if test -z "${enable_version_specific_runtime_libs}"; then	        echo enable_version_specific_runtime_libs = no >> ${Makefile}	    else	        echo enable_version_specific_runtime_libs = ${enable_version_specific_runtime_libs} >> ${Makefile}	    fi	    # Emit a macro which describes the file containing gcc's	    # version number.	    echo gcc_version_trigger = ${gcc_version_trigger} >> ${Makefile}	    # And emit a macro defining gcc's version number.	    echo gcc_version = ${gcc_version} >> ${Makefile}            # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,            # remove any form feeds.            if [ -z "${subdirs}" ]; then                rm -f ${subdir}/Makefile.tm2                sed -e "s:^SUBDIRS[ 	]*=.*$:SUBDIRS = ${configdirs}:" \                    -e "s:^NONSUBDIRS[ 	]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \                    ${subdir}/Makefile.tem > ${subdir}/Makefile.tm2                rm -f ${subdir}/Makefile.tem                mv ${subdir}/Makefile.tm2 ${subdir}/Makefile.tem	    fi	    sed     -e "s|^prefix[ 	]*=.*$|prefix = ${prefix}|" \                    -e "s|^exec_prefix[ 	]*=.*$|exec_prefix = ${exec_prefix}|" \                    -e "s|^bindir[ 	]*=.*$|bindir = ${bindir}|" \                    -e "s|^sbindir[ 	]*=.*$|sbindir = ${sbindir}|" \                    -e "s|^libexecdir[ 	]*=.*$|libexecdir = ${libexecdir}|" \                    -e "s|^datadir[ 	]*=.*$|datadir = ${datadir}|" \                    -e "s|^sysconfdir[ 	]*=.*$|sysconfdir = ${sysconfdir}|" \                    -e "s|^sharedstatedir[ 	]*=.*$|sharedstatedir = ${sharedstatedir}|" \                    -e "s|^localstatedir[ 	]*=.*$|localstatedir = ${localstatedir}|" \                    -e "s|^libdir[ 	]*=.*$|libdir = ${libdir}|" \                    -e "s|^includedir[ 	]*=.*$|includedir = ${includedir}|" \                    -e "s|^oldincludedir[ 	]*=.*$|oldincludedir = ${oldincludedir}|" \                    -e "s|^infodir[ 	]*=.*$|infodir = ${infodir}|" \                    -e "s|^mandir[ 	]*=.*$|mandir = ${mandir}|" \		    -e "/^CC[ 	]*=/{			:loop1			/\\\\$/ N			s/\\\\\\n//g			t loop1			s%^CC[ 	]*=.*$%CC = ${CC}%			}" \		    -e "/^CXX[ 	]*=/{			:loop2			/\\\\$/ N			s/\\\\\\n//g			t loop2			s%^CXX[ 	]*=.*$%CXX = ${CXX}%			}" \		    -e "/^CFLAGS[ 	]*=/{			:loop3			/\\\\$/ N			s/\\\\\\n//g			t loop3			s%^CFLAGS[ 	]*=.*$%CFLAGS = ${CFLAGS}%			}" \		    -e "/^CXXFLAGS[ 	]*=/{			:loop4			/\\\\$/ N			s/\\\\\\n//g			t loop4			s%^CXXFLAGS[ 	]*=.*$%CXXFLAGS = ${CXXFLAGS}%			}" \		    -e "s|^SHELL[	 ]*=.*$|SHELL = ${config_shell}|" \                    -e "s|^srcdir[ 	]*=.*$|srcdir = ${makesrcdir}|" \                    -e "s///" \                    -e "s:^program_prefix[ 	]*=.*$:program_prefix = ${program_prefix}:" \                    -e "s:^program_suffix[ 	]*=.*$:program_suffix = ${program_suffix}:" \                    -e "s:^program_transform_name[ 	]*=.*$:program_transform_name = ${program_transform_name}:" \                    -e "s|^tooldir[ 	]*=.*$|tooldir = ${tooldir}|" \                    -e "s|^build_tooldir[ 	]*=.*$|build_tooldir = ${tooldir}|" \		    -e "s:^DEFAULT_YACC[	 ]*=.*$:DEFAULT_YACC = ${DEFAULT_YACC}:" \		    -e "s:^DEFAULT_LEX[	 ]*=.*$:DEFAULT_LEX = ${DEFAULT_LEX}:" \		    -e "s:^DEFAULT_M4[  ]*=.*$:DEFAULT_M4 = ${DEFAULT_M4}:" \                    ${subdir}/Makefile.tem >> ${Makefile}  	    sed -e "s:^GDB_TK[	 ]*=.*$:GDB_TK = ${GDB_TK}:" ${Makefile} >${Makefile}.tem	    mv -f ${Makefile}.tem ${Makefile}	    # If this is a Canadian Cross, preset the values of many more	    # tools.	    if [ "${build}" != "${host}" ]; then		for var in ${tools}; do		    eval val=\$${var}		    sed -e "/^${var}[ 	]*=/{			   :loop1			   /\\\\$/ N			   /\\\\$/ b loop1			   s/\\\\\\n//g			   s%^${var}[ 	]*=.*$%${var} = ${val}%			   }" ${Makefile} > ${Makefile}.tem		    mv -f ${Makefile}.tem ${Makefile}		done	    fi            # final copy now in ${Makefile}        else           echo "No Makefile.in found in ${srcdir}/${subdir}, unable to configure" 1>&2        fi        rm -f ${subdir}/Makefile.tem        case "${host_makefile_frag}" in        "") using= ;;        *) using="and \"${host_makefile_frag}\"" ;;        esac        case "${target_makefile_frag}" in        "") ;;        *) using="${using} and \"${target_makefile_frag}\"" ;;        esac        case "${site_makefile_frag}" in        "") ;;        *) using="${using} and \"${site_makefile_frag}\"" ;;        esac        newusing=`echo "${using}" | sed 's/and/using/'`        using=${newusing}        echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using}        . ${tmpfile}.pos        # describe the chosen configuration in config.status.        # Make that file a shellscript which will reestablish        # the same configuration.  Used in Makefiles to rebuild        # Makefiles.        case "${norecursion}" in        "") arguments="${arguments} --norecursion" ;;        *) ;;        esac        if [ ${subdir} = . ] ; then            echo "#!/bin/sh# ${NO_EDIT}# This directory was configured as follows:${progname}" ${arguments}  "# ${using}" > ${subdir}/config.new        else            echo "#!/bin/sh# ${NO_EDIT}# This directory was configured as follows:cd ${invsubdir}${progname}" ${arguments}  "# ${using}" > ${subdir}/config.new        fi        chmod a+x ${subdir}/config.new        if [ -r ${subdir}/config.back ] ; then                mv -f ${subdir}/config.back ${subdir}/config.status        fi	${config_shell} ${moveifchange} ${subdir}/config.new ${subdir}/config.status        ;;    *)  rm -f ${Makefile} ${subdir}/config.status ${links} ;;    esacdone# If there are subdirectories, then recur.if [ -z "${norecursion}" ] && [ -n "${configdirs}" ] ; then         for configdir in ${configdirs} ${extraconfigdirs} ; do		# If configdir contains ',' it is		# srcdir,builddir,target_alias		# These come from extraconfigdirs.		case ${configdir} in		*,*)		    eval `echo ${configdir} | sed -e 's/\([^,]*\),\([^,]*\),\(.*\)/cfg_dir=\1 bld_dir=\2 tgt_alias=\3/'`		    ;;		*)		    cfg_dir=${configdir}		    bld_dir=${configdir}		    tgt_alias=${target_alias}		    ;;		esac                if [ -d ${srcdir}/${cfg_dir} ] ; then                        eval echo Configuring ${configdir}... ${redirect}                        case "${srcdir}" in                        ".") ;;                        *)                                if [ ! -d ./${bld_dir} ] ; then                                        if mkdir ./${bld_dir} ; then                                                true                                        else                                                echo '***' "${progname}: could not make ${PWD=`pwd`}/${bld_dir}" 1>&2                                                exit 1                                        fi                                fi                                ;;                        esac                        POPDIR=${PWD=`pwd`}                        cd ${bld_dir} ### figure out what to do with srcdir                        case "${srcdir}" in                        ".") newsrcdir=${srcdir} ;; # no -srcdir option.  We're building in place.                        /*) # absolute path                                newsrcdir=${srcdir}/${cfg_dir}                                srcdiroption="--srcdir=${newsrcdir}"                                ;;                        ?:*) # absolute path on win32                                newsrcdir=${srcdir}/${cfg_dir}                                srcdiroption="--srcdir=${newsrcdir}"                                ;;                        *) # otherwise relative                                newsrcdir=../${srcdir}/${cfg_dir}                                srcdiroption="--srcdir=${newsrcdir}"                                ;;                        esac			# Handle --cache-file=../XXX			case "${cache_file}" in			"") # empty				;;			/*) # absolute path				cache_file_option="--cache-file=${cache_file}"				;;			?:*) # absolute path on win32				cache_file_option="--cache-file=${cache_file}"				;;			*) # relative path				cache_file_option="--cache-file=../${cache_file}"				;;			esac### check for guested configure, otherwise fix possibly relative progname                        if [ -f ${newsrcdir}/configure ] ; then                                recprog=${newsrcdir}/configure                        elif [ -f ${newsrcdir}/configure.in ] ; then                                case "${progname}" in                                /*)     recprog=${progname} ;;                                ?:*)    recprog=${progname} ;;                                *)      recprog=../${progname} ;;                                esac			else				eval echo No configuration information in ${cfg_dir} ${redirect}				recprog=                        fi### The recursion line is here.			if [ ! -z "${recprog}" ] ; then	                        if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${tgt_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} ; then	                                true        	                else					echo Configure in `pwd` failed, exiting. 1>&2                	                exit 1                        	fi			fi                        cd ${POPDIR}                fi        donefi# Perform the same cleanup as the trap handler, minus the "exit 1" of course,# and reset the trap handler.rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.postrap 0exit 0## Local Variables:# fill-column: 131# End:## end of configure

⌨️ 快捷键说明

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