configure.ac 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl
  3. dnl
  4. AC_PREREQ(2.59)
  5. AC_INIT([wraith],[],[wraith@botpack.net])
  6. AC_CONFIG_SRCDIR(src/eggdrop.h)
  7. AC_CONFIG_HEADER(config.h)
  8. AC_COPYRIGHT([Copyright (c) 2003 - 2010 Bryan Drewery])
  9. AC_REVISION($Revision$)
  10. EGG_SAVE_PARAMETERS
  11. # Setup build environment
  12. dnl Search for newer gcc versions before older
  13. #AC_REQUIRE_CPP
  14. AC_LANG(C++)
  15. AC_PROG_CXX([g++-4.4 g++-4.4.1 g++-4.4.2 g++-4.4.0 g++44 g++4 g++-3.3 g++33 g++-3 g++3 g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC])
  16. dnl AC_PROG_CC([gcc34 gcc-3.4 gcc33 gcc3 gcc-3.3 gcc cc c1])
  17. EGG_CHECK_CC
  18. # Crazy machines
  19. AC_AIX
  20. AC_ISC_POSIX
  21. AC_MINIX
  22. #checkpoint
  23. AC_CACHE_SAVE
  24. # Speedup compile
  25. EGG_CHECK_CCWALL
  26. EGG_CHECK_CCPIPE
  27. EGG_CHECK_DEPMODE
  28. #checkpoint
  29. AC_CACHE_SAVE
  30. # Checks for programs
  31. AC_PROG_MAKE_SET
  32. EGG_PROG_HEAD_1
  33. EGG_PROG_AWK
  34. EGG_PROG_BASENAME
  35. AC_CHECK_PROG(OBJCOPY, objcopy, [objcopy --remove-section=.note --remove-section=.comment], touch)
  36. AC_CHECK_PROG(STRIP, strip, strip, touch)
  37. AC_CHECK_PROG(DIFF, gdiff, gdiff, diff)
  38. AC_CHECK_PROG(UNAME, uname, uname)
  39. AC_CHECK_PROG(CCACHE, ccache, ccache)
  40. AC_CHECK_PROG(DISTCC, distcc, distcc)
  41. # Test the os and set the module linking settings
  42. EGG_CHECK_OS
  43. # Check for IPv6 support
  44. #EGG_IPV6_SUPPORTED
  45. EGG_IPV6_OPTIONS
  46. EGG_CHECK_SOCKLEN_T
  47. # Check for inconsistent random() functions
  48. EGG_CHECK_RANDOM_MAX
  49. # Create static binaries
  50. EGG_CHECK_CCSTATIC
  51. AC_SUBST(CCDEBUG)dnl
  52. AC_SUBST(MAKEJOBS)dnl
  53. #checkpoint
  54. AC_CACHE_SAVE
  55. # Checks for system libraries
  56. EGG_CHECK_LIBS
  57. # Checks for header files
  58. AC_HEADER_DIRENT
  59. AC_HEADER_SYS_WAIT
  60. AC_HEADER_TIME
  61. AC_HEADER_STAT
  62. #checkpoint
  63. AC_CACHE_SAVE
  64. AC_CHECK_HEADERS([stdarg.h std_arg.h arpa/inet.h fcntl.h limits.h locale.h netdb.h netinet/in.h])
  65. AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/param.h sys/socket.h wchar.h sys/ptrace.h paths.h])
  66. #checkpoint
  67. AC_CACHE_SAVE
  68. #AC_CHECK_HEADERS(openssl/ssl.h openssl/crypto.h)
  69. #AC_CHECK_HEADERS(zlib.h)
  70. #EGG_CHECK_ZLIB
  71. CHECK_SSL
  72. # TCL checks
  73. # Tcl version to recommend if no Tcl is found, and the site where it can be
  74. # found for download.
  75. tclrecommendver="8.5.X"
  76. tclrecommendsite="ftp://tcl.activestate.com/pub/tcl/tcl8_5/"
  77. # Tcl library filename prefixes, suffixes, and search paths.
  78. tcllibnames="tcl8.5 tcl85 tcl8.4 tcl84 tcl8.3 tcl83 tcl8.2 tcl82 \
  79. tcl8.1 tcl81 tcl8.0 tcl80 tcl tcl7.6 tcl76 tcl7.5 tcl75 \
  80. tcl7.4 tcl74 tcl7.3 tcl73 tcl7.2 tcl72 tcl7.1 tcl71 \
  81. tcl7.0 tcl70"
  82. tcllibextensions=".so .so.1 .so.1.0 .so.1.2 .dll .dylib .sl .a"
  83. tcllibpaths="$HOME/lib $HOME/tcl/lib \
  84. /usr/local/lib /usr/lib /lib /lib64 /usr/lib64 \
  85. /usr/local/lib/tcl8.5 /usr/lib/tcl8.5 \
  86. /usr/local/lib/tcl8.4 /usr/lib/tcl8.4 \
  87. /usr/local/lib/tcl8.3 /usr/lib/tcl8.3 \
  88. /usr/local/pkgs/tcl/lib /sys/lib /usr/pkg/lib \
  89. /usr/i486-linuxaout/lib /beos/system/lib $HOME"
  90. # Tcl header filenames and search paths.
  91. tclheadernames="tcl.h"
  92. tclheaderpaths="$HOME/include $HOME/tcl/include \
  93. /usr/local/include /usr/include \
  94. /usr/local/include/tcl8.5 /usr/include/tcl8.5 \
  95. /usr/local/include/tcl8.4 /usr/include/tcl8.4 \
  96. /usr/local/include/tcl8.3 /usr/include/tcl8.3 \
  97. /usr/local/pkgs/tcl/include /sys/include \
  98. /usr/pkg/lib /beos/system/include /beos/devel/include $HOME"
  99. # Misc Tcl checks.
  100. EGG_TCL_ARG_WITH
  101. EGG_TCL_ENV
  102. EGG_TCL_WITH_TCLLIB
  103. EGG_TCL_WITH_TCLINC
  104. EGG_TCL_FIND_LIBRARY
  105. EGG_TCL_FIND_HEADER
  106. EGG_TCL_CHECK_LIBRARY
  107. EGG_TCL_CHECK_HEADER
  108. EGG_TCL_DETECT_CHANGE
  109. EGG_TCL_CHECK_VERSION
  110. EGG_TCL_CHECK_PRE70
  111. EGG_TCL_TESTLIBS
  112. EGG_TCL_CHECK_FREE
  113. #EGG_TCL_CHECK_GETCURRENTTHREAD
  114. #EGG_TCL_CHECK_GETTHREADDATA
  115. EGG_TCL_CHECK_SETNOTIFIER
  116. EGG_TCL_LIB_REQS
  117. AC_CACHE_SAVE
  118. #AC_SUBST(ZLIB)dnl
  119. # Checks for typedefs, structures, and compiler characteristics
  120. AC_TYPE_PID_T
  121. AC_TYPE_SIZE_T
  122. AC_TYPE_UID_T
  123. #AC_C_CONST
  124. AC_C_VOLATILE
  125. AC_C_BIGENDIAN(AC_DEFINE(B_ENDIAN, 1, [big endian]),AC_DEFINE(L_ENDIAN, 1, [little endian]))
  126. #AC_C_INLINE
  127. AC_C_CHAR_UNSIGNED
  128. #AC_C_STRINGIZE
  129. #AC_C_PROTOTYPES
  130. #checkpoint
  131. AC_CACHE_SAVE
  132. AC_CHECK_SIZEOF(short, 0)
  133. AC_CHECK_SIZEOF(int, 0)
  134. AC_CHECK_SIZEOF(long, 0)
  135. AC_CHECK_SIZEOF(long long,0)
  136. AC_CHECK_SIZEOF(size_t, 0)
  137. AC_CHECK_SIZEOF(ptrdiff_t, 0)
  138. AC_CHECK_SIZEOF(time_t, 0)
  139. AC_STRUCT_TIMEZONE
  140. AC_STRUCT_TM
  141. # Checks for library functions
  142. AC_FUNC_FORK
  143. AC_FUNC_LSTAT
  144. AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
  145. AC_FUNC_MALLOC
  146. AC_FUNC_MKTIME
  147. AC_FUNC_MMAP
  148. AC_FUNC_REALLOC
  149. AC_FUNC_STAT
  150. EGG_FUNC_TIMESPEC
  151. AC_FUNC_STRFTIME
  152. #checkpoint
  153. AC_CACHE_SAVE
  154. AC_CHECK_FUNCS([clock fsync getrusage isascii getpassphrase])
  155. AC_CHECK_FUNCS([memcpy memset random rename snprintf srandom gettime])
  156. #checkpoint
  157. AC_CACHE_SAVE
  158. AC_CHECK_FUNCS([strcasecmp strncasecmp vsnprintf])
  159. #autoscan suggested this....
  160. #These are recommended by autoscan, but no code supports it currently
  161. #AC_CHECK_FUNCS([alarm bzero dup2 getcwd gethostbyaddr gethostbyname gethostname getpass gettimeofday mbrlen
  162. #mkdir munmap realpath select setlocale socket strchr strerror strpbrk strrchr strstr strtol tzset])
  163. EGG_CHECK_FUNC_VSPRINTF
  164. EGG_CHECK_FUNC_UNAME
  165. # Make sure we have stdc headers, since we can't compile without them
  166. EGG_HEADER_STDC
  167. #checkpoint
  168. AC_CACHE_SAVE
  169. EGG_SUBST_VERSION
  170. #FIND_WRAPS
  171. EGG_SUBST_MOD_UPDIR
  172. DO_DEPS
  173. AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile src/compat/Makefile src/crypto/Makefile src/mod/Makefile src/buildinfo.h])
  174. AC_OUTPUT
  175. AH_TEMPLATE(HAVE_ST_MTIM, [Define to 1 if your struct stat has an st_mtim member])
  176. AH_TEMPLATE(HAVE_ST_MTIMESPEC, [Define to 1 if your struct stat has an st_mtimespec member])
  177. AH_TEMPLATE(HAVE_TIMESPEC, [Define to 1 if you have struct timespec in sys/time.h])
  178. AH_TEMPLATE(HAVE_TIMESPECSUB2, [Define to 1 if you have a timespecsub macro or function that takes two arguments (not three)])
  179. AH_BOTTOM([/*
  180. * Macros to pull sec and nsec parts of mtime from struct stat.
  181. */
  182. #ifdef HAVE_ST_MTIM
  183. # define mtim_getsec(_x) ((_x).st_mtim.tv_sec)
  184. # define mtim_getnsec(_x) ((_x).st_mtim.tv_nsec)
  185. #else
  186. # ifdef HAVE_ST_MTIMESPEC
  187. # define mtim_getsec(_x) ((_x).st_mtimespec.tv_sec)
  188. # define mtim_getnsec(_x) ((_x).st_mtimespec.tv_nsec)
  189. # else
  190. # define mtim_getsec(_x) ((_x).st_mtime)
  191. # define mtim_getnsec(_x) (0)
  192. # endif /* HAVE_ST_MTIMESPEC */
  193. #endif /* HAVE_ST_MTIM */
  194. /*
  195. * Enable IPv6 debugging?
  196. */
  197. #define DEBUG_IPV6 1
  198. #define HAVE_IPV6 1
  199. /* IPv6 sanity checks. */
  200. #ifdef USE_IPV6
  201. # ifndef HAVE_IPV6
  202. # undef USE_IPV6
  203. # endif
  204. # ifndef HAVE_GETHOSTBYNAME2
  205. # ifndef HAVE_GETIPNODEBYNAME
  206. # undef USE_IPV6
  207. # endif
  208. # endif
  209. #endif
  210. ])
  211. [
  212. GIT_REQUIRED=1
  213. if [ "$GIT_REQUIRED" = "1" ]; then
  214. if ! test -d .git; then
  215. echo ""
  216. echo ""
  217. echo "You have downloaded a GIT version of wraith."
  218. echo "Either 'git clone' from a git repository or download a source tarball"
  219. echo "A distribution version can be found at http://wraith.botpack.net/wiki/Download"
  220. echo ""
  221. echo ""
  222. exit 1
  223. fi
  224. fi
  225. ]
  226. src/generate_defs.sh
  227. echo ""
  228. echo ""
  229. echo "------------ Configuring BDLIB ------------"
  230. [
  231. if test -d .git; then
  232. git submodule init
  233. git submodule update
  234. fi
  235. ]
  236. test -f lib/bdlib/configure && cd lib/bdlib && MAKEJOBS="$MAKEJOBS" ./configure