Skip to content

Commit

Permalink
Switch compiler back to C++17
Browse files Browse the repository at this point in the history
  • Loading branch information
teusbenschop committed Oct 19, 2023
1 parent 4a514f9 commit 25d92c0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 45 deletions.
5 changes: 4 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ bin_PROGRAMS = server$(EXEEXT) unittest$(EXEEXT) generate$(EXEEXT)
@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

# 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
@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
Expand Down Expand Up @@ -946,7 +949,7 @@ GUMBO_CFLAGS = @GUMBO_CFLAGS@
GUMBO_LIBS = @GUMBO_LIBS@
GUNZIP_PATH = @GUNZIP_PATH@
GZIP_PATH = @GZIP_PATH@
HAVE_CXX20 = @HAVE_CXX20@
HAVE_CXX17 = @HAVE_CXX17@
ICU_CFLAGS = @ICU_CFLAGS@
ICU_LIBS = @ICU_LIBS@
INSTALL = @INSTALL@
Expand Down
4 changes: 2 additions & 2 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
/* Define whether to compile for Android */
/* #undef HAVE_ANDROID */

/* define if the compiler supports basic C++20 syntax */
#define HAVE_CXX20 1
/* define if the compiler supports basic C++17 syntax */
#define HAVE_CXX17 1

/* Define whether execinfo.h is present */
#define HAVE_EXECINFO 1
Expand Down
4 changes: 2 additions & 2 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/* Define whether to compile for Android */
#undef HAVE_ANDROID

/* define if the compiler supports basic C++20 syntax */
#undef HAVE_CXX20
/* define if the compiler supports basic C++17 syntax */
#undef HAVE_CXX17

/* Define whether execinfo.h is present */
#undef HAVE_EXECINFO
Expand Down
52 changes: 13 additions & 39 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ FIND_TAR
GUNZIP_PATH
GZIP_PATH
RANLIB
HAVE_CXX20
HAVE_CXX17
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
CXXDEPMODE
Expand Down Expand Up @@ -5276,7 +5276,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu


ax_cxx_compile_alternatives="20" ax_cxx_compile_cxx20_required=true
ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=true
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Expand All @@ -5293,12 +5293,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do
if test x"$switch" = xMSVC; then
switch=-std:c++${alternative}
cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx20_${switch}_MSVC" | $as_tr_sh`
cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_${switch}_MSVC" | $as_tr_sh`
else
cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx20_$switch" | $as_tr_sh`
cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh`
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++20 features with $switch" >&5
printf %s "checking whether $CXX supports C++20 features with $switch... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5
printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; }
if eval test \${$cachevar+y}
then :
printf %s "(cached) " >&6
Expand Down Expand Up @@ -6097,32 +6097,6 @@ namespace cxx17
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 202002L && !defined _MSC_VER
#error "This is not a C++20 compiler"
#else
#include <version>
namespace cxx20
{
// As C++20 supports feature test macros in the standard, there is no
// immediate need to actually test for feature availability on the
// Autoconf side.
} // namespace cxx20
#endif // __cplusplus < 202002L && !defined _MSC_VER
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
Expand Down Expand Up @@ -6156,19 +6130,19 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

if test x$ax_cxx_compile_cxx20_required = xtrue; then
if test x$ax_cxx_compile_cxx17_required = xtrue; then
if test x$ac_success = xno; then
as_fn_error $? "*** A compiler with support for C++20 language features is required." "$LINENO" 5
as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5
fi
fi
if test x$ac_success = xno; then
HAVE_CXX20=0
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++20 support was found" >&5
printf "%s\n" "$as_me: No compiler with C++20 support was found" >&6;}
HAVE_CXX17=0
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5
printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;}
else
HAVE_CXX20=1
HAVE_CXX17=1

printf "%s\n" "#define HAVE_CXX20 1" >>confdefs.h
printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h

fi

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ac_default_prefix=/usr
AC_PROG_CC
AC_PROG_CXX
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX(20,[noext],[mandatory])
AX_CXX_COMPILE_STDCXX(17,[noext],[mandatory])
AC_PROG_RANLIB
AC_CONFIG_HEADERS([config.h])

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

0 comments on commit 25d92c0

Please sign in to comment.