Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meson fixes #1087

Merged
merged 9 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions config_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
# define memmove(_d,_s,_l) bcopy((_s),(_d),(_l))
#endif

#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif

#if HAVE_UNISTD_H
# include <unistd.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions dev-docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ system in use.
* libxrandr-dev (>= 1.5)
* libxrender-dev
* libxt-dev
* xtrans-dev

## Optional dependencies

Expand Down
5 changes: 1 addition & 4 deletions libs/fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@
#include <X11/Xutil.h>
#include <X11/Xproto.h>
#include <X11/Xatom.h>
#if defined(HAVE_X11_XTRANS_XTRANS_H) && defined(HAVE__ICETRANSNOLISTEN)
#include <X11/Xtrans/Xtrans.h>
#elif defined(HAVE__ICETRANSNOLISTEN)
extern void _IceTransNoListen(char *protocol);
#endif


#include "fvwmlib.h"
#include "log.h"
Expand Down
8 changes: 0 additions & 8 deletions libs/ftime.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@

#include "config.h"

#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif

#endif /* FVWMLIB_FTIME_H */
133 changes: 72 additions & 61 deletions libs/meson.build
Original file line number Diff line number Diff line change
@@ -1,66 +1,77 @@
libfvwm3_sources = files(
'BidiJoin.c',
'Bindings.c',
'ClientMsg.c',
'ColorUtils.c',
'Colorset.c',
'CombineChars.c',
'Cursor.c',
'Event.c',
'FBidi.c',
'FEvent.c',
'FGettext.c',
'FImage.c',
'FRender.c',
'FRenderInit.c',
'FScreen.c',
'FShape.c',
'FTips.c',
'Fft.c',
'Ficonv.c',
'Flocale.c',
'FlocaleCharset.c',
'Grab.c',
'Graphics.c',
'Module.c',
'Parse.c',
'Picture.c',
'PictureBase.c',
'PictureGraphics.c',
'PictureImageLoader.c',
'PictureUtils.c',
'Rectangles.c',
'Strings.c',
'System.c',
'Target.c',
'WinMagic.c',
'XError.c',
'XResource.c',
'cJSON.c',
'charmap.c',
'envvar.c',
'fio.c',
'flist.c',
'fqueue.c',
'fsm.c',
'fvwmlib3.c',
'fvwmrect.c',
'fvwmsignal.c',
'getpwuid.c',
'gravity.c',
'log.c',
'modifiers.c',
'safemalloc.c',
'setpgrp.c',
'strtonum.c',
'timeout.c',
'wcontext.c',
'wild.c',
)

string_sources = files(
'strlcat.c',
'strlcpy.c',
)

# We don't build the string sources on macOS
# We probably could check for target_system, but nobody is cross-compiling _to_ macOS
if not (host_machine.system() == 'darwin')
libfvwm3_sources += string_sources
endif

libfvwm3 = static_library(
'fvwm3',
sources: [
'BidiJoin.c',
'Bindings.c',
'ClientMsg.c',
'ColorUtils.c',
'Colorset.c',
'CombineChars.c',
'Cursor.c',
'Event.c',
'FBidi.c',
'FEvent.c',
'FGettext.c',
'FImage.c',
'FRender.c',
'FRenderInit.c',
'FScreen.c',
'FShape.c',
'FTips.c',
'Fft.c',
'Ficonv.c',
'Flocale.c',
'FlocaleCharset.c',
'Grab.c',
'Graphics.c',
'Module.c',
'Parse.c',
'Picture.c',
'PictureBase.c',
'PictureGraphics.c',
'PictureImageLoader.c',
'PictureUtils.c',
'Rectangles.c',
'Strings.c',
'System.c',
'Target.c',
'WinMagic.c',
'XError.c',
'XResource.c',
'cJSON.c',
'charmap.c',
'envvar.c',
'fio.c',
'flist.c',
'fqueue.c',
'fsm.c',
'fvwmlib3.c',
'fvwmrect.c',
'fvwmsignal.c',
'getpwuid.c',
'gravity.c',
'log.c',
'modifiers.c',
'safemalloc.c',
'setpgrp.c',
'strlcat.c',
'strlcpy.c',
'strtonum.c',
'timeout.c',
'wcontext.c',
'wild.c',
],
sources: libfvwm3_sources,
include_directories: includedirs,
dependencies: all_found_deps,
install: false,
Expand Down
33 changes: 25 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ if host_machine.endian() == 'big'
conf.set('WORDS_BIGENDIAN', true)
endif

if host_machine.system() == 'darwin'
conf.set10('HOST_MACOS', true)
endif

# Set static configuration.
conf.set_quoted('VERSION', meson.project_version())
conf.set_quoted('VERSIONINFO', fvwm_vcs_versioninfo)
Expand All @@ -87,8 +91,6 @@ conf.set('SIGNAL_RETURN', 'return')
conf.set('ICONV_ARG_CONST', '')
conf.set('fd_set_size_t', 'int')
conf.set('EXECUTABLE_EXTENSION', 'NULL')
conf.set10('HAVE_XOUTPUT_METHOD', true)
conf.set10('FORK_CREATES_CHILD', true)

# Enable FTMs
if host_machine.system() == 'linux'
Expand Down Expand Up @@ -158,6 +160,7 @@ functions = {
'sysconf': {},
'intl': {},
'uname': {},
'wait3': {},
'waitpid': {},
}

Expand All @@ -173,6 +176,14 @@ foreach f, v : functions
endif
endforeach

# SETPGRP_VOID is obsolete
# All current systems have a setpgrp whose signature conforms to Posix.
# We need to set this to use the correct implementation internally
# but we don't need to check for it.
if conf.has('HAVE_SETPGRP')
conf.set10('SETPGRP_VOID', true)
endif

# Dependencies.
all_found_deps = []

Expand All @@ -186,6 +197,10 @@ foreach rd : all_req_deps
all_found_deps += this_dep
endforeach

xext = dependency('xext', required: true)
all_found_deps += xext
conf.set10('SHAPE', true)

# 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')
Expand Down Expand Up @@ -219,6 +234,10 @@ else
if readline.found()
all_found_deps += readline
conf.set10('HAVE_READLINE', true)
# Check for append_history to determine if we have GNU readline
if cc.has_function('append_history', dependencies: readline)
conf.set10('HAVE_GNU_READLINE', true)
endif
endif
endif

Expand Down Expand Up @@ -329,12 +348,6 @@ if xcursor.found()
conf.set10('HAVE_XCURSOR', true)
endif

xext = dependency('xext', required: get_option('xext'))
if xext.found()
all_found_deps += xext
conf.set10('SHAPE', true)
endif

xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'))
if xkbcommon.found()
all_found_deps += xkbcommon
Expand All @@ -356,6 +369,10 @@ endif
# Hard-coded
non_configurable_ops = [
'FMiniIconsSupported',
'FORK_CREATES_CHILD',
'HAVE_SAFETY_MKSTEMP', # safer since 2008; no real need to check for this on a modern system.
'HAVE_X11_FD',
'HAVE_XOUTPUT_METHOD',
'HAVE_XSHM',
]

Expand Down
6 changes: 0 additions & 6 deletions meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ option(
value: 'auto',
description: 'Enable Xcursor support',
)
option(
'xext',
type: 'feature',
value: 'auto',
description: 'Enable shaped window support via Xext',
)
option(
'xkbcommon',
type: 'feature',
Expand Down
Loading