Skip to content

Commit

Permalink
Drop MinGW32 support
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Jan 24, 2017
1 parent 61018b6 commit 3f8cd98
Show file tree
Hide file tree
Showing 28 changed files with 42 additions and 520 deletions.
6 changes: 6 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
shadowsocks-libev (2.6.3-1) unstable; urgency=medium

* Refine the project structure.

-- Max Lv <max.c.lv@gmail.com> Tue, 24 Jan 2017 19:10:45 +0800

shadowsocks-libev (2.6.2-1) unstable; urgency=medium

* Refine SIP003 plugin support.
Expand Down
5 changes: 5 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ ACLOCAL_AMFLAGS = -I m4

pkgconfiglibdir = $(libdir)/pkgconfig
pkgconfiglib_DATA = shadowsocks-libev.pc

EXTRA_DIST = acl Changes completions debian docker rpm README.md
EXTRA_DIST += libcork/include libipset/include
EXTRA_DIST += libipset/src/libipset/map/inspection-template.c.in
EXTRA_DIST += libipset/src/libipset/set/inspection-template.c.in
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ It is a port of [Shadowsocks](https://github.com/shadowsocks/shadowsocks)
created by [@clowwindy](https://github.com/clowwindy), and maintained by
[@madeye](https://github.com/madeye) and [@linusyang](https://github.com/linusyang).

Current version: 2.6.2 | [Changelog](debian/changelog)
Current version: 2.6.3 | [Changelog](debian/changelog)

Travis CI: [![Travis CI](https://travis-ci.org/shadowsocks/shadowsocks-libev.svg?branch=master)](https://travis-ci.org/shadowsocks/shadowsocks-libev)

Expand Down
56 changes: 3 additions & 53 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
AC_INIT([shadowsocks-libev], [2.6.2], [max.c.lv@gmail.com])
AC_INIT([shadowsocks-libev], [2.6.3], [max.c.lv@gmail.com])
AC_CONFIG_SRCDIR([src/encrypt.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR(auto)
Expand Down Expand Up @@ -76,19 +76,6 @@ AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
AC_LANG_SOURCE

dnl Add library for mingw
case $host in
*-mingw*)
CFLAGS="$CFLAGS -mno-ms-bitfields"
LIBS="$LIBS -ladvapi32 -lgdi32 -lws2_32 -lcrypt32"
;;
*-cygwin*)
CFLAGS="$CFLAGS -mno-ms-bitfields"
;;
*)
;;
esac

dnl Checks for TLS
AX_TLS([:], [:])

Expand Down Expand Up @@ -135,15 +122,8 @@ case $host in
os_support=linux
AC_MSG_RESULT(Linux)
;;
*-mingw*)
dnl Add custom macros for libev
AC_DEFINE([FD_SETSIZE], [2048], [Reset max file descriptor size.])
AC_DEFINE([EV_FD_TO_WIN32_HANDLE(fd)], [(fd)], [Override libev default fd conversion macro.])
AC_DEFINE([EV_WIN32_HANDLE_TO_FD(handle)], [(handle)], [Override libev default handle conversion macro.])
AC_DEFINE([EV_WIN32_CLOSE_FD(fd)], [closesocket(fd)], [Override libev default fd close macro.])

os_support=mingw
AC_MSG_RESULT(MinGW)
*-cygwin*)
CFLAGS="$CFLAGS -mno-ms-bitfields"
;;
*)
AC_MSG_RESULT(transparent proxy does not support for $host)
Expand Down Expand Up @@ -188,7 +168,6 @@ if test x$has_stack_protector = xyes && test x$enable_ssp = xyes; then
fi

AM_CONDITIONAL(BUILD_REDIRECTOR, test "$os_support" = "linux")
AM_CONDITIONAL(BUILD_WINCOMPAT, test "$os_support" = "mingw")

dnl Checks for header files.
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])
Expand All @@ -213,10 +192,6 @@ AC_CHECK_HEADERS([net/if.h], [], [],
])

case $host in
*-mingw*)
AC_DEFINE([CONNECT_IN_PROGRESS], [WSAEWOULDBLOCK], [errno for incomplete non-blocking connect(2)])
AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h], [], [AC_MSG_ERROR([Missing MinGW headers])], [])
;;
*-linux*)
AC_DEFINE([CONNECT_IN_PROGRESS], [EINPROGRESS], [errno for incomplete non-blocking connect(2)])
dnl Checks for netfilter headers
Expand Down Expand Up @@ -270,31 +245,6 @@ AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([memset select setresuid setreuid strerror getpwnam_r setrlimit])

dnl Check for select() into ws2_32 for Msys/Mingw
if test "$ac_cv_func_select" != "yes"; then
AC_MSG_CHECKING([for select in ws2_32])
AC_TRY_LINK([
#ifdef HAVE_WINSOCK2_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
#endif
],[
select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL);
],[
AC_MSG_RESULT([yes])
HAVE_SELECT="1"
AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
[Define to 1 if you have the 'select' function.])
HAVE_SYS_SELECT_H="1"
AC_DEFINE_UNQUOTED(HAVE_SYS_SELECT_H, 1,
[Define to 1 if you have the <sys/select.h> header file.])
],[
AC_MSG_ERROR([no])
])
fi

AC_CHECK_LIB(socket, connect)

dnl Checks for library functions.
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
shadowsocks-libev (2.6.3-1) unstable; urgency=medium

* Refine the project structure.

-- Max Lv <max.c.lv@gmail.com> Tue, 24 Jan 2017 19:10:45 +0800

shadowsocks-libev (2.6.2-1) unstable; urgency=medium

* Refine SIP003 plugin support.
Expand Down
2 changes: 2 additions & 0 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ html-local: $(MAN_HTML)

doc_DATA = $(MAN_HTML)
CLEANFILES = $(MAN_XML) $(man_MANS) $(MAN_HTML)

EXTRA_DIST = *.asciidoc asciidoc.conf *.xsl
2 changes: 1 addition & 1 deletion docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
FROM alpine
MAINTAINER kev <noreply@datageek.info>

ARG SS_VER=2.6.2
ARG SS_VER=2.6.3
ARG SS_URL=https://github.com/shadowsocks/shadowsocks-libev/archive/v$SS_VER.tar.gz

ENV SERVER_ADDR 0.0.0.0
Expand Down
4 changes: 2 additions & 2 deletions rpm/genrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ show_help()
echo
echo -e "Options:"
echo -e " -h show this help."
echo -e " -v with argument version (2.6.2 by default)."
echo -e " -v with argument version (2.6.3 by default)."
echo -e " -f with argument format (tar.xz by default) used by git archive."
echo
echo -e "Examples:"
Expand Down Expand Up @@ -38,7 +38,7 @@ do
esac
done

: ${version:=2.6.2}
: ${version:=2.6.3}
: ${format:=tar.gz}

name="shadowsocks-libev"
Expand Down
14 changes: 5 additions & 9 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ SS_COMMON_LIBS = $(top_builddir)/libipset/libipset.la \
$(INET_NTOP_LIB) $(LIBPCRE_LIBS)
SS_COMMON_LIBS += -lev -lsodium -lm

bin_PROGRAMS = ss-local ss-tunnel
if !BUILD_WINCOMPAT
bin_PROGRAMS += ss-server ss-manager
endif
bin_PROGRAMS = ss-local ss-tunnel ss-server ss-manager

sni_src = http.c \
tls.c \
Expand Down Expand Up @@ -77,11 +74,6 @@ ss_tunnel_CFLAGS = $(AM_CFLAGS) -DMODULE_TUNNEL
ss_server_CFLAGS = $(AM_CFLAGS) -DMODULE_REMOTE
ss_manager_CFLAGS = $(AM_CFLAGS) -DMODULE_MANAGER

if BUILD_WINCOMPAT
ss_local_SOURCES += win32.c
ss_tunnel_SOURCES += win32.c
endif

if BUILD_REDIRECTOR
bin_SCRIPTS = ss-nat
bin_PROGRAMS += ss-redir
Expand All @@ -107,3 +99,7 @@ libshadowsocks_libev_la_CFLAGS = $(ss_local_CFLAGS) -DLIB_ONLY
libshadowsocks_libev_la_LDFLAGS = -version-info $(VERSION_INFO)
libshadowsocks_libev_la_LIBADD = $(ss_local_LDADD)
include_HEADERS = shadowsocks.h

noinst_HEADERS = acl.h encrypt.h json.h netutils.h redir.h server.h tls.h uthash.h \
cache.h http.h local.h plugin.h resolv.h tunnel.h utils.h \
common.h jconf.h manager.h protocol.h rule.h socks5.h udprelay.h
4 changes: 0 additions & 4 deletions src/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
#include "cache.h"
#include "utils.h"

#ifdef __MINGW32__
#include "win32.h"
#endif

/** Creates a new cache object
*
* @param dst
Expand Down
2 changes: 0 additions & 2 deletions src/encrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@

#include <sodium.h>

#ifndef __MINGW32__
#include <arpa/inet.h>
#endif

#include "cache.h"
#include "encrypt.h"
Expand Down
13 changes: 0 additions & 13 deletions src/encrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,7 @@
#ifndef _ENCRYPT_H
#define _ENCRYPT_H

#ifndef __MINGW32__
#include <sys/socket.h>
#else

#ifdef max
#undef max
#endif

#ifdef min
#undef min
#endif

#endif

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
Loading

0 comments on commit 3f8cd98

Please sign in to comment.