VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile70
1 files changed, 45 insertions, 25 deletions
diff --git a/src/Makefile b/src/Makefile
index 799a8ff5..65d9a4ef 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -23,8 +23,8 @@
# SSSE3: Enable SSSE3 support in compiler
# SSE41: Enable SSE4.1 support in compiler
# NOSSE2: Disable SEE2 support in compiler
-# WITHGTK3: Build wxWidgets against GTK3
-# WOLFCRYPT: Build with wolfCrypt as crypto provider (see Crypto/wolfCrypt.md)
+# WOLFCRYPT: Build with wolfCrypt as crypto provider (see Crypto/wolfCrypt.md)
+# WITHFUSET: Build with FUSE-T support on macOS instead of MacFUSE
#------ Targets ------
# all
@@ -52,6 +52,8 @@ export LFLAGS :=
export PKG_CONFIG ?= pkg-config
export PKG_CONFIG_PATH ?= /usr/local/lib/pkgconfig
+export VC_FUSE_PACKAGE := fuse
+export VC_OSX_FUSET ?= 0
export WX_CONFIG ?= wx-config
export WX_CONFIG_ARGS := --unicode
@@ -62,6 +64,12 @@ WX_ROOT ?= $(BASE_DIR)/wxWidgets
export TC_BUILD_CONFIG := Release
+ifeq "$(origin WITHFUSET)" "command line"
+ ifneq "$(WITHFUSET)" "0"
+ VC_OSX_FUSET := 1
+ endif
+endif
+
ifeq "$(origin DEBUG)" "command line"
ifneq "$(DEBUG)" "0"
TC_BUILD_CONFIG := Debug
@@ -97,16 +105,6 @@ ifeq "$(origin WXSTATIC)" "command line"
endif
endif
-ifeq "$(origin INDICATOR)" "command line"
- ifneq (,$(findstring gtk3,$(shell $(WX_CONFIG) --selected-config)))
- INDICATOR_LIBRARY=ayatana-appindicator3-0.1
- else
- INDICATOR_LIBRARY=ayatana-appindicator-0.1
- endif
- export AYATANA_LIBS += $(shell $(PKG_CONFIG) --libs $(INDICATOR_LIBRARY))
- C_CXX_FLAGS += $(shell $(PKG_CONFIG) --cflags $(INDICATOR_LIBRARY)) -DHAVE_INDICATORS
-endif
-
#------ Release configuration ------
ifeq "$(TC_BUILD_CONFIG)" "Release"
@@ -150,6 +148,7 @@ export ENABLE_WOLFCRYPT ?= 0
export GCC_GTEQ_440 := 0
export GCC_GTEQ_430 := 0
+export GTK_VERSION := 0
ARCH ?= $(shell uname -m)
@@ -202,7 +201,7 @@ ifeq "$(shell uname -s)" "Linux"
C_CXX_FLAGS += -DTC_UNIX -DTC_LINUX
# PCSC
- C_CXX_FLAGS += $(shell pkg-config --cflags libpcsclite)
+ C_CXX_FLAGS += $(shell $(PKG_CONFIG) --cflags libpcsclite)
# Extract the major and minor version numbers of GCC in a combined format for easy comparison
GCC_VERSION := $(shell $(CC) -dumpversion | awk -F. '{printf "%d%02d", $$1, $$2}')
@@ -279,13 +278,6 @@ ifeq "$(shell uname -s)" "Linux"
WXCONFIG_CFLAGS += -mno-sse2
WXCONFIG_CXXFLAGS += -mno-sse2
endif
-
- ifeq "$(origin WITHGTK3)" "command line"
- WX_CONFIGURE_FLAGS += --with-gtk=3
- else
- WX_CONFIGURE_FLAGS += --with-gtk=2
- endif
-
endif
#------ Mac OS X configuration ------
@@ -315,6 +307,7 @@ ifeq "$(shell uname -s)" "Darwin"
GCC_GTEQ_430 := 1
+ CXXFLAGS += -std=c++11
C_CXX_FLAGS += -DTC_UNIX -DTC_BSD -DTC_MACOSX -mmacosx-version-min=$(VC_OSX_TARGET) -isysroot $(VC_OSX_SDK_PATH)
LFLAGS += -mmacosx-version-min=$(VC_OSX_TARGET) -Wl,-syslibroot $(VC_OSX_SDK_PATH)
#Xcode 15 linker emits a warning "no platform load command found" when linking object files generated by yasm
@@ -332,6 +325,10 @@ ifeq "$(shell uname -s)" "Darwin"
WX_CONFIGURE_FLAGS += --with-macosx-version-min=$(VC_OSX_TARGET) --with-macosx-sdk=$(VC_OSX_SDK_PATH)
+ ifneq "$(VC_OSX_FUSET)" "0"
+ C_CXX_FLAGS += -DVC_MACOSX_FUSET
+ VC_FUSE_PACKAGE := fuse-t
+ endif
# Set x86 assembly flags (-msse2, -mssse3, -msse4.1)
# Apply flags if SIMD_SUPPORTED is 1 or if not in local development build (we are creating universal binary in this case)
@@ -380,7 +377,6 @@ ifeq "$(shell uname -s)" "Darwin"
ARCH_FLAG += -arch i386
WX_CONFIGURE_FLAGS += --enable-universal_binary=i386,x86_64
else
- CXXFLAGS += -std=c++11
# Non-development build defaults to universal binary for arm64 and x86_64
ARCH_FLAG += -arch arm64
WX_CONFIGURE_FLAGS += --enable-universal_binary=arm64,x86_64
@@ -413,7 +409,7 @@ ifeq "$(shell uname -s)" "FreeBSD"
C_CXX_FLAGS += -DTC_UNIX -DTC_BSD -DTC_FREEBSD
# PCSC
- C_CXX_FLAGS += $(shell pkg-config --cflags libpcsclite)
+ C_CXX_FLAGS += $(shell $(PKG_CONFIG) --cflags libpcsclite)
CC := cc
CXX := c++
@@ -474,7 +470,7 @@ ifeq "$(shell uname -s)" "OpenBSD"
C_CXX_FLAGS += -DTC_UNIX -DTC_BSD -DTC_OPENBSD
# PCSC
- C_CXX_FLAGS += $(shell pkg-config --cflags libpcsclite)
+ C_CXX_FLAGS += $(shell $(PKG_CONFIG) --cflags libpcsclite)
CC := cc
CXX := c++
@@ -501,10 +497,29 @@ ifeq "$(shell uname -s)" "SunOS"
WX_CONFIGURE_FLAGS += --with-gtk
# PCSC
- C_CXX_FLAGS += $(shell pkg-config --cflags libpcsclite)
+ C_CXX_FLAGS += $(shell $(PKG_CONFIG) --cflags libpcsclite)
endif
+ifneq (,$(filter Linux FreeBSD OpenBSD,$(PLATFORM)))
+ # Determine GTK version
+ GTK_VERSION := $(shell $(PKG_CONFIG) --modversion gtk+-3.0 2>/dev/null | grep -o '^3' || echo 2)
+ ifeq ($(GTK_VERSION),3)
+ WX_CONFIGURE_FLAGS += --with-gtk=3
+ else
+ WX_CONFIGURE_FLAGS += --with-gtk=2
+ endif
+
+ ifeq "$(origin INDICATOR)" "command line"
+ ifeq ($(GTK_VERSION),3)
+ INDICATOR_LIBRARY=ayatana-appindicator3-0.1
+ else
+ INDICATOR_LIBRARY=ayatana-appindicator-0.1
+ endif
+ export AYATANA_LIBS += $(shell $(PKG_CONFIG) --libs $(INDICATOR_LIBRARY))
+ C_CXX_FLAGS += $(shell $(PKG_CONFIG) --cflags $(INDICATOR_LIBRARY)) -DHAVE_INDICATORS
+ endif
+endif
#------ Common configuration ------
@@ -534,12 +549,17 @@ WX_CONFIGURE_FLAGS += --disable-protocol --disable-protocols --disable-url --dis
ifneq (,$(filter Linux FreeBSD,$(PLATFORM)))
WX_CONFIGURE_FLAGS += --disable-tooltips
-ifneq "$(origin WITHGTK3)" "command line"
+ifneq ($(GTK_VERSION),3)
WX_CONFIGURE_FLAGS += --disable-graphics_ctx
endif
else
WX_CONFIGURE_FLAGS += --disable-graphics_ctx
endif
+else
+# Disable libtiff on macOS
+ifeq "$(PLATFORM)" "MacOSX"
+ WX_CONFIGURE_FLAGS += --without-libtiff
+endif
endif