ruby-changes:37712
From: nobu <ko1@a...>
Date: Sun, 1 Mar 2015 18:10:48 +0900 (JST)
Subject: [ruby-changes:37712] nobu:r49793 (trunk): configure.in: check broken memmem before earlier
nobu 2015-03-01 18:10:36 +0900 (Sun, 01 Mar 2015) New Revision: 49793 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49793 Log: configure.in: check broken memmem before earlier * configure.in (rb_cv_broken_memmem): check before adding the result HAVE_MEMMEM macro to confdefs.h, so that configured results will be stable. Modified files: trunk/ChangeLog trunk/configure.in Index: configure.in =================================================================== --- configure.in (revision 49792) +++ configure.in (revision 49793) @@ -2027,6 +2027,33 @@ else https://github.com/ruby/ruby/blob/trunk/configure.in#L2027 AC_LIBOBJ([signbit]) fi +AC_CACHE_CHECK(for broken memmem, rb_cv_broken_memmem, [ + AC_TRY_RUN([ +@%:@include <string.h> + +int +main(int argc, char **argv) +{ + const char *str = "hogefugafoobar"; + const char *rs = "foo"; + const char *empty = ""; + char *p; + + p = memmem(str, strlen(str), rs, strlen(rs)); + if (p == str+8) { + p = memmem(str, strlen(str), empty, strlen(empty)); + if (p == str) + return 0; + } + return 1; +} + ], + rb_cv_broken_memmem=no, + rb_cv_broken_memmem=yes, + rb_cv_broken_memmem=yes) +]) +test x"$rb_cv_broken_memmem" = xyes && ac_cv_func_memmem=no + AC_FUNC_FORK AC_CHECK_FUNCS(__syscall) @@ -3882,40 +3909,6 @@ if test "${universal_binary-no}" = yes ; https://github.com/ruby/ruby/blob/trunk/configure.in#L3909 [rb_cv_architecture_available=yes], [rb_cv_architecture_available=no])) fi -if test "$ac_cv_func_memmem" = yes; then - AC_CACHE_CHECK(for broken memmem, rb_cv_broken_memmem, [ - AC_TRY_RUN([ -#include <string.h> - -int -main() -{ - char *str = "hogefugafoobar"; - char *rs = "foo"; - char *empty = ""; - char *p; - - p = memmem(str, strlen(str), rs, strlen(rs)); - if (p == str+8) { - p = memmem(str, strlen(str), empty, strlen(empty)); - if (p == str) - return 0; - else - return 1; - } - else { - return 1; - } -} - ], - rb_cv_broken_memmem=no, - rb_cv_broken_memmem=yes, - rb_cv_broken_memmem=yes) - ]) - test x"$rb_cv_broken_memmem" = xyes && ac_cv_func_memmem=no -fi - - CPPFLAGS="$CPPFLAGS "'$(DEFS)' test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}' if test -n "${cflags+set}"; then Index: ChangeLog =================================================================== --- ChangeLog (revision 49792) +++ ChangeLog (revision 49793) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Mar 1 18:10:34 2015 Nobuyoshi Nakada <nobu@r...> + + * configure.in (rb_cv_broken_memmem): check before adding the + result HAVE_MEMMEM macro to confdefs.h, so that configured + results will be stable. + Sun Mar 1 11:17:56 2015 Nobuyoshi Nakada <nobu@r...> * gc.c (id2ref): prohibit from accessing internal objects. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/