|
| 1 | +library project WolfSSL is |
| 2 | + |
| 3 | + for Library_Name use "wolfssl"; |
| 4 | + -- for Library_Version use Project'Library_Name & ".so"; |
| 5 | + type OS_Kind is ("Windows", "Linux_Or_Mac"); |
| 6 | + |
| 7 | + OS : OS_Kind := external ("OS", "Linux_Or_Mac"); |
| 8 | + |
| 9 | + for Languages use ("C", "Ada"); |
| 10 | + |
| 11 | + for Source_Dirs use (".", |
| 12 | + "../../", |
| 13 | + "../../src", |
| 14 | + "../../wolfcrypt/src"); |
| 15 | + |
| 16 | + -- Don't build the tls client or server application. |
| 17 | + -- They are not needed in order to build the library. |
| 18 | + for Excluded_Source_Files use ("tls_client_main.adb", |
| 19 | + "tls_client.ads", |
| 20 | + "tls_client.adb", |
| 21 | + "tls_server_main.adb", |
| 22 | + "tls_server.ads", |
| 23 | + "tls_server.adb"); |
| 24 | + |
| 25 | + for Object_Dir use "obj"; |
| 26 | + for Library_Dir use "lib"; |
| 27 | + for Create_Missing_Dirs use "True"; |
| 28 | + |
| 29 | + type Library_Type_Type is ("relocatable", "static", "static-pic"); |
| 30 | + Library_Type : Library_Type_Type := external("LIBRARY_TYPE", "static"); |
| 31 | + for Library_Kind use Library_Type; |
| 32 | + |
| 33 | + package Naming is |
| 34 | + for Spec_Suffix ("C") use ".h"; |
| 35 | + end Naming; |
| 36 | + |
| 37 | + package Builder is |
| 38 | + for Global_Configuration_Pragmas use "gnat.adc"; |
| 39 | + end Builder; |
| 40 | + |
| 41 | + package Compiler is |
| 42 | + for Switches ("C") use |
| 43 | + ("-DWOLFSSL_USER_SETTINGS", -- Use the user_settings.h file. |
| 44 | + "-Wno-pragmas", |
| 45 | + "-Wall", |
| 46 | + "-Wextra", |
| 47 | + "-Wunknown-pragmas", |
| 48 | + "--param=ssp-buffer-size=1", |
| 49 | + "-Waddress", |
| 50 | + "-Warray-bounds", |
| 51 | + "-Wbad-function-cast", |
| 52 | + "-Wchar-subscripts", |
| 53 | + "-Wcomment", |
| 54 | + "-Wfloat-equal", |
| 55 | + "-Wformat-security", |
| 56 | + "-Wformat=2", |
| 57 | + "-Wmaybe-uninitialized", |
| 58 | + "-Wmissing-field-initializers", |
| 59 | + "-Wmissing-noreturn", |
| 60 | + "-Wmissing-prototypes", |
| 61 | + "-Wnested-externs", |
| 62 | + "-Wnormalized=id", |
| 63 | + "-Woverride-init", |
| 64 | + "-Wpointer-arith", |
| 65 | + "-Wpointer-sign", |
| 66 | + "-Wshadow", |
| 67 | + "-Wsign-compare", |
| 68 | + "-Wstrict-overflow=1", |
| 69 | + "-Wstrict-prototypes", |
| 70 | + "-Wswitch-enum", |
| 71 | + "-Wundef", |
| 72 | + "-Wunused", |
| 73 | + "-Wunused-result", |
| 74 | + "-Wunused-variable", |
| 75 | + "-Wwrite-strings", |
| 76 | + "-fwrapv") & External_As_List ("CFLAGS", " "); |
| 77 | + |
| 78 | + for Switches ("Ada") use ("-g") & External_As_List ("ADAFLAGS", " "); |
| 79 | + end Compiler; |
| 80 | + |
| 81 | + package Binder is |
| 82 | + for Switches ("Ada") use ("-Es"); -- To include stack traces. |
| 83 | + end Binder; |
| 84 | + |
| 85 | +-- case OS is |
| 86 | +-- when "Windows" => |
| 87 | +-- for Library_Options use ("-lm", -- To include the math library (used by WolfSSL). |
| 88 | +-- "-lcrypt32"); -- Needed on Windows. |
| 89 | +-- when "Linux_Or_Mac" => |
| 90 | +-- for Library_Options use ("-lm"); -- To include the math library (used by WolfSSL). |
| 91 | +-- end case; |
| 92 | +-- |
| 93 | +-- -- Put user options in front, for options like --as-needed. |
| 94 | +-- for Leading_Library_Options use External_As_List ("LDFLAGS", " "); |
| 95 | + |
| 96 | +end WolfSSl; |
0 commit comments