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