Compare commits

...

3 Commits

Author SHA1 Message Date
BodgeMaster 78880e1c20 setupenv: Fix spelling
Yeah, really important commit, I know.
2022-10-31 17:56:11 +01:00
BodgeMaster 1d899db889 scripts/clean: Add a link with the original file name of cygsockpp-0.dll
Otherwise, the dynamic linker complains that it can’t find the file.
2022-10-31 17:56:11 +01:00
BodgeMaster 3cc91ae33d Build system: Get sockpp to build on Cygwin
This is probably not the last time this issue needs attention
as it *builds* on Cygwin with these workarounds, but it doesn’t *work*
on Cygwin...
2022-10-31 17:56:11 +01:00
4 changed files with 16 additions and 16 deletions

View File

@ -1,11 +0,0 @@
set(CMAKE_SYSTEM_NAME Windows)
set(WIN32 true)
set(UNIX false)
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View File

@ -28,7 +28,8 @@ create_directory ./bin/lib
create_directory ./include
if uname -s | tr [:upper:] [:lower:] | grep cygwin >/dev/null; then
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.dll bin/lib/libsockpp.so
ln -vs ../../dependencies/sockpp-0.7.1/build/cygsockpp-0.dll bin/lib/libsockpp.so
ln -vs ../../dependencies/sockpp-0.7.1/build/cygsockpp-0.dll bin/lib/
else
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so bin/lib/
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so.0 bin/lib/

View File

@ -93,12 +93,22 @@ echo "done"
echo ">>> Building sockpp... "
pushd dependencies/sockpp-0.7.1/ >/dev/null 2>&1
if uname -s | tr [:upper:] [:lower:] | grep cygwin >/dev/null; then
echo "Adding cygwin workaound for building sockpp."
cmake -Bbuild -DCMAKE_TOOLCHAIN_FILE=$PROJECT_BASE_DIR/.mingw-cross.cmake -DSOCKPP_BUILD_SHARED=ON -DSOCKPP_BUILD_STATIC=OFF
echo "Adding Cygwin workaound for building sockpp."
for FILE in "$(find ./ -type f)"; do
sed -i -e 's/_WIN32/PLEASE_DO_NOT_DEFINE_THIS_MACRO/g' $FILE
done
mv ./include/sockpp/socket.h ./include/sockpp/socket.h_original
echo '#include <sys/time.h>
#include "socket.h_original"' > ./include/sockpp/socket.h
sed -i -e 's/SO_REUSEPORT/SO_REUSEADDR/g' ./src/acceptor.cpp
CFLAGS="-D_XOPEN_SOURCE=700" CXXFLAGS="-D_XOPEN_SOURCE=700" cmake -Bbuild
CFLAGS="-D_XOPEN_SOURCE=700" CXXFLAGS="-D_XOPEN_SOURCE=700" cmake --build build
else
cmake -Bbuild .
fi
cmake --build build
fi
popd >/dev/null 2>&1
echo ">>> Cleaning up..."

View File

@ -43,7 +43,7 @@ echo "Added aliases and functions."
export PATH="$PROJECT_BASE_DIR/bin:$PROJECT_BASE_DIR/bin/tools:$PROJECT_BASE_DIR/scripts/tools:$PATH"
if uname -s | tr [:upper:] [:lower:] | grep cygwin >/dev/null; then
echo "Adding cygwin workaound for library path."
echo "Adding Cygwin workaound for library path."
export PATH="$PROJECT_BASE_DIR/bin/lib:$PATH"
fi
echo "PATH is $PATH"