Skip to content

Commit

Permalink
Build macOS app for two architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
teusbenschop committed Oct 17, 2023
1 parent d846c37 commit 4a514f9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
9 changes: 9 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,15 @@ AM_CXXFLAGS += $(GUMBO_CFLAGS)
AM_CXXFLAGS += $(PUGIXML_CFLAGS)
AM_CXXFLAGS += $(GTEST_CFLAGS)

if MACFLAGS
# Building Bibledit for macOS for two architectures
# due to the switch from macOS from the x86_64 to the arm64 architecture.
# Additionally it uses the includes and libraries from the macOS SDK.
# Generate the macOS SDK path: $ xcrun --show-sdk-path
AM_CXXFLAGS += -mmacosx-version-min=10.10 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -arch x86_64 -arch arm64
AM_CFLAGS += -mmacosx-version-min=10.10 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -arch x86_64 -arch arm64
endif

LIBS = -Wall -lpthread -L. -g -rdynamic -ldl
LIBS += $(CURL_LIBS)
LIBS += $(OPENSSL_LIBS)
Expand Down
8 changes: 6 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ bin_PROGRAMS = server$(EXEEXT) unittest$(EXEEXT) generate$(EXEEXT)
@COMPILERWARNINGS_TRUE@am__append_1 = -Wall -Wno-unknown-pragmas -Wextra -pedantic -Wno-pragmas
@COMPILERWARNINGS_TRUE@am__append_2 = -Wall -Wno-unknown-pragmas -Wextra -pedantic -Wshadow -Warray-bounds -Wcast-align -Wcast-qual -Wconversion -Wctor-dtor-privacy -Wdelete-non-virtual-dtor -Weffc++ -Wextra-semi -Wfloat-equal -Wformat=2 -Wmissing-include-dirs -Wmissing-noreturn -Wnull-dereference -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wsign-promo -Wsuggest-override -Wswitch-default -Wswitch-enum -Wundef -Wuninitialized -Wunused-but-set-parameter -Wunused-macros -Wunused-parameter -Wvla -Wzero-as-null-pointer-constant -Wmismatched-tags
@COMPILERGCC_TRUE@@COMPILERWARNINGS_TRUE@am__append_3 = -Wcatch-value=2 -Wconditionally-supported -Wduplicated-branches -Wduplicated-cond -Wformat-overflow=2 -Wlogical-op -Wnoexcept -Wno-non-template-friend -Wrestrict -Wstrict-null-sentinel -Wuseless-cast -Wcomma-subscript -Wredundant-tags -Wvolatile

# Generate the macOS SDK path: $ xcrun --show-sdk-path
@MACFLAGS_TRUE@am__append_4 = -mmacosx-version-min=10.10 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -arch x86_64 -arch arm64
@MACFLAGS_TRUE@am__append_5 = -mmacosx-version-min=10.10 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -arch x86_64 -arch arm64
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
Expand Down Expand Up @@ -1648,13 +1652,13 @@ generate_SOURCES = \
sources/styles.cpp

generate_LDADD = libbibledit.a
AM_CFLAGS = -g $(OPENSSL_CFLAGS) $(am__append_1)
AM_CFLAGS = -g $(OPENSSL_CFLAGS) $(am__append_1) $(am__append_5)
# AM_CXXFLAGS += $(TIDY_CFLAGS) -I/usr/include/tidy
AM_CXXFLAGS = -fno-var-tracking -g $(am__append_2) $(am__append_3) \
$(CURL_CFLAGS) $(OPENSSL_CFLAGS) $(GTK_CFLAGS) \
$(WEBKIT2GTK_CFLAGS) $(ICU_CFLAGS) $(XML2_CFLAGS) \
$(UTF8PROC_CFLAGS) $(GUMBO_CFLAGS) $(PUGIXML_CFLAGS) \
$(GTEST_CFLAGS)
$(GTEST_CFLAGS) $(am__append_4)

# The core library compiles and embeds the mbedtls library.
# On Debian this gives a lintian error:
Expand Down
14 changes: 14 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,8 @@ LTLIBOBJS
LIBOBJS
COMPILERWARNINGS_FALSE
COMPILERWARNINGS_TRUE
MACFLAGS_FALSE
MACFLAGS_TRUE
COMPILERCLANG_FALSE
COMPILERCLANG_TRUE
COMPILERGCC_FALSE
Expand Down Expand Up @@ -7654,6 +7656,14 @@ printf "%s\n" "#define HAVE_MAC 1" >>confdefs.h
ENABLEMAC=yes


fi

if test $ENABLEMAC = yes; then
MACFLAGS_TRUE=
MACFLAGS_FALSE='#'
else
MACFLAGS_TRUE='#'
MACFLAGS_FALSE=
fi


Expand Down Expand Up @@ -7856,6 +7866,10 @@ if test -z "${COMPILERCLANG_TRUE}" && test -z "${COMPILERCLANG_FALSE}"; then
as_fn_error $? "conditional \"COMPILERCLANG\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MACFLAGS_TRUE}" && test -z "${MACFLAGS_FALSE}"; then
as_fn_error $? "conditional \"MACFLAGS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${COMPILERWARNINGS_TRUE}" && test -z "${COMPILERWARNINGS_FALSE}"; then
as_fn_error $? "conditional \"COMPILERWARNINGS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ AC_DEFINE([HAVE_MAC], [1], [Define whether to compile for Mac])
ENABLEMAC=yes
]
)
AM_CONDITIONAL([MACFLAGS],[test $ENABLEMAC = yes])

# Linux.
ENABLELINUX=no
Expand Down
3 changes: 0 additions & 3 deletions pkgdata/files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@
/fonts/Montserrat-SemiBold.ttf
/fonts/SILEOT.ttf
/fonts/SIL-Licenses.txt
/generate
/git
/git/gitflag
/help
Expand Down Expand Up @@ -714,7 +713,6 @@
/sendreceive
/sendreceive/index.html
/sendreceive/index.js
/server
/session
/session/login.html
/session/login.js
Expand Down Expand Up @@ -953,7 +951,6 @@
/tmp/holder
/trash
/trash/holder
/unittest
/unittests
/unittests/scripts
/unittests/scripts/editor1.py
Expand Down

0 comments on commit 4a514f9

Please sign in to comment.