X-Git-Url: https://git.draconx.ca/gitweb/upkg.git/blobdiff_plain/382855dd3f69cdce3e3b4eb6da392f881e7825da..6e7d67bed9f4d76943e2f1724acff1e16b8bf7ac:/configure.ac diff --git a/configure.ac b/configure.ac index f86b8dd..48ccbb2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,3 +1,9 @@ +dnl Copyright © 2009-2011 Nick Bowler +dnl +dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2. +dnl This is free software: you are free to do what the fuck you want to. +dnl There is NO WARRANTY, to the extent permitted by law. + AC_PREREQ(2.62) AC_INIT([upkg],[0.1],[nbowler@draconx.ca]) AC_CONFIG_SRCDIR([src/libupkg.c]) @@ -5,32 +11,60 @@ 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 + +LT_CONFIG_LTDL_DIR([libltdl]) +LT_INIT([dlopen]) +LTDL_INIT([nonrecursive]) + +AM_CONDITIONAL([BUNDLED_LIBLTDL], [test x$LTDLDEPS != x]) -AC_ARG_WITH([gobject], - [AS_HELP_STRING([--with-gobject], - [build tools requiring libgobject [default=yes]] +gl_INIT + +m4_include([lib/gnulib.mk]) + +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_gobject=yes]) + [with_modlib=$withval], + [with_modlib=auto]) -have_gobject=no -if test x$with_gobject = xyes; then -AM_PATH_GLIB_2_0(, [have_gobject=yes], [have_gobject=no], [gobject]) -fi +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]) -AM_CONDITIONAL([BUILD_UPKG], [test x$have_gobject = xyes]) + 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]) -LT_CONFIG_LTDL_DIR([libltdl]) -LT_INIT([dlopen]) -LTDL_INIT([recursive]) +AM_CONDITIONAL([USE_LIBMODPLUG], [test x$use_modlib = xmodplug]) +AM_CONDITIONAL([USE_DUMMYMOD], [test x$use_modlib = xnone]) -AM_CONDITIONAL([BUNDLED_LIBLTDL], [test x$LTDLDEPS != x]) +GOB2_CHECK([2.0.0]) AC_CONFIG_FILES([ Makefile - libltdl/Makefile - src/Makefile + libuobject.pc ]) AC_OUTPUT