xserver-multidpi/hw/xquartz/mach-startup/meson.build
Jon Turney 655b1eb32e meson: Convert xquartz from autotools
Differences from autotools:

* Autotools defined NO_ALLOCA for OSX builds.  I don't think we need
this anymore as Xalloc.h is no longer used anywhere in the xserver.

* X11.bin is linked with -u,miDCInitialize, and then libserver_mi
provided to satisfy (just) that.  It's been that way since the commit
which added it.  We can't write the equivalent in meson due to linker
argument ordering issues, but do we really need to?

* An explicit -Dsecure-rpc=false is required for OSX, since in meson we
don't do the checks that XTRANS_SECURE_RPC_FLAGS did for the existence
of the specific RPC functions required.
2019-05-02 15:42:58 +00:00

93 lines
2.3 KiB
Meson

# mach interface
mig = find_program('mig')
mach_startup = custom_target('mach_startup',
command: [mig,
'-sheader', '@OUTPUT0@', '-header', '@OUTPUT2@',
'-server', '@OUTPUT1@', '-user', '@OUTPUT3@',
'@INPUT@'],
input: 'mach_startup.defs',
output: ['mach_startupServer.h',
'mach_startupServer.c',
'mach_startup.h',
'mach_startupUser.c'],
)
mach_startup_dep = declare_dependency(
sources: mach_startup[2] # mach_startup.h
)
# common defines
xquartz_defs = [
bundle_id_def,
'-DXSERVER_VERSION="@0@"'.format(meson.project_version()),
'-DX11BINDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('bindir'))),
]
# X11.bin
x11appdir = join_paths(bundle_root, 'Contents/MacOS')
x11_bin_deps = [
meson.get_compiler('c').find_library('Xplugin'),
dependency('Carbon', method: 'extraframework'),
cocoa,
dependency('CoreAudio', method: 'extraframework'),
dependency('IOKit', method: 'extraframework')
]
if build_glx
x11_bin_deps += [dependency('OpenGL', method: 'extraframework')]
endif
if build_sparkle
x11_bin_deps += sparkle
endif
x11_bin_libs = [
libXquartz,
libXquartzXpr,
libxpbproxy,
libxserver_fb,
libxserver,
libxserver_xkb_stubs,
]
if build_glx
x11_bin_libs += [libcglcore, libxserver_glx, libglxvnd]
endif
x11_bin = executable('X11.bin',
[
'bundle-main.c',
# strndup(3) was added in Mac OS X 10.7 (Lion), but we do this
# unconditionally to deal with the case where we build on 10.7 or later,
# but target 10.6 (Snow Leopard) or earlier as the minimum OS version.
'../../../os/strndup.c',
mach_startup[1], # mach_startupServer.c
mach_startup[3], # mach_startupUser.c
],
link_with: x11_bin_libs,
dependencies: [xproto_dep, x11_bin_deps, mach_startup_dep],
include_directories: [inc, '..', top_dir_inc],
c_args: xquartz_defs,
link_args: ['-Objc'],
install: true,
install_dir: x11appdir,
)
# Xquartz
xquartz_deps = [
dependency('CoreServices', method: 'extraframework'),
]
xquartz = executable('Xquartz',
[
'stub.c',
'launchd_fd.c',
mach_startup[3], # mach_startupUser.c
],
include_directories: inc,
c_args: xquartz_defs,
dependencies: [xquartz_deps, mach_startup_dep],
install: true,
)