Skip to content

Commit

Permalink
ICU-21107 Update configure files from configure.ac using autoreconf.
Browse files Browse the repository at this point in the history
  • Loading branch information
roubert committed Dec 21, 2023
1 parent 45d351c commit ef78f2a
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions icu4c/source/configure
Original file line number Diff line number Diff line change
Expand Up @@ -3987,6 +3987,41 @@ if test "$GCC" = yes; then
CXXFLAGS="$CXXFLAGS -O2"
fi
fi
# if CFLAGS does not have a "-std=" setting, set it now to -std=c11,
# and check that the compiler still works.
if ! echo "$CFLAGS" | grep '\-std=' >/dev/null 2>&1; then
OLD_CFLAGS="${CFLAGS}"
CFLAGS="$CFLAGS -std=c11"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have a C11 compiler" >&5
$as_echo_n "checking if we have a C11 compiler... " >&6; }

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
c11_okay=yes
else
c11_okay=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $c11_okay" >&5
$as_echo "$c11_okay" >&6; }
if [ $c11_okay = yes ]; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Adding CFLAGS option -std=c11" >&5
$as_echo "$as_me: Adding CFLAGS option -std=c11" >&6;}
UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -std=c11"
else
CFLAGS="$OLD_CFLAGS"
fi
fi
fi

ac_ext=c
Expand Down Expand Up @@ -4479,17 +4514,6 @@ $as_echo "$ac_use_strict_options" >&6; }
then
if test "$GCC" = yes
then
case "${host}" in
*-*-solaris*)
# Don't use -std=c11 on Solaris because of timezone check fails
;;
*)
# Do not use -ansi. It limits us to C90, and it breaks some platforms.
# We use -std=c11 to disable the gnu99 defaults and its associated warnings
CFLAGS="$CFLAGS -std=c11"
;;
esac

CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
else
case "${host}" in
Expand Down Expand Up @@ -4521,7 +4545,6 @@ $as_echo "$ac_use_strict_options" >&6; }

# Check if we can build and use 64-bit libraries


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
Expand Down

0 comments on commit ef78f2a

Please sign in to comment.