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

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