From 664ab79add830dfe724cd8c37aaf1b961bbd9b55 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Fri, 10 May 2013 18:35:42 +0200 Subject: [PATCH] Changed WM_OSDEP to use Conditional instead of Substitution The automake documentation states that using substitution inside the list of SOURCES will not work and calls for not doing it. The use of 'EXTRA_xxx' made things look like they worked but is probably not enough for corner cases. This patches switches to the conditional method which will be safe. --- configure.ac | 5 ++++- src/Makefile.am | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 006c8fa5..f3e113ec 100644 --- a/configure.ac +++ b/configure.ac @@ -101,7 +101,10 @@ AS_CASE(["$host"], [*-apple-darwin*], [WM_OSDEP="darwin"], [*-*-solaris*], [WM_OSDEP="stub"], dnl solaris.c when done [WM_OSDEP="stub"]) -AC_SUBST(WM_OSDEP) +AM_CONDITIONAL([WM_OSDEP_LINUX], [test "x$WM_OSDEP" = "xlinux"]) +AM_CONDITIONAL([WM_OSDEP_BSD], [test "x$WM_OSDEP" = "xbsd"]) +AM_CONDITIONAL([WM_OSDEP_DARWIN], [test "x$WM_OSDEP" = "xdarwin"]) +AM_CONDITIONAL([WM_OSDEP_GENERIC], [test "x$WM_OSDEP" = "xstub"]) dnl the prefix diff --git a/src/Makefile.am b/src/Makefile.am index f67e1cfb..2d1bd2bb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -49,7 +49,6 @@ wmaker_SOURCES = \ menu.h \ misc.c \ misc.h \ - osdep_@WM_OSDEP@.c \ monitor.c \ motif.c \ motif.h \ @@ -105,7 +104,18 @@ wmaker_SOURCES = \ workspace.c \ workspace.h -EXTRA_wmaker_SOURCES = osdep_bsd.c osdep_darwin.c osdep_linux.c osdep_stub.c +if WM_OSDEP_BSD +wmaker_SOURCES += osdep_bsd.c +endif +if WM_OSDEP_DARWIN +wmaker_SOURCES += osdep_darwin.c +endif +if WM_OSDEP_LINUX +wmaker_SOURCES += osdep_linux.c +endif +if WM_OSDEP_GENERIC +wmaker_SOURCES += osdep_stub.c +endif AM_CFLAGS =