From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,WEIRD_QUOTING autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.3d73Ybk3C5U4I2t8lv+lAQ.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Starting learning ADA Date: Sun, 9 Jun 2019 21:29:23 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <47f671ea-bd40-4a98-8a34-8e99d94622cb@googlegroups.com> <441bc6de-05c5-4e2f-b601-110e8400cec7@googlegroups.com> <0f5a2a6b-d467-434c-8f3e-0964793e93ef@googlegroups.com> NNTP-Posting-Host: 3d73Ybk3C5U4I2t8lv+lAQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:56582 Date: 2019-06-09T21:29:23+02:00 List-Id: On 2019-06-09 20:12, Ricardo Brandão wrote: > Thanks for information Simon > >> If you can install GNAT CE 2019 in this environment, that would probably >> work much better. And include GPS. > > My question is: I'm in process of learning Ada. So, in some time in the near future (as soon as I got some good knowledge), I'll need to deploy in different devices: at least, Linux servers, embedded devices, and Windows. Will be possible compile the libraries in all these platforms? Yes, it is easy. Especially with Ada libraries that do not use autoconf, make, cmake. Comparing to building any GNU library under, say, VxWorks Ada libraries work almost out of the box. Regarding gprconfig. It frequently gets broken under Debian and Ubuntu. You can simply use a configuration file with gprbuild: gprbuild --config=config.cgpr -P.gpr config.cgpr is just a text file with 1-2 lines actually relevant to make it work. E.g. this is for Debian GNAT 8: ---------------------------------> -- This gpr configuration file was generated by gprconfig configuration project Default is for Target use "x86_64-linux-gnu"; for Inherit_Source_Path ("C++") use ("C"); for Toolchain_Version ("Ada") use "GNAT 8"; for Runtime_Dir ("Ada") use "/usr/lib/gcc/x86_64-linux-gnu/8/"; for Library_Encapsulated_Supported use "true"; for Object_Lister use ("nm", "-g"); for Object_Lister_Matcher use " [TDRB] (.*)"; for Archive_Builder use ("ar", "cr"); for Archive_Builder_Append_Option use ("q"); for Archive_Indexer use ("ranlib"); for Archive_Suffix use ".a"; for Library_Builder use "/usr/lib/gprbuild/gprlib"; for Library_Support use "full"; for Shared_Library_Prefix use "lib"; for Symbolic_Link_Supported use "true"; for Library_Major_Minor_Id_Supported use "true"; for Shared_Library_Minimum_Switches use ("-shared"); for Library_Version_Switches use ("-Wl,-soname,"); for Shared_Library_Suffix use ".so"; for Library_Auto_Init_Supported use "true"; for Run_Path_Option use ("-Wl,-z,origin,-rpath,"); for Run_Path_Origin use "$ORIGIN"; for Library_Encapsulated_Options use ("-shared", "-static-libgcc"); Target_Name := project'Target; case Target_Name is when "arm-android" | "arm-linux-androideabi" => null; when others => for Library_Partial_Linker use ("/usr/bin/gnatgcc", "-nostdlib", "-Wl,-r", "-o"); end case; for Default_Language use "Ada"; package Compiler is for Driver ("C") use "/usr/bin/gnatgcc"; for Leading_Required_Switches ("C") use ("-c", "-x", "c") & Compiler'Leading_Required_Switches ("C"); for Include_Switches ("C") use ("-I"); for Max_Command_Line_Length use "8192"; for Response_File_Format ("C") use "GCC_GNU"; for Dependency_Switches ("C") use ("-MMD", "-MF", ""); for PIC_Option ("C") use ("-fPIC"); for Driver ("Ada") use "/usr/bin/gnatgcc"; for Language_Kind ("Ada") use "unit_based"; for Dependency_Kind ("Ada") use "ALI_File"; for Leading_Required_Switches ("Ada") use ("-c", "-x", "ada", "-gnatA") & Compiler'Leading_Required_Switches ("Ada"); for Mapping_File_Switches ("Ada") use ("-gnatem="); for Mapping_Spec_Suffix ("Ada") use "%s"; for Mapping_Body_Suffix ("Ada") use "%b"; for Config_File_Switches ("Ada") use ("-gnatec="); for Include_Path_File ("Ada") use "ADA_PRJ_INCLUDE_FILE"; for Multi_Unit_Switches ("Ada") use ("-gnateI"); for Multi_Unit_Object_Separator ("Ada") use "~"; for Config_Body_File_Name ("Ada") use "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"");"; for Config_Spec_File_Name ("Ada") use "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"");"; for Config_Body_File_Name_Index ("Ada") use "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"", Index => %i);"; for Config_Spec_File_Name_Index ("Ada") use "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"", Index => %i);"; for Config_Body_File_Name_Pattern ("Ada") use "pragma Source_File_Name_Project " & " (Body_File_Name => ""*%b""," & " Casing => %c," & " Dot_Replacement => ""%d"");"; for Config_Spec_File_Name_Pattern ("Ada") use "pragma Source_File_Name_Project " & " (Spec_File_Name => ""*%s""," & " Casing => %c," & " Dot_Replacement => ""%d"");"; for Config_File_Unique ("Ada") use "False"; for PIC_Option ("Ada") use ("-fPIC"); end Compiler; package Naming is for Spec_Suffix ("Ada") use ".ads"; for Body_Suffix ("Ada") use ".adb"; for Body_Suffix ("Asm") use ".s"; for Body_Suffix ("Asm2") use ".asm"; for Body_Suffix ("Asm_Cpp") use ".S"; for Body_Suffix ("C") use ".c"; for Spec_Suffix ("C") use ".h"; for Spec_Suffix ("C++") use ".hh"; for Body_Suffix ("C++") use ".cpp"; for Body_Suffix ("Fortran") use ".f"; for Casing use "lowercase"; for Dot_Replacement use "-"; end Naming; package Binder is for Required_Switches ("Ada") use Binder'Required_Switches ("Ada") & ("gnatbind_prefix="); for Objects_Path_File ("Ada") use "ADA_PRJ_OBJECTS_FILE"; for Driver ("Ada") use "/usr/lib/gprbuild/gprbind"; end Binder; package Linker is for Export_File_Format use "GNU"; for Export_File_Switch use "-Wl,--version-script="; for Map_File_Option use "-Wl,-Map,"; for Driver use Compiler'Driver ("Ada"); for Response_File_Format use "GCC_GNU"; for Max_Command_Line_Length use "8192"; end Linker; package Clean is for Source_Artifact_Extensions ("Ada") use (".dg", ".rep"); for Object_Artifact_Extensions ("Ada") use (".s", ".ci", ".gcno", ".su"); for Source_Artifact_Extensions ("C") use (".gli"); for Object_Artifact_Extensions ("C") use (".s", "ci", ".gcno", ".su"); for Source_Artifact_Extensions ("C++") use (".gli"); for Object_Artifact_Extensions ("C++") use (".s", "ci", ".gcno", ".su"); -- Remove the files generated by gnatinspect (in the context of GPS) for Artifacts_In_Object_Dir use Clean'Artifacts_In_Object_Dir & ("gnatinspect.*"); end Clean; end Default; <------------------------------------------ Check and modify paths in it. Make sure hello-world project compiles and then use it with all projects. You can even make gprbuild.sh that calls the original gprbuild with the --config switch. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de