Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1,7 +1,9 @@ AC_INIT(ObjGameKit, 0.1, js@webkeks.org) AC_CONFIG_SRCDIR(src) + +AC_CANONICAL_HOST AC_CHECK_TOOL(OBJFW_CONFIG, objfw-config) AS_IF([test x"$OBJFW_CONFIG" = x""], [ AC_MSG_ERROR(You need ObjFW and objfw-config installed!) ]) @@ -41,10 +43,16 @@ CPPFLAGS="$CPPFLAGS $allegro5_CFLAGS" LIBS="$LIBS $allegro5_LIBS" ], [ AC_MSG_ERROR(You need allegro{_main,_image}-5.0 installed!) ]) + +case "$host_os" in + darwin*) + AC_SUBST(REEXPORT_ALLEGRO, ["-Wl,-reexport-lallegro_main"]) + ;; +esac # We add -Werror after all tests in case some tests emit warnings OBJCFLAGS="$OBJCFLAGS -Werror" BUILDSYS_SHARED_LIB @@ -55,7 +63,7 @@ dnl and add OBJCPPFLAGS to CPPFLAGS, thus we need to AC_SUBST these ourself. AC_SUBST(CPP) AC_SUBST(CPPFLAGS) AC_SUBST(PACKAGE, ObjGameKit) -AC_CONFIG_FILES(buildsys.mk) +AC_CONFIG_FILES([buildsys.mk extra.mk]) AC_OUTPUT ADDED extra.mk.in Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -0,0 +1,1 @@ +REEXPORT_ALLEGRO = @REEXPORT_ALLEGRO@ Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -9,8 +9,10 @@ INCLUDES = ${SRCS:.m=.h} \ ObjGameKit.h include ../buildsys.mk +include ../extra.mk CPPFLAGS += -DOGK_INTERNAL LD = ${OBJC} +LDFLAGS += ${REEXPORT_ALLEGRO}