[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: hashcat build in kFreeBSD



Steven Chamberlain wrote:
> The attached patch

Oops, really attached this time.

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org
diff --git a/include/common.h b/include/common.h
index c36a3e0..43b9505 100644
--- a/include/common.h
+++ b/include/common.h
@@ -52,7 +52,7 @@
 #include <mach/mach.h>
 #endif
 
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 #include <termios.h>
 #include <sys/ioctl.h>
 #endif
diff --git a/include/ext_OpenCL.h b/include/ext_OpenCL.h
index 49021a9..fb63746 100644
--- a/include/ext_OpenCL.h
+++ b/include/ext_OpenCL.h
@@ -25,7 +25,7 @@
 #include <CL/cl.h>
 #endif
 
-#ifdef __FreeBSD__
+#ifdef __FreeBSD_kernel__
 #include <CL/cl.h>
 #endif
 
diff --git a/src/Makefile b/src/Makefile
index afc1328..668ebd3 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -17,6 +17,9 @@ UNAME                    := $(shell uname -s)
 # we need to strip the windows version number to be able to build hashcat on cygwin hosts
 UNAME                    := $(patsubst CYGWIN_NT-%,CYGWIN_NT-,$(UNAME))
 
+# :XXX: treat GNU/kFreeBSD, Hurd and Linux
+UNAME                    := $(patsubst GNU%,Linux,$(UNAME))
+
 ifeq (,$(filter $(UNAME),Linux Darwin CYGWIN_NT- FreeBSD))
 $(error "! Your Operating System ($(UNAME)) is not supported by $(PROG_NAME) Makefile")
 endif
diff --git a/src/shared.c b/src/shared.c
index f52d762..f15516c 100644
--- a/src/shared.c
+++ b/src/shared.c
@@ -18,6 +18,11 @@
 #include <shared.h>
 #include <limits.h>
 
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
+
 /**
  * basic bit handling
  */
@@ -2387,7 +2392,7 @@ int tty_fix()
 }
 #endif
 
-#if defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(__APPLE__) || defined(__FreeBSD_kernel__)
 static struct termios savemodes;
 static int havemodes = 0;
 
@@ -4378,9 +4383,7 @@ char *get_exec_path ()
 
   const int len = strlen (exec_path);
 
-  #elif __FreeBSD__
-
-  #include <sys/sysctl.h>
+  #elif __FreeBSD_kernel__
 
   int mib[4];
   mib[0] = CTL_KERN;

Attachment: signature.asc
Description: Digital signature


Reply to: