X-Git-Url: https://git.draconx.ca/gitweb/upkg.git/blobdiff_plain/af7bd229dca60b22270b928e5f767292be74501c..cdb019ee207a4bf4872203db94184bb507fa6670:/configure.ac diff --git a/configure.ac b/configure.ac index 752343f..85dfd3c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -dnl Copyright © 2009-2012, 2015, 2019 Nick Bowler +dnl Copyright © 2009-2012, 2015, 2019-2020 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. @@ -23,6 +23,8 @@ LTDL_INIT([nonrecursive]) gl_INIT +AC_CACHE_SAVE + m4_include([lib/gnulib.mk]) CHECK_GLIB_2([], [gobject]) @@ -47,10 +49,30 @@ AC_MSG_RESULT([$use_modlib]) AM_CONDITIONAL([USE_LIBMODPLUG], [test x$use_modlib = xmodplug]) AM_CONDITIONAL([USE_DUMMYMOD], [test x$use_modlib = xnone]) -GOB2_CHECK([2.0.0]) +DX_PROG_GOB2([2.0.0], [have_gob2=yes], [have_gob2=no]) +AM_CONDITIONAL([HAVE_GOB2], [test x"$have_gob2" = x"yes"]) -AC_CONFIG_FILES([ - Makefile - libuobject.pc +AS_IF([test x"$have_gob2" != x"yes"], [dx_cv_gob2_dynamic_types=no]) +AC_CACHE_CHECK([Whether $GOB2 supports dynamic types], + [dx_cv_gob2_dynamic_types], [cat >conftest.gob <<'EOF' +class :Conftest from G:Object (dynamic) +{ + public void test(void) + { + } +} +EOF +dx_cv_gob2_dynamic_types=no +AS_IF([$GOB2 conftest.gob >/dev/null 2>&1], +[mv conftest.c conftest.inc +save_CFLAGS=$CFLAGS save_LIBS=$LIBS +CFLAGS="$GLIB_CFLAGS $CFLAGS" +LIBS="$LIBS $GLIB_LIBS" +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#]include "conftest.inc"], +[conftest_register_type(0);])], [dx_cv_gob2_dynamic_types=yes]) +CFLAGS=$save_CFLAGS LIBS=$save_LIBS]) ]) +AM_CONDITIONAL([HAVE_GOB2_DYN], [test x"$dx_cv_gob2_dynamic_types" = x"yes"]) + +AC_CONFIG_FILES([Makefile libuobject.pc]) AC_OUTPUT