Skip to content

Implement building multithreaded for windows. #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ jobs:
sudo docker run --rm dockcross/windows-x64 > dockcross-windows-x64
cat dockcross-windows-x64
chmod +x dockcross-windows-x64
wget https://curl.haxx.se/download/curl-7.69.1.tar.gz
wget https://curl.haxx.se/download/curl-7.80.0.tar.gz
tar xzf curl-*
CURL_SRC=curl-*
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && ./configure --prefix="/work/deps/curl" --host=x86_64-w64-mingw32.static --with-winssl --disable-dependency-tracking --disable-pthreads --disable-pthreads --enable-threaded-resolver'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && ./configure --prefix="/work/deps/curl" --host=x86_64-w64-mingw32.static --disable-shared --with-schannel --disable-dependency-tracking --enable-threaded-resolver --disable-imap --disable-pop3 --disable-smtp --disable-ldap --disable-mqtt --disable-smb'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make install'

- name: Build Release
run: |
mkdir -p build/bin
./dockcross-windows-x64 make install NO_PTHREADS=1 STATIC=true EXE=true PREFIX=build
./dockcross-windows-x64 make install STATIC=true EXE=true PREFIX=build

- uses: actions/upload-artifact@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ jobs:
sudo docker run --rm dockcross/windows-x64 > dockcross-windows-x64
cat dockcross-windows-x64
chmod +x dockcross-windows-x64
wget https://curl.haxx.se/download/curl-7.69.1.tar.gz
wget https://curl.haxx.se/download/curl-7.80.0.tar.gz
tar xzf curl-*
CURL_SRC=curl-*
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && ./configure --prefix="/work/deps/curl" --host=x86_64-w64-mingw32.static --with-winssl --disable-dependency-tracking --disable-pthreads --disable-pthreads --enable-threaded-resolver'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && ./configure --prefix="/work/deps/curl" --host=x86_64-w64-mingw32.static --disable-shared --with-schannel --disable-dependency-tracking --enable-threaded-resolver --disable-imap --disable-pop3 --disable-smtp --disable-ldap --disable-mqtt --disable-smb'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make'
./dockcross-windows-x64 bash -c 'cd '"$CURL_SRC"' && make install'
- name: Run Tests
run: |
## if builds pass then its passing for now
./dockcross-windows-x64 make all NO_PTHREADS=1 STATIC=true EXE=true
./dockcross-windows-x64 make all STATIC=true EXE=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
clib
clib-install
clib-search
*.exe
*.o
*.d
tmp/
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ MAKEFILES = $(wildcard deps/*/Makefile)

export CC

CFLAGS += -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__

ifdef STATIC
CFLAGS += -DCURL_STATICLIB -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__ $(shell deps/curl/bin/curl-config --cflags)
CFLAGS += -DCURL_STATICLIB $(shell deps/curl/bin/curl-config --cflags)
LDFLAGS += -static $(shell deps/curl/bin/curl-config --static-libs)
else
CFLAGS += -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__ $(shell curl-config --cflags)
CFLAGS += $(shell curl-config --cflags)
LDFLAGS += $(shell curl-config --libs)
endif

Expand Down
2 changes: 1 addition & 1 deletion scripts/feature-test-pthreads
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
echo '#include <pthread.h>' &&
echo 'void *f(void *a) { return 0; }' &&
echo 'int main(void) { pthread_t t; return pthread_create(&t, 0, f, 0); }';
} | ${CC:-cc} -o /dev/null -xc -pthread - 2>/dev/null
} | ${CC:-cc} -o pthread_test -xc -pthread - 2>/dev/null && rm pthread_test
exit $?