Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 298 lines (258 sloc) 9.249 kB
39cdbfd @arrai [7017] Updated copyright notice for new year
arrai authored
1 # Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
1ccdd8e @danielsreichenbach Imported MaNGOS revision 6767 from http://mangos.svn.sourceforge.net/…
danielsreichenbach authored
2 #
3 # This file is free software; as a special exception the author gives
4 # unlimited permission to copy and/or distribute it, with or without
5 # modifications, as long as this notice is preserved.
6 #
7 # This program is distributed in the hope that it will be useful, but
8 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
9 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
11 ## Process this file with autoconf to produce a configure script.
12
13 # TODO: create m4 directory and put the checks there, because this file got realy poluted ( by Derex )
14
15 ## Prelude, basic settings for Autoconf
16 # PACKAGE: mangos
1f03299 [7987] Bump for 0.14.0 development.
VladimirMangos authored
17 # VERSION: 0.14.0 (trunk)
1ccdd8e @danielsreichenbach Imported MaNGOS revision 6767 from http://mangos.svn.sourceforge.net/…
danielsreichenbach authored
18 # BUG-REPORT-ADDRESS: mangos-devs@lists.sourceforge.net
1f03299 [7987] Bump for 0.14.0 development.
VladimirMangos authored
19 AC_INIT( [mangos], [0.14.0], [mangos-devs@lists.sourceforge.net])
1ccdd8e @danielsreichenbach Imported MaNGOS revision 6767 from http://mangos.svn.sourceforge.net/…
danielsreichenbach authored
20 AC_CONFIG_SRCDIR([src/shared/Base.cpp])
21
22 ## Prelude, basic settings for Automake
23 # Turn on all warnings and error messages, and enforce GNU
24 # standards for the package.
25 AM_INIT_AUTOMAKE([-Wall -Werror gnu tar-pax])
26 AM_MAINTAINER_MODE
27
28 ## Prevent the configure script from continuing any further if
29 # configuration is being performed in the top-level directory.
b029952 @comps Removed trailing whitespaces and CRLFs
comps authored
30 # The idea is to prevent this ,because some maintainers tend
1ccdd8e @danielsreichenbach Imported MaNGOS revision 6767 from http://mangos.svn.sourceforge.net/…
danielsreichenbach authored
31 # to break parallel build trees (a.k.a. VPATH builds).
32 if test "$srcdir" = "." && test "$enable_maintainer_mode" != "yes"; then
33 AC_MSG_ERROR(
34 [
35 Please configure and build in a directory other than the
36 top-level source directory. This is needed because a lot
b029952 @comps Removed trailing whitespaces and CRLFs
comps authored
37 of maintainers tend to break parallel build trees
38 (a.k.a. VPATH builds). This is kinda real ensurance they
1ccdd8e @danielsreichenbach Imported MaNGOS revision 6767 from http://mangos.svn.sourceforge.net/…
danielsreichenbach authored
39 will not do it (by enforcing everybody to do VPATH builds).
40
41 For example, try the following from the top-level source
42 directory:
43
44 mkdir objdir
45 cd objdir
46 ../configure
47 make
48
49 This will create a build space in the directory `objdir' and
50 start a build in that directory.
51
52 If however you realy want to disable this error,
53 use --enable-maintainer-mode switch.
54 ])
55 fi
56
57 ## Disable building of static libraries by default
58 AC_DISABLE_STATIC
59
60 ## Check for required dependencies.
61
62 ## Check for a valid build environment.
63 # Valid equals having:
64 # - a C++ compiler compliant with the ISO98 C++ specification.
65 # - a working library tool for creating convenience libraries.
66 # - a working linker for creating static and shared libraries.
67 AC_PROG_CC
68 AC_PROG_CXX
69 AM_PROG_CC_C_O
70 AC_PROG_LIBTOOL
71 AC_PROG_INSTALL
72
73 # Check for doxygen
74 AC_ARG_ENABLE(doxygen, AC_HELP_STRING([--enable-doxygen], [turn on generating documentation]))
75
76 enable_doxygen_support=no
77
78 if test "x$enable_doxygen" = "xyes";
79 then
80 AC_PATH_PROG(DOXYGEN, doxygen, no)
81 if test "x$DOXYGEN" = "xno"; then
82 AC_MSG_ERROR([You need to install the doxygen package])
83 fi
84 enable_doxygen_support=yes
85 fi
86 AM_CONDITIONAL(DOXYGEN_ENABLED, test x$enable_doxygen_support = xyes)
87
88 ## Check for required libraries.
b029952 @comps Removed trailing whitespaces and CRLFs
comps authored
89 AC_CHECK_LIB( pthread, pthread_create, [],
1ccdd8e @danielsreichenbach Imported MaNGOS revision 6767 from http://mangos.svn.sourceforge.net/…
danielsreichenbach authored
90 [LDFLAGS="-pthread $LDFLAGS"
91 AC_TRY_LINK([char pthread_create();],
92 pthread_create();,
93 [], [AC_MSG_ERROR([Missing pthread])])
94 ])
95 AC_CHECK_LIB( z, compress, [ZLIB=-lz],[AC_MSG_ERROR([Missing zlib])] )
96 AC_CHECK_LIB( compat, ftime, [COMPATLIB=-lcompat] )
97 AC_CHECK_LIB( crypto, SHA1_Init, [SSLLIB=-lssl], [AC_MSG_ERROR([Missing openssl])])
98
99 AC_ARG_WITH(postgresql,
100 [ --with-postgresql Use PostgreSQL as a backend (default: no)],
101 [case "${withval}" in
102 yes) DO_POSTGRESQL=yes ;;
103 no) DO_POSTGRESQL=no ;;
104 maybe) DO_POSTGRESQL=maybe ;;
105 *) AC_MSG_ERROR(Bad value ${withval} for --with-postgresql) ;;
106 esac],
107 [DO_POSTGRESQL=no])
b029952 @comps Removed trailing whitespaces and CRLFs
comps authored
108
1ccdd8e @danielsreichenbach Imported MaNGOS revision 6767 from http://mangos.svn.sourceforge.net/…
danielsreichenbach authored
109 AC_ARG_WITH(mysql,
110 [ --with-mysql Use MySQL as a backend (default: yes)],
111 [case "${withval}" in
112 yes) DO_MYSQL=yes ;;
113 no) DO_MYSQL=no ;;
114 maybe) DO_MYSQL=maybe ;;
115 *) AC_MSG_ERROR(Bad value ${withval} for --with-mysql) ;;
116 esac],
117 [DO_MYSQL=yes])
118
119 # here Postgre
120 AC_MSG_CHECKING(whether to build/link POSTGRESQL)
121 if test "x$DO_POSTGRESQL" = "xyes"; then
122 DO_MYSQL=no
123 POSTGRE_INCLUDES="-I/usr/include/postgresql $POSTGRE_INCLUDES"
124 POSTGRE_LIBS="-L/usr/lib/postresql -lpq -lz -lpthread -lcrypt -lnsl -lm -lpthread -L/usr/lib -lssl -lcrypto $POSTGRE_LIBS "
125 CXXFLAGS="-DDO_POSTGRESQL $CXXFLAGS"
126 fi
127 AC_MSG_RESULT($DO_POSTGRESQL)
b029952 @comps Removed trailing whitespaces and CRLFs
comps authored
128
1ccdd8e @danielsreichenbach Imported MaNGOS revision 6767 from http://mangos.svn.sourceforge.net/…
danielsreichenbach authored
129 # here mysql
130 AC_MSG_CHECKING(whether to build/link MYSQL)
131 if test "x$DO_MYSQL" = "xyes"; then
132 AC_MSG_RESULT($DO_MYSQL)
133 AC_PATH_PROGS(MYSQL_CONFIG, mysql_config, mysql_config, $PATH)
134 if test -x "$MYSQL_CONFIG"
135 then
136 # MySQL v4 uses --include while v3 uses --cflags
137 MYSQL_INCLUDES="`$MYSQL_CONFIG --include`" || \
138 MYSQL_INCLUDES="`$MYSQL_CONFIG --cflags`"
139 MYSQL_LIBS="`$MYSQL_CONFIG --libs_r`"
140 CXXFLAGS="-DDO_MYSQL $CXXFLAGS"
141 fi
142 else
143 AC_MSG_RESULT($DO_MYSQL)
144 fi
145
146 ## Check for options
147 # Include debug info in library?
148 AC_MSG_CHECKING(whether to include debug info in library)
149 MANGOSD_DEBUG_INFO=no
150 AC_ARG_WITH(debug-info,
151 [
152 Debugging options:
153
154 --with-debug-info Include debug info in library],
155 [
156 if test "$withval" = "yes" ; then
157 CFLAGS="-g -DMANGOS_DEBUG $CFLAGS"
158 CXXFLAGS="-g -DMANGOS_DEBUG $CXXFLAGS"
159 MANGOSD_DEBUG_INFO=yes
160 elif test "$withval" != "no" ; then
161 AC_MSG_ERROR(Please choose yes or no)
162 fi
163 ])
164 AC_MSG_RESULT($MANGOSD_DEBUG_INFO)
165
166 ## Check for required header files.
167 AC_HEADER_STDC
168 AC_HEADER_DIRENT
169 AC_CHECK_HEADERS([ arpa/inet.h fcntl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h sys/timeb.h sys/time.h termios.h unistd.h ])
170
171 AC_CHECK_HEADERS([pthread.h])
172 AC_CHECK_HEADERS([openssl/md5.h openssl/rand.h openssl/ssl.h openssl/sha.h openssl/bn.h])
173 AC_CHECK_HEADERS([mysql.h mysql/mysql.h])
174 AC_CHECK_HEADERS([libpq-fe.h])
175 AC_CHECK_HEADERS([zlib.h])
176
177 ## Check for typedefs, structures, and compiler characteristics.
178 AC_HEADER_STDBOOL
179 AC_C_CONST
180 AC_C_INLINE
181 AC_HEADER_TIME
182 AC_STRUCT_TM
183 AC_C_VOLATILE
184 AC_CHECK_TYPES([ptrdiff_t])
185
186 ## Check for required library functions.
187 AC_FUNC_CLOSEDIR_VOID
188 AC_FUNC_ERROR_AT_LINE
189 AC_FUNC_MALLOC
190 AC_FUNC_MEMCMP
191 AC_FUNC_REALLOC
192 AC_FUNC_SELECT_ARGTYPES
193 AC_TYPE_SIGNAL
194 AC_FUNC_VPRINTF
195 AC_CHECK_FUNCS([atexit ftime gethostbyaddr gethostbyname gethostname gettimeofday memmove memset pow realpath select socket sqrt strchr strdup strerror strstr])
196
197 ## Check what to do with ACE library
198 AC_LANG_PUSH([C++])
199 AC_CHECK_HEADER([ace/Reactor.h], [have_ace_headers=yes], [have_ace_headers=no])
200 AC_CHECK_LIB([ACE], [main], [have_ace_lib=yes], [have_ace_lib=no])
201 AC_LANG_POP([C++])
202
203 AC_MSG_CHECKING([whether to build ACE])
204 if test X$have_ace_headers = Xyes -a X$have_ace_lib = Xyes;
205 then
206 need_to_build_ace=no
207 AC_MSG_RESULT([no])
208 else
209 if test X$have_ace_headers = Xno -a X$have_ace_lib = Xno; then
210 need_to_build_ace=yes
211 AC_MSG_RESULT([yes])
212 else
213 if test X$have_ace_headers = Xyes; then
214 AC_MSG_ERROR([looks like you have ACE headers, but you do not have ACE libs installed])
215 else
216 need_to_build_ace=yes
217 AC_MSG_RESULT([yes, over-install])
218 fi
219 fi
220 fi
221
222 if test X$need_to_build_ace = Xyes; then
223 MANGOS_INCLUDES="-I\$(top_srcdir)/dep/ACE_wrappers -I\$(top_builddir)/dep/ACE_wrappers $MANGOS_INCLUDES"
224 MANGOS_LIBS="\$(top_builddir)/dep/ACE_wrappers/ace/libACE.la $MANGOS_LIBS"
225 else
226 MANGOS_LIBS="-lACE $MANGOS_LIBS"
227 fi
228
229 AM_CONDITIONAL([MANGOS_BUILD_ACE], [test X$need_to_build_ace = Xyes])
230
8fb9be3 [8079] Fixed build errors at use old ACE versions (without ace/Stack_…
VladimirMangos authored
231 # old ace versions not have ace/Stack_Trace.h
232 AC_CHECK_HEADERS([ace/Stack_Trace.h])
1ccdd8e @danielsreichenbach Imported MaNGOS revision 6767 from http://mangos.svn.sourceforge.net/…
danielsreichenbach authored
233
234 ## Unify all additional includes/libs in one variable.
235 # TODO this looks kinda ugly, but when we add m4 folder I will make it look very pritey ( by Derex ).
236 MANGOS_INCLUDES="$POSTGRE_INCLUDES $MYSQL_INCLUDES $MANGOS_INCLUDES"
237 MANGOS_LIBS="$POSTGRE_LIBS $MYSQL_LIBS $ZLIB $COMPATLIB $SSLLIB $MANGOS_LIBS"
238
239 ## Export defined variables
240 AC_SUBST(DOXYGEN)
241 AC_SUBST(MANGOSD_DEBUG_INFO)
242
243 ## Additional CPPFLAGS and LDFLAGS.
244 AC_SUBST(MANGOS_INCLUDES)
245 AC_SUBST(MANGOS_LIBS)
246
247 ## Set output files.
248 AC_CONFIG_HEADERS([config.h])
249 AC_CONFIG_FILES([
250 dep/include/Makefile
251 dep/lib/Makefile
252 dep/src/Makefile
253 dep/src/g3dlite/Makefile
254 dep/src/sockets/Makefile
255 dep/src/zlib/Makefile
256 dep/Makefile
257 doc/Doxyfile
258 doc/Makefile
259 Makefile
260 sql/Makefile
261 sql/tools/Makefile
262 sql/updates/Makefile
263 src/Makefile
264 src/tools/Makefile
3659017 Rename gensvnrevision and related files and references to genrevision…
VladimirMangos authored
265 src/tools/genrevision/Makefile
1ccdd8e @danielsreichenbach Imported MaNGOS revision 6767 from http://mangos.svn.sourceforge.net/…
danielsreichenbach authored
266 src/framework/Makefile
267 src/shared/Makefile
268 src/shared/Auth/Makefile
269 src/shared/Config/Makefile
270 src/shared/Database/Makefile
271 src/shared/vmap/Makefile
272 src/shared/SystemConfig.h
273 src/game/Makefile
274 src/realmd/Makefile
275 src/realmd/realmd.conf.dist
276 src/mangosd/Makefile
277 src/mangosd/mangosd.conf.dist
278 src/bindings/Makefile
279 src/bindings/universal/Makefile
280 ])
281
282 ## Configure ACE, if needed
283 if test X$need_to_build_ace = Xyes; then
284 AC_CONFIG_SUBDIRS([dep/ACE_wrappers])
285 fi
286
287 AC_CONFIG_COMMANDS([default],[
288 echo ""
289 echo "Configuration of MaNGOS $PACKAGE_VERSION is now complete."
290 echo ""
291 ],[PACKAGE_VERSION=$PACKAGE_VERSION])
292
293 ## Disabled Makefiles, until they are ready for a successful make and
294 # make dist run.
295
296 ## Output files.
297 AC_OUTPUT
Something went wrong with that request. Please try again.