AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_PROG_CC_C99
+gl_EARLY
+
+LT_CONFIG_LTDL_DIR([libltdl])
+LT_INIT([dlopen])
+LTDL_INIT([recursive])
+
+AM_CONDITIONAL([BUNDLED_LIBLTDL], [test x$LTDLDEPS != x])
+
+gl_INIT
+
+AC_ARG_WITH([gobject],
+ [AS_HELP_STRING([--with-gobject],
+ [build tools requiring libgobject [default=yes]]
+ )],
+ [],
+ [with_gobject=yes])
+
+have_gobject=no
+if test x$with_gobject = xyes; then
+AM_PATH_GLIB_2_0(, [have_gobject=yes], [have_gobject=no], [gobject])
+fi
+
+AM_CONDITIONAL([BUILD_UPKG], [test x$have_gobject = xyes])
-LT_INIT
AC_CONFIG_FILES([
Makefile
+ libltdl/Makefile
+ lib/Makefile
src/Makefile
])
AC_OUTPUT