Skip to content

Commit

Permalink
[core] use 'wdk' instead of 'ddk' and drop IA64 support
Browse files Browse the repository at this point in the history
* This means that DDK_DIR/--with-ddkdir has been changed to WDK_DIR/--with-wdkdir
* Also fix precommit version update and AppVeyor builds
  • Loading branch information
pbatard committed Jun 23, 2017
1 parent 4636409 commit d94a117
Show file tree
Hide file tree
Showing 19 changed files with 73 additions and 117 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
*.aps
*.db*
*.dep
*.exe
*.htm
*.idb
*.ilk
*.ipch
*.la
*.lib
*.lo
Expand All @@ -13,6 +16,7 @@
*.ncb
*.o
*.obj
*.opendb
*.opt
*.pc
*.pdb
Expand Down
4 changes: 2 additions & 2 deletions _pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ fi
echo "setting nano to $TAGVER"

cat > cmd.sed <<\_EOF
s/^[ \t]*FILEVERSION[ \t]*\(.*\),\(.*\),\(.*\),.*/ FILEVERSION \1,\2,\3,@@TAGVER@@/
s/^[ \t]*PRODUCTVERSION[ \t]*\(.*\),\(.*\),\(.*\),.*/ PRODUCTVERSION \1,\2,\3,@@TAGVER@@/
s/^[ \t]*FILEVERSION[ \t]*\(.*\),\(.*\),.*,0/ FILEVERSION \1,\2,@@TAGVER@@,0/
s/^[ \t]*PRODUCTVERSION[ \t]*\(.*\),\(.*\),.*,0/ PRODUCTVERSION \1,\2,@@TAGVER@@,0/
s/^\([ \t]*\)VALUE[ \t]*"FileVersion",[ \t]*"\(.*\)\..*"/\1VALUE "FileVersion", "\2.@@TAGVER@@"/
s/^\([ \t]*\)VALUE[ \t]*"ProductVersion",[ \t]*"\(.*\)\..*"/\1VALUE "ProductVersion", "\2.@@TAGVER@@"/
s/^\(.*\)"Zadig \(.*\)\..*"\(.*\)/\1"Zadig \2.@@TAGVER@@"\3/
Expand Down
6 changes: 4 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ build:
verbosity: detailed

install:
- curl -o wdk10-redist.7z -L http://files.akeo.ie/appveyor/libwdi/wdk10-redist.7z
- curl -o libusb-win32-bin-1.2.6.0.zip -L http://files.akeo.ie/appveyor/libwdi/libusb-win32-bin-1.2.6.0.zip
- curl -o libusbK-3.0.7.0-bin.7z -L http://files.akeo.ie/appveyor/libwdi/libusbK-3.0.7.0-bin.7z
- 7z x wdk10-redist.7z
- 7z x libusb-win32-bin-1.2.6.0.zip
- 7z x libusbK-3.0.7.0-bin.7z
- if [%PLATFORM%]==[x86_64] set BITS=64
- if [%PLATFORM%]==[x86_64] set EXTRA_OPTS=--disable-32bit

build_script:
- if [%COMPILER%]==[MSVC] msbuild libwdi.sln /m /p:Configuration=%CONFIGURATION%,Platform=%PLATFORM%,BuildMacros="LIBUSB0_DIR=\"c:/projects/libwdi/libusb-win32-bin-1.2.6.0\";LIBUSBK_DIR=\"c:/projects/libwdi/libusbK-3.0.7.0-bin/bin\"" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- if [%COMPILER%]==[MinGW] C:\msys64\usr\bin\bash -lc "export PATH=/mingw%BITS%/bin:$PATH; cd /c/projects/libwdi; ./bootstrap.sh; ./configure --build=%PLATFORM%-w64-mingw32 --host=%PLATFORM%-w64-mingw32 --enable-toggable-debug --enable-examples-build --disable-debug --disable-shared %EXTRA_OPTS% --with-ddkdir=\"C:/Program Files (x86)/Windows Kits/10\" --with-wdfver=1011 --with-libusb0=\"C:/Projects/libwdi/libusb-win32-bin-1.2.6.0\" --with-libusbk=\"C:/Projects/libwdi/libusbK-3.0.7.0-bin/bin\"; make -j4"
- if [%COMPILER%]==[MSVC] msbuild libwdi.sln /m /p:Configuration=%CONFIGURATION%,Platform=%PLATFORM%,BuildMacros="WDK_DIR=\"c:/projects/libwdi/wdk\";LIBUSB0_DIR=\"c:/projects/libwdi/libusb-win32-bin-1.2.6.0\";LIBUSBK_DIR=\"c:/projects/libwdi/libusbK-3.0.7.0-bin/bin\"" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- if [%COMPILER%]==[MinGW] C:\msys64\usr\bin\bash -lc "export PATH=/mingw%BITS%/bin:$PATH; cd /c/projects/libwdi; ./bootstrap.sh; ./configure --build=%PLATFORM%-w64-mingw32 --host=%PLATFORM%-w64-mingw32 --enable-toggable-debug --enable-examples-build --disable-debug --disable-shared %EXTRA_OPTS% --with-wdkdir=\"C:/Projects/libwdi/wdk\" --with-wdfver=1011 --with-libusb0=\"C:/Projects/libwdi/libusb-win32-bin-1.2.6.0\" --with-libusbk=\"C:/Projects/libwdi/libusbK-3.0.7.0-bin/bin\"; make -j4"
2 changes: 1 addition & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ create_def()
set -e

./bootstrap.sh
./configure --enable-toggable-debug --enable-examples-build --disable-debug --with-ddkdir="C:/Program Files (x86)/Windows Kits/10" --with-wdfver=1011 --with-libusb0="D:/libusb-win32" --with-libusbk="D:/libusbK/bin" $*
./configure --enable-toggable-debug --enable-examples-build --disable-debug --with-wdkdir="C:/Program Files (x86)/Windows Kits/10" --with-wdfver=1011 --with-libusb0="D:/libusb-win32" --with-libusbk="D:/libusbK/bin" $*
# rebuild .def, if sed is available
type -P sed &>/dev/null && create_def
58 changes: 19 additions & 39 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ AC_C_INLINE
AM_PROG_CC_C_O
AC_DEFINE([_GNU_SOURCE], [], [Use GNU extensions])

AC_ARG_WITH([ddkdir],
[AS_HELP_STRING([--with-ddkdir], [embed WinUSB driver files from the following DDK location])],
[DDK_DIR=$withval],
[DDK_DIR=""])
if test "x$DDK_DIR" != "x"; then
AC_DEFINE_UNQUOTED([DDK_DIR], ["${DDK_DIR}"], [embed WinUSB driver files from the following DDK location])
AC_ARG_WITH([wdkdir],
[AS_HELP_STRING([--with-wdkdir], [embed WinUSB driver files from the following WDK location])],
[WDK_DIR=$withval],
[WDK_DIR=""])
if test "x$WDK_DIR" != "x"; then
AC_DEFINE_UNQUOTED([WDK_DIR], ["${WDK_DIR}"], [embed WinUSB driver files from the following WDK location])
fi

AC_ARG_WITH([wdfver],
[AS_HELP_STRING([--with-wdfver], [WDF/KDMF version to use (default 1011)])],
[WDF_VER=$withval],
[WDF_VER=1011])
AC_DEFINE_UNQUOTED([WDF_VER], [${WDF_VER}], [DDK WDF/KMDF coinstaller version])
AC_DEFINE_UNQUOTED([WDF_VER], [${WDF_VER}], [WDK WDF/KMDF coinstaller version])

AC_ARG_WITH([libusb0],
[AS_HELP_STRING([--with-libusb0], [embed libusb0 driver files from the following location])],
Expand All @@ -54,8 +54,8 @@ if test "x$USER_DIR" != "x"; then
AC_DEFINE_UNQUOTED([USER_DIR], ["${USER_DIR}"], [embed user defined driver files from the following location])
fi

if test "x$USER_DIR" == "x" -a "x$DDK_DIR" == "x" -a "x$LIBUSB0_DIR" == "x" -a "x$LIBUSBK_DIR" == "x"; then
AC_MSG_ERROR([One of --with-ddkdir, --with-libusb0, --with-libusbk or --with-userdir options MUST be provided.])
if test "x$USER_DIR" == "x" -a "x$WDK_DIR" == "x" -a "x$LIBUSB0_DIR" == "x" -a "x$LIBUSBK_DIR" == "x"; then
AC_MSG_ERROR([One of --with-wdkdir, --with-libusb0, --with-libusbk or --with-userdir options MUST be provided.])
fi

AC_MSG_CHECKING([development environment])
Expand Down Expand Up @@ -155,10 +155,6 @@ AC_ARG_ENABLE([64bit], [AS_HELP_STRING([--enable-64bit],
[build 64 bit compatible library (default y)])],
[enable_64bit='$enableval'],
[enable_64bit='yes'])
AC_ARG_ENABLE([ia64], [AS_HELP_STRING([--enable-ia64],
[embed IA64/Itanium driver files (default n)])],
[enable_ia64='$enableval'],
[enable_ia64='no'])
if test "x$enable_64bit" == "xno" -a "x$enable_32bit" == "xno"; then
AC_MSG_ERROR([you cannot disable both 32 and 64 bit support])
fi
Expand Down Expand Up @@ -191,10 +187,6 @@ if test "x$enable_64bit" != "xno"; then
AC_SUBST([OPT_M64])
fi
AM_CONDITIONAL([OPT_M64], [test "x$enable_64bit" != "xno"])
if test "x$enable_ia64" != "xno"; then
AC_DEFINE([OPT_IA64], [], [embed IA64 driver files])
AC_SUBST([OPT_IA64])
fi

if test "x$enable_64bit" != "xno"; then
# the default is to produce 32 bit, when both 64 and 32 bit support are available
Expand All @@ -221,29 +213,25 @@ AC_SUBST([ARCH_RCFLAGS])
# AC_CHECK_FILES only works when not cross compiling
if test "$cross_compiling" != "yes"
then
if test "x$DDK_DIR" != "x"; then
# check that the required WinUSB DDK files are available
AC_CHECK_FILES([$DDK_DIR/redist/winusb/], [COINSTALLER_DIR="winusb"], [COINSTALLER_DIR="wdf"])
if test "x$WDK_DIR" != "x"; then
# check that the required WinUSB WDK files are available
AC_CHECK_FILES([$WDK_DIR/redist/winusb/], [COINSTALLER_DIR="winusb"], [COINSTALLER_DIR="wdf"])
AC_DEFINE_UNQUOTED([COINSTALLER_DIR], ["${COINSTALLER_DIR}"], [CoInstaller subdirectory for WinUSB redist files ("winusb" or "wdf")])
AC_SUBST([COINSTALLER_DIR])
if test "x$enable_64bit" != "xno"; then
AC_CHECK_FILES([$DDK_DIR/redist/wdf/x64/], [X64_DIR="x64"], [X64_DIR="amd64"])
AC_CHECK_FILES([$WDK_DIR/redist/wdf/x64/], [X64_DIR="x64"], [X64_DIR="amd64"])
AC_DEFINE_UNQUOTED([X64_DIR], ["${X64_DIR}"], [64bit subdirectory for WinUSB redist files ("x64" or "amd64")])
AC_SUBST([X64_DIR])
AC_CHECK_FILES([$DDK_DIR/redist/wdf/${X64_DIR}/WdfCoInstaller0${WDF_VER}.dll $DDK_DIR/redist/${COINSTALLER_DIR}/${X64_DIR}/winusbcoinstaller2.dll], [],
[AC_MSG_ERROR([the WinUSB x64 driver files could not be detected (--with-ddkdir)])])
AC_CHECK_FILES([$WDK_DIR/redist/wdf/${X64_DIR}/WdfCoInstaller0${WDF_VER}.dll $WDK_DIR/redist/${COINSTALLER_DIR}/${X64_DIR}/winusbcoinstaller2.dll], [],
[AC_MSG_ERROR([the WinUSB x64 driver files could not be detected (--with-wdkdir)])])
fi
if test "x$enable_32bit" != "xno"; then
AC_CHECK_FILES([$DDK_DIR/redist/wdf/x86/WdfCoInstaller0${WDF_VER}.dll $DDK_DIR/redist/${COINSTALLER_DIR}/x86/winusbcoinstaller2.dll], [],
[AC_MSG_ERROR([the WinUSB x86 driver files could not be detected (--with-ddkdir)])])
fi
if test "x$enable_ia64" != "xno"; then
AC_CHECK_FILES([$DDK_DIR/redist/wdf/ia64/WdfCoInstaller0${WDF_VER}.dll $DDK_DIR/redist/${COINSTALLER_DIR}/ia64/winusbcoinstaller2.dll], [],
[AC_MSG_ERROR([the WinUSB ia64 driver files could not be detected (--with-ddkdir)])])
AC_CHECK_FILES([$WDK_DIR/redist/wdf/x86/WdfCoInstaller0${WDF_VER}.dll $WDK_DIR/redist/${COINSTALLER_DIR}/x86/winusbcoinstaller2.dll], [],
[AC_MSG_ERROR([the WinUSB x86 driver files could not be detected (--with-wdkdir)])])
fi
case "$DDK_DIR" in
case "$WDK_DIR" in
[[\\/]]*|?:[[\\/]]*) ;;
*) AC_DEFINE_UNQUOTED([DDK_DIR], "../$DDK_DIR");;
*) AC_DEFINE_UNQUOTED([WDK_DIR], "../$WDK_DIR");;
esac
fi

Expand All @@ -255,10 +243,6 @@ then
AC_CHECK_FILES([$LIBUSB0_DIR/bin/amd64/libusb0.sys $LIBUSB0_DIR/bin/amd64/libusb0.dll],,
[AC_MSG_ERROR([the libusb0 amd64 driver files could not be detected (--with-libusb0)])])
fi
if test "x$enable_ia64" != "xno"; then
AC_CHECK_FILES([$LIBUSB0_DIR/bin/ia64/libusb0.sys $LIBUSB0_DIR/bin/ia64/libusb0.dll],,
[AC_MSG_ERROR([the libusb0 ia64 driver files could not be detected (--with-libusb0)])])
fi
case "$LIBUSB0_DIR" in
[[\\/]]*|?:[[\\/]]*) ;;
*) AC_DEFINE_UNQUOTED([LIBUSB0_DIR], "../$LIBUSB0_DIR");;
Expand All @@ -273,10 +257,6 @@ then
AC_CHECK_FILES([$LIBUSBK_DIR/sys/amd64/libusbK.sys $LIBUSBK_DIR/dll/amd64/libusbK.dll $LIBUSBK_DIR/dll/amd64/libusb0.dll],,
[AC_MSG_ERROR([the libusbK amd64 driver files could not be detected (--with-libusbk)])])
fi
if test "x$enable_ia64" != "xno"; then
AC_CHECK_FILES([$LIBUSBK_DIR/sys/ia64/libusbK.sys $LIBUSBK_DIR/dll/ia64/libusbK.dll $LIBUSBK_DIR/dll/ia64/libusb0.dll],,
[AC_MSG_ERROR([the libusbK ia64 driver files could not be detected (--with-libusbk)])])
fi
case "$LIBUSBK_DIR" in
[[\\/]]*|?:[[\\/]]*) ;;
*) AC_DEFINE_UNQUOTED([LIBUSBK_DIR], "../$LIBUSBK_DIR");;
Expand Down
8 changes: 4 additions & 4 deletions examples/wdi-simple.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,0,708
PRODUCTVERSION 1,3,0,708
FILEVERSION 1,3,709,0
PRODUCTVERSION 1,3,709,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -25,13 +25,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "WDI-Simple"
VALUE "FileVersion", "1.3.0.708"
VALUE "FileVersion", "1.3.709"
VALUE "InternalName", "WDI-Simple"
VALUE "LegalCopyright", "� 2010-2017 Pete Batard (LGPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/lesser.html"
VALUE "OriginalFilename", "wdi-simple.exe"
VALUE "ProductName", "WDI-Simple"
VALUE "ProductVersion", "1.3.0.708"
VALUE "ProductVersion", "1.3.709"
VALUE "Comments", "http://libwdi.akeo.ie"
END
END
Expand Down
8 changes: 4 additions & 4 deletions examples/zadic.rc
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,0,708
PRODUCTVERSION 1,3,0,708
FILEVERSION 1,3,709,0
PRODUCTVERSION 1,3,709,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -74,13 +74,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "Zadic"
VALUE "FileVersion", "1.3.0.708"
VALUE "FileVersion", "1.3.709"
VALUE "InternalName", "Zadic"
VALUE "LegalCopyright", "� 2010-2017 Pete Batard (LGPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/lesser.html"
VALUE "OriginalFilename", "zadic.exe"
VALUE "ProductName", "Zadic"
VALUE "ProductVersion", "1.3.0.708"
VALUE "ProductVersion", "1.3.709"
VALUE "Comments", "http://libwdi.akeo.ie"
END
END
Expand Down
2 changes: 1 addition & 1 deletion examples/zadig.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#define FIELD_ORANGE RGB(255,240,200)
#define ARROW_GREEN RGB(92,228,65)
#define ARROW_ORANGE RGB(253,143,56)
#define APP_VERSION "Zadig 2.3.708"
#define APP_VERSION "Zadig 2.3.709"

// These are used to flag end users about the driver they are going to replace
enum driver_type {
Expand Down
8 changes: 4 additions & 4 deletions examples/zadig.rc
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,3,682,708
PRODUCTVERSION 2,3,682,708
FILEVERSION 2,3,709,0
PRODUCTVERSION 2,3,709,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -264,13 +264,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "Zadig"
VALUE "FileVersion", "2.3.708"
VALUE "FileVersion", "2.3.709"
VALUE "InternalName", "Zadig"
VALUE "LegalCopyright", "� 2010-2017 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "zadig.exe"
VALUE "ProductName", "Zadig"
VALUE "ProductVersion", "2.3.708"
VALUE "ProductVersion", "2.3.709"
VALUE "Comments", "http://libwdi.akeo.ie"
END
END
Expand Down
1 change: 1 addition & 0 deletions libwdi/.msvc/libwdi_dll.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ embedder embedded.h</Command>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\msvc\config.h" />
<ClInclude Include="..\embedder_files.h" />
<ClInclude Include="..\installer.h" />
<ClInclude Include="..\libwdi.h" />
<ClInclude Include="..\libwdi_i.h" />
Expand Down
3 changes: 3 additions & 0 deletions libwdi/.msvc/libwdi_dll.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
<ClInclude Include="..\libwdi_i.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\embedder_files.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\libwdi.def">
Expand Down
1 change: 1 addition & 0 deletions libwdi/.msvc/libwdi_static.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ embedder embedded.h</Command>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\msvc\config.h" />
<ClInclude Include="..\embedder_files.h" />
<ClInclude Include="..\stdfn.h" />
<ClInclude Include="..\installer.h" />
<ClInclude Include="..\libwdi.h" />
Expand Down
3 changes: 3 additions & 0 deletions libwdi/.msvc/libwdi_static.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
<ClInclude Include="..\stdfn.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\embedder_files.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\libusb0.inf.in">
Expand Down
6 changes: 3 additions & 3 deletions libwdi/embedder.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* embedder : converts binary resources into a .h include
* "If you can think of a better way to get ice, I'd like to hear it."
* Copyright (c) 2010-2013 Pete Batard <[email protected]>
* Copyright (c) 2010-2017 Pete Batard <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand All @@ -23,8 +23,8 @@
#error both 32 and 64 bit support have been disabled - check your config.h
#endif

#if !defined(DDK_DIR) && !defined(LIBUSB0_DIR) && !defined(USER_DIR) && !defined(LIBUSBK_DIR)
#error at least one of DDK_DIR, LIBUSB0_DIR, LIBUSBK_DIR or USER_DIR must be defined - check your config.h
#if !defined(WDK_DIR) && !defined(LIBUSB0_DIR) && !defined(USER_DIR) && !defined(LIBUSBK_DIR)
#error at least one of WDK_DIR, LIBUSB0_DIR, LIBUSBK_DIR or USER_DIR must be defined - check your config.h
#endif

// Some adjustment is needed for MSVC
Expand Down
Loading

0 comments on commit d94a117

Please sign in to comment.