gprbuild-gpl-2014-src/ 0000755 0000767 0000145 00000000000 12323721732 014134 5 ustar gnatmail gnat gprbuild-gpl-2014-src/known-problems-130 0000644 0000767 0000145 00000010726 11267625216 017351 0 ustar gnatmail gnat ========================================
Known problems in GPRBUILD version 1.3.0
========================================
Copyright (c) 2009, AdaCore
The following is a listing of known problems in release 1.3.0. Except where
specifically noted, all these problems have been corrected in the development
tree of the 1.4 technology. This means they are corrected in any 1.3.0w
wavefront issued subsequent to the date specified (in ISO format YYYY-MM-DD) in
the status line. This can be used to determine if a given wavefront has the fix
identified in the entry.
KP-130-IA09-020 Wrong run path option for shared libs on Darwin
Problem: On Darwin, where there should be one run path option per
directory, a single run path option for all the directory is
issued when linking a shared library.
Status: This was fixed in 1.4.0 on 2009-10-09
Workaround: Use static libraries
KP-130-IA01-027 Incorrect linking of shared library on Windows
Problem: When gprbuild is invoked with --unchecked-shared-lib-imports
and a shared library imports a static ibrary, the linking of
the shared library may fail in Windows with undefined references.
Status: This was fixed in 1.4.0 on 2009-10-02
Workaround: Add the necessary Library_Options
KP-130-I904-011 Incorrect compilation in extending projects
Problem: gprbuild incorrectly compiles up to date inherited sources
in extending projects and does not recompile non up-to-date
sources in projects extending externally built projects.
Status: This was fixed in 1.4.0 on 2009-09-05
Workaround: Make the project being extended not externally built.
KP-130-I828-007 Crash when using attribute Included_Switches
Problem: When there are several languages in a project files and for
one of these languages attribute Included_Switches is declared,
gprbuild may crash.
Status: This was fixed in 1.4.0 on 2009-08-29
Workaround: Use one project file for each language
KP-130-I828-004 Failure to bind with a cross with no prefix
Problem: When a cross-compiler with no prefix is used, gprbind fails as
it does not recognize "gnatbind_prefix=" as a special option.
Status: This was fixed in 1.4.0 on 2009-09-01
Workaround: Remove the lines in package Binder of the configuration project
file that specify the option "gnatbind_prefix=".
KP-130-I722-017 Systematic binding and linking when using extending projects
Problem: If you are using extending projects, gprbuild will systematically
bind and link your application, even when everything is up to
date.
Status: This was fixed in 1.4.0 on 2009-07-21
Workaround: The compilation still performs correctly, and is just a bit
slower
KP-130-I713-011 gprclean does not remove binder files
Problem: When the main unit's name is less than 3 characters long,
gprclean does not remove the binder generated files (b__*.ads,
b__*.adb and *.bexch files)
Status: This was fixed in 1.4.0 on 2009-07-13
Workaround: Remove the files manually.
KP-130-I525-017 gprbuild incompatible with option -r of gnatbind
Problem: When a binder option such as -r that adds output to the
invocation of gnatbind is used, linking fails.
Status: This was fixed in 1.4.0 on 2009-08-12
Workaround: Remove binder option -r
KP-130-I507-019 Spec not compiled when body has been excluded
Problem: When the body of a spec has been locally removed, the spec that
does not need a completion is not compiled.
Status: This was fixed in 1.4.0 on 2009-05-19
Workaround: Use a spec with a dummy completion and a dummy body
KP-130-I505-015 Extending library project not built
Problem: When gprbuild is invoked for a library project that extends
another one, the library may not be built.
Status: This was fixed in 1.4.0 on 2009-05-06
Workaround: Use only non extending library projects
KP-130-I421-020 First compiler on the path not automatically used
Problem: If the directory where gprbuild resides is not first on the path,
compilers that are in front of this directory in the path will
not be chosen in autoconfiguration.
Status: This was fixed in 1.4.0 on 2009-09-08
Workaround: Create a configuration project file using gprconfig before
invoking gprbuild.
gprbuild-gpl-2014-src/obj-debug/ 0000755 0000767 0000145 00000000000 12317234544 015775 5 ustar gnatmail gnat gprbuild-gpl-2014-src/share/ 0000755 0000767 0000145 00000000000 12317234545 015242 5 ustar gnatmail gnat gprbuild-gpl-2014-src/share/_default.gpr 0000644 0000767 0000145 00000000051 12323721731 017526 0 ustar gnatmail gnat standard project Default is
end Default;
gprbuild-gpl-2014-src/share/gprconfig/ 0000755 0000767 0000145 00000000000 12317234545 017220 5 ustar gnatmail gnat gprbuild-gpl-2014-src/share/gprconfig/asm.xml 0000644 0000767 0000145 00000003406 11452363313 020520 0 ustar gnatmail gnat
package Naming is
for Body_Suffix ("Asm_Cpp") use ".S";
end Naming;
package Compiler is
for Driver ("Asm_Cpp") use "${PATH(asm_cpp)}${PREFIX(asm_cpp)}gcc";
for Leading_Required_Switches ("Asm_Cpp") use
Compiler'Leading_Required_Switches ("Asm_Cpp") &
("-c", "-x", "assembler-with-cpp");
for Include_Path ("Asm_Cpp") use "CPATH";
end Compiler;
package Naming is
for Body_Suffix ("Asm") use ".s";
end Naming;
package Compiler is
for Driver ("Asm") use "${PATH(asm)}${PREFIX(asm)}gcc";
for Leading_Required_Switches ("Asm") use
Compiler'Leading_Required_Switches ("Asm") &
("-c", "-x", "assembler");
for Include_Path ("Asm") use "CPATH";
end Compiler;
package Naming is
for Body_Suffix ("Asm2") use ".asm";
end Naming;
package Compiler is
for Driver ("Asm2") use "${PATH(asm2)}${PREFIX(asm2)}gcc";
for Leading_Required_Switches ("Asm2") use
Compiler'Leading_Required_Switches ("Asm2") &
("-c", "-x", "assembler");
for Include_Path ("Asm2") use "CPATH";
end Compiler;
gprbuild-gpl-2014-src/share/gprconfig/linker.xml 0000644 0000767 0000145 00000111377 12277050514 021235 0 ustar gnatmail gnat
for Archive_Builder use ("lmp-elf-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("lmp-elf-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("powerpc-elf-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("powerpc-elf-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("ar", "crs");
for Archive_Builder_Append_Option use ("q");
for Archive_Suffix use ".a";
for Archive_Builder use ("powerpc-xcoff-lynxos178-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("powerpc-xcoff-lynxos178-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("powerpc-eabispe-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("powerpc-eabispe-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("i686-elinos-linux-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("i686-elinos-linux-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("i686-pc-mingw32-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("i686-pc-mingw32-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("x86_64-pc-mingw32-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("x86_64-pc-mingw32-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("powerpc-elinos-linux-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("powerpc-elinos-linux-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("arm-linux-androideabi-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("arm-linux-androideabi-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("arm-linux-gnueabi-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("arm-linux-gnueabi-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("erc32-elf-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("erc32-elf-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("leon-elf-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("leon-elf-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("leon3-elf-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("leon3-elf-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("arm-eabi-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("arm-eabi-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("avr-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("avr-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("i586-sysgo-pikeos-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("i586-sysgo-pikeos-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Suffix use ".a";
package Linker is
for Max_Command_Line_Length use "15000";
for Response_File_Format use "object_list";
for Response_File_Switches use ("-Wl,-f,");
for Map_File_Option use "-Wl,-b,map:";
end Linker;
for Archive_Builder use ("e500v2-wrs-vxworks-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("e500v2-wrs-vxworks-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("e500v2-wrs-vxworksae-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("e500v2-wrs-vxworksae-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("e500v2-wrs-vxworksmils-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("e500v2-wrs-vxworksmils-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("i586-wrs-vxworks-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("i586-wrs-vxworks-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("i586-wrs-vxworksae-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("i586-wrs-vxworksae-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("arm-wrs-vxworks-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("arm-wrs-vxworks-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("powerpc-wrs-vxworks-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("powerpc-wrs-vxworks-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("leon-wrs-vxworks-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("leon-wrs-vxworks-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("powerpc-wrs-vxworksae-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("powerpc-wrs-vxworksae-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("powerpc-wrs-vxworksmils-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("powerpc-wrs-vxworksmils-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Suffix use ".a";
for Archive_Builder use ("ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("powerpc-wrs-linux-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("powerpc-wrs-linux-ranlib");
for Archive_Suffix use ".a";
for Archive_Builder use ("e500v2-wrs-linux-ar", "cr");
for Archive_Builder_Append_Option use ("q");
for Archive_Indexer use ("e500v2-wrs-linux-ranlib");
for Archive_Suffix use ".a";
package Linker is
for Driver use Compiler'Driver ("Ada");
end Linker;
for Library_Support use "static_only";
for Library_Builder use "${GPRCONFIG_PREFIX}libexec/gprbuild/gprlib";
for Library_Support use "none";
package Linker is
for Driver use "aa_link";
end Linker;
for Library_Support use "none";
package Linker is
for Driver use "dotnet-ld";
end Linker;
for Library_Builder use "${GPRCONFIG_PREFIX}libexec/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 Run_Path_Option use ("-Wl,-rpath,");
for Separate_Run_Path_Options use "true";
for Run_Path_Origin use "@executable_path";
for Library_Install_Name_Option use "-Wl,-install_name,@rpath";
for Shared_Library_Suffix use ".dylib";
for Library_Auto_Init_Supported use "true";
for Archive_Indexer use project'Archive_Indexer & ("-c");
for Shared_Library_Minimum_Switches use
("-dynamiclib", "-shared-libgcc");
for Library_Encapsulated_Options use ("-shared", "-static-libgcc");
package Linker is
for Map_File_Option use "-Wl,-map,";
end Linker;
for Library_Rpath_Options ("C++") use ("-print-file-name=libstdc++.dylib");
for Library_Builder use "${GPRCONFIG_PREFIX}libexec/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", "-fPIC");
for Library_Version_Switches use ("-Wl,-soname,");
for Shared_Library_Suffix use ".sl";
for Library_Auto_Init_Supported use "true";
for Run_Path_Option use ("-Wl,+b,");
for Library_Partial_Linker use ("gcc", "-nostdlib", "-Wl,-r", "-o");
package Linker is
for Max_Command_Line_Length use "5000";
for Response_File_Format use "object_list";
for Response_File_Switches use ("-Wl,-c,");
end Linker;
for Shared_Library_Suffix use ".so";
for Library_Version_Switches use ("-Wl,+h,");
for Library_Builder use "${GPRCONFIG_PREFIX}libexec/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");
package Linker is
for Map_File_Option use "-Wl,-Map,";
end Linker;
for Library_Partial_Linker use ("${PATH(ada)}${PREFIX(ada)}gcc", "-nostdlib", "-Wl,-r", "-o");
for Library_Partial_Linker use ("${PATH(ada)}${PREFIX(c)}gcc", "-nostdlib", "-Wl,-r", "-o");
for Library_Rpath_Options ("C++") use ("-print-file-name=libstdc++.so");
for Run_Path_Option use ("-Wl,-rpath,");
for Run_Path_Option use ("-Wl,-rpath,");
package Linker is
for Max_Command_Line_Length use "5000";
for Response_File_Format use "object_list";
for Response_File_Switches use ("-Wl,-objectlist,");
end Linker;
for Library_Builder use "${GPRCONFIG_PREFIX}libexec/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,-h,");
for Shared_Library_Suffix use ".so";
for Library_Auto_Init_Supported use "true";
for Library_Encapsulated_Options use
("-shared", "-static-libgcc", "-mimpure-text");
for Run_Path_Option use ("-Wl,-z,origin,-R,");
for Run_Path_Origin use "$$ORIGIN";
for Library_Partial_Linker use ("gcc", "-nostdlib", "-Wl,-r", "-o");
for Library_Rpath_Options ("C++") use ("-print-file-name=libstdc++.so");
for Library_Builder use "${GPRCONFIG_PREFIX}libexec/gprbuild/gprlib";
for Library_Support use "full";
for Shared_Library_Prefix use "lib";
for Symbolic_Link_Supported use "false";
for Library_Major_Minor_Id_Supported use "false";
for Shared_Library_Minimum_Switches use ("-shared", "-shared-libgcc");
for Library_Version_Switches use ("-Wl,-soname,");
for Shared_Library_Suffix use ".dll";
for Library_Encapsulated_Options use ("-shared", "-static-libgcc");
for Library_Auto_Init_Supported use "true";
for Library_Partial_Linker use ("gcc", "-nostdlib", "-Wl,-r", "-o");
package Linker is
for Map_File_Option use "-Wl,-Map,";
end Linker;
for Library_Builder use "${GPRCONFIG_PREFIX}libexec/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", "-Wl,-expect_unresolved,*");
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,-rpath,");
package Linker is
for Max_Command_Line_Length use "10000";
for Response_File_Format use "object_list";
for Response_File_Switches use ("-Wl,-input,");
end Linker;
for Library_Builder use "${GPRCONFIG_PREFIX}libexec/gprbuild/gprlib";
for Library_Support use "full";
for Shared_Library_Prefix use "lib";
for Shared_Library_Suffix use ".exe";
for Symbolic_Link_Supported use "false";
for Library_Major_Minor_Id_Supported use "false";
for Shared_Library_Minimum_Switches use ("-shared", "-shared-libgcc");
for Library_Auto_Init_Supported use "true";
package Linker is
for Required_Switches use ("-mno-cygwin");
end Linker;
package Linker is
for Driver use Compiler'Driver ("C++");
end Linker;
package Linker is
for Driver use Compiler'Driver ("C++");
end Linker;
package Linker is
for Required_Switches use Linker'Required_Switches & ("-shared-libgcc");
end Linker;
package Linker is
for Driver use Compiler'Driver ("Fortran");
end Linker;
package Linker is
for Driver use Compiler'Driver ("Ada");
end Linker;
package Linker is
for Driver use Compiler'Driver ("C");
end Linker;
package Linker is
for Driver use Compiler'Driver ("Ada");
end Linker;
package Linker is
for Driver use Compiler'Driver ("Ada");
end Linker;
package Linker is
for Driver use Compiler'Driver ("C");
end Linker;
package Linker is
for Required_Switches use
Linker'Required_Switches
& ("-L" & Wind_Base
& "/target/lib/usr/lib/ppc/PPC32/common",
"-L" & Wind_Base
& "/target/usr/lib/ppc/PPC32/common");
end Linker;
package Linker is
for Required_Switches use
Linker'Required_Switches
& ("-L" & Wind_Base
& "/target/lib_smp/usr/lib/ppc/PPC32/common");
end Linker;
package Linker is
for Required_Switches use
Linker'Required_Switches
& ("-L" & Wind_Base
& "/target/lib_smp/usr/lib/arm/ARMARCH7/common");
end Linker;
package Linker is
for Required_Switches use
Linker'Required_Switches
& ("-L" & Wind_Base
& "/target/lib/usr/lib/ppc/PPC32/e500v2common",
"-L" & Wind_Base
& "/target/usr/lib/ppc/PPC32/e500v2common");
end Linker;
package Linker is
for Required_Switches use
Linker'Required_Switches
& ("-L" & Wind_Base
& "/target/lib_smp/usr/lib/ppc/PPC32/e500v2common");
end Linker;
package Linker is
for Required_Switches use
Linker'Required_Switches
& ("-L" & Wind_Base
& "/target/usr/lib_cert_rtp/ppc/PPC32/common");
end Linker;
package Linker is
for Required_Switches use
Linker'Required_Switches
& ("-L" & Wind_Base
& "/target/usr/lib_cert_rtp/ppc/PPC32/e500v2common");
end Linker;
package Linker is
for Driver use Compiler'Driver ("C");
end Linker;
package Linker is
for Response_File_Format use "GCC_GNU";
for Max_Command_Line_Length use "8192";
end Linker;
package Linker is
for Response_File_Format use "GNU";
for Max_Command_Line_Length use "8192";
end Linker;
package Linker is
for Response_File_Format use "GNU";
for Max_Command_Line_Length use "8192";
end Linker;
package Linker is
for Response_File_Format use "GCC_Object_List";
end Linker;
for Default_Language use "Ada";
for Default_Language use "C";
for Default_Language use "Fortran";
for Default_Language use "C++";
gprbuild-gpl-2014-src/share/gprconfig/fortran.xml 0000644 0000767 0000145 00000004504 11452321006 021404 0 ustar gnatmail gnat
package Naming is
for Body_Suffix ("Fortran") use ".f";
end Naming;
package Compiler is
for Driver ("Fortran") use "${PATH(fortran)}g77";
for Leading_Required_Switches ("Fortran") use
Compiler'Leading_Required_Switches ("Fortran") &
("-c", "-fno-underscoring");
for Include_Path ("Fortran") use "CPATH";
end Compiler;
package Compiler is
for Leading_Required_Switches ("Fortran") use
Compiler'Leading_Required_Switches ("Fortran") & ("-mno-cygwin");
end Compiler;
package Naming is
for Body_Suffix ("Fortran") use ".f";
end Naming;
package Compiler is
for Driver ("Fortran") use "${PATH(fortran)}gfortran${PREFIX(fortran)}";
for Leading_Required_Switches ("Fortran") use
Compiler'Leading_Required_Switches ("Fortran") &
("-c", "-fno-underscoring");
for Include_Path ("Fortran") use "CPATH";
end Compiler;
package Compiler is
for PIC_Option ("Fortran") use ("-fPIC");
end Compiler;
gprbuild-gpl-2014-src/share/gprconfig/nocompiler.xml 0000644 0000767 0000145 00000000567 10774202155 022116 0 ustar gnatmail gnat
package Compiler is
for Driver ("Project File") use "";
end Compiler;
package Naming is
for Spec_Suffix ("Project File") use ".gpr";
end Naming;
gprbuild-gpl-2014-src/share/gprconfig/cpp.xml 0000644 0000767 0000145 00000013273 12247666154 020541 0 ustar gnatmail gnat
package Naming is
for Spec_Suffix ("C++") use ".hh";
for Body_Suffix ("C++") use ".cpp";
end Naming;
for Inherit_Source_Path ("C++") use ("C");
package Compiler is
for Driver ("C++") use "${PATH(c++)}g++${PREFIX(c++)}";
end Compiler;
package Clean is
for Source_Artifact_Extensions ("C++") use (".gli");
for Object_Artifact_Extensions ("C++") use (".s", "ci", ".gcno");
end Clean;
package Compiler is
for Driver ("C++") use "${PATH(c++)}c++${PREFIX(c++)}";
end Compiler;
package Compiler is
for Leading_Required_Switches ("C++") use
("-c", "-x", "c++") &
Compiler'Leading_Required_Switches ("C++");
for Dependency_Switches ("C++") use ("-MMD", "-MF", "");
for Include_Path ("C++") use "CPATH";
end Compiler;
package Compiler is
for Leading_Required_Switches ("C++") use
Compiler'Leading_Required_Switches ("C++") & ("-fdump-xref");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C++") use
Compiler'Leading_Required_Switches ("C++") &
("-c", "-x", "c++");
for Dependency_Switches ("C++") use ("-Wp,-MMD,");
for Include_Path ("C++") use "CPATH";
end Compiler;
package Compiler is
for PIC_Option ("C++") use ("-fPIC");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C++") use
Compiler'Leading_Required_Switches ("C++") & ("-mno-cygwin");
end Compiler;
gprbuild-gpl-2014-src/share/gprconfig/gnat.xml 0000644 0000767 0000145 00000024171 12215621730 020671 0 ustar gnatmail gnat
'>
] >
package Naming is
for Spec_Suffix ("Ada") use ".ads";
for Body_Suffix ("Ada") use ".adb";
for Casing use "lowercase";
for Dot_Replacement use "-";
end Naming;
package Compiler is
for Driver ("Ada") use "gnaamp";
for Language_Kind ("Ada") use "unit_based";
for Dependency_Kind ("Ada") use "ALI_File";
for Required_Switches ("Ada") use
Compiler'Required_Switches ("Ada")
& ("-gnatA");
for Object_File_Suffix ("Ada") use ".obj";
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 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_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";
end Compiler;
package Binder is
for Objects_Path_File ("Ada") use "ADA_PRJ_OBJECTS_FILE";
for Required_Switches ("Ada") use
Binder'Required_Switches ("Ada") &
("ada_binder=gnaampbind");
for Driver ("Ada") use
"${GPRCONFIG_PREFIX}/libexec/gprbuild/gprbind";
end Binder;
for Toolchain_Version ("Ada") use "GNAT ${VERSION(ada)}";
for Runtime_Library_Dir ("Ada") use "${RUNTIME_DIR(ada)}/adalib/";
for Runtime_Source_Dir ("Ada") use "${RUNTIME_DIR(ada)}/adainclude/";
&filter_gnat;
package Naming is
for Spec_Suffix ("Ada") use ".ads";
for Body_Suffix ("Ada") use ".adb";
for Casing use "lowercase";
for Dot_Replacement use "-";
end Naming;
package Compiler is
for Driver ("Ada") use "${PATH(ada)}${PREFIX(ada)}gcc";
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";
end Compiler;
package Binder is
for Objects_Path_File ("Ada") use "ADA_PRJ_OBJECTS_FILE";
for Driver ("Ada") use
"${GPRCONFIG_PREFIX}libexec/gprbuild/gprbind";
end Binder;
package Clean is
for Source_Artifact_Extensions ("Ada") use (".dg", ".rep");
for Object_Artifact_Extensions ("Ada") use (".s", "ci", ".gcno");
end Clean;
for Toolchain_Version ("Ada") use "GNAT ${VERSION(ada)}";
for Runtime_Library_Dir ("Ada") use "${RUNTIME_DIR(ada)}/adalib/";
for Runtime_Source_Dir ("Ada") use "${RUNTIME_DIR(ada)}/adainclude/";
package Compiler is
for Object_File_Suffix ("Ada") use ".il";
for Driver ("Ada") use "${PATH(ada)}${PREFIX(ada)}gnatcompile";
end Compiler;
&filter_gnat;
package Compiler is
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";
end Compiler;
&filter_gnat;
package Compiler is
for Config_Body_File_Name ("Ada") use
"pragma Source_File_Name (%u, Body_File_Name => ""%f"");";
for Config_Spec_File_Name ("Ada") use
"pragma Source_File_Name (%u, Spec_File_Name => ""%f"");";
for Config_Body_File_Name_Pattern ("Ada") use
"pragma Source_File_Name " &
" (Body_File_Name => ""*%b""," &
" Casing => %c," &
" Dot_Replacement => ""%d"");";
for Config_Spec_File_Name_Pattern ("Ada") use
"pragma Source_File_Name " &
" (Spec_File_Name => ""*%s""," &
" Casing => %c," &
" Dot_Replacement => ""%d"");";
for Config_File_Unique ("Ada") use "True";
end Compiler;
&filter_gnat;
package Compiler is
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_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";
end Compiler;
&filter_gnat;
package Compiler is
for PIC_Option ("Ada") use ("-fPIC");
end Compiler;
&filter_gnat;
for Library_Encapsulated_Supported use "true";
package Compiler is
for Leading_Required_Switches ("Ada") use
Compiler'Leading_Required_Switches ("Ada") & ("--RTS=${RUNTIME(ada)}");
end Compiler;
package Binder is
for Required_Switches ("Ada") use
Binder'Required_Switches ("Ada") & ("--RTS=${RUNTIME(ada)}");
end Binder;
package Compiler is
for Leading_Required_Switches ("Ada") use
Compiler'Leading_Required_Switches ("Ada") & ("--RTS=${RUNTIME(ada)}/..");
end Compiler;
package Binder is
for Required_Switches ("Ada") use
Binder'Required_Switches ("Ada") & ("--RTS=${RUNTIME(ada)}/..");
end Binder;
package Compiler is
for Leading_Required_Switches ("Ada") use
Compiler'Leading_Required_Switches ("Ada") & ("-msoft-float");
end Compiler;
gprbuild-gpl-2014-src/share/gprconfig/gprconfig.xsd 0000644 0000767 0000145 00000014474 12267650363 021734 0 ustar gnatmail gnat
gprbuild-gpl-2014-src/share/gprconfig/compilers.xml 0000644 0000767 0000145 00000064521 12313013502 021727 0 ustar gnatmail gnat
PRJFILE
Project File
GCC
(.*(-wrs-|-sysgo|-elf-|-eabi-|-eabispe-|avr-|-elinos-linux|-pc-mingw32|-xcoff-|arm-linux-androideabi-|arm-linux-gnueabi-).*)?gcc
${PREFIX}gcc -v
C
${PREFIX}gcc -dumpmachine
GCC_Pro
(.*(-wrs-|-sysgo|-elf-|-eabi-|-eabispe-|avr-|-elinos-linux|-pc-mingw32|-xcoff-|arm-linux-androideabi-|arm-linux-gnueabi-).*)?gcc
${PREFIX}gcc -v
C
${PREFIX}gcc -dumpmachine
GCC-WRS6
cc(arm|pentium|sh|mips|ppc)
vxworks-6.*
C
kernel,kernel-smp,kernel-sjlj,rtp,rtp-smp
cc${PREFIX} -dumpmachine
GCC-WRS6LEON
cc(sparc)
vxworks-6.*
C
kernel
leon-wrs-vxworks
GCC-WRS6E500V2
cc(ppc)
vxworks-6.*
C
kernel,kernel-smp,kernel-sjlj,rtp,rtp-smp
e500v2-wrs-vxworks
GCC-WRS7
cc(arm|pentium|sh|mips|ppc)
vxworks-7.*
C
kernel,kernel-smp,kernel-sjlj,rtp,rtp-smp
cc${PREFIX} -dumpmachine
GCC-WRS7LEON
cc(sparc)
vxworks-6.*
C
kernel
leon-wrs-vxworks
GCC-WRS7E500V2
cc(ppc)
vxworks-7.*
C
kernel,kernel-smp,kernel-sjlj,rtp,rtp-smp
e500v2-wrs-vxworks
GCC-WRS6CERT
cc(arm|pentium|sh|mips|ppc|sparc)
vxworks-cert-6.*
C
kernel,ravenscar-cert,zfp,rtp,ravenscar-cert-rtp
cc${PREFIX} -dumpmachine
GCC-WRS6CERTE500V2
cc(ppc)
vxworks-cert-6.*
C
kernel,ravenscar-cert,zfp,rtp,ravenscar-cert-rtp
e500v2-wrs-vxworks
GCC-WRS5
cc(arm|pentium|sh|mips|ppc|sparc)
cc${PREFIX} -v
(tornado 2|VxWorks 5)
C
cc${PREFIX} -dumpmachine
GCC-WRS653
cc(ppc|pentium)
vxworks653.*
C
full,cert,ravenscar-cert,zfp
cc${PREFIX} -dumpmachine
GCC-WRS653-E500V2
cc(ppc)
vxworks653.*
C
full,cert,ravenscar-cert,zfp
e500v2-wrs-vxworksae
GCC-WRSMILS
cc(ppc)
cc${PREFIX} -v
vxworksae
C
full,cert,ravenscar-cert,zfp
powerpc-wrs-vxworksmils
GCC-WRSMILS-E500V2
cc(ppc)
cc${PREFIX} -v
vxworksae
C
full,cert,ravenscar-cert,zfp
e500v2-wrs-vxworksmils
GCC-WRSMILSHAE
c\+\+(ppc)
vxworks-mils-hae-1.*
C
zfp
powerpc-wrs-vxworksmils
GCC-WRSMILSHAE-E500V2
c\+\+(ppc)
vxworks-mils-hae-1.*
C
zfp
e500v2-wrs-vxworksmils
GCC-SYSGO
(x86_i586-)gcc
C
i586-sysgo-pikeos
GCC-28
gcc
gcc -v
2\.8\.
C
gcc -dumpmachine
GNAAMP
gnaampmake
gnaampls -v
Ada
aamp
G++
g\+\+
g++ -v
C++
g++ -dumpmachine
G++_Pro
g\+\+
g++ -v
C++
g++ -dumpmachine
G++-WRS5
c\+\+(arm|pentium|sh|mips|ppc|sparc)
c++${PREFIX} -v
tornado 2|VxWorks 5
C++
c++${PREFIX} -dumpmachine
G++-WRS6
c\+\+(arm|pentium|sh|mips|ppc|sparc)
vxworks-6.*
C++
kernel,kernel-smp,kernel-sjlj,rtp,rtp-smp
c++${PREFIX} -dumpmachine
G++-WRS6LEON
c\+\+(sparc)
vxworks-6.*
C++
kernel
leon-wrs-vxworks
G++-WRS6E500V2
c\+\+(ppc)
vxworks-6.*
C++
kernel,kernel-smp,kernel-sjlj,rtp,rtp-smp
e500v2-wrs-vxworks
G++-WRS7
c\+\+(arm|pentium|sh|mips|ppc|sparc)
vxworks-7.*
C++
kernel,kernel-smp,kernel-sjlj,rtp,rtp-smp
c++${PREFIX} -dumpmachine
G++-WRS7LEON
c\+\+(sparc)
vxworks-7.*
C++
kernel
leon-wrs-vxworks
G++-WRS7E500V2
c\+\+(ppc)
vxworks-7.*
C++
kernel,kernel-smp,kernel-sjlj,rtp,rtp-smp
e500v2-wrs-vxworks
G++-WRS6CERT
c\+\+(arm|pentium|sh|mips|ppc|sparc)
vxworks-cert-6.*
C++
kernel,ravenscar-cert,zfp,rtp,ravenscar-cert-rtp
c++${PREFIX} -dumpmachine
G++-WRS6CERTE500V2
c\+\+(ppc)
vxworks-cert-6.*
C++
kernel,ravenscar-cert,zfp,rtp,ravenscar-cert-rtp
e500v2-wrs-vxworks
G++-WRS653
c\+\+(ppc|pentium)
vxworks653.*
C++
full,cert,ravenscar-cert,zfp
c++${PREFIX} -dumpmachine
G++-WRS653-E500V2
c\+\+(ppc)
vxworks653.*
C++
full,cert,ravenscar-cert,zfp
e500v2-wrs-vxworksae
G++-WRSMILS
c\+\+(ppc)
c++${PREFIX} -v
vxworksae
C++
full,cert,ravenscar-cert,zfp
powerpc-wrs-vxworksmils
G++-WRSMILS-E500V2
c\+\+(ppc)
c++${PREFIX} -v
vxworksae
C++
full,cert,ravenscar-cert,zfp
e500v2-wrs-vxworksmils
G++-WRSLINUX
(powerpc-wrs-linux-gnu)-cpp
${PREFIX}-cpp -v
C++
full
${PREFIX}-cpp -dumpmachine
G++-WRSLINUXE500V2
(powerpc-wrs-linux-gnu)-cpp
${PREFIX}-cpp -v
C++
full
e500v2-wrs-linux
GCC-WRSLINUX
(powerpc-wrs-linux-gnu)-gcc
${PREFIX}-cpp -v
C
full
${PREFIX} -dumpmachine
GCC-WRSLINUXE500V2
(powerpc-wrs-linux-gnu)-gcc
${PREFIX}-cpp -v
C
full
e500v2-wrs-linux
G++-WRSMILSHAE
c\+\+(ppc)
vxworks-mils-hae-1.*
C++
zfp
powerpc-wrs-vxworksmils
G++-WRSMILSHAE-E500V2
c\+\+(ppc)
vxworks-mils-hae-1.*
C++
zfp
e500v2-wrs-vxworksmils
GCC-ASM
(.*(-wrs-|-elf-|-eabi-|-eabispe-|avr-|elinos-linux|-pc-mingw32).*)?gcc
${PREFIX}gcc -v
Asm,Asm_Cpp,Asm2
${PREFIX}gcc -dumpmachine
GNAT
(.*(-wrs-|-sysgo|-elf-|-eabi-|-eabispe-|avr-|elinos-linux|-pc-mingw32|-xcoff-|-pikeos-|arm-linux-androideabi-|arm-linux-gnueabi-).*)?gnatmake
${PREFIX}gnatls -v
Ada
${PREFIX}gcc -v
\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/adalib/
\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/ada_object_path
\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/rts-(.*)/adalib/
${PREFIX}gcc -dumpmachine
GNAT_CODEPEER
(.*codepeer-)gnatmake
${PREFIX}gnatls -v
Ada
${PREFIX}gcc -v
\.\./lib/gcc/.*/$gcc_version/adalib/
codepeer
GNAT_DOTNET
(.*dotnet-)gnatmake
${PREFIX}gnatls -v
Ada
\.\./lib/dotgnat/adalib/
\.\./lib/dotgnat/rts-(.*)/adalib/
dotnet
G77
g77
g77 --version
Fortran
g77 -dumpmachine
GFORTRAN
gfortran
gfortran -v
Fortran
gfortran -dumpmachine
GCC-CYGMING
gcc
gcc --version
C,C++,Fortran
gcc -mno-cygwin -dumpmachine
GCC-MINGW32
gcc(-sjlj|)
gcc${PREFIX} --version
C,C++,Fortran
gcc${PREFIX} -dumpmachine
DIABC-PPC
dcc
dcc -V
C
powerpc-elf
LYNXWORKS-C
gcc
gcc -v
C
gcc -dumpmachine
.*xcoff-lynxos.*
LYNXWORKS-C++
c\+\+
c++ -v
C++
c++ -dumpmachine
.*xcoff-lynxos.*
LLVM
clang
clang -v
C
clang -dumpmachine
gprbuild-gpl-2014-src/share/gprconfig/c.xml 0000644 0000767 0000145 00000017060 12313013502 020150 0 ustar gnatmail gnat
package Naming is
for Spec_Suffix ("C") use ".h";
for Body_Suffix ("C") use ".c";
end Naming;
package Compiler is
for Driver ("C") use "${PATH(c)}${PREFIX(c)}gcc";
end Compiler;
package Clean is
for Source_Artifact_Extensions ("C") use (".gli");
for Object_Artifact_Extensions ("C") use (".s", "ci", ".gcno");
end Clean;
package Compiler is
for Driver ("C") use "${PATH(c)}gcc${PREFIX(c)}";
end Compiler;
package Clean is
for Source_Artifact_Extensions ("C") use (".gli");
for Object_Artifact_Extensions ("C") use (".s", "ci", ".gcno");
end Clean;
package Compiler is
for Driver ("C") use "${PATH(c)}cc${PREFIX(c)}";
end Compiler;
package Compiler is
for Driver ("C") use "${PATH(c)}dcc";
end Compiler;
package Compiler is
for Driver ("C") use "${PATH(c)}clang";
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
("-c", "-x", "c") & Compiler'Leading_Required_Switches ("C");
for Include_Path ("C") use "CPATH";
end Compiler;
package Compiler is
for Dependency_Switches ("C") use ("-Wp,-MMD,");
end Compiler;
package Compiler is
for Dependency_Switches ("C") use ("-MMD", "-MF", "");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C") & ("-tPPC750EH:cross", "-c");
for Dependency_Switches ("C") use
("-Xmake-dependency=6", "-Xmake-dependency-savefile=");
for Include_Path ("C") use "CPATH";
end Compiler;
package Compiler is
for PIC_Option ("C") use ("-fPIC");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C") & ("-fdump-xref");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C") & ("-mno-cygwin");
end Compiler;
gprbuild-gpl-2014-src/share/gprconfig/gnat_runtime.mapping 0000644 0000767 0000145 00000122571 10520412162 023264 0 ustar gnatmail gnat a-astaco.adb
body
Ada.Asynchronous_Task_Control
a-calari.adb
body
Ada.Calendar.Arithmetic
a-caldel.adb
body
Ada.Calendar.Delays
a-calend.adb
body
Ada.Calendar
a-calfor.adb
body
Ada.Calendar.Formatting
a-catizo.adb
body
Ada.Calendar.Time_Zones
a-cbdlli.adb
body
Ada.Containers.Bounded_Doubly_Linked_Lists
a-cdlili.adb
body
Ada.Containers.Doubly_Linked_Lists
a-cgaaso.adb
body
Ada.Containers.Generic_Anonymous_Array_Sort
a-cgarso.adb
body
Ada.Containers.Generic_Array_Sort
a-cgcaso.adb
body
Ada.Containers.Generic_Constrained_Array_Sort
a-chacon.adb
body
Ada.Characters.Conversions
a-chahan.adb
body
Ada.Characters.Handling
a-chtgke.adb
body
Ada.Containers.Hash_Tables.Generic_Keys
a-chtgop.adb
body
Ada.Containers.Hash_Tables.Generic_Operations
a-cidlli.adb
body
Ada.Containers.Indefinite_Doubly_Linked_Lists
a-cihama.adb
body
Ada.Containers.Indefinite_Hashed_Maps
a-cihase.adb
body
Ada.Containers.Indefinite_Hashed_Sets
a-ciorma.adb
body
Ada.Containers.Indefinite_Ordered_Maps
a-ciormu.adb
body
Ada.Containers.Indefinite_Ordered_Multisets
a-ciorse.adb
body
Ada.Containers.Indefinite_Ordered_Sets
a-cohama.adb
body
Ada.Containers.Hashed_Maps
a-cohase.adb
body
Ada.Containers.Hashed_Sets
a-coinve.adb
body
Ada.Containers.Indefinite_Vectors
a-colien.adb
body
Ada.Command_Line.Environment
a-colire.adb
body
Ada.Command_Line.Remove
a-comlin.adb
body
Ada.Command_Line
a-convec.adb
body
Ada.Containers.Vectors
a-coorma.adb
body
Ada.Containers.Ordered_Maps
a-coormu.adb
body
Ada.Containers.Ordered_Multisets
a-coorse.adb
body
Ada.Containers.Ordered_Sets
a-coprnu.adb
body
Ada.Containers.Prime_Numbers
a-crbtgk.adb
body
Ada.Containers.Red_Black_Trees.Generic_Keys
a-crbtgo.adb
body
Ada.Containers.Red_Black_Trees.Generic_Operations
a-crdlli.adb
body
Ada.Containers.Restricted_Doubly_Linked_Lists
a-decima.adb
body
Ada.Decimal
a-diocst.adb
body
Ada.Direct_Io.C_Streams
a-direct.adb
body
Ada.Directories
a-direio.adb
body
Ada.Direct_Io
a-diroro.adb
body
Ada.Dispatching.Round_Robin
a-dirval.adb
body
Ada.Directories.Validity
a-dynpri.adb
body
Ada.Dynamic_Priorities
a-einuoc.adb
body
Ada.Exceptions.Is_Null_Occurrence
a-elchha.adb
body
Ada.Exceptions.Last_Chance_Handler
a-envvar.adb
body
Ada.Environment_Variables
a-excpol.adb
body
Ada.Exceptions.Poll
a-exctra.adb
body
Ada.Exceptions.Traceback
a-exexda.adb
body
Ada.Exceptions.Exception_Data
a-exexpr.adb
body
Ada.Exceptions.Exception_Propagation
a-exextr.adb
body
Ada.Exceptions.Exception_Traces
a-filico.adb
body
Ada.Finalization.List_Controller
a-finali.adb
body
Ada.Finalization
a-interr.adb
body
Ada.Interrupts
a-intsig.adb
body
Ada.Interrupts.Signal
a-ngcefu.adb
body
Ada.Numerics.Generic_Complex_Elementary_Functions
a-ngcoar.adb
body
Ada.Numerics.Generic_Complex_Arrays
a-ngcoty.adb
body
Ada.Numerics.Generic_Complex_Types
a-ngelfu.adb
body
Ada.Numerics.Generic_Elementary_Functions
a-ngrear.adb
body
Ada.Numerics.Generic_Real_Arrays
a-nudira.adb
body
Ada.Numerics.Discrete_Random
a-nuflra.adb
body
Ada.Numerics.Float_Random
a-numaux.adb
body
Ada.Numerics.Aux
a-rbtgso.adb
body
Ada.Containers.Red_Black_Trees.Generic_Set_Operations
a-reatim.adb
body
Ada.Real_Time
a-retide.adb
body
Ada.Real_Time.Delays
a-rttiev.adb
body
Ada.Real_Time.Timing_Events
a-secain.adb
body
Ada.Strings.Equal_Case_Insensitive
a-sequio.adb
body
Ada.Sequential_Io
a-shcain.adb
body
Ada.Strings.Hash_Case_Insensitive
a-siocst.adb
body
Ada.Sequential_Io.C_Streams
a-slcain.adb
body
Ada.Strings.Less_Case_Insensitive
a-ssicst.adb
body
Ada.Streams.Stream_Io.C_Streams
a-stboha.adb
body
Ada.Strings.Bounded.Hash
a-storio.adb
body
Ada.Storage_Io
a-strbou.adb
body
Ada.Strings.Bounded
a-strfix.adb
body
Ada.Strings.Fixed
a-strhas.adb
body
Ada.Strings.Hash
a-strmap.adb
body
Ada.Strings.Maps
a-strsea.adb
body
Ada.Strings.Search
a-strsup.adb
body
Ada.Strings.Superbounded
a-strunb.adb
body
Ada.Strings.Unbounded
a-ststio.adb
body
Ada.Streams.Stream_Io
a-stunau.adb
body
Ada.Strings.Unbounded.Aux
a-stunha.adb
body
Ada.Strings.Unbounded.Hash
a-stwibo.adb
body
Ada.Strings.Wide_Bounded
a-stwifi.adb
body
Ada.Strings.Wide_Fixed
a-stwiha.adb
body
Ada.Strings.Wide_Hash
a-stwima.adb
body
Ada.Strings.Wide_Maps
a-stwise.adb
body
Ada.Strings.Wide_Search
a-stwisu.adb
body
Ada.Strings.Wide_Superbounded
a-stwiun.adb
body
Ada.Strings.Wide_Unbounded
a-stzbou.adb
body
Ada.Strings.Wide_Wide_Bounded
a-stzfix.adb
body
Ada.Strings.Wide_Wide_Fixed
a-stzhas.adb
body
Ada.Strings.Wide_Wide_Hash
a-stzmap.adb
body
Ada.Strings.Wide_Wide_Maps
a-stzsea.adb
body
Ada.Strings.Wide_Wide_Search
a-stzsup.adb
body
Ada.Strings.Wide_Wide_Superbounded
a-stzunb.adb
body
Ada.Strings.Wide_Wide_Unbounded
a-suteio.adb
body
Ada.Strings.Unbounded.Text_Io
a-swbwha.adb
body
Ada.Strings.Wide_Bounded.Wide_Hash
a-swunau.adb
body
Ada.Strings.Wide_Unbounded.Aux
a-swuwha.adb
body
Ada.Strings.Wide_Unbounded.Wide_Hash
a-swuwti.adb
body
Ada.Strings.Wide_Unbounded.Wide_Text_Io
a-swwibo.adb
body
Ada.Strings.Wide_Wide_Bounded
a-swwifi.adb
body
Ada.Strings.Wide_Wide_Fixed
a-swwima.adb
body
Ada.Strings.Wide_Wide_Maps
a-swwise.adb
body
Ada.Strings.Wide_Wide_Search
a-swwisu.adb
body
Ada.Strings.Wide_Wide_Superbounded
a-sytaco.adb
body
Ada.Synchronous_Task_Control
a-szbzha.adb
body
Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Hash
a-szunau.adb
body
Ada.Strings.Wide_Wide_Unbounded.Aux
a-szuzha.adb
body
Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash
a-szuzti.adb
body
Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_Io
a-tags.adb
body
Ada.Tags
a-tasatt.adb
body
Ada.Task_Attributes
a-taside.adb
body
Ada.Task_Identification
a-taster.adb
body
Ada.Task_Termination
a-teioed.adb
body
Ada.Text_Io.Editing
a-textio.adb
body
Ada.Text_Io
a-tiboio.adb
body
Ada.Text_Io.Bounded_Io
a-ticoau.adb
body
Ada.Text_Io.Complex_Aux
a-ticoio.adb
body
Ada.Text_Io.Complex_Io
a-tideau.adb
body
Ada.Text_Io.Decimal_Aux
a-tideio.adb
body
Ada.Text_Io.Decimal_Io
a-tienau.adb
body
Ada.Text_Io.Enumeration_Aux
a-tienio.adb
body
Ada.Text_Io.Enumeration_Io
a-tifiio.adb
body
Ada.Text_Io.Fixed_Io
a-tiflau.adb
body
Ada.Text_Io.Float_Aux
a-tiflio.adb
body
Ada.Text_Io.Float_Io
a-tigeau.adb
body
Ada.Text_Io.Generic_Aux
a-tiinau.adb
body
Ada.Text_Io.Integer_Aux
a-tiinio.adb
body
Ada.Text_Io.Integer_Io
a-timoau.adb
body
Ada.Text_Io.Modular_Aux
a-timoio.adb
body
Ada.Text_Io.Modular_Io
a-tiocst.adb
body
Ada.Text_Io.C_Streams
a-titest.adb
body
Ada.Text_Io.Text_Streams
a-wichun.adb
body
Ada.Wide_Characters.Unicode
a-witeio.adb
body
Ada.Wide_Text_Io
a-wtcoau.adb
body
Ada.Wide_Text_Io.Complex_Aux
a-wtcoio.adb
body
Ada.Wide_Text_Io.Complex_Io
a-wtcstr.adb
body
Ada.Wide_Text_Io.C_Streams
a-wtdeau.adb
body
Ada.Wide_Text_Io.Decimal_Aux
a-wtdeio.adb
body
Ada.Wide_Text_Io.Decimal_Io
a-wtedit.adb
body
Ada.Wide_Text_Io.Editing
a-wtenau.adb
body
Ada.Wide_Text_Io.Enumeration_Aux
a-wtenio.adb
body
Ada.Wide_Text_Io.Enumeration_Io
a-wtfiio.adb
body
Ada.Wide_Text_Io.Fixed_Io
a-wtflau.adb
body
Ada.Wide_Text_Io.Float_Aux
a-wtflio.adb
body
Ada.Wide_Text_Io.Float_Io
a-wtgeau.adb
body
Ada.Wide_Text_Io.Generic_Aux
a-wtinau.adb
body
Ada.Wide_Text_Io.Integer_Aux
a-wtinio.adb
body
Ada.Wide_Text_Io.Integer_Io
a-wtmoau.adb
body
Ada.Wide_Text_Io.Modular_Aux
a-wtmoio.adb
body
Ada.Wide_Text_Io.Modular_Io
a-wttest.adb
body
Ada.Wide_Text_Io.Text_Streams
a-wwboio.adb
body
Ada.Wide_Text_Io.Wide_Bounded_Io
a-zchuni.adb
body
Ada.Wide_Wide_Characters.Unicode
a-ztcoau.adb
body
Ada.Wide_Wide_Text_Io.Complex_Aux
a-ztcoio.adb
body
Ada.Wide_Wide_Text_Io.Complex_Io
a-ztcstr.adb
body
Ada.Wide_Wide_Text_Io.C_Streams
a-ztdeau.adb
body
Ada.Wide_Wide_Text_Io.Decimal_Aux
a-ztdeio.adb
body
Ada.Wide_Wide_Text_Io.Decimal_Io
a-ztedit.adb
body
Ada.Wide_Wide_Text_Io.Editing
a-ztenau.adb
body
Ada.Wide_Wide_Text_Io.Enumeration_Aux
a-ztenio.adb
body
Ada.Wide_Wide_Text_Io.Enumeration_Io
a-ztexio.adb
body
Ada.Wide_Wide_Text_Io
a-ztfiio.adb
body
Ada.Wide_Wide_Text_Io.Fixed_Io
a-ztflau.adb
body
Ada.Wide_Wide_Text_Io.Float_Aux
a-ztflio.adb
body
Ada.Wide_Wide_Text_Io.Float_Io
a-ztgeau.adb
body
Ada.Wide_Wide_Text_Io.Generic_Aux
a-ztinau.adb
body
Ada.Wide_Wide_Text_Io.Integer_Aux
a-ztinio.adb
body
Ada.Wide_Wide_Text_Io.Integer_Io
a-ztmoau.adb
body
Ada.Wide_Wide_Text_Io.Modular_Aux
a-ztmoio.adb
body
Ada.Wide_Wide_Text_Io.Modular_Io
a-zttest.adb
body
Ada.Wide_Wide_Text_Io.Text_Streams
a-zzboio.adb
body
Ada.Wide_Wide_Text_Io.Wide_Wide_Bounded_Io
g-alleve.adb
body
GNAT.ALTIVEC.LOW_LEVEL_VECTORS
g-altcon.adb
body
GNAT.ALTIVEC.CONVERSIONS
g-alveop.adb
body
GNAT.ALTIVEC.VECTOR_OPERATIONS
g-arrspl.adb
body
GNAT.ARRAY_SPLIT
g-boubuf.adb
body
GNAT.BOUNDED_BUFFERS
g-bubsor.adb
body
GNAT.BUBBLE_SORT
g-busora.adb
body
GNAT.BUBBLE_SORT_A
g-busorg.adb
body
GNAT.BUBBLE_SORT_G
g-bytswa.adb
body
GNAT.BYTE_SWAPPING
g-calend.adb
body
GNAT.CALENDAR
g-casuti.adb
body
GNAT.CASE_UTIL
g-catiio.adb
body
GNAT.CALENDAR.TIME_IO
g-cgi.adb
body
GNAT.CGI
g-cgicoo.adb
body
GNAT.CGI.COOKIE
g-cgideb.adb
body
GNAT.CGI.DEBUG
g-comlin.adb
body
GNAT.COMMAND_LINE
g-comver.adb
body
GNAT.COMPILER_VERSION
g-crc32.adb
body
GNAT.CRC32
g-debpoo.adb
body
GNAT.DEBUG_POOLS
g-debuti.adb
body
GNAT.DEBUG_UTILITIES
g-diopit.adb
body
GNAT.DIRECTORY_OPERATIONS.ITERATION
g-dirope.adb
body
GNAT.DIRECTORY_OPERATIONS
g-dynhta.adb
body
GNAT.DYNAMIC_HTABLES
g-dyntab.adb
body
GNAT.DYNAMIC_TABLES
g-eacodu.adb
body
Gnat.Exception_Actions.Core_Dump
g-excact.adb
body
GNAT.EXCEPTION_ACTIONS
g-exctra.adb
body
GNAT.EXCEPTION_TRACES
g-expect.adb
body
GNAT.EXPECT
g-heasor.adb
body
GNAT.HEAP_SORT
g-hesora.adb
body
GNAT.HEAP_SORT_A
g-hesorg.adb
body
GNAT.HEAP_SORT_G
g-htable.adb
body
GNAT.HTABLE
g-io.adb
body
GNAT.IO
g-io_aux.adb
body
GNAT.IO_AUX
g-locfil.adb
body
GNAT.LOCK_FILES
g-md5.adb
body
GNAT.MD5
g-memdum.adb
body
GNAT.MEMORY_DUMP
g-moreex.adb
body
GNAT.MOST_RECENT_EXCEPTION
g-os_lib.adb
body
GNAT.OS_LIB
g-pehage.adb
body
GNAT.PERFECT_HASH_GENERATORS
g-regexp.adb
body
GNAT.REGEXP
g-regist.adb
body
GNAT.REGISTRY
g-regpat.adb
body
GNAT.REGPAT
g-semaph.adb
body
GNAT.SEMAPHORES
g-sha1.adb
body
GNAT.SHA1
g-signal.adb
body
GNAT.SIGNALS
g-socket.adb
body
GNAT.SOCKETS
g-socthi.adb
body
GNAT.SOCKETS.THIN
g-speche.adb
body
GNAT.SPELLING_CHECKER
g-spipat.adb
body
GNAT.SPITBOL.PATTERNS
g-spitbo.adb
body
GNAT.SPITBOL
g-string.adb
body
GNAT.STRINGS
g-table.adb
body
GNAT.TABLE
g-tasloc.adb
body
GNAT.TASK_LOCK
g-thread.adb
body
GNAT.THREADS
g-traceb.adb
body
GNAT.TRACEBACK
g-trasym.adb
body
GNAT.TRACEBACK.SYMBOLIC
i-c.adb
body
Interfaces.C
i-cobol.adb
body
Interfaces.Cobol
i-cpoint.adb
body
Interfaces.C.Pointers
i-cpp.adb
body
Interfaces.Cpp
i-cstrea.adb
body
Interfaces.C_Streams
i-cstrin.adb
body
Interfaces.C.Strings
i-fortra.adb
body
Interfaces.Fortran
i-pacdec.adb
body
Interfaces.Packed_Decimal
i-vxwoio.adb
body
Interfaces.Vxworks.Io
s-addima.adb
body
System.Address_Image
s-addope.adb
body
System.Address_Operations
s-arit64.adb
body
System.Arith_64
s-assert.adb
body
System.Assertions
s-asthan.adb
body
System.Ast_Handling
s-atacco.adb
body
System.Address_To_Access_Conversions
s-bbinte.adb
body
System.Bb.Interrupts
s-bbprot.adb
body
System.Bb.Protection
s-bbseou.adb
body
System.Bb.Serial_Output
s-bbthqu.adb
body
System.Bb.Threads.Queues
s-bbthre.adb
body
System.Bb.Threads
s-bbtime.adb
body
System.Bb.Time
s-bitops.adb
body
System.Bit_Ops
s-carsi8.adb
body
System.Compare_Array_Signed_8
s-carun8.adb
body
System.Compare_Array_Unsigned_8
s-casi16.adb
body
System.Compare_Array_Signed_16
s-casi32.adb
body
System.Compare_Array_Signed_32
s-casi64.adb
body
System.Compare_Array_Signed_64
s-casuti.adb
body
System.Case_Util
s-caun16.adb
body
System.Compare_Array_Unsigned_16
s-caun32.adb
body
System.Compare_Array_Unsigned_32
s-caun64.adb
body
System.Compare_Array_Unsigned_64
s-crc32.adb
body
System.Crc32
s-direio.adb
body
System.Direct_Io
s-errrep.adb
body
System.Error_Reporting
s-exctab.adb
body
System.Exception_Table
s-exnint.adb
body
System.Exn_Int
s-exnllf.adb
body
System.Exn_Llf
s-exnlli.adb
body
System.Exn_Lli
s-expint.adb
body
System.Exp_Int
s-explli.adb
body
System.Exp_Lli
s-expllu.adb
body
System.Exp_Llu
s-expmod.adb
body
System.Exp_Mod
s-expuns.adb
body
System.Exp_Uns
s-fatgen.adb
body
System.Fat_Gen
s-fileio.adb
body
System.File_Io
s-finimp.adb
body
System.Finalization_Implementation
s-finroo.adb
body
System.Finalization_Root
s-fore.adb
body
System.Fore
s-gearop.adb
body
System.Generic_Array_Operations
s-gecobl.adb
body
System.Generic_Complex_Blas
s-gecola.adb
body
System.Generic_Complex_Lapack
s-gerebl.adb
body
System.Generic_Real_Blas
s-gerela.adb
body
System.Generic_Real_Lapack
s-geveop.adb
body
System.Generic_Vector_Operations
s-gloloc.adb
body
System.Global_Locks
s-htable.adb
body
System.Htable
s-imgbiu.adb
body
System.Img_Biu
s-imgboo.adb
body
System.Img_Bool
s-imgcha.adb
body
System.Img_Char
s-imgdec.adb
body
System.Img_Dec
s-imgenu.adb
body
System.Img_Enum
s-imgint.adb
body
System.Img_Int
s-imgllb.adb
body
System.Img_Llb
s-imglld.adb
body
System.Img_Lld
s-imglli.adb
body
System.Img_Lli
s-imgllu.adb
body
System.Img_Llu
s-imgllw.adb
body
System.Img_Llw
s-imgrea.adb
body
System.Img_Real
s-imguns.adb
body
System.Img_Uns
s-imgwch.adb
body
System.Img_Wchar
s-imgwiu.adb
body
System.Img_Wiu
s-inmaop.adb
body
System.Interrupt_Management.Operations
s-interr.adb
body
System.Interrupts
s-intman.adb
body
System.Interrupt_Management
s-io.adb
body
System.Io
s-mantis.adb
body
System.Mantissa
s-mastop.adb
body
System.Machine_State_Operations
s-memory.adb
body
System.Memory
s-osprim.adb
body
System.Os_Primitives
s-pack03.adb
body
System.Pack_03
s-pack05.adb
body
System.Pack_05
s-pack06.adb
body
System.Pack_06
s-pack07.adb
body
System.Pack_07
s-pack09.adb
body
System.Pack_09
s-pack10.adb
body
System.Pack_10
s-pack11.adb
body
System.Pack_11
s-pack12.adb
body
System.Pack_12
s-pack13.adb
body
System.Pack_13
s-pack14.adb
body
System.Pack_14
s-pack15.adb
body
System.Pack_15
s-pack17.adb
body
System.Pack_17
s-pack18.adb
body
System.Pack_18
s-pack19.adb
body
System.Pack_19
s-pack20.adb
body
System.Pack_20
s-pack21.adb
body
System.Pack_21
s-pack22.adb
body
System.Pack_22
s-pack23.adb
body
System.Pack_23
s-pack24.adb
body
System.Pack_24
s-pack25.adb
body
System.Pack_25
s-pack26.adb
body
System.Pack_26
s-pack27.adb
body
System.Pack_27
s-pack28.adb
body
System.Pack_28
s-pack29.adb
body
System.Pack_29
s-pack30.adb
body
System.Pack_30
s-pack31.adb
body
System.Pack_31
s-pack33.adb
body
System.Pack_33
s-pack34.adb
body
System.Pack_34
s-pack35.adb
body
System.Pack_35
s-pack36.adb
body
System.Pack_36
s-pack37.adb
body
System.Pack_37
s-pack38.adb
body
System.Pack_38
s-pack39.adb
body
System.Pack_39
s-pack40.adb
body
System.Pack_40
s-pack41.adb
body
System.Pack_41
s-pack42.adb
body
System.Pack_42
s-pack43.adb
body
System.Pack_43
s-pack44.adb
body
System.Pack_44
s-pack45.adb
body
System.Pack_45
s-pack46.adb
body
System.Pack_46
s-pack47.adb
body
System.Pack_47
s-pack48.adb
body
System.Pack_48
s-pack49.adb
body
System.Pack_49
s-pack50.adb
body
System.Pack_50
s-pack51.adb
body
System.Pack_51
s-pack52.adb
body
System.Pack_52
s-pack53.adb
body
System.Pack_53
s-pack54.adb
body
System.Pack_54
s-pack55.adb
body
System.Pack_55
s-pack56.adb
body
System.Pack_56
s-pack57.adb
body
System.Pack_57
s-pack58.adb
body
System.Pack_58
s-pack59.adb
body
System.Pack_59
s-pack60.adb
body
System.Pack_60
s-pack61.adb
body
System.Pack_61
s-pack62.adb
body
System.Pack_62
s-pack63.adb
body
System.Pack_63
s-parame.adb
body
System.Parameters
s-parint.adb
body
System.Partition_Interface
s-pooglo.adb
body
System.Pool_Global
s-pooloc.adb
body
System.Pool_Local
s-poosiz.adb
body
System.Pool_Size
s-proinf.adb
body
System.Program_Info
s-restri.adb
body
System.Restrictions
s-rpc.adb
body
System.Rpc
s-scaval.adb
body
System.Scalar_Values
s-secsta.adb
body
System.Secondary_Stack
s-sequio.adb
body
System.Sequential_Io
s-shasto.adb
body
System.Shared_Storage
s-sopco3.adb
body
System.String_Ops_Concat_3
s-sopco4.adb
body
System.String_Ops_Concat_4
s-sopco5.adb
body
System.String_Ops_Concat_5
s-stache.adb
body
System.Stack_Checking
s-stausa.adb
body
System.Stack_Usage
s-stoele.adb
body
System.Storage_Elements
s-stopoo.adb
body
System.Storage_Pools
s-stratt.adb
body
System.Stream_Attributes
s-strcom.adb
body
System.String_Compare
s-strops.adb
body
System.String_Ops
s-strxdr.adb
body
System.Stream_Attributes
s-tadeca.adb
body
System.Tasking.Async_Delays.Enqueue_Calendar
s-tadert.adb
body
System.Tasking.Async_Delays.Enqueue_Rt
s-taenca.adb
body
System.Tasking.Entry_Calls
s-tasdeb.adb
body
System.Tasking.Debug
s-tasinf.adb
body
System.Task_Info
s-tasque.adb
body
System.Tasking.Queuing
s-tasren.adb
body
System.Tasking.Rendezvous
s-tataat.adb
body
System.Tasking.Task_Attributes
s-tpinop.adb
body
System.Task_Primitives.Interrupt_Operations
s-tpoben.adb
body
System.Tasking.Protected_Objects.Entries
s-tpobop.adb
body
System.Tasking.Protected_Objects.Operations
s-tpopsp.adb
body
System.Task_Primitives.Operations.Specific
s-tporft.adb
body
System.Task_Primitives.Operations.Register_Foreign_Thread
s-traceb.adb
body
System.Traceback
s-traces.adb
body
System.Traces
s-traent.adb
body
System.Traceback_Entries
s-tratas.adb
body
System.Traces.Tasking
s-vaflop.adb
body
System.Vax_Float_Operations
s-valboo.adb
body
System.Val_Bool
s-valcha.adb
body
System.Val_Char
s-valdec.adb
body
System.Val_Dec
s-valenu.adb
body
System.Val_Enum
s-valint.adb
body
System.Val_Int
s-vallld.adb
body
System.Val_Lld
s-vallli.adb
body
System.Val_Lli
s-valllu.adb
body
System.Val_Llu
s-valrea.adb
body
System.Val_Real
s-valuns.adb
body
System.Val_Uns
s-valuti.adb
body
System.Val_Util
s-valwch.adb
body
System.Val_Wchar
s-veboop.adb
body
System.Vectors.Boolean_Operations
s-vercon.adb
body
System.Version_Control
s-vmexta.adb
body
System.Vms_Exception_Table
s-vxwexc.adb
body
System.Vxworks_Exceptions
s-wchcnv.adb
body
System.Wch_Cnv
s-wchcon.adb
body
System.Wch_Con
s-wchjis.adb
body
System.Wch_Jis
s-wchstw.adb
body
System.Wch_Stw
s-wchwts.adb
body
System.Wch_Wts
s-widboo.adb
body
System.Wid_Bool
s-widcha.adb
body
System.Wid_Char
s-widenu.adb
body
System.Wid_Enum
s-widlli.adb
body
System.Wid_Lli
s-widllu.adb
body
System.Wid_Llu
s-widwch.adb
body
System.Wid_Wchar
s-wwdcha.adb
body
System.Wwd_Char
s-wwdenu.adb
body
System.Wwd_Enum
s-wwdwch.adb
body
System.Wwd_Wchar
a-astaco.ads
spec
Ada.Asynchronous_Task_Control
a-calari.ads
spec
Ada.Calendar.Arithmetic
a-caldel.ads
spec
Ada.Calendar.Delays
a-calend.ads
spec
Ada.Calendar
a-calfor.ads
spec
Ada.Calendar.Formatting
a-catizo.ads
spec
Ada.Calendar.Time_Zones
a-cbdlli.ads
spec
Ada.Containers.Bounded_Doubly_Linked_Lists
a-cdlili.ads
spec
Ada.Containers.Doubly_Linked_Lists
a-cgaaso.ads
spec
Ada.Containers.Generic_Anonymous_Array_Sort
a-cgarso.ads
spec
Ada.Containers.Generic_Array_Sort
a-cgcaso.ads
spec
Ada.Containers.Generic_Constrained_Array_Sort
a-chacon.ads
spec
Ada.Characters.Conversions
a-chahan.ads
spec
Ada.Characters.Handling
a-charac.ads
spec
Ada.Characters
a-chlat1.ads
spec
Ada.Characters.Latin_1
a-chlat9.ads
spec
Ada.Characters.Latin_9
a-chtgke.ads
spec
Ada.Containers.Hash_Tables.Generic_Keys
a-chtgop.ads
spec
Ada.Containers.Hash_Tables.Generic_Operations
a-chzla1.ads
spec
Ada.Characters.Wide_Wide_Latin_1
a-chzla9.ads
spec
Ada.Characters.Wide_Wide_Latin_9
a-cidlli.ads
spec
Ada.Containers.Indefinite_Doubly_Linked_Lists
a-cihama.ads
spec
Ada.Containers.Indefinite_Hashed_Maps
a-cihase.ads
spec
Ada.Containers.Indefinite_Hashed_Sets
a-ciorma.ads
spec
Ada.Containers.Indefinite_Ordered_Maps
a-ciormu.ads
spec
Ada.Containers.Indefinite_Ordered_Multisets
a-ciorse.ads
spec
Ada.Containers.Indefinite_Ordered_Sets
a-cohama.ads
spec
Ada.Containers.Hashed_Maps
a-cohase.ads
spec
Ada.Containers.Hashed_Sets
a-cohata.ads
spec
Ada.Containers.Hash_Tables
a-coinve.ads
spec
Ada.Containers.Indefinite_Vectors
a-colien.ads
spec
Ada.Command_Line.Environment
a-colire.ads
spec
Ada.Command_Line.Remove
a-comlin.ads
spec
Ada.Command_Line
a-contai.ads
spec
Ada.Containers
a-convec.ads
spec
Ada.Containers.Vectors
a-coorma.ads
spec
Ada.Containers.Ordered_Maps
a-coormu.ads
spec
Ada.Containers.Ordered_Multisets
a-coorse.ads
spec
Ada.Containers.Ordered_Sets
a-coprnu.ads
spec
Ada.Containers.Prime_Numbers
a-coteio.ads
spec
Ada.Complex_Text_Io
a-crbltr.ads
spec
Ada.Containers.Red_Black_Trees
a-crbtgk.ads
spec
Ada.Containers.Red_Black_Trees.Generic_Keys
a-crbtgo.ads
spec
Ada.Containers.Red_Black_Trees.Generic_Operations
a-crdlli.ads
spec
Ada.Containers.Restricted_Doubly_Linked_Lists
a-cwila1.ads
spec
Ada.Characters.Wide_Latin_1
a-cwila9.ads
spec
Ada.Characters.Wide_Latin_9
a-decima.ads
spec
Ada.Decimal
a-diocst.ads
spec
Ada.Direct_Io.C_Streams
a-direct.ads
spec
Ada.Directories
a-direio.ads
spec
Ada.Direct_Io
a-diroro.ads
spec
Ada.Dispatching.Round_Robin
a-dirval.ads
spec
Ada.Directories.Validity
a-disedf.ads
spec
Ada.Dispatching.Edf
a-dispat.ads
spec
Ada.Dispatching
a-dynpri.ads
spec
Ada.Dynamic_Priorities
a-einuoc.ads
spec
Ada.Exceptions.Is_Null_Occurrence
a-elchha.ads
spec
Ada.Exceptions.Last_Chance_Handler
a-envvar.ads
spec
Ada.Environment_Variables
a-etgrbu.ads
spec
Ada.Execution_Time.Group_Budgets
a-exctra.ads
spec
Ada.Exceptions.Traceback
a-exetim.ads
spec
Ada.Execution_Time
a-extiti.ads
spec
Ada.Execution_Time.Timers
a-filico.ads
spec
Ada.Finalization.List_Controller
a-finali.ads
spec
Ada.Finalization
a-flteio.ads
spec
Ada.Float_Text_Io
a-fwteio.ads
spec
Ada.Float_Wide_Text_Io
a-fzteio.ads
spec
Ada.Float_Wide_Wide_Text_Io
a-inteio.ads
spec
Ada.Integer_Text_Io
a-interr.ads
spec
Ada.Interrupts
a-intnam.ads
spec
Ada.Interrupts.Names
a-intsig.ads
spec
Ada.Interrupts.Signal
a-ioexce.ads
spec
Ada.Io_Exceptions
a-iwteio.ads
spec
Ada.Integer_Wide_Text_Io
a-izteio.ads
spec
Ada.Integer_Wide_Wide_Text_Io
a-lcteio.ads
spec
Ada.Long_Complex_Text_Io
a-lfteio.ads
spec
Ada.Long_Float_Text_Io
a-lfwtio.ads
spec
Ada.Long_Float_Wide_Text_Io
a-lfztio.ads
spec
Ada.Long_Float_Wide_Wide_Text_Io
a-liteio.ads
spec
Ada.Long_Integer_Text_Io
a-liwtio.ads
spec
Ada.Long_Integer_Wide_Text_Io
a-liztio.ads
spec
Ada.Long_Integer_Wide_Wide_Text_Io
a-llctio.ads
spec
Ada.Long_Long_Complex_Text_Io
a-llftio.ads
spec
Ada.Long_Long_Float_Text_Io
a-llfwti.ads
spec
Ada.Long_Long_Float_Wide_Text_Io
a-llfzti.ads
spec
Ada.Long_Long_Float_Wide_Wide_Text_Io
a-llitio.ads
spec
Ada.Long_Long_Integer_Text_Io
a-lliwti.ads
spec
Ada.Long_Long_Integer_Wide_Text_Io
a-llizti.ads
spec
Ada.Long_Long_Integer_Wide_Wide_Text_Io
a-ncelfu.ads
spec
Ada.Numerics.Complex_Elementary_Functions
a-ngcefu.ads
spec
Ada.Numerics.Generic_Complex_Elementary_Functions
a-ngcoar.ads
spec
Ada.Numerics.Generic_Complex_Arrays
a-ngcoty.ads
spec
Ada.Numerics.Generic_Complex_Types
a-ngelfu.ads
spec
Ada.Numerics.Generic_Elementary_Functions
a-ngrear.ads
spec
Ada.Numerics.Generic_Real_Arrays
a-nlcefu.ads
spec
Ada.Numerics.Long_Complex_Elementary_Functions
a-nlcoar.ads
spec
Ada.Numerics.Long_Complex_Arrays
a-nlcoty.ads
spec
Ada.Numerics.Long_Complex_Types
a-nlelfu.ads
spec
Ada.Numerics.Long_Elementary_Functions
a-nllcar.ads
spec
Ada.Numerics.Long_Long_Complex_Arrays
a-nllcef.ads
spec
Ada.Numerics.Long_Long_Complex_Elementary_Functions
a-nllcty.ads
spec
Ada.Numerics.Long_Long_Complex_Types
a-nllefu.ads
spec
Ada.Numerics.Long_Long_Elementary_Functions
a-nllrar.ads
spec
Ada.Numerics.Long_Long_Real_Arrays
a-nlrear.ads
spec
Ada.Numerics.Long_Real_Arrays
a-nscefu.ads
spec
Ada.Numerics.Short_Complex_Elementary_Functions
a-nscoty.ads
spec
Ada.Numerics.Short_Complex_Types
a-nselfu.ads
spec
Ada.Numerics.Short_Elementary_Functions
a-nucoar.ads
spec
Ada.Numerics.Complex_Arrays
a-nucoty.ads
spec
Ada.Numerics.Complex_Types
a-nudira.ads
spec
Ada.Numerics.Discrete_Random
a-nuelfu.ads
spec
Ada.Numerics.Elementary_Functions
a-nuflra.ads
spec
Ada.Numerics.Float_Random
a-numaux.ads
spec
Ada.Numerics.Aux
a-numeri.ads
spec
Ada.Numerics
a-nurear.ads
spec
Ada.Numerics.Real_Arrays
a-rbtgso.ads
spec
Ada.Containers.Red_Black_Trees.Generic_Set_Operations
a-reatim.ads
spec
Ada.Real_Time
a-retide.ads
spec
Ada.Real_Time.Delays
a-rttiev.ads
spec
Ada.Real_Time.Timing_Events
a-scteio.ads
spec
Ada.Short_Complex_Text_Io
a-secain.ads
spec
Ada.Strings.Equal_Case_Insensitive
a-sequio.ads
spec
Ada.Sequential_Io
a-sfteio.ads
spec
Ada.Short_Float_Text_Io
a-sfwtio.ads
spec
Ada.Short_Float_Wide_Text_Io
a-sfztio.ads
spec
Ada.Short_Float_Wide_Wide_Text_Io
a-shcain.ads
spec
Ada.Strings.Hash_Case_Insensitive
a-siocst.ads
spec
Ada.Sequential_Io.C_Streams
a-siteio.ads
spec
Ada.Short_Integer_Text_Io
a-siwtio.ads
spec
Ada.Short_Integer_Wide_Text_Io
a-siztio.ads
spec
Ada.Short_Integer_Wide_Wide_Text_Io
a-slcain.ads
spec
Ada.Strings.Less_Case_Insensitive
a-ssicst.ads
spec
Ada.Streams.Stream_Io.C_Streams
a-ssitio.ads
spec
Ada.Short_Short_Integer_Text_Io
a-ssiwti.ads
spec
Ada.Short_Short_Integer_Wide_Text_Io
a-ssizti.ads
spec
Ada.Short_Short_Integer_Wide_Wide_Text_Io
a-stboha.ads
spec
Ada.Strings.Bounded.Hash
a-stfiha.ads
spec
Ada.Strings.Fixed.Hash
a-stmaco.ads
spec
Ada.Strings.Maps.Constants
a-storio.ads
spec
Ada.Storage_Io
a-strbou.ads
spec
Ada.Strings.Bounded
a-stream.ads
spec
Ada.Streams
a-strfix.ads
spec
Ada.Strings.Fixed
a-strhas.ads
spec
Ada.Strings.Hash
a-string.ads
spec
Ada.Strings
a-strmap.ads
spec
Ada.Strings.Maps
a-strsea.ads
spec
Ada.Strings.Search
a-strsup.ads
spec
Ada.Strings.Superbounded
a-strunb.ads
spec
Ada.Strings.Unbounded
a-ststio.ads
spec
Ada.Streams.Stream_Io
ada.ads
spec
Ada
a-stunau.ads
spec
Ada.Strings.Unbounded.Aux
a-stunha.ads
spec
Ada.Strings.Unbounded.Hash
a-stwibo.ads
spec
Ada.Strings.Wide_Bounded
a-stwifi.ads
spec
Ada.Strings.Wide_Fixed
a-stwiha.ads
spec
Ada.Strings.Wide_Hash
a-stwima.ads
spec
Ada.Strings.Wide_Maps
a-stwise.ads
spec
Ada.Strings.Wide_Search
a-stwisu.ads
spec
Ada.Strings.Wide_Superbounded
a-stwiun.ads
spec
Ada.Strings.Wide_Unbounded
a-stzbou.ads
spec
Ada.Strings.Wide_Wide_Bounded
a-stzfix.ads
spec
Ada.Strings.Wide_Wide_Fixed
a-stzhas.ads
spec
Ada.Strings.Wide_Wide_Hash
a-stzmap.ads
spec
Ada.Strings.Wide_Wide_Maps
a-stzsea.ads
spec
Ada.Strings.Wide_Wide_Search
a-stzsup.ads
spec
Ada.Strings.Wide_Wide_Superbounded
a-stzunb.ads
spec
Ada.Strings.Wide_Wide_Unbounded
a-suteio.ads
spec
Ada.Strings.Unbounded.Text_Io
a-swbwha.ads
spec
Ada.Strings.Wide_Bounded.Wide_Hash
a-swfwha.ads
spec
Ada.Strings.Wide_Fixed.Wide_Hash
a-swmwco.ads
spec
Ada.Strings.Wide_Maps.Wide_Constants
a-swunau.ads
spec
Ada.Strings.Wide_Unbounded.Aux
a-swuwha.ads
spec
Ada.Strings.Wide_Unbounded.Wide_Hash
a-swuwti.ads
spec
Ada.Strings.Wide_Unbounded.Wide_Text_Io
a-sytaco.ads
spec
Ada.Synchronous_Task_Control
a-szbzha.ads
spec
Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Hash
a-szfzha.ads
spec
Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash
a-szmzco.ads
spec
Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants
a-szunau.ads
spec
Ada.Strings.Wide_Wide_Unbounded.Aux
a-szuzha.ads
spec
Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash
a-szuzti.ads
spec
Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_Io
a-tags.ads
spec
Ada.Tags
a-tasatt.ads
spec
Ada.Task_Attributes
a-taside.ads
spec
Ada.Task_Identification
a-taster.ads
spec
Ada.Task_Termination
a-teioed.ads
spec
Ada.Text_Io.Editing
a-textio.ads
spec
Ada.Text_Io
a-tiboio.ads
spec
Ada.Text_Io.Bounded_Io
a-ticoau.ads
spec
Ada.Text_Io.Complex_Aux
a-ticoio.ads
spec
Ada.Text_Io.Complex_Io
a-tideau.ads
spec
Ada.Text_Io.Decimal_Aux
a-tideio.ads
spec
Ada.Text_Io.Decimal_Io
a-tienau.ads
spec
Ada.Text_Io.Enumeration_Aux
a-tienio.ads
spec
Ada.Text_Io.Enumeration_Io
a-tifiau.ads
spec
Ada.Text_Io.Fixed_Aux
a-tifiio.ads
spec
Ada.Text_Io.Fixed_Io
a-tiflau.ads
spec
Ada.Text_Io.Float_Aux
a-tiflio.ads
spec
Ada.Text_Io.Float_Io
a-tigeau.ads
spec
Ada.Text_Io.Generic_Aux
a-tiinau.ads
spec
Ada.Text_Io.Integer_Aux
a-tiinio.ads
spec
Ada.Text_Io.Integer_Io
a-timoau.ads
spec
Ada.Text_Io.Modular_Aux
a-timoio.ads
spec
Ada.Text_Io.Modular_Io
a-tiocst.ads
spec
Ada.Text_Io.C_Streams
a-titest.ads
spec
Ada.Text_Io.Text_Streams
a-tiunio.ads
spec
Ada.Text_Io.Unbounded_Io
a-unccon.ads
spec
Ada.Unchecked_Conversion
a-uncdea.ads
spec
Ada.Unchecked_Deallocation
a-wichun.ads
spec
Ada.Wide_Characters.Unicode
a-widcha.ads
spec
Ada.Wide_Characters
a-witeio.ads
spec
Ada.Wide_Text_Io
a-wtcoau.ads
spec
Ada.Wide_Text_Io.Complex_Aux
a-wtcoio.ads
spec
Ada.Wide_Text_Io.Complex_Io
a-wtcstr.ads
spec
Ada.Wide_Text_Io.C_Streams
a-wtdeau.ads
spec
Ada.Wide_Text_Io.Decimal_Aux
a-wtdeio.ads
spec
Ada.Wide_Text_Io.Decimal_Io
a-wtedit.ads
spec
Ada.Wide_Text_Io.Editing
a-wtenau.ads
spec
Ada.Wide_Text_Io.Enumeration_Aux
a-wtenio.ads
spec
Ada.Wide_Text_Io.Enumeration_Io
a-wtfiio.ads
spec
Ada.Wide_Text_Io.Fixed_Io
a-wtflau.ads
spec
Ada.Wide_Text_Io.Float_Aux
a-wtflio.ads
spec
Ada.Wide_Text_Io.Float_Io
a-wtgeau.ads
spec
Ada.Wide_Text_Io.Generic_Aux
a-wtinau.ads
spec
Ada.Wide_Text_Io.Integer_Aux
a-wtinio.ads
spec
Ada.Wide_Text_Io.Integer_Io
a-wtmoau.ads
spec
Ada.Wide_Text_Io.Modular_Aux
a-wtmoio.ads
spec
Ada.Wide_Text_Io.Modular_Io
a-wttest.ads
spec
Ada.Wide_Text_Io.Text_Streams
a-wwboio.ads
spec
Ada.Wide_Text_Io.Wide_Bounded_Io
a-wwunio.ads
spec
Ada.Wide_Text_Io.Wide_Unbounded_Io
a-zchara.ads
spec
Ada.Wide_Wide_Characters
a-zchuni.ads
spec
Ada.Wide_Wide_Characters.Unicode
a-ztcoau.ads
spec
Ada.Wide_Wide_Text_Io.Complex_Aux
a-ztcoio.ads
spec
Ada.Wide_Wide_Text_Io.Complex_Io
a-ztcstr.ads
spec
Ada.Wide_Wide_Text_Io.C_Streams
a-ztdeau.ads
spec
Ada.Wide_Wide_Text_Io.Decimal_Aux
a-ztdeio.ads
spec
Ada.Wide_Wide_Text_Io.Decimal_Io
a-ztedit.ads
spec
Ada.Wide_Wide_Text_Io.Editing
a-ztenau.ads
spec
Ada.Wide_Wide_Text_Io.Enumeration_Aux
a-ztenio.ads
spec
Ada.Wide_Wide_Text_Io.Enumeration_Io
a-ztexio.ads
spec
Ada.Wide_Wide_Text_Io
a-ztfiio.ads
spec
Ada.Wide_Wide_Text_Io.Fixed_Io
a-ztflau.ads
spec
Ada.Wide_Wide_Text_Io.Float_Aux
a-ztflio.ads
spec
Ada.Wide_Wide_Text_Io.Float_Io
a-ztgeau.ads
spec
Ada.Wide_Wide_Text_Io.Generic_Aux
a-ztinau.ads
spec
Ada.Wide_Wide_Text_Io.Integer_Aux
a-ztinio.ads
spec
Ada.Wide_Wide_Text_Io.Integer_Io
a-ztmoau.ads
spec
Ada.Wide_Wide_Text_Io.Modular_Aux
a-ztmoio.ads
spec
Ada.Wide_Wide_Text_Io.Modular_Io
a-zttest.ads
spec
Ada.Wide_Wide_Text_Io.Text_Streams
a-zzboio.ads
spec
Ada.Wide_Wide_Text_Io.Wide_Wide_Bounded_Io
a-zzunio.ads
spec
Ada.Wide_Wide_Text_Io.Wide_Wide_Unbounded_Io
calendar.ads
spec
Calendar
g-allein.ads
spec
GNAT.ALTIVEC.LOW_LEVEL_INTERFACE
g-alleve.ads
spec
GNAT.ALTIVEC.LOW_LEVEL_VECTORS
g-altcon.ads
spec
GNAT.ALTIVEC.CONVERSIONS
g-altdes.ads
spec
GNAT.ALTIVEC.DESIGN
g-altive.ads
spec
GNAT.ALTIVEC
g-alveop.ads
spec
GNAT.ALTIVEC.VECTOR_OPERATIONS
g-alvety.ads
spec
GNAT.ALTIVEC.VECTOR_TYPES
g-alvevi.ads
spec
GNAT.ALTIVEC.VECTOR_VIEWS
g-arrspl.ads
spec
Gnat.Array_Split
g-awk.ads
spec
GNAT.AWK
g-boubuf.ads
spec
GNAT.BOUNDED_BUFFERS
g-boumai.ads
spec
GNAT.BOUNDED_MAILBOXES
g-bubsor.ads
spec
GNAT.BUBBLE_SORT
g-busora.ads
spec
GNAT.BUBBLE_SORT_A
g-busorg.ads
spec
Gnat.Bubble_Sort_G
g-bytswa.ads
spec
GNAT.BYTE_SWAPPING
g-calend.ads
spec
GNAT.CALENDAR
g-casuti.ads
spec
GNAT.CASE_UTIL
g-catiio.ads
spec
GNAT.CALENDAR.TIME_IO
g-cgi.ads
spec
GNAT.CGI
g-cgicoo.ads
spec
GNAT.CGI.COOKIE
g-cgideb.ads
spec
GNAT.CGI.DEBUG
g-comlin.ads
spec
GNAT.COMMAND_LINE
g-comver.ads
spec
GNAT.COMPILER_VERSION
g-crc32.ads
spec
GNAT.CRC32
g-ctrl_c.ads
spec
GNAT.CTRL_C
g-curexc.ads
spec
GNAT.CURRENT_EXCEPTION
g-debpoo.ads
spec
GNAT.DEBUG_POOLS
g-debuti.ads
spec
GNAT.DEBUG_UTILITIES
g-diopit.ads
spec
GNAT.DIRECTORY_OPERATIONS.ITERATION
g-dirope.ads
spec
GNAT.DIRECTORY_OPERATIONS
g-dynhta.ads
spec
GNAT.DYNAMIC_HTABLES
g-dyntab.ads
spec
GNAT.DYNAMIC_TABLES
g-excact.ads
spec
GNAT.EXCEPTION_ACTIONS
g-except.ads
spec
GNAT.EXCEPTIONS
g-exctra.ads
spec
GNAT.EXCEPTION_TRACES
g-expect.ads
spec
GNAT.EXPECT
g-flocon.ads
spec
GNAT.FLOAT_CONTROL
g-heasor.ads
spec
GNAT.HEAP_SORT
g-hesora.ads
spec
GNAT.HEAP_SORT_A
g-hesorg.ads
spec
Gnat.Heap_Sort_G
g-htable.ads
spec
GNAT.HTABLE
g-io.ads
spec
GNAT.IO
g-io_aux.ads
spec
GNAT.IO_AUX
g-locfil.ads
spec
GNAT.LOCK_FILES
g-md5.ads
spec
GNAT.MD5
g-memdum.ads
spec
GNAT.MEMORY_DUMP
g-moreex.ads
spec
GNAT.MOST_RECENT_EXCEPTION
g-os_lib.ads
spec
GNAT.OS_LIB
g-pehage.ads
spec
GNAT.PERFECT_HASH_GENERATORS
g-regexp.ads
spec
GNAT.REGEXP
g-regist.ads
spec
GNAT.REGISTRY
g-regpat.ads
spec
GNAT.REGPAT
g-semaph.ads
spec
GNAT.SEMAPHORES
g-sestin.ads
spec
GNAT.SECONDARY_STACK_INFO
g-sha1.ads
spec
GNAT.SHA1
g-signal.ads
spec
GNAT.SIGNALS
g-soccon.ads
spec
GNAT.SOCKETS.CONSTANTS
g-socket.ads
spec
GNAT.SOCKETS
g-socthi.ads
spec
GNAT.SOCKETS.THIN
g-soliop.ads
spec
GNAT.SOCKETS.LINKER_OPTIONS
g-souinf.ads
spec
GNAT.SOURCE_INFO
g-speche.ads
spec
GNAT.SPELLING_CHECKER
g-spipat.ads
spec
GNAT.SPITBOL.PATTERNS
g-spitbo.ads
spec
GNAT.SPITBOL
g-sptabo.ads
spec
GNAT.SPITBOL.TABLE_BOOLEAN
g-sptain.ads
spec
GNAT.SPITBOL.TABLE_INTEGER
g-sptavs.ads
spec
GNAT.SPITBOL.TABLE_VSTRING
g-string.ads
spec
GNAT.STRINGS
g-strspl.ads
spec
GNAT.STRING_SPLIT
g-table.ads
spec
GNAT.TABLE
g-tasloc.ads
spec
GNAT.TASK_LOCK
g-thread.ads
spec
GNAT.THREADS
g-traceb.ads
spec
GNAT.TRACEBACK
g-trasym.ads
spec
GNAT.TRACEBACK.SYMBOLIC
g-utf_32.ads
spec
GNAT.UTF_32
g-wistsp.ads
spec
GNAT.WIDE_STRING_SPLIT
g-zstspl.ads
spec
GNAT.WIDE_WIDE_STRING_SPLIT
gnat.ads
spec
GNAT
i-c.ads
spec
Interfaces.C
i-cexten.ads
spec
Interfaces.C.Extensions
i-cobol.ads
spec
Interfaces.Cobol
i-cpoint.ads
spec
Interfaces.C.Pointers
i-cpp.ads
spec
Interfaces.Cpp
i-cstrea.ads
spec
Interfaces.C_Streams
i-cstrin.ads
spec
Interfaces.C.Strings
i-forbla.ads
spec
Interfaces.Fortran.Blas
i-forlap.ads
spec
Interfaces.Fortran.Lapack
i-fortra.ads
spec
Interfaces.Fortran
i-jalaob.ads
spec
Interfaces.Java.Lang.Object
i-jalasy.ads
spec
Interfaces.Java.Lang.System
i-jalath.ads
spec
Interfaces.Java.Lang.Thread
i-java.ads
spec
Interfaces.Java
i-javlan.ads
spec
Interfaces.Java.Lang
i-pacdec.ads
spec
Interfaces.Packed_Decimal
i-vxwoio.ads
spec
Interfaces.Vxworks.Io
i-vxwork.ads
spec
Interfaces.Vxworks
interfac.ads
spec
Interfaces
machcode.ads
spec
Machine_Code
s-addima.ads
spec
System.Address_Image
s-addope.ads
spec
System.Address_Operations
s-arit64.ads
spec
System.Arith_64
s-assert.ads
spec
System.Assertions
s-asthan.ads
spec
System.Ast_Handling
s-atacco.ads
spec
System.Address_To_Access_Conversions
s-auxdec.ads
spec
System.Aux_Dec
s-auxvad.ads
spec
System.Aux_Vads_Sgi
s-bb.ads
spec
System.Bb
s-bbinte.ads
spec
System.Bb.Interrupts
s-bbprot.ads
spec
System.Bb.Protection
s-bbseou.ads
spec
System.Bb.Serial_Output
s-bbthqu.ads
spec
System.Bb.Threads.Queues
s-bbthre.ads
spec
System.Bb.Threads
s-bbtime.ads
spec
System.Bb.Time
s-bitops.ads
spec
System.Bit_Ops
s-boarop.ads
spec
System.Boolean_Array_Operations
s-carsi8.ads
spec
System.Compare_Array_Signed_8
s-carun8.ads
spec
System.Compare_Array_Unsigned_8
s-casi16.ads
spec
System.Compare_Array_Signed_16
s-casi32.ads
spec
System.Compare_Array_Signed_32
s-casi64.ads
spec
System.Compare_Array_Signed_64
s-casuti.ads
spec
System.Case_Util
s-caun16.ads
spec
System.Compare_Array_Unsigned_16
s-caun32.ads
spec
System.Compare_Array_Unsigned_32
s-caun64.ads
spec
System.Compare_Array_Unsigned_64
s-chepoo.ads
spec
System.Checked_Pools
s-crc32.ads
spec
System.Crc32
s-crtl.ads
spec
System.Crtl
s-direio.ads
spec
System.Direct_Io
s-dsaser.ads
spec
System.Dsa_Services
s-errrep.ads
spec
System.Error_Reporting
s-exctab.ads
spec
System.Exception_Table
s-exnint.ads
spec
System.Exn_Int
s-exnllf.ads
spec
System.Exn_Llf
s-exnlli.ads
spec
System.Exn_Lli
s-expint.ads
spec
System.Exp_Int
s-explli.ads
spec
System.Exp_Lli
s-expllu.ads
spec
System.Exp_Llu
s-expmod.ads
spec
System.Exp_Mod
s-expuns.ads
spec
System.Exp_Uns
s-fatflt.ads
spec
System.Fat_Flt
s-fatgen.ads
spec
System.Fat_Gen
s-fatlfl.ads
spec
System.Fat_Lflt
s-fatllf.ads
spec
System.Fat_Llf
s-fatsfl.ads
spec
System.Fat_Sflt
s-ficobl.ads
spec
System.File_Control_Block
s-fileio.ads
spec
System.File_Io
s-filofl.ads
spec
System.Fat_Ieee_Long_Float
s-finimp.ads
spec
System.Finalization_Implementation
s-finroo.ads
spec
System.Finalization_Root
s-fishfl.ads
spec
System.Fat_Ieee_Short_Float
s-fore.ads
spec
System.Fore
s-fvadfl.ads
spec
System.Fat_Vax_D_Float
s-fvaffl.ads
spec
System.Fat_Vax_F_Float
s-fvagfl.ads
spec
System.Fat_Vax_G_Float
s-gearop.ads
spec
System.Generic_Array_Operations
s-gecobl.ads
spec
System.Generic_Complex_Blas
s-gecola.ads
spec
System.Generic_Complex_Lapack
s-gerebl.ads
spec
System.Generic_Real_Blas
s-gerela.ads
spec
System.Generic_Real_Lapack
s-geveop.ads
spec
System.Generic_Vector_Operations
s-gloloc.ads
spec
System.Global_Locks
s-hibaen.ads
spec
System.Hie_Back_End
s-htable.ads
spec
System.Htable
s-imgbiu.ads
spec
System.Img_Biu
s-imgboo.ads
spec
System.Img_Bool
s-imgcha.ads
spec
System.Img_Char
s-imgdec.ads
spec
System.Img_Dec
s-imgenu.ads
spec
System.Img_Enum
s-imgint.ads
spec
System.Img_Int
s-imgllb.ads
spec
System.Img_Llb
s-imglld.ads
spec
System.Img_Lld
s-imglli.ads
spec
System.Img_Lli
s-imgllu.ads
spec
System.Img_Llu
s-imgllw.ads
spec
System.Img_Llw
s-imgrea.ads
spec
System.Img_Real
s-imguns.ads
spec
System.Img_Uns
s-imgwch.ads
spec
System.Img_Wchar
s-imgwiu.ads
spec
System.Img_Wiu
s-inmaop.ads
spec
System.Interrupt_Management.Operations
s-interr.ads
spec
System.Interrupts
s-intman.ads
spec
System.Interrupt_Management
s-io.ads
spec
System.Io
s-maccod.ads
spec
System.Machine_Code
s-mantis.ads
spec
System.Mantissa
s-memcop.ads
spec
System.Memory_Copy
s-memory.ads
spec
System.Memory
s-osinte.ads
spec
System.Os_Interface
s-osprim.ads
spec
System.Os_Primitives
s-pack03.ads
spec
System.Pack_03
s-pack05.ads
spec
System.Pack_05
s-pack06.ads
spec
System.Pack_06
s-pack07.ads
spec
System.Pack_07
s-pack09.ads
spec
System.Pack_09
s-pack10.ads
spec
System.Pack_10
s-pack11.ads
spec
System.Pack_11
s-pack12.ads
spec
System.Pack_12
s-pack13.ads
spec
System.Pack_13
s-pack14.ads
spec
System.Pack_14
s-pack15.ads
spec
System.Pack_15
s-pack17.ads
spec
System.Pack_17
s-pack18.ads
spec
System.Pack_18
s-pack19.ads
spec
System.Pack_19
s-pack20.ads
spec
System.Pack_20
s-pack21.ads
spec
System.Pack_21
s-pack22.ads
spec
System.Pack_22
s-pack23.ads
spec
System.Pack_23
s-pack24.ads
spec
System.Pack_24
s-pack25.ads
spec
System.Pack_25
s-pack26.ads
spec
System.Pack_26
s-pack27.ads
spec
System.Pack_27
s-pack28.ads
spec
System.Pack_28
s-pack29.ads
spec
System.Pack_29
s-pack30.ads
spec
System.Pack_30
s-pack31.ads
spec
System.Pack_31
s-pack33.ads
spec
System.Pack_33
s-pack34.ads
spec
System.Pack_34
s-pack35.ads
spec
System.Pack_35
s-pack36.ads
spec
System.Pack_36
s-pack37.ads
spec
System.Pack_37
s-pack38.ads
spec
System.Pack_38
s-pack39.ads
spec
System.Pack_39
s-pack40.ads
spec
System.Pack_40
s-pack41.ads
spec
System.Pack_41
s-pack42.ads
spec
System.Pack_42
s-pack43.ads
spec
System.Pack_43
s-pack44.ads
spec
System.Pack_44
s-pack45.ads
spec
System.Pack_45
s-pack46.ads
spec
System.Pack_46
s-pack47.ads
spec
System.Pack_47
s-pack48.ads
spec
System.Pack_48
s-pack49.ads
spec
System.Pack_49
s-pack50.ads
spec
System.Pack_50
s-pack51.ads
spec
System.Pack_51
s-pack52.ads
spec
System.Pack_52
s-pack53.ads
spec
System.Pack_53
s-pack54.ads
spec
System.Pack_54
s-pack55.ads
spec
System.Pack_55
s-pack56.ads
spec
System.Pack_56
s-pack57.ads
spec
System.Pack_57
s-pack58.ads
spec
System.Pack_58
s-pack59.ads
spec
System.Pack_59
s-pack60.ads
spec
System.Pack_60
s-pack61.ads
spec
System.Pack_61
s-pack62.ads
spec
System.Pack_62
s-pack63.ads
spec
System.Pack_63
s-parame.ads
spec
System.Parameters
s-parint.ads
spec
System.Partition_Interface
s-pooglo.ads
spec
System.Pool_Global
s-pooloc.ads
spec
System.Pool_Local
s-poosiz.ads
spec
System.Pool_Size
s-powtab.ads
spec
System.Powten_Table
s-proinf.ads
spec
System.Program_Info
s-purexc.ads
spec
System.Pure_Exceptions
s-restri.ads
spec
System.Restrictions
s-rident.ads
spec
System.Rident
s-rpc.ads
spec
System.Rpc
s-scaval.ads
spec
System.Scalar_Values
s-secsta.ads
spec
System.Secondary_Stack
s-sequio.ads
spec
System.Sequential_Io
s-shasto.ads
spec
System.Shared_Storage
s-soflin.ads
spec
System.Soft_Links
s-solita.ads
spec
System.Soft_Links.Tasking
s-sopco3.ads
spec
System.String_Ops_Concat_3
s-sopco4.ads
spec
System.String_Ops_Concat_4
s-sopco5.ads
spec
System.String_Ops_Concat_5
s-stache.ads
spec
System.Stack_Checking
s-stausa.ads
spec
System.Stack_Usage
s-stoele.ads
spec
System.Storage_Elements
s-stopoo.ads
spec
System.Storage_Pools
s-stratt.ads
spec
System.Stream_Attributes
s-strcom.ads
spec
System.String_Compare
s-strops.ads
spec
System.String_Ops
s-taasde.ads
spec
System.Tasking.Async_Delays
s-tadeca.ads
spec
System.Tasking.Async_Delays.Enqueue_Calendar
s-tadert.ads
spec
System.Tasking.Async_Delays.Enqueue_Rt
s-taenca.ads
spec
System.Tasking.Entry_Calls
s-taprob.ads
spec
System.Tasking.Protected_Objects
s-taprop.ads
spec
System.Task_Primitives.Operations
s-tarest.ads
spec
System.Tasking.Restricted.Stages
s-tasdeb.ads
spec
System.Tasking.Debug
s-tasinf.ads
spec
System.Task_Info
s-tasini.ads
spec
System.Tasking.Initialization
s-taskin.ads
spec
System.Tasking
s-tasque.ads
spec
System.Tasking.Queuing
s-tasren.ads
spec
System.Tasking.Rendezvous
s-tasres.ads
spec
System.Tasking.Restricted
s-tassta.ads
spec
System.Tasking.Stages
s-tasuti.ads
spec
System.Tasking.Utilities
s-tataat.ads
spec
System.Tasking.Task_Attributes
s-thread.ads
spec
System.Threads
s-tpinop.ads
spec
System.Task_Primitives.Interrupt_Operations
s-tpoben.ads
spec
System.Tasking.Protected_Objects.Entries
s-tpobop.ads
spec
System.Tasking.Protected_Objects.Operations
s-tposen.ads
spec
System.Tasking.Protected_Objects.Single_Entry
s-traces.ads
spec
System.Traces
s-traent.ads
spec
System.Traceback_Entries
s-tratas.ads
spec
System.Traces.Tasking
s-unstyp.ads
spec
System.Unsigned_Types
s-vaflop.ads
spec
System.Vax_Float_Operations
s-valboo.ads
spec
System.Val_Bool
s-valcha.ads
spec
System.Val_Char
s-valdec.ads
spec
System.Val_Dec
s-valenu.ads
spec
System.Val_Enum
s-valint.ads
spec
System.Val_Int
s-vallld.ads
spec
System.Val_Lld
s-vallli.ads
spec
System.Val_Lli
s-valllu.ads
spec
System.Val_Llu
s-valrea.ads
spec
System.Val_Real
s-valuns.ads
spec
System.Val_Uns
s-valuti.ads
spec
System.Val_Util
s-valwch.ads
spec
System.Val_Wchar
s-veboop.ads
spec
System.Vectors.Boolean_Operations
s-vector.ads
spec
System.Vectors
s-vercon.ads
spec
System.Version_Control
s-vmexta.ads
spec
System.Vms_Exception_Table
s-vxwexc.ads
spec
System.Vxworks_Exceptions
s-wchcnv.ads
spec
System.Wch_Cnv
s-wchcon.ads
spec
System.Wch_Con
s-wchjis.ads
spec
System.Wch_Jis
s-wchstw.ads
spec
System.Wch_Stw
s-wchwts.ads
spec
System.Wch_Wts
s-widboo.ads
spec
System.Wid_Bool
s-widcha.ads
spec
System.Wid_Char
s-widenu.ads
spec
System.Wid_Enum
s-widlli.ads
spec
System.Wid_Lli
s-widllu.ads
spec
System.Wid_Llu
s-widwch.ads
spec
System.Wid_Wchar
s-wwdcha.ads
spec
System.Wwd_Char
s-wwdenu.ads
spec
System.Wwd_Enum
s-wwdwch.ads
spec
System.Wwd_Wchar
system.ads
spec
System
unchconv.ads
spec
Unchecked_Conversion
unchdeal.ads
spec
Unchecked_Deallocation
gprbuild-gpl-2014-src/share/gprconfig/cross.xml 0000644 0000767 0000145 00000063475 12203444510 021077 0 ustar gnatmail gnat
package Builder is
for Executable_Suffix use ".axe";
end Builder;
package Builder is
for Executable_Suffix use ".exe";
end Builder;
package Builder is
for Executable_Suffix use "";
end Builder;
Wind_Base := external ("WIND_BASE");
Wind_Usr := external ("WIND_USR", Wind_Base & "/target/usr/");
Pikeos_Target_Files := external ("PIKEOS_TARGET_FILES");
WRS_RTP_Base := external ("WRS_RTP_BASE", "0x40000000");
package Builder is
for Executable_Suffix use ".out";
end Builder;
package Builder is
for Executable_Suffix use ".vxe";
end Builder;
package Linker is
for Required_Switches use
Linker'Required_Switches & ("-mrtp");
end Linker;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C")
& ("-mlongcall");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C++") use
Compiler'Leading_Required_Switches ("C++")
& ("-mlongcall");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C")
& ("-mlong-calls");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C++") use
Compiler'Leading_Required_Switches ("C++")
& ("-mlong-calls");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C")
& ("-fno-builtin");
end Compiler;
-- Traditionally the entry point of a native application is _p4_entry. For
-- an APEX application, it is _begin.
-- In order to use the same link options for both personalities, _begin is
-- used for native as well.
package Linker is
for Required_Switches use
Linker'Required_Switches
& ("-u_begin", "-e_begin", "-nostdlib", "-Tapp-ld-script",
"-lvm", "-lp4", "-lstand", "-lgcc",
"-L" & Pikeos_Target_Files & "/scripts",
"-L" & Pikeos_Target_Files & "/lib");
end Linker;
package Linker is
for Required_Switches use
Linker'Required_Switches
& ("-Wl,--defsym,__wrs_rtp_base=" & WRS_RTP_Base,
"-mrtp");
end Linker;
package Linker is
for Required_Switches use
Linker'Required_Switches
& ("-Wl,--defsym,__wrs_rtp_base=" & WRS_RTP_Base,
"-mrtp");
end Linker;
package Compiler is
for Leading_Required_Switches ("Ada") use
Compiler'Leading_Required_Switches ("Ada") & ("-mrtp");
end Compiler;
package Linker is
for Required_Switches use
Linker'Required_Switches & ("-mrtp");
end Linker;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C") & ("-mrtp")
& ("-I" & Wind_Base & "/target/usr/h",
"-I" & Wind_Base & "/target/usr/h/wrn/coreip");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C")
& ("-DVTHREADS",
"-I" & Wind_Base & "/target/vThreads/h",
"-I" & Wind_Base & "/target/val/h");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C")
& ("-I" & Wind_Base & "/target/include");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C")
& ("-I" & Wind_Base & "/target/h",
"-I" & Wind_Base & "/target/h/wrn/coreip");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C")
& ("-I" & Wind_Base & "/target/h",
"-msoft-float");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C")
& ("-I" & Wind_Base & "/target/h");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C++") use
Compiler'Leading_Required_Switches ("C++") & ("-mrtp")
& ("-I" & Wind_Base & "/target/usr/h",
"-I" & Wind_Base & "/target/usr/h/wrn/coreip");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C++") use
Compiler'Leading_Required_Switches ("C++")
& ("-I" & Wind_Base & "/target/h",
"-I" & Wind_Base & "/target/h/wrn/coreip");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C")
& ("-te500v2", "-fno-implicit-fp");
for Leading_Required_Switches ("C++") use
Compiler'Leading_Required_Switches ("C++")
& ("-te500v2", "-fno-implicit-fp");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C++") use
Compiler'Leading_Required_Switches ("C++")
& ("-DVTHREADS",
"-I" & Wind_Base & "/target/vThreads/h",
"-I" & Wind_Base & "/target/val/h");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C++") use
Compiler'Leading_Required_Switches ("C++")
& ("-I" & Wind_Base & "/target/include");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C")
& ("-fno-builtin");
end Compiler;
package Compiler is
for Leading_Required_Switches ("C++") use
Compiler'Leading_Required_Switches ("C++")
& ("-fno-builtin");
end Compiler;
package Builder is
for Executable_Suffix use ".out";
end Builder;
package Binder is
for Required_Switches ("Ada") use
Binder'Required_Switches ("Ada") &
("gnatbind_prefix=${PREFIX(ada)}");
end Binder;
gprbuild-gpl-2014-src/share/gprconfig/targetset.xml 0000644 0000767 0000145 00000016070 12277050514 021745 0 ustar gnatmail gnat
x86-elinos-linux
i686-elinos-linux
ppc-elinos-linux
powerpc-elinos-linux
e500v2-wrs-linux
e500v2-wrs-linux
ppc-wrs-linux
powerpc-wrs-linux
x86-linux
i.86-.*linux.*
x86_64-linux
x86_64-.*linux.*
ia64-hp_linux
ia64-sgi_linux
ia64-.*linux.*
sparc-solaris
sparc-.*solaris.*
sparc64-solaris
sparc64-.*solaris.*
x86-solaris
i.86-(pc-)?solaris.*
x86-windows
mingw32
i.86-.*mingw32.*
pentium-.*mingw32.*
x86_64-windows
x86_64-.*mingw32.*
ppc-darwin
powerpc.*darwin.*
x86-darwin
i.86-.*-darwin.*
x86_64-darwin
x86_64-.*-darwin.*
pa-hpux
hppa.*-hpux.*
ia64-hpux
ia64-.*hpux.*
alpha-tru64
alpha.*osf.*
alpha-openvms
alpha64-dec-openvms.*
mips-irix
mips-.*irix.*
ppc-aix
powerpc.*-aix.*
x86-lynx
i.86-.*-lynxos
i.*-cygwin.*
pent.*-cygwin.*
x86-freebsd
i.86-.*freebsd.*
x86_64-freebsd
x86_64-.*freebsd.*
amd64-.*freebsd.*
aamp
.*aamp.*
ppc-lynx5.*
powerpc-elf-lynxos5.*
ppc-lynx-solaris
ppc-lynx-.*
powerpc-elf-lynxos.*
ppc-xcoff-lynxos
ppc-xcoff-lynxos178.*
powerpc-xcoff-lynxos178.*
x86-lynx5.*
i386-elf-lynxos5.*
x86-wrs-vxworks
x86-vx6-windows
x86-vx6-linux
i.86-wrs-vxworks
powerpc-wrs-vxworks
ppc-vxw-solaris
ppc-vxw-windows
ppc-vx178b-solaris
ppc-vx178b-windows
ppc-vx6-solaris
ppc-vx6-windows
ppc-vx6-linux
e500v2-wrs-vxworks
e500v2-vx6-solaris
e500v2-vx6-windows
e500v2-vx6-linux
leon-wrs-vxworks
leon-vx6-linux
ppc-vx653-solaris
ppc-vx653-windows
powerpc-wrs-vxworksae
e500v2-vx653-windows
e500v2-wrs-vxworksae
ppc-vxmils-windows
powerpc-wrs-vxworksmils
e500v2-vxmils-windows
e500v2-wrs-vxworksmils
x86-vx653-windows
i.86-wrs-vxworksae
ppc-elf-solaris
ppc-elf-windows
powerpc-elf
p55-elf-windows
powerpc-eabispe
erc32-elf-solaris
erc32-elf-linux
erc32-elf.*
leon-elf-solaris
leon-elf-linux
leon-elf.*
leon3-elf-linux
leon3-elf.*
arm-elf-linux
arm-eabi
avr-elf-windows
avr
gprbuild-gpl-2014-src/share/gprconfig/windres.xml 0000644 0000767 0000145 00000002105 12033260115 021376 0 ustar gnatmail gnat
WINDRES
(i686-pc-mingw32-|x86_64-pc-mingw32-)?windres
${PREFIX}windres --version
WinRes
${PREFIX}gcc -dumpmachine
package Compiler is
for Driver ("WinRes") use "${PREFIX(WinRes)}windres";
for Leading_Required_Switches ("WinRes") use ("-i");
for Object_File_Suffix ("WinRes") use ".coff";
for Object_File_Switches ("WinRes") use ("-o", "");
end Compiler;
package Naming is
for Body_Suffix ("WinRes") use ".rc";
end Naming;
gprbuild-gpl-2014-src/share/gprconfig/clean.xml 0000644 0000767 0000145 00000000514 12160011421 021002 0 ustar gnatmail gnat
package Clean is
-- 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;
gprbuild-gpl-2014-src/share/share.gpr 0000644 0000767 0000145 00000000143 12323721731 017047 0 ustar gnatmail gnat project Share is
for Languages use ("XML");
for Source_Dirs use ("gprconfig");
end Share;
gprbuild-gpl-2014-src/config.sub 0000755 0000767 0000145 00000067100 10517620563 016126 0 ustar gnatmail gnat #! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
timestamp='2001-09-07'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT 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
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Please send patches to .
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit 0;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis)
os=
basic_machine=$1
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| c4x | clipper \
| d10v | d30v | dsp16xx \
| fr30 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| m32r | m68000 | m68k | m88k | mcore \
| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el | mips64vr4300 \
| mips64vr4300el | mips64vr5000 | mips64vr5000el \
| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
| mipsisa32 \
| mn10200 | mn10300 \
| ns16k | ns32k \
| openrisc \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| s390 | s390x \
| sh | sh[34] | sh[34]eb | shbe | shle \
| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
| stormy16 | strongarm \
| tahoe | thumb | tic80 | tron \
| v850 \
| we32k \
| x86 | xscale \
| z8k)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alphapca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armv*-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c54x-* \
| clipper-* | cray2-* | cydra-* \
| d10v-* | d30v-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| m32r-* \
| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| s390-* | s390x-* \
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
| sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \
| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
| v850-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
| ymp-* \
| z8k-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | ymp)
basic_machine=ymp-cray
os=-unicos
;;
cray2)
basic_machine=cray2-cray
os=-unicos
;;
[cjt]90)
basic_machine=${basic_machine}-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
;;
mips*-linux*)
basic_machine=mips-unknown
os=-linux-gnu
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
mmix*)
basic_machine=mmix-knuth
os=-mmixware
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexgen)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i686-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sparclite-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=t3e-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
windows32)
basic_machine=i386-pc
os=-windows32-msvcrt
;;
xmp)
basic_machine=xmp-cray
os=-unicos
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
mips)
if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
fi
;;
romp)
basic_machine=romp-ibm
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh3 | sh4 | sh3eb | sh4eb)
basic_machine=sh-unknown
;;
sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
c4x*)
basic_machine=c4x-none
os=-coff
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto*)
os=-nto-qnx
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-ibm)
os=-aix
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-vxsim* | -vxworks*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
gprbuild-gpl-2014-src/known-problems-163 0000644 0000767 0000145 00000012344 12115157055 017347 0 ustar gnatmail gnat ========================================
Known problems in GPRBUILD version 1.6.3
========================================
Copyright (C) 2012-2013, AdaCore
The following is a listing of known problems in release 1.6.3. Except where
specifically noted, all these problems have been corrected in the development
tree of the 2.0 technology. This means they are corrected in any 1.7.0w/2.0.0w
wavefront issued subsequent to the date specified (in ISO format YYYY-MM-DD) in
the status line. This can be used to determine if a given wavefront has the fix
identified in the entry.
KP-163-M214-016 VxWorks: incompatible system headers in RTP
Problem: When compiling a C file for a RTP on VxWorks, path to
incompatible system headers are added to the configuration
and can provoke a compilation error.
Status: This was fixed in 2.0 on 2012-07-10
Workaround: Remove the following lines from the .cgpr file:
for Leading_Required_Switches ("C") use
Compiler'Leading_Required_Switches ("C")
& ("-I" & Wind_Base & "/target/h",
"-I" & Wind_Base & "/target/h/wrn/coreip");
KP-163-L921-007 Resolve --RTS relative pathes
Problem: The behaviour of --RTS switch using a relative path is different
when the switch appears on the gprbuild command line and when
the switch appears in the Builder package.
Status: This was fixed in 2.1 on 2012-12-23
Workaround: Specify the switch on the command line
KP-163-L717-025 gprconfig crashes with exception Expression_Error
Problem: If a query for the target of a compiler, such as
"gcc -dumpmachine", returns a string that includes special
characters or sequence of characters in regular expressions,
gprconfig may crash with exception Expression_error.
Status: This was fixed in 2.0 on 2012-07-18
Workaround: Remove from the path the compilers that returns such malformed
targets.
KP-163-L713-021 Exception DIRECTORY_ERROR raised when missing obj directory
Problem: The exception DIRECTORY_ERROR is raised when an externally
build project defines an object directory which does not
exists.
Status: This was fixed in 2.0 on 2012-07-13
Workaround: Create the missing object directory manually
KP-163-L624-002 Knowledge base must_match node may not have desired effect
Problem: In some cases, the toolchain that should have been ignored
by gprconfig because it doesn't satisfy must_match criterion
is added to the list of candidates anyway.
Status: This was fixed in 2.0 on 2012-06-28
Workaround: Describe a toolchain in a way that doesn't use must_match
criterion, or simply do not select a candidate that is incorrect.
KP-163-L530-060 Allow the same library project in multiple tree
Problem: An error message is reported when the same library
project is found in different aggregated projects.
Status: This was fixed in 2.0 on 2012-06-06
Workaround: Compile aggregated projects separately
KP-163-L503-024 gprbuild crashes with exception names in virtual project
Problem: gprbuild crashes if a project that is virtually extended
has one or several sources with exception names specified in
its package Naming.
Status: This was fixed in 2.0 on 2012-07-05
Workaround: Use only names that follows the naming scheme of the project.
KP-163-L321-006 Extra recompilation when using gprbuild -s -m
Problem: When gprbuild is invoked with both -s and -m and the timestamp
of a source (or the comments, but not the code) has changed,
gprbuild still recompiles the source because the switches file is
older than the source.
Status: This was fixed in 2.0 on 2012-03-21
Workaround: Use only -m.
KP-163-L320-047 gprbuild --no-indirect-imports and generic instantiations
Problem: When --no-indirect-imports is used and an imported units
is instantiated or contains an instantiation, there may be units
imported by the generic body that are sources of a project that
is not imported. In this case, gprbuild reports an error.
Status: This was fixed in 2.0 on 2012-03-27
Workaround: Import the additional projects.
KP-163-L315-021 gprbuild --no-object-check and main in project file
Problem: When gprbuild is called with --no-object-check and no main on
the command line, and there is one or several mains specified in
the project file, all sources of the project files were compiled
instead of just the closure of the mains.
Status: This was fixed in 2.0 on 2012-03-16
Workaround: Call gprbuild with a main on the command line.
KP-163-L215-032 Remove duplicate stack size option on Windows
Problem: On Windows, a stack size option such as "-XLinker --stack="
in the linker switches in the project file or on the command line
is not taken into account.
Status: This was fixed in 2.0 on 2012-02-16
Workaround: Make sure that the default stack size option is sufficient
for the execution of the program.
gprbuild-gpl-2014-src/configure 0000755 0000767 0000145 00000247272 12046434747 016072 0 ustar gnatmail gnat #! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for gprbuild 2.1.
#
# Report bugs to .
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in
*posix*) set -o posix ;;
esac
fi
# PATH needs CR
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
echo "#! /bin/sh" >conf$$.sh
echo "exit 0" >>conf$$.sh
chmod +x conf$$.sh
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -f conf$$.sh
fi
# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
as_nl='
'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
case $0 in
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
{ (exit 1); exit 1; }
fi
# Work around bugs in pre-3.0 UWIN ksh.
for as_var in ENV MAIL MAILPATH
do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
for as_var in \
LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
fi
done
# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
# Name of the executable.
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# CDPATH.
$as_unset CDPATH
if test "x$CONFIG_SHELL" = x; then
if (eval ":") 2>/dev/null; then
as_have_required=yes
else
as_have_required=no
fi
if test $as_have_required = yes && (eval ":
(as_func_return () {
(exit \$1)
}
as_func_success () {
as_func_return 0
}
as_func_failure () {
as_func_return 1
}
as_func_ret_success () {
return 0
}
as_func_ret_failure () {
return 1
}
exitcode=0
if as_func_success; then
:
else
exitcode=1
echo as_func_success failed.
fi
if as_func_failure; then
exitcode=1
echo as_func_failure succeeded.
fi
if as_func_ret_success; then
:
else
exitcode=1
echo as_func_ret_success failed.
fi
if as_func_ret_failure; then
exitcode=1
echo as_func_ret_failure succeeded.
fi
if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
:
else
exitcode=1
echo positional parameters were not saved.
fi
test \$exitcode = 0) || { (exit 1); exit 1; }
(
as_lineno_1=\$LINENO
as_lineno_2=\$LINENO
test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
") 2> /dev/null; then
:
else
as_candidate_shells=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
case $as_dir in
/*)
for as_base in sh bash ksh sh5; do
as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
done;;
esac
done
IFS=$as_save_IFS
for as_shell in $as_candidate_shells $SHELL; do
# Try only shells that exist, to save several forks.
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
{ ("$as_shell") 2> /dev/null <<\_ASEOF
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in
*posix*) set -o posix ;;
esac
fi
:
_ASEOF
}; then
CONFIG_SHELL=$as_shell
as_have_required=yes
if { "$as_shell" 2> /dev/null <<\_ASEOF
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in
*posix*) set -o posix ;;
esac
fi
:
(as_func_return () {
(exit $1)
}
as_func_success () {
as_func_return 0
}
as_func_failure () {
as_func_return 1
}
as_func_ret_success () {
return 0
}
as_func_ret_failure () {
return 1
}
exitcode=0
if as_func_success; then
:
else
exitcode=1
echo as_func_success failed.
fi
if as_func_failure; then
exitcode=1
echo as_func_failure succeeded.
fi
if as_func_ret_success; then
:
else
exitcode=1
echo as_func_ret_success failed.
fi
if as_func_ret_failure; then
exitcode=1
echo as_func_ret_failure succeeded.
fi
if ( set x; as_func_ret_success y && test x = "$1" ); then
:
else
exitcode=1
echo positional parameters were not saved.
fi
test $exitcode = 0) || { (exit 1); exit 1; }
(
as_lineno_1=$LINENO
as_lineno_2=$LINENO
test "x$as_lineno_1" != "x$as_lineno_2" &&
test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
_ASEOF
}; then
break
fi
fi
done
if test "x$CONFIG_SHELL" != x; then
for as_var in BASH_ENV ENV
do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
done
export CONFIG_SHELL
exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
fi
if test $as_have_required = no; then
echo This script requires a shell more modern than all the
echo shells that I found on your system. Please install a
echo modern shell, or manually run the script under such a
echo shell if you do have one.
{ (exit 1); exit 1; }
fi
fi
fi
(eval "as_func_return () {
(exit \$1)
}
as_func_success () {
as_func_return 0
}
as_func_failure () {
as_func_return 1
}
as_func_ret_success () {
return 0
}
as_func_ret_failure () {
return 1
}
exitcode=0
if as_func_success; then
:
else
exitcode=1
echo as_func_success failed.
fi
if as_func_failure; then
exitcode=1
echo as_func_failure succeeded.
fi
if as_func_ret_success; then
:
else
exitcode=1
echo as_func_ret_success failed.
fi
if as_func_ret_failure; then
exitcode=1
echo as_func_ret_failure succeeded.
fi
if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
:
else
exitcode=1
echo positional parameters were not saved.
fi
test \$exitcode = 0") || {
echo No shell found that supports shell functions.
echo Please tell autoconf@gnu.org about your system,
echo including any error possibly output before this
echo message
}
as_lineno_1=$LINENO
as_lineno_2=$LINENO
test "x$as_lineno_1" != "x$as_lineno_2" &&
test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
# line-number line after each line using $LINENO; the second 'sed'
# does the real work. The second script uses 'N' to pair each
# line-number line with the line containing $LINENO, and appends
# trailing '-' during substitution so that $LINENO is not a special
# case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
# scripts with optimization help from Paolo Bonzini. Blame Lee
# E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in
-n*)
case `echo 'x\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
*) ECHO_C='\c';;
esac;;
*)
ECHO_N='-n';;
esac
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir
fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -p'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
if test -x / >/dev/null 2>&1; then
as_test_x='test -x'
else
if ls -dL / >/dev/null 2>&1; then
as_ls_L_option=L
else
as_ls_L_option=
fi
as_test_x='
eval sh -c '\''
if test -d "$1"; then
test -d "$1/.";
else
case $1 in
-*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
fi
as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 7<&0 &1
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='gprbuild'
PACKAGE_TARNAME='gprbuild'
PACKAGE_VERSION='2.1'
PACKAGE_STRING='gprbuild 2.1'
PACKAGE_BUGREPORT='report@adacore.com'
ac_subst_vars='SHELL
PATH_SEPARATOR
PACKAGE_NAME
PACKAGE_TARNAME
PACKAGE_VERSION
PACKAGE_STRING
PACKAGE_BUGREPORT
exec_prefix
prefix
program_transform_name
bindir
sbindir
libexecdir
datarootdir
datadir
sysconfdir
sharedstatedir
localstatedir
includedir
oldincludedir
docdir
infodir
htmldir
dvidir
pdfdir
psdir
libdir
localedir
mandir
DEFS
ECHO_C
ECHO_N
ECHO_T
LIBS
build_alias
host_alias
target_alias
build
build_cpu
build_vendor
build_os
host
host_cpu
host_vendor
host_os
target
target_cpu
target_vendor
target_os
ac_prefix_program
INSTALL_PROGRAM
INSTALL_SCRIPT
INSTALL_DATA
objdir
is_windows
xmlada_build_target
xmlada_prj_flags
LIBOBJS
LTLIBOBJS'
ac_subst_files=''
ac_precious_vars='build_alias
host_alias
target_alias'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE
# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'
ac_prev=
ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval $ac_prev=\$ac_option
ac_prev=
continue
fi
case $ac_option in
*=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
*) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file=$ac_optarg ;;
--config-cache | -C)
cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
| --dataroo | --dataro | --datar)
ac_prev=datarootdir ;;
-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid feature name: $ac_feature" >&2
{ (exit 1); exit 1; }; }
ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
eval enable_$ac_feature=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
-docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
docdir=$ac_optarg ;;
-dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
ac_prev=dvidir ;;
-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid feature name: $ac_feature" >&2
{ (exit 1); exit 1; }; }
ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
eval enable_$ac_feature=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he | -h)
ac_init_help=long ;;
-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
ac_init_help=recursive ;;
-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
ac_init_help=short ;;
-host | --host | --hos | --ho)
ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
-htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
ac_prev=htmldir ;;
-htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
| --ht=*)
htmldir=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
-localedir | --localedir | --localedi | --localed | --locale)
ac_prev=localedir ;;
-localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
localedir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
-pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
ac_prev=pdfdir ;;
-pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
pdfdir=$ac_optarg ;;
-psdir | --psdir | --psdi | --psd | --ps)
ac_prev=psdir ;;
-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
psdir=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers | -V)
ac_init_version=: ;;
-with-* | --with-*)
ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid package name: $ac_package" >&2
{ (exit 1); exit 1; }; }
ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
eval with_$ac_package=\$ac_optarg ;;
-without-* | --without-*)
ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid package name: $ac_package" >&2
{ (exit 1); exit 1; }; }
ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
eval with_$ac_package=no ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
-*) { echo "$as_me: error: unrecognized option: $ac_option
Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; }
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid variable name: $ac_envvar" >&2
{ (exit 1); exit 1; }; }
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
echo "$as_me: WARNING: invalid host type: $ac_option" >&2
: ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
esac
done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
{ echo "$as_me: error: missing argument to $ac_option" >&2
{ (exit 1); exit 1; }; }
fi
# Be sure to have absolute directory names.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
do
eval ac_val=\$$ac_var
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
{ echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
{ (exit 1); exit 1; }; }
done
# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias
# FIXME: To remove some day.
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used." >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
fi
ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
{ echo "$as_me: error: Working directory cannot be determined" >&2
{ (exit 1); exit 1; }; }
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
{ echo "$as_me: error: pwd does not report name of working directory" >&2
{ (exit 1); exit 1; }; }
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
ac_confdir=`$as_dirname -- "$0" ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$0" : 'X\(//\)[^/]' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$0" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
{ echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
{ (exit 1); exit 1; }; }
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
{ (exit 1); exit 1; }; }
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
eval ac_env_${ac_var}_set=\${${ac_var}+set}
eval ac_env_${ac_var}_value=\$${ac_var}
eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
eval ac_cv_env_${ac_var}_value=\$${ac_var}
done
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures gprbuild 2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print \`checking...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/gprbuild]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
--target=TARGET configure for building compilers for TARGET [HOST]
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of gprbuild 2.1:";;
esac
cat <<\_ACEOF
Report bugs to .
_ACEOF
ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
test -d "$ac_dir" || continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
# Check for guested configure.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
elif test -f "$ac_srcdir/configure"; then
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gprbuild configure 2.1
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by gprbuild $as_me 2.1, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
_ASUNAME
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
echo "PATH: $as_dir"
done
IFS=$as_save_IFS
} >&5
cat >&5 <<_ACEOF
## ----------- ##
## Core tests. ##
## ----------- ##
_ACEOF
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
for ac_arg
do
case $ac_arg in
-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
2)
ac_configure_args1="$ac_configure_args1 '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
case $ac_arg in
*=* | --config-cache | -C | -disable-* | --disable-* \
| -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
| -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
| -with-* | --with-* | -without-* | --without-* | --x)
case "$ac_configure_args0 " in
"$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
esac
;;
-* ) ac_must_keep_next=true ;;
esac
fi
ac_configure_args="$ac_configure_args '$ac_arg'"
;;
esac
done
done
$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
echo
cat <<\_ASBOX
## ---------------- ##
## Cache variables. ##
## ---------------- ##
_ASBOX
echo
# The following way of writing the cache mishandles newlines in values,
(
for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
*) $as_unset $ac_var ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
sed -n \
"s/'\''/'\''\\\\'\'''\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
;; #(
*)
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
)
echo
cat <<\_ASBOX
## ----------------- ##
## Output variables. ##
## ----------------- ##
_ASBOX
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
cat <<\_ASBOX
## ------------------- ##
## File substitutions. ##
## ------------------- ##
_ASBOX
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
cat <<\_ASBOX
## ----------- ##
## confdefs.h. ##
## ----------- ##
_ASBOX
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
# Predefined preprocessor variables.
cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF
# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
if test -n "$CONFIG_SITE"; then
set x "$CONFIG_SITE"
elif test "x$prefix" != xNONE; then
set x "$prefix/share/config.site" "$prefix/etc/config.site"
else
set x "$ac_default_prefix/share/config.site" \
"$ac_default_prefix/etc/config.site"
fi
shift
for ac_site_file
do
if test -r "$ac_site_file"; then
{ echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special
# files actually), so we avoid doing that.
if test -f "$cache_file"; then
{ echo "$as_me:$LINENO: loading cache $cache_file" >&5
echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
{ echo "$as_me:$LINENO: creating cache $cache_file" >&5
echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val=\$ac_cv_env_${ac_var}_value
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
{ echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
{ echo "$as_me:$LINENO: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
{ echo "$as_me:$LINENO: current value: $ac_new_val" >&5
echo "$as_me: current value: $ac_new_val" >&2;}
ac_cache_corrupted=:
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
*) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
echo "$as_me: error: changes in the environment can compromise the build" >&2;}
{ { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
{ (exit 1); exit 1; }; }
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f "$ac_dir/install.sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
elif test -f "$ac_dir/shtool"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
{ { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
{ (exit 1); exit 1; }; }
fi
# These three variables are undocumented and unsupported,
# and are intended to be withdrawn in a future Autoconf release.
# They can cause serious problems if a builder's source tree is in a directory
# whose full name contains unusual characters.
ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
{ { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
{ (exit 1); exit 1; }; }
{ echo "$as_me:$LINENO: checking build system type" >&5
echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
if test "${ac_cv_build+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
{ { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
{ (exit 1); exit 1; }; }
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
{ { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
{ (exit 1); exit 1; }; }
fi
{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
echo "${ECHO_T}$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
echo "$as_me: error: invalid value of canonical build" >&2;}
{ (exit 1); exit 1; }; };;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_build
shift
build_cpu=$1
build_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
build_os=$*
IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
{ echo "$as_me:$LINENO: checking host system type" >&5
echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
if test "${ac_cv_host+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
{ { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
echo "${ECHO_T}$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
echo "$as_me: error: invalid value of canonical host" >&2;}
{ (exit 1); exit 1; }; };;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_host
shift
host_cpu=$1
host_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
host_os=$*
IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
{ echo "$as_me:$LINENO: checking target system type" >&5
echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
if test "${ac_cv_target+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "x$target_alias" = x; then
ac_cv_target=$ac_cv_host
else
ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
{ { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
echo "${ECHO_T}$ac_cv_target" >&6; }
case $ac_cv_target in
*-*-*) ;;
*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
echo "$as_me: error: invalid value of canonical target" >&2;}
{ (exit 1); exit 1; }; };;
esac
target=$ac_cv_target
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_target
shift
target_cpu=$1
target_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
target_os=$*
IFS=$ac_save_IFS
case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
# The aliases save the names the user supplied, while $host etc.
# will get canonicalized.
test -n "$target_alias" &&
test "$program_prefix$program_suffix$program_transform_name" = \
NONENONEs,x,x, &&
program_prefix=${target_alias}-
if test "x$prefix" = xNONE; then
echo $ECHO_N "checking for prefix by $ECHO_C" >&6
# Extract the first word of "gnatmake", so it can be a program name with args.
set dummy gnatmake; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_ac_prefix_program+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $ac_prefix_program in
[\\/]* | ?:[\\/]*)
ac_cv_path_ac_prefix_program="$ac_prefix_program" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_ac_prefix_program="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
ac_prefix_program=$ac_cv_path_ac_prefix_program
if test -n "$ac_prefix_program"; then
{ echo "$as_me:$LINENO: result: $ac_prefix_program" >&5
echo "${ECHO_T}$ac_prefix_program" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
if test -n "$ac_prefix_program"; then
prefix=`$as_dirname -- "$ac_prefix_program" ||
$as_expr X"$ac_prefix_program" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_prefix_program" : 'X\(//\)[^/]' \| \
X"$ac_prefix_program" : 'X\(//\)$' \| \
X"$ac_prefix_program" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$ac_prefix_program" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
prefix=`$as_dirname -- "$prefix" ||
$as_expr X"$prefix" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$prefix" : 'X\(//\)[^/]' \| \
X"$prefix" : 'X\(//\)$' \| \
X"$prefix" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$prefix" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
fi
fi
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
# Account for people who put trailing slashes in PATH elements.
case $as_dir/ in
./ | .// | /cC/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# Don't use installbsd from OSF since it installs stuff as root
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
break 3
fi
fi
done
done
;;
esac
done
IFS=$as_save_IFS
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
# value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
{ echo "$as_me:$LINENO: result: $INSTALL" >&5
echo "${ECHO_T}$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
objdir=`pwd`
case $host in
*mingw*|*cygwin*) is_windows="true";;
*) is_windows="false";;
esac
{ echo "$as_me:$LINENO: checking for xmlada" >&5
echo $ECHO_N "checking for xmlada... $ECHO_C" >&6; }
xmlada_build_target=
xmlada_prj_flags=
if test -d $srcdir/xmlada; then
xmlada_build_target=build_xmlada
xmlada_prj_flags="-aP$srcdir/xmlada/install/lib/gnat"
{ echo "$as_me:$LINENO: result: yes (sources in gprbuild tree)" >&5
echo "${ECHO_T}yes (sources in gprbuild tree)" >&6; }
else
# Create a temporary directory (from "info autoconf")
: ${TMPDIR=/tmp}
{
tmp=`(umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null` \
&& test -n "$tmp" && test -d "$tmp"
} || {
tmp=$TMPDIR/foo$$-$RANDOM
(umask 077 && mkdir -p "$tmp")
} || exit $?
mkdir $tmp/lib
cat > $tmp/conftest.gpr << EOF
with "xmlada.gpr";
project Conftest is
for Source_Dirs use ();
end Conftest;
EOF
if gnatmake -P$tmp/conftest.gpr >&5 2>&1; then
{ echo "$as_me:$LINENO: result: yes (precompiled)" >&5
echo "${ECHO_T}yes (precompiled)" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
{ { echo "$as_me:$LINENO: error: cannot find xmlada
See \`config.log' for more details." >&5
echo "$as_me: error: cannot find xmlada
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
fi
ac_config_files="$ac_config_files src/gprconfig-sdefault.ads Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems. If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.
_ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
*) $as_unset $ac_var ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
) |
sed '
/^ac_cv_env_/b end
t clear
:clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
test "x$cache_file" != "x/dev/null" &&
{ echo "$as_me:$LINENO: updating cache $cache_file" >&5
echo "$as_me: updating cache $cache_file" >&6;}
cat confcache >$cache_file
else
{ echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
#
# If the first sed substitution is executed (which looks for macros that
# take arguments), then branch to the quote section. Otherwise,
# look for a macro that doesn't take arguments.
ac_script='
t clear
:clear
s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
t quote
s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
t quote
b any
:quote
s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
s/\[/\\&/g
s/\]/\\&/g
s/\$/$$/g
H
:any
${
g
s/^\n//
s/\n/ /g
p
}
'
DEFS=`sed -n "$ac_script" confdefs.h`
ac_libobjs=
ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
ac_i=`echo "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in
*posix*) set -o posix ;;
esac
fi
# PATH needs CR
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
echo "#! /bin/sh" >conf$$.sh
echo "exit 0" >>conf$$.sh
chmod +x conf$$.sh
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -f conf$$.sh
fi
# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
as_nl='
'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
case $0 in
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
{ (exit 1); exit 1; }
fi
# Work around bugs in pre-3.0 UWIN ksh.
for as_var in ENV MAIL MAILPATH
do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
for as_var in \
LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
fi
done
# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
# Name of the executable.
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# CDPATH.
$as_unset CDPATH
as_lineno_1=$LINENO
as_lineno_2=$LINENO
test "x$as_lineno_1" != "x$as_lineno_2" &&
test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
# line-number line after each line using $LINENO; the second 'sed'
# does the real work. The second script uses 'N' to pair each
# line-number line with the line containing $LINENO, and appends
# trailing '-' during substitution so that $LINENO is not a special
# case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
# scripts with optimization help from Paolo Bonzini. Blame Lee
# E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in
-n*)
case `echo 'x\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
*) ECHO_C='\c';;
esac;;
*)
ECHO_N='-n';;
esac
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir
fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -p'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
if test -x / >/dev/null 2>&1; then
as_test_x='test -x'
else
if ls -dL / >/dev/null 2>&1; then
as_ls_L_option=L
else
as_ls_L_option=
fi
as_test_x='
eval sh -c '\''
if test -d "$1"; then
test -d "$1/.";
else
case $1 in
-*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
fi
as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 6>&1
# Save the log message, to keep $[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by gprbuild $as_me 2.1, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
on `(hostname || uname -n) 2>/dev/null | sed 1q`
"
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
# Files that config.status was made for.
config_files="$ac_config_files"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
current configuration.
Usage: $0 [OPTIONS] [FILE]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
-q, --quiet do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
instantiate the configuration file FILE
Configuration files:
$config_files
Report bugs to ."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
gprbuild config.status 2.1
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
Copyright (C) 2006 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
# If no file are specified by the user, then we need to provide default
# value. By we need to know if files were specified by the user.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
esac
case $ac_option in
# Handling of the options.
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
echo "$ac_cs_version"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
CONFIG_FILES="$CONFIG_FILES $ac_optarg"
ac_need_defaults=false;;
--he | --h | --help | --hel | -h )
echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
-*) { echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; } ;;
*) ac_config_targets="$ac_config_targets $1"
ac_need_defaults=false ;;
esac
shift
done
ac_configure_extra_args=
if $ac_cs_silent; then
exec 6>/dev/null
ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
if \$ac_cs_recheck; then
echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
CONFIG_SHELL=$SHELL
export CONFIG_SHELL
exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
fi
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
echo "$ac_log"
} >&5
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"src/gprconfig-sdefault.ads") CONFIG_FILES="$CONFIG_FILES src/gprconfig-sdefault.ads" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
done
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
fi
# Have a temporary directory for convenience. Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
tmp=
trap 'exit_status=$?
{ test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
' 0
trap '{ (exit 1); exit 1; }' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} ||
{
echo "$me: cannot create a temporary directory in ." >&2
{ (exit 1); exit 1; }
}
#
# Set up the sed scripts for CONFIG_FILES section.
#
# No need to generate the scripts if there are no CONFIG_FILES.
# This happens for instance when ./config.status config.h
if test -n "$CONFIG_FILES"; then
_ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
SHELL!$SHELL$ac_delim
PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
PACKAGE_NAME!$PACKAGE_NAME$ac_delim
PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
PACKAGE_STRING!$PACKAGE_STRING$ac_delim
PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
exec_prefix!$exec_prefix$ac_delim
prefix!$prefix$ac_delim
program_transform_name!$program_transform_name$ac_delim
bindir!$bindir$ac_delim
sbindir!$sbindir$ac_delim
libexecdir!$libexecdir$ac_delim
datarootdir!$datarootdir$ac_delim
datadir!$datadir$ac_delim
sysconfdir!$sysconfdir$ac_delim
sharedstatedir!$sharedstatedir$ac_delim
localstatedir!$localstatedir$ac_delim
includedir!$includedir$ac_delim
oldincludedir!$oldincludedir$ac_delim
docdir!$docdir$ac_delim
infodir!$infodir$ac_delim
htmldir!$htmldir$ac_delim
dvidir!$dvidir$ac_delim
pdfdir!$pdfdir$ac_delim
psdir!$psdir$ac_delim
libdir!$libdir$ac_delim
localedir!$localedir$ac_delim
mandir!$mandir$ac_delim
DEFS!$DEFS$ac_delim
ECHO_C!$ECHO_C$ac_delim
ECHO_N!$ECHO_N$ac_delim
ECHO_T!$ECHO_T$ac_delim
LIBS!$LIBS$ac_delim
build_alias!$build_alias$ac_delim
host_alias!$host_alias$ac_delim
target_alias!$target_alias$ac_delim
build!$build$ac_delim
build_cpu!$build_cpu$ac_delim
build_vendor!$build_vendor$ac_delim
build_os!$build_os$ac_delim
host!$host$ac_delim
host_cpu!$host_cpu$ac_delim
host_vendor!$host_vendor$ac_delim
host_os!$host_os$ac_delim
target!$target$ac_delim
target_cpu!$target_cpu$ac_delim
target_vendor!$target_vendor$ac_delim
target_os!$target_os$ac_delim
ac_prefix_program!$ac_prefix_program$ac_delim
INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
INSTALL_DATA!$INSTALL_DATA$ac_delim
objdir!$objdir$ac_delim
is_windows!$is_windows$ac_delim
xmlada_build_target!$xmlada_build_target$ac_delim
xmlada_prj_flags!$xmlada_prj_flags$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 59; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
{ (exit 1); exit 1; }; }
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
if test -n "$ac_eof"; then
ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
ac_eof=`expr $ac_eof + 1`
fi
cat >>$CONFIG_STATUS <<_ACEOF
cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
_ACEOF
sed '
s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
s/^/s,@/; s/!/@,|#_!!_#|/
:n
t n
s/'"$ac_delim"'$/,g/; t
s/$/\\/; p
N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF
:end
s/|#_!!_#|//g
CEOF$ac_eof
_ACEOF
# VPATH may cause trouble with some makes, so we remove $(srcdir),
# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=/{
s/:*\$(srcdir):*/:/
s/:*\${srcdir}:*/:/
s/:*@srcdir@:*/:/
s/^\([^=]*=[ ]*\):*/\1/
s/:*$//
s/^[^=]*=[ ]*$//
}'
fi
cat >>$CONFIG_STATUS <<\_ACEOF
fi # test -n "$CONFIG_FILES"
for ac_tag in :F $CONFIG_FILES
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
echo "$as_me: error: Invalid tag $ac_tag." >&2;}
{ (exit 1); exit 1; }; };;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
ac_save_IFS=$IFS
IFS=:
set x $ac_tag
IFS=$ac_save_IFS
shift
ac_file=$1
shift
case $ac_mode in
:L) ac_source=$1;;
:[FH])
ac_file_inputs=
for ac_f
do
case $ac_f in
-) ac_f="$tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
{ { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
echo "$as_me: error: cannot find input file: $ac_f" >&2;}
{ (exit 1); exit 1; }; };;
esac
ac_file_inputs="$ac_file_inputs $ac_f"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input="Generated from "`IFS=:
echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
{ echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
fi
case $ac_tag in
*:-:* | *:-) cat >"$tmp/stdin";;
esac
;;
esac
ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
{ as_dir="$ac_dir"
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
echo "$as_me: error: cannot create directory $as_dir" >&2;}
{ (exit 1); exit 1; }; }; }
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
case $ac_mode in
:F)
#
# CONFIG_FILE
#
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
case `sed -n '/datarootdir/ {
p
q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p
' $ac_file_inputs` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
{ echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
s&@infodir@&$infodir&g
s&@localedir@&$localedir&g
s&@mandir@&$mandir&g
s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF
sed "$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s&@configure_input@&$configure_input&;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
{ echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined." >&5
echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined." >&2;}
rm -f "$tmp/stdin"
case $ac_file in
-) cat "$tmp/out"; rm -f "$tmp/out";;
*) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
esac
;;
esac
done # for ac_tag
{ (exit 0); exit 0; }
_ACEOF
chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded. So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status. When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
ac_cs_success=:
ac_config_status_args=
test "$silent" = yes &&
ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
$SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
$ac_cs_success || { (exit 1); exit 1; }
fi
gprbuild-gpl-2014-src/vms_gprbuild.gpr 0000644 0000767 0000145 00000006140 12323721731 017343 0 ustar gnatmail gnat project VMS_Gprbuild is
type OS_Type is ("avms", "ivms");
OS : OS_Type := external ("OS", "ivms");
type Build_Type is ("debug", "production", "coverage", "profiling");
Bld : Build_Type := external ("BUILD", "debug");
type VCS_Type is ("Subversion", "Git", "auto");
VCS_Kind : VCS_Type := external ("PRJ_VCS", "Subversion");
for Main use
("gprbuild.adb",
"gprbind.adb",
"gprlib.adb",
"gprclean.adb",
"ccomp.adb",
"forcomp.adb");
for Source_Dirs use ("src", "gnat");
case Bld is
when "production" => for Object_Dir use "obj";
when "coverage" => for Object_Dir use "obj-cov";
when "profiling" => for Object_Dir use "obj-prof";
when "debug" => for Object_Dir use "obj-debug";
end case;
for Exec_Dir use ".";
for Languages use ("Ada", "C");
package Compiler is
common_switches := ("-gnat05", "-gnaty", "-gnatQ");
case Bld is
when "debug" =>
for Default_Switches ("Ada") use common_switches &
("-g", "-gnata", "-gnatVa", "-gnatwaCJI"
-- , "-gnatwe"
, "-gnatyg"
);
for Local_Configuration_Pragmas use "debug.adc";
when "coverage" =>
for Default_Switches ("Ada") use common_switches &
("-ftest-coverage", "-fprofile-arcs");
when "profiling" =>
for Default_Switches ("Ada") use common_switches &
("-pg", "-g");
when "production" =>
for Default_Switches ("Ada") use common_switches &
("-O2", "-gnatpn", "-gnatws");
end case;
end Compiler;
package Binder is
common_switches := ("-E", "-static");
case Bld is
when "debug" =>
for Default_Switches ("Ada") use common_switches;
when "coverage" | "profiling" | "production" =>
for Default_Switches ("Ada") use common_switches;
end case;
end Binder;
package Linker is
Common_Switches_VMS :=
(project'Object_Dir & "/gprbuild_dummies.obj",
project'Object_Dir & "/link.obj");
case Bld is
when "production" | "debug" | "coverage" =>
for Default_Switches ("Ada") use Common_Switches_VMS;
when "profiling" =>
for Default_Switches ("Ada")
use Common_Switches_VMS & ("-pg", "-g");
end case;
end Linker;
Common_Excluded_Source_Files :=
("gprlib-build_shared_lib.adb",
"gprlib-build_shared_lib-nosymbols.adb",
"gprlib-build_shared_lib-vms.adb",
"mlib-tgt-vms-alpha.adb",
"mlib-tgt-vms-ia64.adb");
package Naming is
for Body ("gprlib.build_shared_lib")
use "gprlib-build_shared_lib-vms.adb";
for Body ("gpr_util.knowledge") use "gpr_util-knowledge-vms.adb";
case OS is
when "avms" =>
for Body ("mlib.tgt.specific")
use "mlib-tgt-specific-vms-alpha.adb";
when "ivms" =>
for Body ("mlib.tgt.specific")
use "mlib-tgt-specific-vms-ia64.adb";
end case;
end Naming;
end VMS_Gprbuild;
gprbuild-gpl-2014-src/features-14 0000644 0000767 0000145 00000005542 11370043134 016117 0 ustar gnatmail gnat ==============================
GPRBUILD 1.4 NEW FEATURES LIST
==============================
Copyright (C) 2009-2010, AdaCore
This file contains a complete list of new features in version 1.4 of GPRBUILD.
A full description of all GPRBUILD features can be found in the GPRBUILD
User's Guide.
An ISO date (YYYY-MM-DD) appears in parentheses after the description line.
This date shows the implementation date of the feature. Any 1.4.0w
wavefront subsequent to this date will contain the indicated feature, as
will any subsequent releases.
NF-14-J107-014 Compilation switches and Stand-Alone Libraries (2010-01-11)
The Ada leading and trailing switches are now used to compile the binder
generated files of Stand-Alone Libraries.
NF-14-IA01-036 No relink if non interfaces of shared SALs changed (2009-10-01)
When only non interface units are modified in a shared Stand-Alone Library,
the shared SAL needs to be rebuilt but the executable no longer needs to be
rebound and relinked.
NF-14-I930-029 Ignore Builder switches -x for Ada (2009-09-30)
For better compatibility with gnatmake, switch -x is ignored when found
in the Builder switches for Ada.
NF-14-I928-023 Library_Interface of SALs enforced (2009-09-30)
When attribute Interfaces is not declared in a Stand-Alone Library,
the units declared in Library_Interface constitutes the interface of
the library. If an external unit imports a unit of the library that
is not in Library_Interface, its compilation will be invalidated and
gprbuild will fail.
NF-14-I814-016 gprbuild no longer outputs "creating auto.cgpr" (2009-08-20)
When running in the default auto configuration mode, gprbuild will no
longer display the message "creating auto.cgpr"
NF-14-I728-026 gprclean warns when object dir does not exist (2009-08-11)
When the object dir of a project does not exist, gprclean used to exit
with an error. Instead, it will now display a warning, and skip this
project, but continue cleaning the other projects if required.
NF-14-I415-016 Binder generated file compiled with all options (2009-05-06)
gprbind now compiles the binder generated file with the required trailing
compilation switches specified in the configuration project file.
NF-14-I401-028 Support for Ada multi-unit source files (2009-09-20)
gprbuild now supports Ada multi-unit source files
NF-14-HA27-001 New switch --no-split-units (2009-10-07)
A new switch --no-split-units is added. When this switch is specified, the
spec, body and subunits of an Ada unit must be sources of the same project
or of projects extending each others.
NF-14-H828-007 Compilers working on all targets (2009-09-03)
It is now possible in the knowledge base for gprconfig to specify
compilers that work on all targets, by omitting the node. In
particular, you can add support for tools that generate code instead of
object code.
gprbuild-gpl-2014-src/known-problems-21 0000644 0000767 0000145 00000015626 12312367513 017267 0 ustar gnatmail gnat ======================================
Known problems in GPRBUILD version 2.1
======================================
Copyright (C) 2013-2014, AdaCore
The following is a listing of known problems in releases 2.1.1 and 2.1.2.
Each entry contains a status line stating when the problem was fixed, and on
which release(s). In addition, any wavefront issued subsequent to the date
specified (in ISO format YYYY-MM-DD) also contains the fix. This can be used
to determine if a given release or wavefront has the fix identified in the
entry.
Note that older releases might or might not be affected by the problems listed
in this document.
Known problems fixed in 2.2.1 and above
---------------------------------------
KP-21-N319-020 gprbuild fails with binder switch "-s"
Problem: When gprbuild is invoked with the binder switch "-s". the binding
phase will fail as gnatbind is unable to find the sources.
Status: This was fixed in 2.2 on 2014-03-19
Workaround: Do not use binder switch "-s" when using gprbuild.
KP-21-N318-025 gprinstall does not recognized -d option
Problem: The -d option (short version of --dry-run) is documented
but not recognized by gprinstall.
Status: This was fixed in 2.2 on 2014-03-19
Workaround: Uses --dry-run instead.
KP-21-N313-008 gprinstall fails with spec naming exception
Problem: When gprinstall is invoked to install a library project file
that is not a Stand-Alone Library and there is a spec with
a naming exception, the installation will fail.
Status: This was fixed in 2.2 on 2014-03-13
Workaround: Avoid spec naming exceptions in library project file.
KP-21-N310-027 gprbuild wait indefinitely for some compilation results
Problem: If the Remote package Root_Dir attribute is not properly set
gprbuild may not terminate.
Status: This was fixed in 2.2 on 2014-03-10
Workaround: fix the Root_Dir attribute value.
KP-21-N207-022 Fail to compile sources in distributed mode
Problem: Top level sources (sources found at the project's root
directory) will fail to compile on remote compilation slaves.
Status: This was fixed in 2.2 on 2014-02-07
Workaround: do not use the distributed compilation mode
KP-21-N206-041 wrong permissions set by gprinstall for binaries
Problem: On UNIX, a binary installed with gprinstall will have the
executable permission set only for the owner. This will prevent
others to execute this binary. It is a problem when installing
an application in a shared computer for example.
Status: This was fixed in 2.2 on 2014-02-06
Workaround: change the permissions manually using chmod
KP-21-N120-075 gprclean -r and cycles in externally built projects
Problem: When there are several externally built projects in the project
tree and some of them form a cycle, through limited withs,
invoking gprclean with switch -r will result in a crash.
Status: This was fixed in 2.2 on 2014-01-21
Workaround: Avoid circularities in externally built projects or invoke
gprclean without switch -r.
KP-21-N103-018 Failure to link on target powerpc-xcoff-lynxos178
Problem: For target powerpc-xcoff-lynxos178, when there are two many
object files to be linked, because a response file is not used,
the linking phase may fail.
Status: This was fixed in 2.2 on 2014-01-06
Workaround: Add these two lines in package Linker of the main project:
for Response_File_Format use "GCC_GNU";
for Max_Command_Line_Length use "8192";
KP-21-MB30-011 Garbled output from parallel invocations of gnatbind
Problem: When gprbuild is invoked with -jnn and there are several mains,
several invocations of gprbind may be running in parallel and
their displayed gnatbind invocations may be garbled.
Status: This was fixed in 2.2 on 2013-12-01
Workaround: Ignore the problem or invoke gprbuild without -jnn.
KP-21-MB26-007 Dependency builder must be invoked from the object directory
Problem: When gprbuild performs parallel compilations and for some
language a dependency builder is invoked to build a dependency
file, the dependency builder may be invoked from the object
directory of another project and thus may fail if some of its
arguments are relative paths.
Status: This was fixed in 2.2 on 2013-11-27
Workaround: Use absolute paths for the arguments of a dependency builder.
KP-21-MB05-034 gprinstall fails to install projects built with sub-dirs
Problem: gprinstall is not able to install a code which has been
built with gprbuild's --subdirs option.
Status: This was fixed in 2.2 on 2013-11-05
Workaround: Install the code manually.
KP-21-MA31-004 Aggregated libraries and externally built
Problem: gprbuild was not properly dealing with externally built
projects on the dependencies. First it was trying to add the
object code from such libraries and failed to pass the library
on to the linker.
Status: This was fixed in 2.2 on 2013-11-01
Workaround: Remove the externally built projects from the dependencies if
possible and pass the corresponding library to the linker.
KP-21-MA30-041 Aggregated libraries and gprinstall
Problem: gprinstall was not properly handling aggregate libraries. The
installation was failing and/or the generated project was not
usable.
Status: This was fixed in 2.2 on 2013-11-02
Workaround: Install the software using a script.
Known problems fixed in 2.1.2 and above
---------------------------------------
Known problems fixed in 2.1.1 and above
---------------------------------------
KP-21-MB06-054 gprinstall and shared library with version on windows
Problem: On Windows, gprinstall fails while installing a shared library
project when the attribute Library_Version is defined.
Status: This was fixed in 2.2 on 2013-11-06
This was fixed in 2.1.1 on 2013-11-27
Workaround: Manually install the library.
KP-21-MB06-015 gprinstall and standalone libraries
Problem: gprinstall does not generate a usable project file for
standalone libraries.
Status: This was fixed in 2.2 on 2013-11-06
This was fixed in 2.1.1 on 2013-11-27
Workaround: Manually adds the Library_Interface and Library_Standalone
attributes.
KP-21-MB05-020 gprconfig does not detect non GNAT gcc C and g++ compilers
Problem: gprconfig does not find all non GNAT gcc C and g++ compilers.
Status: This was fixed in 2.2 on 2013-11-07
This was fixed in 2.1.1 on 2013-12-10
Workaround: Manually edit a configuration project file and use it with
gprbuild.
gprbuild-gpl-2014-src/known-problems-152 0000644 0000767 0000145 00000003435 11673621721 017352 0 ustar gnatmail gnat ========================================
Known problems in GPRBUILD version 1.5.2
========================================
Copyright (C) 2011, AdaCore
The following is a listing of known problems in release 1.5.2. Except where
specifically noted, all these problems have been corrected in the development
tree of the 1.6 technology. This means they are corrected in any 1.6.0w
wavefront issued subsequent to the date specified (in ISO format YYYY-MM-DD) in
the status line. This can be used to determine if a given wavefront has the fix
identified in the entry.
KP-152-KA13-044 Crash when attempting to compile an header file
Problem: gprbuild crashes when asked to compile an header file,
for example with: gprbuild -u -c prj.gpr toro.h
Status: This was fixed in 1.6.0 on 2011-10-14
Workaround: Do not attempt to compile header files.
KP-152-KA04-012 Pragma Linker_Options not honored
Problem: gprbuild does not pass libraries specified with a pragma
Linker_Options to the linker.
Status: This was fixed in 1.6.0 on 2011-10-06
Workaround: Pass the corresponding libraries explicitly to the linker.
KP-152-K801-014 Crash for library projects with no sources
Problem: gprbuild and gprclean crash with a library project with no
sources that is not externally built.
Status: This was fixed in 1.6.0 on 2011-08-02
Workaround: Declare the library project as externally built.
KP-152-K711-032 Failure to build archive on Windows
Problem: On Windows, gprbuild may fail to build an archive if the
length of the command line is greater than 8192.
Status: This was fixed in 1.6.0 on 2011-07-22
Workaround: Reduce the length of the object path names to reduce the
length of the command line.
gprbuild-gpl-2014-src/CHANGES 0000644 0000767 0000145 00000000147 12323721732 015131 0 ustar gnatmail gnat {doc: 303217, gnat: 303554, gprbuild: 225341, gprbuild.anod: 7807aabc8a6be77aca4e121b12238a2da15898cd}
gprbuild-gpl-2014-src/known-problems-162 0000644 0000767 0000145 00000001073 12032613023 017331 0 ustar gnatmail gnat ========================================
Known problems in GPRBUILD version 1.6.2
========================================
Copyright (C) 2012, AdaCore
The following is a listing of known problems in release 1.6.2. Except where
specifically noted, all these problems have been corrected in the development
tree of the 2.0 technology. This means they are corrected in any 1.7.0w/2.0.0w
wavefront issued subsequent to the date specified (in ISO format YYYY-MM-DD) in
the status line. This can be used to determine if a given wavefront has the fix
identified in the entry.
gprbuild-gpl-2014-src/features-12 0000644 0000767 0000145 00000007131 11265233506 016120 0 ustar gnatmail gnat ==============================
GPRBUILD 1.2 NEW FEATURES LIST
==============================
Copyright (C) 2008-2009, AdaCore
This file contains a complete list of new features in version 1.2 of GPRBUILD.
A full description of all GPRBUILD features can be found in the GPRBUILD
User's Guide.
An ISO date (YYYY-MM-DD) appears in parentheses after the description line.
This date shows the implementation date of the feature. Any 1.2.0w
wavefront subsequent to this date will contain the indicated feature, as
will any subsequent releases.
NF-12-HA21-031 Support for -margs switch (2008-10-21)
The -margs switch, equivalent to -gargs is now supported, for better
compatibility with gnatmake.
NF-12-H903-021 Better error messages for qualified lib projects (2008-09-04)
When a project qualified as a "library project" is not a library project
because one or both of the attributes Library_Dir and Library_Name is
missing, the error message will now indicate which attribute is not
declared.
NF-12-H821-015 Use response files when available (2008-09-22)
When supported, and when the command line is too long, gprlib now uses
response files to link shared libraries.
NF-12-H812-005 Support for Diab C compiler (2008-08-28)
The Diab C compiler is now supported for powerpc-elf (using the
ppc750 variant).
NF-12-H808-006 Specifying executable name in gprconfig (2008-08-11)
The --config switch parameter to gprconfig can now be used to specify
the base name of the executable you want to use. This can be used to
easily select a type of compiler over another type, no matter whether it
appears first in the path or not.
NF-12-H806-009 Switch files only created when -s is used (2008-09-10)
Switch files (with the .cswi suffix) are now only created when the
switch -s is used.
NF-12-H712-006 Partial linker to link shared libraries (2008-07-18)
The partial linker, when declared, is now used to build shared libraries,
in chunks if the command line length would be too long to build the
shared library in one chunk.
NF-12-H518-002 New attribute Builder'Global_Compilation_Switches (2008-06-03)
A new attribute Global_Compilation_Switches ("") is created in
package Builder. This attribute is taken into account in the main project
when attribute Default_Switches ("") is not take into account.
The switches specified in Global_Compilation_Switches ("") are used
when compiling a source of language "" anywhere in the project tree.
NF-12-H501-004 Improve backward compatibility with gnatmake (2008-05-05)
Compatibility with projects accepted by gnatmake is improved:
- a main may be truncated: the body suffix may be missing
- switches from Builder'Switches () that are not recognized
by gprbuild are for the compiler of the language of the main.
NF-12-H408-020 New attributes Object_Generated and Objects_Linked (2008-04-16)
New attributes for languages are created: Object_Generated (when "false",
it means that no object file is created by the "compiler") and
Objects_Linked (when "false", it means that the object files of the
languages are not linked in an executable or put in a library).
NF-12-H404-015 Warning when no source of a language (2008-04-05)
When a language is declared or defaulted in a project file and there is
no source of the language, gprbuild now issues a warning indicating this,
unless warnings are suppressed.
NF-12-H116-039 Partial linking in chunks (2008-07-18)
When the partial linker is declared, a static stand-alone library is
linked in chunks if the command line would be too long to link it in
one chunk.
gprbuild-gpl-2014-src/known-problems-200 0000644 0000767 0000145 00000001634 12072675335 017347 0 ustar gnatmail gnat ========================================
Known problems in GPRBUILD version 2.0.0
========================================
Copyright (C) 2013, AdaCore
The following is a listing of known problems in release 2.0.0. Except where
specifically noted, all these problems have been corrected in the development
tree of the 2.1 technology. This means they are corrected in any 2.1.0w
wavefront issued subsequent to the date specified (in ISO format YYYY-MM-DD) in
the status line. This can be used to determine if a given wavefront has the fix
identified in the entry.
KP-200-M104-032 Modified library in externally built library project
Problem: When the library file of an externally built library project
is modified, executables that depend on this library are not
always relinked.
Status: This was fixed in 2.1.0 on 2012-01-07
Workaround: Force recompilation of the executables.
gprbuild-gpl-2014-src/known-problems-161 0000644 0000767 0000145 00000001572 12032613023 017334 0 ustar gnatmail gnat ========================================
Known problems in GPRBUILD version 1.6.1
========================================
Copyright (C) 2012, AdaCore
The following is a listing of known problems in release 1.6.1. Except where
specifically noted, all these problems have been corrected in the development
tree of the 2.0 technology. This means they are corrected in any 1.7.0w/2.0.0w
wavefront issued subsequent to the date specified (in ISO format YYYY-MM-DD) in
the status line. This can be used to determine if a given wavefront has the fix
identified in the entry.
KP-161-KC01-033 gprconfig: duplicate runtimes detected on Windows
Problem: On Windows, gprconfig will sometimes report the "default" runtime
multiple times for a given Ada compiler.
Status: This was fixed in 1.6.2 on 2012-03-28
Workaround: Selecting any of the lines has the same effect.
gprbuild-gpl-2014-src/known-problems-150 0000644 0000767 0000145 00000003272 11522317416 017343 0 ustar gnatmail gnat ========================================
Known problems in GPRBUILD version 1.5.0
========================================
Copyright (C) 2010-2011, AdaCore
The following is a listing of known problems in release 1.5.0. All these
problems have been corrected in the release 1.5.1 and in any wavefront
issued subsequent to the date specified (in ISO format YYYY-MM-DD) in the
status line. This can be used to determine if a given wavefront has the fix
identified in the entry.
KP-150-JC22-022 Duplicate rpaths when there are several mains
Problem: gprbuild keeps the rpaths from the previous mains when linking
another main. That may leads to reach a limit in some platforms,
and the link may then fail.
Status: This was fixed in 1.5.1 on 2010-12-29
Workaround: Invoke gprbuild to link one main at a time.
KP-150-JC09-012 Main in mixed cases on Windows
Problem: On Windows, if the mains in attributes Mains contain capital
letters, linking executables may fail.
Status: This was fixed in 1.5.1 on 2011-01-07
Workaround: Use only small letters in attribute Main.
KP-150-JB09-027 Improper attempt to compile locally removed body
Problem: gprbuild attempts to compiled the body of a package that has
been "locally removed" in an extended project.
Status: This was fixed in 1.5.1 on 2010-11-09
Workaround: Make sure the spec needs a body.
KP-150-J512-013 gprconfig's requires a prefix
Problem: In its knowledge base, gprconfig requires a valid prefix
attribute for nodes.
Status: This was fixed in 1.5.1 on 2010-12-01
Workaround: Add prefix="-1" to
gprbuild-gpl-2014-src/features-21 0000644 0000767 0000145 00000011256 12301444157 016121 0 ustar gnatmail gnat ==============================
GPRBUILD 2.1 NEW FEATURES LIST
==============================
Copyright (C) 2012-2014, AdaCore
This file contains a complete list of new features in version 2.1 of GPRBUILD.
A full description of all GPRBUILD features can be found in the GPRBUILD
User's Guide.
NF-21-MC01-007 Add support for artifacts in gprinstall (2013-12-22)
It is now possible to install files or directories not part of the
project (source or object). Those artifacts are described into the
project's Install package and can be used to install documentation
or examples.
NF-21-M918-043 Attributes External and environment variables (2013-09-19)
In main aggregate project, when attribute External is specified, the
corresponding environment variable is set, if it is not already set in the
environment.
NF-21-M719-035 -b, -c and -l may be used in package Builder (2013-08-08)
The switches -c, -b and -l are no longer restricted to the command line. They
may be specified in package Builder of the main project.
NF-21-M719-029 --no-object-check may be used in package Builder (2013-07-21)
The gprbuild switch --no-object-check is no longer restricted to the command
line. It may be specified in package Builder of the main project file.
NF-21-M714-001 Bind and link several executables simultaneously (2013-07-17)
gprbuild is now able to bind several executables simultaneously when
switch -jnnn is used, with nnn other than 1. It is also able to link
these executables simultaneously with the same switch -jnnn.
NF-21-M529-021 Clean artifacts in object and exec directories (2013-06-18)
gprclean now cleans from the object directory the files specified in
new attribute Artifacts_In_Object_Dir in package Clean and for main projects
cleans from the exec directory the files specified in new attribute
Artifacts_In_Exec_Dir in package Clean.
NF-21-M405-028 gprinstall now supports cross-environment (2013-04-05)
gprinstall will work in cross-environment by using the newly added
--target option. This way it is possible to install a .dll created
from a Windows cross-compiler on GNU/Linux for example.
NF-21-M304-056 gprinstall now preserves timestamps (2013-03-05)
gprinstall now preserves timestamps when copying the source files,
object files and libraries.
NF-21-LC19-034 Project_Path searched before ADA_PROJECT_PATH (2013-01-04)
Project_Path values are searched before ADA_PROJECT_PATH. This behavior
is better as if Project_Path is defined for the aggregate project we
do not want to pick a random project found in ADA_PROJECT_PATH.
NF-21-LA25-026 Aggregate projects and auto-configuration (2012-01-11)
gprbuild fails when the project tree includes only aggregate projects and
aggregate libraries projects. When gprbuild is called with a main project
that is either an aggregate project or an aggregate library project,
if auto-configuration is used, the configuration project file is created
in the object directory of one of the non aggregate projects in the project
tree.
NF-21-LA22-030 New Linker attribute Trailing_Switches (2012-12-29)
A new attribute Trailing_Switches has been added in package Linker of
project files. These switches are added in the linking command line
after the required switches, so that they can override these switches.
NF-21-LA05-034 --config= in Builder switches (2012-12-24)
gprbuild now takes into account a switch --config= in package Builder
of the main project.
NF-21-L809-007 Non Ada sources copied to the Library_Src_Dir (2013-06-24)
In a library project, when attributes Library_Src_Dir and Interfaces are
declared and there are non Ada sources/templates in the Interfaces,
these sources/templates are now copied to the Library_Src_Dir.
NF-21-L724-003 Empty Run_Path_Origin (2013-02-05)
It is now allowed to specify attribute Run_Path_Origin as an empty
string. This allows the run paths to be absolute paths. Then an executable
may be moved to another directory without moving the shared libraries
it needs.
NF-21-KB01-015 libstdc++.so directory in run path option (2013-06-26)
A new configuration attribute Library_Rpath_Options is created. The main
goal of this attribute is to make sure that shared libraries with C++ code
are linked with a run path option that includes the directory of the
correct libstdc++.so.
NF-21-K826-028 Add support for distributed compilation (2012-12-19)
It is now possible to use multiple computers to conduct the compilations.
This can give good speed-up for large projects.
NF-21-K314-016 Linking several executables simultaneously (2013-07-14)
gprbuild is now able to link several executables simultaneously when
switch -jnnn is used, with nnn other than 1.
gprbuild-gpl-2014-src/known-problems-141 0000644 0000767 0000145 00000014323 11403143521 017332 0 ustar gnatmail gnat ========================================
Known problems in GPRBUILD version 1.4.1
========================================
Copyright (c) 2010 AdaCore
The following is a listing of known problems in release 1.4.1. Except where
specifically noted, all these problems have been corrected in the development
tree of the 1.5 technology. This means they are corrected in any wavefront
issued subsequent to the date specified (in ISO format YYYY-MM-DD) in the
status line. This can be used to determine if a given wavefront has the fix
identified in the entry.
KP-141-J513-012 Same source file name in different projects and languages
Problem: gprbuild does not accept an Ada source to have the same file name
as the source of another language in another project.
Status: This was fixed in 1.5.0 on 2010-05-17
Workaround: Do not put the two projects in the same project tree.
KP-141-J512-013 gprconfig always appends .exe on Windows
Problem: On windows, gprconfig will always add ".exe" to the executable
name specified in the XML files (node ), even if
this extension is already specified.
Status: This was fixed in 1.5.0 on 2010-05-12
Workaround: This is only a problem when trying to share the same XML file
on Unix and Windows systems, and naming the executables with
".exe" on the unix platform. In such a case, use two different
XML files.
KP-141-J506-012 Linking command line too long on VxWorks cross platforms
Problem: On VxWorks cross platforms hosted on Windows, if the linking
command line is too long (>32K) because there are two many
Ada object files, the linking phase will fail.
Status: This was fixed in 1.5.0 on 2010-05-07
Workaround: Reduce the linking command line length by changing some
project files to non shared library project files.
KP-141-J504-020 Shared SAL cannot import non library project
Problem: When building a shared Stand-Alone Library project that imports
a non library project with switch --unchecked-shared-lib-imports,
the binding of the library fails.
Status: This was fixed in 1.4.2 on 2010-05-05
Workaround: Do not import a non library project in a shared SAL
KP-141-J325-035 Fake object files for header files in libraries
Problem: When in a library project a header file has the same base name
as an Ada source in the main project and the library project has
the same object directory as the main project, linking
executables may fail, as the object files corresponding to the
Ada source is not specified to the linker.
Status: This was fixed in 1.4.2 on 2010-03-30
Workaround: Specify a different object directory for the library project.
KP-141-J316-017 Recompilation with switches -I in package Compiler
Problem: When switches -I are specified in package Compiler for languages
other than Ada, gprbuild may recompile up-to-date sources of
these languages.
Status: This was fixed in 1.5.0 on 2010-03-18
Workaround: Avoid switches -I. Use sourceless auxiliary project files to
specify the header directories.
KP-141-J310-029 Builder'Switches (others) not taken into account
Problem: When there are no mains (for example in a library project) or
several mains with different languages, the switches specified in
Builder'Switches (others) are not taken into account.
Status: This was fixed in 1.4.2 on 2010-03-11
Workaround: Specify the switches on the command line.
KP-141-J309-023 Crash with pragma Restrictions (No_Dependence => ...)
Problem gprbuild may crash when an ALI file contains R lines to record
pragmas Restrictions (No_Dependence => ...).
Status: This was fixed in 1.5.0 on 2010-03-11
Workaround: Remove the pragmas Restrictions (No_Dependence => ...).
KP-141-J305-007 gprbuild fails to scan properly ALI files
Problem: When gprbuild is used with an Ada compiler with sources more
recent than those of gprbuild, it may happen that the compiler
put lines in the ALI files that are not known by gprbuild, and
then gprbuild fails to scan properly ALI files.
Status: This was fixed in 1.4.2 on 2010-03-07
Workaround: Use a new version of gprbuild.
KP-141-J301-025 Builder switch -p passed to the compiler
Problem: When gprbuild find the switch -p in package Builder of the
main project, it invoke the compiler with this switch.
Status: This was fixed in 1.5.0 on 2010-03-02
Workaround: Remove switch -p from package Builder.
KP-141-J107-023 Extending project and --no-indirect-imports
Problem: gprbuild fails to compile a source in a project being extended
that imports from the extending project when invoked with
--no-indirect-imports.
Status: This was fixed in 1.4.2 on 2010-01-07
Workaround: Invoke gprbuild without --no-indirect-imports.
KP-141-IC08-014 Duplicate Linker_Options for extending projects
Problem: An project extending another project inherits
Linker'Linker_Options which may result in failure to link because
of duplicate inker options.
Status: This was fixed in 1.5.0 on 2009-12-08
Workaround: Declare empty Linker_Options in the extending project
KP-141-IB16-009 Language configuration redefined in extending project
Problem: When the compiler of a language is defined as non existent and
an existing driver is declared in an extending project, the
the sources of the original project are not compiled.
Status: This was fixed in 1.5.0 on 2009-11-25
Workaround: Avoid declaring non existent compiler if the project is extended.
KP-141-I925-022 No language detected when extending a project with no languages
Problem: A project that extends another project with no languages may
not have a default language, as no languages were found during
auto configuration.
Status: This was fixed in 1.5.0 on 2009-10-23
Workaround: Declare the Ada language in the extending project.
gprbuild-gpl-2014-src/src/ 0000755 0000767 0000145 00000000000 12317234544 014726 5 ustar gnatmail gnat gprbuild-gpl-2014-src/src/gprbuild-link.ads 0000644 0000767 0000145 00000003332 12323721731 020157 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B U I L D . L I N K --
-- --
-- S p e c --
-- --
-- Copyright (C) 2011-2012, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
package Gprbuild.Link is
procedure Run;
-- Perform linking, if necessary, for all registered mains: main project,
-- aggregated projects,...
end Gprbuild.Link;
gprbuild-gpl-2014-src/src/ccomp.adb 0000644 0000767 0000145 00000017340 12323721731 016500 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- C C O M P --
-- --
-- B o d y --
-- --
-- Copyright (C) 2010-2012, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- This program is used on VMS as a front end to invoke the DEC C compiler CC
pragma Extend_System (Aux_DEC);
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with Osint; use Osint;
with System; use System;
procedure Ccomp is
subtype Cond_Value_Type is System.Unsigned_Longword;
Output_File_Name : String_Access;
procedure Spawn (Status : out Cond_Value_Type; Command : String;
Input_File : String := String'Null_Parameter;
Output_File : String := String'Null_Parameter);
pragma Import (External, Spawn);
pragma Import_Valued_Procedure
(Spawn, "LIB$SPAWN",
(Cond_Value_Type, String, String, String),
(Value, Descriptor (S), Descriptor (S), Descriptor (S)));
-- LIB$SPAWN is used to invoke the CC compiler
procedure Stop (Status : Cond_Value_Type);
pragma Import (External, Stop);
pragma Import_Procedure (Stop, "LIB$STOP", Mechanism => Value);
-- LIB$STOP is used to set the error code when the invocation of CC fails
Success : constant Cond_Value_Type := 1;
Command : constant String := "cc";
Status : Cond_Value_Type;
Include_Directory : constant String := "/INCLUDE_DIRECTORY=";
Mms_Dependencies : constant String := "/MMS_DEPENDENCIES=FILE=";
Output_File : constant String := "-o";
Verbose : Boolean := False;
procedure Add
(S : in out String_Access;
Last : in out Natural;
Value : String);
-- Add string Value to string variable S, updating Last
---------
-- Add --
---------
procedure Add
(S : in out String_Access;
Last : in out Natural;
Value : String)
is
begin
while S'Last < Last + Value'Length loop
declare
New_S : constant String_Access := new String (1 .. 2 * S'Last);
begin
New_S (1 .. Last) := S (1 .. Last);
Free (S);
S := New_S;
end;
end loop;
S (Last + 1 .. Last + Value'Length) := Value;
Last := Last + Value'Length;
end Add;
begin
declare
Command_String : String_Access := new String (1 .. 40);
-- This is the command string that will be used to invoke CC
Last_Command : Natural := 0;
Includes : String_Access := new String (1 .. 40);
-- As they can be only one /INCLUDE_DIRECTORY= option, we regroupe all
-- directories in string Includes.
Last_Include : Natural := 0;
Arg_Num : Natural;
begin
Add (Command_String, Last_Command, Command);
Arg_Num := 0;
while Arg_Num < Argument_Count loop
Arg_Num := Arg_Num + 1;
declare
Arg : constant String := Argument (Arg_Num);
begin
-- If this command is /INCLUDE_DIRECTORY=, add the directory to
-- string Includes.
if Arg'Length > Include_Directory'Length and then
Arg (Arg'First .. Arg'First + Include_Directory'Length - 1) =
Include_Directory
then
if Last_Include = 0 then
Add (Includes, Last_Include, Include_Directory & "(");
else
Add (Includes, Last_Include, ",");
end if;
declare
Dir : constant String :=
Arg (Arg'First + Include_Directory'Length .. Arg'Last);
New_Dir : String_Access;
begin
if Is_Directory (Dir) then
New_Dir := To_Host_Dir_Spec (Dir, False);
Add (Includes, Last_Include, New_Dir.all);
else
Add (Includes, Last_Include, Dir);
end if;
end;
elsif Arg'Length > Mms_Dependencies'Length and then
Arg (Arg'First .. Arg'First + Mms_Dependencies'Length - 1) =
Mms_Dependencies
then
Add (Command_String,
Last_Command,
" " & Mms_Dependencies &
To_Host_File_Spec
(Arg
(Arg'First + Mms_Dependencies'Length ..
Arg'Last)).all);
-- If it is "-o", the next argument is the output file
elsif Arg = Output_File then
if Arg_Num < Argument_Count then
Arg_Num := Arg_Num + 1;
Output_File_Name := To_Host_File_Spec (Argument (Arg_Num));
end if;
-- If it is "-v", skip the argument and set Verbose to True
elsif Arg = "-v" then
Verbose := True;
-- Otherwise, add argument to the command string
else
declare
New_Arg : String_Access;
begin
if Is_Regular_File (Arg) then
New_Arg := To_Host_File_Spec (Arg);
elsif Is_Directory (Arg) then
New_Arg := To_Host_Dir_Spec (Arg, False);
end if;
if New_Arg /= null then
Add (Command_String, Last_Command, " " & New_Arg.all);
else
Add (Command_String, Last_Command, " " & Arg);
end if;
end;
end if;
end;
end loop;
-- If there was at least one /INCLUDE_DIRECTORY= switch, add
-- /INCLUDE_DIRECTORY= with all directories to the command string.
if Last_Include /= 0 then
Add
(Command_String,
Last_Command,
" " & Includes (1 .. Last_Include) & ")");
end if;
-- Invoke CC
declare
Cmd : constant String (1 .. Last_Command) :=
Command_String (1 .. Last_Command);
begin
if Verbose then
Put_Line (Cmd);
end if;
if Output_File_Name /= null then
Spawn (Status, Cmd, Output_File => Output_File_Name.all);
else
Spawn (Status, Cmd);
end if;
if (Status mod 2) /= Success then
Stop (Status);
end if;
end;
end;
end Ccomp;
gprbuild-gpl-2014-src/src/gprbuild-post_compile.adb 0000644 0000767 0000145 00000361713 12323721731 021710 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B U I L D . P O S T _ C O M P I L E --
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-2013, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Ada.Containers.Ordered_Sets;
with Ada.Text_IO; use Ada, Ada.Text_IO;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with Debug; use Debug;
with Gpr_Util; use Gpr_Util;
with Gprexch; use Gprexch;
with Makeutl; use Makeutl;
with Opt;
with Osint; use Osint;
with Output; use Output;
with Prj.Env;
with Prj.Util; use Prj.Util;
with Snames; use Snames;
with Tempdir;
package body Gprbuild.Post_Compile is
type Lang_Names is array (Positive range <>) of Language_Ptr;
type Lang_Names_Ptr is access Lang_Names;
Langs : Lang_Names_Ptr := new Lang_Names (1 .. 4);
Last_Lang : Natural := 0;
procedure Build_Library
(For_Project : Project_Id;
Project_Tree : Project_Tree_Ref;
No_Create : Boolean);
-- Build, if necessary, the library of a library project. If No_Create
-- is True then the actual static or shared library is not built, yet
-- the exchange file with dependencies is created.
procedure Post_Compilation_Phase
(Main_Project : Project_Id; Project_Tree : Project_Tree_Ref);
function Is_Included_In_Global_Archive
(Object_Name : File_Name_Type;
Project : Project_Id) return Boolean;
-- Return True if the object Object_Name is not overridden by a source
-- in a project extending project Project.
type Library_Object is record
Path : Path_Name_Type;
TS : Time_Stamp_Type;
Known : Boolean;
end record;
package Library_Objs is new Table.Table
(Table_Component_Type => Library_Object,
Table_Index_Type => Integer,
Table_Low_Bound => 1,
Table_Initial => 10,
Table_Increment => 10,
Table_Name => "Buildgpr.Library_Objs");
-- Library objects with their time stamps
package Project_File_Paths is new GNAT.HTable.Simple_HTable
(Header_Num => Prj.Header_Num,
Element => Boolean,
No_Element => False,
Key => Name_Id,
Hash => Hash,
Equal => "=");
procedure CodePeer_Globalize;
-- Call the codepeer_globalizer for each of the object directories
-------------------
-- Build_Library --
-------------------
procedure Build_Library
(For_Project : Project_Id;
Project_Tree : Project_Tree_Ref;
No_Create : Boolean)
is
package Lang_Set is new Containers.Ordered_Sets (Name_Id);
procedure Get_Objects;
-- Get the paths of the object files of the library in table
-- Library_Objs.
procedure Write_List
(File : Text_IO.File_Type;
Label : Library_Section;
List : String_List_Id);
-- Write values in list into section Label in the given file. Ouptut
-- Label if it is not the current section.
procedure Write_Name_List
(File : Text_IO.File_Type;
Label : Library_Section;
List : Name_List_Index);
-- Write name list values into the File, output Label first. Ouptut
-- Label if it is not the current section.
-- Procedures to write specific sections of the exchange file
procedure Write_Object_Files;
procedure Write_Object_Directory;
procedure Write_Compilers;
procedure Write_Compiler_Leading_Switches;
procedure Write_Compiler_Trailing_Switches;
procedure Write_Partial_Linker;
procedure Write_Shared_Lib_Minimum_Options;
procedure Write_Library_Version;
procedure Write_Runtime_Library_Dir;
procedure Write_Auto_Init;
procedure Write_Run_Path_Option;
procedure Write_Leading_Library_Options;
procedure Write_Library_Options;
procedure Write_Library_Rpath_Options;
procedure Write_Imported_Libraries;
procedure Write_Dependency_Files;
procedure Write_Toolchain_Version;
procedure Write_Interface_Dep_Files;
procedure Write_Other_Interfaces;
procedure Write_Sources;
procedure Write_Response_Files;
Object_Directory_Path : String_Access;
Project_Name : constant String :=
Get_Name_String (For_Project.Name);
Current_Dir : constant String := Get_Current_Dir;
Exchange_File : Text_IO.File_Type;
Exchange_File_Name : String_Access;
Latest_Object_TS : Time_Stamp_Type := Empty_Time_Stamp;
Library_Builder_Name : String_Access;
Library_Builder : String_Access;
Library_Needs_To_Be_Built : Boolean := False;
Object_Path : Path_Name_Type;
Object_TS : Time_Stamp_Type;
Source : Source_Id;
Project : Project_Id;
Disregard : Boolean;
Path_Found : Boolean;
Iter : Source_Iterator;
Current_Section : Library_Section := No_Library_Section;
-----------------
-- Get_Objects --
-----------------
procedure Get_Objects is
procedure Process
(Proj : Project_Id;
Tree : Project_Tree_Ref;
S : in out Boolean);
-- Get objects for corresponding project
-------------
-- Process --
-------------
procedure Process
(Proj : Project_Id;
Tree : Project_Tree_Ref;
S : in out Boolean)
is
pragma Unreferenced (S);
Never : constant Time_Stamp_Type := (others => '9');
-- A time stamp that is greater than any real one
Source : Source_Id;
Iter : Source_Iterator;
begin
Iter := For_Each_Source (Tree, Proj);
loop
Source := Prj.Element (Iter);
exit when Source = No_Source;
Change_To_Object_Directory (Source.Project);
Initialize_Source_Record (Source);
if Is_Compilable (Source)
and then Source.Language.Config.Objects_Linked
and then
((Source.Unit = No_Unit_Index
and then Source.Kind = Impl)
or else
(Source.Unit /= No_Unit_Index
and then (Source.Kind = Impl
or else Other_Part (Source) = No_Source)
and then not Is_Subunit (Source)))
and then
(not Source.Project.Externally_Built
or else Source.Project.Extended_By /= No_Project)
then
Library_Objs.Append
((Path => Source.Object_Path,
TS => Source.Object_TS,
Known => False));
if Source.Object_TS = Empty_Time_Stamp then
Latest_Object_TS := Never;
if not Library_Needs_To_Be_Built then
Library_Needs_To_Be_Built := True;
if Opt.Verbose_Mode then
Write_Str (" -> missing object file: ");
Get_Name_String (Source.Object);
Write_Line (Name_Buffer (1 .. Name_Len));
end if;
end if;
elsif Source.Object_TS > Latest_Object_TS then
Latest_Object_TS := Source.Object_TS;
end if;
end if;
Next (Iter);
end loop;
end Process;
procedure Process_Project_And_Imported is
new For_Every_Project_Imported (Boolean, Process);
S : Boolean := False;
Proj : Project_Id := For_Project;
begin
Library_Objs.Init;
if For_Project.Qualifier = Aggregate_Library then
Process_Project_And_Imported
(For_Project, Project_Tree, S, Include_Aggregated => False);
else
while Proj /= No_Project loop
Process (Proj, Project_Tree, S);
Proj := Proj.Extends;
end loop;
end if;
end Get_Objects;
------------------------
-- Write_Object_Files --
------------------------
procedure Write_Object_Files is
begin
if Library_Objs.Last > 0 then
Put_Line (Exchange_File, Library_Label (Object_Files));
for J in 1 .. Library_Objs.Last loop
Put_Line
(Exchange_File,
Get_Name_String (Library_Objs.Table (J).Path));
end loop;
end if;
end Write_Object_Files;
----------------------------
-- Write_Object_Directory --
----------------------------
procedure Write_Object_Directory is
begin
Put_Line (Exchange_File, Library_Label (Object_Directory));
-- Do not output object directory for an aggregate library as such
-- library does not have objects by themselves.
if For_Project.Qualifier /= Aggregate_Library then
Put_Line (Exchange_File, Object_Directory_Path.all);
end if;
-- Add object directory of project being extended, if any
declare
Proj : Project_Id := For_Project.Extends;
begin
while Proj /= No_Project loop
if Proj.Object_Directory /= No_Path_Information then
Put_Line
(Exchange_File,
Get_Name_String (Proj.Object_Directory.Display_Name));
end if;
Proj := Proj.Extends;
end loop;
end;
-- Add object directories of imported non library projects
Process_Imported_Non_Libraries (For_Project);
declare
Proj : Project_Id;
begin
for J in 1 .. Non_Library_Projs.Last loop
Proj := Non_Library_Projs.Table (J);
if Proj.Object_Directory /= No_Path_Information then
Put_Line
(Exchange_File,
Get_Name_String (Proj.Object_Directory.Display_Name));
end if;
end loop;
end;
-- Add ALI dir directories of imported projects (only if it is not an
-- externally built project or if the project has sources). This skip
-- the library projects with no sources used for example to add a
-- system library to the linker.
declare
List : Project_List := For_Project.All_Imported_Projects;
begin
while List /= null loop
if not List.Project.Externally_Built
or else List.Project.Source_Dirs /= Nil_String
then
if List.Project.Library_ALI_Dir /= No_Path_Information then
Put_Line
(Exchange_File,
Get_Name_String
(List.Project.Library_ALI_Dir.Display_Name));
elsif List.Project.Library_Dir /= No_Path_Information then
Put_Line
(Exchange_File,
Get_Name_String
(List.Project.Library_Dir.Display_Name));
end if;
end if;
List := List.Next;
end loop;
end;
end Write_Object_Directory;
---------------------
-- Write_Compilers --
---------------------
procedure Write_Compilers is
procedure Compilers_For
(Project : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean);
-- Write compilers for the given project
Dummy : Boolean := True;
Lang_Seen : Lang_Set.Set;
-------------------
-- Compilers_For --
-------------------
procedure Compilers_For
(Project : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean)
is
pragma Unreferenced (Tree, Dummy);
Lang : Language_Ptr := Project.Languages;
Compiler : String_Access;
begin
-- Exchange file, Compilers section
while Lang /= No_Language_Index loop
if not Lang_Seen.Contains (Lang.Name) then
Lang_Seen.Insert (Lang.Name);
Compiler := Get_Compiler_Driver_Path (Project_Tree, Lang);
if Compiler /= null then
Put_Line (Exchange_File, Get_Name_String (Lang.Name));
Put_Line (Exchange_File, Compiler.all);
elsif Lang.Config.Compiler_Driver /= No_File then
Put_Line (Exchange_File, Get_Name_String (Lang.Name));
Put_Line
(Exchange_File,
Get_Name_String (Lang.Config.Compiler_Driver));
end if;
end if;
Lang := Lang.Next;
end loop;
end Compilers_For;
procedure For_Imported is
new For_Every_Project_Imported (Boolean, Compilers_For);
begin
Put_Line (Exchange_File, Library_Label (Compilers));
Compilers_For (For_Project, Project_Tree, Dummy);
if For_Project.Qualifier = Aggregate_Library then
For_Imported (For_Project, Project_Tree, Dummy);
end if;
end Write_Compilers;
-------------------------------------
-- Write_Compiler_Leading_Switches --
-------------------------------------
procedure Write_Compiler_Leading_Switches is
procedure Compiler_Leading_Switches_For
(Project : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean);
-- Write compilers for the given project
Dummy : Boolean := True;
Lang_Seen : Lang_Set.Set;
-----------------------------------
-- Compiler_Leading_Switches_For --
-----------------------------------
procedure Compiler_Leading_Switches_For
(Project : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean)
is
pragma Unreferenced (Tree, Dummy);
Lang : Language_Ptr := Project.Languages;
Indx : Name_List_Index;
Node : Name_Node;
begin
while Lang /= No_Language_Index loop
if not Lang_Seen.Contains (Lang.Name) then
Lang_Seen.Insert (Lang.Name);
Indx := Lang.Config.Compiler_Leading_Required_Switches;
if Indx /= No_Name_List then
Put_Line
(Exchange_File,
"language=" & Get_Name_String (Lang.Name));
while Indx /= No_Name_List loop
Node := Project_Tree.Shared.Name_Lists.Table (Indx);
Put_Line (Exchange_File, Get_Name_String (Node.Name));
Indx := Node.Next;
end loop;
end if;
end if;
Lang := Lang.Next;
end loop;
end Compiler_Leading_Switches_For;
procedure For_Imported is new For_Every_Project_Imported
(Boolean, Compiler_Leading_Switches_For);
begin
Put_Line (Exchange_File, Library_Label (Compiler_Leading_Switches));
Compiler_Leading_Switches_For (For_Project, Project_Tree, Dummy);
if For_Project.Qualifier = Aggregate_Library then
For_Imported (For_Project, Project_Tree, Dummy);
end if;
end Write_Compiler_Leading_Switches;
--------------------------------------
-- Write_Compiler_Trailing_Switches --
--------------------------------------
procedure Write_Compiler_Trailing_Switches is
procedure Compiler_Trailing_Switches_For
(Project : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean);
-- Write compilers for the given project
Dummy : Boolean := True;
Lang_Seen : Lang_Set.Set;
------------------------------------
-- Compiler_Trailing_Switches_For --
------------------------------------
procedure Compiler_Trailing_Switches_For
(Project : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean)
is
pragma Unreferenced (Tree, Dummy);
Lang : Language_Ptr := Project.Languages;
Indx : Name_List_Index;
Node : Name_Node;
begin
while Lang /= No_Language_Index loop
if not Lang_Seen.Contains (Lang.Name) then
Lang_Seen.Insert (Lang.Name);
Indx := Lang.Config.Compiler_Trailing_Required_Switches;
if Indx /= No_Name_List then
Put_Line
(Exchange_File,
"language=" & Get_Name_String (Lang.Name));
while Indx /= No_Name_List loop
Node := Project_Tree.Shared.Name_Lists.Table (Indx);
Put_Line (Exchange_File, Get_Name_String (Node.Name));
Indx := Node.Next;
end loop;
end if;
end if;
Lang := Lang.Next;
end loop;
end Compiler_Trailing_Switches_For;
procedure For_Imported is new For_Every_Project_Imported
(Boolean, Compiler_Trailing_Switches_For);
begin
Put_Line
(Exchange_File, Library_Label (Compiler_Trailing_Switches));
Compiler_Trailing_Switches_For (For_Project, Project_Tree, Dummy);
if For_Project.Qualifier = Aggregate_Library then
For_Imported (For_Project, Project_Tree, Dummy);
end if;
end Write_Compiler_Trailing_Switches;
----------------
-- Write_List --
----------------
procedure Write_List
(File : Text_IO.File_Type;
Label : Library_Section;
List : String_List_Id)
is
Current : String_List_Id := List;
Element : String_Element;
Output_Label : Boolean := True;
begin
while Current /= Nil_String loop
Element :=
Project_Tree.Shared.String_Elements.Table (Current);
Get_Name_String (Element.Value);
if Name_Len /= 0 then
if Output_Label and then Current_Section /= Label then
Put_Line (File, Library_Label (Label));
Output_Label := False;
Current_Section := Label;
end if;
Put_Line (File, Name_Buffer (1 .. Name_Len));
end if;
Current := Element.Next;
end loop;
end Write_List;
---------------------
-- Write_Name_List --
---------------------
procedure Write_Name_List
(File : Text_IO.File_Type;
Label : Library_Section;
List : Name_List_Index)
is
Current : Name_List_Index := List;
Nam : Name_Node;
begin
if List /= No_Name_List then
if Current_Section /= Label then
Put_Line (File, Library_Label (Label));
Current_Section := Label;
end if;
while Current /= No_Name_List loop
Nam := Project_Tree.Shared.Name_Lists.Table (Current);
Put_Line (File, Get_Name_String (Nam.Name));
Current := Nam.Next;
end loop;
end if;
end Write_Name_List;
--------------------------
-- Write_Partial_Linker --
--------------------------
procedure Write_Partial_Linker is
List : constant Name_List_Index :=
For_Project.Config.Lib_Partial_Linker;
begin
if List /= No_Name_List then
Write_Name_List (Exchange_File, Partial_Linker, List);
end if;
end Write_Partial_Linker;
--------------------------------------
-- Write_Shared_Lib_Minimum_Options --
--------------------------------------
procedure Write_Shared_Lib_Minimum_Options is
Library_Options : Variable_Value := Nil_Variable_Value;
begin
-- Output the minimal options to build a shared library (standard
-- or encapsulated).
if For_Project.Standalone_Library = Encapsulated then
Library_Options :=
Value_Of
(Name_Library_Encapsulated_Options,
For_Project.Decl.Attributes, Project_Tree.Shared);
if not Library_Options.Default then
Write_List
(Exchange_File,
Gprexch.Shared_Lib_Minimum_Options,
Library_Options.Values);
end if;
else
Write_Name_List
(Exchange_File,
Shared_Lib_Minimum_Options,
For_Project.Config.Shared_Lib_Min_Options);
end if;
end Write_Shared_Lib_Minimum_Options;
---------------------------
-- Write_Library_Version --
---------------------------
procedure Write_Library_Version is
List : constant Name_List_Index :=
For_Project.Config.Lib_Version_Options;
begin
if List /= No_Name_List then
Write_Name_List (Exchange_File, Library_Version_Options, List);
end if;
end Write_Library_Version;
-------------------------------
-- Write_Runtime_Library_Dir --
-------------------------------
procedure Write_Runtime_Library_Dir is
use type Ada.Containers.Count_Type;
procedure RTL_For
(Project : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean);
-- Write runtime libraries for the given project
Dummy : Boolean := True;
Lang_Seen : Lang_Set.Set;
-------------
-- RTL_For --
-------------
procedure RTL_For
(Project : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean)
is
pragma Unreferenced (Tree, Dummy);
List : Language_Ptr := Project.Languages;
begin
while List /= No_Language_Index loop
if List.Config.Runtime_Library_Dir /= No_Name
and then not Lang_Seen.Contains (List.Name)
then
if Lang_Seen.Length = 0 then
Put_Line
(Exchange_File, Library_Label (Runtime_Library_Dir));
end if;
Lang_Seen.Insert (List.Name);
Put_Line (Exchange_File, Get_Name_String (List.Name));
Put_Line
(Exchange_File,
Get_Name_String (List.Config.Runtime_Library_Dir));
end if;
List := List.Next;
end loop;
end RTL_For;
procedure For_Imported is
new For_Every_Project_Imported (Boolean, RTL_For);
begin
RTL_For (For_Project, Project_Tree, Dummy);
if For_Project.Qualifier = Aggregate_Library then
For_Imported (For_Project, Project_Tree, Dummy);
end if;
end Write_Runtime_Library_Dir;
---------------------
-- Write_Auto_Init --
---------------------
procedure Write_Auto_Init is
begin
if For_Project.Standalone_Library /= No then
if For_Project.Lib_Auto_Init then
Put_Line (Exchange_File, Library_Label (Auto_Init));
end if;
declare
Binder_Package : constant Package_Id :=
Value_Of
(Name => Name_Binder,
In_Packages =>
For_Project.Decl.Packages,
Shared => Project_Tree.Shared);
begin
if Binder_Package /= No_Package then
declare
Defaults : constant Array_Element_Id :=
Value_Of
(Name => Name_Default_Switches,
In_Arrays =>
Project_Tree.Shared.Packages.Table
(Binder_Package).Decl.Arrays,
Shared => Project_Tree.Shared);
Switches : Variable_Value := Nil_Variable_Value;
begin
if Defaults /= No_Array_Element then
Switches :=
Value_Of
(Index => Name_Ada,
Src_Index => 0,
In_Array => Defaults,
Shared => Project_Tree.Shared);
if not Switches.Default then
Write_List
(Exchange_File, Gprexch.Binding_Options,
Switches.Values);
end if;
end if;
end;
end if;
end;
end if;
end Write_Auto_Init;
---------------------------
-- Write_Run_Path_Option --
---------------------------
procedure Write_Run_Path_Option is
List : constant Name_List_Index :=
For_Project.Config.Run_Path_Option;
begin
if Opt.Run_Path_Option and then List /= No_Name_List then
Write_Name_List (Exchange_File, Run_Path_Option, List);
if For_Project.Config.Separate_Run_Path_Options then
Put_Line
(Exchange_File,
Library_Label (Gprexch.Separate_Run_Path_Options));
end if;
end if;
end Write_Run_Path_Option;
-----------------------------------
-- Write_Leading_Library_Options --
-----------------------------------
procedure Write_Leading_Library_Options is
Leading_Library_Options : Variable_Value := Nil_Variable_Value;
begin
-- If attribute Leading_Library_Options was specified, add these
-- additional options.
Leading_Library_Options :=
Value_Of
(Name_Leading_Library_Options,
For_Project.Decl.Attributes, Project_Tree.Shared);
if not Leading_Library_Options.Default then
Write_List
(Exchange_File,
Gprexch.Leading_Library_Options,
Leading_Library_Options.Values);
end if;
end Write_Leading_Library_Options;
---------------------------
-- Write_Library_Options --
---------------------------
procedure Write_Library_Options is
Library_Options : Variable_Value := Nil_Variable_Value;
begin
-- If attribute Library_Options was specified, add these
-- additional options.
Library_Options :=
Value_Of
(Name_Library_Options,
For_Project.Decl.Attributes, Project_Tree.Shared);
if not Library_Options.Default then
Write_List
(Exchange_File,
Gprexch.Library_Options, Library_Options.Values);
end if;
end Write_Library_Options;
---------------------------------
-- Write_Library_Rpath_Options --
---------------------------------
procedure Write_Library_Rpath_Options is
procedure Add_Language (Lang : Language_Ptr);
-- Add language Name in array Langs if not already there
procedure Find_Languages
(Project : Project_Id;
Tree : Project_Tree_Ref;
With_State : in out Boolean);
-- Find the languages of a project
procedure Find_All_Languages is new
For_Every_Project_Imported (Boolean, Find_Languages);
procedure Get_Languages;
-- Put in Langs the languages of the project tree rooted at project
-- For_Project.
------------------
-- Add_Language --
------------------
procedure Add_Language (Lang : Language_Ptr) is
begin
-- Only add a language if it is not already in the list
for J in 1 .. Last_Lang loop
if Lang.Name = Langs (J).Name then
return;
end if;
end loop;
-- Double array Langs if already full
if Last_Lang = Langs'Last then
declare
New_Langs : constant Lang_Names_Ptr :=
new Lang_Names (1 .. 2 * Langs'Length);
begin
New_Langs (Langs'Range) := Langs.all;
Langs := New_Langs;
end;
end if;
Last_Lang := Last_Lang + 1;
Langs (Last_Lang) := Lang;
end Add_Language;
--------------------
-- Find_Languages --
--------------------
procedure Find_Languages
(Project : Project_Id;
Tree : Project_Tree_Ref;
With_State : in out Boolean)
is
pragma Unreferenced (Tree);
pragma Unreferenced (With_State);
Lang : Language_Ptr := Project.Languages;
begin
while Lang /= No_Language_Index loop
Add_Language (Lang);
Lang := Lang.Next;
end loop;
end Find_Languages;
-------------------
-- Get_Languages --
-------------------
procedure Get_Languages is
OK : Boolean := True;
begin
Last_Lang := 0;
Find_Languages (For_Project, Project_Tree, OK);
Find_All_Languages
(By => For_Project,
Tree => Project_Tree,
With_State => OK,
Include_Aggregated => False);
end Get_Languages;
List : Array_Element_Id;
Elem : Array_Element;
Label_Issued : Boolean := False;
Lang_Index : Natural;
Lang_Ptr : Language_Ptr;
Opt_List : String_List_Id;
Opt_Elem : String_Element;
begin
if Opt.Run_Path_Option
and then For_Project.Config.Run_Path_Option /= No_Name_List
then
List :=
Value_Of
(Name_Library_Rpath_Options,
For_Project.Decl.Arrays, Project_Tree.Shared);
if List /= No_Array_Element then
Get_Languages;
while Last_Lang /= 0 and then List /= No_Array_Element loop
Elem := Project_Tree.Shared.Array_Elements.Table (List);
Lang_Index := 0;
for J in 1 .. Last_Lang loop
if Elem.Index = Langs (J).Name then
Lang_Index := J;
exit;
end if;
end loop;
if Lang_Index /= 0 then
Lang_Ptr := Langs (Lang_Index);
-- Remove language from the list so that rpath options
-- are not looked for twice for the same language.
Langs (Lang_Index .. Last_Lang - 1) :=
Langs (Lang_Index + 1 .. Last_Lang);
Last_Lang := Last_Lang - 1;
-- Invoke the compiler for the language, followed by
-- the options and put the result into a temporary file.
Opt_List := Elem.Value.Values;
-- Nothing to do if there is no options
if Opt_List /= Nil_String then
declare
Opt_Nmb : Natural := 0;
begin
-- Count the options
while Opt_List /= Nil_String loop
Opt_Elem :=
Project_Tree.Shared.String_Elements.Table
(Opt_List);
Opt_Nmb := Opt_Nmb + 1;
Opt_List := Opt_Elem.Next;
end loop;
declare
Args : Argument_List (1 .. Opt_Nmb);
FD : File_Descriptor;
Pname : Path_Name_Type;
Return_Code : Integer;
pragma Warnings (Off, Return_Code);
File : Text_File;
Line : String (1 .. 1000);
Last : Natural;
Disregard : Boolean;
pragma Warnings (Off, Disregard);
begin
Opt_List := Elem.Value.Values;
Opt_Nmb := 0;
-- Put the options in Args
while Opt_List /= Nil_String loop
Opt_Elem :=
Project_Tree.Shared.String_Elements.Table
(Opt_List);
Opt_Nmb := Opt_Nmb + 1;
Args (Opt_Nmb) :=
new String'
(Get_Name_String (Opt_Elem.Value));
Opt_List := Opt_Elem.Next;
end loop;
-- Create a temporary file and invoke the
-- compiler with the options redirecting
-- the output to this temporary file.
Tempdir.Create_Temp_File (FD, Pname);
Spawn
(Program_Name =>
Lang_Ptr.Config.Compiler_Driver_Path.all,
Args => Args,
Output_File_Descriptor => FD,
Return_Code => Return_Code);
Close (FD);
-- Now read the temporary file and get the first
-- non empty line, if any.
Open (File, Get_Name_String (Pname));
if Is_Valid (File) then
Last := 0;
while not End_Of_File (File) loop
Get_Line (File, Line, Last);
exit when Last > 0;
end loop;
-- Get the directory name of the path
if Last /= 0 then
declare
Dir : constant String :=
Dir_Name
(Normalize_Pathname
(Line (1 .. Last)));
begin
-- If it is in fact a directory, put it
-- in the exchange file.
if Is_Directory (Dir) then
if not Label_Issued then
Put_Line
(Exchange_File,
Library_Label
(Gprexch.Library_Rpath_Options));
Label_Issued := True;
end if;
Put_Line
(Exchange_File, Dir);
end if;
end;
end if;
end if;
if Is_Valid (File) then
Close (File);
end if;
-- Delete the temporary file, if gprbuild was
-- not invoked with -dn.
if not Debug_Flag_N then
Delete_File
(Get_Name_String (Pname), Disregard);
end if;
end;
end;
end if;
end if;
List := Elem.Next;
end loop;
end if;
end if;
end Write_Library_Rpath_Options;
------------------------------
-- Write_Imported_Libraries --
------------------------------
procedure Write_Imported_Libraries is
begin
-- If there are imported libraries, put their data in the exchange
-- file.
if Library_Projs.Last > 0 then
Put_Line (Exchange_File, Library_Label (Imported_Libraries));
for J in reverse 1 .. Library_Projs.Last loop
if For_Project.Qualifier /= Aggregate_Library
or else Library_Projs.Table (J).Proj.Externally_Built
then
Put_Line
(Exchange_File,
Get_Name_String
(Library_Projs.Table (J).
Proj.Library_Dir.Display_Name));
Put_Line
(Exchange_File,
Get_Name_String
(Library_Projs.Table (J).Proj.Library_Name));
end if;
end loop;
end if;
end Write_Imported_Libraries;
----------------------------
-- Write_Dependency_Files --
----------------------------
procedure Write_Dependency_Files is
Current_Proj : Project_Id := For_Project;
Source : Source_Id;
begin
Put_Line (Exchange_File, Library_Label (Dependency_Files));
while Current_Proj /= No_Project loop
declare
Iter : Source_Iterator;
begin
if Current_Proj.Qualifier = Aggregate_Library then
Iter := For_Each_Source (Project_Tree);
else
Iter := For_Each_Source (Project_Tree, Current_Proj);
end if;
loop
Source := Prj.Element (Iter);
exit when Source = No_Source;
if not Source.Locally_Removed
and then Source.Dep_Path /= No_Path
and then
(not Source.Project.Externally_Built
or else Source.Project.Extended_By /= No_Project)
then
if Source.Kind = Spec then
if Other_Part (Source) = No_Source then
Put_Line
(Exchange_File,
Get_Name_String (Source.Dep_Path));
end if;
elsif not Is_Subunit (Source) then
Put_Line
(Exchange_File,
Get_Name_String (Source.Dep_Path));
end if;
end if;
Next (Iter);
end loop;
Current_Proj := Current_Proj.Extends;
end;
end loop;
end Write_Dependency_Files;
-----------------------------
-- Write_Toolchain_Version --
-----------------------------
procedure Write_Toolchain_Version is
use type Ada.Containers.Count_Type;
procedure Toolchain_Version_For
(Project : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean);
-- Write runtime libraries for the given project
Dummy : Boolean := True;
Lang_Seen : Lang_Set.Set;
---------------------------
-- Toolchain_Version_For --
---------------------------
procedure Toolchain_Version_For
(Project : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean)
is
pragma Unreferenced (Tree, Dummy);
List : Language_Ptr := Project.Languages;
begin
while List /= No_Language_Index loop
if List.Config.Toolchain_Version /= No_Name
and then not Lang_Seen.Contains (List.Name)
then
if Lang_Seen.Length = 0 then
Put_Line
(Exchange_File, Library_Label (Toolchain_Version));
end if;
Lang_Seen.Insert (List.Name);
Put_Line (Exchange_File, Get_Name_String (List.Name));
Put_Line
(Exchange_File,
Get_Name_String (List.Config.Toolchain_Version));
end if;
List := List.Next;
end loop;
end Toolchain_Version_For;
procedure For_Imported is
new For_Every_Project_Imported (Boolean, Toolchain_Version_For);
begin
Toolchain_Version_For (For_Project, Project_Tree, Dummy);
if For_Project.Qualifier = Aggregate_Library then
For_Imported (For_Project, Project_Tree, Dummy);
end if;
end Write_Toolchain_Version;
-------------------------------
-- Write_Interface_Dep_Files --
-------------------------------
procedure Write_Interface_Dep_Files is
Interface_ALIs : String_List_Id :=
For_Project.Lib_Interface_ALIs;
Element : String_Element;
begin
Put_Line (Exchange_File, Library_Label (Interface_Dep_Files));
while Interface_ALIs /= Nil_String loop
Element :=
Project_Tree.Shared.String_Elements.Table (Interface_ALIs);
-- Find the source to get the absolute path of the ALI file
declare
Next_Proj : Project_Id;
Iter : Source_Iterator;
begin
Next_Proj := For_Project.Extends;
if For_Project.Qualifier = Aggregate_Library then
Iter := For_Each_Source (Project_Tree);
else
Iter := For_Each_Source (Project_Tree, For_Project);
end if;
loop
while Prj.Element (Iter) /= No_Source
and then
(Prj.Element (Iter).Unit = null
or else Prj.Element (Iter).Dep_Name /=
File_Name_Type (Element.Value))
loop
Next (Iter);
end loop;
Source := Prj.Element (Iter);
exit when Source /= No_Source
or else Next_Proj = No_Project;
Iter := For_Each_Source (Project_Tree, Next_Proj);
Next_Proj := Next_Proj.Extends;
end loop;
if Source /= No_Source then
if Source.Kind = Sep then
Source := No_Source;
elsif Source.Kind = Spec
and then Other_Part (Source) /= No_Source
then
Source := Other_Part (Source);
end if;
end if;
if Source /= No_Source then
if Source.Project /= Project
and then not Is_Extending (For_Project, Source.Project)
and then not (For_Project.Qualifier = Aggregate_Library)
then
Source := No_Source;
end if;
end if;
if Source /= No_Source then
Put_Line (Exchange_File, Get_Name_String (Source.Dep_Path));
end if;
end;
Interface_ALIs := Element.Next;
end loop;
end Write_Interface_Dep_Files;
----------------------------
-- Write_Other_Interfaces --
----------------------------
procedure Write_Other_Interfaces is
Interfaces : String_List_Id :=
For_Project.Other_Interfaces;
Element : String_Element;
begin
Put_Line (Exchange_File, Library_Label (Other_Interfaces));
while Interfaces /= Nil_String loop
Element :=
Project_Tree.Shared.String_Elements.Table (Interfaces);
Put_Line (Exchange_File, Get_Name_String (Element.Value));
Interfaces := Element.Next;
end loop;
end Write_Other_Interfaces;
-------------------
-- Write_Sources --
-------------------
procedure Write_Sources is
begin
Put_Line (Exchange_File, Library_Label (Sources));
-- Copy the path of the sources
Project := For_Project;
while Project /= No_Project loop
Iter := For_Each_Source (Project_Tree, Project);
loop
Source := Prj.Element (Iter);
exit when Source = No_Source;
if not Source.Locally_Removed
and then Source.Replaced_By = No_Source
then
Put_Line
(Exchange_File,
Get_Name_String (Source.Path.Display_Name));
end if;
Next (Iter);
end loop;
Project := Project.Extends;
end loop;
end Write_Sources;
--------------------------
-- Write_Response_Files --
--------------------------
procedure Write_Response_Files is
begin
if For_Project.Config.Max_Command_Line_Length > 0
and then For_Project.Config.Resp_File_Format /= None
then
Put_Line (Exchange_File, Library_Label (Max_Command_Line_Length));
Put_Line
(Exchange_File, For_Project.Config.Max_Command_Line_Length'Img);
Put_Line
(Exchange_File, Library_Label (Gprexch.Response_File_Format));
Put_Line
(Exchange_File, For_Project.Config.Resp_File_Format'Img);
if For_Project.Config.Resp_File_Options /= No_Name_List then
Write_Name_List
(Exchange_File, Response_File_Switches,
For_Project.Config.Resp_File_Options);
end if;
if Debug.Debug_Flag_N then
Put_Line (Exchange_File, Library_Label (Keep_Response_File));
end if;
end if;
end Write_Response_Files;
-- Start of processing for Build_Library
begin
-- Check if there is an object directory
if For_Project.Object_Directory.Display_Name = No_Path then
Fail_Program
(Project_Tree,
"no object directory for library project " &
Get_Name_String (For_Project.Display_Name));
end if;
Object_Directory_Path :=
new String'(Get_Name_String
(For_Project.Object_Directory.Display_Name));
-- Check consistentcy and build environment
if For_Project.Config.Lib_Support = None then
Fail_Program (Project_Tree,
"library projects not supported on this platform");
elsif For_Project.Library_Kind /= Static
and then For_Project.Config.Lib_Support /= Full
then
Fail_Program
(Project_Tree,
"shared library projects not supported on this platform");
elsif not For_Project.Config.Lib_Encapsulated_Supported
and then For_Project.Standalone_Library = Encapsulated
then
Fail_Program
(Project_Tree,
"encapsulated library projects not supported on this platform");
end if;
if For_Project.Config.Library_Builder = No_Path then
Fail_Program (Project_Tree, "no library builder specified");
else
Library_Builder :=
Locate_Exec_On_Path
(Get_Name_String (For_Project.Config.Library_Builder));
if Library_Builder = null then
Fail_Program
(Project_Tree,
"could not locate library builder """ &
Get_Name_String (For_Project.Config.Library_Builder) & '"');
else
Library_Builder_Name :=
new String'(Base_Name (Library_Builder.all));
end if;
end if;
if For_Project.Library_Kind = Static then
Check_Archive_Builder;
end if;
Library_Needs_To_Be_Built := Opt.Force_Compilations;
if not Library_Needs_To_Be_Built and then Opt.Verbose_Mode then
Write_Str (" Checking library ");
Get_Name_String (For_Project.Library_Name);
Write_Str (Name_Buffer (1 .. Name_Len));
Write_Line (" ...");
end if;
Get_Objects;
-- Work occurs in the object directory
Change_To_Object_Directory (For_Project);
-- Get the name of of the library exchange file
Get_Name_String (For_Project.Library_Name);
Add_Str_To_Name_Buffer (Library_Exchange_Suffix);
Exchange_File_Name := new String'(Name_Buffer (1 .. Name_Len));
if not Library_Needs_To_Be_Built then
declare
TS : constant Time_Stamp_Type :=
File_Stamp (File_Name_Type'(Name_Find));
begin
if String (TS) < String (Latest_Object_TS) then
Library_Needs_To_Be_Built := True;
if Opt.Verbose_Mode then
if TS = Empty_Time_Stamp then
Write_Line
(" -> library exchange file " &
Exchange_File_Name.all &
" does not exist");
else
Write_Line
(" -> object files more recent than" &
" library exchange file " &
Exchange_File_Name.all);
end if;
end if;
else
begin
Open (Exchange_File, In_File, Exchange_File_Name.all);
if End_Of_File (Exchange_File) then
if Opt.Verbose_Mode then
Write_Str (" -> library exchange file """);
Write_Str (Exchange_File_Name.all);
Write_Line (""" is empty");
end if;
Library_Needs_To_Be_Built := True;
end if;
exception
when others =>
if Opt.Verbose_Mode then
Write_Str
(" -> library exchange file """);
Write_Str (Exchange_File_Name.all);
Write_Line (""" cannot be open");
end if;
Library_Needs_To_Be_Built := True;
end;
end if;
end;
end if;
if not Library_Needs_To_Be_Built then
-- The exchange file is open in input
-- Get the path of the library file that should be the first field
Get_Line (Exchange_File, Name_Buffer, Name_Len);
if Name_Buffer (1 .. Name_Len) /= Library_Label (Library_Path) then
Library_Needs_To_Be_Built := True;
Close (Exchange_File);
if Opt.Verbose_Mode then
Write_Line (" -> library exchange file " &
Exchange_File_Name.all &
" has wrong format");
end if;
else
Get_Line (Exchange_File, Name_Buffer, Name_Len);
if String (File_Stamp (File_Name_Type'(Name_Find))) <
String (Latest_Object_TS)
then
Library_Needs_To_Be_Built := True;
Close (Exchange_File);
if Opt.Verbose_Mode then
Write_Line
(" -> object file(s) more recent than library file " &
Exchange_File_Name.all);
end if;
end if;
end if;
end if;
if not Library_Needs_To_Be_Built then
-- The next line should be the object file label, followed by the
-- object paths and time stamps.
Get_Line (Exchange_File, Name_Buffer, Name_Len);
if Name_Buffer (1 .. Name_Len) /= Library_Label (Object_Files) then
Library_Needs_To_Be_Built := True;
if Opt.Verbose_Mode then
Write_Line (" -> library exchange file " &
Exchange_File_Name.all & " has wrong format");
end if;
end if;
while not Library_Needs_To_Be_Built
and then not End_Of_File (Exchange_File)
loop
Get_Line (Exchange_File, Name_Buffer, Name_Len);
exit when Name_Buffer (1) = '[';
Object_Path := Name_Find;
Library_Needs_To_Be_Built := True;
if End_Of_File (Exchange_File) then
if Opt.Verbose_Mode then
Write_Line
(" -> library exchange file " &
Exchange_File_Name.all & " has wrong format");
end if;
else
Get_Line (Exchange_File, Name_Buffer, Name_Len);
if Name_Len = Time_Stamp_Length then
Object_TS :=
Time_Stamp_Type (Name_Buffer (1 .. Name_Len));
Path_Found := False;
for Index in 1 .. Library_Objs.Last loop
if Object_Path = Library_Objs.Table (Index).Path then
Path_Found := True;
Library_Needs_To_Be_Built :=
Object_TS /= Library_Objs.Table (Index).TS;
Library_Objs.Table (Index).Known := True;
exit;
end if;
end loop;
-- If the object file is not found, it may be that the path
-- in the library is the same as the path of the object
-- files, but with different symbolic links. So, we try
-- again resolving the symbolic links.
if not Path_Found then
declare
Norm_Path : constant String :=
Normalize_Pathname
(Get_Name_String (Object_Path));
begin
for Index in 1 .. Library_Objs.Last loop
if Norm_Path =
Normalize_Pathname
(Get_Name_String
(Library_Objs.Table (Index).Path))
then
Library_Needs_To_Be_Built :=
Object_TS /= Library_Objs.Table (Index).TS;
Library_Objs.Table (Index).Known := True;
exit;
end if;
end loop;
end;
end if;
if Library_Needs_To_Be_Built and then Opt.Verbose_Mode then
Write_Str (" -> object file ");
Write_Str (Get_Name_String (Object_Path));
Write_Line
(" does not exist or have wrong time stamp");
end if;
else
if Opt.Verbose_Mode then
Write_Line
(" -> library exchange file " &
Exchange_File_Name.all &
" has wrong format");
end if;
end if;
end if;
end loop;
Close (Exchange_File);
if not Library_Needs_To_Be_Built then
for Index in 1 .. Library_Objs.Last loop
if not Library_Objs.Table (Index).Known then
Library_Needs_To_Be_Built := True;
if Opt.Verbose_Mode then
Write_Str
(" -> library was built without object file ");
Write_Line
(Get_Name_String (Library_Objs.Table (Index).Path));
end if;
exit;
end if;
end loop;
end if;
end if;
if not Library_Needs_To_Be_Built then
if Opt.Verbose_Mode then
Write_Line (" -> up to date");
end if;
else
-- Create the library exchange file
begin
Create (Exchange_File, Out_File, Exchange_File_Name.all);
exception
when others =>
Fail_Program
(Project_Tree,
"unable to create library exchange file " &
Exchange_File_Name.all);
end;
if Opt.Quiet_Output then
Put_Line (Exchange_File, Library_Label (Quiet));
elsif Opt.Verbose_Mode then
Put_Line (Exchange_File, Library_Label (Verbose));
end if;
Write_Object_Files;
-- Library name
Put_Line (Exchange_File, Library_Label (Library_Name));
Put_Line (Exchange_File, Get_Name_String (For_Project.Library_Name));
-- Library version
if For_Project.Lib_Internal_Name /= No_Name then
Put_Line (Exchange_File, Library_Label (Library_Version));
Put_Line (Exchange_File,
Get_Name_String (For_Project.Lib_Internal_Name));
end if;
-- Library directory
Put_Line (Exchange_File, Library_Label (Library_Directory));
Put_Line
(Exchange_File,
Get_Name_String (For_Project.Library_Dir.Display_Name));
if For_Project.Library_ALI_Dir /= No_Path_Information
and then
For_Project.Library_ALI_Dir.Name /= For_Project.Library_Dir.Name
then
Put_Line
(Exchange_File, Library_Label (Library_Dependency_Directory));
Put_Line
(Exchange_File,
Get_Name_String (For_Project.Library_ALI_Dir.Display_Name));
end if;
Write_Object_Directory;
Write_Compilers;
Write_Compiler_Leading_Switches;
Write_Compiler_Trailing_Switches;
Write_Partial_Linker;
if No_Create then
Put_Line (Exchange_File, Library_Label (Gprexch.No_Create));
end if;
if For_Project.Qualifier = Aggregate_Library then
Put_Line (Exchange_File, Library_Label (Gprexch.No_Copy_ALI));
end if;
if For_Project.Library_Kind = Static then
Put_Line (Exchange_File, Library_Label (Static));
Put_Line (Exchange_File, Library_Label (Archive_Builder));
Put_Line (Exchange_File, Archive_Builder_Path.all);
for J in 1 .. Archive_Builder_Opts.Last loop
Put_Line (Exchange_File, Archive_Builder_Opts.Options (J).all);
end loop;
if Archive_Builder_Append_Opts.Last > 0 then
Put_Line
(Exchange_File,
Library_Label (Archive_Builder_Append_Option));
for J in 1 .. Archive_Builder_Append_Opts.Last loop
Put_Line
(Exchange_File,
Archive_Builder_Append_Opts.Options (J).all);
end loop;
end if;
if For_Project.Config.Archive_Suffix /= No_File then
Put_Line (Exchange_File, Library_Label (Archive_Suffix));
Put_Line
(Exchange_File,
Get_Name_String (For_Project.Config.Archive_Suffix));
end if;
if Archive_Indexer_Path /= null then
Put_Line (Exchange_File, Library_Label (Archive_Indexer));
Put_Line (Exchange_File, Archive_Indexer_Path.all);
for J in 1 .. Archive_Indexer_Opts.Last loop
Put_Line
(Exchange_File, Archive_Indexer_Opts.Options (J).all);
end loop;
end if;
else
-- Driver_Name
if For_Project.Config.Shared_Lib_Driver /= No_File then
Put_Line (Exchange_File, Library_Label (Driver_Name));
Put_Line
(Exchange_File,
Get_Name_String (For_Project.Config.Shared_Lib_Driver));
end if;
-- Shared_Lib_Prefix
if For_Project.Config.Shared_Lib_Prefix /= No_File then
Put_Line (Exchange_File, Library_Label (Shared_Lib_Prefix));
Put_Line
(Exchange_File,
Get_Name_String (For_Project.Config.Shared_Lib_Prefix));
end if;
-- Shared_Lib_Suffix
if For_Project.Config.Shared_Lib_Suffix /= No_File then
Put_Line (Exchange_File, Library_Label (Shared_Lib_Suffix));
Put_Line
(Exchange_File,
Get_Name_String (For_Project.Config.Shared_Lib_Suffix));
end if;
Write_Shared_Lib_Minimum_Options;
Write_Library_Version;
-- Symbolic_Link_Supported
if For_Project.Config.Symbolic_Link_Supported then
Put_Line
(Exchange_File, Library_Label (Symbolic_Link_Supported));
end if;
-- Major_Minor_Id_Supported
if For_Project.Config.Lib_Maj_Min_Id_Supported then
Put_Line
(Exchange_File, Library_Label (Major_Minor_Id_Supported));
end if;
Process_Imported_Libraries
(For_Project, There_Are_SALs => Disregard);
Write_Runtime_Library_Dir;
-- Relocatable
if For_Project.Library_Kind /= Static then
Put_Line (Exchange_File, Library_Label (Relocatable));
end if;
-- Auto_init
Write_Auto_Init;
-- Gprexch.Install_Name
if
For_Project.Config.Library_Install_Name_Option /= No_Name
then
Put_Line (Exchange_File, Library_Label (Gprexch.Install_Name));
Put_Line
(Exchange_File,
Get_Name_String
(For_Project.Config.Library_Install_Name_Option));
end if;
Write_Run_Path_Option;
Write_Leading_Library_Options;
Write_Library_Options;
Write_Library_Rpath_Options;
Write_Imported_Libraries;
end if;
Write_Dependency_Files;
Write_Toolchain_Version;
if For_Project.Standalone_Library /= No then
if For_Project.Lib_Auto_Init then
Put_Line (Exchange_File, Library_Label (Auto_Init));
end if;
Write_Interface_Dep_Files;
if For_Project.Other_Interfaces /= Nil_String then
Write_Other_Interfaces;
end if;
if For_Project.Library_Src_Dir /= No_Path_Information then
-- Copy_Source_Dir
Put_Line (Exchange_File, Library_Label (Copy_Source_Dir));
Put_Line
(Exchange_File,
Get_Name_String (For_Project.Library_Src_Dir.Display_Name));
Write_Sources;
end if;
-- Standalone mode
Put_Line (Exchange_File, Library_Label (Standalone_Mode));
Put_Line
(Exchange_File,
Standalone'Image (For_Project.Standalone_Library));
elsif For_Project.Other_Interfaces /= Nil_String then
Write_Other_Interfaces;
end if;
Write_Response_Files;
Close (Exchange_File);
declare
Arguments : constant Argument_List := (1 => Exchange_File_Name);
Success : Boolean;
begin
if not Opt.Quiet_Output then
if Opt.Verbose_Mode then
Write_Str (Library_Builder.all);
else
Write_Str (Library_Builder_Name.all);
end if;
Write_Char (' ');
Write_Line (Exchange_File_Name.all);
end if;
Spawn (Library_Builder.all, Arguments, Success);
if not Success then
Fail_Program
(Project_Tree,
"could not build library for project " & Project_Name);
end if;
end;
end if;
-- Restore the current working directory to its previous value
Change_Dir (Current_Dir);
end Build_Library;
------------------------
-- CodePeer_Globalize --
------------------------
procedure CodePeer_Globalize is
Globalizer : constant String := "codepeer_globalizer";
-- CodePeer globalizer executable name
Globalizer_Path : constant String_Access :=
GNAT.OS_Lib.Locate_Exec_On_Path (Globalizer);
-- Path for CodePeer globalizer
Quiet_Str : aliased String := "-quiet";
Globalizer_Args : constant Argument_List :=
(1 => Quiet_Str'Unchecked_Access);
Previous_Dir : String_Access := null;
Success : Boolean;
procedure Globalize_Dir (Dir : String);
-- Call CodePeer globalizer on Dir
-------------------
-- Globalize_Dir --
-------------------
procedure Globalize_Dir (Dir : String) is
Result : Boolean;
begin
if Previous_Dir = null or else Dir /= Previous_Dir.all then
Free (Previous_Dir);
Previous_Dir := new String'(Dir);
Change_Dir (Dir);
GNAT.OS_Lib.Spawn (Globalizer_Path.all, Globalizer_Args, Result);
Success := Success and Result;
end if;
end Globalize_Dir;
procedure Globalize_Dirs is new
Prj.Env.For_All_Object_Dirs (Globalize_Dir);
begin
if Globalizer_Path = null then
Fail_Program (Project_Tree, "error, unable to locate " & Globalizer);
elsif not Opt.Quiet_Output then
Write_Str (Globalizer);
Write_Char (' ');
Write_Line (Quiet_Str);
end if;
Success := True;
Globalize_Dirs (Main_Project, Project_Tree);
if not Success then
Fail_Program (Project_Tree, "codepeer_globalizer failed");
end if;
end CodePeer_Globalize;
-----------------------------------
-- Is_Included_In_Global_Archive --
-----------------------------------
function Is_Included_In_Global_Archive
(Object_Name : File_Name_Type;
Project : Project_Id) return Boolean
is
Proj : Project_Id;
Source : Source_Id;
Iter : Source_Iterator;
begin
-- If a source is overriden in an extending project, then the object
-- file is not included in the global archive.
Proj := Project.Extended_By;
while Proj /= No_Project loop
Iter := For_Each_Source (Project_Tree, Proj);
loop
Source := Prj.Element (Iter);
exit when Source = No_Source;
if Object_To_Global_Archive (Source)
and then Source.Object = Object_Name
then
return False;
end if;
Next (Iter);
end loop;
Proj := Proj.Extended_By;
end loop;
Iter := For_Each_Source (Project_Tree, Project);
loop
Source := Prj.Element (Iter);
exit when Source = No_Source;
if Object_To_Global_Archive (Source)
and then Source.Object = Object_Name
then
return Source.Language.Config.Objects_Linked;
end if;
Next (Iter);
end loop;
return True;
end Is_Included_In_Global_Archive;
---------
-- Run --
---------
procedure Run is
Data : Process_Data;
Main : Main_Info;
OK : Boolean;
procedure Do_Post (Project : Project_Id; Tree : Project_Tree_Ref);
-------------
-- Do_Post --
-------------
procedure Do_Post (Project : Project_Id; Tree : Project_Tree_Ref) is
begin
if Builder_Data (Tree).Need_Binding
and then not Stop_Spawning
then
Post_Compilation_Phase (Project, Tree);
end if;
end Do_Post;
procedure Post_Compile_All is new For_Project_And_Aggregated (Do_Post);
begin
Outstanding_Processes := 0;
Stop_Spawning := False;
if Main_Project.Qualifier = Aggregate_Library then
-- For an aggregate library we do not want to build separate
-- libraries if any, this means that at this point we want to
-- handle only the main aggregate library project.
Post_Compilation_Phase (Main_Project, Project_Tree);
else
Post_Compile_All (Main_Project, Project_Tree);
end if;
while Outstanding_Processes > 0 loop
Await_Process (Data, OK);
if not OK then
Record_Failure (Data.Main);
end if;
Display_Processes ("bind");
end loop;
if Bad_Processes.Last = 1 then
Main := Bad_Processes.Table (1);
Fail_Program
(Main.Tree,
"unable to bind " & Get_Name_String (Main.File));
elsif Bad_Processes.Last > 1 then
for J in 1 .. Bad_Processes.Last loop
Main := Bad_Processes.Table (J);
Write_Str (" binding of ");
Write_Str (Get_Name_String (Main.File));
Write_Line (" failed");
end loop;
Fail_Program (Main.Tree, "*** post compilation phase failed");
end if;
if Opt.CodePeer_Mode then
CodePeer_Globalize;
end if;
end Run;
----------------------------
-- Post_Compilation_Phase --
----------------------------
procedure Post_Compilation_Phase
(Main_Project : Project_Id; Project_Tree : Project_Tree_Ref)
is
Exchange_File : Text_IO.File_Type;
Line : String (1 .. 1_000);
Last : Natural;
Proj_List : Project_List;
Shared_Libs : Boolean := False;
Bind_Exchange_TS : Time_Stamp_Type;
Bind_Object_TS : Time_Stamp_Type;
Binder_Driver_Needs_To_Be_Called : Boolean := False;
Project_Path : Name_Id;
Project_File_TS : Time_Stamp_Type;
There_Are_Stand_Alone_Libraries : Boolean := False;
-- Set to True if there are SALS in the project tree
procedure Bind_Language
(Main_Proj : Project_Id;
Main : String;
Main_Base_Name_Index : File_Name_Type;
Main_File : Main_Info;
Main_Id : File_Name_Type;
B_Data : Binding_Data);
-- Do the "binding" phase for the language describeb in B_Data
procedure Add_Dependency_Files
(For_Project : Project_Id;
Language : Language_Ptr;
Main_Source : Source_Id;
Dep_Files : out Boolean);
-- Put the dependency files of the project in the binder exchange file
procedure Wait_For_Available_Slot;
--------------------------
-- Add_Dependency_Files --
--------------------------
procedure Add_Dependency_Files
(For_Project : Project_Id;
Language : Language_Ptr;
Main_Source : Source_Id;
Dep_Files : out Boolean)
is
Config : constant Language_Config := Language.Config;
Roots : Roots_Access;
Iter : Source_Iterator;
procedure Put_Dependency_File (Source : Source_Id);
-- Put in the exchange file the dependency file path name for source
-- Source, if applicable.
-------------------------
-- Put_Dependency_File --
-------------------------
procedure Put_Dependency_File (Source : Source_Id) is
begin
if Source.Language.Name = Language.Name
and then
((Config.Kind = File_Based and then Source.Kind = Impl)
or else
(Config.Kind = Unit_Based
and then
Source.Unit /= No_Unit_Index
and then
Source.Unit /= Main_Source.Unit
and then
(Source.Kind = Impl
or else
Other_Part (Source) = No_Source)
and then not Is_Subunit (Source)))
and then Is_Included_In_Global_Archive
(Source.Object, Source.Project)
then
if Source.Project = For_Project
or not Source.Project.Library
or Config.Kind = File_Based
then
Put_Line (Exchange_File, Get_Name_String (Source.Dep_Path));
Dep_Files := True;
elsif Source.Project.Standalone_Library = No then
Get_Name_String
(Source.Project.Library_ALI_Dir.Display_Name);
Get_Name_String_And_Append (Source.Dep_Name);
Put_Line (Exchange_File, Name_Buffer (1 .. Name_Len));
Dep_Files := True;
end if;
end if;
end Put_Dependency_File;
begin
Dep_Files := False;
Roots := Main_Source.Roots;
if Roots = null then
if Main_Source.Unit = No_Unit_Index then
if Main_Project.Qualifier = Aggregate_Library then
Iter := For_Each_Source (Project_Tree);
else
Iter := For_Each_Source
(Project_Tree, Encapsulated_Libs => False);
end if;
while Prj.Element (Iter) /= No_Source loop
Initialize_Source_Record (Prj.Element (Iter));
-- Do not bind the non compilable sources, such as those
-- that have been locally removed.
if Is_Compilable (Prj.Element (Iter)) then
Put_Dependency_File (Prj.Element (Iter));
end if;
Next (Iter);
end loop;
end if;
else
-- Put the Roots
while Roots /= null loop
Put_Dependency_File (Roots.Root);
Roots := Roots.Next;
end loop;
end if;
end Add_Dependency_Files;
-------------------
-- Bind_Language --
-------------------
procedure Bind_Language
(Main_Proj : Project_Id;
Main : String;
Main_Base_Name_Index : File_Name_Type;
Main_File : Main_Info;
Main_Id : File_Name_Type;
B_Data : Binding_Data)
is
Main_Source : constant Source_Id := Main_File.Source;
Bind_Exchange : String_Access;
Options_Instance : Bind_Option_Table_Ref :=
No_Bind_Option_Table;
Dep_Files : Boolean;
Lang_Index : Language_Ptr;
Object_File_Suffix_Label_Written : Boolean;
begin
Binder_Driver_Needs_To_Be_Called :=
Opt.Force_Compilations or Opt.CodePeer_Mode;
-- First check if the binder driver needs to be called.
-- It needs to be called if
-- 1) there is no existing binder exchange file
-- 2) there is no binder generated object file
-- 3) there is a dependency file of the language that
-- is more recent than any of these two files
if not Binder_Driver_Needs_To_Be_Called
and then Opt.Verbose_Mode
then
Write_Line
(" Checking binder generated files for " & Main & "...");
end if;
Bind_Exchange :=
Binder_Exchange_File_Name
(Main_Base_Name_Index, B_Data.Binder_Prefix);
Bind_Exchange_TS :=
File_Stamp
(Path_Name_Type'(Create_Name (Bind_Exchange.all)));
if not Binder_Driver_Needs_To_Be_Called then
if Bind_Exchange_TS = Empty_Time_Stamp then
Binder_Driver_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line
(" -> binder exchange file " &
Bind_Exchange.all &
" does not exist");
end if;
else
begin
Open (Exchange_File, In_File, Bind_Exchange.all);
exception
when others =>
Binder_Driver_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line
(" -> could not open " &
"binder exchange file" &
Bind_Exchange.all);
end if;
end;
end if;
end if;
if not Binder_Driver_Needs_To_Be_Called then
begin
Get_Line (Exchange_File, Line, Last);
exception
when others =>
Binder_Driver_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line
(" -> previous gprbind failed, or " &
Bind_Exchange.all &
" corrupted");
end if;
end;
end if;
-- Check the generated object file
if not Binder_Driver_Needs_To_Be_Called then
if Line (1 .. Last) /= Binding_Label (Generated_Object_File)
or else End_Of_File (Exchange_File)
then
Binder_Driver_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line
(" -> previous gprbind failed, or " &
Bind_Exchange.all &
" corrupted");
end if;
else
Get_Line (Exchange_File, Line, Last);
Bind_Object_TS :=
File_Stamp
(Path_Name_Type'(Create_Name (Line (1 .. Last))));
if Bind_Object_TS = Empty_Time_Stamp then
Binder_Driver_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line
(" -> binder generated object " &
Line (1 .. Last) &
" does not exist");
end if;
end if;
end if;
end if;
if not Binder_Driver_Needs_To_Be_Called then
if End_Of_File (Exchange_File) then
Binder_Driver_Needs_To_Be_Called := True;
else
Get_Line (Exchange_File, Line, Last);
if Line (1 .. Last) /= Binding_Label (Project_Files)
or else End_Of_File (Exchange_File)
then
Binder_Driver_Needs_To_Be_Called := True;
end if;
end if;
if Binder_Driver_Needs_To_Be_Called then
if Opt.Verbose_Mode then
Write_Line
(" -> previous gprbind failed, or " &
Bind_Exchange.all & " corrupted");
end if;
else
-- Populate the hash table Project_File_Paths with
-- the paths of all project files in the closure
-- of the main project.
Project_File_Paths.Reset;
Project_File_Paths.Set
(Name_Id (Main_Proj.Path.Display_Name), True);
Proj_List := Main_Proj.All_Imported_Projects;
while Proj_List /= null loop
Project_File_Paths.Set
(Name_Id (Proj_List.Project.Path.Display_Name),
True);
Proj_List := Proj_List.Next;
end loop;
-- Get the project file paths from the exchange
-- file and check if they are the expected project
-- files with the same time stamps.
while not End_Of_File (Exchange_File) loop
Get_Line (Exchange_File, Name_Buffer, Name_Len);
exit when Name_Len > 0 and then Name_Buffer (1) = '[';
if End_Of_File (Exchange_File) then
Binder_Driver_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line
(" -> previous gprbind failed, " &
"or " &
Bind_Exchange.all &
" corrupted");
end if;
exit;
end if;
Project_Path := Name_Find;
if Project_File_Paths.Get (Project_Path) then
Project_File_Paths.Remove (Project_Path);
Get_Line (Exchange_File, Line, Last);
Project_File_TS :=
File_Stamp (Path_Name_Type (Project_Path));
if String (Project_File_TS) /= Line (1 .. Last) then
Binder_Driver_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line
(" -> project file " &
Get_Name_String (Project_Path) &
" has been modified");
end if;
exit;
end if;
else
Binder_Driver_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line
(" -> unknown project file " &
Get_Name_String (Project_Path));
end if;
exit;
end if;
end loop;
-- Check if there are still project file paths in
-- the has table.
if not Binder_Driver_Needs_To_Be_Called
and then Project_File_Paths.Get_First
then
Binder_Driver_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line
(" -> more project files");
end if;
end if;
end if;
end if;
if Is_Open (Exchange_File) then
Close (Exchange_File);
end if;
if not Binder_Driver_Needs_To_Be_Called then
Queue.Initialize (Opt.One_Compilation_Per_Obj_Dir, Force => True);
declare
Config : constant Language_Config :=
B_Data.Language.Config;
Source_Identity : Source_Id;
Roots : Roots_Access;
Source : Source_Id;
Iter : Source_Iterator;
begin
-- Put the root sources in the queue
if Main_Source.Language.Name = B_Data.Language.Name then
Queue.Insert
(Source => (Format => Format_Gprbuild,
Tree => Main_File.Tree,
Id => Main_File.Source));
end if;
Roots := Main_Source.Roots;
while Roots /= null loop
Queue.Insert
(Source => (Format => Format_Gprbuild,
Tree => Main_File.Tree,
Id => Roots.Root));
Roots := Roots.Next;
end loop;
-- If main is not unit base and there is no root,
-- check all sources with the language name of the
-- binder, except those that are not interfaces of
-- their project.
if Queue.Is_Empty then
Iter := For_Each_Source (Project_Tree);
Loop1 : loop
Source := Prj.Element (Iter);
exit Loop1 when Source = No_Source;
if Source.Language.Name = B_Data.Language.Name
and then not Source.Locally_Removed
and then Is_Compilable (Source)
and then
((Config.Kind = File_Based
and then Source.Kind = Impl)
or else
(Config.Kind = Unit_Based
and then Source.Unit /= No_Unit_Index
and then Source.Unit /= Main_Source.Unit
and then (Source.Kind = Impl
or else Other_Part (Source) = No_Source)
and then not Is_Subunit (Source)))
and then Source.In_Interfaces
then
declare
Proj : Project_Id;
Src : Source_Id;
Iter2 : Source_Iterator;
begin
-- If a source is overriden in an
-- extending project, then the object file
-- is not included in the global archive.
Proj := Source.Project.Extended_By;
Loop2 : while Proj /= No_Project loop
Iter2 := For_Each_Source (Project_Tree, Proj);
loop
Src := Prj.Element (Iter2);
exit when Src = No_Source;
exit Loop1 when
Src.Object = Source.Object;
Next (Iter2);
end loop;
Proj := Proj.Extended_By;
end loop Loop2;
end;
Queue.Insert
(Source => (Format => Format_Gprbuild,
Tree => Main_File.Tree,
Id => Source));
end if;
Next (Iter);
end loop Loop1;
end if;
-- Get each file from the queue and check its
-- dependency file.
declare
Dep_TS : aliased File_Attributes := Unknown_Attributes;
Dep_File : File_Name_Type;
Dep_Path : Path_Name_Type;
Stamp : Time_Stamp_Type;
The_ALI : ALI.ALI_Id;
Text : Text_Buffer_Ptr;
Found : Boolean;
Source : Queue.Source_Info;
begin
while not Queue.Is_Empty loop
Queue.Extract (Found, Source);
Source_Identity := Source.Id;
Initialize_Source_Record (Source_Identity);
-- Get the dependency file for this source
Dep_File := Source_Identity.Dep_Name;
Dep_Path := Source_Identity.Dep_Path;
Dep_TS := Source_Identity.Dep_TS;
-- For a library file, if there is no ALI file
-- in the object directory, check in the Library
-- ALI directory.
if not Is_Regular_File (Get_Name_String (Dep_Path))
and then Source_Identity.Project.Library
and then
Source_Identity.Project.Library_ALI_Dir /=
No_Path_Information
then
Name_Len := 0;
Add_Str_To_Name_Buffer
(Get_Name_String
(Source_Identity.Project
.Library_ALI_Dir.Display_Name));
Add_Char_To_Name_Buffer (Directory_Separator);
Add_Str_To_Name_Buffer (Get_Name_String (Dep_File));
Name_Buffer (Name_Len + 1) := ASCII.NUL;
Dep_TS := Unknown_Attributes;
if Is_Regular_File
(Name_Buffer'Address, Dep_TS'Access)
then
Dep_Path := Name_Find;
end if;
end if;
declare
Proj : Project_Id :=
Source_Identity.Project.Extended_By;
begin
while Proj /= No_Project loop
Name_Len := 0;
if Proj.Library
and then
Proj.Library_ALI_Dir /= No_Path_Information
then
Add_Str_To_Name_Buffer
(Get_Name_String
(Proj.Library_ALI_Dir.Display_Name));
else
Add_Str_To_Name_Buffer
(Get_Name_String
(Proj.Object_Directory.Display_Name));
end if;
Add_Char_To_Name_Buffer
(Directory_Separator);
Add_Str_To_Name_Buffer
(Get_Name_String (Dep_File));
Name_Buffer (Name_Len + 1) := ASCII.NUL;
-- Check if the dependency file exists in
-- the extended project, and if it does,
-- replace both Dep_Path and Dep_TS with
-- the information for it.
declare
NDT : aliased File_Attributes :=
Unknown_Attributes;
begin
if Is_Regular_File
(Name_Buffer'Address, NDT'Access)
then
Dep_Path := Name_Find;
Dep_TS := NDT;
end if;
end;
Proj := Proj.Extended_By;
end loop;
end;
Stamp := File_Time_Stamp (Dep_Path, Dep_TS'Access);
-- Check the time stamp against the binder
-- exchange file time stamp.
if Stamp = Empty_Time_Stamp then
Binder_Driver_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Str (" -> cannot find ");
Write_Line (Get_Name_String (Dep_Path));
end if;
exit;
elsif Stamp > Bind_Exchange_TS then
Binder_Driver_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Str (" -> ");
Write_Str (Get_Name_String (Dep_Path));
Write_Line
(" is more recent that the binder " &
"exchange file");
end if;
exit;
else
Text := Read_Library_Info_From_Full
(File_Name_Type (Dep_Path), Dep_TS'Access);
if Text /= null then
The_ALI :=
ALI.Scan_ALI
(File_Name_Type (Dep_Path),
Text,
Ignore_ED => False,
Err => True,
Ignore_Errors => True,
Read_Lines => "W");
Free (Text);
Queue.Insert_Withed_Sources_For
(The_ALI,
Project_Tree,
Excluding_Shared_SALs => True);
end if;
end if;
end loop;
end;
end;
end if;
if not Binder_Driver_Needs_To_Be_Called then
if Opt.Verbose_Mode then
Write_Line (" -> up to date");
end if;
else
Create (Exchange_File, Out_File, Bind_Exchange.all);
-- Optional line: Quiet or Verbose
if Opt.Quiet_Output then
Put_Line (Exchange_File, Binding_Label (Quiet));
elsif Opt.Verbose_Mode then
Put_Line (Exchange_File, Binding_Label (Verbose));
end if;
-- If -dn was used, indicate to gprbind that the
-- temporary response file, if created, should not
-- deleted.
if Debug_Flag_N then
Put_Line (Exchange_File, Binding_Label (Delete_Temp_Files));
Put_Line (Exchange_File, "False");
end if;
-- If there are Stand-Alone Libraries, tell it to gprbind
if There_Are_Stand_Alone_Libraries then
Put_Line
(Exchange_File,
Binding_Label (Gprexch.There_Are_Stand_Alone_Libraries));
end if;
-- If the language is Ada, create a binder mapping file
-- and pass it to gprbind.
if B_Data.Language_Name = Name_Ada then
declare
Mapping_Path : constant Path_Name_Type :=
Create_Binder_Mapping_File (Project_Tree);
begin
if Mapping_Path /= No_Path then
Put_Line
(Exchange_File,
Binding_Label (Gprexch.Mapping_File));
Put_Line
(Exchange_File,
Get_Name_String (Mapping_Path));
end if;
end;
end if;
-- Send the Toolchain Version if there is one for the language
if B_Data.Language.Config.Toolchain_Version /= No_Name then
Put_Line (Exchange_File, Binding_Label (Toolchain_Version));
Put_Line
(Exchange_File,
Get_Name_String (B_Data.Language.Name));
Put_Line
(Exchange_File,
Get_Name_String (B_Data.Language.Config.Toolchain_Version));
end if;
-- Send the object file suffix for each language where it
-- is declared.
Lang_Index := Main_Proj.Languages;
Object_File_Suffix_Label_Written := False;
while Lang_Index /= No_Language_Index loop
if Lang_Index.Config.Object_File_Suffix /= No_Name then
if not Object_File_Suffix_Label_Written then
Put_Line
(Exchange_File, Binding_Label
(Gprexch.Object_File_Suffix));
Object_File_Suffix_Label_Written := True;
end if;
Put_Line
(Exchange_File, Get_Name_String (Lang_Index.Name));
Put_Line
(Exchange_File,
Get_Name_String (Lang_Index.Config.Object_File_Suffix));
end if;
Lang_Index := Lang_Index.Next;
end loop;
-- Optional line: shared libs
if Shared_Libs then
Put_Line (Exchange_File, Binding_Label (Gprexch.Shared_Libs));
end if;
-- First, the main base name
Put_Line (Exchange_File, Binding_Label (Gprexch.Main_Base_Name));
Put_Line (Exchange_File, Get_Name_String (Main_Base_Name_Index));
-- Then, the compiler path and required switches
declare
Config : Language_Config renames B_Data.Language.Config;
List : Name_List_Index;
Nam_Nod : Name_Node;
Previous_Was_x : Boolean := False;
begin
-- Compiler path
Put_Line
(Exchange_File, Binding_Label (Gprexch.Compiler_Path));
Put_Line
(Exchange_File,
Get_Compiler_Driver_Path
(Project_Tree, B_Data.Language).all);
-- Leading required switches, if any
List := Config.Compiler_Leading_Required_Switches;
if List /= No_Name_List then
Put_Line
(Exchange_File,
Binding_Label (Gprexch.Compiler_Leading_Switches));
while List /= No_Name_List loop
Nam_Nod := Project_Tree.Shared.Name_Lists.Table (List);
if Opt.CodePeer_Mode and then Previous_Was_x then
Put_Line (Exchange_File, "adascil");
else
Put_Line
(Exchange_File,
Get_Name_String (Nam_Nod.Name));
end if;
Previous_Was_x := Get_Name_String (Nam_Nod.Name) = "-x";
List := Nam_Nod.Next;
end loop;
if Opt.CodePeer_Mode then
Put_Line (Exchange_File, "-gnatcC");
end if;
end if;
-- Trailing required switches, if any
List := Config.Compiler_Trailing_Required_Switches;
if List /= No_Name_List then
Put_Line
(Exchange_File,
Binding_Label
(Gprexch.Compiler_Trailing_Switches));
while List /= No_Name_List loop
Nam_Nod :=
Project_Tree.Shared.Name_Lists.Table (List);
Put_Line
(Exchange_File, Get_Name_String (Nam_Nod.Name));
List := Nam_Nod.Next;
end loop;
end if;
end;
-- Then, the Dependency files
if Main_Source.Unit /= No_Unit_Index then
Initialize_Source_Record (Main_Source);
Put_Line
(Exchange_File, Binding_Label (Main_Dependency_File));
Put_Line
(Exchange_File, Get_Name_String (Main_Source.Dep_Path));
end if;
-- Add the relevant dependency files, either those in
-- Roots () for the project, or all dependency
-- files in the project tree, if Roots () is not
-- specified .
Put_Line (Exchange_File, Binding_Label (Dependency_Files));
Add_Dependency_Files
(Main_Proj, B_Data.Language, Main_Source, Dep_Files);
-- Put the options, if any
declare
The_Packages : constant Package_Id :=
Main_Proj.Decl.Packages;
Binder_Package : constant Prj.Package_Id :=
Prj.Util.Value_Of
(Name => Name_Binder,
In_Packages => The_Packages,
Shared => Project_Tree.Shared);
Config : constant Language_Config :=
B_Data.Language.Config;
Switches : Variable_Value;
Switch_List : String_List_Id;
Element : String_Element;
begin
-- First, check if there are binder options
-- specified in the main project file.
if Binder_Package /= No_Package then
declare
Defaults : constant Array_Element_Id :=
Prj.Util.Value_Of
(Name => Name_Default_Switches,
In_Arrays =>
Project_Tree.Shared.Packages.Table
(Binder_Package).Decl.Arrays,
Shared => Project_Tree.Shared);
Switches_Array : constant Array_Element_Id :=
Prj.Util.Value_Of
(Name => Name_Switches,
In_Arrays =>
Project_Tree.Shared.Packages.Table
(Binder_Package).Decl.Arrays,
Shared => Project_Tree.Shared);
begin
Switches :=
Prj.Util.Value_Of
(Index => Name_Id (Main_Id),
Src_Index => 0,
In_Array => Switches_Array,
Shared => Project_Tree.Shared,
Allow_Wildcards => True);
if Switches = Nil_Variable_Value then
Switches :=
Prj.Util.Value_Of
(Index =>
B_Data.Language_Name,
Src_Index => 0,
In_Array => Switches_Array,
Shared => Project_Tree.Shared,
Force_Lower_Case_Index => True);
end if;
if Switches = Nil_Variable_Value then
Switches :=
Prj.Util.Value_Of
(Index => All_Other_Names,
Src_Index => 0,
In_Array => Switches_Array,
Shared => Project_Tree.Shared,
Force_Lower_Case_Index => True);
end if;
if Switches = Nil_Variable_Value then
Switches :=
Prj.Util.Value_Of
(Index => B_Data.Language_Name,
Src_Index => 0,
In_Array => Defaults,
Shared => Project_Tree.Shared);
end if;
end;
end if;
-- If there are binder options, either minimum
-- binder options, or in the main project file or
-- on the command line, put them in the exchange
-- file.
Options_Instance :=
Binder_Options_HTable.Get (B_Data.Language_Name);
if Config.Binder_Required_Switches /= No_Name_List
or else Switches.Kind = Prj.List
or else All_Language_Binder_Options.Last > 0
or else Options_Instance /= No_Bind_Option_Table
or else Opt.CodePeer_Mode
then
Put_Line
(Exchange_File, Binding_Label (Gprexch.Binding_Options));
-- First, the required switches, if any
declare
List : Name_List_Index :=
Config.Binder_Required_Switches;
Elem : Name_Node;
begin
while List /= No_Name_List loop
Elem :=
Project_Tree.Shared.Name_Lists.Table (List);
Get_Name_String (Elem.Name);
if Name_Len > 0 then
Put_Line
(Exchange_File,
Name_Buffer (1 .. Name_Len));
end if;
List := Elem.Next;
end loop;
end;
-- Then, the eventual options in the main
-- project file.
if Switches.Kind = Prj.List then
declare
Option : String_Access;
begin
Switch_List := Switches.Values;
while Switch_List /= Nil_String loop
Element :=
Project_Tree.Shared.String_Elements.Table
(Switch_List);
Get_Name_String (Element.Value);
if Name_Len > 0 then
Option :=
new String'
(Name_Buffer (1 .. Name_Len));
Test_If_Relative_Path
(Option,
Main_Project_Dir.all,
No_Name);
Put_Line (Exchange_File, Option.all);
end if;
Switch_List := Element.Next;
end loop;
end;
end if;
-- Then -P if in CodePeer mode
if Opt.CodePeer_Mode then
Put_Line (Exchange_File, "-P");
end if;
-- Then those on the command line, for all
-- binder drivers, if any.
for J in 1 .. All_Language_Binder_Options.Last loop
Put_Line
(Exchange_File,
All_Language_Binder_Options.Table (J).all);
end loop;
-- Finally those on the command line for the
-- binder driver of the language
if Options_Instance /= No_Bind_Option_Table then
for Index in 1 .. Binder_Options.Last
(Options_Instance.all)
loop
Put_Line
(Exchange_File,
Options_Instance.Table (Index).all);
end loop;
end if;
end if;
end;
-- Finally, the list of the project paths with their
-- time stamps.
Put_Line (Exchange_File, Binding_Label (Project_Files));
-- The main project file is always the first one, so that
-- gprbind may know the main project dir.
Put_Line
(Exchange_File,
Get_Name_String (Main_Proj.Path.Display_Name));
Put_Line
(Exchange_File,
String (File_Stamp (Main_Proj.Path.Display_Name)));
Proj_List := Main_Proj.All_Imported_Projects;
while Proj_List /= null loop
if Main_Proj.Standalone_Library = Encapsulated
or else not Proj_List.From_Encapsulated_Lib
then
Put_Line
(Exchange_File,
Get_Name_String
(Proj_List.Project.Path.Display_Name));
Put_Line
(Exchange_File,
String
(File_Stamp
(Proj_List.Project.Path.Display_Name)));
end if;
Proj_List := Proj_List.Next;
end loop;
Close (Exchange_File);
if Main_Source.Unit = No_Unit_Index and then (not Dep_Files) then
if Opt.Verbose_Mode then
Write_Line (" -> nothing to bind");
end if;
else
if B_Data.Language.Config.Objects_Path /= No_Name then
declare
Env_Var : constant String :=
Get_Name_String
(B_Data.Language.Config.
Objects_Path);
Path_Name : String_Access :=
Main_Proj.Objects_Path;
begin
if Path_Name = null then
if Current_Verbosity = High then
Put_Line (Env_Var & " :");
end if;
Get_Directories
(Project_Tree => Project_Tree,
For_Project => Main_Proj,
Activity => Executable_Binding,
Languages => No_Names);
Path_Name := Create_Path_From_Dirs;
Main_Proj.Objects_Path := Path_Name;
end if;
Setenv (Env_Var, Path_Name.all);
if Opt.Verbose_Mode then
Write_Str (Env_Var);
Write_Str (" = ");
Write_Line (Path_Name.all);
end if;
end;
elsif B_Data.Language.Config.Objects_Path_File /= No_Name then
declare
Env_Var : constant String :=
Get_Name_String
(B_Data.Language.Config.
Objects_Path_File);
Path_Name : Path_Name_Type :=
Main_Proj.Objects_Path_File_Without_Libs;
begin
if Path_Name = No_Path then
if Current_Verbosity = High then
Put_Line (Env_Var & " :");
end if;
Get_Directories
(Project_Tree => Project_Tree,
For_Project => Main_Proj,
Activity => Executable_Binding,
Languages => No_Names);
declare
FD : File_Descriptor;
Len : Integer;
Status : Boolean;
begin
Prj.Env.Create_New_Path_File
(Shared => Project_Tree.Shared,
Path_FD => FD,
Path_Name =>
Main_Proj.
Objects_Path_File_Without_Libs);
if FD = Invalid_FD then
Fail_Program
(Project_Tree,
"could not create " &
"temporary path file");
end if;
Path_Name :=
Main_Proj.
Objects_Path_File_Without_Libs;
for Index in 1 .. Directories.Last loop
Get_Name_String
(Directories.Table (Index));
if Current_Verbosity = High then
Put_Line
(Name_Buffer (1 .. Name_Len));
end if;
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := ASCII.LF;
Len :=
Write
(FD,
Name_Buffer (1)'Address,
Name_Len);
if Len /= Name_Len then
Fail_Program
(Project_Tree, "disk full");
end if;
end loop;
Close (FD, Status);
if not Status then
Fail_Program
(Project_Tree, "disk full");
end if;
end;
end if;
Setenv (Env_Var, Get_Name_String (Path_Name));
if Opt.Verbose_Mode then
Write_Str (Env_Var);
Write_Str (" = ");
Write_Line (Get_Name_String (Path_Name));
end if;
end;
end if;
if not Opt.Quiet_Output then
if Opt.Verbose_Mode then
Write_Str (B_Data.Binder_Driver_Path.all);
else
Name_Len := 0;
Add_Str_To_Name_Buffer
(Base_Name
(Get_Name_String
(B_Data.Binder_Driver_Name)));
if Executable_Suffix'Length /= 0
and then Name_Len > Executable_Suffix'Length
and then Name_Buffer
(Name_Len - Executable_Suffix'Length + 1
.. Name_Len) = Executable_Suffix.all
then
Name_Len := Name_Len - Executable_Suffix'Length;
end if;
Write_Str (Name_Buffer (1 .. Name_Len));
end if;
Write_Char (' ');
Write_Line (Bind_Exchange.all);
end if;
declare
Pid : Process_Id;
begin
Pid := Non_Blocking_Spawn
(B_Data.Binder_Driver_Path.all, (1 => Bind_Exchange));
if Pid = Invalid_Pid then
Record_Failure (Main_File);
else
Add_Process (Pid, (Binding, Pid, Main_File));
Display_Processes ("bind");
end if;
end;
end if;
end if;
end Bind_Language;
-----------------------------
-- Wait_For_Available_Slot --
-----------------------------
procedure Wait_For_Available_Slot is
Data : Process_Data;
OK : Boolean;
begin
while Outstanding_Processes >= Opt.Maximum_Processes loop
Await_Process (Data, OK);
if not OK then
Record_Failure (Data.Main);
end if;
Display_Processes ("bind");
end loop;
end Wait_For_Available_Slot;
-- Start of processing for Post_Compilation_Phase
begin
-- Build the libraries, if any
-- First, get the libraries in building order in table Library_Projs
if not Opt.CodePeer_Mode then
Process_Imported_Libraries
(Main_Project,
There_Are_SALs => There_Are_Stand_Alone_Libraries,
And_Project_Itself => True);
if Library_Projs.Last > 0 then
declare
Lib_Projs : array (1 .. Library_Projs.Last) of Library_Project;
Proj : Library_Project;
begin
-- Copy the list of library projects in local array Lib_Projs,
-- as procedure Build_Library uses table Library_Projs.
for J in 1 .. Library_Projs.Last loop
Lib_Projs (J) := Library_Projs.Table (J);
end loop;
for J in Lib_Projs'Range loop
Proj := Lib_Projs (J);
-- Try building a library only if no errors occured in
-- library project and projects it depends on.
if not Project_Compilation_Failed (Proj.Proj) then
if Proj.Proj.Extended_By = No_Project then
if not Proj.Proj.Externally_Built then
Build_Library
(Proj.Proj, Project_Tree,
No_Create => Proj.Is_Aggregated);
end if;
if Proj.Proj.Library_Kind /= Static then
Shared_Libs := True;
end if;
end if;
end if;
end loop;
end;
end if;
end if;
-- If no main is specified, there is nothing else to do
if Mains.Number_Of_Mains (Project_Tree) = 0 then
return;
end if;
-- Check if there is a need to call a binder driver
Find_Binding_Languages (Project_Tree, Main_Project);
-- Proceed to bind (or rebind if needed) for each main
Mains.Reset;
loop
declare
Main_File : Main_Info;
begin
Main_File := Mains.Next_Main;
exit when Main_File = No_Main_Info;
if Main_File.Tree /= Project_Tree
or else Project_Compilation_Failed (Main_File.Project)
then
-- Will be processed later, or do not need any processing in
-- the case of compilation errors in the project.
null;
elsif
not Builder_Data (Main_File.Tree).There_Are_Binder_Drivers
then
if Current_Verbosity = High then
Debug_Output ("Post-compilation, no binding required for",
Debug_Name (Main_File.Tree));
end if;
else
declare
Main : constant String :=
Get_Name_String (Main_File.File);
Main_Id : constant File_Name_Type :=
Create_Name (Base_Name (Main));
Main_Index : constant Int := Main_File.Index;
B_Data : Binding_Data;
Main_Base_Name_Index : File_Name_Type;
Main_Proj : Project_Id;
Index_Separator : Character;
begin
Main_Proj := Ultimate_Extending_Project_Of
(Main_File.Source.Project);
-- Get the main base name-index name
Index_Separator :=
Main_File.Source.Language
.Config.Multi_Unit_Object_Separator;
Main_Base_Name_Index :=
Base_Name_Index_For (Main, Main_Index, Index_Separator);
Change_To_Object_Directory (Main_Proj);
B_Data := Builder_Data (Main_File.Tree).Binding;
while B_Data /= null loop
Wait_For_Available_Slot;
exit when Stop_Spawning;
Bind_Language
(Main_Proj, Main, Main_Base_Name_Index,
Main_File, Main_Id, B_Data);
exit when Stop_Spawning;
B_Data := B_Data.Next;
end loop;
end;
end if;
end;
end loop;
end Post_Compilation_Phase;
end Gprbuild.Post_Compile;
gprbuild-gpl-2014-src/src/gprlib-build_shared_lib-nosymbols.adb 0000644 0000767 0000145 00000034030 12323721731 024145 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R L I B . B U I L D _ S H A R E D _ L I B --
-- --
-- B o d y --
-- --
-- Copyright (C) 2006-2012, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- This is the version of the body of procedure Build_Shared_Lib for most
-- non VMS platforms where shared libraries are supported.
with MLib; use MLib;
with Output; use Output;
separate (Gprlib)
procedure Build_Shared_Lib is
Ofiles : constant Argument_List :=
Argument_List (Object_Files.Table (1 .. Object_Files.Last));
Options : constant Argument_List :=
Argument_List (Options_Table.Table (1 .. Options_Table.Last));
Lib_File : constant String :=
Shared_Lib_Prefix.all &
Library_Name.all & Shared_Lib_Suffix.all;
Lib_Path : constant String :=
Library_Directory.all & Lib_File;
Maj_Version : String_Access := new String'("");
Result : Integer;
pragma Unreferenced (Result);
procedure Build (Output_File : String);
-- Find the library builder executable and invoke it with the correct
-- options to build the shared library.
-----------
-- Build --
-----------
procedure Build (Output_File : String) is
Success : Boolean;
Out_Opt : constant String_Access := new String'("-o");
Out_V : constant String_Access := new String'(Output_File);
Driver : String_Access;
Lib_Index : Natural := 0;
Response_File_Name : Path_Name_Type := No_Path;
Response_2 : Path_Name_Type := No_Path;
procedure Display_Linking_Command;
-- Display the linking command, depending on verbosity and quiet output
-----------------------------
-- Display_Linking_Command --
-----------------------------
procedure Display_Linking_Command is
begin
if not Opt.Quiet_Output then
if Opt.Verbose_Mode then
Write_Str (Driver.all);
else
Write_Str (Base_Name (Driver.all));
end if;
for J in 1 .. Last_Arg loop
if Opt.Verbose_Mode or else
J <= Lib_Index or else
J = First_Object
then
Write_Char (' ');
Write_Str (Arguments (J).all);
elsif J > First_Object then
Write_Str (" ...");
exit;
elsif J = Lib_Index + 1 then
Write_Str (" ...");
end if;
end loop;
Write_Eol;
end if;
end Display_Linking_Command;
begin
-- Get the executable to use, either the specified Driver, or "gcc"
if Driver_Name = No_Name then
Driver := Locate_Exec_On_Path (Gcc_Name);
if Driver = null then
Osint.Fail (Gcc_Name & " not found in path");
end if;
else
Driver := Locate_Exec_On_Path (Get_Name_String (Driver_Name));
if Driver = null then
Osint.Fail (Get_Name_String (Driver_Name) & " not found in path");
end if;
end if;
Last_Arg := 0;
Argument_Length := Driver'Length;
-- The minimum arguments
for J in 1 .. Shared_Lib_Minimum_Options.Last loop
Add_Arg (Shared_Lib_Minimum_Options.Table (J));
end loop;
-- The leading library options, if any
for J in 1 .. Leading_Library_Options_Table.Last loop
Add_Arg (Leading_Library_Options_Table.Table (J));
end loop;
-- -o
Add_Arg (Out_Opt);
Add_Arg (Out_V);
Lib_Index := Last_Arg;
-- The options
for J in Options'Range loop
if Options (J) /= null and then Options (J).all /= "" then
Add_Arg (Options (J));
end if;
end loop;
-- Other options
for J in 1 .. Library_Version_Options.Last loop
if Library_Version_Options.Table (J).all /= "" then
Add_Arg (Library_Version_Options.Table (J));
end if;
end loop;
-- The object files
if Partial_Linker /= null then
Partial_Linker_Path := Locate_Exec_On_Path (Partial_Linker.all);
if Partial_Linker_Path = null then
Osint.Fail ("unable to locate linker " & Partial_Linker.all);
end if;
end if;
if Resp_File_Format = Prj.None
and then Partial_Linker_Path /= null
then
-- If partial linker is used, do a partial link first
Partial_Number := 0;
First_Object := Ofiles'First;
loop
declare
Partial : constant String_Access :=
new String'
(Partial_Name
(Library_Name.all,
Partial_Number,
Object_Suffix));
Size : Natural := 0;
Saved_Last_PL_Option : Natural;
begin
Saved_Last_PL_Option := Last_PL_Option;
Add (Partial, PL_Options, Last_PL_Option);
Size := Size + 1 + Partial'Length;
if Partial_Number > 0 then
Add
(Partial_Name
(Library_Name.all,
Partial_Number - 1,
Object_Suffix),
PL_Options,
Last_PL_Option);
end if;
for J in 1 .. Last_PL_Option loop
Size := Size + 1 + PL_Options (J)'Length;
end loop;
loop
Add
(Ofiles (First_Object),
PL_Options,
Last_PL_Option);
Size := Size + 1 + PL_Options (Last_PL_Option)'Length;
First_Object := First_Object + 1;
exit when
First_Object > Ofiles'Last or else
Size >= Maximum_Size;
end loop;
if not Quiet_Output then
if Verbose_Mode then
Put (Partial_Linker_Path.all);
else
Put (Base_Name (Partial_Linker_Path.all));
end if;
for J in 1 .. Last_PL_Option loop
if (not Verbose_Mode) and then J >= 5 then
Put (" ...");
exit;
end if;
Put (' ');
Put (PL_Options (J).all);
end loop;
New_Line;
end if;
Spawn
(Partial_Linker_Path.all,
PL_Options (1 .. Last_PL_Option),
Success);
if not Success then
Osint.Fail
("call to linker driver " &
Partial_Linker.all & " failed");
end if;
if First_Object > Ofiles'Last then
Add_Arg (Partial);
exit;
end if;
Last_PL_Option := Saved_Last_PL_Option;
Partial_Number := Partial_Number + 1;
end;
end loop;
else
First_Object := Last_Arg + 1;
for J in Ofiles'Range loop
Add_Arg (Ofiles (J));
end loop;
end if;
Last_Object := Last_Arg;
-- In Ofiles we can have at the end some libraries -lname, so ensure
-- that the object are only taken up to Last_Object_File_Index.
if Last_Object_File_Index > First_Object
and then Last_Object_File_Index < Last_Object
then
Last_Object := Last_Object_File_Index;
end if;
-- Finally the library switches and the library options
for J in 1 .. Library_Switches_Table.Last loop
Add_Arg (Library_Switches_Table.Table (J));
end loop;
for J in 1 .. Library_Options_Table.Last loop
Add_Arg (Library_Options_Table.Table (J));
end loop;
Display_Linking_Command;
-- Check if a response file is needed
if Max_Command_Line_Length > 0
and then Argument_Length > Max_Command_Line_Length
and then Resp_File_Format /= Prj.None
then
declare
-- Preserve the options, if any
Options : constant String_List :=
Arguments (Last_Object + 1 .. Last_Arg);
begin
Create_Response_File
(Format => Resp_File_Format,
Objects => Arguments (First_Object .. Last_Object),
Other_Arguments => Options,
Resp_File_Options => Response_File_Switches.all,
Name_1 => Response_File_Name,
Name_2 => Response_2);
Last_Arg := First_Object - 1;
if Resp_File_Format = GCC
or else Resp_File_Format = GCC_GNU
or else Resp_File_Format = GCC_Object_List
or else Resp_File_Format = GCC_Option_List
then
Add_Arg
(new String'("@" & Get_Name_String (Response_File_Name)));
else
if Response_File_Switches'Length /= 0 then
for J in Response_File_Switches'First ..
Response_File_Switches'Last - 1
loop
Add_Arg (Response_File_Switches (J));
end loop;
Add_Arg
(new String'
(Response_File_Switches
(Response_File_Switches'Last).all &
Get_Name_String (Response_File_Name)));
else
Add_Arg
(new String'(Get_Name_String (Response_File_Name)));
end if;
-- Put back the options
for J in Options'Range loop
Add_Arg (Options (J));
end loop;
end if;
end;
Display_Linking_Command;
end if;
-- Finally spawn the library builder driver
Spawn (Driver.all, Arguments (1 .. Last_Arg), Success);
-- Delete response file, if any, except when asked not to
if Response_File_Name /= No_Path and then Delete_Response_File then
declare
Dont_Care : Boolean;
pragma Warnings (Off, Dont_Care);
begin
Delete_File (Get_Name_String (Response_File_Name), Dont_Care);
if Response_2 /= No_Path then
Delete_File (Get_Name_String (Response_2), Dont_Care);
end if;
end;
end if;
if not Success then
if Driver_Name = No_Name then
Osint.Fail (Gcc_Name & " execution error");
else
Osint.Fail (Get_Name_String (Driver_Name) & " execution error");
end if;
end if;
end Build;
-- Start of processing for Build_Shared_Lib
begin
if Opt.Verbose_Mode then
Write_Str ("building relocatable shared library ");
Write_Line (Lib_File);
end if;
if Library_Version.all = "" or else not Symbolic_Link_Supported then
-- If no Library_Version specified, make sure the table is empty and
-- call Build.
Library_Version_Options.Set_Last (0);
Build (Lib_Path);
else
-- Put the necessary options corresponding to the Library_Version in the
-- table.
if Major_Minor_Id_Supported then
Maj_Version :=
new String'(Major_Id_Name (Lib_File, Library_Version.all));
end if;
if Library_Version_Options.Last > 0 then
if Maj_Version.all /= "" then
Library_Version_Options.Table (Library_Version_Options.Last) :=
new String'
(Library_Version_Options.Table
(Library_Version_Options.Last).all & Maj_Version.all);
else
Library_Version_Options.Table (Library_Version_Options.Last) :=
new String'
(Library_Version_Options.Table
(Library_Version_Options.Last).all &
Library_Version.all);
end if;
end if;
if Is_Absolute_Path (Library_Version.all) then
Library_Version_Path := Library_Version;
else
Library_Version_Path :=
new String'
(Library_Directory.all & Library_Version.all);
end if;
-- Now that the table has been filled, call Build
Build (Library_Version_Path.all);
-- Create symbolic link, if appropriate
if Library_Version.all /= Lib_Path then
Create_Sym_Links
(Lib_Path,
Library_Version.all,
Library_Directory.all,
Maj_Version.all);
end if;
end if;
end Build_Shared_Lib;
gprbuild-gpl-2014-src/src/gprexch.ads 0000644 0000767 0000145 00000010466 12323721731 017062 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R E X C H --
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2013, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- These package defines sections and the corresponding labels for exchange
-- files between gprmake and gprbind (binding exchange files) and gprlib
-- (library exchange files).
-- All labels start with '[' and end with ']'
package Gprexch is
-- Binding exchange file sections
type Binding_Section is
(No_Binding_Section,
Quiet,
Verbose,
Shared_Libs,
Main_Base_Name,
Mapping_File,
Compiler_Path,
Compiler_Leading_Switches,
Compiler_Trailing_Switches,
Main_Dependency_File,
Dependency_Files,
Binding_Options,
Generated_Object_File,
Bound_Object_Files,
Generated_Source_Files,
Resulting_Options,
Run_Path_Option,
Project_Files,
Toolchain_Version,
Delete_Temp_Files,
Object_File_Suffix,
There_Are_Stand_Alone_Libraries);
function Binding_Label (Section : Binding_Section) return String;
-- Return the label for a section in a binder exchange file
function Get_Binding_Section (Label : String) return Binding_Section;
-- Get the current section from a label in a binding exchange file
-- Library exchange file sections
type Library_Section is
(No_Library_Section,
No_Create,
No_Copy_ALI,
Quiet,
Verbose,
Relocatable,
Static,
Object_Files,
Options,
Object_Directory,
Library_Name,
Library_Directory,
Library_Dependency_Directory,
Library_Version,
Library_Options,
Library_Rpath_Options,
Library_Path,
Library_Version_Options,
Shared_Lib_Prefix,
Shared_Lib_Suffix,
Shared_Lib_Minimum_Options,
Symbolic_Link_Supported,
Major_Minor_Id_Supported,
PIC_Option,
Imported_Libraries,
Runtime_Library_Dir,
Driver_Name,
Compilers,
Compiler_Leading_Switches,
Compiler_Trailing_Switches,
Toolchain_Version,
Archive_Builder,
Archive_Builder_Append_Option,
Archive_Indexer,
Partial_Linker,
Archive_Suffix,
Run_Path_Option,
Separate_Run_Path_Options,
Install_Name,
Auto_Init,
Interface_Dep_Files,
Other_Interfaces,
Standalone_Mode,
Dependency_Files,
Binding_Options,
Leading_Library_Options,
Copy_Source_Dir,
Sources,
Generated_Object_Files,
Generated_Source_Files,
Max_Command_Line_Length,
Response_File_Format,
Response_File_Switches,
Keep_Response_File);
function Library_Label (Section : Library_Section) return String;
-- Return the label for a section in a library exchange file
function Get_Library_Section (Label : String) return Library_Section;
-- Get the current section from a label in a library exchange file
end Gprexch;
gprbuild-gpl-2014-src/src/gpr_util-knowledge.adb 0000644 0000767 0000145 00000005543 12323721731 021203 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R _ U T I L . K N O W L E D G E --
-- --
-- B o d y --
-- --
-- Copyright (C) 2010-2012, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with GprConfig.Knowledge; use GprConfig.Knowledge;
with GprConfig.Sdefault; use GprConfig.Sdefault;
separate (Gpr_Util)
package body Knowledge is
Base : Knowledge_Base;
-------------------------
-- Normalized_Hostname --
-------------------------
function Normalized_Hostname return String is
Id : Targets_Set_Id;
begin
Get_Targets_Set (Base, Hostname, Id);
return Normalized_Target (Base, Id);
end Normalized_Hostname;
--------------------------
-- Parse_Knowledge_Base --
--------------------------
procedure Parse_Knowledge_Base
(Project_Tree : Project_Tree_Ref;
Directory : String := "")
is
function Dir return String;
-- Returns Directory or if empty Default_Knowledge_Base_Directory
pragma Inline (Dir);
---------
-- Dir --
---------
function Dir return String is
begin
if Directory'Length = 0 then
return Default_Knowledge_Base_Directory;
else
return Directory;
end if;
end Dir;
begin
Parse_Knowledge_Base (Base, Dir, Parse_Compiler_Info => False);
exception
when Invalid_Knowledge_Base =>
Fail_Program
(Project_Tree, "could not parse the XML files in " & Dir);
end Parse_Knowledge_Base;
end Knowledge;
gprbuild-gpl-2014-src/src/gprbuild-post_compile.ads 0000644 0000767 0000145 00000003463 12323721731 021724 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B U I L D . P O S T _ C O M P I L E --
-- --
-- S p e c --
-- --
-- Copyright (C) 2011-2012, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
package Gprbuild.Post_Compile is
procedure Run;
-- Build libraries, if needed, and perform binding, if needed.
-- This is either for a specific project tree, or for the root project and
-- all its aggregated projects.
end Gprbuild.Post_Compile;
gprbuild-gpl-2014-src/src/gprbuild-compilation.ads 0000644 0000767 0000145 00000006657 12323721731 021555 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B U I L D . C O M P I L A T I O N --
-- --
-- S p e c --
-- --
-- Copyright (C) 2012-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- This is the root package for the compilation support. It handles the local
-- and distributed compilation modes.
with Ada.Characters.Latin_1;
private with Ada.Containers.Indefinite_Vectors;
with Ada.Containers.Vectors;
with Ada.Strings.Unbounded;
package Gprbuild.Compilation is
Default_Port : constant := 8484;
Opts_Sep : constant Character := Ada.Characters.Latin_1.HT;
-- Command options separator, that is the separator used for options to be
-- passed to the executed command.
-- A simple concurrent counter type
protected type Shared_Counter is
function Count return Natural;
-- Returns the current counter value
procedure Increment;
-- Increment by one
procedure Decrement;
-- Decrement by one
procedure Reset;
-- Reset counter to 0
entry Wait_Non_Zero;
-- Returns when the counter is above zero
private
Counter : Natural := 0;
end Shared_Counter;
procedure Set_Env
(Env : String;
Fail : Boolean;
Force : Boolean := False);
-- Set environemnt given an Env variable containing a set of name=value
-- separated with Opts_Sep.
--
-- name=value[name=value]
--
-- If Fail is true the program will exit if the a format error is detected.
-- If Force is set to True the environement will always be set otherwise it
-- will be set only if not already set.
-- The set of files for a given project (associated with a synchronization
-- job).
type File_Data is record
Path_Name : Ada.Strings.Unbounded.Unbounded_String;
Timestamp : Time_Stamp_Type; -- YYYYMMDDhhmmss
Prev : Time_Stamp_Type;
end record;
package File_Data_Set is new Ada.Containers.Vectors (Positive, File_Data);
private
package Str_Vect is
new Ada.Containers.Indefinite_Vectors (Positive, String);
end Gprbuild.Compilation;
gprbuild-gpl-2014-src/src/gprinstall-install.ads 0000644 0000767 0000145 00000003454 12323721731 021244 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R I N S T A L L . M A I N --
-- --
-- B o d y --
-- --
-- Copyright (C) 2012-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Prj;
package Gprinstall.Install is
use Prj;
procedure Process
(Tree : Project_Tree_Ref;
Project : Project_Id);
-- Install Project and possibly all imported projects depending on the
-- options.
end Gprinstall.Install;
gprbuild-gpl-2014-src/src/gprbind.adb 0000644 0000767 0000145 00000137225 12323721731 017031 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B I N D --
-- --
-- B o d y --
-- --
-- Copyright (C) 2006-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- gprbind is the executable called by gprmake to bind Ada sources. It is
-- the driver for gnatbind. It gets its input from gprmake through the
-- binding exchange file and gives back its results through the same file.
with Ada.Directories;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Command_Line; use Ada.Command_Line;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with ALI; use ALI;
with Gprexch; use Gprexch;
with Gpr_Util; use Gpr_Util;
with Hostparm;
with Makeutl; use Makeutl;
with Namet; use Namet;
with Osint;
with Switch;
with Tempdir;
with Table;
with Types;
procedure Gprbind is
Shared_Libgcc_Default : Character;
for Shared_Libgcc_Default'Size use Character'Size;
pragma Import
(C, Shared_Libgcc_Default, "__gnat_shared_libgcc_default");
Preserve : Attribute := Time_Stamps;
-- Used in calls to Copy_File. Changed to None for OpenVMS, because
-- Copy_Attributes always fails on VMS.
Executable_Suffix : constant String_Access := Get_Executable_Suffix;
-- The suffix of executables on this platforms
GNATBIND : String_Access := new String'("gnatbind");
-- The file name of the gnatbind executable. May be modified by an option
-- in the Minimum_Binder_Options.
Gnatbind_Prefix_Equal : constant String := "gnatbind_prefix=";
-- Start of the option to specify a prefix for the gnatbind executable
Gnatbind_Path_Equal : constant String := "--gnatbind_path=";
-- Start of the option to specify the absolute path of gnatbind
Ada_Binder_Equal : constant String := "ada_binder=";
-- Start of the option to specify the full name of the Ada binder
-- executable. Introduced for GNAAMP, where it is gnaambind.
Quiet_Output : Boolean := False;
Verbose_Mode : Boolean := False;
Dash_O_Specified : Boolean := False;
Dash_O_File_Specified : Boolean := False;
There_Are_Stand_Alone_Libraries : Boolean := False;
-- Set to True if the corresponding label is in the exchange file
No_Main_Option : constant String := "-n";
Dash_o : constant String := "-o";
Dash_shared : constant String := "-shared";
Dash_x : constant String := "-x";
Dash_Fequal : constant String := "-F=";
Dash_OO : constant String := "-O";
-- Minimum switches to be used to compile the binder generated file
Dash_c : constant String := "-c";
Dash_gnatA : constant String := "-gnatA";
Dash_gnatWb : constant String := "-gnatWb";
Dash_gnatiw : constant String := "-gnatiw";
Dash_gnatws : constant String := "-gnatws";
GCC_Version : Character := '0';
Gcc_Version_String : constant String := "gcc version ";
Shared_Libgcc : constant String := "-shared-libgcc";
Static_Libgcc : constant String := "-static-libgcc";
IO_File : File_Type;
-- The file to get the inputs and to put the results of the binding
Line : String (1 .. 1_000);
Last : Natural;
Exchange_File_Name : String_Access;
Ada_Compiler_Path : String_Access;
FULL_GNATBIND : String_Access;
Gnatbind_Path : String_Access;
Gnatbind_Path_Specified : Boolean := False;
Compiler_Options : String_List_Access := new String_List (1 .. 100);
Last_Compiler_Option : Natural := 0;
Compiler_Trailing_Options : String_List_Access := new String_List (1 .. 10);
Last_Compiler_Trailing_Option : Natural := 0;
Gnatbind_Options : String_List_Access := new String_List (1 .. 100);
Last_Gnatbind_Option : Natural := 0;
Main_ALI : String_Access := null;
Main_Base_Name : String_Access := null;
Binder_Generated_File : String_Access := null;
BG_File : File_Type;
Mapping_File : String_Access := null;
Success : Boolean := False;
Return_Code : Integer;
Adalib_Dir : String_Access;
Prefix_Path : String_Access;
Lib_Path : String_Access;
Static_Libs : Boolean := True;
Current_Section : Binding_Section := No_Binding_Section;
All_Binding_Options : Boolean;
Get_Option : Boolean;
Xlinker_Seen : Boolean;
Stack_Equal_Seen : Boolean;
GNAT_Version : String_Access := new String'("000");
-- The version of GNAT, coming from the Toolchain_Version for Ada
GNAT_Version_Set : Boolean := False;
-- True when the toolchain version is in the input exchange file
Delete_Temp_Files : Boolean := True;
FD_Objects : File_Descriptor;
Objects_Path : Path_Name_Type;
Objects_File : File_Type;
Ada_Object_Suffix : String_Access := Get_Object_Suffix;
Display_Line : String_Access := new String (1 .. 1_000);
Display_Last : Natural := 0;
-- A String buffer to store temporarily the displayed gnatbind command
-- invoked by gprbind.
procedure Add_To_Display_Line (S : String);
-- Add an argument to the Display_Line
package Binding_Options_Table is new Table.Table
(Table_Component_Type => String_Access,
Table_Index_Type => Natural,
Table_Low_Bound => 1,
Table_Initial => 10,
Table_Increment => 100,
Table_Name => "Gprbind.Binding_Options_Table");
Binding_Option_Dash_V_Specified : Boolean := False;
-- Set to True if -v is specified in the binding options
GNAT_6_Or_Higher : Boolean := False;
-- Set to True when GNAT version is neither 3.xx nor 5.xx
GNAT_6_4_Or_Higher : Boolean := False;
-- Set to True when GNAT_6_Or_Higher is True and if GNAT version is 6.xy
-- with x >= 4.
package ALI_Files_Table is new Table.Table
(Table_Component_Type => String_Access,
Table_Index_Type => Natural,
Table_Low_Bound => 1,
Table_Initial => 10,
Table_Increment => 100,
Table_Name => "Gprbind.ALI_File_Table");
type Path_And_Stamp is record
Path : String_Access;
Stamp : String_Access;
end record;
package Project_Paths is new Table.Table
(Table_Component_Type => Path_And_Stamp,
Table_Index_Type => Natural,
Table_Low_Bound => 1,
Table_Initial => 10,
Table_Increment => 100,
Table_Name => "Gprbind.Project_Paths");
type Bound_File;
type Bound_File_Access is access Bound_File;
type Bound_File is record
Name : String_Access;
Next : Bound_File_Access;
end record;
Bound_Files : Bound_File_Access;
-------------------------
-- Add_To_Display_Line --
-------------------------
procedure Add_To_Display_Line (S : String) is
begin
while Display_Last + 1 + S'Length > Display_Line'Last loop
declare
New_Buffer : constant String_Access :=
new String (1 .. 2 * Display_Line'Length);
begin
New_Buffer (1 .. Display_Last) :=
Display_Line (1 .. Display_Last);
Free (Display_Line);
Display_Line := New_Buffer;
end;
end loop;
if Display_Last > 0 then
Display_Last := Display_Last + 1;
Display_Line (Display_Last) := ' ';
end if;
Display_Line (Display_Last + 1 .. Display_Last + S'Length) := S;
Display_Last := Display_Last + S'Length;
end Add_To_Display_Line;
begin
if Argument_Count /= 1 then
Osint.Fail ("incorrect invocation");
end if;
Namet.Initialize;
-- Copy_Attributes always fails on VMS
if Hostparm.OpenVMS then
Preserve := None;
end if;
Exchange_File_Name := new String'(Argument (1));
-- DEBUG: save a copy of the exchange file
declare
Gprbind_Debug : constant String := Getenv ("GPRBIND_DEBUG").all;
begin
if Gprbind_Debug = "TRUE" then
Copy_File
(Exchange_File_Name.all,
Exchange_File_Name.all & "__saved",
Success,
Mode => Overwrite,
Preserve => Preserve);
end if;
end;
-- Open the binding exchange file
begin
Open (IO_File, In_File, Exchange_File_Name.all);
exception
when others =>
Osint.Fail ("could not read " & Exchange_File_Name.all);
end;
-- Get the information from the binding exchange file
while not End_Of_File (IO_File) loop
Get_Line (IO_File, Line, Last);
if Last > 0 then
if Line (1) = '[' then
Current_Section := Get_Binding_Section (Line (1 .. Last));
case Current_Section is
when No_Binding_Section =>
Osint.Fail ("unknown section: " & Line (1 .. Last));
when Quiet =>
Quiet_Output := True;
Verbose_Mode := False;
when Verbose =>
Quiet_Output := False;
Verbose_Mode := True;
when Shared_Libs =>
Static_Libs := False;
when Gprexch.There_Are_Stand_Alone_Libraries =>
There_Are_Stand_Alone_Libraries := True;
when others =>
null;
end case;
else
case Current_Section is
when No_Binding_Section =>
Osint.Fail ("no section specified: " & Line (1 .. Last));
when Quiet =>
Osint.Fail ("quiet section should be empty");
when Verbose =>
Osint.Fail ("verbose section should be empty");
when Shared_Libs =>
Osint.Fail ("shared libs section should be empty");
when Gprexch.There_Are_Stand_Alone_Libraries =>
Osint.Fail ("stand-alone libraries section should be empty");
when Gprexch.Main_Base_Name =>
if Main_Base_Name /= null then
Osint.Fail
("main base name specified multiple times");
end if;
Main_Base_Name := new String'(Line (1 .. Last));
when Gprexch.Mapping_File =>
Mapping_File := new String'(Line (1 .. Last));
when Compiler_Path =>
if Ada_Compiler_Path /= null then
Osint.Fail
("compiler path specified multiple times");
end if;
Ada_Compiler_Path := new String'(Line (1 .. Last));
when Compiler_Leading_Switches =>
Add
(Line (1 .. Last),
Compiler_Options, Last_Compiler_Option);
when Compiler_Trailing_Switches =>
Add
(Line (1 .. Last),
Compiler_Trailing_Options, Last_Compiler_Trailing_Option);
when Main_Dependency_File =>
if Main_ALI /= null then
Osint.Fail ("main ALI file specified multiple times");
end if;
Main_ALI := new String'(Line (1 .. Last));
when Dependency_Files =>
ALI_Files_Table.Append (new String'(Line (1 .. Last)));
when Binding_Options =>
-- Check if a gnatbind absolute is specified
if Last > Gnatbind_Path_Equal'Length
and then Line (1 .. Gnatbind_Path_Equal'Length) =
Gnatbind_Path_Equal
then
Gnatbind_Path := new String'
(Line (Gnatbind_Path_Equal'Length + 1 .. Last));
Gnatbind_Path_Specified := True;
-- Check if a gnatbind prefix is specified
elsif Last >= Gnatbind_Prefix_Equal'Length
and then Line (1 .. Gnatbind_Prefix_Equal'Length) =
Gnatbind_Prefix_Equal
then
-- Ignore an empty prefix
if Last > Gnatbind_Prefix_Equal'Length then
-- There is always a '-' between and
-- "gnatbind". Add one if not already in .
if Line (Last) /= '-' then
Last := Last + 1;
Line (Last) := '-';
end if;
GNATBIND := new String'
(Line (Gnatbind_Prefix_Equal'Length + 1 .. Last) &
"gnatbind");
end if;
elsif Last > Ada_Binder_Equal'Length
and then Line (1 .. Ada_Binder_Equal'Length) =
Ada_Binder_Equal
then
GNATBIND := new String'
(Line (Ada_Binder_Equal'Length + 1 .. Last));
-- When -O is used, instead of -O=file, -v is ignored to
-- avoid polluting the output. Record occurence of -v and
-- check the GNAT version later.
elsif Line (1 .. Last) = "-v" then
Binding_Option_Dash_V_Specified := True;
-- Ignore -C, as the generated sources are always in Ada
elsif Line (1 .. Last) /= "-C" then
Binding_Options_Table.Append
(new String'(Line (1 .. Last)));
end if;
when Project_Files =>
if End_Of_File (IO_File) then
Osint.Fail ("no time stamp for " & Line (1 .. Last));
else
declare
PS : Path_And_Stamp;
begin
PS.Path := new String'(Line (1 .. Last));
Get_Line (IO_File, Line, Last);
PS.Stamp := new String'(Line (1 .. Last));
Project_Paths.Append (PS);
end;
end if;
when Gprexch.Toolchain_Version =>
if End_Of_File (IO_File) then
Osint.Fail
("no toolchain version for language " &
Line (1 .. Last));
elsif Line (1 .. Last) = "ada" then
Get_Line (IO_File, Line, Last);
if Last > 5 and then Line (1 .. 5) = "GNAT " then
GNAT_Version := new String'(Line (6 .. Last));
GNAT_Version_Set := True;
end if;
else
Skip_Line (IO_File);
end if;
when Gprexch.Delete_Temp_Files =>
begin
Delete_Temp_Files := Boolean'Value (Line (1 .. Last));
exception
when Constraint_Error =>
null;
end;
when Gprexch.Object_File_Suffix =>
if End_Of_File (IO_File) then
Osint.Fail
("no object file suffix for language " &
Line (1 .. Last));
elsif Line (1 .. Last) = "ada" then
Get_Line (IO_File, Line, Last);
Ada_Object_Suffix := new String'(Line (1 .. Last));
else
Skip_Line (IO_File);
end if;
when Generated_Object_File |
Generated_Source_Files |
Bound_Object_Files |
Resulting_Options |
Run_Path_Option =>
null;
end case;
end if;
end if;
end loop;
if Main_Base_Name = null then
Osint.Fail ("no main base name specified");
else
Binder_Generated_File :=
new String'("b__" & Main_Base_Name.all & ".adb");
end if;
Close (IO_File);
-- Modify binding option -A= if is not an absolute path
if Project_Paths.Last >= 1 then
declare
Project_Dir : constant String :=
Ada.Directories.Containing_Directory
(Project_Paths.Table (1).Path.all);
begin
for J in 1 .. Binding_Options_Table.Last loop
if Binding_Options_Table.Table (J)'Length >= 4 and then
Binding_Options_Table.Table (J) (1 .. 3) = "-A="
then
declare
File : constant String :=
Binding_Options_Table.Table (J)
(4 .. Binding_Options_Table.Table (J)'Length);
begin
if not Is_Absolute_Path (File) then
declare
New_File : constant String :=
Normalize_Pathname (File, Project_Dir);
begin
Binding_Options_Table.Table (J) :=
new String'("-A=" & New_File);
end;
end if;
end;
end if;
end loop;
end;
end if;
-- Check if GNAT version is 6.4 or higher
if GNAT_Version_Set
and then
GNAT_Version'Length > 2
and then
GNAT_Version.all /= "000"
and then
GNAT_Version (GNAT_Version'First .. GNAT_Version'First + 1) /= "3."
and then
GNAT_Version (GNAT_Version'First .. GNAT_Version'First + 1) /= "5."
then
GNAT_6_Or_Higher := True;
if GNAT_Version (GNAT_Version'First .. GNAT_Version'First + 1) /= "6."
or else
GNAT_Version.all >= "6.4"
then
GNAT_6_4_Or_Higher := True;
end if;
end if;
-- Check if binding option -v was specified and issue it only if the GNAT
-- version is 6.4 or higher, otherwise the output of gnatbind -O will be
-- polluted.
if Binding_Option_Dash_V_Specified and then GNAT_6_4_Or_Higher then
Binding_Options_Table.Append (new String'("-v"));
end if;
if not Static_Libs then
Add (Dash_shared, Gnatbind_Options, Last_Gnatbind_Option);
end if;
-- Specify the name of the generated file to gnatbind
Add (Dash_o, Gnatbind_Options, Last_Gnatbind_Option);
Add
(Binder_Generated_File.all,
Gnatbind_Options,
Last_Gnatbind_Option);
if not Is_Regular_File (Ada_Compiler_Path.all) then
Osint.Fail ("could not find the Ada compiler");
end if;
if Main_ALI /= null then
Add (Main_ALI.all, Gnatbind_Options, Last_Gnatbind_Option);
end if;
-- If there are Stand-Alone Libraries, invoke gnatbind with -F (generate
-- checks of elaboration flags) to avoid multiple elaborations.
if There_Are_Stand_Alone_Libraries
and then GNAT_Version_Set
and then GNAT_Version'Length > 2
and then GNAT_Version (GNAT_Version'First .. GNAT_Version'First + 1) /=
"3."
then
Add ("-F", Gnatbind_Options, Last_Gnatbind_Option);
end if;
for J in 1 .. ALI_Files_Table.Last loop
Add (ALI_Files_Table.Table (J), Gnatbind_Options, Last_Gnatbind_Option);
end loop;
for J in 1 .. Binding_Options_Table.Last loop
Add
(Binding_Options_Table.Table (J),
Gnatbind_Options,
Last_Gnatbind_Option);
if Binding_Options_Table.Table (J).all = Dash_OO then
Dash_O_Specified := True;
elsif Binding_Options_Table.Table (J)'Length >= 4 and then
Binding_Options_Table.Table (J) (1 .. 3) = Dash_OO & '='
then
Dash_O_Specified := True;
Dash_O_File_Specified := True;
Name_Len := 0;
Add_Str_To_Name_Buffer
(Binding_Options_Table.Table (J)
(4 .. Binding_Options_Table.Table (J)'Last));
Objects_Path := Name_Find;
end if;
end loop;
-- Add -x at the end, so that if -s is specified in the binding options,
-- gnatbind does not try to look for sources, as the binder mapping file
-- specified by -F- is not for sources, but for ALI files.
Add (Dash_x, Gnatbind_Options, Last_Gnatbind_Option);
if Ada_Compiler_Path = null or else
Is_Absolute_Path (GNATBIND.all)
then
FULL_GNATBIND := GNATBIND;
else
FULL_GNATBIND :=
new String'
(Dir_Name (Ada_Compiler_Path.all) &
Directory_Separator &
GNATBIND.all);
end if;
if Gnatbind_Path_Specified then
FULL_GNATBIND := Gnatbind_Path;
end if;
Gnatbind_Path := Locate_Exec_On_Path (FULL_GNATBIND.all);
-- If gnatbind is not found and its full path was not specified, check for
-- gnatbind on the path.
if Gnatbind_Path = null and then not Gnatbind_Path_Specified then
Gnatbind_Path := Locate_Exec_On_Path (GNATBIND.all);
end if;
if Gnatbind_Path = null then
-- Make sure Namelen has a non negative value
Name_Len := 0;
if Gnatbind_Path_Specified then
Osint.Fail ("could not locate " & FULL_GNATBIND.all);
else
Osint.Fail ("could not locate " & GNATBIND.all);
end if;
else
-- Normalize the path, so that gnaampbind does not complain about not
-- being in a "bin" directory. But don't resolve symbolic links,
-- because in GNAT 5.01a1 and previous releases, gnatbind was a symbolic
-- link for .gnat_wrapper.
Gnatbind_Path :=
new String'
(Normalize_Pathname (Gnatbind_Path.all, Resolve_Links => False));
end if;
if Main_ALI = null then
Add (No_Main_Option, Gnatbind_Options, Last_Gnatbind_Option);
end if;
-- Add the switch -F= if the mapping file was specified
-- and the version of GNAT is recent enough.
if Mapping_File /= null
and then GNAT_Version_Set
and then GNAT_Version'Length > 2
and then GNAT_Version (GNAT_Version'First .. GNAT_Version'First + 1) /=
"3."
then
Add (Dash_Fequal & Mapping_File.all,
Gnatbind_Options,
Last_Gnatbind_Option);
end if;
-- Create temporary file to get the list of objects
if not Dash_O_File_Specified then
Tempdir.Create_Temp_File (FD_Objects, Objects_Path);
end if;
if GNAT_6_4_Or_Higher then
if not Dash_O_File_Specified then
Add
(Dash_OO & "=" & Get_Name_String (Objects_Path),
Gnatbind_Options,
Last_Gnatbind_Option);
Close (FD_Objects);
end if;
elsif not Dash_O_Specified then
Add (Dash_OO, Gnatbind_Options, Last_Gnatbind_Option);
end if;
if not Quiet_Output then
Display_Last := 0;
if Verbose_Mode then
Add_To_Display_Line (Gnatbind_Path.all);
else
Add_To_Display_Line (Base_Name (GNATBIND.all));
end if;
if Verbose_Mode then
for Option in 1 .. Last_Gnatbind_Option loop
Add_To_Display_Line (Gnatbind_Options (Option).all);
end loop;
else
if Main_ALI /= null then
Add_To_Display_Line (Base_Name (Main_ALI.all));
if ALI_Files_Table.Last > 0 then
Add_To_Display_Line ("...");
end if;
elsif ALI_Files_Table.Last > 0 then
Add_To_Display_Line (Base_Name (ALI_Files_Table.Table (1).all));
if ALI_Files_Table.Last > 1 then
Add_To_Display_Line ("...");
end if;
Add_To_Display_Line (No_Main_Option);
end if;
end if;
Put_Line (Display_Line (1 .. Display_Last));
end if;
declare
Size : Natural := 0;
begin
for J in 1 .. Last_Gnatbind_Option loop
Size := Size + Gnatbind_Options (J)'Length + 1;
end loop;
-- Invoke gnatbind with the arguments if the size is not too large or
-- if the version of GNAT is not recent enough.
if not GNAT_6_Or_Higher or else Size <= Maximum_Size then
if not GNAT_6_4_Or_Higher then
Spawn
(Gnatbind_Path.all,
Gnatbind_Options (1 .. Last_Gnatbind_Option),
FD_Objects,
Return_Code,
Err_To_Out => False);
Success := Return_Code = 0;
else
Return_Code :=
Spawn
(Gnatbind_Path.all,
Gnatbind_Options (1 .. Last_Gnatbind_Option));
end if;
else
-- Otherwise create a temporary response file
declare
FD : File_Descriptor;
Path : Path_Name_Type;
Args : Argument_List (1 .. 1);
EOL : constant String (1 .. 1) := (1 => ASCII.LF);
Status : Integer;
Quotes_Needed : Boolean;
Last_Char : Natural;
Ch : Character;
begin
Tempdir.Create_Temp_File (FD, Path);
Args (1) := new String'("@" & Get_Name_String (Path));
for J in 1 .. Last_Gnatbind_Option loop
-- Check if the argument should be quoted
Quotes_Needed := False;
Last_Char := Gnatbind_Options (J)'Length;
for K in Gnatbind_Options (J)'Range loop
Ch := Gnatbind_Options (J) (K);
if Ch = ' ' or else Ch = ASCII.HT or else Ch = '"' then
Quotes_Needed := True;
exit;
end if;
end loop;
if Quotes_Needed then
-- Quote the argument, doubling '"'
declare
Arg : String (1 .. Gnatbind_Options (J)'Length * 2 + 2);
begin
Arg (1) := '"';
Last_Char := 1;
for K in Gnatbind_Options (J)'Range loop
Ch := Gnatbind_Options (J) (K);
Last_Char := Last_Char + 1;
Arg (Last_Char) := Ch;
if Ch = '"' then
Last_Char := Last_Char + 1;
Arg (Last_Char) := '"';
end if;
end loop;
Last_Char := Last_Char + 1;
Arg (Last_Char) := '"';
Status := Write (FD, Arg'Address, Last_Char);
end;
else
Status := Write
(FD,
Gnatbind_Options (J) (Gnatbind_Options (J)'First)'Address,
Last_Char);
end if;
if Status /= Last_Char then
Osint.Fail ("disk full");
end if;
Status := Write (FD, EOL (1)'Address, 1);
if Status /= 1 then
Osint.Fail ("disk full");
end if;
end loop;
Close (FD);
-- And invoke gnatbind with this this response file
if not GNAT_6_4_Or_Higher then
Spawn
(Gnatbind_Path.all,
Args,
FD_Objects,
Return_Code,
Err_To_Out => False);
else
Return_Code := Spawn (Gnatbind_Path.all, Args);
end if;
if Delete_Temp_Files then
declare
Succ : Boolean;
pragma Warnings (Off, Succ);
begin
Delete_File (Get_Name_String (Path), Succ);
end;
end if;
end;
end if;
end;
if not GNAT_6_4_Or_Higher and then not Dash_O_File_Specified then
Close (FD_Objects);
end if;
if Return_Code /= 0 then
if Delete_Temp_Files and not Dash_O_File_Specified then
Delete_File (Get_Name_String (Objects_Path), Success);
end if;
Osint.Fail ("invocation of gnatbind failed");
end if;
Add (Dash_c, Compiler_Options, Last_Compiler_Option);
Add (Dash_gnatA, Compiler_Options, Last_Compiler_Option);
Add (Dash_gnatWb, Compiler_Options, Last_Compiler_Option);
Add (Dash_gnatiw, Compiler_Options, Last_Compiler_Option);
Add (Dash_gnatws, Compiler_Options, Last_Compiler_Option);
-- Read the ALI file of the first ALI file. Fetch the back end switches
-- from this ALI file and use these switches to compile the binder
-- generated file.
if Main_ALI /= null or else ALI_Files_Table.Last >= 1 then
Initialize_ALI;
Name_Len := 0;
if Main_ALI /= null then
Add_Str_To_Name_Buffer (Main_ALI.all);
else
Add_Str_To_Name_Buffer (ALI_Files_Table.Table (1).all);
end if;
declare
use Types;
F : constant File_Name_Type := Name_Find;
T : Text_Buffer_Ptr;
A : ALI_Id;
begin
-- Load the ALI file
T := Osint.Read_Library_Info (F, True);
-- Read it. Note that we ignore errors, since we only want very
-- limited information from the ali file, and likely a slightly
-- wrong version will be just fine, though in normal operation
-- we don't expect this to happen.
A := Scan_ALI
(F,
T,
Ignore_ED => False,
Err => False,
Ignore_Errors => True,
Read_Lines => "A");
if A /= No_ALI_Id then
for
Index in Units.Table (ALIs.Table (A).First_Unit).First_Arg ..
Units.Table (ALIs.Table (A).First_Unit).Last_Arg
loop
-- Do not compile with the front end switches. However, --RTS
-- is to be dealt with specially because the binder-generated
-- file need to compiled with the same switch.
declare
Arg : String_Ptr renames Args.Table (Index);
begin
if (not Switch.Is_Front_End_Switch (Arg.all))
or else
(Arg'Length > 5
and then
Arg (Arg'First + 2 .. Arg'First + 5) = "RTS=")
then
Add
(String_Access (Arg),
Compiler_Options,
Last_Compiler_Option);
end if;
end;
end loop;
end if;
end;
end if;
Add (Binder_Generated_File, Compiler_Options, Last_Compiler_Option);
declare
Object : constant String :=
"b__" & Main_Base_Name.all & Ada_Object_Suffix.all;
begin
Add
(Dash_o,
Compiler_Options,
Last_Compiler_Option);
Add
(Object,
Compiler_Options,
Last_Compiler_Option);
if not Quiet_Output then
Name_Len := 0;
if Verbose_Mode then
Add_Str_To_Name_Buffer (Ada_Compiler_Path.all);
else
Add_Str_To_Name_Buffer (Base_Name (Ada_Compiler_Path.all));
end if;
-- Remove the executable suffix, if present
if Executable_Suffix'Length > 0
and then
Name_Len > Executable_Suffix'Length
and then
Name_Buffer
(Name_Len - Executable_Suffix'Length + 1 .. Name_Len) =
Executable_Suffix.all
then
Name_Len := Name_Len - Executable_Suffix'Length;
end if;
Display_Last := 0;
Add_To_Display_Line (Name_Buffer (1 .. Name_Len));
if Verbose_Mode then
for Option in 1 .. Last_Compiler_Option loop
Add_To_Display_Line (Compiler_Options (Option).all);
end loop;
else
Add_To_Display_Line (Compiler_Options (1).all);
if Compiler_Options (1) /= Binder_Generated_File then
Add_To_Display_Line (Binder_Generated_File.all);
end if;
end if;
Put_Line (Display_Line (1 .. Display_Last));
end if;
-- Add the trailing options, if any
for J in 1 .. Last_Compiler_Trailing_Option loop
Add
(Compiler_Trailing_Options (J),
Compiler_Options,
Last_Compiler_Option);
end loop;
Spawn
(Ada_Compiler_Path.all,
Compiler_Options (1 .. Last_Compiler_Option),
Success);
if not Success then
Osint.Fail ("compilation of binder generated file failed");
end if;
-- Find the GCC version
Spawn
(Program_Name => Ada_Compiler_Path.all,
Args => (1 => new String'("-v")),
Output_File => Exchange_File_Name.all,
Success => Success,
Return_Code => Return_Code,
Err_To_Out => True);
if Success then
Open (IO_File, In_File, Exchange_File_Name.all);
while not End_Of_File (IO_File) loop
Get_Line (IO_File, Line, Last);
if Last > Gcc_Version_String'Length and then
Line (1 .. Gcc_Version_String'Length) = Gcc_Version_String
then
GCC_Version := Line (Gcc_Version_String'Length + 1);
exit;
end if;
end loop;
Close (IO_File);
end if;
Create (IO_File, Out_File, Exchange_File_Name.all);
-- First, the generated object file
Put_Line (IO_File, Binding_Label (Generated_Object_File));
Put_Line (IO_File, Object);
-- Repeat the project paths with their time stamps
Put_Line (IO_File, Binding_Label (Project_Files));
for J in 1 .. Project_Paths.Last loop
Put_Line (IO_File, Project_Paths.Table (J).Path.all);
Put_Line (IO_File, Project_Paths.Table (J).Stamp.all);
end loop;
-- Get the bound object files from the Object file
Open (Objects_File, In_File, Get_Name_String (Objects_Path));
Put_Line (IO_File, Binding_Label (Bound_Object_Files));
while not End_Of_File (Objects_File) loop
Get_Line (Objects_File, Line, Last);
-- Only put in the exchange file the path of the object files.
-- Output anything else on standard output.
if Is_Regular_File (Line (1 .. Last)) then
Put_Line (IO_File, Line (1 .. Last));
Bound_Files := new Bound_File'
(Name => new String'(Line (1 .. Last)), Next => Bound_Files);
if Dash_O_Specified and then not Dash_O_File_Specified then
Put_Line (Line (1 .. Last));
end if;
elsif not Dash_O_File_Specified then
Put_Line (Line (1 .. Last));
end if;
end loop;
Close (Objects_File);
if Delete_Temp_Files and then not Dash_O_File_Specified then
Delete_File (Get_Name_String (Objects_Path), Success);
end if;
-- For the benefit of gprclean, the generated files other than the
-- generated object file.
Put_Line (IO_File, Binding_Label (Generated_Source_Files));
Put_Line (IO_File, "b__" & Main_Base_Name.all & ".ads");
Put_Line (IO_File, Binder_Generated_File.all);
Put_Line (IO_File, "b__" & Main_Base_Name.all & ".ali");
-- Get the options from the binder generated file
Open (BG_File, In_File, Binder_Generated_File.all);
while not End_Of_File (BG_File) loop
Get_Line (BG_File, Line, Last);
exit when Line (1 .. Last) = Begin_Info;
end loop;
if not End_Of_File (BG_File) then
Put_Line (IO_File, Binding_Label (Resulting_Options));
All_Binding_Options := False;
Xlinker_Seen := False;
Stack_Equal_Seen := False;
loop
Get_Line (BG_File, Line, Last);
exit when Line (1 .. Last) = End_Info;
Line (1 .. Last - 8) := Line (9 .. Last);
Last := Last - 8;
if Line (1) = '-' then
-- After the first switch, we take all options, because some
-- of the options specified in pragma Linker_Options may not
-- start with '-'.
All_Binding_Options := True;
end if;
Get_Option :=
All_Binding_Options
or else
(Base_Name (Line (1 .. Last)) = "g-trasym.o")
or else
(Base_Name (Line (1 .. Last)) = "g-trasym.obj");
-- g-trasym is a special case as it is not included in libgnat
-- Avoid duplication of object file
if Get_Option then
declare
BF : Bound_File_Access := Bound_Files;
begin
while BF /= null loop
if BF.Name.all = Line (1 .. Last) then
Get_Option := False;
exit;
else
BF := BF.Next;
end if;
end loop;
end;
end if;
if Get_Option then
if Line (1 .. Last) = "-Xlinker" then
Xlinker_Seen := True;
elsif Xlinker_Seen then
Xlinker_Seen := False;
-- Make sure that only the first switch --stack= is put in
-- the exchange file.
if Last > 8 and then Line (1 .. 8) = "--stack=" then
if not Stack_Equal_Seen then
Stack_Equal_Seen := True;
Put_Line (IO_File, "-Xlinker");
Put_Line (IO_File, Line (1 .. Last));
end if;
else
Put_Line (IO_File, "-Xlinker");
Put_Line (IO_File, Line (1 .. Last));
end if;
elsif Last > 12 and then Line (1 .. 12) = "-Wl,--stack=" then
if not Stack_Equal_Seen then
Stack_Equal_Seen := True;
Put_Line (IO_File, Line (1 .. Last));
end if;
elsif Last >= 3 and then Line (1 .. 2) = "-L" then
-- Set Adalib_Dir only if libgnat is found inside.
if Is_Regular_File
(Line (3 .. Last) & Directory_Separator & "libgnat.a")
then
Adalib_Dir := new String'(Line (3 .. Last));
if Verbose_Mode then
Put_Line ("Adalib_Dir = """ & Adalib_Dir.all & '"');
end if;
-- Build the Prefix_Path, where to look for some
-- archives: libaddr2line.a, libbfd.a, libgnatmon.a,
-- libgnalasup.a and libiberty.a. It contains three
-- directories: $(adalib)/.., $(adalib)/../.. and the
-- subdirectory "lib" ancestor of $(adalib).
declare
Dir_Last : Positive;
Prev_Dir_Last : Positive;
First : Positive;
Prev_Dir_First : Positive;
Nmb : Natural;
begin
Name_Len := 0;
Add_Str_To_Name_Buffer (Line (3 .. Last));
while Name_Buffer (Name_Len) = Directory_Separator
or else Name_Buffer (Name_Len) = '/'
loop
Name_Len := Name_Len - 1;
end loop;
while Name_Buffer (Name_Len) /= Directory_Separator
and then Name_Buffer (Name_Len) /= '/'
loop
Name_Len := Name_Len - 1;
end loop;
while Name_Buffer (Name_Len) = Directory_Separator
or else Name_Buffer (Name_Len) = '/'
loop
Name_Len := Name_Len - 1;
end loop;
Dir_Last := Name_Len;
Nmb := 0;
Dir_Loop : loop
Prev_Dir_Last := Dir_Last;
First := Dir_Last - 1;
while First > 3
and then
Name_Buffer (First) /= Directory_Separator
and then
Name_Buffer (First) /= '/'
loop
First := First - 1;
end loop;
Prev_Dir_First := First + 1;
exit Dir_Loop when First <= 3;
Dir_Last := First - 1;
while Name_Buffer (Dir_Last) = Directory_Separator
or else Name_Buffer (Dir_Last) = '/'
loop
Dir_Last := Dir_Last - 1;
end loop;
Nmb := Nmb + 1;
if Nmb <= 1 then
Add_Char_To_Name_Buffer (Path_Separator);
Add_Str_To_Name_Buffer
(Name_Buffer (1 .. Dir_Last));
elsif Name_Buffer (Prev_Dir_First .. Prev_Dir_Last)
= "lib"
then
Add_Char_To_Name_Buffer (Path_Separator);
Add_Str_To_Name_Buffer
(Name_Buffer (1 .. Prev_Dir_Last));
exit Dir_Loop;
end if;
end loop Dir_Loop;
Prefix_Path :=
new String'(Name_Buffer (1 .. Name_Len));
if Verbose_Mode then
Put_Line
("Prefix_Path = """ & Prefix_Path.all & '"');
end if;
end;
end if;
Put_Line (IO_File, Line (1 .. Last));
elsif Line (1 .. Last) = "-static" then
Static_Libs := True;
Put_Line (IO_File, Line (1 .. Last));
if Shared_Libgcc_Default = 'T'
and then GCC_Version >= '3'
then
Put_Line (IO_File, Static_Libgcc);
end if;
elsif Line (1 .. Last) = "-shared" then
Static_Libs := False;
Put_Line (IO_File, Line (1 .. Last));
if GCC_Version >= '3' then
Put_Line (IO_File, Shared_Libgcc);
end if;
-- For a number of archives, we need to indicate the full
-- path of the archive, if we find it, to be sure that the
-- correct archive is used by the linker.
elsif Line (1 .. Last) = "-lgnat" then
if Adalib_Dir = null then
if Verbose_Mode then
Put_Line ("No Adalib_Dir");
end if;
Put_Line (IO_File, "-lgnat");
elsif Static_Libs then
Put_Line (IO_File, Adalib_Dir.all & "libgnat.a");
else
Put_Line (IO_File, "-lgnat");
end if;
elsif Line (1 .. Last) = "-lgnarl" and then
Static_Libs and then
Adalib_Dir /= null
then
Put_Line (IO_File, Adalib_Dir.all & "libgnarl.a");
elsif Line (1 .. Last) = "-laddr2line"
and then Prefix_Path /= null
then
Lib_Path := Locate_Regular_File
("libaddr2line.a", Prefix_Path.all);
if Lib_Path /= null then
Put_Line (IO_File, Lib_Path.all);
Free (Lib_Path);
else
Put_Line (IO_File, Line (1 .. Last));
end if;
elsif Line (1 .. Last) = "-lbfd"
and then Prefix_Path /= null
then
Lib_Path := Locate_Regular_File
("libbfd.a", Prefix_Path.all);
if Lib_Path /= null then
Put_Line (IO_File, Lib_Path.all);
Free (Lib_Path);
else
Put_Line (IO_File, Line (1 .. Last));
end if;
elsif Line (1 .. Last) = "-lgnalasup"
and then Prefix_Path /= null
then
Lib_Path := Locate_Regular_File
("libgnalasup.a", Prefix_Path.all);
if Lib_Path /= null then
Put_Line (IO_File, Lib_Path.all);
Free (Lib_Path);
else
Put_Line (IO_File, Line (1 .. Last));
end if;
elsif Line (1 .. Last) = "-lgnatmon"
and then Prefix_Path /= null
then
Lib_Path := Locate_Regular_File
("libgnatmon.a", Prefix_Path.all);
if Lib_Path /= null then
Put_Line (IO_File, Lib_Path.all);
Free (Lib_Path);
else
Put_Line (IO_File, Line (1 .. Last));
end if;
elsif Line (1 .. Last) = "-liberty"
and then Prefix_Path /= null
then
Lib_Path := Locate_Regular_File
("libiberty.a", Prefix_Path.all);
if Lib_Path /= null then
Put_Line (IO_File, Lib_Path.all);
Free (Lib_Path);
else
Put_Line (IO_File, Line (1 .. Last));
end if;
else
Put_Line (IO_File, Line (1 .. Last));
end if;
end if;
end loop;
end if;
Close (BG_File);
if not Static_Libs
and then Adalib_Dir /= null
then
Put_Line (IO_File, Binding_Label (Run_Path_Option));
Put_Line (IO_File, Adalib_Dir.all);
Name_Len := Adalib_Dir'Length;
Name_Buffer (1 .. Name_Len) := Adalib_Dir.all;
for J in reverse 2 .. Name_Len - 4 loop
if Name_Buffer (J) = Directory_Separator and then
Name_Buffer (J + 4) = Directory_Separator and then
Name_Buffer (J + 1 .. J + 3) = "lib"
then
Name_Len := J + 3;
Put_Line (IO_File, Name_Buffer (1 .. Name_Len));
exit;
end if;
end loop;
end if;
Close (IO_File);
end;
end Gprbind;
gprbuild-gpl-2014-src/src/gprconfig-knowledge.ads 0000644 0000767 0000145 00000053561 12323721731 021360 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R C O N F I G --
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- This unit is responsible for parsing the gprconfig knowledge base
with Ada.Containers.Doubly_Linked_Lists;
with Ada.Containers.Indefinite_Doubly_Linked_Lists;
with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Containers.Hashed_Maps;
with Ada.Containers.Vectors;
with Ada.Strings.Unbounded;
with GNAT.Regpat;
with Namet;
package GprConfig.Knowledge is
Generate_Error : exception;
-- To be raised when an error occurs during generation of config files
--------------------
-- Knowledge base --
--------------------
-- The following types and subprograms manipulate the knowldge base. This
-- base is a set of XML files that describe how to find compilers that are
-- installed on the system and that match specific criterias.
type Knowledge_Base is private;
function Default_Knowledge_Base_Directory return String;
-- Return the default location of the knowledge database. This is based on
-- the installation directory of the executable.
procedure Parse_Knowledge_Base
(Base : in out Knowledge_Base;
Directory : String;
Parse_Compiler_Info : Boolean := True;
Validate : Boolean := False);
-- Parse info from the knowledge base, and store it in memory.
-- Only information relevant to the current host is parsed.
-- If Parse_Compiler_Info is False, then only the information about
-- target sets is parsed.
-- This procedure will raise Invalid_Knowledge_Base if the base contains
-- incorrect data.
-- If Validate is True, the contents of the knowledge base is first
-- validated with an XSD schema.
Invalid_Knowledge_Base : exception;
-- To be raised when an error occurred while parsing the knowledge base
Knowledge_Base_Validation_Error : exception;
-- Some files in the knowledge base are invalid.
-----------------
-- Target sets --
-----------------
-- One of the information pieces contain in the database is a way to
-- normalize target names, since various names are used in different
-- contexts thus making it harder to write project files depending on the
-- target.
type Targets_Set_Id is private;
-- Identify a target aliases set
All_Target_Sets : constant Targets_Set_Id;
-- Matches all target sets
Unknown_Targets_Set : constant Targets_Set_Id;
-- Special target set when a target is not known
function Query_Targets_Set
(Base : Knowledge_Base;
Target : String) return Targets_Set_Id;
-- Get the target alias set id for a target, or Unknown_Targets_Set if
-- no such target is in the base.
procedure Get_Targets_Set
(Base : in out Knowledge_Base;
Target : String;
Id : out Targets_Set_Id);
-- Get the target alias set id for a target. If not already in the base,
-- add it.
function Normalized_Target
(Base : Knowledge_Base;
Set : Targets_Set_Id) return String;
-- Return the normalized name for a target set
---------------
-- Compilers --
---------------
-- Most of the information in the database relates to compilers. However,
-- you do not have direct access to the generic description that explains
-- how to find compilers on the PATH and how to compute their attributes
-- (version, runtimes,...) Instead, this package gives you access to the
-- list of compilers that were found. The package ensures that all
-- information is only computed at most once, to save on system calls and
-- provide better performance.
type Compiler is private;
type Compiler_Access is access all Compiler;
function Runtime_Dir_Of (Comp : Compiler_Access) return Namet.Name_Id;
-- Return the name of the runtime directory for the compiler. Returns
-- No_Name if Comp is null.
package Compiler_Lists
is new Ada.Containers.Indefinite_Doubly_Linked_Lists (Compiler_Access);
-- A list of compilers
function Is_Selected (Comp : Compiler) return Boolean;
function Target (Comp : Compiler) return Namet.Name_Id;
procedure Set_Selection
(Compilers : in out Compiler_Lists.List;
Cursor : Compiler_Lists.Cursor;
Selected : Boolean);
procedure Set_Selection
(Comp : in out Compiler;
Selected : Boolean);
-- Toggle the selection status of a compiler in the list.
-- This does not check that the selection is consistent though (use
-- Is_Supported_Config to do this test)
function To_String
(Base : Knowledge_Base;
Comp : Compiler;
As_Config_Arg : Boolean;
Show_Target : Boolean := False;
Rank_In_List : Integer := -1;
Parser_Friendly : Boolean := False) return String;
-- Return a string representing the compiler. It is either the --config
-- argument (if As_Config_Arg is true) or the string to use in the
-- interactive menu otherwise.
-- If Rank_In_List is specified, it is written at the beginning of the
-- line.
-- If Parser_Friendly is set, then the list is displayed in a way that can
-- be easily parsed automatically
function To_String
(Base : Knowledge_Base;
Compilers : Compiler_Lists.List;
Selected_Only : Boolean;
Show_Target : Boolean := False;
Parser_Friendly : Boolean := False) return String;
-- Return the list of compilers.
-- Unselectable compilers are hidden. If Selected_Only is true, then only
-- compilers that are currently selected are displayed.
-- If Parser_Friendly is set, then the list is displayed in a way that can
-- be easily parsed automatically
function Display_Before (Comp1, Comp2 : Compiler_Access) return Boolean;
-- Whether Comp1 should be displayed before Comp2 when displaying lists of
-- compilers. This ensures that similar languages are grouped, among othe
-- things.
procedure Filter_Compilers_List
(Base : Knowledge_Base;
Compilers : in out Compiler_Lists.List;
For_Target_Set : Targets_Set_Id);
-- Based on the currently selected compilers, check which other compilers
-- can or cannot be selected by the user.
-- This is not the case if the resulting selection in Compilers is not a
-- supported config (multiple compilers for the same language, set of
-- compilers explicitly marked as unsupported in the knowledge base,...).
------------------
-- Command line --
------------------
-- This package provides support for manipulating the --config command line
-- parameters. The intent is that they have the same form in all the tools
-- that support it. The information provides to --config might be partial
-- only, and this package provides support for completing it automatically
-- based on the knowledge base.
procedure Parse_Config_Parameter
(Base : Knowledge_Base;
Config : String;
Compiler : out Compiler_Access;
Requires_Compiler : out Boolean);
-- Parse the --config parameter, and store the (partial) information
-- found in Compiler.
-- When a switch matches a language that requires no compiler,
-- Requires_Compiler is set to False.
-- Raises Invalid_Config if Config is invalid
Invalid_Config : exception;
-- Raised when the user has specified an invalid --config switch
procedure Complete_Command_Line_Compilers
(Base : in out Knowledge_Base;
On_Target : Targets_Set_Id;
Filters : Compiler_Lists.List;
Compilers : in out Compiler_Lists.List);
-- In batch mode, the --config parameters indicate what compilers should be
-- selected. Each of these switch selects the first matching compiler
-- available, and all --config switch must match a compiler.
-- The information provided by the user does not have to be complete, and
-- this procedure completes all missing information like version, runtime,
-- and so on.
-- In gprconfig, it should only be called in batch mode, since otherwise
-- --config only acts as a filter for the compilers that are found through
-- the knowledge base.
-- Filters is the list specified by the user as --config, and contains
-- potentially partial information for each compiler. On output, Compilers
-- is completed with the full information for all compilers in Filters. If
-- at least one of the compilers in Filters cannot be found, Invalid_Config
-- is raised.
function Extra_Dirs_From_Filters
(Filters : Compiler_Lists.List) return String;
-- Compute the list of directories that should be prepended to the PATH
-- when searching for compilers. These are all the directories that the
-- user has explicitly specified in his filters (aka --config)
-----------------------------
-- knowledge base contents --
-----------------------------
function Hash_Case_Insensitive
(Name : Namet.Name_Id) return Ada.Containers.Hash_Type;
package Variables_Maps is new Ada.Containers.Hashed_Maps
(Key_Type => Namet.Name_Id,
Element_Type => Namet.Name_Id,
Hash => Hash_Case_Insensitive,
Equivalent_Keys => Namet."=",
"=" => Namet."=");
No_Compiler : constant Compiler;
-- Describes one of the compilers found on the PATH.
-- Path is the directory that contains the compiler executable.
-- Path_Order is used for sorting in the interactive menu: it indicates the
-- index in $PATH of the directory, so that we can show first the compilers
-- that are first in path.
-- Any of these compilers can be selected by the user as part of a config.
-- However, to prevent incompatibilities, a compiler can be marked as not
-- selectable. This will be re-evaluated based on the current selection.
-- Complete is set to True if all the information about the compiler was
-- computed. It is set to False if the compiler was specified through a
-- command line argument --config, and part of the info needs to be
-- computed.
-- Index_In_List is used for the interactive menu, and is initialized
-- automatically.
type Compiler_Iterator is abstract tagged null record;
-- An iterator that searches for all known compilers in a list of
-- directories. Whenever a new compiler is found, the Callback primitive
-- operation is called.
procedure Callback
(Iterator : in out Compiler_Iterator;
Base : in out Knowledge_Base;
Comp : Compiler;
From_Extra_Dir : Boolean;
Continue : out Boolean) is abstract;
-- Called whenever a new compiler is discovered.
-- It might be discovered either in a path added through a --config
-- parameter (in which case From_Extra_Dir is True), or in a path specified
-- in the environment variable $PATH (in which case it is False). If the
-- directory is both in Extra_Dirs and in $PATH, From_Extra_Dir is set to
-- False.
-- On exit, Continue should be set to False if there is no need to discover
-- further compilers (however there will be no possibility to restart the
-- search at the same point later on).
procedure Foreach_Compiler_In_Path
(Iterator : in out Compiler_Iterator;
Base : in out Knowledge_Base;
On_Target : Targets_Set_Id;
Extra_Dirs : String := "");
-- Find all compilers in "Extra_Dirs & $PATH".
-- Extra_Dirs should typically be the list of directories found in
-- --config command line arguments.
-- The only filtering done is the target, for optimization purposes (no
-- need to computed all info about the compiler if we know it will not be
-- uses anyway).
procedure Known_Compiler_Names
(Base : Knowledge_Base;
List : out Ada.Strings.Unbounded.Unbounded_String);
-- Set List to the comma-separated list of known compilers
procedure Generate_Configuration
(Base : Knowledge_Base;
Compilers : Compiler_Lists.List;
Output_File : String;
Target : String);
-- Generate the configuration file for the list of selected compilers
package String_Lists is
new Ada.Containers.Indefinite_Doubly_Linked_Lists (String);
procedure Put_Verbose (Str : String; Indent_Delta : Integer := 0);
-- Print Str if verbose mode is activated.
-- Indent_Delta will increase the current indentation level for all further
-- traces, which is used to highlight nested calls. Only the sign of
-- Indent_Delta is taken into account.
-- Nothing is printed if Str is the empty string, only the indentation is
-- changed
function Filter_Match
(Base : Knowledge_Base;
Comp : Compiler;
Filter : Compiler) return Boolean;
-- Returns True if Comp match Filter (the latter corresponds to a --config
-- command line argument).
private
type Targets_Set_Id is range -1 .. Natural'Last;
All_Target_Sets : constant Targets_Set_Id := -1;
Unknown_Targets_Set : constant Targets_Set_Id := 0;
type Compiler is record
Name : Namet.Name_Id := Namet.No_Name;
-- The name of the compiler, as specified in the node of the
-- knowledge base. If Compiler represents a filter as defined on through
-- --config switch, then name can also be the base name of the
-- executable we are looking for. In such a case, it never includes the
-- exec suffix (.exe on Windows)
Executable : Namet.Name_Id := Namet.No_Name;
Target : Namet.Name_Id := Namet.No_Name;
Targets_Set : Targets_Set_Id;
Path : Namet.Name_Id := Namet.No_Name;
Base_Name : Namet.Name_Id := Namet.No_Name;
-- Base name of the executable. This does not include the exec suffix
Version : Namet.Name_Id := Namet.No_Name;
Variables : Variables_Maps.Map;
Prefix : Namet.Name_Id := Namet.No_Name;
Runtime : Namet.Name_Id := Namet.No_Name;
Alt_Runtime : Namet.Name_Id := Namet.No_Name;
Runtime_Dir : Namet.Name_Id := Namet.No_Name;
Path_Order : Integer;
Language_Case : Namet.Name_Id := Namet.No_Name;
-- The supported language, with the casing read from the compiler. This
-- is for display purposes only
Language_LC : Namet.Name_Id := Namet.No_Name;
-- The supported language, always lower case
Selectable : Boolean := True;
Selected : Boolean := False;
Complete : Boolean := True;
end record;
No_Compiler : constant Compiler :=
(Name => Namet.No_Name,
Target => Namet.No_Name,
Targets_Set => Unknown_Targets_Set,
Executable => Namet.No_Name,
Base_Name => Namet.No_Name,
Path => Namet.No_Name,
Variables => Variables_Maps.Empty_Map,
Version => Namet.No_Name,
Prefix => Namet.No_Name,
Runtime => Namet.No_Name,
Alt_Runtime => Namet.No_Name,
Runtime_Dir => Namet.No_Name,
Language_Case => Namet.No_Name,
Language_LC => Namet.No_Name,
Selectable => False,
Selected => False,
Complete => True,
Path_Order => 0);
type Pattern_Matcher_Access is access all GNAT.Regpat.Pattern_Matcher;
type External_Value_Type is (Value_Constant,
Value_Shell,
Value_Directory,
Value_Grep,
Value_Nogrep,
Value_Filter,
Value_Must_Match,
Value_Variable,
Value_Done);
type External_Value_Node
(Typ : External_Value_Type := Value_Constant) is
record
case Typ is
when Value_Constant =>
Value : Namet.Name_Id;
when Value_Shell =>
Command : Namet.Name_Id;
when Value_Directory =>
Directory : Namet.Name_Id;
Directory_Group : Integer;
Dir_If_Match : Namet.Name_Id;
Contents : Pattern_Matcher_Access;
when Value_Grep =>
Regexp_Re : Pattern_Matcher_Access;
Group : Natural;
when Value_Nogrep =>
Regexp_No : Pattern_Matcher_Access;
when Value_Filter =>
Filter : Namet.Name_Id;
when Value_Must_Match =>
Must_Match : Namet.Name_Id;
when Value_Variable =>
Var_Name : Namet.Name_Id;
when Value_Done =>
null;
end case;
end record;
package External_Value_Nodes is
new Ada.Containers.Doubly_Linked_Lists (External_Value_Node);
subtype External_Value is External_Value_Nodes.List;
Null_External_Value : constant External_Value :=
External_Value_Nodes.Empty_List;
type Compiler_Description is record
Name : Namet.Name_Id := Namet.No_Name;
Executable : Namet.Name_Id := Namet.No_Name;
Executable_Re : Pattern_Matcher_Access;
Prefix_Index : Integer := -1;
Target : External_Value;
Version : External_Value;
Variables : External_Value;
Languages : External_Value;
Runtimes : External_Value;
Default_Runtimes : String_Lists.List;
end record;
-- Executable_Re is only set if the name of the must be
-- taken as a regular expression.
package Compiler_Description_Maps is new
Ada.Containers.Indefinite_Hashed_Maps
(Namet.Name_Id, Compiler_Description,
Hash_Case_Insensitive, Namet."=");
type Compiler_Filter is record
Name : Namet.Name_Id;
Version : Namet.Name_Id;
Version_Re : Pattern_Matcher_Access;
Runtime : Namet.Name_Id;
Runtime_Re : Pattern_Matcher_Access;
Language_LC : Namet.Name_Id;
end record;
-- Representation for a node (in )
package Compiler_Filter_Lists is new Ada.Containers.Doubly_Linked_Lists
(Compiler_Filter);
type Compilers_Filter is record
Compiler : Compiler_Filter_Lists.List;
Negate : Boolean := False;
end record;
No_Compilers_Filter : constant Compilers_Filter :=
(Compiler => Compiler_Filter_Lists.Empty_List,
Negate => False);
-- a filter, that matches if any of its child
-- matches.
package Compilers_Filter_Lists is new Ada.Containers.Doubly_Linked_Lists
(Compilers_Filter);
type Configuration is record
Compilers_Filters : Compilers_Filter_Lists.List;
Targets_Filters : String_Lists.List; -- these are regexps
Negate_Targets : Boolean := False;
Config : Namet.Name_Id;
Supported : Boolean;
-- Whether the combination of compilers is supported
end record;
package Configuration_Lists is new Ada.Containers.Doubly_Linked_Lists
(Configuration);
package Target_Lists is new Ada.Containers.Doubly_Linked_Lists
(Pattern_Matcher_Access);
type Target_Set_Description is record
Name : Namet.Name_Id;
Patterns : Target_Lists.List;
end record;
subtype Known_Targets_Set_Id
is Targets_Set_Id range 1 .. Targets_Set_Id'Last;
-- Known targets set. They are in the base
package Targets_Set_Vectors is new Ada.Containers.Vectors
(Known_Targets_Set_Id, Target_Set_Description, "=");
type Knowledge_Base is record
Compilers : Compiler_Description_Maps.Map;
No_Compilers : String_Lists.List;
Check_Executable_Regexp : Boolean := False;
Configurations : Configuration_Lists.List;
Targets_Sets : Targets_Set_Vectors.Vector;
end record;
-- Check_Executable_Regexp is set to True if at least some of the
-- executable names are specified as regular expressions. In such a case,
-- a slightly slower algorithm is used to search for compilers.
-- No_Compilers is the list of languages that require no compiler, and thus
-- should not be searched on the PATH.
end GprConfig.Knowledge;
gprbuild-gpl-2014-src/src/gprlib-build_shared_lib-vms.adb 0000644 0000767 0000145 00000005507 12323721731 022734 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R L I B . B U I L D _ S H A R E D _ L I B --
-- --
-- B o d y --
-- --
-- Copyright (C) 2006-2012, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with MLib.Tgt; use MLib.Tgt;
with MLib.Utl; use MLib.Utl;
separate (Gprlib)
procedure Build_Shared_Lib is
Ofiles : Argument_List (1 .. Object_Files.Last);
Options : Argument_List (1 .. Options_Table.Last);
begin
-- If runtime library directory is indicated, call Specify_Adalib_Dir so
-- that function MLib.Libgnat returns it. If we don't know what is the
-- runtime library directory, set it to the current directory so that
-- MLib.Libgnat does not fail.
if Runtime_Library_Dir /= null then
Specify_Adalib_Dir (Runtime_Library_Dir.all);
else
Specify_Adalib_Dir (".");
end if;
-- On VMS, use Build_Dynamic_Library to build the library as there is
-- specific handling of symbols.
for J in Ofiles'Range loop
Ofiles (J) := Object_Files.Table (J);
end loop;
for J in Options'Range loop
Options (J) := Options_Table.Table (J);
end loop;
Build_Dynamic_Library
(Ofiles => Ofiles,
Options => Options,
Interfaces => MLib.No_Argument_List,
Lib_Filename => Library_Name.all,
Lib_Dir => Library_Directory.all,
Symbol_Data => Prj.No_Symbols,
Lib_Version => Library_Version.all,
Driver_Name => Driver_Name,
Auto_Init => Auto_Init);
end Build_Shared_Lib;
gprbuild-gpl-2014-src/src/gpr_version.ads 0000644 0000767 0000145 00000003751 12323721731 017756 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R _ V E R S I O N --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- This package spec holds version information for the GPR tools.
-- It is updated whenever the release number is changed.
package GPR_Version is
Gpr_Version : constant String := "2014";
-- Static string identifying this version
function Gpr_Version_String return String;
-- Version output when GPRBUILD or its related tools, including
-- GPRCLEAN, are run (with appropriate verbose option switch set).
end GPR_Version;
gprbuild-gpl-2014-src/src/gprslave.ads 0000644 0000767 0000145 00000003101 12323721731 017231 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B U I L D . C O M P I L E --
-- --
-- B o d y --
-- --
-- Copyright (C) 2012, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
procedure Gprslave;
gprbuild-gpl-2014-src/src/gprbuild.adb 0000644 0000767 0000145 00000050356 12323721731 017213 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B U I L D --
-- --
-- B o d y --
-- --
-- Copyright (C) 2004-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with Output; use Output;
with Gpr_Util; use Gpr_Util;
package body Gprbuild is
package Processed_Projects is new GNAT.HTable.Simple_HTable
(Header_Num => Prj.Header_Num,
Element => Boolean,
No_Element => False,
Key => Name_Id,
Hash => Hash,
Equal => "=");
-- Projects that have already been processed
----------------
-- Add_Option --
----------------
procedure Add_Option
(Value : String;
To : in out Options_Data;
Display : Boolean;
Simple_Name : Boolean := False)
is
begin
Name_Len := Value'Length;
Name_Buffer (1 .. Name_Len) := Value;
Add_Option_Internal (Get_Option (Name_Find), To, Display, Simple_Name);
end Add_Option;
procedure Add_Option
(Value : Name_Id;
To : in out Options_Data;
Display : Boolean;
Simple_Name : Boolean := False)
is
begin
Add_Option_Internal (Get_Option (Value), To, Display, Simple_Name);
end Add_Option;
-------------------------
-- Add_Option_Internal --
-------------------------
procedure Add_Option_Internal
(Value : String_Access;
To : in out Options_Data;
Display : Boolean;
Simple_Name : Boolean := False)
is
begin
-- For compatibility with gnatmake, do not consider empty options
if Value'Length = 0 then
return;
end if;
To.Last := To.Last + 1;
if To.Last > To.Options'Last then
declare
New_Options : constant String_List_Access :=
new String_List (1 .. 2 * To.Options'Last);
New_Visible : constant Booleans :=
new Boolean_Array (1 .. 2 * To.Visible'Last);
New_Simple_Name : constant Booleans :=
new Boolean_Array (1 .. 2 * To.Visible'Last);
begin
New_Options (To.Options'Range) := To.Options.all;
To.Options.all := (others => null);
Free (To.Options);
To.Options := New_Options;
New_Visible (To.Visible'Range) := To.Visible.all;
Free (To.Visible);
To.Visible := New_Visible;
New_Simple_Name (To.Simple_Name'Range) := To.Simple_Name.all;
Free (To.Simple_Name);
To.Simple_Name := New_Simple_Name;
end;
end if;
To.Options (To.Last) := Value;
To.Visible (To.Last) := Display;
To.Simple_Name (To.Last) := Simple_Name;
end Add_Option_Internal;
----------------------------------
-- Add_Option_Internal_Codepeer --
----------------------------------
procedure Add_Option_Internal_Codepeer
(Value : String_Access;
To : in out Options_Data;
Display : Boolean;
Simple_Name : Boolean := False)
is
begin
if Value'Length <= 2
or else Value (Value'First .. Value'First + 1) /= "-m"
then
Add_Option_Internal (Value, To, Display, Simple_Name);
end if;
end Add_Option_Internal_Codepeer;
-----------------
-- Add_Options --
-----------------
procedure Add_Options
(Value : String_List_Id;
To : in out Options_Data;
Display_All : Boolean;
Display_First : Boolean;
Simple_Name : Boolean := False)
is
List : String_List_Id := Value;
Element : String_Element;
Option : String_Access;
First_Display : Boolean := Display_First;
begin
while List /= Nil_String loop
Element := Project_Tree.Shared.String_Elements.Table (List);
-- Ignore empty options
if Element.Value /= Empty_String then
Option := Get_Option (Element.Value);
Add_Option_Internal
(Value => Option,
To => To,
Display => Display_All or First_Display,
Simple_Name => Simple_Name);
First_Display := False;
end if;
List := Element.Next;
end loop;
end Add_Options;
-----------------
-- Add_Process --
-----------------
procedure Add_Process (Process : Process_Id; Data : Process_Data) is
begin
Process_Htable.Set (Process, Data);
Outstanding_Processes := Outstanding_Processes + 1;
end Add_Process;
--------------------
-- Archive_Suffix --
--------------------
function Archive_Suffix (For_Project : Project_Id) return String is
begin
if For_Project.Config.Archive_Suffix = No_File then
return ".a";
else
return Get_Name_String (For_Project.Config.Archive_Suffix);
end if;
end Archive_Suffix;
-------------------
-- Await_Process --
-------------------
procedure Await_Process (Data : out Process_Data; OK : out Boolean) is
Pid : Process_Id;
begin
loop
Data := No_Process_Data;
Wait_Process (Pid, OK);
if Pid = Invalid_Pid then
return;
end if;
Data := Process_Htable.Get (Pid);
if Data /= No_Process_Data then
Process_Htable.Set (Pid, No_Process_Data);
Outstanding_Processes := Outstanding_Processes - 1;
return;
end if;
end loop;
end Await_Process;
--------------------------------
-- Change_To_Object_Directory --
--------------------------------
procedure Change_To_Object_Directory (Project : Project_Id) is
begin
-- Nothing to do if the current working directory is already the correct
-- object directory.
if Project_Of_Current_Object_Directory /= Project then
Project_Of_Current_Object_Directory := Project;
-- Set the working directory to the object directory of the actual
-- project.
Change_Dir (Get_Name_String (Project.Object_Directory.Display_Name));
if Opt.Verbose_Mode and then Opt.Verbosity_Level > Opt.Low then
Write_Str ("Changing to object directory of """);
Write_Name (Project.Display_Name);
Write_Str (""": """);
Write_Name (Project.Object_Directory.Display_Name);
Write_Line ("""");
end if;
end if;
exception
-- Fail if unable to change to the object directory
when Directory_Error =>
Fail_Program
(Project_Tree,
"unable to change to object directory """ &
Get_Name_String (Project.Object_Directory.Display_Name) &
""" of project " &
Get_Name_String (Project.Display_Name));
end Change_To_Object_Directory;
---------------------------
-- Check_Archive_Builder --
---------------------------
procedure Check_Archive_Builder is
List : Name_List_Index;
begin
-- First, make sure that the archive builder (ar) is on the path
if Archive_Builder_Path = null then
List := Main_Project.Config.Archive_Builder;
if List = No_Name_List then
Fail_Program
(Project_Tree, "no archive builder in configuration");
else
Archive_Builder_Name :=
new String'(Get_Name_String
(Project_Tree.Shared.Name_Lists.Table
(List).Name));
Archive_Builder_Path :=
Locate_Exec_On_Path (Archive_Builder_Name.all);
if Archive_Builder_Path = null then
Fail_Program
(Project_Tree,
"unable to locate archive builder """ &
Archive_Builder_Name.all & '"');
end if;
loop
List := Project_Tree.Shared.Name_Lists.Table (List).Next;
exit when List = No_Name_List;
Add_Option
(Value => Project_Tree.Shared.Name_Lists.Table (List).Name,
To => Archive_Builder_Opts,
Display => True);
end loop;
List := Main_Project.Config.Archive_Builder_Append_Option;
while List /= No_Name_List loop
Add_Option
(Value => Project_Tree.Shared.Name_Lists.Table (List).Name,
To => Archive_Builder_Append_Opts,
Display => True);
List := Project_Tree.Shared.Name_Lists.Table (List).Next;
end loop;
-- If there is an archive indexer (ranlib), try to locate it on
-- the path. Don't fail if it is not found.
List := Main_Project.Config.Archive_Indexer;
if List /= No_Name_List then
Archive_Indexer_Name :=
new String'(Get_Name_String
(Project_Tree.Shared.Name_Lists.Table (List).Name));
Archive_Indexer_Path :=
Locate_Exec_On_Path (Archive_Indexer_Name.all);
if Archive_Builder_Path /= null then
loop
List := Project_Tree.Shared.Name_Lists.Table (List).Next;
exit when List = No_Name_List;
Add_Option
(Value =>
Project_Tree.Shared.Name_Lists.Table (List).Name,
To => Archive_Indexer_Opts,
Display => True);
end loop;
end if;
end if;
end if;
end if;
end Check_Archive_Builder;
---------------------------
-- Create_Path_From_Dirs --
---------------------------
function Create_Path_From_Dirs return String_Access is
Result : String_Access;
Tmp : String_Access;
Path_Last : Natural := 0;
begin
for Index in 1 .. Directories.Last loop
Get_Name_String (Directories.Table (Index));
while Name_Len > 1
and then (Name_Buffer (Name_Len) = Directory_Separator
or else Name_Buffer (Name_Len) = '/')
loop
Name_Len := Name_Len - 1;
end loop;
if Result = null then
Result := new String (1 .. Name_Len);
else
while Path_Last + Name_Len + 1 > Result'Last loop
Tmp := new String (1 .. 2 * Result'Length);
Tmp (1 .. Path_Last) := Result (1 .. Path_Last);
Free (Result);
Result := Tmp;
end loop;
Path_Last := Path_Last + 1;
Result (Path_Last) := Path_Separator;
end if;
Result (Path_Last + 1 .. Path_Last + Name_Len) :=
Name_Buffer (1 .. Name_Len);
Path_Last := Path_Last + Name_Len;
end loop;
if Current_Verbosity = High and then Result /= null then
Put_Line ("Path=" & Result (1 .. Path_Last));
end if;
Tmp := new String'(Result (1 .. Path_Last));
Free (Result);
return Tmp;
end Create_Path_From_Dirs;
-----------------------
-- Display_Processes --
-----------------------
procedure Display_Processes (Name : String) is
begin
if Opt.Maximum_Processes > 1
and then Opt.Verbose_Mode
and then Current_Verbosity = High
then
Write_Str (" ");
Write_Str (Outstanding_Processes'Img);
Write_Char (' ');
Write_Str (Name);
if Outstanding_Processes <= 1 then
Write_Line (" process");
else
Write_Line (" processes");
end if;
end if;
end Display_Processes;
----------------
-- Get_Option --
----------------
function Get_Option (Option : Name_Id) return String_Access is
Option_Name : constant String := Get_Name_String (Option);
begin
-- Look in All_Options if this option is already cached
for Index in 1 .. All_Options.Last loop
if All_Options.Options (Index).all = Option_Name then
return All_Options.Options (Index);
end if;
end loop;
-- Add the option to the All_Options cache, so that it will be found
-- next time.
Add_Option_Internal
(new String'(Option_Name),
To => All_Options,
Display => False);
return All_Options.Options (All_Options.Last);
end Get_Option;
----------
-- Hash --
----------
function Hash (Pid : Process_Id) return Header_Num is
Modulo : constant Integer := Integer (Header_Num'Last) + 1;
begin
return Header_Num (Pid_To_Integer (Pid) mod Modulo);
end Hash;
--------------------------------
-- Process_Imported_Libraries --
--------------------------------
procedure Process_Imported_Libraries
(For_Project : Project_Id;
There_Are_SALs : out Boolean;
And_Project_Itself : Boolean := False)
is
procedure Process_Project (Project : Project_Id; Is_Aggregate : Boolean);
-- Process Project and its imported projects recursively.
-- Add any library projects to table Library_Projs.
---------------------
-- Process_Project --
---------------------
procedure Process_Project
(Project : Project_Id; Is_Aggregate : Boolean)
is
Imported : Project_List := Project.Imported_Projects;
begin
-- Nothing to do if project has already been processed
if not Processed_Projects.Get (Project.Name) then
Processed_Projects.Set (Project.Name, True);
-- We first process the imported projects to guarantee that
-- We have a proper reverse order for the libraries. Do not add
-- library for encapsulated libraries dependencies except when
-- building the encapsulated library itself.
if For_Project.Standalone_Library = Encapsulated
or else Project.Standalone_Library /= Encapsulated
then
while Imported /= null loop
if Imported.Project /= No_Project then
Process_Project
(Imported.Project,
Is_Aggregate =>
(Project.Qualifier = Aggregate_Library)
or else Is_Aggregate);
end if;
Imported := Imported.Next;
end loop;
end if;
-- For an extending project, process the project being extended
if Project.Extends /= No_Project then
Process_Project (Project.Extends, Is_Aggregate => False);
end if;
-- If it is a library project, add it to Library_Projs
if (And_Project_Itself or else Project /= For_Project)
and then Project.Extended_By = No_Project
and then Project.Library
then
if Project.Standalone_Library /= No then
There_Are_SALs := True;
end if;
Library_Projs.Append
(Library_Project'
(Project,
Is_Aggregate and then not Project.Externally_Built));
end if;
end if;
end Process_Project;
-- Start of processing for Process_Imported_Libraries
begin
Processed_Projects.Reset;
Library_Projs.Init;
There_Are_SALs := False;
Process_Project (For_Project, Is_Aggregate => False);
end Process_Imported_Libraries;
------------------------------------
-- Process_Imported_Non_Libraries --
------------------------------------
procedure Process_Imported_Non_Libraries (For_Project : Project_Id) is
procedure Process_Project (Project : Project_Id);
-- Process Project and its imported projects recursively.
-- Add any non library project to table Non_Library_Projs.
---------------------
-- Process_Project --
---------------------
procedure Process_Project (Project : Project_Id) is
Imported : Project_List := Project.Imported_Projects;
begin
-- Nothing to do if project has already been processed
if not Processed_Projects.Get (Project.Name) then
Processed_Projects.Set (Project.Name, True);
-- Call Process_Project recursively for any imported project.
-- We first process the imported projects to guarantee that
-- we have a proper reverse order for the libraries.
while Imported /= null loop
if Imported.Project /= No_Project then
Process_Project (Imported.Project);
end if;
Imported := Imported.Next;
end loop;
-- For an extending project, process the project being extended
if Project.Extends /= No_Project then
Process_Project (Project.Extends);
end if;
-- If it is not a library project, add it to Non_Library_Projs
if Project /= For_Project
and then Project.Extended_By = No_Project
and then not Project.Library
then
Non_Library_Projs.Append (Project);
end if;
end if;
end Process_Project;
-- Start of processing for Process_Imported_Non_Libraries
begin
Processed_Projects.Reset;
Non_Library_Projs.Init;
Process_Project (For_Project);
end Process_Imported_Non_Libraries;
--------------------
-- Record_Failure --
--------------------
procedure Record_Failure (Main : Main_Info) is
begin
Bad_Processes.Append (Main);
if not Opt.Keep_Going then
Stop_Spawning := True;
end if;
end Record_Failure;
---------------------------
-- Test_If_Relative_Path --
---------------------------
procedure Test_If_Relative_Path
(Switch : in out String_Access;
Parent : String;
Including_Switch : Name_Id)
is
Original : constant String (1 .. Switch'Length) := Switch.all;
begin
if Original (1) = '-' and then Including_Switch /= No_Name then
declare
Inc_Switch : constant String := Get_Name_String (Including_Switch);
begin
if Original'Last > Inc_Switch'Last
and then Original (1 .. Inc_Switch'Last) = Inc_Switch
and then not Is_Absolute_Path
(Original (Inc_Switch'Last + 1 .. Original'Last))
then
Switch := new String'
(Inc_Switch & Parent & Directory_Separator &
Original (Inc_Switch'Last + 1 .. Original'Last));
end if;
end;
end if;
if Original (1) /= '-' and then not Is_Absolute_Path (Original) then
Switch := new String'(Parent & Directory_Separator & Original);
end if;
end Test_If_Relative_Path;
end Gprbuild;
gprbuild-gpl-2014-src/src/gprbuild-link.adb 0000644 0000767 0000145 00000311232 12323721731 020137 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B U I L D . L I N K --
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-2013, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation; use Ada;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with Debug; use Debug;
with Gpr_Util; use Gpr_Util;
with Gprexch; use Gprexch;
with Makeutl; use Makeutl;
with Osint; use Osint;
with Output; use Output;
with Prj.Util; use Prj.Util;
with Snames; use Snames;
package body Gprbuild.Link is
type Archive_Data is record
Checked : Boolean := False;
Has_Been_Built : Boolean := False;
Exists : Boolean := False;
end record;
type Source_Index_Rec is record
Project : Project_Id;
Id : Source_Id;
Found : Boolean := False;
end record;
-- Used as Source_Indexes component to check if archive needs to be rebuilt
type Source_Index_Array is array (Positive range <>) of Source_Index_Rec;
type Source_Indexes_Ref is access Source_Index_Array;
procedure Free is new Unchecked_Deallocation
(Source_Index_Array, Source_Indexes_Ref);
Initial_Source_Index_Count : constant Positive := 20;
Source_Indexes : Source_Indexes_Ref :=
new Source_Index_Array (1 .. Initial_Source_Index_Count);
-- A list of the Source_Ids, with an indication that they have been found
-- in the archive dependency file.
procedure Build_Global_Archive
(For_Project : Project_Id;
Project_Tree : Project_Tree_Ref;
Has_Been_Built : out Boolean;
Exists : out Boolean;
OK : out Boolean);
-- Build, if necessary, the global archive for a main project.
-- Out parameter Has_Been_Built is True iff the global archive has been
-- built/rebuilt. Exists is False if there is no need for a global archive.
-- OK is False when there is a problem building the global archive.
procedure Link_Main (Main_File : Main_Info);
-- Link a specific main unit
procedure Get_Linker_Options (For_Project : Project_Id);
-- Get the Linker_Options from a project
procedure Add_Rpath (Path : String);
-- Add a path name to Rpath
procedure Rpaths_Relative_To
(Exec_Dir : Path_Name_Type; Origin : Name_Id);
-- Change all paths in table Rpaths to paths relative to Exec_Dir, if they
-- have at least one non root directory in common.
function Is_In_Library_Project (Object_Path : String) return Boolean;
-- Return True if Object_Path is the path of an object file in a library
-- project.
procedure Display_Command
(Name : String;
Path : String_Access;
Ellipse : Boolean := False);
-- Display the command for a spawned process, if in Verbose_Mode or not in
-- Quiet_Output. In non verbose mode, when Ellipse is True, display "..."
-- in place of the first argument that has Display set to False.
procedure Add_Argument
(Arg : String_Access;
Display : Boolean;
Simple_Name : Boolean := False);
procedure Add_Argument
(Arg : String;
Display : Boolean;
Simple_Name : Boolean := False);
-- Add an argument to Arguments. Reallocate if necessary
procedure Add_Arguments
(Args : Argument_List;
Display : Boolean;
Simple_Name : Boolean := False);
-- Add a list of arguments to Arguments. Reallocate if necessary
No_Archive_Data : constant Archive_Data :=
(Checked => False,
Has_Been_Built => False,
Exists => False);
package Global_Archives_Built is new GNAT.HTable.Simple_HTable
(Header_Num => Prj.Header_Num,
Element => Archive_Data,
No_Element => No_Archive_Data,
Key => Name_Id,
Hash => Prj.Hash,
Equal => "=");
-- A hash table to record what global archives have been already built
package Cache_Args is new Table.Table
(Table_Component_Type => String_Access,
Table_Index_Type => Integer,
Table_Low_Bound => 1,
Table_Initial => 200,
Table_Increment => 100,
Table_Name => "Buildgpr.Cache_Args");
-- A table to cache arguments, to avoid multiple allocation of the same
-- strings. It is not possible to use a hash table, because String is
-- an unconstrained type.
package Rpaths is new Table.Table
(Table_Component_Type => String_Access,
Table_Index_Type => Integer,
Table_Low_Bound => 1,
Table_Initial => 200,
Table_Increment => 50,
Table_Name => "Makegpr.Rpaths");
-- Directories to be put in the run path option
package Library_Dirs is new GNAT.HTable.Simple_HTable
(Header_Num => Prj.Header_Num,
Element => Boolean,
No_Element => False,
Key => Path_Name_Type,
Hash => Hash,
Equal => "=");
-- A hash table to store the library dirs, to avoid repeating uselessly
-- the same switch when linking executables.
Last_Source : Natural := 0;
-- The index of the last valid component of Source_Indexes
Initial_Argument_Count : constant Positive := 20;
Arguments : Argument_List_Access :=
new Argument_List (1 .. Initial_Argument_Count);
-- Used to store lists of arguments to be used when spawning a process
Arguments_Displayed : Booleans :=
new Boolean_Array (1 .. Initial_Argument_Count);
-- For each argument in Arguments, indicate if the argument should be
-- displayed when procedure Display_Command is called.
Arguments_Simple_Name : Booleans :=
new Boolean_Array (1 .. Initial_Argument_Count);
-- For each argument that should be displayed, indicate that the argument
-- is a path name and that only the simple name should be displayed.
Last_Argument : Natural := 0;
-- Index of the last valid argument in Arguments
------------------
-- Add_Argument --
------------------
procedure Add_Argument
(Arg : String_Access;
Display : Boolean;
Simple_Name : Boolean := False)
is
begin
-- Nothing to do if no argument is specified or if argument is empty
if Arg /= null and then Arg'Length /= 0 then
-- Reallocate arrays if necessary
if Last_Argument = Arguments'Last then
declare
New_Arguments : constant Argument_List_Access :=
new Argument_List
(1 .. Last_Argument +
Initial_Argument_Count);
New_Arguments_Displayed : constant Booleans :=
new Boolean_Array
(1 .. Last_Argument +
Initial_Argument_Count);
New_Arguments_Simple_Name : constant Booleans :=
new Boolean_Array
(1 .. Last_Argument +
Initial_Argument_Count);
begin
New_Arguments (Arguments'Range) := Arguments.all;
-- To avoid deallocating the strings, nullify all components
-- of Arguments before calling Free.
Arguments.all := (others => null);
Free (Arguments);
Arguments := New_Arguments;
New_Arguments_Displayed (Arguments_Displayed'Range) :=
Arguments_Displayed.all;
Free (Arguments_Displayed);
Arguments_Displayed := New_Arguments_Displayed;
New_Arguments_Simple_Name (Arguments_Simple_Name'Range) :=
Arguments_Simple_Name.all;
Free (Arguments_Simple_Name);
Arguments_Simple_Name := New_Arguments_Simple_Name;
end;
end if;
-- Add the argument and its display indication
Last_Argument := Last_Argument + 1;
Arguments (Last_Argument) := Arg;
Arguments_Displayed (Last_Argument) := Display;
Arguments_Simple_Name (Last_Argument) := Simple_Name;
end if;
end Add_Argument;
procedure Add_Argument
(Arg : String;
Display : Boolean;
Simple_Name : Boolean := False)
is
Argument : String_Access := null;
begin
-- Nothing to do if argument is empty
if Arg'Length > 0 then
-- Check if the argument is already in the Cache_Args table. If it is
-- already there, reuse the allocated value.
for Index in 1 .. Cache_Args.Last loop
if Cache_Args.Table (Index).all = Arg then
Argument := Cache_Args.Table (Index);
exit;
end if;
end loop;
-- If the argument is not in the cache, create a new entry in the
-- cache.
if Argument = null then
Argument := new String'(Arg);
Cache_Args.Increment_Last;
Cache_Args.Table (Cache_Args.Last) := Argument;
end if;
-- And add the argument
Add_Argument (Argument, Display, Simple_Name);
end if;
end Add_Argument;
-------------------
-- Add_Arguments --
-------------------
procedure Add_Arguments
(Args : Argument_List;
Display : Boolean;
Simple_Name : Boolean := False)
is
begin
-- Reallocate the arrays, if necessary
if Last_Argument + Args'Length > Arguments'Last then
declare
New_Arguments : constant Argument_List_Access :=
new Argument_List
(1 .. Last_Argument + Args'Length +
Initial_Argument_Count);
New_Arguments_Displayed : constant Booleans :=
new Boolean_Array
(1 .. Last_Argument +
Args'Length +
Initial_Argument_Count);
begin
New_Arguments (1 .. Last_Argument) :=
Arguments (1 .. Last_Argument);
-- To avoid deallocating the strings, nullify all components
-- of Arguments before calling Free.
Arguments.all := (others => null);
Free (Arguments);
Arguments := New_Arguments;
New_Arguments_Displayed (1 .. Last_Argument) :=
Arguments_Displayed (1 .. Last_Argument);
Free (Arguments_Displayed);
Arguments_Displayed := New_Arguments_Displayed;
end;
end if;
-- Add the new arguments and the display indications
Arguments (Last_Argument + 1 .. Last_Argument + Args'Length) := Args;
Arguments_Displayed (Last_Argument + 1 .. Last_Argument + Args'Length) :=
(others => Display);
Arguments_Simple_Name (Last_Argument + 1 .. Last_Argument + Args'Length)
:= (others => Simple_Name);
Last_Argument := Last_Argument + Args'Length;
end Add_Arguments;
---------------
-- Add_Rpath --
---------------
procedure Add_Rpath (Path : String) is
begin
-- Nothing to do if Path is empty
if Path'Length > 0 then
-- Nothing to do if the directory is already in the Rpaths table
for J in 1 .. Rpaths.Last loop
if Rpaths.Table (J).all = Path then
return;
end if;
end loop;
Rpaths.Append (new String'(Path));
end if;
end Add_Rpath;
--------------------------
-- Build_Global_Archive --
--------------------------
procedure Build_Global_Archive
(For_Project : Project_Id;
Project_Tree : Project_Tree_Ref;
Has_Been_Built : out Boolean;
Exists : out Boolean;
OK : out Boolean)
is
Archive_Name : constant String :=
"lib"
& Get_Name_String (For_Project.Name)
& Archive_Suffix (For_Project);
-- The name of the archive file for this project
Archive_Dep_Name : constant String :=
"lib"
& Get_Name_String (For_Project.Name) & ".deps";
-- The name of the archive dependency file for this project
File : Prj.Util.Text_File;
Object_Path : Path_Name_Type;
Time_Stamp : Time_Stamp_Type;
First_Object : Natural;
Discard : Boolean;
Proj_List : Project_List;
Src_Id : Source_Id;
S_Id : Source_Id;
Success : Boolean;
Real_Last_Argument : Positive;
Current_Object_Pos : Positive;
Size : Natural;
Global_Archive_Data : Archive_Data;
Need_To_Build : Boolean;
procedure Add_Sources (Proj : Project_Id);
-- Add all the sources of project Proj to Sources_Index
procedure Add_Objects (Proj : Project_Id);
-- Add all the object paths of project Proj to Arguments
-----------------
-- Add_Sources --
-----------------
procedure Add_Sources (Proj : Project_Id) is
Project : Project_Id := Proj;
Id : Source_Id;
Iter : Source_Iterator;
procedure Add_Source_Id (Project : Project_Id; Id : Source_Id);
-- Add a source id to Source_Indexes, with Found set to False
-------------------
-- Add_Source_Id --
-------------------
procedure Add_Source_Id (Project : Project_Id; Id : Source_Id) is
begin
-- Reallocate the array, if necessary
if Last_Source = Source_Indexes'Last then
declare
New_Indexes : constant Source_Indexes_Ref :=
new Source_Index_Array
(1 .. Source_Indexes'Last +
Initial_Source_Index_Count);
begin
New_Indexes (Source_Indexes'Range) := Source_Indexes.all;
Free (Source_Indexes);
Source_Indexes := New_Indexes;
end;
end if;
Last_Source := Last_Source + 1;
Source_Indexes (Last_Source) := (Project, Id, False);
end Add_Source_Id;
begin
while Project /= No_Project loop
Iter := For_Each_Source (Project_Tree, Project);
loop
Id := Prj.Element (Iter);
exit when Id = No_Source;
if Is_Compilable (Id)
and then Id.Kind = Impl
and then Id.Unit = No_Unit_Index
then
Add_Source_Id (Proj, Id);
end if;
Next (Iter);
end loop;
Project := Project.Extends;
end loop;
end Add_Sources;
-----------------
-- Add_Objects --
-----------------
procedure Add_Objects (Proj : Project_Id) is
Project : Project_Id := Proj;
Id : Source_Id;
Iter : Source_Iterator;
begin
loop
if Project.Object_Directory /= No_Path_Information then
if Project.Externally_Built then
-- If project is externally built, include all object files
-- in the object directory in the global archive.
declare
Obj_Dir : constant String :=
Get_Name_String
(Project.Object_Directory.Display_Name);
Dir_Obj : Dir_Type;
begin
if Is_Regular_File (Obj_Dir) then
Open (Dir_Obj, Obj_Dir);
loop
Read (Dir_Obj, Name_Buffer, Name_Len);
exit when Name_Len = 0;
Canonical_Case_File_Name
(Name_Buffer (1 .. Name_Len));
if Name_Len > Object_Suffix'Length
and then
Name_Buffer
(Name_Len - Object_Suffix'Length + 1
.. Name_Len) = Object_Suffix
then
Add_Argument
(Obj_Dir & Directory_Separator &
Name_Buffer (1 .. Name_Len),
Opt.Verbose_Mode,
Simple_Name => not Opt.Verbose_Mode);
end if;
end loop;
Close (Dir_Obj);
end if;
end;
else
Iter := For_Each_Source (Project_Tree, Project);
loop
Id := Prj.Element (Iter);
exit when Id = No_Source;
if Object_To_Global_Archive (Id) then
-- The source record may not be initialized if
-- gprbuild was called with the switch -l.
Initialize_Source_Record (Id);
Add_Argument
(Get_Name_String (Id.Object_Path),
Opt.Verbose_Mode,
Simple_Name => not Opt.Verbose_Mode);
end if;
Next (Iter);
end loop;
end if;
end if;
Project := Project.Extends;
exit when Project = No_Project;
end loop;
end Add_Objects;
begin
Exists := False;
Has_Been_Built := False;
OK := True;
-- No need to build the global archive, if it has already been done
if For_Project.Object_Directory /= No_Path_Information then
Global_Archive_Data :=
Global_Archives_Built.Get (Name_Id (For_Project.Path.Name));
if Global_Archive_Data.Checked then
Exists := Global_Archive_Data.Exists;
Has_Been_Built := Global_Archive_Data.Has_Been_Built;
else
Change_To_Object_Directory (For_Project);
-- Put all non Ada sources in the project tree in Source_Indexes
Last_Source := 0;
Add_Sources (For_Project);
Proj_List := For_Project.All_Imported_Projects;
while Proj_List /= null loop
if not Proj_List.Project.Library then
Add_Sources (Proj_List.Project);
end if;
Proj_List := Proj_List.Next;
end loop;
Need_To_Build := Opt.Force_Compilations;
if not Need_To_Build then
if Opt.Verbose_Mode then
Write_Str (" Checking ");
Write_Str (Archive_Name);
Write_Line (" ...");
end if;
-- If the archive does not exist, of course it needs to be
-- built.
if not Is_Regular_File (Archive_Name) then
Need_To_Build := True;
if Opt.Verbose_Mode then
Write_Line (" -> archive does not exist");
end if;
else
-- Archive does exist
-- Check the archive dependency file
Open (File, Archive_Dep_Name);
-- If the archive dependency file does not exist, we need to
-- to rebuild the archive and to create its dependency file.
if not Is_Valid (File) then
Need_To_Build := True;
if Opt.Verbose_Mode then
Write_Str (" -> archive dependency file ");
Write_Str (Archive_Dep_Name);
Write_Line (" does not exist");
end if;
else
-- Read the dependency file, line by line
while not End_Of_File (File) loop
Get_Line (File, Name_Buffer, Name_Len);
-- First line is the path of the object file
Object_Path := Name_Find;
Src_Id := No_Source;
-- Check if this object file is for a source of this
-- project.
for S in 1 .. Last_Source loop
S_Id := Source_Indexes (S).Id;
if not Source_Indexes (S).Found
and then S_Id.Object_Path = Object_Path
then
-- We have found the object file: get the
-- source data, and mark it as found.
Src_Id := S_Id;
Source_Indexes (S).Found := True;
exit;
end if;
end loop;
-- If it is not for a source of this project, then the
-- archive needs to be rebuilt.
if Src_Id = No_Source then
Need_To_Build := True;
if Opt.Verbose_Mode then
Write_Str (" -> ");
Write_Str (Get_Name_String (Object_Path));
Write_Line (" is not an object of any project");
end if;
exit;
end if;
-- The second line is the time stamp of the object
-- file. If there is no next line, then the dependency
-- file is truncated, and the archive need to be
-- rebuilt.
if End_Of_File (File) then
Need_To_Build := True;
if Opt.Verbose_Mode then
Write_Str (" -> archive dependency file ");
Write_Line (" is truncated");
end if;
exit;
end if;
Get_Line (File, Name_Buffer, Name_Len);
-- If the line has the wrong number of characters,
-- then the dependency file is incorrectly formatted,
-- and the archive needs to be rebuilt.
if Name_Len /= Time_Stamp_Length then
Need_To_Build := True;
if Opt.Verbose_Mode then
Write_Str (" -> archive dependency file ");
Write_Line
(" is incorrectly formatted (time stamp)");
end if;
exit;
end if;
Time_Stamp :=
Time_Stamp_Type (Name_Buffer (1 .. Name_Len));
-- If the time stamp in the dependency file is
-- different from the time stamp of the object file,
-- then the archive needs to be rebuilt. The
-- comparaison is done with String type values,
-- because two values of type Time_Stamp_Type are
-- equal if they differ by 2 seconds or less; here the
-- check is for an exact match.
if String (Time_Stamp) /=
String (Src_Id.Object_TS)
then
Need_To_Build := True;
if Opt.Verbose_Mode then
Write_Str (" -> time stamp of ");
Write_Str (Get_Name_String (Object_Path));
Write_Str (" is incorrect in the archive");
Write_Line (" dependency file");
Write_Str (" recorded time stamp: ");
Write_Line (String (Time_Stamp));
Write_Str (" actual time stamp: ");
Write_Line (String (Src_Id.Object_TS));
end if;
exit;
elsif Debug_Flag_T then
Write_Str (" -> time stamp of ");
Write_Str (Get_Name_String (Object_Path));
Write_Str (" is correct in the archive");
Write_Line (" dependency file");
Write_Str (" recorded time stamp: ");
Write_Line (String (Time_Stamp));
Write_Str (" actual time stamp: ");
Write_Line (String (Src_Id.Object_TS));
end if;
end loop;
Close (File);
end if;
end if;
end if;
if not Need_To_Build then
for S in 1 .. Last_Source loop
if not Source_Indexes (S).Found
and then Object_To_Global_Archive (Source_Indexes (S).Id)
then
Need_To_Build := True;
if Opt.Verbose_Mode then
Write_Str (" -> object file ");
Write_Str (Get_Name_String
(Source_Indexes (S).Id.Object_Path));
Write_Line (" is not in the dependency file");
end if;
exit;
end if;
end loop;
end if;
if not Need_To_Build then
if Opt.Verbose_Mode then
Write_Line (" -> up to date");
end if;
Exists := True;
Has_Been_Built := False;
-- Archive needs to be rebuilt
else
Check_Archive_Builder;
-- If archive already exists, first delete it, but if this is
-- not possible, continue: if archive cannot be built, we will
-- fail later on.
if Is_Regular_File (Archive_Name) then
Delete_File (Archive_Name, Discard);
end if;
Last_Argument := 0;
-- Start with the minimal options
Add_Arguments
(Archive_Builder_Opts.Options
(1 .. Archive_Builder_Opts.Last),
True);
-- Followed by the archive name
Add_Argument
(Archive_Name, True, Simple_Name => not Opt.Verbose_Mode);
First_Object := Last_Argument + 1;
-- Followed by all the object files of the non library projects
Add_Objects (For_Project);
Proj_List := For_Project.All_Imported_Projects;
while Proj_List /= null loop
if not Proj_List.Project.Library then
Add_Objects (Proj_List.Project);
end if;
Proj_List := Proj_List.Next;
end loop;
-- No global archive, if there is no object file to put into
if Last_Argument < First_Object then
Has_Been_Built := False;
Exists := False;
if Opt.Verbose_Mode then
Write_Line (" -> there is no global archive");
end if;
else
Real_Last_Argument := Last_Argument;
-- If there is an Archive_Builder_Append_Option, we may have
-- to build the archive in chuck.
if Archive_Builder_Append_Opts.Last = 0 then
Current_Object_Pos := Real_Last_Argument + 1;
else
Size := 0;
for J in 1 .. First_Object - 1 loop
Size := Size + Arguments (J)'Length + 1;
end loop;
Current_Object_Pos := First_Object;
while Current_Object_Pos <= Real_Last_Argument loop
Size :=
Size + Arguments (Current_Object_Pos)'Length + 1;
exit when Size > Maximum_Size;
Current_Object_Pos := Current_Object_Pos + 1;
end loop;
Last_Argument := Current_Object_Pos - 1;
end if;
Display_Command
(Archive_Builder_Name.all,
Archive_Builder_Path,
Ellipse => True);
Spawn
(Archive_Builder_Path.all,
Arguments (1 .. Last_Argument),
Success);
-- If the archive has not been built completely, add the
-- remaining chunks.
if Success
and then Current_Object_Pos <= Real_Last_Argument
then
Last_Argument := 0;
Add_Arguments
(Archive_Builder_Append_Opts.Options
(1 .. Archive_Builder_Append_Opts.Last),
True);
Add_Argument
(Archive_Name, True,
Simple_Name => not Opt.Verbose_Mode);
First_Object := Last_Argument + 1;
while Current_Object_Pos <= Real_Last_Argument loop
Size := 0;
for J in 1 .. First_Object - 1 loop
Size := Size + Arguments (J)'Length + 1;
end loop;
Last_Argument := First_Object - 1;
while Current_Object_Pos <= Real_Last_Argument loop
Size :=
Size + Arguments (Current_Object_Pos)'Length + 1;
exit when Size > Maximum_Size;
Last_Argument := Last_Argument + 1;
Arguments (Last_Argument) :=
Arguments (Current_Object_Pos);
Current_Object_Pos := Current_Object_Pos + 1;
end loop;
Display_Command
(Archive_Builder_Name.all,
Archive_Builder_Path,
Ellipse => True);
Spawn
(Archive_Builder_Path.all,
Arguments (1 .. Last_Argument),
Success);
exit when not Success;
end loop;
end if;
-- If the archive was built, run the archive indexer
-- (ranlib) if there is one.
if Success then
-- If the archive was built, run the archive indexer
-- (ranlib), if there is one.
if Archive_Indexer_Path /= null then
Last_Argument := 0;
Add_Arguments
(Archive_Indexer_Opts.Options
(1 .. Archive_Indexer_Opts.Last),
True);
Add_Argument
(Archive_Name,
True,
Simple_Name => not Opt.Verbose_Mode);
Display_Command
(Archive_Indexer_Name.all, Archive_Indexer_Path);
Spawn
(Archive_Indexer_Path.all,
Arguments (1 .. Last_Argument),
Success);
if not Success then
-- Running the archive indexer failed, delete the
-- dependency file, if it exists.
if Is_Regular_File (Archive_Dep_Name) then
Delete_File (Archive_Dep_Name, Success);
end if;
end if;
end if;
end if;
if Success then
-- The archive was correctly built, create its dependency
-- file.
declare
Dep_File : Text_IO.File_Type;
begin
-- Create the file in Append mode, to avoid automatic
-- insertion of an end of line if file is empty.
Create (Dep_File, Append_File, Archive_Dep_Name);
for S in 1 .. Last_Source loop
Src_Id := Source_Indexes (S).Id;
if Object_To_Global_Archive (Src_Id) then
Put_Line
(Dep_File,
Get_Name_String (Src_Id.Object_Path));
Put_Line (Dep_File, String (Src_Id.Object_TS));
end if;
end loop;
Close (Dep_File);
exception
when others =>
if Is_Open (Dep_File) then
Close (Dep_File);
end if;
end;
Has_Been_Built := True;
Exists := True;
else
-- Building the archive failed, delete dependency file if
-- one exists.
if Is_Regular_File (Archive_Dep_Name) then
Delete_File (Archive_Dep_Name, Success);
end if;
Write_Str ("global archive for project ");
Write_Str
(Get_Name_String (For_Project.Display_Name));
Write_Line (" could not be built");
OK := False;
return;
end if;
end if;
end if;
Global_Archives_Built.Set
(Name_Id (For_Project.Path.Name),
(Checked => True,
Has_Been_Built => Has_Been_Built,
Exists => Exists));
end if;
end if;
end Build_Global_Archive;
---------------------
-- Display_Command --
---------------------
procedure Display_Command
(Name : String;
Path : String_Access;
Ellipse : Boolean := False)
is
Display_Ellipse : Boolean := Ellipse;
begin
-- Only display the command in Verbose Mode (-v) or when
-- not in Quiet Output (no -q).
if not Opt.Quiet_Output then
-- In Verbose Mode output the full path of the spawned process
if Opt.Verbose_Mode then
Write_Str (Path.all);
elsif Executable_Suffix'Length > 0
and then Name'Length > Executable_Suffix'Length
then
Name_Len := Name'Length;
Name_Buffer (1 .. Name_Len) := Name;
if Name_Buffer
(Name_Len - Executable_Suffix'Length + 1 .. Name_Len) =
Executable_Suffix.all
then
Name_Len := Name_Len - Executable_Suffix'Length;
end if;
Put (Base_Name (Name_Buffer (1 .. Name_Len)));
else
Write_Str (Base_Name (Name));
end if;
-- Display only the arguments for which the display flag is set
-- (in Verbose Mode, the display flag is set for all arguments)
for Arg in 1 .. Last_Argument loop
if Arguments_Displayed (Arg) then
Write_Char (' ');
if Arguments_Simple_Name (Arg) then
Write_Str (Base_Name (Arguments (Arg).all));
else
Write_Str (Arguments (Arg).all);
end if;
elsif Display_Ellipse then
Write_Str (" ...");
Display_Ellipse := False;
end if;
end loop;
Write_Eol;
end if;
end Display_Command;
------------------------
-- Get_Linker_Options --
------------------------
procedure Get_Linker_Options (For_Project : Project_Id) is
Linker_Lib_Dir_Option : String_Access;
Linker_Lib_Name_Option : String_Access;
procedure Recursive_Add
(Proj : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean);
-- The recursive routine used to add linker options
-------------------
-- Recursive_Add --
-------------------
procedure Recursive_Add
(Proj : Project_Id;
Tree : Project_Tree_Ref;
Dummy : in out Boolean)
is
pragma Unreferenced (Dummy);
Linker_Package : Package_Id;
Options : Variable_Value;
begin
if Proj /= For_Project then
Linker_Package :=
Prj.Util.Value_Of
(Name => Name_Linker,
In_Packages => Proj.Decl.Packages,
Shared => Tree.Shared);
Options :=
Prj.Util.Value_Of
(Name => Name_Ada,
Index => 0,
Attribute_Or_Array_Name => Name_Linker_Options,
In_Package => Linker_Package,
Shared => Tree.Shared);
-- If attribute is present, add the project with
-- the attribute to table Linker_Opts.
if Options /= Nil_Variable_Value then
Linker_Opts.Increment_Last;
Linker_Opts.Table (Linker_Opts.Last) :=
(Project => Proj, Options => Options.Values);
end if;
end if;
end Recursive_Add;
procedure For_All_Projects is
new For_Every_Project_Imported (Boolean, Recursive_Add);
Dummy : Boolean := False;
-- Start of processing for Get_Linker_Options
begin
if For_Project.Config.Linker_Lib_Dir_Option = No_Name then
Linker_Lib_Dir_Option := new String'("-L");
else
Linker_Lib_Dir_Option :=
new String'
(Get_Name_String (For_Project.Config.Linker_Lib_Dir_Option));
end if;
if For_Project.Config.Linker_Lib_Name_Option = No_Name then
Linker_Lib_Name_Option := new String'("-l");
else
Linker_Lib_Name_Option :=
new String'
(Get_Name_String (For_Project.Config.Linker_Lib_Name_Option));
end if;
Linker_Opts.Init;
For_All_Projects
(For_Project, Project_Tree, Dummy, Imported_First => True);
for Index in reverse 1 .. Linker_Opts.Last loop
declare
Options : String_List_Id := Linker_Opts.Table (Index).Options;
Proj : constant Project_Id :=
Linker_Opts.Table (Index).Project;
Option : Name_Id;
Dir_Path : constant String :=
Get_Name_String (Proj.Directory.Display_Name);
begin
while Options /= Nil_String loop
Option :=
Project_Tree.Shared.String_Elements.Table (Options).Value;
Get_Name_String (Option);
-- Do not consider empty linker options
if Name_Len /= 0 then
-- Object files and -L switches specified with relative
-- paths must be converted to absolute paths.
if Name_Len > Linker_Lib_Dir_Option'Length
and then
Name_Buffer (1 .. Linker_Lib_Dir_Option'Length) =
Linker_Lib_Dir_Option.all
then
if Is_Absolute_Path
(Name_Buffer
(Linker_Lib_Dir_Option'Length + 1 .. Name_Len))
then
Add_Argument (Name_Buffer (1 .. Name_Len), True);
else
Add_Argument
(Linker_Lib_Dir_Option.all &
Dir_Path &
Directory_Separator &
Name_Buffer
(Linker_Lib_Dir_Option'Length + 1 .. Name_Len),
True);
end if;
elsif (Name_Len > Linker_Lib_Name_Option'Length
and then
Name_Buffer (1 .. Linker_Lib_Name_Option'Length) =
Linker_Lib_Name_Option.all)
or else
Name_Buffer (1) = '-'
or else
Is_Absolute_Path (Name_Buffer (1 .. Name_Len))
then
Add_Argument (Name_Buffer (1 .. Name_Len), True);
else
Add_Argument
(Dir_Path &
Directory_Separator &
Name_Buffer (1 .. Name_Len),
True,
Simple_Name => True);
end if;
end if;
Options :=
Project_Tree.Shared.String_Elements.Table (Options).Next;
end loop;
end;
end loop;
end Get_Linker_Options;
---------------------------
-- Is_In_Library_Project --
---------------------------
function Is_In_Library_Project (Object_Path : String) return Boolean is
Path_Id : constant Path_Name_Type := Create_Name (Object_Path);
Src : Source_Id;
Iter : Source_Iterator;
begin
Iter := For_Each_Source (Project_Tree);
loop
Src := Prj.Element (Iter);
exit when Src = No_Source;
if Src.Object_Path = Path_Id then
return Src.Project.Library;
end if;
Next (Iter);
end loop;
return False;
end Is_In_Library_Project;
------------------------
-- Rpaths_Relative_To --
------------------------
procedure Rpaths_Relative_To
(Exec_Dir : Path_Name_Type;
Origin : Name_Id)
is
Exec : String :=
Normalize_Pathname
(Get_Name_String (Exec_Dir),
Case_Sensitive => False);
Last_Exec : Positive;
Curr_Exec : Positive;
Last_Path : Positive;
Curr_Path : Positive;
Nmb : Natural;
Origin_Name : constant String := Get_Name_String (Origin);
begin
-- Replace all directory separators with '/' to ease search
if Directory_Separator /= '/' then
for J in Exec'Range loop
if Exec (J) = Directory_Separator then
Exec (J) := '/';
end if;
end loop;
end if;
for Npath in 1 .. Rpaths.Last loop
declare
Insensitive_Path : String :=
Normalize_Pathname
(Rpaths.Table (Npath).all,
Case_Sensitive => False);
Path : constant String :=
Normalize_Pathname (Rpaths.Table (Npath).all);
begin
-- Replace all directory separators with '/' to ease search
if Directory_Separator /= '/' then
for J in Insensitive_Path'Range loop
if Insensitive_Path (J) = Directory_Separator then
Insensitive_Path (J) := '/';
end if;
end loop;
end if;
-- Find the number of common directories between the path and the
-- exec directory.
Nmb := 0;
Curr_Path := Insensitive_Path'First;
Curr_Exec := Exec'First;
loop
exit when
Curr_Path > Insensitive_Path'Last
or else Curr_Exec > Exec'Last
or else Insensitive_Path (Curr_Path) /= Exec (Curr_Exec);
if Insensitive_Path (Curr_Path) = '/' then
Nmb := Nmb + 1;
Last_Path := Curr_Path;
Last_Exec := Curr_Exec;
elsif Curr_Exec = Exec'Last
and then Curr_Path > Insensitive_Path'Last
then
Nmb := Nmb + 1;
Last_Path := Curr_Path + 1;
Last_Exec := Curr_Exec + 1;
exit;
end if;
Curr_Path := Curr_Path + 1;
Curr_Exec := Curr_Exec + 1;
end loop;
-- If there is more than one common directories (the root
-- directory does not count), then change the absolute path to a
-- relative path.
if Nmb > 1 then
Nmb := 0;
for J in Last_Exec .. Exec'Last - 1 loop
if Exec (J) = '/' then
Nmb := Nmb + 1;
end if;
end loop;
if Nmb = 0 then
if Last_Path >= Path'Last then
-- Case of the path being the exec dir
Rpaths.Table (Npath) :=
new String'(Origin_Name & Directory_Separator & ".");
else
-- Case of the path being a subdir of the exec dir
Rpaths.Table (Npath) :=
new String'
(Origin_Name & Directory_Separator &
Path (Last_Path + 1 .. Path'Last));
end if;
else
if Last_Path >= Path'Last then
-- Case of the exec dir being a subdir of the path
Rpaths.Table (Npath) :=
new String'
(Origin_Name & Directory_Separator &
(Nmb - 1) * (".." & Directory_Separator) & "..");
else
-- General case of path and exec dir having a common root
Rpaths.Table (Npath) :=
new String'
(Origin_Name & Directory_Separator &
Nmb * (".." & Directory_Separator) &
Path (Last_Path + 1 .. Path'Last));
end if;
end if;
end if;
end;
end loop;
end Rpaths_Relative_To;
---------------
-- Link_Main --
---------------
procedure Link_Main (Main_File : Main_Info) is
function Global_Archive_Name (For_Project : Project_Id) return String;
-- Returns the name of the global archive for a project
Linker_Name : String_Access := null;
Linker_Path : String_Access;
Min_Linker_Opts : Name_List_Index;
Exchange_File : Text_IO.File_Type;
Line : String (1 .. 1_000);
Last : Natural;
-- Success : Boolean := False;
Section : Binding_Section := No_Binding_Section;
Linker_Needs_To_Be_Called : Boolean;
Executable_TS : Time_Stamp_Type;
Main_Object_TS : Time_Stamp_Type;
Binder_Exchange_TS : Time_Stamp_Type;
Binder_Object_TS : Time_Stamp_Type := Dummy_Time_Stamp;
Global_Archive_TS : Time_Stamp_Type;
Global_Archive_Has_Been_Built : Boolean;
Global_Archive_Exists : Boolean;
OK : Boolean;
Disregard : Boolean;
B_Data : Binding_Data;
-- Main already has the right canonical casing
Main : constant String := Get_Name_String (Main_File.File);
Main_Source : constant Source_Id := Main_File.Source;
Main_Id : File_Name_Type;
Exec_Name : File_Name_Type;
Exec_Path_Name : Path_Name_Type;
Main_Proj : Project_Id;
Main_Base_Name_Index : File_Name_Type;
First_Object_Index : Natural := 0;
Last_Object_Index : Natural := 0;
Index_Separator : Character;
Response_File_Name : Path_Name_Type := No_Path;
Response_2 : Path_Name_Type := No_Path;
-------------------------
-- Global_Archive_Name --
-------------------------
function Global_Archive_Name (For_Project : Project_Id) return String is
begin
return
"lib" &
Get_Name_String (For_Project.Name) &
Archive_Suffix (For_Project);
end Global_Archive_Name;
begin
-- Make sure that the table Rpaths is emptied after each main, so
-- that the same rpaths are not duplicated.
Rpaths.Set_Last (0);
Linker_Needs_To_Be_Called := Opt.Force_Compilations;
Main_Id := Create_Name (Base_Name (Main));
Main_Proj := Ultimate_Extending_Project_Of (Main_Source.Project);
Change_To_Object_Directory (Main_Proj);
-- Build the global archive for this project, if needed
Build_Global_Archive
(Main_Proj,
Main_File.Tree,
Global_Archive_Has_Been_Built,
Global_Archive_Exists,
OK);
if not OK then
Stop_Spawning := True;
Bad_Processes.Append (Main_File);
return;
end if;
-- Get the main base name
Index_Separator :=
Main_Source.Language.Config.Multi_Unit_Object_Separator;
Main_Base_Name_Index :=
Base_Name_Index_For (Main, Main_File.Index, Index_Separator);
if not Linker_Needs_To_Be_Called and then Opt.Verbose_Mode then
Write_Str (" Checking executable for ");
Write_Str (Get_Name_String (Main_Source.File));
Write_Line (" ...");
end if;
if Output_File_Name /= null then
Name_Len := 0;
Add_Str_To_Name_Buffer (Output_File_Name.all);
Exec_Name := Name_Find;
else
Exec_Name := Executable_Of
(Project => Main_Proj,
Shared => Main_File.Tree.Shared,
Main => Main_Id,
Index => Main_Source.Index,
Ada_Main => False,
Language => Get_Name_String (Main_Source.Language.Name));
end if;
if Main_Proj.Exec_Directory = Main_Proj.Object_Directory then
Exec_Path_Name := Path_Name_Type (Exec_Name);
else
Get_Name_String (Main_Proj.Exec_Directory.Display_Name);
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := Directory_Separator;
Add_Str_To_Name_Buffer (Get_Name_String (Exec_Name));
Exec_Path_Name := Name_Find;
end if;
Executable_TS := File_Stamp (Exec_Path_Name);
if not Linker_Needs_To_Be_Called
and then Executable_TS = Empty_Time_Stamp
then
Linker_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line (" -> executable does not exist");
end if;
end if;
-- Get the path of the linker driver
if Main_Proj.Config.Linker /= No_Path then
Linker_Name := new String'(Get_Name_String (Main_Proj.Config.Linker));
Linker_Path := Locate_Exec_On_Path (Linker_Name.all);
if Linker_Path = null then
Fail_Program
(Main_File.Tree,
"unable to find linker " & Linker_Name.all);
end if;
else
Fail_Program
(Main_File.Tree,
"no linker specified and " &
"no default linker in the configuration");
end if;
Last_Argument := 0;
Initialize_Source_Record (Main_Source);
Main_Object_TS := File_Stamp (File_Name_Type (Main_Source.Object_Path));
if not Linker_Needs_To_Be_Called then
if Main_Object_TS = Empty_Time_Stamp then
if Opt.Verbose_Mode then
Write_Line (" -> main object does not exist");
end if;
Linker_Needs_To_Be_Called := True;
elsif String (Main_Object_TS) > String (Executable_TS) then
if Opt.Verbose_Mode then
Write_Line
(" -> main object more recent than executable");
end if;
Linker_Needs_To_Be_Called := True;
end if;
end if;
if Main_Object_TS = Empty_Time_Stamp then
Write_Str ("main object for ");
Write_Str (Get_Name_String (Main_Source.File));
Write_Line (" does not exist");
Record_Failure (Main_File);
return;
end if;
if Main_Proj = Main_Source.Object_Project then
Add_Argument (Get_Name_String (Main_Source.Object), True);
else
Add_Argument (Get_Name_String (Main_Source.Object_Path), True);
end if;
-- Add the Leading_Switches if there are any in package Linker
declare
The_Packages : constant Package_Id :=
Main_Proj.Decl.Packages;
Linker_Package : constant Prj.Package_Id :=
Prj.Util.Value_Of
(Name => Name_Linker,
In_Packages => The_Packages,
Shared => Main_File.Tree.Shared);
Switches : Variable_Value;
Switch_List : String_List_Id;
Element : String_Element;
begin
if Linker_Package /= No_Package then
declare
Switches_Array : constant Array_Element_Id :=
Prj.Util.Value_Of
(Name => Name_Leading_Switches,
In_Arrays =>
Main_File.Tree.Shared.Packages.Table
(Linker_Package).Decl.Arrays,
Shared => Main_File.Tree.Shared);
Option : String_Access;
begin
Switches :=
Prj.Util.Value_Of
(Index => Name_Id (Main_Id),
Src_Index => 0,
In_Array => Switches_Array,
Shared => Main_File.Tree.Shared);
if Switches = Nil_Variable_Value then
Switches :=
Prj.Util.Value_Of
(Index =>
Main_Source.Language.Name,
Src_Index => 0,
In_Array => Switches_Array,
Shared => Main_File.Tree.Shared,
Force_Lower_Case_Index => True);
end if;
if Switches = Nil_Variable_Value then
Switches :=
Prj.Util.Value_Of
(Index => All_Other_Names,
Src_Index => 0,
In_Array => Switches_Array,
Shared => Main_File.Tree.Shared,
Force_Lower_Case_Index => True);
end if;
case Switches.Kind is
when Undefined | Single =>
null;
when Prj.List =>
Switch_List := Switches.Values;
while Switch_List /= Nil_String loop
Element :=
Main_File.Tree.Shared.String_Elements.Table
(Switch_List);
Get_Name_String (Element.Value);
if Name_Len > 0 then
Option :=
new String'(Name_Buffer (1 .. Name_Len));
Add_Argument (Option.all, True);
end if;
Switch_List := Element.Next;
end loop;
end case;
end;
end if;
end;
Find_Binding_Languages (Main_File.Tree, Main_File.Project);
if Builder_Data (Main_File.Tree).There_Are_Binder_Drivers then
First_Object_Index := Last_Argument + 1;
Binding_Options.Init;
B_Data := Builder_Data (Main_File.Tree).Binding;
while B_Data /= null loop
declare
Exchange_File_Name : constant String :=
Binder_Exchange_File_Name
(Main_Base_Name_Index,
B_Data.Binder_Prefix).all;
begin
if Is_Regular_File (Exchange_File_Name) then
Binder_Exchange_TS :=
File_Stamp
(Path_Name_Type'(Create_Name
(Exchange_File_Name)));
if not Linker_Needs_To_Be_Called
and then
String (Binder_Exchange_TS) > String (Executable_TS)
then
Linker_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Str (" -> binder exchange file """);
Write_Str (Exchange_File_Name);
Write_Line (""" is more recent than executable");
end if;
end if;
Open (Exchange_File, In_File, Exchange_File_Name);
while not End_Of_File (Exchange_File) loop
Get_Line (Exchange_File, Line, Last);
if Last > 0 then
if Line (1) = '[' then
Section :=
Get_Binding_Section (Line (1 .. Last));
else
case Section is
when Generated_Object_File =>
Binder_Object_TS :=
File_Stamp
(Path_Name_Type'
(Create_Name
(Line (1 .. Last))));
Add_Argument
(Line (1 .. Last), Opt.Verbose_Mode);
when Bound_Object_Files =>
if Normalize_Pathname
(Line (1 .. Last),
Case_Sensitive => False) /=
Normalize_Pathname
(Get_Name_String
(Main_Source.Object_Path),
Case_Sensitive => False)
and then
not Is_In_Library_Project
(Line (1 .. Last))
then
Add_Argument
(Line (1 .. Last), Opt.Verbose_Mode);
end if;
when Resulting_Options =>
if Line (1 .. Last) /= "-static"
and then Line (1 .. Last) /= "-shared"
then
Binding_Options.Append
(new String'(Line (1 .. Last)));
end if;
when Gprexch.Run_Path_Option =>
if Opt.Run_Path_Option
and then
Main_Proj.Config.Run_Path_Option /=
No_Name_List
then
Add_Rpath (Line (1 .. Last));
Add_Rpath
(Shared_Libgcc_Dir
(Line (1 .. Last)));
end if;
when others =>
null;
end case;
end if;
end if;
end loop;
Close (Exchange_File);
if Binder_Object_TS = Empty_Time_Stamp then
if not Linker_Needs_To_Be_Called
and then Opt.Verbose_Mode
then
Write_Line
(" -> no binder generated object file");
end if;
Write_Str ("no binder generated object file for ");
Write_Line (Get_Name_String (Main_File.File));
Record_Failure (Main_File);
return;
elsif not Linker_Needs_To_Be_Called
and then
String (Binder_Object_TS) > String (Executable_TS)
then
Linker_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line
(" -> binder generated object is more " &
"recent than executable");
end if;
end if;
else
Write_Str ("binder exchange file ");
Write_Str (Exchange_File_Name);
Write_Line (" does not exist");
Record_Failure (Main_File);
return;
end if;
end;
B_Data := B_Data.Next;
end loop;
Last_Object_Index := Last_Argument;
end if;
-- Add the global archive, if there is one
if Global_Archive_Exists then
Global_Archive_TS :=
File_Stamp
(Path_Name_Type'
(Create_Name (Global_Archive_Name (Main_Proj))));
if Global_Archive_TS = Empty_Time_Stamp then
if not Linker_Needs_To_Be_Called
and then Opt.Verbose_Mode
then
Write_Line (" -> global archive does not exist");
end if;
Write_Str ("global archive for project file ");
Write_Str (Get_Name_String (Main_Proj.Name));
Write_Line (" does not exist");
end if;
end if;
if not Linker_Needs_To_Be_Called
and then Global_Archive_Has_Been_Built
then
Linker_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line (" -> global archive has just been built");
end if;
end if;
if not Linker_Needs_To_Be_Called
and then Global_Archive_Exists
and then String (Global_Archive_TS) > String (Executable_TS)
then
Linker_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Line (" -> global archive is more recent than " &
"executable");
end if;
end if;
-- Check if there are library files that are more recent than
-- executable.
declare
List : Project_List := Main_Proj.All_Imported_Projects;
Proj : Project_Id;
Current_Dir : constant String := Get_Current_Dir;
begin
while List /= null loop
Proj := List.Project;
List := List.Next;
if Proj.Extended_By = No_Project
and then Proj.Library
and then Proj.Object_Directory /= No_Path_Information
and then (Proj.Library_Kind = Static
or else Proj.Standalone_Library = No)
then
-- Put the full path name of the library file in Name_Buffer
Get_Name_String (Proj.Library_Dir.Display_Name);
if Proj.Library_Kind = Static then
Add_Str_To_Name_Buffer ("lib");
Add_Str_To_Name_Buffer (Get_Name_String (Proj.Library_Name));
if Proj.Config.Archive_Suffix = No_File then
Add_Str_To_Name_Buffer (".a");
else
Add_Str_To_Name_Buffer
(Get_Name_String (Proj.Config.Archive_Suffix));
end if;
else
-- Shared libraries
if Proj.Config.Shared_Lib_Prefix = No_File then
Add_Str_To_Name_Buffer ("lib");
else
Add_Str_To_Name_Buffer
(Get_Name_String (Proj.Config.Shared_Lib_Prefix));
end if;
Add_Str_To_Name_Buffer (Get_Name_String (Proj.Library_Name));
if Proj.Config.Shared_Lib_Suffix = No_File then
Add_Str_To_Name_Buffer (".so");
else
Add_Str_To_Name_Buffer
(Get_Name_String (Proj.Config.Shared_Lib_Suffix));
end if;
end if;
-- Check that library file exists and that it is not more
-- recent than the executable.
declare
Lib_TS : constant Time_Stamp_Type :=
File_Stamp (File_Name_Type'(Name_Find));
begin
if Lib_TS = Empty_Time_Stamp then
Linker_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Str (" -> library file """);
Write_Str (Name_Buffer (1 .. Name_Len));
Write_Line (""" not found");
end if;
exit;
elsif String (Lib_TS) > String (Executable_TS) then
Linker_Needs_To_Be_Called := True;
if Opt.Verbose_Mode then
Write_Str (" -> library file """);
Write_Str (Name_Buffer (1 .. Name_Len));
Write_Line
(""" is more recent than executable");
end if;
exit;
end if;
end;
end if;
end loop;
Change_Dir (Current_Dir);
end;
if not Linker_Needs_To_Be_Called then
if Opt.Verbose_Mode then
Write_Line (" -> up to date");
elsif not Opt.Quiet_Output then
Inform (Exec_Name, "up to date");
end if;
else
if Global_Archive_Exists then
Add_Argument (Global_Archive_Name (Main_Proj), Opt.Verbose_Mode);
end if;
-- Add the library switches, if there are libraries
Process_Imported_Libraries (Main_Proj, There_Are_SALs => Disregard);
Library_Dirs.Reset;
for J in reverse 1 .. Library_Projs.Last loop
if not Library_Projs.Table (J).Is_Aggregated then
if Library_Projs.Table (J).Proj.Library_Kind = Static then
Add_Argument
(Get_Name_String
(Library_Projs.Table (J).Proj.Library_Dir.Display_Name)
& "lib"
& Get_Name_String
(Library_Projs.Table (J).Proj.Library_Name)
& Archive_Suffix (Library_Projs.Table (J).Proj),
Opt.Verbose_Mode);
else
-- Do not issue several time the same -L switch if
-- several library projects share the same library
-- directory.
if not Library_Dirs.Get
(Library_Projs.Table (J).Proj.Library_Dir.Name)
then
Library_Dirs.Set
(Library_Projs.Table (J).Proj.Library_Dir.Name, True);
if Main_Proj.Config.Linker_Lib_Dir_Option = No_Name then
Add_Argument
("-L" &
Get_Name_String
(Library_Projs.Table (J).
Proj.Library_Dir.Display_Name),
Opt.Verbose_Mode);
else
Add_Argument
(Get_Name_String
(Main_Proj.Config.Linker_Lib_Dir_Option) &
Get_Name_String
(Library_Projs.Table (J).
Proj.Library_Dir.Display_Name),
Opt.Verbose_Mode);
end if;
if Opt.Run_Path_Option
and then
Main_Proj.Config.Run_Path_Option /= No_Name_List
and then
Library_Projs.Table (J).Proj.Library_Kind /= Static
then
Add_Rpath
(Get_Name_String
(Library_Projs.Table
(J).Proj.Library_Dir.Display_Name));
end if;
end if;
if Main_Proj.Config.Linker_Lib_Name_Option = No_Name then
Add_Argument
("-l" &
Get_Name_String
(Library_Projs.Table (J).Proj.Library_Name),
Opt.Verbose_Mode);
else
Add_Argument
(Get_Name_String
(Main_Proj.Config.Linker_Lib_Name_Option) &
Get_Name_String
(Library_Projs.Table (J).Proj.Library_Name),
Opt.Verbose_Mode);
end if;
end if;
end if;
end loop;
-- Put the options in the project file, if any
declare
The_Packages : constant Package_Id :=
Main_Proj.Decl.Packages;
Linker_Package : constant Prj.Package_Id :=
Prj.Util.Value_Of
(Name => Name_Linker,
In_Packages => The_Packages,
Shared => Main_File.Tree.Shared);
Switches : Variable_Value;
Switch_List : String_List_Id;
Element : String_Element;
begin
if Linker_Package /= No_Package then
declare
Defaults : constant Array_Element_Id :=
Prj.Util.Value_Of
(Name => Name_Default_Switches,
In_Arrays =>
Main_File.Tree.Shared.Packages.Table
(Linker_Package).Decl.Arrays,
Shared => Main_File.Tree.Shared);
Switches_Array : constant Array_Element_Id :=
Prj.Util.Value_Of
(Name => Name_Switches,
In_Arrays =>
Main_File.Tree.Shared.Packages.Table
(Linker_Package).Decl.Arrays,
Shared => Main_File.Tree.Shared);
Option : String_Access;
begin
Switches :=
Prj.Util.Value_Of
(Index => Name_Id (Main_Id),
Src_Index => 0,
In_Array => Switches_Array,
Shared => Main_File.Tree.Shared,
Allow_Wildcards => True);
if Switches = Nil_Variable_Value then
Switches :=
Prj.Util.Value_Of
(Index =>
Main_Source.Language.Name,
Src_Index => 0,
In_Array => Switches_Array,
Shared => Main_File.Tree.Shared,
Force_Lower_Case_Index => True);
end if;
if Switches = Nil_Variable_Value then
Switches :=
Prj.Util.Value_Of
(Index => All_Other_Names,
Src_Index => 0,
In_Array => Switches_Array,
Shared => Main_File.Tree.Shared,
Force_Lower_Case_Index => True);
end if;
if Switches = Nil_Variable_Value then
Switches :=
Prj.Util.Value_Of
(Index =>
Main_Source.Language.Name,
Src_Index => 0,
In_Array => Defaults,
Shared => Main_File.Tree.Shared);
end if;
case Switches.Kind is
when Undefined | Single =>
null;
when Prj.List =>
Switch_List := Switches.Values;
while Switch_List /= Nil_String loop
Element :=
Main_File.Tree.Shared.String_Elements.Table
(Switch_List);
Get_Name_String (Element.Value);
if Name_Len > 0 then
Option :=
new String'(Name_Buffer (1 .. Name_Len));
Test_If_Relative_Path
(Option,
Main_Project_Dir.all,
Dash_L);
Add_Argument (Option.all, True);
end if;
Switch_List := Element.Next;
end loop;
end case;
end;
end if;
end;
-- Get the Linker_Options, if any
Get_Linker_Options (For_Project => Main_Proj);
-- Add the linker switches specified on the command line
for J in 1 .. Command_Line_Linker_Options.Last loop
Add_Argument
(Command_Line_Linker_Options.Table (J), Opt.Verbose_Mode);
end loop;
-- Then the binding options
for J in 1 .. Binding_Options.Last loop
Add_Argument (Binding_Options.Table (J), Opt.Verbose_Mode);
end loop;
-- Then the required switches, if any. These are put here because,
-- if they include -L switches for example, the link may fail because
-- the wrong objects or libraries are linked in.
Min_Linker_Opts :=
Main_Proj.Config.Trailing_Linker_Required_Switches;
while Min_Linker_Opts /= No_Name_List loop
Add_Argument
(Get_Name_String
(Main_File.Tree.Shared.Name_Lists.Table
(Min_Linker_Opts).Name),
Opt.Verbose_Mode);
Min_Linker_Opts := Main_File.Tree.Shared.Name_Lists.Table
(Min_Linker_Opts).Next;
end loop;
-- Finally the Trailing_Switches if there are any in package Linker.
-- They are put here so that it is possible to override the required
-- switches from the configuration project file.
declare
The_Packages : constant Package_Id :=
Main_Proj.Decl.Packages;
Linker_Package : constant Prj.Package_Id :=
Prj.Util.Value_Of
(Name => Name_Linker,
In_Packages => The_Packages,
Shared => Main_File.Tree.Shared);
Switches : Variable_Value;
Switch_List : String_List_Id;
Element : String_Element;
begin
if Linker_Package /= No_Package then
declare
Switches_Array : constant Array_Element_Id :=
Prj.Util.Value_Of
(Name => Name_Trailing_Switches,
In_Arrays =>
Main_File.Tree.Shared.Packages.Table
(Linker_Package).Decl.Arrays,
Shared => Main_File.Tree.Shared);
Option : String_Access;
begin
Switches :=
Prj.Util.Value_Of
(Index => Name_Id (Main_Id),
Src_Index => 0,
In_Array => Switches_Array,
Shared => Main_File.Tree.Shared);
if Switches = Nil_Variable_Value then
Switches :=
Prj.Util.Value_Of
(Index =>
Main_Source.Language.Name,
Src_Index => 0,
In_Array => Switches_Array,
Shared => Main_File.Tree.Shared,
Force_Lower_Case_Index => True);
end if;
if Switches = Nil_Variable_Value then
Switches :=
Prj.Util.Value_Of
(Index => All_Other_Names,
Src_Index => 0,
In_Array => Switches_Array,
Shared => Main_File.Tree.Shared,
Force_Lower_Case_Index => True);
end if;
case Switches.Kind is
when Undefined | Single =>
null;
when Prj.List =>
Switch_List := Switches.Values;
while Switch_List /= Nil_String loop
Element :=
Main_File.Tree.Shared.String_Elements.Table
(Switch_List);
Get_Name_String (Element.Value);
if Name_Len > 0 then
Option :=
new String'(Name_Buffer (1 .. Name_Len));
Add_Argument (Option.all, True);
end if;
Switch_List := Element.Next;
end loop;
end case;
end;
end if;
end;
-- Remove duplicate stack size setting coming from pragmas
-- Linker_Options or Link_With and linker switches ("-Xlinker
-- --stack=R,C" or "-Wl,--stack=R"). Only the first stack size
-- setting option should be taken into account, because the one in
-- the project file or on the command line will always be the first
-- one. And any subsequent stack setting option will overwrite the
-- previous one.
Clean_Link_Option_Set : declare
J : Natural := Last_Object_Index + 1;
Stack_Op : Boolean := False;
begin
while J <= Last_Argument loop
-- Check for two switches "-Xlinker" followed by "--stack=..."
if Arguments (J).all = "-Xlinker"
and then J < Last_Argument
and then Arguments (J + 1)'Length > 8
and then Arguments (J + 1) (1 .. 8) = "--stack="
then
if Stack_Op then
Arguments (J .. Last_Argument - 2) :=
Arguments (J + 2 .. Last_Argument);
Last_Argument := Last_Argument - 2;
else
Stack_Op := True;
end if;
end if;
-- Check for single switch
if (Arguments (J)'Length > 17
and then Arguments (J) (1 .. 17) = "-Xlinker --stack=")
or else
(Arguments (J)'Length > 12
and then Arguments (J) (1 .. 12) = "-Wl,--stack=")
then
if Stack_Op then
Arguments (J .. Last_Argument - 1) :=
Arguments (J + 1 .. Last_Argument);
Last_Argument := Last_Argument - 1;
else
Stack_Op := True;
end if;
end if;
J := J + 1;
end loop;
end Clean_Link_Option_Set;
-- Look for the last switch -shared-libgcc or -static-libgcc and
-- remove all the others.
declare
Dash_Shared_Libgcc : Boolean := False;
Dash_Static_Libgcc : Boolean := False;
Arg : Natural;
procedure Remove_Argument;
-- Remove Arguments (Arg)
procedure Remove_Argument is
begin
Arguments (Arg .. Last_Argument - 1) :=
Arguments (Arg + 1 .. Last_Argument);
Last_Argument := Last_Argument - 1;
end Remove_Argument;
begin
Arg := Last_Argument;
loop
if Arguments (Arg).all = "-shared-libgcc" then
if Dash_Shared_Libgcc or Dash_Static_Libgcc then
Remove_Argument;
else
Dash_Shared_Libgcc := True;
end if;
elsif Arguments (Arg).all = "-static-libgcc" then
if Dash_Shared_Libgcc or Dash_Static_Libgcc then
Remove_Argument;
else
Dash_Static_Libgcc := True;
end if;
end if;
Arg := Arg - 1;
exit when Arg = 0;
end loop;
-- If -shared-libgcc was the last switch, then put in the
-- run path option the shared libgcc dir.
if Dash_Shared_Libgcc
and then Opt.Run_Path_Option
and then Main_Proj.Config.Run_Path_Option /= No_Name_List
then
-- Look for the adalib directory in -L switches.
-- If it is found, then add the shared libgcc
-- directory to the run path option.
for J in 1 .. Last_Argument loop
declare
Option : String (1 .. Arguments (J)'Length);
Last : Natural := Option'Last;
begin
Option := Arguments (J).all;
if Last > 2 and then Option (1 .. 2) = "-L" then
if Option (Last) = '/'
or else Option (Last) = Directory_Separator
then
Last := Last - 1;
end if;
if Last > 10
and then Option (Last - 5 .. Last) = "adalib"
then
Add_Rpath
(Shared_Libgcc_Dir (Option (3 .. Last)));
exit;
end if;
end if;
end;
end loop;
end if;
end;
-- Add the run path option, if necessary
if Opt.Run_Path_Option
and then Main_Proj.Config.Run_Path_Option /= No_Name_List
and then Rpaths.Last > 0
then
declare
Nam_Nod : Name_Node :=
Main_File.Tree.Shared.Name_Lists.Table
(Main_Proj.Config.Run_Path_Option);
Length : Natural := 0;
Arg : String_Access := null;
begin
if Main_Proj.Config.Run_Path_Origin /= No_Name
and then
Get_Name_String (Main_Proj.Config.Run_Path_Origin) /= ""
then
Rpaths_Relative_To
(Main_Proj.Exec_Directory.Display_Name,
Main_Proj.Config.Run_Path_Origin);
end if;
if Main_Proj.Config.Separate_Run_Path_Options then
for J in 1 .. Rpaths.Last loop
Nam_Nod := Main_File.Tree.Shared.Name_Lists.Table
(Main_Proj.Config.Run_Path_Option);
while Nam_Nod.Next /= No_Name_List loop
Add_Argument
(Get_Name_String (Nam_Nod.Name), True);
Nam_Nod := Main_File.Tree.Shared.Name_Lists.Table
(Nam_Nod.Next);
end loop;
Get_Name_String (Nam_Nod.Name);
Add_Str_To_Name_Buffer (Rpaths.Table (J).all);
Add_Argument
(Name_Buffer (1 .. Name_Len), Opt.Verbose_Mode);
end loop;
else
while Nam_Nod.Next /= No_Name_List loop
Add_Argument (Get_Name_String (Nam_Nod.Name), True);
Nam_Nod := Main_File.Tree.Shared.Name_Lists.Table
(Nam_Nod.Next);
end loop;
-- Compute the length of the argument
Get_Name_String (Nam_Nod.Name);
Length := Name_Len;
for J in 1 .. Rpaths.Last loop
Length := Length + Rpaths.Table (J)'Length + 1;
end loop;
Length := Length - 1;
-- Create the argument
Arg := new String (1 .. Length);
Length := Name_Len;
Arg (1 .. Name_Len) := Name_Buffer (1 .. Name_Len);
for J in 1 .. Rpaths.Last loop
if J /= 1 then
Length := Length + 1;
Arg (Length) := Path_Separator;
end if;
Arg (Length + 1 .. Length + Rpaths.Table (J)'Length)
:= Rpaths.Table (J).all;
Length := Length + Rpaths.Table (J)'Length;
end loop;
Add_Argument (Arg, Opt.Verbose_Mode);
end if;
end;
end if;
-- Add the map file option, if supported and requested
if Map_File /= null
and then Main_Proj.Config.Map_File_Option /= No_Name
then
Get_Name_String (Main_Proj.Config.Map_File_Option);
if Map_File'Length > 0 then
Add_Str_To_Name_Buffer (Map_File.all);
else
Add_Str_To_Name_Buffer
(Get_Name_String (Main_Base_Name_Index));
Add_Str_To_Name_Buffer (".map");
end if;
Add_Argument (Name_Buffer (1 .. Name_Len), Opt.Verbose_Mode);
end if;
-- Add the switch(es) to specify the name of the executable
declare
List : Name_List_Index :=
Main_Proj.Config.Linker_Executable_Option;
Nam : Name_Node;
procedure Add_Executable_Name;
-- Add the name of the executable to to current name buffer,
-- then the content of the name buffer as the next argument.
-------------------------
-- Add_Executable_Name --
-------------------------
procedure Add_Executable_Name is
begin
Add_Str_To_Name_Buffer (Get_Name_String (Exec_Path_Name));
Add_Argument
(Name_Buffer (1 .. Name_Len),
True,
Simple_Name => not Opt.Verbose_Mode);
end Add_Executable_Name;
begin
if List /= No_Name_List then
loop
Nam := Main_File.Tree.Shared.Name_Lists.Table (List);
Get_Name_String (Nam.Name);
if Nam.Next = No_Name_List then
Add_Executable_Name;
exit;
else
Add_Argument (Name_Buffer (1 .. Name_Len), True);
end if;
List := Nam.Next;
end loop;
else
Add_Argument ("-o", True);
Name_Len := 0;
Add_Executable_Name;
end if;
end;
-- If response file are supported, check the length of the
-- command line and the number of object files, then create
-- a response file if needed.
if Main_Proj.Config.Max_Command_Line_Length > 0
and then Main_Proj.Config.Resp_File_Format /= Prj.None
and then First_Object_Index > 0
then
declare
Arg_Length : Natural := 0;
Min_Number_Of_Objects : Natural := 0;
begin
for J in 1 .. Last_Argument loop
Arg_Length := Arg_Length + Arguments (J)'Length + 1;
end loop;
if Arg_Length > Main_Proj.Config.Max_Command_Line_Length then
if Main_Proj.Config.Resp_File_Options = No_Name_List then
Min_Number_Of_Objects := 0;
else
Min_Number_Of_Objects := 1;
end if;
-- Don't create a project file if there would not be
-- a smaller number of arguments.
if Last_Object_Index - First_Object_Index + 1 >
Min_Number_Of_Objects
then
declare
Resp_File_Options : String_List_Access :=
new String_List (1 .. 0);
List : Name_List_Index :=
Main_Proj.Config.
Resp_File_Options;
Nam_Nod : Name_Node;
begin
while List /= No_Name_List loop
Nam_Nod :=
Main_File.Tree.Shared.Name_Lists.Table (List);
Resp_File_Options :=
new String_List'
(Resp_File_Options.all
& new String'
(Get_Name_String (Nam_Nod.Name)));
List := Nam_Nod.Next;
end loop;
Create_Response_File
(Format =>
Main_Proj.Config.Resp_File_Format,
Objects => Arguments
(First_Object_Index .. Last_Object_Index),
Other_Arguments =>
Arguments (Last_Object_Index + 1 ..
Last_Argument),
Resp_File_Options => Resp_File_Options.all,
Name_1 => Response_File_Name,
Name_2 => Response_2);
if Main_Proj.Config.Resp_File_Format = GCC
or else
Main_Proj.Config.Resp_File_Format = GCC_GNU
or else
Main_Proj.Config.Resp_File_Format = GCC_Object_List
or else
Main_Proj.Config.Resp_File_Format = GCC_Option_List
then
Arguments (First_Object_Index) :=
new String'("@" &
Get_Name_String
(Response_File_Name));
Last_Argument := First_Object_Index;
else
-- Replace the first object file arguments
-- with the argument(s) specifying the
-- response file. No need to update
-- Arguments_Displayed, as the values are
-- already correct (= Verbose_Mode).
if Resp_File_Options'Length = 0 then
Arguments (First_Object_Index) :=
new String'(Get_Name_String
(Response_File_Name));
First_Object_Index := First_Object_Index + 1;
else
for J in Resp_File_Options'First ..
Resp_File_Options'Last - 1
loop
Arguments (First_Object_Index) :=
Resp_File_Options (J);
First_Object_Index :=
First_Object_Index + 1;
end loop;
Arguments (First_Object_Index) :=
new String'(Resp_File_Options
(Resp_File_Options'Last).all
&
Get_Name_String
(Response_File_Name));
First_Object_Index :=
First_Object_Index + 1;
end if;
-- And put the arguments following the object
-- files immediately after the response file
-- argument(s). Update Arguments_Displayed
-- too.
Arguments (First_Object_Index ..
Last_Argument -
Last_Object_Index +
First_Object_Index -
1) :=
Arguments (Last_Object_Index + 1 ..
Last_Argument);
Arguments_Displayed
(First_Object_Index ..
Last_Argument -
Last_Object_Index +
First_Object_Index -
1) :=
Arguments_Displayed
(Last_Object_Index + 1 ..
Last_Argument);
Last_Argument :=
Last_Argument - Last_Object_Index +
First_Object_Index - 1;
end if;
end;
end if;
end if;
end;
end if;
-- Delete an eventual executable, in case it is a symbolic
-- link as we don't want to modify the target of the link.
declare
Dummy : Boolean;
pragma Unreferenced (Dummy);
begin
Delete_File (Get_Name_String (Exec_Path_Name), Dummy);
end;
Display_Command (Linker_Name.all, Linker_Path);
declare
Pid : Process_Id;
begin
Pid := Non_Blocking_Spawn
(Linker_Path.all, Arguments (1 .. Last_Argument));
if Pid = Invalid_Pid then
Record_Failure (Main_File);
else
Add_Process
(Pid,
(Linking,
Pid,
Main_File,
Response_File_Name,
Response_2));
Display_Processes ("link");
end if;
end;
end if;
end Link_Main;
---------
-- Run --
---------
procedure Run is
Main : Main_Info;
procedure Do_Link (Project : Project_Id; Tree : Project_Tree_Ref);
procedure Await_Link;
procedure Wait_For_Available_Slot;
----------------
-- Await_Link --
----------------
procedure Await_Link is
Data : Process_Data;
OK : Boolean;
begin
loop
Await_Process (Data, OK);
if Data /= No_Process_Data then
if not OK then
Record_Failure (Data.Main);
elsif Data.Response_1 /= No_Path
and then not Debug.Debug_Flag_N
then
declare
Dont_Care : Boolean;
pragma Warnings (Off, Dont_Care);
begin
Delete_File
(Get_Name_String (Data.Response_1), Dont_Care);
if Data.Response_2 /= No_Path then
Delete_File
(Get_Name_String (Data.Response_2), Dont_Care);
end if;
end;
end if;
Display_Processes ("link");
return;
end if;
end loop;
end Await_Link;
-------------
-- Do_Link --
-------------
procedure Do_Link (Project : Project_Id; Tree : Project_Tree_Ref) is
pragma Unreferenced (Project);
Main_File : Main_Info;
begin
if Builder_Data (Tree).Need_Linking and then not Stop_Spawning then
Mains.Reset;
loop
Main_File := Mains.Next_Main;
exit when Main_File = No_Main_Info;
if Main_File.Tree = Tree
and then not Project_Compilation_Failed (Main_File.Project)
then
Wait_For_Available_Slot;
exit when Stop_Spawning;
Link_Main (Main_File);
exit when Stop_Spawning;
end if;
end loop;
end if;
end Do_Link;
procedure Link_All is new For_Project_And_Aggregated (Do_Link);
-----------------------------
-- Wait_For_Available_Slot --
-----------------------------
procedure Wait_For_Available_Slot is
begin
while Outstanding_Processes >= Opt.Maximum_Processes loop
Await_Link;
end loop;
end Wait_For_Available_Slot;
begin
Outstanding_Processes := 0;
Stop_Spawning := False;
Link_All (Main_Project, Project_Tree);
while Outstanding_Processes > 0 loop
Await_Link;
end loop;
if Bad_Processes.Last = 1 then
Main := Bad_Processes.Table (1);
Fail_Program
(Main.Tree,
"link of " & Get_Name_String (Main.File) & " failed");
elsif Bad_Processes.Last > 1 then
for J in 1 .. Bad_Processes.Last loop
Main := Bad_Processes.Table (J);
Write_Str (" link of ");
Write_Str (Get_Name_String (Main.File));
Write_Line (" failed");
end loop;
Fail_Program (Main.Tree, "*** link phase failed");
end if;
end Run;
end Gprbuild.Link;
gprbuild-gpl-2014-src/src/gprinstall-main.adb 0000644 0000767 0000145 00000064626 12323721731 020511 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R I N S T A L L . M A I N --
-- --
-- B o d y --
-- --
-- Copyright (C) 2012-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Directories;
with Ada.Exceptions; use Ada.Exceptions;
with GNAT.Case_Util; use GNAT.Case_Util;
with GNAT.Command_Line; use GNAT.Command_Line;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with Atree; use Atree;
with Csets;
with Gpr_Util; use Gpr_Util;
with GPR_Version; use GPR_Version;
with Hostparm;
with Makeutl; use Makeutl;
with Namet; use Namet;
with Osint; use Osint;
with Output; use Output;
with Prj.Conf; use Prj.Conf;
with Prj.Env;
with Prj.Err;
with Prj.Tree; use Prj.Tree;
with Snames; use Snames;
with Stringt;
with Switch; use Switch;
with Opt; use Opt;
with Types; use Types;
with Gprinstall.DB;
with Gprinstall.Install;
with Gprinstall.Uninstall;
procedure Gprinstall.Main is
use Gpr_Util.Knowledge;
-- Options specific to gprinstall
Build_Var_Option : constant String := "--build-var";
Build_Name_Option : constant String := "--build-name";
Install_Name_Option : constant String := "--install-name";
Uninstall_Option : constant String := "--uninstall";
Mode_Option : constant String := "--mode=";
Lib_Subdir_Option : constant String := "--lib-subdir";
Link_Lib_Subdir_Option : constant String := "--link-lib-subdir";
Exec_Subdir_Option : constant String := "--exec-subdir";
Sources_Subdir_Option : constant String := "--sources-subdir";
Project_Subdir_Option : constant String := "--project-subdir";
No_Lib_Link_Option : constant String := "--no-lib-link";
List_Option : constant String := "--list";
Stat_Option : constant String := "--stat";
procedure Initialize;
-- Do the necessary package intialization and process the command line
-- arguments.
procedure Usage;
-- Display the usage
procedure Scan_Arg
(Arg : String;
Command_Line : Boolean;
Success : out Boolean);
-- Process one gprinstall argument Arg. Command_Line is True if the
-- argument is specified on the command line. Optional parameter Additional
-- gives additional information about the origin of the argument if it is
-- found illegal.
procedure Copyright;
-- Output the Copyright notice
type Sigint_Handler is access procedure;
pragma Convention (C, Sigint_Handler);
procedure Install_Int_Handler (Handler : Sigint_Handler);
pragma Import (C, Install_Int_Handler, "__gnat_install_int_handler");
-- Called by Gnatmake to install the SIGINT handler below
procedure Sigint_Intercepted;
pragma Convention (C, Sigint_Intercepted);
-- Called when the program is interrupted by Ctrl-C to delete the
-- temporary mapping files and configuration pragmas files.
---------------
-- Copyright --
---------------
procedure Copyright is
begin
-- Only output the Copyright notice once
if not Copyright_Output then
Copyright_Output := True;
Display_Version
("GPRBUILD", "2012", Version_String => Gpr_Version_String);
end if;
end Copyright;
--------------
-- Scan_Arg --
--------------
procedure Scan_Arg
(Arg : String;
Command_Line : Boolean;
Success : out Boolean)
is
function Has_Prefix (Name : String) return Boolean;
-- Returns True if Arg start with Name
procedure Set_Param (P : in out Param; Name : String);
-- Set P with value for option Name
----------------
-- Has_Prefix --
----------------
function Has_Prefix (Name : String) return Boolean is
begin
pragma Assert (Arg'First = 1);
return Arg'Length >= Name'Length
and then Arg (1 .. Name'Length) = Name;
end Has_Prefix;
---------------
-- Set_Param --
---------------
procedure Set_Param (P : in out Param; Name : String) is
begin
P := (new String'
(Ensure_Directory (Arg (Name'Length + 2 .. Arg'Last))),
False);
end Set_Param;
Processed : Boolean := True;
begin
pragma Assert (Arg'First = 1);
Success := True;
if Arg'Length = 0 then
return;
end if;
-- If preceding switch was -P, a project file name need to be
-- specified, not a switch.
if Project_File_Name_Expected then
if Arg (1) = '-' then
Fail_Program
(Project_Tree, "project file name missing after -P");
else
Project_File_Name_Expected := False;
Project_File_Name := new String'(Arg);
end if;
-- If preceding switch was -o, an executable name need to be
-- specified, not a switch.
elsif Search_Project_Dir_Expected then
if Arg (1) = '-' then
Fail_Program
(Project_Tree, "directory name missing after -aP");
else
Search_Project_Dir_Expected := False;
Prj.Env.Add_Directories (Root_Environment.Project_Path, Arg);
end if;
elsif Db_Directory_Expected then
Db_Directory_Expected := False;
Parse_Knowledge_Base (Project_Tree, Arg);
-- Set the processor/language for the following switches
-- Switches start with '-'
elsif Arg (1) = '-' then
if Has_Prefix (Source_Info_Option) then
Project_Tree.Source_Info_File_Name :=
new String'(Arg (Source_Info_Option'Length + 1 .. Arg'Last));
elsif Has_Prefix (Config_Project_Option) then
if Config_Project_File_Name /= null
and then (Autoconf_Specified
or else Config_Project_File_Name.all /=
Arg (Config_Project_Option'Length + 1 .. Arg'Last))
then
Fail_Program
(Project_Tree,
"several different configuration switches "
& "cannot be specified");
else
Autoconfiguration := False;
Autoconf_Specified := False;
Config_Project_File_Name :=
new String'
(Arg (Config_Project_Option'Length + 1 .. Arg'Last));
end if;
elsif Has_Prefix (Autoconf_Project_Option) then
if Hostparm.OpenVMS then
Fail_Program
(Project_Tree,
Autoconf_Project_Option & " cannot be used on VMS");
end if;
if Config_Project_File_Name /= null
and then (not Autoconf_Specified
or else Config_Project_File_Name.all /=
Arg (Autoconf_Project_Option'Length + 1 .. Arg'Last))
then
Fail_Program
(Project_Tree,
"several different configuration switches "
& "cannot be specified");
else
Config_Project_File_Name :=
new String'
(Arg (Autoconf_Project_Option'Length + 1 .. Arg'Last));
Autoconf_Specified := True;
end if;
elsif Arg = "-h" then
Usage_Needed := True;
elsif Arg = "-p" or else Arg = "--create-missing-dirs" then
Create_Dest_Dir := True;
elsif Arg'Length >= 2 and then Arg (2) = 'P' then
if Project_File_Name /= null then
Fail_Program
(Project_Tree,
"cannot have several project files specified");
elsif Arg'Length = 2 then
Project_File_Name_Expected := True;
else
Project_File_Name := new String'(Arg (3 .. Arg'Last));
end if;
elsif Arg'Length >= 3 and then Arg (1 .. 3) = "-aP" then
if Arg'Length = 3 then
Search_Project_Dir_Expected := True;
else
Prj.Env.Add_Directories
(Root_Environment.Project_Path, Arg (4 .. Arg'Last));
end if;
elsif Arg = "-q" then
Opt.Quiet_Output := True;
Opt.Verbose_Mode := False;
elsif Arg = "-r" then
Recursive := True;
elsif Arg = "-v" then
Opt.Verbose_Mode := True;
Opt.Quiet_Output := False;
elsif Arg = "-f" then
Force_Installations := True;
elsif Arg = "-a" then
All_Sources := True;
elsif Arg = "-d" then
Dry_Run := True;
elsif Arg'Length >= 3
and then Arg (2) = 'X'
and then Is_External_Assignment (Root_Environment, Arg)
then
-- Is_External_Assignment has side effects when it returns True
null;
elsif Arg'Length > 1 and then Arg (2) = '-' then
if Has_Prefix (Prefix_Project_Option) then
Set_Param (Global_Prefix_Dir, Prefix_Project_Option);
elsif Has_Prefix (Exec_Subdir_Option) then
Set_Param (Global_Exec_Subdir, Exec_Subdir_Option);
elsif Has_Prefix (Lib_Subdir_Option) then
Set_Param (Global_Lib_Subdir, Lib_Subdir_Option);
elsif Has_Prefix (Link_Lib_Subdir_Option) then
Set_Param (Global_Link_Lib_Subdir, Link_Lib_Subdir_Option);
elsif Has_Prefix (Sources_Subdir_Option) then
Set_Param (Global_Sources_Subdir, Sources_Subdir_Option);
elsif Has_Prefix (Project_Subdir_Option) then
Set_Param (Global_Project_Subdir, Project_Subdir_Option);
elsif Has_Prefix (Build_Var_Option) then
Build_Var := new String'
(Arg (Build_Var_Option'Length + 2 .. Arg'Last));
elsif Has_Prefix (Build_Name_Option) then
Free (Build_Name);
Build_Name := new String'
(Arg (Build_Name_Option'Length + 2 .. Arg'Last));
elsif Has_Prefix (Install_Name_Option) then
Free (Install_Name);
Install_Name := new String'
(Arg (Install_Name_Option'Length + 2 .. Arg'Last));
Install_Name_Default := False;
elsif Has_Prefix (Uninstall_Option) then
Usage_Mode := Uninstall_Mode;
elsif Has_Prefix (List_Option) then
Usage_Mode := List_Mode;
elsif Has_Prefix (Stat_Option) then
Output_Stats := True;
elsif Has_Prefix (Mode_Option) then
declare
Mode : String := Arg (Mode_Option'Length + 1 .. Arg'Last);
begin
To_Lower (Mode);
if Mode = "dev" then
For_Dev := True;
elsif Mode = "usage" then
For_Dev := False;
else
Processed := False;
end if;
end;
elsif Has_Prefix (Dry_Run_Option) then
Dry_Run := True;
elsif Has_Prefix (No_Lib_Link_Option) then
Add_Lib_Link := False;
elsif Has_Prefix (Subdirs_Option) then
Subdirs :=
new String'(Arg (Subdirs_Option'Length + 1 .. Arg'Last));
elsif Has_Prefix (Target_Project_Option) then
if Target_Name /= null then
if Target_Name.all /=
Arg (Target_Project_Option'Length + 1 .. Arg'Last)
then
Fail_Program
(Project_Tree,
"several different target switches "
& "cannot be specified");
end if;
else
Target_Name :=
new String'
(Arg (Target_Project_Option'Length + 1 .. Arg'Last));
end if;
else
Processed := False;
end if;
else
Processed := False;
end if;
elsif Command_Line then
-- The file name of a main or a project file
declare
File_Name : String := Arg;
begin
Canonical_Case_File_Name (File_Name);
if Usage_Mode = Uninstall_Mode
or else
(File_Name'Length > Project_File_Extension'Length
and then File_Name
(File_Name'Last - Project_File_Extension'Length + 1
.. File_Name'Last) = Project_File_Extension)
then
if Project_File_Name /= null then
Fail_Program
(Project_Tree,
"cannot have several project files specified");
else
Project_File_Name := new String'(File_Name);
end if;
else
-- Not a project file, then it is a main
Fail_Program (Project_Tree, "only project files expected");
end if;
end;
else
Processed := False;
end if;
if not Processed then
if Command_Line then
Fail_Program
(Project_Tree,
"illegal option """ & Arg & """ on the command line");
end if;
end if;
end Scan_Arg;
------------------------
-- Sigint_Intercepted --
------------------------
procedure Sigint_Intercepted is
begin
Write_Line ("*** Interrupted ***");
Delete_All_Temp_Files (Project_Tree.Shared);
OS_Exit (1);
end Sigint_Intercepted;
----------------
-- Initialize --
----------------
procedure Initialize is
procedure Check_Version_And_Help is new Check_Version_And_Help_G (Usage);
begin
-- Do some necessary package initializations
Csets.Initialize;
Namet.Initialize;
Snames.Initialize;
Stringt.Initialize;
Prj.Tree.Initialize (Root_Environment, Gprbuild_Flags);
Prj.Tree.Initialize (Project_Node_Tree);
Prj.Initialize (Project_Tree);
Mains.Delete;
-- Get the command line arguments, starting with --version and --help
Check_Version_And_Help
("GPRINSTALL", "2012", Version_String => Gpr_Version_String);
-- Now process the other options
Autoconfiguration := True;
declare
Do_Not_Care : Boolean;
begin
Scan_Args : for Next_Arg in 1 .. Argument_Count loop
Scan_Arg
(Argument (Next_Arg),
Command_Line => True,
Success => Do_Not_Care);
end loop Scan_Args;
end;
Mains.Set_Multi_Unit_Index (Project_Tree, Main_Index);
-- Target_Name has potentially been set when calling Scan_Arg, so we can
-- only initialize the project path after parsing the command line
-- arguments.
if Target_Name = null then
Prj.Env.Initialize_Default_Project_Path
(Root_Environment.Project_Path, Target_Name => "");
else
Prj.Env.Initialize_Default_Project_Path
(Root_Environment.Project_Path, Target_Name.all);
end if;
if Opt.Verbose_Mode then
Copyright;
end if;
if Usage_Needed then
Usage;
Usage_Needed := False;
end if;
-- Fail if command line ended with "-P"
if Project_File_Name_Expected then
Fail_Program
(Project_Tree, "project file name missing after -P");
elsif Search_Project_Dir_Expected then
Fail_Program
(Project_Tree, "directory name missing after -aP");
end if;
if Build_Name.all /= "default" and then Usage_Mode = Uninstall_Mode then
Fail_Program
(Project_Tree, "cannot specify --build-name in uninstall mode");
end if;
if Build_Var /= null and then Usage_Mode = Uninstall_Mode then
Fail_Program
(Project_Tree, "cannot specify --build-var in uninstall mode");
end if;
if Output_Stats and then Usage_Mode /= List_Mode then
Fail_Program
(Project_Tree, "cannot specify --stat in install/uninstall mode");
end if;
if Load_Standard_Base then
-- We need to parse the knowledge base so that we are able to
-- normalize the target names. Unfortunately, if we have to spawn
-- gprconfig, it will also have to parse that knowledge base on
-- its own.
Parse_Knowledge_Base (Project_Tree);
end if;
-- If no project file was specified, look first for a default
if Project_File_Name = null
and then Usage_Mode /= List_Mode
then
Try_Help;
Fail_Program (Project_Tree, "no project file specified");
end if;
-- Check prefix, if not specified set to default toolchain
if Global_Prefix_Dir.V = null then
-- Set to default for current toolchain
Global_Prefix_Dir := (new String'(Executable_Prefix_Path), True);
end if;
end Initialize;
-----------
-- Usage --
-----------
procedure Usage is
begin
if not Usage_Output then
Usage_Output := True;
Write_Str ("Usage: ");
Osint.Write_Program_Name;
Write_Str (" [-P] [.gpr] [opts]");
Write_Eol;
Write_Eol;
-- GPRINSTALL switches
Write_Str ("gprinstall switches:");
Write_Eol;
Display_Usage_Version_And_Help;
-- Line for Config_Project_Option
Write_Str (" ");
Write_Str (Config_Project_Option);
Write_Str ("file.cgpr");
Write_Eol;
Write_Str (" Specify the main config project file name");
Write_Eol;
-- Line for Autoconf_Project_Option
if not Hostparm.OpenVMS then
Write_Str (" ");
Write_Str (Autoconf_Project_Option);
Write_Str ("file.cgpr");
Write_Eol;
Write_Str
(" Specify/create the main config project file name");
Write_Eol;
end if;
-- Line for --prefix
Write_Line (" --prefix=");
Write_Line (" Install destination directory");
Write_Line (" --install-name=");
Write_Line (" The name of the installation");
Write_Line (" --sources-subdir=");
Write_Line (" The sources directory/sub-directory");
Write_Line (" --lib-subdir=");
Write_Line (" The library directory/sub-directory");
Write_Line (" --link-lib-subdir=");
Write_Line
(" The symlib directory/sub-directory to libraries");
Write_Line (" --exec-subdir=");
Write_Line (" The executbales directory/sub-directory");
Write_Line (" --project-subdir=");
Write_Line (" The project directory/sub-directory");
Write_Line (" --no-lib-link");
Write_Line
(" Do not copy shared lib in exec/lib directory");
-- Line for --subdirs=
Write_Line (" --subdirs=dir");
Write_Line (" Real obj/lib/exec dirs are subdirs");
-- Line for Target_Project_Option
Write_Str (" ");
Write_Str (Target_Project_Option);
Write_Str ("targetname");
Write_Eol;
Write_Str
(" Specify a target for cross platforms");
Write_Eol;
-- Line for --dry-run
Write_Line (" -d, --dry-run");
Write_Line (" Execute nothing, display commands");
-- Line for --build-var
Write_Line (" --build-var=");
Write_Line (" Name of the variable which identify a build");
-- Line for --build-name
Write_Line (" --build-name=");
Write_Line (" Build name value (default is ""Default"")");
-- Line for --mode
Write_Line (" --mode=[dev|usage]");
Write_Line
(" Kind of installation (default is ""dev"")");
-- Line for --uninstall
Write_Line (" --uninstall");
Write_Line
(" Remove all previously installed files");
-- Line for -aP
Write_Line (" -aP dir Add directory dir to project search path");
-- Line for -eL
Write_Line (" -eL "
& "Follow symbolic links when processing project files");
-- Line for -P
Write_Line (" -P proj Use Project File proj");
-- Line for -p
Write_Line (" -p, --create-missing-dirs");
Write_Line (" Create missing directories");
-- Line for -q
Write_Line (" -q Be quiet/terse");
-- Line for -r
Write_Line (" -r Recursive");
-- Line for -a
Write_Line (" -a Force copy of all sources");
-- Line for -f
Write_Line (" -f Force installaion, overwrite files");
-- Line for -v
Write_Line (" -v Verbose output");
-- Line for -X
Write_Line (" -Xnm=val Specify an external reference for "
& "Project Files");
Write_Eol;
end if;
end Usage;
User_Project_Node : Project_Node_Id;
begin
-- First initialize and read the command line arguments
Initialize;
-- And install Ctrl-C handler
Install_Int_Handler (Sigint_Intercepted'Unrestricted_Access);
-- Check command line arguments. These will be overridden when looking
-- for the configuration file
if Target_Name = null then
Target_Name := new String'("");
end if;
if Config_Project_File_Name = null then
Config_Project_File_Name := new String'("");
end if;
-- Then, parse the user's project and the configuration file. Apply the
-- configuration file to the project so that its settings are
-- automatically inherited by the project.
-- If either the project or the configuration file contains errors, the
-- following call with call Osint.Fail and never return
if Usage_Mode = Install_Mode then
begin
Parse_Project_And_Apply_Config
(Main_Project => Main_Project,
User_Project_Node => User_Project_Node,
Config_File_Name => Config_Project_File_Name.all,
Autoconf_Specified => Autoconf_Specified,
Project_File_Name => Project_File_Name.all,
Project_Tree => Project_Tree,
Env => Root_Environment,
Project_Node_Tree => Project_Node_Tree,
Packages_To_Check => Packages_To_Check,
Allow_Automatic_Generation => Autoconfiguration,
Automatically_Generated => Delete_Autoconf_File,
Config_File_Path => Configuration_Project_Path,
Target_Name => Target_Name.all,
Normalized_Hostname => Normalized_Hostname);
exception
when E : Prj.Conf.Invalid_Config =>
Osint.Fail (Exception_Message (E));
end;
if Main_Project = No_Project then
-- Don't flush messages in case of parsing error. This has already
-- been taken care when parsing the tree. Otherwise, it results in
-- the same message being displayed twice.
Fail_Program
(Project_Tree,
"""" & Project_File_Name.all & """ processing failed",
Flush_Messages => User_Project_Node /= Empty_Node);
end if;
if Configuration_Project_Path /= null then
Free (Config_Project_File_Name);
Config_Project_File_Name := new String'
(Base_Name (Configuration_Project_Path.all));
end if;
if Total_Errors_Detected > 0 then
Prj.Err.Finalize;
Fail_Program
(Project_Tree,
"problems while getting the configuration",
Flush_Messages => False);
end if;
Main_Project_Dir :=
new String'(Get_Name_String (Main_Project.Directory.Display_Name));
if Warnings_Detected > 0 then
Prj.Err.Finalize;
Prj.Err.Initialize;
end if;
Mains.Fill_From_Project (Main_Project, Project_Tree);
Compute_All_Imported_Projects (Main_Project, Project_Tree);
-- Source file lookups should be cached for efficiency.
-- Source files are not supposed to change.
Osint.Source_File_Data (Cache => True);
Install.Process (Project_Tree, Main_Project);
if Warnings_Detected /= 0 then
Prj.Err.Finalize;
end if;
elsif Usage_Mode = List_Mode then
DB.List;
else
if Install_Name = null then
Install_Name := new String'
(Ada.Directories.Base_Name (Project_File_Name.all));
end if;
Uninstall.Process (Install_Name.all);
end if;
Namet.Finalize;
if Usage_Mode = Install_Mode then
Finish_Program (Project_Tree, E_Success);
end if;
end Gprinstall.Main;
gprbuild-gpl-2014-src/src/gprbuild-compilation-process.ads 0000644 0000767 0000145 00000010624 12323721731 023216 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B U I L D . C O M P I L A T I O N . P R O C E S S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2012-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- This package abstract out a process which can be either local or remote.
-- The communication with the remote instances are done through sockets.
with GNAT.OS_Lib;
package Gprbuild.Compilation.Process is
type Id is private;
type Remote_Id is mod 2 ** 64;
-- Represent a remote process id, this number is unique across all slaves.
-- Such number if created by the slaves using a slave id (unique number)
-- and a compilation number. Bother numbers are 32bits value:
--
-- 63 32 31 0
-- | [slave id] | [compilation number] |
Invalid_Process : constant Id;
function Create_Local (Pid : GNAT.OS_Lib.Process_Id) return Id;
-- Returns a local process for Pid
function Create_Remote (Pid : Remote_Id) return Id;
-- Returns a remote process (one running on a slave) for Pid
procedure Record_Environment
(Project : Project_Id;
Language : Name_Id;
Name, Value : String);
-- Record an environement variable to set when spawning a compilation. This
-- is for example to set CPATH if needed for the compilation of C sources.
function Run
(Executable : String;
Options : GNAT.OS_Lib.Argument_List;
Project : Project_Id;
Obj_Name : String;
Language : String := "";
Dep_Name : String := "";
Output_File : String := "";
Err_To_Out : Boolean := False;
Force_Local : Boolean := False) return Id;
-- Run Executable with the given options locally or on a remote slave.
-- Dep_File name is the name of the file that is expected to be generated
-- if the compilation is successful. If Force_Local is set then the
-- compilation will happen on the local machine.
function Get_Maximum_Processes return Positive;
-- The maximum number of simultaneous compilation supported. This is the
-- sum of the local parallelism and the sum of of remote slaves supported
-- processes.
-- For the hash table of jobs
type Header_Num is range 0 .. 2047;
function Hash (Process : Id) return Header_Num;
function Image (Pid : Remote_Id) return String;
-- Returns the string representation of Pid
procedure Record_Remote_Failure (Pid : Id; Slave : String);
-- This is to be able to display on which slaves a specific compilation has
-- failed.
function Get_Slave_For (Pid : Id) return String;
-- Returns the slave for the given compilation, or the empty string if the
-- compilation was successful or conducted locally.
private
type Process_Kind is (Local, Remote);
type Id (Kind : Process_Kind := Local) is record
case Kind is
when Local => Pid : Process_Id;
when Remote => R_Pid : Remote_Id;
end case;
end record;
Invalid_Process : constant Id := (Local, Pid => Invalid_Pid);
end Gprbuild.Compilation.Process;
gprbuild-gpl-2014-src/src/gprbuild-compilation-result.ads 0000644 0000767 0000145 00000004041 12323721731 023052 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B U I L D . C O M P I L A T I O N . R E S U L T --
-- --
-- S p e c --
-- --
-- Copyright (C) 2012-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Gprbuild.Compilation.Process; use Gprbuild.Compilation.Process;
package Gprbuild.Compilation.Result is
procedure Add (Process : Id; Status : Boolean; Slave : String := "");
-- Add process Id with the given status into the list of results
procedure Wait (Process : out Id; Status : out Boolean);
-- Wait for a process to terminate (so a compilation process result) to be
-- available and returns the process Id and the corresponding status.
end Gprbuild.Compilation.Result;
gprbuild-gpl-2014-src/src/gprbuild-compilation-protocol.adb 0000644 0000767 0000145 00000061544 12323721731 023367 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B U I L D . C O M P I L A T I O N . P R O T O C O L --
-- --
-- B o d y --
-- --
-- Copyright (C) 2012-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Ada.Directories; use Ada.Directories;
with Ada.Streams.Stream_IO;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Strings.Maps.Constants; use Ada.Strings.Maps;
with GNAT.Rewrite_Data;
with GNAT.String_Split; use GNAT.String_Split;
with Gnatvsn; use Gnatvsn;
with Gpr_Util; use Gpr_Util;
package body Gprbuild.Compilation.Protocol is
Args_Sep : constant Character := '|';
-- Channel's argument separator
function Image (N : Natural) return String;
-- Returns string representation of N without leading space
procedure Send_File_Internal
(Channel : Communication_Channel;
Path_Name : String;
Cmd : Command_Kind);
-- Send file Path_Name over the channel with rewritting if needed
procedure Send_RAW_File_Content
(Channel : Communication_Channel;
Path_Name : String);
-- Send the file content untranslated
----------
-- Args --
----------
function Args (Cmd : Command) return Argument_List_Access is
begin
return Cmd.Args;
end Args;
-------------------
-- Clear_Rewrite --
-------------------
procedure Clear_Rewrite (Channel : in out Communication_Channel) is
begin
Channel.WD_From := Null_Unbounded_String;
Channel.WD_To := Null_Unbounded_String;
Channel.CD_From := Null_Unbounded_String;
Channel.CD_To := Null_Unbounded_String;
end Clear_Rewrite;
-----------
-- Close --
-----------
procedure Close (Channel : in out Communication_Channel) is
begin
begin
-- Make sure we never fail, the other end-point could have already
-- closed the channel (hard ctrl-c).
Shutdown_Socket (Channel.Sock);
exception
when others =>
null;
end;
Channel.Channel := null;
Clear_Rewrite (Channel);
end Close;
------------
-- Create --
------------
function Create (Sock : Socket_Type) return Communication_Channel is
begin
return Communication_Channel'
(Sock, Stream (Sock),
Null_Unbounded_String, Null_Unbounded_String,
Null_Unbounded_String, Null_Unbounded_String);
end Create;
-----------------
-- Get_Command --
-----------------
function Get_Command (Channel : Communication_Channel) return Command is
use Ada.Streams.Stream_IO;
function Handle_File (Cmd : Command) return Command;
-- A file has been recieved, write it to disk
function Handle_RAW_File (Cmd : Command) return Command;
-- A file has been recieved, write it to disk, no rewritte taking place
procedure Handle_Output (Cmd : in out Command);
-- A display output is received, read it and store it into the command
-----------------
-- Handle_File --
-----------------
function Handle_File (Cmd : Command) return Command is
File_Name : constant String :=
Translate_Receive (Channel, Cmd.Args (2).all);
Dir : constant String := Containing_Directory (File_Name);
procedure Input
(Item : out Stream_Element_Array;
Last : out Stream_Element_Offset);
-- Read and return some data from channel
procedure Output (Item : Stream_Element_Array);
-- Write data to file
Size : Stream_Element_Count :=
Stream_Element_Count'Value (Cmd.Args (1).all);
-- Number of bytes remaining to be read from channel
Rewriter : Rewrite_Data.Buffer :=
Rewrite_Data.Create
(To_String (Channel.WD_To),
To_String (Channel.WD_From));
Rewriter_CD : aliased Rewrite_Data.Buffer :=
Rewrite_Data.Create
(To_String (Channel.CD_To),
To_String (Channel.CD_From));
File : File_Type;
-----------
-- Input --
-----------
procedure Input
(Item : out Stream_Element_Array;
Last : out Stream_Element_Offset) is
begin
if Size = 0 then
Last := 0;
else
Last := Stream_Element_Count'Min (Item'Length, Size);
Stream_Element_Array'Read
(Channel.Channel, Item (Item'First .. Last));
Size := Size - Last;
end if;
end Input;
------------
-- Output --
------------
procedure Output (Item : Stream_Element_Array) is
begin
Write (File, Item);
end Output;
begin
Rewrite_Data.Link (Rewriter, Rewriter_CD'Unchecked_Access);
if Dir /= "" and then not Exists (Dir) then
Create_Directory (Dir);
end if;
Create (File, Out_File, File_Name);
Rewrite_Data.Rewrite (Rewriter, Input'Access, Output'Access);
Close (File);
return Get_Command (Channel);
end Handle_File;
---------------------
-- Handle_RAW_File --
---------------------
function Handle_RAW_File (Cmd : Command) return Command is
File_Name : constant String :=
Translate_Receive (Channel, Cmd.Args (1).all);
Dir : constant String := Containing_Directory (File_Name);
File : File_Type;
begin
if Dir /= "" and then not Exists (Dir) then
Create_Directory (Dir);
end if;
Create (File, Out_File, File_Name);
loop
declare
Data : constant Stream_Element_Array := Get_Raw_Data (Channel);
begin
exit when Data'Length = 0;
Write (File, Data);
end;
end loop;
Close (File);
return Get_Command (Channel);
end Handle_RAW_File;
-------------------
-- Handle_Output --
-------------------
procedure Handle_Output (Cmd : in out Command) is
function Is_Number (Cmd : Command) return Boolean is
(Is_Subset
(To_Set (Cmd.Args (1).all), Constants.Decimal_Digit_Set));
begin
if Cmd.Args'Length = 2
and then Is_Number (Cmd)
then
declare
Size : constant Natural :=
Natural'Value (Cmd.Args (1).all);
Result : String (1 .. Size);
begin
if Size = 0 then
Cmd.Output := Null_Unbounded_String;
else
String'Read (Channel.Channel, Result);
Cmd.Output := To_Unbounded_String (Result);
end if;
end;
else
raise Wrong_Command
with "Expected DP found " & Command_Kind'Image (Cmd.Cmd);
end if;
end Handle_Output;
Result : Command;
Args : Slice_Set;
begin
declare
Line : constant String := String'Input (Channel.Channel);
C : constant String :=
(if Line'Length >= 2
then Line (Line'First .. Line'First + 1)
else "");
begin
if C in
"EX" | "AK" | "TS" | "ES" | "FL" | "FR" | "OK" | "KO"
| "CX" | "CU" | "DP" | "EC"
then
Result.Cmd := Command_Kind'Value (C);
-- Slice arguments
Create
(Args,
Line (Line'First + 2 .. Line'Last),
String'(1 => Args_Sep));
Result.Args :=
new Argument_List (1 .. Integer (Slice_Count (Args)));
for K in Result.Args'Range loop
Result.Args (K) := new String'(Slice (Args, Slice_Number (K)));
end loop;
if Result.Cmd = FL then
-- We got some file data to write
return Handle_File (Result);
elsif Result.Cmd = FR then
return Handle_RAW_File (Result);
elsif Result.Cmd = DP then
-- We got an output to display
Handle_Output (Result);
end if;
else
if Line'Length > 0 then
raise Wrong_Command with Line;
else
raise Wrong_Command with "empty command line";
end if;
end if;
return Result;
end;
exception
when others =>
-- Any exception means that the channel has been closed
Result.Cmd := EC;
return Result;
end Get_Command;
-----------------
-- Get_Context --
-----------------
procedure Get_Context
(Channel : Communication_Channel;
Target : out Unbounded_String;
Project_Name : out Unbounded_String;
Build_Env : out Unbounded_String;
Sync : out Sync_Kind;
Timestamp : out Time_Stamp_Type;
Version : out Unbounded_String)
is
Line : constant Command := Get_Command (Channel);
begin
if Line.Cmd = CX
and then Line.Args'Length = 6
then
Target := To_Unbounded_String (Line.Args (1).all);
Project_Name := To_Unbounded_String (Line.Args (2).all);
Build_Env := To_Unbounded_String (Line.Args (3).all);
Sync := Sync_Kind'Value (Line.Args (4).all);
Timestamp := Time_Stamp_Type (Line.Args (5).all);
Version := To_Unbounded_String (Line.Args (6).all);
else
raise Wrong_Command
with "Expected CX found " & Command_Kind'Image (Line.Cmd);
end if;
end Get_Context;
-------------
-- Get_Pid --
-------------
procedure Get_Pid
(Channel : Communication_Channel;
Pid : out Process.Remote_Id;
Success : out Boolean)
is
Cmd : constant Command := Get_Command (Channel);
begin
if Cmd.Args'Length = 1
and then Cmd.Cmd in OK | KO
then
Pid := Process.Remote_Id'Value (Cmd.Args (1).all);
Success := (if Kind (Cmd) = KO then False);
end if;
end Get_Pid;
------------------
-- Get_Raw_Data --
------------------
function Get_Raw_Data
(Channel : Communication_Channel) return Stream_Element_Array is
begin
return Stream_Element_Array'Input (Channel.Channel);
end Get_Raw_Data;
-----------
-- Image --
-----------
function Image (N : Natural) return String is
N_Img : constant String := Natural'Image (N);
begin
return N_Img (N_Img'First + 1 .. N_Img'Last);
end Image;
----------
-- Kind --
----------
function Kind (Cmd : Command) return Command_Kind is
begin
return Cmd.Cmd;
end Kind;
------------
-- Output --
------------
function Output (Cmd : Command) return Unbounded_String is
begin
return Cmd.Output;
end Output;
--------------
-- Send_Ack --
--------------
procedure Send_Ack
(Channel : Communication_Channel; Pid : Process.Remote_Id) is
begin
String'Output
(Channel.Channel, Command_Kind'Image (AK) & Process.Image (Pid));
end Send_Ack;
-------------------
-- Send_Clean_Up --
-------------------
procedure Send_Clean_Up
(Channel : Communication_Channel; Project_Name : String) is
begin
String'Output
(Channel.Channel, Command_Kind'Image (CU) & Project_Name);
end Send_Clean_Up;
------------------
-- Send_Context --
------------------
procedure Send_Context
(Channel : Communication_Channel;
Target : String;
Project_Name : String;
Build_Env : String;
Sync : Sync_Kind) is
begin
String'Output
(Channel.Channel,
Command_Kind'Image (CX) & Target & Args_Sep & Project_Name
& Args_Sep & Build_Env
& Args_Sep & Sync_Kind'Image (Sync)
& Args_Sep & String (UTC_Time)
& Args_Sep & Gnat_Static_Version_String);
end Send_Context;
-----------------------------
-- Send_End_Of_Compilation --
-----------------------------
procedure Send_End_Of_Compilation (Channel : Communication_Channel) is
begin
String'Output (Channel.Channel, Command_Kind'Image (EC));
end Send_End_Of_Compilation;
---------------------------
-- Send_End_Of_File_List --
---------------------------
procedure Send_End_Of_File_List (Channel : Communication_Channel) is
begin
String'Output (Channel.Channel, Command_Kind'Image (ES));
end Send_End_Of_File_List;
---------------
-- Send_Exec --
---------------
procedure Send_Exec
(Channel : Communication_Channel;
Project : String;
Dir : String;
Command : String;
Options : Argument_List;
Obj_Name : String;
Dep_Name : String;
Env : String;
Filter : access function (Str, Sep : String) return String := null)
is
R_Cmd : Unbounded_String;
begin
-- Options are serialized into a string and separated with Opts_Sep
for K in Options'Range loop
if Filter /= null then
R_Cmd := R_Cmd & Filter (Options (K).all, WD_Path_Tag);
else
R_Cmd := R_Cmd & Options (K).all;
end if;
if K /= Options'Last then
R_Cmd := R_Cmd & Opts_Sep;
end if;
end loop;
-- Send the command over the channel
String'Output
(Channel.Channel,
Command_Kind'Image (EX)
& Filter (Project, WD_Path_Tag)
& Args_Sep & Dir & Args_Sep & Command
& Args_Sep & Obj_Name & Args_Sep & Dep_Name
& Args_Sep & To_String (R_Cmd)
& Args_Sep & Filter (Env, WD_Path_Tag));
end Send_Exec;
---------------
-- Send_File --
---------------
procedure Send_File
(Channel : Communication_Channel;
Path_Name : String;
Rewrite : Boolean) is
begin
if Rewrite then
Send_File_Internal (Channel, Path_Name, FL);
else
if Exists (Path_Name) then
String'Output
(Channel.Channel,
Command_Kind'Image (FR) & Translate_Send (Channel, Path_Name));
Send_RAW_File_Content (Channel, Path_Name);
end if;
end if;
end Send_File;
----------------
-- Sync_Files --
----------------
procedure Sync_Files
(Channel : Communication_Channel;
Root_Dir : String;
Files : File_Data_Set.Vector) is
begin
Create_Args : declare
Args : Unbounded_String;
First : Boolean := True;
begin
for F of Files loop
if First then
First := False;
else
Append (Args, Args_Sep);
end if;
Append (Args, F.Path_Name);
Append (Args, Args_Sep);
Append (Args, String (F.Timestamp));
end loop;
String'Output
(Channel.Channel,
Command_Kind'Image (TS) & To_String (Args));
end Create_Args;
declare
use Protocol;
Cmd : constant Command := Get_Command (Channel);
begin
if Kind (Cmd) = KO then
for Filename of Args (Cmd).all loop
Send_RAW_File_Content
(Channel,
(if Root_Dir = ""
then ""
else Root_Dir & Directory_Separator) & Filename.all);
end loop;
end if;
end;
end Sync_Files;
------------------------
-- Send_File_Internal --
------------------------
procedure Send_File_Internal
(Channel : Communication_Channel;
Path_Name : String;
Cmd : Command_Kind)
is
use Ada.Streams.Stream_IO;
procedure Input
(Item : out Stream_Element_Array; Last : out Stream_Element_Offset);
-- Get input data from file
procedure Output (Item : Stream_Element_Array);
-- Send data to channel
function File_Size return Natural;
-- Compute the size of the file as rewritten
File : File_Type;
F_Size : Natural;
Rewriter : Rewrite_Data.Buffer :=
Rewrite_Data.Create
(To_String (Channel.WD_From),
To_String (Channel.WD_To));
Rewriter_CD : aliased Rewrite_Data.Buffer :=
Rewrite_Data.Create
(To_String (Channel.CD_From),
To_String (Channel.CD_To));
---------------
-- File_Size --
---------------
function File_Size return Natural is
procedure Count (Item : Stream_Element_Array);
-- Count bytes
Result : Natural := Natural (Size (Path_Name));
-----------
-- Count --
-----------
procedure Count (Item : Stream_Element_Array) is
begin
Result := Result + Item'Length;
end Count;
begin
if Channel.WD_From /= Null_Unbounded_String
and then Length (Channel.WD_From) <= Result
then
Result := 0;
Rewrite_Data.Rewrite (Rewriter, Input'Access, Count'Access);
Reset (File);
end if;
return Result;
end File_Size;
-----------
-- Input --
-----------
procedure Input
(Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is
begin
if End_Of_File (File) then
Last := 0;
else
Read (File, Item, Last);
end if;
end Input;
------------
-- Output --
------------
procedure Output (Item : Stream_Element_Array) is
begin
Stream_Element_Array'Write (Channel.Channel, Item);
end Output;
begin
Rewrite_Data.Link (Rewriter, Rewriter_CD'Unchecked_Access);
if Exists (Path_Name) then
Open (File, In_File, Path_Name);
-- First compute the file size as translated, note that this means
-- that we are parsing the file twice.
F_Size := File_Size;
String'Output
(Channel.Channel,
Command_Kind'Image (Cmd) & Image (F_Size)
& Args_Sep & Translate_Send (Channel, Path_Name));
if F_Size /= 0 then
Rewrite_Data.Rewrite (Rewriter, Input'Access, Output'Access);
end if;
Close (File);
else
raise Constraint_Error with "File not found : " & Path_Name;
end if;
end Send_File_Internal;
-------------
-- Send_Ko --
-------------
procedure Send_Ko
(Channel : Communication_Channel; Pid : Process.Remote_Id) is
begin
String'Output
(Channel.Channel, Command_Kind'Image (KO) & Process.Image (Pid));
end Send_Ko;
procedure Send_Ko (Channel : Communication_Channel) is
begin
String'Output (Channel.Channel, Command_Kind'Image (KO));
end Send_Ko;
procedure Send_Ko
(Channel : Communication_Channel;
Files : File_Data_Set.Vector)
is
Args : Unbounded_String;
First : Boolean := True;
begin
for F of Files loop
if First then
First := False;
else
Append (Args, Args_Sep);
end if;
Append (Args, To_String (F.Path_Name));
end loop;
String'Output
(Channel.Channel, Command_Kind'Image (KO) & To_String (Args));
end Send_Ko;
-------------
-- Send_Ok --
-------------
procedure Send_Ok
(Channel : Communication_Channel; Pid : Process.Remote_Id) is
begin
String'Output
(Channel.Channel, Command_Kind'Image (OK) & Process.Image (Pid));
end Send_Ok;
procedure Send_Ok (Channel : Communication_Channel) is
begin
String'Output (Channel.Channel, Command_Kind'Image (OK));
end Send_Ok;
-----------------
-- Send_Output --
-----------------
procedure Send_Output
(Channel : Communication_Channel; File_Name : String) is
begin
Send_File_Internal (Channel, File_Name, DP);
end Send_Output;
---------------------------
-- Send_RAW_File_Content --
---------------------------
procedure Send_RAW_File_Content
(Channel : Communication_Channel;
Path_Name : String)
is
use Ada;
type Buffer_Access is access Stream_Element_Array;
procedure Unchecked_Free is
new Unchecked_Deallocation (Stream_Element_Array, Buffer_Access);
Buffer : Buffer_Access;
Last : Stream_Element_Offset;
File : Stream_IO.File_Type;
begin
Buffer := new Stream_Element_Array (1 .. 2 * 1_024 * 1_024);
-- A somewhat large buffer is needed to transfer big file
-- efficiently. Here we use a 2Mb buffer which should be
-- large enough for read most file contents in one OS call.
--
-- This is allocated on the heap to avoid too much pressure on the
-- stack of the tasks.
-- Open the file in shared mode as multiple tasks could have
-- to send it.
Stream_IO.Open
(File, Stream_IO.In_File, Path_Name, Form => "shared=yes");
-- Always send an empty stream element array at the end.
-- This is used as EOF tag.
loop
Stream_IO.Read (File, Buffer.all, Last);
Stream_Element_Array'Output (Channel.Channel, Buffer (1 .. Last));
exit when Last = 0;
end loop;
Stream_IO.Close (File);
Unchecked_Free (Buffer);
end Send_RAW_File_Content;
-----------------------
-- Send_Slave_Config --
-----------------------
procedure Send_Slave_Config
(Channel : Communication_Channel;
Max_Process : Positive;
Root_Directory : String;
Clock_Status : Boolean) is
begin
String'Output
(Channel.Channel,
Command_Kind'Image (OK)
& Image (Max_Process)
& Args_Sep & Root_Directory
& Args_Sep & Boolean'Image (Clock_Status));
end Send_Slave_Config;
--------------------
-- Set_Rewrite_CD --
--------------------
procedure Set_Rewrite_CD
(Channel : in out Communication_Channel; Path : String) is
begin
Channel.CD_From := To_Unbounded_String (Normalize_Pathname (Path));
Channel.CD_To := To_Unbounded_String (CD_Path_Tag);
end Set_Rewrite_CD;
--------------------
-- Set_Rewrite_WD --
--------------------
procedure Set_Rewrite_WD
(Channel : in out Communication_Channel; Path : String) is
begin
Channel.WD_From := To_Unbounded_String (Path);
Channel.WD_To := To_Unbounded_String (WD_Path_Tag);
end Set_Rewrite_WD;
----------
-- Sock --
----------
function Sock (Channel : Communication_Channel) return Socket_Type is
begin
return Channel.Sock;
end Sock;
-----------------------
-- Translate_Receive --
-----------------------
function Translate_Receive
(Channel : Communication_Channel; Str : String) return String
is
P : constant Natural := Index (Str, To_String (Channel.WD_To));
begin
if P = 0 then
return Str;
else
return To_String (Channel.WD_From)
& Str (P + Length (Channel.WD_To) .. Str'Last);
end if;
end Translate_Receive;
--------------------
-- Translate_Send --
--------------------
function Translate_Send
(Channel : Communication_Channel; Str : String) return String
is
P : constant Natural := Index (Str, To_String (Channel.WD_From));
begin
if P = 0 then
return Str;
else
return To_String (Channel.WD_To)
& Str (P + Length (Channel.WD_From) .. Str'Last);
end if;
end Translate_Send;
end Gprbuild.Compilation.Protocol;
gprbuild-gpl-2014-src/src/gprinstall.adb 0000644 0000767 0000145 00000003557 12323721731 017563 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R I N S T A L L . M A I N --
-- --
-- B o d y --
-- --
-- Copyright (C) 2012, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
package body Gprinstall is
---------
-- Dup --
---------
function Dup (P : Param) return Param is
begin
return (new String'(P.V.all), P.Default);
end Dup;
----------
-- Free --
----------
procedure Free (P : in out Param) is
begin
Free (P.V);
end Free;
end Gprinstall;
gprbuild-gpl-2014-src/src/gprconfig-main.adb 0000644 0000767 0000145 00000052122 12323721731 020274 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R C O N F I G --
-- --
-- B o d y --
-- --
-- Copyright (C) 2006-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Ada.Command_Line;
with Ada.Containers; use Ada.Containers;
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Command_Line; use GNAT.Command_Line;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with GprConfig.Knowledge; use GprConfig.Knowledge;
with GprConfig.Sdefault;
with GPR_Version;
with Hostparm;
with Namet; use Namet;
with Opt;
with Prj; use Prj;
with Switch;
procedure GprConfig.Main is
Default_Output_File : constant String := "default.cgpr";
-- Name of the configuration file used by gprbuild by default
-- ??? Should be shared with gprbuild
Output_File : Unbounded_String := To_Unbounded_String (Default_Output_File);
Selected_Target : Unbounded_String;
-- Value of --target switch
Target_Specified : Boolean := False;
Selected_Targets_Set : Targets_Set_Id;
-- Targets set id for the selected target
Opt_Validate : Boolean := False;
-- Whether we should validate the contents of the knowledge base
use Compiler_Lists;
procedure Help (Base : Knowledge_Base);
-- Display list of switches
procedure Usage;
-- Display list of options, no specific to current invocation, to be used
-- when switch --help is used.
procedure Check_Version_And_Help is
new Switch.Check_Version_And_Help_G (Usage);
procedure Display_Compilers_For_Parser
(Base : in out Knowledge_Base;
Compilers : in out Compiler_Lists.List);
-- Display the list of found compilers for use by an external parser
procedure Select_Compilers_Interactively
(Base : in out Knowledge_Base;
Compilers : in out Compiler_Lists.List);
-- Ask the user for compilers to be selected
procedure Show_Command_Line_Config (Compilers : Compiler_Lists.List);
-- Display the batch command line that would have the same effect as the
-- current selection of compilers.
type Boolean_Array is array (Count_Type range <>) of Boolean;
type All_Iterator (Count : Count_Type) is new Compiler_Iterator with
record
Filter_Matched : Boolean_Array (1 .. Count) := (others => False);
Filters : Compiler_Lists.List;
Compilers : Compiler_Lists.List;
end record;
procedure Callback
(Iterator : in out All_Iterator;
Base : in out Knowledge_Base;
Comp : Compiler;
From_Extra_Dir : Boolean;
Continue : out Boolean);
-- Search all compilers on path, preselecting the first one matching each
-- of the filters.
Base : Knowledge_Base;
Filters : Compiler_Lists.List;
Load_Standard_Base : Boolean := True;
Batch : Boolean := False;
Show_Targets : Boolean := False;
Show_Compilers : Boolean := False;
Compilers : Compiler_Lists.List;
package Compiler_Sort is
new Compiler_Lists.Generic_Sorting (Display_Before);
Valid_Switches : constant String :=
"-batch -config= -db: h o: v q -show-targets"
& " -validate -mi-show-compilers -target=";
--------------
-- Callback --
--------------
procedure Callback
(Iterator : in out All_Iterator;
Base : in out Knowledge_Base;
Comp : Compiler;
From_Extra_Dir : Boolean;
Continue : out Boolean)
is
New_Comp : Compiler := Comp;
C : Compiler_Lists.Cursor;
Index : Count_Type := 1;
begin
if Iterator.Filter_Matched /=
(Iterator.Filter_Matched'Range => True)
then
C := First (Iterator.Filters);
while Has_Element (C) loop
if not Iterator.Filter_Matched (Index)
and then Filter_Match
(Base, Comp => Comp, Filter => Element (C).all)
then
Set_Selection (New_Comp, True);
Iterator.Filter_Matched (Index) := True;
exit;
end if;
Index := Index + 1;
Next (C);
end loop;
end if;
-- Ignore compilers from extra directories, unless they have been
-- selected because of a --config argument
if Is_Selected (New_Comp) or else not From_Extra_Dir then
Put_Verbose
("Adding compiler to interactive menu "
& To_String (Base, Comp, True)
& " selected=" & Is_Selected (New_Comp)'Img);
Append (Iterator.Compilers, new Compiler'(New_Comp));
end if;
Continue := True;
end Callback;
----------
-- Help --
----------
procedure Help (Base : Knowledge_Base) is
Known : Unbounded_String;
begin
Known_Compiler_Names (Base, Known);
Usage;
Put_Line (" The known compilers are: " & To_String (Known));
end Help;
----------------------------------
-- Display_Compilers_For_Parser --
----------------------------------
procedure Display_Compilers_For_Parser
(Base : in out Knowledge_Base;
Compilers : in out Compiler_Lists.List)
is
Comp : Compiler_Lists.Cursor := First (Compilers);
Count : constant Integer := Integer (Length (Compilers));
Choices : array (1 .. Count) of Compiler_Lists.Cursor;
begin
for C in Choices'Range loop
Choices (C) := Comp;
Next (Comp);
end loop;
Filter_Compilers_List (Base, Compilers, Selected_Targets_Set);
Put
(To_String
(Base,
Compilers,
Selected_Only => False,
Show_Target => True,
Parser_Friendly => True));
end Display_Compilers_For_Parser;
------------------------------------
-- Select_Compilers_Interactively --
------------------------------------
procedure Select_Compilers_Interactively
(Base : in out Knowledge_Base;
Compilers : in out Compiler_Lists.List)
is
Comp : Compiler_Lists.Cursor := First (Compilers);
Tmp : Natural;
Choice : Natural;
Line : String (1 .. 1024);
Count : constant Integer := Integer (Length (Compilers));
Choices : array (1 .. Count) of Compiler_Lists.Cursor;
begin
for C in Choices'Range loop
Choices (C) := Comp;
Next (Comp);
end loop;
loop
Filter_Compilers_List (Base, Compilers, Selected_Targets_Set);
Put_Line ("--------------------------------------------------");
Put_Line
("gprconfig has found the following compilers on your PATH.");
Put_Line
("Only those matching the target and the selected compilers"
& " are displayed.");
Put (To_String
(Base, Compilers, Selected_Only => False,
Show_Target => Selected_Targets_Set = All_Target_Sets));
Put
("Select or unselect the following compiler (or ""s"" to save): ");
Get_Line (Line, Tmp);
exit when Tmp = 1 and then Line (1) = 's';
if Tmp = 0 then
Choice := 0;
else
begin
Choice := Natural'Value (Line (1 .. Tmp));
if Choice > Choices'Last then
Choice := 0;
end if;
exception
when Constraint_Error =>
Choice := 0;
end;
end if;
if Choice = 0 then
Put_Line ("Unrecognized choice");
else
Set_Selection
(Compilers, Choices (Choice),
not Is_Selected (Element (Choices (Choice)).all));
end if;
end loop;
end Select_Compilers_Interactively;
------------------------------
-- Show_Command_Line_Config --
------------------------------
procedure Show_Command_Line_Config (Compilers : Compiler_Lists.List) is
C : Compiler_Lists.Cursor;
begin
if not Is_Empty (Compilers) then
New_Line;
Put_Line ("You can regenerate the same config file in batch mode");
Put_Line (" with the following command line:");
Put ("gprconfig --batch");
Put (" --target=");
if Selected_Target = Null_Unbounded_String then
Put ("all");
else
Put (To_String (Selected_Target));
end if;
C := First (Compilers);
while Has_Element (C) loop
if Is_Selected (Element (C).all) then
Put (" --config="
& To_String
(Base, Element (C).all, As_Config_Arg => True));
end if;
Next (C);
end loop;
New_Line;
New_Line;
end if;
end Show_Command_Line_Config;
-----------
-- Usage --
-----------
procedure Usage is
begin
Switch.Display_Usage_Version_And_Help;
Put_Line (" --target=target (" & Sdefault.Hostname & " by default)");
Put_Line
(" Select specified target or ""all"" for any target.");
Put_Line (" --show-targets : List all compiler targets available.");
Put_Line (" --mi-show-compilers : List all compilers available in a " &
"parser-friendly way.");
Put_Line (" --batch : batch mode, no interactive compiler selection.");
Put_Line (" -v : verbose mode.");
Put_Line (" -q : quiet output.");
Put_Line (" -o file : Name and directory of the output file.");
Put_Line (" default is " & To_String (Output_File));
Put_Line (" --db dir : Parse dir as an additional knowledge base.");
Put_Line (" --db- : Do not load the standard knowledge base from:");
Put_Line (" " & Default_Knowledge_Base_Directory);
Put_Line (" --validate : Validate the contents of the knowledge base");
Put_Line (" before loading.");
Put_Line (" --config=language[,version[,runtime[,path[,name]]]]");
Put_Line (" Preselect a compiler.");
Put_Line (" Name is either one of the names of the blocks");
Put_Line (" in the knowledge base ('GCC', 'GCC-28',...) or");
Put_Line (" the base name of an executable ('gcc',");
Put_Line (" 'gnatmake').");
Put_Line (" An empty string can be specified for any of the");
Put_Line (" optional parameters");
end Usage;
Saved_Verbosity : Verbosity := Default;
begin
Namet.Initialize;
Selected_Target := To_Unbounded_String (Sdefault.Hostname);
-- First, check if --version or --help is used
Check_Version_And_Help
("GPRCONFIG",
"2006",
Version_String => GPR_Version.Gpr_Version_String);
-- Now check whether we should parse the default knownledge base.
-- This needs to be done first, since that influences --config and -h
-- at least.
Initialize_Option_Scan;
loop
case Getopt (Valid_Switches) is
when '-' =>
if Full_Switch = "-db" then
if Parameter = "-" then
Load_Standard_Base := False;
end if;
elsif Full_Switch = "-validate" then
Opt_Validate := True;
elsif Full_Switch = "-target" then
Target_Specified := True;
if Parameter = "all" then
Selected_Target := Null_Unbounded_String;
else
Selected_Target := To_Unbounded_String (Parameter);
Output_File := To_Unbounded_String (Parameter & ".cgpr");
end if;
elsif Full_Switch = "-show-targets" then
-- By default, display all targets available
Selected_Target := Null_Unbounded_String;
end if;
when 'q' =>
Opt.Quiet_Output := True;
Current_Verbosity := Default;
when 'v' =>
case Current_Verbosity is
when Default => Current_Verbosity := Medium;
when others => Current_Verbosity := High;
end case;
Opt.Quiet_Output := False;
when ASCII.NUL =>
exit;
when others =>
null;
end case;
end loop;
Saved_Verbosity := Current_Verbosity;
Current_Verbosity := Default;
if Load_Standard_Base then
Parse_Knowledge_Base
(Base, Default_Knowledge_Base_Directory, Validate => Opt_Validate);
end if;
-- Now check all the other command line switches
Initialize_Option_Scan;
loop
case Getopt (Valid_Switches) is
when '-' =>
if Full_Switch = "-config" then
declare
Requires_Comp : Boolean;
Comp : Compiler_Access;
begin
Parse_Config_Parameter
(Base => Base,
Config => Parameter,
Compiler => Comp,
Requires_Compiler => Requires_Comp);
if Requires_Comp then
Append (Filters, Comp);
else
Append (Compilers, Comp);
end if;
end;
elsif Full_Switch = "-batch" then
Batch := True;
elsif Full_Switch = "-mi-show-compilers" then
Show_Compilers := True;
elsif Full_Switch = "-show-targets" then
Show_Targets := True;
elsif Full_Switch = "-db" then
if Parameter = "-" then
null; -- already processed
else
Parse_Knowledge_Base
(Base, Parameter, Validate => Opt_Validate);
end if;
end if;
when 'h' =>
Help (Base);
return;
when 'o' =>
Output_File := To_Unbounded_String (Parameter);
when 'q' | 'v' | 't' =>
null; -- already processed
when others =>
exit;
end case;
end loop;
Current_Verbosity := Saved_Verbosity;
Put_Verbose ("Only compilers matching target "
& To_String (Selected_Target)
& " will be preserved");
Get_Targets_Set
(Base, To_String (Selected_Target), Selected_Targets_Set);
if Batch or Hostparm.OpenVMS then
Complete_Command_Line_Compilers
(Base,
Selected_Targets_Set,
Filters,
Compilers);
else
declare
Iter : All_Iterator (Length (Filters));
begin
Iter.Filters := Filters;
Foreach_Compiler_In_Path
(Iterator => Iter,
Base => Base,
On_Target => Selected_Targets_Set,
Extra_Dirs => Extra_Dirs_From_Filters (Filters));
Splice (Target => Compilers,
Before => No_Element,
Source => Iter.Compilers);
end;
if Show_Targets or else Current_Verbosity /= Default then
declare
use String_Lists;
All_Target : String_Lists.List;
C : Compiler_Lists.Cursor := First (Compilers);
begin
Put_Line ("List of targets supported by a compiler:");
while Has_Element (C) loop
if Target (Element (C).all) /= No_Name then
declare
Cur_Target : constant String :=
Get_Name_String (Target (Element (C).all));
T : String_Lists.Cursor := First (All_Target);
Dup : Boolean := False;
begin
while Has_Element (T) loop
if Element (T) = Cur_Target then
Dup := True;
exit;
end if;
Next (T);
end loop;
if not Dup then
Put (Cur_Target);
if Cur_Target = Sdefault.Hostname then
Put (" (native target)");
end if;
New_Line;
Append (All_Target, Cur_Target);
end if;
end;
end if;
Next (C);
end loop;
end;
if Show_Targets then
return;
end if;
end if;
if Is_Empty (Compilers) then
if Selected_Target /= Null_Unbounded_String then
Put_Line
(Standard_Error,
"No compilers found for target " & To_String (Selected_Target));
else
Put_Line (Standard_Error, "No compilers found");
end if;
Ada.Command_Line.Set_Exit_Status (1);
return;
end if;
Compiler_Sort.Sort (Compilers);
if Show_Compilers then
Display_Compilers_For_Parser (Base, Compilers);
return;
else
Select_Compilers_Interactively (Base, Compilers);
Show_Command_Line_Config (Compilers);
end if;
end if;
if not Target_Specified then
Get_Targets_Set
(Base, GprConfig.Sdefault.Hostname, Selected_Targets_Set);
Selected_Target :=
To_Unbounded_String (Normalized_Target (Base, Selected_Targets_Set));
end if;
if Output_File /= Null_Unbounded_String then
-- Look for runtime directories XML files
declare
Cursor : Compiler_Lists.Cursor;
Comp : Compiler_Access;
begin
Cursor := Compiler_Lists.First (Compilers);
while Compiler_Lists.Has_Element (Cursor) loop
Comp := Compiler_Lists.Element (Cursor);
if Runtime_Dir_Of (Comp) /= No_Name then
declare
RTS : constant String :=
Get_Name_String (Runtime_Dir_Of (Comp));
Last : Natural := RTS'Last;
begin
if RTS (Last) = '/' or else
RTS (Last) = Directory_Separator
then
Last := Last - 1;
end if;
if Last - RTS'First > 6 and then
RTS (Last - 5 .. Last) = "adalib" and then
(RTS (Last - 6) = Directory_Separator or else
(RTS (Last - 6) = '/'))
then
Last := Last - 6;
else
Last := RTS'Last;
end if;
Parse_Knowledge_Base (Base, RTS (RTS'First .. Last));
end;
end if;
Compiler_Lists.Next (Cursor);
end loop;
end;
Generate_Configuration
(Base,
Compilers,
To_String (Output_File),
To_String (Selected_Target));
end if;
exception
when Invalid_Config =>
Put_Line
(Standard_Error, "Invalid configuration specified with --config");
Ada.Command_Line.Set_Exit_Status (1);
when Generate_Error =>
Put_Line
(Standard_Error, "Generation of configuration files failed");
Ada.Command_Line.Set_Exit_Status (3);
when E : Knowledge_Base_Validation_Error =>
Put_Verbose (Exception_Information (E));
Ada.Command_Line.Set_Exit_Status (4);
when E : Invalid_Knowledge_Base =>
Put_Line
(Standard_Error, "Invalid setup of the gprconfig knowledge base");
Put_Verbose (Exception_Information (E));
Ada.Command_Line.Set_Exit_Status (4);
when End_Error =>
null;
when Invalid_Switch | Invalid_Parameter =>
Put_Line ("Invalid command line switch: -" & Full_Switch);
Try_Help;
Ada.Command_Line.Set_Exit_Status (2);
end GprConfig.Main;
gprbuild-gpl-2014-src/src/create_ada_runtime_project.adb 0000644 0000767 0000145 00000030570 12323721731 022740 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT SYSTEM UTILITIES --
-- --
-- C R E A T E _ A D A _ R U N T I M E _ P R O J E C T --
-- --
-- B o d y --
-- --
-- Copyright (C) 2006-2012, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- This utility creates the Ada runtime project file ada_runtime.gpr
-- This project file resides in the parent directory of adainclude (the source
-- directory) and adalib (the object directory). It is "externally built". Its
-- package Naming gives the mapping of the source file names to unit names.
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Command_Line; use GNAT.Command_Line;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with GNAT.HTable; use GNAT.HTable;
procedure Create_Ada_Runtime_Project is
Err : exception;
-- Raised to terminate execution
Project_File : Ada.Text_IO.File_Type;
-- The project file being created
Adainclude : String_Access := new String'("adainclude");
-- The path name of the adainclude directory, given as argument of the
-- utility.
Dir : Dir_Type;
Str : String (1 .. 1_000);
Last : Natural;
Gcc : constant String := "gcc";
Gcc_Path : String_Access;
Args : Argument_List (1 .. 6) :=
(1 => new String'("-c"),
2 => new String'("-gnats"),
3 => new String'("-gnatu"),
4 => new String'("-x"),
5 => new String'("ada"),
6 => null);
-- The arguments used when invoking the Ada compiler to get the name and
-- kind (spec or body) of the unit contained in a source file.
Success : Boolean;
Return_Code : Integer;
Mapping_File_Name : String_Access := new String'("gnat_runtime.mapping");
-- Location of the default mapping file.
Output_File : String_Access := new String'("ada_runtime.gpr");
-- Name of the final project file being created
Output_File_Name : constant String := "output.txt";
Output : Ada.Text_IO.File_Type;
-- The text file where the output of the compiler invocation is stored.
-- This is temporary output from gcc
Line : String (1 .. 1_000);
Line_Last : Natural;
Spec : Boolean;
Verbose_Mode : Boolean := False;
-- True if switch -v is used
subtype Header_Num is Natural range 0 .. 4095;
function Hash (Key : String_Access) return Header_Num;
function Equal (K1, K2 : String_Access) return Boolean;
type Element is record
Spec : Boolean := False;
Unit : String_Access := null;
end record;
No_Element : constant Element := (False, null);
package Mapping is new GNAT.HTable.Simple_HTable
(Header_Num => Header_Num,
Element => Element,
No_Element => No_Element,
Key => String_Access,
Hash => Hash,
Equal => Equal);
-- A hash table to keep the mapping of source file names to unit names
-- found in file gnat_runtime.mapping.
Key : String_Access;
Elem : Element;
function Hash is new GNAT.HTable.Hash (Header_Num);
procedure Get_Mapping (Mapping_File : String);
-- Read file mapping file to get the mapping of source file names
-- to unit names and populate hash table Mapping.
-- If the file doesn't exist, nothing is done, but
-- Create_Ada_Runtime_Project will execute more slowly
procedure Fail (S : String);
-- Outputs S to Standard_Error, followed by a newline and then raises the
-- exception Err.
procedure Help;
-- Display help on using this application
-----------
-- Equal --
-----------
function Equal (K1, K2 : String_Access) return Boolean is
begin
if K1 = null or else K2 = null then
return K1 = K2;
else
return K1.all = K2.all;
end if;
end Equal;
----------
-- Fail --
----------
procedure Fail (S : String) is
begin
Put_Line (Standard_Error, S);
raise Err;
end Fail;
-----------------
-- Get_Mapping --
-----------------
procedure Get_Mapping (Mapping_File : String) is
File : File_Type;
Line : String (1 .. 1_000);
Last : Natural;
begin
Open (File, In_File, Mapping_File);
while not End_Of_File (File) loop
Get_Line (File, Line, Last);
-- Skip the line if it is a comment line
if Last > 2 and then Line (1 .. 2) /= "--" then
Key := new String'(Line (1 .. Last));
Get_Line (File, Line, Last);
Elem.Spec := Line (1 .. Last) = "spec";
Get_Line (File, Line, Last);
Elem.Unit := new String'(Line (1 .. Last));
Mapping.Set (Key, Elem);
end if;
end loop;
Close (File);
exception
when others =>
if Is_Open (File) then
Close (File);
end if;
if Verbose_Mode then
Put_Line (Standard_Error, "Could not read " & Mapping_File);
end if;
end Get_Mapping;
----------
-- Hash --
----------
function Hash (Key : String_Access) return Header_Num is
begin
if Key = null then
return 0;
else
return Hash (Key.all);
end if;
end Hash;
----------
-- Help --
----------
procedure Help is
begin
Put_Line (" -adainclude : Location of the adainclude directory");
Put_Line (" -mapping : Location of the pre-built mapping file");
Put_Line (" -o : Output file name");
Put_Line (" -v : Verbose mode");
Put_Line (" Default is " & Output_File.all);
end Help;
-- Start of processing for Create_Ada_Runtime_Project
begin
-- The utility needs to be invoked with only one argument: the path name
-- of the adainclude directory.
loop
case Getopt ("adainclude: o: mapping: h v") is
when 'a' =>
Free (Adainclude);
Adainclude := new String'(Parameter);
when 'm' =>
Free (Mapping_File_Name);
Mapping_File_Name := new String'(Parameter);
when 'o' =>
Free (Output_File);
Output_File := new String'(Parameter);
when 'h' =>
Help;
return;
when 'v' =>
Verbose_Mode := True;
when others =>
exit;
end case;
end loop;
Gcc_Path := Locate_Exec_On_Path (Gcc);
if Gcc_Path = null then
Fail ("cannot find " & Gcc);
end if;
Get_Mapping (Mapping_File_Name.all);
-- Change the working directory to the adainclude directory
begin
Change_Dir (Adainclude.all);
exception
when Directory_Error =>
Fail ("cannot find adainclude directory " & Adainclude.all);
end;
-- Create the project file in the parent directory of adainclude
Create (Project_File, Out_File, Output_File.all);
-- Put the first lines that are always the same
Put_Line (Project_File, "project Ada_Runtime is");
New_Line (Project_File);
Put_Line (Project_File, " for Languages use (""Ada"");");
Put_Line (Project_File, " for Source_Dirs use ("""
& Adainclude.all & """);");
Put_Line (Project_File, " for Object_Dir use """
& Adainclude.all
& ".." & Directory_Separator & "adalib"";");
New_Line (Project_File);
Put_Line (Project_File, " for Externally_Built use ""true"";");
New_Line (Project_File);
Put_Line (Project_File, " package Naming is");
Open (Dir, ".");
-- For each regular file in the adainclude directory, invoke the compiler
-- to get the unit name.
loop
Read (Dir, Str, Last);
exit when Last = 0;
if Is_Regular_File (Str (1 .. Last)) then
Key := new String'(Str (1 .. Last));
Elem := Mapping.Get (Key);
-- Mapping found in hash table
if Elem /= No_Element then
if To_Lower (Elem.Unit.all) /= Str (1 .. Last - 4) then
Put (Project_File, " for ");
if Elem.Spec then
Put (Project_File, "Spec (""");
else
Put (Project_File, "Body (""");
end if;
Put (Project_File, Elem.Unit.all);
Put (Project_File, """) use """);
Put (Project_File, Str (1 .. Last));
Put_Line (Project_File, """;");
end if;
-- Case where Mapping.Get returned no element: use the compiler
-- to get the unit name.
else
Args (Args'Last) := new String'(Str (1 .. Last));
if Verbose_Mode then
Put (Gcc_Path.all);
for J in Args'Range loop
Put (' ' & Args (J).all);
end loop;
New_Line;
end if;
Spawn (Gcc_Path.all, Args, Output_File_Name, Success, Return_Code);
if Success then
Open (Output, In_File, Output_File_Name);
if not End_Of_File (Output) then
Get_Line (Output, Line, Line_Last);
-- Find the first closing parenthesis
Char_Loop : for J in 1 .. Line_Last loop
if Line (J) = ')' then
if J >= 13 and then Line (1 .. 4) = "Unit" then
-- No need for a spec or body declaration if the
-- file name is as expected.
if To_Lower (Line (6 .. J - 7)) /=
Str (1 .. Last - 4)
then
Spec := Line (J - 5 .. J) = "(spec)";
Put (Project_File, " for ");
if Spec then
Put (Project_File, "Spec (""");
else
Put (Project_File, "Body (""");
end if;
Put (Project_File, Line (6 .. J - 7));
Put (Project_File, """) use """);
Put (Project_File, Str (1 .. Last));
Put_Line (Project_File, """;");
end if;
end if;
exit Char_Loop;
end if;
end loop Char_Loop;
end if;
Close (Output);
end if;
end if;
end if;
end loop;
-- Put the closing lines and close the project file
Put_Line (Project_File, " end Naming;");
New_Line (Project_File);
Put_Line (Project_File, "end Ada_Runtime;");
Close (Project_File);
-- Clean up: delete the output file
Delete_File (Output_File_Name, Success);
exception
when Invalid_Switch | Invalid_Parameter =>
Put_Line ("Invalid switch: " & Full_Switch);
Help;
when Err =>
Set_Exit_Status (1);
when others =>
Put_Line ("unexpected exception");
raise;
end Create_Ada_Runtime_Project;
gprbuild-gpl-2014-src/src/gprconfig-sdefault.ads.in 0000644 0000767 0000145 00000004063 12323721731 021606 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R C O N F I G --
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2012, 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 2, 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 COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package GprConfig.Sdefault is
pragma Warnings (Off);
Hostname : constant String := "@host@";
end GprConfig.Sdefault;
gprbuild-gpl-2014-src/src/forcomp.adb 0000644 0000767 0000145 00000016275 12323721731 017052 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- F O R C O M P --
-- --
-- B o d y --
-- --
-- Copyright (C) 2010-2012, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- This program is used on VMS as a front end to invoke the DEC Fortran
-- compiler.
pragma Extend_System (Aux_DEC);
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with Osint; use Osint;
with System; use System;
procedure Forcomp is
subtype Cond_Value_Type is System.Unsigned_Longword;
Output_File_Name : String_Access;
procedure Spawn (Status : out Cond_Value_Type; Command : String;
Input_File : String := String'Null_Parameter;
Output_File : String := String'Null_Parameter);
pragma Import (External, Spawn);
pragma Import_Valued_Procedure
(Spawn, "LIB$SPAWN",
(Cond_Value_Type, String, String, String),
(Value, Descriptor (S), Descriptor (S), Descriptor (S)));
-- LIB$SPAWN is used to invoke the compiler
procedure Stop (Status : Cond_Value_Type);
pragma Import (External, Stop);
pragma Import_Procedure (Stop, "LIB$STOP", Mechanism => Value);
-- LIB$STOP is used to set the error code when the invocation of the
-- compiler fails.
Success : constant Cond_Value_Type := 1;
Command : constant String := "fortran";
Status : Cond_Value_Type;
Include_Directory : constant String := "/INCLUDE=";
Output_File : constant String := "-o";
Verbose : Boolean := False;
procedure Add
(S : in out String_Access;
Last : in out Natural;
Value : String);
-- Add string Value to string variable S, updating Last
---------
-- Add --
---------
procedure Add
(S : in out String_Access;
Last : in out Natural;
Value : String)
is
begin
while S'Last < Last + Value'Length loop
declare
New_S : constant String_Access := new String (1 .. 2 * S'Last);
begin
New_S (1 .. Last) := S (1 .. Last);
Free (S);
S := New_S;
end;
end loop;
S (Last + 1 .. Last + Value'Length) := Value;
Last := Last + Value'Length;
end Add;
begin
declare
Command_String : String_Access := new String (1 .. 40);
-- This is the command string that will be used to invoke the compiler
Last_Command : Natural := 0;
Includes : String_Access := new String (1 .. 40);
-- As they can be only one /INCLUDE= option, we regroupe all directories
-- in string Includes.
Last_Include : Natural := 0;
Arg_Num : Natural;
begin
Add (Command_String, Last_Command, Command);
Arg_Num := 0;
while Arg_Num < Argument_Count loop
Arg_Num := Arg_Num + 1;
declare
Arg : constant String := Argument (Arg_Num);
begin
-- If this command is /INCLUDE=, add the directory to string
-- Includes.
if Arg'Length > Include_Directory'Length and then
Arg (Arg'First .. Arg'First + Include_Directory'Length - 1) =
Include_Directory
then
if Last_Include = 0 then
Add (Includes, Last_Include, Include_Directory & "(");
else
Add (Includes, Last_Include, ",");
end if;
declare
Dir : constant String :=
Arg (Arg'First + Include_Directory'Length .. Arg'Last);
New_Dir : String_Access;
begin
if Is_Directory (Dir) then
New_Dir := To_Host_Dir_Spec (Dir, False);
Add (Includes, Last_Include, New_Dir.all);
else
Add (Includes, Last_Include, Dir);
end if;
end;
-- If it is "-o", the next argument is the output file
elsif Arg = Output_File then
if Arg_Num < Argument_Count then
Arg_Num := Arg_Num + 1;
Output_File_Name := To_Host_File_Spec (Argument (Arg_Num));
end if;
-- If it is "-v", skip the argument and set Verbose to True
elsif Arg = "-v" then
Verbose := True;
-- Otherwise, add argument to the command string
else
declare
New_Arg : String_Access;
begin
if Is_Regular_File (Arg) then
New_Arg := To_Host_File_Spec (Arg);
elsif Is_Directory (Arg) then
New_Arg := To_Host_Dir_Spec (Arg, False);
end if;
if New_Arg /= null then
Add (Command_String, Last_Command, " " & New_Arg.all);
else
Add (Command_String, Last_Command, " " & Arg);
end if;
end;
end if;
end;
end loop;
-- If there was at least one /INCLUDE= switch, add /INCLUDE= with all
-- directories to the command string.
if Last_Include /= 0 then
Add
(Command_String,
Last_Command,
" " & Includes (1 .. Last_Include) & ")");
end if;
-- Invoke Fortran
declare
Cmd : constant String (1 .. Last_Command) :=
Command_String (1 .. Last_Command);
begin
if Verbose then
Put_Line (Cmd);
end if;
if Output_File_Name /= null then
Spawn (Status, Cmd, Output_File => Output_File_Name.all);
else
Spawn (Status, Cmd);
end if;
if (Status mod 2) /= Success then
Stop (Status);
end if;
end;
end;
end Forcomp;
gprbuild-gpl-2014-src/src/gprbuild-compilation-slave.adb 0000644 0000767 0000145 00000074313 12323721731 022636 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R B U I L D . C O M P I L A T I O N . S L A V E --
-- --
-- B o d y --
-- --
-- Copyright (C) 2012-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Ada.Calendar; use Ada.Calendar;
with Ada.Containers.Ordered_Sets;
with Ada.Containers.Vectors; use Ada;
with Ada.Directories; use Ada.Directories;
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Strings.Maps.Constants; use Ada.Strings;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with GNAT.Sockets; use GNAT; use GNAT.Sockets;
with GNAT.String_Split; use GNAT.String_Split;
with Output; use Output;
with Snames; use Snames;
with Gpr_Util; use Gpr_Util;
with Gprbuild.Compilation.Protocol; use Gprbuild.Compilation.Protocol;
with Gprbuild.Compilation.Result;
with Gprbuild.Compilation.Sync;
package body Gprbuild.Compilation.Slave is
type Slave_Data is record
Host : Unbounded_String;
User : Unbounded_String;
Port : Port_Type;
Sync : Sync_Kind;
end record;
No_Slave_Data : constant Slave_Data :=
(Port => Port_Type'Last, others => <>);
package Slaves_N is new Containers.Vectors (Positive, Slave_Data);
Slaves_Data : Slaves_N.Vector;
type Slave is record
Sock : Integer;
Data : Slave_Data;
Channel : Communication_Channel;
Current : Natural := 0;
Max_Processes : Positive := 1;
Root_Dir : Unbounded_String;
Rsync_Pid : Process_Id;
Included_Artifact_Patterns : Str_Vect.Vector;
end record;
function "<" (K1, K2 : Slave) return Boolean is (K1.Sock < K2.Sock);
function "=" (K1, K2 : Slave) return Boolean is (K1.Sock = K2.Sock);
No_Slave : constant Slave :=
(-1, No_Slave_Data, Current => Natural'Last, others => <>);
package Slave_S is new Containers.Ordered_Sets (Slave);
-- The key is the C socket number
function Connect_Slave
(S_Data : Slave_Data;
Project_Name : String) return Slave;
-- Connect to the slave and return the corresponding object
-- Ack transient signal stored into this variable
protected Wait_Ack is
procedure Set (Pid : Remote_Id);
entry Get (Pid : out Remote_Id);
private
Is_Set : Boolean := False;
Id : Remote_Id;
end Wait_Ack;
task type Wait_Remote;
-- Wait for incoming data from all registred slaves
type Wait_Remote_Ref is access Wait_Remote;
WR : Wait_Remote_Ref;
-- Will be initialized only if the distributed mode is activated
Compiler_Path : constant OS_Lib.String_Access :=
Locate_Exec_On_Path ("gnatls");
Project_Name : Unbounded_String;
-- Current project name being compiled
Root_Dir : Unbounded_String;
-- Root directory from where the sources are to be synchronized with the
-- slaves. This is by default the directory containing the main project
-- file. The value is changed with the Root_Dir attribute value of the
-- project file's Remote package.
Remote_Process : Shared_Counter;
Slaves_Sockets : Socket_Set_Type;
Max_Processes : Natural := 0;
protected Slaves is
procedure Insert (S : Slave);
-- Add a slave into the pool
function Find (Socket : Integer) return Slave;
-- Find a slave given the socket number
function Get_Free return Slave;
-- Returns a slave with free compilation slot
function Count return Natural;
-- Returns the number of registered slaves
procedure Increment_Current (S : in out Slave);
-- Increment the number of processes handled by slave
procedure Decrement_Current (S : in out Slave);
-- Decrement the number of processes handled by slave
procedure Set_Rewrite_CD (S : in out Slave; Path : String);
-- Record rewriting of the compiler directory
procedure Set_Rewrite_WD (S : in out Slave; Path : String);
-- Record rewriting of the wording directory
procedure Iterate (Proc : access procedure (S : in out Slave));
-- Iterate over all slaves in the pool and call proc
procedure Clear;
-- Clear the pool
private
Pool : Slave_S.Set;
end Slaves;
----------------------------
-- Clean_Up_Remote_Slaves --
----------------------------
procedure Clean_Up_Remote_Slaves
(Tree : Project_Tree_Ref;
Project : Project_Id)
is
pragma Unreferenced (Tree);
procedure Clean_Up_Remote_Slave
(S_Data : Slave_Data;
Project_Name : String);
-- Clean-up slave
---------------------------
-- Clean_Up_Remote_Slave --
---------------------------
procedure Clean_Up_Remote_Slave
(S_Data : Slave_Data;
Project_Name : String)
is
function User_Host return String is
(if S_Data.User = Null_Unbounded_String
then To_String (S_Data.Host)
else To_String (S_Data.User) & '@' & To_String (S_Data.Host));
S : Slave;
begin
-- Only clean-up when the sources are not shared
if S_Data.Sync = Protocol.Rsync then
S := Connect_Slave (S_Data, Project_Name);
-- Send the clean-up request
Protocol.Send_Clean_Up (S.Channel, Project_Name);
declare
Cmd : constant Command := Get_Command (S.Channel);
begin
if Kind (Cmd) = OK then
if Opt.Verbose_Mode then
Write_Line
("Clean-up done on " & To_String (S_Data.Host));
end if;
elsif Kind (Cmd) = KO then
Write_Line ("Slave cannot clean-up " & User_Host);
OS_Exit (1);
else
Write_Line
("protocol error: " & Command_Kind'Image (Kind (Cmd)));
OS_Exit (1);
end if;
end;
Protocol.Send_End_Of_Compilation (S.Channel);
Close (S.Channel);
end if;
end Clean_Up_Remote_Slave;
begin
for S of Slaves_Data loop
Clean_Up_Remote_Slave (S, Get_Name_String (Project.Name));
end loop;
end Clean_Up_Remote_Slaves;
-------------------
-- Connect_Slave --
-------------------
function Connect_Slave
(S_Data : Slave_Data;
Project_Name : String) return Slave
is
Address : Sock_Addr_Type;
Sock : Socket_Type;
S : Slave;
Status : Selector_Status;
begin
S.Data := S_Data;
if S.Data.Host = Null_Unbounded_String then
Write_Line ("A slave must have a name, aborting");
OS_Exit (1);
end if;
Address.Addr := Addresses
(Get_Host_By_Name (To_String (S.Data.Host)), 1);
Address.Port := S_Data.Port;
Create_Socket (Sock);
Set_Socket_Option (Sock, Socket_Level, (Reuse_Address, True));
Connect_Socket (Sock, Address, Timeout => 2.0, Status => Status);
if Status in Expired .. Aborted then
Write_Line
("Cannot connect to slave "
& To_String (S.Data.Host) & ", aborting");
OS_Exit (1);
end if;
S.Channel := Create (Sock);
-- Do initial handshake
Protocol.Send_Context
(S.Channel, Get_Target, Project_Name, Slave_Env.all, S.Data.Sync);
declare
Cmd : constant Command := Get_Command (S.Channel);
Parameters : constant Argument_List_Access := Args (Cmd);
begin
if Kind (Cmd) = OK and then Parameters'Length = 3 then
S.Max_Processes := Natural'Value (Parameters (1).all);
S.Root_Dir := To_Unbounded_String (Parameters (2).all);
if not Boolean'Value (Parameters (3).all) then
Write_Line
("warning: non synchronized clock detected for "
& To_String (S.Data.Host));
end if;
elsif Kind (Cmd) = KO then
Write_Line
("build slave is not compatible : " & To_String (S.Data.Host));
OS_Exit (1);
else
Write_Line ("protocol error: " & Command_Kind'Image (Kind (Cmd)));
OS_Exit (1);
end if;
end;
return S;
end Connect_Slave;
-----------------------
-- Get_Max_Processes --
-----------------------
function Get_Max_Processes return Natural is
begin
return Max_Processes;
end Get_Max_Processes;
-------------------
-- Record_Slaves --
-------------------
procedure Record_Slaves (Option : String) is
S : Slice_Set;
procedure Parse_Build_Slave (V : String);
-- Parse the build slave V
-----------------------
-- Parse_Build_Slave --
-----------------------
procedure Parse_Build_Slave (V : String) is
User : Unbounded_String;
Host : Unbounded_String;
Port : Port_Type := Default_Port;
Sync : Sync_Kind := Protocol.Rsync;
F : Natural := V'First;
I : Natural := Index (V, "://");
begin
-- Check for protocol
if I /= 0 then
if V (F .. I - 1) = "rsync" then
Sync := Protocol.Rsync;
elsif V (F .. I - 1) = "gpr" then
Sync := Gpr;
else
Write_Line ("error: unknown protocol in " & V);
OS_Exit (1);
end if;
F := I + 3;
end if;
-- Check for user
I := Index (V, "@", From => F);
if I /= 0 then
User := To_Unbounded_String (V (F .. I - 1));
F := I + 1;
end if;
-- Get for port
I := Index (V, ":", From => F);
if I = 0 then
Host := To_Unbounded_String (V (F .. V'Last));
else
Host := To_Unbounded_String (V (F .. I - 1));
declare
Port_Str : constant String := V (I + 1 .. V'Last);
begin
if Strings.Maps.Is_Subset
(Maps.To_Set (Port_Str),
Maps.Constants.Decimal_Digit_Set)
then
Port := Port_Type'Value (V (I + 1 .. V'Last));
else
Write_Line ("error: invalid port value in " & V);
OS_Exit (1);
end if;
end;
end if;
Slaves_Data.Append (Slave_Data'(Host, User, Port, Sync));
end Parse_Build_Slave;
begin
Create (S, Option, ",");
for K in 1 .. Slice_Count (S) loop
Parse_Build_Slave (Slice (S, K));
end loop;
end Record_Slaves;
----------------------------
-- Register_Remote_Slaves --
----------------------------
procedure Register_Remote_Slaves
(Tree : Project_Tree_Ref;
Project : Project_Id)
is
use type Containers.Count_Type;
procedure Register_Remote_Slave
(S_Data : Slave_Data;
Project_Name : String);
-- Register a slave living on Host for the given project name. User is
-- used when calling rsync, it is the remote machine user name, if empty
-- the local user name is used.
Start, Stop : Calendar.Time;
procedure Insert
(V : out Str_Vect.Vector;
Values : String_List_Id);
-- Inserts all values into the vector
Excluded_Patterns : Str_Vect.Vector;
Included_Patterns : Str_Vect.Vector;
Included_Artifact_Patterns : Str_Vect.Vector;
------------
-- Insert --
------------
procedure Insert
(V : out Str_Vect.Vector;
Values : String_List_Id)
is
Idx : String_List_Id := Values;
begin
while Idx /= Nil_String loop
declare
Item : constant String_Element :=
Tree.Shared.String_Elements.Table (Idx);
begin
V.Append (Get_Name_String (Item.Value));
Idx := Item.Next;
end;
end loop;
end Insert;
---------------------------
-- Register_Remote_Slave --
---------------------------
procedure Register_Remote_Slave
(S_Data : Slave_Data;
Project_Name : String)
is
function User_Host return String is
(if S_Data.User = Null_Unbounded_String
then To_String (S_Data.Host)
else To_String (S_Data.User) & '@' & To_String (S_Data.Host));
S : Slave;
begin
S := Connect_Slave (S_Data, Project_Name);
Set (Slaves_Sockets, Sock (S.Channel));
-- Sum the Max_Process values
Max_Processes := Max_Processes + S.Max_Processes;
if Opt.Verbose_Mode then
Write_Str ("Register slave " & User_Host & ",");
Write_Str (Integer'Image (S.Max_Processes));
Write_Line (" process(es)");
Write_Line (" location: " & To_String (S.Root_Dir));
end if;
-- Let's double check that Root_Dir and Projet_Name are not empty,
-- this is a safety check to avoid rsync detroying remote environment
-- as rsync is using the --delete options.
if Length (S.Root_Dir) = 0 then
Write_Line ("error: Root_Dir cannot be empty");
OS_Exit (1);
end if;
if Project_Name = "" then
Write_Line ("error: Project_Name cannot be empty");
OS_Exit (1);
end if;
Compilation.Sync.To_Slave
(Sync => S_Data.Sync,
Channel => S.Channel,
Project_Name => Project_Name,
Root_Dir => To_String (Root_Dir),
Slave_Root_Dir => To_String (S.Root_Dir),
Host => To_String (S_Data.Host),
User => To_String (S_Data.User),
Included_Patterns => Included_Patterns,
Excluded_Patterns => Excluded_Patterns);
-- Now that all slave's data is known and set, record it
S.Sock := To_C (Sock (S.Channel));
S.Included_Artifact_Patterns := Included_Artifact_Patterns;
Slaves.Insert (S);
end Register_Remote_Slave;
Pcks : Package_Table.Table_Ptr renames Tree.Shared.Packages.Table;
Pck : Package_Id := Project.Decl.Packages;
begin
Project_Name := To_Unbounded_String (Get_Name_String (Project.Name));
Root_Dir := To_Unbounded_String
(Containing_Directory (Get_Name_String (Project.Path.Display_Name)));
-- Check for Root_Dir attribute and Excluded_Patterns
Look_Remote_Package : while Pck /= No_Package loop
if Pcks (Pck).Decl /= No_Declarations
and then Pcks (Pck).Name = Name_Remote
then
declare
Id : Variable_Id := Pcks (Pck).Decl.Attributes;
begin
while Id /= No_Variable loop
declare
V : constant Variable :=
Tree.Shared.Variable_Elements.Table (Id);
begin
if not V.Value.Default then
if V.Name = Name_Root_Dir then
declare
RD : constant String :=
Get_Name_String (V.Value.Value);
begin
if Is_Absolute_Path (RD) then
Root_Dir := To_Unbounded_String (RD);
else
Root_Dir := To_Unbounded_String
(Normalize_Pathname
(To_String (Root_Dir)
& Directory_Separator & RD));
end if;
if not Exists (To_String (Root_Dir))
or else not Is_Directory (To_String (Root_Dir))
then
Write_Line
("error: " & To_String (Root_Dir)
& " is not a directory"
& " or does not exists");
OS_Exit (1);
else
Write_Line
("root dir : " & To_String (Root_Dir));
end if;
end;
elsif V.Name = Name_Excluded_Patterns then
Insert (Excluded_Patterns, V.Value.Values);
elsif V.Name = Name_Included_Patterns then
Insert (Included_Patterns, V.Value.Values);
elsif V.Name = Name_Included_Artifact_Patterns then
Insert (Included_Artifact_Patterns, V.Value.Values);
end if;
end if;
end;
Id := Tree.Shared.Variable_Elements.Table (Id).Next;
end loop;
end;
end if;
Pck := Pcks (Pck).Next;
end loop Look_Remote_Package;
-- Check if Excluded_Patterns and Included_Patterns are set
if Included_Patterns.Length /= 0
and then Excluded_Patterns.Length /= 0
then
Write_Line
("error: Excluded_Patterns and Included_Patterns are exclusive");
OS_Exit (1);
end if;
-- Then registers the build slaves
Start := Calendar.Clock;
for S of Slaves_Data loop
Register_Remote_Slave (S, To_String (Project_Name));
end loop;
Sync.Wait;
Stop := Calendar.Clock;
if Opt.Verbose_Mode then
Write_Str (" All data synchronized in ");
Write_Str (Duration'Image (Stop - Start));
Write_Line (" seconds");
end if;
-- We are in remote mode, the initialization was successful, start tasks
-- now.
if WR = null then
WR := new Wait_Remote;
end if;
end Register_Remote_Slaves;
---------
-- Run --
---------
function Run
(Project : Project_Id;
Language : String;
Options : GNAT.OS_Lib.Argument_List;
Obj_Name : String;
Dep_Name : String := "";
Env : String := "") return Id
is
CWD : constant String := Current_Directory;
-- CWD is the directory from which the command is run
RD : constant String := To_String (Root_Dir);
S : Slave := Slaves.Get_Free;
-- Get a free slave for conducting the compilation
function Filter_String
(O : String; Sep : String := WD_Path_Tag) return String;
-- Make O PATH relative to RD. For option -gnatec and -gnatem makes
-- the specified filename absolute in the slave environment and send
-- the file to the slave.
-------------------
-- Filter_String --
-------------------
function Filter_String
(O : String;
Sep : String := WD_Path_Tag) return String
is
Pos : constant Natural := Index (O, RD);
begin
if Pos = 0 then
return O;
else
-- Note that we transfer files only when they are under the
-- project root.
if O'Length > 8
and then O (O'First .. O'First + 7) in "-gnatem=" | "-gnatec="
then
-- Send the corresponding file to the slave
declare
File_Name : constant String := O (O'First + 8 .. O'Last);
begin
if Exists (File_Name) then
Send_File (S.Channel, File_Name, Rewrite => True);
else
Write_Line
("File not found " & File_Name);
Write_Line
("Please check that Built_Root is properly set");
end if;
return O (O'First .. O'First + 7)
& Translate_Send (S.Channel, File_Name);
end;
end if;
return O (O'First .. Pos - 1)
& Sep & Filter_String (O (Pos + RD'Length + 1 .. O'Last));
end if;
end Filter_String;
Pid : Remote_Id;
begin
-- Record the rewrite information for this channel only if we are not
-- using a shared directory.
Slaves.Set_Rewrite_WD (S, Path => RD);
if Compiler_Path /= null then
Slaves.Set_Rewrite_CD
(S,
Path => Containing_Directory
(Containing_Directory (Compiler_Path.all)));
end if;
Send_Exec
(S.Channel,
Get_Name_String (Project.Path.Display_Name),
Filter_String (CWD, Sep => ""),
Language, Options, Obj_Name, Dep_Name, Env,
Filter_String'Access);
Remote_Process.Increment;
-- Wait for the Ack from the remore host, this is set by the Wait_Remote
-- task.
Wait_Ack.Get (Pid);
return Create_Remote (Pid);
exception
when E : others =>
Write_Line ("Unexpected exception: " & Exception_Information (E));
OS_Exit (1);
end Run;
------------
-- Slaves --
------------
protected body Slaves is
--------------------
-- Change_Current --
--------------------
procedure Change_Current (S : in out Slave; Value : Integer) is
Position : constant Slave_S.Cursor := Pool.Find (S);
begin
Pool (Position).Current := Pool (Position).Current + Value;
end Change_Current;
-----------
-- Clear --
-----------
procedure Clear is
begin
Pool.Clear;
end Clear;
-----------
-- Count --
-----------
function Count return Natural is
begin
return Natural (Pool.Length);
end Count;
-----------------------
-- Decrement_Current --
-----------------------
procedure Decrement_Current (S : in out Slave) is
begin
Change_Current (S, -1);
end Decrement_Current;
----------
-- Find --
----------
function Find (Socket : Integer) return Slave is
S : constant Slave := (Sock => Socket, others => <>);
Position : constant Slave_S.Cursor := Pool.Find (S);
begin
if Slave_S.Has_Element (Position) then
return Slave_S.Element (Position);
else
return No_Slave;
end if;
end Find;
--------------
-- Get_Free --
--------------
function Get_Free return Slave is
begin
for S of Pool loop
if S.Current < S.Max_Processes then
return S;
end if;
end loop;
return No_Slave;
end Get_Free;
-----------------------
-- Increment_Current --
-----------------------
procedure Increment_Current (S : in out Slave) is
begin
Change_Current (S, 1);
end Increment_Current;
------------
-- Insert --
------------
procedure Insert (S : Slave) is
begin
Pool.Insert (S);
end Insert;
-------------
-- Iterate --
-------------
procedure Iterate (Proc : access procedure (S : in out Slave)) is
begin
for C in Pool.Iterate loop
declare
S : Slave := Slave_S.Element (C);
begin
Proc (S);
Pool (C) := S;
end;
end loop;
end Iterate;
--------------------
-- Set_Rewrite_CD --
--------------------
procedure Set_Rewrite_CD (S : in out Slave; Path : String) is
Position : constant Slave_S.Cursor := Pool.Find (S);
begin
Set_Rewrite_CD (Pool (Position).Channel, Path => Path);
S := Pool (Position);
end Set_Rewrite_CD;
--------------------
-- Set_Rewrite_WD --
--------------------
procedure Set_Rewrite_WD (S : in out Slave; Path : String) is
Position : constant Slave_S.Cursor := Pool.Find (S);
begin
Set_Rewrite_WD (Pool (Position).Channel, Path => Path);
S := Pool (Position);
end Set_Rewrite_WD;
end Slaves;
------------------------------
-- Unregister_Remote_Slaves --
------------------------------
procedure Unregister_Remote_Slaves is
procedure Unregister (S : in out Slave);
-- Unregister given slave
Start, Stop : Time;
----------------
-- Unregister --
----------------
procedure Unregister (S : in out Slave) is
begin
Send_End_Of_Compilation (S.Channel);
Close (S.Channel);
-- Sync back the object code if needed
Sync.From_Slave
(Sync => S.Data.Sync,
Project_Name => To_String (Project_Name),
Root_Dir => To_String (Root_Dir),
Slave_Root_Dir => To_String (S.Root_Dir),
User => To_String (S.Data.User),
Host => To_String (S.Data.Host),
Included_Artifact_Patterns => S.Included_Artifact_Patterns);
end Unregister;
begin
Start := Clock;
Slaves.Iterate (Unregister'Access);
Sync.Wait;
Stop := Clock;
if Opt.Verbose_Mode and then Slaves.Count > 0 then
Write_Str (" All data synchronized in ");
Write_Str (Duration'Image (Stop - Start));
Write_Line (" seconds");
end if;
Slaves.Clear;
end Unregister_Remote_Slaves;
--------------
-- Wait_Ack --
--------------
protected body Wait_Ack is
---------
-- Set --
---------
procedure Set (Pid : Remote_Id) is
begin
Id := Pid;
Is_Set := True;
end Set;
---------
-- Get --
---------
entry Get (Pid : out Remote_Id) when Is_Set is
begin
Pid := Id;
Is_Set := False;
end Get;
end Wait_Ack;
-----------------
-- Wait_Remote --
-----------------
task body Wait_Remote is
use type Slave_S.Cursor;
Proc : Id;
Pid : Remote_Id;
Selector : Selector_Type;
Status : Selector_Status;
R_Set, W_Set : Socket_Set_Type;
Sock : Socket_Type;
S : Slave;
begin
-- In this task we are only interrested by the incoming data, so we do
-- not wait on socket ready for writting.
Sockets.Empty (W_Set);
Create_Selector (Selector);
loop
-- Let's wait for at least some process to monitor
Remote_Process.Wait_Non_Zero;
-- Wait for response from all registered slaves
Copy (Slaves_Sockets, R_Set);
Check_Selector (Selector, R_Set, W_Set, Status);
if Status = Completed then
Get (R_Set, Sock);
pragma Assert
(Sock /= No_Socket, "no socket returned by selector");
S := Slaves.Find (To_C (Sock));
if S /= No_Slave then
declare
Cmd : constant Command := Get_Command (S.Channel);
Success : Boolean;
begin
-- A display output
if Kind (Cmd) = DP then
-- Write output to the console
Write_Str (To_String (Protocol.Output (Cmd)));
Get_Pid (S.Channel, Pid, Success);
Proc := Create_Remote (Pid);
Remote_Process.Decrement;
Slaves.Decrement_Current (S);
Result.Add (Proc, Success, To_String (S.Data.Host));
-- An acknowledgment of an compilation job
elsif Kind (Cmd) = AK then
declare
Pid : constant Remote_Id :=
Remote_Id'Value (Args (Cmd)(1).all);
begin
Slaves.Increment_Current (S);
Wait_Ack.Set (Pid);
end;
elsif Kind (Cmd) = EC then
null;
else
raise Constraint_Error with "Unexpected command: "
& Command_Kind'Image (Kind (Cmd));
end if;
end;
end if;
else
if Opt.Verbose_Mode and then Opt.Verbosity_Level = Opt.High then
Write_Line
("warning: selector in " & Selector_Status'Image (Status)
& " state");
end if;
end if;
Sockets.Empty (R_Set);
end loop;
exception
when E : others =>
Write_Line (Exception_Information (E));
OS_Exit (1);
end Wait_Remote;
end Gprbuild.Compilation.Slave;
gprbuild-gpl-2014-src/src/gprinstall-uninstall.ads 0000644 0000767 0000145 00000003260 12323721731 021602 0 ustar gnatmail gnat ------------------------------------------------------------------------------
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R I N S T A L L . M A I N --
-- --
-- B o d y --
-- --
-- Copyright (C) 2012-2014, Free Software Foundation, Inc. --
-- --
-- This 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. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
package Gprinstall.Uninstall is
procedure Process (Install_Name : String);
-- Uninstall Project
end Gprinstall.Uninstall;
gprbuild-gpl-2014-src/src/gprmunch.sh 0000755 0000767 0000145 00000003234 10612067551 017110 0 ustar gnatmail gnat #!/bin/sh
if [ $# != 1 ]; then
echo "Bad number of arguments";
exit 2
fi
exch_file=$1
cp $exch_file $exch_file.saved
# Save stdin and use exchange file as input.
exec >&3
exec < $exch_file
# Save and set IFS to new line.
OLD_IFS=$IFS
IFS="
"
# Parse exchange file.
section='Unknown'
dep_files=""
bindsec='Unknown'
nm="nm-not-defined"
cc="cc-not-defined"
verbose=""
while read line; do
case $line in
"[MAIN BASE NAME]") section="base name" ;;
"[COMPILER PATH]") section="discard" ;;
"[COMPILER OPTIONS]") section="discard" ;;
"[DEPENDENCY FILES]") section="dependency" ;;
"[BINDING OPTIONS]") section="options" ;;
"[VERBOSE]") verbose=y; section="Unknown" ;;
\[*) echo "Unknown section ($line)"; exit 1 ;;
*) case $section in
"discard") ;;
"Unknown") echo "Malformed exchange file"; exit 1 ;;
"base name") basename=$line ;;
"dependency") dep_files="$dep_files $line" ;;
"options")
case $line in
--nm=*) nm=`echo $line | sed -e "s/^--nm=//"` ;;
--cc=*) cc=`echo $line | sed -e "s/^--cc=//"` ;;
*) echo "Unknown binder option ($line)" ;;
esac ;;
*) echo "Internal error (section $section) unhandled"; exit 1 ;;
esac
esac
done
# Restore IFS and stdin.
IFS=$OLD_IFS
exec 3>&1
exec 3>&-
# Convert dependancy files to object files.
object_files=`echo $dep_files | sed -e 's/\\.d\$/.o/'`
# Do the real work.
$nm $object_files | munch > cpp__$basename.c
$cc -c cpp__$basename.c
# Generate the exchange file.
cat > $1 <