aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Third2020-09-03 21:56:03 +0100
committerAlan Third2020-09-03 21:56:03 +0100
commit4ea928e14f486ae8b89c0cdf1d19d3dc3d6498a2 (patch)
treeb01ec38c86b9f36cb598d86baf29f8eefc804975
parent00b22239ab7cd8bd6af6a234ceb673b43dd01df4 (diff)
downloademacs-4ea928e14f486ae8b89c0cdf1d19d3dc3d6498a2.tar.gz
emacs-4ea928e14f486ae8b89c0cdf1d19d3dc3d6498a2.zip
* configure.ac (GNU_OBJC_CFLAGS): Check ObjC defaults to C99. (bug#43167)
-rw-r--r--configure.ac19
1 files changed, 16 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index dd2adb7e740..0bcff587e8a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1900,8 +1900,7 @@ tmp_CPPFLAGS="$CPPFLAGS"
1900tmp_CFLAGS="$CFLAGS" 1900tmp_CFLAGS="$CFLAGS"
1901CPPFLAGS="$CPPFLAGS -x objective-c" 1901CPPFLAGS="$CPPFLAGS -x objective-c"
1902CFLAGS="$CFLAGS -x objective-c" 1902CFLAGS="$CFLAGS -x objective-c"
1903# Recent versions of GCC don't use C99 to compile Obj-C. 1903GNU_OBJC_CFLAGS=""
1904GNU_OBJC_CFLAGS="-std=c99"
1905LIBS_GNUSTEP= 1904LIBS_GNUSTEP=
1906if test "${with_ns}" != no; then 1905if test "${with_ns}" != no; then
1907 # macfont.o requires macuvs.h which is absent after 'make extraclean', 1906 # macfont.o requires macuvs.h which is absent after 'make extraclean',
@@ -1917,7 +1916,7 @@ if test "${with_ns}" != no; then
1917 elif flags=$( (gnustep-config --objc-flags) 2>/dev/null); then 1916 elif flags=$( (gnustep-config --objc-flags) 2>/dev/null); then
1918 NS_IMPL_GNUSTEP=yes 1917 NS_IMPL_GNUSTEP=yes
1919 NS_GNUSTEP_CONFIG=yes 1918 NS_GNUSTEP_CONFIG=yes
1920 GNU_OBJC_CFLAGS="$GNU_OBJC_CFLAGS $flags" 1919 GNU_OBJC_CFLAGS="$flags"
1921 LIBS_GNUSTEP=$(gnustep-config --gui-libs) || exit 1920 LIBS_GNUSTEP=$(gnustep-config --gui-libs) || exit
1922 elif test -f $GNUSTEP_CONFIG_FILE; then 1921 elif test -f $GNUSTEP_CONFIG_FILE; then
1923 NS_IMPL_GNUSTEP=yes 1922 NS_IMPL_GNUSTEP=yes
@@ -2067,6 +2066,20 @@ if test "${HAVE_NS}" = yes; then
2067 AC_DEFINE(NATIVE_OBJC_INSTANCETYPE, 1, 2066 AC_DEFINE(NATIVE_OBJC_INSTANCETYPE, 1,
2068 [Define if ObjC compiler supports instancetype natively.]) 2067 [Define if ObjC compiler supports instancetype natively.])
2069 fi 2068 fi
2069
2070 AC_CACHE_CHECK(
2071 [if the Objective C compiler defaults to C99],
2072 [emacs_cv_objc_c99],
2073 [AC_LANG_PUSH([Objective C])
2074 AC_COMPILE_IFELSE(
2075 [AC_LANG_PROGRAM([], [[for (int i = 0;;);]])],
2076 emacs_cv_objc_c99=yes,
2077 emacs_cv_objc_c99=no)
2078 AC_LANG_POP([Objective C])])
2079
2080 if test x$emacs_cv_objc_c99 = xno ; then
2081 GNU_OBJC_CFLAGS="$GNU_OBJC_CFLAGS -std=c99"
2082 fi
2070fi 2083fi
2071 2084
2072HAVE_W32=no 2085HAVE_W32=no