|
| 1 | +project('nemo-gtkhash', |
| 2 | + 'c', |
| 3 | + version: '4.8.0', |
| 4 | + meson_version: '>=0.50.0' |
| 5 | +) |
| 6 | + |
| 7 | +project_url = 'https://github.com/linuxmint/nemo-extensions' |
| 8 | + |
| 9 | + |
| 10 | +gnome = import('gnome') |
| 11 | +pkgconfig = import('pkgconfig') |
| 12 | +cc = meson.get_compiler('c') |
| 13 | + |
| 14 | +config = configuration_data() |
| 15 | + |
| 16 | +################################################################################ |
| 17 | +# Find libnemo-extensions |
| 18 | + |
| 19 | +libnemo = dependency('libnemo-extension', version: '>=2.0.0') |
| 20 | +libnemo_extension_dir = libnemo.get_pkgconfig_variable('extensiondir') |
| 21 | +libnemo_extension_ver = libnemo.version().split('.') |
| 22 | + |
| 23 | +config.set('NEMO_VERSION_MAJOR', libnemo_extension_ver[0]) |
| 24 | +config.set('NEMO_VERSION_MINOR', libnemo_extension_ver[1]) |
| 25 | +config.set('NEMO_VERSION_MICRO', libnemo_extension_ver[2]) |
| 26 | + |
| 27 | +glib = dependency('glib-2.0', version: '>=2.14.0') |
| 28 | + |
| 29 | +################################################################################ |
| 30 | +# Extension dependencies |
| 31 | + |
| 32 | +gzip = find_program('gzip') |
| 33 | + |
| 34 | +gtk3 = dependency('gtk+-3.0', version: '>=3.0') |
| 35 | + |
| 36 | + |
| 37 | +if [ 'debug', 'relwithdebinfo'].contains(get_option('buildtype')) |
| 38 | + config.set('G_DISABLE_DEPRECATED', 1) |
| 39 | + config.set('GDK_DISABLE_DEPRECATED', 1) |
| 40 | + config.set('GTK_DISABLE_DEPRECATED', 1) |
| 41 | +else |
| 42 | + config.set('G_DISABLE_ASSERT', 1) |
| 43 | + config.set('G_DISABLE_CAST_CHECKS', 1) |
| 44 | +endif |
| 45 | + |
| 46 | +no_dep = dependency('', required: false) |
| 47 | + |
| 48 | +zlib = get_option('zlib') ? dependency('zlib') : no_dep |
| 49 | +config.set10('ENABLE_ZLIB', zlib.found()) |
| 50 | + |
| 51 | +libgcrypt = get_option('gcrypt') ? dependency('libgcrypt') : no_dep |
| 52 | +config.set10('ENABLE_GCRYPT', libgcrypt.found()) |
| 53 | + |
| 54 | +libcrypto = get_option('libcrypto') ? dependency('libcrypto') : no_dep |
| 55 | +config.set10('ENABLE_LIBCRYPTO', libcrypto.found()) |
| 56 | + |
| 57 | +nettle = get_option('nettle') ? dependency('nettle') : no_dep |
| 58 | +config.set10('ENABLE_NETTLE', nettle.found()) |
| 59 | + |
| 60 | +nss = get_option('nss') ? dependency('nss') : no_dep |
| 61 | +config.set10('ENABLE_NSS', nss.found()) |
| 62 | + |
| 63 | +mhash = get_option('mhash') ? cc.find_library('mhash', has_headers: 'mhash.h') : no_dep |
| 64 | +config.set10('ENABLE_MHASH', mhash.found()) |
| 65 | + |
| 66 | + |
| 67 | +if get_option('linux-crypto') |
| 68 | + if not cc.has_header('linux/if_alg.h') |
| 69 | + error('Header if_alg.h not found !') |
| 70 | + endif |
| 71 | +endif |
| 72 | +config.set10('ENABLE_LINUX_CRYPTO', get_option('linux-crypto')) |
| 73 | + |
| 74 | + |
| 75 | +if get_option('mbedtls') |
| 76 | + mbedtls = cc.find_library('mbedcrypto', has_headers: 'mbedtls/md.h', required: false) |
| 77 | + mbedtls_version = 2 |
| 78 | + if not mbedtls.found() |
| 79 | + mbedtls = cc.find_library('polarssl', has_headers: 'polarssl/md.h', required: false) |
| 80 | + mbedtls_version = 1 |
| 81 | + endif |
| 82 | + if not mbedtls.found() |
| 83 | + error('Could not find mbedtls or polarssl !') |
| 84 | + endif |
| 85 | +else |
| 86 | + mbedtls = no_dep |
| 87 | +endif |
| 88 | +config.set10('ENABLE_MBEDTLS', mbedtls.found()) |
| 89 | +config.set10('HAVE_MBEDTLS_2_0_0', mbedtls_version == 2) |
| 90 | + |
| 91 | + |
| 92 | +config.set10('ENABLE_GLIB_CHECKSUMS', get_option('glib-checksums')) |
| 93 | + |
| 94 | +config.set10('ENABLE_MD6', get_option('internal-md6')) |
| 95 | + |
| 96 | + |
| 97 | +build_gtkhash = get_option('build-gtkhash') |
| 98 | +build_nautilus = get_option('build-nautilus') |
| 99 | +build_nemo = get_option('build-nemo') |
| 100 | +build_thunar = get_option('build-thunar') |
| 101 | + |
| 102 | + |
| 103 | +config.set('HASH_FILE_BUFFER_SIZE', 131072) |
| 104 | +config.set('HASH_FILE_REPORT_INTERVAL', 166) |
| 105 | + |
| 106 | +################################################################################ |
| 107 | +# Generic stuff |
| 108 | + |
| 109 | +config.set_quoted('GETTEXT_PACKAGE', 'nemo-extensions') |
| 110 | +config.set_quoted('GNOMELOCALEDIR', get_option('prefix')/get_option('datadir')/'locale') |
| 111 | + |
| 112 | +add_project_arguments('-DG_LOG_DOMAIN="nemo-gtkhash"', language: 'c') |
| 113 | + |
| 114 | +add_project_arguments('-DHAVE_CONFIG_H', language: 'c') |
| 115 | +configure_file( |
| 116 | + output: 'config.h', |
| 117 | + configuration: config, |
| 118 | +) |
| 119 | + |
| 120 | +rootInclude = include_directories('.') |
| 121 | + |
| 122 | +subdir('src') |
| 123 | +subdir('data') |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | +# -fno-common \ |
| 128 | +# -fvisibility=hidden \ |
| 129 | +# -pedantic \ |
| 130 | +# -Wall \ |
| 131 | +# -Wextra \ |
| 132 | +# -Waggregate-return \ |
| 133 | +# -Wbad-function-cast \ |
| 134 | +# -Wcast-align \ |
| 135 | +# -Winit-self \ |
| 136 | +# -Wfloat-equal \ |
| 137 | +# -Wlogical-op \ |
| 138 | +# -Wmissing-declarations \ |
| 139 | +# -Wmissing-noreturn \ |
| 140 | +# -Wredundant-decls \ |
| 141 | +# -Wshadow \ |
| 142 | +# -Wswitch-default \ |
| 143 | +# -Wwrite-strings \ |
| 144 | +# -Werror=implicit-function-declaration |
0 commit comments