+gl_EARLY
+
+LT_CONFIG_LTDL_DIR([libltdl])
+LT_INIT([dlopen])
+LTDL_INIT([recursive])
+
+AM_CONDITIONAL([BUNDLED_LIBLTDL], [test x$LTDLDEPS != x])
+
+gl_INIT
+
+CHECK_GLIB_2([], [gobject])
+
+AC_ARG_WITH([modlib],
+ [AS_HELP_STRING([--with-modlib],
+ [specify which module decoding library to use - one of modplug, none or auto. [default=auto]]
+ )],
+ [with_modlib=$withval],
+ [with_modlib=auto])
+
+case $with_modlib in
+no|none)
+ use_modlib=none
+;;
+modplug)
+ DX_CHECK_LIBMODPLUG([use_modlib=modplug], [])
+;;
+auto)
+ DX_CHECK_LIBMODPLUG([have_libmodplug=yes], [have_libmodplug=no])
+
+ if test x$have_libmodplug = xyes; then
+ use_modlib=modplug
+ else
+ use_modlib=none
+ fi
+;;
+*)
+ AC_MSG_ERROR([Invalid argument to --with-modlib: $with_modlib])
+;;
+esac
+AC_MSG_CHECKING([which module library to use])
+AC_MSG_RESULT([$use_modlib])