Port autounit to glib 2.0

Signed-off-by: Roland Stigge <stigge@antcom.de>

--- autounit-0.20.1.orig/configure.in
+++ autounit-0.20.1/configure.in
@@ -11,9 +11,6 @@
 AC_PROG_CC
 AC_PROG_LIBTOOL
 
-# Checks for libraries.
-AM_PATH_GLIB()
-
 # Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
@@ -27,8 +24,9 @@
 AC_FUNC_FORK
 AC_CHECK_FUNCS([strchr strerror strstr strtoul])
 
-LIBS="$LIBS $GLIB_LIBS"
-CFLAGS="$CFLAGS $GLIB_CFLAGS"
+PKG_CHECK_MODULES(DEP, glib-2.0)
+AC_SUBST(DEP_CFLAGS)
+AC_SUBST(DEP_LIBS)
 
 AC_CONFIG_FILES([Makefile
 		 c-unit/Makefile
--- autounit-0.20.1.orig/c-unit/Makefile.am
+++ autounit-0.20.1/c-unit/Makefile.am
@@ -5,12 +5,12 @@
 noinst_HEADERS = au-netstring.h autounit-private.h
 
 AM_CFLAGS = \
-	$(GLIB_CFLAGS) \
+	$(DEP_CFLAGS) \
 	-I$(top_srcdir)/c-unit \
 	-I.. \
 	-I../intl \
 	-I$(top_srcdir)/intl
 
 libau_c_unit_la_SOURCES = test.c au-netstring.c suite.c assert.c
-libau_c_unit_la_LIBADD = $(GLIB_LIBS)
+libau_c_unit_la_LIBADD = $(DEP_LIBS)
 libau_c_unit_la_LDFLAGS = -version-info 4:0:2
--- autounit-0.20.1.orig/c-unit/TEST/Makefile.am
+++ autounit-0.20.1/c-unit/TEST/Makefile.am
@@ -5,15 +5,15 @@
 check_PROGRAMS = $(OUR_UNIT_TESTS)
 
 test_au_netstring_SOURCES = test-au-netstring.c
-test_au_netstring_LDADD = ../libau-c-unit.la $(GLIB_LIBS)
-test_au_netstring_CFLAGS = $(GLIB_CFLAGS) -I..
+test_au_netstring_LDADD = ../libau-c-unit.la $(DEP_LIBS)
+test_au_netstring_CFLAGS = $(DEP_CFLAGS) -I..
 
 test_test_SOURCES = test-test.c
-test_test_LDADD = ../libau-c-unit.la $(GLIB_LIBS)
-test_test_CFLAGS = $(GLIB_CFLAGS) -I..
+test_test_LDADD = ../libau-c-unit.la $(DEP_LIBS)
+test_test_CFLAGS = $(DEP_CFLAGS) -I..
 
 test_suite_SOURCES = test-suite.c
-test_suite_LDADD = ../libau-c-unit.la $(GLIB_LIBS)
-test_suite_CFLAGS = $(GLIB_CFLAGS) -I..
+test_suite_LDADD = ../libau-c-unit.la $(DEP_LIBS)
+test_suite_CFLAGS = $(DEP_CFLAGS) -I..
 
 AM_CFLAGS = -I$(top_srcdir)/c-unit -I.. -I$(top_srcdir) -I../..
