From 25a96a81909984206a20f2f382e828a66b9cb447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Sun, 16 Oct 2022 15:42:16 -0500 Subject: [PATCH] allow use config.def.h instead of config.h --- Makefile | 2 +- config.mk | 3 +++ dwl.c | 8 +++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c26f475..3d17001 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ include config.mk # flags for compiling -DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND) +DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND) $(CONFIG_H) DWLDEVCFLAGS = -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wno-sign-compare -Wshadow -Wunused-macros\ -Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types diff --git a/config.mk b/config.mk index 091c03a..dd31704 100644 --- a/config.mk +++ b/config.mk @@ -7,6 +7,9 @@ PKG_CONFIG = pkg-config PREFIX = /usr/local MANDIR = $(PREFIX)/share/man +# Comment to use config.h instead of config.def.h +CONFIG_H = -DUSE_CONFIG_DEF_H + XWAYLAND = XLIBS = # Uncomment to build XWayland support diff --git a/dwl.c b/dwl.c index 4fc01ba..bbfd5c4 100644 --- a/dwl.c +++ b/dwl.c @@ -436,7 +436,13 @@ static Atom netatom[NetLast]; /* configuration, allows nested code to access above variables */ #include "push.h" -#include "config.h" + +#ifdef USE_CONFIG_DEF_H +# include "config.def.h" +#else +# include "config.h" +#endif + #include "push.c" /* attempt to encapsulate suck into one file */