diff --git a/meson.build b/meson.build index 9a244b16a..0b16a8b9b 100644 --- a/meson.build +++ b/meson.build @@ -31,6 +31,7 @@ if m_dep.found() add_project_link_arguments('-lm', language: 'c') endif +bindir = get_option('bindir') datadir = get_option('datadir') sysconfdir = get_option('sysconfdir') prefix = get_option('prefix') @@ -51,9 +52,9 @@ conf.set_quoted('FVWM2RC', '.fvwm2rc') conf.set_quoted('FVWM_CONFIG', 'config') conf.set_quoted('FVWM_IMAGEPATH', '/usr/include/X11/bitmaps:/usr/include/X11/pixmaps') conf.set_quoted('FVWM_MODULEDIR', get_option('libexecdir') + '/' + meson.project_name() + '/' + meson.project_version()) -conf.set_quoted('FVWM_DATADIR', get_option('datadir') + '/' + meson.project_name()) +conf.set_quoted('FVWM_DATADIR', datadir + '/' + meson.project_name()) conf.set_quoted('LOCALEDIR', conf.get('FVWM_DATADIR') + '/' + 'locale') -conf.set_quoted('FVWM_CONFDIR', get_option('sysconfdir')) +conf.set_quoted('FVWM_CONFDIR', sysconfdir) conf.set('ICONV_ARG_CONST', '') conf.set('fd_set_size_t', 'int') conf.set('EXECUTABLE_EXTENSION', 'NULL') @@ -326,6 +327,19 @@ if cc.has_header_symbol('libcharset.h', 'locale_charset') conf.set10('HAVE_LIBCHARSET', true) endif +# Python is a required dependency, we generate shebangs at buildtime +# This will error by default if there is no python interpreter found +py_mod = import('python') +py = py_mod.find_installation('python3') + +# Perl is a required dependency, we generate shebangs at buildtime +perl = find_program('perl', required: true) + +# We currently detect go then configure our build to use one +# of two paths. We should probably just default to golang and +# hard fail if it is not available. +golang = find_program('go', required: false) + # Hard-coded non_configurable_ops = [ 'FMiniIconsSupported', @@ -337,8 +351,9 @@ foreach nco : non_configurable_ops conf.set10(nco, true) endforeach +# We should just error out if we can't find asciidoctor and it's been requested. asciidoctor = find_program('asciidoctor', - required: get_option('mandoc') == true || get_option('htmldoc') == true) + required: get_option('mandoc') or get_option('htmldoc')) mandoc_explain = get_option('mandoc') == true and not asciidoctor.found() ? 'No (asciidoctor not found)' : 'Yes' htmldoc_explain = get_option('htmldoc') == true and not asciidoctor.found() ? 'No (asciidoctor not found)' : 'Yes' @@ -360,6 +375,7 @@ configure_file( libraries = [] lib_includes = include_directories('.') fvwm_includes = include_directories('fvwm') + subdir('libs') subdir('po') @@ -374,27 +390,35 @@ fvwm3 = executable( link_with: libraries, ) +# Core modules modules = { 'FvwmAnimate': {'subdir': 'modules/FvwmAnimate'}, 'FvwmAuto': {'subdir': 'modules/FvwmAuto'}, 'FvwmBacker': {'subdir': 'modules/FvwmBacker'}, 'FvwmButtons': {'subdir': 'modules/FvwmButtons'}, - #FvwmConsole (TODO) 'FvwmEvent': {'subdir': 'modules/FvwmEvent'}, - } +if not golang.found() + modules+= { + 'FvwmConsole': {'subdir': 'modules/FvwmConsole'} + } +endif + +# FvwmPrompt and FvwmCommand +subdir('bin') + module_sources = [] foreach m, _ : modules subdir(modules[m]['subdir']) endforeach summary({ - 'prefix': get_option('prefix'), - 'bindir': get_option('bindir'), + 'prefix': prefix, + 'bindir': bindir, 'libdir': get_option('libdir'), 'libexecdir': get_option('libexecdir'), - 'datadir': get_option('datadir') + 'datadir': get_option('datadir'), }, section: 'Directories') summary({ 'iconv': iconv,