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.

318 lines
8.6 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.4.8], [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 Checks for using shared libraries from system
  20. AC_ARG_ENABLE(
  21. [system-shared-lib],
  22. AS_HELP_STRING([--enable-system-shared-lib], [build against shared libraries when possible]),
  23. [
  24. case "${enableval}" in
  25. yes) enable_system_shared_lib=true ;;
  26. no) enable_system_shared_lib=false ;;
  27. *) AC_MSG_ERROR([bad value ${enableval} for --enable-system-shared-lib]) ;;
  28. esac], [enable_system_shared_lib=false])
  29. AM_CONDITIONAL([USE_SYSTEM_SHARED_LIB], [test x$enable_system_shared_lib = xtrue])
  30. dnl Checks for crypto library
  31. AC_ARG_WITH(
  32. [crypto-library],
  33. [AS_HELP_STRING([--with-crypto-library=library], [build with the given crypto library, TYPE=openssl|polarssl|mbedtls @<:@default=openssl@:>@])],
  34. [
  35. case "${withval}" in
  36. openssl|polarssl|mbedtls) ;;
  37. *) AC_MSG_ERROR([bad value ${withval} for --with-crypto-library]) ;;
  38. esac
  39. ],
  40. [with_crypto_library="openssl"]
  41. )
  42. AC_ARG_ENABLE([documentation],
  43. AS_HELP_STRING([--disable-documentation], [do not build documentation]),
  44. [disable_documentation=true],
  45. [disable_documentation=false])
  46. AM_CONDITIONAL([ENABLE_DOCUMENTATION], [test x$disable_documentation = xfalse])
  47. AM_COND_IF([ENABLE_DOCUMENTATION], [
  48. AC_PATH_PROG([ASCIIDOC], [asciidoc], [asciidoc])
  49. AC_PATH_PROG([XMLTO], [xmlto], [xmlto])
  50. AC_PATH_PROG([GZIP], [gzip], [gzip])
  51. AC_PATH_PROG([RM], [rm], [rm])
  52. AC_PATH_PROG([MV], [mv], [mv])
  53. AC_PROG_SED
  54. ])
  55. dnl Checks for programs.
  56. AC_PROG_CC
  57. AM_PROG_CC_C_O
  58. AC_PROG_INSTALL
  59. AC_PROG_LN_S
  60. AC_PROG_LIBTOOL
  61. AC_PROG_MAKE_SET
  62. AC_LANG_SOURCE
  63. dnl Checks for libev
  64. AM_COND_IF([USE_SYSTEM_SHARED_LIB],
  65. [],
  66. [m4_include([libev/libev.m4])])
  67. dnl Add library for mingw
  68. case $host in
  69. *-mingw*)
  70. LIBS="$LIBS -ladvapi32 -lgdi32 -lws2_32 -lcrypt32"
  71. ;;
  72. *)
  73. ;;
  74. esac
  75. dnl Checks for TLS
  76. AX_TLS([:], [:])
  77. dnl Checks for crypto library
  78. case "${with_crypto_library}" in
  79. openssl)
  80. ss_ZLIB
  81. ss_OPENSSL
  82. AC_DEFINE([USE_CRYPTO_OPENSSL], [1], [Use OpenSSL library])
  83. ;;
  84. polarssl)
  85. ss_POLARSSL
  86. AC_DEFINE([USE_CRYPTO_POLARSSL], [1], [Use PolarSSL library])
  87. ;;
  88. mbedtls)
  89. ss_MBEDTLS
  90. AC_DEFINE([USE_CRYPTO_MBEDTLS], [1], [Use mbed TLS library])
  91. ;;
  92. esac
  93. dnl Checks for Apple CommonCrypto API
  94. AC_ARG_ENABLE(applecc,
  95. AS_HELP_STRING([--enable-applecc], [enable Apple CommonCrypto API support]),
  96. [
  97. AC_CHECK_HEADERS(CommonCrypto/CommonCrypto.h,
  98. [],
  99. [AC_MSG_ERROR([CommonCrypto header files not found.]); break]
  100. )
  101. AC_CHECK_FUNCS([CCCryptorCreateWithMode], ,
  102. [AC_MSG_ERROR([CommonCrypto API needs OS X (>= 10.7) and iOS (>= 5.0).]); break]
  103. )
  104. AC_DEFINE([USE_CRYPTO_APPLECC], [1], [Use Apple CommonCrypto library])
  105. ]
  106. )
  107. dnl Checks for inet_ntop
  108. ss_FUNC_INET_NTOP
  109. dnl Checks for host.
  110. AC_MSG_CHECKING(for what kind of host)
  111. case $host in
  112. *-linux*)
  113. os_support=linux
  114. AC_MSG_RESULT(Linux)
  115. ;;
  116. *-mingw*)
  117. dnl Add custom macros for libev
  118. AC_DEFINE([FD_SETSIZE], [2048], [Reset max file descriptor size.])
  119. AC_DEFINE([EV_FD_TO_WIN32_HANDLE(fd)], [(fd)], [Override libev default fd conversion macro.])
  120. AC_DEFINE([EV_WIN32_HANDLE_TO_FD(handle)], [(handle)], [Override libev default handle conversion macro.])
  121. AC_DEFINE([EV_WIN32_CLOSE_FD(fd)], [closesocket(fd)], [Override libev default fd close macro.])
  122. os_support=mingw
  123. AC_MSG_RESULT(MinGW)
  124. ;;
  125. *)
  126. AC_MSG_RESULT(transparent proxy does not support for $host)
  127. ;;
  128. esac
  129. dnl Checks for pthread
  130. AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS"
  131. CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
  132. CC="$PTHREAD_CC"], AC_MSG_ERROR(Can not find pthreads. This is required.))
  133. dnl Checks for stack protector
  134. GGL_CHECK_STACK_PROTECTOR([has_stack_protector=yes], [has_stack_protector=no])
  135. # XXX - disable -fstack-protector due to missing libssp_nonshared
  136. case "$host_os" in
  137. *aix*)
  138. AC_MSG_NOTICE([-fstack-protector disabled on AIX])
  139. has_stack_protector=no
  140. ;;
  141. *sunos*)
  142. AC_MSG_NOTICE([-fstack-protector disabled on SunOS])
  143. has_stack_protector=no
  144. ;;
  145. *solaris*)
  146. AC_MSG_NOTICE([-fstack-protector disabled on Solaris])
  147. has_stack_protector=no
  148. ;;
  149. esac
  150. AC_ARG_ENABLE(ssp,
  151. [AS_HELP_STRING(--disable-ssp,Do not compile with -fstack-protector)],
  152. [
  153. enable_ssp="no"
  154. ],
  155. [
  156. enable_ssp="yes"
  157. ])
  158. if test x$has_stack_protector = xyes && test x$enable_ssp = xyes; then
  159. CFLAGS="$CFLAGS -fstack-protector"
  160. AC_MSG_NOTICE([-fstack-protector enabled in CFLAGS])
  161. fi
  162. AM_CONDITIONAL(BUILD_REDIRECTOR, test "$os_support" = "linux")
  163. AM_CONDITIONAL(BUILD_WINCOMPAT, test "$os_support" = "mingw")
  164. dnl Checks for header files.
  165. 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])
  166. dnl A special check required for <net/if.h> on Darwin. See
  167. dnl http://www.gnu.org/software/autoconf/manual/html_node/Header-Portability.html.
  168. AC_CHECK_HEADERS([sys/socket.h])
  169. AC_CHECK_HEADERS([net/if.h], [], [],
  170. [
  171. #include <stdio.h>
  172. #ifdef STDC_HEADERS
  173. # include <stdlib.h>
  174. # include <stddef.h>
  175. #else
  176. # ifdef HAVE_STDLIB_H
  177. # include <stdlib.h>
  178. # endif
  179. #endif
  180. #ifdef HAVE_SYS_SOCKET_H
  181. # include <sys/socket.h>
  182. #endif
  183. ])
  184. case $host in
  185. *-mingw*)
  186. AC_DEFINE([CONNECT_IN_PROGRESS], [WSAEWOULDBLOCK], [errno for incomplete non-blocking connect(2)])
  187. AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h], [], [AC_MSG_ERROR([Missing MinGW headers])], [])
  188. ;;
  189. *-linux*)
  190. AC_DEFINE([CONNECT_IN_PROGRESS], [EINPROGRESS], [errno for incomplete non-blocking connect(2)])
  191. dnl Checks for netfilter headers
  192. AC_CHECK_HEADERS([linux/if.h linux/netfilter_ipv4.h linux/netfilter_ipv6/ip6_tables.h],
  193. [], [AC_MSG_ERROR([Missing netfilter headers])],
  194. [[
  195. #if HAVE_LIMITS_H
  196. #include <limits.h>
  197. #endif
  198. /* Netfilter ip(6)tables v1.4.0 has broken headers */
  199. #if HAVE_NETINET_IN_H
  200. #include <netinet/in.h>
  201. #endif
  202. #if HAVE_LINUX_IF_H
  203. #include <linux/if.h>
  204. #endif
  205. #if HAVE_SYS_SOCKET_H
  206. #include <sys/socket.h>
  207. #endif
  208. ]])
  209. ;;
  210. *)
  211. # These are POSIX-like systems using BSD-like sockets API.
  212. AC_DEFINE([CONNECT_IN_PROGRESS], [EINPROGRESS], [errno for incomplete non-blocking connect(2)])
  213. ;;
  214. esac
  215. AC_C_BIGENDIAN
  216. dnl Checks for typedefs, structures, and compiler characteristics.
  217. AC_C_INLINE
  218. AC_TYPE_SSIZE_T
  219. dnl Checks for header files.
  220. AC_HEADER_ASSERT
  221. AC_HEADER_STDC
  222. AC_HEADER_SYS_WAIT
  223. dnl Checks for typedefs, structures, and compiler characteristics.
  224. AC_C_CONST
  225. AC_TYPE_PID_T
  226. AC_TYPE_SIZE_T
  227. AC_TYPE_SSIZE_T
  228. AC_TYPE_UINT16_T
  229. AC_TYPE_UINT8_T
  230. AC_HEADER_TIME
  231. dnl Checks for library functions.
  232. AC_FUNC_FORK
  233. AC_FUNC_SELECT_ARGTYPES
  234. AC_TYPE_SIGNAL
  235. AC_CHECK_FUNCS([memset select setresuid setreuid strerror getpwnam_r setrlimit])
  236. dnl Check for select() into ws2_32 for Msys/Mingw
  237. if test "$ac_cv_func_select" != "yes"; then
  238. AC_MSG_CHECKING([for select in ws2_32])
  239. AC_TRY_LINK([
  240. #ifdef HAVE_WINSOCK2_H
  241. #ifndef WIN32_LEAN_AND_MEAN
  242. #define WIN32_LEAN_AND_MEAN
  243. #endif
  244. #include <winsock2.h>
  245. #endif
  246. ],[
  247. select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL);
  248. ],[
  249. AC_MSG_RESULT([yes])
  250. HAVE_SELECT="1"
  251. AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
  252. [Define to 1 if you have the 'select' function.])
  253. HAVE_SYS_SELECT_H="1"
  254. AC_DEFINE_UNQUOTED(HAVE_SYS_SELECT_H, 1,
  255. [Define to 1 if you have the <sys/select.h> header file.])
  256. ],[
  257. AC_MSG_ERROR([no])
  258. ])
  259. fi
  260. AC_CHECK_LIB(socket, connect)
  261. dnl Checks for library functions.
  262. AC_CHECK_FUNCS([malloc memset socket])
  263. dnl Add define for libudns to enable IPv6 support
  264. dnl This is an option defined in the origin configure script
  265. AC_DEFINE([HAVE_IPv6], [1], [Enable IPv6 support in libudns])
  266. AM_COND_IF([USE_SYSTEM_SHARED_LIB],
  267. [],
  268. [AC_CONFIG_SUBDIRS([libsodium])])
  269. AC_CONFIG_FILES([ shadowsocks-libev.pc
  270. Makefile
  271. libcork/Makefile
  272. libipset/Makefile
  273. src/Makefile])
  274. AM_COND_IF([USE_SYSTEM_SHARED_LIB],
  275. [],
  276. [AC_CONFIG_FILES([libudns/Makefile
  277. libev/Makefile])])
  278. AM_COND_IF([ENABLE_DOCUMENTATION],
  279. [AC_CONFIG_FILES([doc/Makefile])
  280. ])
  281. AC_OUTPUT