build: Conditionally add gwin32.c to sources without using EXTRA_ prefix

Instead of messing around with EXTRA_*_SOURCES and manually handling .lo
files, why not just add gwin32.c to the GLib sources conditionally?

This will hopefully fix `make distcheck` failing due to gwin32.Plo not
being generated in the sub-builddir≠srcdir stage, due to depcomp
inexplicably not generating it. (Note that it is correctly generated in
non-distcheck builds.)

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2018-07-31 14:40:29 +01:00
parent bcafcc5b54
commit 862fe11f90
2 changed files with 7 additions and 15 deletions

View File

@ -1772,18 +1772,6 @@ dnl ****************************************
dnl *** platform dependent source checks ***
dnl ****************************************
AC_MSG_CHECKING(for platform-dependent source)
case "$host" in
*-*-cygwin*|*-*-mingw*)
PLATFORMDEP=gwin32.lo
;;
*)
PLATFORMDEP=
;;
esac
AC_MSG_RESULT($PLATFORMDEP)
AC_SUBST(PLATFORMDEP)
AC_MSG_CHECKING([whether to compile timeloop])
case "$host" in
*-*-cygwin*|*-*-mingw*|*-*-minix)

View File

@ -222,13 +222,17 @@ libglib_2_0_la_SOURCES += gthread-posix.c
endif
endif
if PLATFORM_WIN32
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 \
gwin32.c
$(NULL)
glibincludedir=$(includedir)/glib-2.0
glibinclude_HEADERS = \
@ -360,8 +364,8 @@ pcre_inc =
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@ @PLATFORMDEP@ @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@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
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_LDFLAGS = $(GLIB_LINK_FLAGS) \
$(glib_win32_res_ldflag) \