diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2022-11-29 19:07:34 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2022-11-29 19:07:34 -0500 |
commit | d229296fb59f460bc9f081c18c1f767eae31070f (patch) | |
tree | e87193e0265452942def6d4a73971c060d08d96f | |
parent | ea9b7c9415544bc7e74bbaa90341694f5621b791 (diff) | |
download | lite-xl-plugin-manager-d229296fb59f460bc9f081c18c1f767eae31070f.tar.gz lite-xl-plugin-manager-d229296fb59f460bc9f081c18c1f767eae31070f.zip |
Windows fixes.
-rwxr-xr-x | build.sh | 8 | ||||
-rw-r--r-- | src/lpm.c | 2 |
2 files changed, 6 insertions, 4 deletions
@@ -11,14 +11,16 @@ LDFLAGS="$LDFLAGS -lm -pthread -static-libgcc" [[ "$@" == "clean" ]] && rm -rf lib/libgit2/build lib/zlib/build lib/mbedtls-2.27.0/build lib/curl/build lib/libarchive/build-tmp lib/liblzma/build lib/prefix lua $BIN *.exe src/lpm.luac src/lpm.lua.c && exit 0 # Build supporting libraries, libz, libmbedtls, libmbedcrypto, libgit2, liblzma, libarchive, liblua -CMAKE_DEFAULT_FLAGS="$CMAKE_DEFAULT_FLAGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=`pwd`/lib/prefix -DCMAKE_INSTALL_PREFIX=`pwd`/lib/prefix -DBUILD_SHARED_LIBS=OFF" +CMAKE_DEFAULT_FLAGS=" $CMAKE_DEFAULT_FLAGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=`pwd`/lib/prefix -DCMAKE_INSTALL_PREFIX=`pwd`/lib/prefix -DBUILD_SHARED_LIBS=OFF" +mkdir -p lib/prefix/include lib/prefix/lib if [[ "$@" != *"-lz"* ]]; then [ ! -e "lib/zlib" ] && echo "Make sure you've cloned submodules. (git submodule update --init --depth=1)" && exit -1 - [ ! -e "lib/zlib/build" ] && cd lib/zlib && mkdir build && cd build && ../configure --prefix=`pwd`/../../prefix && $MAKE -j $JOBS && $MAKE install && cd ../../../ + [ ! -e "lib/zlib/build" && $OSTYPE == 'msys'* ] && cd lib/zlib && mkdir build && cd build && ../configure --prefix=`pwd`/../../prefix && $MAKE -j $JOBS && $MAKE install && cd ../../../ + [ ! -e "lib/zlib/build" && $OSTYPE != 'msys'* ] && cd lib/zlib && mkdir build && $MAKE -f ../win32/Makefile.gcc -j $JOBS && cp *.a ../prefix/lib && cp *.h ../prefix/include && cd ../../ LDFLAGS="$LDFLAGS -Llib/libz/build -l:libz.a" && CFLAGS="$CFLAGS -Ilib/prefix/include" && LDFLAGS="$LDFLAGS -Llib/prefix/lib -Llib/prefix/lib64" fi if [[ "$@" != *"-lmbedtls"* && "$@" != *"-lmbedcrypto"* ]]; then - [ ! -e "lib/mbedtls-2.27.0/build" ] && cd lib/mbedtls-2.27.0 && mkdir build && cd build && CFLAGS="-DMBEDTLS_MD4_C=1" cmake .. $CMAKE_DEFAULT_FLAGS -DENABLE_TESTING=OFF -DENABLE_PROGRAMS=OFF $SSL_CONFIGURE && CFLAGS="-DMBEDTLS_MD4_C=1" $MAKE -j $JOBS && $MAKE install && cd ../../../ + [ ! -e "lib/mbedtls-2.27.0/build" ] && cd lib/mbedtls-2.27.0 && mkdir build && cd build && CFLAGS="-DMBEDTLS_MD4_C=1" cmake .. $CMAKE_DEFAULT_FLAGS -G "Unix Makefiles" -DENABLE_TESTING=OFF -DENABLE_PROGRAMS=OFF $SSL_CONFIGURE && CFLAGS="-DMBEDTLS_MD4_C=1" $MAKE -j $JOBS && $MAKE install && cd ../../../ CFLAGS="$CFLAGS -Ilib/prefix/include" && LDFLAGS="$LDFLAGS -Llib/prefix/lib -Llib/prefix/lib64 -lmbedtls -lmbedx509 -lmbedcrypto" fi if [[ "$@" != *"-lgit2"* ]]; then @@ -19,7 +19,6 @@ #include <mbedtls/ctr_drbg.h> #include <mbedtls/ssl.h> #include <mbedtls/net.h> -#include <netinet/in.h> #include <arpa/inet.h> #ifdef _WIN32 @@ -28,6 +27,7 @@ #include <windows.h> #include <fileapi.h> #else + #include <netinet/in.h> #include <netdb.h> #include <sys/socket.h> #define MAX_PATH PATH_MAX |