configure
来自「基于4个mips核的noc设计」· 代码 · 共 1,619 行 · 第 1/4 页
TXT
1,619 行
s/\\\n//gt loop/^CC[ ]*=/ s/CC[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc CC=`tail -1 Makefile.cc` rm -f Makefile.ccfiif [ -z "${CFLAGS}" ] && [ -r Makefile ]; then sed -n -e ':loop/\\$/ Ns/\\\n//gt loop/^CFLAGS[ ]*=/ s/CFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc CFLAGS=`tail -1 Makefile.cc` rm -f Makefile.ccfiif [ -z "${CXX}" ] && [ -r Makefile ]; then sed -n -e ':loop/\\$/ Ns/\\\n//gt loop/^CXX[ ]*=/ s/CXX[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc CXX=`tail -1 Makefile.cc` rm -f Makefile.ccfiif [ -z "${CXXFLAGS}" ] && [ -r Makefile ]; then sed -n -e ':loop/\\$/ Ns/\\\n//gt loop/^CXXFLAGS[ ]*=/ s/CXXFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc CXXFLAGS=`tail -1 Makefile.cc` rm -f Makefile.ccfi# Generate a default definition for YACC. This is used if the makefile can't# locate bison or byacc in objdir.for prog in 'bison -y' byacc yaccdo set dummy $prog; tmp=$2 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/$tmp; then DEFAULT_YACC="$prog" break fi done IFS="$save_ifs" test -n "$DEFAULT_YACC" && breakdone# Generate a default definition for M4. This is used if the makefile can't# locate m4 in objdir.for prog in gm4 gnum4 m4do set dummy $prog; tmp=$2 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/$tmp; then DEFAULT_M4="$prog" break fi done IFS="$save_ifs" test -n "$DEFAULT_M4" && breakdone# Generate a default definition for LEX. This is used if the makefile can't# locate flex in objdir.for prog in flex lexdo set dummy $prog; tmp=$2 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/$tmp; then DEFAULT_LEX="$prog" break fi done IFS="$save_ifs" test -n "$DEFAULT_LEX" && breakdoneif [ "${build}" != "${host}" ]; then # If we are doing a Canadian Cross, in which the host and build systems # are not the same, we set reasonable default values for the tools. tools="AR AR_FOR_TARGET AS AS_FOR_TARGET BISON CC_FOR_BUILD" tools="${tools} CC_FOR_TARGET CXX_FOR_TARGET" tools="${tools} DLLTOOL DLLTOOL_FOR_TARGET GCC_FOR_TARGET HOST_PREFIX" tools="${tools} HOST_PREFIX_1 LD LD_FOR_TARGET LEX MAKEINFO NM" tools="${tools} NM_FOR_TARGET RANLIB RANLIB_FOR_TARGET" tools="${tools} WINDRES WINDRES_FOR_TARGET YACC" tools="${tools} OBJCOPY OBJDUMP" for var in ${tools}; do if eval [ -z \"\$${var}\" ] && [ -r Makefile ]; then sed -n -e ':loop/\\$/ Ns/\\\n//gt loop/^'"${var}"'[ ]*=/ s/'"${var}"'[ ]*=[ ]*\(.*\)/\1/p' \ < Makefile > Makefile.v t=`tail -1 Makefile.v` if [ -n "${t}" ]; then eval "${var}=\${t}" fi rm -f Makefile.v fi done AR=${AR-${host_alias}-ar} AR_FOR_TARGET=${AR_FOR_TARGET-${target_alias}-ar} AS=${AS-${host_alias}-as} AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as} BISON=${BISON-bison} CC=${CC-${host_alias}-gcc} CFLAGS=${CFLAGS-"-g -O2"} CXX=${CXX-${host_alias}-c++} CXXFLAGS=${CXXFLAGS-"-g -O2"} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc} CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++} DLLTOOL=${DLLTOOL-${host_alias}-dlltool} DLLTOOL_FOR_TARGET=${DLLTOOL_FOR_TARGET-${target_alias}-dlltool} GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}} HOST_PREFIX=${build_alias}- HOST_PREFIX_1=${build_alias}- LD=${LD-${host_alias}-ld} LD_FOR_TARGET=${LD_FOR_TARGET-${target_alias}-ld} MAKEINFO=${MAKEINFO-makeinfo} NM=${NM-${host_alias}-nm} NM_FOR_TARGET=${NM_FOR_TARGET-${target_alias}-nm} RANLIB=${RANLIB-${host_alias}-ranlib} RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET-${target_alias}-ranlib} WINDRES=${WINDRES-${host_alias}-windres} WINDRES_FOR_TARGET=${WINDRES_FOR_TARGET-${target_alias}-windres} OBJCOPY=${OBJCOPY-${host_alias}-objcopy} OBJDUMP=${OBJDUMP-${host_alias}-objdump} if [ -z "${YACC}" ]; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/bison; then YACC="bison -y" break fi if test -f $dir/byacc; then YACC=byacc break fi if test -f $dir/yacc; then YACC=yacc break fi done IFS="$save_ifs" if [ -z "${YACC}" ]; then YACC="bison -y" fi fi if [ -z "${LEX}" ]; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/flex; then LEX=flex break fi if test -f $dir/lex; then LEX=lex break fi done IFS="$save_ifs" LEX=${LEX-flex} fi # Export variables which autoconf might try to set. export AS export AR export CC_FOR_BUILD export DLLTOOL export LD export NM export RANLIB export WINDRES export OBJCOPY export OBJDUMPelse # If CC is still not set, try to get gcc. if [ -z "${CC}" ]; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc; then CC="gcc" echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then CFLAGS=${CFLAGS-"-g -O2"} CXXFLAGS=${CXXFLAGS-"-g -O2"} else CFLAGS=${CFLAGS-"-O2"} CXXFLAGS=${CXXFLAGS-"-O2"} fi rm -f conftest* break fi done IFS="$save_ifs" CC=${CC-cc} else if test -z "${CFLAGS}"; then # Here CC is set but CFLAGS is not. Use a quick hack to use -O2 if CC # is set to a version of gcc. case "${CC}" in *gcc) echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then CFLAGS=${CFLAGS-"-g -O2"} CXXFLAGS=${CXXFLAGS-"-g -O2"} else CFLAGS=${CFLAGS-"-O2"} CXXFLAGS=${CXXFLAGS-"-O2"} fi rm -f conftest* ;; esac fi fi CXX=${CXX-"c++"} CFLAGS=${CFLAGS-"-g"} CXXFLAGS=${CXXFLAGS-"-g -O2"}fiexport CCexport CXXexport CFLAGSexport CXXFLAGS# FIXME: This should be in configure.in, not configurecase "$host" in *go32*) enable_gdbtk=no ;; *msdosdjgpp*) enable_gdbtk=no ;;esac# FIXME: This should be in configure.in, not configure# Determine whether gdb needs tk/tcl or not.if [ "$enable_gdbtk" != "no" ]; then GDB_TK="all-tcl all-tk all-itcl all-tix all-libgui"else GDB_TK=""fifor subdir in . ${subdirs} ; do # ${subdir} is relative path from . to the directory we're currently # configuring. # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed. invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'` ### figure out what to do with srcdir case "${srcdir}" in ".") # no -srcdir option. We're building in place. makesrcdir=. ;; /*) # absolute path makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'` ;; *) # otherwise relative case "${subdir}" in .) makesrcdir=${srcdir} ;; *) makesrcdir=${invsubdir}${srcdir}/${subdir} ;; esac ;; esac if [ "${subdir}/" != "./" ] ; then Makefile=${subdir}/Makefile fi if [ ! -d ${subdir} ] ; then if mkdir ${subdir} ; then true else echo '***' "${progname}: could not make ${PWD=`pwd`}/${subdir}" 1>&2 exit 1 fi fi case "${removing}" in "") case "${subdir}" in .) ;; *) eval echo Building in ${subdir} ${redirect} ;; esac # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest) # Set up the list of links to be made. # ${links} is the list of link names, and ${files} is the list of names to link to. # Make the links. configlinks="${links}" if [ -r ${subdir}/config.status ] ; then mv -f ${subdir}/config.status ${subdir}/config.back fi while [ -n "${files}" ] ; do # set file to car of files, files to cdr of files set ${files}; file=$1; shift; files=$* set ${links}; link=$1; shift; links=$* if [ ! -r ${srcdir}/${file} ] ; then if [ ! -r ${file} ] ; then echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2 echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2 exit 1 else srcfile=${file} fi else srcfile=${srcdir}/${file} fi ${remove} -f ${link} # Make a symlink if possible, otherwise try a hard link if ${symbolic_link} ${srcfile} ${link} >/dev/null 2>&1 ; then true else # We need to re-remove the file because Lynx leaves a # very strange directory there when it fails an NFS symlink. ${remove} -r -f ${link} ${hard_link} ${srcfile} ${link} fi if [ ! -r ${link} ] ; then echo '***' "${progname}: unable to link \"${link}\" to \"${srcfile}\"." 1>&2 exit 1 fi echo "Linked \"${link}\" to \"${srcfile}\"." done # Create a .gdbinit file which runs the one in srcdir # and tells GDB to look there for source files. if [ -r ${srcdir}/${subdir}/.gdbinit ] ; then case ${srcdir} in .) ;; *) cat > ${subdir}/.gdbinit <<EOF# ${NO_EDIT}dir ${makesrcdir}dir .source ${makesrcdir}/.gdbinitEOF ;; esac fi # Install a makefile, and make it set VPATH # if necessary so that the sources are found. # Also change its value of srcdir. # NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has # been somewhat optimized and is perhaps a bit twisty. # code is order so as to try to sed the smallest input files we know. # so do these separately because I don't trust the order of sed -e expressions. # the five makefile fragments MUST end up in the resulting Makefile in this order: # package macros, target, host, site, and package rules. if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then # Conditionalize the makefile for this package from "Makefile.in" (or whatever it's called) into Makefile.tem. rm -f ${subdir}/${Makefile}.tem case "${package_makefile_rules_frag}" in "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;; *) if [ ! -f ${package_makefile_rules_frag} ] ; then package_makefile_rules_frag=${srcdir}/${package_makefile_rules_frag} fi if [ -f ${package_makefile_rules_frag} ] ; then sed -e "/^####/ r ${package_makefile_rules_frag}" ${srcdir}/${subdir}/${Makefile_in} > ${Makefile}.tem else echo '***' Expected package makefile rules fragment \"${package_makefile_rules_frag}\" 1>&2 echo '***' is missing in ${PWD=`pwd`}. 1>&2 cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem fi esac # working copy now in ${Makefile}.tem
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?