Re: [perl #34933] [PATCH] Handle trailing space in $(LD_OUT)

2005-04-13 Thread Leopold Toetsch
Andy Dougherty [EMAIL PROTECTED] wrote:

 Removing ICU from the build uncovered an odd build bug concerning the
 space after ${ld_out} in config/init/data.pl.  This patch fixes it.

Thanks, applied.
leo


[perl #34933] [PATCH] Handle trailing space in $(LD_OUT)

2005-04-12 Thread via RT
# New Ticket Created by  Andy Dougherty 
# Please include the string:  [perl #34933]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34933 


Removing ICU from the build uncovered an odd build bug concerning the
space after ${ld_out} in config/init/data.pl.  This patch fixes it.

Gory details:
The Makefile command to build ./parrot is (essentially)

$(LINK) $(LINKFLAGS) $(LD_OUT)$(PARROT) $(IMCC_DIR)/main$(O) 

Note how there's no space between LD_OUT and PARROT.  That's
deliberate, I think, allowing for VMS-like syntax
link /output=parrot.exe 
on the compile line.

On Unix systems, however, the typical command would be
cc -o parrot 
Some compilers don't require the space after the '-o'; Sun's CC
compiler does (at least under certain conditions, which are triggered
by the parrot Makefile).  The ${ld_out} Configure.pl variable contains
a trailing space, and the $(LD_OUT) Makefile variable also holds that
trailing space.  However, not all 'make' programs honor trailing
spaces.  GNU make does.  Sun's make doesn't.  NetBSD make doesn't
either.

This patch takes the issue out of make's hands and leaves it up to
perl to decide as it extracts the root.in Makefile.  Since I highly
doubt that anyone is experimenting with command-line overrides for LD_OUT
when they type 'make', this fix should be safe and sensible.

diff -r -u parrot-orig/config/gen/makefiles/root.in 
parrot-andy/config/gen/makefiles/root.in
--- parrot-orig/config/gen/makefiles/root.inMon Apr 11 11:14:51 2005
+++ parrot-andy/config/gen/makefiles/root.inTue Apr 12 12:32:04 2005
@@ -121,7 +121,6 @@
 SHARE_EXT   = ${share_ext}
 LOAD_EXT= ${load_ext}
 A   = ${a}
-LD_OUT  = ${ld_out}
 LD_SHARE_FLAGS  = ${ld_share_flags}
 LD_LOAD_FLAGS   = ${ld_load_flags}
 
@@ -625,7 +624,7 @@
$(PARROT) parrot-config.imc VERSION DEVEL
 
 $(PARROT) : $(IMCC_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) 
lib/Parrot/OpLib/core.pm
-   $(LINK) $(LD_OUT)$(PARROT) $(LINKFLAGS) $(IMCC_DIR)/main$(O) 
$(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(PARROT) $(LINKFLAGS) $(IMCC_DIR)/main$(O) 
$(ALL_PARROT_LIBS)
 
 lib_deps_object : $(O_FILES)
$(PERL) tools/dev/lib_deps.pl object $(O_FILES)
@@ -660,10 +659,10 @@
 
 blib/lib/libparrot$(SHARE_EXT) : $(O_FILES)
$(MKDIR) blib blib/lib
-   $(LD) $(LD_SHARE_FLAGS) $(LDFLAGS) 
$(LD_OUT)blib/lib/libparrot$(SHARE_EXT) $(O_FILES) $(C_LIBS) $(LIBICUCORE) 
$(LIBICUDATA)
+   $(LD) $(LD_SHARE_FLAGS) $(LDFLAGS) 
${ld_out}blib/lib/libparrot$(SHARE_EXT) $(O_FILES) $(C_LIBS) $(LIBICUCORE) 
$(LIBICUDATA)
 
 $(PARROT_SO) : $(IMCC_DIR)/main$(O) blib/lib/libparrot$(SHARE_EXT) 
lib/Parrot/OpLib/core.pm
-   $(LINK) $(LINKFLAGS) $(LD_OUT)$(PARROT) $(IMCC_DIR)/main$(O) -Lblib/lib 
-lparrot $(C_LIBS)
+   $(LINK) $(LINKFLAGS) ${ld_out}$(PARROT) $(IMCC_DIR)/main$(O) -Lblib/lib 
-lparrot $(C_LIBS)
 
 #
 # Parrot Debugger
@@ -672,7 +671,7 @@
 $(SRC_DIR)/pdb$(O) : $(GENERAL_H_FILES)
 
 $(PDB) : $(SRC_DIR)/pdb$(O) $(LIBPARROT)
-   $(LINK) $(LD_OUT)$(PDB) $(SRC_DIR)/pdb$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(PDB) $(SRC_DIR)/pdb$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
 
 #
 # Parrot Disassembler
@@ -681,19 +680,19 @@
 $(SRC_DIR)/disassemble$(O) : $(GENERAL_H_FILES)
 
 $(DIS) : $(SRC_DIR)/disassemble$(O) $(LIBPARROT)
-   $(LINK) $(LD_OUT)$(DIS) $(SRC_DIR)/disassemble$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(DIS) $(SRC_DIR)/disassemble$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
 
 #
 # Parrot Dump
 #
 
 $(PDUMP) : $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) $(LIBPARROT)
-   $(LINK) $(LD_OUT)$(PDUMP) $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) 
$(LINKFLAGS) $(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(PDUMP) $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) 
$(LINKFLAGS) $(ALL_PARROT_LIBS)
 
 
 # pbc_info
 $(PINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT)
-   $(LINK) $(LD_OUT)$(PINFO) $(SRC_DIR)/pbc_info$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(PINFO) $(SRC_DIR)/pbc_info$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
 
 ###
 #
@@ -1361,17 +1360,17 @@
 ###
 
 exec : $(SRC_DIR)/exec_start$(O) $(LIBPARROT)
-   $(LINK) $(LD_OUT)$(EXEC) $(LINKFLAGS) $(EXEC)$(O) 
$(SRC_DIR)/exec_start$(O) $(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(EXEC) $(LINKFLAGS) $(EXEC)$(O) 
$(SRC_DIR)/exec_start$(O) $(ALL_PARROT_LIBS)
 
 exec_so : $(SRC_DIR)/exec_start$(O) blib/lib/libparrot$(SHARE_EXT)
-   $(LINK) $(LD_OUT)$(EXEC) $(LINKFLAGS) $(EXEC)$(O) 
$(SRC_DIR)/exec_start$(O) -lparrot $(C_LIBS)
+   $(LINK) ${ld_out}$(EXEC) $(LINKFLAGS) $(EXEC)$(O) 
$(SRC_DIR)/exec_start$(O) -lparrot $(C_LIBS)
 
 ## OS depend targets ##
 
 # for use by t/pmc/nci.t
 $(LIBNCI_TEST_SO):