[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#432356: Acknowledgement ([PATCH] REVERSE_CROSS breaks DEB_CROSS build)



Hello,

A nicer patch has been made to fix this issue.
Replaces ifdef with makefile language ifeq

--
Héctor Orón
diff -urN gcc-4.2-4.2-20070707/debian/rules2 gcc-4.2-4.2-20070707.cross/debian/rules2
--- gcc-4.2-4.2-20070707/debian/rules2	2007-07-09 20:47:25.000000000 +0200
+++ gcc-4.2-4.2-20070707.cross/debian/rules2	2007-07-09 21:07:48.000000000 +0200
@@ -76,7 +76,7 @@
   BOOT_CFLAGS = $(strip -O2 $(CPPFLAGS) -fno-stack-protector)
 endif
 
-ifdef DEB_CROSS
+ifeq ($(DEB_CROSS),yes)
   CFLAGS	= $(BOOT_CFLAGS)
 endif
 
@@ -133,7 +133,7 @@
   endif
 endif
 
-ifndef DEB_CROSS
+ifneq ($(DEB_CROSS),yes)
   ifneq ($(PKGSOURCE),gcc-snapshot)
     cxx_inc_dir	= $(PF)/include/c++/$(BASE_VERSION)
   endif
@@ -309,7 +309,7 @@
   CONFARGS += --enable-checking=release
 endif
 
-ifndef DEB_CROSS
+ifneq ($(DEB_CROSS),yes)
   CONFARGS += \
 	--build=$(DEB_BUILD_GNU_TYPE) \
 	--host=$(DEB_HOST_GNU_TYPE) \
@@ -387,7 +387,7 @@
 	@echo "GCC version: $(GCC_VERSION)"
 	@echo "Base Debian version: $(BASE_VERSION)"
 	@echo -e "Configured with: $(foreach i,$(CONFARGS),$(i)\n\t)"
-ifdef DEB_CROSS
+ifeq ($(DEB_CROSS),yes)
 	@echo "Building cross compiler for $(DEB_TARGET_ARCH)"
 endif
 	@echo "Using shell $(SHELL)"
@@ -542,8 +542,41 @@
 	dh_testdir
 	rm -f bootstrap-protocol
 # DEB_CROSS is never set if REVERSE_CROSS is set and vice-versa.
-ifndef DEB_CROSS
-ifndef REVERSE_CROSS
+# DEB_CROSS build
+ifeq ($(DEB_CROSS),yes)
+	: # build cross compiler for $(TARGET_ALIAS)
+	( \
+	  set +e; \
+	  PATH=$(PWD)/bin:$$PATH \
+	  $(SET_LOCPATH) \
+	    $(MAKE) -C $(builddir) $(NJOBS) \
+		CC="$(CC)" \
+		CFLAGS="$(CFLAGS)" \
+		BOOT_CFLAGS="$(BOOT_CFLAGS)" \
+		LDFLAGS="$(LDFLAGS)" \
+		; \
+	  echo $$? > status; \
+	) 2>&1 | tee bootstrap-protocol
+	s=`cat status`; rm -f status; test $$s -eq 0
+else
+  # REVERSE_CROSS build
+  ifeq ($(REVERSE_CROSS),yes)
+	: # build cross compiler for $(TARGET_ALIAS)
+	( \
+	  set +e; \
+	  PATH=$(PWD)/bin:$$PATH \
+	  $(SET_LOCPATH) \
+	    $(MAKE) -C $(builddir) $(NJOBS) \
+		CC="$(CC)" \
+		CFLAGS="$(CFLAGS)" \
+		BOOT_CFLAGS="$(BOOT_CFLAGS)" \
+		LDFLAGS="$(LDFLAGS)" \
+		; \
+	  echo $$? > status; \
+	) 2>&1 | tee bootstrap-protocol
+	s=`cat status`; rm -f status; test $$s -eq 0
+else
+  # Native build
   ifeq ($(with_java),yes)
 	mkdir -p bin
 	ln -sf /usr/bin/fastjar bin/jar
@@ -604,21 +637,6 @@
 	  echo $$? > status; \
 	) 2>&1 | tee bootstrap-protocol
 	s=`cat status`; rm -f status; test $$s -eq 0
-else
-	: # build cross compiler for $(TARGET_ALIAS)
-	( \
-	  set +e; \
-	  PATH=$(PWD)/bin:$$PATH \
-	  $(SET_LOCPATH) \
-	    $(MAKE) -C $(builddir) $(NJOBS) \
-		CC="$(CC)" \
-		CFLAGS="$(CFLAGS)" \
-		BOOT_CFLAGS="$(BOOT_CFLAGS)" \
-		LDFLAGS="$(LDFLAGS)" \
-		; \
-	  echo $$? > status; \
-	) 2>&1 | tee bootstrap-protocol
-	s=`cat status`; rm -f status; test $$s -eq 0
 endif
 endif
 	-chmod 755 $(srcdir)/contrib/warn_summary
@@ -1039,7 +1057,7 @@
   gpc_pkg_ver := -$(GPC_BASE_VERSION)$(pkg_ver)
 endif
 
-ifndef DEB_CROSS
+ifneq ($(DEB_CROSS),yes)
   p_base = gcc$(pkg_ver)-base
   p_gcc  = gcc$(pkg_ver)
   p_cpp  = cpp$(pkg_ver)
@@ -1075,7 +1093,7 @@
   include debian/rules.d/binary-snapshot.mk
 else
 
-ifndef DEB_CROSS
+ifneq ($(DEB_CROSS),yes)
 # ----------------------------------------
 # native target
 
@@ -1549,7 +1567,7 @@
 #	    > debian/shlibs.local
 #endif
 
-ifdef DEB_CROSS
+ifeq ($(DEB_CROSS),yes)
   ifeq ($(DEB_TARGET_ARCH),s390)
 	: # s390 64bit stuff happens to be in s390x-linux-gnu/lib64/
 	mkdir -p $(d)/$(PF)/s390-linux-gnu/lib64

Reply to: