1 dnl Process this file with autoconf to produce a configure script.
3 AM_CONFIG_HEADER(src/config.h)
4 AM_INIT_AUTOMAKE(thales, 0.9.4)
5 AC_PREFIX_DEFAULT([\${HOME}/thales])
6 dnl Checks for programs.
12 dnl Checks for libraries.
13 AC_CHECK_LIB(socket, connect, gethostbyname)
14 AC_CHECK_LIB(z, compress)
15 AC_CHECK_LIB(m, floor)
17 dnl Checks for header files.
19 AC_CHECK_HEADERS(limits.h sys/time.h unistd.h)
21 dnl Checks for typedefs, structures, and compiler characteristics.
27 dnl Checks for library functions.
30 AC_CHECK_FUNCS(gettimeofday select socket strcspn strdup strerror strspn strtol)
33 [ --with-ircd=ircdtype type of the ircd used with thales (bahamut, hybrid, ircdru, unreal, ultimate28 or ultimate30)])
34 AC_ARG_WITH(tableprefix,
35 [ --tableprefix=string prefix to add to all SQL tables names. database creation scripts need to be modified accordingly.)])
37 [ --with-hashlist=YES/NO Use an internal hashlist to store some data ? (that makes Thales run faster)])
39 [ --with-mysql=PFX Prefix where MySQL is installed (usually /usr/local)])
40 AC_ARG_WITH(mysql-includes,
41 [ --with-mysql-includes=PFX Prefix where MySQL includes are found (usually
42 /usr/local/include/mysql)])
43 AC_ARG_WITH(mysql-libraries,
44 [ --with-mysql-libraries=PFX Prefix where MySQL libraries are found (usually
45 /usr/local/lib/mysql)])
46 AC_ARG_ENABLE(noreportusage,
47 [ --enable-noreportusage Forget about the Usage Survey],[REPORT=0],[REPORT=1])
49 dnl Check usr/local first, in case sys admin has installed a later version
50 dnl than was included with the OS (in which case the older will be in /usr)
52 if test "x$with_mysql_includes" != "x"; then
53 AC_CHECK_HEADER($with_mysql_includes/mysql.h,
54 [CFLAGS="$CFLAGS -I$with_mysql_includes"],
55 AC_MSG_ERROR(Need MySQL includes!))
58 if test "x$with_mysql_libraries" != "x"; then
59 AC_CHECK_LIB_LOC($with_mysql_libraries,mysqlclient,mysql_real_connect,,
60 AC_MSG_ERROR(Need MySQL client library!))
63 if test "x$with_mysql" != "x"; then
64 if test "x$with_mysql_libraries" = "x"; then
65 AC_CHECK_LIB_LOC($with_mysql/lib/mysql,mysqlclient,mysql_real_connect,,
66 AC_MSG_ERROR(Need MySQL client library!))
68 if test "x$with_mysql_includes" = "x"; then
69 AC_CHECK_HEADER($with_mysql/include/mysql/mysql.h,
70 [CFLAGS="$CFLAGS -I$with_mysql/include/mysql"],
71 AC_MSG_ERROR(Need MySQL includes!))
74 if test "x$with_mysql_libraries" = "x"; then
75 AC_CHECK_LIB_LOC(/opt/lib/mysql,mysqlclient,mysql_real_connect,,
76 AC_CHECK_LIB_LOC(/usr/local/lib/mysql,mysqlclient,mysql_real_connect,,
77 AC_CHECK_LIB_LOC(/usr/lib/mysql,mysqlclient,mysql_real_connect,,
78 AC_CHECK_LIB_LOC(/usr/local/lib,mysqlclient,mysql_real_connect,,
79 AC_CHECK_LIB_LOC(/opt/lib,mysqlclient,mysql_real_connect,,
80 AC_CHECK_LIB_LOC(/usr/lib,mysqlclient,mysql_real_connect,,
81 AC_MSG_ERROR(Need MySQL client library!)))))))
83 if test "x$with_mysql_includes" = "x"; then
84 AC_CHECK_HEADER(/opt/include/mysql/mysql.h, CFLAGS="$CFLAGS -I/opt/include/mysql",
85 AC_CHECK_HEADER(/usr/local/include/mysql/mysql.h, CFLAGS="$CFLAGS -I/usr/local/include/mysql",
86 AC_CHECK_HEADER(/usr/include/mysql/mysql.h, CFLAGS="$CFLAGS -I/usr/include/mysql",
87 AC_MSG_ERROR(Need MySQL includes!))))
90 CFLAGS="$CFLAGS -Wall"
93 [ --enable-static links statically],
94 [LDFLAGS="$LDFLAGS -static"])
99 if test "x$with_tableprefix" != "x"; then
100 AC_DEFINE_UNQUOTED(TBL_PREFIX, "$with_tableprefix", 'table prefix to use')
107 if test "x$with_hashlist" != "x"; then
108 case $with_hashlist in
110 echo "Hashlist support disabled : Thales will run slower."
115 if test $ok -eq 0; then
116 AC_DEFINE_UNQUOTED(HASHLISTSUPPORT, 1, 'use internal hashlist')
122 if test "x$with_ircd" != "x"; then
124 [[Bb][Aa][Hh][Aa][Mm][Uu][Tt]])
125 AC_DEFINE_UNQUOTED(IRCD_BAHAMUT, 1, 'ircd type')
126 echo "Using Bahamut IRCD"
129 [[Hh][Yy][Bb][Rr][Ii][Dd]])
130 AC_DEFINE_UNQUOTED(IRCD_HYBRID, 1, 'ircd type')
131 echo "Using Hybrid IRCD"
134 [[Ii][Rr][Cc][Dd][Rr][Uu]])
135 AC_DEFINE_UNQUOTED(IRCD_IRCDRU, 1, 'ircd type')
136 echo "Using IRCD-RU IRCD"
139 [[Uu][Nn][Rr][Ee][Aa][Ll]])
140 AC_DEFINE_UNQUOTED(IRCD_UNREAL, 1, 'ircd type')
141 echo "Using Unreal IRCD"
144 [[Uu][Ll][Tt][Ii][Mm][Aa][Tt][Ee]28])
145 AC_DEFINE_UNQUOTED(IRCD_ULTI28, 1, 'ircd type')
146 echo "Using Ultimate IRCD 2.8"
149 [[Uu][Ll][Tt][Ii][Mm][Aa][Tt][Ee]30])
150 AC_DEFINE_UNQUOTED(IRCD_ULTIMATE, 1, 'ircd type')
151 echo "Using Ultimate IRCD 3.0"
155 echo "IRCD type unrecognized"
159 if test $ok -eq 0; then
161 echo "---------------------------------------------------------------"
163 echo "Which of the following is closest to the type of server used on"
164 echo "your IRC network ?"
165 echo " 1) Bahamut 1.4.27 or later"
166 echo " 2) Hybrid 7 or later"
167 echo " 3) ircd-RU! 1.4.0 or later"
168 echo " 4) UnrealIRCd 3.1.1 or later"
169 echo " 5) UltimateIRCD 2.8 or later (2.8 branch)"
170 echo " 6) UltimateIRCD 3.0.0 or later"
171 while `test $ok -eq 0` ; do
176 AC_DEFINE_UNQUOTED(IRCD_BAHAMUT, 1, 'ircd type')
180 AC_DEFINE_UNQUOTED(IRCD_HYBRID, 1, 'ircd type')
184 AC_DEFINE_UNQUOTED(IRCD_IRCDRU, 1, 'ircd type')
188 AC_DEFINE_UNQUOTED(IRCD_UNREAL, 1, 'ircd type')
192 AC_DEFINE_UNQUOTED(IRCD_ULTI28, 1, 'ircd type')
196 AC_DEFINE_UNQUOTED(IRCD_ULTIMATE, 1, 'ircd type')
200 echo "Please enter a valid option number."
206 AC_ARG_ENABLE(no-modes,
207 [ --enable-no-modes Disables modes in the database (modes are enabled by default)],
208 [AC_DEFINE_UNQUOTED(NOMODES, 1, 'dont store modes in the database ?')])
210 AC_OUTPUT(src/Makefile data/Makefile Makefile)
212 if test $REPORT -eq 1; then
216 echo "Thales will be installed in ${prefix}. To change this, run :"
217 echo " ./configure --prefix=DIRECTORY"
218 echo "To compile Thales, run make (or gmake on non-GNU systems)"
219 echo "To install Thales, run make install (or gmake install on non-GNU systems)"
221 echo "Don't forget to read the README and INSTALL files for more detailed instructions"