configure.ac 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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(src/config.h)
  8. AC_COPYRIGHT([Copyright (c) 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++49 g++-4.9 g++48 g++-4.8 g++47 g++-4.7 clang++ g++46 g++-4.6 g++45 g++-4.5 g++-4.4 g++-4.4.1 g++-4.4.2 g++-4.4.0 g++44 g++4 eg++ 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. AC_REQUIRE_CPP
  18. AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
  19. EGG_CHECK_CC
  20. # Crazy machines
  21. AC_AIX
  22. AC_ISC_POSIX
  23. AC_MINIX
  24. #checkpoint
  25. AC_CACHE_SAVE
  26. # Speedup compile
  27. EGG_CHECK_CCWALL
  28. EGG_CHECK_CCPIPE
  29. CXX_FLAG_CHECK([CXXFLAGS], [-fcolor-diagnostics], [colordiagnostics])
  30. CXX_FLAG_CHECK([DEBCXXFLAGS], [-fstack-protector-all], [stackprotector])
  31. EGG_CHECK_DEPMODE
  32. #checkpoint
  33. AC_CACHE_SAVE
  34. # Checks for programs
  35. AC_PROG_MAKE_SET
  36. AC_PROG_SED
  37. EGG_PROG_HEAD_1
  38. EGG_PROG_AWK
  39. EGG_PROG_BASENAME
  40. AC_CHECK_PROG(OBJCOPY, objcopy, [objcopy --remove-section=.note --remove-section=.comment], touch)
  41. AC_CHECK_PROG(STRIP, strip, strip, touch)
  42. AC_CHECK_PROG(DIFF, gdiff, gdiff, diff)
  43. AC_CHECK_PROG(UNAME, uname, uname)
  44. AC_CHECK_PROG(CCACHE, ccache, ccache)
  45. AC_CHECK_PROG(DISTCC, distcc, distcc)
  46. # Test the os and set the module linking settings
  47. EGG_CHECK_OS
  48. # Check for IPv6 support
  49. #EGG_IPV6_SUPPORTED
  50. EGG_IPV6_OPTIONS
  51. EGG_CHECK_SOCKLEN_T
  52. # Check for inconsistent random() functions
  53. EGG_CHECK_RANDOM_MAX
  54. # Create static binaries
  55. EGG_CHECK_CCSTATIC
  56. AC_SUBST(CCDEBUG)dnl
  57. AC_SUBST(DEBCXXFLAGS)
  58. #checkpoint
  59. AC_CACHE_SAVE
  60. # Checks for system libraries
  61. EGG_CHECK_LIBS
  62. # Checks for header files
  63. AC_HEADER_DIRENT
  64. AC_HEADER_SYS_WAIT
  65. AC_HEADER_TIME
  66. AC_HEADER_STAT
  67. #checkpoint
  68. AC_CACHE_SAVE
  69. AC_CHECK_HEADERS([stdarg.h arpa/inet.h fcntl.h limits.h locale.h netdb.h netinet/in.h])
  70. AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/param.h sys/socket.h wchar.h sys/ptrace.h paths.h sys/prctl.h])
  71. #checkpoint
  72. AC_CACHE_SAVE
  73. #AC_CHECK_HEADERS(openssl/ssl.h openssl/crypto.h)
  74. #AC_CHECK_HEADERS(zlib.h)
  75. #EGG_CHECK_ZLIB
  76. CHECK_SSL
  77. # TCL checks
  78. # Tcl version to recommend if no Tcl is found, and the site where it can be
  79. # found for download.
  80. tclrecommendver="8.5.X"
  81. tclrecommendsite="ftp://tcl.activestate.com/pub/tcl/tcl8_5/"
  82. # Tcl library filename prefixes, suffixes, and search paths.
  83. tcllibnames="tcl8.6 tcl86 tcl8.5 tcl85 tcl8.4 tcl84 tcl8.3 tcl83 tcl8.2 tcl82 \
  84. tcl8.1 tcl81 tcl8.0 tcl80 tcl tcl7.6 tcl76 tcl7.5 tcl75 \
  85. tcl7.4 tcl74 tcl7.3 tcl73 tcl7.2 tcl72 tcl7.1 tcl71 \
  86. tcl7.0 tcl70"
  87. tcllibextensions=".so .so.1 .so.1.0 .so.1.1 .so.1.2 .dll .dylib .sl .a"
  88. tcllibpaths="$HOME/lib $HOME/tcl/lib \
  89. /usr/local/lib /usr/lib /lib /lib64 /usr/lib64 \
  90. /usr/local/lib/tcl8.5 /usr/lib/tcl8.5 \
  91. /usr/local/lib/tcl8.4 /usr/lib/tcl8.4 \
  92. /usr/local/lib/tcl8.3 /usr/lib/tcl8.3 \
  93. /usr/local/pkgs/tcl/lib /sys/lib /usr/pkg/lib \
  94. /usr/i486-linuxaout/lib /beos/system/lib $HOME"
  95. # Tcl header filenames and search paths.
  96. tclheadernames="tcl.h"
  97. tclheaderpaths="$HOME/include $HOME/tcl/include \
  98. /usr/local/include /usr/include \
  99. /usr/local/include/tcl8.5 /usr/include/tcl8.5 \
  100. /usr/local/include/tcl8.4 /usr/include/tcl8.4 \
  101. /usr/local/include/tcl8.3 /usr/include/tcl8.3 \
  102. /usr/local/pkgs/tcl/include /sys/include \
  103. /usr/pkg/lib /beos/system/include /beos/devel/include $HOME"
  104. # Misc Tcl checks.
  105. EGG_TCL_OPTIONS
  106. EGG_TCL_ENV
  107. EGG_TCL_WITH_TCLLIB
  108. EGG_TCL_WITH_TCLINC
  109. EGG_TCL_FIND_LIBRARY
  110. EGG_TCL_FIND_HEADER
  111. EGG_TCL_CHECK_LIBRARY
  112. EGG_TCL_CHECK_HEADER
  113. EGG_TCL_DETECT_CHANGE
  114. EGG_TCL_CHECK_VERSION
  115. EGG_TCL_CHECK_PRE70
  116. EGG_TCL_TESTLIBS
  117. EGG_TCL_CHECK_FREE
  118. #EGG_TCL_CHECK_GETCURRENTTHREAD
  119. #EGG_TCL_CHECK_GETTHREADDATA
  120. EGG_TCL_CHECK_SETNOTIFIER
  121. EGG_TCL_LIB_REQS
  122. AC_CACHE_SAVE
  123. #AC_SUBST(ZLIB)dnl
  124. # Checks for typedefs, structures, and compiler characteristics
  125. AC_TYPE_PID_T
  126. AC_TYPE_SIZE_T
  127. AC_TYPE_UID_T
  128. #AC_C_CONST
  129. AC_C_VOLATILE
  130. AC_C_BIGENDIAN(AC_DEFINE(B_ENDIAN, 1, [big endian]),AC_DEFINE(L_ENDIAN, 1, [little endian]))
  131. #AC_C_INLINE
  132. AC_C_CHAR_UNSIGNED
  133. #AC_C_STRINGIZE
  134. #AC_C_PROTOTYPES
  135. #checkpoint
  136. AC_CACHE_SAVE
  137. # Checks for typedefs, structures, and compiler characteristics
  138. AC_TYPE_PID_T
  139. AC_TYPE_SIZE_T
  140. AC_TYPE_UID_T
  141. AC_TYPE_LONG_LONG_INT
  142. AC_TYPE_INT8_T
  143. AC_TYPE_UINT8_T
  144. AC_TYPE_INT16_T
  145. AC_TYPE_UINT16_T
  146. AC_TYPE_INT32_T
  147. AC_TYPE_UINT32_T
  148. AC_TYPE_INT64_T
  149. AC_TYPE_UINT64_T
  150. AC_STRUCT_TIMEZONE
  151. AC_STRUCT_TM
  152. # Checks for library functions
  153. AC_FUNC_FORK
  154. AC_FUNC_LSTAT
  155. AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
  156. AC_FUNC_MALLOC
  157. AC_FUNC_MKTIME
  158. AC_FUNC_MMAP
  159. AC_FUNC_REALLOC
  160. AC_FUNC_STAT
  161. EGG_FUNC_TIMESPEC
  162. AC_FUNC_STRFTIME
  163. #checkpoint
  164. AC_CACHE_SAVE
  165. AC_CHECK_FUNCS([clock fsync getrusage isascii getpassphrase])
  166. AC_CHECK_FUNCS([memcpy memset random rename snprintf srandom gettime])
  167. #checkpoint
  168. AC_CACHE_SAVE
  169. AC_CHECK_FUNCS([strcasecmp strncasecmp vsnprintf inet_ntop])
  170. #autoscan suggested this....
  171. #These are recommended by autoscan, but no code supports it currently
  172. #AC_CHECK_FUNCS([alarm bzero dup2 getcwd gethostbyaddr gethostname getpass gettimeofday mbrlen
  173. #mkdir munmap realpath select setlocale socket strchr strerror strpbrk strrchr strstr strtol tzset])
  174. EGG_CHECK_FUNC_VSPRINTF
  175. EGG_CHECK_FUNC_UNAME
  176. # Make sure we have stdc headers, since we can't compile without them
  177. EGG_HEADER_STDC
  178. #checkpoint
  179. AC_CACHE_SAVE
  180. EGG_SUBST_VERSION
  181. #FIND_WRAPS
  182. EGG_SUBST_MOD_UPDIR
  183. DO_DEPS
  184. AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile src/compat/Makefile src/crypto/Makefile src/mod/Makefile src/buildinfo.h src/mod/mod.mk])
  185. AC_OUTPUT
  186. AH_TEMPLATE(HAVE_ST_MTIM, [Define to 1 if your struct stat has an st_mtim member])
  187. AH_TEMPLATE(HAVE_ST_MTIMESPEC, [Define to 1 if your struct stat has an st_mtimespec member])
  188. AH_TEMPLATE(HAVE_TIMESPEC, [Define to 1 if you have struct timespec in sys/time.h])
  189. AH_TEMPLATE(HAVE_TIMESPECSUB2, [Define to 1 if you have a timespecsub macro or function that takes two arguments (not three)])
  190. AH_BOTTOM([#include "config-sanity.h"])
  191. [
  192. GIT_REQUIRED=1
  193. if [ "$GIT_REQUIRED" = "1" ]; then
  194. if ! test -d .git; then
  195. echo ""
  196. echo ""
  197. echo "You have downloaded a GIT version of wraith."
  198. echo "Either 'git clone' from a git repository or download a source tarball"
  199. echo "A distribution version can be found at http://wraith.botpack.net/wiki/Download"
  200. echo ""
  201. echo ""
  202. exit 1
  203. fi
  204. fi
  205. ]
  206. [
  207. if test -d .git; then
  208. git submodule init
  209. git submodule update
  210. fi
  211. ]
  212. CXX="$CXX" TCL_INCLUDES="$TCL_INCLUDES" SSL_INCLUDES="$SSL_INCLUDES" SED="$SED" src/generate_defs.sh
  213. [
  214. if [ $? -ne 0 ]; then
  215. exit 1
  216. fi
  217. ]
  218. echo ""
  219. echo ""
  220. echo "------------ Configuring BDLIB ------------"
  221. test -f lib/bdlib/configure && cd lib/bdlib && CXX="$CXX" ./configure