kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=4df26af47adc5fc48705ab67c9fa3c9d595f4701

commit 4df26af47adc5fc48705ab67c9fa3c9d595f4701
Author: Kim Woelders <k...@woelders.dk>
Date:   Mon Apr 19 06:32:04 2021 +0200

    Don't build disabled stuff
    
    Disable by autofoo instead of by #ifdef.
---
 configure.ac       |  2 ++
 src/Makefile.am    | 59 +++++++++++++++++++++++++++++++++++++++++++++---------
 src/sound.c        |  3 ---
 src/sound_alsa.c   |  3 ---
 src/sound_esound.c |  3 ---
 src/sound_load.c   |  6 +-----
 src/sound_player.c |  3 ---
 src/sound_pulse.c  |  3 ---
 src/sound_sndio.c  |  3 ---
 src/text_pango.c   |  6 ++----
 src/text_xft.c     |  4 +---
 11 files changed, 55 insertions(+), 40 deletions(-)

diff --git a/configure.ac b/configure.ac
index ee4f9083..1baa1050 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,7 @@ xplayer)
 *)
   enable_sound=no;;
 esac
+AM_CONDITIONAL(ENABLE_SOUND, test "x$enable_sound" != "xno")
 
 AC_ARG_WITH(sndldr,
   AS_HELP_STRING([--with-sndldr],
@@ -184,6 +185,7 @@ xplayer)
   AC_DEFINE(ENABLE_SOUND, 1, [Sound support])
   ;;
 esac
+AM_CONDITIONAL(USE_SOUND_LOADER, test "x$with_sndldr" != "xnone")
 
 # Save CPPFLAGS/LDFLAGS and add X_... to each
 SAVE_CPPFLAGS="$CPPFLAGS"
diff --git a/src/Makefile.am b/src/Makefile.am
index 0b9d768e..b0ff8e02 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -89,7 +89,6 @@ e16_SOURCES = \
        slide.c                 slide.h                 \
        slideout.c              \
        snaps.c                 snaps.h                 \
-       sound.c                 sound.h                 \
        sounds.h                \
        stacking.c              \
        startup.c               \
@@ -108,7 +107,8 @@ e16_SOURCES = \
        xprop.c                 xprop.h                 \
        x.c                     xwin.h                  \
        xtypes.h                \
-       $(MODULE_SRCS)          \
+       $(SRCS_SOUND)           \
+       $(SRCS_FONTS)           \
        $(SRCS_GNOME)           \
        $(SRCS_ZOOM)            \
        $(SRCS_GLX)             \
@@ -130,7 +130,8 @@ e16_CPPFLAGS = \
        $(AM_CPPFLAGS) \
        -I$(top_srcdir) \
        -I$(top_builddir) \
-       $(MODULE_CFLAGS) \
+       $(SOUND_CFLAGS) \
+       $(FONTS_CFLAGS) \
        $(IMLIB2_CFLAGS) \
        $(DBUS_CFLAGS) \
        $(XI_CFLAGS) \
@@ -142,7 +143,8 @@ LDADD = \
        $(LTLIBINTL)            \
        $(LTLIBICONV)           \
        $(IMLIB2_LIBS)          \
-       $(MODULE_LIBS)          \
+       $(SOUND_LIBS)           \
+       $(FONTS_LIBS)           \
        $(GLX_LIBS)             \
        $(XCOMPOSITE_LIBS)      \
        $(XDAMAGE_LIBS)         \
@@ -159,6 +161,7 @@ LDADD = \
        $(X_EXTRA_LIBS)         \
        $(E_X_LIBS)             \
        $(DBUS_LIBS)            \
+       $(MODULE_LIBS)          \
        $(CLOCK_LIBS)           \
        -lX11 -lm
 
@@ -167,6 +170,10 @@ SNDLDR_LIBS = $(AUDIOFILE_LIBS) $(SNDFILE_LIBS)
 
 if BUILD_MODULES
 
+if ENABLE_SOUND
+SRCS_SOUND = sound.c sound.h
+endif
+
 e16_LDFLAGS = -export-dynamic
 MODULE_LIBS = $(DLOPEN_LIBS)
 
@@ -236,12 +243,44 @@ endif
 
 else
 
-MODULE_SRCS = sound_esound.c sound_pulse.c sound_sndio.c sound_alsa.c 
sound_player.c sound_load.c \
-       ttfont.c text_xft.c text_pango.c
-MODULE_LIBS = $(ESD_LIBS) $(PULSE_LIBS) $(SNDIO_LIBS) $(ALSA_LIBS) 
$(SNDLDR_LIBS) \
-             $(PANGO_LIBS) $(XFT_LIBS)
-MODULE_CFLAGS = $(ESD_CFLAGS) $(PULSE_CFLAGS) $(SNDIO_CFLAGS) $(SNDLDR_CFLAGS) 
\
-               $(PANGO_CFLAGS) $(XFT_CFLAGS)
+if ENABLE_SOUND
+if USE_SOUND_LOADER
+SRCS_SOUND_LOADER = sound_load.c
+endif
+if USE_SOUND_ESOUND
+SRCS_SOUND_ESOUND = sound_esound.c
+endif
+if USE_SOUND_PULSE
+SRCS_SOUND_PULSE = sound_pulse.c
+endif
+if USE_SOUND_SNDIO
+SRCS_SOUND_SNDIO = sound_sndio.c
+endif
+if USE_SOUND_ALSA
+SRCS_SOUND_ALSA = sound_alsa.c
+endif
+if USE_SOUND_PLAYER
+SRCS_SOUND_PLAYER = sound_player.c
+endif
+SRCS_SOUND = sound.c sound.h $(SRCS_SOUND_LOADER) \
+            $(SRCS_SOUND_ESOUND) $(SRCS_SOUND_PULSE) $(SRCS_SOUND_SNDIO) \
+            $(SRCS_SOUND_ALSA) $(SRCS_SOUND_PLAYER)
+endif
+
+SRCS_FONT_IFT = ttfont.c
+if USE_LIBXFT
+SRCS_FONT_XFT = text_xft.c
+endif
+if USE_LIBPANGO
+SRCS_FONT_PANGO = text_pango.c
+endif
+SRCS_FONTS = $(SRCS_FONT_IFT) $(SRCS_FONT_XFT) $(SRCS_FONT_PANGO)
+
+SOUND_LIBS = $(ESD_LIBS) $(PULSE_LIBS) $(SNDIO_LIBS) $(ALSA_LIBS) 
$(SNDLDR_LIBS)
+FONTS_LIBS = $(PANGO_LIBS) $(XFT_LIBS)
+
+SOUND_CFLAGS = $(ESD_CFLAGS) $(PULSE_CFLAGS) $(SNDIO_CFLAGS) $(SNDLDR_CFLAGS)
+FONTS_CFLAGS = $(PANGO_CFLAGS) $(XFT_CFLAGS)
 
 endif
 
diff --git a/src/sound.c b/src/sound.c
index 380a680e..4f2da2ac 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -22,7 +22,6 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include "E.h"
-#if ENABLE_SOUND
 #include "dialog.h"
 #include "emodule.h"
 #include "file.h"
@@ -581,5 +580,3 @@ const EModule       ModSound = {
    MOD_ITEMS(SoundIpcArray),
    MOD_ITEMS(SoundCfgItems)
 };
-
-#endif /* ENABLE_SOUND */
diff --git a/src/sound_alsa.c b/src/sound_alsa.c
index 98efd64f..adc77644 100644
--- a/src/sound_alsa.c
+++ b/src/sound_alsa.c
@@ -22,7 +22,6 @@
  */
 #include "config.h"
 
-#if defined(ENABLE_SOUND) && defined(USE_SOUND_ALSA)
 #include <alsa/asoundlib.h>
 
 #include "sound.h"
@@ -138,5 +137,3 @@ const SoundOps      SoundOps_alsa = {
    _sound_alsa_Init, _sound_alsa_Exit, _sound_alsa_Load,
    _sound_alsa_Destroy, _sound_alsa_Play,
 };
-
-#endif /* HAVE_SOUND && USE_SOUND_ALSA */
diff --git a/src/sound_esound.c b/src/sound_esound.c
index f8d4be16..6822fe0e 100644
--- a/src/sound_esound.c
+++ b/src/sound_esound.c
@@ -23,7 +23,6 @@
  */
 #include "config.h"
 
-#if defined(ENABLE_SOUND) && defined(USE_SOUND_ESOUND)
 #include <esd.h>
 #include <unistd.h>
 
@@ -147,5 +146,3 @@ const SoundOps      SoundOps_esd = {
    _sound_esound_Init, _sound_esound_Exit,
    _sound_esound_Load, _sound_esound_Destroy, _sound_esound_Play,
 };
-
-#endif /* ENABLE_SOUND && USE_SOUND_ESOUND */
diff --git a/src/sound_load.c b/src/sound_load.c
index 62657d4a..8a6e4fd8 100644
--- a/src/sound_load.c
+++ b/src/sound_load.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
- * Copyright (C) 2004-2020 Kim Woelders
+ * Copyright (C) 2004-2021 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -22,8 +22,6 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include "E.h"
-
-#if ENABLE_SOUND
 #include "sound.h"
 
 #if USE_SOUND_LOADER_AUDIOFILE
@@ -121,5 +119,3 @@ SoundSampleGetData(const char *file, SoundSampleData * ssd)
 }
 
 #endif /* USE_SOUND_LOADER_SNDFILE */
-
-#endif /* ENABLE_SOUND */
diff --git a/src/sound_player.c b/src/sound_player.c
index d04d2127..bab3730b 100644
--- a/src/sound_player.c
+++ b/src/sound_player.c
@@ -22,7 +22,6 @@
  */
 #include "config.h"
 
-#if defined(ENABLE_SOUND) && defined(USE_SOUND_PLAYER)
 #include "file.h"
 #include "sound.h"
 #include "util.h"
@@ -68,5 +67,3 @@ const SoundOps      SoundOps_player = {
    _sound_player_Init, _sound_player_Exit,
    _sound_player_Load, _sound_player_Destroy, _sound_player_Play,
 };
-
-#endif /* ENABLE_SOUND && USE_SOUND_PLAYER */
diff --git a/src/sound_pulse.c b/src/sound_pulse.c
index a71ef7c1..8feb4da5 100644
--- a/src/sound_pulse.c
+++ b/src/sound_pulse.c
@@ -22,7 +22,6 @@
  */
 #include "config.h"
 
-#if defined(ENABLE_SOUND) && defined(USE_SOUND_PULSE)
 #include <fcntl.h>
 #include <pulse/pulseaudio.h>
 #include <sys/stat.h>
@@ -354,5 +353,3 @@ const SoundOps      SoundOps_pulse = {
    _sound_pulse_Init, _sound_pulse_Exit,
    _sound_pulse_Load, _sound_pulse_Destroy, _sound_pulse_Play,
 };
-
-#endif /* ENABLE_SOUND && USE_SOUND_PULSE */
diff --git a/src/sound_sndio.c b/src/sound_sndio.c
index b289dda4..06e0c998 100644
--- a/src/sound_sndio.c
+++ b/src/sound_sndio.c
@@ -23,7 +23,6 @@
  */
 #include "config.h"
 
-#if defined(ENABLE_SOUND) && defined(USE_SOUND_SNDIO)
 #include <sndio.h>
 
 #include "sound.h"
@@ -124,5 +123,3 @@ const SoundOps      SoundOps_sndio = {
    _sound_sndio_Init, _sound_sndio_Exit, _sound_sndio_Load,
    _sound_sndio_Destroy, _sound_sndio_Play,
 };
-
-#endif /* ENABLE_SOUND && USE_SOUND_SNDIO */
diff --git a/src/text_pango.c b/src/text_pango.c
index f89fcae9..8643788f 100644
--- a/src/text_pango.c
+++ b/src/text_pango.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2016 Kim Woelders
+ * Copyright (C) 2007-2021 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -22,9 +22,9 @@
  */
 #include "config.h"
 
-#ifdef USE_PANGO
 #include <X11/Xft/Xft.h>
 #include <pango/pangoxft.h>
+
 #include "tclass.h"
 #include "xwin.h"
 
@@ -134,5 +134,3 @@ const FontOps       FontOps_pango = {
    _pango_xft_TextSize, TextstateTextFit, _pango_xft_TextDraw,
    _xft_FdcInit, _xft_FdcFini, _xft_FdcSetDrawable, _xft_FdcSetColor
 };
-
-#endif /* USE_PANGO */
diff --git a/src/text_xft.c b/src/text_xft.c
index 4ba7f7d1..a98f5afa 100644
--- a/src/text_xft.c
+++ b/src/text_xft.c
@@ -22,9 +22,9 @@
  */
 #include "config.h"
 
-#ifdef USE_XFT
 #include <X11/extensions/Xrender.h>
 #include <X11/Xft/Xft.h>
+
 #include "tclass.h"
 #include "xtypes.h"
 
@@ -166,5 +166,3 @@ const FontOps       FontOps_xft = {
    _xft_Load, _xft_Unload, _xft_TextSize, TextstateTextFit, _xft_TextDraw,
    _xft_FdcInit, _xft_FdcFini, _xft_FdcSetDrawable, _xft_FdcSetColor
 };
-
-#endif /* FONT_TYPE_XFT */

-- 


Reply via email to