-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
90 lines (69 loc) · 3.28 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
AC_INIT(dunelegacy, 0.97.0, http://dunelegacy.sourceforge.net)
AC_CANONICAL_BUILD
AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CXX
if test "$prefix" = "" ; then
dunelegacydatadir='data'
else
dunelegacydatadir='${pkgdatadir}'
fi
AC_SUBST(dunelegacydatadir)
dnl Some flags for gcc
CXXFLAGS="-std=c++14 -pthread -fPIC -O3 -pipe -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-shift-negative-value -Wno-unknown-pragmas -D__STDC_FORMAT_MACROS -DNDEBUG"
CFLAGS="-std=c99 -pthread -fPIC -O3 -pipe -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-shift-negative-value -Wno-unknown-pragmas -D__STDC_FORMAT_MACROS -DNDEBUG"
dnl Additional flags: -Wconversion -Wno-sign-conversion -Wlogical-op
dnl Some flags for clang
dnl CXXFLAGS="-std=c++14 -O3 -pipe -pedantic -Weverything -Wno-sign-conversion -Wno-conversion -Wno-shadow -Wno-missing-noreturn -Wno-padded -Wno-packed -Wno-weak-vtables -Wno-c++11-narrowing -Wno-cast-align -Wno-unreachable-code -Wno-missing-prototypes -Wno-float-equal -Wno-global-constructors -Wno-exit-time-destructors -Wno-format-nonliteral -Wno-unused-macros -Wreserved-id-macro -Wextra -Wno-unused-parameter -Wno-narrowing -Wno-unknown-pragmas"
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[compile with debug information @<:@default=disabled@:>@])],
[],
[])
if test "$enable_debug" = "yes" ; then
CXXFLAGS="$CXXFLAGS -g"
fi
dnl Check for SDL library
dnl Check for SDL_mixer library.
SDL_VERSION=2.0.0
AM_PATH_SDL2($SDL_VERSION, : , AC_MSG_ERROR([*** SDL2 version $SDL_VERSION not found!]))
dnl PKG_CHECK_MODULES(SDL, sdl2 SDL2_mixer)
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
dnl Check for SDL_mixer library.
AC_CHECK_LIB(SDL2_mixer,
Mix_OpenAudio,
LIBS="$LIBS -lSDL2_mixer",
AC_MSG_ERROR([*** SDL2_mixer library not found!])
)
dnl Check for SDL2_ttf library.
AC_CHECK_LIB(SDL2_ttf,
TTF_Init,
LIBS="$LIBS -lSDL2_ttf",
AC_MSG_ERROR([*** SDL2_ttf library not found!])
)
dnl enet defines
AC_CHECK_FUNC(gethostbyaddr_r, [AC_DEFINE(HAS_GETHOSTBYADDR_R)])
AC_CHECK_FUNC(gethostbyname_r, [AC_DEFINE(HAS_GETHOSTBYNAME_R)])
AC_CHECK_FUNC(poll, [AC_DEFINE(HAS_POLL)])
AC_CHECK_FUNC(fcntl, [AC_DEFINE(HAS_FCNTL)])
AC_CHECK_FUNC(inet_pton, [AC_DEFINE(HAS_INET_PTON)])
AC_CHECK_FUNC(inet_ntop, [AC_DEFINE(HAS_INET_NTOP)])
AC_CHECK_MEMBER(struct msghdr.msg_flags, [AC_DEFINE(HAS_MSGHDR_FLAGS)], , [#include <sys/socket.h>])
AC_CHECK_TYPE(socklen_t, [AC_DEFINE(HAS_SOCKLEN_T)], ,
#include <sys/types.h>
#include <sys/socket.h>
)
AC_EGREP_HEADER(MSG_MAXIOVLEN, /usr/include/sys/socket.h, AC_DEFINE(ENET_BUFFER_MAXIMUM, [MSG_MAXIOVLEN]))
AC_EGREP_HEADER(MSG_MAXIOVLEN, socket.h, AC_DEFINE(ENET_BUFFER_MAXIMUM, [MSG_MAXIOVLEN]))
if test "${host}" = "i686-w64-mingw32" ; then
LIBS="$LIBS -lws2_32 -lwinmm -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic resource.o"
dunelegacydatadir='.'
elif test "${host}" = "x86_64-w64-mingw32" ; then
LIBS="$LIBS -lws2_32 -lwinmm -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic resource.o"
dunelegacydatadir='.'
fi
AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile)
AC_OUTPUT