Make $(native-compile) run in source directory like other compilation commands.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 24 Apr 2012 20:05:34 +0000 (20:05 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 24 Apr 2012 20:05:34 +0000 (20:05 +0000)
ChangeLog
Makerules

index b8ba4095bc103439e15f66e9ca240beecf54a794..1e22a45c475c73ff7e87d35eac29118735b3c170 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-04-24  Joseph Myers  <joseph@codesourcery.com>
+
+       * Makerules (native-compile): Do not change working directory for
+       build.  Use $(OUTPUT_OPTION) in command.
+       (ALL_BUILD_CFLAGS): Use $(common-objpfx) to find config.h.
+
 2012-04-24  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
        [BZ #13886]
index d184be6d20d8c63306e2d27366e8fee731a7ed59..a9b178608c5822783d60b3614cce3147403eb434 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -1114,17 +1114,15 @@ install-no-libc.a-nosubdir: install-bin-nosubdir install-bin-script-nosubdir \
 endif
 install: install-no-libc.a-nosubdir
 \f
-# Command to compile $< in $(objdir) using the native libraries.
+# Command to compile $< using the native libraries.
 define native-compile
 $(make-target-directory)
-$(patsubst %/,cd % &&,$(objpfx)) \
 $(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
-           $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
+           $< $(OUTPUT_OPTION)
 endef
 
 # We always want to use configuration definitions.
-# Note that this is only used for commands running in $(objpfx).
-ALL_BUILD_CFLAGS = $(BUILD_CFLAGS) -include $(..)config.h
+ALL_BUILD_CFLAGS = $(BUILD_CFLAGS) -include $(common-objpfx)config.h
 
 # Support the GNU standard name for this target.
 .PHONY: check