Browse Source

* Don't stringfix on debug binaries

Bryan Drewery 14 years ago
parent
commit
f03fc56966
3 changed files with 11 additions and 8 deletions
  1. 7 5
      Makefile.in
  2. 3 2
      build/build.mk.in
  3. 1 1
      build/cc1plus

+ 7 - 5
Makefile.in

@@ -58,19 +58,21 @@ _CFLGS = -fno-strict-aliasing -W -Wformat \
 
 MAKEFLAGS = -s @MAKEJOBS@
 
+STRINGFIX = src/stringfix
+
 MAKE_STATIC = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'LD=$(LD_STATIC)' 'INCLUDES=$(INCLUDES)' \
 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
-'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DBIN_TYPE_STATIC' \
+'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DBIN_TYPE_STATIC' 'STRINGFIX=$(STRINGFIX)' \
 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(wraith)'
 
 MAKE_DYNAMIC = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'LD=$(LD_DYNAMIC)' 'INCLUDES=$(INCLUDES)' \
 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
-'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DBIN_TYPE_DYNAMIC' \
+'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DBIN_TYPE_DYNAMIC' 'STRINGFIX=$(STRINGFIX)' \
 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(wraith)'
 
 MAKE_DEBUG = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CCDEBUG)' 'LD=$(LD_DEBUG) -g' 'INCLUDES=$(INCLUDES)' \
 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
-'STRIP=touch' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS) -DBIN_TYPE_DYNAMIC' \
+'STRIP=touch' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS) -DBIN_TYPE_DYNAMIC' 'STRINGFIX=' \
 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(debug)'
 
 MAKE_UTILS = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CCDEBUG)' 'STRIP=touch' 'INCLUDES=$(INCLUDES)' \
@@ -90,7 +92,7 @@ default: dynamic
 test:
 
 cleanutils:
-	@rm -f src/stringfix@EXEEXT@ src/sorthelp@EXEEXT@ src/makehelp@EXEEXT@ src/makeres@EXEEXT@ src/makeset@EXEEXT@
+	@rm -f $(STRINGFIX) src/sorthelp@EXEEXT@ src/makehelp@EXEEXT@ src/makeres@EXEEXT@ src/makeset@EXEEXT@
 
 clean:  cleanutils
 	+@cd src && $(MAKE) clean
@@ -155,7 +157,7 @@ help: makehelp stringfix
 	@(if [ ! -f src/help.h ]; then \
 	touch src/help.h; \
 	fi)
-	@src/stringfix@EXEEXT@ src/help.h.tmp~ src/help.h~ 1
+	@$(STRINGFIX) src/help.h.tmp~ src/help.h~ 1
 	@(if test "x`$(DIFF) -qurN src/help.h~ src/help.h`" != "x"; then \
 	cp -f src/help.h~ src/help.h; \
 	fi)

+ 3 - 2
build/build.mk.in

@@ -2,6 +2,7 @@ depcomp = /bin/sh $(top_srcdir)/build/autotools/depcomp
 
 %.o: %.c stringfix@EXEEXT@ $(top_srcdir)/build/cc1plus
 	@echo -e "Compiling: \033[1m`basename $< .c`\033[0m"
-	stringfix="./stringfix@EXEEXT@" source='$<' object='$@' depfile='.deps/$*.Po' tmpdepfile='.deps/$*.TPo' depmode=$(CCDEPMODE) $(depcomp) \
-	$(CXX) -no-integrated-cpp -B$(top_srcdir)/build $(CXXFLAGS) $(CPPFLAGS) -c $<  -o `basename $< .c`.o
+	# STRINGFIX included after CXX for ccache to recognize
+	stringfix="$(top_srcdir)/$(STRINGFIX)" source='$<' object='$@' depfile='.deps/$*.Po' tmpdepfile='.deps/$*.TPo' depmode=$(CCDEPMODE) $(depcomp) \
+	$(CXX) -DSTRINGFIX=$(STRINGFIX) -no-integrated-cpp -B$(top_srcdir)/build $(CXXFLAGS) $(CPPFLAGS) -c $<  -o `basename $< .c`.o
 

+ 1 - 1
build/cc1plus

@@ -4,7 +4,7 @@
 # This avoids the need for the old _*.c temp files.
 
 # Only capture pre-processing
-if [ $1 != "-E" -o -z "$stringfix" ]; then
+if [ $1 != "-E" -o -z "$stringfix" -o ! -f "$stringfix" ]; then
   exec $(${COLLECT_GCC} --print-prog-name=cc1plus) $@
 fi