Wojciech,

I've reviewed your patch for STDCXX-1051. It looks reasonable
to me. I've made a couple of minor changes (see the attached
diff):

1) Renamed EXEC_RUNNER to CFG_EXEC to match the .cfg suffix
   we use for some of the configuration files (such as
   GNUMakefile.cfg), and left it unset by default to avoid
   unnecessarily invoking the shell by default. The extra
   shell invocation can be quite expensive on systems line
   CygWin and make the configuration process very slow.

2) Removed the changes to the link and compile_then_link
   functions. Because of the comments within them these
   were effectively commented out and had no effect.

   I also don't understand why the chmod +x command is
   necessary. The linker should set the executable bit after
   a successful link. There is one linker (HP) that fails (or
   used to) to delete the output file on failure (maybe when
   when it crashes). With that linker the only way to tell
   that the file is bad (other than the exit status of the
   linker) is by examining the executable bit.

I've successfully tested the attached patch both ways, with
and without a CFG_EXEC script. Let me know if this works for
you.

Martin
Index: GNUmakefile
===================================================================
--- GNUmakefile (revision 1078356)
+++ GNUmakefile (working copy)
@@ -114,6 +114,12 @@
 #
 #   CCVER     - compiler version (must contain no spaces)
 #
+#   CFG_EXEC  - when defined, each executable configuration test is
+#               is invoked by passing its file name as an argument
+#               to $(CFG_EXEC) 
+#               useful for cross-compilation to execute config tests
+#               in an emulator
+#
 #   DEPENDFLAGS - preprocessor flags used to generate dependencies
 #
 #   LIBBASE   - name of the library w/o the suffix suitable
@@ -652,7 +658,8 @@
           && echo "CADVISEFLAGS = $(CADVISEFLAGS)"       >> $(MAKEFILE_IN)  \
           && echo "WITH_PURIFY = $(WITH_PURIFY)"         >> $(MAKEFILE_IN)  \
           && echo "PURIFYFLAGS = $(PURIFYFLAGS)"         >> $(MAKEFILE_IN)  \
-          && echo "CXX_REPOSITORY = $(CXX_REPOSITORY)"  >> $(MAKEFILE_IN));
+          && echo "CXX_REPOSITORY = $(CXX_REPOSITORY)"   >> $(MAKEFILE_IN)  \
+          && echo "CFG_EXEC = $(CFG_EXEC)"               >> $(MAKEFILE_IN));
 
 # creates the build directory tree and generates makefile.in
 builddir: $(MAKEFILE_IN)
Index: etc/config/GNUmakefile.cfg
===================================================================
--- etc/config/GNUmakefile.cfg  (revision 1078356)
+++ etc/config/GNUmakefile.cfg  (working copy)
@@ -252,7 +252,7 @@
                   LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:. ;                  \
                   LIBPATH=$$LIBPATH:. ;                                  \
                   export LIBPATH LD_LIBRARY_PATH ;                       \
-                  text=`./$$file` ;                                      \
+                  text=`$(CFG_EXEC) ./$$file`;                           \
               fi;                                                        \
               res=$$? ;                                                  \
                  [ $$res -eq 0 -a $$neg -ne 0 ]                          \

Reply via email to