From dae4f47f2b80c7ea7b1df0f713efe79a8a50c69f Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Mon, 18 Jan 2016 11:59:31 +0100 Subject: Added Library_Type to help with building libraries as shared or static. --- testsuite/sources/dual_library/Makefile | 20 ++++++++++++++++ .../sources/dual_library/build_testcase.gpr.gp | 28 ++++++++++++++++++++++ testsuite/sources/dual_library/generated_files | 8 +++++++ testsuite/sources/dual_library/testcase.adb | 24 +++++++++++++++++++ testsuite/sources/dual_library/testcase.ads | 18 ++++++++++++++ testsuite/sources/dual_library/testcase.gpr.gp | 27 +++++++++++++++++++++ 6 files changed, 125 insertions(+) create mode 100644 testsuite/sources/dual_library/Makefile create mode 100644 testsuite/sources/dual_library/build_testcase.gpr.gp create mode 100644 testsuite/sources/dual_library/generated_files create mode 100644 testsuite/sources/dual_library/testcase.adb create mode 100644 testsuite/sources/dual_library/testcase.ads create mode 100644 testsuite/sources/dual_library/testcase.gpr.gp (limited to 'testsuite/sources/dual_library') diff --git a/testsuite/sources/dual_library/Makefile b/testsuite/sources/dual_library/Makefile new file mode 100644 index 0000000..aa57d84 --- /dev/null +++ b/testsuite/sources/dual_library/Makefile @@ -0,0 +1,20 @@ +# part of Comfignat's testsuite +# Copyright 2016 B. Persson, Bjorn@Rombobeorn.se +# +# This material is provided as is, with absolutely no warranty expressed +# or implied. Any use is at your own risk. +# +# Permission is hereby granted to use or copy this testsuite +# for any purpose, provided the above notices are retained on all copies. +# Permission to modify the code and to distribute modified code is granted, +# provided the above notices are retained, and a notice that the code was +# modified is included with the above copyright notice. + + +include comfignat.mk + +usage_GPRs = testcase.gpr + +base: build_testcase.gpr + ${build_GPR} -margs -XLIBRARY_TYPE=dynamic + ${build_GPR} -margs -XLIBRARY_TYPE=static diff --git a/testsuite/sources/dual_library/build_testcase.gpr.gp b/testsuite/sources/dual_library/build_testcase.gpr.gp new file mode 100644 index 0000000..1c39659 --- /dev/null +++ b/testsuite/sources/dual_library/build_testcase.gpr.gp @@ -0,0 +1,28 @@ +-- part of Comfignat's testsuite +-- Copyright 2016 B. Persson, Bjorn@Rombobeorn.se +-- +-- This material is provided as is, with absolutely no warranty expressed +-- or implied. Any use is at your own risk. +-- +-- Permission is hereby granted to use or copy this testsuite +-- for any purpose, provided the above notices are retained on all copies. +-- Permission to modify the code and to distribute modified code is granted, +-- provided the above notices are retained, and a notice that the code was +-- modified is included with the above copyright notice. + + +with "comfignat.gpr"; + +library project Build_Testcase is + + for Library_Name use "testcase"; + for Library_Kind use Comfignat.Library_Type; + for Library_Version use "libtestcase.so.1"; + for Library_Interface use ("Testcase"); + for Source_Dirs use ($Srcdir); + for Object_Dir use Comfignat.Objdir; + for Library_Src_Dir use Comfignat.Stage_Includedir & "/testcase"; + for Library_Dir use Comfignat.Stage_Libdir; + for Library_ALI_Dir use Comfignat.Stage_Alidir & "/testcase"; + +end Build_Testcase; diff --git a/testsuite/sources/dual_library/generated_files b/testsuite/sources/dual_library/generated_files new file mode 100644 index 0000000..45a5035 --- /dev/null +++ b/testsuite/sources/dual_library/generated_files @@ -0,0 +1,8 @@ +build_testcase.gpr +comfignat.gpr +${stage_includedir}/testcase/testcase.ads +${stage_libdir}/libtestcase.so.1 +${stage_libdir}/libtestcase.so +${stage_libdir}/libtestcase.a +${stage_alidir}/testcase/testcase.ali +${stage_gprdir}/testcase.gpr diff --git a/testsuite/sources/dual_library/testcase.adb b/testsuite/sources/dual_library/testcase.adb new file mode 100644 index 0000000..df96cc3 --- /dev/null +++ b/testsuite/sources/dual_library/testcase.adb @@ -0,0 +1,24 @@ +-- part of Comfignat's testsuite +-- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +-- +-- This material is provided as is, with absolutely no warranty expressed +-- or implied. Any use is at your own risk. +-- +-- Permission is hereby granted to use or copy this testsuite +-- for any purpose, provided the above notices are retained on all copies. +-- Permission to modify the code and to distribute modified code is granted, +-- provided the above notices are retained, and a notice that the code was +-- modified is included with the above copyright notice. + + +with Ada.Calendar; use Ada.Calendar; +with Ada.Text_IO; use Ada.Text_IO; + +package body Testcase is + + function Year return String is + begin + return Year(Clock)'Img; + end Year; + +end Testcase; diff --git a/testsuite/sources/dual_library/testcase.ads b/testsuite/sources/dual_library/testcase.ads new file mode 100644 index 0000000..d2646b8 --- /dev/null +++ b/testsuite/sources/dual_library/testcase.ads @@ -0,0 +1,18 @@ +-- part of Comfignat's testsuite +-- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +-- +-- This material is provided as is, with absolutely no warranty expressed +-- or implied. Any use is at your own risk. +-- +-- Permission is hereby granted to use or copy this testsuite +-- for any purpose, provided the above notices are retained on all copies. +-- Permission to modify the code and to distribute modified code is granted, +-- provided the above notices are retained, and a notice that the code was +-- modified is included with the above copyright notice. + + +package Testcase is + + function Year return String; + +end Testcase; diff --git a/testsuite/sources/dual_library/testcase.gpr.gp b/testsuite/sources/dual_library/testcase.gpr.gp new file mode 100644 index 0000000..e2833c1 --- /dev/null +++ b/testsuite/sources/dual_library/testcase.gpr.gp @@ -0,0 +1,27 @@ +-- part of Comfignat's testsuite +-- Copyright 2016 B. Persson, Bjorn@Rombobeorn.se +-- +-- This material is provided as is, with absolutely no warranty expressed +-- or implied. Any use is at your own risk. +-- +-- Permission is hereby granted to use or copy this testsuite +-- for any purpose, provided the above notices are retained on all copies. +-- Permission to modify the code and to distribute modified code is granted, +-- provided the above notices are retained, and a notice that the code was +-- modified is included with the above copyright notice. + + +#if Directories_GPR'Defined then +with $Directories_GPR; +#end if; + +library project Testcase is + + for Library_Name use "testcase"; + for Library_Kind use external("testcase_library_type", $Library_Type); + for Source_Dirs use ($Includedir & "/testcase"); + for Library_Dir use $Libdir; + for Library_ALI_Dir use $Alidir & "/testcase"; + for Externally_Built use "true"; + +end Testcase; -- cgit v1.2.3