TorK – anonymity manager for TDE
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.in.in 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. #MIN_CONFIG(3.3.5)
  2. AM_INIT_AUTOMAKE(tork, 0.1)
  3. AC_C_BIGENDIAN
  4. AC_CHECK_KDEMAXPATHLEN
  5. # ---- Taken from KOffice ----------------------
  6. # --- Check for KDE 3.2 or 3.3 or 3.4 or 3.5 ---
  7. AC_MSG_CHECKING([for KDE version])
  8. AC_LANG_SAVE
  9. AC_LANG_CPLUSPLUS
  10. tdeversion_save_CXXFLAGS="$CXXFLAGS"
  11. tdeversion_safe_LIBS="$LIBS"
  12. LIBS="$LIBS $X_EXTRA_LIBS"
  13. CXXFLAGS="$CXXFLAGS $all_includes"
  14. AC_COMPILE_IFELSE([
  15. #include <tdeversion.h>
  16. #if ! ( KDE_IS_VERSION( 3, 2, 90 ) )
  17. #error KDE 3.2
  18. #endif
  19. ],
  20. need_kde32_compat="no"
  21. ,
  22. need_kde32_compat="yes"
  23. )
  24. AC_COMPILE_IFELSE([
  25. #include <tdeversion.h>
  26. #if ! ( KDE_IS_VERSION( 3, 3, 90 ) )
  27. #error KDE 3.3
  28. #endif
  29. ],
  30. need_kde33_compat="no"
  31. ,
  32. need_kde33_compat="yes"
  33. )
  34. AC_COMPILE_IFELSE([
  35. #include <tdeversion.h>
  36. #if ! ( KDE_IS_VERSION( 3, 4, 90 ) )
  37. #error KDE 3.4
  38. #endif
  39. ],
  40. need_kde34_compat="no"
  41. ,
  42. need_kde34_compat="yes"
  43. )
  44. AC_COMPILE_IFELSE([
  45. #include <tdeversion.h>
  46. #if ! ( KDE_IS_VERSION( 3, 5, 2 ) )
  47. #error KDE 3.5.x (x < 2)
  48. #endif
  49. ],
  50. need_kde351_compat="no"
  51. ,
  52. need_kde351_compat="yes"
  53. )
  54. CXXFLAGS="$tdeversion_save_CXXFLAGS"
  55. LIBS="$tdeversion_safe_LIBS"
  56. AC_LANG_RESTORE
  57. if test "$need_kde32_compat" = "yes"; then
  58. AC_MSG_ERROR([You have KDE 3.2.x. TorK needs KDE 3.5.1 or greater.])
  59. else
  60. if test "$need_kde33_compat" = "yes"; then
  61. AC_MSG_ERROR([You have KDE 3.3.x TorK needs KDE 3.5.1 or greater.])
  62. else
  63. if test "$need_kde34_compat" = "yes"; then
  64. AC_MSG_ERROR([You have KDE 3.4.x TorK needs KDE 3.5.1 or greater.])
  65. else
  66. if test "$need_kde351_compat" = "yes"; then
  67. AC_MSG_RESULT([KDE 3.5.x (x >=1) or SVN trunk])
  68. else
  69. AC_MSG_RESULT([KDE 3.5.x (x >=2) or SVN trunk])
  70. fi
  71. fi
  72. fi
  73. fi
  74. # --- End KDE 3.2 check ---
  75. # --- Begin libgnutls macro ---
  76. dnl Autoconf macros for libgnutls
  77. dnl $id$
  78. # Modified for LIBGNUTLS -- nmav
  79. # Configure paths for LIBGCRYPT
  80. # Shamelessly stolen from the one of XDELTA by Owen Taylor
  81. # Werner Koch 99-12-09
  82. dnl AM_PATH_LIBGNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
  83. dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS
  84. dnl
  85. AC_DEFUN([AM_PATH_LIBGNUTLS],
  86. [dnl
  87. dnl Get the cflags and libraries from the libgnutls-config script
  88. dnl
  89. AC_ARG_WITH(libgnutls-prefix,
  90. [ --with-libgnutls-prefix=PFX Prefix where libgnutls is installed (optional)],
  91. libgnutls_config_prefix="$withval", libgnutls_config_prefix="")
  92. if test x$libgnutls_config_prefix != x ; then
  93. if test x${LIBGNUTLS_CONFIG+set} != xset ; then
  94. LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config
  95. fi
  96. fi
  97. AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no)
  98. min_libgnutls_version=ifelse([$1], ,0.1.0,$1)
  99. AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version)
  100. no_libgnutls=""
  101. if test "$LIBGNUTLS_CONFIG" = "no" ; then
  102. no_libgnutls=yes
  103. else
  104. LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
  105. LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
  106. libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
  107. ac_save_CFLAGS="$CFLAGS"
  108. ac_save_LIBS="$LIBS"
  109. CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
  110. LIBS="$LIBS $LIBGNUTLS_LIBS"
  111. dnl
  112. dnl Now check if the installed libgnutls is sufficiently new. Also sanity
  113. dnl checks the results of libgnutls-config to some extent
  114. dnl
  115. rm -f conf.libgnutlstest
  116. AC_TRY_RUN([
  117. #include <stdio.h>
  118. #include <stdlib.h>
  119. #include <string.h>
  120. #include <gnutls/gnutls.h>
  121. int
  122. main ()
  123. {
  124. system ("touch conf.libgnutlstest");
  125. if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) )
  126. {
  127. printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n",
  128. "$libgnutls_config_version", gnutls_check_version(NULL) );
  129. printf("*** was found! If libgnutls-config was correct, then it is best\n");
  130. printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n");
  131. printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
  132. printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
  133. printf("*** required on your system.\n");
  134. printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n");
  135. printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n");
  136. printf("*** before re-running configure\n");
  137. }
  138. else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) )
  139. {
  140. printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION);
  141. printf("*** library (version %s)\n", gnutls_check_version(NULL) );
  142. }
  143. else
  144. {
  145. if ( gnutls_check_version( "$min_libgnutls_version" ) )
  146. {
  147. return 0;
  148. }
  149. else
  150. {
  151. printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n",
  152. gnutls_check_version(NULL) );
  153. printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n",
  154. "$min_libgnutls_version" );
  155. printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n");
  156. printf("*** \n");
  157. printf("*** If you have already installed a sufficiently new version, this error\n");
  158. printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n");
  159. printf("*** being found. The easiest way to fix this is to remove the old version\n");
  160. printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n");
  161. printf("*** correct copy of libgnutls-config. (In this case, you will have to\n");
  162. printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
  163. printf("*** so that the correct libraries are found at run-time))\n");
  164. }
  165. }
  166. return 1;
  167. }
  168. ],, no_libgnutls=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  169. CFLAGS="$ac_save_CFLAGS"
  170. LIBS="$ac_save_LIBS"
  171. fi
  172. if test "x$no_libgnutls" = x ; then
  173. AC_MSG_RESULT(yes)
  174. ifelse([$2], , :, [$2])
  175. else
  176. if test -f conf.libgnutlstest ; then
  177. :
  178. else
  179. AC_MSG_RESULT(no)
  180. fi
  181. if test "$LIBGNUTLS_CONFIG" = "no" ; then
  182. echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found"
  183. echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in"
  184. echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the"
  185. echo "*** full path to libgnutls-config."
  186. else
  187. if test -f conf.libgnutlstest ; then
  188. :
  189. else
  190. echo "*** Could not run libgnutls test program, checking why..."
  191. CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
  192. LIBS="$LIBS $LIBGNUTLS_LIBS"
  193. AC_TRY_LINK([
  194. #include <stdio.h>
  195. #include <stdlib.h>
  196. #include <string.h>
  197. #include <gnutls/gnutls.h>
  198. ], [ return !!gnutls_check_version(NULL); ],
  199. [ echo "*** The test program compiled, but did not run. This usually means"
  200. echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong"
  201. echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your"
  202. echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  203. echo "*** to the installed location Also, make sure you have run ldconfig if that"
  204. echo "*** is required on your system"
  205. echo "***"
  206. echo "*** If you have an old version installed, it is best to remove it, although"
  207. echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
  208. echo "***" ],
  209. [ echo "*** The test program failed to compile or link. See the file config.log for the"
  210. echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed"
  211. echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you"
  212. echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ])
  213. CFLAGS="$ac_save_CFLAGS"
  214. LIBS="$ac_save_LIBS"
  215. fi
  216. fi
  217. LIBGNUTLS_CFLAGS=""
  218. LIBGNUTLS_LIBS=""
  219. ifelse([$3], , :, [$3])
  220. fi
  221. rm -f conf.libgnutlstest
  222. AC_SUBST(LIBGNUTLS_CFLAGS)
  223. AC_SUBST(LIBGNUTLS_LIBS)
  224. ])
  225. # --- End libgnutls macro ---
  226. dnl Compile with GNUTLS
  227. AC_ARG_ENABLE(gnutls,
  228. AS_HELP_STRING(--enable-gnutls, Compile with GnuTLS))
  229. if test x$enable_gnutls = xyes; then
  230. # gnu tls
  231. #AM_PATH_LIBGNUTLS(1.0.0, , [
  232. PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.0.0], , [
  233. AC_DEFINE(USE_OPENSSL, 1, [use openssl for ssl session decryption instead of gnutls])
  234. AC_SUBST(USE_OPENSSL)
  235. ])
  236. fi
  237. # --- If no gnutls check for openssl ---
  238. if test "x$LIBGNUTLS_LIBS" = "x"; then
  239. AC_DEFINE(USE_OPENSSL, 1, [use openssl for ssl session decryption instead of gnutls])
  240. AC_SUBST(USE_OPENSSL)
  241. fi
  242. # --- End of If no gnutls check for openssl ---
  243. # Even if gnutls is required, we still need openssl for shallot.
  244. dnl ------------------------------------------------------
  245. dnl Where do you live, openssl? And how do we call you?
  246. AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssl_dir, [
  247. saved_LIBS="$LIBS"
  248. saved_LDFLAGS="$LDFLAGS"
  249. saved_CPPFLAGS="$CPPFLAGS"
  250. ssl_found=no
  251. 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
  252. LDFLAGS="$saved_LDFLAGS"
  253. SSL_LIBS="-lssl -lcrypto"
  254. LIBS="$saved_LIBS $SSL_LIBS"
  255. # Skip the directory if it isn't there.
  256. if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
  257. continue;
  258. fi
  259. if test ! -z "$ssldir" ; then
  260. if test -d "$ssldir/lib" ; then
  261. LDFLAGS="-L$ssldir/lib $LDFLAGS"
  262. else
  263. LDFLAGS="-L$ssldir $LDFLAGS"
  264. fi
  265. if test -d "$ssldir/include" ; then
  266. CPPFLAGS="-I$ssldir/include $CPPFLAGS"
  267. else
  268. CPPFLAGS="-I$ssldir $CPPFLAGS"
  269. fi
  270. fi
  271. # Can I link it?
  272. AC_TRY_LINK([#include <openssl/rand.h>],
  273. [ RAND_add((void*)0,0,0); ],
  274. [ openssl_linked=yes ], [ openssl_linked=no ])
  275. if test $openssl_linked = yes; then
  276. if test ! -z "$ssldir" ; then
  277. ac_cv_openssl_dir=$ssldir
  278. else
  279. ac_cv_openssl_dir="(system)"
  280. fi
  281. ssl_found=yes
  282. break
  283. fi
  284. done
  285. LIBS="$saved_LIBS"
  286. LDFLAGS="$saved_LDFLAGS"
  287. CPPFLAGS="$saved_CPPFLAGS"
  288. if test $ssl_found = no ; then
  289. AC_MSG_ERROR([Could not find a linkable OpenSSL. You can specify an explicit path using --with-ssl-dir])
  290. fi
  291. ])
  292. saved_LIBS="$LIBS"
  293. SSL_LIBS="-lssl -lcrypto"
  294. LIBS="$saved_LIBS $SSL_LIBS"
  295. if test "$ac_cv_openssl_dir" != "(system)"; then
  296. if test -d "$ac_cv_openssl_dir/lib" ; then
  297. LDFLAGS="-L$ac_cv_openssl_dir/lib $LDFLAGS"
  298. ssl_libdir="$ac_cv_openssl_dir/lib"
  299. else
  300. LDFLAGS="-L$ac_cv_openssl_dir $LDFLAGS"
  301. ssl_libdir="$ac_cv_openssl_dir"
  302. fi
  303. if test -d "$ac_cv_openssl_dir/include" ; then
  304. CPPFLAGS="-I$ac_cv_openssl_dir/include $CPPFLAGS"
  305. else
  306. CPPFLAGS="-I$ac_cv_openssl_dir $CPPFLAGS"
  307. fi
  308. fi
  309. AC_CACHE_CHECK([whether we need extra options to link OpenSSL],
  310. ac_cv_openssl_linker_option, [
  311. saved_LDFLAGS="$LDFLAGS"
  312. ssl_runs=no
  313. linked_with=nothing
  314. for ssl_extra in "" "-Wl,-R$ssl_libdir" "-R$ssl_libdir" ; do
  315. LDFLAGS="$ssl_extra $saved_LDFLAGS"
  316. AC_TRY_RUN([
  317. #include <string.h>
  318. #include <openssl/rand.h>
  319. int main(void)
  320. {
  321. char a[2048];
  322. memset(a, 0, sizeof(a));
  323. RAND_add(a, sizeof(a), sizeof(a));
  324. return(RAND_status() <= 0);
  325. }
  326. ],
  327. openssl_runs=yes, openssl_runs=no)
  328. if test $openssl_runs = yes ; then
  329. if test "$linked_with" = nothing; then
  330. linked_with="$ssl_extra"
  331. fi
  332. AC_TRY_RUN([
  333. #include <openssl/opensslv.h>
  334. #include <openssl/crypto.h>
  335. int main(void) {
  336. return (OPENSSL_VERSION_NUMBER == SSLeay()) == 0;
  337. }],
  338. right_version=yes, right_version=no)
  339. if test "$right_version" = yes; then
  340. if test -z "$ssl_extra" ; then
  341. ac_cv_openssl_linker_option='(none)'
  342. else
  343. ac_cv_openssl_linker_option=$ssl_extra
  344. fi
  345. ssl_runs=yes
  346. break
  347. fi
  348. fi
  349. done
  350. if test $ssl_runs = no ; then
  351. if test "$linked_with" = 'nothing' ; then
  352. 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?])
  353. else
  354. if test -z "$linked_with" ; then
  355. ac_cv_openssl_linker_option='(none)'
  356. else
  357. ac_cv_openssl_linker_option=$linked_with
  358. fi
  359. 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.])
  360. fi
  361. fi
  362. LDFLAGS="$saved_LDFLAGS"
  363. ])
  364. if test "$ac_cv_openssl_linker_option" != '(none)' ; then
  365. LDFLAGS="$ac_cv_openssl_linker_option $LDFLAGS"
  366. fi
  367. LIBS="$saved_LIBS"
  368. # --- Decide which library to use for linking Tork ---
  369. # --- SSL will be used for shallot ---
  370. if test "x$LIBGNUTLS_LIBS" = "x"; then
  371. CRYPTO_LIBS=$SSL_LIBS
  372. else
  373. CRYPTO_LIBS=$LIBGNUTLS_LIBS
  374. fi
  375. AC_SUBST(CRYPTO_LIBS)
  376. AC_SUBST(SSL_LIBS)
  377. dnl - GeoIP
  378. AC_ARG_WITH(external-geoip,
  379. AC_HELP_STRING([--with-external-geoip], [Build against an external copy of GeoIP]))
  380. if test "x$with_external_geoip" != "xyes"; then
  381. GEOVERSION=1.4.2
  382. dnl PACKAGE=GeoIP
  383. GEOIP_VERSION_INFO=`echo $GEOVERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
  384. AC_SUBST(GEOIP_VERSION_INFO)
  385. AC_ARG_WITH(city,
  386. [ --with-city=\"no\" Enable/disable support for GeoIP City Edition. (yes)])
  387. if test "$with_city" = "no" ; then
  388. echo Disabling GeoIP City Edition support
  389. WITH_CITY=1
  390. else
  391. echo Enabling GeoIP City Edition support
  392. WITH_CITY=0
  393. fi
  394. AC_SUBST(WITH_CITY)
  395. else
  396. with_city=no
  397. AC_CHECK_HEADERS([GeoIP.h],,
  398. [AC_MSG_ERROR([External GeoIP requested but GeoIP not found.])])
  399. AC_CHECK_LIB([GeoIP], [GeoIP_new], [GEOIPLIB=-lGeoIP],
  400. [AC_MSG_ERROR([External GeoIP requested but GeoIP not found.])])
  401. fi
  402. AM_CONDITIONAL(WITH_CITY, test "$with_city" != "no")
  403. AM_CONDITIONAL([EXTERNAL_GEOIP], [test "x$with_external_geoip" = "xyes"])
  404. if test x$with_external_geoip = xyes; then
  405. AC_DEFINE(EXTERNAL_GEOIP, 1, "Using External GeoIP")
  406. fi
  407. dnl - libwhich
  408. which_cv_iberty=no
  409. AC_ARG_ENABLE(iberty,
  410. [ --disable-iberty do not try to find and use the iberty library],
  411. which_cv_iberty=$enableval)
  412. dnl Checks for programs.
  413. AC_PROG_CC
  414. AC_PROG_INSTALL
  415. AC_LANG_C
  416. AC_DEFUN([BASH_CHECK_GETPW_FUNCS],
  417. [AC_MSG_CHECKING(whether programs are able to redeclare getpw functions)
  418. AC_CACHE_VAL(bash_cv_can_redecl_getpw,
  419. [AC_TRY_COMPILE([#include <sys/types.h>
  420. #include <pwd.h>
  421. extern struct passwd *getpwent();
  422. extern struct passwd *getpwuid();
  423. extern struct passwd *getpwnam();],
  424. [struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");],
  425. bash_cv_can_redecl_getpw=yes,bash_cv_can_redecl_getpw=no)])
  426. AC_MSG_RESULT($bash_cv_can_redecl_getpw)
  427. if test $bash_cv_can_redecl_getpw = no; then
  428. AC_DEFINE([HAVE_GETPW_DECLS], 1, [Define this when you are able to redeclare getpw functions.])
  429. fi
  430. ])
  431. dnl Checks for header files.
  432. AC_HEADER_STDC
  433. AC_CHECK_FUNCS(strchr memcpy getopt_long)
  434. AC_CHECK_HEADERS(unistd.h string.h libiberty.h)
  435. AC_HEADER_STAT
  436. dnl Checks for typedefs, structures, and compiler characteristics.
  437. AC_C_CONST
  438. AC_TYPE_SIZE_T
  439. dnl Checks for library functions.
  440. AC_TYPE_GETGROUPS
  441. AC_CHECK_FUNCS(getcwd getwd)
  442. AC_DEFINE([NEED_XMALLOC], 1, [Define if you need xmalloc().])
  443. dnl Additional stuff needed for the tilde directory
  444. AC_CHECK_PROG(AR, ar, ar, ar)
  445. AC_PROG_RANLIB
  446. AC_CHECK_HEADERS(stdlib.h)
  447. BASH_CHECK_GETPW_FUNCS
  448. if test "x$CONFDIR" = "x"; then
  449. CONFDIR=`eval echo $sysconfdir`
  450. fi
  451. AC_SUBST(CONFDIR)
  452. AH_TEMPLATE([CONFDIR],[tork's configuration directory])
  453. AC_DEFINE_UNQUOTED(CONFDIR,"$CONFDIR")
  454. dnl Disable stuff that's not suitable for a Live CD
  455. AC_ARG_ENABLE(live-cd,
  456. AS_HELP_STRING(--enable-live-cd, Disable Features Unsuitable for LiveCD))
  457. if test x$enable_live_cd = xyes; then
  458. AC_DEFINE(LIVECD, 1, "Define to compile for a LiveCD")
  459. fi
  460. dnl Detect OS for Shallot compilation
  461. case "$host" in
  462. *-*-linux*) AC_DEFINE(LINUX_PORT, 1, "Shallot will compile for Linux") ;;
  463. *-*-freebsd*) AC_DEFINE(BSD, 1, "Shallot will compile for BSD") ;;
  464. *-*-netbsd*) AC_DEFINE(BSD, 1, "Shallot will compile for BSD") ;;
  465. *-*-openbsd*) AC_DEFINE(BSD, 1, "Shallot will compile for BSD") ;;
  466. *) AC_DEFINE(GENERIC, 1, "Shallot will compile for GENERIC") ;;
  467. esac
  468. #AC_DEFINE(_GNU_SOURCE, 1, "Shallot will compile with _GNU_SOURCE")
  469. # USE_GNU_SOURCE above is used instead and _GNU_SOURCE defined in shallot.
  470. dnl Check for presence of torsocks
  471. AC_CHECK_PROG(TORSOCKS, torsocks, torsocks)
  472. if test "${TORSOCKS}" = ""; then
  473. AC_MSG_ERROR('TorK requires torsocks: http://code.google.com/p/torsocks')
  474. fi
  475. dnl detect netfilter
  476. AC_CHECK_HEADERS(sys/types.h sys/socket.h)
  477. AC_CHECK_HEADERS(linux/netfilter_ipv4.h,
  478. linux_netfilter_ipv4=1, linux_netfilter_ipv4=0)
  479. failsafe_ok=0
  480. if test x$linux_netfilter_ipv4 = x1 ; then
  481. failsafe_ok=1
  482. fi
  483. if test x$failsafe_ok = x1 ; then
  484. AC_DEFINE(USE_FAILSAFE, 1, "Define to enable failsafe support")
  485. fi
  486. AC_CONFIG_FILES([src/menu/tork])