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] Fix srcdir=. bug in build modules


While compiling the latest build from ftp.gnu.org, I got the following
error.
Can someone help me fix this? Thanks in advance.

When the Makefile builds the symlink tree for build-i686-pc-linux-gnu, it makes a symlink tree only for libiberty and fixincludes, not for include. This was always broken, except that now the build directory is always used even in a native configuration.


The attached patch forces a symlink-tree of the include directory to be built under build-i686-pc-linux-gnu, and cleans up Makefile.tpl since BUILD_SUBDIR cannot be . (see my 2004-08-16 change to remove BUILD_DIR_PREFIX and replace it throughout with BUILD_SUBDIR).

I'm including Makefile.in in the patch to ease Rajikishore's testing.

Tested with "./configure && make all-build-libiberty", and a complete bootstrap with a separate build directory. Ok for mainline?

Paolo
2004-10-12  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.tpl (configure-build-[+module+]): Create
	symlink tree of the include directory.
	* Makefile.in: Regenerated.

Index: Makefile.tpl
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.tpl,v
retrieving revision 1.116
diff -u -b -r1.116 Makefile.tpl
--- Makefile.tpl	6 Oct 2004 10:09:29 -0000	1.116
+++ Makefile.tpl	12 Oct 2004 07:51:16 -0000
@@ -823,28 +823,25 @@
 	  /* | [A-Za-z]:[\\/]*) \
 	    topdir=$(srcdir) ;; \
 	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	    topdir="../../$(srcdir)" ;; \
 	esac; \
 	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
 	    if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
 	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
+	      $(MAKE) distclean || exit 1; \
 	      else \
 	        true; \
 	      fi; \
 	    else \
 	      exit 1; \
 	    fi; \
-	  else \
+	  if [ -d ../include ] ; then \
 	    true; \
+	  else \
+	    mkdir ../include; \
+	    cd ../include; \
+	    $(SHELL) $$s/symlink-tree $${topdir}/include "no-such-file"; \
+	    cd ../[+module+]; \
 	  fi; \
 	  srcdiroption="--srcdir=."; \
 	  libsrcdir="."; \
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.in,v
retrieving revision 1.242
diff -u -b -r1.242 Makefile.in
--- Makefile.in	6 Oct 2004 10:09:19 -0000	1.242
+++ Makefile.in	12 Oct 2004 07:52:36 -0000
@@ -2068,28 +2068,25 @@
 	  /* | [A-Za-z]:[\\/]*) \
 	    topdir=$(srcdir) ;; \
 	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	    topdir="../../$(srcdir)" ;; \
 	esac; \
 	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
 	    if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \
 	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
+	      $(MAKE) distclean || exit 1; \
 	      else \
 	        true; \
 	      fi; \
 	    else \
 	      exit 1; \
 	    fi; \
-	  else \
+	  if [ -d ../include ] ; then \
 	    true; \
+	  else \
+	    mkdir ../include; \
+	    cd ../include; \
+	    $(SHELL) $$s/symlink-tree $${topdir}/include "no-such-file"; \
+	    cd ../libiberty; \
 	  fi; \
 	  srcdiroption="--srcdir=."; \
 	  libsrcdir="."; \
@@ -2133,28 +2130,25 @@
 	  /* | [A-Za-z]:[\\/]*) \
 	    topdir=$(srcdir) ;; \
 	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	    topdir="../../$(srcdir)" ;; \
 	esac; \
 	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
 	    if $(SHELL) $$s/symlink-tree $${topdir}/bison "no-such-file" ; then \
 	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
+	      $(MAKE) distclean || exit 1; \
 	      else \
 	        true; \
 	      fi; \
 	    else \
 	      exit 1; \
 	    fi; \
-	  else \
+	  if [ -d ../include ] ; then \
 	    true; \
+	  else \
+	    mkdir ../include; \
+	    cd ../include; \
+	    $(SHELL) $$s/symlink-tree $${topdir}/include "no-such-file"; \
+	    cd ../bison; \
 	  fi; \
 	  srcdiroption="--srcdir=."; \
 	  libsrcdir="."; \
@@ -2198,28 +2192,25 @@
 	  /* | [A-Za-z]:[\\/]*) \
 	    topdir=$(srcdir) ;; \
 	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	    topdir="../../$(srcdir)" ;; \
 	esac; \
 	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
 	    if $(SHELL) $$s/symlink-tree $${topdir}/byacc "no-such-file" ; then \
 	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
+	      $(MAKE) distclean || exit 1; \
 	      else \
 	        true; \
 	      fi; \
 	    else \
 	      exit 1; \
 	    fi; \
-	  else \
+	  if [ -d ../include ] ; then \
 	    true; \
+	  else \
+	    mkdir ../include; \
+	    cd ../include; \
+	    $(SHELL) $$s/symlink-tree $${topdir}/include "no-such-file"; \
+	    cd ../byacc; \
 	  fi; \
 	  srcdiroption="--srcdir=."; \
 	  libsrcdir="."; \
@@ -2263,28 +2254,25 @@
 	  /* | [A-Za-z]:[\\/]*) \
 	    topdir=$(srcdir) ;; \
 	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	    topdir="../../$(srcdir)" ;; \
 	esac; \
 	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
 	    if $(SHELL) $$s/symlink-tree $${topdir}/flex "no-such-file" ; then \
 	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
+	      $(MAKE) distclean || exit 1; \
 	      else \
 	        true; \
 	      fi; \
 	    else \
 	      exit 1; \
 	    fi; \
-	  else \
+	  if [ -d ../include ] ; then \
 	    true; \
+	  else \
+	    mkdir ../include; \
+	    cd ../include; \
+	    $(SHELL) $$s/symlink-tree $${topdir}/include "no-such-file"; \
+	    cd ../flex; \
 	  fi; \
 	  srcdiroption="--srcdir=."; \
 	  libsrcdir="."; \
@@ -2328,28 +2316,25 @@
 	  /* | [A-Za-z]:[\\/]*) \
 	    topdir=$(srcdir) ;; \
 	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	    topdir="../../$(srcdir)" ;; \
 	esac; \
 	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
 	    if $(SHELL) $$s/symlink-tree $${topdir}/m4 "no-such-file" ; then \
 	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
+	      $(MAKE) distclean || exit 1; \
 	      else \
 	        true; \
 	      fi; \
 	    else \
 	      exit 1; \
 	    fi; \
-	  else \
+	  if [ -d ../include ] ; then \
 	    true; \
+	  else \
+	    mkdir ../include; \
+	    cd ../include; \
+	    $(SHELL) $$s/symlink-tree $${topdir}/include "no-such-file"; \
+	    cd ../m4; \
 	  fi; \
 	  srcdiroption="--srcdir=."; \
 	  libsrcdir="."; \
@@ -2393,28 +2378,25 @@
 	  /* | [A-Za-z]:[\\/]*) \
 	    topdir=$(srcdir) ;; \
 	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	    topdir="../../$(srcdir)" ;; \
 	esac; \
 	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
 	    if $(SHELL) $$s/symlink-tree $${topdir}/texinfo "no-such-file" ; then \
 	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
+	      $(MAKE) distclean || exit 1; \
 	      else \
 	        true; \
 	      fi; \
 	    else \
 	      exit 1; \
 	    fi; \
-	  else \
+	  if [ -d ../include ] ; then \
 	    true; \
+	  else \
+	    mkdir ../include; \
+	    cd ../include; \
+	    $(SHELL) $$s/symlink-tree $${topdir}/include "no-such-file"; \
+	    cd ../texinfo; \
 	  fi; \
 	  srcdiroption="--srcdir=."; \
 	  libsrcdir="."; \
@@ -2458,28 +2440,25 @@
 	  /* | [A-Za-z]:[\\/]*) \
 	    topdir=$(srcdir) ;; \
 	  *) \
-	    case "$(BUILD_SUBDIR)" in \
-	      .) topdir="../$(srcdir)" ;; \
-	      *) topdir="../../$(srcdir)" ;; \
-	    esac ;; \
+	    topdir="../../$(srcdir)" ;; \
 	esac; \
 	if [ "$(srcdir)" = "." ] ; then \
-	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
 	    if $(SHELL) $$s/symlink-tree $${topdir}/fixincludes "no-such-file" ; then \
 	      if [ -f Makefile ]; then \
-	        if $(MAKE) distclean; then \
-	          true; \
-	        else \
-	          exit 1; \
-	        fi; \
+	      $(MAKE) distclean || exit 1; \
 	      else \
 	        true; \
 	      fi; \
 	    else \
 	      exit 1; \
 	    fi; \
-	  else \
+	  if [ -d ../include ] ; then \
 	    true; \
+	  else \
+	    mkdir ../include; \
+	    cd ../include; \
+	    $(SHELL) $$s/symlink-tree $${topdir}/include "no-such-file"; \
+	    cd ../fixincludes; \
 	  fi; \
 	  srcdiroption="--srcdir=."; \
 	  libsrcdir="."; \

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