1
0

configure.ac 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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@shatow.net])
  6. AC_CONFIG_SRCDIR(src/eggdrop.h)
  7. AC_CONFIG_HEADER(config.h)
  8. AC_COPYRIGHT([Copyright (c) 2003, 2004 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++-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. #checkpoint
  53. AC_CACHE_SAVE
  54. # Checks for system libraries
  55. EGG_CHECK_LIBS
  56. # Checks for header files
  57. AC_HEADER_DIRENT
  58. AC_HEADER_SYS_WAIT
  59. AC_HEADER_TIME
  60. AC_HEADER_STAT
  61. #checkpoint
  62. AC_CACHE_SAVE
  63. AC_CHECK_HEADERS([stdarg.h std_arg.h arpa/inet.h fcntl.h limits.h locale.h netdb.h netinet/in.h])
  64. AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/param.h sys/socket.h wchar.h sys/ptrace.h paths.h])
  65. #checkpoint
  66. AC_CACHE_SAVE
  67. #AC_CHECK_HEADERS(openssl/ssl.h openssl/crypto.h)
  68. #AC_CHECK_HEADERS(zlib.h)
  69. #EGG_CHECK_ZLIB
  70. #EGG_CHECK_SSL
  71. #AC_SUBST(ZLIB)dnl
  72. #AC_SUBST(SSL)dnl
  73. # Checks for typedefs, structures, and compiler characteristics
  74. AC_TYPE_PID_T
  75. AC_TYPE_SIZE_T
  76. AC_TYPE_UID_T
  77. #AC_C_CONST
  78. AC_C_VOLATILE
  79. AC_C_BIGENDIAN(AC_DEFINE(B_ENDIAN, 1, [big endian]),AC_DEFINE(L_ENDIAN, 1, [little endian]))
  80. #AC_C_INLINE
  81. AC_C_CHAR_UNSIGNED
  82. #AC_C_STRINGIZE
  83. #AC_C_PROTOTYPES
  84. #checkpoint
  85. AC_CACHE_SAVE
  86. AC_CHECK_SIZEOF(short, 0)
  87. AC_CHECK_SIZEOF(int, 0)
  88. AC_CHECK_SIZEOF(long, 0)
  89. AC_CHECK_SIZEOF(long long,0)
  90. AC_CHECK_SIZEOF(size_t, 0)
  91. AC_CHECK_SIZEOF(ptrdiff_t, 0)
  92. AC_CHECK_SIZEOF(time_t, 0)
  93. AC_STRUCT_TIMEZONE
  94. AC_STRUCT_TM
  95. # Checks for library functions
  96. AC_FUNC_FORK
  97. AC_FUNC_LSTAT
  98. AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
  99. AC_FUNC_MALLOC
  100. AC_FUNC_MKTIME
  101. AC_FUNC_MMAP
  102. AC_FUNC_REALLOC
  103. AC_FUNC_STAT
  104. EGG_FUNC_TIMESPEC
  105. AC_FUNC_STRFTIME
  106. #checkpoint
  107. AC_CACHE_SAVE
  108. AC_CHECK_FUNCS([clock fsync getrusage isascii getpassphrase])
  109. AC_CHECK_FUNCS([memcpy memset random rename snprintf srandom gettime])
  110. #checkpoint
  111. AC_CACHE_SAVE
  112. AC_CHECK_FUNCS([strcasecmp strncasecmp vsnprintf])
  113. #autoscan suggested this....
  114. #These are recommended by autoscan, but no code supports it currently
  115. #AC_CHECK_FUNCS([alarm bzero dup2 getcwd gethostbyaddr gethostbyname gethostname getpass gettimeofday mbrlen
  116. #mkdir munmap realpath select setlocale socket strchr strerror strpbrk strrchr strstr strtol tzset])
  117. EGG_CHECK_FUNC_VSPRINTF
  118. EGG_CHECK_FUNC_UNAME
  119. # Make sure we have stdc headers, since we can't compile without them
  120. EGG_HEADER_STDC
  121. #checkpoint
  122. AC_CACHE_SAVE
  123. EGG_SUBST_VERSION
  124. #FIND_WRAPS
  125. EGG_SUBST_MOD_UPDIR
  126. DO_DEPS
  127. AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile src/compat/Makefile src/crypto/Makefile src/mod/Makefile src/buildinfo.h])
  128. AC_OUTPUT
  129. AH_TEMPLATE(HAVE_ST_MTIM, [Define to 1 if your struct stat has an st_mtim member])
  130. AH_TEMPLATE(HAVE_ST_MTIMESPEC, [Define to 1 if your struct stat has an st_mtimespec member])
  131. AH_TEMPLATE(HAVE_TIMESPEC, [Define to 1 if you have struct timespec in sys/time.h])
  132. AH_TEMPLATE(HAVE_TIMESPECSUB2, [Define to 1 if you have a timespecsub macro or function that takes two arguments (not three)])
  133. AH_BOTTOM([/*
  134. * Macros to pull sec and nsec parts of mtime from struct stat.
  135. */
  136. #ifdef HAVE_ST_MTIM
  137. # define mtim_getsec(_x) ((_x).st_mtim.tv_sec)
  138. # define mtim_getnsec(_x) ((_x).st_mtim.tv_nsec)
  139. #else
  140. # ifdef HAVE_ST_MTIMESPEC
  141. # define mtim_getsec(_x) ((_x).st_mtimespec.tv_sec)
  142. # define mtim_getnsec(_x) ((_x).st_mtimespec.tv_nsec)
  143. # else
  144. # define mtim_getsec(_x) ((_x).st_mtime)
  145. # define mtim_getnsec(_x) (0)
  146. # endif /* HAVE_ST_MTIMESPEC */
  147. #endif /* HAVE_ST_MTIM */
  148. /*
  149. * Enable IPv6 debugging?
  150. */
  151. #define DEBUG_IPV6 1
  152. #define HAVE_IPV6 1
  153. /* IPv6 sanity checks. */
  154. #ifdef USE_IPV6
  155. # ifndef HAVE_IPV6
  156. # undef USE_IPV6
  157. # endif
  158. # ifndef HAVE_GETHOSTBYNAME2
  159. # ifndef HAVE_GETIPNODEBYNAME
  160. # undef USE_IPV6
  161. # endif
  162. # endif
  163. #endif
  164. ])
  165. #echo ""
  166. #echo ""
  167. #echo "------------ Configuring BDLIB ------------"
  168. #cd lib/bdlib && ./configure