]> git.draconx.ca Git - upkg.git/blobdiff - configure.ac
Fix build with more recent libmodplug.
[upkg.git] / configure.ac
index 42594de730addfda86b819a926ef11e4cbbc2f3e..752343f62616ae84dffb1c1b50c776cdbc143ee5 100644 (file)
@@ -1,34 +1,31 @@
+dnl Copyright © 2009-2012, 2015, 2019 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])
 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])])
+AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects])
+AM_SILENT_RULES([yes])
+DX_AUTOMAKE_COMPAT
 
 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])
+LTDL_INIT([nonrecursive])
 
 gl_INIT
 
-AC_ARG_WITH([gobject],
-       [AS_HELP_STRING([--with-gobject],
-               [build tools requiring libgobject [default=yes]]
-       )],
-       [],
-       [with_gobject=yes])
+m4_include([lib/gnulib.mk])
 
-have_gobject=no
-if test x$with_gobject = xyes; then
-AM_PATH_GLIB_2_0(, [have_gobject=yes], [have_gobject=no], [gobject])
-fi
+CHECK_GLIB_2([], [gobject])
 
 AC_ARG_WITH([modlib],
        [AS_HELP_STRING([--with-modlib],
@@ -37,44 +34,23 @@ AC_ARG_WITH([modlib],
        [with_modlib=$withval],
        [with_modlib=auto])
 
-CHECK_LIBMODPLUG([have_libmodplug=yes], [have_libmodplug=no])
+use_modlib=none
+AS_CASE([$with_modlib],
+  [no|none], [:],
+  [modplug], [DX_LIB_LIBMODPLUG([use_modlib=modplug])],
+  [auto], [DX_LIB_LIBMODPLUG([use_modlib=modplug], [:])],
+  [AC_MSG_ERROR([Invalid argument to --with-modlib: $with_modlib])])
+
 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])
 
-AM_CONDITIONAL([BUILD_UPKG], [test x$have_gobject = xyes])
+GOB2_CHECK([2.0.0])
 
 AC_CONFIG_FILES([
        Makefile
-       libltdl/Makefile
-       lib/Makefile
-       src/Makefile
+       libuobject.pc
 ])
 AC_OUTPUT