diff --git a/config_defines.h b/config_defines.h index 1dfc31cad..9a2d37718 100644 --- a/config_defines.h +++ b/config_defines.h @@ -31,10 +31,6 @@ # define memmove(_d,_s,_l) bcopy((_s),(_d),(_l)) #endif -#if HAVE_SYS_TYPES_H -# include -#endif - #if HAVE_UNISTD_H # include #endif diff --git a/dev-docs/INSTALL.md b/dev-docs/INSTALL.md index a11ed1956..165f19203 100644 --- a/dev-docs/INSTALL.md +++ b/dev-docs/INSTALL.md @@ -32,6 +32,7 @@ system in use. * libxrandr-dev (>= 1.5) * libxrender-dev * libxt-dev +* xtrans-dev ## Optional dependencies diff --git a/libs/fsm.c b/libs/fsm.c index cfac128bd..20186af76 100644 --- a/libs/fsm.c +++ b/libs/fsm.c @@ -33,11 +33,8 @@ #include #include #include -#if defined(HAVE_X11_XTRANS_XTRANS_H) && defined(HAVE__ICETRANSNOLISTEN) #include -#elif defined(HAVE__ICETRANSNOLISTEN) -extern void _IceTransNoListen(char *protocol); -#endif + #include "fvwmlib.h" #include "log.h" diff --git a/libs/ftime.h b/libs/ftime.h index f53469c26..0731cbac4 100644 --- a/libs/ftime.h +++ b/libs/ftime.h @@ -5,15 +5,7 @@ #include "config.h" -#ifdef TIME_WITH_SYS_TIME # include # include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif #endif /* FVWMLIB_FTIME_H */ diff --git a/libs/meson.build b/libs/meson.build index 3184ec230..13d8a4dde 100644 --- a/libs/meson.build +++ b/libs/meson.build @@ -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, diff --git a/meson.build b/meson.build index 984eaad31..68e0e22f4 100644 --- a/meson.build +++ b/meson.build @@ -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) @@ -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' @@ -158,6 +160,7 @@ functions = { 'sysconf': {}, 'intl': {}, 'uname': {}, + 'wait3': {}, 'waitpid': {}, } @@ -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 = [] @@ -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') @@ -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 @@ -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 @@ -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', ] diff --git a/meson.options b/meson.options index 3d37cef62..ed9b82852 100644 --- a/meson.options +++ b/meson.options @@ -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',