#! /bin/sh -e # DP: - Install the shared Ada libraries as '.so.1', not '.so' to conform # DP: to the Debian policy. # DP: - Don't include a runtime link path (-rpath), when linking binaries. # DP: - Build the shared libraries on hppa-linux. # DP: - Instead of building libada as a target library only, build it as # DP: both a host and, if different, target library. # DP: - Build the GNAT tools in their top-level directory; do not use # DP: recursive makefiles. # DP: - Link the GNAT tools dynamically. # DP: - Fix a bug in src/gnattools/configure.ac whereby a nonexistent version # DP: of indepsw's body was selected. Regenerate configure. (PR ada/27300) # This patch seems large, but the hunks in Makefile.in are actually # generated from Makefile.def using autogen. dir=./ if [ $# -eq 3 -a "$2" = '-d' ]; then pdir="-d $3" dir="$3/" elif [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 fi case "$1" in -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0 cd ${dir} && autoconf ;; -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 ;; *) echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 esac exit 0 Index: gcc/ada/config-lang.in =================================================================== --- gcc/ada/config-lang.in.orig 2007-09-03 15:14:47.000000000 +0200 +++ gcc/ada/config-lang.in 2008-01-29 12:16:44.688811730 +0100 @@ -35,7 +35,7 @@ outputs=ada/Makefile target_libs="target-libada" -lang_dirs="gnattools" +lang_dirs="libada gnattools" # Ada will not work until the front end starts emitting GIMPLE trees. build_by_default=no Index: gcc/ada/link.c =================================================================== --- gcc/ada/link.c.orig 2007-11-21 12:20:42.000000000 +0100 +++ gcc/ada/link.c 2008-01-29 12:16:44.688811730 +0100 @@ -146,8 +146,8 @@ #elif defined (__FreeBSD__) const char *__gnat_object_file_option = ""; -const char *__gnat_run_path_option = "-Wl,-rpath,"; -char __gnat_shared_libgnat_default = STATIC; +char *__gnat_run_path_option = ""; +char __gnat_shared_libgnat_default = SHARED; int __gnat_link_max = 8192; unsigned char __gnat_objlist_file_supported = 1; unsigned char __gnat_using_gnu_linker = 1; @@ -155,8 +155,8 @@ #elif defined (linux) const char *__gnat_object_file_option = ""; -const char *__gnat_run_path_option = "-Wl,-rpath,"; -char __gnat_shared_libgnat_default = STATIC; +const char *__gnat_run_path_option = ""; +char __gnat_shared_libgnat_default = SHARED; int __gnat_link_max = 8192; unsigned char __gnat_objlist_file_supported = 1; unsigned char __gnat_using_gnu_linker = 1; Index: gcc/ada/Makefile.in =================================================================== --- gcc/ada/Makefile.in.orig 2008-01-29 12:10:06.222766372 +0100 +++ gcc/ada/Makefile.in 2008-01-29 12:17:55.465175005 +0100 @@ -114,7 +114,7 @@ MAKEINFO = makeinfo TEXI2DVI = texi2dvi TEXI2PDF = texi2pdf -GNATBIND_FLAGS = -static -x +GNATBIND_FLAGS = -shared -x ADA_CFLAGS = ADAFLAGS = -W -Wall -gnatpg -gnata SOME_ADAFLAGS =-gnata @@ -247,7 +247,6 @@ LIBDEPS = $(LIBINTL_DEP) $(LIBIBERTY) # Default is no TGT_LIB; one might be passed down or something TGT_LIB = -TOOLS_LIBS = $(EXTRA_GNATTOOLS_OBJS) targext.o link.o $(LIBGNAT) ../../../libiberty/libiberty.a $(SYSLIBS) $(TGT_LIB) # Specify the directories to be searched for header files. # Both . and srcdir are used, in that order, @@ -293,30 +292,6 @@ # defined in this file into the environment. .NOEXPORT: -# Lists of files for various purposes. - -GNATLINK_OBJS = gnatlink.o \ - a-except.o ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o \ - gnatvsn.o hostparm.o indepsw.o interfac.o i-c.o i-cstrin.o namet.o opt.o \ - osint.o output.o rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \ - sdefault.o snames.o stylesw.o switch.o system.o table.o targparm.o tree_io.o \ - types.o validsw.o widechar.o - -GNATMAKE_OBJS = a-except.o ali.o ali-util.o s-casuti.o \ - alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o\ - erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o \ - gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o \ - make.o makeusg.o makeutl.o mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o \ - mlib-tgt-specific.o mlib-utl.o namet.o nlists.o opt.o osint.o osint-m.o output.o \ - prj.o prj-attr.o prj-attr-pm.o prj-com.o prj-dect.o prj-env.o prj-err.o prj-ext.o prj-nmsc.o \ - prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o \ - rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \ - scans.o scng.o sdefault.o sfn_scan.o s-purexc.o s-htable.o \ - sinfo.o sinput.o sinput-c.o sinput-p.o \ - snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o switch.o switch-m.o \ - table.o targparm.o tempdir.o tree_io.o types.o \ - uintp.o uname.o urealp.o usage.o widechar.o \ - $(EXTRA_GNATMAKE_OBJS) # Convert the target variable into a space separated list of architecture, # manufacturer, and operating system and assign each of those to its own @@ -1017,6 +992,11 @@ GMEM_LIB = gmemlib endif +ifeq ($(strip $(filter-out hppa% unknown linux gnu,$(targ))),) + GNATLIB_SHARED = gnatlib-shared-dual + LIBRARY_VERSION := $(LIB_VERSION) +endif + ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),) LIBGNAT_TARGET_PAIRS = \ a-excpol.adb