~cypheon/pkgsrc-wip

pkgsrc-wip/hashcat/patches/patch-src_Makefile -rw-r--r-- 2.8 KiB
5f1bf4f5 — Johann Rudloff Subst PLIST paths for platform specific files for other architectures 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
$NetBSD$

Set preferences.
Add minimal NetBSD support.
Don't override CC nor optimisation flags in CFLAGS.
Remove sed magic; we'll use nbsed.

--- src/Makefile.orig	2021-05-15 12:07:58.000000000 +0000
+++ src/Makefile
@@ -31,7 +31,7 @@ UNAME                   := $(patsubst MS
 UNAME                   := $(patsubst MINGW32_NT-%,MSYS2,$(UNAME))
 UNAME                   := $(patsubst MINGW64_NT-%,MSYS2,$(UNAME))
 
-ifeq (,$(filter $(UNAME),Linux FreeBSD Darwin CYGWIN MSYS2))
+ifeq (,$(filter $(UNAME),Linux FreeBSD NetBSD Darwin CYGWIN MSYS2))
 $(error "! Your Operating System ($(UNAME)) is not supported by this Makefile")
 endif
 
@@ -59,8 +59,6 @@ MODULE_INTERFACE_VERSION := 620
 ## Native compiler paths
 ##
 
-CC                      := gcc
-CXX                     := g++
 AR                      := ar
 FIND                    := find
 INSTALL                 := install
@@ -69,20 +67,9 @@ SED                     := sed
 SED_IN_PLACE            := -i
 
 ifeq ($(UNAME),Darwin)
-CC                      := clang
-CXX                     := clang++
-# the sed -i option of macOS requires a parameter for the backup file (we just use "")
-AR                      := /usr/bin/ar
-SED                     := /usr/bin/sed
-SED_IN_PLACE            := -i ""
 DARWIN_VERSION          := $(shell uname -r | cut -d. -f1)
 endif
 
-ifeq ($(UNAME),FreeBSD)
-CC                      := cc
-CXX                     := c++
-SED                     := gsed
-endif
 
 ##
 ## Version
@@ -222,7 +209,6 @@ endif
 endif
 
 ifeq ($(DEBUG),0)
-CFLAGS                  += -O2
 ifneq ($(UNAME),Darwin)
 LFLAGS                  += -s
 endif
@@ -306,6 +292,13 @@ LFLAGS_NATIVE           += -liconv
 endif
 endif # FreeBSD
 
+ifeq ($(UNAME),NetBSD)
+CFLAGS_NATIVE           := $(CFLAGS)
+CFLAGS_NATIVE           += -I$(OPENCL_HEADERS_KHRONOS)/
+LFLAGS_NATIVE           := $(LFLAGS)
+LFLAGS_NATIVE           += -lpthread
+endif # NetBSD
+
 ifeq ($(UNAME),Darwin)
 export MACOSX_DEPLOYMENT_TARGET=10.9
 CFLAGS_NATIVE           := $(CFLAGS)
@@ -630,8 +623,13 @@ endif
 $(MODULES_DISABLE): ;
 
 ifeq ($(SHARED),1)
+  ifeq ($(UNAME),Darwin)
+modules/module_%.$(MODULE_SUFFIX): src/modules/module_%.c $(HASHCAT_LIBRARY)
+	$(CC)    $(CCFLAGS) $(CFLAGS_NATIVE) $^ -o $@ $(LFLAGS_NATIVE) -install_name $(SHARED_FOLDER)/$@ -shared -fPIC -D MODULE_INTERFACE_VERSION_CURRENT=$(MODULE_INTERFACE_VERSION)
+  else
 modules/module_%.$(MODULE_SUFFIX): src/modules/module_%.c $(HASHCAT_LIBRARY)
 	$(CC)    $(CCFLAGS) $(CFLAGS_NATIVE) $^ -o $@ $(LFLAGS_NATIVE) -shared -fPIC -D MODULE_INTERFACE_VERSION_CURRENT=$(MODULE_INTERFACE_VERSION)
+  endif
 else
 modules/module_%.$(MODULE_SUFFIX): src/modules/module_%.c obj/combined.NATIVE.a
 	$(CC)    $(CCFLAGS) $(CFLAGS_NATIVE) $^ -o $@ $(LFLAGS_NATIVE) -shared -fPIC -D MODULE_INTERFACE_VERSION_CURRENT=$(MODULE_INTERFACE_VERSION)