90e5ce7 by Bjørn Lindeijer at 2005-03-20 1
AC_PREREQ(2.59)
1ce650f by Bjørn Lindeijer at 2009-06-09 2
AC_INIT([The Mana World], [0.0.29.1], [themanaworld-devel@lists.sourceforge.net], [tmw])
3
AM_INIT_AUTOMAKE([1.9])
546f5b9 by Bjørn Lindeijer at 2005-03-01 4
AC_CONFIG_HEADERS([config.h:config.h.in])
528ded2 by Bjørn Lindeijer at 2005-02-10 5
AC_LANG_CPLUSPLUS
7586735 by Alexander Baldeck at 2004-12-16 6
528ded2 by Bjørn Lindeijer at 2005-02-10 7
# Checks for programs.
8
AC_PROG_CXX
9
AC_PROG_INSTALL
7586735 by Alexander Baldeck at 2004-12-16 10
d338582 by Bjørn Lindeijer at 2006-08-13 11
# Checks for typedefs, structures, and compiler characteristics.
12
AC_HEADER_TIME
13
14
# Checks for library functions.
15
AC_FUNC_ERROR_AT_LINE
16
AC_FUNC_MALLOC
17
AC_FUNC_REALLOC
18
AC_FUNC_SELECT_ARGTYPES
19
AC_FUNC_VPRINTF
20
AC_CHECK_FUNCS([atexit floor getcwd gethostbyname memset mkdir select socket])
21
bfd1d1b by Bjørn Lindeijer at 2009-01-06 22
# Checks for internationalization support
23
AM_GNU_GETTEXT([external])
24
AM_GNU_GETTEXT_VERSION([0.16.1])
25
ce0d7b6 by Guillaume Melquiond at 2009-01-05 26
# Search for *-config
27
AC_PATH_PROG(SDL_CONFIG, sdl-config)
28
AC_PATH_PROG(PKG_CONFIG, pkg-config)
29
AC_PATH_PROG(CURL_CONFIG, curl-config)
30
528ded2 by Bjørn Lindeijer at 2005-02-10 31
# Checks for libraries
4df1759 by Bjørn Lindeijer at 2005-10-02 32
AC_CHECK_LIB([pthread], [pthread_create], ,
86441fd by Bjørn Lindeijer at 2007-10-18 33
AC_MSG_ERROR([ *** Unable to find pthread library]))
4df1759 by Bjørn Lindeijer at 2005-10-02 34
90e5ce7 by Bjørn Lindeijer at 2005-03-20 35
AC_CHECK_LIB([guichan], [gcnGuichanVersion], ,
ce0d7b6 by Guillaume Melquiond at 2009-01-05 36
AC_MSG_ERROR([ *** Unable to find Guichan library (http://guichan.sf.net/)]))
37
AC_CHECK_HEADERS([guichan.hpp], ,
38
AC_MSG_ERROR([ *** Guichan library found but cannot find headers (http://guichan.sf.net/)]))
dc453f0 by Bjørn Lindeijer at 2005-02-13 39
ce0d7b6 by Guillaume Melquiond at 2009-01-05 40
if test -n "$SDL_CONFIG"; then
41
    LIBS="$LIBS `$SDL_CONFIG --libs`"
42
    CPPFLAGS="$CPPFLAGS `$SDL_CONFIG --cflags`"
43
fi
44
AC_CHECK_LIB([SDL], [SDL_Init], ,
45
AC_MSG_ERROR([ *** Unable to find SDL library (http://www.libsdl.org/)]))
46
AC_CHECK_HEADERS([SDL.h], ,
47
AC_MSG_ERROR([ *** SDL library found but cannot find headers (http://www.libsdl.org/)]))
43e20b9 by Bjørn Lindeijer at 2005-03-21 48
b89f24f by Bjørn Lindeijer at 2006-10-23 49
AC_CHECK_LIB([z], [inflate], ,
50
AC_MSG_ERROR([ *** Unable to find zlib (http://www.gzip.org/zlib/)]))
51
a4cf076 by Bjørn Lindeijer at 2005-03-05 52
AC_CHECK_LIB([physfs], [PHYSFS_init], ,
ce0d7b6 by Guillaume Melquiond at 2009-01-05 53
AC_MSG_ERROR([ *** Unable to find PhysFS library (http://icculus.org/physfs/)]))
54
AC_CHECK_HEADERS([physfs.h], ,
55
AC_MSG_ERROR([ *** PhysFS library found but cannot find headers (http://icculus.org/physfs/)]))
a4cf076 by Bjørn Lindeijer at 2005-03-05 56
ce0d7b6 by Guillaume Melquiond at 2009-01-05 57
if test -n "$CURL_CONFIG"; then
58
    LIBS="$LIBS `$CURL_CONFIG --libs`"
59
    CPPFLAGS="$CPPFLAGS `$CURL_CONFIG --cflags`"
60
fi
e7d0e1f by Aaron Marks at 2005-07-08 61
AC_CHECK_LIB([curl], [curl_global_init], ,
62
AC_MSG_ERROR([ *** Unable to find CURL library (http://curl.haxx.se/)]))
ce0d7b6 by Guillaume Melquiond at 2009-01-05 63
AC_CHECK_HEADERS([curl/curl.h], ,
64
AC_MSG_ERROR([ *** CURL library found but cannot find headers (http://curl.haxx.se/)]))
e7d0e1f by Aaron Marks at 2005-07-08 65
ce0d7b6 by Guillaume Melquiond at 2009-01-05 66
if test -n "$PKG_CONFIG"; then
67
    LIBS="$LIBS `$PKG_CONFIG --libs libxml-2.0`"
68
    CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags libxml-2.0`"
69
fi
a4cf076 by Bjørn Lindeijer at 2005-03-05 70
AC_CHECK_LIB([xml2], [xmlInitParser], ,
ce0d7b6 by Guillaume Melquiond at 2009-01-05 71
AC_MSG_ERROR([ *** Unable to find libxml2 library (http://xmlsoft.org/)]))
72
AC_CHECK_HEADERS([libxml/xmlreader.h], ,
73
AC_MSG_ERROR([ *** libxml2 library found but cannot find headers (http://xmlsoft.org/)]))
a4cf076 by Bjørn Lindeijer at 2005-03-05 74
e8c3de1 by Bjørn Lindeijer at 2006-08-20 75
AC_CHECK_LIB(png, png_write_info, ,
76
AC_MSG_ERROR([ *** Unable to find png library]))
77
e4e314d by Bjørn Lindeijer at 2005-05-16 78
AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, ,
3638ed8 by Bjørn Lindeijer at 2005-02-12 79
AC_MSG_ERROR([ *** Unable to find SDL_image library with PNG support
80
(http://www.libsdl.org/projects/SDL_image/)]))
dc453f0 by Bjørn Lindeijer at 2005-02-13 81
7cc4dfe by Eugenio Favalli at 2008-12-29 82
AC_CHECK_LIB(SDL_ttf, TTF_Quit, ,
83
AC_MSG_ERROR([ *** Unable to find SDL_ttf library (http://www.libsdl.org/projects/SDL_ttf/)]))
84
86441fd by Bjørn Lindeijer at 2007-10-18 85
AC_CHECK_LIB([SDL_mixer], [Mix_OpenAudio], ,
86
AC_MSG_ERROR([ *** Unable to find SDL_mixer library (http://www.libsdl.org/projects/SDL_mixer/)]))
3638ed8 by Bjørn Lindeijer at 2005-02-12 87
ce0d7b6 by Guillaume Melquiond at 2009-01-05 88
AC_CHECK_LIB([guichan_sdl], [gcnSDL], ,
89
AC_MSG_ERROR([ *** Unable to find Guichan SDL library (http://guichan.sf.net/)]))
90
528ded2 by Bjørn Lindeijer at 2005-02-10 91
# Checks for header files.
92
AC_HEADER_STDC
93
AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h])
94
e4e314d by Bjørn Lindeijer at 2005-05-16 95
# Option to enable OpenGL
a064b26 by Bjørn Lindeijer at 2007-02-26 96
AC_ARG_WITH(opengl,[  --without-opengl        don't use OpenGL ] )
97
if test "x$with_opengl" == "xno"; then
98
    with_opengl=no
99
else
da9cb51 by Mateusz Kaduk at 2005-05-16 100
    with_opengl=yes
86441fd by Bjørn Lindeijer at 2007-10-18 101
    AC_CHECK_LIB([GL], [glBegin], ,
102
    AC_MSG_ERROR([ *** Unable to find OpenGL library]))
103
    AC_DEFINE(USE_OPENGL, 1, [Defines if tmw should use an OpenGL display])
da9cb51 by Mateusz Kaduk at 2005-05-16 104
fi
7586735 by Alexander Baldeck at 2004-12-16 105
a7f5eae by Bjørn Lindeijer at 2009-02-18 106
# Enable either tmwserv or eAthena
107
AC_ARG_WITH(
108
    [server],
109
    AS_HELP_STRING(
110
        [--with-server=ARG],
111
        [which server to use [[ARG=tmwserv,eathena]]
112
        [(default=eathena)]]
113
    ),
114
    [if test "$withval" = "yes"; then
115
        # default is eathena
116
        with_server="eathena"
117
     elif test "$withval" = "no"; then
118
        AC_MSG_ERROR([$PACKAGE_NAME cannot run without a server.])
119
     else
120
         with_server="$withval"
121
     fi],
122
    [with_server="eathena"]
123
)
124
125
if test "$with_server" = "tmwserv"; then
126
    AC_CHECK_LIB([enet], [enet_initialize], ,
127
    AC_MSG_ERROR([ *** Unable to find enet library (http://enet.bespin.org/)]))
128
    AC_DEFINE(TMWSERV_SUPPORT, 1, [Defines if tmwserv support is enabled])
129
elif test "$with_server" = "eathena"; then
130
    AC_CHECK_LIB(SDL_net, SDLNet_Init, ,
131
    AC_MSG_ERROR([ *** Unable to find SDL_net library]))
132
    AC_DEFINE(EATHENA_SUPPORT, 1, [Defines if eAthena support is enabled])
133
else
134
    AC_MSG_ERROR([unknown server: $with_server])
135
fi
136
137
AM_CONDITIONAL(SERVER_TMWSERV, test "$with_server" = "tmwserv")
138
AM_CONDITIONAL(SERVER_EATHENA, test "$with_server" = "eathena")
139
f61fc8e by Rodney Dawes at 2005-05-01 140
AC_CONFIG_FILES([
141
Makefile
142
src/Makefile
143
data/Makefile
5cffb54 by Bjørn Lindeijer at 2009-01-04 144
data/fonts/Makefile
f61fc8e by Rodney Dawes at 2005-05-01 145
data/graphics/Makefile
146
data/graphics/gui/Makefile
147
data/graphics/images/Makefile
670c944 by José Ávila at 2005-06-02 148
data/help/Makefile
f61fc8e by Rodney Dawes at 2005-05-01 149
data/icons/Makefile
150
docs/Makefile
bfd1d1b by Bjørn Lindeijer at 2009-01-06 151
po/Makefile.in
f61fc8e by Rodney Dawes at 2005-05-01 152
])
153
528ded2 by Bjørn Lindeijer at 2005-02-10 154
AC_OUTPUT
da9cb51 by Mateusz Kaduk at 2005-05-16 155
156
echo
a7f5eae by Bjørn Lindeijer at 2009-02-18 157
echo "Build with OpenGL: $with_opengl"
158
echo "Supported server:  $with_server"
da9cb51 by Mateusz Kaduk at 2005-05-16 159
echo
a7f5eae by Bjørn Lindeijer at 2009-02-18 160
echo "configure complete, now type \"make\""
da9cb51 by Mateusz Kaduk at 2005-05-16 161
echo