* include/ruby/encoding.h (rb_econv_t): add fields: in_buf_start,
[ruby-svn.git] / configure.in
bloba6b11f71df762cfc5ef7fe734fe1d4bedf7919b5
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT()
4 AC_PREREQ(2.60)
6 AC_ARG_WITH(baseruby,
7         [  --with-baseruby=RUBY use RUBY as baseruby; RUBY is the pathname of ruby],
8         [
9                 case "$withval" in
10                 *ruby*)
11                         BASERUBY=$withval
12                         ;;
13                 *)
14                         AC_MSG_ERROR(need ruby)
15                         ;;
16                 esac
17         ],
18         [
19                 BASERUBY="ruby"
20         ])
21 test "`$BASERUBY -e 'p 42' 2>/dev/null`" = 42 ||
22     BASERUBY="echo executable host ruby is required.  use --with-baseruby option.; false"
23 AC_SUBST(BASERUBY)
25 AC_DEFUN([RUBY_MINGW32],
26 [case "$host_os" in
27 cygwin*)
28 AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
29 [AC_TRY_CPP([
30 #ifndef __MINGW32__
31 # error
32 #endif
33 ], rb_cv_mingw32=yes,rb_cv_mingw32=no)
34 rm -f conftest*])
35 test "$rb_cv_mingw32" = yes && target_os="mingw32"
36   ;;
37 esac])
39 AC_DEFUN([RUBY_CPPOUTFILE],
40 [AC_CACHE_CHECK(whether ${CPP} accepts -o, rb_cv_cppoutfile,
41 [cppflags=$CPPFLAGS
42 CPPFLAGS='-o conftest.i'
43 AC_TRY_CPP([], rb_cv_cppoutfile=yes, rb_cv_cppoutfile=no)
44 CPPFLAGS=$cppflags
45 rm -f conftest*])
46 if test "$rb_cv_cppoutfile" = yes; then
47   CPPOUTFILE='-o conftest.i'
48 elif test "$rb_cv_cppoutfile" = no; then
49   CPPOUTFILE='> conftest.i'
50 elif test -n "$rb_cv_cppoutfile"; then
51   CPPOUTFILE="$rb_cv_cppoutfile"
53 AC_SUBST(CPPOUTFILE)])
55 AC_DEFUN([RUBY_PROG_GNU_LD],
56 [AC_CACHE_CHECK(whether the linker is GNU ld, rb_cv_prog_gnu_ld,
57 [if `$CC $CFLAGS $CPPFLAGS $LDFLAGS --print-prog-name=ld 2>&1` -v 2>&1 | grep "GNU ld" > /dev/null; then
58   rb_cv_prog_gnu_ld=yes
59 else
60   rb_cv_prog_gnu_ld=no
63 GNU_LD=$rb_cv_prog_gnu_ld
64 AC_SUBST(GNU_LD)])
66 unset GREP_OPTIONS
67 rb_version=`grep RUBY_VERSION $srcdir/version.h`
68 MAJOR=`expr "$rb_version" : '#define RUBY_VERSION "\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*"'`
69 MINOR=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*"'`
70 TEENY=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)"'`
71 if test "$MAJOR" = ""; then
72   AC_MSG_ERROR(could not determine MAJOR number from version.h)
74 if test "$MINOR" = ""; then
75   AC_MSG_ERROR(could not determine MINOR number from version.h)
77 if test "$TEENY" = ""; then
78   AC_MSG_ERROR(could not determine TEENY number from version.h)
80 AC_SUBST(MAJOR)
81 AC_SUBST(MINOR)
82 AC_SUBST(TEENY)
83 dnl checks for alternative programs
84 AC_ARG_WITH(gcc, [  --without-gcc           never use gcc], [
85         case $withval in
86         no)     : ${CC=cc}
87                 ;;
88         yes)    : ${CC=gcc}
89                 ;;
90         *)      CC=$withval
91                 ;;
92         esac])
93 dnl If the user switches compilers, we can't believe the cache
94 if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
95 then
96   AC_MSG_ERROR(cached CC is different -- throw away $cache_file
97 (it is also a good idea to do 'make clean' before compiling))
100 if test "$program_prefix" = NONE; then
101   program_prefix=
104 AC_CANONICAL_TARGET
105 target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
106 ac_install_sh='' # unusable for extension libraries.
108 ifelse(currently,disabled, [
109 dnl checks for fat-binary
110 AC_ARG_ENABLE(fat-binary,
111        [  --enable-fat-binary=ARCHS
112                           build an Apple/NeXT Multi Architecture Binary (MAB);
113                           ARCHS is a comma-delimited list of architectures for
114                           which to build; if ARCHS is omitted, then the package
115                           will be built for all architectures supported by the
116                           platform ("ppc" for MacOS/X and Darwin; "ppc,i386"
117                           for Rhapsody; "m68k,i386,sparc" for OpenStep;
118                           "m68k,i386,sparc,hppa" for NextStep); if this option
119                           is disabled or omitted entirely, then the package
120                           will be built only for the target platform],
121        [fat_binary=$enableval], [fat_binary=no])
122 if test "$fat_binary" != no; then
124     AC_MSG_CHECKING([target architectures])
126     # Respect TARGET_ARCHS setting from environment if available.
127     if test -z "$TARGET_ARCHS"; then
128         # Respect ARCH given to --enable-fat-binary if present.
129         if test "$fat_binary" != yes; then
130             TARGET_ARCHS=`echo "$fat_binary" | tr ',' ' '`
131         else
132             # Choose a default set of architectures based upon platform.
133             case "$target_os" in
134             darwin*)
135                 TARGET_ARCHS="ppc"
136                 ;;
137             rhapsody*)
138                 TARGET_ARCHS="ppc i386"
139                 ;;
140             openstep*)
141                 TARGET_ARCHS="m68k i386 sparc"
142                 ;;
143             nextstep*)
144                 TARGET_ARCHS="m68k i386 sparc hppa"
145                 ;;
146             *)
147                 TARGET_ARCHS=`arch`
148             esac
149         fi
150     fi
152     AC_MSG_RESULT([$TARGET_ARCHS])
154     # /usr/lib/arch_tool -archify_list $TARGET_ARCHS
155     ARCH_FLAG=
156     for archs in $TARGET_ARCHS 
157     do
158         ARCH_FLAG="$ARCH_FLAG -arch $archs"
159     done
160     AC_DEFINE(NEXT_FAT_BINARY)
162 ], [fat_binary=no])
164 case $target_cpu in
165   i?86) frame_address=yes;;
166   *)    frame_address=no;;
167 esac
168 AC_ARG_ENABLE(frame-address,
169        [  --enable-frame-address  use GCC __builtin_frame_address(). ],
170        [frame_address=$enableval])
171 if test $frame_address = yes; then
172     AC_DEFINE(USE_BUILTIN_FRAME_ADDRESS)
175 AC_ARG_PROGRAM
177 dnl Checks for programs.
179 : ${CFLAGS=} ${cflags='${optflags} ${debugflags} ${warnflags}'}
180 : ${CXXFLAGS=} ${cxxflags='${optflags} ${debugflags} ${warnflags}'}
181 if test x"${build}" != x"${host}"; then
182   AC_CHECK_TOOL(CC, gcc)
184 AC_PROG_CC
185 AC_PROG_CXX
186 AC_PROG_GCC_TRADITIONAL
187 test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
188 if test "$GCC" = yes; then
189     linker_flag=-Wl,
190     : ${optflags=-O2} ${warnflags="-Wall -Wno-parentheses"}
191 else
192     linker_flag=
194 CFLAGS="${CFLAGS} `eval echo $cflags`"
195 CXXFLAGS="${CXXFLAGS} `eval echo $cxxflags`"
197 RUBY_PROG_GNU_LD
198 RUBY_CPPOUTFILE
200 : ${OUTFLAG='-o '}
201 : ${COUTFLAG=${OUTFLAG}}
202 AC_SUBST(OUTFLAG)
203 AC_SUBST(COUTFLAG)
205 RUBY_MINGW32
207 AC_CHECK_TOOL(RANLIB, ranlib, :)
208 AC_CHECK_TOOL(AR, ar)
209 if test -z "$AR"; then
210   AC_CHECK_PROGS(AR, aal, ar)
213 AC_CHECK_TOOL(AS, as)
214 ASFLAGS=$ASFLAGS
215 AC_SUBST(ASFLAGS)
217 case "$target_os" in
218 cygwin*|mingw*)
219     AC_CHECK_TOOL(NM, nm)
220     AC_CHECK_TOOL(WINDRES, windres)
221     AC_CHECK_TOOL(DLLWRAP, dllwrap)
222     target_cpu=`echo $target_cpu | sed s/i.86/i386/`
223     case "$target_os" in
224     mingw*)
225         test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
226         AC_CHECK_TOOL(OBJDUMP, objdump)
227         AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
228         AC_TRY_LINK([#include <stdio.h>],
229                     [FILE* volatile f = stdin; return 0;],
230                     [rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
231                                    tr A-Z a-z |
232                                    sed -n '/^[[         ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
233                     [rb_cv_msvcrt=msvcrt])
234         test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
235     esac
236     : ${enable_shared=yes}
237     ;;
238 aix*)
239     AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)
240     ;;
241 hiuxmpp*)
242     # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
243     AC_DEFINE(__HIUX_MPP__)
244     ;;
245 esac
247 AC_PROG_LN_S
248 AC_PROG_MAKE_SET
249 AC_PROG_INSTALL
251 # checks for UNIX variants that set C preprocessor variables
252 AC_USE_SYSTEM_EXTENSIONS
254 AC_SUBST(RM, ['rm -f'])
255 AC_SUBST(CP, ['cp'])
256 if $as_mkdir_p; then
257   MAKEDIRS='mkdir -p'
258 else
259   MAKEDIRS='install -d'
261 AC_SUBST(MAKEDIRS)
263 dnl check for large file stuff
264 mv confdefs.h confdefs1.h
265 : > confdefs.h
266 AC_SYS_LARGEFILE
267 mv confdefs.h largefile.h
268 mv confdefs1.h confdefs.h
269 cat largefile.h >> confdefs.h
271 case "$target_os" in
272 mingw*)
273         ac_cv_type_off_t=yes
274         ac_cv_sizeof_off_t=8
275         ;;
276 esac
278 AC_CHECK_TYPES([long long, off_t])
280 AC_CHECK_SIZEOF(int, 4)
281 AC_CHECK_SIZEOF(short, 2)
282 AC_CHECK_SIZEOF(long, 4)
283 AC_CHECK_SIZEOF(long long, 0)
284 AC_CHECK_SIZEOF(__int64, 0)
285 AC_CHECK_SIZEOF(off_t, 0)
286 AC_CHECK_SIZEOF(void*, 4)
287 AC_CHECK_SIZEOF(float, 4)
288 AC_CHECK_SIZEOF(double, 8)
289 AC_CHECK_SIZEOF(time_t, 0)
291 dnl RUBY_REPLACE_TYPE [typename] [default type] [macro type] [included]
292 AC_DEFUN([RUBY_REPLACE_TYPE], [dnl
293     AC_CHECK_TYPE([$1],
294         [AC_DEFINE_UNQUOTED(rb_[$1], [$1])],
295         [AC_DEFINE_UNQUOTED(rb_[$1], [$2])],
296         [$4])
297     AC_CACHE_CHECK([for convertible type of [$1]], rb_cv_[$1]_convertible, [
298         u= t=
299         AC_COMPILE_IFELSE(
300             [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT]
301                                       [$4], [(rb_[$1])-1 > 0])],
302             [u=U])
303         if test x"$t" = x; then
304             AC_COMPILE_IFELSE(
305                 [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT]
306                                           [$4], [sizeof(rb_[$1]) > sizeof(long)])],
307                 [t=LL])
308         fi
309         if test x"$t" = x; then
310             AC_COMPILE_IFELSE(
311                 [AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT]
312                                           [$4], [sizeof(rb_[$1]) == sizeof(long)])],
313                 [t=LONG])
314         fi
315         if test x"$t" = x; then
316             t=INT
317         fi
318         rb_cv_[$1]_convertible=${u}${t}])
319     AC_DEFINE_UNQUOTED([$3]2NUM[(v)], [${rb_cv_[$1]_convertible}2NUM(v)])
320     AC_DEFINE_UNQUOTED(NUM2[$3][(v)], [NUM2${rb_cv_[$1]_convertible}(v)])
322 RUBY_REPLACE_TYPE(pid_t, int, PIDT)
323 RUBY_REPLACE_TYPE(uid_t, int, UIDT)
324 RUBY_REPLACE_TYPE(gid_t, int, GIDT)
326 AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
327   [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
328         rb_cv_have_prototypes=yes,
329         rb_cv_have_prototypes=no)])
330 if test "$rb_cv_have_prototypes" = yes; then
331   AC_DEFINE(HAVE_PROTOTYPES)
334 AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste,
335   [AC_TRY_COMPILE([#define paste(a,b) a##b],
336                   [int xy = 1; return paste(x,y);],
337                   rb_cv_tokenpaste=ansi,
338                   rb_cv_tokenpaste=knr)])
339 if test "$rb_cv_tokenpaste" = ansi; then
340   AC_DEFINE(TOKEN_PASTE(x,y),[x##y])
341 else
342   AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y])
345 AC_CACHE_CHECK(stringization, rb_cv_stringization, [
346   rb_cv_stringization=no
347   for string in "#expr" '"expr"'; do
348     AC_COMPILE_IFELSE([
349       AC_LANG_BOOL_COMPILE_TRY([
350 #define STRINGIZE0(expr) $string
351 #define STRINGIZE(expr) STRINGIZE0(expr)
352 #undef real_test_for_stringization
353 #define test_for_stringization -.real_test_for_stringization.-
354 const char stringized[[]] = STRINGIZE(test_for_stringization);
355 ], [sizeof(stringized) == 32])],
356       [rb_cv_stringization="$string"; break],
357       [rb_cv_stringization=no])
358   done]
360 AC_DEFINE(STRINGIZE(expr),STRINGIZE0(expr))
361 if test x"$rb_cv_stringization" != xno -a "$rb_cv_stringization" != "#expr"; then
362   AC_DEFINE_UNQUOTED(STRINGIZE0(expr),$rb_cv_stringization)
363   AC_DEFINE(OLD_FASHIONED_STRINGIZATION,1)
366 AC_CACHE_CHECK([string literal concatenation],
367   rb_cv_string_literal_concatenation, [
368   AC_COMPILE_IFELSE([
369     AC_LANG_BOOL_COMPILE_TRY([
370 const char concatenated_literal[[]] = "literals" "to"
371   "be" "concatenated.";
372 ], [sizeof(concatenated_literal) == 26])],
373     [rb_cv_string_literal_concatenation=yes],
374     [rb_cv_string_literal_concatenation=no])]
376 if test "$rb_cv_string_literal_concatenation" = no; then
377   AC_DEFINE(NO_STRING_LITERAL_CONCATENATION,1)
380 AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg,
381   [AC_TRY_COMPILE([
382 #include <stdarg.h>
383 int foo(int x, ...) {
384         va_list va;
385         va_start(va, x);
386         va_arg(va, int);
387         va_arg(va, char *);
388         va_arg(va, double);
389         return 0;
391 ], [return foo(10, "", 3.14);],
392         rb_cv_stdarg=yes,
393         rb_cv_stdarg=no)])
394 if test "$rb_cv_stdarg" = yes; then
395   AC_DEFINE(HAVE_STDARG_PROTOTYPES)
398 AC_CACHE_CHECK(for variable length macro, rb_cv_va_args_macro,
399   [AC_TRY_COMPILE([@%:@define FOO(a, ...) foo(a, @%:@@%:@__VA_ARGS__)],
400   [FOO(1);FOO(1,2);FOO(1,2,3);],
401   rb_cv_va_args_macro=yes,
402   rb_cv_va_args_macro=no)])
403 if test "$rb_cv_va_args_macro" = yes; then
404   AC_DEFINE(HAVE_VA_ARGS_MACRO)
407 AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
408 m4_ifval([$2], dnl
409   [AS_VAR_PUSHDEF([attrib],[$2])], dnl
410   [AS_VAR_PUSHDEF([attrib],[FUNC_]AS_TR_CPP($1))] dnl
411 )dnl
412 m4_ifval([$3], dnl
413   [AS_VAR_PUSHDEF([rbcv],[$3])], dnl
414   [AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl
415 )dnl
416 AC_CACHE_CHECK(for [$1] function attribute, rbcv,
417 [rbcv=x
418 if test "${ac_c_werror_flag+set}"; then
419   rb_c_werror_flag="$ac_c_werror_flag"
420 else
421   unset rb_c_werror_flag
423 ac_c_werror_flag=yes
424 for mac in "__attribute__ (($1)) x" "x __attribute__ (($1))" "__declspec($1) x" x; do
425   AC_TRY_COMPILE(
426     [#define ]attrib[(x) $mac
427     ]attrib[(void conftest_attribute_check(void));], [],
428     [rbcv="$mac"; break])
429 done
430 if test "${rb_c_werror_flag+set}"; then
431   ac_c_werror_flag="$rb_c_werror_flag"
432 else
433   unset ac_c_werror_flag
436 AC_DEFINE_UNQUOTED(attrib[(x)], $rbcv)
437 AS_VAR_POPDEF([attrib])
438 AS_VAR_POPDEF([rbcv])
441 RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
442 RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
443 RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)
444 RUBY_FUNC_ATTRIBUTE(stdcall)
445 RUBY_FUNC_ATTRIBUTE(cdecl)
446 RUBY_FUNC_ATTRIBUTE(fastcall)
448 if test "$GCC" = yes; then
449     AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias],
450         [rb_cv_gcc_function_alias=no
451         for a in alias weak,alias; do
452             AC_TRY_LINK([void foo(void) {}
453                 void bar(void) __attribute__(($a("foo")));], [bar()],
454                 [rb_cv_gcc_function_alias=$a; break])
455         done])
456     if test "$rb_cv_gcc_function_alias" = no; then
457         AC_DEFINE([RUBY_ALIAS_FUNCTION(old_prot, new_name, args)],
458                   [VALUE old_prot {return new_name args;}])
459     else
460         AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION(old_prot, new_name, args)],
461                            [VALUE old_prot __attribute__(($rb_cv_gcc_function_alias(@%:@new_name)));])
462     fi
465 AC_CACHE_CHECK([for RUBY_EXTERN], rb_cv_ruby_extern,
466 [rb_cv_ruby_extern=no
467 for mac in "__attribute__((dllimport))" "__declspec(dllimport)"; do
468   AC_TRY_COMPILE(
469     [extern $mac void conftest(void);],
470     [rb_cv_ruby_extern="extern $mac"; break])
471 done])
472 test "x$rb_cv_ruby_extern" = xno || AC_DEFINE_UNQUOTED(RUBY_EXTERN, $rb_cv_ruby_extern)
474 XCFLAGS="$XCFLAGS -DRUBY_EXPORT"
476 dnl Check whether we need to define sys_nerr locally
477 AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
478 #include <errno.h>])
480 case "$target_os" in
481 freebsd*)
482   AC_CACHE_CHECK([whether pthread should be enabled by default],
483     rb_cv_enable_pthread_default,
484     [AC_TRY_CPP([
485 #include <osreldate.h>
486 #if __FreeBSD_version < 502102
487 #error pthread should be disabled on this platform
488 #endif
489       ],
490       rb_cv_enable_pthread_default=yes,
491       rb_cv_enable_pthread_default=no)])
492   enable_pthread_default=$rb_cv_enable_pthread_default
493   ;;
494 mingw*)
495   enable_pthread_default=no
496   ;;
498   enable_pthread_default=yes
499   ;;
500 esac
502 AC_ARG_ENABLE(pthread,
503        [  --enable-pthread        use pthread library.],
504        [enable_pthread=$enableval], [enable_pthread=$enable_pthread_default])
506 dnl Checks for libraries.
507 case "$target_os" in
508 nextstep*)      ;;
509 openstep*)      ;;
510 rhapsody*)      ;;
511 darwin*)        LIBS="-lobjc $LIBS"
512                 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE"
513                 AC_TRY_CPP([#include <AvailabilityMacros.h>
514                     #if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
515                     #error pre OS X 10.4
516                     [!<===== pre OS X 10.4 =====>]
517                     #endif
518                     ],
519                     [
520                     test "x$target_cpu" = xppc && ac_cv_header_ucontext_h=no
521                     ],
522                     [
523                     AC_DEFINE(BROKEN_SETREUID, 1)
524                     AC_DEFINE(BROKEN_SETREGID, 1)
525                     ])
526                 ;;
527 hpux*)          LIBS="-lm $LIBS"
528                 ac_cv_c_inline=no;;
529 human*)         ac_cv_func_getpgrp_void=yes
530                 ac_cv_func_setitimer=no
531                 ;;
532 beos*|haiku*)   ac_cv_func_link=no
533                 ac_cv_func_sched_yield=no
534                 ac_cv_func_pthread_attr_setinheritsched=no
535                 case "$target_os" in
536                 beos*) ac_cv_header_net_socket_h=yes;;
537                 haiku*) ac_cv_func_shutdown=no;;
538                 esac
539                 LIBS="$LIBS" # m lib is include in root under BeOS/Haiku
540                 ;;
541 cygwin*)        ;;
542 mingw*)         LIBS="-lshell32 -lws2_32 $LIBS"
543                 ac_cv_header_a_out_h=no
544                 ac_cv_header_pwd_h=no
545                 ac_cv_header_utime_h=no
546                 ac_cv_header_sys_ioctl_h=no
547                 ac_cv_header_sys_param_h=no
548                 ac_cv_header_sys_resource_h=no
549                 ac_cv_header_sys_select_h=no
550                 ac_cv_header_sys_time_h=no
551                 ac_cv_header_sys_times_h=no
552                 ac_cv_header_sys_socket_h=no
553                 ac_cv_func_times=yes
554                 ac_cv_func_waitpid=yes
555                 ac_cv_func_fsync=yes
556                 ac_cv_func_snprintf=yes
557                 ac_cv_func_vsnprintf=yes
558                 ac_cv_func_seekdir=yes
559                 ac_cv_func_telldir=yes
560                 ac_cv_func_isinf=yes
561                 ac_cv_func_isnan=yes
562                 ac_cv_func_finite=yes
563                 ac_cv_func_link=yes
564                 ac_cv_func_truncate=yes
565                 ac_cv_func_fseeko=yes
566                 ac_cv_func_ftello=yes
567                 ac_cv_lib_crypt_crypt=no
568                 ac_cv_func_getpgrp_void=no
569                 ac_cv_func_setpgrp_void=yes
570                 ac_cv_func_memcmp_working=yes
571                 ac_cv_lib_dl_dlopen=no
572                 rb_cv_binary_elf=no
573                 rb_cv_negative_time_t=no
574                 ac_cv_func_fcntl=yes
575                 ;;
576 os2-emx*)       LIBS="-lm $LIBS"
577                 ac_cv_lib_dir_opendir=no;;
578 msdosdjgpp*)    LIBS="-lm $LIBS"
579                 ac_cv_func_getpgrp_void=yes
580                 ac_cv_func_setitimer=no
581                 ac_cv_sizeof_rlim_t=4
582                 ac_cv_func_fork=no
583                 ac_cv_func_setrlimit=no
584                 ac_cv_header_sys_socket_h=no
585                 ;;
586 bsdi*)          LIBS="-lm $LIBS"
587                 AC_DEFINE(BROKEN_SETREUID, 1)
588                 AC_DEFINE(BROKEN_SETREGID, 1)
589                 ac_cv_sizeof_rlim_t=8;;
590 freebsd*)       LIBS="-lm $LIBS"
591                 AC_CACHE_CHECK([whether -lxpg4 has to be linked],
592                   rb_cv_lib_xpg4_needed,
593                   [AC_TRY_CPP([
594 #include <osreldate.h>
595 #if __FreeBSD_version < 400020 || \
596    (__FreeBSD_version >= 500000 && __FreeBSD_version < 500005)
597 #error needs libxpg4
598 #endif
599                    ],
600                    rb_cv_lib_xpg4_needed=no,
601                    rb_cv_lib_xpg4_needed=yes,
602                    rb_cv_lib_xpg4_needed=yes)])
603                 if test "$rb_cv_lib_xpg4_needed" = yes; then
604                         AC_CHECK_LIB(xpg4, setlocale)
605                 fi
606                 ;;
607 dragonfly*)     LIBS="-lm $LIBS"
608                 ;;
609 bow)            ac_cv_func_setitimer=no
610                 ;;
611 superux*)     ac_cv_func_setitimer=no
612               ;;
613 *) LIBS="-lm $LIBS";;
614 esac
615 AC_CHECK_LIB(crypt, crypt)
616 AC_CHECK_LIB(dl, dlopen)        # Dynamic linking for SunOS/Solaris and SYSV
617 AC_CHECK_LIB(dld, shl_load)     # Dynamic linking for HP-UX
618 AC_CHECK_LIB(socket, socketpair)        # SunOS/Solaris
619 AC_CHECK_LIB(rt, clock_gettime) # GNU/Linux
621 case "$target_cpu" in
622 alpha*)         case "$target_os"::"$GCC" in
623                 *::yes) CFLAGS="-mieee $CFLAGS" ;;   # gcc
624                 osf*)   CFLAGS="-ieee $CFLAGS" ;;    # ccc
625                 esac ;;
626 esac
628 ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no}
629 if test "$ac_cv_header_net_socket_h" = yes; then
630     ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=no}
631 else
632     ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes}
635 dnl Checks for header files.
636 AC_HEADER_DIRENT
637 AC_HEADER_STDC
638 AC_HEADER_SYS_WAIT
639 AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h sys/syscall.h\
640                  fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
641                  syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
642                  sys/mkdev.h sys/utime.h xti.h netinet/in_systm.h float.h ieeefp.h pthread.h \
643                  ucontext.h intrinsics.h langinfo.h locale.h sys/sendfile.h time.h \
644                  net/socket.h sys/socket.h)
646 dnl Check additional types.
647 AC_CHECK_SIZEOF(rlim_t, 0, [
648   #ifdef HAVE_SYS_TYPES_H
649   # include <sys/types.h>
650   #endif
651   #ifdef HAVE_SYS_TIME_H
652   # include <sys/time.h>
653   #endif
654   #ifdef HAVE_SYS_RESOURCE_H
655   # include <sys/resource.h>
656   #endif
657   #ifdef HAVE_UNISTD_H
658   # include <unistd.h>
659   #endif
660   #include <stdio.h>
663 dnl Checks for typedefs, structures, and compiler characteristics.
664 AC_TYPE_SIZE_T
665 AC_CHECK_SIZEOF(size_t, 0)
666 AC_CHECK_SIZEOF(ptrdiff_t, $ac_cv_sizeof_size_t)
667 AC_STRUCT_ST_BLKSIZE
668 AC_STRUCT_ST_BLOCKS
669 AC_STRUCT_ST_RDEV
670 AC_CHECK_MEMBERS([struct stat.st_atim])
671 AC_CHECK_MEMBERS([struct stat.st_atimespec])
672 AC_CHECK_MEMBERS([struct stat.st_atimensec])
673 AC_CHECK_MEMBERS([struct stat.st_mtim])
674 AC_CHECK_MEMBERS([struct stat.st_mtimespec])
675 AC_CHECK_MEMBERS([struct stat.st_mtimensec])
676 AC_CHECK_MEMBERS([struct stat.st_ctim])
677 AC_CHECK_MEMBERS([struct stat.st_ctimespec])
678 AC_CHECK_MEMBERS([struct stat.st_ctimensec])
680 AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H
681 @%:@include <time.h>
682 @%:@endif])
684 AC_CHECK_TYPE(fd_mask, [AC_DEFINE(HAVE_RB_FD_INIT, 1)])
686 dnl RUBY_DEFINT TYPENAME, SIZE, [SIGNED-OR-UNSIGNED], [INCLUDES = DEFAULT-INCLUDES]
687 AC_DEFUN([RUBY_DEFINT], [dnl
688 AC_CACHE_CHECK([for $1], [rb_cv_type_$1],
689 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])
690 typedef $1 t; int s = sizeof(t) == 42;])],
691    [rb_cv_type_$1=yes],
692    [case m4_bmatch([$2], [^[1-9][0-9]*$], $2, [$ac_cv_sizeof_]AS_TR_SH($2)) in
693     "1") rb_cv_type_$1="m4_if([$3], [], [signed ], [$3 ])char";;
694     "$ac_cv_sizeof_short") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])short";;
695     "$ac_cv_sizeof_int") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])int";;
696     "$ac_cv_sizeof_long") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long";;
697     "$ac_cv_sizeof_long_long") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long long";;
698     "$ac_cv_sizeof___int64") rb_cv_type_$1="m4_if([$3], [], [], [$3 ])__int64";;
699     *) rb_cv_type_$1=no;;
700     esac])])
701 if test "${rb_cv_type_$1}" != no; then
702     AC_DEFINE([HAVE_]AS_TR_CPP($1), 1)
703     test "${rb_cv_type_$1}" = yes || AC_DEFINE_UNQUOTED($1, [$rb_cv_type_$1])
707 RUBY_DEFINT(int8_t, 1)
708 RUBY_DEFINT(uint8_t, 1, unsigned)
709 RUBY_DEFINT(int16_t, 2)
710 RUBY_DEFINT(uint16_t, 2, unsigned)
711 RUBY_DEFINT(int32_t, 4)
712 RUBY_DEFINT(uint32_t, 4, unsigned)
713 RUBY_DEFINT(int64_t, 8)
714 RUBY_DEFINT(uint64_t, 8, unsigned)
715 RUBY_DEFINT(int128_t, 16)
716 RUBY_DEFINT(uint128_t, 16, unsigned)
717 RUBY_DEFINT(intptr_t, void*)
718 RUBY_DEFINT(uintptr_t, void*, unsigned)
719 RUBY_DEFINT(ssize_t, size_t)    dnl may differ from int, so not use AC_TYPE_SSIZE_T.
721 AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
722 [rb_cv_stack_end_address=no
723 for addr in __libc_stack_end _SEND; do
724   AC_TRY_LINK(
725     [extern void *$addr;],
726     [if (!$addr) return 1;],
727     [rb_cv_stack_end_address="$addr"; break])
728 done])
729 if test $rb_cv_stack_end_address != no; then
730   AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
733 dnl Checks for library functions.
734 AC_TYPE_GETGROUPS
735 AC_TYPE_SIGNAL
736 case "${target_cpu}-${target_os}" in
737 powerpc-darwin*)
738   AC_LIBSOURCES(alloca.c)
739   AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
740   AC_DEFINE(C_ALLOCA)
741   AC_DEFINE_UNQUOTED(alloca, alloca)
742   ;;
744   AC_FUNC_ALLOCA
745   ;;
746 esac
747 AC_FUNC_MEMCMP
749 # http://sources.redhat.com/ml/libc-hacker/2005-08/msg00008.html
750 # Debian GNU/Linux Etch's libc6.1 2.3.6.ds1-13etch5 has this problem.
751 # Debian GNU/Linux Lenny's libc6.1 2.7-10 has no problem.
752 AC_CACHE_CHECK(for broken erfc of glibc-2.3.6 on IA64, rb_cv_broken_glibc_ia64_erfc,
753   [AC_TRY_RUN([
754 #include <math.h>
756 main()
758    erfc(10000.0);
759    return 0;
762         rb_cv_broken_glibc_ia64_erfc=no,
763         rb_cv_broken_glibc_ia64_erfc=yes,
764         rb_cv_broken_glibc_ia64_erfc=no)])
765 case $rb_cv_broken_glibc_ia64_erfc in
766   yes) ac_cv_func_erf=no;;
767 esac
769 AC_REPLACE_FUNCS(dup2 memmove strerror strftime\
770                  strchr strstr crypt flock vsnprintf\
771                  isnan finite isinf hypot acosh erf tgamma lgamma_r cbrt \
772                  strlcpy strlcat)
773 AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall chroot fsync getcwd eaccess\
774               truncate ftruncate chsize times utimes utimensat fcntl lockf lstat\
775               link symlink readlink\
776               setitimer setruid seteuid setreuid setresuid setproctitle socketpair\
777               setrgid setegid setregid setresgid issetugid pause lchown lchmod\
778               getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
779               getpriority getrlimit setrlimit sysconf group_member\
780               dlopen sigprocmask sigaction sigsetjmp _setjmp _longjmp vsnprintf snprintf\
781               setsid telldir seekdir fchmod cosh sinh tanh log2 round signbit\
782               setuid setgid daemon select_large_fdset setenv unsetenv\
783               mktime timegm clock_gettime gettimeofday\
784               pread sendfile shutdown)
786 AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
787 [AC_TRY_LINK([@%:@include <setjmp.h>
788     jmp_buf jb; void t(v) int v; {__builtin_longjmp(jb, v);}],
789     [__builtin_setjmp(jb);],
790     [ac_cv_func___builtin_setjmp=yes],
791     [ac_cv_func___builtin_setjmp=no])
794 test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
796 AC_MSG_CHECKING(for setjmp type)
797 AC_ARG_WITH(setjmp-type, 
798         [  --with-setjmp-type      select setjmp type], [
799         case $withval in
800         __builtin_setjmp) setjmp_prefix=__builtin_;;
801         _setjmp) setjmp_prefix=_;;
802         sigsetjmp) setjmp_prefix=sig;;
803         setjmp) setjmp_prefix=;;
804         '') unset setjmp_prefix;;
805         *)   AC_MSG_ERROR(invalid setjmp type: $withval);;
806         esac], [unset setjmp_prefix])
807 if test ${setjmp_prefix+set}; then
808     if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp = no; then
809         AC_MSG_ERROR(${setjmp_prefix}setjmp is not available)
810     fi
811 elif test "$ac_cv_func___builtin_setjmp" = yes; then
812     setjmp_prefix=__builtin_
813 elif test "$ac_cv_func__setjmp" = yes; then
814     setjmp_prefix=_
815 elif test "$ac_cv_func_sigsetjmp" = yes; then
816     case $target_os in
817     solaris*|cygwin*)
818         setjmp_prefix=;;
819     *)
820         setjmp_prefix=sig;;
821     esac
822 else
823     setjmp_prefix=
825 if test x$setjmp_prefix = xsig; then
826     setjmp_sigmask=yes
827 else
828     unset setjmp_sigmask
830 AC_MSG_RESULT(${setjmp_prefix}setjmp)
831 AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp(env${setjmp_sigmask+,0})])
832 AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)])
833 AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf)
835 AC_ARG_ENABLE(setreuid,
836        [  --enable-setreuid       use setreuid()/setregid() according to need even if obsolete.],
837        [use_setreuid=$enableval])
838 if test "$use_setreuid" = yes; then
839     AC_DEFINE(USE_SETREUID)
840     AC_DEFINE(USE_SETREGID)
842 AC_STRUCT_TIMEZONE
843 AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
844   [AC_TRY_COMPILE([#include <time.h>],
845     [struct tm t; t.tm_gmtoff = 3600;],
846   [rb_cv_member_struct_tm_tm_gmtoff=yes],
847   [rb_cv_member_struct_tm_tm_gmtoff=no])])
848 if test "$rb_cv_member_struct_tm_tm_gmtoff" = yes; then
849   AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF)
851 AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
852   [AC_TRY_LINK([#include <time.h>
853   int i;],
854         [i = daylight;],
855         rb_cv_have_daylight=yes,
856         rb_cv_have_daylight=no)])
857 if test "$rb_cv_have_daylight" = yes; then
858   AC_DEFINE(HAVE_DAYLIGHT)
860 AC_DEFUN([RUBY_CHECK_VARTYPE], [dnl
861 AC_CACHE_CHECK([for external $1], rb_cv_var_$1,
862   [rb_cv_var_$1=no
863   AC_TRY_COMPILE([
864 #ifndef _XOPEN_SOURCE
865 #define _XOPEN_SOURCE 1
866 #endif
869 const volatile void *volatile t;],
870     [t = &(&$1)[0];],
871     [for t in $3; do
872       AC_TRY_COMPILE([
873 #ifndef _XOPEN_SOURCE
874 #define _XOPEN_SOURCE 1
875 #endif
878 extern $t $1;
879 const volatile void *volatile t;],
880         [t = &(&$1)[0];],
881         [rb_cv_var_$1=$t; break])
882     done])])
883 if test "[$rb_cv_var_]$1" != no; then
884   AC_DEFINE([HAVE_VAR_]m4_toupper($1))
885   AC_DEFINE_UNQUOTED([TYPEOF_VAR_]m4_toupper($1), $rb_cv_var_$1)
886 fi])
887 RUBY_CHECK_VARTYPE(timezone, [@%:@include <time.h>], [long int])
888 RUBY_CHECK_VARTYPE(altzone, [@%:@include <time.h>], [long int])
889 if test "$rb_cv_var_timezone" = no; then
890   AC_CHECK_FUNCS(timezone)
891   if test "$ac_cv_func_timezone" = yes; then
892     AC_CACHE_CHECK([whether timezone requires zero arguments], rb_cv_func_timezone_void,
893       [AC_TRY_COMPILE([@%:@include <time.h>],
894         [(void)timezone(0, 0);],
895         [rb_cv_func_timezone_void=no],
896         [rb_cv_func_timezone_void=yes])]
897     )
898     if test $rb_cv_func_timezone_void = yes; then
899       AC_DEFINE(TIMEZONE_VOID)
900     fi
901   fi
904 AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t,
905   [AC_TRY_RUN([
906 #include <time.h>
908 void
909 check(tm, y, m, d, h, s)
910     struct tm *tm;
911     int y, m, d, h, s;
913     if (!tm ||
914         tm->tm_year != y ||
915         tm->tm_mon  != m-1 ||
916         tm->tm_mday != d ||
917         tm->tm_hour != h ||
918         tm->tm_sec  != s) {
919         exit(1);
920     }
924 main()
926    time_t t = -1;
927    struct tm *tm;
929    check(gmtime(&t), 69, 12, 31, 23, 59);
930    t = ~(time_t)0 << 31;
931    check(gmtime(&t), 1, 12, 13, 20, 52);
932    return 0;
935         rb_cv_negative_time_t=yes,
936         rb_cv_negative_time_t=no,
937         rb_cv_negative_time_t=yes)])
938 if test "$rb_cv_negative_time_t" = yes; then
939   AC_DEFINE(NEGATIVE_TIME_T)
942 if test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = yes; then
943    AC_DEFINE(POSIX_SIGNAL)
944 else
945   AC_CHECK_FUNCS(sigsetmask)
946   AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal,
947     [AC_TRY_RUN([
948 #include <stdio.h>
949 #include <signal.h>
951 void
952 sig_handler(dummy)
953      int dummy;
958 main()
960   signal(SIGINT, sig_handler);
961   kill(getpid(), SIGINT);
962   kill(getpid(), SIGINT);
963   return 0;
966         rb_cv_bsd_signal=yes,
967         rb_cv_bsd_signal=no,
968         rb_cv_bsd_signal=$ac_cv_func_sigsetmask)])
969   if test "$rb_cv_bsd_signal" = yes; then
970     AC_DEFINE(BSD_SIGNAL)
971   fi
974 AC_FUNC_GETPGRP
975 AC_FUNC_SETPGRP  
977 AC_C_BIGENDIAN
978 AC_C_CONST
979 AC_C_CHAR_UNSIGNED
980 AC_C_INLINE
981 AC_C_VOLATILE
983 if test x"$target_cpu" = xia64; then
984     AC_LIBOBJ([ia64])
985     AC_CACHE_CHECK(for __libc_ia64_register_backing_store_base,
986                    rb_cv___libc_ia64_register_backing_store_base,
987     [rb_cv___libc_ia64_register_backing_store_base=no
988     AC_TRY_LINK(
989       [extern unsigned long __libc_ia64_register_backing_store_base;],
990       [unsigned long p = __libc_ia64_register_backing_store_base;
991        printf("%ld\n", p);],
992       [rb_cv___libc_ia64_register_backing_store_base=yes])])
993     if test $rb_cv___libc_ia64_register_backing_store_base = yes; then
994       AC_DEFINE(HAVE___LIBC_IA64_REGISTER_BACKING_STORE_BASE)
995     fi
998 AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign,
999     [AC_COMPILE_IFELSE(AC_LANG_BOOL_COMPILE_TRY([], [(-1==(-1>>1))]),
1000         rb_cv_rshift_sign=yes,
1001         rb_cv_rshift_sign=no)])
1002 if test "$rb_cv_rshift_sign" = yes; then
1003   AC_DEFINE(RSHIFT(x,y), ((x)>>(int)y))
1004 else
1005   AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>y) : (x)>>y))
1008 AC_MSG_CHECKING(read count field in FILE structures)
1009 AC_CACHE_VAL(rb_cv_fcnt,
1010 [for fcnt in    dnl
1011      _cnt       dnl
1012      __cnt      dnl
1013      _r         dnl
1014      readCount  dnl
1015      _rcount    dnl for emx0.9c
1016 ; do
1017     AC_TRY_COMPILE([#include <stdio.h>
1019         [FILE *f = stdin; f->$fcnt = 0;],
1020         rb_cv_fcnt="$fcnt"; break,
1021         rb_cv_fcnt="not found")
1022 done])
1023 if test "$rb_cv_fcnt" = "not found"; then
1024   AC_MSG_RESULT([not found(OK if using GNU libc)])
1025 else
1026   AC_MSG_RESULT($rb_cv_fcnt)
1027   AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)
1030 AC_MSG_CHECKING(read buffer ptr field in FILE structures)
1031 AC_CACHE_VAL(rb_cv_frptr,
1032 [for frptr in   dnl
1033      _IO_read_ptr dnl
1034      _ptr       dnl
1035      __ptr      dnl
1036      bufpos     dnl
1037      _p dnl
1038 ; do
1039     AC_TRY_COMPILE([#include <stdio.h>
1041         [FILE *f = stdin; char buf[256]; f->$frptr = buf;],
1042         rb_cv_frptr="$frptr"; break,
1043         rb_cv_frptr="not found")
1044 done])
1045 if test "$rb_cv_frptr" = "not found"; then
1046   AC_MSG_RESULT([not found])
1047 else
1048   AC_MSG_RESULT($rb_cv_frptr)
1049   AC_DEFINE_UNQUOTED(FILE_READPTR, $rb_cv_frptr)
1051   if test "$rb_cv_fcnt" = "not found"; then
1052     AC_MSG_CHECKING(read buffer end field in FILE structures)
1053     AC_CACHE_VAL(rb_cv_frend,
1054     [for frend in       dnl
1055          _IO_read_end   dnl
1056          bufread        dnl
1057     ; do
1058         AC_TRY_COMPILE([#include <stdio.h>
1059     ],
1060         [FILE *f = stdin; char buf[256]; f->$frend = buf;],
1061         rb_cv_frend="$frend"; break,
1062         rb_cv_frend="not found")
1063     done])
1064     if test "$rb_cv_frend" = "not found"; then
1065       AC_MSG_RESULT([not found])
1066     else
1067       AC_MSG_RESULT($rb_cv_frend)
1068       AC_DEFINE_UNQUOTED(FILE_READEND, $rb_cv_frend)
1069     fi
1070   fi
1073 AC_CACHE_CHECK([whether st_ino is huge], rb_cv_huge_st_ino,
1074 [AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([
1075 #include <sys/stat.h>
1076 struct stat test_stat;
1077 ], [sizeof(test_stat.st_ino)>sizeof(long)])],
1078 rb_cv_huge_st_ino=yes,
1079 rb_cv_huge_st_ino=no)
1081 if test $rb_cv_huge_st_ino = yes; then
1082   AC_DEFINE(HUGE_ST_INO)
1085 if test "$ac_cv_func_sysconf" = yes; then
1086   AC_DEFUN([RUBY_CHECK_SYSCONF], [dnl
1087   AC_CACHE_CHECK([whether _SC_$1 is supported], rb_cv_have_sc_[]m4_tolower($1),
1088     [AC_TRY_COMPILE([#include <unistd.h>
1089       ],
1090       [_SC_$1 >= 0],
1091       rb_cv_have_sc_[]m4_tolower($1)=yes,
1092       rb_cv_have_sc_[]m4_tolower($1)=no)
1093     ])
1094   if test "$rb_cv_have_sc_[]m4_tolower($1)" = yes; then
1095     AC_DEFINE(HAVE__SC_$1)
1096   fi
1097   ])
1098   RUBY_CHECK_SYSCONF(CLK_TCK)
1101 case "$target_cpu" in
1102 m68*|i?86|ia64|sparc*|alpha*) rb_cv_stack_grow_dir=-1;;
1103 hppa*) rb_cv_stack_grow_dir=+1;;
1104 esac
1105 AC_CACHE_CHECK(stack growing direction, rb_cv_stack_grow_dir,
1106   [AC_TRY_RUN([
1107 /* recurse to get rid of inlining */
1108 static int
1109 stack_growup_p(addr, n)
1110     volatile int *addr, n;
1112     volatile int end;
1113     if (n > 0)
1114         return *addr = stack_growup_p(addr, n - 1);
1115     else
1116         return (&end > addr);
1118 int main()
1120     int x;
1121     return stack_growup_p(&x, 10);
1123 ], rb_cv_stack_grow_dir=-1, rb_cv_stack_grow_dir=+1, rb_cv_stack_grow_dir=0)])
1124 AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $rb_cv_stack_grow_dir)
1126 if test x"$enable_pthread" = xyes; then
1127     for pthread_lib in thr pthread pthreads c c_r root; do
1128         AC_CHECK_LIB($pthread_lib, pthread_kill,
1129                      rb_with_pthread=yes, rb_with_pthread=no)
1130         if test "$rb_with_pthread" = "yes"; then break; fi
1131     done
1132     if test x"$rb_with_pthread" = xyes; then
1133         AC_DEFINE(_REENTRANT)
1134         AC_DEFINE(_THREAD_SAFE)
1135         AC_DEFINE(HAVE_LIBPTHREAD)
1136         case $pthread_lib in
1137         c)
1138             ;;
1139         root)
1140                 ;;
1141         c_r)
1142             MAINLIBS="-pthread $MAINLIBS"
1143             ;;
1144         *)
1145             LIBS="-l$pthread_lib $LIBS"
1146             ;;
1147         esac
1148     else
1149         AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
1150     fi
1151     AC_CHECK_FUNCS(nanosleep sched_yield pthread_attr_setinheritsched)
1152     if test x"$ac_cv_func_nanosleep" = xno; then
1153        AC_CHECK_LIB(rt, nanosleep)
1154        if test x"$ac_cv_lib_rt_nanosleep" = xyes; then
1155            AC_DEFINE(HAVE_NANOSLEEP)
1156        fi
1157     fi
1159 if test x"$ac_cv_header_ucontext_h" = xyes; then
1160     if test x"$rb_with_pthread" = xyes; then
1161         AC_CHECK_FUNCS(getcontext setcontext)
1162     fi
1165 if test "$ac_cv_func_fork" = "yes" -a "$rb_with_pthread" = "yes"; then
1166     AC_CACHE_CHECK([if fork works with pthread], rb_cv_fork_with_pthread,
1167         [AC_TRY_RUN([
1168 #include <stdlib.h>
1169 #include <unistd.h>
1170 #include <pthread.h>
1171 #include <stdio.h>
1172 #include <sys/types.h>
1173 #include <sys/wait.h>
1174 #include <signal.h>
1175 #ifndef EXIT_SUCCESS
1176 #define EXIT_SUCCESS 0
1177 #endif
1178 #ifndef EXIT_FAILURE
1179 #define EXIT_FAILURE 1
1180 #endif
1182 void *
1183 thread_func(void *dmy)
1185     return dmy;
1189 use_threads(void)
1191     pthread_t tid;
1192     if (pthread_create(&tid, 0, thread_func, 0) != 0) {
1193         return -1;
1194     }
1195     if (pthread_join(tid, 0) != 0) {
1196         return -1;
1197     }
1198     return 0;
1202 main(int argc, char *argv[])
1204     pid_t pid;
1205     if (use_threads()) return EXIT_FAILURE;
1206     pid = fork();
1208     if (pid) {
1209         int loc;
1210         sleep(1);
1211         if (waitpid(pid, &loc, WNOHANG) == 0) {
1212             kill(pid, SIGKILL);
1213             return EXIT_FAILURE;
1214         }
1215     }
1216     else {
1217         if (use_threads()) return EXIT_FAILURE;
1218     }
1220     return EXIT_SUCCESS;
1222         rb_cv_fork_with_pthread=yes,
1223         rb_cv_fork_with_pthread=no,
1224         rb_cv_fork_with_pthread=yes)])
1225     test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
1228 AC_CHECK_FUNCS(backtrace)
1230 AC_ARG_WITH(valgrind,
1231         [  --with-valgrind         enable valgrind memcheck support.],
1232         [AC_CHECK_HEADERS(valgrind/memcheck.h)])
1234 dnl wheather use dln_a_out or not
1235 AC_ARG_WITH(dln-a-out, 
1236         [  --with-dln-a-out        use dln_a_out if possible], [
1237         case $withval in
1238         yes) with_dln_a_out=yes;;
1239         *)   with_dln_a_out=no;;
1240         esac], [with_dln_a_out=no])
1242 AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
1243 [AC_TRY_LINK([],[], [
1244 case "`head -1 conftest$EXEEXT | cat -e`" in
1245 dnl (
1246 '^?ELF'*)
1247     rb_cv_binary_elf=yes;;
1248 dnl (
1250     rb_cv_binary_elf=no;;
1251 esac],
1252 rb_cv_binary_elf=no)])
1254 if test "$rb_cv_binary_elf" = yes; then
1255   AC_DEFINE(USE_ELF)
1258 case "$target_os" in
1259 linux* | gnu* | k*bsd*-gnu | bsdi*)
1260     if test "$rb_cv_binary_elf" = no; then
1261         with_dln_a_out=yes
1262     else
1263         LDFLAGS="$LDFLAGS -rdynamic"
1264     fi;;
1265 esac
1266 LIBEXT=a
1268 AC_SUBST(DLDFLAGS)dnl
1269 AC_SUBST(ARCH_FLAG)dnl
1271 AC_SUBST(STATIC)dnl
1272 AC_SUBST(CCDLFLAGS)dnl
1273 AC_SUBST(LDSHARED)dnl
1274 AC_SUBST(LDSHAREDXX)dnl
1275 AC_SUBST(DLEXT)dnl
1276 AC_SUBST(DLEXT2)dnl
1277 AC_SUBST(LIBEXT)dnl
1279 STATIC=
1280 : ${LIBPATHFLAG=' -L%s'}
1281 : ${PATHFLAG=''}
1283 if test "$with_dln_a_out" != yes; then
1284   rb_cv_dlopen=unknown
1285   AC_MSG_CHECKING(whether OS depend dynamic link works)
1286   if test "$GCC" = yes; then
1287     case "$target_os" in
1288     nextstep*)  CCDLFLAGS="$CCDLFLAGS -fno-common";;
1289     openstep*)  CCDLFLAGS="$CCDLFLAGS -fno-common";;
1290     rhapsody*)  CCDLFLAGS="$CCDLFLAGS -fno-common";;
1291     darwin*)    CCDLFLAGS="$CCDLFLAGS -fno-common";;
1292     human*|bsdi*|beos*|haiku*|cygwin*|mingw*|aix*|interix*) ;;
1293     *) CCDLFLAGS="$CCDLFLAGS -fPIC";;
1294     esac
1295   else
1296     case "$target_os" in
1297         hpux*)          CCDLFLAGS="$CCDLFLAGS +Z";;
1298         solaris*|irix*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
1299         sunos*)         CCDLFLAGS="$CCDLFLAGS -PIC" ;;
1300         esix*|uxpds*)   CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
1301         *)              : ${CCDLFLAGS=""} ;;
1302     esac
1303   fi
1306   AC_ARG_ENABLE(rpath,
1307        [  --disable-rpath         embed run path into extension libraries.],
1308        [enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
1309   if test "$enable_rpath" = yes; then
1310     LIBPATHFLAG=" -L%1\$-s"
1311     RPATHFLAG=" ${linker_flag}-R%1\$-s"
1312   fi
1314   case "$target_os" in
1315         hpux*)          DLDFLAGS="$DLDFLAGS -E"
1316                         : ${LDSHARED='ld -b'}
1317                         XLDFLAGS="$XLDFLAGS -Wl,-E"
1318                         : ${LIBPATHENV=SHLIB_PATH}
1319                         if test "$rb_cv_prog_gnu_ld" = no; then
1320                             RPATHFLAG=' +b %1$-s'
1321                         fi
1322                         rb_cv_dlopen=yes;;
1323         solaris*)       if test "$GCC" = yes; then
1324                           : ${LDSHARED='$(CC) -shared'}
1325                            if test "$rb_cv_prog_gnu_ld" = yes; then
1326                                LDFLAGS="$LDFLAGS -Wl,-E"
1327                            fi
1328                         else
1329                            : ${LDSHARED='ld -G'}
1330                         fi
1331                         rb_cv_dlopen=yes;;
1332         sunos*)         : ${LDSHARED='ld -assert nodefinitions'}
1333                         rb_cv_dlopen=yes;;
1334         irix*)          : ${LDSHARED='ld -shared'}
1335                         rb_cv_dlopen=yes;;
1336         sysv4*)         : ${LDSHARED='ld -G'}
1337                         rb_cv_dlopen=yes;;
1338         nto-qnx*)       : ${LDSHARED="qcc -shared"}
1339                         rb_cv_dlopen=yes ;;
1340         esix*|uxpds*)   : ${LDSHARED="ld -G"}
1341                         rb_cv_dlopen=yes ;;
1342         osf*)           : ${LDSHARED="ld -shared -expect_unresolved \"*\""}
1343                         rb_cv_dlopen=yes ;;
1344         bsdi3*)         case "$CC" in
1345                         *shlicc*)       : ${LDSHARED="$CC -r"}
1346                                         rb_cv_dlopen=yes ;;
1347                         esac ;;
1348         linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi*)
1349                         : ${LDSHARED='${CC} -shared'}
1350                         if test "$rb_cv_binary_elf" = yes; then
1351                             LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
1352                         fi
1353                         rb_cv_dlopen=yes ;;
1354         interix*)       : ${LDSHARED="$CC -shared"}
1355                         XLDFLAGS="$XLDFLAGS -Wl,-E"
1356                         LIBPATHFLAG=" -L%1\$-s"
1357                         rb_cv_dlopen=yes ;;
1358         freebsd*|dragonfly*)       : ${LDSHARED="$CC -shared"}
1359                         if test "$rb_cv_binary_elf" = yes; then
1360                             LDFLAGS="$LDFLAGS -rdynamic"
1361                             DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$(.TARGET)'
1362                         else
1363                           test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable"
1364                         fi
1365                         rb_cv_dlopen=yes ;;
1366         openbsd*)       : ${LDSHARED="\$(CC) -shared ${CCDLFLAGS}"}
1367                         if test "$rb_cv_binary_elf" = yes; then
1368                             LDFLAGS="$LDFLAGS -Wl,-E"
1369                         fi
1370                         rb_cv_dlopen=yes ;;
1371         nextstep*)      : ${LDSHARED='cc -r -nostdlib'}
1372                         LDFLAGS="$LDFLAGS -u libsys_s"
1373                         rb_cv_dlopen=yes ;;
1374         openstep*)      : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
1375                         : ${LDFLAGS=""}
1376                         rb_cv_dlopen=yes ;;
1377         rhapsody*)      : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
1378                         : ${LDFLAGS=""}
1379                         rb_cv_dlopen=yes ;;
1380         darwin*)        : ${LDSHARED='cc -dynamic -bundle -undefined suppress -flat_namespace'}
1381                         : ${LDFLAGS=""}
1382                         : ${LIBPATHENV=DYLD_LIBRARY_PATH}
1383                         rb_cv_dlopen=yes ;;
1384         aix*)           if test "$GCC" = yes; then
1385                             : ${LDSHARED='$(CC) -shared'}
1386                         else
1387                             : ${LDSHARED='$(CC)'}
1388                         fi
1389                         LDSHARED="$LDSHARED ${linker_flag}-G"
1390                         DLDFLAGS='-eInit_$(TARGET)'
1391                         XLDFLAGS="${linker_flag}-bE:ruby.imp ${linker_flag}-brtl"
1392                         : ${ARCHFILE="ruby.imp"}
1393                         TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
1394                         TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
1395                         : ${LIBPATHENV=SHLIB_PATH}
1396                         rb_cv_dlopen=yes ;;
1397         human*)         : ${DLDFLAGS=''}
1398                         : ${LDSHARED=''}
1399                         : ${LDFLAGS=''}
1400                         : ${LINK_SO='ar cru $@ $(OBJS)'}
1401                         rb_cv_dlopen=yes ;;
1402         beos*)          case "$target_cpu" in
1403                           powerpc*)
1404                             : ${LDSHARED="ld -xms"}
1405                             DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
1406                             ;;
1407                           i586*)
1408                             : ${LDSHARED="ld -shared"}
1409                             DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lbe -lroot"
1410                             ;;
1411                         esac
1412                         : ${LIBPATHENV=LIBRARY_PATH}
1413                         rb_cv_dlopen=yes ;;
1414         haiku*)                 case "$target_cpu" in
1415                           powerpc*)
1416                             : ${LDSHARED="ld -xms"}
1417                             DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
1418                             ;;
1419                           i586*)
1420                             : ${LDSHARED="ld -shared"}
1421                             DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lbe -lroot"
1422                             ;;
1423                         esac
1424                         : ${LIBPATHENV=LIBRARY_PATH}
1425                         rb_cv_dlopen=yes ;;
1426         nto-qnx*)       DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
1427                         : ${LDSHARED='ld -Bshareable -x'}
1428                         LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
1429                         rb_cv_dlopen=yes;;
1430         cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
1431                         XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000"
1432                         DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import,--export-all"
1433                         : ${LIBPATHENV=""}
1434                         rb_cv_dlopen=yes ;;
1435         hiuxmpp)        : ${LDSHARED='ld -r'} ;;
1436         atheos*)        : ${LDSHARED="$CC -shared"}
1437                         rb_cv_dlopen=yes ;;
1438         os2-emx*)       LDFLAGS="$LDFLAGS -Zbsd-signals"
1439                         ;;
1440         *)              : ${LDSHARED='ld'} ;;
1441   esac
1442   AC_MSG_RESULT($rb_cv_dlopen)
1444 if test "${LDSHAREDXX}" = ""; then
1445     case "${LDSHARED}" in
1446         *'$(CC)'*)
1447             LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\$(CC)/$(CXX)/'`
1448             ;;
1449         *'${CC}'*)
1450             LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\${CC}/${CXX}/'`
1451             ;;
1452         *$CC*)
1453             LDSHAREDXX=`echo "${LDSHARED}" | sed "s|$CC|$CXX|"`
1454             ;;
1455         ld" "*)
1456             ;;
1457     esac
1460 AC_SUBST(LINK_SO)
1461 AC_SUBST(LIBPATHFLAG)
1462 AC_SUBST(RPATHFLAG)
1463 AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
1464 AC_SUBST(TRY_LINK)
1466 dln_a_out_works=no
1467 if test "$ac_cv_header_a_out_h" = yes; then
1468   if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
1469     cat confdefs.h > config.h
1470     AC_CACHE_CHECK(whether matz's dln works, rb_cv_dln_a_out,
1471     [AC_TRY_COMPILE([
1472 #define USE_DLN_A_OUT
1473 #include "dln.c"
1475         [], 
1476         rb_cv_dln_a_out=yes,
1477         rb_cv_dln_a_out=no)])
1478     if test "$rb_cv_dln_a_out" = yes; then
1479       dln_a_out_works=yes
1480       AC_DEFINE(USE_DLN_A_OUT)
1481     fi
1482   fi
1485 if test "$dln_a_out_works" = yes; then
1486   if test "$GCC" = yes; then
1487     STATIC=-static
1488   else
1489     STATIC=-Bstatic
1490   fi
1491   DLEXT=so
1492   CCDLFLAGS=
1493 else
1494   case "$target_os" in
1495     hpux*)      DLEXT=sl;;
1496     nextstep*)  DLEXT=bundle;;
1497     openstep*)  DLEXT=bundle;;
1498     rhapsody*)  DLEXT=bundle;;
1499     darwin*)    DLEXT=bundle;;
1500     os2-emx*)   DLEXT=dll;;
1501     cygwin*|mingw*)     DLEXT=so;;
1502     *)          DLEXT=so;;
1503   esac
1505 len=2 # .rb
1506 n=`expr "$DLEXT"  : '.*'`; test "$n" -gt "$len" && len=$n
1507 n=`expr "$DLEXT2" : '.*'`; test "$n" -gt "$len" && len=$n
1508 AC_DEFINE_UNQUOTED(DLEXT_MAXLEN, `expr $len + 1`)
1509 test ".$DLEXT"  = "." || AC_DEFINE_UNQUOTED(DLEXT,  ".$DLEXT")
1510 test ".$DLEXT2" = "." || AC_DEFINE_UNQUOTED(DLEXT2, ".$DLEXT2")
1511 AC_SUBST(DLEXT)
1513 AC_SUBST(STRIP)dnl
1514 if test "$with_dln_a_out" = yes; then
1515   STRIP=true
1516 else
1517   STRIP=strip
1520 case "$target_os" in
1521   linux* | gnu* | k*bsd*-gnu)
1522         STRIP='strip -S -x';;
1523   nextstep*)
1524         STRIP='strip -A -n';;
1525   openstep*)
1526         STRIP='strip -A -n';;
1527   rhapsody*)
1528         STRIP='strip -A -n';;
1529   darwin*)
1530         STRIP='strip -A -n';;
1531 esac
1533 EXTSTATIC=
1534 AC_SUBST(EXTSTATIC)dnl
1535 AC_ARG_WITH(static-linked-ext,
1536             [  --with-static-linked-ext link external modules statically],
1537             [case $withval in
1538              yes) STATIC=
1539                   EXTSTATIC=static;;
1540              *) ;;
1541              esac])
1543 case "$target_os" in
1544   human*)
1545     AC_CHECK_LIB(signal, _harderr)
1546     AC_CHECK_LIB(hmem, hmemset)
1547     AC_CHECK_FUNCS(select)
1548     AC_CACHE_CHECK(whether PD libc _dtos18 fail to convert big number,
1549                    rb_cv_missing__dtos18,
1550     [AC_TRY_RUN(
1551 changequote(<<, >>)dnl
1553 #include <stdio.h>
1555 main()
1557    char buf[256];
1558    sprintf(buf, "%g", 1e+300);
1559    return (strcmp (buf, "1e+300") ? 0 : 1);
1562 changequote([, ])dnl
1563 rb_cv_missing__dtos18=yes, rb_cv_missing__dtos18=no, rb_cv_missing__dtos18=no)])
1564     if test "$rb_cv_missing__dtos18" = yes; then
1565       AC_DEFINE(MISSING__DTOS18)
1566     fi
1567     AC_CACHE_CHECK(whether PD libc fconvert fail to round,
1568                    rb_cv_missing_fconvert,
1569     [AC_TRY_RUN(
1570 changequote(<<, >>)dnl
1572 #include <stdio.h>
1573 #include <math.h>
1575 main()
1577   char buf[256];
1578   sprintf(buf, "%f", log(exp(1.0)));
1579   return (strcmp (buf, "1.000000") ? 0 : 1);
1582 changequote([, ])dnl
1583 rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no)])
1584     if test "$rb_cv_missing_fconvert" = yes; then
1585       AC_DEFINE(MISSING_FCONVERT)
1586     fi
1587     AC_LIBOBJ([x68.o])
1588     CFLAGS="$CFLAGS -fansi-only"
1589     XCFLAGS="$XCFLAGS -cc1-stack=262144 -cpp-stack=2694144"
1590     EXEEXT=.x
1591     OBJEXT=o
1592     setup=Setup.x68
1593     ;;
1594   dnl OS/2 environment w/ Autoconf 2.1x for EMX
1595   os2-emx)
1596     AC_LIBOBJ([os2])
1597     setup=Setup.emx
1598     ;;
1599   *djgpp*)
1600     setup=Setup.dj
1601     ;;
1602   *)
1603     setup=Setup
1604     ;;
1605 esac
1607 AC_SUBST(setup)
1609 if test "$prefix" = NONE; then
1610   prefix=$ac_default_prefix
1613 #if test "$fat_binary" != no ; then
1614 #  CFLAGS="$CFLAGS $ARCH_FLAG"
1617 if test x"$cross_compiling" = xyes; then
1618   test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
1619   PREP=fake.rb
1620   RUNRUBY='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
1621 else
1622   MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib'
1623   MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common -I./- -r$(srcdir)/ext/purelib.rb'
1624   PREP='miniruby$(EXEEXT)'
1625   RUNRUBY='$(MINIRUBY) $(srcdir)/runruby.rb --extout=$(EXTOUT)'
1627 AC_SUBST(MINIRUBY)
1628 AC_SUBST(PREP)
1629 AC_SUBST(RUNRUBY)
1630 AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
1632 FIRSTMAKEFILE=""
1633 LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
1634 LIBRUBY='$(LIBRUBY_A)'
1635 LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static'
1636 LIBRUBYARG='$(LIBRUBYARG_STATIC)'
1637 SOLIBS=
1639 case "$target_os" in
1640   cygwin*|mingw*|beos*|haiku*|openstep*|nextstep*|rhapsody*|darwin*|os2-emx*)
1641     : ${DLDLIBS=""}
1642     ;;
1643   *)
1644     DLDLIBS="$DLDLIBS -lc"
1645     ;;
1646 esac
1648 RUBY_SO_NAME='$(RUBY_INSTALL_NAME)'
1649 LIBRUBY_LDSHARED=$LDSHARED
1650 LIBRUBY_DLDFLAGS=$DLDFLAGS
1651 LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
1652 LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so'
1653 ENABLE_SHARED=no
1655 AC_ARG_ENABLE(shared,
1656        [  --enable-shared         build a shared library for Ruby. ],
1657        [enable_shared=$enableval])
1658 if test "$enable_shared" = 'yes'; then
1659   LIBRUBY='$(LIBRUBY_SO)'
1660   LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
1661   LIBRUBYARG='$(LIBRUBYARG_SHARED)'
1662   CFLAGS="$CFLAGS $CCDLFLAGS"
1663   ENABLE_SHARED=yes
1664   if test "$rb_cv_binary_elf" = yes; then
1665     SOLIBS='$(LIBS)'
1666   fi
1667   case "$target_os" in
1668     sunos4*)
1669         LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
1670         ;;
1671     linux* | gnu* | k*bsd*-gnu | atheos*)
1672         LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
1673         LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
1674         ;;
1675     freebsd*|dragonfly*)
1676         SOLIBS='$(LIBS)'
1677         LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
1678         if test "$rb_cv_binary_elf" != "yes" ; then
1679             LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
1680             LIBRUBY_ALIASES=''
1681         fi
1682         ;;
1683     netbsd*)
1684         SOLIBS='$(LIBS)'
1685         LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
1686         LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
1687         if test "$rb_cv_binary_elf" = yes; then # ELF platforms
1688            LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
1689         else    # a.out platforms
1690            LIBRUBY_ALIASES=""
1691         fi
1692         ;;
1693     openbsd*)
1694         SOLIBS='$(LIBS)'
1695         LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
1696         ;;
1697     solaris*)
1698         SOLIBS='$(LIBS)'
1699         LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)'
1700         LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY) lib$(RUBY_SO_NAME).so'
1701         if test "$GCC" = yes; then
1702             LIBRUBY_DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(@F)'
1703         fi
1704         XLDFLAGS="$XLDFLAGS "'-R${libdir}'
1705         ;;
1706     hpux*)
1707         XLDFLAGS="$XLDFLAGS "'-Wl,+s,+b,$(libdir)'
1708         LIBRUBY_SO='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
1709         LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).sl'
1710         ;;
1711     aix*)
1712         LIBRUBY_DLDFLAGS="${linker_flag}-bnoentry $XLDFLAGS"
1713         LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}'
1714         SOLIBS='-lm -lc'
1715         ;;
1716     beos*)
1717         case "$target_cpu" in
1718         powerpc*)
1719             LIBRUBY_DLDFLAGS='-f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
1720             ;;
1721         esac
1722         ;;
1723     darwin*)
1724         LIBRUBY_SO='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
1725         LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
1726         LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
1727         LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
1728         ;;
1729     interix*)
1730         LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
1731         ;;
1732     *)
1733         ;;
1734   esac
1736 if test "$enable_rpath" = yes; then
1737     LIBRUBYARG_SHARED="${linker_flag}-R ${linker_flag}\$(libdir) -L\$(libdir) $LIBRUBYARG_SHARED"
1740 LDFLAGS="-L. $LDFLAGS"
1741 AC_SUBST(ARCHFILE)
1743 dnl build rdoc index if requested
1744 RDOCTARGET=""
1745 AC_ARG_ENABLE(install-doc,
1746        [  --disable-install-doc    do not install rdoc indexes during install ],
1747        [install_doc=$enableval], [install_doc=yes])
1748 if test "$install_doc" != no; then
1749    RDOCTARGET="install-doc"
1751 AC_SUBST(RDOCTARGET)
1753 if test "$rb_with_pthread" = "yes"; then
1754     THREAD_MODEL=pthread
1756 MINIDLNOBJ=dln.o
1757 case "$target_os" in
1758     linux*)
1759         ;;
1760     netbsd*)
1761         CFLAGS="$CFLAGS -pipe"
1762         ;;
1763     nextstep*|openstep*)
1764         # The -fno-common is needed if we wish to embed the Ruby interpreter
1765         # into a plugin module of some project (as opposed to embedding it
1766         # within the project's application).  The -I/usr/local/include is
1767         # needed because CPP as discovered by configure (cc -E -traditional)
1768         # fails to consult /usr/local/include by default.  This causes
1769         # mkmf.rb's have_header() to fail if the desired resource happens to be
1770         # installed in the /usr/local tree.
1771         CFLAGS="$CFLAGS -pipe -fno-common"
1772         CPPFLAGS="$CPPFLAGS -I/usr/local/include"
1773         ;;
1774     rhapsody*)
1775         CFLAGS="$CFLAGS -pipe -no-precomp -fno-common"
1776         ;;
1777     darwin*)
1778         CFLAGS="$CFLAGS -pipe -fno-common"
1779         MINIDLNOBJ=dmydln.o
1780         ;;
1781     os2-emx)
1782         CFLAGS="$CFLAGS -DOS2 -Zmts"
1783         LIBRUBY_A=`echo $LIBRUBY_A | sed 's/^lib//'`
1784         LIBRUBY_SO=`echo $LIBRUBY_SO | sed 's/^lib//'`
1785         LIBRUBY_ALIASES=`for i in $LIBRUBY_ALIASES; do echo "$i"; done | sed 's/^lib//'`
1786         ;;
1787     osf*)
1788         if test "$GCC" != "yes" ; then
1789           # compile something small: taint.c is fine for this.
1790           # the main point is the '-v' flag of 'cc'.
1791           case "`cc -v -I. -c main.c -o /tmp/main.o 2>&1`" in
1792           */gemc_cc*)   # we have the new DEC GEM CC
1793                         CFLAGS="$CFLAGS -oldc"
1794                         ;;
1795           *)            # we have the old MIPS CC
1796                         ;;
1797           esac
1798           # cleanup
1799           rm -f /tmp/main.o
1800           CFLAGS="$CFLAGS -std"
1801         fi
1802         ;;
1803     beos*)
1804         case "$target_cpu" in
1805         powerpc*)
1806             CFLAGS="$CFLAGS -relax_pointers"
1807             ;;
1808         esac
1809         ;;
1810     cygwin*|mingw*)
1811         LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
1812         case "$target_os" in
1813         cygwin*)
1814             if test x"$enable_shared" = xyes; then
1815                 LIBRUBY_SO='cyg$(RUBY_SO_NAME)'${MAJOR}${MINOR}${TEENY}.dll
1816             fi
1817             ;;
1818         mingw*)
1819             RUBY_SO_NAME=${rb_cv_msvcrt}-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}${TEENY}
1820             if test x"$enable_shared" = xyes; then
1821                 LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
1822                 LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
1823             fi
1824             AC_LIBOBJ([win32])
1825             COMMON_LIBS=m
1826 #           COMMON_MACROS="WIN32_LEAN_AND_MEAN="
1827             COMMON_HEADERS="winsock2.h windows.h"
1828             THREAD_MODEL=win32
1829             ;;
1830         esac
1831         LIBRUBY_ALIASES=''
1832         FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
1833         SOLIBS='$(LIBS)'
1834         if test x"$enable_shared" = xyes; then
1835             LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
1836         else
1837             LIBRUBY_SO=dummy
1838             LIBRUBY='lib$(RUBY_SO_NAME).a'
1839             LIBRUBYARG='-l$(RUBY_SO_NAME)'
1840         fi
1841         MINIDLNOBJ=dmydln.o
1842         ;;
1843     hpux*)
1844         case "$YACC" in
1845           *yacc*)
1846             XCFLAGS="$XCFLAGS -DYYMAXDEPTH=300"
1847             YACC="$YACC -Nl40000 -Nm40000"
1848             ;;
1849         esac
1850         MINIDLNOBJ=dmydln.o
1851         ;;
1852     *msdosdjgpp*)
1853         FIRSTMAKEFILE=GNUmakefile:djgpp/GNUmakefile.in
1854         ;;
1855     *)
1856         ;;
1857 esac
1858 MINIOBJS="$MINIDLNOBJ"
1860 case "$FIRSTMAKEFILE" in
1861 dnl (
1862 *GNUmakefile:*)
1863     gnumake=yes
1864     ;;
1865 dnl (
1867     AC_MSG_CHECKING([for if ${MAKE-make} is GNU make])
1868     mkdir conftest.dir
1869     echo "all:; @echo yes" > conftest.dir/GNUmakefile
1870     echo "all:; @echo no" > conftest.dir/Makefile
1871     gnumake=`(cd conftest.dir; ${MAKE-make})`
1872     rm -fr conftest.dir
1873     case "$gnumake" in
1874     dnl (
1875     *yes*)
1876         echo "include Makefile" > GNUmakefile
1877         echo "include uncommon.mk" >> GNUmakefile
1878         gnumake=yes;;
1879     dnl (
1880     *)
1881         gnumake=no;;
1882     esac
1883     AC_MSG_RESULT($gnumake)
1884     ;;
1885 esac
1887 CPPFLAGS="$CPPFLAGS "'$(DEFS)'
1888 test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
1889 cflagspat=`eval echo '"'"${cflags}"'"' | sed 's/[][|.*]/\\&/g'`
1890 CFLAGS=`echo "$CFLAGS" | sed "s|$cflagspat"'|${cflags}|'`
1891 cxxflagspat=`eval echo '"'"${cxxflags}"'"' | sed 's/[][|.*]/\\&/g'`
1892 CXXFLAGS=`echo "$CXXFLAGS" | sed "s|$cxxflagspat"'|${cxxflags}|'`
1893 AC_SUBST(cppflags, [])dnl
1894 AC_SUBST(cflags, ['${optflags} ${debugflags} ${warnflags}'])dnl
1895 AC_SUBST(optflags)dnl
1896 AC_SUBST(debugflags)dnl
1897 AC_SUBST(warnflags)dnl
1898 AC_SUBST(XCFLAGS)dnl
1899 AC_SUBST(XLDFLAGS)dnl
1900 AC_SUBST(LIBRUBY_LDSHARED)
1901 AC_SUBST(LIBRUBY_DLDFLAGS)
1902 AC_SUBST(RUBY_INSTALL_NAME)
1903 AC_SUBST(rubyw_install_name)
1904 AC_SUBST(RUBYW_INSTALL_NAME)
1905 AC_SUBST(RUBY_SO_NAME)
1906 AC_SUBST(LIBRUBY_A)
1907 AC_SUBST(LIBRUBY_SO)
1908 AC_SUBST(LIBRUBY_ALIASES)
1909 AC_SUBST(LIBRUBY)
1910 AC_SUBST(LIBRUBYARG)
1911 AC_SUBST(LIBRUBYARG_STATIC)
1912 AC_SUBST(LIBRUBYARG_SHARED)
1913 AC_SUBST(SOLIBS)
1914 AC_SUBST(DLDLIBS)
1915 AC_SUBST(ENABLE_SHARED)
1916 AC_SUBST(MAINLIBS)
1917 AC_SUBST(COMMON_LIBS)
1918 AC_SUBST(COMMON_MACROS)
1919 AC_SUBST(COMMON_HEADERS)
1920 AC_SUBST(EXPORT_PREFIX)
1921 AC_SUBST(MINIOBJS)
1922 AC_SUBST(THREAD_MODEL)
1924 MAKEFILES="Makefile `echo $FIRSTMAKEFILE | sed 's/:.*//'`"
1925 MAKEFILES="`echo $MAKEFILES`"
1926 AC_SUBST(MAKEFILES)
1928 ri_prefix=
1929 test "$program_prefix" != NONE &&
1930   ri_prefix=$program_prefix
1932 ri_suffix=
1933 test "$program_suffix" != NONE &&
1934   ri_suffix=$program_suffix
1936 RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
1937 case "$target_os" in
1938   cygwin*|mingw*)
1939     RUBYW_INSTALL_NAME="${ri_prefix}rubyw${ri_suffix}"
1940     rubyw_install_name="$RUBYW_INSTALL_NAME"
1941     ;;
1942 esac
1943 RUBY_LIB_PREFIX=`eval echo \\"${libdir}/ruby\\"`
1945 AC_ARG_WITH(ruby-version,
1946             [  --with-ruby-version=STR ruby version string for version specific directories [[full]] (full|minor|STR)],
1947             [ruby_version=$withval],
1948             [ruby_version=full])
1949 case "$ruby_version" in
1950   full)
1951     ruby_version="${MAJOR}.${MINOR}.${TEENY}"
1952     ;;
1953   minor)
1954     ruby_version="${MAJOR}.${MINOR}"
1955     ;;
1956 esac
1958 AC_ARG_WITH(sitedir,
1959             [  --with-sitedir=DIR      site libraries in DIR [[LIBDIR/ruby/site_ruby]]],
1960             [sitedir=$withval],
1961             [sitedir='${libdir}/ruby/site_ruby'])
1962 SITE_DIR=`eval echo \\"${sitedir}\\"`
1964 AC_ARG_WITH(vendordir,
1965             [  --with-vendordir=DIR    vendor libraries in DIR [[LIBDIR/ruby/vendor_ruby]]],
1966             [vendordir=$withval],
1967             [vendordir='${libdir}/ruby/vendor_ruby'])
1968 VENDOR_DIR=`eval echo \\"${vendordir}\\"`
1970 case "$target_os" in
1971   cygwin*|mingw*|*djgpp*|os2-emx*)
1972     RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
1973     RUBY_SITE_LIB_PATH="`eval echo "$SITE_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
1974     RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
1975     ;;
1976   *)
1977     RUBY_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
1978     RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
1979     RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
1980     ;;
1981 esac
1982 RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${ruby_version}"
1983 RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${ruby_version}"
1984 RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${ruby_version}"
1986 AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
1987 AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
1988 AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
1989 AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, "${RUBY_VENDOR_LIB_PATH}")
1990 AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, "${RUBY_VENDOR_LIB_PATH2}")
1992 AC_SUBST(arch)dnl
1993 AC_SUBST(sitearch)dnl
1994 AC_SUBST(ruby_version)dnl
1995 AC_SUBST(sitedir)dnl
1996 AC_SUBST(vendordir)dnl
1998 configure_args=$ac_configure_args
1999 AC_SUBST(configure_args)dnl
2001 if test "$fat_binary" != no ; then
2002     arch="fat-${target_os}"
2004     AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB,
2005                  "${RUBY_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
2007     AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
2008                  "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
2009     AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB,
2010                  "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
2011     AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
2012 else
2013     arch="${target_cpu}-${target_os}"
2014     AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
2017 case "$target_os" in
2018   mingw*) sitearch="$target_cpu-$rb_cv_msvcrt" ;;
2019   *) sitearch="${arch}" ;;
2020 esac
2022 AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}")
2023 AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
2024 AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, "${RUBY_VENDOR_LIB_PATH2}/${sitearch}")
2026 AC_ARG_WITH(search-path,
2027                 [  --with-search-path=DIR specify the additional search path],
2028                 [search_path=$withval])
2029 if test "$search_path" != ""; then
2030     AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
2033 AC_ARG_WITH(rubyhdrdir,
2034             [  --with-ruby-hdrdir=DIR  core headers in DIR [INCLUDEDIR]],
2035             [rubyhdrdir=$withval],
2036             [rubyhdrdir='${includedir}/ruby-${ruby_version}'])
2038 AC_ARG_WITH(sitehdrdir,
2039             [  --with-site-hdrdir=DIR  core headers in DIR [INCLUDEDIR]],
2040             [sitehdrdir=$withval],
2041             [sitehdrdir='${rubyhdrdir}/site_ruby'])
2043 AC_ARG_WITH(vendorhdrdir,
2044             [  --with-vendor-hdrdir=DIR core headers in DIR [INCLUDEDIR]],
2045             [vendorhdrdir=$withval],
2046             [vendorhdrdir='${rubyhdrdir}/vendor_ruby'])
2048 AC_SUBST(rubyhdrdir)dnl
2049 AC_SUBST(sitehdrdir)dnl
2050 AC_SUBST(vendorhdrdir)dnl
2052 AC_ARG_WITH(mantype,
2053                 [  --with-mantype=TYPE specify man page type; TYPE is one of man and doc],
2054                 [
2055                         case "$withval" in
2056                         man|doc)
2057                                 MANTYPE=$withval
2058                                 ;;
2059                         *)
2060                                 AC_MSG_ERROR(invalid man type: $withval)
2061                                 ;;
2062                         esac
2063                 ])
2064 if test -z "$MANTYPE"; then
2065         AC_PATH_PROGS(NROFF, nroff awf, /bin/false, "/usr/bin:/usr/ucb")
2066         if ${NROFF} -mdoc ${srcdir}/ruby.1 >/dev/null 2>&1; then
2067                 MANTYPE=doc
2068         else
2069                 MANTYPE=man
2070         fi
2072 AC_SUBST(MANTYPE)
2074 arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
2075 $MAKEDIRS "${arch_hdrdir}"
2076 config_h="${arch_hdrdir}/config.h"
2077 if test -f "${config_h}" && tr -d '\015' < confdefs.h | cmp -s "${config_h}" -; then
2078   echo "config.h unchanged"
2079 else
2080   echo "creating config.h"
2081   tr -d '\015' < confdefs.h > "${config_h}"
2083 tr -d '\015' < largefile.h > confdefs.h
2084 rm largefile.h
2086 BUILTIN_ENCS=["`sed -n -e '/^BUILTIN_ENCS[      ]*=/{' \
2087         -e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
2088         -e '}' "${srcdir}/enc/Makefile.in"`"]
2089 BUILTIN_ENCOBJS=
2090 for e in $BUILTIN_ENCS; do BUILTIN_ENCOBJS="$BUILTIN_ENCOBJS `basename $e .c`"'.$(OBJEXT)'; done
2091 AC_SUBST(BUILTIN_ENCOBJS)
2093 AC_CONFIG_FILES($FIRSTMAKEFILE)
2094 AC_CONFIG_FILES(Makefile, [{
2095         sed '/^MISSING/s/\$U\././g' Makefile
2096         echo; test x"$EXEEXT" = x || echo 'miniruby: miniruby$(EXEEXT)'
2097         test "$RUBY_INSTALL_NAME$EXEEXT" = ruby || echo 'ruby: $(PROGRAM);'
2098         if test "$gnumake" != yes; then
2099             echo ['$(MKFILES): $(srcdir)/common.mk']
2100             sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
2101         fi
2102       } >> confmk$$.tmp && mv -f confmk$$.tmp Makefile],
2103 [RUBY_INSTALL_NAME=$RUBY_INSTALL_NAME EXEEXT=$EXEEXT gnumake=$gnumake])
2104 AC_OUTPUT