diff --git a/build_proton.sh b/build_proton.sh index b7b8daf9d..3def3aa39 100755 --- a/build_proton.sh +++ b/build_proton.sh @@ -2,34 +2,74 @@ set -e -RUNTIME_PATH="$PWD/../../runtime/steam-runtime-both/" - #./wine/ <-- wine source #./build/ <-- built files #./dist/ <-- proton build, ready to distribute mkdir -p dist/ build/wine.win32 build/dist.win32 build/wine.win64 -DST_DIR="$PWD/dist" +TOP="$PWD" +RUNTIME_PATH="$TOP/../../runtime/steam-runtime-both/" +DST_DIR="$TOP/dist" +TOOLS_DIR64="$TOP/build/tools.win64" +TOOLS_DIR32="$TOP/build/tools.win32" cp -a toolmanifest.vdf dist/ -cd build/wine.win64 -CC="ccache gcc" "$RUNTIME_PATH/shell-amd64.sh" ../../wine/configure --enable-win64 --disable-tests --prefix="$DST_DIR" +#build wine64 +cd "$TOP"/build/wine.win64 +CC="ccache gcc" "$RUNTIME_PATH/shell-amd64.sh" "$TOP"/wine/configure --enable-win64 --disable-tests --prefix="$DST_DIR" "$RUNTIME_PATH/shell-amd64.sh" make "$RUNTIME_PATH/shell-amd64.sh" make install-lib +"$RUNTIME_PATH/shell-amd64.sh" make prefix="$TOOLS_DIR64" libdir="$TOOLS_DIR64/lib64" dlldir="$TOOLS_DIR64/lib64/wine" install-dev install-lib -cd ../wine.win32 -CC="ccache gcc" "$RUNTIME_PATH/shell-i386.sh" ../../wine/configure --disable-tests --prefix="$PWD/../dist.win32/" +#build wine32 +cd "$TOP"/build/wine.win32 +CC="ccache gcc" "$RUNTIME_PATH/shell-i386.sh" "$TOP"/wine/configure --disable-tests --prefix="$TOP/build/dist.win32/" "$RUNTIME_PATH/shell-i386.sh" make "$RUNTIME_PATH/shell-i386.sh" make install-lib +"$RUNTIME_PATH/shell-i386.sh" make prefix="$TOOLS_DIR32" libdir="$TOOLS_DIR32/lib" dlldir="$TOOLS_DIR32/lib/wine" install-dev install-lib #install 32-bit stuff manually, see # https://wiki.winehq.org/Packaging#WoW64_Workarounds -cd ../dist.win32/ +cd "$TOP"/build/dist.win32/ cp -a lib "$DST_DIR"/ cp -a bin/wine "$DST_DIR"/bin/ cp -a bin/wine-preloader "$DST_DIR"/bin/ cp -a bin/wineserver "$DST_DIR"/bin/wineserver32 +#build 64-bit lsteamclient +cd "$TOP" +rm -rf build/lsteamclient.win64 +cp -a lsteamclient build/lsteamclient.win64 +cd "$TOP"/build/lsteamclient.win64/ +"$RUNTIME_PATH/shell-amd64.sh" "$TOP"/wine/tools/winemaker/winemaker \ + --nosource-fix --nolower-include --nodlls --nomsvcrt \ + -DSTEAM_API_EXPORTS \ + -I"$TOOLS_DIR64"/include/ \ + -I"$TOOLS_DIR64"/include/wine/ \ + -I"$TOOLS_DIR64"/include/wine/windows/ \ + -L"$TOOLS_DIR64"/lib64/ \ + -L"$TOOLS_DIR64"/lib64/wine/ \ + --dll . +CXXFLAGS=-Wno-attributes PATH="$TOOLS_DIR64/bin:$PATH" "$RUNTIME_PATH/shell-amd64.sh" make +cp -a lsteamclient.dll.so "$TOP"/dist/lib64/wine/ + +#build 32-bit lsteamclient +cd "$TOP" +rm -rf build/lsteamclient.win32 +cp -a lsteamclient build/lsteamclient.win32 +cd "$TOP"/build/lsteamclient.win32/ +"$RUNTIME_PATH/shell-i386.sh" "$TOP"/wine/tools/winemaker/winemaker \ + --nosource-fix --nolower-include --nodlls --nomsvcrt --wine32 \ + -DSTEAM_API_EXPORTS \ + -I"$TOOLS_DIR32"/include/ \ + -I"$TOOLS_DIR32"/include/wine/ \ + -I"$TOOLS_DIR32"/include/wine/windows/ \ + -L"$TOOLS_DIR32"/lib/ \ + -L"$TOOLS_DIR32"/lib/wine/ \ + --dll . +CXXFLAGS=-Wno-attributes PATH="$TOOLS_DIR32/bin:$PATH" "$RUNTIME_PATH/shell-i386.sh" make -j1 +cp -a lsteamclient.dll.so "$TOP"/dist/lib/wine/ + echo "Proton ready in dist/" diff --git a/lsteamclient/cxx.h b/lsteamclient/cxx.h index a2f59d7c1..6307e7e3b 100644 --- a/lsteamclient/cxx.h +++ b/lsteamclient/cxx.h @@ -18,6 +18,12 @@ /* Copied from dlls/msvcrt/cxx.h */ #undef __thiscall + +#define __ASM_NAME(name) name +#define __ASM_DEFINE_FUNC(name,suffix,code) asm(".text\n\t.align 4\n\t.globl " #name suffix "\n\t.type " #name suffix ",@function\n" #name suffix ":\n\t.cfi_startproc\n\t" code "\n\t.cfi_endproc\n\t.previous"); +#define __ASM_GLOBAL_FUNC(name,code) __ASM_DEFINE_FUNC(name,"",code) +#define __ASM_STDCALL(args) "" + #ifdef __i386__ /* thiscall functions are i386-specific */ #define THISCALL(func) __thiscall_ ## func diff --git a/lsteamclient/gen.sh b/lsteamclient/gen.sh index b80c818cd..2ac0dbc1e 100755 --- a/lsteamclient/gen.sh +++ b/lsteamclient/gen.sh @@ -8,3 +8,5 @@ rm cpp*.h rm cb*.h rm cb*.cpp rm cb*.dat + +./gen_wrapper.py diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index 07c1a05b2..ce2be488a 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -296,8 +296,6 @@ def handle_class(sdkver, classnode): cfile = open("%s.c" % winname, "a") if not file_exists: cfile.write("""/* This file is auto-generated, do not edit. */ -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/steamclient_main.c b/lsteamclient/steamclient_main.c index 6ad438827..5ee00d9d0 100644 --- a/lsteamclient/steamclient_main.c +++ b/lsteamclient/steamclient_main.c @@ -22,8 +22,6 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) switch (reason) { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(instance); break; diff --git a/lsteamclient/steamclient_private.h b/lsteamclient/steamclient_private.h index 5ef97a123..deb0632d8 100644 --- a/lsteamclient/steamclient_private.h +++ b/lsteamclient/steamclient_private.h @@ -31,3 +31,7 @@ typedef struct __winX winX; void *create_win_interface(const char *name, void *linux_side); unsigned int steamclient_unix_path_to_dos_path(unsigned int api_result, char *inout, unsigned int inout_bytes); void *create_LinuxMatchmakingServerListResponse(void *win); + +#define TRACE WINE_TRACE +#define ERR WINE_ERR +#define WARN WINE_WARN diff --git a/lsteamclient/steamclient_wrappers.c b/lsteamclient/steamclient_wrappers.c index 593e0c010..99c56b892 100644 --- a/lsteamclient/steamclient_wrappers.c +++ b/lsteamclient/steamclient_wrappers.c @@ -1,7 +1,5 @@ /* Linux-to-Windows conversions (i.e. callbacks) here. */ -#include "config.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamAppList.c b/lsteamclient/winISteamAppList.c index e62694209..42f6d68eb 100644 --- a/lsteamclient/winISteamAppList.c +++ b/lsteamclient/winISteamAppList.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamAppTicket.c b/lsteamclient/winISteamAppTicket.c index 446380f9b..4616983ce 100644 --- a/lsteamclient/winISteamAppTicket.c +++ b/lsteamclient/winISteamAppTicket.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamApps.c b/lsteamclient/winISteamApps.c index 693afeca2..aa91e34be 100644 --- a/lsteamclient/winISteamApps.c +++ b/lsteamclient/winISteamApps.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamClient.c b/lsteamclient/winISteamClient.c index fcd31e27e..e9cb4bf4f 100644 --- a/lsteamclient/winISteamClient.c +++ b/lsteamclient/winISteamClient.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamController.c b/lsteamclient/winISteamController.c index 8c7ec418e..180bdc55a 100644 --- a/lsteamclient/winISteamController.c +++ b/lsteamclient/winISteamController.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamFriends.c b/lsteamclient/winISteamFriends.c index c400e4bba..2dc8ce2ea 100644 --- a/lsteamclient/winISteamFriends.c +++ b/lsteamclient/winISteamFriends.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamGameCoordinator.c b/lsteamclient/winISteamGameCoordinator.c index 78b330492..d1524a9c8 100644 --- a/lsteamclient/winISteamGameCoordinator.c +++ b/lsteamclient/winISteamGameCoordinator.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamGameServer.c b/lsteamclient/winISteamGameServer.c index fccb2159b..e747e8469 100644 --- a/lsteamclient/winISteamGameServer.c +++ b/lsteamclient/winISteamGameServer.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamGameServerStats.c b/lsteamclient/winISteamGameServerStats.c index 27fde6d1a..ee8bd1f39 100644 --- a/lsteamclient/winISteamGameServerStats.c +++ b/lsteamclient/winISteamGameServerStats.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamHTMLSurface.c b/lsteamclient/winISteamHTMLSurface.c index 485e7b98b..baa7c1d4d 100644 --- a/lsteamclient/winISteamHTMLSurface.c +++ b/lsteamclient/winISteamHTMLSurface.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamHTTP.c b/lsteamclient/winISteamHTTP.c index 2f54b7e0c..3a95a7f5b 100644 --- a/lsteamclient/winISteamHTTP.c +++ b/lsteamclient/winISteamHTTP.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamInventory.c b/lsteamclient/winISteamInventory.c index 2041a0e49..6c0dbc3cf 100644 --- a/lsteamclient/winISteamInventory.c +++ b/lsteamclient/winISteamInventory.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamMasterServerUpdater.c b/lsteamclient/winISteamMasterServerUpdater.c index d0997d066..929c76a06 100644 --- a/lsteamclient/winISteamMasterServerUpdater.c +++ b/lsteamclient/winISteamMasterServerUpdater.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamMatchmaking.c b/lsteamclient/winISteamMatchmaking.c index f0ccdada8..30f814373 100644 --- a/lsteamclient/winISteamMatchmaking.c +++ b/lsteamclient/winISteamMatchmaking.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamMatchmakingServers.c b/lsteamclient/winISteamMatchmakingServers.c index 9182c084e..a5a63bbb8 100644 --- a/lsteamclient/winISteamMatchmakingServers.c +++ b/lsteamclient/winISteamMatchmakingServers.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamMusic.c b/lsteamclient/winISteamMusic.c index 30e75e90e..cdd04bd2f 100644 --- a/lsteamclient/winISteamMusic.c +++ b/lsteamclient/winISteamMusic.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamMusicRemote.c b/lsteamclient/winISteamMusicRemote.c index 914b879d0..5b47214d3 100644 --- a/lsteamclient/winISteamMusicRemote.c +++ b/lsteamclient/winISteamMusicRemote.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamNetworking.c b/lsteamclient/winISteamNetworking.c index 1e1614e89..604e2c143 100644 --- a/lsteamclient/winISteamNetworking.c +++ b/lsteamclient/winISteamNetworking.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamParentalSettings.c b/lsteamclient/winISteamParentalSettings.c index 7bccedcd9..e1df01028 100644 --- a/lsteamclient/winISteamParentalSettings.c +++ b/lsteamclient/winISteamParentalSettings.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamRemoteStorage.c b/lsteamclient/winISteamRemoteStorage.c index a9ab51355..148891a03 100644 --- a/lsteamclient/winISteamRemoteStorage.c +++ b/lsteamclient/winISteamRemoteStorage.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamScreenshots.c b/lsteamclient/winISteamScreenshots.c index 5320c4760..75d4ebd08 100644 --- a/lsteamclient/winISteamScreenshots.c +++ b/lsteamclient/winISteamScreenshots.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamUGC.c b/lsteamclient/winISteamUGC.c index 06ddaf5f6..4ad99a6d8 100644 --- a/lsteamclient/winISteamUGC.c +++ b/lsteamclient/winISteamUGC.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamUnifiedMessages.c b/lsteamclient/winISteamUnifiedMessages.c index d8073167f..759a78617 100644 --- a/lsteamclient/winISteamUnifiedMessages.c +++ b/lsteamclient/winISteamUnifiedMessages.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamUser.c b/lsteamclient/winISteamUser.c index ead3d8830..03306715b 100644 --- a/lsteamclient/winISteamUser.c +++ b/lsteamclient/winISteamUser.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamUserStats.c b/lsteamclient/winISteamUserStats.c index c9f5945fe..1ebf37184 100644 --- a/lsteamclient/winISteamUserStats.c +++ b/lsteamclient/winISteamUserStats.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamUtils.c b/lsteamclient/winISteamUtils.c index 4eb2d7477..bc0155bab 100644 --- a/lsteamclient/winISteamUtils.c +++ b/lsteamclient/winISteamUtils.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/lsteamclient/winISteamVideo.c b/lsteamclient/winISteamVideo.c index e424dd41c..8c7eafdbf 100644 --- a/lsteamclient/winISteamVideo.c +++ b/lsteamclient/winISteamVideo.c @@ -1,8 +1,4 @@ /* This file is auto-generated, do not edit. */ - -#include "config.h" -#include "wine/port.h" - #include #include "windef.h"