You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

324 lines
8.7 KiB

12 years ago
12 years ago
8 years ago
11 years ago
12 years ago
12 years ago
12 years ago
Asciidoc man page rework (#699) * Add 'tunnel_address' support for json config parser And allow ss-tunnel to use the newly introduced parser. Signed-off-by: Adam Anonymous <anonymous_temp_user@yahoo.co.jp> * Add "mode" support for jconf Now jconf supports "mode" setting, allowed values are "tcp_only", "tcp_and_udp" and "udp_only". Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Use jconf "mode" for server/local/tunnel/manager Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Add per-project vimrc to gitignore As the coding style differs from kernel and other projects, so such project vimrc should be helpful. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Introduce asciidoc based documentation framework Use asciidoc for new documentation framework, which could not only output man pages, but also htmls. And asciidoc documentation is much more human-readable than roff man pages. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert shadowsocks-libev man page to asciidoc The port to asciidoc has some format change compared to old one. The most obvious one is the options listed in SYNOPSIS. Now the options list is not split into 2/3 columns, or we must use asciidoc tables and introduce table frames. Other small change includes the removal of AUTHOR sector, as it's not an expendable method to update AUTHOR sector every time it gets updated. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-local man page to asciidoc Also modify gitignore, since it use too generic rules to ignore such documentation. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-manager man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-nat man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-redir man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-server man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-tunnel man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Remove old roff man pages Welcome to the new age of asciidoc. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Add equivalent tables for command line options and config file Now user can get a more clear view of config file and command line options. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp>
8 years ago
Asciidoc man page rework (#699) * Add 'tunnel_address' support for json config parser And allow ss-tunnel to use the newly introduced parser. Signed-off-by: Adam Anonymous <anonymous_temp_user@yahoo.co.jp> * Add "mode" support for jconf Now jconf supports "mode" setting, allowed values are "tcp_only", "tcp_and_udp" and "udp_only". Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Use jconf "mode" for server/local/tunnel/manager Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Add per-project vimrc to gitignore As the coding style differs from kernel and other projects, so such project vimrc should be helpful. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Introduce asciidoc based documentation framework Use asciidoc for new documentation framework, which could not only output man pages, but also htmls. And asciidoc documentation is much more human-readable than roff man pages. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert shadowsocks-libev man page to asciidoc The port to asciidoc has some format change compared to old one. The most obvious one is the options listed in SYNOPSIS. Now the options list is not split into 2/3 columns, or we must use asciidoc tables and introduce table frames. Other small change includes the removal of AUTHOR sector, as it's not an expendable method to update AUTHOR sector every time it gets updated. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-local man page to asciidoc Also modify gitignore, since it use too generic rules to ignore such documentation. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-manager man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-nat man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-redir man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-server man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-tunnel man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Remove old roff man pages Welcome to the new age of asciidoc. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Add equivalent tables for command line options and config file Now user can get a more clear view of config file and command line options. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp>
8 years ago
Asciidoc man page rework (#699) * Add 'tunnel_address' support for json config parser And allow ss-tunnel to use the newly introduced parser. Signed-off-by: Adam Anonymous <anonymous_temp_user@yahoo.co.jp> * Add "mode" support for jconf Now jconf supports "mode" setting, allowed values are "tcp_only", "tcp_and_udp" and "udp_only". Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Use jconf "mode" for server/local/tunnel/manager Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Add per-project vimrc to gitignore As the coding style differs from kernel and other projects, so such project vimrc should be helpful. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Introduce asciidoc based documentation framework Use asciidoc for new documentation framework, which could not only output man pages, but also htmls. And asciidoc documentation is much more human-readable than roff man pages. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert shadowsocks-libev man page to asciidoc The port to asciidoc has some format change compared to old one. The most obvious one is the options listed in SYNOPSIS. Now the options list is not split into 2/3 columns, or we must use asciidoc tables and introduce table frames. Other small change includes the removal of AUTHOR sector, as it's not an expendable method to update AUTHOR sector every time it gets updated. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-local man page to asciidoc Also modify gitignore, since it use too generic rules to ignore such documentation. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-manager man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-nat man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-redir man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-server man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-tunnel man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Remove old roff man pages Welcome to the new age of asciidoc. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Add equivalent tables for command line options and config file Now user can get a more clear view of config file and command line options. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp>
8 years ago
Asciidoc man page rework (#699) * Add 'tunnel_address' support for json config parser And allow ss-tunnel to use the newly introduced parser. Signed-off-by: Adam Anonymous <anonymous_temp_user@yahoo.co.jp> * Add "mode" support for jconf Now jconf supports "mode" setting, allowed values are "tcp_only", "tcp_and_udp" and "udp_only". Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Use jconf "mode" for server/local/tunnel/manager Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Add per-project vimrc to gitignore As the coding style differs from kernel and other projects, so such project vimrc should be helpful. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Introduce asciidoc based documentation framework Use asciidoc for new documentation framework, which could not only output man pages, but also htmls. And asciidoc documentation is much more human-readable than roff man pages. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert shadowsocks-libev man page to asciidoc The port to asciidoc has some format change compared to old one. The most obvious one is the options listed in SYNOPSIS. Now the options list is not split into 2/3 columns, or we must use asciidoc tables and introduce table frames. Other small change includes the removal of AUTHOR sector, as it's not an expendable method to update AUTHOR sector every time it gets updated. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-local man page to asciidoc Also modify gitignore, since it use too generic rules to ignore such documentation. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-manager man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-nat man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-redir man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-server man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-tunnel man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Remove old roff man pages Welcome to the new age of asciidoc. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Add equivalent tables for command line options and config file Now user can get a more clear view of config file and command line options. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp>
8 years ago
Asciidoc man page rework (#699) * Add 'tunnel_address' support for json config parser And allow ss-tunnel to use the newly introduced parser. Signed-off-by: Adam Anonymous <anonymous_temp_user@yahoo.co.jp> * Add "mode" support for jconf Now jconf supports "mode" setting, allowed values are "tcp_only", "tcp_and_udp" and "udp_only". Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Use jconf "mode" for server/local/tunnel/manager Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Add per-project vimrc to gitignore As the coding style differs from kernel and other projects, so such project vimrc should be helpful. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Introduce asciidoc based documentation framework Use asciidoc for new documentation framework, which could not only output man pages, but also htmls. And asciidoc documentation is much more human-readable than roff man pages. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert shadowsocks-libev man page to asciidoc The port to asciidoc has some format change compared to old one. The most obvious one is the options listed in SYNOPSIS. Now the options list is not split into 2/3 columns, or we must use asciidoc tables and introduce table frames. Other small change includes the removal of AUTHOR sector, as it's not an expendable method to update AUTHOR sector every time it gets updated. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-local man page to asciidoc Also modify gitignore, since it use too generic rules to ignore such documentation. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-manager man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-nat man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-redir man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-server man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Convert ss-tunnel man page to asciidoc Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Remove old roff man pages Welcome to the new age of asciidoc. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp> * Doc: Add equivalent tables for command line options and config file Now user can get a more clear view of config file and command line options. Signed-off-by: Adam Anonymous <anonymous_temp_mail@yahoo.co.jp>
8 years ago
12 years ago
12 years ago
11 years ago
12 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
8 years ago
12 years ago
8 years ago
8 years ago
8 years ago
8 years ago
12 years ago
12 years ago
12 years ago
10 years ago
12 years ago
  1. dnl -*- Autoconf -*-
  2. dnl Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.67])
  4. AC_INIT([shadowsocks-libev], [2.5.1], [max.c.lv@gmail.com])
  5. AC_CONFIG_SRCDIR([src/encrypt.c])
  6. AC_CONFIG_HEADERS([config.h])
  7. AC_CONFIG_AUX_DIR(auto)
  8. AC_CONFIG_MACRO_DIR([m4])
  9. AC_USE_SYSTEM_EXTENSIONS
  10. AM_INIT_AUTOMAKE([subdir-objects foreign -Wno-gnu -Werror])
  11. m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
  12. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  13. AM_MAINTAINER_MODE
  14. AM_DEP_TRACK
  15. dnl Checks for lib
  16. AC_DISABLE_STATIC
  17. AC_DISABLE_SHARED
  18. LT_INIT([dlopen])
  19. dnl Check for pcre library
  20. TS_CHECK_PCRE
  21. if test "x${enable_pcre}" != "xyes"; then
  22. AC_MSG_ERROR([Cannot find pcre library. Configure --with-pcre=DIR])
  23. fi
  24. dnl Checks for using shared libraries from system
  25. AC_ARG_ENABLE(
  26. [system-shared-lib],
  27. AS_HELP_STRING([--enable-system-shared-lib], [build against shared libraries when possible]),
  28. [
  29. case "${enableval}" in
  30. yes) enable_system_shared_lib=true ;;
  31. no) enable_system_shared_lib=false ;;
  32. *) AC_MSG_ERROR([bad value ${enableval} for --enable-system-shared-lib]) ;;
  33. esac], [enable_system_shared_lib=false])
  34. AM_CONDITIONAL([USE_SYSTEM_SHARED_LIB], [test x$enable_system_shared_lib = xtrue])
  35. dnl Checks for crypto library
  36. AC_ARG_WITH(
  37. [crypto-library],
  38. [AS_HELP_STRING([--with-crypto-library=library], [build with the given crypto library, TYPE=openssl|polarssl|mbedtls @<:@default=openssl@:>@])],
  39. [
  40. case "${withval}" in
  41. openssl|polarssl|mbedtls) ;;
  42. *) AC_MSG_ERROR([bad value ${withval} for --with-crypto-library]) ;;
  43. esac
  44. ],
  45. [with_crypto_library="openssl"]
  46. )
  47. AC_ARG_ENABLE([documentation],
  48. AS_HELP_STRING([--disable-documentation], [do not build documentation]),
  49. [disable_documentation=true],
  50. [disable_documentation=false])
  51. AM_CONDITIONAL([ENABLE_DOCUMENTATION], [test x$disable_documentation = xfalse])
  52. AM_COND_IF([ENABLE_DOCUMENTATION], [
  53. AC_PATH_PROG([ASCIIDOC], [asciidoc], [asciidoc])
  54. AC_PATH_PROG([XMLTO], [xmlto], [xmlto])
  55. AC_PATH_PROG([GZIP], [gzip], [gzip])
  56. AC_PATH_PROG([RM], [rm], [rm])
  57. AC_PATH_PROG([MV], [mv], [mv])
  58. AC_PROG_SED
  59. ])
  60. dnl Checks for programs.
  61. AC_PROG_CC
  62. AM_PROG_CC_C_O
  63. AC_PROG_INSTALL
  64. AC_PROG_LN_S
  65. AC_PROG_LIBTOOL
  66. AC_PROG_MAKE_SET
  67. AC_LANG_SOURCE
  68. dnl Checks for libev
  69. AM_COND_IF([USE_SYSTEM_SHARED_LIB],
  70. [],
  71. [m4_include([libev/libev.m4])])
  72. dnl Add library for mingw
  73. case $host in
  74. *-mingw*)
  75. LIBS="$LIBS -ladvapi32 -lgdi32 -lws2_32 -lcrypt32"
  76. ;;
  77. *)
  78. ;;
  79. esac
  80. dnl Checks for TLS
  81. AX_TLS([:], [:])
  82. dnl Checks for crypto library
  83. case "${with_crypto_library}" in
  84. openssl)
  85. ss_ZLIB
  86. ss_OPENSSL
  87. AC_DEFINE([USE_CRYPTO_OPENSSL], [1], [Use OpenSSL library])
  88. ;;
  89. polarssl)
  90. ss_POLARSSL
  91. AC_DEFINE([USE_CRYPTO_POLARSSL], [1], [Use PolarSSL library])
  92. ;;
  93. mbedtls)
  94. ss_MBEDTLS
  95. AC_DEFINE([USE_CRYPTO_MBEDTLS], [1], [Use mbed TLS library])
  96. ;;
  97. esac
  98. dnl Checks for Apple CommonCrypto API
  99. AC_ARG_ENABLE(applecc,
  100. AS_HELP_STRING([--enable-applecc], [enable Apple CommonCrypto API support]),
  101. [
  102. AC_CHECK_HEADERS(CommonCrypto/CommonCrypto.h,
  103. [],
  104. [AC_MSG_ERROR([CommonCrypto header files not found.]); break]
  105. )
  106. AC_CHECK_FUNCS([CCCryptorCreateWithMode], ,
  107. [AC_MSG_ERROR([CommonCrypto API needs OS X (>= 10.7) and iOS (>= 5.0).]); break]
  108. )
  109. AC_DEFINE([USE_CRYPTO_APPLECC], [1], [Use Apple CommonCrypto library])
  110. ]
  111. )
  112. dnl Checks for inet_ntop
  113. ss_FUNC_INET_NTOP
  114. dnl Checks for host.
  115. AC_MSG_CHECKING(for what kind of host)
  116. case $host in
  117. *-linux*)
  118. os_support=linux
  119. AC_MSG_RESULT(Linux)
  120. ;;
  121. *-mingw*)
  122. dnl Add custom macros for libev
  123. AC_DEFINE([FD_SETSIZE], [2048], [Reset max file descriptor size.])
  124. AC_DEFINE([EV_FD_TO_WIN32_HANDLE(fd)], [(fd)], [Override libev default fd conversion macro.])
  125. AC_DEFINE([EV_WIN32_HANDLE_TO_FD(handle)], [(handle)], [Override libev default handle conversion macro.])
  126. AC_DEFINE([EV_WIN32_CLOSE_FD(fd)], [closesocket(fd)], [Override libev default fd close macro.])
  127. os_support=mingw
  128. AC_MSG_RESULT(MinGW)
  129. ;;
  130. *)
  131. AC_MSG_RESULT(transparent proxy does not support for $host)
  132. ;;
  133. esac
  134. dnl Checks for pthread
  135. AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS"
  136. CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
  137. CC="$PTHREAD_CC"], AC_MSG_ERROR(Can not find pthreads. This is required.))
  138. dnl Checks for stack protector
  139. GGL_CHECK_STACK_PROTECTOR([has_stack_protector=yes], [has_stack_protector=no])
  140. # XXX - disable -fstack-protector due to missing libssp_nonshared
  141. case "$host_os" in
  142. *aix*)
  143. AC_MSG_NOTICE([-fstack-protector disabled on AIX])
  144. has_stack_protector=no
  145. ;;
  146. *sunos*)
  147. AC_MSG_NOTICE([-fstack-protector disabled on SunOS])
  148. has_stack_protector=no
  149. ;;
  150. *solaris*)
  151. AC_MSG_NOTICE([-fstack-protector disabled on Solaris])
  152. has_stack_protector=no
  153. ;;
  154. esac
  155. AC_ARG_ENABLE(ssp,
  156. [AS_HELP_STRING(--disable-ssp,Do not compile with -fstack-protector)],
  157. [
  158. enable_ssp="no"
  159. ],
  160. [
  161. enable_ssp="yes"
  162. ])
  163. if test x$has_stack_protector = xyes && test x$enable_ssp = xyes; then
  164. CFLAGS="$CFLAGS -fstack-protector"
  165. AC_MSG_NOTICE([-fstack-protector enabled in CFLAGS])
  166. fi
  167. AM_CONDITIONAL(BUILD_REDIRECTOR, test "$os_support" = "linux")
  168. AM_CONDITIONAL(BUILD_WINCOMPAT, test "$os_support" = "mingw")
  169. dnl Checks for header files.
  170. AC_CHECK_HEADERS([limits.h stdint.h inttypes.h arpa/inet.h fcntl.h langinfo.h locale.h netdb.h netinet/in.h stdlib.h string.h strings.h unistd.h sys/ioctl.h])
  171. dnl A special check required for <net/if.h> on Darwin. See
  172. dnl http://www.gnu.org/software/autoconf/manual/html_node/Header-Portability.html.
  173. AC_CHECK_HEADERS([sys/socket.h])
  174. AC_CHECK_HEADERS([net/if.h], [], [],
  175. [
  176. #include <stdio.h>
  177. #ifdef STDC_HEADERS
  178. # include <stdlib.h>
  179. # include <stddef.h>
  180. #else
  181. # ifdef HAVE_STDLIB_H
  182. # include <stdlib.h>
  183. # endif
  184. #endif
  185. #ifdef HAVE_SYS_SOCKET_H
  186. # include <sys/socket.h>
  187. #endif
  188. ])
  189. case $host in
  190. *-mingw*)
  191. AC_DEFINE([CONNECT_IN_PROGRESS], [WSAEWOULDBLOCK], [errno for incomplete non-blocking connect(2)])
  192. AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h], [], [AC_MSG_ERROR([Missing MinGW headers])], [])
  193. ;;
  194. *-linux*)
  195. AC_DEFINE([CONNECT_IN_PROGRESS], [EINPROGRESS], [errno for incomplete non-blocking connect(2)])
  196. dnl Checks for netfilter headers
  197. AC_CHECK_HEADERS([linux/if.h linux/netfilter_ipv4.h linux/netfilter_ipv6/ip6_tables.h],
  198. [], [AC_MSG_ERROR([Missing netfilter headers])],
  199. [[
  200. #if HAVE_LIMITS_H
  201. #include <limits.h>
  202. #endif
  203. /* Netfilter ip(6)tables v1.4.0 has broken headers */
  204. #if HAVE_NETINET_IN_H
  205. #include <netinet/in.h>
  206. #endif
  207. #if HAVE_LINUX_IF_H
  208. #include <linux/if.h>
  209. #endif
  210. #if HAVE_SYS_SOCKET_H
  211. #include <sys/socket.h>
  212. #endif
  213. ]])
  214. ;;
  215. *)
  216. # These are POSIX-like systems using BSD-like sockets API.
  217. AC_DEFINE([CONNECT_IN_PROGRESS], [EINPROGRESS], [errno for incomplete non-blocking connect(2)])
  218. ;;
  219. esac
  220. AC_C_BIGENDIAN
  221. dnl Checks for typedefs, structures, and compiler characteristics.
  222. AC_C_INLINE
  223. AC_TYPE_SSIZE_T
  224. dnl Checks for header files.
  225. AC_HEADER_ASSERT
  226. AC_HEADER_STDC
  227. AC_HEADER_SYS_WAIT
  228. dnl Checks for typedefs, structures, and compiler characteristics.
  229. AC_C_CONST
  230. AC_TYPE_PID_T
  231. AC_TYPE_SIZE_T
  232. AC_TYPE_SSIZE_T
  233. AC_TYPE_UINT16_T
  234. AC_TYPE_UINT8_T
  235. AC_HEADER_TIME
  236. dnl Checks for library functions.
  237. AC_FUNC_FORK
  238. AC_FUNC_SELECT_ARGTYPES
  239. AC_TYPE_SIGNAL
  240. AC_CHECK_FUNCS([memset select setresuid setreuid strerror getpwnam_r setrlimit])
  241. dnl Check for select() into ws2_32 for Msys/Mingw
  242. if test "$ac_cv_func_select" != "yes"; then
  243. AC_MSG_CHECKING([for select in ws2_32])
  244. AC_TRY_LINK([
  245. #ifdef HAVE_WINSOCK2_H
  246. #ifndef WIN32_LEAN_AND_MEAN
  247. #define WIN32_LEAN_AND_MEAN
  248. #endif
  249. #include <winsock2.h>
  250. #endif
  251. ],[
  252. select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL);
  253. ],[
  254. AC_MSG_RESULT([yes])
  255. HAVE_SELECT="1"
  256. AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
  257. [Define to 1 if you have the 'select' function.])
  258. HAVE_SYS_SELECT_H="1"
  259. AC_DEFINE_UNQUOTED(HAVE_SYS_SELECT_H, 1,
  260. [Define to 1 if you have the <sys/select.h> header file.])
  261. ],[
  262. AC_MSG_ERROR([no])
  263. ])
  264. fi
  265. AC_CHECK_LIB(socket, connect)
  266. dnl Checks for library functions.
  267. AC_CHECK_FUNCS([malloc memset socket])
  268. dnl Add define for libudns to enable IPv6 support
  269. dnl This is an option defined in the origin configure script
  270. AC_DEFINE([HAVE_IPv6], [1], [Enable IPv6 support in libudns])
  271. AM_COND_IF([USE_SYSTEM_SHARED_LIB],
  272. [],
  273. [AC_CONFIG_SUBDIRS([libsodium])])
  274. AC_CONFIG_FILES([ shadowsocks-libev.pc
  275. Makefile
  276. libcork/Makefile
  277. libipset/Makefile
  278. src/Makefile])
  279. AM_COND_IF([USE_SYSTEM_SHARED_LIB],
  280. [],
  281. [AC_CONFIG_FILES([libudns/Makefile
  282. libev/Makefile])])
  283. AM_COND_IF([ENABLE_DOCUMENTATION],
  284. [AC_CONFIG_FILES([doc/Makefile])
  285. ])
  286. AC_OUTPUT