build: Conditionally add spawn and IO channel without using EXTRA_ prefix

See previous commit; same reasoning behind the commit, except that these
sources weren’t (yet) causing `make distcheck` to fail.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
diff --git a/configure.ac b/configure.ac
index 5fd2d5c..11fde90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1552,14 +1552,14 @@
 AC_MSG_CHECKING(for gspawn implementation)
 case "$host" in
   *-*-mingw*)
-    GSPAWN=gspawn-win32.lo
+    g_spawn_impl=win32
     ;;
   *)
-    GSPAWN=gspawn.lo
+    g_spawn_impl=unix
     ;;    
 esac
-AC_MSG_RESULT($GSPAWN)
-AC_SUBST(GSPAWN)
+AC_MSG_RESULT($g_spawn_impl)
+AM_CONDITIONAL(G_SPAWN_WIN32, [test "$g_spawn_impl" = "win32"])
 
 dnl *************************
 dnl *** GIOChannel checks ***
@@ -1568,14 +1568,14 @@
 AC_MSG_CHECKING(for GIOChannel implementation)
 case "$host" in
   *-*-mingw*)
-    GIO=giowin32.lo
+    g_io_channel_impl=win32
     ;;
   *)
-    GIO=giounix.lo
+    g_io_channel_impl=unix
     ;;    
 esac
-AC_MSG_RESULT($GIO)
-AC_SUBST(GIO)
+AC_MSG_RESULT($g_io_channel_impl)
+AM_CONDITIONAL(G_IO_CHANNEL_WIN32, [test "$g_io_channel_impl" = "win32"])
 
 dnl *********************************
 dnl *** Directory for GIO modules ***
diff --git a/glib/Makefile.am b/glib/Makefile.am
index 9234599..8f6536c 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -163,6 +163,7 @@
 	gshell.c		\
 	gslice.c		\
 	gslist.c		\
+	gspawn-private.h	\
 	gstdio.c		\
 	gstdioprivate.h		\
 	gstrfuncs.c		\
@@ -226,13 +227,17 @@
 libglib_2_0_la_SOURCES += gwin32.c
 endif
 
-EXTRA_libglib_2_0_la_SOURCES = \
-	giounix.c	\
-	giowin32.c	\
-	gspawn.c	\
-	gspawn-private.h \
-	gspawn-win32.c	\
-	$(NULL)
+if G_SPAWN_WIN32
+libglib_2_0_la_SOURCES += gspawn-win32.c
+else
+libglib_2_0_la_SOURCES += gspawn.c
+endif
+
+if G_IO_CHANNEL_WIN32
+libglib_2_0_la_SOURCES += giowin32.c
+else
+libglib_2_0_la_SOURCES += giounix.c
+endif
 
 glibincludedir=$(includedir)/glib-2.0
 glibinclude_HEADERS =   \
@@ -364,8 +369,8 @@
 endif
 
 libglib_2_0_la_CFLAGS = $(AM_CFLAGS) $(GLIB_HIDDEN_VISIBILITY_CFLAGS) $(LIBSYSTEMD_CFLAGS)
-libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD) $(LIBSYSTEMD_LIBS)
-libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ $(glib_win32_res) $(glib_def)
+libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD) $(LIBSYSTEMD_LIBS)
+libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) $(glib_win32_res) $(glib_def)
 
 libglib_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
 	 $(glib_win32_res_ldflag) \