Skip to content

Commit

Permalink
Tidy up meson build and implement new modules and bins
Browse files Browse the repository at this point in the history
  • Loading branch information
Kangie committed Apr 5, 2024
1 parent 5cf2a82 commit ec3054c
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand Down Expand Up @@ -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',
Expand All @@ -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'
Expand All @@ -360,6 +375,7 @@ configure_file(
libraries = []
lib_includes = include_directories('.')
fvwm_includes = include_directories('fvwm')

subdir('libs')

subdir('po')
Expand All @@ -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,
Expand Down

0 comments on commit ec3054c

Please sign in to comment.