mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-26 18:08:23 +08:00
Initial Windows build support for NE
This commit is contained in:
parent
4b2b997079
commit
fc1e614d02
21
.appveyor.yml
Normal file
21
.appveyor.yml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
image: Visual Studio 2015
|
||||||
|
|
||||||
|
environment:
|
||||||
|
matrix:
|
||||||
|
- MSYS2_ARCH: i686
|
||||||
|
MSYSTEM: MINGW32
|
||||||
|
|
||||||
|
clone_depth: 10
|
||||||
|
|
||||||
|
build_script:
|
||||||
|
- cd %APPVEYOR_BUILD_FOLDER%
|
||||||
|
- set PATH=C:\msys64\mingw32\bin;C:\msys64\usr\bin;%PATH%
|
||||||
|
- bash ./unixbuild.sh
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
provider: GitHub
|
||||||
|
auth_token:
|
||||||
|
secure: zSJnpSnrKY1NO5RPVBaD/uq7UPyc+GW7ecjPFqEMsLjtnd6H+iNfROdoeuxJgt5T
|
||||||
|
artifact: /dist\\.*\.zip/
|
||||||
|
on:
|
||||||
|
appveyor_repo_tag: true
|
@ -14,7 +14,7 @@ WITHWARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <inttypes.h>
|
#include <cinttypes>
|
||||||
|
|
||||||
#include "descriptor.h"
|
#include "descriptor.h"
|
||||||
#include "ffs.h"
|
#include "ffs.h"
|
||||||
|
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <cinttypes>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "nvramparser.h"
|
#include "nvramparser.h"
|
||||||
|
@ -40,7 +40,7 @@ not recommended that bformat be used at all. */
|
|||||||
#define START_VSNBUFF (256)
|
#define START_VSNBUFF (256)
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if defined (__GNUC__) && !defined (__PPC__)
|
#if defined (__GNUC__) && !defined (__PPC__) && !defined(__WIN32__)
|
||||||
/* Something is making gcc complain about this prototype not being here, so
|
/* Something is making gcc complain about this prototype not being here, so
|
||||||
I've just gone ahead and put it in. */
|
I've just gone ahead and put it in. */
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
42
unixbuild.sh
42
unixbuild.sh
@ -1,11 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
UTARGET=$(uname)
|
UTARGET=$(uname)
|
||||||
|
BINSUFFIX=""
|
||||||
|
|
||||||
if [ "$UTARGET" = "Darwin" ]; then
|
if [ "$UTARGET" = "Darwin" ]; then
|
||||||
export UPLATFORM="mac"
|
export UPLATFORM="mac"
|
||||||
elif [ "$UTARGET" = "Linux" ]; then
|
elif [ "$UTARGET" = "Linux" ]; then
|
||||||
export UPLATFORM="linux_$(uname -m)"
|
export UPLATFORM="linux_$(uname -m)"
|
||||||
|
elif [ "${UTARGET/MINGW32/}" != "$UTARGET" ]; then
|
||||||
|
export UPLATFORM="win32"
|
||||||
|
export BINSUFFIX=".exe"
|
||||||
else
|
else
|
||||||
# Fallback to something...
|
# Fallback to something...
|
||||||
export UPLATFORM="$UTARGET"
|
export UPLATFORM="$UTARGET"
|
||||||
@ -27,6 +31,28 @@ if [ "$UPLATFORM" = "mac" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
export PATH="/opt/qt56sm/bin:$PATH"
|
export PATH="/opt/qt56sm/bin:$PATH"
|
||||||
|
elif [ "$UPLATFORM" = "win32" ]; then
|
||||||
|
# Install missing dependencies
|
||||||
|
pacman -S --noconfirm --needed zip unzip curl perl mingw-w64-i686-toolchain mingw-w64-i686-cmake || exit 1
|
||||||
|
|
||||||
|
# Fix PATH to support running shasum.
|
||||||
|
export PATH="/usr/bin/core_perl:$PATH"
|
||||||
|
|
||||||
|
if [ ! -d "/c/Qt/5.6/mingw49_32_release_static/" ]; then
|
||||||
|
curl -L -o /tmp/qt-5.6.3-static-win32.zip https://github.com/distdb/qtbuilds/blob/master/qt-5.6.3-static-win32.zip?raw=true || exit 1
|
||||||
|
qtsum=$(shasum -a 256 /tmp/qt-5.6.3-static-win32.zip | cut -f1 -d' ')
|
||||||
|
qtexpsum="bcd85145d6fed00da37498c08c49d763c6fa883337f754880b5c786899e6bb1d"
|
||||||
|
if [ "$qtsum" != "$qtexpsum" ]; then
|
||||||
|
echo "Qt hash $qtsum does not match $qtexpsum"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
mkdir -p /c/Qt/5.6 || exit 1
|
||||||
|
cd /c/Qt/5.6 || exit 1
|
||||||
|
unzip -q /tmp/qt-5.6.3-static-win32.zip || exit 1
|
||||||
|
cd - || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PATH="/c/Qt/5.6/mingw49_32_release_static/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Attempting to build UEFITool NE for ${UPLATFORM}..."
|
echo "Attempting to build UEFITool NE for ${UPLATFORM}..."
|
||||||
@ -51,25 +77,35 @@ build_tool() {
|
|||||||
# -flto is flawed on CI atm
|
# -flto is flawed on CI atm
|
||||||
if [ "$UPLATFORM" = "mac" ]; then
|
if [ "$UPLATFORM" = "mac" ]; then
|
||||||
qmake $3 QMAKE_CXXFLAGS+=-flto QMAKE_LFLAGS+=-flto CONFIG+=optimize_size || exit 1
|
qmake $3 QMAKE_CXXFLAGS+=-flto QMAKE_LFLAGS+=-flto CONFIG+=optimize_size || exit 1
|
||||||
|
elif [ "$UPLATFORM" = "win32" ]; then
|
||||||
|
qmake $3 QMAKE_CXXFLAGS="-static -flto -Os" QMAKE_LFLAGS="-static -flto -Os" CONFIG+=optimize_size CONFIG+=staticlib CONFIG+=static || exit 1
|
||||||
else
|
else
|
||||||
qmake $3 CONFIG+=optimize_size || exit 1
|
qmake $3 CONFIG+=optimize_size || exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ "$UPLATFORM" = "mac" ]; then
|
if [ "$UPLATFORM" = "mac" ]; then
|
||||||
cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-stdlib=libc++ -flto -Os -mmacosx-version-min=10.7" -DCMAKE_C_FLAGS="-flto -Os -mmacosx-version-min=10.7" || exit 1
|
cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-stdlib=libc++ -flto -Os -mmacosx-version-min=10.7" -DCMAKE_C_FLAGS="-flto -Os -mmacosx-version-min=10.7" || exit 1
|
||||||
|
elif [ "$UPLATFORM" = "win32" ]; then
|
||||||
|
cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-static -Os" -DCMAKE_C_FLAGS="-static -Os" || exit 1
|
||||||
else
|
else
|
||||||
cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-Os" -DCMAKE_C_FLAGS="-Os" || exit 1
|
cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-Os" -DCMAKE_C_FLAGS="-Os" || exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make || exit 1
|
make || exit 1
|
||||||
|
|
||||||
|
# Move the binary out of the dir
|
||||||
|
if [ "$UPLATFORM" = "win32" ] && [ -f "release/${1}${BINSUFFIX}" ]; then
|
||||||
|
mv "release/${1}${BINSUFFIX}" "${1}${BINSUFFIX}" || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Archive
|
# Archive
|
||||||
if [ "$1" = "UEFITool" ] && [ "$UPLATFORM" = "mac" ]; then
|
if [ "$1" = "UEFITool" ] && [ "$UPLATFORM" = "mac" ]; then
|
||||||
strip -x UEFITool.app/Contents/MacOS/UEFITool || exit 1
|
strip -x UEFITool.app/Contents/MacOS/UEFITool || exit 1
|
||||||
zip -qry ../dist/"${1}_NE_${2}_${UPLATFORM}.zip" UEFITool.app "${4}" || exit 1
|
zip -qry ../dist/"${1}_NE_${2}_${UPLATFORM}.zip" UEFITool.app ${4} || exit 1
|
||||||
else
|
else
|
||||||
strip -x "$1" || exit 1
|
strip -x "${1}${BINSUFFIX}" || exit 1
|
||||||
zip -qry ../dist/"${1}_NE_${2}_${UPLATFORM}.zip" "${1}" "${4}" || exit 1
|
zip -qry ../dist/"${1}_NE_${2}_${UPLATFORM}.zip" "${1}${BINSUFFIX}" ${4} || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Return to parent
|
# Return to parent
|
||||||
|
Loading…
Reference in New Issue
Block a user