Author: leo
Date: Wed Apr 13 01:17:06 2005
New Revision: 7821

Modified:
   trunk/config/gen/makefiles/root.in
   trunk/config/init/data.pl
Log:
[perl #34933] [PATCH] Handle trailing space in $(LD_OUT)

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.

Courtesy of Andy Dougherty <[EMAIL PROTECTED]>


Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in  (original)
+++ trunk/config/gen/makefiles/root.in  Wed Apr 13 01:17:06 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}
 
@@ -627,7 +626,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)
@@ -662,10 +661,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
@@ -674,7 +673,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
@@ -683,19 +682,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)
 
 ###############################################################################
 #
@@ -1366,17 +1365,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): $(SRC_DIR)/nci_test$(O)
        $(LD) $(LD_LOAD_FLAGS) ${ncilib_link_extra} $(LDFLAGS) \
-           $(LD_OUT)$@ $(SRC_DIR)/nci_test$(O) $(C_LIBS)
+           ${ld_out}$@ $(SRC_DIR)/nci_test$(O) $(C_LIBS)
 
 # vim ctags
 # this needs exuberant-ctags

Modified: trunk/config/init/data.pl
==============================================================================
--- trunk/config/init/data.pl   (original)
+++ trunk/config/init/data.pl   Wed Apr 13 01:17:06 2005
@@ -99,7 +99,7 @@
 
     cc_ldflags    => '',                  # prefix for ldflags (necessary for 
Win32)
 
-    ld_out        => '-o ',               # ld output file
+    ld_out        => '-o ',               # ld output file.  Keep the trailing 
space.
     ld_debug      => '-g ',               # include debug info in executable
 
     # should we have a dependancy upon arc to generate .a's?

Reply via email to