This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR ada/39172: fix building libada for m68k


All the makefile fragments in the gcc directory assume that $(srcdir)
points to the gcc directory, not the language subdir.  This patch
changes the definition of srcdir in the ada makefiles to match that
assumption.

Additionally, the m68k/t-mlib fragment needs AWK and target_cpu_default
defined.

Tested by building a cross to m68k-linux and bootstraping on
ia64-suse-linux.

Andreas.

2009-02-26  Andreas Schwab  <schwab@suse.de>

gcc/ada/:
	PR ada/39172
	* Makefile.in (srcdir): Set to @top_srcdir@ instead of @srcdir@.
	* gcc-interface/Makefile.in: Change all uses of $(srcdir),
	$(fsrcdir) and $(fsrcpfx) to add ada subdir.
	(AWK): Substitute.
	(target_cpu_default): Substitute.

gnattools/:
	PR ada/39172
	* Makefile.in (fsrcdir): Point to gcc directory, not gcc/ada.
	(INCLUDES_FOR_SUBDIR): Adjust.
	(ADA_INCLUDES_FOR_SUBDIR): Adjust.

Index: gcc/ada/Makefile.in
===================================================================
--- gcc/ada/Makefile.in	(revision 144445)
+++ gcc/ada/Makefile.in	(working copy)
@@ -1,3 +1,5 @@
-srcdir = @srcdir@
+# All makefile fragments assume that $(srcdir) points to the gcc
+# directory, not the language subdir
+srcdir = @top_srcdir@
 -include ./gcc-interface/Makefile
 -include ../gcc-interface/Makefile
Index: gcc/ada/gcc-interface/Makefile.in
===================================================================
--- gcc/ada/gcc-interface/Makefile.in	(revision 144445)
+++ gcc/ada/gcc-interface/Makefile.in	(working copy)
@@ -90,6 +90,7 @@ AR_FLAGS = rc
 LS = ls
 RANLIB = @RANLIB@
 RANLIB_FLAGS = @ranlib_flags@
+AWK = @AWK@
 
 SHELL = @SHELL@
 PWD_COMMAND = $${PWDCMD-pwd}
@@ -148,11 +149,12 @@ target=@target@
 xmake_file = @xmake_file@
 tmake_file = @tmake_file@
 host_canonical=@host@
+target_cpu_default=@target_cpu_default@
 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
 
 # Directory where sources are, from where we are.
-VPATH = $(srcdir)
+VPATH = $(srcdir)/ada
 
 fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND})
 fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/
@@ -189,19 +191,14 @@ all: all.indirect
 # This tells GNU Make version 3 not to put all variables in the environment.
 .NOEXPORT:
 
-# tmake_file and xmake_file expand to lists with entries of the form
-# $(srcdir)/config/...  but here $(srcdir) is the ada subdirectory so we
-# need to adjust the paths.  There can't be spaces in the subst arguments
-# or we get spurious spaces in the actual list of files to include.
-
 # target overrides
 ifneq ($(tmake_file),)
-include $(subst /config,/../config,$(tmake_file))
+include $(tmake_file)
 endif
 
 # host overrides
 ifneq ($(xmake_file),)
-include $(subst /config,/../config,$(xmake_file))
+include $(xmake_file)
 endif
 
 # Now figure out from those variables how to compile and link.
@@ -236,14 +233,14 @@ TOOLS_LIBS = $(EXTRA_GNATTOOLS_OBJS) tar
 # Both . and srcdir are used, in that order,
 # so that tm.h and config.h will be found in the compilation
 # subdirectory rather than in the source directory.
-INCLUDES = -I- -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config \
-	-I$(srcdir)/../../include
+INCLUDES = -I- -I. -I.. -I$(srcdir)/ada -I$(srcdir) -I$(srcdir)/config \
+	-I$(srcdir)/../include
 
-ADA_INCLUDES = -I- -I. -I$(srcdir)
+ADA_INCLUDES = -I- -I. -I$(srcdir)/ada
 
-INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir) -I$(fsrcdir)/../config \
-	-I$(fsrcdir)/../../include -I$(fsrcdir)/..
-ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir) -I$(fsrcdir)/gcc
+INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir)/ada -I$(fsrcdir)/config \
+	-I$(fsrcdir)/../include -I$(fsrcdir)
+ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)/ada
 
 # Avoid a lot of time thinking about remaking Makefile.in and *.def.
 .SUFFIXES: .in .def
@@ -266,7 +263,7 @@ ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdi
 	$(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
 
 # how to regenerate this file
-Makefile: ../config.status $(srcdir)/gcc-interface/Makefile.in $(srcdir)/Makefile.in $(srcdir)/../version.c
+Makefile: ../config.status $(srcdir)/ada/gcc-interface/Makefile.in $(srcdir)/ada/Makefile.in $(srcdir)/version.c
 	cd ..; \
 	LANGUAGES="$(CONFIG_LANGUAGES)" \
 	CONFIG_HEADERS= \
@@ -392,7 +389,7 @@ DUMMY_SOCKETS_TARGET_PAIRS = \
   g-sothco.ads<g-sothco-dummy.ads \
   g-sttsne.ads<g-sttsne-dummy.ads
 
-LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/'))
+LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)ada/gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/'))
 
 # $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT.
 # $(strip STRING) removes leading and trailing spaces from STRING.
@@ -1334,7 +1331,7 @@ endif
      ../../vms_help$(exeext) \
      ../../gnat.hlp
   # This command transforms (YYYYMMDD) into YY,MMDD
-  GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\).*/\2,\3/')
+  GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)ada/gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\).*/\2,\3/')
   TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
   LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
 endif
@@ -1808,7 +1805,7 @@ LIBGNAT_OBJS = adaint.o argv.o cio.o cst
 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
 # the following include file:
 
-include $(fsrcdir)/Makefile.rtl
+include $(fsrcdir)/ada/Makefile.rtl
 
 GNATRTL_LINEARALGEBRA_OBJS = a-nlcoar.o a-nllcar.o a-nllrar.o a-nlrear.o \
   a-nucoar.o a-nurear.o i-forbla.o i-forlap.o s-gearop.o
@@ -1993,14 +1990,14 @@ install-gnatlib: ../stamp-gnatlib-$(RTSD
 	$(CHMOD) u+w $(RTSDIR)
 # Copy target independent sources
 	$(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
-	  $(LN_S) $(fsrcpfx)$(f) $(RTSDIR) ;) true
+	  $(LN_S) $(fsrcpfx)ada/$(f) $(RTSDIR) ;) true
 # Remove files to be replaced by target dependent sources
 	$(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
 	                $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR))))
 	$(RM) $(RTSDIR)/*-*-*.ads $(RTSDIR)/*-*-*.adb
 # Copy new target dependent sources
 	$(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
-	          $(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
+	          $(LN_S) $(fsrcpfx)ada/$(word 2,$(subst <, ,$(PAIR))) \
 	                $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR)));)
 # Copy generated target dependent sources
 	$(RM) $(RTSDIR)/s-oscons.ads
@@ -2372,5 +2369,5 @@ force:
 	$(GNATLINK) -v vms_help -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
 
 ../../gnat.hlp: ../../vms_help$(exeext)
-	../../vms_help$(exeext) $(fsrcdir)/gnat.help_in \
-	                        $(fsrcdir)/vms_data.ads ../../gnat.hlp
+	../../vms_help$(exeext) $(fsrcdir)/ada/gnat.help_in \
+	                        $(fsrcdir)/ada/vms_data.ads ../../gnat.hlp
Index: gnattools/Makefile.in
===================================================================
--- gnattools/Makefile.in	(revision 144445)
+++ gnattools/Makefile.in	(working copy)
@@ -56,13 +56,13 @@ ADAFLAGS= -gnatpg -gnata
 # For finding the GCC build dir, which is used far too much
 GCC_DIR=../gcc
 
-# Absolute srcdir for gcc/ada (why do we want absolute?  I dunno)
-fsrcdir := $(shell cd $(srcdir)/../gcc/ada/; ${PWD_COMMAND})
+# Absolute srcdir for gcc (why do we want absolute?  I dunno)
+fsrcdir := $(shell cd $(srcdir)/../gcc/; ${PWD_COMMAND})
 
 # Useful "subroutines" for the excess includes
-INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir) -I$(fsrcdir)/../config \
-	-I$(fsrcdir)/../../include -I$(fsrcdir)/..
-ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)
+INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir)/ada -I$(fsrcdir)/config \
+	-I$(fsrcdir)/../include -I$(fsrcdir)
+ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)/ada
 
 # Variables for gnattools1, native
 TOOLS_FLAGS_TO_PASS_1= \

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]