1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-24 23:48:39 +00:00

Add some changes to improve compiling on MSYS2

This commit is contained in:
jsteube 2016-10-21 09:07:39 +02:00
parent 6b96146e0f
commit c6c31a86d8
3 changed files with 13 additions and 6 deletions

View File

@ -12,10 +12,12 @@ PROG_NAME := hashcat
UNAME := $(shell uname -s) UNAME := $(shell uname -s)
# we need to strip the windows version number to be able to build hashcat on cygwin hosts # we need to strip the windows version number to be able to build hashcat on cygwin hosts
UNAME := $(patsubst CYGWIN_NT-%,CYGWIN_NT-,$(UNAME)) UNAME := $(patsubst CYGWIN_NT-%,CYGWIN,$(UNAME))
UNAME := $(patsubst MINGW64_NT-%,MINGW64_NT-,$(UNAME)) UNAME := $(patsubst MSYS_NT-%,MSYS2,$(UNAME))
UNAME := $(patsubst MINGW32_NT-%,MSYS2,$(UNAME))
UNAME := $(patsubst MINGW64_NT-%,MSYS2,$(UNAME))
ifeq (,$(filter $(UNAME),Linux Darwin CYGWIN_NT- MINGW64_NT- FreeBSD)) ifeq (,$(filter $(UNAME),Linux Darwin CYGWIN MSYS2 FreeBSD))
$(error "! Your Operating System ($(UNAME)) is not supported by $(PROG_NAME) Makefile") $(error "! Your Operating System ($(UNAME)) is not supported by $(PROG_NAME) Makefile")
endif endif

View File

@ -74,7 +74,7 @@ static int get_exec_path (char *exec_path, const size_t exec_path_sz)
return 0; return 0;
} }
static void get_install_dir (char *install_dir, const char *exec_path) void get_install_dir (char *install_dir, const char *exec_path)
{ {
strncpy (install_dir, exec_path, HCBUFSIZ_TINY - 1); strncpy (install_dir, exec_path, HCBUFSIZ_TINY - 1);
@ -95,12 +95,12 @@ static void get_install_dir (char *install_dir, const char *exec_path)
} }
} }
static void get_profile_dir (char *profile_dir, const char *home_dir) void get_profile_dir (char *profile_dir, const char *home_dir)
{ {
snprintf (profile_dir, HCBUFSIZ_TINY - 1, "%s/%s", home_dir, DOT_HASHCAT); snprintf (profile_dir, HCBUFSIZ_TINY - 1, "%s/%s", home_dir, DOT_HASHCAT);
} }
static void get_session_dir (char *session_dir, const char *profile_dir) void get_session_dir (char *session_dir, const char *profile_dir)
{ {
snprintf (session_dir, HCBUFSIZ_TINY - 1, "%s/%s", profile_dir, SESSIONS_FOLDER); snprintf (session_dir, HCBUFSIZ_TINY - 1, "%s/%s", profile_dir, SESSIONS_FOLDER);
} }

View File

@ -18,8 +18,13 @@ ifneq (,$(IS_WIN_BUILD))
# entering this code path means: we need to check for CRT_glob.o since we try to build binaries for windows operating systems # entering this code path means: we need to check for CRT_glob.o since we try to build binaries for windows operating systems
ifeq ($(UNAME),MSYS2)
CRT_GLOB_LIB_PATH_32 ?= /mingw32/i686-w64-mingw32/lib/
CRT_GLOB_LIB_PATH_64 ?= /mingw64/x86_64-w64-mingw32/lib/
else
CRT_GLOB_LIB_PATH_32 ?= /usr/i686-w64-mingw32/lib/ CRT_GLOB_LIB_PATH_32 ?= /usr/i686-w64-mingw32/lib/
CRT_GLOB_LIB_PATH_64 ?= /usr/x86_64-w64-mingw32/lib/ CRT_GLOB_LIB_PATH_64 ?= /usr/x86_64-w64-mingw32/lib/
endif
CRT_GLOB_LIB_SYSROOT_32 := $(shell $(CC_WIN_32) --verbose 2>&1 | $(EGREP) -m 1 -o '(with-sysroot="[^"]"|with-sysroot=[^ ]*)' | $(SED) 's/^with-sysroot="\?\([^"]*\)"\?$$/\1/') CRT_GLOB_LIB_SYSROOT_32 := $(shell $(CC_WIN_32) --verbose 2>&1 | $(EGREP) -m 1 -o '(with-sysroot="[^"]"|with-sysroot=[^ ]*)' | $(SED) 's/^with-sysroot="\?\([^"]*\)"\?$$/\1/')
CRT_GLOB_LIB_SYSROOT_64 := $(shell $(CC_WIN_64) --verbose 2>&1 | $(EGREP) -m 1 -o '(with-sysroot="[^"]"|with-sysroot=[^ ]*)' | $(SED) 's/^with-sysroot="\?\([^"]*\)"\?$$/\1/') CRT_GLOB_LIB_SYSROOT_64 := $(shell $(CC_WIN_64) --verbose 2>&1 | $(EGREP) -m 1 -o '(with-sysroot="[^"]"|with-sysroot=[^ ]*)' | $(SED) 's/^with-sysroot="\?\([^"]*\)"\?$$/\1/')