diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2021-08-15 00:51:06 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2021-08-15 01:07:17 +0200 |
commit | 8ae5a715d66dcbc598017f262089165b762f42c5 (patch) | |
tree | d1067a8e36e94f246e494677e04ebebaa175febe | |
parent | 33baca72616d7d78e7a31519ea608a8f493842d6 (diff) | |
download | VeraCrypt-8ae5a715d66dcbc598017f262089165b762f42c5.tar.gz VeraCrypt-8ae5a715d66dcbc598017f262089165b762f42c5.zip |
MacOSX: First native Apple M1 support
-rw-r--r-- | src/Main/FatalErrorHandler.cpp | 4 | ||||
-rw-r--r-- | src/Main/Forms/MainFrame.cpp | 2 | ||||
-rw-r--r-- | src/Main/Forms/international.h | 2 | ||||
-rw-r--r-- | src/Main/LanguageStrings.cpp | 6 | ||||
-rwxr-xr-x | src/Main/Main.make | 2 | ||||
-rw-r--r-- | src/Main/Resources.cpp | 25 | ||||
-rw-r--r-- | src/Makefile | 12 |
7 files changed, 33 insertions, 20 deletions
diff --git a/src/Main/FatalErrorHandler.cpp b/src/Main/FatalErrorHandler.cpp index 40b11cca..5e391698 100644 --- a/src/Main/FatalErrorHandler.cpp +++ b/src/Main/FatalErrorHandler.cpp @@ -56,9 +56,13 @@ namespace VeraCrypt #elif defined (TC_MACOSX) # ifdef __x86_64__ faultingInstructionAddress = context->uc_mcontext->__ss.__rip; +# else +# ifdef __aarch64__ + faultingInstructionAddress = context->uc_mcontext->__ss.__pc; # else faultingInstructionAddress = context->uc_mcontext->__ss.__eip; # endif +# endif #endif wstringstream vars; diff --git a/src/Main/Forms/MainFrame.cpp b/src/Main/Forms/MainFrame.cpp index b744ebbd..45b3cf72 100644 --- a/src/Main/Forms/MainFrame.cpp +++ b/src/Main/Forms/MainFrame.cpp @@ -282,7 +282,7 @@ namespace VeraCrypt VolumeStaticBoxSizer->Detach (VolumeGridBagSizer); VolumeStaticBoxSizer->Add (VolumeGridBagSizer, 1, wxEXPAND, 0); - ExitButton->SetLabel (LangString["CLOSE"]); + ExitButton->SetLabel (LangString["IDCLOSE"]); MountAllDevicesButton->SetLabel (LangString["LINUX_MOUNT_ALL_DEV"]); #endif diff --git a/src/Main/Forms/international.h b/src/Main/Forms/international.h index a30adab0..1ca0c436 100644 --- a/src/Main/Forms/international.h +++ b/src/Main/Forms/international.h @@ -1,4 +1,4 @@ -#ifdef TC_LINUX +#ifndef TC_WINDOWS #include "Main/LanguageStrings.h" #undef _ #define _(key) LangString[key] diff --git a/src/Main/LanguageStrings.cpp b/src/Main/LanguageStrings.cpp index 33aaf6a9..71914ec7 100644 --- a/src/Main/LanguageStrings.cpp +++ b/src/Main/LanguageStrings.cpp @@ -29,6 +29,9 @@ namespace VeraCrypt { if (Map.count (key) > 0) return wxString (Map.find (key)->second); + // return "VeraCrypt" as it is + if (key == "VeraCrypt") + return L"VeraCrypt"; return wxString (L"?") + StringConverter::ToWide (key) + L"?"; } @@ -40,7 +43,6 @@ namespace VeraCrypt void LanguageStrings::Init () { -#ifdef TC_LINUX static byte LanguageXml[] = { # include "Common/Language.xml.h" @@ -53,7 +55,7 @@ namespace VeraCrypt text.Replace (L"\\n", L"\n"); Map[StringConverter::ToSingle (wstring (node.Attributes[L"key"]))] = text; } -#endif + foreach (XmlNode node, XmlParser (Resources::GetLanguageXml()).GetNodes (L"entry")) { wxString text = node.InnerText; diff --git a/src/Main/Main.make b/src/Main/Main.make index 77f7dc91..3a9ef8c6 100755 --- a/src/Main/Main.make +++ b/src/Main/Main.make @@ -178,6 +178,7 @@ endif ifeq "$(PLATFORM)" "MacOSX" prepare: $(APPNAME) mkdir -p $(APPNAME).app/Contents/MacOS $(APPNAME).app/Contents/Resources/doc/HTML + mkdir -p $(APPNAME).app/Contents/MacOS $(APPNAME).app/Contents/Resources/languages -rm -f $(APPNAME).app/Contents/MacOS/$(APPNAME) -rm -f $(APPNAME).app/Contents/MacOS/$(APPNAME)_console @@ -200,6 +201,7 @@ endif cp $(BASE_DIR)/Resources/Icons/VeraCrypt.icns $(APPNAME).app/Contents/Resources cp $(BASE_DIR)/Resources/Icons/VeraCrypt_Volume.icns $(APPNAME).app/Contents/Resources cp $(BASE_DIR)/../doc/html/* $(APPNAME).app/Contents/Resources/doc/HTML + cp $(BASE_DIR)/../Translations/* $(APPNAME).app/Contents/Resources/languages echo -n APPLTRUE >$(APPNAME).app/Contents/PkgInfo ifdef VC_LEGACY_BUILD diff --git a/src/Main/Resources.cpp b/src/Main/Resources.cpp index 32bcd9d2..6ba63c52 100644 --- a/src/Main/Resources.cpp +++ b/src/Main/Resources.cpp @@ -14,16 +14,17 @@ #include "Platform/Platform.h" #include "Resources.h" -#ifdef TC_LINUX +#ifdef TC_WINDOWS +#include "Main/resource.h" +#else +#ifdef TC_MACOSX +#include "Application.h" +#endif #include "Platform/File.h" #include "Platform/StringConverter.h" #include <stdio.h> #endif -#ifdef TC_WINDOWS -#include "Main/resource.h" -#endif - namespace VeraCrypt { @@ -54,13 +55,17 @@ namespace VeraCrypt strBuf.Zero(); strBuf.CopyFrom (res); return string (reinterpret_cast <char *> (strBuf.Ptr())); -#elif TC_LINUX +#else // get language from env LANG // support: C,POSIX, // support for e.g. german: de_DE.UTF-8, de.UTF8, de_DE, de // not support e.g.: de@Euro string defaultLang("en"); +#if defined (TC_MACOSX) + string filenamePrefix = StringConverter::ToSingle (Application::GetExecutableDirectory()) + "/../Resources/languages/Language."; +#else string filenamePrefix("/usr/share/veracrypt/languages/Language."); +#endif string filenamePost(".xml"); string filename = filenamePrefix + defaultLang + filenamePost; if(const char* env_p = getenv("LANG")){ @@ -127,14 +132,6 @@ namespace VeraCrypt }; return string ((const char*) LanguageXml); -#else - static byte LanguageXml[] = - { -# include "Common/Language.xml.h" - , 0 - }; - - return string ((const char*) LanguageXml); #endif } diff --git a/src/Makefile b/src/Makefile index 4f9796b6..e8cc2d68 100644 --- a/src/Makefile +++ b/src/Makefile @@ -274,6 +274,10 @@ ifeq "$(shell uname -s)" "Darwin" ifeq "$(CPU_ARCH)" "x64" CPU_ARCH = x86 endif + + ifeq "$(CPU_ARCH)" "arm64" + CPU_ARCH = x86 + endif CFLAGS += -msse2 CXXFLAGS += -msse2 @@ -302,14 +306,18 @@ ifeq "$(shell uname -s)" "Darwin" C_CXX_FLAGS += -gfull -arch x86_64 LFLAGS += -Wl,-dead_strip -arch x86_64 + WX_CONFIGURE_FLAGS += --without-libpng --disable-gif --disable-pcx --disable-tga --disable-iff --disable-gif --disable-svg + #----- Legacy build: we build both 32-bit and 64-bit ---- ifdef VC_LEGACY_BUILD C_CXX_FLAGS += -arch i386 LFLAGS += -arch i386 WX_CONFIGURE_FLAGS += --enable-universal_binary=i386,x86_64 else - CXXFLAGS += -std=c++11 - WX_CONFIGURE_FLAGS += --disable-universal_binary + CXXFLAGS += -std=c++11 + C_CXX_FLAGS += -arch arm64 + LFLAGS += -arch arm64 + WX_CONFIGURE_FLAGS += --enable-universal_binary=arm64,x86_64 endif WXCONFIG_CFLAGS += -gfull |