# Directory where sources are, from where we are.
VPATH = $(srcdir)/ada
+# Full path to top source directory
+# In particular this is used to access libgcc headers, so that references to
+# these headers from GNAT runtime objects have path names in debugging info
+# that are consistent with libgcc objects. Also used for other references to
+# the top source directory for consistency.
+ftop_srcdir := $(shell cd $(srcdir)/..;${PWD_COMMAND})
+
fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND})
fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/
fcurdir := $(shell ${PWD_COMMAND})
# 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)/ada -I$(srcdir) -I$(srcdir)/../include $(GMPINC)
+INCLUDES = -I- -I. -I.. -I$(srcdir)/ada -I$(srcdir) -I$(ftop_srcdir)/include $(GMPINC)
ADA_INCLUDES = -I- -I. -I$(srcdir)/ada
ifneq ($(findstring vxworks,$(target_os)),)
INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \
-iquote $(fsrcdir)/ada \
- -I$(fsrcdir)/../include $(GMPINC)
+ -I$(ftop_srcdir)/include $(GMPINC)
else
INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \
-iquote $(fsrcdir)/ada -iquote $(fsrcdir) \
- -I$(fsrcdir)/../include $(GMPINC)
+ -I$(ftop_srcdir)/include $(GMPINC)
endif
ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)/ada
# PowerPC and e500v2 VxWorks
ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(target_cpu) $(target_vendor) $(target_os))),)
- ifeq ($(strip $(filter-out e500%, $(arch))),)
+ ifeq ($(strip $(filter-out e500%, $(target_alias))),)
ARCH_STR=e500
else
ARCH_STR=ppc
EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
endif
-# ARM linux, Android eabi
+# ARM android
ifeq ($(strip $(filter-out arm% linux-androideabi,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-linux.ads \
indepsw.adb<indepsw-gnu.adb
GNATLIB_SHARED = gnatlib-shared-dual
+ MISCLIB = -ldl
GMEM_LIB = gmemlib
LIBRARY_VERSION := $(LIB_VERSION)
endif
indepsw.adb<indepsw-gnu.adb
endif
-# *-elf, *-eabi or *-eabispe
+# *-elf, *-eabi, or *-eabispe
ifeq ($(strip $(filter-out elf eabi eabispe,$(target_os))),)
TOOLS_TARGET_PAIRS=\
mlib-tgt-specific.adb<mlib-tgt-specific-xi.adb \
EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
EH_MECHANISM=-gcc
THREADSLIB=-lpthread -lrt
+ MISCLIB = -ldl
GNATLIB_SHARED=gnatlib-shared-dual
GMEM_LIB = gmemlib
LIBRARY_VERSION := $(LIB_VERSION)
raise-gcc.o : raise-gcc.c raise.h
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
- -iquote $(srcdir) -iquote $(srcdir)/../libgcc \
+ -iquote $(srcdir) -iquote $(ftop_srcdir)/libgcc \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
cio.o : cio.c