This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: PR other/17637: Top level configure doesn't support symlinks


Top level configure has things like

if test -f ${topsrcdir}/gcc/version.c ; then

It doesn't work with symlinks. I have

[hjl@gnu gcc]$ ls -l gcc/version.c
lrwxrwxrwx    1 hjl      hjl            36 Sep 23 10:44 gcc/version.c ->
../../../../import/gcc/gcc/version.c

Here is a patch.


H.J.
-----
2004-09-23  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.in: Support symlinks.
	* configure: Regenerated.

--- configure.in.symlink	2004-09-23 10:17:27.000000000 -0700
+++ configure.in	2004-09-23 10:28:57.000000000 -0700
@@ -39,7 +39,7 @@ case "${OSTYPE}" in
 *win32*)
   if test x${CONFIG_SHELL} = x ; then
     if test ! -f /bin/sh ; then
-      if test x${SHELL} != x && test -f ${SHELL} ; then
+      if test x${SHELL} != x && test -e ${SHELL} ; then
 	CONFIG_SHELL=${SHELL}
 	export CONFIG_SHELL
       else
@@ -47,7 +47,7 @@ case "${OSTYPE}" in
 	  IFS="${IFS=	}"; save_ifs="$IFS"; IFS="${IFS}:"
 	  for dir in $PATH; do
 	    test -z "$dir" && dir=.
-	    if test -f $dir/$prog; then
+	    if test -e $dir/$prog; then
 	      CONFIG_SHELL=$dir/$prog
 	      export CONFIG_SHELL
 	      break
@@ -98,7 +98,7 @@ if test "${with_gcc_version_trigger+set}
   gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
 else
   # If gcc's sources are available, define the trigger file.
-  if test -f ${topsrcdir}/gcc/version.c ; then
+  if test -e ${topsrcdir}/gcc/version.c ; then
     gcc_version_trigger=${topsrcdir}/gcc/version.c
     gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'`
     case "$ac_configure_args" in
@@ -374,7 +374,7 @@ case "${target}" in
   *-*-freebsd*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
-	&& test -f /usr/local/include/gmp.h; then
+	&& test -e /usr/local/include/gmp.h; then
       with_gmp=/usr/local
     fi
 
@@ -953,7 +953,7 @@ if test -z "${CC}" && test "${build}" = 
   found=
   for dir in $PATH; do
     test -z "$dir" && dir=.
-    if test -f $dir/gcc; then
+    if test -e $dir/gcc; then
       found=yes
       break
     fi
@@ -1050,9 +1050,9 @@ AC_ARG_WITH(gmp-dir, [  --with-gmp-dir=P
 
 if test "x$with_gmp_dir" != x; then
   gmpinc="$gmpinc -I$with_gmp_dir"
-  if test -f "$with_gmp_dir/.libs/libgmp.a"; then
+  if test -e "$with_gmp_dir/.libs/libgmp.a"; then
     gmplibs="$gmplibs $with_gmp_dir/.libs/libgmp.a"
-  elif test -f "$with_gmp_dir/_libs/libgmp.a"; then
+  elif test -e "$with_gmp_dir/_libs/libgmp.a"; then
     gmplibs="$gmplibs $with_gmp_dir/_libs/libgmp.a"
   fi
   # One of the later tests will catch the error if neither library is present.
@@ -1297,7 +1297,7 @@ build_configdirs_all="$build_configdirs"
 build_configdirs=
 for i in ${build_configdirs_all} ; do
   j=`echo $i | sed -e s/build-//g` 
-  if test -f ${srcdir}/$j/configure ; then
+  if test -e ${srcdir}/$j/configure ; then
     build_configdirs="${build_configdirs} $i"
   fi
 done
@@ -1305,7 +1305,7 @@ done
 configdirs_all="$configdirs"
 configdirs=
 for i in ${configdirs_all} ; do
-  if test -f ${srcdir}/$i/configure ; then
+  if test -e ${srcdir}/$i/configure ; then
     configdirs="${configdirs} $i"
   fi
 done
@@ -1314,7 +1314,7 @@ target_configdirs_all="$target_configdir
 target_configdirs=
 for i in ${target_configdirs_all} ; do
   j=`echo $i | sed -e s/target-//g` 
-  if test -f ${srcdir}/$j/configure ; then
+  if test -e ${srcdir}/$j/configure ; then
     target_configdirs="${target_configdirs} $i"
   fi
 done


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]