mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-31 22:25:25 -04:00
build: Allow disabling building of wayland libraries
When cross-compiling it may be useful to build only the wayland-scanner natively. This patch makes it possible to disable build of the libraries. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
parent
aeeca31696
commit
5cfdbef3d2
2 changed files with 45 additions and 32 deletions
47
Makefile.am
47
Makefile.am
|
|
@ -22,9 +22,32 @@ dist_pkgdata_DATA = \
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA =
|
pkgconfig_DATA =
|
||||||
|
|
||||||
lib_LTLIBRARIES = libwayland-server.la libwayland-client.la
|
if ENABLE_SCANNER
|
||||||
|
wayland_scanner = $(top_builddir)/wayland-scanner
|
||||||
|
bin_PROGRAMS = wayland-scanner
|
||||||
|
wayland_scanner_SOURCES = src/scanner.c
|
||||||
|
wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(AM_CFLAGS)
|
||||||
|
wayland_scanner_LDADD = $(EXPAT_LIBS) libwayland-util.la
|
||||||
|
$(BUILT_SOURCES) : wayland-scanner
|
||||||
|
pkgconfig_DATA += src/wayland-scanner.pc
|
||||||
|
else
|
||||||
|
wayland_scanner = wayland-scanner
|
||||||
|
endif
|
||||||
|
|
||||||
|
libwayland_util_la_CFLAGS = $(FFI_CFLAGS) $(GCC_CFLAGS)
|
||||||
|
libwayland_util_la_SOURCES = \
|
||||||
|
src/connection.c \
|
||||||
|
src/wayland-util.c \
|
||||||
|
src/wayland-util.h \
|
||||||
|
src/wayland-os.c \
|
||||||
|
src/wayland-os.h \
|
||||||
|
src/wayland-private.h
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libwayland-util.la
|
noinst_LTLIBRARIES = libwayland-util.la
|
||||||
|
|
||||||
|
if ENABLE_LIBRARIES
|
||||||
|
lib_LTLIBRARIES = libwayland-server.la libwayland-client.la
|
||||||
|
|
||||||
include_HEADERS = \
|
include_HEADERS = \
|
||||||
src/wayland-util.h \
|
src/wayland-util.h \
|
||||||
src/wayland-server.h \
|
src/wayland-server.h \
|
||||||
|
|
@ -39,15 +62,6 @@ nodist_include_HEADERS = \
|
||||||
protocol/wayland-server-protocol.h \
|
protocol/wayland-server-protocol.h \
|
||||||
protocol/wayland-client-protocol.h
|
protocol/wayland-client-protocol.h
|
||||||
|
|
||||||
libwayland_util_la_CFLAGS = $(FFI_CFLAGS) $(GCC_CFLAGS)
|
|
||||||
libwayland_util_la_SOURCES = \
|
|
||||||
src/connection.c \
|
|
||||||
src/wayland-util.c \
|
|
||||||
src/wayland-util.h \
|
|
||||||
src/wayland-os.c \
|
|
||||||
src/wayland-os.h \
|
|
||||||
src/wayland-private.h
|
|
||||||
|
|
||||||
libwayland_server_la_CFLAGS = $(FFI_CFLAGS) $(GCC_CFLAGS) -pthread
|
libwayland_server_la_CFLAGS = $(FFI_CFLAGS) $(GCC_CFLAGS) -pthread
|
||||||
libwayland_server_la_LIBADD = $(FFI_LIBS) libwayland-util.la -lrt -lm
|
libwayland_server_la_LIBADD = $(FFI_LIBS) libwayland-util.la -lrt -lm
|
||||||
libwayland_server_la_LDFLAGS = -version-info 1:0:1
|
libwayland_server_la_LDFLAGS = -version-info 1:0:1
|
||||||
|
|
@ -72,18 +86,6 @@ nodist_libwayland_client_la_SOURCES = \
|
||||||
|
|
||||||
pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
|
pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
|
||||||
|
|
||||||
if ENABLE_SCANNER
|
|
||||||
wayland_scanner = $(top_builddir)/wayland-scanner
|
|
||||||
bin_PROGRAMS = wayland-scanner
|
|
||||||
wayland_scanner_SOURCES = src/scanner.c
|
|
||||||
wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(AM_CFLAGS)
|
|
||||||
wayland_scanner_LDADD = $(EXPAT_LIBS) libwayland-util.la
|
|
||||||
$(BUILT_SOURCES) : wayland-scanner
|
|
||||||
pkgconfig_DATA += src/wayland-scanner.pc
|
|
||||||
else
|
|
||||||
wayland_scanner = wayland-scanner
|
|
||||||
endif
|
|
||||||
|
|
||||||
protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
|
protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
|
||||||
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
|
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
|
||||||
|
|
||||||
|
|
@ -224,3 +226,4 @@ os_wrappers_test_LDADD = libtest-runner.la
|
||||||
|
|
||||||
exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
|
exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
|
||||||
exec_fd_leak_checker_LDADD = libtest-runner.la
|
exec_fd_leak_checker_LDADD = libtest-runner.la
|
||||||
|
endif
|
||||||
|
|
|
||||||
30
configure.ac
30
configure.ac
|
|
@ -54,16 +54,11 @@ AC_SUBST(GCC_CFLAGS)
|
||||||
|
|
||||||
AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate])
|
AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate])
|
||||||
|
|
||||||
AC_CHECK_DECL(SFD_CLOEXEC,[],
|
AC_ARG_ENABLE([libraries],
|
||||||
[AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland")],
|
[AC_HELP_STRING([--disable-libraries],
|
||||||
[[#include <sys/signalfd.h>]])
|
[Disable compilation of wayland libraries])],
|
||||||
AC_CHECK_DECL(TFD_CLOEXEC,[],
|
[],
|
||||||
[AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland")],
|
[enable_libraries=yes])
|
||||||
[[#include <sys/timerfd.h>]])
|
|
||||||
AC_CHECK_DECL(CLOCK_MONOTONIC,[],
|
|
||||||
[AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland")],
|
|
||||||
[[#include <time.h>]])
|
|
||||||
AC_CHECK_HEADERS([execinfo.h])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([scanner],
|
AC_ARG_ENABLE([scanner],
|
||||||
[AC_HELP_STRING([--disable-scanner],
|
[AC_HELP_STRING([--disable-scanner],
|
||||||
|
|
@ -79,11 +74,26 @@ AC_ARG_ENABLE([documentation],
|
||||||
|
|
||||||
AM_CONDITIONAL(ENABLE_SCANNER, test "x$enable_scanner" = xyes)
|
AM_CONDITIONAL(ENABLE_SCANNER, test "x$enable_scanner" = xyes)
|
||||||
|
|
||||||
|
AM_CONDITIONAL(ENABLE_LIBRARIES, test "x$enable_libraries" = xyes)
|
||||||
|
|
||||||
AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for cursor icons here],
|
AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for cursor icons here],
|
||||||
[ ICONDIR=$withval],
|
[ ICONDIR=$withval],
|
||||||
[ ICONDIR=${datadir}/icons])
|
[ ICONDIR=${datadir}/icons])
|
||||||
AC_SUBST([ICONDIR])
|
AC_SUBST([ICONDIR])
|
||||||
|
|
||||||
|
if test "x$enable_libraries" = "xyes"; then
|
||||||
|
AC_CHECK_DECL(SFD_CLOEXEC,[],
|
||||||
|
[AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland libraries")],
|
||||||
|
[[#include <sys/signalfd.h>]])
|
||||||
|
AC_CHECK_DECL(TFD_CLOEXEC,[],
|
||||||
|
[AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland libraries")],
|
||||||
|
[[#include <sys/timerfd.h>]])
|
||||||
|
AC_CHECK_DECL(CLOCK_MONOTONIC,[],
|
||||||
|
[AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland libraries")],
|
||||||
|
[[#include <time.h>]])
|
||||||
|
AC_CHECK_HEADERS([execinfo.h])
|
||||||
|
fi
|
||||||
|
|
||||||
if test "x$enable_scanner" = "xyes"; then
|
if test "x$enable_scanner" = "xyes"; then
|
||||||
PKG_CHECK_MODULES(EXPAT, [expat], [],
|
PKG_CHECK_MODULES(EXPAT, [expat], [],
|
||||||
[AC_CHECK_HEADERS(expat.h, [],
|
[AC_CHECK_HEADERS(expat.h, [],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue