s-osprim.adb<s-osprim-vxworks.adb \
s-parame.ads<s-parame-vxworks.ads \
s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
s-stchop.adb<s-stchop-vxworks.adb \
s-taprop.adb<s-taprop-vxworks.adb \
s-taspri.ads<s-taspri-vxworks.ads \
g-sttsne.ads<g-sttsne-locking.ads \
system.ads<system-vxworks-m68k.ads
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
s-osprim.adb<s-osprim-vxworks.adb \
s-parame.ads<s-parame-vxworks.ads \
s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
s-stchop.adb<s-stchop-vxworks.adb \
s-taprop.adb<s-taprop-vxworks.adb \
s-taspri.ads<s-taspri-vxworks.ads \
g-sttsne.adb<g-sttsne-vxworks.adb \
g-sttsne.ads<g-sttsne-locking.ads
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
ifeq ($(strip $(filter-out yes,$(TRACE))),)
LIBGNAT_TARGET_PAIRS += \
g-sttsne.ads<g-sttsne-locking.ads \
system.ads<system-vxworks-ppc-vthread.ads
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
s-osprim.adb<s-osprim-vxworks.adb \
s-parame.ads<s-parame-vxworks.ads \
s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
s-stchop.adb<s-stchop-vxworks.adb \
s-taprop.adb<s-taprop-vxworks.adb \
s-taspri.ads<s-taspri-vxworks.ads \
g-sttsne.ads<g-sttsne-locking.ads \
system.ads<system-vxworks-sparcv9.ads \
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
s-osprim.adb<s-osprim-vxworks.adb \
s-parame.ads<s-parame-vxworks.ads \
s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
s-stchop.adb<s-stchop-vxworks.adb \
s-taprop.adb<s-taprop-vxworks.adb \
s-taspri.ads<s-taspri-vxworks.ads \
g-sttsne.adb<g-sttsne-vxworks.adb \
g-sttsne.ads<g-sttsne-locking.ads
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
ifeq ($(strip $(filter-out yes,$(TRACE))),)
LIBGNAT_TARGET_PAIRS += \
s-osprim.adb<s-osprim-vxworks.adb \
s-parame.ads<s-parame-vxworks.ads \
s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
s-stchop.adb<s-stchop-vxworks.adb \
s-taprop.adb<s-taprop-vxworks.adb \
s-taspri.ads<s-taspri-vxworks.ads \
g-sttsne.ads<g-sttsne-locking.ads \
system.ads<system-vxworks-arm.ads
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
s-osprim.adb<s-osprim-vxworks.adb \
s-parame.ads<s-parame-vxworks.ads \
s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
s-stchop.adb<s-stchop-vxworks.adb \
s-taprop.adb<s-taprop-vxworks.adb \
s-taspri.ads<s-taspri-vxworks.ads \
g-sttsne.ads<g-sttsne-locking.ads \
system.ads<system-vxworks-mips.ads
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-vxworks.adb
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
endif
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-solaris.adb
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
EH_MECHANISM=-gcc
THREADSLIB = -lposix4 -lthread
g-soliop.ads<g-soliop-solaris.ads \
system.ads<system-solaris-x86.ads
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-solaris.adb
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
EH_MECHANISM=-gcc
THREADSLIB = -lposix4 -lthread
else
LIBGNAT_TARGET_PAIRS += \
g-soccon.ads<g-soccon-linux-x86.ads \
+ s-linux.ads<s-linux.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osinte.ads<s-osinte-linux.ads \
s-tasinf.ads<s-tasinf-linux.ads \
EH_MECHANISM=-gcc
THREADSLIB = -lpthread
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
endif
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-linux.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
indepsw.adb<indepsw-gnu.adb
GNATLIB_SHARED = gnatlib-shared-dual
system.ads<system-freebsd-x86.ads
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-linux.adb
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
GNATLIB_SHARED = gnatlib-shared-dual
EH_MECHANISM=-gcc
a-intnam.ads<a-intnam-linux.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osinte.ads<s-osinte-linux.ads \
s-osprim.adb<s-osprim-posix.adb \
s-taprop.adb<s-taprop-linux.adb \
s-tasinf.ads<s-tasinf-linux.ads \
s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix.ads \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
system.ads<system-linux-s390x.ads
else
a-intnam.ads<a-intnam-linux.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osinte.ads<s-osinte-linux.ads \
s-osprim.adb<s-osprim-posix.adb \
s-taprop.adb<s-taprop-linux.adb \
s-tasinf.ads<s-tasinf-linux.ads \
s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix.ads \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
system.ads<system-linux-s390.ads
endif
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-linux.adb
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
EH_MECHANISM=-gcc
THREADSLIB = -lpthread
GNATLIB_SHARED = gnatlib-shared-dual
endif
EH_MECHANISM=-gcc
- TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-irix.adb
+ TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-irix.adb
TGT_LIB = -lexc
MISCLIB = -lexc
PREFIX_OBJS = $(PREFIX_REAL_OBJS)
g-soccon.ads<g-soccon-hpux.ads \
system.ads<system-hpux.ads
- TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-hpux.adb
+ TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-hpux.adb
EH_MECHANISM=-gcc
TGT_LIB = /usr/lib/libcl.a
THREADSLIB = -lpthread
PREFIX_OBJS=$(PREFIX_REAL_OBJS)
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-aix.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-aix.adb \
indepsw.adb<indepsw-aix.adb
GMEM_LIB = gmemlib
ifeq ($(strip $(filter-out lynxos,$(osys))),)
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-lynxos.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-lynxos.adb \
indepsw.adb<indepsw-gnu.adb
ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
g-soccon.ads<g-soccon-tru64.ads \
system.ads<system-tru64.ads
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-tru64.adb
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-tru64.adb
EH_MECHANISM=-gcc
GMEM_LIB=gmemlib
LIBGNAT_TARGET_PAIRS_AUX1 = \
g-enblsp.adb<g-enblsp-vms-ia64.adb \
g-trasym.adb<g-trasym-vms-ia64.adb \
- s-auxdec.ads<s-auxdec-vms_64.ads \
+ s-asthan.adb<s-asthan-vms-ia64.adb \
s-osinte.adb<s-osinte-vms-ia64.adb \
s-osinte.ads<s-osinte-vms-ia64.ads \
s-vaflop.adb<s-vaflop-vms-ia64.adb \
LIBGNAT_TARGET_PAIRS_AUX1 = \
g-enblsp.adb<g-enblsp-vms-alpha.adb \
g-trasym.adb<g-trasym-vms-alpha.adb \
+ s-traent.adb<s-traent-vms.adb \
+ s-traent.ads<s-traent-vms.ads \
s-asthan.adb<s-asthan-vms-alpha.adb \
- s-auxdec.ads<s-auxdec-vms_64.ads \
s-osinte.adb<s-osinte-vms.adb \
s-osinte.ads<s-osinte-vms.ads \
s-vaflop.adb<s-vaflop-vms-alpha.adb \
i-cpoint.ads<i-cpoint-vms_64.ads \
i-cpoint.adb<i-cpoint-vms_64.adb \
i-cstrea.adb<i-cstrea-vms.adb \
+ memtrack.adb<memtrack-vms_64.adb \
+ s-auxdec.ads<s-auxdec-vms_64.ads \
+ s-crtl.ads<s-crtl-vms_64.ads \
s-inmaop.adb<s-inmaop-vms.adb \
s-interr.adb<s-interr-vms.adb \
s-intman.adb<s-intman-vms.adb \
s-intman.ads<s-intman-vms.ads \
+ s-memory.adb<s-memory-vms_64.adb \
+ s-memory.ads<s-memory-vms_64.ads \
s-osprim.adb<s-osprim-vms.adb \
s-osprim.ads<s-osprim-vms.ads \
s-taprop.adb<s-taprop-vms.adb \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
s-tpopde.adb<s-tpopde-vms.adb \
s-tpopde.ads<s-tpopde-vms.ads \
- s-traent.adb<s-traent-vms.adb \
- s-traent.ads<s-traent-vms.ads \
$(LIBGNAT_TARGET_PAIRS_AUX1) \
$(LIBGNAT_TARGET_PAIRS_AUX2)
ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
TOOLS_TARGET_PAIRS= \
- mlib-tgt-specific.adb<mlib-tgt-vms-ia64.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-vms-ia64.adb \
symbols.adb<symbols-vms.adb \
symbols-processing.adb<symbols-processing-vms-ia64.adb
else
TOOLS_TARGET_PAIRS= \
- mlib-tgt-specific.adb<mlib-tgt-vms-alpha.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-vms-alpha.adb \
symbols.adb<symbols-vms.adb \
symbols-processing.adb<symbols-processing-vms-alpha.adb
endif
+adamsg.o: adamsg.msg
+ -$(DECC) --cc=message adamsg.msg -o adamsg.o
- EXTRA_GNATMAKE_OBJS = mlib-tgt-vms.o
+ EXTRA_GNATMAKE_OBJS = mlib-tgt-vms_common.o
GMEM_LIB = gmemlib
EH_MECHANISM=-gcc
EXTRA_LIBGNAT_SRCS=vmshandler.asm
EXTRA_LIBGNAT_OBJS=vmshandler.o
endif
+ EXTRA_LIBGNAT_SRCS+=adamsg.msg
+ EXTRA_LIBGNAT_OBJS+=adamsg.o
EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
EXTRA_GNATTOOLS = \
../../gnatlbr$(exeext) \
../../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)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
g-socthi.adb<g-socthi-mingw.adb \
g-stsifd.adb<g-stsifd-sockets.adb \
g-soccon.ads<g-soccon-mingw.ads \
- g-soliop.ads<g-soliop-mingw.ads \
- g-sercom.adb<g-sercom-mingw.adb
+ g-soliop.ads<g-soliop-mingw.ads
ifeq ($(strip $(filter-out rtx_w32 rtx_rtss,$(THREAD_KIND))),)
LIBGNAT_TARGET_PAIRS += \
s-taprop.adb<s-taprop-rtx.adb \
system.ads<system-rtx.ads
+ EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o
+
MISCLIB = -lwsock32 -lrtapi_w32
THREADSLIB=-lrtapi_w32
else
a-exetim.adb<a-exetim-mingw.adb \
a-exetim.ads<a-exetim-mingw.ads \
a-intnam.ads<a-intnam-mingw.ads \
+ g-sercom.adb<g-sercom-mingw.adb \
s-interr.adb<s-interr-sigaction.adb \
s-intman.adb<s-intman-mingw.adb \
s-osinte.ads<s-osinte-mingw.ads \
s-taprop.adb<s-taprop-mingw.adb \
system.ads<system-mingw.ads
- EXTRA_GNATRTL_NONTASKING_OBJS = g-regist.o
- EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o
+ EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o s-win32.o g-regist.o
+ EXTRA_GNATRTL_TASKING_OBJS = a-exetim.o
MISCLIB = -lwsock32
endif
TOOLS_TARGET_PAIRS= \
- mlib-tgt-specific.adb<mlib-tgt-mingw.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-mingw.adb \
indepsw.adb<indepsw-mingw.adb
EH_MECHANISM=-gcc
g-soccon.ads<g-soccon-linux-mips.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osinte.ads<s-osinte-linux.ads \
s-osprim.adb<s-osprim-posix.adb \
g-soccon.ads<g-soccon-linux-mips.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osinte.ads<s-osinte-linux.ads \
s-osprim.adb<s-osprim-posix.adb \
g-soccon.ads<g-soccon-linux-ppc.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osinte.ads<s-osinte-linux.ads \
s-osprim.adb<s-osprim-posix.adb \
s-taprop.adb<s-taprop-linux.adb \
s-tasinf.ads<s-tasinf-linux.ads \
s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix.ads \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
g-sercom.adb<g-sercom-linux.adb \
system.ads<system-linux-ppc.ads
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-linux.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
indepsw.adb<indepsw-gnu.adb
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
EH_MECHANISM=-gcc
THREADSLIB = -lpthread
GNATLIB_SHARED = gnatlib-shared-dual
a-intnam.ads<a-intnam-linux.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osinte.ads<s-osinte-linux.ads \
s-osprim.adb<s-osprim-posix.adb \
s-taprop.adb<s-taprop-linux.adb \
s-tasinf.ads<s-tasinf-linux.ads \
s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix.ads \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
system.ads<system-linux-sparc.ads
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-linux.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
indepsw.adb<indepsw-gnu.adb
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
EH_MECHANISM=-gcc
THREADSLIB = -lpthread
GNATLIB_SHARED = gnatlib-shared-dual
a-intnam.ads<a-intnam-linux.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux-hppa.ads \
s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-linux-hppa.ads \
+ s-osinte.ads<s-osinte-linux.ads \
s-osprim.adb<s-osprim-posix.adb \
s-taprop.adb<s-taprop-linux.adb \
s-tasinf.ads<s-tasinf-linux.ads \
s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix.ads \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
system.ads<system-linux-hppa.ads
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-linux.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
indepsw.adb<indepsw-gnu.adb
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
EH_MECHANISM=-gcc
THREADSLIB = -lpthread
GNATLIB_SHARED = gnatlib-shared-dual
g-soccon.ads<g-soccon-linux-64.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
s-osinte.ads<s-osinte-linux.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osprim.adb<s-osprim-posix.adb \
s-tasinf.ads<s-tasinf-linux.ads \
s-tasinf.adb<s-tasinf-linux.adb \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- s-taspri.ads<s-taspri-posix.ads \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
g-sercom.adb<g-sercom-linux.adb \
system.ads<system-linux-ia64.ads
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-linux.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
indepsw.adb<indepsw-gnu.adb
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
EH_MECHANISM=-gcc
MISCLIB=
THREADSLIB=-lpthread
a-intnam.ads<a-intnam-linux.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
- s-osinte.ads<s-osinte-linux-alpha.ads \
+ s-linux.ads<s-linux-alpha.ads \
+ s-osinte.ads<s-osinte-linux.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osprim.adb<s-osprim-posix.adb \
s-taprop.adb<s-taprop-linux.adb \
s-tasinf.ads<s-tasinf-linux.ads \
s-tasinf.adb<s-tasinf-linux.adb \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- s-taspri.ads<s-taspri-posix.ads \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
system.ads<system-linux-alpha.ads
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-linux.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
indepsw.adb<indepsw-gnu.adb
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
EH_MECHANISM=-gcc
MISCLIB=
THREADSLIB=-lpthread
g-soccon.ads<g-soccon-linux-64.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
s-osinte.ads<s-osinte-linux.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osprim.adb<s-osprim-posix.adb \
system.ads<system-linux-x86_64.ads
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-linux.adb \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
indepsw.adb<indepsw-gnu.adb
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
EH_MECHANISM=-gcc
THREADSLIB=-lpthread
GNATLIB_SHARED=gnatlib-shared-dual
endif
TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-darwin.adb
+ mlib-tgt-specific.adb<mlib-tgt-specific-darwin.adb
EH_MECHANISM=-gcc
GNATLIB_SHARED = gnatlib-shared-darwin
$(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
$(TOOLS_LIBS)
-../../gnatbl$(exeext): gnatbl.o
- $(GCC_LINK) -o $@ $(ALL_CFLAGS) $(LDFLAGS) gnatbl.o $(TOOLS_LIBS)
-
-gnatbl.o: gnatbl.c adaint.h
- $(CC) $(ALL_CFLAGS) $(INCLUDES) -c $< $(OUTPUT_OPTION)
-
../stamp-gnatlib:
@if [ ! -f stamp-gnatlib ] ; \
then \
THREAD_KIND="$(THREAD_KIND)" \
gnatlib
$(RM) rts/libgna*$(soext)
- cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
- objdump --syms $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) | \
- $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
- echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
+ cd rts && \
+ ../../gnatsym -s SYMVEC_$$$$.opt \
+ $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) && \
../../xgcc -g -B../../ -shared -shared-libgcc \
-o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
sys\$$library:trace.exe \
--for-linker=/noinform \
--for-linker=SYMVEC_$$$$.opt \
--for-linker=gsmatch=equal,$(GSMATCH_VERSION)
- cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
- objdump --syms $(GNATRTL_TASKING_OBJS) | \
- $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
- echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
+ cd rts && \
+ ../../gnatsym -s SYMVEC_$$$$.opt \
+ $(GNATRTL_TASKING_OBJS) && \
../../xgcc -g -B../../ -shared -shared-libgcc \
-o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (AIX Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2003-2007, AdaCore --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the AIX version of the body
-
-with Ada.Strings.Fixed; use Ada.Strings.Fixed;
-
-with MLib.Fil;
-with MLib.Utl;
-with Opt;
-with Output; use Output;
-with Prj.Com;
-with Prj.Util; use Prj.Util;
-
-package body MLib.Tgt.Specific is
-
- -- Non default subprograms
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- function DLL_Ext return String;
-
- function Library_Major_Minor_Id_Supported return Boolean;
-
- function Support_For_Libraries return Library_Support;
-
- -- Local variables
-
- No_Arguments : aliased Argument_List := (1 .. 0 => null);
- Empty_Argument_List : constant Argument_List_Access := No_Arguments'Access;
-
- Bexpall : aliased String := "-Wl,-bexpall";
- Bexpall_Option : constant String_Access := Bexpall'Access;
- -- The switch to export all symbols
-
- Lpthreads : aliased String := "-lpthreads";
- Native_Thread_Options : aliased Argument_List := (1 => Lpthreads'Access);
- -- The switch to use when linking a library against libgnarl when using
- -- Native threads.
-
- Lgthreads : aliased String := "-lgthreads";
- Lmalloc : aliased String := "-lmalloc";
- FSU_Thread_Options : aliased Argument_List :=
- (1 => Lgthreads'Access, 2 => Lmalloc'Access);
- -- The switches to use when linking a library against libgnarl when using
- -- FSU threads.
-
- Thread_Options : Argument_List_Access := Empty_Argument_List;
- -- Designate the thread switches to used when linking a library against
- -- libgnarl. Depends on the thread library (Native or FSU). Resolved for
- -- the first library linked against libgnarl.
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
- pragma Unreferenced (Interfaces);
- pragma Unreferenced (Symbol_Data);
- pragma Unreferenced (Lib_Version);
- pragma Unreferenced (Auto_Init);
-
- Lib_File : constant String :=
- Lib_Dir & Directory_Separator & "lib" &
- MLib.Fil.Append_To (Lib_Filename, DLL_Ext);
- -- The file name of the library
-
- Thread_Opts : Argument_List_Access := Empty_Argument_List;
- -- Set to Thread_Options if -lgnarl is found in the Options
-
- begin
- if Opt.Verbose_Mode then
- Write_Str ("building relocatable shared library ");
- Write_Line (Lib_File);
- end if;
-
- -- Look for -lgnarl in Options. If found, set the thread options
-
- for J in Options'Range loop
- if Options (J).all = "-lgnarl" then
-
- -- If Thread_Options is null, read s-osinte.ads to discover the
- -- thread library and set Thread_Options accordingly.
-
- if Thread_Options = null then
- declare
- File : Text_File;
- Line : String (1 .. 100);
- Last : Natural;
-
- begin
- Open
- (File, Include_Dir_Default_Prefix & "/s-osinte.ads");
-
- while not End_Of_File (File) loop
- Get_Line (File, Line, Last);
-
- if Index (Line (1 .. Last), "-lpthreads") /= 0 then
- Thread_Options := Native_Thread_Options'Access;
- exit;
-
- elsif Index (Line (1 .. Last), "-lgthreads") /= 0 then
- Thread_Options := FSU_Thread_Options'Access;
- exit;
- end if;
- end loop;
-
- Close (File);
-
- if Thread_Options = null then
- Prj.Com.Fail ("cannot find the thread library in use");
- end if;
-
- exception
- when others =>
- Prj.Com.Fail ("cannot open s-osinte.ads");
- end;
- end if;
-
- Thread_Opts := Thread_Options;
- exit;
- end if;
- end loop;
-
- -- Finally, call GCC (or the driver specified) to build the library
-
- MLib.Utl.Gcc
- (Output_File => Lib_File,
- Objects => Ofiles,
- Options => Options & Bexpall_Option,
- Driver_Name => Driver_Name,
- Options_2 => Thread_Opts.all);
- end Build_Dynamic_Library;
-
- -------------
- -- DLL_Ext --
- -------------
-
- function DLL_Ext return String is
- begin
- return "a";
- end DLL_Ext;
-
- --------------------------------------
- -- Library_Major_Minor_Id_Supported --
- --------------------------------------
-
- function Library_Major_Minor_Id_Supported return Boolean is
- begin
- return False;
- end Library_Major_Minor_Id_Supported;
-
- ---------------------------
- -- Support_For_Libraries --
- ---------------------------
-
- function Support_For_Libraries return Library_Support is
- begin
- return Static_Only;
- end Support_For_Libraries;
-
-begin
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
- DLL_Ext_Ptr := DLL_Ext'Access;
- Library_Major_Minor_Id_Supported_Ptr :=
- Library_Major_Minor_Id_Supported'Access;
- Support_For_Libraries_Ptr := Support_For_Libraries'Access;
-
-end MLib.Tgt.Specific;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (Darwin Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the Darwin version of the body
-
-with MLib; use MLib;
-with MLib.Fil;
-with MLib.Utl;
-with Opt; use Opt;
-with Output; use Output;
-
-package body MLib.Tgt.Specific is
-
- -- Non default subprograms
-
- function Archive_Indexer_Options return String_List_Access;
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- function DLL_Ext return String;
-
- function Dynamic_Option return String;
-
- function Is_Archive_Ext (Ext : String) return Boolean;
-
- -- Local objects
-
- Flat_Namespace : aliased String := "-Wl,-flat_namespace";
- -- Instruct the linker to build the shared library as a flat
- -- namespace image. The default is a two-level namespace image.
-
- Shared_Libgcc : aliased String := "-shared-libgcc";
-
- Shared_Options : constant Argument_List :=
- (1 => Flat_Namespace'Access,
- 2 => Shared_Libgcc'Access);
-
- -----------------------------
- -- Archive_Indexer_Options --
- -----------------------------
-
- function Archive_Indexer_Options return String_List_Access is
- begin
- return new String_List'(1 => new String'("-c"));
- end Archive_Indexer_Options;
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
- pragma Unreferenced (Interfaces);
- pragma Unreferenced (Symbol_Data);
- pragma Unreferenced (Auto_Init);
-
- Lib_File : constant String :=
- "lib" & Fil.Append_To (Lib_Filename, DLL_Ext);
-
- Lib_Path : constant String :=
- Lib_Dir & Directory_Separator & Lib_File;
-
- Symbolic_Link_Needed : Boolean := False;
-
- begin
- if Opt.Verbose_Mode then
- Write_Str ("building relocatable shared library ");
- Write_Line (Lib_File);
- end if;
-
- -- If specified, add automatic elaboration/finalization
-
- if Lib_Version = "" then
- Utl.Gcc
- (Output_File => Lib_File,
- Objects => Ofiles,
- Options => Options & Shared_Options,
- Driver_Name => Driver_Name,
- Options_2 => No_Argument_List);
-
- else
- declare
- Maj_Version : constant String :=
- Major_Id_Name (Lib_File, Lib_Version);
- begin
- if Is_Absolute_Path (Lib_Version) then
- Utl.Gcc
- (Output_File => Lib_Version,
- Objects => Ofiles,
- Options => Options & Shared_Options,
- Driver_Name => Driver_Name,
- Options_2 => No_Argument_List);
- Symbolic_Link_Needed := Lib_Version /= Lib_File;
-
- else
- Utl.Gcc
- (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
- Objects => Ofiles,
- Options => Options & Shared_Options,
- Driver_Name => Driver_Name,
- Options_2 => No_Argument_List);
- Symbolic_Link_Needed :=
- Lib_Dir & Directory_Separator & Lib_Version /= Lib_File;
- end if;
-
- if Symbolic_Link_Needed then
- Create_Sym_Links
- (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
- end if;
- end;
- end if;
- end Build_Dynamic_Library;
-
- -------------
- -- DLL_Ext --
- -------------
-
- function DLL_Ext return String is
- begin
- return "dylib";
- end DLL_Ext;
-
- --------------------
- -- Dynamic_Option --
- --------------------
-
- function Dynamic_Option return String is
- begin
- return "-dynamiclib";
- end Dynamic_Option;
-
- --------------------
- -- Is_Archive_Ext --
- --------------------
-
- function Is_Archive_Ext (Ext : String) return Boolean is
- begin
- return Ext = ".dylib" or else Ext = ".a";
- end Is_Archive_Ext;
-
-begin
- Archive_Indexer_Options_Ptr := Archive_Indexer_Options'Access;
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
- DLL_Ext_Ptr := DLL_Ext'Access;
- Dynamic_Option_Ptr := Dynamic_Option'Access;
- Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
-end MLib.Tgt.Specific;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (HP-UX Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2003-2007, AdaCore --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the HP-UX version of the body
-
-with MLib.Fil;
-with MLib.Utl;
-with Opt;
-with Output; use Output;
-
-package body MLib.Tgt.Specific is
-
- -- Non default subprograms
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- function DLL_Ext return String;
-
- function Is_Archive_Ext (Ext : String) return Boolean;
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
- pragma Unreferenced (Interfaces);
- pragma Unreferenced (Symbol_Data);
- pragma Unreferenced (Auto_Init);
-
- Lib_File : constant String :=
- "lib" & Fil.Append_To (Lib_Filename, DLL_Ext);
-
- Lib_Path : constant String :=
- Lib_Dir & Directory_Separator & Lib_File;
-
- Version_Arg : String_Access;
- Symbolic_Link_Needed : Boolean := False;
-
- Common_Options : constant Argument_List :=
- Options & new String'(PIC_Option);
- -- Common set of options to the gcc command performing the link.
- -- On HPUX, this command eventually resorts to collect2, which may
- -- generate a C file and compile it on the fly. This compilation shall
- -- also generate position independent code for the final link to
- -- succeed.
- begin
- if Opt.Verbose_Mode then
- Write_Str ("building relocatable shared library ");
- Write_Line (Lib_Path);
- end if;
-
- if Lib_Version = "" then
- MLib.Utl.Gcc
- (Output_File => Lib_Path,
- Objects => Ofiles,
- Options => Common_Options,
- Options_2 => No_Argument_List,
- Driver_Name => Driver_Name);
-
- else
- declare
- Maj_Version : constant String :=
- Major_Id_Name (Lib_File, Lib_Version);
- begin
- if Maj_Version'Length /= 0 then
- Version_Arg := new String'("-Wl,+h," & Maj_Version);
-
- else
- Version_Arg := new String'("-Wl,+h," & Lib_Version);
- end if;
-
- if Is_Absolute_Path (Lib_Version) then
- MLib.Utl.Gcc
- (Output_File => Lib_Version,
- Objects => Ofiles,
- Options => Common_Options & Version_Arg,
- Options_2 => No_Argument_List,
- Driver_Name => Driver_Name);
- Symbolic_Link_Needed := Lib_Version /= Lib_Path;
-
- else
- MLib.Utl.Gcc
- (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
- Objects => Ofiles,
- Options => Common_Options & Version_Arg,
- Options_2 => No_Argument_List,
- Driver_Name => Driver_Name);
- Symbolic_Link_Needed :=
- Lib_Dir & Directory_Separator & Lib_Version /= Lib_Path;
- end if;
-
- if Symbolic_Link_Needed then
- Create_Sym_Links
- (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
- end if;
- end;
- end if;
- end Build_Dynamic_Library;
-
- -------------
- -- DLL_Ext --
- -------------
-
- function DLL_Ext return String is
- begin
- return "sl";
- end DLL_Ext;
-
- --------------------
- -- Is_Archive_Ext --
- --------------------
-
- function Is_Archive_Ext (Ext : String) return Boolean is
- begin
- return Ext = ".a" or else Ext = ".so";
- end Is_Archive_Ext;
-
-begin
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
- DLL_Ext_Ptr := DLL_Ext'Access;
- Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
-end MLib.Tgt.Specific;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (IRIX Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2003-2007, AdaCore --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the IRIX version of the body
-
-with MLib.Fil;
-with MLib.Utl;
-with Opt;
-with Output; use Output;
-
-package body MLib.Tgt.Specific is
-
- -- Non default subprogram
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- function Is_Archive_Ext (Ext : String) return Boolean;
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
- pragma Unreferenced (Interfaces);
- pragma Unreferenced (Symbol_Data);
- pragma Unreferenced (Auto_Init);
-
- Lib_File : constant String :=
- "lib" & MLib.Fil.Append_To (Lib_Filename, DLL_Ext);
-
- Lib_Path : constant String :=
- Lib_Dir & Directory_Separator & Lib_File;
-
- Version_Arg : String_Access;
- Symbolic_Link_Needed : Boolean := False;
-
- N_Options : Argument_List := Options;
- Options_Last : Natural := N_Options'Last;
- -- After moving -lxxx to Options_2, N_Options up to index Options_Last
- -- will contain the Options to pass to MLib.Utl.Gcc.
-
- Real_Options_2 : Argument_List (1 .. Options'Length);
- Real_Options_2_Last : Natural := 0;
- -- Real_Options_2 up to index Real_Options_2_Last will contain the
- -- Options_2 to pass to MLib.Utl.Gcc.
-
- begin
- if Opt.Verbose_Mode then
- Write_Str ("building relocatable shared library ");
- Write_Line (Lib_Path);
- end if;
-
- -- Move all -lxxx to Options_2
-
- declare
- Index : Natural := N_Options'First;
- Arg : String_Access;
-
- begin
- while Index <= Options_Last loop
- Arg := N_Options (Index);
-
- if Arg'Length > 2
- and then Arg (Arg'First .. Arg'First + 1) = "-l"
- then
- Real_Options_2_Last := Real_Options_2_Last + 1;
- Real_Options_2 (Real_Options_2_Last) := Arg;
- N_Options (Index .. Options_Last - 1) :=
- N_Options (Index + 1 .. Options_Last);
- Options_Last := Options_Last - 1;
-
- else
- Index := Index + 1;
- end if;
- end loop;
- end;
-
- if Lib_Version = "" then
- MLib.Utl.Gcc
- (Output_File => Lib_Path,
- Objects => Ofiles,
- Options => N_Options (N_Options'First .. Options_Last),
- Driver_Name => Driver_Name,
- Options_2 => Real_Options_2 (1 .. Real_Options_2_Last));
-
- else
- declare
- Maj_Version : constant String :=
- Major_Id_Name (Lib_File, Lib_Version);
- begin
- if Maj_Version'Length /= 0 then
- Version_Arg := new String'("-Wl,-soname," & Maj_Version);
-
- else
- Version_Arg := new String'("-Wl,-soname," & Lib_Version);
- end if;
-
- if Is_Absolute_Path (Lib_Version) then
- MLib.Utl.Gcc
- (Output_File => Lib_Version,
- Objects => Ofiles,
- Options => N_Options (N_Options'First .. Options_Last) &
- Version_Arg,
- Driver_Name => Driver_Name,
- Options_2 => Real_Options_2 (1 .. Real_Options_2_Last));
- Symbolic_Link_Needed := Lib_Version /= Lib_Path;
-
- else
- MLib.Utl.Gcc
- (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
- Objects => Ofiles,
- Options => N_Options (N_Options'First .. Options_Last) &
- Version_Arg,
- Driver_Name => Driver_Name,
- Options_2 => Real_Options_2 (1 .. Real_Options_2_Last));
- Symbolic_Link_Needed :=
- Lib_Dir & Directory_Separator & Lib_Version /= Lib_Path;
- end if;
-
- if Symbolic_Link_Needed then
- Create_Sym_Links
- (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
- end if;
- end;
- end if;
- end Build_Dynamic_Library;
-
- --------------------
- -- Is_Archive_Ext --
- --------------------
-
- function Is_Archive_Ext (Ext : String) return Boolean is
- begin
- return Ext = ".a" or else Ext = ".so";
- end Is_Archive_Ext;
-
-begin
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
- Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
-end MLib.Tgt.Specific;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (GNU/Linux Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the GNU/Linux version of the body
-
-with MLib.Fil;
-with MLib.Utl;
-with Opt;
-with Output; use Output;
-
-package body MLib.Tgt.Specific is
-
- use MLib;
-
- -- Non default subprograms
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- function Is_Archive_Ext (Ext : String) return Boolean;
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
- pragma Unreferenced (Interfaces);
- pragma Unreferenced (Symbol_Data);
- pragma Unreferenced (Auto_Init);
- -- Initialization is done through the constructor mechanism
-
- Lib_File : constant String :=
- "lib" & Fil.Append_To (Lib_Filename, DLL_Ext);
-
- Lib_Path : constant String :=
- Lib_Dir & Directory_Separator & Lib_File;
-
- Version_Arg : String_Access;
- Symbolic_Link_Needed : Boolean := False;
-
- begin
- if Opt.Verbose_Mode then
- Write_Str ("building relocatable shared library ");
- Write_Line (Lib_Path);
- end if;
-
- if Lib_Version = "" then
- Utl.Gcc
- (Output_File => Lib_Path,
- Objects => Ofiles,
- Options => Options,
- Driver_Name => Driver_Name,
- Options_2 => No_Argument_List);
-
- else
- declare
- Maj_Version : constant String :=
- Major_Id_Name (Lib_File, Lib_Version);
- begin
- if Maj_Version'Length /= 0 then
- Version_Arg := new String'("-Wl,-soname," & Maj_Version);
-
- else
- Version_Arg := new String'("-Wl,-soname," & Lib_Version);
- end if;
-
- if Is_Absolute_Path (Lib_Version) then
- Utl.Gcc
- (Output_File => Lib_Version,
- Objects => Ofiles,
- Options => Options & Version_Arg,
- Driver_Name => Driver_Name,
- Options_2 => No_Argument_List);
- Symbolic_Link_Needed := Lib_Version /= Lib_Path;
-
- else
- Utl.Gcc
- (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
- Objects => Ofiles,
- Options => Options & Version_Arg,
- Driver_Name => Driver_Name,
- Options_2 => No_Argument_List);
- Symbolic_Link_Needed :=
- Lib_Dir & Directory_Separator & Lib_Version /= Lib_Path;
- end if;
-
- if Symbolic_Link_Needed then
- Create_Sym_Links
- (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
- end if;
- end;
- end if;
- end Build_Dynamic_Library;
-
- --------------------
- -- Is_Archive_Ext --
- --------------------
-
- function Is_Archive_Ext (Ext : String) return Boolean is
- begin
- return Ext = ".a" or else Ext = ".so";
- end Is_Archive_Ext;
-
-begin
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
- Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
-end MLib.Tgt.Specific;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (LynxOS Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2003-2007, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the LynxOS version of the body
-
-package body MLib.Tgt.Specific is
-
- -- Non default subprograms
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- function DLL_Ext return String;
-
- function Dynamic_Option return String;
-
- function PIC_Option return String;
-
- function Library_Major_Minor_Id_Supported return Boolean;
-
- function Standalone_Library_Auto_Init_Is_Supported return Boolean;
-
- function Support_For_Libraries return Library_Support;
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
- pragma Unreferenced (Ofiles);
- pragma Unreferenced (Options);
- pragma Unreferenced (Interfaces);
- pragma Unreferenced (Lib_Filename);
- pragma Unreferenced (Lib_Dir);
- pragma Unreferenced (Symbol_Data);
- pragma Unreferenced (Driver_Name);
- pragma Unreferenced (Lib_Version);
- pragma Unreferenced (Auto_Init);
-
- begin
- null;
- end Build_Dynamic_Library;
-
- -------------
- -- DLL_Ext --
- -------------
-
- function DLL_Ext return String is
- begin
- return "";
- end DLL_Ext;
-
- --------------------
- -- Dynamic_Option --
- --------------------
-
- function Dynamic_Option return String is
- begin
- return "";
- end Dynamic_Option;
-
- --------------------------------------
- -- Library_Major_Minor_Id_Supported --
- --------------------------------------
-
- function Library_Major_Minor_Id_Supported return Boolean is
- begin
- return False;
- end Library_Major_Minor_Id_Supported;
-
- ----------------
- -- PIC_Option --
- ----------------
-
- function PIC_Option return String is
- begin
- return "";
- end PIC_Option;
-
- -----------------------------------------------
- -- Standalone_Library_Auto_Init_Is_Supported --
- -----------------------------------------------
-
- function Standalone_Library_Auto_Init_Is_Supported return Boolean is
- begin
- return False;
- end Standalone_Library_Auto_Init_Is_Supported;
-
- ---------------------------
- -- Support_For_Libraries --
- ---------------------------
-
- function Support_For_Libraries return Library_Support is
- begin
- return Static_Only;
- end Support_For_Libraries;
-
-begin
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
- DLL_Ext_Ptr := DLL_Ext'Access;
- Dynamic_Option_Ptr := Dynamic_Option'Access;
- Library_Major_Minor_Id_Supported_Ptr :=
- Library_Major_Minor_Id_Supported'Access;
- PIC_Option_Ptr := PIC_Option'Access;
- Standalone_Library_Auto_Init_Is_Supported_Ptr :=
- Standalone_Library_Auto_Init_Is_Supported'Access;
- Support_For_Libraries_Ptr := Support_For_Libraries'Access;
-end MLib.Tgt.Specific;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (Windows Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2002-2007, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the Windows version of the body. Works only with GCC versions
--- supporting the "-shared" option.
-
-with Opt;
-with Output; use Output;
-
-with MLib.Fil;
-with MLib.Utl;
-
-package body MLib.Tgt.Specific is
-
- package Files renames MLib.Fil;
- package Tools renames MLib.Utl;
-
- -- Non default subprograms
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- function DLL_Ext return String;
-
- function DLL_Prefix return String;
-
- function Is_Archive_Ext (Ext : String) return Boolean;
-
- function Library_Major_Minor_Id_Supported return Boolean;
-
- function PIC_Option return String;
-
- No_Argument_List : constant String_List := (1 .. 0 => null);
- -- Used as value of parameter Options or Options2 in calls to Gcc
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
- pragma Unreferenced (Symbol_Data);
- pragma Unreferenced (Interfaces);
- pragma Unreferenced (Lib_Version);
- pragma Unreferenced (Auto_Init);
-
- Lib_File : constant String :=
- Lib_Dir & Directory_Separator &
- DLL_Prefix & Files.Append_To (Lib_Filename, DLL_Ext);
-
- -- Start of processing for Build_Dynamic_Library
-
- begin
- if Opt.Verbose_Mode then
- Write_Str ("building relocatable shared library ");
- Write_Line (Lib_File);
- end if;
-
- Tools.Gcc
- (Output_File => Lib_File,
- Objects => Ofiles,
- Options => No_Argument_List,
- Options_2 => Options,
- Driver_Name => Driver_Name);
- end Build_Dynamic_Library;
-
- -------------
- -- DLL_Ext --
- -------------
-
- function DLL_Ext return String is
- begin
- return "dll";
- end DLL_Ext;
-
- ----------------
- -- DLL_Prefix --
- ----------------
-
- function DLL_Prefix return String is
- begin
- return "lib";
- end DLL_Prefix;
-
- --------------------
- -- Is_Archive_Ext --
- --------------------
-
- function Is_Archive_Ext (Ext : String) return Boolean is
- begin
- return Ext = ".a" or else Ext = ".dll";
- end Is_Archive_Ext;
-
- --------------------------------------
- -- Library_Major_Minor_Id_Supported --
- --------------------------------------
-
- function Library_Major_Minor_Id_Supported return Boolean is
- begin
- return False;
- end Library_Major_Minor_Id_Supported;
-
- ----------------
- -- PIC_Option --
- ----------------
-
- function PIC_Option return String is
- begin
- return "";
- end PIC_Option;
-
-begin
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
- DLL_Ext_Ptr := DLL_Ext'Access;
- DLL_Prefix_Ptr := DLL_Prefix'Access;
- Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
- PIC_Option_Ptr := PIC_Option'Access;
- Library_Major_Minor_Id_Supported_Ptr :=
- Library_Major_Minor_Id_Supported'Access;
-end MLib.Tgt.Specific;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (Solaris Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2002-2007, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the Solaris version of the body
-
-with MLib.Fil;
-with MLib.Utl;
-with Opt;
-with Output; use Output;
-
-package body MLib.Tgt.Specific is
-
- -- Non default subprograms
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- function Is_Archive_Ext (Ext : String) return Boolean;
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
- pragma Unreferenced (Interfaces);
- pragma Unreferenced (Symbol_Data);
- pragma Unreferenced (Auto_Init);
-
- Lib_File : constant String :=
- "lib" & Fil.Append_To (Lib_Filename, DLL_Ext);
-
- Lib_Path : constant String :=
- Lib_Dir & Directory_Separator & Lib_File;
-
- Version_Arg : String_Access;
- Symbolic_Link_Needed : Boolean := False;
-
- begin
- if Opt.Verbose_Mode then
- Write_Str ("building relocatable shared library ");
- Write_Line (Lib_Path);
- end if;
-
- if Lib_Version = "" then
- Utl.Gcc
- (Output_File => Lib_Path,
- Objects => Ofiles,
- Options => Options,
- Options_2 => No_Argument_List,
- Driver_Name => Driver_Name);
-
- else
- declare
- Maj_Version : constant String :=
- Major_Id_Name (Lib_File, Lib_Version);
- begin
- if Maj_Version'Length /= 0 then
- Version_Arg := new String'("-Wl,-h," & Maj_Version);
-
- else
- Version_Arg := new String'("-Wl,-h," & Lib_Version);
- end if;
-
- if Is_Absolute_Path (Lib_Version) then
- Utl.Gcc
- (Output_File => Lib_Version,
- Objects => Ofiles,
- Options => Options & Version_Arg,
- Options_2 => No_Argument_List,
- Driver_Name => Driver_Name);
- Symbolic_Link_Needed := Lib_Version /= Lib_Path;
-
- else
- Utl.Gcc
- (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
- Objects => Ofiles,
- Options => Options & Version_Arg,
- Options_2 => No_Argument_List,
- Driver_Name => Driver_Name);
- Symbolic_Link_Needed :=
- Lib_Dir & Directory_Separator & Lib_Version /= Lib_Path;
- end if;
-
- if Symbolic_Link_Needed then
- Create_Sym_Links
- (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
- end if;
- end;
- end if;
- end Build_Dynamic_Library;
-
- --------------------
- -- Is_Archive_Ext --
- --------------------
-
- function Is_Archive_Ext (Ext : String) return Boolean is
- begin
- return Ext = ".a" or else Ext = ".so";
- end Is_Archive_Ext;
-
-begin
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
- Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
-end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (AIX Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2003-2008, AdaCore --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the AIX version of the body
+
+with Ada.Strings.Fixed; use Ada.Strings.Fixed;
+
+with MLib.Fil;
+with MLib.Utl;
+with Opt;
+with Output; use Output;
+with Prj.Com;
+with Prj.Util; use Prj.Util;
+
+package body MLib.Tgt.Specific is
+
+ -- Local subprograms
+ -- These *ALL* require comments ???
+
+ function Archive_Indexer return String;
+ -- What is this???
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ function DLL_Ext return String;
+
+ function Library_Major_Minor_Id_Supported return Boolean;
+
+ function Support_For_Libraries return Library_Support;
+
+ -- Local variables
+
+ No_Arguments : aliased Argument_List := (1 .. 0 => null);
+ Empty_Argument_List : constant Argument_List_Access := No_Arguments'Access;
+
+ Bexpall : aliased String := "-Wl,-bexpall";
+ Bexpall_Option : constant String_Access := Bexpall'Access;
+ -- The switch to export all symbols
+
+ Lpthreads : aliased String := "-lpthreads";
+ Native_Thread_Options : aliased Argument_List := (1 => Lpthreads'Access);
+ -- The switch to use when linking a library against libgnarl when using
+ -- Native threads.
+
+ Lgthreads : aliased String := "-lgthreads";
+ Lmalloc : aliased String := "-lmalloc";
+ FSU_Thread_Options : aliased Argument_List :=
+ (1 => Lgthreads'Access, 2 => Lmalloc'Access);
+ -- The switches to use when linking a library against libgnarl when using
+ -- FSU threads.
+
+ Thread_Options : Argument_List_Access := Empty_Argument_List;
+ -- Designate the thread switches to used when linking a library against
+ -- libgnarl. Depends on the thread library (Native or FSU). Resolved for
+ -- the first library linked against libgnarl.
+
+ ---------------------
+ -- Archive_Indexer --
+ ---------------------
+
+ function Archive_Indexer return String is
+ begin
+ return "";
+ end Archive_Indexer;
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+ pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
+ pragma Unreferenced (Lib_Version);
+ pragma Unreferenced (Auto_Init);
+
+ Lib_File : constant String :=
+ Lib_Dir & Directory_Separator & "lib" &
+ MLib.Fil.Append_To (Lib_Filename, DLL_Ext);
+ -- The file name of the library
+
+ Thread_Opts : Argument_List_Access := Empty_Argument_List;
+ -- Set to Thread_Options if -lgnarl is found in the Options
+
+ begin
+ if Opt.Verbose_Mode then
+ Write_Str ("building relocatable shared library ");
+ Write_Line (Lib_File);
+ end if;
+
+ -- Look for -lgnarl in Options. If found, set the thread options
+
+ for J in Options'Range loop
+ if Options (J).all = "-lgnarl" then
+
+ -- If Thread_Options is null, read s-osinte.ads to discover the
+ -- thread library and set Thread_Options accordingly.
+
+ if Thread_Options = null then
+ declare
+ File : Text_File;
+ Line : String (1 .. 100);
+ Last : Natural;
+
+ begin
+ Open
+ (File, Include_Dir_Default_Prefix & "/s-osinte.ads");
+
+ while not End_Of_File (File) loop
+ Get_Line (File, Line, Last);
+
+ if Index (Line (1 .. Last), "-lpthreads") /= 0 then
+ Thread_Options := Native_Thread_Options'Access;
+ exit;
+
+ elsif Index (Line (1 .. Last), "-lgthreads") /= 0 then
+ Thread_Options := FSU_Thread_Options'Access;
+ exit;
+ end if;
+ end loop;
+
+ Close (File);
+
+ if Thread_Options = null then
+ Prj.Com.Fail ("cannot find the thread library in use");
+ end if;
+
+ exception
+ when others =>
+ Prj.Com.Fail ("cannot open s-osinte.ads");
+ end;
+ end if;
+
+ Thread_Opts := Thread_Options;
+ exit;
+ end if;
+ end loop;
+
+ -- Finally, call GCC (or the driver specified) to build the library
+
+ MLib.Utl.Gcc
+ (Output_File => Lib_File,
+ Objects => Ofiles,
+ Options => Options & Bexpall_Option,
+ Driver_Name => Driver_Name,
+ Options_2 => Thread_Opts.all);
+ end Build_Dynamic_Library;
+
+ -------------
+ -- DLL_Ext --
+ -------------
+
+ function DLL_Ext return String is
+ begin
+ return "a";
+ end DLL_Ext;
+
+ --------------------------------------
+ -- Library_Major_Minor_Id_Supported --
+ --------------------------------------
+
+ function Library_Major_Minor_Id_Supported return Boolean is
+ begin
+ return False;
+ end Library_Major_Minor_Id_Supported;
+
+ ---------------------------
+ -- Support_For_Libraries --
+ ---------------------------
+
+ function Support_For_Libraries return Library_Support is
+ begin
+ return Static_Only;
+ end Support_For_Libraries;
+
+begin
+ Archive_Indexer_Ptr := Archive_Indexer'Access;
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+ DLL_Ext_Ptr := DLL_Ext'Access;
+ Library_Major_Minor_Id_Supported_Ptr :=
+ Library_Major_Minor_Id_Supported'Access;
+ Support_For_Libraries_Ptr := Support_For_Libraries'Access;
+
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (Darwin Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the Darwin version of the body
+
+with MLib; use MLib;
+with MLib.Fil;
+with MLib.Utl;
+with Opt; use Opt;
+with Output; use Output;
+
+package body MLib.Tgt.Specific is
+
+ -- Non default subprograms
+
+ function Archive_Indexer_Options return String_List_Access;
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ function DLL_Ext return String;
+
+ function Dynamic_Option return String;
+
+ function Is_Archive_Ext (Ext : String) return Boolean;
+
+ -- Local objects
+
+ Flat_Namespace : aliased String := "-Wl,-flat_namespace";
+ -- Instruct the linker to build the shared library as a flat
+ -- namespace image. The default is a two-level namespace image.
+
+ Shared_Libgcc : aliased String := "-shared-libgcc";
+
+ Shared_Options : constant Argument_List :=
+ (1 => Flat_Namespace'Access,
+ 2 => Shared_Libgcc'Access);
+
+ -----------------------------
+ -- Archive_Indexer_Options --
+ -----------------------------
+
+ function Archive_Indexer_Options return String_List_Access is
+ begin
+ return new String_List'(1 => new String'("-c"));
+ end Archive_Indexer_Options;
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+ pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
+ pragma Unreferenced (Auto_Init);
+
+ Lib_File : constant String :=
+ "lib" & Fil.Append_To (Lib_Filename, DLL_Ext);
+
+ Lib_Path : constant String :=
+ Lib_Dir & Directory_Separator & Lib_File;
+
+ Symbolic_Link_Needed : Boolean := False;
+
+ begin
+ if Opt.Verbose_Mode then
+ Write_Str ("building relocatable shared library ");
+ Write_Line (Lib_File);
+ end if;
+
+ -- If specified, add automatic elaboration/finalization
+
+ if Lib_Version = "" then
+ Utl.Gcc
+ (Output_File => Lib_Path,
+ Objects => Ofiles,
+ Options => Options & Shared_Options,
+ Driver_Name => Driver_Name,
+ Options_2 => No_Argument_List);
+
+ else
+ declare
+ Maj_Version : constant String :=
+ Major_Id_Name (Lib_File, Lib_Version);
+ begin
+ if Is_Absolute_Path (Lib_Version) then
+ Utl.Gcc
+ (Output_File => Lib_Version,
+ Objects => Ofiles,
+ Options => Options & Shared_Options,
+ Driver_Name => Driver_Name,
+ Options_2 => No_Argument_List);
+ Symbolic_Link_Needed := Lib_Version /= Lib_Path;
+
+ else
+ Utl.Gcc
+ (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
+ Objects => Ofiles,
+ Options => Options & Shared_Options,
+ Driver_Name => Driver_Name,
+ Options_2 => No_Argument_List);
+ Symbolic_Link_Needed :=
+ Lib_Dir & Directory_Separator & Lib_Version /= Lib_Path;
+ end if;
+
+ if Symbolic_Link_Needed then
+ Create_Sym_Links
+ (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
+ end if;
+ end;
+ end if;
+ end Build_Dynamic_Library;
+
+ -------------
+ -- DLL_Ext --
+ -------------
+
+ function DLL_Ext return String is
+ begin
+ return "dylib";
+ end DLL_Ext;
+
+ --------------------
+ -- Dynamic_Option --
+ --------------------
+
+ function Dynamic_Option return String is
+ begin
+ return "-dynamiclib";
+ end Dynamic_Option;
+
+ --------------------
+ -- Is_Archive_Ext --
+ --------------------
+
+ function Is_Archive_Ext (Ext : String) return Boolean is
+ begin
+ return Ext = ".dylib" or else Ext = ".a";
+ end Is_Archive_Ext;
+
+begin
+ Archive_Indexer_Options_Ptr := Archive_Indexer_Options'Access;
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+ DLL_Ext_Ptr := DLL_Ext'Access;
+ Dynamic_Option_Ptr := Dynamic_Option'Access;
+ Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (HP-UX Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2003-2008, AdaCore --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the HP-UX version of the body
+
+with MLib.Fil;
+with MLib.Utl;
+with Opt;
+with Output; use Output;
+
+package body MLib.Tgt.Specific is
+
+ -- Non default subprograms
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ function DLL_Ext return String;
+
+ function Is_Archive_Ext (Ext : String) return Boolean;
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+ pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
+ pragma Unreferenced (Auto_Init);
+
+ Lib_File : constant String :=
+ "lib" & Fil.Append_To (Lib_Filename, DLL_Ext);
+
+ Lib_Path : constant String :=
+ Lib_Dir & Directory_Separator & Lib_File;
+
+ Version_Arg : String_Access;
+ Symbolic_Link_Needed : Boolean := False;
+
+ Common_Options : constant Argument_List :=
+ Options & new String'(PIC_Option);
+ -- Common set of options to the gcc command performing the link.
+ -- On HPUX, this command eventually resorts to collect2, which may
+ -- generate a C file and compile it on the fly. This compilation shall
+ -- also generate position independent code for the final link to
+ -- succeed.
+ begin
+ if Opt.Verbose_Mode then
+ Write_Str ("building relocatable shared library ");
+ Write_Line (Lib_Path);
+ end if;
+
+ if Lib_Version = "" then
+ MLib.Utl.Gcc
+ (Output_File => Lib_Path,
+ Objects => Ofiles,
+ Options => Common_Options,
+ Options_2 => No_Argument_List,
+ Driver_Name => Driver_Name);
+
+ else
+ declare
+ Maj_Version : constant String :=
+ Major_Id_Name (Lib_File, Lib_Version);
+ begin
+ if Maj_Version'Length /= 0 then
+ Version_Arg := new String'("-Wl,+h," & Maj_Version);
+
+ else
+ Version_Arg := new String'("-Wl,+h," & Lib_Version);
+ end if;
+
+ if Is_Absolute_Path (Lib_Version) then
+ MLib.Utl.Gcc
+ (Output_File => Lib_Version,
+ Objects => Ofiles,
+ Options => Common_Options & Version_Arg,
+ Options_2 => No_Argument_List,
+ Driver_Name => Driver_Name);
+ Symbolic_Link_Needed := Lib_Version /= Lib_Path;
+
+ else
+ MLib.Utl.Gcc
+ (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
+ Objects => Ofiles,
+ Options => Common_Options & Version_Arg,
+ Options_2 => No_Argument_List,
+ Driver_Name => Driver_Name);
+ Symbolic_Link_Needed :=
+ Lib_Dir & Directory_Separator & Lib_Version /= Lib_Path;
+ end if;
+
+ if Symbolic_Link_Needed then
+ Create_Sym_Links
+ (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
+ end if;
+ end;
+ end if;
+ end Build_Dynamic_Library;
+
+ -------------
+ -- DLL_Ext --
+ -------------
+
+ function DLL_Ext return String is
+ begin
+ return "sl";
+ end DLL_Ext;
+
+ --------------------
+ -- Is_Archive_Ext --
+ --------------------
+
+ function Is_Archive_Ext (Ext : String) return Boolean is
+ begin
+ return Ext = ".a" or else Ext = ".so";
+ end Is_Archive_Ext;
+
+begin
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+ DLL_Ext_Ptr := DLL_Ext'Access;
+ Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (IRIX Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2003-2007, AdaCore --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the IRIX version of the body
+
+with MLib.Fil;
+with MLib.Utl;
+with Opt;
+with Output; use Output;
+
+package body MLib.Tgt.Specific is
+
+ -- Non default subprogram
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ function Is_Archive_Ext (Ext : String) return Boolean;
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+ pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
+ pragma Unreferenced (Auto_Init);
+
+ Lib_File : constant String :=
+ "lib" & MLib.Fil.Append_To (Lib_Filename, DLL_Ext);
+
+ Lib_Path : constant String :=
+ Lib_Dir & Directory_Separator & Lib_File;
+
+ Version_Arg : String_Access;
+ Symbolic_Link_Needed : Boolean := False;
+
+ N_Options : Argument_List := Options;
+ Options_Last : Natural := N_Options'Last;
+ -- After moving -lxxx to Options_2, N_Options up to index Options_Last
+ -- will contain the Options to pass to MLib.Utl.Gcc.
+
+ Real_Options_2 : Argument_List (1 .. Options'Length);
+ Real_Options_2_Last : Natural := 0;
+ -- Real_Options_2 up to index Real_Options_2_Last will contain the
+ -- Options_2 to pass to MLib.Utl.Gcc.
+
+ begin
+ if Opt.Verbose_Mode then
+ Write_Str ("building relocatable shared library ");
+ Write_Line (Lib_Path);
+ end if;
+
+ -- Move all -lxxx to Options_2
+
+ declare
+ Index : Natural := N_Options'First;
+ Arg : String_Access;
+
+ begin
+ while Index <= Options_Last loop
+ Arg := N_Options (Index);
+
+ if Arg'Length > 2
+ and then Arg (Arg'First .. Arg'First + 1) = "-l"
+ then
+ Real_Options_2_Last := Real_Options_2_Last + 1;
+ Real_Options_2 (Real_Options_2_Last) := Arg;
+ N_Options (Index .. Options_Last - 1) :=
+ N_Options (Index + 1 .. Options_Last);
+ Options_Last := Options_Last - 1;
+
+ else
+ Index := Index + 1;
+ end if;
+ end loop;
+ end;
+
+ if Lib_Version = "" then
+ MLib.Utl.Gcc
+ (Output_File => Lib_Path,
+ Objects => Ofiles,
+ Options => N_Options (N_Options'First .. Options_Last),
+ Driver_Name => Driver_Name,
+ Options_2 => Real_Options_2 (1 .. Real_Options_2_Last));
+
+ else
+ declare
+ Maj_Version : constant String :=
+ Major_Id_Name (Lib_File, Lib_Version);
+ begin
+ if Maj_Version'Length /= 0 then
+ Version_Arg := new String'("-Wl,-soname," & Maj_Version);
+
+ else
+ Version_Arg := new String'("-Wl,-soname," & Lib_Version);
+ end if;
+
+ if Is_Absolute_Path (Lib_Version) then
+ MLib.Utl.Gcc
+ (Output_File => Lib_Version,
+ Objects => Ofiles,
+ Options => N_Options (N_Options'First .. Options_Last) &
+ Version_Arg,
+ Driver_Name => Driver_Name,
+ Options_2 => Real_Options_2 (1 .. Real_Options_2_Last));
+ Symbolic_Link_Needed := Lib_Version /= Lib_Path;
+
+ else
+ MLib.Utl.Gcc
+ (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
+ Objects => Ofiles,
+ Options => N_Options (N_Options'First .. Options_Last) &
+ Version_Arg,
+ Driver_Name => Driver_Name,
+ Options_2 => Real_Options_2 (1 .. Real_Options_2_Last));
+ Symbolic_Link_Needed :=
+ Lib_Dir & Directory_Separator & Lib_Version /= Lib_Path;
+ end if;
+
+ if Symbolic_Link_Needed then
+ Create_Sym_Links
+ (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
+ end if;
+ end;
+ end if;
+ end Build_Dynamic_Library;
+
+ --------------------
+ -- Is_Archive_Ext --
+ --------------------
+
+ function Is_Archive_Ext (Ext : String) return Boolean is
+ begin
+ return Ext = ".a" or else Ext = ".so";
+ end Is_Archive_Ext;
+
+begin
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+ Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (GNU/Linux Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the GNU/Linux version of the body
+
+with MLib.Fil;
+with MLib.Utl;
+with Opt;
+with Output; use Output;
+
+package body MLib.Tgt.Specific is
+
+ use MLib;
+
+ -- Non default subprograms
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ function Is_Archive_Ext (Ext : String) return Boolean;
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+ pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
+ pragma Unreferenced (Auto_Init);
+ -- Initialization is done through the contructor mechanism
+
+ Lib_File : constant String :=
+ "lib" & Fil.Append_To (Lib_Filename, DLL_Ext);
+
+ Lib_Path : constant String :=
+ Lib_Dir & Directory_Separator & Lib_File;
+
+ Version_Arg : String_Access;
+ Symbolic_Link_Needed : Boolean := False;
+
+ begin
+ if Opt.Verbose_Mode then
+ Write_Str ("building relocatable shared library ");
+ Write_Line (Lib_Path);
+ end if;
+
+ if Lib_Version = "" then
+ Utl.Gcc
+ (Output_File => Lib_Path,
+ Objects => Ofiles,
+ Options => Options,
+ Driver_Name => Driver_Name,
+ Options_2 => No_Argument_List);
+
+ else
+ declare
+ Maj_Version : constant String :=
+ Major_Id_Name (Lib_File, Lib_Version);
+ begin
+ if Maj_Version'Length /= 0 then
+ Version_Arg := new String'("-Wl,-soname," & Maj_Version);
+
+ else
+ Version_Arg := new String'("-Wl,-soname," & Lib_Version);
+ end if;
+
+ if Is_Absolute_Path (Lib_Version) then
+ Utl.Gcc
+ (Output_File => Lib_Version,
+ Objects => Ofiles,
+ Options => Options & Version_Arg,
+ Driver_Name => Driver_Name,
+ Options_2 => No_Argument_List);
+ Symbolic_Link_Needed := Lib_Version /= Lib_Path;
+
+ else
+ Utl.Gcc
+ (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
+ Objects => Ofiles,
+ Options => Options & Version_Arg,
+ Driver_Name => Driver_Name,
+ Options_2 => No_Argument_List);
+ Symbolic_Link_Needed :=
+ Lib_Dir & Directory_Separator & Lib_Version /= Lib_Path;
+ end if;
+
+ if Symbolic_Link_Needed then
+ Create_Sym_Links
+ (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
+ end if;
+ end;
+ end if;
+ end Build_Dynamic_Library;
+
+ --------------------
+ -- Is_Archive_Ext --
+ --------------------
+
+ function Is_Archive_Ext (Ext : String) return Boolean is
+ begin
+ return Ext = ".a" or else Ext = ".so";
+ end Is_Archive_Ext;
+
+begin
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+ Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (LynxOS Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2003-2007, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the LynxOS version of the body
+
+package body MLib.Tgt.Specific is
+
+ -- Non default subprograms
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ function DLL_Ext return String;
+
+ function Dynamic_Option return String;
+
+ function PIC_Option return String;
+
+ function Library_Major_Minor_Id_Supported return Boolean;
+
+ function Standalone_Library_Auto_Init_Is_Supported return Boolean;
+
+ function Support_For_Libraries return Library_Support;
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+ pragma Unreferenced (Ofiles);
+ pragma Unreferenced (Options);
+ pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Lib_Filename);
+ pragma Unreferenced (Lib_Dir);
+ pragma Unreferenced (Symbol_Data);
+ pragma Unreferenced (Driver_Name);
+ pragma Unreferenced (Lib_Version);
+ pragma Unreferenced (Auto_Init);
+
+ begin
+ null;
+ end Build_Dynamic_Library;
+
+ -------------
+ -- DLL_Ext --
+ -------------
+
+ function DLL_Ext return String is
+ begin
+ return "";
+ end DLL_Ext;
+
+ --------------------
+ -- Dynamic_Option --
+ --------------------
+
+ function Dynamic_Option return String is
+ begin
+ return "";
+ end Dynamic_Option;
+
+ --------------------------------------
+ -- Library_Major_Minor_Id_Supported --
+ --------------------------------------
+
+ function Library_Major_Minor_Id_Supported return Boolean is
+ begin
+ return False;
+ end Library_Major_Minor_Id_Supported;
+
+ ----------------
+ -- PIC_Option --
+ ----------------
+
+ function PIC_Option return String is
+ begin
+ return "";
+ end PIC_Option;
+
+ -----------------------------------------------
+ -- Standalone_Library_Auto_Init_Is_Supported --
+ -----------------------------------------------
+
+ function Standalone_Library_Auto_Init_Is_Supported return Boolean is
+ begin
+ return False;
+ end Standalone_Library_Auto_Init_Is_Supported;
+
+ ---------------------------
+ -- Support_For_Libraries --
+ ---------------------------
+
+ function Support_For_Libraries return Library_Support is
+ begin
+ return Static_Only;
+ end Support_For_Libraries;
+
+begin
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+ DLL_Ext_Ptr := DLL_Ext'Access;
+ Dynamic_Option_Ptr := Dynamic_Option'Access;
+ Library_Major_Minor_Id_Supported_Ptr :=
+ Library_Major_Minor_Id_Supported'Access;
+ PIC_Option_Ptr := PIC_Option'Access;
+ Standalone_Library_Auto_Init_Is_Supported_Ptr :=
+ Standalone_Library_Auto_Init_Is_Supported'Access;
+ Support_For_Libraries_Ptr := Support_For_Libraries'Access;
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (Windows Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2002-2007, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the Windows version of the body. Works only with GCC versions
+-- supporting the "-shared" option.
+
+with Opt;
+with Output; use Output;
+
+with MLib.Fil;
+with MLib.Utl;
+
+package body MLib.Tgt.Specific is
+
+ package Files renames MLib.Fil;
+ package Tools renames MLib.Utl;
+
+ -- Non default subprograms
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ function DLL_Ext return String;
+
+ function DLL_Prefix return String;
+
+ function Is_Archive_Ext (Ext : String) return Boolean;
+
+ function Library_Major_Minor_Id_Supported return Boolean;
+
+ function PIC_Option return String;
+
+ No_Argument_List : constant String_List := (1 .. 0 => null);
+ -- Used as value of parameter Options or Options2 in calls to Gcc
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+ pragma Unreferenced (Symbol_Data);
+ pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Lib_Version);
+ pragma Unreferenced (Auto_Init);
+
+ Lib_File : constant String :=
+ Lib_Dir & Directory_Separator &
+ DLL_Prefix & Files.Append_To (Lib_Filename, DLL_Ext);
+
+ -- Start of processing for Build_Dynamic_Library
+
+ begin
+ if Opt.Verbose_Mode then
+ Write_Str ("building relocatable shared library ");
+ Write_Line (Lib_File);
+ end if;
+
+ Tools.Gcc
+ (Output_File => Lib_File,
+ Objects => Ofiles,
+ Options => No_Argument_List,
+ Options_2 => Options,
+ Driver_Name => Driver_Name);
+ end Build_Dynamic_Library;
+
+ -------------
+ -- DLL_Ext --
+ -------------
+
+ function DLL_Ext return String is
+ begin
+ return "dll";
+ end DLL_Ext;
+
+ ----------------
+ -- DLL_Prefix --
+ ----------------
+
+ function DLL_Prefix return String is
+ begin
+ return "lib";
+ end DLL_Prefix;
+
+ --------------------
+ -- Is_Archive_Ext --
+ --------------------
+
+ function Is_Archive_Ext (Ext : String) return Boolean is
+ begin
+ return Ext = ".a" or else Ext = ".dll";
+ end Is_Archive_Ext;
+
+ --------------------------------------
+ -- Library_Major_Minor_Id_Supported --
+ --------------------------------------
+
+ function Library_Major_Minor_Id_Supported return Boolean is
+ begin
+ return False;
+ end Library_Major_Minor_Id_Supported;
+
+ ----------------
+ -- PIC_Option --
+ ----------------
+
+ function PIC_Option return String is
+ begin
+ return "";
+ end PIC_Option;
+
+begin
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+ DLL_Ext_Ptr := DLL_Ext'Access;
+ DLL_Prefix_Ptr := DLL_Prefix'Access;
+ Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
+ PIC_Option_Ptr := PIC_Option'Access;
+ Library_Major_Minor_Id_Supported_Ptr :=
+ Library_Major_Minor_Id_Supported'Access;
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (Solaris Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2002-2007, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the Solaris version of the body
+
+with MLib.Fil;
+with MLib.Utl;
+with Opt;
+with Output; use Output;
+
+package body MLib.Tgt.Specific is
+
+ -- Non default subprograms
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ function Is_Archive_Ext (Ext : String) return Boolean;
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+ pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
+ pragma Unreferenced (Auto_Init);
+
+ Lib_File : constant String :=
+ "lib" & Fil.Append_To (Lib_Filename, DLL_Ext);
+
+ Lib_Path : constant String :=
+ Lib_Dir & Directory_Separator & Lib_File;
+
+ Version_Arg : String_Access;
+ Symbolic_Link_Needed : Boolean := False;
+
+ begin
+ if Opt.Verbose_Mode then
+ Write_Str ("building relocatable shared library ");
+ Write_Line (Lib_Path);
+ end if;
+
+ if Lib_Version = "" then
+ Utl.Gcc
+ (Output_File => Lib_Path,
+ Objects => Ofiles,
+ Options => Options,
+ Options_2 => No_Argument_List,
+ Driver_Name => Driver_Name);
+
+ else
+ declare
+ Maj_Version : constant String :=
+ Major_Id_Name (Lib_File, Lib_Version);
+ begin
+ if Maj_Version'Length /= 0 then
+ Version_Arg := new String'("-Wl,-h," & Maj_Version);
+
+ else
+ Version_Arg := new String'("-Wl,-h," & Lib_Version);
+ end if;
+
+ if Is_Absolute_Path (Lib_Version) then
+ Utl.Gcc
+ (Output_File => Lib_Version,
+ Objects => Ofiles,
+ Options => Options & Version_Arg,
+ Options_2 => No_Argument_List,
+ Driver_Name => Driver_Name);
+ Symbolic_Link_Needed := Lib_Version /= Lib_Path;
+
+ else
+ Utl.Gcc
+ (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
+ Objects => Ofiles,
+ Options => Options & Version_Arg,
+ Options_2 => No_Argument_List,
+ Driver_Name => Driver_Name);
+ Symbolic_Link_Needed :=
+ Lib_Dir & Directory_Separator & Lib_Version /= Lib_Path;
+ end if;
+
+ if Symbolic_Link_Needed then
+ Create_Sym_Links
+ (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
+ end if;
+ end;
+ end if;
+ end Build_Dynamic_Library;
+
+ --------------------
+ -- Is_Archive_Ext --
+ --------------------
+
+ function Is_Archive_Ext (Ext : String) return Boolean is
+ begin
+ return Ext = ".a" or else Ext = ".so";
+ end Is_Archive_Ext;
+
+begin
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+ Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (Tru64 Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2002-2008, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the True64 version of the body
+
+with MLib.Fil;
+with MLib.Utl;
+with Opt;
+with Output; use Output;
+
+package body MLib.Tgt.Specific is
+
+ use MLib;
+
+ -- Non default subprogram
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ function Is_Archive_Ext (Ext : String) return Boolean;
+
+ function PIC_Option return String;
+
+ -- Local variables
+
+ Expect_Unresolved : aliased String := "-Wl,-expect_unresolved,*";
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+ pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
+ pragma Unreferenced (Auto_Init);
+ -- Initialization is done through the constructor mechanism
+
+ Lib_File : constant String :=
+ "lib" & Fil.Append_To (Lib_Filename, DLL_Ext);
+
+ Lib_Path : constant String :=
+ Lib_Dir & Directory_Separator & Lib_File;
+
+ Version_Arg : String_Access;
+ Symbolic_Link_Needed : Boolean := False;
+
+ begin
+ if Opt.Verbose_Mode then
+ Write_Str ("building relocatable shared library ");
+ Write_Line (Lib_Path);
+ end if;
+
+ -- If specified, add automatic elaboration/finalization
+
+ if Lib_Version = "" then
+ Utl.Gcc
+ (Output_File => Lib_Path,
+ Objects => Ofiles,
+ Options => Options & Expect_Unresolved'Access,
+ Options_2 => No_Argument_List,
+ Driver_Name => Driver_Name);
+
+ else
+ declare
+ Maj_Version : constant String :=
+ Major_Id_Name (Lib_File, Lib_Version);
+ begin
+ if Maj_Version'Length /= 0 then
+ Version_Arg := new String'("-Wl,-soname," & Maj_Version);
+
+ else
+ Version_Arg := new String'("-Wl,-soname," & Lib_Version);
+ end if;
+
+ if Is_Absolute_Path (Lib_Version) then
+ Utl.Gcc
+ (Output_File => Lib_Version,
+ Objects => Ofiles,
+ Options =>
+ Options & Version_Arg & Expect_Unresolved'Access,
+ Options_2 => No_Argument_List,
+ Driver_Name => Driver_Name);
+ Symbolic_Link_Needed := Lib_Version /= Lib_Path;
+
+ else
+ Utl.Gcc
+ (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
+ Objects => Ofiles,
+ Options =>
+ Options & Version_Arg & Expect_Unresolved'Access,
+ Options_2 => No_Argument_List,
+ Driver_Name => Driver_Name);
+ Symbolic_Link_Needed :=
+ Lib_Dir & Directory_Separator & Lib_Version /= Lib_Path;
+ end if;
+
+ if Symbolic_Link_Needed then
+ Create_Sym_Links
+ (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
+ end if;
+ end;
+ end if;
+ end Build_Dynamic_Library;
+
+ --------------------
+ -- Is_Archive_Ext --
+ --------------------
+
+ function Is_Archive_Ext (Ext : String) return Boolean is
+ begin
+ return Ext = ".a" or else Ext = ".so";
+ end Is_Archive_Ext;
+
+ ----------------
+ -- PIC_Option --
+ ----------------
+
+ function PIC_Option return String is
+ begin
+ return "";
+ end PIC_Option;
+
+begin
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+ Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
+ PIC_Option_Ptr := PIC_Option'Access;
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (Alpha VMS Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2003-2008, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the Alpha VMS version of the body
+
+with Ada.Characters.Handling; use Ada.Characters.Handling;
+
+with MLib.Fil;
+with MLib.Utl;
+
+with MLib.Tgt.VMS_Common;
+pragma Warnings (Off, MLib.Tgt.VMS_Common);
+-- MLib.Tgt.VMS_Common is with'ed only for elaboration purposes
+
+with Opt; use Opt;
+with Output; use Output;
+
+with GNAT.Directory_Operations; use GNAT.Directory_Operations;
+
+with System; use System;
+with System.Case_Util; use System.Case_Util;
+with System.CRTL; use System.CRTL;
+
+package body MLib.Tgt.Specific is
+
+ -- Non default subprogram. See comment in mlib-tgt.ads.
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ -- Local variables
+
+ Empty_Argument_List : aliased Argument_List := (1 .. 0 => null);
+ Additional_Objects : Argument_List_Access := Empty_Argument_List'Access;
+ -- Used to add the generated auto-init object files for auto-initializing
+ -- stand-alone libraries.
+
+ Macro_Name : constant String := "mcr gnu:[bin]gcc -c -x assembler";
+ -- The name of the command to invoke the macro-assembler
+
+ VMS_Options : Argument_List := (1 .. 1 => null);
+
+ Gnatsym_Name : constant String := "gnatsym";
+
+ Gnatsym_Path : String_Access;
+
+ Arguments : Argument_List_Access := null;
+ Last_Argument : Natural := 0;
+
+ Success : Boolean := False;
+
+ Shared_Libgcc : aliased String := "-shared-libgcc";
+
+ Shared_Libgcc_Switch : constant Argument_List :=
+ (1 => Shared_Libgcc'Access);
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+
+ Lib_File : constant String :=
+ Lib_Dir & Directory_Separator & "lib" &
+ Fil.Ext_To (Lib_Filename, DLL_Ext);
+
+ Opts : Argument_List := Options;
+ Last_Opt : Natural := Opts'Last;
+ Opts2 : Argument_List (Options'Range);
+ Last_Opt2 : Natural := Opts2'First - 1;
+
+ Inter : constant Argument_List := Interfaces;
+
+ function Is_Interface (Obj_File : String) return Boolean;
+ -- For a Stand-Alone Library, returns True if Obj_File is the object
+ -- file name of an interface of the SAL. For other libraries, always
+ -- return True.
+
+ function Option_File_Name return String;
+ -- Returns Symbol_File, if not empty. Otherwise, returns "symvec.opt"
+
+ function Version_String return String;
+ -- Returns Lib_Version if not empty and if Symbol_Data.Symbol_Policy is
+ -- not Autonomous, otherwise returns "". When Symbol_Data.Symbol_Policy
+ -- is Autonomous, fails gnatmake if Lib_Version is not the image of a
+ -- positive number.
+
+ ------------------
+ -- Is_Interface --
+ ------------------
+
+ function Is_Interface (Obj_File : String) return Boolean is
+ ALI : constant String :=
+ Fil.Ext_To
+ (Filename => To_Lower (Base_Name (Obj_File)),
+ New_Ext => "ali");
+
+ begin
+ if Inter'Length = 0 then
+ return True;
+
+ elsif ALI'Length > 2 and then
+ ALI (ALI'First .. ALI'First + 2) = "b__"
+ then
+ return True;
+
+ else
+ for J in Inter'Range loop
+ if Inter (J).all = ALI then
+ return True;
+ end if;
+ end loop;
+
+ return False;
+ end if;
+ end Is_Interface;
+
+ ----------------------
+ -- Option_File_Name --
+ ----------------------
+
+ function Option_File_Name return String is
+ begin
+ if Symbol_Data.Symbol_File = No_Path then
+ return "symvec.opt";
+ else
+ Get_Name_String (Symbol_Data.Symbol_File);
+ To_Lower (Name_Buffer (1 .. Name_Len));
+ return Name_Buffer (1 .. Name_Len);
+ end if;
+ end Option_File_Name;
+
+ --------------------
+ -- Version_String --
+ --------------------
+
+ function Version_String return String is
+ Version : Integer := 0;
+
+ begin
+ if Lib_Version = ""
+ or else Symbol_Data.Symbol_Policy /= Autonomous
+ then
+ return "";
+
+ else
+ begin
+ Version := Integer'Value (Lib_Version);
+
+ if Version <= 0 then
+ raise Constraint_Error;
+ end if;
+
+ return Lib_Version;
+
+ exception
+ when Constraint_Error =>
+ Fail ("illegal version """, Lib_Version,
+ """ (on VMS version must be a positive number)");
+ return "";
+ end;
+ end if;
+ end Version_String;
+
+ ---------------------
+ -- Local Variables --
+ ---------------------
+
+ Opt_File_Name : constant String := Option_File_Name;
+ Version : constant String := Version_String;
+ For_Linker_Opt : String_Access;
+
+ -- Start of processing for Build_Dynamic_Library
+
+ begin
+ -- If option file name does not ends with ".opt", append "/OPTIONS"
+ -- to its specification for the VMS linker.
+
+ if Opt_File_Name'Length > 4
+ and then
+ Opt_File_Name (Opt_File_Name'Last - 3 .. Opt_File_Name'Last) = ".opt"
+ then
+ For_Linker_Opt := new String'("--for-linker=" & Opt_File_Name);
+ else
+ For_Linker_Opt :=
+ new String'("--for-linker=" & Opt_File_Name & "/OPTIONS");
+ end if;
+
+ VMS_Options (VMS_Options'First) := For_Linker_Opt;
+
+ for J in Inter'Range loop
+ To_Lower (Inter (J).all);
+ end loop;
+
+ -- "gnatsym" is necessary for building the option file
+
+ if Gnatsym_Path = null then
+ Gnatsym_Path := Locate_Exec_On_Path (Gnatsym_Name);
+
+ if Gnatsym_Path = null then
+ Fail (Gnatsym_Name, " not found in path");
+ end if;
+ end if;
+
+ -- For auto-initialization of a stand-alone library, we create
+ -- a macro-assembly file and we invoke the macro-assembler.
+
+ if Auto_Init then
+ declare
+ Macro_File_Name : constant String := Lib_Filename & "__init.asm";
+ Macro_File : File_Descriptor;
+ Init_Proc : String := Lib_Filename & "INIT";
+ Popen_Result : System.Address;
+ Pclose_Result : Integer;
+ Len : Natural;
+ OK : Boolean := True;
+
+ command : constant String :=
+ Macro_Name & " " & Macro_File_Name & ASCII.NUL;
+ -- The command to invoke the assembler on the generated auto-init
+ -- assembly file.
+
+ mode : constant String := "r" & ASCII.NUL;
+ -- The mode for the invocation of Popen
+
+ begin
+ To_Upper (Init_Proc);
+
+ if Verbose_Mode then
+ Write_Str ("Creating auto-init assembly file """);
+ Write_Str (Macro_File_Name);
+ Write_Line ("""");
+ end if;
+
+ -- Create and write the auto-init assembly file
+
+ declare
+ First_Line : constant String :=
+ ASCII.HT & ".section LIB$INITIALIZE,GBL,NOWRT" &
+ ASCII.LF;
+ Second_Line : constant String :=
+ ASCII.HT & ".long " & Init_Proc & ASCII.LF;
+ -- First and second lines of the auto-init assembly file
+
+ begin
+ Macro_File := Create_File (Macro_File_Name, Text);
+ OK := Macro_File /= Invalid_FD;
+
+ if OK then
+ Len := Write
+ (Macro_File, First_Line (First_Line'First)'Address,
+ First_Line'Length);
+ OK := Len = First_Line'Length;
+ end if;
+
+ if OK then
+ Len := Write
+ (Macro_File, Second_Line (Second_Line'First)'Address,
+ Second_Line'Length);
+ OK := Len = Second_Line'Length;
+ end if;
+
+ if OK then
+ Close (Macro_File, OK);
+ end if;
+
+ if not OK then
+ Fail ("creation of auto-init assembly file """,
+ Macro_File_Name, """ failed");
+ end if;
+ end;
+
+ -- Invoke the macro-assembler
+
+ if Verbose_Mode then
+ Write_Str ("Assembling auto-init assembly file """);
+ Write_Str (Macro_File_Name);
+ Write_Line ("""");
+ end if;
+
+ Popen_Result := popen (command (command'First)'Address,
+ mode (mode'First)'Address);
+
+ if Popen_Result = Null_Address then
+ Fail ("assembly of auto-init assembly file """,
+ Macro_File_Name, """ failed");
+ end if;
+
+ -- Wait for the end of execution of the macro-assembler
+
+ Pclose_Result := pclose (Popen_Result);
+
+ if Pclose_Result < 0 then
+ Fail ("assembly of auto init assembly file """,
+ Macro_File_Name, """ failed");
+ end if;
+
+ -- Add the generated object file to the list of objects to be
+ -- included in the library.
+
+ Additional_Objects :=
+ new Argument_List'
+ (1 => new String'(Lib_Filename & "__init.obj"));
+ end;
+ end if;
+
+ -- Allocate the argument list and put the symbol file name, the
+ -- reference (if any) and the policy (if not autonomous).
+
+ Arguments := new Argument_List (1 .. Ofiles'Length + 8);
+
+ Last_Argument := 0;
+
+ -- Verbosity
+
+ if Verbose_Mode then
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-v");
+ end if;
+
+ -- Version number (major ID)
+
+ if Lib_Version /= "" then
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-V");
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'(Version);
+ end if;
+
+ -- Symbol file
+
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-s");
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'(Opt_File_Name);
+
+ -- Reference Symbol File
+
+ if Symbol_Data.Reference /= No_Path then
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-r");
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) :=
+ new String'(Get_Name_String (Symbol_Data.Reference));
+ end if;
+
+ -- Policy
+
+ case Symbol_Data.Symbol_Policy is
+ when Autonomous =>
+ null;
+
+ when Compliant =>
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-c");
+
+ when Controlled =>
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-C");
+
+ when Restricted =>
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-R");
+
+ when Direct =>
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-D");
+
+ end case;
+
+ -- Add each relevant object file
+
+ for Index in Ofiles'Range loop
+ if Is_Interface (Ofiles (Index).all) then
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'(Ofiles (Index).all);
+ end if;
+ end loop;
+
+ -- Spawn gnatsym
+
+ Spawn (Program_Name => Gnatsym_Path.all,
+ Args => Arguments (1 .. Last_Argument),
+ Success => Success);
+
+ if not Success then
+ Fail ("unable to create symbol file for library """,
+ Lib_Filename, """");
+ end if;
+
+ Free (Arguments);
+
+ -- Move all the -l switches from Opts to Opts2
+
+ declare
+ Index : Natural := Opts'First;
+ Opt : String_Access;
+
+ begin
+ while Index <= Last_Opt loop
+ Opt := Opts (Index);
+
+ if Opt'Length > 2 and then
+ Opt (Opt'First .. Opt'First + 1) = "-l"
+ then
+ if Index < Last_Opt then
+ Opts (Index .. Last_Opt - 1) :=
+ Opts (Index + 1 .. Last_Opt);
+ end if;
+
+ Last_Opt := Last_Opt - 1;
+
+ Last_Opt2 := Last_Opt2 + 1;
+ Opts2 (Last_Opt2) := Opt;
+
+ else
+ Index := Index + 1;
+ end if;
+ end loop;
+ end;
+
+ -- Invoke gcc to build the library
+
+ Utl.Gcc
+ (Output_File => Lib_File,
+ Objects => Ofiles & Additional_Objects.all,
+ Options => VMS_Options,
+ Options_2 => Shared_Libgcc_Switch &
+ Opts (Opts'First .. Last_Opt) &
+ Opts2 (Opts2'First .. Last_Opt2),
+ Driver_Name => Driver_Name);
+
+ -- The auto-init object file need to be deleted, so that it will not
+ -- be included in the library as a regular object file, otherwise
+ -- it will be included twice when the library will be built next
+ -- time, which may lead to errors.
+
+ if Auto_Init then
+ declare
+ Auto_Init_Object_File_Name : constant String :=
+ Lib_Filename & "__init.obj";
+ Disregard : Boolean;
+
+ begin
+ if Verbose_Mode then
+ Write_Str ("deleting auto-init object file """);
+ Write_Str (Auto_Init_Object_File_Name);
+ Write_Line ("""");
+ end if;
+
+ Delete_File (Auto_Init_Object_File_Name, Success => Disregard);
+ end;
+ end if;
+ end Build_Dynamic_Library;
+
+-- Package initialization
+
+begin
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (Integrity VMS Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the Integrity VMS version of the body
+
+with Ada.Characters.Handling; use Ada.Characters.Handling;
+
+with MLib.Fil;
+with MLib.Utl;
+
+with MLib.Tgt.VMS_Common;
+pragma Warnings (Off, MLib.Tgt.VMS_Common);
+-- MLib.Tgt.VMS_Common is with'ed only for elaboration purposes
+
+with Opt; use Opt;
+with Output; use Output;
+
+with GNAT.Directory_Operations; use GNAT.Directory_Operations;
+
+with System; use System;
+with System.Case_Util; use System.Case_Util;
+with System.CRTL; use System.CRTL;
+
+package body MLib.Tgt.Specific is
+
+ -- Non default subprogram. See comment in mlib-tgt.ads.
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ -- Local variables
+
+ Empty_Argument_List : aliased Argument_List := (1 .. 0 => null);
+ Additional_Objects : Argument_List_Access := Empty_Argument_List'Access;
+ -- Used to add the generated auto-init object files for auto-initializing
+ -- stand-alone libraries.
+
+ Macro_Name : constant String := "mcr gnu:[bin]gcc -c -x assembler";
+ -- The name of the command to invoke the macro-assembler
+
+ VMS_Options : Argument_List := (1 .. 1 => null);
+
+ Gnatsym_Name : constant String := "gnatsym";
+
+ Gnatsym_Path : String_Access;
+
+ Arguments : Argument_List_Access := null;
+ Last_Argument : Natural := 0;
+
+ Success : Boolean := False;
+
+ Shared_Libgcc : aliased String := "-shared-libgcc";
+
+ Shared_Libgcc_Switch : constant Argument_List :=
+ (1 => Shared_Libgcc'Access);
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+
+ Lib_File : constant String :=
+ Lib_Dir & Directory_Separator & "lib" &
+ Fil.Ext_To (Lib_Filename, DLL_Ext);
+
+ Opts : Argument_List := Options;
+ Last_Opt : Natural := Opts'Last;
+ Opts2 : Argument_List (Options'Range);
+ Last_Opt2 : Natural := Opts2'First - 1;
+
+ Inter : constant Argument_List := Interfaces;
+
+ function Is_Interface (Obj_File : String) return Boolean;
+ -- For a Stand-Alone Library, returns True if Obj_File is the object
+ -- file name of an interface of the SAL. For other libraries, always
+ -- return True.
+
+ function Option_File_Name return String;
+ -- Returns Symbol_File, if not empty. Otherwise, returns "symvec.opt"
+
+ function Version_String return String;
+ -- Returns Lib_Version if not empty and if Symbol_Data.Symbol_Policy is
+ -- not Autonomous, otherwise returns "". When Symbol_Data.Symbol_Policy
+ -- is Autonomous, fails gnatmake if Lib_Version is not the image of a
+ -- positive number.
+
+ ------------------
+ -- Is_Interface --
+ ------------------
+
+ function Is_Interface (Obj_File : String) return Boolean is
+ ALI : constant String :=
+ Fil.Ext_To
+ (Filename => To_Lower (Base_Name (Obj_File)),
+ New_Ext => "ali");
+
+ begin
+ if Inter'Length = 0 then
+ return True;
+
+ elsif ALI'Length > 2 and then
+ ALI (ALI'First .. ALI'First + 2) = "b__"
+ then
+ return True;
+
+ else
+ for J in Inter'Range loop
+ if Inter (J).all = ALI then
+ return True;
+ end if;
+ end loop;
+
+ return False;
+ end if;
+ end Is_Interface;
+
+ ----------------------
+ -- Option_File_Name --
+ ----------------------
+
+ function Option_File_Name return String is
+ begin
+ if Symbol_Data.Symbol_File = No_Path then
+ return "symvec.opt";
+ else
+ Get_Name_String (Symbol_Data.Symbol_File);
+ To_Lower (Name_Buffer (1 .. Name_Len));
+ return Name_Buffer (1 .. Name_Len);
+ end if;
+ end Option_File_Name;
+
+ --------------------
+ -- Version_String --
+ --------------------
+
+ function Version_String return String is
+ Version : Integer := 0;
+ begin
+ if Lib_Version = ""
+ or else Symbol_Data.Symbol_Policy /= Autonomous
+ then
+ return "";
+
+ else
+ begin
+ Version := Integer'Value (Lib_Version);
+
+ if Version <= 0 then
+ raise Constraint_Error;
+ end if;
+
+ return Lib_Version;
+
+ exception
+ when Constraint_Error =>
+ Fail ("illegal version """, Lib_Version,
+ """ (on VMS version must be a positive number)");
+ return "";
+ end;
+ end if;
+ end Version_String;
+
+ ---------------------
+ -- Local Variables --
+ ---------------------
+
+ Opt_File_Name : constant String := Option_File_Name;
+ Version : constant String := Version_String;
+ For_Linker_Opt : String_Access;
+
+ -- Start of processing for Build_Dynamic_Library
+
+ begin
+ -- Option file must end with ".opt"
+
+ if Opt_File_Name'Length > 4
+ and then
+ Opt_File_Name (Opt_File_Name'Last - 3 .. Opt_File_Name'Last) = ".opt"
+ then
+ For_Linker_Opt := new String'("--for-linker=" & Opt_File_Name);
+ else
+ Fail ("Options File """, Opt_File_Name, """ must end with .opt");
+ end if;
+
+ VMS_Options (VMS_Options'First) := For_Linker_Opt;
+
+ for J in Inter'Range loop
+ To_Lower (Inter (J).all);
+ end loop;
+
+ -- "gnatsym" is necessary for building the option file
+
+ if Gnatsym_Path = null then
+ Gnatsym_Path := Locate_Exec_On_Path (Gnatsym_Name);
+
+ if Gnatsym_Path = null then
+ Fail (Gnatsym_Name, " not found in path");
+ end if;
+ end if;
+
+ -- For auto-initialization of a stand-alone library, we create
+ -- a macro-assembly file and we invoke the macro-assembler.
+
+ if Auto_Init then
+ declare
+ Macro_File_Name : constant String := Lib_Filename & "__init.asm";
+ Macro_File : File_Descriptor;
+ Init_Proc : String := Lib_Filename & "INIT";
+ Popen_Result : System.Address;
+ Pclose_Result : Integer;
+ Len : Natural;
+ OK : Boolean := True;
+
+ command : constant String :=
+ Macro_Name & " " & Macro_File_Name & ASCII.NUL;
+ -- The command to invoke the assembler on the generated auto-init
+ -- assembly file.
+ -- Why odd lower case name ???
+
+ mode : constant String := "r" & ASCII.NUL;
+ -- The mode for the invocation of Popen
+ -- Why odd lower case name ???
+
+ begin
+ To_Upper (Init_Proc);
+
+ if Verbose_Mode then
+ Write_Str ("Creating auto-init assembly file """);
+ Write_Str (Macro_File_Name);
+ Write_Line ("""");
+ end if;
+
+ -- Create and write the auto-init assembly file
+
+ declare
+ First_Line : constant String :=
+ ASCII.HT
+ & ".type " & Init_Proc & "#, @function"
+ & ASCII.LF;
+ Second_Line : constant String :=
+ ASCII.HT
+ & ".global " & Init_Proc & "#"
+ & ASCII.LF;
+ Third_Line : constant String :=
+ ASCII.HT
+ & ".global LIB$INITIALIZE#"
+ & ASCII.LF;
+ Fourth_Line : constant String :=
+ ASCII.HT
+ & ".section LIB$INITIALIZE#,""a"",@progbits"
+ & ASCII.LF;
+ Fifth_Line : constant String :=
+ ASCII.HT
+ & "data4 @fptr(" & Init_Proc & "#)"
+ & ASCII.LF;
+
+ begin
+ Macro_File := Create_File (Macro_File_Name, Text);
+ OK := Macro_File /= Invalid_FD;
+
+ if OK then
+ Len := Write
+ (Macro_File, First_Line (First_Line'First)'Address,
+ First_Line'Length);
+ OK := Len = First_Line'Length;
+ end if;
+
+ if OK then
+ Len := Write
+ (Macro_File, Second_Line (Second_Line'First)'Address,
+ Second_Line'Length);
+ OK := Len = Second_Line'Length;
+ end if;
+
+ if OK then
+ Len := Write
+ (Macro_File, Third_Line (Third_Line'First)'Address,
+ Third_Line'Length);
+ OK := Len = Third_Line'Length;
+ end if;
+
+ if OK then
+ Len := Write
+ (Macro_File, Fourth_Line (Fourth_Line'First)'Address,
+ Fourth_Line'Length);
+ OK := Len = Fourth_Line'Length;
+ end if;
+
+ if OK then
+ Len := Write
+ (Macro_File, Fifth_Line (Fifth_Line'First)'Address,
+ Fifth_Line'Length);
+ OK := Len = Fifth_Line'Length;
+ end if;
+
+ if OK then
+ Close (Macro_File, OK);
+ end if;
+
+ if not OK then
+ Fail ("creation of auto-init assembly file """,
+ Macro_File_Name, """ failed");
+ end if;
+ end;
+
+ -- Invoke the macro-assembler
+
+ if Verbose_Mode then
+ Write_Str ("Assembling auto-init assembly file """);
+ Write_Str (Macro_File_Name);
+ Write_Line ("""");
+ end if;
+
+ Popen_Result := popen (command (command'First)'Address,
+ mode (mode'First)'Address);
+
+ if Popen_Result = Null_Address then
+ Fail ("assembly of auto-init assembly file """,
+ Macro_File_Name, """ failed");
+ end if;
+
+ -- Wait for the end of execution of the macro-assembler
+
+ Pclose_Result := pclose (Popen_Result);
+
+ if Pclose_Result < 0 then
+ Fail ("assembly of auto init assembly file """,
+ Macro_File_Name, """ failed");
+ end if;
+
+ -- Add the generated object file to the list of objects to be
+ -- included in the library.
+
+ Additional_Objects :=
+ new Argument_List'
+ (1 => new String'(Lib_Filename & "__init.obj"));
+ end;
+ end if;
+
+ -- Allocate the argument list and put the symbol file name, the
+ -- reference (if any) and the policy (if not autonomous).
+
+ Arguments := new Argument_List (1 .. Ofiles'Length + 8);
+
+ Last_Argument := 0;
+
+ -- Verbosity
+
+ if Verbose_Mode then
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-v");
+ end if;
+
+ -- Version number (major ID)
+
+ if Lib_Version /= "" then
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-V");
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'(Version);
+ end if;
+
+ -- Symbol file
+
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-s");
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'(Opt_File_Name);
+
+ -- Reference Symbol File
+
+ if Symbol_Data.Reference /= No_Path then
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-r");
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) :=
+ new String'(Get_Name_String (Symbol_Data.Reference));
+ end if;
+
+ -- Policy
+
+ case Symbol_Data.Symbol_Policy is
+ when Autonomous =>
+ null;
+
+ when Compliant =>
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-c");
+
+ when Controlled =>
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-C");
+
+ when Restricted =>
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-R");
+
+ when Direct =>
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-D");
+ end case;
+
+ -- Add each relevant object file
+
+ for Index in Ofiles'Range loop
+ if Is_Interface (Ofiles (Index).all) then
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'(Ofiles (Index).all);
+ end if;
+ end loop;
+
+ -- Spawn gnatsym
+
+ Spawn (Program_Name => Gnatsym_Path.all,
+ Args => Arguments (1 .. Last_Argument),
+ Success => Success);
+
+ if not Success then
+ Fail ("unable to create symbol file for library """,
+ Lib_Filename, """");
+ end if;
+
+ Free (Arguments);
+
+ -- Move all the -l switches from Opts to Opts2
+
+ declare
+ Index : Natural := Opts'First;
+ Opt : String_Access;
+
+ begin
+ while Index <= Last_Opt loop
+ Opt := Opts (Index);
+
+ if Opt'Length > 2 and then
+ Opt (Opt'First .. Opt'First + 1) = "-l"
+ then
+ if Index < Last_Opt then
+ Opts (Index .. Last_Opt - 1) :=
+ Opts (Index + 1 .. Last_Opt);
+ end if;
+
+ Last_Opt := Last_Opt - 1;
+
+ Last_Opt2 := Last_Opt2 + 1;
+ Opts2 (Last_Opt2) := Opt;
+
+ else
+ Index := Index + 1;
+ end if;
+ end loop;
+ end;
+
+ -- Invoke gcc to build the library
+
+ Utl.Gcc
+ (Output_File => Lib_File,
+ Objects => Ofiles & Additional_Objects.all,
+ Options => VMS_Options,
+ Options_2 => Shared_Libgcc_Switch &
+ Opts (Opts'First .. Last_Opt) &
+ Opts2 (Opts2'First .. Last_Opt2),
+ Driver_Name => Driver_Name);
+
+ -- The auto-init object file need to be deleted, so that it will not
+ -- be included in the library as a regular object file, otherwise
+ -- it will be included twice when the library will be built next
+ -- time, which may lead to errors.
+
+ if Auto_Init then
+ declare
+ Auto_Init_Object_File_Name : constant String :=
+ Lib_Filename & "__init.obj";
+
+ Disregard : Boolean;
+ pragma Warnings (Off, Disregard);
+
+ begin
+ if Verbose_Mode then
+ Write_Str ("deleting auto-init object file """);
+ Write_Str (Auto_Init_Object_File_Name);
+ Write_Line ("""");
+ end if;
+
+ Delete_File (Auto_Init_Object_File_Name, Success => Disregard);
+ end;
+ end if;
+ end Build_Dynamic_Library;
+
+-- Package initialization
+
+begin
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . S P E C I F I C --
+-- (VxWorks Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2003-2007, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the VxWorks version of the body
+
+with Sdefault;
+
+package body MLib.Tgt.Specific is
+
+ -----------------------
+ -- Local Subprograms --
+ -----------------------
+
+ function Get_Target_Suffix return String;
+ -- Returns the required suffix for some utilities
+ -- (such as ar and ranlib) that depend on the real target.
+
+ -- Non default subprograms
+
+ function Archive_Builder return String;
+
+ function Archive_Indexer return String;
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ function DLL_Ext return String;
+
+ function Dynamic_Option return String;
+
+ function Library_Major_Minor_Id_Supported return Boolean;
+
+ function PIC_Option return String;
+
+ function Standalone_Library_Auto_Init_Is_Supported return Boolean;
+
+ function Support_For_Libraries return Library_Support;
+
+ ---------------------
+ -- Archive_Builder --
+ ---------------------
+
+ function Archive_Builder return String is
+ begin
+ return "ar" & Get_Target_Suffix;
+ end Archive_Builder;
+
+ ---------------------
+ -- Archive_Indexer --
+ ---------------------
+
+ function Archive_Indexer return String is
+ begin
+ return "ranlib" & Get_Target_Suffix;
+ end Archive_Indexer;
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+ pragma Unreferenced (Ofiles);
+ pragma Unreferenced (Options);
+ pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Lib_Filename);
+ pragma Unreferenced (Lib_Dir);
+ pragma Unreferenced (Symbol_Data);
+ pragma Unreferenced (Driver_Name);
+ pragma Unreferenced (Lib_Version);
+ pragma Unreferenced (Auto_Init);
+
+ begin
+ null;
+ end Build_Dynamic_Library;
+
+ -------------
+ -- DLL_Ext --
+ -------------
+
+ function DLL_Ext return String is
+ begin
+ return "";
+ end DLL_Ext;
+
+ --------------------
+ -- Dynamic_Option --
+ --------------------
+
+ function Dynamic_Option return String is
+ begin
+ return "";
+ end Dynamic_Option;
+
+ -----------------------------
+ -- Get_Target_Suffix --
+ -----------------------------
+
+ function Get_Target_Suffix return String is
+ Target_Name : constant String := Sdefault.Target_Name.all;
+ Index : Positive := Target_Name'First;
+
+ begin
+ while Index < Target_Name'Last
+ and then Target_Name (Index + 1) /= '-'
+ loop
+ Index := Index + 1;
+ end loop;
+
+ if Target_Name (Target_Name'First .. Index) = "m68k" then
+ return "68k";
+ elsif Target_Name (Target_Name'First .. Index) = "mips" then
+ return "mips";
+ elsif Target_Name (Target_Name'First .. Index) = "powerpc" then
+ return "ppc";
+ elsif Target_Name (Target_Name'First .. Index) = "sparc" then
+ return "sparc";
+ elsif Target_Name (Target_Name'First .. Index) = "sparc64" then
+ return "sparc64";
+ elsif Target_Name (Target_Name'First .. Index) = "xscale" then
+ return "arm";
+ elsif Target_Name (Target_Name'First .. Index) = "i586" then
+ return "pentium";
+ else
+ return "";
+ end if;
+ end Get_Target_Suffix;
+
+ --------------------------------------
+ -- Library_Major_Minor_Id_Supported --
+ --------------------------------------
+
+ function Library_Major_Minor_Id_Supported return Boolean is
+ begin
+ return False;
+ end Library_Major_Minor_Id_Supported;
+
+ ----------------
+ -- PIC_Option --
+ ----------------
+
+ function PIC_Option return String is
+ begin
+ return "";
+ end PIC_Option;
+
+ -----------------------------------------------
+ -- Standalone_Library_Auto_Init_Is_Supported --
+ -----------------------------------------------
+
+ function Standalone_Library_Auto_Init_Is_Supported return Boolean is
+ begin
+ return False;
+ end Standalone_Library_Auto_Init_Is_Supported;
+
+ ---------------------------
+ -- Support_For_Libraries --
+ ---------------------------
+
+ function Support_For_Libraries return Library_Support is
+ begin
+ return Static_Only;
+ end Support_For_Libraries;
+
+begin
+ Archive_Builder_Ptr := Archive_Builder'Access;
+ Archive_Indexer_Ptr := Archive_Indexer'Access;
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+ DLL_Ext_Ptr := DLL_Ext'Access;
+ Dynamic_Option_Ptr := Dynamic_Option'Access;
+ PIC_Option_Ptr := PIC_Option'Access;
+ Library_Major_Minor_Id_Supported_Ptr :=
+ Library_Major_Minor_Id_Supported'Access;
+ Standalone_Library_Auto_Init_Is_Supported_Ptr :=
+ Standalone_Library_Auto_Init_Is_Supported'Access;
+ Support_For_Libraries_Ptr := Support_For_Libraries'Access;
+end MLib.Tgt.Specific;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T. S P E C I F I C --
+-- (Bare Board Version) --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2003-2007, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the bare board version of the body
+
+with Sdefault;
+with Types; use Types;
+
+package body MLib.Tgt.Specific is
+
+ -----------------------
+ -- Local Subprograms --
+ -----------------------
+
+ function Get_Target_Prefix return String;
+ -- Returns the required prefix for some utilities
+ -- (such as ar and ranlib) that depend on the real target.
+
+ -- Non default subprograms
+
+ function Archive_Builder return String;
+
+ function Archive_Indexer return String;
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False);
+
+ function DLL_Ext return String;
+
+ function Dynamic_Option return String;
+
+ function Library_Major_Minor_Id_Supported return Boolean;
+
+ function PIC_Option return String;
+
+ function Standalone_Library_Auto_Init_Is_Supported return Boolean;
+
+ function Support_For_Libraries return Library_Support;
+
+ ---------------------
+ -- Archive_Builder --
+ ---------------------
+
+ function Archive_Builder return String is
+ begin
+ return Get_Target_Prefix & "ar";
+ end Archive_Builder;
+
+ ---------------------
+ -- Archive_Indexer --
+ ---------------------
+
+ function Archive_Indexer return String is
+ begin
+ return Get_Target_Prefix & "ranlib";
+ end Archive_Indexer;
+
+ ---------------------------
+ -- Build_Dynamic_Library --
+ ---------------------------
+
+ procedure Build_Dynamic_Library
+ (Ofiles : Argument_List;
+ Options : Argument_List;
+ Interfaces : Argument_List;
+ Lib_Filename : String;
+ Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
+ Driver_Name : Name_Id := No_Name;
+ Lib_Version : String := "";
+ Auto_Init : Boolean := False)
+ is
+ pragma Unreferenced (Ofiles);
+ pragma Unreferenced (Options);
+ pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Lib_Filename);
+ pragma Unreferenced (Lib_Dir);
+ pragma Unreferenced (Symbol_Data);
+ pragma Unreferenced (Driver_Name);
+ pragma Unreferenced (Lib_Version);
+ pragma Unreferenced (Auto_Init);
+
+ begin
+ null;
+ end Build_Dynamic_Library;
+
+ -------------
+ -- DLL_Ext --
+ -------------
+
+ function DLL_Ext return String is
+ begin
+ return "";
+ end DLL_Ext;
+
+ --------------------
+ -- Dynamic_Option --
+ --------------------
+
+ function Dynamic_Option return String is
+ begin
+ return "";
+ end Dynamic_Option;
+
+ -----------------------
+ -- Get_Target_Prefix --
+ -----------------------
+
+ function Get_Target_Prefix return String is
+ Target_Name : constant String_Ptr := Sdefault.Target_Name;
+ Index : Positive := Target_Name'First;
+
+ begin
+ while Index < Target_Name'Last
+ and then Target_Name (Index + 1) /= '-'
+ loop
+ Index := Index + 1;
+ end loop;
+
+ if Target_Name (Target_Name'First .. Index) = "erc32" then
+ return "erc32-elf-";
+ elsif Target_Name (Target_Name'First .. Index) = "leon" then
+ return "leon-elf-";
+ elsif Target_Name (Target_Name'First .. Index) = "powerpc" then
+ return "powerpc-elf-";
+ else
+ return "";
+ end if;
+ end Get_Target_Prefix;
+
+ --------------------------------------
+ -- Library_Major_Minor_Id_Supported --
+ --------------------------------------
+
+ function Library_Major_Minor_Id_Supported return Boolean is
+ begin
+ return False;
+ end Library_Major_Minor_Id_Supported;
+
+ ----------------
+ -- PIC_Option --
+ ----------------
+
+ function PIC_Option return String is
+ begin
+ return "";
+ end PIC_Option;
+
+ -----------------------------------------------
+ -- Standalone_Library_Auto_Init_Is_Supported --
+ -----------------------------------------------
+
+ function Standalone_Library_Auto_Init_Is_Supported return Boolean is
+ begin
+ return False;
+ end Standalone_Library_Auto_Init_Is_Supported;
+
+ ---------------------------
+ -- Support_For_Libraries --
+ ---------------------------
+
+ function Support_For_Libraries return Library_Support is
+ begin
+ return Static_Only;
+ end Support_For_Libraries;
+
+begin
+ Archive_Builder_Ptr := Archive_Builder'Access;
+ Archive_Indexer_Ptr := Archive_Indexer'Access;
+ Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
+ DLL_Ext_Ptr := DLL_Ext'Access;
+ Dynamic_Option_Ptr := Dynamic_Option'Access;
+ Library_Major_Minor_Id_Supported_Ptr :=
+ Library_Major_Minor_Id_Supported'Access;
+ PIC_Option_Ptr := PIC_Option'Access;
+ Standalone_Library_Auto_Init_Is_Supported_Ptr :=
+ Standalone_Library_Auto_Init_Is_Supported'Access;
+ Support_For_Libraries_Ptr := Support_For_Libraries'Access;
+end MLib.Tgt.Specific;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (Tru64 Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2002-2007, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the Tru64 version of the body
-
-with MLib.Fil;
-with MLib.Utl;
-with Opt;
-with Output; use Output;
-
-package body MLib.Tgt.Specific is
-
- use MLib;
-
- -- Non default subprogram
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- function Is_Archive_Ext (Ext : String) return Boolean;
-
- function PIC_Option return String;
-
- -- Local variables
-
- Expect_Unresolved : aliased String := "-Wl,-expect_unresolved,*";
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
- pragma Unreferenced (Interfaces);
- pragma Unreferenced (Symbol_Data);
- pragma Unreferenced (Auto_Init);
- -- Initialization is done through the constructor mechanism
-
- Lib_File : constant String :=
- "lib" & Fil.Append_To (Lib_Filename, DLL_Ext);
-
- Lib_Path : constant String :=
- Lib_Dir & Directory_Separator & Lib_File;
-
- Version_Arg : String_Access;
- Symbolic_Link_Needed : Boolean := False;
-
- begin
- if Opt.Verbose_Mode then
- Write_Str ("building relocatable shared library ");
- Write_Line (Lib_Path);
- end if;
-
- -- If specified, add automatic elaboration/finalization
-
- if Lib_Version = "" then
- Utl.Gcc
- (Output_File => Lib_Path,
- Objects => Ofiles,
- Options => Options & Expect_Unresolved'Access,
- Options_2 => No_Argument_List,
- Driver_Name => Driver_Name);
-
- else
- declare
- Maj_Version : constant String :=
- Major_Id_Name (Lib_File, Lib_Version);
- begin
- if Maj_Version'Length /= 0 then
- Version_Arg := new String'("-Wl,-soname," & Maj_Version);
-
- else
- Version_Arg := new String'("-Wl,-soname," & Lib_Version);
- end if;
-
- if Is_Absolute_Path (Lib_Version) then
- Utl.Gcc
- (Output_File => Lib_Version,
- Objects => Ofiles,
- Options =>
- Options & Version_Arg & Expect_Unresolved'Access,
- Options_2 => No_Argument_List,
- Driver_Name => Driver_Name);
- Symbolic_Link_Needed := Lib_Version /= Lib_Path;
-
- else
- Utl.Gcc
- (Output_File => Lib_Dir & Directory_Separator & Lib_Version,
- Objects => Ofiles,
- Options =>
- Options & Version_Arg & Expect_Unresolved'Access,
- Options_2 => No_Argument_List,
- Driver_Name => Driver_Name);
- Symbolic_Link_Needed :=
- Lib_Dir & Directory_Separator & Lib_Version /= Lib_Path;
- end if;
-
- if Symbolic_Link_Needed then
- Create_Sym_Links
- (Lib_Path, Lib_Version, Lib_Dir, Maj_Version);
- end if;
- end;
- end if;
- end Build_Dynamic_Library;
-
- --------------------
- -- Is_Archive_Ext --
- --------------------
-
- function Is_Archive_Ext (Ext : String) return Boolean is
- begin
- return Ext = ".a" or else Ext = ".so";
- end Is_Archive_Ext;
-
- ----------------
- -- PIC_Option --
- ----------------
-
- function PIC_Option return String is
- begin
- return "";
- end PIC_Option;
-
-begin
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
- Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
- PIC_Option_Ptr := PIC_Option'Access;
-end MLib.Tgt.Specific;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (Alpha VMS Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2003-2007, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the Alpha VMS version of the body
-
-with Ada.Characters.Handling; use Ada.Characters.Handling;
-
-with MLib.Fil;
-with MLib.Utl;
-
-with MLib.Tgt.VMS;
-pragma Warnings (Off, MLib.Tgt.VMS);
--- MLib.Tgt.VMS is with'ed only for elaboration purposes
-
-with Opt; use Opt;
-with Output; use Output;
-
-with GNAT.Directory_Operations; use GNAT.Directory_Operations;
-
-with System; use System;
-with System.Case_Util; use System.Case_Util;
-with System.CRTL; use System.CRTL;
-
-package body MLib.Tgt.Specific is
-
- -- Non default subprogram. See comment in mlib-tgt.ads.
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- -- Local variables
-
- Empty_Argument_List : aliased Argument_List := (1 .. 0 => null);
- Additional_Objects : Argument_List_Access := Empty_Argument_List'Access;
- -- Used to add the generated auto-init object files for auto-initializing
- -- stand-alone libraries.
-
- Macro_Name : constant String := "mcr gnu:[bin]gcc -c -x assembler";
- -- The name of the command to invoke the macro-assembler
-
- VMS_Options : Argument_List := (1 .. 1 => null);
-
- Gnatsym_Name : constant String := "gnatsym";
-
- Gnatsym_Path : String_Access;
-
- Arguments : Argument_List_Access := null;
- Last_Argument : Natural := 0;
-
- Success : Boolean := False;
-
- Shared_Libgcc : aliased String := "-shared-libgcc";
-
- Shared_Libgcc_Switch : constant Argument_List :=
- (1 => Shared_Libgcc'Access);
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
-
- Lib_File : constant String :=
- Lib_Dir & Directory_Separator & "lib" &
- Fil.Ext_To (Lib_Filename, DLL_Ext);
-
- Opts : Argument_List := Options;
- Last_Opt : Natural := Opts'Last;
- Opts2 : Argument_List (Options'Range);
- Last_Opt2 : Natural := Opts2'First - 1;
-
- Inter : constant Argument_List := Interfaces;
-
- function Is_Interface (Obj_File : String) return Boolean;
- -- For a Stand-Alone Library, returns True if Obj_File is the object
- -- file name of an interface of the SAL. For other libraries, always
- -- return True.
-
- function Option_File_Name return String;
- -- Returns Symbol_File, if not empty. Otherwise, returns "symvec.opt"
-
- function Version_String return String;
- -- Returns Lib_Version if not empty and if Symbol_Data.Symbol_Policy is
- -- not Autonomous, otherwise returns "". When Symbol_Data.Symbol_Policy
- -- is Autonomous, fails gnatmake if Lib_Version is not the image of a
- -- positive number.
-
- ------------------
- -- Is_Interface --
- ------------------
-
- function Is_Interface (Obj_File : String) return Boolean is
- ALI : constant String :=
- Fil.Ext_To
- (Filename => To_Lower (Base_Name (Obj_File)),
- New_Ext => "ali");
-
- begin
- if Inter'Length = 0 then
- return True;
-
- elsif ALI'Length > 2 and then
- ALI (ALI'First .. ALI'First + 2) = "b__"
- then
- return True;
-
- else
- for J in Inter'Range loop
- if Inter (J).all = ALI then
- return True;
- end if;
- end loop;
-
- return False;
- end if;
- end Is_Interface;
-
- ----------------------
- -- Option_File_Name --
- ----------------------
-
- function Option_File_Name return String is
- begin
- if Symbol_Data.Symbol_File = No_Path then
- return "symvec.opt";
- else
- Get_Name_String (Symbol_Data.Symbol_File);
- To_Lower (Name_Buffer (1 .. Name_Len));
- return Name_Buffer (1 .. Name_Len);
- end if;
- end Option_File_Name;
-
- --------------------
- -- Version_String --
- --------------------
-
- function Version_String return String is
- Version : Integer := 0;
-
- begin
- if Lib_Version = ""
- or else Symbol_Data.Symbol_Policy /= Autonomous
- then
- return "";
-
- else
- begin
- Version := Integer'Value (Lib_Version);
-
- if Version <= 0 then
- raise Constraint_Error;
- end if;
-
- return Lib_Version;
-
- exception
- when Constraint_Error =>
- Fail ("illegal version """, Lib_Version,
- """ (on VMS version must be a positive number)");
- return "";
- end;
- end if;
- end Version_String;
-
- ---------------------
- -- Local Variables --
- ---------------------
-
- Opt_File_Name : constant String := Option_File_Name;
- Version : constant String := Version_String;
- For_Linker_Opt : String_Access;
-
- -- Start of processing for Build_Dynamic_Library
-
- begin
- -- If option file name does not ends with ".opt", append "/OPTIONS"
- -- to its specification for the VMS linker.
-
- if Opt_File_Name'Length > 4
- and then
- Opt_File_Name (Opt_File_Name'Last - 3 .. Opt_File_Name'Last) = ".opt"
- then
- For_Linker_Opt := new String'("--for-linker=" & Opt_File_Name);
- else
- For_Linker_Opt :=
- new String'("--for-linker=" & Opt_File_Name & "/OPTIONS");
- end if;
-
- VMS_Options (VMS_Options'First) := For_Linker_Opt;
-
- for J in Inter'Range loop
- To_Lower (Inter (J).all);
- end loop;
-
- -- "gnatsym" is necessary for building the option file
-
- if Gnatsym_Path = null then
- Gnatsym_Path := Locate_Exec_On_Path (Gnatsym_Name);
-
- if Gnatsym_Path = null then
- Fail (Gnatsym_Name, " not found in path");
- end if;
- end if;
-
- -- For auto-initialization of a stand-alone library, we create
- -- a macro-assembly file and we invoke the macro-assembler.
-
- if Auto_Init then
- declare
- Macro_File_Name : constant String := Lib_Filename & "__init.asm";
- Macro_File : File_Descriptor;
- Init_Proc : String := Lib_Filename & "INIT";
- Popen_Result : System.Address;
- Pclose_Result : Integer;
- Len : Natural;
- OK : Boolean := True;
-
- command : constant String :=
- Macro_Name & " " & Macro_File_Name & ASCII.NUL;
- -- The command to invoke the assembler on the generated auto-init
- -- assembly file.
-
- mode : constant String := "r" & ASCII.NUL;
- -- The mode for the invocation of Popen
-
- begin
- To_Upper (Init_Proc);
-
- if Verbose_Mode then
- Write_Str ("Creating auto-init assembly file """);
- Write_Str (Macro_File_Name);
- Write_Line ("""");
- end if;
-
- -- Create and write the auto-init assembly file
-
- declare
- First_Line : constant String :=
- ASCII.HT & ".section LIB$INITIALIZE,GBL,NOWRT" &
- ASCII.LF;
- Second_Line : constant String :=
- ASCII.HT & ".long " & Init_Proc & ASCII.LF;
- -- First and second lines of the auto-init assembly file
-
- begin
- Macro_File := Create_File (Macro_File_Name, Text);
- OK := Macro_File /= Invalid_FD;
-
- if OK then
- Len := Write
- (Macro_File, First_Line (First_Line'First)'Address,
- First_Line'Length);
- OK := Len = First_Line'Length;
- end if;
-
- if OK then
- Len := Write
- (Macro_File, Second_Line (Second_Line'First)'Address,
- Second_Line'Length);
- OK := Len = Second_Line'Length;
- end if;
-
- if OK then
- Close (Macro_File, OK);
- end if;
-
- if not OK then
- Fail ("creation of auto-init assembly file """,
- Macro_File_Name, """ failed");
- end if;
- end;
-
- -- Invoke the macro-assembler
-
- if Verbose_Mode then
- Write_Str ("Assembling auto-init assembly file """);
- Write_Str (Macro_File_Name);
- Write_Line ("""");
- end if;
-
- Popen_Result := popen (command (command'First)'Address,
- mode (mode'First)'Address);
-
- if Popen_Result = Null_Address then
- Fail ("assembly of auto-init assembly file """,
- Macro_File_Name, """ failed");
- end if;
-
- -- Wait for the end of execution of the macro-assembler
-
- Pclose_Result := pclose (Popen_Result);
-
- if Pclose_Result < 0 then
- Fail ("assembly of auto init assembly file """,
- Macro_File_Name, """ failed");
- end if;
-
- -- Add the generated object file to the list of objects to be
- -- included in the library.
-
- Additional_Objects :=
- new Argument_List'
- (1 => new String'(Lib_Filename & "__init.obj"));
- end;
- end if;
-
- -- Allocate the argument list and put the symbol file name, the
- -- reference (if any) and the policy (if not autonomous).
-
- Arguments := new Argument_List (1 .. Ofiles'Length + 8);
-
- Last_Argument := 0;
-
- -- Verbosity
-
- if Verbose_Mode then
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-v");
- end if;
-
- -- Version number (major ID)
-
- if Lib_Version /= "" then
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-V");
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'(Version);
- end if;
-
- -- Symbol file
-
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-s");
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'(Opt_File_Name);
-
- -- Reference Symbol File
-
- if Symbol_Data.Reference /= No_Path then
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-r");
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) :=
- new String'(Get_Name_String (Symbol_Data.Reference));
- end if;
-
- -- Policy
-
- case Symbol_Data.Symbol_Policy is
- when Autonomous =>
- null;
-
- when Compliant =>
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-c");
-
- when Controlled =>
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-C");
-
- when Restricted =>
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-R");
-
- when Direct =>
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-D");
-
- end case;
-
- -- Add each relevant object file
-
- for Index in Ofiles'Range loop
- if Is_Interface (Ofiles (Index).all) then
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'(Ofiles (Index).all);
- end if;
- end loop;
-
- -- Spawn gnatsym
-
- Spawn (Program_Name => Gnatsym_Path.all,
- Args => Arguments (1 .. Last_Argument),
- Success => Success);
-
- if not Success then
- Fail ("unable to create symbol file for library """,
- Lib_Filename, """");
- end if;
-
- Free (Arguments);
-
- -- Move all the -l switches from Opts to Opts2
-
- declare
- Index : Natural := Opts'First;
- Opt : String_Access;
-
- begin
- while Index <= Last_Opt loop
- Opt := Opts (Index);
-
- if Opt'Length > 2 and then
- Opt (Opt'First .. Opt'First + 1) = "-l"
- then
- if Index < Last_Opt then
- Opts (Index .. Last_Opt - 1) :=
- Opts (Index + 1 .. Last_Opt);
- end if;
-
- Last_Opt := Last_Opt - 1;
-
- Last_Opt2 := Last_Opt2 + 1;
- Opts2 (Last_Opt2) := Opt;
-
- else
- Index := Index + 1;
- end if;
- end loop;
- end;
-
- -- Invoke gcc to build the library
-
- Utl.Gcc
- (Output_File => Lib_File,
- Objects => Ofiles & Additional_Objects.all,
- Options => VMS_Options,
- Options_2 => Shared_Libgcc_Switch &
- Opts (Opts'First .. Last_Opt) &
- Opts2 (Opts2'First .. Last_Opt2),
- Driver_Name => Driver_Name);
-
- -- The auto-init object file need to be deleted, so that it will not
- -- be included in the library as a regular object file, otherwise
- -- it will be included twice when the library will be built next
- -- time, which may lead to errors.
-
- if Auto_Init then
- declare
- Auto_Init_Object_File_Name : constant String :=
- Lib_Filename & "__init.obj";
- Disregard : Boolean;
-
- begin
- if Verbose_Mode then
- Write_Str ("deleting auto-init object file """);
- Write_Str (Auto_Init_Object_File_Name);
- Write_Line ("""");
- end if;
-
- Delete_File (Auto_Init_Object_File_Name, Success => Disregard);
- end;
- end if;
- end Build_Dynamic_Library;
-
--- Package initialization
-
-begin
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
-end MLib.Tgt.Specific;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (Integrity VMS Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the Integrity VMS version of the body
-
-with Ada.Characters.Handling; use Ada.Characters.Handling;
-
-with MLib.Fil;
-with MLib.Utl;
-
-with MLib.Tgt.VMS;
-pragma Warnings (Off, MLib.Tgt.VMS);
--- MLib.Tgt.VMS is with'ed only for elaboration purposes
-
-with Opt; use Opt;
-with Output; use Output;
-
-with GNAT.Directory_Operations; use GNAT.Directory_Operations;
-
-with System; use System;
-with System.Case_Util; use System.Case_Util;
-with System.CRTL; use System.CRTL;
-
-package body MLib.Tgt.Specific is
-
- -- Non default subprogram. See comment in mlib-tgt.ads.
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- -- Local variables
-
- Empty_Argument_List : aliased Argument_List := (1 .. 0 => null);
- Additional_Objects : Argument_List_Access := Empty_Argument_List'Access;
- -- Used to add the generated auto-init object files for auto-initializing
- -- stand-alone libraries.
-
- Macro_Name : constant String := "mcr gnu:[bin]gcc -c -x assembler";
- -- The name of the command to invoke the macro-assembler
-
- VMS_Options : Argument_List := (1 .. 1 => null);
-
- Gnatsym_Name : constant String := "gnatsym";
-
- Gnatsym_Path : String_Access;
-
- Arguments : Argument_List_Access := null;
- Last_Argument : Natural := 0;
-
- Success : Boolean := False;
-
- Shared_Libgcc : aliased String := "-shared-libgcc";
-
- Shared_Libgcc_Switch : constant Argument_List :=
- (1 => Shared_Libgcc'Access);
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
-
- Lib_File : constant String :=
- Lib_Dir & Directory_Separator & "lib" &
- Fil.Ext_To (Lib_Filename, DLL_Ext);
-
- Opts : Argument_List := Options;
- Last_Opt : Natural := Opts'Last;
- Opts2 : Argument_List (Options'Range);
- Last_Opt2 : Natural := Opts2'First - 1;
-
- Inter : constant Argument_List := Interfaces;
-
- function Is_Interface (Obj_File : String) return Boolean;
- -- For a Stand-Alone Library, returns True if Obj_File is the object
- -- file name of an interface of the SAL. For other libraries, always
- -- return True.
-
- function Option_File_Name return String;
- -- Returns Symbol_File, if not empty. Otherwise, returns "symvec.opt"
-
- function Version_String return String;
- -- Returns Lib_Version if not empty and if Symbol_Data.Symbol_Policy is
- -- not Autonomous, otherwise returns "". When Symbol_Data.Symbol_Policy
- -- is Autonomous, fails gnatmake if Lib_Version is not the image of a
- -- positive number.
-
- ------------------
- -- Is_Interface --
- ------------------
-
- function Is_Interface (Obj_File : String) return Boolean is
- ALI : constant String :=
- Fil.Ext_To
- (Filename => To_Lower (Base_Name (Obj_File)),
- New_Ext => "ali");
-
- begin
- if Inter'Length = 0 then
- return True;
-
- elsif ALI'Length > 2 and then
- ALI (ALI'First .. ALI'First + 2) = "b__"
- then
- return True;
-
- else
- for J in Inter'Range loop
- if Inter (J).all = ALI then
- return True;
- end if;
- end loop;
-
- return False;
- end if;
- end Is_Interface;
-
- ----------------------
- -- Option_File_Name --
- ----------------------
-
- function Option_File_Name return String is
- begin
- if Symbol_Data.Symbol_File = No_Path then
- return "symvec.opt";
- else
- Get_Name_String (Symbol_Data.Symbol_File);
- To_Lower (Name_Buffer (1 .. Name_Len));
- return Name_Buffer (1 .. Name_Len);
- end if;
- end Option_File_Name;
-
- --------------------
- -- Version_String --
- --------------------
-
- function Version_String return String is
- Version : Integer := 0;
- begin
- if Lib_Version = ""
- or else Symbol_Data.Symbol_Policy /= Autonomous
- then
- return "";
-
- else
- begin
- Version := Integer'Value (Lib_Version);
-
- if Version <= 0 then
- raise Constraint_Error;
- end if;
-
- return Lib_Version;
-
- exception
- when Constraint_Error =>
- Fail ("illegal version """, Lib_Version,
- """ (on VMS version must be a positive number)");
- return "";
- end;
- end if;
- end Version_String;
-
- ---------------------
- -- Local Variables --
- ---------------------
-
- Opt_File_Name : constant String := Option_File_Name;
- Version : constant String := Version_String;
- For_Linker_Opt : String_Access;
-
- -- Start of processing for Build_Dynamic_Library
-
- begin
- -- Option file must end with ".opt"
-
- if Opt_File_Name'Length > 4
- and then
- Opt_File_Name (Opt_File_Name'Last - 3 .. Opt_File_Name'Last) = ".opt"
- then
- For_Linker_Opt := new String'("--for-linker=" & Opt_File_Name);
- else
- Fail ("Options File """, Opt_File_Name, """ must end with .opt");
- end if;
-
- VMS_Options (VMS_Options'First) := For_Linker_Opt;
-
- for J in Inter'Range loop
- To_Lower (Inter (J).all);
- end loop;
-
- -- "gnatsym" is necessary for building the option file
-
- if Gnatsym_Path = null then
- Gnatsym_Path := Locate_Exec_On_Path (Gnatsym_Name);
-
- if Gnatsym_Path = null then
- Fail (Gnatsym_Name, " not found in path");
- end if;
- end if;
-
- -- For auto-initialization of a stand-alone library, we create
- -- a macro-assembly file and we invoke the macro-assembler.
-
- if Auto_Init then
- declare
- Macro_File_Name : constant String := Lib_Filename & "__init.asm";
- Macro_File : File_Descriptor;
- Init_Proc : String := Lib_Filename & "INIT";
- Popen_Result : System.Address;
- Pclose_Result : Integer;
- Len : Natural;
- OK : Boolean := True;
-
- command : constant String :=
- Macro_Name & " " & Macro_File_Name & ASCII.NUL;
- -- The command to invoke the assembler on the generated auto-init
- -- assembly file.
- -- Why odd lower case name ???
-
- mode : constant String := "r" & ASCII.NUL;
- -- The mode for the invocation of Popen
- -- Why odd lower case name ???
-
- begin
- To_Upper (Init_Proc);
-
- if Verbose_Mode then
- Write_Str ("Creating auto-init assembly file """);
- Write_Str (Macro_File_Name);
- Write_Line ("""");
- end if;
-
- -- Create and write the auto-init assembly file
-
- declare
- First_Line : constant String :=
- ASCII.HT
- & ".type " & Init_Proc & "#, @function"
- & ASCII.LF;
- Second_Line : constant String :=
- ASCII.HT
- & ".global " & Init_Proc & "#"
- & ASCII.LF;
- Third_Line : constant String :=
- ASCII.HT
- & ".global LIB$INITIALIZE#"
- & ASCII.LF;
- Fourth_Line : constant String :=
- ASCII.HT
- & ".section LIB$INITIALIZE#,""a"",@progbits"
- & ASCII.LF;
- Fifth_Line : constant String :=
- ASCII.HT
- & "data4 @fptr(" & Init_Proc & "#)"
- & ASCII.LF;
-
- begin
- Macro_File := Create_File (Macro_File_Name, Text);
- OK := Macro_File /= Invalid_FD;
-
- if OK then
- Len := Write
- (Macro_File, First_Line (First_Line'First)'Address,
- First_Line'Length);
- OK := Len = First_Line'Length;
- end if;
-
- if OK then
- Len := Write
- (Macro_File, Second_Line (Second_Line'First)'Address,
- Second_Line'Length);
- OK := Len = Second_Line'Length;
- end if;
-
- if OK then
- Len := Write
- (Macro_File, Third_Line (Third_Line'First)'Address,
- Third_Line'Length);
- OK := Len = Third_Line'Length;
- end if;
-
- if OK then
- Len := Write
- (Macro_File, Fourth_Line (Fourth_Line'First)'Address,
- Fourth_Line'Length);
- OK := Len = Fourth_Line'Length;
- end if;
-
- if OK then
- Len := Write
- (Macro_File, Fifth_Line (Fifth_Line'First)'Address,
- Fifth_Line'Length);
- OK := Len = Fifth_Line'Length;
- end if;
-
- if OK then
- Close (Macro_File, OK);
- end if;
-
- if not OK then
- Fail ("creation of auto-init assembly file """,
- Macro_File_Name, """ failed");
- end if;
- end;
-
- -- Invoke the macro-assembler
-
- if Verbose_Mode then
- Write_Str ("Assembling auto-init assembly file """);
- Write_Str (Macro_File_Name);
- Write_Line ("""");
- end if;
-
- Popen_Result := popen (command (command'First)'Address,
- mode (mode'First)'Address);
-
- if Popen_Result = Null_Address then
- Fail ("assembly of auto-init assembly file """,
- Macro_File_Name, """ failed");
- end if;
-
- -- Wait for the end of execution of the macro-assembler
-
- Pclose_Result := pclose (Popen_Result);
-
- if Pclose_Result < 0 then
- Fail ("assembly of auto init assembly file """,
- Macro_File_Name, """ failed");
- end if;
-
- -- Add the generated object file to the list of objects to be
- -- included in the library.
-
- Additional_Objects :=
- new Argument_List'
- (1 => new String'(Lib_Filename & "__init.obj"));
- end;
- end if;
-
- -- Allocate the argument list and put the symbol file name, the
- -- reference (if any) and the policy (if not autonomous).
-
- Arguments := new Argument_List (1 .. Ofiles'Length + 8);
-
- Last_Argument := 0;
-
- -- Verbosity
-
- if Verbose_Mode then
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-v");
- end if;
-
- -- Version number (major ID)
-
- if Lib_Version /= "" then
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-V");
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'(Version);
- end if;
-
- -- Symbol file
-
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-s");
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'(Opt_File_Name);
-
- -- Reference Symbol File
-
- if Symbol_Data.Reference /= No_Path then
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-r");
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) :=
- new String'(Get_Name_String (Symbol_Data.Reference));
- end if;
-
- -- Policy
-
- case Symbol_Data.Symbol_Policy is
- when Autonomous =>
- null;
-
- when Compliant =>
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-c");
-
- when Controlled =>
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-C");
-
- when Restricted =>
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-R");
-
- when Direct =>
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'("-D");
- end case;
-
- -- Add each relevant object file
-
- for Index in Ofiles'Range loop
- if Is_Interface (Ofiles (Index).all) then
- Last_Argument := Last_Argument + 1;
- Arguments (Last_Argument) := new String'(Ofiles (Index).all);
- end if;
- end loop;
-
- -- Spawn gnatsym
-
- Spawn (Program_Name => Gnatsym_Path.all,
- Args => Arguments (1 .. Last_Argument),
- Success => Success);
-
- if not Success then
- Fail ("unable to create symbol file for library """,
- Lib_Filename, """");
- end if;
-
- Free (Arguments);
-
- -- Move all the -l switches from Opts to Opts2
-
- declare
- Index : Natural := Opts'First;
- Opt : String_Access;
-
- begin
- while Index <= Last_Opt loop
- Opt := Opts (Index);
-
- if Opt'Length > 2 and then
- Opt (Opt'First .. Opt'First + 1) = "-l"
- then
- if Index < Last_Opt then
- Opts (Index .. Last_Opt - 1) :=
- Opts (Index + 1 .. Last_Opt);
- end if;
-
- Last_Opt := Last_Opt - 1;
-
- Last_Opt2 := Last_Opt2 + 1;
- Opts2 (Last_Opt2) := Opt;
-
- else
- Index := Index + 1;
- end if;
- end loop;
- end;
-
- -- Invoke gcc to build the library
-
- Utl.Gcc
- (Output_File => Lib_File,
- Objects => Ofiles & Additional_Objects.all,
- Options => VMS_Options,
- Options_2 => Shared_Libgcc_Switch &
- Opts (Opts'First .. Last_Opt) &
- Opts2 (Opts2'First .. Last_Opt2),
- Driver_Name => Driver_Name);
-
- -- The auto-init object file need to be deleted, so that it will not
- -- be included in the library as a regular object file, otherwise
- -- it will be included twice when the library will be built next
- -- time, which may lead to errors.
-
- if Auto_Init then
- declare
- Auto_Init_Object_File_Name : constant String :=
- Lib_Filename & "__init.obj";
-
- Disregard : Boolean;
- pragma Warnings (Off, Disregard);
-
- begin
- if Verbose_Mode then
- Write_Str ("deleting auto-init object file """);
- Write_Str (Auto_Init_Object_File_Name);
- Write_Line ("""");
- end if;
-
- Delete_File (Auto_Init_Object_File_Name, Success => Disregard);
- end;
- end if;
- end Build_Dynamic_Library;
-
--- Package initialization
-
-begin
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
-end MLib.Tgt.Specific;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . V M S --
--- --
--- B o d y --
--- --
--- Copyright (C) 2003-2007, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the part of MLib.Tgt.Specific common to both VMS versions
-
-package body MLib.Tgt.VMS is
-
- -- Non default subprograms. See comments in mlib-tgt.ads
-
- function Archive_Ext return String;
-
- function Default_Symbol_File_Name return String;
-
- function DLL_Ext return String;
-
- function Is_Object_Ext (Ext : String) return Boolean;
-
- function Is_Archive_Ext (Ext : String) return Boolean;
-
- function Libgnat return String;
-
- function Object_Ext return String;
-
- function Library_Major_Minor_Id_Supported return Boolean;
-
- function PIC_Option return String;
-
- -----------------
- -- Archive_Ext --
- -----------------
-
- function Archive_Ext return String is
- begin
- return "olb";
- end Archive_Ext;
-
- ------------------------------
- -- Default_Symbol_File_Name --
- ------------------------------
-
- function Default_Symbol_File_Name return String is
- begin
- return "symvec.opt";
- end Default_Symbol_File_Name;
-
- -------------
- -- DLL_Ext --
- -------------
-
- function DLL_Ext return String is
- begin
- return "exe";
- end DLL_Ext;
-
- -------------------
- -- Is_Object_Ext --
- -------------------
-
- function Is_Object_Ext (Ext : String) return Boolean is
- begin
- return Ext = ".obj";
- end Is_Object_Ext;
-
- --------------------
- -- Is_Archive_Ext --
- --------------------
-
- function Is_Archive_Ext (Ext : String) return Boolean is
- begin
- return Ext = ".olb" or else Ext = ".exe";
- end Is_Archive_Ext;
-
- -------------
- -- Libgnat --
- -------------
-
- function Libgnat return String is
- Libgnat_A : constant String := "libgnat.a";
- Libgnat_Olb : constant String := "libgnat.olb";
-
- begin
- Name_Len := Libgnat_A'Length;
- Name_Buffer (1 .. Name_Len) := Libgnat_A;
-
- if Osint.Find_File (Name_Enter, Osint.Library) /= No_File then
- return Libgnat_A;
- else
- return Libgnat_Olb;
- end if;
- end Libgnat;
-
- --------------------------------------
- -- Library_Major_Minor_Id_Supported --
- --------------------------------------
-
- function Library_Major_Minor_Id_Supported return Boolean is
- begin
- return False;
- end Library_Major_Minor_Id_Supported;
-
- ----------------
- -- Object_Ext --
- ----------------
-
- function Object_Ext return String is
- begin
- return "obj";
- end Object_Ext;
-
- ----------------
- -- PIC_Option --
- ----------------
-
- function PIC_Option return String is
- begin
- return "";
- end PIC_Option;
-
--- Package initialization
-
-begin
- Archive_Ext_Ptr := Archive_Ext'Access;
- Default_Symbol_File_Name_Ptr := Default_Symbol_File_Name'Access;
- DLL_Ext_Ptr := DLL_Ext'Access;
- Is_Object_Ext_Ptr := Is_Object_Ext'Access;
- Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
- Libgnat_Ptr := Libgnat'Access;
- Object_Ext_Ptr := Object_Ext'Access;
- PIC_Option_Ptr := PIC_Option'Access;
- Library_Major_Minor_Id_Supported_Ptr :=
- Library_Major_Minor_Id_Supported'Access;
-
-end MLib.Tgt.VMS;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . V M S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2007, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the part of MLib.Tgt.Specific common to both VMS versions
-
-package MLib.Tgt.VMS is
- pragma Elaborate_Body;
-end MLib.Tgt.VMS;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . V M S _ C O M M O N --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2003-2008, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the part of MLib.Tgt.Specific common to both VMS versions
+
+package body MLib.Tgt.VMS_Common is
+
+ -- Non default subprograms. See comments in mlib-tgt.ads
+
+ function Archive_Ext return String;
+
+ function Default_Symbol_File_Name return String;
+
+ function DLL_Ext return String;
+
+ function Is_Object_Ext (Ext : String) return Boolean;
+
+ function Is_Archive_Ext (Ext : String) return Boolean;
+
+ function Libgnat return String;
+
+ function Object_Ext return String;
+
+ function Library_Major_Minor_Id_Supported return Boolean;
+
+ function PIC_Option return String;
+
+ -----------------
+ -- Archive_Ext --
+ -----------------
+
+ function Archive_Ext return String is
+ begin
+ return "olb";
+ end Archive_Ext;
+
+ ------------------------------
+ -- Default_Symbol_File_Name --
+ ------------------------------
+
+ function Default_Symbol_File_Name return String is
+ begin
+ return "symvec.opt";
+ end Default_Symbol_File_Name;
+
+ -------------
+ -- DLL_Ext --
+ -------------
+
+ function DLL_Ext return String is
+ begin
+ return "exe";
+ end DLL_Ext;
+
+ -------------------
+ -- Is_Object_Ext --
+ -------------------
+
+ function Is_Object_Ext (Ext : String) return Boolean is
+ begin
+ return Ext = ".obj";
+ end Is_Object_Ext;
+
+ --------------------
+ -- Is_Archive_Ext --
+ --------------------
+
+ function Is_Archive_Ext (Ext : String) return Boolean is
+ begin
+ return Ext = ".olb" or else Ext = ".exe";
+ end Is_Archive_Ext;
+
+ -------------
+ -- Libgnat --
+ -------------
+
+ function Libgnat return String is
+ Libgnat_A : constant String := "libgnat.a";
+ Libgnat_Olb : constant String := "libgnat.olb";
+
+ begin
+ Name_Len := Libgnat_A'Length;
+ Name_Buffer (1 .. Name_Len) := Libgnat_A;
+
+ if Osint.Find_File (Name_Enter, Osint.Library) /= No_File then
+ return Libgnat_A;
+ else
+ return Libgnat_Olb;
+ end if;
+ end Libgnat;
+
+ --------------------------------------
+ -- Library_Major_Minor_Id_Supported --
+ --------------------------------------
+
+ function Library_Major_Minor_Id_Supported return Boolean is
+ begin
+ return False;
+ end Library_Major_Minor_Id_Supported;
+
+ ----------------
+ -- Object_Ext --
+ ----------------
+
+ function Object_Ext return String is
+ begin
+ return "obj";
+ end Object_Ext;
+
+ ----------------
+ -- PIC_Option --
+ ----------------
+
+ function PIC_Option return String is
+ begin
+ return "";
+ end PIC_Option;
+
+-- Package initialization
+
+begin
+ Archive_Ext_Ptr := Archive_Ext'Access;
+ Default_Symbol_File_Name_Ptr := Default_Symbol_File_Name'Access;
+ DLL_Ext_Ptr := DLL_Ext'Access;
+ Is_Object_Ext_Ptr := Is_Object_Ext'Access;
+ Is_Archive_Ext_Ptr := Is_Archive_Ext'Access;
+ Libgnat_Ptr := Libgnat'Access;
+ Object_Ext_Ptr := Object_Ext'Access;
+ PIC_Option_Ptr := PIC_Option'Access;
+ Library_Major_Minor_Id_Supported_Ptr :=
+ Library_Major_Minor_Id_Supported'Access;
+
+end MLib.Tgt.VMS_Common;
--- /dev/null
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- M L I B . T G T . V M S _ C O M M O N --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2007-2008, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the part of MLib.Tgt.Specific common to both VMS versions
+
+package MLib.Tgt.VMS_Common is
+ pragma Elaborate_Body;
+end MLib.Tgt.VMS_Common;
+++ /dev/null
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- M L I B . T G T . S P E C I F I C --
--- (VxWorks Version) --
--- --
--- B o d y --
--- --
--- Copyright (C) 2003-2007, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 3, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING3. If not, go to --
--- http://www.gnu.org/licenses for a complete copy of the license. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the VxWorks version of the body
-
-with Sdefault;
-
-package body MLib.Tgt.Specific is
-
- -----------------------
- -- Local Subprograms --
- -----------------------
-
- function Get_Target_Suffix return String;
- -- Returns the required suffix for some utilities
- -- (such as ar and ranlib) that depend on the real target.
-
- -- Non default subprograms
-
- function Archive_Builder return String;
-
- function Archive_Indexer return String;
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False);
-
- function DLL_Ext return String;
-
- function Dynamic_Option return String;
-
- function Library_Major_Minor_Id_Supported return Boolean;
-
- function PIC_Option return String;
-
- function Standalone_Library_Auto_Init_Is_Supported return Boolean;
-
- function Support_For_Libraries return Library_Support;
-
- ---------------------
- -- Archive_Builder --
- ---------------------
-
- function Archive_Builder return String is
- begin
- return "ar" & Get_Target_Suffix;
- end Archive_Builder;
-
- ---------------------
- -- Archive_Indexer --
- ---------------------
-
- function Archive_Indexer return String is
- begin
- return "ranlib" & Get_Target_Suffix;
- end Archive_Indexer;
-
- ---------------------------
- -- Build_Dynamic_Library --
- ---------------------------
-
- procedure Build_Dynamic_Library
- (Ofiles : Argument_List;
- Options : Argument_List;
- Interfaces : Argument_List;
- Lib_Filename : String;
- Lib_Dir : String;
- Symbol_Data : Symbol_Record;
- Driver_Name : Name_Id := No_Name;
- Lib_Version : String := "";
- Auto_Init : Boolean := False)
- is
- pragma Unreferenced (Ofiles);
- pragma Unreferenced (Options);
- pragma Unreferenced (Interfaces);
- pragma Unreferenced (Lib_Filename);
- pragma Unreferenced (Lib_Dir);
- pragma Unreferenced (Symbol_Data);
- pragma Unreferenced (Driver_Name);
- pragma Unreferenced (Lib_Version);
- pragma Unreferenced (Auto_Init);
-
- begin
- null;
- end Build_Dynamic_Library;
-
- -------------
- -- DLL_Ext --
- -------------
-
- function DLL_Ext return String is
- begin
- return "";
- end DLL_Ext;
-
- --------------------
- -- Dynamic_Option --
- --------------------
-
- function Dynamic_Option return String is
- begin
- return "";
- end Dynamic_Option;
-
- -----------------------------
- -- Get_Target_Suffix --
- -----------------------------
-
- function Get_Target_Suffix return String is
- Target_Name : constant String := Sdefault.Target_Name.all;
- Index : Positive := Target_Name'First;
-
- begin
- while Index < Target_Name'Last
- and then Target_Name (Index + 1) /= '-'
- loop
- Index := Index + 1;
- end loop;
-
- if Target_Name (Target_Name'First .. Index) = "m68k" then
- return "68k";
- elsif Target_Name (Target_Name'First .. Index) = "mips" then
- return "mips";
- elsif Target_Name (Target_Name'First .. Index) = "powerpc" then
- return "ppc";
- elsif Target_Name (Target_Name'First .. Index) = "sparc" then
- return "sparc";
- elsif Target_Name (Target_Name'First .. Index) = "sparc64" then
- return "sparc64";
- elsif Target_Name (Target_Name'First .. Index) = "xscale" then
- return "arm";
- elsif Target_Name (Target_Name'First .. Index) = "i586" then
- return "pentium";
- else
- return "";
- end if;
- end Get_Target_Suffix;
-
- --------------------------------------
- -- Library_Major_Minor_Id_Supported --
- --------------------------------------
-
- function Library_Major_Minor_Id_Supported return Boolean is
- begin
- return False;
- end Library_Major_Minor_Id_Supported;
-
- ----------------
- -- PIC_Option --
- ----------------
-
- function PIC_Option return String is
- begin
- return "";
- end PIC_Option;
-
- -----------------------------------------------
- -- Standalone_Library_Auto_Init_Is_Supported --
- -----------------------------------------------
-
- function Standalone_Library_Auto_Init_Is_Supported return Boolean is
- begin
- return False;
- end Standalone_Library_Auto_Init_Is_Supported;
-
- ---------------------------
- -- Support_For_Libraries --
- ---------------------------
-
- function Support_For_Libraries return Library_Support is
- begin
- return Static_Only;
- end Support_For_Libraries;
-
-begin
- Archive_Builder_Ptr := Archive_Builder'Access;
- Archive_Indexer_Ptr := Archive_Indexer'Access;
- Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access;
- DLL_Ext_Ptr := DLL_Ext'Access;
- Dynamic_Option_Ptr := Dynamic_Option'Access;
- PIC_Option_Ptr := PIC_Option'Access;
- Library_Major_Minor_Id_Supported_Ptr :=
- Library_Major_Minor_Id_Supported'Access;
- Standalone_Library_Auto_Init_Is_Supported_Ptr :=
- Standalone_Library_Auto_Init_Is_Supported'Access;
- Support_For_Libraries_Ptr := Support_For_Libraries'Access;
-end MLib.Tgt.Specific;