]> jfr.im git - irc/thales.git/blame - configure.in
Sequana support removed
[irc/thales.git] / configure.in
CommitLineData
2ace9480 1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(src/main.c)
3AM_CONFIG_HEADER(src/config.h)
4AM_INIT_AUTOMAKE(thales, 0.9.4)
5AC_PREFIX_DEFAULT([\${HOME}/thales])
6dnl Checks for programs.
7AC_PROG_AWK
8AC_PROG_CC
9AC_PROG_INSTALL
10AC_PROG_LN_S
11
12dnl Checks for libraries.
13AC_CHECK_LIB(socket, connect, gethostbyname)
14AC_CHECK_LIB(z, compress)
15AC_CHECK_LIB(m, floor)
16
17dnl Checks for header files.
18AC_HEADER_STDC
19AC_CHECK_HEADERS(limits.h sys/time.h unistd.h)
20
21dnl Checks for typedefs, structures, and compiler characteristics.
22AC_C_CONST
23AC_TYPE_SIZE_T
24AC_HEADER_TIME
25AC_STRUCT_TM
26
27dnl Checks for library functions.
28AC_FUNC_STRFTIME
29AC_FUNC_VPRINTF
30AC_CHECK_FUNCS(gettimeofday select socket strcspn strdup strerror strspn strtol)
31
32AC_ARG_WITH(ircd,
287805aa 33[ --with-ircd=ircdtype type of the ircd used with thales (bahamut, hybrid, ircdru, unreal, ultimate28 or ultimate30)])
2ace9480 34AC_ARG_WITH(tableprefix,
35[ --tableprefix=string prefix to add to all SQL tables names. database creation scripts need to be modified accordingly.)])
36AC_ARG_WITH(hashlist,
37[ --with-hashlist=YES/NO Use an internal hashlist to store some data ? (that makes Thales run faster)])
38AC_ARG_WITH(mysql,
39[ --with-mysql=PFX Prefix where MySQL is installed (usually /usr/local)])
40AC_ARG_WITH(mysql-includes,
41[ --with-mysql-includes=PFX Prefix where MySQL includes are found (usually
42 /usr/local/include/mysql)])
43AC_ARG_WITH(mysql-libraries,
44[ --with-mysql-libraries=PFX Prefix where MySQL libraries are found (usually
45 /usr/local/lib/mysql)])
46AC_ARG_ENABLE(noreportusage,
47[ --enable-noreportusage Forget about the Usage Survey],[REPORT=0],[REPORT=1])
48
49dnl Check usr/local first, in case sys admin has installed a later version
50dnl than was included with the OS (in which case the older will be in /usr)
51
52if 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!))
56fi
57
58if 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!))
61fi
62
63if 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
73else
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
89fi
90CFLAGS="$CFLAGS -Wall"
91
92AC_ARG_ENABLE(static,
93[ --enable-static links statically],
94[LDFLAGS="$LDFLAGS -static"])
95
96dnl Table prefix
97
98ok=0
99if test "x$with_tableprefix" != "x"; then
100 AC_DEFINE_UNQUOTED(TBL_PREFIX, "$with_tableprefix", 'table prefix to use')
101fi
102
103
104dnl Hashlist ?
105
106ok=0
107if 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
114fi
115if test $ok -eq 0; then
116 AC_DEFINE_UNQUOTED(HASHLISTSUPPORT, 1, 'use internal hashlist')
117fi
118
119dnl IRCD type
120
121ok=0
122if 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 ;;
2ace9480 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
158fi
159if 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"
287805aa 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"
2ace9480 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)
2ace9480 188 AC_DEFINE_UNQUOTED(IRCD_UNREAL, 1, 'ircd type')
189 ok=1
190 ;;
287805aa 191 5)
2ace9480 192 AC_DEFINE_UNQUOTED(IRCD_ULTI28, 1, 'ircd type')
193 ok=1
194 ;;
287805aa 195 6)
2ace9480 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
204fi
205
206AC_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
210AC_OUTPUT(src/Makefile data/Makefile Makefile)
211
212if test $REPORT -eq 1; then
213 ./ReportUsage.sh
214fi
215echo
216echo "Thales will be installed in ${prefix}. To change this, run :"
217echo " ./configure --prefix=DIRECTORY"
218echo "To compile Thales, run make (or gmake on non-GNU systems)"
219echo "To install Thales, run make install (or gmake install on non-GNU systems)"
220echo
221echo "Don't forget to read the README and INSTALL files for more detailed instructions"
222echo