autotools: stop using AC_FUNC_MEMCMP and AC_FUNC_STRTOD Closes: https://github.com/libsdl-org/SDL/issues/6266 .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
diff --git a/configure b/configure
index d4fc7bf..62c39ee 100755
--- a/configure
+++ b/configure
@@ -657,6 +657,7 @@ ac_includes_default="\
ac_header_c_list=
ac_subst_vars='LTLIBOBJS
+LIBOBJS
WAYLAND_SCANNER_CODE_MODE
WAYLAND_SCANNER
EXTRA_LDFLAGS
@@ -718,8 +719,6 @@ JACK_LIBS
JACK_CFLAGS
ALSA_LIBS
ALSA_CFLAGS
-POW_LIB
-LIBOBJS
ALLOCA
CPP
LIBTOOLLINKERTAG
@@ -19118,198 +19117,6 @@ printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
-printf %s "checking for working memcmp... " >&6; }
-if test ${ac_cv_func_memcmp_working+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- if test "$cross_compiling" = yes
-then :
- ac_cv_func_memcmp_working=no
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main (void)
-{
-
- /* Some versions of memcmp are not 8-bit clean. */
- char c0 = '\100', c1 = '\200', c2 = '\201';
- if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
- return 1;
-
- /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
- or more and with at least one buffer not starting on a 4-byte boundary.
- William Lewis provided this test program. */
- {
- char foo[21];
- char bar[21];
- int i;
- for (i = 0; i < 4; i++)
- {
- char *a = foo + i;
- char *b = bar + i;
- strcpy (a, "--------01111111");
- strcpy (b, "--------10000000");
- if (memcmp (a, b, 16) >= 0)
- return 1;
- }
- return 0;
- }
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"
-then :
- ac_cv_func_memcmp_working=yes
-else $as_nop
- ac_cv_func_memcmp_working=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5
-printf "%s\n" "$ac_cv_func_memcmp_working" >&6; }
-test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
- *" memcmp.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
- ;;
-esac
-
-
- if test x$ac_cv_func_memcmp_working = xyes; then
-
-printf "%s\n" "#define HAVE_MEMCMP 1" >>confdefs.h
-
- fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5
-printf %s "checking for working strtod... " >&6; }
-if test ${ac_cv_func_strtod+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- if test "$cross_compiling" = yes
-then :
- ac_cv_func_strtod=no
-else $as_nop
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-$ac_includes_default
-#ifndef strtod
-double strtod ();
-#endif
-int
-main (void)
-{
- {
- /* Some versions of Linux strtod mis-parse strings with leading '+'. */
- char *string = " +69";
- char *term;
- double value;
- value = strtod (string, &term);
- if (value != 69 || term != (string + 4))
- return 1;
- }
-
- {
- /* Under Solaris 2.4, strtod returns the wrong value for the
- terminating character under some conditions. */
- char *string = "NaN";
- char *term;
- strtod (string, &term);
- if (term != string && *(term - 1) == 0)
- return 1;
- }
- return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"
-then :
- ac_cv_func_strtod=yes
-else $as_nop
- ac_cv_func_strtod=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5
-printf "%s\n" "$ac_cv_func_strtod" >&6; }
-if test $ac_cv_func_strtod = no; then
- case " $LIBOBJS " in
- *" strtod.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strtod.$ac_objext"
- ;;
-esac
-
-ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
-if test "x$ac_cv_func_pow" = xyes
-then :
-
-fi
-
-if test $ac_cv_func_pow = no; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
-printf %s "checking for pow in -lm... " >&6; }
-if test ${ac_cv_lib_m_pow+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-char pow ();
-int
-main (void)
-{
-return pow ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_lib_m_pow=yes
-else $as_nop
- ac_cv_lib_m_pow=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
-printf "%s\n" "$ac_cv_lib_m_pow" >&6; }
-if test "x$ac_cv_lib_m_pow" = xyes
-then :
- POW_LIB=-lm
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5
-printf "%s\n" "$as_me: WARNING: cannot find library containing definition of pow" >&2;}
-fi
-
-fi
-
-fi
-
- if test x$ac_cv_func_strtod = xyes; then
-
-printf "%s\n" "#define HAVE_STRTOD 1" >>confdefs.h
-
- fi
ac_fn_c_check_func "$LINENO" "mprotect" "ac_cv_func_mprotect"
if test "x$ac_cv_func_mprotect" = xyes
then :
@@ -19416,6 +19223,12 @@ then :
printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h
fi
+ac_fn_c_check_func "$LINENO" "memcmp" "ac_cv_func_memcmp"
+if test "x$ac_cv_func_memcmp" = xyes
+then :
+ printf "%s\n" "#define HAVE_MEMCMP 1" >>confdefs.h
+
+fi
ac_fn_c_check_func "$LINENO" "memcpy" "ac_cv_func_memcpy"
if test "x$ac_cv_func_memcpy" = xyes
then :
@@ -19596,6 +19409,12 @@ then :
printf "%s\n" "#define HAVE__ULTOA 1" >>confdefs.h
fi
+ac_fn_c_check_func "$LINENO" "strtod" "ac_cv_func_strtod"
+if test "x$ac_cv_func_strtod" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRTOD 1" >>confdefs.h
+
+fi
ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol"
if test "x$ac_cv_func_strtol" = xyes
then :
diff --git a/configure.ac b/configure.ac
index d0873d7..5365189 100644
--- a/configure.ac
+++ b/configure.ac
@@ -334,14 +334,6 @@ dnl Check for defines
AC_FUNC_ALLOCA
dnl Checks for library functions.
- AC_FUNC_MEMCMP
- if test x$ac_cv_func_memcmp_working = xyes; then
- AC_DEFINE(HAVE_MEMCMP, 1, [ ])
- fi
- AC_FUNC_STRTOD
- if test x$ac_cv_func_strtod = xyes; then
- AC_DEFINE(HAVE_STRTOD, 1, [ ])
- fi
AC_CHECK_FUNC(mprotect,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
@@ -350,7 +342,7 @@ dnl Checks for library functions.
AC_DEFINE(HAVE_MPROTECT, 1, [ ])
],[]),
)
- AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll _Exit)
+ AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll _Exit)
AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf trunc truncf fmod fmodf log logf log10 log10f lround lroundf pow powf round roundf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)