robert d267cd02ca Unbreak autoconf checks with clang by not using nested functions
in the checks.

Someone clearly did not read the autoconf documentation because
using the following functions with a function declaration inside
the body will end up declaring a function inside a function.

- AC_TRY_COMPILE( [], [ int main() { return 0; } ],
- AC_LANG_PROGRAM([[]], [[int main (void) { return 0; }]])],
- AC_TRY_LINK([], [int main (void) { return 0; }],

Result:

int
main ()
{
int main (void) { return 0; }
  ;
  return 0;
}

nested functions is a gcc extension which is not supported by
clang.

test.c:4:17: error: function definition is not allowed here
int main (void) { return 0; }
                ^
1 error generated.

This causes tests to fail in the configure scripts resulting in
missing compile and link time flags from the builds.

This resulted in weird behaviour of several software, like gnome
hanging completely due to gtk+3 not being built properly.

This change intrudces the following fixes:

- remove int main() declaration from AC_TRY_COMPILE, AC_LANG_PROGRAM, AC_TRY_LINK
  as it comes with a declaration already, and people misused them

- change to use AC_LANG_SOURCE when needed in case a complete source block is specified

Most of the changes are in configure.(ac|in), however there were some cases
where autoconf is either broken or the build failed because of an autoconf
generated configure script. Everytihng else is switched to autoconf, so
the maintainers can go ahead and upstream these diffs.

There are more to come, we are continously checking the tree for these issues
and in the future the infrastructure will error if such a case is found.
2017-09-25 09:16:12 +00:00

61 lines
1.5 KiB
Makefile

# $OpenBSD: Makefile,v 1.11 2017/09/25 09:16:13 robert Exp $
COMMENT-main = library for registering keyboard shortcuts
COMMENT-python = python bindings for keybinder
DISTNAME = keybinder-0.3.0
PKGNAME-main = ${DISTNAME}
PKGNAME-python = py-${DISTNAME}
REVISION = 6
CATEGORIES = x11 devel
SHARED_LIBS = keybinder 0.0 # 0.0
HOMEPAGE = https://github.com/engla/keybinder
# GPLv2+
PERMIT_PACKAGE_CDROM = Yes
MASTER_SITES = http://mirrors.nycbug.org/pub/distfiles/
MULTI_PACKAGES = -main -python
WANTLIB += X11 Xcomposite Xcursor Xdamage Xext Xfixes Xi Xinerama
WANTLIB += Xrandr Xrender atk-1.0 cairo expat ffi fontconfig freetype
WANTLIB += gdk-x11-2.0 gdk_pixbuf-2.0 gio-2.0 glib-2.0 gmodule-2.0
WANTLIB += gobject-2.0 graphite2 gthread-2.0 gtk-x11-2.0 harfbuzz
WANTLIB += iconv intl m pango-1.0 pangocairo-1.0 pangoft2-1.0
WANTLIB += pcre pixman-1 png pthread pthread-stubs xcb xcb-render
WANTLIB += xcb-shm z
WANTLIB-python = ${WANTLIB} keybinder
MODULES = lang/python \
x11/gnome
MODGNOME_TOOLS = gobject-introspection
BUILD_DEPENDS = x11/py-gtk2
LIB_DEPENDS-main = x11/gtk+2
LIB_DEPENDS-python = ${BUILD_PKGPATH},-main
RUN_DEPENDS-python = ${MODPY_RUN_DEPENDS} \
x11/py-gtk2
MODPY_RUNDEP = No
CONFIGURE_STYLE = gnu
CONFIGURE_ARGS = --disable-lua \
--disable-static
USE_GMAKE = Yes
LIBTOOL_FLAGS = --tag=disable-static
post-install:
rm ${PREFIX}/lib/libkeybinder.la
rm ${WRKINST}${MODPY_SITEPKG}/keybinder/_keybinder.la
.include <bsd.port.mk>