]> git.draconx.ca Git - upkg.git/blob - configure.ac
Sync gnulib and dxcommon to latest versions.
[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
31 AC_ARG_WITH([modlib],
32         [AS_HELP_STRING([--with-modlib],
33                 [specify which module decoding library to use - one of modplug, none or auto. [default=auto]]
34         )],
35         [with_modlib=$withval],
36         [with_modlib=auto])
37
38 use_modlib=none
39 AS_CASE([$with_modlib],
40   [no|none], [:],
41   [modplug], [DX_LIB_LIBMODPLUG([use_modlib=modplug])],
42   [auto], [DX_LIB_LIBMODPLUG([use_modlib=modplug], [:])],
43   [AC_MSG_ERROR([Invalid argument to --with-modlib: $with_modlib])])
44
45 AC_MSG_CHECKING([which module library to use])
46 AC_MSG_RESULT([$use_modlib])
47
48 AM_CONDITIONAL([USE_LIBMODPLUG], [test x$use_modlib = xmodplug])
49 AM_CONDITIONAL([USE_DUMMYMOD],   [test x$use_modlib = xnone])
50
51 DX_PROG_GOB2([2.0.0], [have_gob2=yes], [have_gob2=no])
52 AM_CONDITIONAL([HAVE_GOB2], [test x"$have_gob2" = x"yes"])
53
54 AS_IF([test x"$have_gob2" != x"yes"], [dx_cv_gob2_dynamic_types=no])
55 AC_CACHE_CHECK([Whether $GOB2 supports dynamic types],
56   [dx_cv_gob2_dynamic_types], [cat >conftest.gob <<'EOF'
57 class :Conftest from G:Object (dynamic)
58 {
59   public void test(void)
60   {
61   }
62 }
63 EOF
64 dx_cv_gob2_dynamic_types=no
65 AS_IF([$GOB2 conftest.gob >/dev/null 2>&1],
66 [mv conftest.c conftest.inc
67 save_CFLAGS=$CFLAGS save_LIBS=$LIBS
68 CFLAGS="$GLIB_CFLAGS $CFLAGS"
69 LIBS="$LIBS $GLIB_LIBS"
70 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#]include "conftest.inc"],
71 [conftest_register_type(0);])], [dx_cv_gob2_dynamic_types=yes])
72 CFLAGS=$save_CFLAGS LIBS=$save_LIBS])
73 ])
74 AM_CONDITIONAL([HAVE_GOB2_DYN], [test x"$dx_cv_gob2_dynamic_types" = x"yes"])
75
76 AC_CONFIG_FILES([Makefile libuobject.pc])
77 AC_OUTPUT