forked from mortenbpost/eservices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
177 lines (146 loc) · 4.89 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Exiled.Net IRC Services.
# $Id: configure.ac,v 1.5 2004/01/09 00:15:37 cure Exp $
# Process this file with autoconf to produce a configure script.
AC_INIT([Exiled.Net IRC Services], [], [[email protected]])
AC_CONFIG_SRCDIR([src/chanserv.c])
AC_LANG(C)
AM_INIT_AUTOMAKE
dnl Checks for programs.
AC_PROG_CC
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_TIME
# required by strcmp()
AC_CHECK_HEADERS(string.h)
# required for socket()
AC_CHECK_HEADERS([sys/types.h])
AC_CHECK_HEADERS([sys/socket.h])
# required for select()
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([sys/time.h])
# required for gethostbyname()
AC_CHECK_HEADERS([netdb.h])
# required for sockaddr_in
AC_CHECK_HEADERS([netinet/in.h])
# required for atexit()
AC_CHECK_HEADERS([stdlib.h])
# For systems which defines crypt() in crypt.h instead of unistd.h
AC_CHECK_HEADERS([crypt.h])
# Check for OpenSSL for use of SHA1 rutine
AC_CHECK_HEADERS([openssl/sha.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_FUNC_MALLOC
AC_CHECK_FUNCS([atexit signal fork])
AC_CHECK_FUNCS([memmove memset])
AC_CHECK_FUNCS([select socket gethostbyname listen bind])
AC_CHECK_FUNCS([strcasecmp stricmp strchr strtoul snprintf])
dnl Check for libs
AC_CHECK_LIB(m, floor)
AC_CHECK_LIB(crypt, crypt)
AC_CHECK_LIB(z, compress)
AC_CHECK_LIB(ssl -lcrypto, SHA1)
dnl Turn of debug information?
AC_ARG_WITH(debug,
AC_HELP_STRING([--with-debug],
[Specifies whether debug console-output information should be suppressed]))
if test "x$with_debug" = "xno"; then
DEBUG="-DNDEBUG"
else
DEBUG=""
fi
dnl MySQL stuff
AC_ARG_WITH(mysql-includes,
AC_HELP_STRING([--with-mysql-includes=prefix],
[Prefix where MySQL includes are found (usually /usr/local/include/mysql)]))
AC_ARG_WITH(mysql-libraries,
AC_HELP_STRING([--with-mysql-libraries=prefix],
[Prefix where MySQL libraries are found (usually /usr/local/lib/mysql)]))
AC_MSG_CHECKING([for mysql.h])
if test "x$with_mysql_includes" != "x"; then
if test -f "$with_mysql_includes/mysql.h"; then
CFLAGS="$CFLAGS -I$with_mysql_includes"
AC_MSG_RESULT([found in $with_mysql_includes])
else
AC_MSG_ERROR([not found in $with_mysql_includes!])
fi
else
if test -f "/usr/local/include/mysql/mysql.h"; then
CFLAGS="$CFLAGS -I/usr/local/include/mysql"
AC_MSG_RESULT([found in /usr/local/include/mysql])
elif test -f "/usr/include/mysql/mysql.h"; then
CFLAGS="$CFLAGS -I/usr/include/mysql"
AC_MSG_RESULT([found in /usr/include/mysql])
elif test -f "/opt/include/mysql/mysql.h"; then
CFLAGS="$CFLAGS -I/opt/include/mysql"
AC_MSG_RESULT([found in /opt/include/mysql])
elif test -f "/include/mysql/mysql.h"; then
CFLAGS="$CFLAGS -I/include/mysql"
AC_MSG_RESULT([found in /include/mysql])
elif test -f "/var/mysql/include/mysql.h"; then
CFLAGS="$CFLAGS -I/var/mysql/include"
AC_MSG_RESULT([found in /var/mysql/include])
else
AC_MSG_ERROR([not found, please specify --with-mysql-include on the commandline!])
fi
fi
AC_MSG_CHECKING([for mysqlclient library])
if test "x$with_mysql_libraries" != "x"; then
if test -f "$with_mysql_libraries/libmysqlclient.a"; then
MYSQL_LIB=$with_mysql_libraries
AC_MSG_RESULT([found in $MYSQL_LIB])
else
AC_MSG_ERROR([not found in $with_mysql_libraries!])
fi
else
if test -f "/usr/local/lib/mysql/libmysqlclient.a"; then
MYSQL_LIB="/usr/local/lib/mysql"
AC_MSG_RESULT([found in $MYSQL_LIB])
elif test -f "/usr/lib/mysql/libmysqlclient.a"; then
MYSQL_LIB="/usr/lib/mysql"
AC_MSG_RESULT([found in $MYSQL_LIB])
elif test -f "/lib/mysql/libmysqlclient.a"; then
MYSQL_LIB="/lib/mysql"
AC_MSG_RESULT([found in $MYSQL_LIB])
elif test -f "/var/mysql/lib/libmysqlclient.a"; then
MYSQL_LIB="/var/lib/mysql"
AC_MSG_RESULT([found in $MYSQL_LIB])
elif test -f "/opt/lib/libmysqlclient.a"; then
MYSQL_LIB="/opt/lib"
AC_MSG_RESULT([found in $MYSQL_LIB])
elif test -f "/opt/lib/mysql/libmysqlclient.a"; then
MYSQL_LIB="/opt/lib/mysql"
AC_MSG_RESULT([found in $MYSQL_LIB])
else
AC_MSG_ERROR(not found, please specify --with-mysql-libraries on the commandline!)
fi
fi
dnl End of MySQL stuff
ACX_PTHREAD([hmmm=yes],[AC_MSG_ERROR([pthread is needed!])])
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(void*)
if test "x$acx_pthread_ok" = xyes; then
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
else
AC_MSG_ERROR([Something's rotten in the state of Denmark])
fi
LDFLAGS="$LDFLAGS -L$MYSQL_LIB"
LIBS="-lmysqlclient $LIBS"
AC_SUBST(DEBUG)
AC_SUBST(MYSQL_LIB)
AC_CONFIG_HEADERS([defines.h])
AC_CONFIG_FILES([Makefile src/Makefile src/nickserv/Makefile src/chanserv/Makefile src/operserv/Makefile src/multiserv/Makefile])
AC_OUTPUT