dnl Copyright © 2019 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. dnl There is NO WARRANTY, to the extent permitted by law. AT_BANNER([Library tests]) dnl TEST_DUMMY_PKGCONFIG([cflags], [libs]) dnl dnl Create a hack pkg-config script in the current working directory which dnl responds to --cflags and --libs with the provided values. The macro dnl arguments should each be a single shell word, suitable for the right dnl hand side of a shell assignment. m4_define([TEST_DUMMY_PKGCONFIG], [[cat >pkg-config <glib.h <<'EOF' #ifndef G_INLINE_FUNC # define G_INLINE_FUNC extern inline #endif G_INLINE_FUNC void break_things(void) { } EOF TEST_CONFIGURE([PKG_CONFIG=$PWD/pkg-config]) AT_CHECK([grep '#.*G_INLINE_FUNC' config.h], [0], [#define G_INLINE_FUNC static inline ]) AT_CHECK([grep '#.*G_IMPLEMENT_INLINES' config.h], [0], [/* #undef G_IMPLEMENT_INLINES */ ]) cat glib-orig.h - >glib.h <<'EOF' #define G_INLINE_FUNC extern inline #ifdef G_IMPLEMENT_INLINES extern void break_things(void); #else G_INLINE_FUNC void break_things(void) { } #endif EOF TEST_CONFIGURE([PKG_CONFIG=$PWD/pkg-config]) AT_CHECK([grep '#.*G_INLINE_FUNC' config.h], [0], [/* #undef G_INLINE_FUNC */ ]) AT_CHECK([grep '#.*G_IMPLEMENT_INLINES' config.h], [0], [#define G_IMPLEMENT_INLINES 1 ]) AT_CLEANUP