TorK – anonymity manager for TDE
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. dnl =======================================================
  2. dnl FILE: ./admin/configure.in.min
  3. dnl =======================================================
  4. dnl This file is part of the KDE libraries/packages
  5. dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
  6. dnl This file is free software; you can redistribute it and/or
  7. dnl modify it under the terms of the GNU Library General Public
  8. dnl License as published by the Free Software Foundation; either
  9. dnl version 2 of the License, or (at your option) any later version.
  10. dnl This library is distributed in the hope that it will be useful,
  11. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. dnl Library General Public License for more details.
  14. dnl You should have received a copy of the GNU Library General Public License
  15. dnl along with this library; see the file COPYING.LIB. If not, write to
  16. dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17. dnl Boston, MA 02110-1301, USA.
  18. # Original Author was Kalle@kde.org
  19. # I lifted it in some mater. (Stephan Kulow)
  20. # I used much code from Janos Farkas
  21. dnl Process this file with autoconf to produce a configure script.
  22. AC_INIT(acinclude.m4) dnl a source file from your sub dir
  23. dnl This is so we can use kde-common
  24. AC_CONFIG_AUX_DIR(admin)
  25. dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
  26. unset CDPATH
  27. dnl Checking host/target/build systems, for make, install etc.
  28. AC_CANONICAL_SYSTEM
  29. dnl Perform program name transformation
  30. AC_ARG_PROGRAM
  31. dnl Automake doc recommends to do this only here. (Janos)
  32. AM_INIT_AUTOMAKE(tork, 0.1) dnl searches for some needed programs
  33. KDE_SET_PREFIX
  34. dnl generate the config header
  35. AM_CONFIG_HEADER(config.h) dnl at the distribution this done
  36. dnl Checks for programs.
  37. AC_CHECK_COMPILERS
  38. AC_ENABLE_SHARED(yes)
  39. AC_ENABLE_STATIC(no)
  40. KDE_PROG_LIBTOOL
  41. dnl for NLS support. Call them in this order!
  42. dnl WITH_NLS is for the po files
  43. AM_KDE_WITH_NLS
  44. KDE_USE_TQT(3.3.5)
  45. AC_PATH_KDE
  46. dnl =======================================================
  47. dnl FILE: configure.in.in
  48. dnl =======================================================
  49. #MIN_CONFIG(3.3.5)
  50. dnl PACKAGE set before
  51. AC_C_BIGENDIAN
  52. AC_CHECK_KDEMAXPATHLEN
  53. # ---- Taken from KOffice ----------------------
  54. # --- Check for KDE 3.2 or 3.3 or 3.4 or 3.5 ---
  55. AC_MSG_CHECKING([for KDE version])
  56. AC_LANG_SAVE
  57. AC_LANG_CPLUSPLUS
  58. tdeversion_save_CXXFLAGS="$CXXFLAGS"
  59. tdeversion_safe_LIBS="$LIBS"
  60. LIBS="$LIBS $X_EXTRA_LIBS"
  61. CXXFLAGS="$CXXFLAGS $all_includes"
  62. AC_COMPILE_IFELSE([
  63. #include <tdeversion.h>
  64. #if ! ( KDE_IS_VERSION( 3, 2, 90 ) )
  65. #error KDE 3.2
  66. #endif
  67. ],
  68. need_kde32_compat="no"
  69. ,
  70. need_kde32_compat="yes"
  71. )
  72. AC_COMPILE_IFELSE([
  73. #include <tdeversion.h>
  74. #if ! ( KDE_IS_VERSION( 3, 3, 90 ) )
  75. #error KDE 3.3
  76. #endif
  77. ],
  78. need_kde33_compat="no"
  79. ,
  80. need_kde33_compat="yes"
  81. )
  82. AC_COMPILE_IFELSE([
  83. #include <tdeversion.h>
  84. #if ! ( KDE_IS_VERSION( 3, 4, 90 ) )
  85. #error KDE 3.4
  86. #endif
  87. ],
  88. need_kde34_compat="no"
  89. ,
  90. need_kde34_compat="yes"
  91. )
  92. AC_COMPILE_IFELSE([
  93. #include <tdeversion.h>
  94. #if ! ( KDE_IS_VERSION( 3, 5, 2 ) )
  95. #error KDE 3.5.x (x < 2)
  96. #endif
  97. ],
  98. need_kde351_compat="no"
  99. ,
  100. need_kde351_compat="yes"
  101. )
  102. CXXFLAGS="$tdeversion_save_CXXFLAGS"
  103. LIBS="$tdeversion_safe_LIBS"
  104. AC_LANG_RESTORE
  105. if test "$need_kde32_compat" = "yes"; then
  106. AC_MSG_ERROR([You have KDE 3.2.x. TorK needs KDE 3.5.1 or greater.])
  107. else
  108. if test "$need_kde33_compat" = "yes"; then
  109. AC_MSG_ERROR([You have KDE 3.3.x TorK needs KDE 3.5.1 or greater.])
  110. else
  111. if test "$need_kde34_compat" = "yes"; then
  112. AC_MSG_ERROR([You have KDE 3.4.x TorK needs KDE 3.5.1 or greater.])
  113. else
  114. if test "$need_kde351_compat" = "yes"; then
  115. AC_MSG_RESULT([KDE 3.5.x (x >=1) or SVN trunk])
  116. else
  117. AC_MSG_RESULT([KDE 3.5.x (x >=2) or SVN trunk])
  118. fi
  119. fi
  120. fi
  121. fi
  122. # --- End KDE 3.2 check ---
  123. # --- Begin libgnutls macro ---
  124. dnl Autoconf macros for libgnutls
  125. dnl $id$
  126. # Modified for LIBGNUTLS -- nmav
  127. # Configure paths for LIBGCRYPT
  128. # Shamelessly stolen from the one of XDELTA by Owen Taylor
  129. # Werner Koch 99-12-09
  130. dnl AM_PATH_LIBGNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
  131. dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS
  132. dnl
  133. AC_DEFUN([AM_PATH_LIBGNUTLS],
  134. [dnl
  135. dnl Get the cflags and libraries from the libgnutls-config script
  136. dnl
  137. AC_ARG_WITH(libgnutls-prefix,
  138. [ --with-libgnutls-prefix=PFX Prefix where libgnutls is installed (optional)],
  139. libgnutls_config_prefix="$withval", libgnutls_config_prefix="")
  140. if test x$libgnutls_config_prefix != x ; then
  141. if test x${LIBGNUTLS_CONFIG+set} != xset ; then
  142. LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config
  143. fi
  144. fi
  145. AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no)
  146. min_libgnutls_version=ifelse([$1], ,0.1.0,$1)
  147. AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version)
  148. no_libgnutls=""
  149. if test "$LIBGNUTLS_CONFIG" = "no" ; then
  150. no_libgnutls=yes
  151. else
  152. LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
  153. LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
  154. libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
  155. ac_save_CFLAGS="$CFLAGS"
  156. ac_save_LIBS="$LIBS"
  157. CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
  158. LIBS="$LIBS $LIBGNUTLS_LIBS"
  159. dnl
  160. dnl Now check if the installed libgnutls is sufficiently new. Also sanity
  161. dnl checks the results of libgnutls-config to some extent
  162. dnl
  163. rm -f conf.libgnutlstest
  164. AC_TRY_RUN([
  165. #include <stdio.h>
  166. #include <stdlib.h>
  167. #include <string.h>
  168. #include <gnutls/gnutls.h>
  169. int
  170. main ()
  171. {
  172. system ("touch conf.libgnutlstest");
  173. if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) )
  174. {
  175. printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n",
  176. "$libgnutls_config_version", gnutls_check_version(NULL) );
  177. printf("*** was found! If libgnutls-config was correct, then it is best\n");
  178. printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n");
  179. printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
  180. printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
  181. printf("*** required on your system.\n");
  182. printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n");
  183. printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n");
  184. printf("*** before re-running configure\n");
  185. }
  186. else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) )
  187. {
  188. printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION);
  189. printf("*** library (version %s)\n", gnutls_check_version(NULL) );
  190. }
  191. else
  192. {
  193. if ( gnutls_check_version( "$min_libgnutls_version" ) )
  194. {
  195. return 0;
  196. }
  197. else
  198. {
  199. printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n",
  200. gnutls_check_version(NULL) );
  201. printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n",
  202. "$min_libgnutls_version" );
  203. printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n");
  204. printf("*** \n");
  205. printf("*** If you have already installed a sufficiently new version, this error\n");
  206. printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n");
  207. printf("*** being found. The easiest way to fix this is to remove the old version\n");
  208. printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n");
  209. printf("*** correct copy of libgnutls-config. (In this case, you will have to\n");
  210. printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
  211. printf("*** so that the correct libraries are found at run-time))\n");
  212. }
  213. }
  214. return 1;
  215. }
  216. ],, no_libgnutls=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  217. CFLAGS="$ac_save_CFLAGS"
  218. LIBS="$ac_save_LIBS"
  219. fi
  220. if test "x$no_libgnutls" = x ; then
  221. AC_MSG_RESULT(yes)
  222. ifelse([$2], , :, [$2])
  223. else
  224. if test -f conf.libgnutlstest ; then
  225. :
  226. else
  227. AC_MSG_RESULT(no)
  228. fi
  229. if test "$LIBGNUTLS_CONFIG" = "no" ; then
  230. echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found"
  231. echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in"
  232. echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the"
  233. echo "*** full path to libgnutls-config."
  234. else
  235. if test -f conf.libgnutlstest ; then
  236. :
  237. else
  238. echo "*** Could not run libgnutls test program, checking why..."
  239. CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
  240. LIBS="$LIBS $LIBGNUTLS_LIBS"
  241. AC_TRY_LINK([
  242. #include <stdio.h>
  243. #include <stdlib.h>
  244. #include <string.h>
  245. #include <gnutls/gnutls.h>
  246. ], [ return !!gnutls_check_version(NULL); ],
  247. [ echo "*** The test program compiled, but did not run. This usually means"
  248. echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong"
  249. echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your"
  250. echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  251. echo "*** to the installed location Also, make sure you have run ldconfig if that"
  252. echo "*** is required on your system"
  253. echo "***"
  254. echo "*** If you have an old version installed, it is best to remove it, although"
  255. echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
  256. echo "***" ],
  257. [ echo "*** The test program failed to compile or link. See the file config.log for the"
  258. echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed"
  259. echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you"
  260. echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ])
  261. CFLAGS="$ac_save_CFLAGS"
  262. LIBS="$ac_save_LIBS"
  263. fi
  264. fi
  265. LIBGNUTLS_CFLAGS=""
  266. LIBGNUTLS_LIBS=""
  267. ifelse([$3], , :, [$3])
  268. fi
  269. rm -f conf.libgnutlstest
  270. AC_SUBST(LIBGNUTLS_CFLAGS)
  271. AC_SUBST(LIBGNUTLS_LIBS)
  272. ])
  273. # --- End libgnutls macro ---
  274. dnl Compile with GNUTLS
  275. AC_ARG_ENABLE(gnutls,
  276. AS_HELP_STRING(--enable-gnutls, Compile with GnuTLS))
  277. if test x$enable_gnutls = xyes; then
  278. # gnu tls
  279. #AM_PATH_LIBGNUTLS(1.0.0, , [
  280. PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.0.0], , [
  281. AC_DEFINE(USE_OPENSSL, 1, [use openssl for ssl session decryption instead of gnutls])
  282. AC_SUBST(USE_OPENSSL)
  283. ])
  284. fi
  285. # --- If no gnutls check for openssl ---
  286. if test "x$LIBGNUTLS_LIBS" = "x"; then
  287. AC_DEFINE(USE_OPENSSL, 1, [use openssl for ssl session decryption instead of gnutls])
  288. AC_SUBST(USE_OPENSSL)
  289. fi
  290. # --- End of If no gnutls check for openssl ---
  291. # Even if gnutls is required, we still need openssl for shallot.
  292. dnl ------------------------------------------------------
  293. dnl Where do you live, openssl? And how do we call you?
  294. AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssl_dir, [
  295. saved_LIBS="$LIBS"
  296. saved_LDFLAGS="$LDFLAGS"
  297. saved_CPPFLAGS="$CPPFLAGS"
  298. ssl_found=no
  299. for ssldir in $tryssldir "" $prefix /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/athena /usr/pkg /opt /opt/openssl ; do
  300. LDFLAGS="$saved_LDFLAGS"
  301. SSL_LIBS="-lssl -lcrypto"
  302. LIBS="$saved_LIBS $SSL_LIBS"
  303. # Skip the directory if it isn't there.
  304. if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
  305. continue;
  306. fi
  307. if test ! -z "$ssldir" ; then
  308. if test -d "$ssldir/lib" ; then
  309. LDFLAGS="-L$ssldir/lib $LDFLAGS"
  310. else
  311. LDFLAGS="-L$ssldir $LDFLAGS"
  312. fi
  313. if test -d "$ssldir/include" ; then
  314. CPPFLAGS="-I$ssldir/include $CPPFLAGS"
  315. else
  316. CPPFLAGS="-I$ssldir $CPPFLAGS"
  317. fi
  318. fi
  319. # Can I link it?
  320. AC_TRY_LINK([#include <openssl/rand.h>],
  321. [ RAND_add((void*)0,0,0); ],
  322. [ openssl_linked=yes ], [ openssl_linked=no ])
  323. if test $openssl_linked = yes; then
  324. if test ! -z "$ssldir" ; then
  325. ac_cv_openssl_dir=$ssldir
  326. else
  327. ac_cv_openssl_dir="(system)"
  328. fi
  329. ssl_found=yes
  330. break
  331. fi
  332. done
  333. LIBS="$saved_LIBS"
  334. LDFLAGS="$saved_LDFLAGS"
  335. CPPFLAGS="$saved_CPPFLAGS"
  336. if test $ssl_found = no ; then
  337. AC_MSG_ERROR([Could not find a linkable OpenSSL. You can specify an explicit path using --with-ssl-dir])
  338. fi
  339. ])
  340. saved_LIBS="$LIBS"
  341. SSL_LIBS="-lssl -lcrypto"
  342. LIBS="$saved_LIBS $SSL_LIBS"
  343. if test "$ac_cv_openssl_dir" != "(system)"; then
  344. if test -d "$ac_cv_openssl_dir/lib" ; then
  345. LDFLAGS="-L$ac_cv_openssl_dir/lib $LDFLAGS"
  346. ssl_libdir="$ac_cv_openssl_dir/lib"
  347. else
  348. LDFLAGS="-L$ac_cv_openssl_dir $LDFLAGS"
  349. ssl_libdir="$ac_cv_openssl_dir"
  350. fi
  351. if test -d "$ac_cv_openssl_dir/include" ; then
  352. CPPFLAGS="-I$ac_cv_openssl_dir/include $CPPFLAGS"
  353. else
  354. CPPFLAGS="-I$ac_cv_openssl_dir $CPPFLAGS"
  355. fi
  356. fi
  357. AC_CACHE_CHECK([whether we need extra options to link OpenSSL],
  358. ac_cv_openssl_linker_option, [
  359. saved_LDFLAGS="$LDFLAGS"
  360. ssl_runs=no
  361. linked_with=nothing
  362. for ssl_extra in "" "-Wl,-R$ssl_libdir" "-R$ssl_libdir" ; do
  363. LDFLAGS="$ssl_extra $saved_LDFLAGS"
  364. AC_TRY_RUN([
  365. #include <string.h>
  366. #include <openssl/rand.h>
  367. int main(void)
  368. {
  369. char a[2048];
  370. memset(a, 0, sizeof(a));
  371. RAND_add(a, sizeof(a), sizeof(a));
  372. return(RAND_status() <= 0);
  373. }
  374. ],
  375. openssl_runs=yes, openssl_runs=no)
  376. if test $openssl_runs = yes ; then
  377. if test "$linked_with" = nothing; then
  378. linked_with="$ssl_extra"
  379. fi
  380. AC_TRY_RUN([
  381. #include <openssl/opensslv.h>
  382. #include <openssl/crypto.h>
  383. int main(void) {
  384. return (OPENSSL_VERSION_NUMBER == SSLeay()) == 0;
  385. }],
  386. right_version=yes, right_version=no)
  387. if test "$right_version" = yes; then
  388. if test -z "$ssl_extra" ; then
  389. ac_cv_openssl_linker_option='(none)'
  390. else
  391. ac_cv_openssl_linker_option=$ssl_extra
  392. fi
  393. ssl_runs=yes
  394. break
  395. fi
  396. fi
  397. done
  398. if test $ssl_runs = no ; then
  399. if test "$linked_with" = 'nothing' ; then
  400. AC_MSG_ERROR([Found linkable OpenSSL in $ac_cv_openssl_dir, but it doesn't run, even with -R. Maybe specify another using --with-ssl-dir?])
  401. else
  402. if test -z "$linked_with" ; then
  403. ac_cv_openssl_linker_option='(none)'
  404. else
  405. ac_cv_openssl_linker_option=$linked_with
  406. fi
  407. AC_MSG_WARN([I managed to make OpenSSL link and run, but I couldn't make it link against the same version I found header files for.])
  408. fi
  409. fi
  410. LDFLAGS="$saved_LDFLAGS"
  411. ])
  412. if test "$ac_cv_openssl_linker_option" != '(none)' ; then
  413. LDFLAGS="$ac_cv_openssl_linker_option $LDFLAGS"
  414. fi
  415. LIBS="$saved_LIBS"
  416. # --- Decide which library to use for linking Tork ---
  417. # --- SSL will be used for shallot ---
  418. if test "x$LIBGNUTLS_LIBS" = "x"; then
  419. CRYPTO_LIBS=$SSL_LIBS
  420. else
  421. CRYPTO_LIBS=$LIBGNUTLS_LIBS
  422. fi
  423. AC_SUBST(CRYPTO_LIBS)
  424. AC_SUBST(SSL_LIBS)
  425. dnl - GeoIP
  426. AC_ARG_WITH(external-geoip,
  427. AC_HELP_STRING([--with-external-geoip], [Build against an external copy of GeoIP]))
  428. if test "x$with_external_geoip" != "xyes"; then
  429. GEOVERSION=1.4.2
  430. dnl PACKAGE=GeoIP
  431. GEOIP_VERSION_INFO=`echo $GEOVERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
  432. AC_SUBST(GEOIP_VERSION_INFO)
  433. AC_ARG_WITH(city,
  434. [ --with-city=\"no\" Enable/disable support for GeoIP City Edition. (yes)])
  435. if test "$with_city" = "no" ; then
  436. echo Disabling GeoIP City Edition support
  437. WITH_CITY=1
  438. else
  439. echo Enabling GeoIP City Edition support
  440. WITH_CITY=0
  441. fi
  442. AC_SUBST(WITH_CITY)
  443. else
  444. with_city=no
  445. AC_CHECK_HEADERS([GeoIP.h],,
  446. [AC_MSG_ERROR([External GeoIP requested but GeoIP not found.])])
  447. AC_CHECK_LIB([GeoIP], [GeoIP_new], [GEOIPLIB=-lGeoIP],
  448. [AC_MSG_ERROR([External GeoIP requested but GeoIP not found.])])
  449. fi
  450. AM_CONDITIONAL(WITH_CITY, test "$with_city" != "no")
  451. AM_CONDITIONAL([EXTERNAL_GEOIP], [test "x$with_external_geoip" = "xyes"])
  452. if test x$with_external_geoip = xyes; then
  453. AC_DEFINE(EXTERNAL_GEOIP, 1, "Using External GeoIP")
  454. fi
  455. dnl - libwhich
  456. which_cv_iberty=no
  457. AC_ARG_ENABLE(iberty,
  458. [ --disable-iberty do not try to find and use the iberty library],
  459. which_cv_iberty=$enableval)
  460. dnl Checks for programs.
  461. AC_PROG_CC
  462. AC_PROG_INSTALL
  463. AC_LANG_C
  464. AC_DEFUN([BASH_CHECK_GETPW_FUNCS],
  465. [AC_MSG_CHECKING(whether programs are able to redeclare getpw functions)
  466. AC_CACHE_VAL(bash_cv_can_redecl_getpw,
  467. [AC_TRY_COMPILE([#include <sys/types.h>
  468. #include <pwd.h>
  469. extern struct passwd *getpwent();
  470. extern struct passwd *getpwuid();
  471. extern struct passwd *getpwnam();],
  472. [struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");],
  473. bash_cv_can_redecl_getpw=yes,bash_cv_can_redecl_getpw=no)])
  474. AC_MSG_RESULT($bash_cv_can_redecl_getpw)
  475. if test $bash_cv_can_redecl_getpw = no; then
  476. AC_DEFINE([HAVE_GETPW_DECLS], 1, [Define this when you are able to redeclare getpw functions.])
  477. fi
  478. ])
  479. dnl Checks for header files.
  480. AC_HEADER_STDC
  481. AC_CHECK_FUNCS(strchr memcpy getopt_long)
  482. AC_CHECK_HEADERS(unistd.h string.h libiberty.h)
  483. AC_HEADER_STAT
  484. dnl Checks for typedefs, structures, and compiler characteristics.
  485. AC_C_CONST
  486. AC_TYPE_SIZE_T
  487. dnl Checks for library functions.
  488. AC_TYPE_GETGROUPS
  489. AC_CHECK_FUNCS(getcwd getwd)
  490. AC_DEFINE([NEED_XMALLOC], 1, [Define if you need xmalloc().])
  491. dnl Additional stuff needed for the tilde directory
  492. AC_CHECK_PROG(AR, ar, ar, ar)
  493. AC_PROG_RANLIB
  494. AC_CHECK_HEADERS(stdlib.h)
  495. BASH_CHECK_GETPW_FUNCS
  496. if test "x$CONFDIR" = "x"; then
  497. CONFDIR=`eval echo $sysconfdir`
  498. fi
  499. AC_SUBST(CONFDIR)
  500. AH_TEMPLATE([CONFDIR],[tork's configuration directory])
  501. AC_DEFINE_UNQUOTED(CONFDIR,"$CONFDIR")
  502. dnl Disable stuff that's not suitable for a Live CD
  503. AC_ARG_ENABLE(live-cd,
  504. AS_HELP_STRING(--enable-live-cd, Disable Features Unsuitable for LiveCD))
  505. if test x$enable_live_cd = xyes; then
  506. AC_DEFINE(LIVECD, 1, "Define to compile for a LiveCD")
  507. fi
  508. dnl Detect OS for Shallot compilation
  509. case "$host" in
  510. *-*-linux*) AC_DEFINE(LINUX_PORT, 1, "Shallot will compile for Linux") ;;
  511. *-*-freebsd*) AC_DEFINE(BSD, 1, "Shallot will compile for BSD") ;;
  512. *-*-netbsd*) AC_DEFINE(BSD, 1, "Shallot will compile for BSD") ;;
  513. *-*-openbsd*) AC_DEFINE(BSD, 1, "Shallot will compile for BSD") ;;
  514. *) AC_DEFINE(GENERIC, 1, "Shallot will compile for GENERIC") ;;
  515. esac
  516. #AC_DEFINE(_GNU_SOURCE, 1, "Shallot will compile with _GNU_SOURCE")
  517. # USE_GNU_SOURCE above is used instead and _GNU_SOURCE defined in shallot.
  518. dnl Check for presence of torsocks
  519. AC_CHECK_PROG(TORSOCKS, torsocks, torsocks)
  520. if test "${TORSOCKS}" = ""; then
  521. AC_MSG_ERROR('TorK requires torsocks: http://code.google.com/p/torsocks')
  522. fi
  523. dnl detect netfilter
  524. AC_CHECK_HEADERS(sys/types.h sys/socket.h)
  525. AC_CHECK_HEADERS(linux/netfilter_ipv4.h,
  526. linux_netfilter_ipv4=1, linux_netfilter_ipv4=0)
  527. failsafe_ok=0
  528. if test x$linux_netfilter_ipv4 = x1 ; then
  529. failsafe_ok=1
  530. fi
  531. if test x$failsafe_ok = x1 ; then
  532. AC_DEFINE(USE_FAILSAFE, 1, "Define to enable failsafe support")
  533. fi
  534. AC_CONFIG_FILES([src/menu/tork])
  535. KDE_CREATE_SUBDIRSLIST
  536. AC_CONFIG_FILES([ Makefile ])
  537. AC_CONFIG_FILES([ doc/Makefile ])
  538. AC_CONFIG_FILES([ doc/en/Makefile ])
  539. AC_CONFIG_FILES([ po/Makefile ])
  540. AC_CONFIG_FILES([ src/Makefile ])
  541. AC_CONFIG_FILES([ src/GeoIP-1.4.0/Makefile ])
  542. AC_CONFIG_FILES([ src/GeoIP-1.4.0/data/Makefile ])
  543. AC_CONFIG_FILES([ src/GeoIP-1.4.0/libGeoIP/Makefile ])
  544. AC_CONFIG_FILES([ src/arkollon/Makefile ])
  545. AC_CONFIG_FILES([ src/icons/Makefile ])
  546. AC_CONFIG_FILES([ src/konqplugin/Makefile ])
  547. AC_CONFIG_FILES([ src/menu/Makefile ])
  548. AC_CONFIG_FILES([ src/privoxytemplates/Makefile ])
  549. AC_CONFIG_FILES([ src/tor_ioslave/Makefile ])
  550. AC_CONFIG_FILES([ src/torkapplet/Makefile ])
  551. AC_CONFIG_FILES([ src/upnp/Makefile ])
  552. AC_OUTPUT
  553. # Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
  554. if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
  555. # And if so, warn when they don't match
  556. if test "$kde_libs_prefix" != "$given_prefix"; then
  557. # And if kde doesn't know about the prefix yet
  558. echo ":"`tde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
  559. if test $? -ne 0; then
  560. echo ""
  561. echo "Warning: you chose to install this package in $given_prefix,"
  562. echo "but KDE was found in $kde_libs_prefix."
  563. echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
  564. echo "that TDEDIRS contains it, e.g. export TDEDIRS=$given_prefix:$kde_libs_prefix"
  565. echo "Then restart KDE."
  566. echo ""
  567. fi
  568. fi
  569. fi
  570. if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
  571. echo ""
  572. echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
  573. echo "was not included. Therefore, GCC symbol visibility support remains disabled."
  574. echo ""
  575. echo "For better performance, consider including the Qt visibility supporting patch"
  576. echo "located at:"
  577. echo ""
  578. echo "http://bugs.kde.org/show_bug.cgi?id=109386"
  579. echo ""
  580. echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
  581. echo "everything will continue to work just fine without it."
  582. echo ""
  583. fi
  584. if test "$all_tests" = "bad"; then
  585. if test ! "$cache_file" = "/dev/null"; then
  586. echo ""
  587. echo "Please remove the file $cache_file after changing your setup"
  588. echo "so that configure will find the changes next time."
  589. echo ""
  590. fi
  591. else
  592. echo ""
  593. echo "Good - your configure finished. Start make now"
  594. echo ""
  595. fi