dev-ada/gps: Respect CFLAGS and ADAFLAGS
authorTupone Alfredo <tupone@gentoo.org>
Sun, 10 Dec 2017 20:44:43 +0000 (21:44 +0100)
committerTupone Alfredo <tupone@gentoo.org>
Sun, 10 Dec 2017 20:44:43 +0000 (21:44 +0100)
Package-Manager: Portage-2.3.13, Repoman-2.3.3

dev-ada/gps/files/gps-2017-gentoo.patch
dev-ada/gps/gps-2017.ebuild

index e6ff1453189d6a18fae02c7a8064c9bb6cb94581..631e6dc92ef98211af037fb441b86fa516472174 100644 (file)
     ----------------------------
 --- gps-gpl-2017-src/toolchains_editor/core/src/toolchains.adb.old     2017-11-23 22:02:52.819994229 +0100
 +++ gps-gpl-2017-src/toolchains_editor/core/src/toolchains.adb 2017-11-23 22:07:20.326248295 +0100
-@@ -309,12 +309,12 @@
+@@ -309,12 +309,13 @@
                 else
                    Set_Command
                      (Tc, GNAT_Driver,
                    Set_Command
                      (Tc, GNAT_List,
 -                     To_String (Full_Path) & "gnatls",
-+                     To_String (Full_Path) & "@GNATLS@",
++                     To_String (Full_Path) &
++                        "@GNATLS@",
                       From_Default,
                       Is_Default_Path);
                    Set_Command
  
 -      Set_Command (Native_Toolchain, GNAT_Driver, "gnat", From_Default, True);
 -      Set_Command (Native_Toolchain, GNAT_List, "gnatls", From_Default, True);
-+      Set_Command (Native_Toolchain, GNAT_Driver, "@GNAT@", From_Default,
-+         True);
-+      Set_Command (Native_Toolchain, GNAT_List, "@GNATLS@", From_Default,
-+         True);
++      Set_Command (Native_Toolchain, GNAT_Driver,
++         "@GNAT@", From_Default, True);
++      Set_Command (Native_Toolchain, GNAT_List,
++         "@GNATLS@", From_Default, True);
        Set_Command (Native_Toolchain, Debugger, "gdb", From_Default, True);
        Set_Command (Native_Toolchain, CPP_Filt, "c++filt", From_Default, True);
  
  
        if Get_Compiler (Native_Toolchain, "Ada") = No_Compiler then
 -         Add_Compiler (Native_Toolchain, "Ada", "gnatmake", From_Default);
-+         Add_Compiler (Native_Toolchain, "Ada", "@GNATMAKE@",
-+            From_Default);
++         Add_Compiler (Native_Toolchain, "Ada",
++            "@GNATMAKE@", From_Default);
        end if;
  
        if Get_Compiler (Native_Toolchain, "C") = No_Compiler then
+--- gps-gpl-2017-src/gps/Makefile.old  2017-12-10 20:29:18.267622400 +0100
++++ gps-gpl-2017-src/gps/Makefile      2017-12-10 20:29:34.564312700 +0100
+@@ -45,7 +45,8 @@
+       for f in ../kernel/generated/*; do cat $$f | tr -d '\015' > $$f-aux; mv -f $$f-aux $$f; done
+ endif
+       $(GPRBUILD) $(GPRBUILD_FLAGS) -m -p -ws -XTP_TASKING=No_Tasking \
+-        $(GPRBUILD_BUILD_TYPE_FLAGS) -Pgps -largs `pkg-config gmodule-2.0 --libs`
++        $(GPRBUILD_BUILD_TYPE_FLAGS) -Pgps -largs `pkg-config gmodule-2.0 --libs` \
++        -cargs:Ada $(ADAFLAGS) -cargs:C ${CFLAGS}
+ 
+ resources:
+ ifeq ($(OS),Windows_NT)
+--- gps-gpl-2017-src/common/common_no_xmlada.gpr.in.old        2017-12-10 20:48:13.986166250 +0100
++++ gps-gpl-2017-src/common/common_no_xmlada.gpr.in    2017-12-10 20:48:29.654872055 +0100
+@@ -22,6 +22,7 @@
+              for Switches ("dynamic_arrays.adb") use No_Checks;
+           when "Debug" =>
+       end case;
++      for Driver ("C") use External ("CC", "gcc");
+    end Compiler;
+ 
+    package Naming is
+--- gps-gpl-2017-src/common/common_with_xmlada.gpr.in.old      2017-12-10 20:48:37.352727540 +0100
++++ gps-gpl-2017-src/common/common_with_xmlada.gpr.in  2017-12-10 20:48:50.423482155 +0100
+@@ -23,6 +23,7 @@
+              for Switches ("dynamic_arrays.adb") use No_Checks;
+           when "Debug" =>
+       end case;
++      for Driver ("C") use External ("CC", "gcc");
+    end Compiler;
+ 
+    package Binder is
+--- gps-gpl-2017-src/shared.gpr.in.old 2017-12-10 20:52:51.117967249 +0100
++++ gps-gpl-2017-src/shared.gpr.in     2017-12-10 20:53:15.627507886 +0100
+@@ -56,6 +56,7 @@
+                );
+             for Switches ("C") use Optimize & ("-g", "-O2");
+       end case;
++      for Driver ("C") use External ("CC", "gcc");
+    end Compiler;
+ 
+    package Binder is
index 1425084ddd95fc2bab9510d46d4906ab226ad745..7ab72b50e19cf5449e69eb609f39947af191192b 100644 (file)
@@ -45,9 +45,9 @@ src_prepare() {
        GCC_PV=6.3.0
        mv configure.{in,ac} || die
        sed -i \
-               -e "s:@GNATMAKE@:gnatmake-${GCC_PV}:g" \
-               -e "s:@GNAT@:gnat-${GCC_PV}:g" \
-               -e "s:@GNATLS@:gnatls-${GCC_PV}:g" \
+               -e "s:@GNATMAKE@:${CHOST}-gnatmake-${GCC_PV}:g" \
+               -e "s:@GNAT@:${CHOST}-gnat-${GCC_PV}:g" \
+               -e "s:@GNATLS@:${CHOST}-gnatls-${GCC_PV}:g" \
                aclocal.m4 \
                share/support/core/gnat_help_menus.py \
                share/support/core/toolchains.py \