Patchwork [2/3] Fix double '/' in MELT build process

login
register
mail settings
Submitter Alexandre Lissy
Date March 1, 2011, 11:43 a.m.
Message ID <1298979829-3027-3-git-send-email-alissy@mandriva.com>
Download mbox | patch
Permalink /patch/84928/
State New
Headers show

Comments

Alexandre Lissy - March 1, 2011, 11:43 a.m.
Double slashes while building are a problem for RPM's debugedit tool,
which seems to be 'well-known', while never fixed. The only solution is
to fix the build process. Also, remove any trailing slash from
MELTMODULE_SRCDIR variable, since slashes are added when used.
---
 gcc/melt-build.tpl |    8 ++++----
 gcc/melt-module.mk |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

Patch

diff --git a/gcc/melt-build.tpl b/gcc/melt-build.tpl
index 20c0012..4666990 100644
--- a/gcc/melt-build.tpl
+++ b/gcc/melt-build.tpl
@@ -107,7 +107,7 @@  melt-stage0-static/[+base+]-0.so: $(MELT_GENERATED_[+mkvarsuf+]_C_FILES) \
              melt-run.h melt-runtime.h melt-runtime.c \
              melt-predef.h $(melt_make_cc1_dependency)
 	+$(MELT_MAKE_MODULE) melt_module \
-              GCCMELT_MODULE_WORKSPACE=melt-stage0-static/ \
+              GCCMELT_MODULE_WORKSPACE=melt-stage0-static \
 	      GCCMELT_CFLAGS="$(melt_cflags)" \
 	      GCCMELT_MODULE_SOURCE=$(melt_make_source_dir)/generated/[+base+]-0.c \
               GCCMELT_MODULE_BINARY=melt-stage0-static/[+base+]-0
@@ -117,7 +117,7 @@  melt-stage0-dynamic/[+base+]-0.d.so: $(MELT_GENERATED_[+mkvarsuf+]_C_FILES) \
              melt-run.h melt-runtime.h melt-runtime.c \
              melt-predef.h $(melt_make_cc1_dependency)
 	+$(MELT_MAKE_MODULE) melt_module_dynamic \
-              GCCMELT_MODULE_WORKSPACE=melt-stage0-dynamic/ \
+              GCCMELT_MODULE_WORKSPACE=melt-stage0-dynamic \
 	      GCCMELT_CFLAGS="$(melt_cflags)" \
 	      GCCMELT_MODULE_SOURCE=$(melt_make_source_dir)/generated/[+base+]-0.c \
               GCCMELT_MODULE_BINARY=melt-stage0-dynamic/[+base+]-0
@@ -181,7 +181,7 @@  $(MELT_STAGE_ZERO):
               melt-run.h melt-runtime.h melt-predef.h \
               $(melt_make_cc1_dependency)
 	+$(MELT_MAKE_MODULE) melt_module \
-              GCCMELT_MODULE_WORKSPACE=[+melt_stage+]/ \
+              GCCMELT_MODULE_WORKSPACE=[+melt_stage+] \
 	      GCCMELT_CFLAGS="$(melt_cflags)" \
 	      GCCMELT_MODULE_SOURCE=[+melt_stage+]/[+ (. outbase)+]-[+(. stageindex)+].c \
               GCCMELT_MODULE_BINARY=[+melt_stage+]/[+(. outbase)+]-[+(. stageindex)+]
@@ -191,7 +191,7 @@  $(MELT_STAGE_ZERO):
               melt-run.h melt-runtime.h melt-predef.h \
               $(melt_make_cc1_dependency)
 	+$(MELT_MAKE_MODULE) melt_module_withoutline \
-              GCCMELT_MODULE_WORKSPACE=[+melt_stage+]/ \
+              GCCMELT_MODULE_WORKSPACE=[+melt_stage+] \
 	      GCCMELT_CFLAGS="$(melt_cflags)" \
 	      GCCMELT_MODULE_SOURCE=[+melt_stage+]/[+ (. outbase)+]-[+(. stageindex)+].c \
               GCCMELT_MODULE_BINARY=[+melt_stage+]/[+(. outbase)+]-[+(. stageindex)+]
diff --git a/gcc/melt-module.mk b/gcc/melt-module.mk
index 38dad9b..3f45736 100644
--- a/gcc/melt-module.mk
+++ b/gcc/melt-module.mk
@@ -46,7 +46,7 @@  endif
 
 MELTMODULE_BASENAME:=$(basename $(GCCMELT_MODULE_SOURCE))
 MELTMODULE_PLAIN:=$(notdir $(MELTMODULE_BASENAME))
-MELTMODULE_SRCDIR:=$(dir $(GCCMELT_MODULE_SOURCE))
+MELTMODULE_SRCDIR:=$(patsubst %/, %, $(dir $(GCCMELT_MODULE_SOURCE)))
 
 
 ## The .d.so & .n.so suffixes are wired in melt-runtime.c!