diff options
author | Dave Davenport <qball@gmpclient.org> | 2018-04-14 14:40:29 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2018-04-14 14:40:29 +0200 |
commit | 86f8d99403858fa8f5027eea7145e46b9eced8ab (patch) | |
tree | 73aa7e1da9373a094e9d2f69ae8ceb0538afc98d | |
parent | 3a726eabbabf1867325b2d2bd51b6b657e655431 (diff) |
Allow libxcb-xrm to be disabled in auto*noxrm
-rw-r--r-- | Makefile.am | 16 | ||||
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | source/xrmoptions.c | 8 |
3 files changed, 30 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am index d2d0db4e..624205fe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -132,6 +132,7 @@ rofi_SOURCES=\ rofi_CFLAGS=\ $(AM_CFLAGS)\ $(glib_CFLAGS)\ + $(xrm_CFLAGS)\ $(NKUTILS_CFLAGS)\ $(GW_XCB_CFLAGS)\ $(pango_CFLAGS)\ @@ -153,6 +154,7 @@ rofi_CFLAGS=\ rofi_LDADD=\ $(glib_LIBS)\ + $(xrm_LIBS)\ $(NKUTILS_LIBS)\ $(GW_XCB_LIBS)\ $(libsn_LIBS)\ @@ -325,8 +327,8 @@ textbox_test_LDADD=\ $(librsvg_LIBS)\ $(libsn_LIBS) -helper_pidfile_CFLAGS=$(textbox_test_CFLAGS) -helper_pidfile_LDADD=$(textbox_test_LDADD) +helper_pidfile_CFLAGS=$(textbox_test_CFLAGS) $(xrm_CFLAGS) +helper_pidfile_LDADD=$(textbox_test_LDADD) $(xrm_LIBS) helper_pidfile_SOURCES=\ config/config.c\ include/rofi.h\ @@ -453,6 +455,7 @@ helper_test_SOURCES=\ helper_test_CFLAGS=\ $(AM_CFLAGS)\ $(glib_CFLAGS)\ + $(xrm_CFLAGS)\ $(pango_CFLAGS)\ $(NKUTILS_CFLAGS)\ $(GW_XCB_CFLAGS)\ @@ -469,6 +472,7 @@ helper_test_CFLAGS=\ helper_test_LDADD=\ $(glib_LIBS)\ + $(xrm_LIBS)\ $(pango_LIBS)\ $(NKUTILS_LIBS)\ $(GW_XCB_LIBS)\ @@ -514,8 +518,8 @@ helper_config_cmdline_parser_SOURCES=\ if USE_CHECK -mode_test_CFLAGS=$(textbox_test_CFLAGS) $(check_CFLAGS) -mode_test_LDADD=$(textbox_test_LDADD) $(check_LIBS) +mode_test_CFLAGS=$(textbox_test_CFLAGS) $(check_CFLAGS) $(xrm_CFLAGS) +mode_test_LDADD=$(textbox_test_LDADD) $(check_LIBS) $(xrm_LIBS) mode_test_SOURCES=\ config/config.c\ test/mode-test.c\ @@ -528,8 +532,8 @@ mode_test_SOURCES=\ source/keyb.c\ include/mode.h\ include/mode-private.h -helper_tokenize_CFLAGS=$(textbox_test_CFLAGS) $(check_CFLAGS) -helper_tokenize_LDADD=$(textbox_test_LDADD) $(check_LIBS) +helper_tokenize_CFLAGS=$(textbox_test_CFLAGS) $(check_CFLAGS) $(xrm_CFLAGS) +helper_tokenize_LDADD=$(textbox_test_LDADD) $(check_LIBS) $(xrm_LIBS) helper_tokenize_SOURCES=\ config/config.c\ include/rofi.h\ diff --git a/configure.ac b/configure.ac index 0f2ff217..4ed6e2c9 100644 --- a/configure.ac +++ b/configure.ac @@ -120,7 +120,7 @@ dnl PKG_CONFIG based dependencies dnl --------------------------------------------------------------------- NK_INIT([bindings xdg-theme]) PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.40 gio-unix-2.0 gmodule-2.0]) -GW_CHECK_XCB([xcb-aux xcb-xkb xkbcommon xkbcommon-x11 xcb-ewmh xcb-icccm xcb-xrm xcb-randr xcb-xinerama]) +GW_CHECK_XCB([xcb-aux xcb-xkb xkbcommon xkbcommon-x11 xcb-ewmh xcb-icccm xcb-randr xcb-xinerama]) PKG_CHECK_MODULES([pango], [pango pangocairo]) PKG_CHECK_MODULES([cairo], [cairo cairo-xcb]) PKG_CHECK_MODULES([libsn], [libstartup-notification-1.0 ]) @@ -135,6 +135,17 @@ AS_IF([test "x${enable_check}" != "xno"], [ PKG_CHECK_MODULES([check],[check >= AM_CONDITIONAL([USE_CHECK], [test "x${enable_check}" != "xno" && test "$HAVE_CHECK" -eq 1]) +AC_ARG_ENABLE([xrm], AS_HELP_STRING([--disable-xrm], [Build with xresources support using xcb-xrm library (default: enabled)])) + +AS_IF([test "x${enable_xrm}" != "xno"], [ PKG_CHECK_MODULES([xrm],[xcb-xrm ], [HAVE_XRMPKG=1]) ]) +AS_IF([test "x${enable_xrm}" != "xno" && test "$HAVE_XRMPKG" -eq 1], [ + AM_CONDITIONAL([HAVE_XRM], [1]) + AC_DEFINE([HAVE_XRM],[1],[Enable Xresources support]) + ],[ + AM_CONDITIONAL([HAVE_XRM], [0]) + ]) + + dnl --------------------------------------------------------------------- dnl Gets the resource compile tool path. dnl --------------------------------------------------------------------- diff --git a/source/xrmoptions.c b/source/xrmoptions.c index 36c296be..b9162d04 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -32,7 +32,9 @@ #include <unistd.h> #include <xcb/xcb.h> #include <xcb/xkb.h> +#ifdef HAVE_XRM #include <xcb/xcb_xrm.h> +#endif #include <glib.h> #include "xcb.h" #include "xcb-internal.h" @@ -239,6 +241,7 @@ void config_parser_add_option ( XrmOptionType type, const char *key, void **valu num_extra_options++; } +#ifdef HAVE_XRM static void config_parser_set ( XrmOption *option, char *xrmValue, enum ConfigSource source ) { switch ( option->type ) @@ -312,20 +315,24 @@ static void __config_parse_xresource_options_dynamic ( xcb_xrm_database_t *xDB, g_free ( name ); } } +#endif void config_parse_xresource_options ( xcb_stuff *xcb ) { +#ifdef HAVE_XRM xcb_xrm_database_t *xDB = xcb_xrm_database_from_default ( xcb->connection ); if ( xDB ) { __config_parse_xresource_options ( xDB, CONFIG_XRESOURCES ); __config_parse_xresource_options_dynamic ( xDB, CONFIG_XRESOURCES ); xcb_xrm_database_free ( xDB ); } +#endif } void config_parse_xresource_options_file ( const char *filename ) { if ( !filename ) { return; } +#ifdef HAVE_XRM // Map Xresource entries to rofi config options. xcb_xrm_database_t *xDB = xcb_xrm_database_from_file ( filename ); if ( xDB == NULL ) { @@ -334,6 +341,7 @@ void config_parse_xresource_options_file ( const char *filename ) __config_parse_xresource_options ( xDB, CONFIG_FILE ); __config_parse_xresource_options_dynamic ( xDB, CONFIG_FILE ); xcb_xrm_database_free ( xDB ); +#endif } /** |