OSDN Git Service

* lex.c (lang_init_options): New function.
[pf3gnuchains/gcc-fork.git] / configure
index c821cf6..f8e6866 100755 (executable)
--- 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