1
diff -ruN ruby-1.8.5.orig/configure.in ruby-1.8.5/configure.in
2
--- ruby-1.8.5.orig/configure.in 2006-08-08 11:37:43.000000000 +0900
3
+++ ruby-1.8.5/configure.in 2006-09-19 15:39:46.000000000 +0900
5
AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
8
+AC_ARG_WITH(extra-site-search-path,
9
+ [ --with-extra-site-search-path=DIR specify the extra site search path],
10
+ [extra_site_search_path=$withval])
11
+if test "$extra_site_search_path" != ""; then
12
+ AC_DEFINE_UNQUOTED(RUBY_EXTRA_SITE_SEARCH_PATH,"$extra_site_search_path")
14
+AC_ARG_WITH(extra-search-path,
15
+ [ --with--site-search-path=DIR specify the extra search path],
16
+ [extra_search_path=$withval])
17
+if test "$extra_search_path" != ""; then
18
+ AC_DEFINE_UNQUOTED(RUBY_EXTRA_SEARCH_PATH,"$extra_search_path")
22
[ --with-mantype=TYPE specify man page type; TYPE is one of man and doc],
24
diff -ruN ruby-1.8.5.orig/configure.in.orig ruby-1.8.5/configure.in.orig
25
--- ruby-1.8.5.orig/configure.in.orig 1970-01-01 09:00:00.000000000 +0900
26
+++ ruby-1.8.5/configure.in.orig 2006-08-08 11:37:43.000000000 +0900
28
+dnl Process this file with autoconf to produce a configure script.
33
+AC_DEFUN([RUBY_MINGW32],
36
+AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
41
+], rb_cv_mingw32=yes,rb_cv_mingw32=no)
43
+test "$rb_cv_mingw32" = yes && target_os="mingw32"
47
+AC_DEFUN([RUBY_CPPOUTFILE],
48
+[AC_CACHE_CHECK(whether ${CPP} accepts -o, rb_cv_cppoutfile,
50
+CPPFLAGS='-o conftest.i'
51
+AC_TRY_CPP([], rb_cv_cppoutfile=yes, rb_cv_cppoutfile=no)
54
+if test "$rb_cv_cppoutfile" = yes; then
55
+ CPPOUTFILE='-o conftest.i'
56
+elif test "$rb_cv_cppoutfile" = no; then
57
+ CPPOUTFILE='> conftest.i'
58
+elif test -n "$rb_cv_cppoutfile"; then
59
+ CPPOUTFILE="$rb_cv_cppoutfile"
61
+AC_SUBST(CPPOUTFILE)])
63
+AC_DEFUN([RUBY_PROG_GNU_LD],
64
+[AC_CACHE_CHECK(whether the linker is GNU ld, rb_cv_prog_gnu_ld,
65
+[if `$CC $CFLAGS $CPPFLAGS $LDFLAGS --print-prog-name=ld 2>&1` -v 2>&1 | grep "GNU ld" > /dev/null; then
66
+ rb_cv_prog_gnu_ld=yes
68
+ rb_cv_prog_gnu_ld=no
71
+GNU_LD=$rb_cv_prog_gnu_ld
74
+rb_version=`grep RUBY_VERSION $srcdir/version.h`
75
+MAJOR=`expr "$rb_version" : '#define RUBY_VERSION "\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*"'`
76
+MINOR=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*"'`
77
+TEENY=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)"'`
81
+dnl checks for alternative programs
82
+AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [
91
+dnl If the user switches compilers, we can't believe the cache
92
+if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
94
+ AC_MSG_ERROR(cached CC is different -- throw away $cache_file
95
+(it is also a good idea to do 'make clean' before compiling))
98
+if test "$program_prefix" = NONE; then
102
+target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
103
+ac_install_sh='' # unusable for extension libraries.
105
+dnl checks for fat-binary
106
+AC_ARG_ENABLE(fat-binary,
107
+ [ --enable-fat-binary=ARCHS
108
+ build an Apple/NeXT Multi Architecture Binary (MAB);
109
+ ARCHS is a comma-delimited list of architectures for
110
+ which to build; if ARCHS is omitted, then the package
111
+ will be built for all architectures supported by the
112
+ platform ("ppc" for MacOS/X and Darwin; "ppc,i386"
113
+ for Rhapsody; "m68k,i386,sparc" for OpenStep;
114
+ "m68k,i386,sparc,hppa" for NextStep); if this option
115
+ is disabled or omitted entirely, then the package
116
+ will be built only for the target platform],
117
+ [fat_binary=$enableval], [fat_binary=no])
118
+if test "$fat_binary" != no; then
120
+ AC_MSG_CHECKING([target architectures])
122
+ # Respect TARGET_ARCHS setting from environment if available.
123
+ if test -z "$TARGET_ARCHS"; then
124
+ # Respect ARCH given to --enable-fat-binary if present.
125
+ if test "$fat_binary" != yes; then
126
+ TARGET_ARCHS=`echo "$fat_binary" | tr ',' ' '`
128
+ # Choose a default set of architectures based upon platform.
129
+ case "$target_os" in
134
+ TARGET_ARCHS="ppc i386"
137
+ TARGET_ARCHS="m68k i386 sparc"
140
+ TARGET_ARCHS="m68k i386 sparc hppa"
143
+ TARGET_ARCHS=`arch`
148
+ AC_MSG_RESULT([$TARGET_ARCHS])
150
+ # /usr/lib/arch_tool -archify_list $TARGET_ARCHS
152
+ for archs in $TARGET_ARCHS
154
+ ARCH_FLAG="$ARCH_FLAG -arch $archs"
156
+ AC_DEFINE(NEXT_FAT_BINARY)
160
+ i?86) frame_address=yes;;
161
+ *) frame_address=no;;
163
+AC_ARG_ENABLE(frame-address,
164
+ [ --enable-frame-address use GCC __builtin_frame_address(). ],
165
+ [frame_address=$enableval])
166
+if test $frame_address = yes; then
167
+ AC_DEFINE(USE_BUILTIN_FRAME_ADDRESS)
172
+dnl Checks for programs.
174
+if test x"${build}" != x"${host}"; then
175
+ AC_CHECK_TOOL(CC, gcc)
178
+AC_PROG_GCC_TRADITIONAL
189
+if test "$YACC" = "yacc"; then
190
+ AC_DEFINE([OLD_YACC])
193
+AC_CHECK_TOOL(RANLIB, ranlib, :)
194
+AC_CHECK_TOOL(AR, ar)
195
+if test -z "$AR"; then
196
+ AC_CHECK_PROGS(AR, aal, ar)
199
+AC_CHECK_TOOL(AS, as)
203
+case "$target_os" in
205
+ AC_CHECK_TOOL(NM, nm)
206
+ AC_CHECK_TOOL(WINDRES, windres)
207
+ AC_CHECK_TOOL(DLLWRAP, dllwrap)
208
+ target_cpu=`echo $target_cpu | sed s/i.86/i386/`
209
+ case "$target_os" in
211
+ test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
212
+ AC_CHECK_TOOL(OBJDUMP, objdump)
213
+ AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
214
+ AC_TRY_LINK([#include <stdio.h>],
215
+ [FILE* volatile f = stdin; return 0;],
216
+ [rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
218
+ sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
219
+ [rb_cv_msvcrt=msvcrt])
220
+ test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
221
+ AC_ARG_WITH(winsock2,
222
+ [ --with-winsock2 link winsock2 (MinGW only)], [
224
+ yes) with_winsock2=yes;;
225
+ *) with_winsock2=no;;
226
+ esac], [with_winsock2=no])
227
+ if test "$with_winsock2" = yes; then
228
+ AC_DEFINE(USE_WINSOCK2)
231
+ : ${enable_shared=yes}
234
+ AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)
237
+ # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
238
+ AC_DEFINE(__HIUX_MPP__)
246
+# checks for UNIX variants that set C preprocessor variables
250
+AC_SUBST(RM, ['rm -f'])
251
+AC_SUBST(CP, ['cp'])
252
+if $as_mkdir_p; then
253
+ AC_SUBST(MAKEDIRS, ['mkdir -p'])
255
+ AC_SUBST(MAKEDIRS, ['install -d'])
258
+dnl check for large file stuff
261
+AC_CHECK_TYPES([long long, off_t])
263
+AC_CHECK_SIZEOF(int, 4)
264
+AC_CHECK_SIZEOF(short, 2)
265
+AC_CHECK_SIZEOF(long, 4)
266
+AC_CHECK_SIZEOF(long long, 0)
267
+AC_CHECK_SIZEOF(__int64, 0)
268
+AC_CHECK_SIZEOF(off_t, 0)
269
+AC_CHECK_SIZEOF(void*, 4)
270
+AC_CHECK_SIZEOF(float, 4)
271
+AC_CHECK_SIZEOF(double, 8)
272
+AC_CHECK_SIZEOF(time_t, 0)
274
+for id in pid_t gid_t uid_t; do
275
+ AC_CHECK_TYPE($id, [typ=$id], [typ=int])
276
+ AC_DEFINE_UNQUOTED(rb_$id, $typ)
279
+AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
280
+ [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
281
+ rb_cv_have_prototypes=yes,
282
+ rb_cv_have_prototypes=no)])
283
+if test "$rb_cv_have_prototypes" = yes; then
284
+ AC_DEFINE(HAVE_PROTOTYPES)
287
+AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste,
288
+ [AC_TRY_COMPILE([#define paste(a,b) a##b],
289
+ [int xy = 1; return paste(x,y);],
290
+ rb_cv_tokenpaste=ansi,
291
+ rb_cv_tokenpaste=knr)])
292
+if test "$rb_cv_tokenpaste" = ansi; then
293
+ AC_DEFINE(TOKEN_PASTE(x,y),[x##y])
295
+ AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y])
298
+AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg,
301
+int foo(int x, ...) {
305
+ va_arg(va, char *);
306
+ va_arg(va, double);
309
+], [return foo(10, "", 3.14);],
312
+if test "$rb_cv_stdarg" = yes; then
313
+ AC_DEFINE(HAVE_STDARG_PROTOTYPES)
316
+AC_CACHE_CHECK([for noreturn], rb_cv_noreturn,
318
+for mac in "x __attribute__ ((noreturn))" "__declspec(noreturn) x" x; do
320
+ [#define NORETURN(x) $mac
321
+NORETURN(void exit(int x));],
323
+ [rb_cv_noreturn="$mac"; break])
325
+AC_DEFINE_UNQUOTED([NORETURN(x)], $rb_cv_noreturn)
327
+AC_CACHE_CHECK([for RUBY_EXTERN], rb_cv_ruby_extern,
328
+[rb_cv_ruby_extern=no
329
+for mac in "__attribute__((dllimport))" "__declspec(dllimport)"; do
331
+ [extern $mac void conftest(void);],
332
+ [rb_cv_ruby_extern="extern $mac"; break])
334
+test "x$rb_cv_ruby_extern" = xno || AC_DEFINE_UNQUOTED(RUBY_EXTERN, $rb_cv_ruby_extern)
336
+XCFLAGS="$XCFLAGS -DRUBY_EXPORT"
338
+dnl Check whether we need to define sys_nerr locally
339
+AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
340
+#include <errno.h>])
342
+dnl whether link libc_r or not
344
+ [ --with-libc_r link libc_r if possible (FreeBSD only)], [
346
+ yes) with_libc_r=yes;;
347
+ *) with_libc_r=no;;
348
+ esac], [with_libc_r=no])
350
+AC_ARG_ENABLE(pthread,
351
+ [ --enable-pthread use pthread library.],
352
+ [enable_pthread=$enableval], [enable_pthread=no])
354
+dnl Checks for libraries.
355
+case "$target_os" in
359
+darwin*) LIBS="-lobjc $LIBS";;
360
+hpux*) LIBS="-lm $LIBS"
361
+ ac_cv_c_inline=no;;
362
+human*) ac_cv_func_getpgrp_void=yes
363
+ ac_cv_func_setitimer=no
365
+beos*) ac_cv_func_link=no;;
366
+cygwin*) rb_cv_have_daylight=no
367
+ ac_cv_var_tzname=no
368
+ ac_cv_func__setjmp=no
369
+ ac_cv_func_setitimer=no
371
+mingw*) if test "$with_winsock2" = yes; then
372
+ LIBS="-lws2_32 $LIBS"
374
+ LIBS="-lwsock32 $LIBS"
376
+ ac_cv_header_a_out_h=no
377
+ ac_cv_header_pwd_h=no
378
+ ac_cv_header_utime_h=no
379
+ ac_cv_header_sys_ioctl_h=no
380
+ ac_cv_header_sys_param_h=no
381
+ ac_cv_header_sys_resource_h=no
382
+ ac_cv_header_sys_select_h=no
383
+ ac_cv_header_sys_time_h=no
384
+ ac_cv_header_sys_times_h=no
385
+ ac_cv_func_times=yes
386
+ ac_cv_func_waitpid=yes
387
+ ac_cv_func_fsync=yes
388
+ ac_cv_func_vsnprintf=yes
389
+ ac_cv_func_seekdir=yes
390
+ ac_cv_func_telldir=yes
391
+ ac_cv_func_isinf=yes
392
+ ac_cv_func_isnan=yes
393
+ ac_cv_func_finite=yes
394
+ ac_cv_func_link=yes
395
+ ac_cv_lib_crypt_crypt=no
396
+ ac_cv_func_getpgrp_void=no
397
+ ac_cv_func_setpgrp_void=yes
398
+ ac_cv_func_memcmp_working=yes
399
+ ac_cv_lib_dl_dlopen=no
400
+ rb_cv_binary_elf=no
401
+ rb_cv_negative_time_t=no
404
+os2-emx*) LIBS="-lm $LIBS"
405
+ ac_cv_lib_dir_opendir=no;;
406
+msdosdjgpp*) LIBS="-lm $LIBS"
407
+ ac_cv_func_getpgrp_void=yes
408
+ ac_cv_func_setitimer=no
409
+ ac_cv_sizeof_rlim_t=4
411
+bsdi*) LIBS="-lm $LIBS"
412
+ ac_cv_sizeof_rlim_t=8;;
413
+freebsd*) LIBS="-lm $LIBS"
414
+ AC_CACHE_CHECK([whether -lxpg4 has to be linked],
415
+ rb_cv_lib_xpg4_needed,
417
+#include <osreldate.h>
418
+#if __FreeBSD_version < 400020 || \
419
+ (__FreeBSD_version >= 500000 && __FreeBSD_version < 500005)
420
+#error needs libxpg4
423
+ rb_cv_lib_xpg4_needed=no,
424
+ rb_cv_lib_xpg4_needed=yes,
425
+ rb_cv_lib_xpg4_needed=yes)])
426
+ if test "$rb_cv_lib_xpg4_needed" = yes; then
427
+ AC_CHECK_LIB(xpg4, setlocale)
429
+ if test "$with_libc_r" = yes; then
430
+ AC_CACHE_CHECK([whether libc_r is supplementary to libc],
431
+ rb_cv_supplementary_lib_c_r,
433
+#include <osreldate.h>
434
+#if 500016 <= __FreeBSD_version
435
+#error libc_r is supplementary to libc
438
+ rb_cv_supplementary_lib_c_r=no,
439
+ rb_cv_supplementary_lib_c_r=yes,
440
+ rb_cv_supplementary_lib_c_r=yes)])
441
+ if test "$rb_cv_supplementary_lib_c_r" = yes; then
442
+ MAINLIBS="-lc_r $MAINLIBS"
446
+dragonfly*) LIBS="-lm $LIBS"
448
+bow) ac_cv_func_setitimer=no
450
+superux*) ac_cv_func_setitimer=no
452
+solaris*2.10) if test -z "$GCC"; then
453
+ ac_cv_func_isinf=yes
457
+*) LIBS="-lm $LIBS";;
459
+AC_CHECK_LIB(crypt, crypt)
460
+AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
461
+AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
463
+case "$target_cpu" in
464
+alpha*) case "$target_os"::"$GCC" in
465
+ *::yes) CFLAGS="-mieee $CFLAGS" ;; # gcc
466
+ osf*) CFLAGS="-ieee $CFLAGS" ;; # ccc
470
+dnl Checks for header files.
474
+AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h sys/syscall.h\
475
+ fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
476
+ syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
477
+ sys/mkdev.h sys/utime.h netinet/in_systm.h float.h ieeefp.h pthread.h \
478
+ ucontext.h intrinsics.h)
480
+dnl Check additional types.
481
+AC_CHECK_SIZEOF(rlim_t, 0, [
482
+ #ifdef HAVE_SYS_TYPES_H
483
+ # include <sys/types.h>
485
+ #ifdef HAVE_SYS_TIME_H
486
+ # include <sys/time.h>
488
+ #ifdef HAVE_SYS_RESOURCE_H
489
+ # include <sys/resource.h>
491
+ #ifdef HAVE_UNISTD_H
492
+ # include <unistd.h>
497
+dnl Checks for typedefs, structures, and compiler characteristics.
499
+AC_STRUCT_ST_BLKSIZE
503
+dnl Checks for library functions.
509
+AC_CHECK_FUNCS(ftello)
510
+AC_REPLACE_FUNCS(dup2 memmove strcasecmp strncasecmp strerror strftime\
511
+ strchr strstr strtoul crypt flock vsnprintf\
512
+ isnan finite isinf hypot acosh erf)
513
+AC_CHECK_FUNCS(fmod killpg wait4 waitpid syscall chroot fsync getcwd eaccess\
514
+ truncate chsize times utimes fcntl lockf lstat symlink link\
515
+ readlink setitimer setruid seteuid setreuid setresuid\
516
+ setproctitle setrgid setegid setregid setresgid issetugid pause\
517
+ lchown lchmod getpgrp setpgrp getpgid setpgid initgroups\
518
+ getgroups setgroups getpriority getrlimit setrlimit sysconf\
519
+ dlopen sigprocmask\
520
+ sigaction _setjmp setsid telldir seekdir fchmod mktime timegm\
521
+ cosh sinh tanh setuid setgid setenv unsetenv)
522
+AC_ARG_ENABLE(setreuid,
523
+ [ --enable-setreuid use setreuid()/setregid() according to need even if obsolete.],
524
+ [use_setreuid=$enableval])
525
+if test "$use_setreuid" = yes; then
526
+ AC_DEFINE(USE_SETREUID)
527
+ AC_DEFINE(USE_SETREGID)
530
+AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
531
+ [AC_TRY_COMPILE([#include <time.h>],
532
+ [struct tm t; t.tm_gmtoff = 3600;],
533
+ [rb_cv_member_struct_tm_tm_gmtoff=yes],
534
+ [rb_cv_member_struct_tm_tm_gmtoff=no])])
535
+if test "$rb_cv_member_struct_tm_tm_gmtoff" = yes; then
536
+ AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF)
538
+AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
539
+ [AC_TRY_LINK([#include <time.h>
542
+ rb_cv_have_daylight=yes,
543
+ rb_cv_have_daylight=no)])
544
+if test "$rb_cv_have_daylight" = yes; then
545
+ AC_DEFINE(HAVE_DAYLIGHT)
547
+AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t,
552
+check(tm, y, m, d, h, s)
557
+ tm->tm_year != y ||
558
+ tm->tm_mon != m-1 ||
559
+ tm->tm_mday != d ||
560
+ tm->tm_hour != h ||
572
+ check(gmtime(&t), 69, 12, 31, 23, 59);
573
+ t = ~(time_t)0 << 31;
574
+ check(gmtime(&t), 1, 12, 13, 20, 52);
578
+ rb_cv_negative_time_t=yes,
579
+ rb_cv_negative_time_t=no,
580
+ rb_cv_negative_time_t=yes)])
581
+if test "$rb_cv_negative_time_t" = yes; then
582
+ AC_DEFINE(NEGATIVE_TIME_T)
585
+if test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = yes; then
586
+ AC_DEFINE(POSIX_SIGNAL)
588
+ AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal,
602
+ signal(SIGINT, sig_handler);
603
+ kill(getpid(), SIGINT);
604
+ kill(getpid(), SIGINT);
608
+ rb_cv_bsd_signal=yes,
609
+ rb_cv_bsd_signal=no,
610
+ rb_cv_bsd_signal=no)])
611
+ if test "$rb_cv_bsd_signal" = yes; then
612
+ AC_DEFINE(BSD_SIGNAL)
625
+AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign,
635
+ rb_cv_rshift_sign=yes,
636
+ rb_cv_rshift_sign=no,
637
+ rb_cv_rshift_sign=yes)])
638
+if test "$rb_cv_rshift_sign" = yes; then
639
+ AC_DEFINE(RSHIFT(x,y), ((x)>>(int)y))
641
+ AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>y) : (x)>>y))
644
+AC_MSG_CHECKING(read count field in FILE structures)
645
+AC_CACHE_VAL(rb_cv_fcnt,
651
+ _rcount dnl for emx0.9c
653
+ AC_TRY_COMPILE([#include <stdio.h>
655
+ [FILE *f = stdin; f->$fcnt = 0;],
656
+ rb_cv_fcnt="$fcnt"; break,
657
+ rb_cv_fcnt="not found")
659
+if test "$rb_cv_fcnt" = "not found"; then
660
+ AC_MSG_RESULT([not found(OK if using GNU libc)])
662
+ AC_MSG_RESULT($rb_cv_fcnt)
663
+ AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)
666
+AC_MSG_CHECKING(read buffer ptr field in FILE structures)
667
+AC_CACHE_VAL(rb_cv_frptr,
675
+ AC_TRY_COMPILE([#include <stdio.h>
677
+ [FILE *f = stdin; char buf[256]; f->$frptr = buf;],
678
+ rb_cv_frptr="$frptr"; break,
679
+ rb_cv_frptr="not found")
681
+if test "$rb_cv_frptr" = "not found"; then
682
+ AC_MSG_RESULT([not found])
684
+ AC_MSG_RESULT($rb_cv_frptr)
685
+ AC_DEFINE_UNQUOTED(FILE_READPTR, $rb_cv_frptr)
687
+ if test "$rb_cv_fcnt" = "not found"; then
688
+ AC_MSG_CHECKING(read buffer end field in FILE structures)
689
+ AC_CACHE_VAL(rb_cv_frend,
694
+ AC_TRY_COMPILE([#include <stdio.h>
696
+ [FILE *f = stdin; char buf[256]; f->$frend = buf;],
697
+ rb_cv_frend="$frend"; break,
698
+ rb_cv_frend="not found")
700
+ if test "$rb_cv_frend" = "not found"; then
701
+ AC_MSG_RESULT([not found])
703
+ AC_MSG_RESULT($rb_cv_frend)
704
+ AC_DEFINE_UNQUOTED(FILE_READEND, $rb_cv_frend)
709
+AC_DEFUN([RUBY_CHECK_IO_NEED],
710
+[AC_CACHE_CHECK(whether need to [$1], [$2],
719
+#define before_seek(f) ]ifelse(index($2,flush_before_seek),-1,[fflush(f)],[(f,0)])[
720
+#define reset_rw(f) ]ifelse(index($2,seek_between_rw),-1,[do_seek(f,SEEK_CUR)],[(f,0)])[
721
+#define do_seek(f, w) (before_seek(f), fseek(f,0,w))
723
+char *fn = "conftest.dat";
724
+char *wombat = "wombat\n";
725
+char *koara = "koara\n";
726
+char *kangaroo = "kangaroo\n";
734
+ if (!(f = fopen(fn, "w+"))) return 1;
736
+ do_seek(f, SEEK_SET);
737
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
740
+ fputs(kangaroo, f);
741
+ do_seek(f, SEEK_SET);
742
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
743
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, koara)) goto fail;
744
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
745
+ do_seek(f, SEEK_SET);
746
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
750
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, koara+1)) goto fail;
751
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
752
+ do_seek(f, SEEK_SET);
753
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, wombat)) goto fail;
754
+ if (!fgets(buf, BUFSIZ, f) || buf[0] != 'X' || strcmp(buf+1, koara+1)) goto fail;
755
+ if (!fgets(buf, BUFSIZ, f) || strcmp(buf, kangaroo)) goto fail;
762
+], [$2]=no, [$2]=yes, [$2]=[$3])])])
763
+RUBY_CHECK_IO_NEED(seek between R/W, rb_cv_need_io_seek_between_rw, yes)
764
+if test "$rb_cv_need_io_seek_between_rw" = yes; then
765
+ AC_DEFINE(NEED_IO_SEEK_BETWEEN_RW, 1)
767
+dnl RUBY_CHECK_IO_NEED(flush before seek, rb_cv_need_io_flush_before_seek, no)
768
+dnl if test "$rb_cv_need_io_flush_before_seek" = yes; then
769
+dnl AC_DEFINE(NEED_IO_FLUSH_BEFORE_SEEK, 1)
772
+AC_CACHE_CHECK([whether st_ino is huge], rb_cv_huge_st_ino,
773
+[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([
774
+#include <sys/stat.h>
775
+struct stat test_stat;
776
+], [sizeof(test_stat.st_ino)>sizeof(long)])],
777
+rb_cv_huge_st_ino=yes,
778
+rb_cv_huge_st_ino=no)
780
+if test $rb_cv_huge_st_ino = yes; then
781
+ AC_DEFINE(HUGE_ST_INO)
784
+if test "$ac_cv_func_sysconf" = yes; then
785
+ AC_DEFUN([RUBY_CHECK_SYSCONF], [dnl
786
+ AC_CACHE_CHECK([whether _SC_$1 is supported], rb_cv_have_sc_[]m4_tolower($1),
787
+ [AC_TRY_COMPILE([#include <unistd.h>
790
+ rb_cv_have_sc_[]m4_tolower($1)=yes,
791
+ rb_cv_have_sc_[]m4_tolower($1)=no)
793
+ if test "$rb_cv_have_sc_[]m4_tolower($1)" = yes; then
794
+ AC_DEFINE(HAVE__SC_$1)
797
+ RUBY_CHECK_SYSCONF(CLK_TCK)
800
+case "$target_cpu" in
801
+m68*|i?86|ia64|sparc*|alpha*) rb_cv_stack_grow_dir=-1;;
802
+hppa*) rb_cv_stack_grow_dir=+1;;
804
+AC_CACHE_CHECK(stack growing direction, rb_cv_stack_grow_dir,
806
+/* recurse to get rid of inlining */
808
+stack_growup_p(addr, n)
809
+ volatile int *addr, n;
813
+ return *addr = stack_growup_p(addr, n - 1);
815
+ return (&end > addr);
820
+ return stack_growup_p(&x, 10);
822
+], rb_cv_stack_grow_dir=-1, rb_cv_stack_grow_dir=+1, rb_cv_stack_grow_dir=0)])
823
+AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $rb_cv_stack_grow_dir)
825
+if test x"$enable_pthread" = xyes; then
826
+ for pthread_lib in pthread pthreads c c_r; do
827
+ AC_CHECK_LIB($pthread_lib, pthread_kill,
828
+ rb_with_pthread=yes, rb_with_pthread=no)
829
+ if test "$rb_with_pthread" = "yes"; then break; fi
831
+ if test x"$rb_with_pthread" = xyes; then
832
+ AC_DEFINE(_REENTRANT)
833
+ AC_DEFINE(_THREAD_SAFE)
834
+ AC_DEFINE(HAVE_LIBPTHREAD)
835
+ case $pthread_lib in
839
+ MAINLIBS="-pthread $MAINLIBS"
842
+ LIBS="-l$pthread_lib $LIBS"
846
+ AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
848
+ AC_CHECK_FUNCS(nanosleep)
849
+ if test x"$ac_cv_func_nanosleep" = xno; then
850
+ AC_CHECK_LIB(rt, nanosleep)
851
+ if test x"$ac_cv_lib_rt_nanosleep" = xyes; then
852
+ AC_DEFINE(HAVE_NANOSLEEP)
856
+if test x"$ac_cv_header_ucontext_h" = xyes; then
857
+ if test x"$target_cpu" = xia64 -o x"$rb_with_pthread" = xyes; then
858
+ AC_CHECK_FUNCS(getcontext setcontext)
862
+dnl default value for $KANJI
863
+DEFAULT_KCODE="KCODE_NONE"
865
+AC_ARG_WITH(default-kcode,
866
+ [ --with-default-kcode=CODE specify default value for \$KCODE (utf8|euc|sjis|none)],
868
+ utf8) DEFAULT_KCODE="KCODE_UTF8";;
869
+ euc) DEFAULT_KCODE="KCODE_EUC";;
870
+ sjis) DEFAULT_KCODE="KCODE_SJIS";;
871
+ none) DEFAULT_KCODE="KCODE_NONE";;
872
+ *) AC_MSG_WARN($withval is not valid kcode; ignored);;
874
+AC_DEFINE_UNQUOTED(DEFAULT_KCODE, $DEFAULT_KCODE)
876
+dnl wheather use dln_a_out or not
877
+AC_ARG_WITH(dln-a-out,
878
+ [ --with-dln-a-out use dln_a_out if possible], [
880
+ yes) with_dln_a_out=yes;;
881
+ *) with_dln_a_out=no;;
882
+ esac], [with_dln_a_out=no])
884
+AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
886
+/* Test for whether ELF binaries are produced */
891
+ int i=open("conftest",O_RDONLY);
893
+ exit(1); /* fail */
894
+ if(read(i,&buffer[0],4)<4)
895
+ exit(1); /* fail */
896
+ if(buffer[0] != 127 || buffer[1] != 'E' ||
897
+ buffer[2] != 'L' || buffer[3] != 'F')
898
+ exit(1); /* fail */
899
+ exit(0); /* succeed (yes, it's ELF) */
902
+rb_cv_binary_elf=yes,
903
+rb_cv_binary_elf=no,
904
+rb_cv_binary_elf=yes)])
906
+if test "$rb_cv_binary_elf" = yes; then
910
+case "$target_os" in
911
+linux* | gnu* | k*bsd*-gnu | bsdi*)
912
+ if test "$rb_cv_binary_elf" = no; then
915
+ LDFLAGS="$LDFLAGS -rdynamic"
920
+AC_SUBST(DLDFLAGS)dnl
921
+AC_SUBST(ARCH_FLAG)dnl
924
+AC_SUBST(CCDLFLAGS)dnl
925
+AC_SUBST(LDSHARED)dnl
931
+: ${LIBPATHFLAG=' -L"%s"'}
934
+if test "$with_dln_a_out" != yes; then
935
+ rb_cv_dlopen=unknown
936
+ AC_MSG_CHECKING(whether OS depend dynamic link works)
937
+ if test "$GCC" = yes; then
938
+ case "$target_os" in
939
+ nextstep*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
940
+ openstep*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
941
+ rhapsody*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
942
+ darwin*) CCDLFLAGS="$CCDLFLAGS -fno-common";;
943
+ human*|bsdi*|beos*|cygwin*|mingw*|aix*|interix*) ;;
944
+ *) CCDLFLAGS="$CCDLFLAGS -fPIC";;
947
+ case "$target_os" in
948
+ hpux*) CCDLFLAGS="$CCDLFLAGS +Z";;
949
+ solaris*|irix*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
950
+ sunos*) CCDLFLAGS="$CCDLFLAGS -PIC" ;;
951
+ esix*|uxpds*) CCDLFLAGS="$CCDLFLAGS -KPIC" ;;
952
+ *) : ${CCDLFLAGS=""} ;;
956
+ case "$target_os" in
957
+ hpux*) DLDFLAGS="$DLDFLAGS -E"
958
+ : ${LDSHARED='ld -b'}
959
+ XLDFLAGS="$XLDFLAGS -Wl,-E"
960
+ : ${LIBPATHENV=SHLIB_PATH}
962
+ solaris*) if test "$GCC" = yes; then
963
+ : ${LDSHARED='$(CC) -shared'}
964
+ if test "$rb_cv_prog_gnu_ld" = yes; then
965
+ LDFLAGS="$LDFLAGS -Wl,-E"
968
+ : ${LDSHARED='ld -G'}
971
+ sunos*) : ${LDSHARED='ld -assert nodefinitions'}
973
+ irix*) : ${LDSHARED='ld -shared'}
975
+ sysv4*) : ${LDSHARED='ld -G'}
977
+ nto-qnx*) : ${LDSHARED="qcc -shared"}
978
+ rb_cv_dlopen=yes ;;
979
+ esix*|uxpds*) : ${LDSHARED="ld -G"}
980
+ rb_cv_dlopen=yes ;;
981
+ osf*) : ${LDSHARED="ld -shared -expect_unresolved \"*\""}
982
+ rb_cv_dlopen=yes ;;
983
+ bsdi3*) case "$CC" in
984
+ *shlicc*) : ${LDSHARED="$CC -r"}
985
+ rb_cv_dlopen=yes ;;
987
+ linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi*)
988
+ : ${LDSHARED='${CC} -shared'}
989
+ if test "$rb_cv_binary_elf" = yes; then
990
+ LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
992
+ rb_cv_dlopen=yes ;;
993
+ interix*) : ${LDSHARED="$CC -shared"}
994
+ XLDFLAGS="$XLDFLAGS -Wl,-E"
995
+ LIBPATHFLAG=" -L'%1\$-s'"
996
+ rb_cv_dlopen=yes ;;
997
+ freebsd*|dragonfly*) : ${LDSHARED="$CC -shared"}
998
+ if test "$rb_cv_binary_elf" = yes; then
999
+ LDFLAGS="$LDFLAGS -rdynamic"
1000
+ DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$(.TARGET)'
1002
+ test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable"
1004
+ rb_cv_dlopen=yes ;;
1005
+ openbsd*) : ${LDSHARED="\$(CC) -shared ${CCDLFLAGS}"}
1006
+ if test "$rb_cv_binary_elf" = yes; then
1007
+ LDFLAGS="$LDFLAGS -Wl,-E"
1009
+ rb_cv_dlopen=yes ;;
1010
+ nextstep*) : ${LDSHARED='cc -r -nostdlib'}
1011
+ LDFLAGS="$LDFLAGS -u libsys_s"
1012
+ rb_cv_dlopen=yes ;;
1013
+ openstep*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
1015
+ rb_cv_dlopen=yes ;;
1016
+ rhapsody*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'}
1018
+ rb_cv_dlopen=yes ;;
1019
+ darwin*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress -flat_namespace'}
1021
+ : ${LIBPATHENV=DYLD_LIBRARY_PATH}
1022
+ rb_cv_dlopen=yes ;;
1023
+ aix*) if test "$GCC" = yes; then
1024
+ : ${LDSHARED='gcc -shared'}
1025
+ DLDFLAGS='-Wl,-G -eInit_$(TARGET)'
1026
+ LDFLAGS='-Wl,-brtl -Wl,-bE:ruby.imp'
1028
+ : ${LDSHARED='/usr/ccs/bin/ld'}
1029
+ DLDFLAGS='-G -eInit_$(TARGET)'
1030
+ LDFLAGS="-brtl -bE:ruby.imp"
1032
+ : ${ARCHFILE="ruby.imp"}
1033
+ TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
1034
+ TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
1035
+ : ${LIBPATHENV=SHLIB_PATH}
1036
+ rb_cv_dlopen=yes ;;
1037
+ human*) : ${DLDFLAGS=''}
1040
+ : ${LINK_SO='ar cru $@ $(OBJS)'}
1041
+ rb_cv_dlopen=yes ;;
1042
+ beos*) case "$target_cpu" in
1044
+ : ${LDSHARED="ld -xms"}
1045
+ DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
1048
+ : ${LDSHARED="ld -shared"}
1049
+ DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lbe -lroot"
1052
+ : ${LIBPATHENV=LIBRARY_PATH}
1053
+ rb_cv_dlopen=yes ;;
1054
+ nto-qnx*) DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
1055
+ : ${LDSHARED='ld -Bshareable -x'}
1056
+ LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
1057
+ rb_cv_dlopen=yes;;
1058
+ cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
1059
+ XLDFLAGS="$XLDFLAGS -Wl,--stack,0x02000000"
1060
+ DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-import,--export-all"
1061
+ : ${LIBPATHENV=""}
1062
+ rb_cv_dlopen=yes ;;
1063
+ hiuxmpp) : ${LDSHARED='ld -r'} ;;
1064
+ atheos*) : ${LDSHARED="$CC -shared"}
1065
+ rb_cv_dlopen=yes ;;
1066
+ os2-emx*) LDFLAGS="$LDFLAGS -Zbsd-signals"
1068
+ *) : ${LDSHARED='ld'} ;;
1070
+ AC_MSG_RESULT($rb_cv_dlopen)
1072
+ AC_ARG_ENABLE(rpath,
1073
+ [ --disable-rpath embed run path into extension libraries.],
1074
+ [enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
1075
+ if test "$enable_rpath" = yes; then
1076
+ LIBPATHFLAG=" -L'%1\$-s'"
1077
+ if test "$GCC" = yes; then
1078
+ RPATHFLAG=" -Wl,-R'%1\$-s'"
1080
+ RPATHFLAG=" -R'%1\$-s'"
1085
+AC_SUBST(LIBPATHFLAG)
1086
+AC_SUBST(RPATHFLAG)
1087
+AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
1091
+if test "$ac_cv_header_a_out_h" = yes; then
1092
+ if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
1093
+ cat confdefs.h > config.h
1094
+ AC_CACHE_CHECK(whether matz's dln works, rb_cv_dln_a_out,
1096
+#define USE_DLN_A_OUT
1100
+ rb_cv_dln_a_out=yes,
1101
+ rb_cv_dln_a_out=no)])
1102
+ if test "$rb_cv_dln_a_out" = yes; then
1103
+ dln_a_out_works=yes
1104
+ AC_DEFINE(USE_DLN_A_OUT)
1109
+if test "$dln_a_out_works" = yes; then
1110
+ if test "$GCC" = yes; then
1116
+ AC_DEFINE(DLEXT, ".so")
1119
+ case "$target_os" in
1121
+ AC_DEFINE(DLEXT, ".sl");;
1122
+ nextstep*) DLEXT=bundle
1123
+ AC_DEFINE(DLEXT, ".bundle");;
1124
+ openstep*) DLEXT=bundle
1125
+ AC_DEFINE(DLEXT, ".bundle");;
1126
+ rhapsody*) DLEXT=bundle
1127
+ AC_DEFINE(DLEXT, ".bundle");;
1128
+ darwin*) DLEXT=bundle
1129
+ AC_DEFINE(DLEXT, ".bundle");;
1130
+ os2-emx*) DLEXT=dll
1131
+ AC_DEFINE(DLEXT, ".dll");;
1132
+ cygwin*|mingw*) DLEXT=so
1133
+ AC_DEFINE(DLEXT, ".so")
1135
+ AC_DEFINE(DLEXT2, ".dll");;
1137
+ AC_DEFINE(DLEXT, ".so");;
1142
+if test "$with_dln_a_out" = yes; then
1148
+case "$target_os" in
1149
+ linux* | gnu* | k*bsd*-gnu)
1150
+ STRIP='strip -S -x';;
1152
+ STRIP='strip -A -n';;
1154
+ STRIP='strip -A -n';;
1156
+ STRIP='strip -A -n';;
1158
+ STRIP='strip -A -n';;
1162
+AC_SUBST(EXTSTATIC)dnl
1163
+AC_ARG_WITH(static-linked-ext,
1164
+ [ --with-static-linked-ext link external modules statically],
1167
+ EXTSTATIC=static;;
1171
+case "$target_os" in
1173
+ AC_CHECK_LIB(signal, _harderr)
1174
+ AC_CHECK_LIB(hmem, hmemset)
1175
+ AC_CHECK_FUNCS(select gettimeofday)
1176
+ AC_CACHE_CHECK(whether PD libc _dtos18 fail to convert big number,
1177
+ rb_cv_missing__dtos18,
1179
+changequote(<<, >>)dnl
1185
+ sprintf (buf, "%g", 1e+300);
1186
+ exit (strcmp (buf, "1e+300") ? 0 : 1);
1189
+changequote([, ])dnl
1190
+rb_cv_missing__dtos18=yes, rb_cv_missing__dtos18=no, rb_cv_missing__dtos18=no)])
1191
+ if test "$rb_cv_missing__dtos18" = yes; then
1192
+ AC_DEFINE(MISSING__DTOS18)
1194
+ AC_CACHE_CHECK(whether PD libc fconvert fail to round,
1195
+ rb_cv_missing_fconvert,
1197
+changequote(<<, >>)dnl
1204
+ sprintf (buf, "%f", log(exp(1.0)));
1205
+ exit (strcmp (buf, "1.000000") ? 0 : 1);
1208
+changequote([, ])dnl
1209
+rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no)])
1210
+ if test "$rb_cv_missing_fconvert" = yes; then
1211
+ AC_DEFINE(MISSING_FCONVERT)
1213
+ AC_LIBOBJ([x68.o])
1214
+ CFLAGS="$CFLAGS -fansi-only"
1215
+ XCFLAGS="$XCFLAGS -cc1-stack=262144 -cpp-stack=2694144"
1220
+ dnl OS/2 environment w/ Autoconf 2.1x for EMX
1235
+if test "$prefix" = NONE; then
1236
+ prefix=$ac_default_prefix
1239
+#if test "$fat_binary" != no ; then
1240
+# CFLAGS="$CFLAGS $ARCH_FLAG"
1243
+if test x"$cross_compiling" = xyes; then
1244
+ test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
1246
+ RUNRUBY='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
1248
+ MINIRUBY='./miniruby$(EXEEXT)'
1249
+ PREP='miniruby$(EXEEXT)'
1250
+ RUNRUBY='$(MINIRUBY) $(srcdir)/runruby.rb --extout=$(EXTOUT) --'
1255
+AC_SUBST(EXTOUT, [${EXTOUT-.ext}])
1258
+LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
1259
+LIBRUBY='$(LIBRUBY_A)'
1260
+LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static'
1261
+LIBRUBYARG='$(LIBRUBYARG_STATIC)'
1264
+case "$target_os" in
1265
+ cygwin*|mingw*|beos*|openstep*|nextstep*|rhapsody*|darwin*|os2-emx*)
1269
+ DLDLIBS="$DLDLIBS -lc"
1273
+RUBY_SO_NAME='$(RUBY_INSTALL_NAME)'
1274
+LIBRUBY_LDSHARED=$LDSHARED
1275
+LIBRUBY_DLDFLAGS=$DLDFLAGS
1276
+LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
1277
+LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so'
1280
+AC_ARG_ENABLE(shared,
1281
+ [ --enable-shared build a shared library for Ruby. ],
1282
+ [enable_shared=$enableval])
1283
+if test "$enable_shared" = 'yes'; then
1284
+ LIBRUBY='$(LIBRUBY_SO)'
1285
+ LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
1286
+ LIBRUBYARG='$(LIBRUBYARG_SHARED)'
1287
+ CFLAGS="$CFLAGS $CCDLFLAGS"
1289
+ if test "$rb_cv_binary_elf" = yes; then
1292
+ case "$target_os" in
1294
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
1296
+ linux* | gnu* | k*bsd*-gnu | atheos*)
1297
+ LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
1298
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
1300
+ freebsd*|dragonfly*)
1302
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
1303
+ if test "$rb_cv_binary_elf" != "yes" ; then
1304
+ LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
1305
+ LIBRUBY_ALIASES=''
1310
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
1311
+ LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
1312
+ if test "$rb_cv_binary_elf" = yes; then # ELF platforms
1313
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
1314
+ else # a.out platforms
1315
+ LIBRUBY_ALIASES=""
1320
+ LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
1324
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)'
1325
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY) lib$(RUBY_SO_NAME).so'
1326
+ if test "$GCC" = yes; then
1327
+ LIBRUBY_DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(@F)'
1329
+ XLDFLAGS="$XLDFLAGS "'-R${libdir}'
1332
+ XLDFLAGS="$XLDFLAGS "'-Wl,+s,+b,$(libdir)'
1333
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
1334
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).sl'
1337
+ if test "$GCC" = yes; then
1338
+ LIBRUBY_LDSHARED='$(CC) -shared'
1339
+ LIBRUBY_DLDFLAGS='-Wl,-G -Wl,-bE:ruby.imp -Wl,-bnoentry'
1341
+ LIBRUBY_LDSHARED='/usr/ccs/bin/ld'
1342
+ LIBRUBY_DLDFLAGS='-G -bE:ruby.imp -bnoentry'
1344
+ LIBRUBYARG_SHARED='-L${libdir} -lruby'
1348
+ case "$target_cpu" in
1350
+ LIBRUBY_DLDFLAGS='-f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
1355
+ LIBRUBY_SO='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
1356
+ LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
1357
+ LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
1358
+ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
1361
+ LIBRUBYARG_SHARED='-L${libdir} -L. -l$(RUBY_SO_NAME)'
1367
+if test "$enable_rpath" = yes; then
1368
+ if test "$GCC" = yes; then
1369
+ LIBRUBYARG_SHARED='-Wl,-R -Wl,$(libdir) -L$(libdir) -L. '"$LIBRUBYARG_SHARED"
1371
+ LIBRUBYARG_SHARED='-R $(libdir) -L$(libdir) -L. '"$LIBRUBYARG_SHARED"
1375
+XLDFLAGS="$XLDFLAGS -L."
1378
+dnl build rdoc index if requested
1380
+AC_ARG_ENABLE(install-doc,
1381
+ [ --enable-install-doc build and install rdoc indexes during install ],
1382
+ [install_doc=$enableval], [install_doc=no])
1383
+if test "$install_doc" != no; then
1384
+ RDOCTARGET="install-doc"
1386
+AC_SUBST(RDOCTARGET)
1388
+case "$target_os" in
1390
+ CFLAGS="$CFLAGS -pipe"
1392
+ nextstep*|openstep*)
1393
+ # The -fno-common is needed if we wish to embed the Ruby interpreter
1394
+ # into a plugin module of some project (as opposed to embedding it
1395
+ # within the project's application). The -I/usr/local/include is
1396
+ # needed because CPP as discovered by configure (cc -E -traditional)
1397
+ # fails to consult /usr/local/include by default. This causes
1398
+ # mkmf.rb's have_header() to fail if the desired resource happens to be
1399
+ # installed in the /usr/local tree.
1400
+ CFLAGS="$CFLAGS -pipe -fno-common"
1401
+ CPPFLAGS="$CPPFLAGS -I/usr/local/include"
1404
+ CFLAGS="$CFLAGS -pipe -no-precomp -fno-common"
1407
+ CFLAGS="$CFLAGS -pipe -fno-common"
1410
+ CFLAGS="$CFLAGS -DOS2 -Zmts"
1411
+ LIBRUBY_A=`echo $LIBRUBY_A | sed 's/^lib//'`
1412
+ LIBRUBY_SO=`echo $LIBRUBY_SO | sed 's/^lib//'`
1413
+ LIBRUBY_ALIASES=`for i in $LIBRUBY_ALIASES; do echo "$i"; done | sed 's/^lib//'`
1416
+ if test "$GCC" != "yes" ; then
1417
+ # compile something small: taint.c is fine for this.
1418
+ # the main point is the '-v' flag of 'cc'.
1419
+ case "`cc -v -I. -c main.c -o /tmp/main.o 2>&1`" in
1420
+ */gemc_cc*) # we have the new DEC GEM CC
1421
+ CFLAGS="$CFLAGS -oldc"
1423
+ *) # we have the old MIPS CC
1428
+ CFLAGS="$CFLAGS -std"
1432
+ case "$target_cpu" in
1434
+ CFLAGS="$CFLAGS -relax_pointers"
1439
+ case "$target_os" in
1441
+ if test x"$enable_shared" = xyes; then
1442
+ LIBRUBY_SO='cyg$(RUBY_SO_NAME)'${MAJOR}${MINOR}.dll
1443
+ LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
1445
+ AC_LIBOBJ([strftime])
1448
+ RUBY_SO_NAME=${rb_cv_msvcrt}-'$(RUBY_INSTALL_NAME)'${MAJOR}${MINOR}
1449
+ if test x"$enable_shared" = xyes; then
1450
+ LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
1451
+ LIBRUBY='lib$(LIBRUBY_SO).a'
1453
+ AC_LIBOBJ([win32])
1455
+# COMMON_MACROS="WIN32_LEAN_AND_MEAN="
1456
+ COMMON_HEADERS="windows.h winsock.h"
1459
+ LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
1460
+ LIBRUBY_ALIASES=''
1461
+ FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
1463
+ if test x"$enable_shared" = xno; then
1465
+ LIBRUBY='lib$(RUBY_SO_NAME).a'
1466
+ LIBRUBYARG='-l$(RUBY_SO_NAME)'
1473
+ XCFLAGS="$XCFLAGS -DYYMAXDEPTH=300"
1474
+ YACC="$YACC -Nl40000 -Nm40000"
1480
+ PREINSTALL='@$(RM) -r $(prefix)/lib/$(LIBRUBY_A) $(prefix)/lib/$(LIBRUBY_SO) $(prefix)/lib/ruby/$(MAJOR).$(MINOR)/$(arch)'
1486
+case "$build_os" in
1487
+ *msdosdjgpp*) FIRSTMAKEFILE=GNUmakefile:djgpp/GNUmakefile.in;;
1490
+AC_SUBST(XCFLAGS)dnl
1491
+AC_SUBST(XLDFLAGS)dnl
1492
+AC_SUBST(LIBRUBY_LDSHARED)
1493
+AC_SUBST(LIBRUBY_DLDFLAGS)
1494
+AC_SUBST(RUBY_INSTALL_NAME)
1495
+AC_SUBST(rubyw_install_name)
1496
+AC_SUBST(RUBYW_INSTALL_NAME)
1497
+AC_SUBST(RUBY_SO_NAME)
1498
+AC_SUBST(LIBRUBY_A)
1499
+AC_SUBST(LIBRUBY_SO)
1500
+AC_SUBST(LIBRUBY_ALIASES)
1502
+AC_SUBST(LIBRUBYARG)
1503
+AC_SUBST(LIBRUBYARG_STATIC)
1504
+AC_SUBST(LIBRUBYARG_SHARED)
1507
+AC_SUBST(ENABLE_SHARED)
1509
+AC_SUBST(COMMON_LIBS)
1510
+AC_SUBST(COMMON_MACROS)
1511
+AC_SUBST(COMMON_HEADERS)
1512
+AC_SUBST(EXPORT_PREFIX)
1514
+AC_SUBST(PREINSTALL)
1516
+MAKEFILES="Makefile `echo $FIRSTMAKEFILE | sed 's/:.*//'`"
1517
+MAKEFILES="`echo $MAKEFILES`"
1518
+AC_SUBST(MAKEFILES)
1521
+test "$program_prefix" != NONE &&
1522
+ ri_prefix=$program_prefix
1525
+test "$program_suffix" != NONE &&
1526
+ ri_suffix=$program_suffix
1528
+RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
1529
+case "$target_os" in
1531
+ RUBYW_INSTALL_NAME="${ri_prefix}rubyw${ri_suffix}"
1532
+ rubyw_install_name="$RUBYW_INSTALL_NAME"
1535
+case "$target_os" in
1536
+ cygwin*|mingw*|*djgpp*|os2-emx*)
1537
+ RUBY_LIB_PREFIX="/lib/ruby"
1540
+ RUBY_LIB_PREFIX="${prefix}/lib/ruby"
1543
+RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}"
1545
+AC_ARG_WITH(sitedir,
1546
+ [ --with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]],
1547
+ [sitedir=$withval],
1548
+ [sitedir='${prefix}/lib/ruby/site_ruby'])
1549
+SITE_DIR="`eval \"echo ${sitedir}\"`"
1550
+case "$target_os" in
1551
+ cygwin*|mingw*|*djgpp*|os2-emx*)
1552
+ RUBY_SITE_LIB_PATH="`expr "$SITE_DIR" : "$prefix\(/.*\)"`" ||
1553
+ RUBY_SITE_LIB_PATH="$SITE_DIR";;
1555
+ RUBY_SITE_LIB_PATH="$SITE_DIR";;
1557
+RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}"
1559
+AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
1560
+AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
1561
+AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
1564
+AC_SUBST(sitearch)dnl
1565
+AC_SUBST(sitedir)dnl
1567
+configure_args=$ac_configure_args
1568
+AC_SUBST(configure_args)dnl
1570
+if test "$fat_binary" != no ; then
1571
+ arch="fat-${target_os}"
1573
+ AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB,
1574
+ "${RUBY_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
1576
+ AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
1577
+ "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
1578
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
1580
+ arch="${target_cpu}-${target_os}"
1581
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
1584
+case "$target_os" in
1585
+ mingw*) sitearch="i386-$rb_cv_msvcrt" ;;
1586
+ *) sitearch="${arch}" ;;
1589
+AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}")
1590
+AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
1592
+AC_ARG_WITH(search-path,
1593
+ [ --with-search-path=DIR specify the additional search path],
1594
+ [search_path=$withval])
1595
+if test "$search_path" != ""; then
1596
+ AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
1599
+AC_ARG_WITH(mantype,
1600
+ [ --with-mantype=TYPE specify man page type; TYPE is one of man and doc],
1602
+ case "$withval" in
1607
+ AC_MSG_ERROR(invalid man type: $withval)
1611
+if test -z "$MANTYPE"; then
1612
+ AC_PATH_PROGS(NROFF, nroff awf, /bin/false, "/usr/bin:/usr/ucb")
1613
+ if ${NROFF} -mdoc ${srcdir}/ruby.1 >/dev/null 2>&1; then
1621
+if test -f config.h && tr -d '\015' < confdefs.h | cmp -s config.h -; then
1622
+ echo "config.h unchanged"
1624
+ echo "creating config.h"
1625
+ tr -d '\015' < confdefs.h > config.h
1629
+AC_CONFIG_FILES($FIRSTMAKEFILE)
1630
+AC_CONFIG_FILES(Makefile, [{
1631
+ echo; test x"$EXEEXT" = x || echo 'miniruby: miniruby$(EXEEXT)'
1632
+ test "$RUBY_INSTALL_NAME$EXEEXT" = ruby || echo 'ruby: $(PROGRAM);'
1633
+ sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
1634
+} >> Makefile], [RUBY_INSTALL_NAME=$RUBY_INSTALL_NAME EXEEXT=$EXEEXT])
1636
diff -ruN ruby-1.8.5.orig/ruby.c ruby-1.8.5/ruby.c
1637
--- ruby-1.8.5.orig/ruby.c 2006-08-16 11:11:21.000000000 +0900
1638
+++ ruby-1.8.5/ruby.c 2006-09-19 15:39:46.000000000 +0900
1640
ruby_incpush(RUBY_RELATIVE(RUBY_SITE_THIN_ARCHLIB));
1642
ruby_incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB));
1643
+#ifdef RUBY_EXTRA_SITE_SEARCH_PATH
1644
+ ruby_incpush(RUBY_RELATIVE(RUBY_EXTRA_SITE_SEARCH_PATH));
1646
ruby_incpush(RUBY_RELATIVE(RUBY_SITE_LIB));
1648
ruby_incpush(RUBY_RELATIVE(RUBY_LIB));
1650
ruby_incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB));
1652
ruby_incpush(RUBY_RELATIVE(RUBY_ARCHLIB));
1653
+#ifdef RUBY_EXTRA_SEARCH_PATH
1654
+ ruby_incpush(RUBY_RELATIVE(RUBY_EXTRA_SEARCH_PATH));
1657
if (rb_safe_level() == 0) {