]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Find the Objective-C compiler out-of-the-box on AlmaLinux 9 systems.
authorBruno Haible <bruno@clisp.org>
Tue, 16 Jul 2024 03:24:27 +0000 (05:24 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 16 Jul 2024 03:24:27 +0000 (05:24 +0200)
* gettext-tools/configure.ac: Invoke AC_PROG_OBJC with a customized search list.
* gettext-tools/tests/init-env.in (OBJC, OBJCFLAGS): Set to the configure-
determined values.
* gettext-tools/tests/lang-objc: Use OBJC instead of CC, and OBJCFLAGS instead
of CFLAGS.
* gettext-tools/examples/hello-objc/configure.ac: Invoke AC_PROG_OBJC with a
customized search list. Don't invoke AC_PROC_CC.

gettext-tools/configure.ac
gettext-tools/examples/hello-objc/configure.ac
gettext-tools/tests/init-env.in
gettext-tools/tests/lang-objc

index 8f3c0f37f12b0e329ec251e9532cc4a6857c6f42..3e79d47768a86d6517805d04070c1d2114214b25 100644 (file)
@@ -550,6 +550,9 @@ gt_LOCALE_FR
 gt_LOCALE_FR_UTF8
 gt_LOCALE_JA
 gt_LOCALE_DE_UTF8
+dnl Test for gobjc before gcc, since that's what the EPEL 9 package 'gcc-objc'
+dnl installs (on systems where gcc does not support Objective C).
+AC_PROG_OBJC([gobjc gcc objcc objc cc CC clang])
 
 dnl Checks for functions for the tests/*.c tests.
 AC_CHECK_FUNCS_ONCE([getrlimit setrlimit uselocale])
index 5d76cd916f0f105ccea33fc09c92b8d8f758d741..7702df168560e6d799f204255ee344de87068d73 100644 (file)
@@ -7,8 +7,9 @@ AC_INIT([hello-objc], [0])
 AC_CONFIG_SRCDIR([hello.m])
 AM_INIT_AUTOMAKE([1.11])
 
-AC_PROG_CC
-AC_SUBST([OBJC], ["$CC"])
+dnl Test for gobjc before gcc, since that's what the EPEL 9 package 'gcc-objc'
+dnl installs (on systems where gcc does not support Objective C).
+AC_PROG_OBJC([gobjc gcc objcc objc cc CC clang])
 AM_GNU_GETTEXT([external])
 AM_GNU_GETTEXT_VERSION([0.22])
 
index cc84ffd39be8de32564a3b7581c0d872a1570f84..096838848dc2f02928f19eb617bd095853068df8 100644 (file)
@@ -7,6 +7,8 @@ CC="@CC@"
 CFLAGS="@CFLAGS@"
 CXX="@CXX@"
 CXXFLAGS="@CXXFLAGS@"
+OBJC="@OBJC@"
+OBJCFLAGS="@OBJCFLAGS@"
 CPPFLAGS="@CPPFLAGS@"
 LDFLAGS="@LDFLAGS@"
 LTLIBINTL="@LTLIBINTL@"
index 925a04c9da3c3f2249c46d2903e3e6dd290a681b..938a0a6c98d0e0d1e44faf0294c5782a7bc7b525 100755 (executable)
@@ -19,7 +19,7 @@ int main ()
   exit (0);
 }
 EOF
-${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o hello hello.m 2>/dev/null \
+${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS} -o hello hello.m 2>/dev/null \
   || { echo "Skipping test: Objective C compiler not found"
        Exit 77
      }
@@ -58,15 +58,15 @@ int main (int argc, char *argv[])
 }
 EOF
 
-# Put the -I flags before ${CFLAGS} ${CPPFLAGS}, to make sure that libintl.h
+# Put the -I flags before ${OBJCFLAGS} ${CPPFLAGS}, to make sure that libintl.h
 # is found in the build directory, regardless of -I options present in
-# ${CFLAGS} or ${CPPFLAGS}.
-${CC} -I../.. -I"$abs_top_srcdir"/gnulib-lib -I../../../gettext-runtime/intl ${CFLAGS} ${CPPFLAGS} -c prog.m \
+# ${OBJCFLAGS} or ${CPPFLAGS}.
+${OBJC} -I../.. -I"$abs_top_srcdir"/gnulib-lib -I../../../gettext-runtime/intl ${OBJCFLAGS} ${CPPFLAGS} -c prog.m \
   || Exit 1
 
 : ${CONFIG_SHELL=${SHELL-/bin/sh}}
 ${CONFIG_SHELL} "$top_builddir"/libtool --quiet --tag=CC --mode=link \
-  ${CC} ${CFLAGS} -o prog prog.${OBJEXT} ../../gnulib-lib/libgettextlib.la ${LDFLAGS} ${LTLIBINTL} \
+  ${OBJC} ${OBJCFLAGS} -o prog prog.${OBJEXT} ../../gnulib-lib/libgettextlib.la ${LDFLAGS} ${LTLIBINTL} \
   || Exit 1
 
 : ${XGETTEXT=xgettext}