[Patch] #1: Change the default search path for GNAT project files
This is the first in a long series of patches which are necessary for
the transition from gnat to gnat-4.1 as the default Ada compiler.
These patches are against the debian directory in
http://svn.debian.org/wsvn/gcccvs
--
Ludovic Brenta.
Index: patches/ada-default-project-path.dpatch
===================================================================
RCS file: patches/ada-default-project-path.dpatch
diff -N patches/ada-default-project-path.dpatch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/ada-default-project-path.dpatch 5 Apr 2006 06:17:44 -0000 1.2
@@ -0,0 +1,101 @@
+#! /bin/sh -e
+
+# DP: - Change the default search path for project files to the one specified
+# DP: by the Debian Policy for Ada: /usr/share/ada/adainclude.
+
+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
+ ;;
+ -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
+
+--- gcc.old/ada/Make-lang.in
++++ gcc/ada/Make-lang.in
+@@ -930,7 +930,7 @@
+ $(ECHO) " S1 : constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb
+ $(ECHO) " S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb
+ $(ECHO) " S3 : constant String := \"$(target)/\";" >>tmp-sdefault.adb
+- $(ECHO) " S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb
++ $(ECHO) " S4 : constant String := \"/usr/share/ada/adainclude/\";" >>tmp-sdefault.adb
+ $(ECHO) " function Include_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb
+ $(ECHO) " begin" >>tmp-sdefault.adb
+ $(ECHO) " return Relocate_Path (S0, S1);" >>tmp-sdefault.adb
+--- gcc.old/ada/prj-ext.adb 2005-11-15 15:01:18.000000000 +0100
++++ gcc/ada/prj-ext.adb 2006-03-22 09:09:51.000000000 +0100
+@@ -282,9 +282,7 @@
+ if Add_Default_Dir then
+ Current_Project_Path :=
+ new String'(Name_Buffer (1 .. Name_Len) & Path_Separator &
+- Sdefault.Search_Dir_Prefix.all & ".." &
+- Directory_Separator & ".." & Directory_Separator &
+- ".." & Directory_Separator & "gnat");
++ Sdefault.Search_Dir_Prefix.all);
+ else
+ Current_Project_Path := new String'(Name_Buffer (1 .. Name_Len));
+ end if;
+--- gcc.old/ada/gnatls.adb 2005-07-01 03:29:17.000000000 +0200
++++ gcc/ada/gnatls.adb 2006-03-22 12:19:39.000000000 +0100
+@@ -1547,9 +1547,6 @@
+ declare
+ Project_Path : constant String_Access := Getenv (Ada_Project_Path);
+
+- Lib : constant String :=
+- Directory_Separator & "lib" & Directory_Separator;
+-
+ First : Natural;
+ Last : Natural;
+
+@@ -1605,35 +1602,9 @@
+ if Add_Default_Dir then
+ Name_Len := 0;
+ Add_Str_To_Name_Buffer (Sdefault.Search_Dir_Prefix.all);
+-
+- -- On Windows, make sure that all directory separators are '\'
+-
+- if Directory_Separator /= '/' then
+- for J in 1 .. Name_Len loop
+- if Name_Buffer (J) = '/' then
+- Name_Buffer (J) := Directory_Separator;
+- end if;
+- end loop;
+- end if;
+-
+- -- Find the sequence "/lib/"
+-
+- while Name_Len >= Lib'Length
+- and then Name_Buffer (Name_Len - 4 .. Name_Len) /= Lib
+- loop
+- Name_Len := Name_Len - 1;
+- end loop;
+-
+- -- If the sequence "/lib"/ was found, display the default
+- -- directory <prefix>/lib/gnat/.
+-
+- if Name_Len >= 5 then
+- Write_Str (" ");
+- Write_Str (Name_Buffer (1 .. Name_Len));
+- Write_Str ("gnat");
+- Write_Char (Directory_Separator);
+- Write_Eol;
+- end if;
++ Write_Str (" ");
++ Write_Str (Name_Buffer (1 .. Name_Len));
++ Write_Eol;
+ end if;
+ end;
+
Index: rules.patch
===================================================================
RCS file: /var/lib/cvs/gcc-debian/F-590C83D3C4DDFAAC5F6B64349CB06DF2.patch,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 rules.patch
--- rules.patch 1 Apr 2006 14:06:00 -0000 1.1.2.3
+++ rules.patch 8 Apr 2006 13:12:55 -0000
@@ -63,10 +63,10 @@
endif
ifeq ($(with_ada),yes)
+ debian_patches += ada-gcc-name ada-default-project-path #ada-names
ifeq ($(with_libgnat),yes)
debian_patches += ada-link-lib
endif
- debian_patches += ada-gcc-name #ada-names
ifeq ($(DEB_TARGET_ARCH)-$(distribution),ia64-Debian)
debian_patches += ignore-comp-fail
endif
Reply to: