configure.in 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. dnl $Id$
  2. dnl Copyright (c) 2001-2005 Roger Dingledine
  3. dnl Copyright (c) 2004-2005 Nick Mathewson
  4. dnl See LICENSE for licensing information
  5. AC_INIT
  6. AM_INIT_AUTOMAKE(tor, 0.1.1.10-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. AC_ARG_WITH(ssl-dir,
  50. [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
  51. [
  52. if test "x$withval" != "xno" ; then
  53. tryssldir=$withval
  54. fi
  55. ]
  56. )
  57. TORUSER=_tor
  58. AC_ARG_WITH(tor-user,
  59. [ --with-tor-user=NAME Specify username for tor daemon ],
  60. [
  61. TORUSER=$withval
  62. ]
  63. )
  64. AC_SUBST(TORUSER)
  65. TORGROUP=_tor
  66. AC_ARG_WITH(tor-group,
  67. [ --with-tor-group=NAME Specify group name for tor daemon ],
  68. [
  69. TORGROUP=$withval
  70. ]
  71. )
  72. AC_SUBST(TORGROUP)
  73. AC_SEARCH_LIBS(socket, [socket])
  74. AC_SEARCH_LIBS(gethostbyname, [nsl])
  75. AC_SEARCH_LIBS(dlopen, [dl])
  76. if test $enable_threads = "yes"; then
  77. AC_SEARCH_LIBS(pthread_create, [pthread])
  78. AC_SEARCH_LIBS(pthread_detach, [pthread])
  79. fi
  80. dnl ------------------------------------------------------
  81. dnl Where do you live, libevent? And how do we call you?
  82. # Step 1. Try to link and run a program using libevent. If it works,
  83. # great! Just add -levent.
  84. AC_CACHE_CHECK([for a normal libevent], ac_cv_libevent_normal, [
  85. saved_LIBS="$LIBS"
  86. LIBS="$LIBS -levent"
  87. AC_TRY_RUN([
  88. void *event_init(void);
  89. int main(void)
  90. {
  91. event_init();
  92. return 0;
  93. }], ac_cv_libevent_normal=yes, ac_cv_libevent_normal=no)
  94. LIBS="$saved_LIBS"
  95. ])
  96. if test "$ac_cv_libevent_normal" = yes; then
  97. LIBS="$LIBS -levent"
  98. else
  99. AC_CACHE_CHECK([for libevent in /usr/local/lib], ac_cv_libevent_local, [
  100. saved_LIBS="$LIBS"
  101. saved_LDFLAGS="$LDFLAGS"
  102. LIBS="$LIBS -levent"
  103. LDFLAGS="$LDFLAGS -L/usr/local/lib"
  104. # Step 2. Otherwise, check whether adding -L/usr/local/lib allows
  105. # us to link. If not, assume we have no libevent at all.
  106. AC_TRY_LINK([], [ void *event_init(void); event_init(); ],
  107. [ libevent_is_in_local=yes ], [ libevent_is_in_local=no ])
  108. if test $libevent_is_in_local = no ; then
  109. ac_cv_libevent_local=no
  110. else
  111. # Step 3. Does adding -L/usr/local/lib allow us to run, too?
  112. # If so, all we have to do as adjust LDFLAGS and CFLAGS.
  113. AC_TRY_RUN([
  114. void *event_init(void);
  115. int main(void)
  116. {
  117. event_init();
  118. return 0;
  119. }], [ ac_cv_libevent_local=yes ], [ ac_cv_libevent_local=unlinked ])
  120. fi
  121. if test "$GCC" = yes -a $ac_cv_libevent_local = unlinked ; then
  122. # Step 4. Okay, so we can link but not run. This probably means
  123. # that the dynamic linker doesn't have /usr/local/lib in
  124. # its search path. If we're lucky enough to be running
  125. # GCC on an ELF system, we might have a workaround for that.
  126. # See whether -Wl,-R/usr/local/lib makes things better.
  127. LDFLAGS="$LDFLAGS -Wl,-R/usr/local/lib"
  128. AC_TRY_RUN([
  129. void *event_init(void);
  130. int main(void)
  131. {
  132. event_init();
  133. return 0;
  134. }], [ ac_cv_libevent_local=unlinked_gcc_elf ])
  135. fi
  136. LIBS="$saved_LIBS"
  137. LDFLAGS="$saved_LDFLAGS" ])
  138. # Now we're done. ac_vc_libevent_local could be:
  139. # yes -- Add -L/usr/local/lib and we can link fine.
  140. # unlinked_gcc_elf -- We can link, but we need to use the GCC-ELF
  141. # workaround. Complain a little.
  142. # unlinked -- We can link, but we can't run. Complain a lot.
  143. # no -- we can't link at all. Give an error and die.
  144. if test $ac_cv_libevent_local != no; then
  145. LIBS="$LIBS -levent"
  146. LDFLAGS="$LDFLAGS -L/usr/local/lib"
  147. CPPFLAGS="$CPPFLAGS -I/usr/local/include"
  148. fi
  149. if test $ac_cv_libevent_local = unlinked_gcc_elf; then
  150. LDFLAGS="$LDFLAGS -Wl,-R/usr/local/lib"
  151. if test -f /etc/ld.so.conf ; then
  152. AC_MSG_NOTICE([
  153. Apparently, you don't have /usr/local/lib in your /etc/ld.so.conf.
  154. Tor is smart enought to deal this now, but other applications aren't.
  155. You might want to add it in.])
  156. fi
  157. fi
  158. if test $ac_cv_libevent_local = unlinked ; then
  159. if test -f /etc/ld.so.conf ; then
  160. AC_MSG_NOTICE([
  161. =================================================
  162. Your libevent library is installed in /usr/local/lib,
  163. but your dynamic linker isn't configured to look for
  164. it there.
  165. Maybe you need to add /usr/local/lib to /etc/ld.so.conf,
  166. and then run ldconfig -v ?
  167. =================================================])
  168. else
  169. AC_MSG_NOTICE([
  170. =================================================
  171. Your libevent library is installed in /usr/local/lib,
  172. but your dynamic linker isn't configured to look for
  173. it there.
  174. =================================================])
  175. fi
  176. fi
  177. if test $ac_cv_libevent_local = no ; then
  178. AC_MSG_ERROR([
  179. Tor requires libevent to build. You can download the latest
  180. version of libevent from http://monkey.org/~provos/libevent/])
  181. fi
  182. fi
  183. dnl ------------------------------------------------------
  184. dnl Where do you live, OpenSSL?
  185. saved_LIBS="$LIBS"
  186. saved_LDFLAGS="$LDFLAGS"
  187. saved_CPPFLAGS="$CPPFLAGS"
  188. if test "x$prefix" != "xNONE" ; then
  189. tryssldir="$tryssldir $prefix"
  190. fi
  191. AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
  192. for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/athena /usr/pkg /opt /opt/openssl ; do
  193. CPPFLAGS="$saved_CPPFLAGS"
  194. LDFLAGS="$saved_LDFLAGS"
  195. LIBS="$saved_LIBS -lssl -lcrypto"
  196. # Skip directories if they don't exist
  197. if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
  198. continue;
  199. fi
  200. if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
  201. # Try to use $ssldir/lib if it exists, otherwise
  202. # $ssldir
  203. if test -d "$ssldir/lib" ; then
  204. LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
  205. if test ! -z "$need_dash_r" ; then
  206. LDFLAGS="-R$ssldir/lib $LDFLAGS"
  207. fi
  208. else
  209. LDFLAGS="-L$ssldir $saved_LDFLAGS"
  210. if test ! -z "$need_dash_r" ; then
  211. LDFLAGS="-R$ssldir $LDFLAGS"
  212. fi
  213. fi
  214. # Try to use $ssldir/include if it exists, otherwise
  215. # $ssldir
  216. if test -d "$ssldir/include" ; then
  217. CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
  218. else
  219. CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
  220. fi
  221. fi
  222. # Basic test to check for compatible version and correct linking
  223. # *does not* test for RSA - that comes later.
  224. AC_TRY_RUN(
  225. [
  226. #include <string.h>
  227. #include <openssl/rand.h>
  228. int main(void)
  229. {
  230. char a[2048];
  231. memset(a, 0, sizeof(a));
  232. RAND_add(a, sizeof(a), sizeof(a));
  233. return(RAND_status() <= 0);
  234. }
  235. ],
  236. [
  237. found_crypto=1
  238. break;
  239. ], []
  240. )
  241. if test ! -z "$found_crypto" ; then
  242. break;
  243. fi
  244. done
  245. if test -z "$found_crypto" ; then
  246. AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
  247. fi
  248. if test -z "$ssldir" ; then
  249. ssldir="(system)"
  250. fi
  251. ac_cv_openssldir=$ssldir
  252. ])
  253. if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ;
  254. then
  255. dnl Need to recover ssldir - test above runs in subshell
  256. ssldir=$ac_cv_openssldir
  257. if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
  258. # Try to use $ssldir/lib if it exists, otherwise
  259. # $ssldir
  260. if test -d "$ssldir/lib" ; then
  261. LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
  262. if test ! -z "$need_dash_r" ; then
  263. LDFLAGS="-R$ssldir/lib $LDFLAGS"
  264. fi
  265. else
  266. LDFLAGS="-L$ssldir $saved_LDFLAGS"
  267. if test ! -z "$need_dash_r" ; then
  268. LDFLAGS="-R$ssldir $LDFLAGS"
  269. fi
  270. fi
  271. # Try to use $ssldir/include if it exists, otherwise
  272. # $ssldir
  273. if test -d "$ssldir/include" ; then
  274. CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
  275. else
  276. CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
  277. fi
  278. fi
  279. fi
  280. LIBS="$saved_LIBS"
  281. AC_SYS_LARGEFILE
  282. dnl The warning message here is no longer strictly accurate.
  283. 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))
  284. AC_CHECK_HEADERS(event.h, , AC_MSG_ERROR(Libevent header (event.h) not found. Tor requires libevent to build.))
  285. 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.))
  286. dnl These headers are not essential
  287. 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)
  288. 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)
  289. if test $enable_threads = "yes"; then
  290. AC_CHECK_HEADERS(pthread.h)
  291. AC_CHECK_FUNCS(pthread_create)
  292. fi
  293. AC_FUNC_FSEEKO
  294. AC_CHECK_MEMBERS([struct timeval.tv_sec])
  295. dnl In case we aren't given a working stdint.h, we'll need to grow our own.
  296. dnl Watch out.
  297. AC_CHECK_SIZEOF(int8_t)
  298. AC_CHECK_SIZEOF(int16_t)
  299. AC_CHECK_SIZEOF(int32_t)
  300. AC_CHECK_SIZEOF(int64_t)
  301. AC_CHECK_SIZEOF(uint8_t)
  302. AC_CHECK_SIZEOF(uint16_t)
  303. AC_CHECK_SIZEOF(uint32_t)
  304. AC_CHECK_SIZEOF(uint64_t)
  305. AC_CHECK_SIZEOF(intptr_t)
  306. AC_CHECK_SIZEOF(uintptr_t)
  307. dnl AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, intptr_t, uintptr_t])
  308. AC_CHECK_SIZEOF(char)
  309. AC_CHECK_SIZEOF(short)
  310. AC_CHECK_SIZEOF(int)
  311. AC_CHECK_SIZEOF(long)
  312. AC_CHECK_SIZEOF(long long)
  313. AC_CHECK_SIZEOF(__int64)
  314. AC_CHECK_SIZEOF(void *)
  315. AC_CHECK_SIZEOF(time_t)
  316. AC_CACHE_CHECK([whether time_t is signed], tor_cv_time_t_signed, [
  317. AC_TRY_RUN([
  318. int main(int c, char**v) { if (((time_t)-1)<0) return 1; else return 0; }],
  319. tor_cv_time_t_signed=no, tor_cv_time_t_signed=yes)
  320. ])
  321. if test $tor_cv_time_t_signed = yes; then
  322. AC_DEFINE([TIME_T_IS_SIGNED], 1,
  323. [Define to 1 iff time_t is signed])
  324. fi
  325. AC_CHECK_SIZEOF(socklen_t, , [AC_INCLUDES_DEFAULT()
  326. #ifdef HAVE_SYS_SOCKET_H
  327. #include <sys/socket.h>
  328. #endif
  329. ])
  330. # We want to make sure that we _don't_ have a cell_t defined, like IRIX does.
  331. AC_CHECK_SIZEOF(cell_t)
  332. # Now, let's see about alignment requirements. On some platforms, we override
  333. # the default.
  334. case $host in
  335. ia64-*-* | arm-*-* | sparc-*-* | sparc64-*-* )
  336. tor_cv_unaligned_ok=no
  337. ;;
  338. # On the following architectures unaligned access works, but is not done in
  339. # hardware. This means that when you try to do unaligned access the kernel
  340. # gets to sort out an exception and then work around to somehow make your
  341. # reqest work, which is quite expensive. Therefore it's probably better to
  342. # not even do it.
  343. alpha-*-* | mips-*-* | mipsel-*-* )
  344. tor_cv_unaligned_ok=no
  345. ;;
  346. *)
  347. AC_CACHE_CHECK([whether unaligned int access is allowed], tor_cv_unaligned_ok,
  348. [AC_RUN_IFELSE([AC_LANG_SOURCE(
  349. [[int main () { char s[] = "A\x00\x00\x00\x00\x00\x00\x00";
  350. return *(int*)(&s[1]); }]])],
  351. [tor_cv_unaligned_ok=yes],
  352. [tor_cv_unaligned_ok=no],
  353. [tor_cv_unaligned_ok=cross])])
  354. esac
  355. if test $tor_cv_unaligned_ok = yes; then
  356. AC_DEFINE([UNALIGNED_INT_ACCESS_OK], 1,
  357. [Define to 1 iff unaligned int access is allowed])
  358. fi
  359. # Now make sure that NULL can be represented as zero bytes.
  360. AC_CACHE_CHECK([whether memset(0) sets pointers to NULL], tor_cv_null_is_zero,
  361. [AC_RUN_IFELSE([AC_LANG_SOURCE(
  362. [[#include <stdlib.h>
  363. #include <string.h>
  364. #include <stdio.h>
  365. #ifdef HAVE_STDDEF_H
  366. #include <stddef.h>
  367. #endif
  368. int main () { char *p1,*p2; p1=NULL; memset(&p2,0,sizeof(p2));
  369. return memcmp(&p1,&p2,sizeof(char*))?1:0; }]])],
  370. [tor_cv_null_is_zero=yes],
  371. [tor_cv_null_is_zero=no],
  372. [tor_cv_null_is_zero=cross])])
  373. if test $tor_cv_null_is_zero = yes; then
  374. AC_DEFINE([NULL_REP_IS_ZERO_BYTES], 1,
  375. [Define to 1 iff memset(0) sets pointers to NULL])
  376. fi
  377. # Whether we should use the dmalloc memory allocation debugging library.
  378. AC_MSG_CHECKING(whether to use dmalloc (debug memory allocation library))
  379. AC_ARG_WITH(dmalloc,
  380. [ --with-dmalloc Use debug memory allocation library. ],
  381. [if [[ "$withval" = "yes" ]]; then
  382. dmalloc=1
  383. AC_MSG_RESULT(yes)
  384. else
  385. dmalloc=1
  386. AC_MSG_RESULT(no)
  387. fi], [ dmalloc=0; AC_MSG_RESULT(no) ]
  388. )
  389. if [[ $dmalloc -eq 1 ]]; then
  390. AC_CHECK_HEADERS(dmalloc.h, , AC_MSG_ERROR(dmalloc header file not found. Do you have the development files for dmalloc installed?))
  391. AC_SEARCH_LIBS(dmalloc_malloc, [dmallocth dmalloc], , AC_MSG_ERROR(Libdmalloc library not found. If you enable it you better have it installed.))
  392. AC_DEFINE(USE_DMALLOC, 1, [Debug memory allocation library])
  393. AC_DEFINE(DMALLOC_FUNC_CHECK, 1, [Enable dmalloc's malloc function check])
  394. fi
  395. # Check for gethostbyname_r in all its glorious incompatible versions.
  396. # (This logic is based on that in Python's configure.in)
  397. AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
  398. [Define this if you have any gethostbyname_r()])
  399. AC_CHECK_FUNC(gethostbyname_r, [
  400. AC_MSG_CHECKING([how many arguments gethostbyname_r() wants])
  401. OLD_CFLAGS=$CFLAGS
  402. CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
  403. AC_TRY_COMPILE([
  404. #include <netdb.h>
  405. ], [
  406. char *cp1, *cp2;
  407. struct hostent *h1, *h2;
  408. int i1, i2;
  409. (void)gethostbyname_r(cp1,h1,cp2,i1,&h2,&i2);
  410. ], [
  411. AC_DEFINE(HAVE_GETHOSTBYNAME_R)
  412. AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
  413. [Define this if gethostbyname_r takes 6 arguments])
  414. AC_MSG_RESULT(6)
  415. ], [
  416. AC_TRY_COMPILE([
  417. #include <netdb.h>
  418. ], [
  419. char *cp1, *cp2;
  420. struct hostent *h1;
  421. int i1, i2;
  422. (void)gethostbyname_r(cp1,h1,cp2,i1,&i2);
  423. ], [
  424. AC_DEFINE(HAVE_GETHOSTBYNAME_R)
  425. AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
  426. [Define this if gethostbyname_r takes 5 arguments])
  427. AC_MSG_RESULT(5)
  428. ], [
  429. AC_TRY_COMPILE([
  430. #include <netdb.h>
  431. ], [
  432. char *cp1;
  433. struct hostent *h1;
  434. struct hostent_data hd;
  435. (void) gethostbyname_r(cp1,h1,&hd);
  436. ], [
  437. AC_DEFINE(HAVE_GETHOSTBYNAME_R)
  438. AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
  439. [Define this if gethostbyname_r takes 3 arguments])
  440. AC_MSG_RESULT(3)
  441. ], [
  442. AC_MSG_RESULT(0)
  443. ])
  444. ])
  445. ])
  446. CFLAGS=$OLD_CFLAGS
  447. ])
  448. # $prefix stores the value of the --prefix command line option, or
  449. # NONE if the option wasn't set. In the case that it wasn't set, make
  450. # it be the default, so that we can use it to expand directories now.
  451. if test "x$prefix" = "xNONE"; then
  452. prefix=$ac_default_prefix
  453. fi
  454. # and similarly for $exec_prefix
  455. if test "x$exec_prefix" = "xNONE"; then
  456. exec_prefix=$prefix
  457. fi
  458. CONFDIR=`eval echo $sysconfdir/tor`
  459. AC_SUBST(CONFDIR)
  460. AC_DEFINE_UNQUOTED(CONFDIR,"$CONFDIR")
  461. AC_DEFINE([CONFDIR], [], [tor's configuration directory])
  462. BINDIR=`eval echo $bindir`
  463. AC_SUBST(BINDIR)
  464. LOCALSTATEDIR=`eval echo $localstatedir`
  465. AC_SUBST(LOCALSTATEDIR)
  466. AC_DEFINE_UNQUOTED(LOCALSTATEDIR,"$LOCALSTATEDIR")
  467. AC_DEFINE([LOCALSTATEDIR], [], [Default location to store state files.])
  468. # Set CFLAGS _after_ all the above checks, since our warnings are stricter
  469. # than autoconf's macros like.
  470. CFLAGS="$CFLAGS -Wall -g -O2"
  471. # Add some more warnings which we use in the cvs version but not in the
  472. # released versions. (Some relevant gcc versions can't handle these.)
  473. #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"
  474. # Add these in when you feel like fun.
  475. #CFLAGS="$CFLAGS -Wbad-function-cast -Werror -Wdeclaration-after-statement -Wold-style-definition"
  476. echo "confdir: $CONFDIR"
  477. 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)
  478. if test -x /usr/bin/perl && test -x ./contrib/updateVersions.pl ; then
  479. ./contrib/updateVersions.pl
  480. fi