crosstool-ng: Refresh patches
This commit is contained in:
parent
811ca4a3da
commit
056ddd2dc9
@ -1,4 +1,4 @@
|
||||
From 1c3f3f6cec97a78376ce760eb53829d991592fc7 Mon Sep 17 00:00:00 2001
|
||||
From 852e5eb018d4f8357679bad8985e1b215d7d3264 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Donnelly <mingw.android@gmail.com>
|
||||
Date: Sat, 12 Apr 2014 15:57:20 +0100
|
||||
Subject: [PATCH 1/6] functions: Add CT_FindRelativePath
|
||||
@ -80,5 +80,5 @@ index a309f2d..9a2be48 100644
|
||||
+ return 0
|
||||
+}
|
||||
--
|
||||
2.1.0
|
||||
2.2.1
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 634ee9d9171eb8499a90d778ca2882e97776c5ec Mon Sep 17 00:00:00 2001
|
||||
From a1eff5b09a1c7d58dbb105e2a4949a34b9824507 Mon Sep 17 00:00:00 2001
|
||||
From: martell <martellmalone@gmail.com>
|
||||
Date: Thu, 11 Sep 2014 20:12:58 +0100
|
||||
Subject: [PATCH 2/6] Use CT_FindRelativePath for gcc and gmp
|
||||
@ -9,10 +9,10 @@ Subject: [PATCH 2/6] Use CT_FindRelativePath for gcc and gmp
|
||||
2 files changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
|
||||
index 9dbc41e..3fbdd6c 100644
|
||||
index 632bc8c..73a9a9c 100644
|
||||
--- a/scripts/build/cc/gcc.sh
|
||||
+++ b/scripts/build/cc/gcc.sh
|
||||
@@ -379,13 +379,14 @@ do_cc_core_backend() {
|
||||
@@ -381,13 +381,14 @@ do_cc_core_backend() {
|
||||
|
||||
CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
|
||||
|
||||
@ -28,7 +28,7 @@ index 9dbc41e..3fbdd6c 100644
|
||||
--build=${CT_BUILD} \
|
||||
--host=${host} \
|
||||
--target=${CT_TARGET} \
|
||||
@@ -842,6 +843,8 @@ do_cc_backend() {
|
||||
@@ -844,6 +845,8 @@ do_cc_backend() {
|
||||
|
||||
CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
|
||||
|
||||
@ -37,7 +37,7 @@ index 9dbc41e..3fbdd6c 100644
|
||||
CT_DoExecLog CFG \
|
||||
CC_FOR_BUILD="${CT_BUILD}-gcc" \
|
||||
CFLAGS="${cflags}" \
|
||||
@@ -850,7 +853,7 @@ do_cc_backend() {
|
||||
@@ -852,7 +855,7 @@ do_cc_backend() {
|
||||
CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \
|
||||
CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \
|
||||
LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \
|
||||
@ -47,12 +47,12 @@ index 9dbc41e..3fbdd6c 100644
|
||||
--host=${host} \
|
||||
--target=${CT_TARGET} \
|
||||
diff --git a/scripts/build/companion_libs/100-gmp.sh b/scripts/build/companion_libs/100-gmp.sh
|
||||
index 8674f16..10e5212 100644
|
||||
index f0c96a2..8028c5b 100644
|
||||
--- a/scripts/build/companion_libs/100-gmp.sh
|
||||
+++ b/scripts/build/companion_libs/100-gmp.sh
|
||||
@@ -81,10 +81,12 @@ do_gmp_backend() {
|
||||
|
||||
CT_DoLog EXTRA "Configuring GMP"
|
||||
@@ -88,10 +88,12 @@ do_gmp_backend() {
|
||||
extra_config+=("--enable-mpbsd")
|
||||
fi
|
||||
|
||||
+ local relpath="$(CT_FindRelativePath "${PWD}" "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}")"
|
||||
+
|
||||
@ -65,5 +65,5 @@ index 8674f16..10e5212 100644
|
||||
--host=${host} \
|
||||
--prefix="${prefix}" \
|
||||
--
|
||||
2.1.0
|
||||
2.2.1
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From ece6fa0c1e29039a1a5db04ce2e3dd67dbd9abd0 Mon Sep 17 00:00:00 2001
|
||||
From d6860aec49d0be38ea5f7723cfd64209c6dc8a41 Mon Sep 17 00:00:00 2001
|
||||
From: martell <martellmalone@gmail.com>
|
||||
Date: Thu, 11 Sep 2014 20:21:40 +0100
|
||||
Subject: [PATCH 3/6] Modify config to support correct Mingw64 Triplet Names
|
||||
@ -44,5 +44,5 @@ index d654d03..d123d08 100755
|
||||
;;
|
||||
mingw32ce)
|
||||
--
|
||||
2.1.0
|
||||
2.2.1
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From f552b843c9d1955cd6ae56d28a38907b5642ca3f Mon Sep 17 00:00:00 2001
|
||||
From b738cfb568be3565c1d55ec2f85c1e1de85575d4 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Donnelly <mingw.android@gmail.com>
|
||||
Date: Fri, 8 Nov 2013 18:42:03 +0000
|
||||
Subject: [PATCH 4/6] AC_SEARCH_LIBS more libs for build on
|
||||
@ -130,5 +130,5 @@ index 3474e5c..8a4939e 100644
|
||||
#-----------------------------------------------------------
|
||||
# Cleaning up the mess...
|
||||
--
|
||||
2.1.0
|
||||
2.2.1
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 9bf7c4150baf5802bce7c5c71bac3903dcffe4c7 Mon Sep 17 00:00:00 2001
|
||||
From 77c9bc579bee2445fcd0f49b4cfe253decaba2ca Mon Sep 17 00:00:00 2001
|
||||
From: martell <martellmalone@gmail.com>
|
||||
Date: Fri, 12 Sep 2014 01:06:15 +0100
|
||||
Subject: [PATCH 5/6] Change both fs case-sensitivity Aborts to Log Warns
|
||||
@ -9,7 +9,7 @@ As otherwise Windows cannot be used as the build machine.
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
|
||||
index cd65d5b..e566d8d 100644
|
||||
index 53ac552..f5caf2d 100644
|
||||
--- a/scripts/crosstool-NG.sh.in
|
||||
+++ b/scripts/crosstool-NG.sh.in
|
||||
@@ -90,7 +90,7 @@ CT_DoExecLog DEBUG rm -f "${CT_WORK_DIR}/backtrace"
|
||||
@ -31,5 +31,5 @@ index cd65d5b..e566d8d 100644
|
||||
|
||||
# Kludge: CT_INSTALL_DIR and CT_PREFIX_DIR might have grown read-only if
|
||||
--
|
||||
2.1.0
|
||||
2.2.1
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 6fabb02355cff2ddf901306b9e0871a44ffe42d2 Mon Sep 17 00:00:00 2001
|
||||
From bbb3a7131d745b6a6e3f6bbada9af244dbe2cb41 Mon Sep 17 00:00:00 2001
|
||||
From: martell <martellmalone@gmail.com>
|
||||
Date: Fri, 12 Sep 2014 01:06:15 +0100
|
||||
Subject: [PATCH 6/6] CT_DoForceRmdir: added support for MSYS and MINGW
|
||||
@ -29,5 +29,5 @@ index 9a2be48..0942fd7 100644
|
||||
CT_Abort "Unhandled host OS $CT_SYS_OS"
|
||||
;;
|
||||
--
|
||||
2.1.0
|
||||
2.2.1
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
_realname=crosstool-ng
|
||||
pkgname="${_realname}-git"
|
||||
_ver_base=1.20
|
||||
pkgver=1.20.2955.991ec3a
|
||||
pkgver=1.20.2997.d86f21e
|
||||
pkgrel=1
|
||||
pkgdesc="A cross-platform open-source toolchain system"
|
||||
arch=('i686' 'x86_64')
|
||||
@ -24,12 +24,12 @@ source=("${_realname}"::"git+http://crosstool-ng.org/git/crosstool-ng"
|
||||
"0006-CT_DoForceRmdir-added-support-for-MSYS-and-MINGW.patch")
|
||||
|
||||
md5sums=('SKIP'
|
||||
'cb489f51a215b7f1fc1fb2224f92a613'
|
||||
'36ffb5b954acdfa906999949aca37793'
|
||||
'9dc4ed429289320e3eb72c4dce67f9df'
|
||||
'40f9bbbeada4a18dc59e348a71d6aa74'
|
||||
'f9219b802481ffa5501bf56298607f1a'
|
||||
'4caf8639b0f3058c6fefb04bdc150025')
|
||||
'53680d2d66c7fc2344795ae430646fc6'
|
||||
'cd6e571072d3689b654fec6dec4dfce3'
|
||||
'2f97178a009fcc8ab2cbb91cd7ac28ae'
|
||||
'e1254270c3ce871f54cc0471e7575e98'
|
||||
'4399f93fe5f158e24569ba6267c560fb'
|
||||
'5ce9985722c0c73720f7580cdaf763f2')
|
||||
|
||||
pkgver() {
|
||||
cd "$srcdir/$_realname"
|
||||
|
||||
@ -10,7 +10,7 @@ license=('BSD')
|
||||
groups=('libraries')
|
||||
depends=('gcc-libs' 'libbz2' 'libiconv' 'liblzma' 'liblzo2' 'libnettle' 'libxml2' 'zlib')
|
||||
makedepends=('libbz2-devel' 'libiconv-devel' 'liblzma-devel' 'liblzo2-devel' 'libnettle-devel' 'libxml2-devel' 'zlib-devel')
|
||||
options=('strip' 'libtool')
|
||||
options=('!strip' 'debug' 'libtool')
|
||||
# provides=('libarchive.so')
|
||||
source=("http://libarchive.org/downloads/$pkgname-$pkgver.tar.gz"
|
||||
'0001-mtree-fix-line-filename-length-calculation.patch'
|
||||
|
||||
@ -12,7 +12,7 @@ groups=('base-devel')
|
||||
depends=('msys2-runtime' 'sh' 'guile')
|
||||
makedepends=('gettext' 'gettext-devel' 'git' 'wget' 'msys2-runtime-devel')
|
||||
install=$pkgname.install
|
||||
#options=('debug' '!strip')
|
||||
options=('debug' '!strip')
|
||||
source=("http://ftp.gnu.org/gnu/make/${pkgname}-${pkgver}.tar.bz2"
|
||||
'make-autoconf.patch')
|
||||
md5sums=('57a7a224a822f94789a587ccbcedff69'
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
pkgname=('msys2-runtime' 'msys2-runtime-devel')
|
||||
_ver_base=2.0
|
||||
pkgver=2.0.16467.0bee699
|
||||
pkgver=2.0.16436.9ef6bf1
|
||||
pkgrel=1
|
||||
pkgdesc="Cygwin POSIX emulation engine"
|
||||
arch=('i686' 'x86_64')
|
||||
@ -22,7 +22,7 @@ makedepends=('cocom'
|
||||
'gettext-devel'
|
||||
'libiconv-devel'
|
||||
'diffutils')
|
||||
# options=('debug' '!strip')
|
||||
options=('debug' '!strip')
|
||||
source=('msys2-runtime'::'git+https://github.com/Alexpux/Cygwin.git#branch=develop')
|
||||
md5sums=('SKIP')
|
||||
pkgver() {
|
||||
|
||||
@ -9,12 +9,14 @@
|
||||
.email: <mingw.android@gmail.com>.
|
||||
*/
|
||||
|
||||
#define WIN32_MEAN_AND_LEAN
|
||||
//#define WIN32_MEAN_AND_LEAN
|
||||
|
||||
#include <windows.h>
|
||||
#include <psapi.h>
|
||||
#include <shellapi.h>
|
||||
#include <gdiplus.h>
|
||||
#include <process.h>
|
||||
#include <winuser.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
@ -94,6 +96,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
ULONG_PTR gdi_plus_token;
|
||||
HWND h_splash_wnd;
|
||||
HRSRC splash_jpg_hrsrcs[IDC_SPLASH_COUNT];
|
||||
HGLOBAL splash_jpg_bufs[IDC_SPLASH_COUNT];
|
||||
GpBitmap* splash_jpg_bitmaps[IDC_SPLASH_COUNT];
|
||||
@ -105,10 +108,21 @@ typedef struct {
|
||||
typedef struct {
|
||||
float n_secs;
|
||||
BOOL displayed_splash;
|
||||
BOOL use_gui;
|
||||
BOOL use_tui;
|
||||
HANDLE ui_thread;
|
||||
unsigned int ui_thread_id;
|
||||
HANDLE ui_thread_event;
|
||||
|
||||
GraphicalInterfaceState gui;
|
||||
TextualInterfaceState tui;
|
||||
} InterfaceState;
|
||||
|
||||
float kSplashTime = 1.0f / (float)IDC_SPLASH_COUNT;
|
||||
int kSplashRateMsec = 1000 / IDC_SPLASH_COUNT;
|
||||
|
||||
#define TIMER_ID 1000
|
||||
|
||||
/* Global variables plus things
|
||||
that are updated dynamically */
|
||||
typedef struct {
|
||||
@ -146,7 +160,8 @@ typedef struct {
|
||||
|
||||
enum {
|
||||
kProcessIncrement = 512,
|
||||
kModulesIncrement = 512,
|
||||
// kModulesIncrement = 512,
|
||||
kModulesIncrement = 4,
|
||||
} kTweaks;
|
||||
|
||||
HWND FindConsoleHandle(void);
|
||||
@ -167,6 +182,18 @@ BOOL debug = FALSE;
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define dbg_printf_GLE(DWORD_ERR_PTR, ...) \
|
||||
do { \
|
||||
char gle_buf[256]; \
|
||||
*DWORD_ERR_PTR = GetLastError(); \
|
||||
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, \
|
||||
NULL, *DWORD_ERR_PTR, \
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), \
|
||||
gle_buf, sizeof(gle_buf), NULL); \
|
||||
dbg_printf(__VA_ARGS__); \
|
||||
dbg_printf("GetLastError()=%ld :: %s", *DWORD_ERR_PTR, gle_buf);\
|
||||
} while (0)
|
||||
|
||||
#define fatal_err_printf(...) \
|
||||
do { \
|
||||
fprintf(stderr, "%s(): ", __FUNCTION__); \
|
||||
@ -334,6 +361,11 @@ ssize_t EnumerateOpenProcessModules(Arguments* args, HANDLE proc_handle,
|
||||
do {
|
||||
DWORD bytes_needed;
|
||||
num_modules += kModulesIncrement;
|
||||
if (num_modules > 2000) {
|
||||
int a = 1;
|
||||
a;
|
||||
}
|
||||
|
||||
bytes_used = num_modules * sizeof(DWORD);
|
||||
modules = (HMODULE*)alloca(bytes_used);
|
||||
if (modules == NULL) {
|
||||
@ -345,11 +377,18 @@ ssize_t EnumerateOpenProcessModules(Arguments* args, HANDLE proc_handle,
|
||||
EnumProcessModules(proc_handle, modules, bytes_used, &bytes_needed);
|
||||
|
||||
if (result != FALSE) {
|
||||
if (bytes_used == bytes_needed) {
|
||||
/* In this case, can't assume that all the processes were enumerated. */
|
||||
if (bytes_used < bytes_needed) {
|
||||
/* Not all processes were enumerated. */
|
||||
result = FALSE;
|
||||
}
|
||||
}
|
||||
if (result == FALSE) {
|
||||
DWORD err;
|
||||
dbg_printf_GLE(&err, "EnumProcessModules(proc_handle=%p) failed\n", proc_handle);
|
||||
if (err == ERROR_PARTIAL_COPY) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (result != FALSE) {
|
||||
num_modules = bytes_needed / sizeof(DWORD);
|
||||
bytes_used = bytes_needed;
|
||||
@ -379,8 +418,7 @@ ssize_t EnumerateOpenProcessModules(Arguments* args, HANDLE proc_handle,
|
||||
}
|
||||
|
||||
/* Returns TRUE if conflicts with any (Arguments*)p_in_args->p_filenames, and
|
||||
*sets
|
||||
*(uint32_t*)p_outvalues to the bitmask of conflicting ids. */
|
||||
*sets *(uint32_t*)p_outvalues to the bitmask of conflicting ids. */
|
||||
BOOL FilterConflictingModule(void* p_in_args, HANDLE proc_handle,
|
||||
HANDLE module_handle, void* p_out_value) {
|
||||
Arguments* args = (Arguments*)p_in_args;
|
||||
@ -395,10 +433,11 @@ BOOL FilterConflictingModule(void* p_in_args, HANDLE proc_handle,
|
||||
char module_name[1024];
|
||||
if (GetModuleFileNameExA(proc_handle, module_handle, module_name,
|
||||
sizeof(module_name) / sizeof(module_name[0]))) {
|
||||
printf("\t%s\n", module_name);
|
||||
/* printf("\t%s\n", module_name); */
|
||||
for (fid = 0; fid < args->num_filenames; ++fid) {
|
||||
if (!strcmp(module_name, args->p_filenames[fid])) {
|
||||
*p_mask_locked |= (1 << fid);
|
||||
dbg_printf("locking %s", module_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -628,54 +667,54 @@ BOOL LaunchedFromConsole(void) {
|
||||
}
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK
|
||||
DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
GlobalState* state = (GlobalState*)lParam;
|
||||
(void)state;
|
||||
switch (uMsg) {
|
||||
case WM_INITDIALOG: {
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
//INT_PTR CALLBACK
|
||||
//DialogProc(HWND hwnd_dlg, UINT msg, WPARAM w_param, LPARAM l_param) {
|
||||
// GlobalState* state = (GlobalState*)l_param;
|
||||
// (void)state;
|
||||
// switch (msg) {
|
||||
// case WM_INITDIALOG: {
|
||||
// return TRUE;
|
||||
// break;
|
||||
// }
|
||||
|
||||
case WM_COMMAND: {
|
||||
switch (wParam) {
|
||||
case IDOK: {
|
||||
EndDialog(hwndDlg, 0);
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
// case WM_COMMAND: {
|
||||
// switch (w_param) {
|
||||
// case IDOK: {
|
||||
// EndDialog(hwnd_dlg, 0);
|
||||
// return TRUE;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
|
||||
case WM_SIZE: {
|
||||
HWND hEdit;
|
||||
RECT rcClient;
|
||||
// case WM_SIZE: {
|
||||
// HWND h_edit;
|
||||
// RECT rc_client;
|
||||
|
||||
GetClientRect(hwndDlg, &rcClient);
|
||||
// GetClientRect(hwnd_dlg, &rc_client);
|
||||
|
||||
hEdit = GetDlgItem(hwndDlg, IDC_UNLOCKERDIALOG);
|
||||
SetWindowPos(hEdit, NULL, 0, 0, rcClient.right, rcClient.bottom,
|
||||
SWP_NOZORDER);
|
||||
break;
|
||||
}
|
||||
// h_edit = GetDlgItem(hwnd_dlg, IDC_UNLOCKERDIALOG);
|
||||
// SetWindowPos(h_edit, NULL, 0, 0, rc_client.right, rc_client.bottom,
|
||||
// SWP_NOZORDER);
|
||||
// break;
|
||||
// }
|
||||
|
||||
case WM_CLOSE: {
|
||||
EndDialog(hwndDlg, kUserExited);
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
// case WM_CLOSE: {
|
||||
// EndDialog(hwnd_dlg, kUserExited);
|
||||
// return TRUE;
|
||||
// break;
|
||||
// }
|
||||
|
||||
default: { break; }
|
||||
}
|
||||
// default: { break; }
|
||||
// }
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
// return FALSE;
|
||||
//}
|
||||
|
||||
/* Runs on the main thread continually. */
|
||||
kExitCode UpdateState(Arguments* args, GlobalState* state) {
|
||||
kExitCode result;
|
||||
size_t i;
|
||||
uint32_t existing_originals_mask;
|
||||
uint32_t existing_replacements_mask;
|
||||
|
||||
@ -693,19 +732,19 @@ kExitCode UpdateState(Arguments* args, GlobalState* state) {
|
||||
return (result);
|
||||
}
|
||||
|
||||
for (i = 0; i < state->num_locking_processes; ++i) {
|
||||
uint32_t conflicts = 0x1010101;
|
||||
if (conflicts) {
|
||||
if (args->interface_style & kInterfaceStyleGUI) {
|
||||
INT_PTR result =
|
||||
DialogBoxParamA(NULL, MAKEINTRESOURCEA(IDC_UNLOCKERDIALOG),
|
||||
state->appHWnd, DialogProc, (LPARAM)state);
|
||||
if (result == kUserExited) {
|
||||
return (kUserExited);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (i = 0; i < state->num_locking_processes; ++i) {
|
||||
// uint32_t conflicts = 0x1010101;
|
||||
// if (conflicts) {
|
||||
// if (args->interface_style & kInterfaceStyleGUI) {
|
||||
// INT_PTR result =
|
||||
// DialogBoxParamA(NULL, MAKEINTRESOURCEA(IDC_UNLOCKERDIALOG),
|
||||
// state->appHWnd, DialogProc, (LPARAM)state);
|
||||
// if (result == kUserExited) {
|
||||
// return (kUserExited);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return (kSuccess);
|
||||
}
|
||||
|
||||
@ -799,6 +838,147 @@ kExitCode GraphicalInterfaceInit(Arguments* args, GraphicalInterfaceState* p_if_
|
||||
return (kSuccess);
|
||||
}
|
||||
|
||||
LRESULT CALLBACK SplashWndProc(HWND hwnd_splash, UINT msg, WPARAM w_param, LPARAM l_param) {
|
||||
InterfaceState* p_if_state = (InterfaceState*)GetWindowLongPtr(hwnd_splash, -21/*GWL_USERDATA*/); // (InterfaceState*)l_param;
|
||||
|
||||
if (p_if_state == NULL) {
|
||||
return DefWindowProc(hwnd_splash, msg, w_param, l_param);
|
||||
}
|
||||
// WM_NCCREATE, WM_NCCALCSIZE, WM_CREATE, WM_SIZE, WM_DESTROY
|
||||
switch (msg) {
|
||||
case WM_PAINT:
|
||||
{
|
||||
static int frame = 0;
|
||||
GpBitmap* bitmap = p_if_state->gui.splash_jpg_bitmaps[frame];
|
||||
if (frame < IDC_SPLASH_COUNT - 1) {
|
||||
++frame;
|
||||
}
|
||||
if (bitmap) {
|
||||
GpGraphics* graphics;
|
||||
GdipCreateFromHWND(hwnd_splash, &graphics);
|
||||
REAL width, height;
|
||||
GdipGetImageDimension(bitmap, &width, &height);
|
||||
/* p_if_state->gui.gdi_plus_token */
|
||||
GdipDrawImageRectI(graphics, bitmap, 0, 0, width, height);
|
||||
|
||||
// if ( pInstance->m_ProgressMsg.size() > 0 )
|
||||
// {
|
||||
// Gdiplus::Font msgFont( L"Tahoma", 8, Gdiplus::UnitPixel );
|
||||
// Gdiplus::SolidBrush msgBrush( static_cast<DWORD>(Gdiplus::Color::Black) );
|
||||
// gdip.DrawString( pInstance->m_ProgressMsg.c_str(), -1, &msgFont, Gdiplus::PointF(2.0f, pInstance->m_pImage->GetHeight()-34.0f), &msgBrush );
|
||||
// }
|
||||
GdipDeleteGraphics(graphics);
|
||||
}
|
||||
ValidateRect(hwnd_splash, NULL);
|
||||
static int done_donate = 0;
|
||||
if (frame == IDC_SPLASH_COUNT - 1 && done_donate == 0) {
|
||||
done_donate = 1;
|
||||
ShellExecuteA(/*hwnd_splash*/NULL,
|
||||
"open",
|
||||
"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=1390079",
|
||||
NULL,
|
||||
NULL,
|
||||
SW_SHOW/*SW_SHOWNORMAL*/);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case WM_TIMER:
|
||||
{
|
||||
InvalidateRect(p_if_state->gui.h_splash_wnd, NULL, TRUE);
|
||||
UpdateWindow(p_if_state->gui.h_splash_wnd);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return DefWindowProc(hwnd_splash, msg, w_param, l_param);
|
||||
}
|
||||
|
||||
kExitCode GraphicalSplashInitThread(InterfaceState* p_if_state) {
|
||||
|
||||
WNDCLASS wndcls = {0};
|
||||
|
||||
wndcls.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wndcls.lpfnWndProc = SplashWndProc;
|
||||
wndcls.hInstance = GetModuleHandle(NULL);
|
||||
wndcls.hCursor = LoadCursor(NULL, IDC_APPSTARTING);
|
||||
wndcls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
||||
wndcls.lpszClassName = L"SplashWnd";
|
||||
wndcls.hIcon = LoadIcon(wndcls.hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
|
||||
|
||||
if (!RegisterClass(&wndcls)) {
|
||||
if (GetLastError() != 0x00000582) // already registered)
|
||||
{
|
||||
OutputDebugString(L"Unable to register class SplashWnd\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
char name[] = "";
|
||||
// TODO :: Fix this.
|
||||
HWND h_parent_wnd = NULL;
|
||||
|
||||
REAL width, height;
|
||||
GdipGetImageDimension(p_if_state->gui.splash_jpg_bitmaps[0], &width, &height);
|
||||
|
||||
// try to find monitor where mouse was last time
|
||||
POINT point = { 0 };
|
||||
MONITORINFO mi = { sizeof(MONITORINFO), {0}, {0}, 0 };
|
||||
HMONITOR hMonitor = 0;
|
||||
RECT rcArea = { 0 };
|
||||
GetCursorPos( &point );
|
||||
|
||||
hMonitor = MonitorFromPoint( point, MONITOR_DEFAULTTONEAREST );
|
||||
if ( GetMonitorInfo( hMonitor, &mi ) )
|
||||
{
|
||||
rcArea.left = ( mi.rcMonitor.right + mi.rcMonitor.left - (LONG)width ) / 2;
|
||||
rcArea.top = ( mi.rcMonitor.top + mi.rcMonitor.bottom - (LONG)height) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
SystemParametersInfo(SPI_GETWORKAREA, NULL, &rcArea, NULL);
|
||||
rcArea.left = (rcArea.right + rcArea.left - (LONG)width)/2;
|
||||
rcArea.top = (rcArea.top + rcArea.bottom - (LONG)height)/2;
|
||||
}
|
||||
|
||||
p_if_state->gui.h_splash_wnd = CreateWindowExA(strlen(name)?0:WS_EX_TOOLWINDOW, "SplashWnd", name,
|
||||
WS_CLIPCHILDREN|WS_POPUP, rcArea.left, rcArea.top, width, height, h_parent_wnd, NULL, wndcls.hInstance, NULL);
|
||||
|
||||
SetWindowLongPtr(p_if_state->gui.h_splash_wnd, /*GWL_USERDATA*/ -21, (LONG_PTR)p_if_state);
|
||||
ShowWindow(p_if_state->gui.h_splash_wnd, SW_SHOWNOACTIVATE);
|
||||
|
||||
MSG msg;
|
||||
PeekMessage(&msg, NULL, 0, 0, 0); // invoke creating message queue
|
||||
return (kSuccess);
|
||||
}
|
||||
|
||||
kExitCode TextualSplashInitThread(InterfaceState* p_if_state) {
|
||||
return (kSuccess);
|
||||
}
|
||||
|
||||
unsigned int __stdcall SplashThread(void* param) {
|
||||
InterfaceState* p_if_state = (InterfaceState*)param;
|
||||
(void)p_if_state;
|
||||
|
||||
if (p_if_state->use_gui) {
|
||||
GraphicalSplashInitThread(p_if_state);
|
||||
}
|
||||
if (p_if_state->use_tui) {
|
||||
TextualSplashInitThread(p_if_state);
|
||||
}
|
||||
SetEvent(p_if_state->ui_thread_event);
|
||||
|
||||
MSG msg;
|
||||
BOOL bRet;
|
||||
SetTimer(p_if_state->gui.h_splash_wnd, TIMER_ID, kSplashRateMsec, 0);
|
||||
while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
kExitCode InterfaceStateInit(Arguments* args, InterfaceState* p_if_state) {
|
||||
p_if_state->n_secs = 0.0f;
|
||||
|
||||
@ -806,14 +986,28 @@ kExitCode InterfaceStateInit(Arguments* args, InterfaceState* p_if_state) {
|
||||
kExitCode status_tui = kSuccess;
|
||||
kExitCode status_gui = kSuccess;
|
||||
|
||||
p_if_state->use_gui = FALSE;
|
||||
p_if_state->use_tui = FALSE;
|
||||
if (args->interface_style & kInterfaceStyleTUI) {
|
||||
status_tui = TextualInterfaceInit(args, &p_if_state->tui);
|
||||
if (status_tui == kSuccess) {
|
||||
p_if_state->use_tui = TRUE;
|
||||
}
|
||||
}
|
||||
if (args->interface_style & kInterfaceStyleGUI) {
|
||||
status_gui = GraphicalInterfaceInit(args, &p_if_state->gui);
|
||||
if (status_gui == kSuccess) {
|
||||
p_if_state->use_gui = TRUE;
|
||||
}
|
||||
}
|
||||
if (status_tui != kSuccess && status_gui != kSuccess) status = status_tui;
|
||||
|
||||
p_if_state->ui_thread_event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
p_if_state->ui_thread = (HANDLE)_beginthreadex(NULL, 0, SplashThread, (void*)p_if_state, 0, &p_if_state->ui_thread_id);
|
||||
if (WaitForSingleObject(p_if_state->ui_thread_event, 5000) == INFINITE) {
|
||||
dbg_printf("ui_thread_event : WAIT_TIMEOUT\n");
|
||||
}
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
@ -856,6 +1050,14 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
state.appHWnd = FindConsoleHandle();
|
||||
|
||||
// TODO :: This should check argv[0] and behave differently for each of msys2, mingw32 and mingw64.
|
||||
// TODO :: It should also interpret the filenames as relative paths from argv[0].
|
||||
char* default_args[] = {"msys2_updater.exe", "--gui", "C:\\msys64\\usr\\bin\\msys-2.0.dll", "C:\\msys64\\usr\\bin\\bash.exe"};
|
||||
if (argc == 1) {
|
||||
argc = sizeof(default_args)/sizeof(default_args[0]);
|
||||
argv = default_args;
|
||||
}
|
||||
|
||||
kExitCode exit_code = ParseArguments(argc, argv, &args);
|
||||
if (exit_code == kUserNoFiles) {
|
||||
PrintHelp();
|
||||
@ -867,8 +1069,8 @@ int main(int argc, char* argv[]) {
|
||||
} else if (exit_code != kSuccess) {
|
||||
return (exit_code);
|
||||
}
|
||||
|
||||
exit_code = InterfaceStateInit(&args, &state.if_state);
|
||||
|
||||
if (exit_code != kSuccess) {
|
||||
CleanupAndExit(&args, &state, exit_code);
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ if ! which gimp > /dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "1" = "0" ]; then
|
||||
#if [ "1" = "0" ]; then
|
||||
{
|
||||
cat <<EOF
|
||||
(define (convert-xcf-to-jpeg filename outfile)
|
||||
@ -39,7 +39,7 @@ done
|
||||
|
||||
echo "(gimp-quit 0)"
|
||||
} | gimp -i -b -
|
||||
fi
|
||||
#fi
|
||||
|
||||
FRAMES=0
|
||||
JPG_FILES=$(find . -name "*.jpg" -printf "%f\n" | sort)
|
||||
|
||||
@ -17,3 +17,38 @@ IDC_SPLASH_JPG_14 RCDATA MOVEABLE PURE "frame14.jpg"
|
||||
IDC_SPLASH_JPG_15 RCDATA MOVEABLE PURE "frame15.jpg"
|
||||
IDC_SPLASH_JPG_16 RCDATA MOVEABLE PURE "frame16.jpg"
|
||||
IDC_SPLASH_JPG_17 RCDATA MOVEABLE PURE "frame17.jpg"
|
||||
IDC_SPLASH_JPG_00 RCDATA MOVEABLE PURE "frame00.jpg"
|
||||
IDC_SPLASH_JPG_02 RCDATA MOVEABLE PURE "frame02.jpg"
|
||||
IDC_SPLASH_JPG_03 RCDATA MOVEABLE PURE "frame03.jpg"
|
||||
IDC_SPLASH_JPG_04 RCDATA MOVEABLE PURE "frame04.jpg"
|
||||
IDC_SPLASH_JPG_05 RCDATA MOVEABLE PURE "frame05.jpg"
|
||||
IDC_SPLASH_JPG_06 RCDATA MOVEABLE PURE "frame06.jpg"
|
||||
IDC_SPLASH_JPG_07 RCDATA MOVEABLE PURE "frame07.jpg"
|
||||
IDC_SPLASH_JPG_08 RCDATA MOVEABLE PURE "frame08.jpg"
|
||||
IDC_SPLASH_JPG_09 RCDATA MOVEABLE PURE "frame09.jpg"
|
||||
IDC_SPLASH_JPG_10 RCDATA MOVEABLE PURE "frame10.jpg"
|
||||
IDC_SPLASH_JPG_11 RCDATA MOVEABLE PURE "frame11.jpg"
|
||||
IDC_SPLASH_JPG_12 RCDATA MOVEABLE PURE "frame12.jpg"
|
||||
IDC_SPLASH_JPG_13 RCDATA MOVEABLE PURE "frame13.jpg"
|
||||
IDC_SPLASH_JPG_14 RCDATA MOVEABLE PURE "frame14.jpg"
|
||||
IDC_SPLASH_JPG_15 RCDATA MOVEABLE PURE "frame15.jpg"
|
||||
IDC_SPLASH_JPG_16 RCDATA MOVEABLE PURE "frame16.jpg"
|
||||
IDC_SPLASH_JPG_17 RCDATA MOVEABLE PURE "frame17.jpg"
|
||||
IDC_SPLASH_JPG_00 RCDATA MOVEABLE PURE "frame00.jpg"
|
||||
IDC_SPLASH_JPG_01 RCDATA MOVEABLE PURE "frame01.jpg"
|
||||
IDC_SPLASH_JPG_02 RCDATA MOVEABLE PURE "frame02.jpg"
|
||||
IDC_SPLASH_JPG_03 RCDATA MOVEABLE PURE "frame03.jpg"
|
||||
IDC_SPLASH_JPG_04 RCDATA MOVEABLE PURE "frame04.jpg"
|
||||
IDC_SPLASH_JPG_05 RCDATA MOVEABLE PURE "frame05.jpg"
|
||||
IDC_SPLASH_JPG_06 RCDATA MOVEABLE PURE "frame06.jpg"
|
||||
IDC_SPLASH_JPG_07 RCDATA MOVEABLE PURE "frame07.jpg"
|
||||
IDC_SPLASH_JPG_08 RCDATA MOVEABLE PURE "frame08.jpg"
|
||||
IDC_SPLASH_JPG_09 RCDATA MOVEABLE PURE "frame09.jpg"
|
||||
IDC_SPLASH_JPG_10 RCDATA MOVEABLE PURE "frame10.jpg"
|
||||
IDC_SPLASH_JPG_11 RCDATA MOVEABLE PURE "frame11.jpg"
|
||||
IDC_SPLASH_JPG_12 RCDATA MOVEABLE PURE "frame12.jpg"
|
||||
IDC_SPLASH_JPG_13 RCDATA MOVEABLE PURE "frame13.jpg"
|
||||
IDC_SPLASH_JPG_14 RCDATA MOVEABLE PURE "frame14.jpg"
|
||||
IDC_SPLASH_JPG_15 RCDATA MOVEABLE PURE "frame15.jpg"
|
||||
IDC_SPLASH_JPG_16 RCDATA MOVEABLE PURE "frame16.jpg"
|
||||
IDC_SPLASH_JPG_17 RCDATA MOVEABLE PURE "frame17.jpg"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user