]> git.draconx.ca Git - upkg.git/blob - configure.ac
Disable deprecation warnings from Glib.
[upkg.git] / configure.ac
1 dnl Copyright © 2009-2012, 2015, 2019-2020, 2022 Nick Bowler
2 dnl
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.
6
7 AC_INIT([upkg],[0.1],[nbowler@draconx.ca])
8 AC_CONFIG_SRCDIR([src/libupkg.c])
9 AC_CONFIG_HEADER([config.h])
10 AC_CONFIG_MACRO_DIR([m4])
11
12 AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects])
13 AM_SILENT_RULES([yes])
14 DX_AUTOMAKE_COMPAT
15
16 AC_PROG_CC_C99
17 gl_EARLY
18
19 LT_CONFIG_LTDL_DIR([libltdl])
20 LT_INIT([dlopen])
21 LTDL_INIT([nonrecursive])
22
23 gl_INIT
24
25 AC_CACHE_SAVE
26
27 m4_include([lib/gnulib.mk])
28
29 DX_LIB_GLIB2([], [gobject])
30 AC_DEFINE([GLIB_DISABLE_DEPRECATION_WARNINGS], [1],
31   [Define to shut up glib deprecation silliness.])
32
33 AC_ARG_WITH([modlib],
34         [AS_HELP_STRING([--with-modlib],
35                 [specify which module decoding library to use - one of modplug, none or auto. [default=auto]]
36         )],
37         [with_modlib=$withval],
38         [with_modlib=auto])
39
40 use_modlib=none
41 AS_CASE([$with_modlib],
42   [no|none], [:],
43   [modplug], [DX_LIB_LIBMODPLUG([use_modlib=modplug])],
44   [auto], [DX_LIB_LIBMODPLUG([use_modlib=modplug], [:])],
45   [AC_MSG_ERROR([Invalid argument to --with-modlib: $with_modlib])])
46
47 AC_MSG_CHECKING([which module library to use])
48 AC_MSG_RESULT([$use_modlib])
49
50 AM_CONDITIONAL([USE_LIBMODPLUG], [test x$use_modlib = xmodplug])
51 AM_CONDITIONAL([USE_DUMMYMOD],   [test x$use_modlib = xnone])
52
53 DX_PROG_GOB2([2.0.0], [have_gob2=yes], [have_gob2=no])
54 AM_CONDITIONAL([HAVE_GOB2], [test x"$have_gob2" = x"yes"])
55
56 AS_IF([test x"$have_gob2" != x"yes"], [dx_cv_gob2_dynamic_types=no])
57 AC_CACHE_CHECK([Whether $GOB2 supports dynamic types],
58   [dx_cv_gob2_dynamic_types], [cat >conftest.gob <<'EOF'
59 class :Conftest from G:Object (dynamic)
60 {
61   public void test(void)
62   {
63   }
64 }
65 EOF
66 dx_cv_gob2_dynamic_types=no
67 AS_IF([$GOB2 conftest.gob >/dev/null 2>&1],
68 [mv conftest.c conftest.inc
69 save_CFLAGS=$CFLAGS save_LIBS=$LIBS
70 CFLAGS="$GLIB_CFLAGS $CFLAGS"
71 LIBS="$LIBS $GLIB_LIBS"
72 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#]include "conftest.inc"],
73 [conftest_register_type(0);])], [dx_cv_gob2_dynamic_types=yes])
74 CFLAGS=$save_CFLAGS LIBS=$save_LIBS])
75 ])
76 AM_CONDITIONAL([HAVE_GOB2_DYN], [test x"$dx_cv_gob2_dynamic_types" = x"yes"])
77
78 AC_CONFIG_FILES([Makefile libuobject.pc])
79 AC_OUTPUT