File: configure.in

package info (click to toggle)
centericq 4.20.0-1sarge5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,712 kB
  • ctags: 11,687
  • sloc: cpp: 45,557; ansic: 39,745; sh: 17,325; makefile: 677; yacc: 316; perl: 235; sed: 16
file content (273 lines) | stat: -rw-r--r-- 8,270 bytes parent folder | download
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
AC_INIT(src/centericq.cc)
AM_INIT_AUTOMAKE(centericq, 4.20.0)

AC_CANONICAL_HOST

AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_RANLIB

AM_CONFIG_HEADER(config.h)
AC_STRUCT_TIMEZONE

AC_LANG_SAVE
AC_LANG_CPLUSPLUS

###     use option --enable-locales-fix to fix problems with double-byte
###     encodings on systems with broken locale, iscntrl()

AC_ARG_ENABLE(locales-fix,
	[  --enable-locales-fix    enables workaround for broken locales. use this
			  option if some of characters in your texts in Chinese
			  or Japanese diappear])

###     use option --with-fribidi to compile with fribidi support
AC_ARG_WITH(fribidi,
	[  --with-fribidi=[DIR]    enable Hebrew and Arabic support using fribidi
			  library in DIR],
	[with_fribidi=$withval],
	[with_fribidi=no])

if test "$with_fribidi" = "yes"; then
    for ac_dir in /usr/local /usr; do
	if test -f "$ac_dir/include/fribidi/fribidi.h"; then
	    with_fribidi=$ac_dir
	    break;
	fi
    done
fi

if test -n "$with_fribidi" -a "$with_fribidi" != "no"; then
    if test "$with_fribidi" = "yes"; then with_fribidi="/usr"; fi

    if test -r $with_fribidi/include/fribidi/fribidi.h; then
	LIBS="$LIBS `$with_fribidi/bin/fribidi-config --libs`"
	AC_DEFINE(USE_FRIBIDI, 1, [use fribidi])
    fi
fi

###     FriBiDi check end

###
###     SSL libs
###

AC_ARG_WITH(ssl, [  --with-ssl              enable SSL secured connections using either OpenSSL
			  or GnuTLS],
	[with_ssl=$withval])

if test "$with_ssl" != "no"; then
    AC_ARG_WITH(openssl,
	[  --with-openssl=[DIR]    enable SSL secured connections using the OpenSSL
			  library in DIR (optional)],
	[with_openssl=$withval])

    if test -z "$with_openssl"; then
	for ac_dir in /usr/local /usr; do
	    if test -f "$ac_dir/include/openssl/ssl.h"; then
		with_openssl=$ac_dir
		break;
	    fi
	done
    fi

    AC_MSG_CHECKING(for OpenSSL)

    if test -n "$with_openssl" -a "$with_openssl" != "no"; then
	if test "$with_openssl" = "yes"; then with_openssl="/usr"; fi
	CFLAGS="$CFLAGS -I${with_openssl}"
	AC_DEFINE(HAVE_OPENSSL, 1, [use openssl])
	AC_MSG_RESULT([found in $with_openssl])
	AC_CHECK_LIB(crypto, main)
	AC_CHECK_LIB(ssl, main)
    else
	AC_MSG_RESULT([not found or disabled])
	with_ssl="no"

	AM_PATH_LIBGNUTLS_EXTRA(0.0.1, [
	    CXXFLAGS="$CXXFLAGS $LIBGNUTLS_CFLAGS"
	    LIBS="$LIBS $LIBGNUTLS_LIBS -lgnutls-extra"
	    AC_DEFINE(HAVE_GNUTLS, 1, [use gnutls])
	    with_ssl="yes"
	])
    fi
fi

###     SSL end

AC_CHECK_HEADERS([vector iostream fstream string algorithm list memory iterator exception utility],,
  AC_MSG_ERROR([You need to have the libstdc++ headers installed]))

AC_CHECK_HEADERS([hash_map strstream ext/hash_map sstream],,)
AC_CHECK_HEADERS([stdint.h sys/types.h],,)

AM_ICONV_LINK

LIBS="$LIBS $LIBICONV"

AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)

AC_CHECK_LIB(ncurses, initscr,,
    [AC_CHECK_LIB(curses, initscr,, AC_MSG_ERROR(The ncurses terminal library is required in order to build the program))])

AC_TRY_COMPILE([
    #include <sys/types.h>
    #include <sys/socket.h>
],[ socklen_t foo; ], ac_cv_c_socklen_t=yes, ac_cv_c_socklen_t=no)

if test "$ac_cv_c_socklen_t" = "no"; then
  AC_DEFINE(socklen_t, int, [Define type of socklen_t for systems missing it])
fi

# Check for GPGME

AC_ARG_WITH(gpgme,
    [  --with-gpgme=[DIR]    gpgme-config in DIR],
    [ if test "$withval" = "no"; then GPGME_CONFIG=""; else GPGME_CONFIG="$withval"; fi ],
    [ AC_PATH_PROG(GPGME_CONFIG,
	gpgme-config)])

if test ! -z "$GPGME_CONFIG"; then
    save_CXXFLAGS="$CXXFLAGS"
    save_LIBS="$LIBS"
    CXXFLAGS="$CXXFLAGS `$GPGME_CONFIG --cflags`"
    LIBS="`$GPGME_CONFIG --libs` $LIBS"

    AC_MSG_CHECKING(OpenPGP protocol is available)
    AC_TRY_RUN([
	#include <gpgme.h>
	int main() {
	    gpgme_ctx_t ctx;
	    if(!gpgme_new(&ctx))
	    if(!gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP))
		return 0;
	    return 1;
	}
    ], opengpg_avail=yes, opengpg_avail=no, opengpg_avail=no)
    AC_MSG_RESULT($opengpg_avail)

    if test "$opengpg_avail" != "yes"; then
	CXXFLAGS="$save_CXXFLAGS"
	LIBS="$save_LIBS"
	GPGME_CONFIG=""
    fi
fi

AC_LANG_RESTORE

# Check for curl.

AC_ARG_WITH(curl,
    [  --with-curl=[DIR]    curl-config in DIR],
    [ if test "$withval" = "no"; then CURL_CONFIG=""; else CURL_CONFIG="$withval"; fi ],
    [ AC_PATH_PROG(CURL_CONFIG,
	curl-config)])

if test ! -z "$CURL_CONFIG"; then
    CXXFLAGS="$CXXFLAGS `$CURL_CONFIG --cflags`"
    LIBS="`$CURL_CONFIG --libs` $LIBS"
fi

case "$host_os" in
	darwin*)
	    LIBS="$LIBS -flat_namespace"
	;;
esac

AC_ARG_ENABLE(yahoo,  [  --disable-yahoo    Build without Yahoo!], build_yahoo="$enableval", build_yahoo="yes")
AC_ARG_ENABLE(aim,    [  --disable-aim      Build without AIM], build_aim="$enableval", build_aim="yes")
AC_ARG_ENABLE(irc,    [  --disable-irc      Build without IRC], build_irc="$enableval", build_irc="yes")
AC_ARG_ENABLE(jabber, [  --disable-jabber   Build without Jabber], build_jabber="$enableval", build_jabber="yes")
AC_ARG_ENABLE(gg,     [  --disable-gg       Build without Gadu-Gadu], build_gg="$enableval", build_gg="yes")
AC_ARG_ENABLE(msn,    [  --disable-msn      Build without MSN], build_msn="$enableval", build_msn="yes")
AC_ARG_ENABLE(rss,    [  --disable-rss      Build without RSS reader], build_rss="$enableval", build_rss="yes")
AC_ARG_ENABLE(lj,     [  --disable-lj       Build without LiveJournal client], build_lj="$enableval", build_lj="yes")

AC_ARG_ENABLE(konst,  [  --disable-konst    Don't add contact list items supplied by author by default], build_konst="$enableval", build_konst="yes")

AM_CONDITIONAL(BUILD_YAHOO, test "x$build_yahoo" = xyes)
AM_CONDITIONAL(BUILD_AIM, test "x$build_aim" = xyes)
AM_CONDITIONAL(BUILD_IRC, test "x$build_irc" = xyes)
AM_CONDITIONAL(BUILD_JABBER, test "x$build_jabber" = xyes)
AM_CONDITIONAL(BUILD_GADU, test "x$build_gg" = xyes)
AM_CONDITIONAL(BUILD_MSN, test "x$build_msn" = xyes)
AM_CONDITIONAL(BUILD_RSS, test "x$build_rss" = xyes -o "x$build_lj" = xyes)
AM_CONDITIONAL(BUILD_LJ, test "x$build_lj" = xyes)

if test "$build_yahoo" = "yes"; then
    AC_DEFINE(BUILD_YAHOO, 1, [build with yahoo support])
fi

if test "$build_aim" = "yes"; then
    AC_DEFINE(BUILD_AIM, 1, [build with aim support])
fi

if test "$build_irc" = "yes"; then
    AC_DEFINE(BUILD_IRC, 1, [build with irc support])
fi

if test "$build_jabber" = "yes"; then
    if test -z "$GPGME_CONFIG"; then
	AC_MSG_WARN([No GPG support in Jabber, since GPGME library not found or its setup not ok])
    else
	AC_DEFINE(HAVE_GPGME, 1, [has GPGME library])
    fi
    AC_DEFINE(BUILD_JABBER, 1, [build with jabber support])
fi

AC_ARG_WITH(libjpeg,
    [  --without-libjpeg        Compile without JPEG token support (for Gadu-Gadu registration)])

if test "$build_gg" = "yes"; then
    AC_DEFINE(BUILD_GADU, 1, [build with gadu-gadu support])

    if test "x$with_libjpeg" != "xno"; then
	AC_CHECK_LIB(jpeg, jpeg_start_decompress,
	[ 
	    AC_CHECK_HEADERS(jpeglib.h,
	    [
		AC_DEFINE(HAVE_LIBJPEG, 1, [define if you have libjpeg])
		LIBS="-ljpeg $LIBS"
		have_libjpeg=yes
	    ])
	])
    fi
fi

if test "$build_msn" = "yes"; then
    if test -z "$CURL_CONFIG"; then
	AC_MSG_ERROR([MSN cannot be built without the curl library, use --disable-msn])
    else
	AC_MSG_CHECKING(for SSL support in libcurl)

	curlssl=`$CURL_CONFIG --feature | grep SSL`
	if test -z "$curlssl"; then
	    AC_MSG_RESULT([no])
	    AC_MSG_ERROR([MSN requires libcurl built with SSL support
    use --disable-msn --without-curl])
	else
	    AC_MSG_RESULT([yes])
	fi

	AC_DEFINE(BUILD_MSN, 1, [build with MSN support])
    fi
fi

if test "$build_rss" = "yes" -o "$build_lj" = "yes"; then
    AC_DEFINE(BUILD_RSS, 1, [build the integrated rss feeds reader])
fi

if test "$build_lj" = "yes"; then
    AC_DEFINE(BUILD_LJ, 1, [build the integrated livejournal client])
fi

if test "$build_konst" = "yes"; then
    AC_DEFINE(BUILD_KONST, 1, [add konst's id by default])
fi

ALL_LINGUAS="zh_TW.Big5 uk sv ru ro pt_BR pl nl ms it hu fr es de cs bg"
AM_GNU_GETTEXT
AC_CONFIG_SUBDIRS(firetalk-0.1 kkconsui-0.1 kkstrtext-0.1 libicq2000-0.1 libjabber-0.1 libyahoo2-0.1 kksystr-0.1 connwrap-0.1 libgadu-0.1 libmsn-0.1)
AC_OUTPUT(Makefile misc/Makefile share/Makefile src/Makefile src/hooks/Makefile po/Makefile.in intl/Makefile)