This repository has been archived by the owner on Dec 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
69 lines (57 loc) · 1.64 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
AC_INIT(ObjGameKit, 0.1, [email protected])
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!)
])
test x"$OBJC" = x"" && OBJC="$($OBJFW_CONFIG --objc)"
AC_LANG([Objective C])
AC_PROG_OBJC
AC_PROG_OBJCPP
AC_PROG_LN_S
AC_PROG_INSTALL
CPP="$OBJCPP"
CPPFLAGS="$CPPFLAGS $OBJCPPFLAGS $($OBJFW_CONFIG --cppflags)"
OBJCFLAGS="$OBJCFLAGS -Wall $($OBJFW_CONFIG --objcflags)"
LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --ldflags)"
LIBS="$LIBS $($OBJFW_CONFIG --libs)"
OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --arc)"
AC_MSG_CHECKING([whether Objective C compiler supports ARC])
AC_TRY_COMPILE([
#if !__has_feature(objc_arc)
# error No ARC
#endif
@interface Test
@end
], [
__unsafe_unretained Test *t;
], [
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
AC_MSG_ERROR(You need an Objective C compiler with ARC support!)
])
PKG_CHECK_MODULES(allegro5, [allegro-5.0 allegro_main-5.0 allegro_image-5.0], [
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
BUILDSYS_INIT
BUILDSYS_TOUCH_DEPS
dnl We don't call AC_PROG_CPP, but only AC_PROG_OBJCPP and set CPP to OBJCPP
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 extra.mk])
AC_OUTPUT