aboutsummaryrefslogtreecommitdiffstats
path: root/main/gcc/ada-crossbuild.patch
blob: d3d2280cb63b05535fe7c51856a64e098bf9e0eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Based on http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55946

--- gcc-4.8.1/libada/configure.orig
+++ gcc-4.8.1/libada/configure
@@ -2951,9 +2951,7 @@
 
 
 # Determine what to build for 'gnatlib'
-if test $build = $target \
-   && test ${enable_shared} = yes ; then
-  # Note that build=target is almost certainly the wrong test; FIXME
+if test ${enable_shared} = yes ; then
   default_gnatlib_target="gnatlib-shared"
 else
   default_gnatlib_target="gnatlib-plain"
--- gcc-4.8.1/gcc/ada/gcc-interface/Make-lang.in.orig
+++ gcc-4.8.1/gcc/ada/gcc-interface/Make-lang.in
@@ -625,7 +625,7 @@
 ada/doctools/xgnatugn$(build_exeext): ada/xgnatugn.adb
 	-$(MKDIR) ada/doctools
 	$(CP) $^ ada/doctools
-	cd ada/doctools && $(GNATMAKE) -q xgnatugn
+	cd ada/doctools && gnatmake -q xgnatugn
 
 # Note that doc/gnat_ugn.texi and doc/projects.texi do not depend on
 # xgnatugn being built so we can distribute a pregenerated doc/gnat_ugn.info
--- gcc-4.8.1/gnattools/Makefile.in.orig
+++ gcc-4.8.1/gnattools/Makefile.in
@@ -32,6 +32,8 @@
 # Nonstandard autoconf-set variables.
 LN_S=@LN_S@
 target_noncanonical=@target_noncanonical@
+build=@build@
+host=@host@
 
 # Variables for the user (or the top level) to override.
 exeext = @EXEEXT@
@@ -183,7 +185,11 @@
 # put the host RTS dir first in the PATH to hide the default runtime
 # files that are among the sources
 # FIXME: This should be done in configure.
+ifeq ($(host), $(build))
 RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
+else
+RTS_DIR:=$(strip $(subst \,/,$(shell $(host)-gnatls -v | grep adalib )))
+endif
 gnattools-cross: $(GCC_DIR)/stamp-tools
 	# gnattools1-re
 	$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \