configure.in 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. dnl $Id$
  2. dnl Copyright (c) 2001-2004, Roger Dingledine
  3. dnl Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
  4. dnl See LICENSE for licensing information
  5. AC_INIT
  6. AM_INIT_AUTOMAKE(tor, 0.1.1.13-alpha-cvs)
  7. AM_CONFIG_HEADER(orconfig.h)
  8. AC_CANONICAL_HOST
  9. if test -f /etc/redhat-release; then
  10. CFLAGS="$CFLAGS -I/usr/kerberos/include"
  11. fi
  12. AC_ARG_ENABLE(debug,
  13. AC_HELP_STRING(--enable-debug, compile with debugging info),
  14. [if test x$enableval = xyes; then
  15. CFLAGS="$CFLAGS -g"
  16. fi])
  17. AC_ARG_ENABLE(threads,
  18. AC_HELP_STRING(--disable-threads, disable multi-threading support))
  19. if test x$enable_threads = x; then
  20. case $host in
  21. *-*-netbsd* | *-*-openbsd* )
  22. # Don't try multithreading on netbsd -- there is no threadsafe DNS
  23. # lookup function there.
  24. AC_MSG_NOTICE([You are running OpenBSD or NetBSD; I am assuming that
  25. getaddrinfo is not threadsafe here, so I will disable threads.])
  26. enable_threads="no";;
  27. *-*-solaris* )
  28. # Don't try multithreading on solaris -- cpuworkers seem to lock.
  29. AC_MSG_NOTICE([You are running Solaris; Sometimes threading makes
  30. cpu workers lock up here, so I will disable threads.])
  31. enable_threads="no";;
  32. *)
  33. enable_threads="yes";;
  34. esac
  35. fi
  36. if test $enable_threads = "yes"; then
  37. AC_DEFINE(ENABLE_THREADS, 1, [Defined if we will try to use multithreading])
  38. fi
  39. case $host in
  40. *-*-solaris* )
  41. AC_DEFINE(_REENTRANT, 1, [Define on some platforms to activate x_r() functions in time.h])
  42. ;;
  43. esac
  44. AC_PROG_CC
  45. AC_PROG_MAKE_SET
  46. AC_PROG_RANLIB
  47. # The big search for OpenSSL
  48. # copied from openssh's configure.ac
  49. tryssldir=""
  50. AC_ARG_WITH(ssl-dir,
  51. [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
  52. [
  53. if test "x$withval" != "xno" ; then
  54. tryssldir=$withval
  55. fi
  56. ]
  57. )
  58. trylibeventdir=""
  59. AC_ARG_WITH(libevent-dir,
  60. [ --with-libevent-dir=PATH Specify path to Libevent installation ],
  61. [
  62. if test "x$withval" != "xno" ; then
  63. trylibeventdir=$withval
  64. fi
  65. ]
  66. )
  67. TORUSER=_tor
  68. AC_ARG_WITH(tor-user,
  69. [ --with-tor-user=NAME Specify username for tor daemon ],
  70. [
  71. TORUSER=$withval
  72. ]
  73. )
  74. AC_SUBST(TORUSER)
  75. TORGROUP=_tor
  76. AC_ARG_WITH(tor-group,
  77. [ --with-tor-group=NAME Specify group name for tor daemon ],
  78. [
  79. TORGROUP=$withval
  80. ]
  81. )
  82. AC_SUBST(TORGROUP)
  83. AC_SEARCH_LIBS(socket, [socket])
  84. AC_SEARCH_LIBS(gethostbyname, [nsl])
  85. AC_SEARCH_LIBS(dlopen, [dl])
  86. if test $enable_threads = "yes"; then
  87. AC_SEARCH_LIBS(pthread_create, [pthread])
  88. AC_SEARCH_LIBS(pthread_detach, [pthread])
  89. fi
  90. dnl ------------------------------------------------------
  91. dnl Where do you live, libevent? And how do we call you?
  92. AC_CACHE_CHECK([for libevent directory], ac_cv_libevent_dir, [
  93. saved_LIBS="$LIBS"
  94. saved_LDFLAGS="$LDFLAGS"
  95. le_found=no
  96. for ledir in $trylibeventdir "" $prefix /usr/local ; do
  97. LDFLAGS="$saved_LDFLAGS"
  98. LIBS="$saved_LIBS -levent"
  99. # Skip the directory if it isn't there.
  100. if test ! -z "$ledir" -a ! -d "$ledir" ; then
  101. continue;
  102. fi
  103. if test ! -z "$ledir" ; then
  104. if test -d "$ledir/lib" ; then
  105. LDFLAGS="-L$ledir/lib $LDFLAGS"
  106. else
  107. LDFLAGS="-L$ledir $LDFLAGS"
  108. fi
  109. fi
  110. # Can I link it?
  111. AC_TRY_LINK([], [ void *event_init(void); event_init(); ],
  112. [ libevent_linked=yes ], [ libevent_linked=no ])
  113. if test $libevent_linked = yes; then
  114. if test ! -z "$ledir" ; then
  115. ac_cv_libevent_dir=$ledir
  116. else
  117. ac_cv_libevent_dir="(system)"
  118. fi
  119. le_found=yes
  120. break
  121. fi
  122. done
  123. LIBS="$saved_LIBS"
  124. LDFLAGS="$saved_LDFLAGS"
  125. if test $le_found = no ; then
  126. AC_MSG_ERROR([Could not find a linkable libevent. You can specify an explicit path using --with-libevent-dir])
  127. fi
  128. ])
  129. LIBS="$LIBS -levent"
  130. if test $ac_cv_libevent_dir != "(system)"; then
  131. if test -d "$ac_cv_libevent_dir/lib" ; then
  132. LDFLAGS="-L$ac_cv_libevent_dir/lib $LDFLAGS"
  133. le_libdir="$ac_cv_libevent_dir/lib"
  134. else
  135. LDFLAGS="-L$ac_cv_libevent_dir $LDFLAGS"
  136. le_libdir="$ac_cv_libevent_dir"
  137. fi
  138. if test -d "$ac_cv_libevent_dir/include" ; then
  139. CPPFLAGS="-I$ac_cv_libevent_dir/include $CPPFLAGS"
  140. else
  141. CPPFLAGS="-I$ac_cv_libevent_dir $CPPFLAGS"
  142. fi
  143. fi
  144. AC_CACHE_CHECK([whether we need extra options to link libevent],
  145. ac_cv_libevent_linker_option, [
  146. saved_LDFLAGS="$LDFLAGS"
  147. le_runs=no
  148. for le_extra in "" "-Wl,-R$le_libdir" "-R$le_libdir" ; do
  149. LDFLAGS="$le_extra $saved_LDFLAGS"
  150. AC_TRY_RUN([void *event_init(void);
  151. int main(int c, char **v) {
  152. event_init(); return 0;
  153. }],
  154. libevent_runs=yes, libevent_runs=no)
  155. if test $libevent_runs = yes ; then
  156. if test -z "$le_extra" ; then
  157. ac_cv_libevent_linker_option='(none)'
  158. else
  159. ac_cv_libevent_linker_option=$le_extra
  160. fi
  161. le_runs=yes
  162. break
  163. fi
  164. done
  165. if test le_runs = no ; then
  166. AC_MSG_ERROR([Found linkable libevent in $ac_cv_libevent_dir, but it doesn't run, even with -R. Maybe specify another using --with-libevent-dir?])
  167. fi
  168. LDFLAGS="$saved_LDFLAGS"
  169. ])
  170. if test $ac_cv_libevent_linker_option != '(none)' ; then
  171. LDFLAGS="$ac_cv_libevent_linker_option $LDFLAGS"
  172. fi
  173. dnl ------------------------------------------------------
  174. dnl Where do you live, openssl? And how do we call you?
  175. AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssl_dir, [
  176. saved_LIBS="$LIBS"
  177. saved_LDFLAGS="$LDFLAGS"
  178. ssl_found=no
  179. 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
  180. LDFLAGS="$saved_LDFLAGS"
  181. LIBS="$saved_LIBS -lssl -lcrypto"
  182. # Skip the directory if it isn't there.
  183. if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
  184. continue;
  185. fi
  186. if test ! -z "$ssldir" ; then
  187. if test -d "$ssldir/lib" ; then
  188. LDFLAGS="-L$ssldir/lib $LDFLAGS"
  189. else
  190. LDFLAGS="-L$ssldir $LDFLAGS"
  191. fi
  192. fi
  193. # Can I link it?
  194. AC_TRY_LINK([],
  195. [ void RAND_add(const void *, int, double); RAND_add((void*)0,0,0); ],
  196. [ openssl_linked=yes ], [ openssl_linked=no ])
  197. if test $openssl_linked = yes; then
  198. if test ! -z "$ssldir" ; then
  199. ac_cv_openssl_dir=$ssldir
  200. else
  201. ac_cv_openssl_dir="(system)"
  202. fi
  203. ssl_found=yes
  204. break
  205. fi
  206. done
  207. LIBS="$saved_LIBS"
  208. LDFLAGS="$saved_LDFLAGS"
  209. if test $ssl_found = no ; then
  210. AC_MSG_ERROR([Could not find a linkable OpenSSL. You can specify an explicit path using --with-ssl-dir])
  211. fi
  212. ])
  213. LIBS="$LIBS -lssl -lcrypto"
  214. if test "$ac_cv_openssl_dir" != "(system)"; then
  215. if test -d "$ac_cv_openssl_dir/lib" ; then
  216. LDFLAGS="-L$ac_cv_openssl_dir/lib $LDFLAGS"
  217. ssl_libdir="$ac_cv_openssl_dir/lib"
  218. else
  219. LDFLAGS="-L$ac_cv_openssl_dir $LDFLAGS"
  220. ssl_libdir="$ac_cv_openssl_dir"
  221. fi
  222. if test -d "$ac_cv_openssl_dir/include" ; then
  223. CPPFLAGS="-I$ac_cv_openssl_dir/include $CPPFLAGS"
  224. else
  225. CPPFLAGS="-I$ac_cv_openssl_dir $CPPFLAGS"
  226. fi
  227. fi
  228. AC_CACHE_CHECK([whether we need extra options to link OpenSSL],
  229. ac_cv_openssl_linker_option, [
  230. saved_LDFLAGS="$LDFLAGS"
  231. ssl_runs=no
  232. for ssl_extra in "" "-Wl,-R$ssl_libdir" "-R$ssl_libdir" ; do
  233. LDFLAGS="$ssl_extra $saved_LDFLAGS"
  234. AC_TRY_RUN([
  235. #include <string.h>
  236. #include <openssl/rand.h>
  237. int main(void)
  238. {
  239. char a[2048];
  240. memset(a, 0, sizeof(a));
  241. RAND_add(a, sizeof(a), sizeof(a));
  242. return(RAND_status() <= 0);
  243. }
  244. ],
  245. openssl_runs=yes, openssl_runs=no)
  246. if test $openssl_runs = yes ; then
  247. if test -z "$ssl_extra" ; then
  248. ac_cv_openssl_linker_option='(none)'
  249. else
  250. ac_cv_openssl_linker_option=$ssl_extra
  251. fi
  252. ssl_runs=yes
  253. break
  254. fi
  255. done
  256. if test ssl_runs = no ; then
  257. 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?])
  258. fi
  259. LDFLAGS="$saved_LDFLAGS"
  260. ])
  261. if test $ac_cv_openssl_linker_option != '(none)' ; then
  262. LDFLAGS="$ac_cv_openssl_linker_option $LDFLAGS"
  263. fi
  264. dnl Make sure to enable support for large off_t if avalable.
  265. AC_SYS_LARGEFILE
  266. dnl The warning message here is no longer strictly accurate.
  267. AC_CHECK_HEADERS(unistd.h string.h signal.h netdb.h ctype.h sys/stat.h sys/types.h fcntl.h sys/fcntl.h sys/ioctl.h sys/socket.h sys/time.h netinet/in.h arpa/inet.h errno.h assert.h time.h pwd.h grp.h, , AC_MSG_WARN(some headers were not found, compilation may fail))
  268. AC_CHECK_HEADERS(event.h, , AC_MSG_ERROR(Libevent header (event.h) not found. Tor requires libevent to build.))
  269. AC_CHECK_HEADERS(zlib.h, , AC_MSG_ERROR(Zlib header (zlib.h) not found. Tor requires zlib to build. You may need to install a zlib development package.))
  270. dnl These headers are not essential
  271. AC_CHECK_HEADERS(stdint.h sys/types.h inttypes.h sys/param.h sys/wait.h sys/limits.h netinet/in.h arpa/inet.h machine/limits.h syslog.h sys/time.h sys/resource.h stddef.h inttypes.h utime.h sys/utime.h)
  272. AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime getrlimit setrlimit strlcat strlcpy strtoull getpwnam getpwuid ftello getaddrinfo localtime_r gmtime_r event_get_version event_get_method event_set_log_callback memmem)
  273. if test $enable_threads = "yes"; then
  274. AC_CHECK_HEADERS(pthread.h)
  275. AC_CHECK_FUNCS(pthread_create)
  276. fi
  277. AC_FUNC_FSEEKO
  278. AC_CHECK_MEMBERS([struct timeval.tv_sec])
  279. dnl In case we aren't given a working stdint.h, we'll need to grow our own.
  280. dnl Watch out.
  281. AC_CHECK_SIZEOF(int8_t)
  282. AC_CHECK_SIZEOF(int16_t)
  283. AC_CHECK_SIZEOF(int32_t)
  284. AC_CHECK_SIZEOF(int64_t)
  285. AC_CHECK_SIZEOF(uint8_t)
  286. AC_CHECK_SIZEOF(uint16_t)
  287. AC_CHECK_SIZEOF(uint32_t)
  288. AC_CHECK_SIZEOF(uint64_t)
  289. AC_CHECK_SIZEOF(intptr_t)
  290. AC_CHECK_SIZEOF(uintptr_t)
  291. dnl AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, intptr_t, uintptr_t])
  292. AC_CHECK_SIZEOF(char)
  293. AC_CHECK_SIZEOF(short)
  294. AC_CHECK_SIZEOF(int)
  295. AC_CHECK_SIZEOF(long)
  296. AC_CHECK_SIZEOF(long long)
  297. AC_CHECK_SIZEOF(__int64)
  298. AC_CHECK_SIZEOF(void *)
  299. AC_CHECK_SIZEOF(time_t)
  300. AC_CACHE_CHECK([whether time_t is signed], tor_cv_time_t_signed, [
  301. AC_TRY_RUN([
  302. int main(int c, char**v) { if (((time_t)-1)<0) return 1; else return 0; }],
  303. tor_cv_time_t_signed=no, tor_cv_time_t_signed=yes)
  304. ])
  305. if test $tor_cv_time_t_signed = yes; then
  306. AC_DEFINE([TIME_T_IS_SIGNED], 1,
  307. [Define to 1 iff time_t is signed])
  308. fi
  309. AC_CHECK_SIZEOF(socklen_t, , [AC_INCLUDES_DEFAULT()
  310. #ifdef HAVE_SYS_SOCKET_H
  311. #include <sys/socket.h>
  312. #endif
  313. ])
  314. # We want to make sure that we _don't_ have a cell_t defined, like IRIX does.
  315. AC_CHECK_SIZEOF(cell_t)
  316. # Now, let's see about alignment requirements. On some platforms, we override
  317. # the default.
  318. case $host in
  319. ia64-*-* | arm-*-* | sparc-*-* | sparc64-*-* )
  320. tor_cv_unaligned_ok=no
  321. ;;
  322. # On the following architectures unaligned access works, but is not done in
  323. # hardware. This means that when you try to do unaligned access the kernel
  324. # gets to sort out an exception and then work around to somehow make your
  325. # reqest work, which is quite expensive. Therefore it's probably better to
  326. # not even do it.
  327. alpha-*-* | mips-*-* | mipsel-*-* )
  328. tor_cv_unaligned_ok=no
  329. ;;
  330. *)
  331. AC_CACHE_CHECK([whether unaligned int access is allowed], tor_cv_unaligned_ok,
  332. [AC_RUN_IFELSE([AC_LANG_SOURCE(
  333. [[int main () { char s[] = "A\x00\x00\x00\x00\x00\x00\x00";
  334. return *(int*)(&s[1]); }]])],
  335. [tor_cv_unaligned_ok=yes],
  336. [tor_cv_unaligned_ok=no],
  337. [tor_cv_unaligned_ok=cross])])
  338. esac
  339. if test $tor_cv_unaligned_ok = yes; then
  340. AC_DEFINE([UNALIGNED_INT_ACCESS_OK], 1,
  341. [Define to 1 iff unaligned int access is allowed])
  342. fi
  343. # Now make sure that NULL can be represented as zero bytes.
  344. AC_CACHE_CHECK([whether memset(0) sets pointers to NULL], tor_cv_null_is_zero,
  345. [AC_RUN_IFELSE([AC_LANG_SOURCE(
  346. [[#include <stdlib.h>
  347. #include <string.h>
  348. #include <stdio.h>
  349. #ifdef HAVE_STDDEF_H
  350. #include <stddef.h>
  351. #endif
  352. int main () { char *p1,*p2; p1=NULL; memset(&p2,0,sizeof(p2));
  353. return memcmp(&p1,&p2,sizeof(char*))?1:0; }]])],
  354. [tor_cv_null_is_zero=yes],
  355. [tor_cv_null_is_zero=no],
  356. [tor_cv_null_is_zero=cross])])
  357. if test $tor_cv_null_is_zero = yes; then
  358. AC_DEFINE([NULL_REP_IS_ZERO_BYTES], 1,
  359. [Define to 1 iff memset(0) sets pointers to NULL])
  360. fi
  361. # Whether we should use the dmalloc memory allocation debugging library.
  362. AC_MSG_CHECKING(whether to use dmalloc (debug memory allocation library))
  363. AC_ARG_WITH(dmalloc,
  364. [ --with-dmalloc Use debug memory allocation library. ],
  365. [if [[ "$withval" = "yes" ]]; then
  366. dmalloc=1
  367. AC_MSG_RESULT(yes)
  368. else
  369. dmalloc=1
  370. AC_MSG_RESULT(no)
  371. fi], [ dmalloc=0; AC_MSG_RESULT(no) ]
  372. )
  373. if [[ $dmalloc -eq 1 ]]; then
  374. AC_CHECK_HEADERS(dmalloc.h, , AC_MSG_ERROR(dmalloc header file not found. Do you have the development files for dmalloc installed?))
  375. AC_SEARCH_LIBS(dmalloc_malloc, [dmallocth dmalloc], , AC_MSG_ERROR(Libdmalloc library not found. If you enable it you better have it installed.))
  376. AC_DEFINE(USE_DMALLOC, 1, [Debug memory allocation library])
  377. AC_DEFINE(DMALLOC_FUNC_CHECK, 1, [Enable dmalloc's malloc function check])
  378. fi
  379. # Allow user to specify an alternate syslog facility
  380. AC_ARG_WITH(syslog-facility,
  381. [ --with-syslog-facility=LOG syslog facility to use (default=LOG_DAEMON)],
  382. syslog_facility="$withval", syslog_facility="LOG_DAEMON")
  383. AC_DEFINE_UNQUOTED(LOGFACILITY,$syslog_facility,[name of the syslog facility])
  384. AC_SUBST(LOGFACILITY)
  385. # Check for gethostbyname_r in all its glorious incompatible versions.
  386. # (This logic is based on that in Python's configure.in)
  387. AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
  388. [Define this if you have any gethostbyname_r()])
  389. AC_CHECK_FUNC(gethostbyname_r, [
  390. AC_MSG_CHECKING([how many arguments gethostbyname_r() wants])
  391. OLD_CFLAGS=$CFLAGS
  392. CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
  393. AC_TRY_COMPILE([
  394. #include <netdb.h>
  395. ], [
  396. char *cp1, *cp2;
  397. struct hostent *h1, *h2;
  398. int i1, i2;
  399. (void)gethostbyname_r(cp1,h1,cp2,i1,&h2,&i2);
  400. ], [
  401. AC_DEFINE(HAVE_GETHOSTBYNAME_R)
  402. AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
  403. [Define this if gethostbyname_r takes 6 arguments])
  404. AC_MSG_RESULT(6)
  405. ], [
  406. AC_TRY_COMPILE([
  407. #include <netdb.h>
  408. ], [
  409. char *cp1, *cp2;
  410. struct hostent *h1;
  411. int i1, i2;
  412. (void)gethostbyname_r(cp1,h1,cp2,i1,&i2);
  413. ], [
  414. AC_DEFINE(HAVE_GETHOSTBYNAME_R)
  415. AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
  416. [Define this if gethostbyname_r takes 5 arguments])
  417. AC_MSG_RESULT(5)
  418. ], [
  419. AC_TRY_COMPILE([
  420. #include <netdb.h>
  421. ], [
  422. char *cp1;
  423. struct hostent *h1;
  424. struct hostent_data hd;
  425. (void) gethostbyname_r(cp1,h1,&hd);
  426. ], [
  427. AC_DEFINE(HAVE_GETHOSTBYNAME_R)
  428. AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
  429. [Define this if gethostbyname_r takes 3 arguments])
  430. AC_MSG_RESULT(3)
  431. ], [
  432. AC_MSG_RESULT(0)
  433. ])
  434. ])
  435. ])
  436. CFLAGS=$OLD_CFLAGS
  437. ])
  438. # $prefix stores the value of the --prefix command line option, or
  439. # NONE if the option wasn't set. In the case that it wasn't set, make
  440. # it be the default, so that we can use it to expand directories now.
  441. if test "x$prefix" = "xNONE"; then
  442. prefix=$ac_default_prefix
  443. fi
  444. # and similarly for $exec_prefix
  445. if test "x$exec_prefix" = "xNONE"; then
  446. exec_prefix=$prefix
  447. fi
  448. CONFDIR=`eval echo $sysconfdir/tor`
  449. AC_SUBST(CONFDIR)
  450. AC_DEFINE_UNQUOTED(CONFDIR,"$CONFDIR")
  451. AC_DEFINE([CONFDIR], [], [tor's configuration directory])
  452. BINDIR=`eval echo $bindir`
  453. AC_SUBST(BINDIR)
  454. LOCALSTATEDIR=`eval echo $localstatedir`
  455. AC_SUBST(LOCALSTATEDIR)
  456. AC_DEFINE_UNQUOTED(LOCALSTATEDIR,"$LOCALSTATEDIR")
  457. AC_DEFINE([LOCALSTATEDIR], [], [Default location to store state files.])
  458. # Set CFLAGS _after_ all the above checks, since our warnings are stricter
  459. # than autoconf's macros like.
  460. CFLAGS="$CFLAGS -Wall -g -O2"
  461. # Add some more warnings which we use in the cvs version but not in the
  462. # released versions. (Some relevant gcc versions can't handle these.)
  463. #CFLAGS="$CFLAGS -W -Wno-unused-parameter -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Winit-self -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wmissing-field-initializers -Wredundant-decls -Winline"
  464. # Add these in when you feel like fun.
  465. #CFLAGS="$CFLAGS -Wbad-function-cast -Werror -Wdeclaration-after-statement -Wold-style-definition"
  466. echo "confdir: $CONFDIR"
  467. AC_OUTPUT(Makefile tor.spec contrib/tor.sh contrib/torctl contrib/torify contrib/tor.logrotate contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist contrib/osx/TorStartupDesc.plist src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile)
  468. if test -x /usr/bin/perl && test -x ./contrib/updateVersions.pl ; then
  469. ./contrib/updateVersions.pl
  470. fi