]> git.draconx.ca Git - upkg.git/blobdiff - configure.ac
build: Add libuobject.pc
[upkg.git] / configure.ac
index 468147bb73354dadcebf99d49e45ba5ea7bba2c9..ed1e5de84a9f48c6690bff3fdaa381960d1e719f 100644 (file)
@@ -5,6 +5,7 @@ AC_CONFIG_HEADER([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 
 AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 AC_PROG_CC_C99
 gl_EARLY
@@ -17,25 +18,52 @@ 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])
+CHECK_GLIB_2([], [gobject])
 
-have_gobject=no
-if test x$with_gobject = xyes; then
-AM_PATH_GLIB_2_0(, [have_gobject=yes], [have_gobject=no], [gobject])
-fi
+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])
 
-AM_CONDITIONAL([BUILD_UPKG], [test x$have_gobject = xyes])
+CHECK_LIBMODPLUG([have_libmodplug=yes], [have_libmodplug=no])
+AC_MSG_CHECKING([which module library to use])
+case $with_modlib in
+none)
+       use_modlib=none
+;;
+no)
+       use_modlib=none
+;;
+modplug)
+       if test x$have_libmodplug = xyes; then
+               use_modlib=modplug
+       else
+               use_modlib=none
+       fi
+;;
+auto)
+       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_RESULT([$use_modlib])
 
+AM_CONDITIONAL([USE_LIBMODPLUG], [test x$use_modlib = xmodplug])
+AM_CONDITIONAL([USE_DUMMYMOD],   [test x$use_modlib = xnone])
 
 AC_CONFIG_FILES([
        Makefile
        libltdl/Makefile
        lib/Makefile
        src/Makefile
+       libuobject.pc
 ])
 AC_OUTPUT