X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=configure;h=f8e6866065ee19555092cd50822927d2b0862cfb;hb=87c1a8030e208af0d7878f207c9825adf3527de2;hp=c821cf6091def059a5ddfb04f824d5068831749b;hpb=3d2749bb5fbad38ac738b44100df7cd3a68bc873;p=pf3gnuchains%2Fgcc-fork.git diff --git a/configure b/configure index c821cf6091d..f8e6866065e 100755 --- a/configure +++ b/configure @@ -762,6 +762,25 @@ do test -n "$DEFAULT_YACC" && break done +# Generate a default definition for M4. This is used if the makefile can't +# locate m4 in objdir. + +for prog in gm4 gnum4 m4 +do + 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" && break +done + # Generate a default definition for LEX. This is used if the makefile can't # locate flex in objdir. @@ -895,10 +914,10 @@ else echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then CFLAGS=${CFLAGS-"-g -O2"} - CXXFLAGS=${CFLAGS-"-g -O2"} + CXXFLAGS=${CXXFLAGS-"-g -O2"} else CFLAGS=${CFLAGS-"-O2"} - CXXFLAGS=${CFLAGS-"-O2"} + CXXFLAGS=${CXXFLAGS-"-O2"} fi rm -f conftest* break @@ -993,27 +1012,34 @@ for subdir in . ${subdirs} ; do 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} ${srcdir}/${file} ${link} >/dev/null 2>&1 ; then + 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} ${srcdir}/${file} ${link} + ${hard_link} ${srcfile} ${link} fi if [ ! -r ${link} ] ; then - echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2 + echo '***' "${progname}: unable to link \"${link}\" to \"${srcfile}\"." 1>&2 exit 1 fi - echo "Linked \"${link}\" to \"${srcdir}/${file}\"." + echo "Linked \"${link}\" to \"${srcfile}\"." done # Create a .gdbinit file which runs the one in srcdir @@ -1195,6 +1221,13 @@ EOF echo gxx_include_dir = ${with_gxx_include_dir} >> ${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 + # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS, # remove any form feeds. if [ -z "${subdirs}" ]; then @@ -1245,6 +1278,7 @@ EOF -e "s|^tooldir[ ]*=.*$|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} # If this is a Canadian Cross, preset the values of many more