1 dnl Copyright © 2009-2012, 2015, 2019-2020, 2022-2023 Nick Bowler
3 dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 dnl This is free software: you are free to do what the fuck you want to.
5 dnl There is NO WARRANTY, to the extent permitted by law.
9 AC_INIT([upkg],[0.1],[nbowler@draconx.ca])
10 AC_CONFIG_SRCDIR([src/libupkg.c])
11 AC_CONFIG_HEADERS([config.h])
12 AC_CONFIG_MACRO_DIR([m4])
14 AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects])
15 AM_SILENT_RULES([yes])
21 LT_CONFIG_LTDL_DIR([libltdl])
23 LTDL_INIT([nonrecursive])
29 m4_include([lib/gnulib.mk])
31 DX_LIB_GLIB2([], [gobject])
32 AC_DEFINE([GLIB_DISABLE_DEPRECATION_WARNINGS], [1],
33 [Define to shut up glib deprecation silliness.])
36 [AS_HELP_STRING([--with-modlib],
37 [specify which module decoding library to use - one of modplug, none or auto. [default=auto]]
39 [with_modlib=$withval],
43 AS_CASE([$with_modlib],
45 [modplug], [DX_LIB_LIBMODPLUG([use_modlib=modplug])],
46 [auto], [DX_LIB_LIBMODPLUG([use_modlib=modplug], [:])],
47 [AC_MSG_ERROR([Invalid argument to --with-modlib: $with_modlib])])
49 AC_MSG_CHECKING([which module library to use])
50 AC_MSG_RESULT([$use_modlib])
52 AM_CONDITIONAL([USE_LIBMODPLUG], [test x$use_modlib = xmodplug])
53 AM_CONDITIONAL([USE_DUMMYMOD], [test x$use_modlib = xnone])
55 DX_PROG_GOB2([2.0.0], [have_gob2=yes], [have_gob2=no])
56 AM_CONDITIONAL([HAVE_GOB2], [test x"$have_gob2" = x"yes"])
58 AS_IF([test x"$have_gob2" != x"yes"], [dx_cv_gob2_dynamic_types=no])
59 AC_CACHE_CHECK([Whether $GOB2 supports dynamic types],
60 [dx_cv_gob2_dynamic_types], [cat >conftest.gob <<'EOF'
61 class :Conftest from G:Object (dynamic)
63 public void test(void)
68 dx_cv_gob2_dynamic_types=no
69 AS_IF([$GOB2 conftest.gob >/dev/null 2>&1],
70 [mv conftest.c conftest.inc
71 save_CFLAGS=$CFLAGS save_LIBS=$LIBS
72 CFLAGS="$GLIB_CFLAGS $CFLAGS"
73 LIBS="$LIBS $GLIB_LIBS"
74 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#]include "conftest.inc"],
75 [conftest_register_type(0);])], [dx_cv_gob2_dynamic_types=yes])
76 CFLAGS=$save_CFLAGS LIBS=$save_LIBS])
78 AM_CONDITIONAL([HAVE_GOB2_DYN], [test x"$dx_cv_gob2_dynamic_types" = x"yes"])
80 AC_CONFIG_TESTDIR([.], [test:.])
82 AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
84 AC_CONFIG_FILES([Makefile libuobject.pc])