-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
134 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,6 @@ src/*.o | |
extension/lua/*.o | ||
extension/mdns_utils/*.o | ||
.vscode/ | ||
win/out/ | ||
!win/openssl/README.md | ||
win/openssl/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
# About | ||
|
||
this is windows building dir under MSYS2. | ||
|
||
you can edit `build.sh` for further configuration. | ||
|
||
|
||
## Building | ||
|
||
under MSYS2 bash shell, just | ||
|
||
```sh | ||
$ sh build.sh | ||
``` | ||
|
||
if you need OpenSSL, read OpenSSL section to copy required resoureces. | ||
|
||
|
||
## Runing | ||
|
||
Win+R open cmd.exe, run server | ||
|
||
```sh | ||
> run.bat out\tls_test_reconnect.exe -s | ||
``` | ||
|
||
Win+R open another cmd.exe, run client side | ||
|
||
```sh | ||
> run.bat out\tls_test_reconnect.exe -c | ||
``` | ||
|
||
and you can test `out\tls_test_rwdata.exe`. | ||
|
||
|
||
## OpenSSL | ||
|
||
the project contains an pre-compiled OpenSSL bundle under Win10, you can get it from release page. | ||
|
||
or you can install lastest OpenSSL from [https://slproweb.com/products/Win32OpenSSL.html](https://slproweb.com/products/Win32OpenSSL.html), | ||
|
||
after install to `C:\Program Files\OpenSSL-Win64`, copy lib and headers to `openssl/` dir | ||
|
||
- copy `libcrypto` and `libssl` into `openssl/lib/` dir, link to short name. | ||
- copy `include/` header dir into `openssl/` dir. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# | ||
# build script under MSYS2 | ||
# | ||
|
||
CC=gcc | ||
CPP=g++ | ||
|
||
CFLAGS=' -Wall -std=c99 -Wdeprecated-declarations -D_POSIX_C_SOURCE=200112L -DWEPOLL_EXPRIMENT' | ||
CPPFLAGS=' -Wall -Wdeprecated-declarations -Wno-deprecated' | ||
|
||
OPENSSL_DIR='include' | ||
MNET_LIBNAME='mnet.dll' | ||
|
||
DEBUG=' -g' | ||
RELEASE=' -O2' | ||
LIBS=' -lWs2_32 -lmnet -Lbuild' | ||
|
||
LIB_SRCS=" ../src/*.c ../extension/mdns_utils/mdns_utils.c" | ||
E_SRCS=" ../examples/*.c" | ||
T_SRCS=" ../test/*.c" | ||
|
||
OE_SRCS="../examples/openssl/*.c" | ||
OL_SRCS="../extension/openssl/*.c" | ||
OT_SRCS="../test/openssl/*.c" | ||
|
||
CPP_SRCS="../test/*.cpp ../examples/*.cpp" | ||
|
||
DIRS="../src/ ../extension/openssl/" | ||
INCS="-I../src/ -I../extension/openssl/" | ||
|
||
O_INCS="-Iopenssl/include" | ||
O_DIRS="-Lopenssl/lib -Lout" | ||
O_LIBS=" -lssl -lcrypto" | ||
|
||
OUT="out" | ||
|
||
# build | ||
# | ||
sh clean.sh | ||
|
||
# lib | ||
#echo $CC $RELEASE $CFLAGS $INCS -o $OUT/$MNET_LIBNAME $LIB_SRCS -lWs2_32 -shared -fPIC | ||
#$CC $RELEASE $CFLAGS $INCS -o $OUT/$MNET_LIBNAME $LIB_SRCS -lWs2_32 -shared -fPIC | ||
|
||
# pull | ||
#echo $CC $DEBUG $CFLAGS $INCS -o $OUT/ntp.out $E_SRCS $LIBS -DEXAMPLE_NTP | ||
#$CC $DEBUG $CFLAGS $INCS -o $OUT/ntp.out $E_SRCS $LIBS -DEXAMPLE_NTP | ||
|
||
#echo $CC $DEBUG $CFLAGS $INCS -o $OUT/echo_svr_pull_style.out $E_SRCS $LIBS -DEXAMPLE_ECHO_SVR_PULL_STYLE | ||
#$CC $DEBUG $CFLAGS $INCS -o $OUT/echo_svr_pull_style.out $E_SRCS $LIBS -DEXAMPLE_ECHO_SVR_PULL_STYLE | ||
|
||
# callback | ||
#echo $CPP $DEBUG $CPPFLAGS $INCS --std=c++0x -o $OUT/echo_cnt.out $CPP_SRCS $LIBS -DEXAMPLE_ECHO_CNT | ||
#$CPP $DEBUG $CPPFLAGS $INCS --std=c++0x -o $OUT/echo_cnt.out $CPP_SRCS $LIBS -DEXAMPLE_ECHO_CNT | ||
|
||
# openssl | ||
echo $CC $RELEASE $CFLAGS $INCS $O_INCS $O_DIRS -o $OUT/$MNET_LIBNAME $LIB_SRCS $OL_SRCS -lWs2_32 -shared -fPIC $O_LIBS | ||
$CC $RELEASE $CFLAGS $INCS $O_INCS $O_DIRS -o $OUT/$MNET_LIBNAME $LIB_SRCS $OL_SRCS -lWs2_32 -shared -fPIC $O_LIBS | ||
|
||
echo $CC $DEBUG $CFLAGS $INCS $O_INCS $O_DIRS -o $OUT/tls_test_reconnect $OT_SRCS $O_LIBS -lmnet -DMNET_TLS_TEST_RECONNECT_PULL_STYLE | ||
$CC $DEBUG $CFLAGS $INCS $O_INCS $O_DIRS -o $OUT/tls_test_reconnect $OT_SRCS $O_LIBS -lmnet -DMNET_TLS_TEST_RECONNECT_PULL_STYLE | ||
|
||
echo $CC $DEBUG $CFLAGS $INCS $O_INCS $O_DIRS -o $OUT/tls_test_rwdata $OT_SRCS $O_LIBS -lmnet -DMNET_TLS_TEST_RWDATA_PULL_STYLE | ||
$CC $DEBUG $CFLAGS $INCS $O_INCS $O_DIRS -o $OUT/tls_test_rwdata $OT_SRCS $O_LIBS -lmnet -DMNET_TLS_TEST_RWDATA_PULL_STYLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# | ||
# clean dir | ||
echo === clean dir === | ||
echo rm -rf out | ||
rm -rf out | ||
echo mkdir -p out | ||
mkdir -p out | ||
echo rm -rf examples | ||
rm -rf examples | ||
echo === clean end === |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- copy `libcrypto` and `libssl` into `openssl/lib/` dir, link to short name. | ||
- copy `include/` header dir into `openssl/` dir. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
rem | ||
rem | ||
|
||
echo off | ||
PATH=%PATH%;openssl\lib\;bulid\; | ||
RD /S /Q examples | ||
XCOPY ..\examples .\examples /Y /E /I /Q | ||
%* |