X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=configure;h=1c27867a713018233acf0b285c0a7ccfca574c6e;hb=60ac749cab2e4a1033080b4ac27124fbcd136fa5;hp=84615b9f11f079b1fccc03eb564012c10eb27183;hpb=734e5c1a8380d98bc828f7e032ed20fa51549535;p=binutils-gdb.git diff --git a/configure b/configure index 84615b9f11f..1c27867a713 100755 --- a/configure +++ b/configure @@ -55,30 +55,33 @@ floating_point=default gas=default host_alias= host_makefile_frag= +moveifchange= next_host= next_prefix= next_site= next_srcdir= next_target= -moveifchange= next_tmpdir= norecursion= -removing= prefix=/usr/local progname= program_prefix= -program_prefix_option= -silent= +program_prefixoption= +program_suffix= +program_suffixoption= +program_transform_name= +program_transform_nameoption= +redirect=">/dev/null" +removing= site= -site_option= site_makefile_frag= +site_option= srcdir= srctrigger= subdirs= target_alias= target_makefile_frag= undefinedargs= -verbose= version="$Revision$" x11=default @@ -93,14 +96,14 @@ NO_EDIT="This file was generated automatically by configure. Do not edit." ## path. Since PATH might include "." we also add `pwd` to the end of PATH. ## -PWD=`pwd` progname=$0 +PWD=`pwd` case "${progname}" in /*) ;; */*) ;; *) - PATH=$PATH:${PWD} ; export PATH + PATH=$PATH:${PWD=`pwd`} ; export PATH ;; esac @@ -119,6 +122,15 @@ do program_prefix=${arg} program_prefixoption="-program_prefix=${program_prefix}" next_program_prefix= + elif [ -n "${next_program_suffix}" ] ; then + program_suffix=${arg} + program_suffixoption="-program_suffix=${program_suffix}" + next_program_suffix= + elif [ -n "${next_program_transform_name}" ] ; then + # Double any backslashes or dollar signs in the argument + program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`" + program_transform_nameoption="${program_transform_nameoption} -program_transform_name='${arg}'" + next_program_transform_name= elif [ -n "${next_target}" ] ; then next_target= case "${target_alias}" in @@ -175,16 +187,27 @@ do next_prefix=yes ;; -rm | --rm) removing=${arg} ;; - -program_prefix=* | --program_prefix=* | --program_prefi=* | --program_pref=* | --program_pre=* | --program_pr=* | --program_p=* | --program_=* | --program=* | --progra=* | --progr=* | --prog=* | --pro=*) - program_prefix=`echo ${arg} | sed 's/^[-a-z]*=//'` + -program_prefix=* | --program_prefix=* | --program_prefi=* | --program_pref=* | --program_pre=* | --program_pr=* | --program_p=*) + program_prefix=`echo ${arg} | sed 's/^[-a-z_]*=//'` program_prefixoption=${arg} ;; - -program_prefix | --program_prefix | --program_prefi | --program_pref | --program_pre | --program_pr | --program_p | --program_ | --program | --progra | --progr | --prog | --pro) + -program_prefix | --program_prefix | --program_prefi | --program_pref | --program_pre | --program_pr | --program_p) next_program_prefix=yes ;; - -s | -silent | --silent | --silen | --sile | --sil) - silent=true - arguments=`echo ${arguments} | sed "s:${arg}::"` + -program_suffix=* | --program_suffix=* | --program_suffi=* | --program_suff=* | --program_suf=* | --program_su=* | --program_s=*) + program_suffix=`echo ${arg} | sed 's/^[-a-z_]*=//'` + program_suffixoption=${arg} + ;; + -program_suffix | --program_suffix | --program_suffi | --program_suff | --program_suf | --program_su | --program_s ) + next_program_suffix=yes + ;; + -program_transform_name=* | --program_transform_name=* | --program_transform_nam=* | --program_transform_na=* | --program_transform_n=* | --program_transform_=* | --program_transform=* | --program_transfor=* | --program_transfo=* | --program_transf=* | --program_trans=* | --program_tran=* | --program_tra=* | --program_tr=* | --program_t=*) + # Double any \ or $ in the argument + program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/^[-a-z_]*=//' -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`" + program_transform_nameoption="${program_transform_nameoption} -program_transform_name='`echo ${arg} | sed 's/^[-a-z_]*=//'`'" + ;; + -program_transform_name | --program_transform_name | --program_transform_nam | --program_transform_na | --program_transform_n | --program_transform_ | --program_transform | --program_transfor | --program_transfo | --program_transf | --program_trans | --program_tran | --program_tra | --program_tr | --program_t) + next_program_transform_name=yes ;; -site=* | --site=* | --sit=* | --si=*) site_option=${arg} @@ -223,7 +246,8 @@ do next_tmpdir=yes ;; -v | -verbose | --v) - verbose=${arg} + redirect= + verbose=-v ;; -version | -V | --version | --V) echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'` @@ -308,6 +332,8 @@ if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then echo " -norecursion configure this directory only. [recurse]" ; echo " -prefix=MYDIR configure for installation of host dependent files into MYDIR. [\"/usr/local\"]" ; echo " -program_prefix=FOO install programs with FOO prepended to their names. [ \"\" ]" ; + echo " -program_suffix=FOO install programs with FOO appended to their names. [ \"\" ]" ; + echo " -program_transform_name=FOO install programs with names transformed by sed pattern FOO. [ \"\" ]" ; 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]" ; @@ -365,7 +391,7 @@ case "${srcdir}" in ".") ;; *) if [ -f ${srcdir}/config.status ] ; then - echo '***' Cannot configure here in \"${PWD}\" when \"${srcdir}\" is currently configured. 1>&2 + echo '***' Cannot configure here in \"${PWD=`pwd`}\" when \"${srcdir}\" is currently configured. 1>&2 exit 1 fi esac @@ -421,7 +447,7 @@ fi # some sanity checks on configure.in case "${srctrigger}" in "") - echo '***' srctrigger not set in ${PWD}/configure.in. 1>&2 + echo '***' srctrigger not set in ${PWD=`pwd`}/configure.in. 1>&2 exit 1 ;; *) ;; @@ -457,14 +483,36 @@ esac if [ ! -r ${srcdir}/${srctrigger} ] ; then case "${srcdirdefaulted}" in - "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD}/${srcdir}" 1>&2 ;; - *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD}/. or ${PWD}/.." 1>&2 ;; + "") 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 1 fi +tooldir="\$(libdir)/${target_alias}" + +if [ "${host_alias}" != "${target_alias}" ] ; then + if [ "${program_prefix}" = "" ] ; then + if [ "${program_suffix}" = "" ] ; then + if [ "${program_transform_name}" = "" ] ; then + program_prefix=${target_alias}- ; + fi + fi + fi +fi + +# Merge program_prefix and program_suffix onto program_transform_name +# Use a double $ so that make ignores it +if [ "${program_suffix}" != "" ] ; then + program_transform_name="-e s/\$\$/${program_suffix}/ ${program_transform_name}" +fi + +if [ "${program_prefix}" != "" ] ; then + program_transform_name="-e s/^/${program_prefix}/ ${program_transform_name}" +fi + for subdir in . ${subdirs} ; do # ${subdir} is relative path from . to the directory we're currently @@ -482,7 +530,7 @@ for subdir in . ${subdirs} ; do *) # otherwise relative case "${subdir}" in .) makesrcdir=${srcdir} ;; - *) makesrcdir=../${srcdir}/${subdir} ;; + *) makesrcdir=`echo ${subdir} | sed -e 's:[^./][^./]*:..:g'`/${srcdir}/${subdir} ;; esac ;; esac @@ -497,16 +545,18 @@ for subdir in . ${subdirs} ; do case "${removing}" in "") - if [ -n "${verbose}" -o -z "${silent}" ] ; then - echo Building in ${subdir} - fi + 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 config.status ] ; then + if [ -r ${subdir}/config.status ] ; then mv -f ${subdir}/config.status ${subdir}/config.back fi while [ -n "${files}" ] ; do @@ -529,10 +579,7 @@ for subdir in . ${subdirs} ; do exit 1 fi - case "${verbose}" in - "") ;; - *) echo "Linked \"${link}\" to \"${srcdir}/${file}\"." ;; - esac + echo "Linked \"${link}\" to \"${srcdir}/${file}\"." done # Create a .gdbinit file which runs the one in srcdir @@ -540,8 +587,7 @@ for subdir in . ${subdirs} ; do if [ -r ${srcdir}/${subdir}/.gdbinit ] ; then case ${srcdir} in - .) - ;; + .) ;; *) cat > ${subdir}/.gdbinit < ${Makefile} else echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2 - echo '***' is missing in ${PWD}. 1>&2 + echo '***' is missing in ${PWD=`pwd`}. 1>&2 mv ${subdir}/Makefile.tem ${Makefile} fi esac # working copy now in ${Makefile} # Conditionalize the makefile for this target. - rm -f Makefile.tem + rm -f ${subdir}/Makefile.tem case "${target_makefile_frag}" in "") mv ${Makefile} ${subdir}/Makefile.tem ;; *) - target_makefile_frag=${srcdir}/${target_makefile_frag} + 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}" ${Makefile} > ${subdir}/Makefile.tem else @@ -630,12 +678,22 @@ target_cpu = ${target_cpu} target_vendor = ${target_vendor} target_os = ${target_os} EOF - if [ "${target_makefile_frag}" != "" ] ; then - echo target_makefile_frag = ${invsubdir}${target_makefile_frag} >>${Makefile} - fi - if [ "${host_makefile_frag}" != "" ] ; then - echo host_makefile_frag = ${invsubdir}${host_makefile_frag} >>${Makefile} - fi + 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 @@ -644,27 +702,22 @@ EOF # Define macro CROSS_COMPILE in compilation if this is a cross-compiler. case "${host_alias}" in "${target_alias}") - tooldir='$(libdir)' echo "ALL=all.internal" >> ${Makefile} ;; *) echo "CROSS=-DCROSS_COMPILE" >> ${Makefile} echo "ALL=all.cross" >> ${Makefile} - case "${program_prefix}" in - "") program_prefix=${target_alias}- ;; - *) ;; - esac - - tooldir="\$(libdir)/${target_alias}" ;; esac # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS, # remove any form feeds. if [ -z "${subdirs}" ]; then + rm -f ${subdir}/Makefile.tem2 sed -e "s:^SUBDIRS[ ]*=.*$:SUBDIRS = ${configdirs}:" \ -e "s:^NONSUBDIRS[ ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \ ${subdir}/Makefile.tem > ${subdir}/Makefile.tem2 + rm -f ${subdir}/Makefile.tem mv ${subdir}/Makefile.tem2 ${subdir}/Makefile.tem fi sed -e "s:^prefix[ ]*=.*$:prefix = ${prefix}:" \ @@ -672,32 +725,32 @@ EOF -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}:" \ ${subdir}/Makefile.tem >> ${Makefile} # final copy now in ${Makefile} rm -f ${subdir}/Makefile.tem - if [ -n "${verbose}" -o -z "${silent}" ] ; then - case "${host_makefile_frag}" in - "") using= ;; - *) using="and \"${host_makefile_frag}\"" ;; - esac + 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 "${target_makefile_frag}" in + "") ;; + *) using="${using} and \"${target_makefile_frag}\"" ;; + esac - case "${site_makefile_frag}" in - "") ;; - *) using="${using} and \"${site_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} ${using} - fi + newusing=`echo "${using}" | sed 's/and/using/'` + using=${newusing} + echo "Created \"${Makefile}\" in" ${PWD=`pwd`} ${using} . ${tmpfile}.pos @@ -714,19 +767,19 @@ EOF if [ ${subdir} = . ] ; then echo "#!/bin/sh # ${NO_EDIT} -# ${PWD} was configured as follows: +# This directory was configured as follows: ${progname}" ${arguments} " # ${using}" > ${subdir}/config.new else echo "#!/bin/sh # ${NO_EDIT} -# ${PWD}/${subdir} was configured as follows: +# This directory was configured as follows: cd ${invsubdir} ${progname}" ${arguments} " # ${using}" > ${subdir}/config.new fi chmod a+x ${subdir}/config.new - if [ -r config.back ] ; then + if [ -r ${subdir}/config.back ] ; then mv -f ${subdir}/config.back ${subdir}/config.status fi ${moveifchange} ${subdir}/config.new ${subdir}/config.status @@ -739,10 +792,7 @@ done # If there are subdirectories, then recur. if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then for configdir in ${configdirs} ; do - case "${verbose}" in - "") ;; - *) echo Configuring ${configdir}... ;; - esac + eval echo Configuring ${configdir}... ${redirect} if [ -d ${srcdir}/${configdir} ] ; then case "${srcdir}" in @@ -754,7 +804,7 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then ;; esac - POPDIR=${PWD} + POPDIR=${PWD=`pwd`} cd ${configdir} ### figure out what to do with srcdir @@ -781,9 +831,9 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then fi ### The recursion line is here. - if ${recprog} -s ${host_alias} -target=${target_alias} \ - ${verbose} ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \ - ${srcdiroption} ${program_prefixoption} ${site_option} ${removing} ; then + if eval ${recprog} ${verbose} ${host_alias} -target=${target_alias} \ + ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \ + ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${removing} ${redirect} ; then true else exit 1 @@ -791,19 +841,11 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then cd ${POPDIR} else - case "${verbose}" in - "") ;; - *) echo Warning: source directory \"${srcdir}/${configdir}\" is missing. ;; - esac + eval echo Warning: source directory \"${srcdir}/${configdir}\" is missing. ${redirect} fi done fi -### clean up. - -# trap cmd above handles this now: -#rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos - exit 0 #