]> jfr.im git - irc/thales.git/blob - configure.in
Sequana support removed
[irc/thales.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(src/main.c)
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.
7 AC_PROG_AWK
8 AC_PROG_CC
9 AC_PROG_INSTALL
10 AC_PROG_LN_S
11
12 dnl Checks for libraries.
13 AC_CHECK_LIB(socket, connect, gethostbyname)
14 AC_CHECK_LIB(z, compress)
15 AC_CHECK_LIB(m, floor)
16
17 dnl Checks for header files.
18 AC_HEADER_STDC
19 AC_CHECK_HEADERS(limits.h sys/time.h unistd.h)
20
21 dnl Checks for typedefs, structures, and compiler characteristics.
22 AC_C_CONST
23 AC_TYPE_SIZE_T
24 AC_HEADER_TIME
25 AC_STRUCT_TM
26
27 dnl Checks for library functions.
28 AC_FUNC_STRFTIME
29 AC_FUNC_VPRINTF
30 AC_CHECK_FUNCS(gettimeofday select socket strcspn strdup strerror strspn strtol)
31
32 AC_ARG_WITH(ircd,
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.)])
36 AC_ARG_WITH(hashlist,
37 [ --with-hashlist=YES/NO Use an internal hashlist to store some data ? (that makes Thales run faster)])
38 AC_ARG_WITH(mysql,
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])
48
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)
51
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!))
56 fi
57
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!))
61 fi
62
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!))
67 fi
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!))
72 fi
73 else
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!)))))))
82 fi
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!))))
88 fi
89 fi
90 CFLAGS="$CFLAGS -Wall"
91
92 AC_ARG_ENABLE(static,
93 [ --enable-static links statically],
94 [LDFLAGS="$LDFLAGS -static"])
95
96 dnl Table prefix
97
98 ok=0
99 if test "x$with_tableprefix" != "x"; then
100 AC_DEFINE_UNQUOTED(TBL_PREFIX, "$with_tableprefix", 'table prefix to use')
101 fi
102
103
104 dnl Hashlist ?
105
106 ok=0
107 if test "x$with_hashlist" != "x"; then
108 case $with_hashlist in
109 [[Nn][Oo]])
110 echo "Hashlist support disabled : Thales will run slower."
111 ok=1
112 ;;
113 esac
114 fi
115 if test $ok -eq 0; then
116 AC_DEFINE_UNQUOTED(HASHLISTSUPPORT, 1, 'use internal hashlist')
117 fi
118
119 dnl IRCD type
120
121 ok=0
122 if test "x$with_ircd" != "x"; then
123 case $with_ircd in
124 [[Bb][Aa][Hh][Aa][Mm][Uu][Tt]])
125 AC_DEFINE_UNQUOTED(IRCD_BAHAMUT, 1, 'ircd type')
126 echo "Using Bahamut IRCD"
127 ok=1
128 ;;
129 [[Hh][Yy][Bb][Rr][Ii][Dd]])
130 AC_DEFINE_UNQUOTED(IRCD_HYBRID, 1, 'ircd type')
131 echo "Using Hybrid IRCD"
132 ok=1
133 ;;
134 [[Ii][Rr][Cc][Dd][Rr][Uu]])
135 AC_DEFINE_UNQUOTED(IRCD_IRCDRU, 1, 'ircd type')
136 echo "Using IRCD-RU IRCD"
137 ok=1
138 ;;
139 [[Uu][Nn][Rr][Ee][Aa][Ll]])
140 AC_DEFINE_UNQUOTED(IRCD_UNREAL, 1, 'ircd type')
141 echo "Using Unreal IRCD"
142 ok=1
143 ;;
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"
147 ok=1
148 ;;
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"
152 ok=1
153 ;;
154 *)
155 echo "IRCD type unrecognized"
156 ;;
157 esac
158 fi
159 if test $ok -eq 0; then
160 echo
161 echo "---------------------------------------------------------------"
162 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
172 echo -n '> '
173 read KBDINPUT
174 case $KBDINPUT in
175 1)
176 AC_DEFINE_UNQUOTED(IRCD_BAHAMUT, 1, 'ircd type')
177 ok=1
178 ;;
179 2)
180 AC_DEFINE_UNQUOTED(IRCD_HYBRID, 1, 'ircd type')
181 ok=1
182 ;;
183 3)
184 AC_DEFINE_UNQUOTED(IRCD_IRCDRU, 1, 'ircd type')
185 ok=1
186 ;;
187 4)
188 AC_DEFINE_UNQUOTED(IRCD_UNREAL, 1, 'ircd type')
189 ok=1
190 ;;
191 5)
192 AC_DEFINE_UNQUOTED(IRCD_ULTI28, 1, 'ircd type')
193 ok=1
194 ;;
195 6)
196 AC_DEFINE_UNQUOTED(IRCD_ULTIMATE, 1, 'ircd type')
197 ok=1
198 ;;
199 *)
200 echo "Please enter a valid option number."
201 ;;
202 esac
203 done
204 fi
205
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 ?')])
209
210 AC_OUTPUT(src/Makefile data/Makefile Makefile)
211
212 if test $REPORT -eq 1; then
213 ./ReportUsage.sh
214 fi
215 echo
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)"
220 echo
221 echo "Don't forget to read the README and INSTALL files for more detailed instructions"
222 echo