| 1 |
Description: Update upstream meson config |
| 2 |
Add some structure to the configuration file and add additional information |
| 3 |
in the build summary |
| 4 |
Author: Nick Morrott <[email protected]> |
| 5 |
Forwarded: not-needed |
| 6 |
Last-Update: 2022-02-11 |
| 7 |
--- |
| 8 |
--- a/meson.build |
| 9 |
+++ b/meson.build |
| 10 |
@@ -1,74 +1,135 @@ |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
+project( |
| 21 |
+ 'connman-gtk', 'c', |
| 22 |
+ version: '1.1.1', |
| 23 |
+ license: 'GPL2', |
| 24 |
+ default_options: 'c_std=c11', |
| 25 |
+) |
| 26 |
+ |
| 27 |
+connman_gtk_name = meson.project_name() |
| 28 |
+ |
| 29 |
+connman_gtk_version = meson.project_version() |
| 30 |
+connman_gtk_version_array = connman_gtk_version.split('.') |
| 31 |
+connman_gtk_major_version = connman_gtk_version_array[0].to_int() |
| 32 |
+connman_gtk_minor_version = connman_gtk_version_array[1].to_int() |
| 33 |
+connman_gtk_patch_version = connman_gtk_version_array[2].to_int() |
| 34 |
+ |
| 35 |
+connman_gtk_prefix = get_option('prefix') |
| 36 |
+connman_gtk_bindir = get_option('bindir') |
| 37 |
+connman_gtk_datadir = get_option('datadir') |
| 38 |
+connman_gtk_includedir = get_option('includedir') |
| 39 |
+connman_gtk_localedir = get_option('localedir') |
| 40 |
+connman_gtk_mandir = get_option('mandir') |
| 41 |
+ |
| 42 |
+#******************************************************************************* |
| 43 |
+# Compiler flags |
| 44 |
+#******************************************************************************* |
| 45 |
|
| 46 |
am_cflags = [ |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
+ '-fstack-protector', |
| 61 |
+ '-pedantic', |
| 62 |
+ '-Wstrict-prototypes', |
| 63 |
+ '-Wundef', |
| 64 |
+ '-Werror-implicit-function-declaration', |
| 65 |
+ '-Wformat', |
| 66 |
+ '-Wformat-security', |
| 67 |
+ '-Werror=format-security', |
| 68 |
+ '-Wconversion', |
| 69 |
+ '-Wno-unused-parameter', |
| 70 |
+ '-Wunreachable-code', |
| 71 |
+ '-Wall', |
| 72 |
+ '-W', |
| 73 |
] |
| 74 |
add_global_arguments(am_cflags, language: 'c') |
| 75 |
|
| 76 |
+#******************************************************************************* |
| 77 |
+# Dependencies |
| 78 |
+#******************************************************************************* |
| 79 |
+ |
| 80 |
gtk = dependency('gtk+-3.0', version: '>=3.22') |
| 81 |
glib = dependency('glib-2.0', version: '>=2.50') |
| 82 |
|
| 83 |
+#******************************************************************************* |
| 84 |
+# i18n |
| 85 |
+#******************************************************************************* |
| 86 |
+ |
| 87 |
i18n = import('i18n') |
| 88 |
|
| 89 |
+source_root = meson.current_source_dir() |
| 90 |
+po_dir = source_root / 'po' |
| 91 |
+ |
| 92 |
+#******************************************************************************* |
| 93 |
+# Configuration Data |
| 94 |
+#******************************************************************************* |
| 95 |
+ |
| 96 |
conf_data = configuration_data() |
| 97 |
+ |
| 98 |
openconnect = disabler() |
| 99 |
cc = meson.get_compiler('c') |
| 100 |
dl = cc.find_library('dl', required: false) |
| 101 |
|
| 102 |
use_openconnect = get_option('use_openconnect') |
| 103 |
if(use_openconnect == 'yes') |
| 104 |
|
| 105 |
+ openconnect = dependency('openconnect', version: '>=5.99') |
| 106 |
endif |
| 107 |
if(use_openconnect == 'dynamic' and dl.found()) |
| 108 |
|
| 109 |
|
| 110 |
+ openconnect = dependency('openconnect', version: '>=5.99') |
| 111 |
+ conf_data.set('USE_OPENCONNECT_DYNAMIC', true) |
| 112 |
endif |
| 113 |
if (use_openconnect == 'check') |
| 114 |
|
| 115 |
+ openconnect = dependency('openconnect', version: '>=5.99', required : false) |
| 116 |
endif |
| 117 |
|
| 118 |
conf_data.set('USE_OPENCONNECT', openconnect.found()) |
| 119 |
conf_data.set('USE_STATUS_ICON', get_option('use_status_icon')) |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
+conf_data.set_quoted('GETTEXT_PACKAGE', connman_gtk_name) |
| 128 |
+conf_data.set_quoted('CONNMAN_GTK_LOCALEDIR', connman_gtk_prefix + '/' + connman_gtk_localedir + '/') |
| 129 |
+ |
| 130 |
+conf_data.set('version', connman_gtk_version) |
| 131 |
+configure_file( |
| 132 |
+ input: 'config.h.in', |
| 133 |
+ output: 'config.h', |
| 134 |
+ configuration: conf_data |
| 135 |
+) |
| 136 |
|
| 137 |
extra_includes = [ |
| 138 |
|
| 139 |
+ include_directories('.'), |
| 140 |
] |
| 141 |
|
| 142 |
readmes = [ |
| 143 |
|
| 144 |
|
| 145 |
+ 'CHANGELOG.md', |
| 146 |
+ 'README.md' |
| 147 |
] |
| 148 |
|
| 149 |
|
| 150 |
# install_data(readmes, install_dir : join_paths(get_option('datadir'), meson.project_name(), 'doc')) |
| 151 |
|
| 152 |
|
| 153 |
+ |
| 154 |
+#******************************************************************************* |
| 155 |
+# Source directories |
| 156 |
+#******************************************************************************* |
| 157 |
+ |
| 158 |
subdir('data') |
| 159 |
+subdir('src') |
| 160 |
+subdir('po') |
| 161 |
|
| 162 |
+#******************************************************************************* |
| 163 |
+# Summary |
| 164 |
+#******************************************************************************* |
| 165 |
+ |
| 166 |
+summary( |
| 167 |
+ { |
| 168 |
+ 'Building connman_gtk with prefix': connman_gtk_prefix, |
| 169 |
+ }, section: 'Directories' |
| 170 |
+) |
| 171 |
+ |
| 172 |
+summary( |
| 173 |
+ { |
| 174 |
+ 'openconnect' : get_option('use_openconnect'), |
| 175 |
+ 'status icon' : get_option('use_status_icon'), |
| 176 |
+ }, section: 'Optional features' |
| 177 |
+) |
| 178 |
+ |
| 179 |
+summary( |
| 180 |
+ { |
| 181 |
+ 'openconnect' : openconnect.found(), |
| 182 |
+ }, section: 'Optional dependencies' |
| 183 |
+) |