root/trunk/configure.ac @ 6

Revision 6, 8.2 kB (checked in by yumileroy, 17 years ago)

[svn] * Added ACE for Linux and Windows (Thanks Derex for Linux part and partial Windows part)
* Updated to 6721 and 676
* Fixed TrinityScript? logo
* Version updated to 0.2.6721.676

Original author: Neo2003
Date: 2008-10-04 06:17:19-05:00

Line 
1# Copyright (C) 2005-2008 MaNGOS project <http://www.mangosproject.org/>
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## Prelude, basic settings for Autoconf
14AC_INIT( [trinitycore], [0.0.1], [devs@trinitycore.org])
15
16AC_CONFIG_SRCDIR([src/shared/Base.cpp])
17
18## Prelude, basic settings for Automake
19#  Turn on all warnings and error messages, and enforce GNU
20#  standards for the package.
21AM_INIT_AUTOMAKE([-Wall -Werror])
22AM_MAINTAINER_MODE
23
24## Prevent the configure script from continuing any further if
25# configuration is being performed in the top-level directory.
26# The idea is to prevent this ,because some maintainers tend
27# to break "off src dir" builds.
28if test "$srcdir" = "." && test "$enable_maintainer_mode" != "yes"; then
29  AC_MSG_ERROR(
30     [
31      Please configure and build in a directory other than the
32      top-level source directory. This is needed because a lot
33      of maintainers tend to break "off src dir" builds. This
34      is kinda real ensurance they wont do it.
35
36      For example, try the following from the top-level source
37      directory:
38
39          mkdir objdir
40          cd objdir
41          ../configure
42          make
43
44      This will create a build space in the directory `objdir' and
45      start a build in that directory.
46
47      If however you realy want to build in src dir,
48      then use --enable-maintainer-mode switch.
49     ])
50fi
51
52## Disable building of static libraries by default
53AC_DISABLE_STATIC
54
55## Check for required dependencies.
56
57## Check for a valid build environment.
58#  Valid equals having:
59#  - a C++ compiler compliant with the ISO98 C++ specification.
60#  - a working library tool for creating convenience libraries.
61#  - a working linker for creating static and shared libraries.
62AC_PROG_CC
63AC_PROG_CXX
64AC_PROG_LIBTOOL
65AC_PROG_INSTALL
66AM_PROG_CC_C_O
67
68# Check if enable scripts
69AC_ARG_ENABLE([scripts], AC_HELP_STRING([--enable-scripts], [Enable TrinityScripts (default: yes) ]), [], [enable_scripts=yes])
70
71AM_CONDITIONAL([USE_TSCRIPTS], [test X$enable_scripts = Xyes])
72
73# Check for doxygen
74AC_ARG_ENABLE(doxygen, AC_HELP_STRING([--enable-doxygen], [turn on generating documentation]))
75
76enable_doxygen_support=no
77
78if test "x$enable_doxygen" = "xyes";
79then
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
85fi
86AM_CONDITIONAL(DOXYGEN_ENABLED, test x$enable_doxygen_support = xyes)
87
88## Check for required libraries.
89AC_CHECK_LIB( pthread, pthread_create, [],
90    [LDFLAGS="-pthread $LDFLAGS"
91     AC_TRY_LINK([char pthread_create();],
92         pthread_create();,
93         [], [AC_MSG_ERROR([Missing pthread])])
94    ])
95AC_CHECK_LIB( z, compress, [ZLIB=-lz],[AC_MSG_ERROR([Missing zlib])] )
96AC_CHECK_LIB( compat, ftime, [COMPATLIB=-lcompat] )
97AC_CHECK_LIB( crypto, SHA1_Init, [SSLLIB=-lssl], [AC_MSG_ERROR([Missing openssl])])
98
99AC_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])
108                                 
109AC_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
120AC_MSG_CHECKING(whether to build/link POSTGRESQL)
121if test "x$DO_POSTGRESQL" = "xyes"; then
122DO_MYSQL=no
123POSTGRE_INCLUDES="-I/usr/include/postgresql $POSTGRE_INCLUDES"
124POSTGRE_LIBS="-L/usr/lib/postresql -lpq -lz -lpthread -lcrypt -lnsl -lm -lpthread -L/usr/lib -lssl -lcrypto $POSTGRE_LIBS "
125CXXFLAGS="-DDO_POSTGRESQL $CXXFLAGS"
126fi
127AC_MSG_RESULT($DO_POSTGRESQL)
128       
129# here mysql
130AC_MSG_CHECKING(whether to build/link MYSQL)
131if test "x$DO_MYSQL" = "xyes"; then
132AC_MSG_RESULT($DO_MYSQL)
133AC_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
142else
143AC_MSG_RESULT($DO_MYSQL)
144fi
145
146## Check for options
147#  Include debug info in library?
148AC_MSG_CHECKING(whether to include debug info in library)
149MANGOSD_DEBUG_INFO=no
150AC_ARG_WITH(debug-info,
151[
152Debugging 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])
164AC_MSG_RESULT($MANGOSD_DEBUG_INFO)
165
166
167# Enable CLI console?
168AC_MSG_CHECKING(whether cli console is enabled)
169MANGOSD_ENABLE_CLI=no
170AC_ARG_ENABLE(cli,
171[  --enable-cli Turn on command console system],
172[
173    if test "$enableval" = "yes" ; then
174        CFLAGS="-DENABLE_CLI $CFLAGS"
175        CXXFLAGS="-DENABLE_CLI $CXXFLAGS"
176        MANGOSD_ENABLE_CLI=yes
177    elif test "$withval" != "no" ; then
178        AC_MSG_ERROR(Please choose yes or no)
179    fi
180])
181AC_MSG_RESULT($MANGOSD_ENABLE_CLI)
182
183# Enable remote console?
184AC_MSG_CHECKING(whether remote console is enabled)
185MANGOSD_ENABLE_RA=no
186AC_ARG_ENABLE(ra,
187[  --enable-ra Turn on remote console system],
188[
189    if test "$enableval" = "yes" ; then
190        CFLAGS="-DENABLE_RA $CFLAGS"
191        CXXFLAGS="-DENABLE_RA $CXXFLAGS"
192        MANGOSD_ENABLE_RA=yes
193    elif test "$withval" != "no" ; then
194        AC_MSG_ERROR(Please choose yes or no)
195    fi
196])
197AC_MSG_RESULT($MANGOSD_ENABLE_RA)
198
199## Check for required header files.
200AC_HEADER_STDC
201AC_HEADER_DIRENT
202AC_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  ])
203
204AC_CHECK_HEADERS([pthread.h])
205AC_CHECK_HEADERS([openssl/md5.h openssl/rand.h openssl/ssl.h openssl/sha.h openssl/bn.h])
206AC_CHECK_HEADERS([mysql.h mysql/mysql.h])
207AC_CHECK_HEADERS([libpq-fe.h])
208AC_CHECK_HEADERS([zlib.h])
209
210## Check for typedefs, structures, and compiler characteristics.
211AC_HEADER_STDBOOL
212AC_C_CONST
213AC_C_INLINE
214AC_TYPE_SIZE_T
215AC_HEADER_TIME
216AC_STRUCT_TM
217AC_TYPE_UINT64_T
218AC_C_VOLATILE
219AC_CHECK_TYPES([ptrdiff_t])
220
221## Check for required library functions.
222AC_FUNC_CLOSEDIR_VOID
223AC_FUNC_ERROR_AT_LINE
224AC_FUNC_MALLOC
225AC_FUNC_MEMCMP
226AC_FUNC_REALLOC
227AC_FUNC_SELECT_ARGTYPES
228AC_TYPE_SIGNAL
229AC_FUNC_VPRINTF
230AC_CHECK_FUNCS([atexit ftime gethostbyaddr gethostbyname gethostname gettimeofday memmove memset pow realpath select socket sqrt strchr strdup strerror strstr])
231
232## Export defined variables
233AC_SUBST(ZLIB)
234AC_SUBST(COMPATLIB)
235AC_SUBST(SSLLIB)
236AC_SUBST(MYSQL_INCLUDES)
237AC_SUBST(MYSQL_LIBS)
238AC_SUBST(POSTGRE_INCLUDES)
239AC_SUBST(POSTGRE_LIBS)
240AC_SUBST(DOXYGEN)
241AC_SUBST(MANGOSD_DEBUG_INFO)
242AC_SUBST(MANGOSD_ENABLE_CLI)
243AC_SUBST(MANGOSD_ENABLE_RA)
244
245## Set output files.
246AC_CONFIG_HEADERS([config.h])
247AC_CONFIG_FILES([
248   dep/include/Makefile
249   dep/lib/Makefile
250   dep/src/Makefile
251   dep/src/g3dlite/Makefile
252   dep/src/sockets/Makefile
253   dep/src/zlib/Makefile
254   dep/src/zthread/Makefile
255   dep/Makefile
256   doc/Doxyfile
257   doc/Makefile
258   Makefile
259   sql/Makefile
260   sql/tools/Makefile
261   sql/updates/Makefile
262   src/Makefile
263   src/framework/Makefile
264   src/shared/Makefile
265   src/shared/vmap/Makefile
266   src/game/Makefile
267   src/trinityrealm/Makefile
268   src/trinitycore/Makefile
269   src/bindings/Makefile
270   src/bindings/scripts/Makefile
271   src/bindings/interface/Makefile
272])
273
274## Configure ACE
275AC_CONFIG_SUBDIRS([dep/ACE_wrappers])
276
277## Disabled Makefiles, until they are ready for a successful make and
278#  make dist run.
279
280AC_CONFIG_COMMANDS([default],[
281  echo ""
282  echo "Configuration of TrinityCore $PACKAGE_VERSION is now complete."
283  echo ""
284 ],[PACKAGE_VERSION=$PACKAGE_VERSION])
285
286## Output files.
287AC_OUTPUT
Note: See TracBrowser for help on using the browser.