1 1.1 mrg # SPDX-License-Identifier: MIT 2 1.1 mrg # 3 1.1 mrg # Copyright (c) 2026, Oracle and/or its affiliates. 4 1.1 mrg # 5 1.1 mrg # Permission is hereby granted, free of charge, to any person obtaining a 6 1.1 mrg # copy of this software and associated documentation files (the "Software"), 7 1.1 mrg # to deal in the Software without restriction, including without limitation 8 1.1 mrg # the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 1.1 mrg # and/or sell copies of the Software, and to permit persons to whom the 10 1.1 mrg # Software is furnished to do so, subject to the following conditions: 11 1.1 mrg # 12 1.1 mrg # The above copyright notice and this permission notice (including the next 13 1.1 mrg # paragraph) shall be included in all copies or substantial portions of the 14 1.1 mrg # Software. 15 1.1 mrg # 16 1.1 mrg # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 1.1 mrg # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 1.1 mrg # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 1.1 mrg # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 1.1 mrg # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 1.1 mrg # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 1.1 mrg # DEALINGS IN THE SOFTWARE. 23 1.1 mrg # 24 1.1 mrg 25 1.1 mrg project( 26 1.1 mrg 'xwud', 27 1.1 mrg 'c', 28 1.1 mrg version: '1.0.8', 29 1.1 mrg license: 'MIT-open-group', 30 1.1 mrg license_files: 'COPYING', 31 1.1 mrg meson_version: '>= 1.1.0', 32 1.1 mrg ) 33 1.1 mrg 34 1.1 mrg conf = configuration_data() 35 1.1 mrg package_string = ' '.join(meson.project_name(), meson.project_version()) 36 1.1 mrg conf.set_quoted('PACKAGE_STRING', package_string) 37 1.1 mrg 38 1.1 mrg cc = meson.get_compiler('c') 39 1.1 mrg 40 1.1 mrg # Replacement for XORG_DEFAULT_OPTIONS 41 1.1 mrg if cc.has_argument('-fno-strict-aliasing') 42 1.1 mrg add_project_arguments('-fno-strict-aliasing', language: 'c') 43 1.1 mrg endif 44 1.1 mrg 45 1.1 mrg # Checks for pkg-config packages 46 1.1 mrg dep_libx11 = dependency('x11', required: true) 47 1.1 mrg dep_xproto = dependency('xproto', required: true, version: '>= 7.0.25') 48 1.1 mrg deps = [dep_libx11, dep_xproto] 49 1.1 mrg 50 1.1 mrg config_h = configure_file(output: 'config.h', configuration: conf) 51 1.1 mrg add_project_arguments('-DHAVE_CONFIG_H', language: ['c']) 52 1.1 mrg 53 1.1 mrg executable( 54 1.1 mrg 'xwud', 55 1.1 mrg [config_h, 'xwud.c'], 56 1.1 mrg dependencies: deps, 57 1.1 mrg install: true, 58 1.1 mrg ) 59 1.1 mrg 60 1.1 mrg # Man page 61 1.1 mrg prog_sed = find_program('sed') 62 1.1 mrg 63 1.1 mrg custom_target( 64 1.1 mrg 'xwud.man', 65 1.1 mrg input: 'man/xwud.man', 66 1.1 mrg output: 'xwud.1', 67 1.1 mrg command: [ 68 1.1 mrg prog_sed, 69 1.1 mrg '-e', f's/__xorgversion__/"@package_string@" "X Version 11"/', 70 1.1 mrg '-e', 's/__appmansuffix__/1/g', 71 1.1 mrg '-e', 's/__miscmansuffix__/7/g', 72 1.1 mrg '@INPUT@', 73 1.1 mrg ], 74 1.1 mrg capture: true, 75 1.1 mrg install: true, 76 1.1 mrg install_dir: get_option('mandir') / 'man1', 77 1.1 mrg install_tag: 'man', 78 1.1 mrg ) 79