0001-Add-ss-server-and-ss-check.patch 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. --- a/.gitignore
  2. +++ b/.gitignore
  3. @@ -2,6 +2,7 @@ build/
  4. .deps/
  5. /Makefile
  6. src/Makefile
  7. +server/Makefile
  8. libev/Makefile
  9. libudns/Makefile
  10. libcork/Makefile
  11. --- a/Makefile.am
  12. +++ b/Makefile.am
  13. @@ -1,7 +1,7 @@
  14. if USE_SYSTEM_SHARED_LIB
  15. -SUBDIRS = libcork libipset src
  16. +SUBDIRS = libcork libipset src server
  17. else
  18. -SUBDIRS = libsodium libcork libipset libudns libev src
  19. +SUBDIRS = libsodium libcork libipset libudns libev src server
  20. endif
  21. if ENABLE_DOCUMENTATION
  22. --- a/Makefile.in
  23. +++ b/Makefile.in
  24. @@ -195,7 +195,7 @@ am__define_uniq_tagged_files = \
  25. ETAGS = etags
  26. CTAGS = ctags
  27. CSCOPE = cscope
  28. -DIST_SUBDIRS = libsodium libcork libipset libudns libev src doc
  29. +DIST_SUBDIRS = libsodium libcork libipset libudns libev src server doc
  30. am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
  31. $(srcdir)/shadowsocks-libev.pc.in $(top_srcdir)/auto/ar-lib \
  32. $(top_srcdir)/auto/compile $(top_srcdir)/auto/config.guess \
  33. @@ -377,8 +377,9 @@ top_build_prefix = @top_build_prefix@
  34. top_builddir = @top_builddir@
  35. top_srcdir = @top_srcdir@
  36. @USE_SYSTEM_SHARED_LIB_FALSE@SUBDIRS = libsodium libcork libipset \
  37. -@USE_SYSTEM_SHARED_LIB_FALSE@ libudns libev src $(am__append_1)
  38. -@USE_SYSTEM_SHARED_LIB_TRUE@SUBDIRS = libcork libipset src \
  39. +@USE_SYSTEM_SHARED_LIB_FALSE@ libudns libev src server \
  40. +@USE_SYSTEM_SHARED_LIB_FALSE@ $(am__append_1)
  41. +@USE_SYSTEM_SHARED_LIB_TRUE@SUBDIRS = libcork libipset src server \
  42. @USE_SYSTEM_SHARED_LIB_TRUE@ $(am__append_1)
  43. ACLOCAL_AMFLAGS = -I m4
  44. pkgconfiglibdir = $(libdir)/pkgconfig
  45. --- a/configure
  46. +++ b/configure
  47. @@ -649,7 +649,6 @@ PTHREAD_CC
  48. ax_pthread_config
  49. INET_NTOP_LIB
  50. MV
  51. -RM
  52. GZIP
  53. XMLTO
  54. ASCIIDOC
  55. @@ -757,6 +756,7 @@ infodir
  56. docdir
  57. oldincludedir
  58. includedir
  59. +runstatedir
  60. localstatedir
  61. sharedstatedir
  62. sysconfdir
  63. @@ -857,6 +857,7 @@ datadir='${datarootdir}'
  64. sysconfdir='${prefix}/etc'
  65. sharedstatedir='${prefix}/com'
  66. localstatedir='${prefix}/var'
  67. +runstatedir='${localstatedir}/run'
  68. includedir='${prefix}/include'
  69. oldincludedir='/usr/include'
  70. docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
  71. @@ -1109,6 +1110,15 @@ do
  72. | -silent | --silent | --silen | --sile | --sil)
  73. silent=yes ;;
  74. + -runstatedir | --runstatedir | --runstatedi | --runstated \
  75. + | --runstate | --runstat | --runsta | --runst | --runs \
  76. + | --run | --ru | --r)
  77. + ac_prev=runstatedir ;;
  78. + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
  79. + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
  80. + | --run=* | --ru=* | --r=*)
  81. + runstatedir=$ac_optarg ;;
  82. +
  83. -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
  84. ac_prev=sbindir ;;
  85. -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  86. @@ -1246,7 +1256,7 @@ fi
  87. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
  88. datadir sysconfdir sharedstatedir localstatedir includedir \
  89. oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
  90. - libdir localedir mandir
  91. + libdir localedir mandir runstatedir
  92. do
  93. eval ac_val=\$$ac_var
  94. # Remove trailing slashes.
  95. @@ -1399,6 +1409,7 @@ Fine tuning of the installation director
  96. --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
  97. --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
  98. --localstatedir=DIR modifiable single-machine data [PREFIX/var]
  99. + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
  100. --libdir=DIR object code libraries [EPREFIX/lib]
  101. --includedir=DIR C header files [PREFIX/include]
  102. --oldincludedir=DIR C header files for non-gcc [/usr/include]
  103. @@ -2472,8 +2483,8 @@ ac_configure="$SHELL $ac_aux_dir/configu
  104. -# expand $ac_aux_dir to an absolute path
  105. -am_aux_dir=`cd $ac_aux_dir && pwd`
  106. +# Expand $ac_aux_dir to an absolute path.
  107. +am_aux_dir=`cd "$ac_aux_dir" && pwd`
  108. ac_ext=c
  109. ac_cpp='$CPP $CPPFLAGS'
  110. @@ -3783,7 +3794,7 @@ $as_echo "$ac_cv_safe_to_define___extens
  111. -am__api_version='1.14'
  112. +am__api_version='1.15'
  113. # Find a good install program. We prefer a C program (faster),
  114. # so one script is as good as another. But avoid the broken or
  115. @@ -3972,7 +3983,7 @@ else
  116. $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
  117. fi
  118. -if test x"${install_sh}" != xset; then
  119. +if test x"${install_sh+set}" != xset; then
  120. case $am_aux_dir in
  121. *\ * | *\ *)
  122. install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
  123. @@ -4363,8 +4374,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}ma
  124. # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
  125. mkdir_p='$(MKDIR_P)'
  126. -# We need awk for the "check" target. The system "awk" is bad on
  127. -# some platforms.
  128. +# We need awk for the "check" target (and possibly the TAP driver). The
  129. +# system "awk" is bad on some platforms.
  130. # Always define AMTAR for backward compatibility. Yes, it's still used
  131. # in the wild :-( We should find a proper way to deprecate it ...
  132. AMTAR='$${TAR-tar}'
  133. @@ -4549,6 +4560,7 @@ END
  134. as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
  135. fi
  136. fi
  137. +
  138. if test -n "$ac_tool_prefix"; then
  139. for ac_prog in ar lib "link -lib"
  140. do
  141. @@ -12494,47 +12506,6 @@ $as_echo "no" >&6; }
  142. fi
  143. - # Extract the first word of "rm", so it can be a program name with args.
  144. -set dummy rm; ac_word=$2
  145. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
  146. -$as_echo_n "checking for $ac_word... " >&6; }
  147. -if ${ac_cv_path_RM+:} false; then :
  148. - $as_echo_n "(cached) " >&6
  149. -else
  150. - case $RM in
  151. - [\\/]* | ?:[\\/]*)
  152. - ac_cv_path_RM="$RM" # Let the user override the test with a path.
  153. - ;;
  154. - *)
  155. - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  156. -for as_dir in $PATH
  157. -do
  158. - IFS=$as_save_IFS
  159. - test -z "$as_dir" && as_dir=.
  160. - for ac_exec_ext in '' $ac_executable_extensions; do
  161. - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  162. - ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext"
  163. - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
  164. - break 2
  165. - fi
  166. -done
  167. - done
  168. -IFS=$as_save_IFS
  169. -
  170. - test -z "$ac_cv_path_RM" && ac_cv_path_RM="rm"
  171. - ;;
  172. -esac
  173. -fi
  174. -RM=$ac_cv_path_RM
  175. -if test -n "$RM"; then
  176. - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5
  177. -$as_echo "$RM" >&6; }
  178. -else
  179. - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  180. -$as_echo "no" >&6; }
  181. -fi
  182. -
  183. -
  184. # Extract the first word of "mv", so it can be a program name with args.
  185. set dummy mv; ac_word=$2
  186. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
  187. @@ -16204,15 +16175,162 @@ $as_echo "#define HAVE_IPv6 1" >>confdef
  188. if test -z "$USE_SYSTEM_SHARED_LIB_TRUE"; then :
  189. - else
  190. +
  191. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sodium_init in -lsodium" >&5
  192. +$as_echo_n "checking for sodium_init in -lsodium... " >&6; }
  193. +if ${ac_cv_lib_sodium_sodium_init+:} false; then :
  194. + $as_echo_n "(cached) " >&6
  195. +else
  196. + ac_check_lib_save_LIBS=$LIBS
  197. +LIBS="-lsodium $LIBS"
  198. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  199. +/* end confdefs.h. */
  200. +
  201. +/* Override any GCC internal prototype to avoid an error.
  202. + Use char because int might match the return type of a GCC
  203. + builtin and then its argument prototype would still apply. */
  204. +#ifdef __cplusplus
  205. +extern "C"
  206. +#endif
  207. +char sodium_init ();
  208. +int
  209. +main ()
  210. +{
  211. +return sodium_init ();
  212. + ;
  213. + return 0;
  214. +}
  215. +_ACEOF
  216. +if ac_fn_c_try_link "$LINENO"; then :
  217. + ac_cv_lib_sodium_sodium_init=yes
  218. +else
  219. + ac_cv_lib_sodium_sodium_init=no
  220. +fi
  221. +rm -f core conftest.err conftest.$ac_objext \
  222. + conftest$ac_exeext conftest.$ac_ext
  223. +LIBS=$ac_check_lib_save_LIBS
  224. +fi
  225. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sodium_sodium_init" >&5
  226. +$as_echo "$ac_cv_lib_sodium_sodium_init" >&6; }
  227. +if test "x$ac_cv_lib_sodium_sodium_init" = xyes; then :
  228. + cat >>confdefs.h <<_ACEOF
  229. +#define HAVE_LIBSODIUM 1
  230. +_ACEOF
  231. +
  232. + LIBS="-lsodium $LIBS"
  233. +
  234. +else
  235. +
  236. + as_fn_error $? "Couldn't find libsodium. Try installing libsodium-dev[el]." "$LINENO" 5
  237. +
  238. +fi
  239. +
  240. +
  241. +else
  242. subdirs="$subdirs libsodium"
  243. fi
  244. -ac_config_files="$ac_config_files shadowsocks-libev.pc Makefile libcork/Makefile libipset/Makefile src/Makefile"
  245. +ac_config_files="$ac_config_files shadowsocks-libev.pc Makefile libcork/Makefile libipset/Makefile src/Makefile server/Makefile"
  246. if test -z "$USE_SYSTEM_SHARED_LIB_TRUE"; then :
  247. - else
  248. +
  249. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dns_dnlen in -ludns" >&5
  250. +$as_echo_n "checking for dns_dnlen in -ludns... " >&6; }
  251. +if ${ac_cv_lib_udns_dns_dnlen+:} false; then :
  252. + $as_echo_n "(cached) " >&6
  253. +else
  254. + ac_check_lib_save_LIBS=$LIBS
  255. +LIBS="-ludns $LIBS"
  256. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  257. +/* end confdefs.h. */
  258. +
  259. +/* Override any GCC internal prototype to avoid an error.
  260. + Use char because int might match the return type of a GCC
  261. + builtin and then its argument prototype would still apply. */
  262. +#ifdef __cplusplus
  263. +extern "C"
  264. +#endif
  265. +char dns_dnlen ();
  266. +int
  267. +main ()
  268. +{
  269. +return dns_dnlen ();
  270. + ;
  271. + return 0;
  272. +}
  273. +_ACEOF
  274. +if ac_fn_c_try_link "$LINENO"; then :
  275. + ac_cv_lib_udns_dns_dnlen=yes
  276. +else
  277. + ac_cv_lib_udns_dns_dnlen=no
  278. +fi
  279. +rm -f core conftest.err conftest.$ac_objext \
  280. + conftest$ac_exeext conftest.$ac_ext
  281. +LIBS=$ac_check_lib_save_LIBS
  282. +fi
  283. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_udns_dns_dnlen" >&5
  284. +$as_echo "$ac_cv_lib_udns_dns_dnlen" >&6; }
  285. +if test "x$ac_cv_lib_udns_dns_dnlen" = xyes; then :
  286. + cat >>confdefs.h <<_ACEOF
  287. +#define HAVE_LIBUDNS 1
  288. +_ACEOF
  289. +
  290. + LIBS="-ludns $LIBS"
  291. +
  292. +else
  293. + as_fn_error $? "Couldn't find libudns. Try installing libudns-dev or udns-devel." "$LINENO" 5
  294. +fi
  295. +
  296. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ev_loop_destroy in -lev" >&5
  297. +$as_echo_n "checking for ev_loop_destroy in -lev... " >&6; }
  298. +if ${ac_cv_lib_ev_ev_loop_destroy+:} false; then :
  299. + $as_echo_n "(cached) " >&6
  300. +else
  301. + ac_check_lib_save_LIBS=$LIBS
  302. +LIBS="-lev $LIBS"
  303. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  304. +/* end confdefs.h. */
  305. +
  306. +/* Override any GCC internal prototype to avoid an error.
  307. + Use char because int might match the return type of a GCC
  308. + builtin and then its argument prototype would still apply. */
  309. +#ifdef __cplusplus
  310. +extern "C"
  311. +#endif
  312. +char ev_loop_destroy ();
  313. +int
  314. +main ()
  315. +{
  316. +return ev_loop_destroy ();
  317. + ;
  318. + return 0;
  319. +}
  320. +_ACEOF
  321. +if ac_fn_c_try_link "$LINENO"; then :
  322. + ac_cv_lib_ev_ev_loop_destroy=yes
  323. +else
  324. + ac_cv_lib_ev_ev_loop_destroy=no
  325. +fi
  326. +rm -f core conftest.err conftest.$ac_objext \
  327. + conftest$ac_exeext conftest.$ac_ext
  328. +LIBS=$ac_check_lib_save_LIBS
  329. +fi
  330. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ev_ev_loop_destroy" >&5
  331. +$as_echo "$ac_cv_lib_ev_ev_loop_destroy" >&6; }
  332. +if test "x$ac_cv_lib_ev_ev_loop_destroy" = xyes; then :
  333. + cat >>confdefs.h <<_ACEOF
  334. +#define HAVE_LIBEV 1
  335. +_ACEOF
  336. +
  337. + LIBS="-lev $LIBS"
  338. +
  339. +else
  340. + as_fn_error $? "Couldn't find libev. Try installing libev-dev[el]." "$LINENO" 5
  341. +fi
  342. +
  343. +
  344. +else
  345. ac_config_files="$ac_config_files libudns/Makefile libev/Makefile"
  346. fi
  347. @@ -17258,6 +17376,7 @@ do
  348. "libcork/Makefile") CONFIG_FILES="$CONFIG_FILES libcork/Makefile" ;;
  349. "libipset/Makefile") CONFIG_FILES="$CONFIG_FILES libipset/Makefile" ;;
  350. "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
  351. + "server/Makefile") CONFIG_FILES="$CONFIG_FILES server/Makefile" ;;
  352. "libudns/Makefile") CONFIG_FILES="$CONFIG_FILES libudns/Makefile" ;;
  353. "libev/Makefile") CONFIG_FILES="$CONFIG_FILES libev/Makefile" ;;
  354. "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
  355. @@ -17958,8 +18077,8 @@ $as_echo X"$file" |
  356. fi
  357. cfgfile="${ofile}T"
  358. - trap "$RM -f \"$cfgfile\"; exit 1" 1 2 15
  359. - $RM -f "$cfgfile"
  360. + trap "$RM \"$cfgfile\"; exit 1" 1 2 15
  361. + $RM "$cfgfile"
  362. cat <<_LT_EOF >> "$cfgfile"
  363. #! $SHELL
  364. --- a/configure.ac
  365. +++ b/configure.ac
  366. @@ -315,7 +315,8 @@ AC_CONFIG_FILES([ shadowsocks-libev.pc
  367. Makefile
  368. libcork/Makefile
  369. libipset/Makefile
  370. - src/Makefile])
  371. + src/Makefile
  372. + server/Makefile])
  373. AM_COND_IF([USE_SYSTEM_SHARED_LIB],[
  374. AC_CHECK_LIB([udns], [dns_dnlen], ,[AC_MSG_ERROR([Couldn't find libudns. Try installing libudns-dev or udns-devel.])])
  375. AC_CHECK_LIB([ev], [ev_loop_destroy], ,[AC_MSG_ERROR([Couldn't find libev. Try installing libev-dev@<:@el@:>@.])])