diff --git a/build.sh b/build.sh index d432b37cd..e7b6a5cc9 100755 --- a/build.sh +++ b/build.sh @@ -34,6 +34,7 @@ configure() { CC=$1 \ LD=$2 \ LDFLAGS=$4 \ + CXX=$CXX_CUST \ CFLAGS="-O2 -I/usr/local/include" \ LIBS=$5 \ CXXFLAGS=$6 \ @@ -171,9 +172,10 @@ set_arch() { LD="i686-w64-mingw32-ld" MAKE_HOST="x86_64-w32-mingw32" BIN_SUFFIX=".exe" - CXXFLAGS="" - LDFLAGS="" - LIBS="" + CXXFLAGS="-I/usr/local/include" + CXX_CUST="i686-w64-mingw32-g++" + LDFLAGS="-L/usr/local/lib" + LIBS="-lws2_32" elif [ "$1" = "win64" ]; then ARCHIT="$1" CC="x86_64-w64-mingw32-gcc" diff --git a/docker/win32/Dockerfile b/docker/win32/Dockerfile new file mode 100644 index 000000000..e40cef1c7 --- /dev/null +++ b/docker/win32/Dockerfile @@ -0,0 +1,63 @@ +# +# [ win32 ] elinks docker development environment v0.1a +# + +# [*] base system + +# get latest debian +FROM debian:latest + +# prepare system +RUN apt-get update && apt-get -y install bash \ + rsync vim screen git make automake \ + gcc-mingw-w64-i686 g++-mingw-w64-i686 + +# [*] source build tools + +# install sources build tools and update +RUN apt-get install -y apt-src && \ + grep '^deb ' /etc/apt/sources.list | sed 's/deb /deb-src /' >> /etc/apt/sources.list && \ + apt-src update + +# [*] install sources + +# install sources for openssl and zlib1g-dev +RUN cd /root && apt-src install libssl-dev zlib1g-dev + +# [*] elinks openssl development support + +# +# build openssl library for win32 +# should be win2k compatible +# +RUN cd /root && cd `ls -d /root/openssl-*` && \ +sed -i '35 i \\n#undef AI_PASSIVE\n' crypto/bio/b_addr.c && \ +CFLAGS="-DWINVER=0x0501 -D_WIN32_WINNT=0x0501" \ +./Configure mingw \ + no-engine \ + no-dso \ + no-shared \ + no-asm \ + no-async \ + --prefix=/usr/local \ + --cross-compile-prefix=i686-w64-mingw32- && \ + make depend && \ + make && \ + make install_runtime_libs && \ + make install_dev + +# [*} zlib sources + +# build zlib library for win32 +RUN cd /root && cd `ls -d /root/zlib-*` && \ +CC="i686-w64-mingw32-gcc" \ +LD="i686-w64-mingw32-ldd" \ +./configure --static --prefix=/usr/local && \ +make && \ +make install + +# [*] elinks sources + +# get elinks source +RUN cd /root; git clone https://github.com/rkd77/elinks + diff --git a/docker/win32/build.sh b/docker/win32/build.sh new file mode 100755 index 000000000..a5bf763f2 --- /dev/null +++ b/docker/win32/build.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker build -t "elinks-win32-dev:latest" . diff --git a/docker/win32/cleanup.sh b/docker/win32/cleanup.sh new file mode 100755 index 000000000..ea4af352c --- /dev/null +++ b/docker/win32/cleanup.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker container rm elinks +docker image rm elinks-dev diff --git a/docker/win32/run.sh b/docker/win32/run.sh new file mode 100755 index 000000000..6707c4f4b --- /dev/null +++ b/docker/win32/run.sh @@ -0,0 +1,6 @@ +#!/bin/bash +docker run -it \ + --name=elinks-win32-dev \ + -v /home/miky:/home/miky \ + elinks-win32-dev:latest \ + /bin/bash diff --git a/docker/win32/shell.sh b/docker/win32/shell.sh new file mode 100755 index 000000000..c74eefb21 --- /dev/null +++ b/docker/win32/shell.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker start elinks +docker exec -it elinks bash