1998-01-16 15:13:05 +03:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
2002-04-21 20:05:52 +04:00
|
|
|
AC_INIT()
|
2012-08-21 20:18:10 +04:00
|
|
|
{
|
2009-05-22 15:48:52 +04:00
|
|
|
AC_CONFIG_AUX_DIR(tool)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2008-04-22 11:03:32 +04:00
|
|
|
AC_PREREQ(2.60)
|
2002-03-14 09:23:46 +03:00
|
|
|
|
2009-02-07 12:02:50 +03:00
|
|
|
AC_DEFUN([RUBY_PREREQ_AC],
|
|
|
|
[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [$1]), [-1],
|
|
|
|
AC_MSG_ERROR([Autoconf version ]$1[ or higher is required]$2))])
|
|
|
|
|
2012-08-21 20:18:10 +04:00
|
|
|
{ # environment section
|
2009-02-09 22:34:43 +03:00
|
|
|
|
2007-08-16 11:48:49 +04:00
|
|
|
AC_ARG_WITH(baseruby,
|
2009-11-01 10:23:05 +03:00
|
|
|
AS_HELP_STRING([--with-baseruby=RUBY], [use RUBY as baseruby; RUBY is the pathname of ruby]),
|
2007-08-16 11:48:49 +04:00
|
|
|
[
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE(["$withval"],[*ruby*],[BASERUBY=$withval],[AC_MSG_ERROR(need ruby)])
|
2007-08-16 11:48:49 +04:00
|
|
|
],
|
|
|
|
[
|
|
|
|
BASERUBY="ruby"
|
|
|
|
])
|
2012-04-23 05:43:35 +04:00
|
|
|
if test "`RUBYOPT=- $BASERUBY -e 'p 42' 2>/dev/null`" = 42; then
|
|
|
|
if test "`RUBYOPT=- $BASERUBY --disable=gems -e 'p 42' 2>/dev/null`" = 42; then
|
|
|
|
BASERUBY="$BASERUBY --disable=gems"
|
|
|
|
fi
|
|
|
|
else
|
2007-12-25 06:07:55 +03:00
|
|
|
BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false"
|
2012-04-23 05:43:35 +04:00
|
|
|
fi
|
2007-08-16 16:16:14 +04:00
|
|
|
AC_SUBST(BASERUBY)
|
2007-08-16 11:48:49 +04:00
|
|
|
|
2006-07-25 20:04:35 +04:00
|
|
|
AC_DEFUN([RUBY_MINGW32],
|
2010-01-21 03:38:03 +03:00
|
|
|
[AS_CASE(["$host_os"],
|
|
|
|
[cygwin*], [
|
2002-09-23 15:01:49 +04:00
|
|
|
AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
|
|
|
|
[AC_TRY_CPP([
|
|
|
|
#ifndef __MINGW32__
|
|
|
|
# error
|
|
|
|
#endif
|
|
|
|
], rb_cv_mingw32=yes,rb_cv_mingw32=no)
|
|
|
|
rm -f conftest*])
|
2011-09-03 18:55:20 +04:00
|
|
|
if test "$rb_cv_mingw32" = yes; then
|
|
|
|
target_os="mingw32"
|
|
|
|
: ${ac_tool_prefix:="`expr "$CC" : ['\(.*-\)g\?cc[^/]*$']`"}
|
|
|
|
fi
|
2010-10-10 05:20:11 +04:00
|
|
|
])
|
2010-07-23 10:09:22 +04:00
|
|
|
AS_CASE(["$target_os"], [mingw*msvc], [
|
|
|
|
target_os="`echo ${target_os} | sed 's/msvc$//'`"
|
2010-10-10 05:20:11 +04:00
|
|
|
])
|
2010-10-12 05:39:11 +04:00
|
|
|
AS_CASE(["$target_cpu-$target_os"], [x86_64-mingw*], [
|
2010-10-10 05:20:11 +04:00
|
|
|
target_cpu=x64
|
|
|
|
])
|
|
|
|
])
|
2002-09-23 15:01:49 +04:00
|
|
|
|
2012-05-17 06:48:59 +04:00
|
|
|
AC_DEFUN([RUBY_NACL],
|
|
|
|
[
|
2012-06-09 02:44:01 +04:00
|
|
|
AS_CASE(["${host_os}"],
|
2012-05-17 06:48:59 +04:00
|
|
|
[nacl], [
|
|
|
|
ac_cv_exeext=.nexe
|
|
|
|
host_vendor=chromium
|
|
|
|
ac_cv_host=chromium
|
|
|
|
AC_MSG_CHECKING([wheather \$NACL_SDK_ROOT is set])
|
|
|
|
if test x"${NACL_SDK_ROOT}" = x; then
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AC_MSG_ERROR([You need to set \$NACL_SDK_ROOT environment variable to build for NativeClient])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
|
|
|
|
nacl_cv_build_variant=glibc
|
|
|
|
AC_ARG_WITH(newlib,
|
|
|
|
AS_HELP_STRING([--with-newlib], [uses newlib version of NativeClient SDK]),
|
|
|
|
[AS_CASE([$withval],
|
|
|
|
[no], [nacl_cv_build_variant=glibc],
|
|
|
|
[yes], [nacl_cv_build_variant=newlib])])
|
|
|
|
|
|
|
|
AS_CASE(["$build_cpu"],
|
|
|
|
[x86_64|i?86], [nacl_cv_cpu_nick=x86], [nacl_cv_cpu_nick=$build_cpu])
|
|
|
|
AS_CASE(["$build_os"],
|
|
|
|
[linux*], [nacl_cv_os_nick=linux],
|
|
|
|
[darwin*], [nacl_cv_os_nick=mac],
|
|
|
|
[cygwin*|mingw*], [nacl_cv_os_nick=win],
|
|
|
|
[nacl_cv_os_nick=$build_os])
|
|
|
|
|
|
|
|
host="$host_cpu-chromium-$host_os-"
|
|
|
|
ac_tool_prefix="$host_cpu-nacl-"
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([NativeClient toolchain])
|
|
|
|
if test -d \
|
|
|
|
"${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"; then
|
|
|
|
NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"
|
|
|
|
else
|
|
|
|
AS_CASE(
|
|
|
|
["${nacl_cv_build_variant}"],
|
|
|
|
[glibc], [if test \
|
|
|
|
-d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_newlib" \
|
|
|
|
-a -d "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"; then
|
|
|
|
NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}"
|
|
|
|
fi],
|
|
|
|
[newlib], [ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}" ])
|
|
|
|
fi
|
|
|
|
if test ! -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/${ac_tool_prefix}gcc"; then
|
|
|
|
if test "${build_cpu}" = i686 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then
|
|
|
|
ac_tool_prefix=nacl-
|
|
|
|
fi
|
|
|
|
if test "${build_cpu}" = x86_64 -a -e "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/nacl-gcc"; then
|
|
|
|
ac_tool_prefix=nacl64-
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test -z "${NACL_TOOLCHAIN}"; then
|
|
|
|
AC_MSG_ERROR([Unrecognized --host and --build combination or NaCl SDK is not installed])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(${NACL_TOOLCHAIN})
|
|
|
|
|
2012-06-10 13:39:17 +04:00
|
|
|
AC_MSG_CHECKING([path to SDK])
|
2012-08-27 05:22:53 +04:00
|
|
|
if ! echo -- "${PATH}" | grep -F "${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin" > /dev/null; then
|
2012-06-10 13:39:17 +04:00
|
|
|
PATH="${PATH}:${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin"
|
|
|
|
fi
|
|
|
|
|
2012-05-17 06:48:59 +04:00
|
|
|
AC_SUBST(NACL_TOOLCHAIN)
|
|
|
|
AC_SUBST(NACL_SDK_ROOT)
|
|
|
|
AC_SUBST(NACL_SDK_VARIANT, nacl_cv_build_variant)
|
|
|
|
])])
|
|
|
|
|
|
|
|
AC_DEFUN([RUBY_NACL_CHECK_PEPPER_TYPES],
|
2012-06-13 08:09:37 +04:00
|
|
|
[AS_CASE(["${host_os}"],
|
|
|
|
[nacl], [
|
2012-05-17 06:48:59 +04:00
|
|
|
AC_CHECK_TYPES([struct PPB_Core, struct PPB_Messaging, struct PPB_Var,
|
|
|
|
struct PPB_URLLoader, struct PPB_URLRequestInfo,
|
|
|
|
struct PPB_URLResponseInfo, struct PPB_FileRef,
|
|
|
|
struct PPP_Instance])
|
|
|
|
])
|
2012-06-13 08:09:37 +04:00
|
|
|
])
|
2012-05-17 06:48:59 +04:00
|
|
|
|
2006-07-25 20:04:35 +04:00
|
|
|
AC_DEFUN([RUBY_CPPOUTFILE],
|
2002-12-12 13:21:41 +03:00
|
|
|
[AC_CACHE_CHECK(whether ${CPP} accepts -o, rb_cv_cppoutfile,
|
2012-07-27 12:58:15 +04:00
|
|
|
[save_CPPFLAGS="$CPPFLAGS"
|
2012-06-14 17:49:51 +04:00
|
|
|
CPPFLAGS='-o conftest-1.i'
|
|
|
|
rb_cv_cppoutfile=no
|
2012-06-14 18:00:02 +04:00
|
|
|
AC_TRY_CPP([test-for-cppout],
|
|
|
|
[grep test-for-cppout conftest-1.i > /dev/null && rb_cv_cppoutfile=yes])
|
2012-07-27 12:58:15 +04:00
|
|
|
CPPFLAGS="$save_CPPFLAGS"
|
2002-09-23 15:01:49 +04:00
|
|
|
rm -f conftest*])
|
2002-12-12 13:21:41 +03:00
|
|
|
if test "$rb_cv_cppoutfile" = yes; then
|
|
|
|
CPPOUTFILE='-o conftest.i'
|
|
|
|
elif test "$rb_cv_cppoutfile" = no; then
|
|
|
|
CPPOUTFILE='> conftest.i'
|
|
|
|
elif test -n "$rb_cv_cppoutfile"; then
|
|
|
|
CPPOUTFILE="$rb_cv_cppoutfile"
|
|
|
|
fi
|
|
|
|
AC_SUBST(CPPOUTFILE)])
|
2002-09-23 15:01:49 +04:00
|
|
|
|
2006-07-25 20:04:35 +04:00
|
|
|
AC_DEFUN([RUBY_PROG_GNU_LD],
|
2002-10-04 09:18:05 +04:00
|
|
|
[AC_CACHE_CHECK(whether the linker is GNU ld, rb_cv_prog_gnu_ld,
|
2003-03-04 09:13:24 +03:00
|
|
|
[if `$CC $CFLAGS $CPPFLAGS $LDFLAGS --print-prog-name=ld 2>&1` -v 2>&1 | grep "GNU ld" > /dev/null; then
|
2002-10-04 09:18:05 +04:00
|
|
|
rb_cv_prog_gnu_ld=yes
|
|
|
|
else
|
|
|
|
rb_cv_prog_gnu_ld=no
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
GNU_LD=$rb_cv_prog_gnu_ld
|
|
|
|
AC_SUBST(GNU_LD)])
|
|
|
|
|
2010-08-24 05:11:14 +04:00
|
|
|
eval `sed -n 's/^#define RUBY_API_VERSION_\([A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)/\1=\2/p' $srcdir/include/ruby/version.h`
|
2009-02-05 08:26:22 +03:00
|
|
|
for v in MAJOR MINOR TEENY; do
|
|
|
|
if eval "test \"\$$v\" = ''"; then
|
|
|
|
AC_MSG_ERROR(could not determine $v number from version.h)
|
|
|
|
fi
|
|
|
|
done
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_SUBST(MAJOR)
|
|
|
|
AC_SUBST(MINOR)
|
|
|
|
AC_SUBST(TEENY)
|
2009-08-21 02:14:58 +04:00
|
|
|
RUBY_PROGRAM_VERSION=`sed -n 's/^#define RUBY_VERSION "\(.*\)"/\1/p' $srcdir/version.h`
|
|
|
|
AC_SUBST(RUBY_PROGRAM_VERSION)
|
|
|
|
RUBY_RELEASE_DATE=`sed -n 's/^#define RUBY_RELEASE_DATE "\(.*\)"/\1/p' $srcdir/version.h`
|
|
|
|
AC_SUBST(RUBY_RELEASE_DATE)
|
2012-01-06 19:52:44 +04:00
|
|
|
AC_DEFINE(CANONICALIZATION_FOR_MATHN)
|
1998-01-16 15:13:05 +03:00
|
|
|
dnl checks for alternative programs
|
2011-08-03 21:49:22 +04:00
|
|
|
AC_CANONICAL_BUILD
|
2009-03-31 10:17:38 +04:00
|
|
|
AC_ARG_WITH(gcc,
|
|
|
|
AS_HELP_STRING([--without-gcc], [never use gcc]),
|
|
|
|
[
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE([$withval],
|
2010-01-21 09:10:16 +03:00
|
|
|
[no], [: ${CC=cc}],
|
|
|
|
[yes], [: ${CC=gcc}],
|
|
|
|
[CC=$withval])])
|
1998-01-16 15:13:05 +03:00
|
|
|
dnl If the user switches compilers, we can't believe the cache
|
|
|
|
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
|
|
|
|
then
|
2002-04-19 11:39:40 +04:00
|
|
|
AC_MSG_ERROR(cached CC is different -- throw away $cache_file
|
1998-01-16 15:13:05 +03:00
|
|
|
(it is also a good idea to do 'make clean' before compiling))
|
|
|
|
fi
|
2011-08-03 21:49:22 +04:00
|
|
|
AS_CASE(["$build_os"],
|
|
|
|
[darwin11.*], [
|
|
|
|
AS_CASE(["x$CC"],
|
|
|
|
[xgcc-4.2|x/usr/bin/gcc-4.2], [: ${CXX=g++-4.2}],
|
|
|
|
[xgcc|x/usr/bin/gcc], [: ${CXX=g++}],
|
|
|
|
[xcc|x/usr/bin/cc], [: ${CXX=c++}],
|
|
|
|
[xclang|x/usr/bin/clang], [: ${CXX=clang++}])
|
|
|
|
])
|
2009-12-05 07:19:31 +03:00
|
|
|
test -z "$CC" || ac_cv_prog_CC="$CC"
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2002-09-08 13:08:15 +04:00
|
|
|
if test "$program_prefix" = NONE; then
|
|
|
|
program_prefix=
|
|
|
|
fi
|
2009-04-09 22:46:59 +04:00
|
|
|
RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"`
|
|
|
|
RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
|
2009-05-08 05:14:14 +04:00
|
|
|
AC_SUBST(RUBY_BASE_NAME)
|
|
|
|
AC_SUBST(RUBYW_BASE_NAME)
|
2006-12-31 18:02:22 +03:00
|
|
|
|
2000-07-03 13:08:37 +04:00
|
|
|
AC_CANONICAL_TARGET
|
2004-06-12 06:17:24 +04:00
|
|
|
target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
|
2006-05-24 18:52:10 +04:00
|
|
|
ac_install_sh='' # unusable for extension libraries.
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2009-02-08 07:09:34 +03:00
|
|
|
AC_DEFUN([RUBY_APPEND_OPTION],
|
2010-01-21 03:38:03 +03:00
|
|
|
[# RUBY_APPEND_OPTION($1, $2)
|
|
|
|
AS_CASE([" [$]{$1-} "],
|
|
|
|
[*' $2 '*], [], [' '], [ $1="$2"], [ $1="[$]$1 $2"])])
|
2009-02-08 07:09:34 +03:00
|
|
|
AC_DEFUN([RUBY_APPEND_OPTIONS],
|
2009-02-09 22:34:43 +03:00
|
|
|
[{ for rb_opt in $2; do # RUBY_APPEND_OPTIONS($1, $2)
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE([" [$]{$1-} "],
|
|
|
|
[*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ $1="[$]$1 [$]{rb_opt}"])
|
2009-02-09 22:34:43 +03:00
|
|
|
done; }])
|
2009-02-08 07:09:34 +03:00
|
|
|
AC_DEFUN([RUBY_PREPEND_OPTION],
|
2010-01-21 03:38:03 +03:00
|
|
|
[# RUBY_PREPEND_OPTION($1, $2)
|
|
|
|
AS_CASE([" [$]{$1-} "],
|
|
|
|
[*' $2 '*], [], [' '], [ $1="$2"], [ $1="$2 [$]$1"])])
|
2009-02-08 07:09:34 +03:00
|
|
|
AC_DEFUN([RUBY_PREPEND_OPTIONS],
|
2009-02-09 22:34:43 +03:00
|
|
|
[{ unset rb_opts; for rb_opt in $2; do # RUBY_PREPEND_OPTIONS($1, $2)
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE([" [$]{rb_opts} [$]{$1-} "],
|
|
|
|
[*" [$]{rb_opt} "*], [], [' '], [ $1="[$]{rb_opt}"], [ rb_opts="[$]{rb_opts}[$]{rb_opt} "])
|
2009-02-08 07:09:34 +03:00
|
|
|
done
|
|
|
|
$1="[$]{rb_opts}[$]$1"; }])
|
|
|
|
|
2009-03-31 10:17:38 +04:00
|
|
|
AC_ARG_WITH(arch,
|
2011-11-27 12:26:54 +04:00
|
|
|
AS_HELP_STRING([--with-arch=ARCHS],
|
2009-03-31 10:17:38 +04:00
|
|
|
[build an Apple/NeXT Multi Architecture Binary (MAB);
|
* gc.c (Init_stack): stack region is far smaller than usual if
pthread is used.
* marshal.c (w_extended): singleton methods should not be checked
when dumping via marshal_dump() or _dump(). [ruby-talk:85909]
* file.c (getcwdofdrv): avoid using getcwd() directly, use
my_getcwd() instead.
* merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine
<sunshine@sunshineco.com>. [ruby-core:01596]
* marshal.c (w_object): LINK check earlier than anything else,
i.e. do not dump TYPE_IVAR for already dumped objects.
(ruby-bugs PR#1220)
* eval.c (rb_eval): call "inherited" only when a new class is
generated; not on reopening.
* eval.c (eval): prepend error position in evaluating string to
* configure.in: revived NextStep, OpenStep, and Rhapsody ports which
had become unbuildable; enhanced --enable-fat-binary option so that
it accepts a list of desired architectures (rather than assuming a
fixed list), or defaults to a platform-appropriate list if user does
not provide an explicit list; made the default list of architectures
for MAB (fat binary) more comprehensive; now uses -fno-common even
when building the interpreter (in addition to using it for
extensions), thus allowing the interpreter to be embedded into a
plugin module of an external project (in addition to allowing
embedding directly into an application); added checks for
<netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
ensures that -I/usr/local/include is employed when extensions'
extconf.rb scripts invoke have_header() since extension checks on
NextStep and OpenStep will fail without it if the desired resource
resides in the /usr/local tree; fixed formatting of --help message.
* Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
(see configure's --enable-fat-binary option); added rule for new
missing/getcwd.c.
* defines.h: fixed endian handling during MAB build (see configure's
--enable-fat-binary option) to ensure that all portions of the
project see the correct WORDS_BIGENDIAN value (some extension modules
were getting the wrong endian setting); added missing constants
GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
define in NeXT section.
* dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
NextStep since, on some installations, this value always resolves
uselessly to zero.
* dln.c: added error reporting to NextStep extension loader since the
previous behavior of failing silently was not useful; now ensures
that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
on Rhapsody since this header lacks multiple-include protection,
which resulted in "redefinition" compilation errors.
* main.c: also create hard reference to objc_msgSend() on NeXT
platforms (in addition to Apple platforms).
* lib/mkmf.rb: now exports XCFLAGS from configure script to extension
makefiles so that extensions can be built MAB (see configure's
--enable-fat-binary option); also utilize XCFLAGS in cc_command()
(but not cpp_command() because MAB flags are incompatible with
direct invocation of `cpp').
* ext/curses/extconf.rb: now additionally checks for presence of these
curses functions which are not present on NextStep or Openstep:
bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
wscrl(), wsetscrreg()
* ext/curses/curses.c: added appropriate #ifdef's for additional set of
curses functions now checked by extconf.rb; fixed curses_bkgd() and
window_bkgd() to correctly return boolean result rather than numeric
result; fixed window_getbkgd() to correctly signal an error by
returning nil rather than -1.
* ext/etc/etc.c: setup_passwd() and setup_group() now check for null
pointers before invoking rb_tainted_str_new2() upon fields extracted
from `struct passwd' and `struct group' since null pointers in some
fields are common on NextStep/OpenStep (especially so for the
`pw_comment' field) and rb_tainted_str_new2() throws an exception
when it receives a null pointer.
* ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup().
* ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
gethostbyaddr(), and gethostbyname() from (const char*) to non-const
(char*) for older platforms such as NextStep and OpenStep.
* ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup(); include
<netinet/in_systm.h> if present for NextStep and OpenStep; cast first
argument of gethostbyaddr() and getservbyname() from (const char*) to
non-const (char*) for older platforms.
* ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22 07:00:03 +03:00
|
|
|
ARCHS is a comma-delimited list of architectures for
|
2009-02-07 12:02:50 +03:00
|
|
|
which to build; if this option is disabled or omitted
|
|
|
|
entirely, then the package will be built only for the
|
2009-03-31 10:17:38 +04:00
|
|
|
target platform]),
|
2009-02-07 12:02:50 +03:00
|
|
|
[target_archs="$withval"], [unset target_archs])
|
2009-09-15 07:01:28 +04:00
|
|
|
|
2010-07-13 15:58:58 +04:00
|
|
|
AC_DEFUN([RUBY_DEFAULT_ARCH], [
|
|
|
|
AC_MSG_CHECKING([arch option])
|
|
|
|
AS_CASE([$1],
|
|
|
|
[*64], [ARCH_FLAG=-m64],
|
|
|
|
[[i[3-6]86]], [ARCH_FLAG=-m32],
|
|
|
|
[AC_MSG_ERROR(unknown target architecture: $target_archs)]
|
|
|
|
)
|
|
|
|
AC_MSG_RESULT([$ARCH_FLAG])
|
|
|
|
])
|
|
|
|
|
2009-09-15 07:01:28 +04:00
|
|
|
AC_DEFUN([RUBY_UNIVERSAL_ARCH], [
|
2010-07-13 15:58:58 +04:00
|
|
|
# RUBY_UNIVERSAL_ARCH begin
|
2011-07-16 12:29:21 +04:00
|
|
|
ARCH_FLAG=`expr " $CFLAGS " : ['.* \(-m[0-9][0-9]*\) ']`
|
2010-07-13 15:58:58 +04:00
|
|
|
test ${CFLAGS+set} && CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g'`
|
2010-08-22 00:55:09 +04:00
|
|
|
test ${LDFLAGS+set} && LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-arch *[^ ]*//g' -e 's/ *-m32//g' -e 's/ *-m64//g'`
|
2011-07-16 12:29:21 +04:00
|
|
|
unset universal_binary universal_archnames
|
2009-02-07 12:02:50 +03:00
|
|
|
if test ${target_archs+set}; then
|
* gc.c (Init_stack): stack region is far smaller than usual if
pthread is used.
* marshal.c (w_extended): singleton methods should not be checked
when dumping via marshal_dump() or _dump(). [ruby-talk:85909]
* file.c (getcwdofdrv): avoid using getcwd() directly, use
my_getcwd() instead.
* merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine
<sunshine@sunshineco.com>. [ruby-core:01596]
* marshal.c (w_object): LINK check earlier than anything else,
i.e. do not dump TYPE_IVAR for already dumped objects.
(ruby-bugs PR#1220)
* eval.c (rb_eval): call "inherited" only when a new class is
generated; not on reopening.
* eval.c (eval): prepend error position in evaluating string to
* configure.in: revived NextStep, OpenStep, and Rhapsody ports which
had become unbuildable; enhanced --enable-fat-binary option so that
it accepts a list of desired architectures (rather than assuming a
fixed list), or defaults to a platform-appropriate list if user does
not provide an explicit list; made the default list of architectures
for MAB (fat binary) more comprehensive; now uses -fno-common even
when building the interpreter (in addition to using it for
extensions), thus allowing the interpreter to be embedded into a
plugin module of an external project (in addition to allowing
embedding directly into an application); added checks for
<netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
ensures that -I/usr/local/include is employed when extensions'
extconf.rb scripts invoke have_header() since extension checks on
NextStep and OpenStep will fail without it if the desired resource
resides in the /usr/local tree; fixed formatting of --help message.
* Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
(see configure's --enable-fat-binary option); added rule for new
missing/getcwd.c.
* defines.h: fixed endian handling during MAB build (see configure's
--enable-fat-binary option) to ensure that all portions of the
project see the correct WORDS_BIGENDIAN value (some extension modules
were getting the wrong endian setting); added missing constants
GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
define in NeXT section.
* dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
NextStep since, on some installations, this value always resolves
uselessly to zero.
* dln.c: added error reporting to NextStep extension loader since the
previous behavior of failing silently was not useful; now ensures
that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
on Rhapsody since this header lacks multiple-include protection,
which resulted in "redefinition" compilation errors.
* main.c: also create hard reference to objc_msgSend() on NeXT
platforms (in addition to Apple platforms).
* lib/mkmf.rb: now exports XCFLAGS from configure script to extension
makefiles so that extensions can be built MAB (see configure's
--enable-fat-binary option); also utilize XCFLAGS in cc_command()
(but not cpp_command() because MAB flags are incompatible with
direct invocation of `cpp').
* ext/curses/extconf.rb: now additionally checks for presence of these
curses functions which are not present on NextStep or Openstep:
bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
wscrl(), wsetscrreg()
* ext/curses/curses.c: added appropriate #ifdef's for additional set of
curses functions now checked by extconf.rb; fixed curses_bkgd() and
window_bkgd() to correctly return boolean result rather than numeric
result; fixed window_getbkgd() to correctly signal an error by
returning nil rather than -1.
* ext/etc/etc.c: setup_passwd() and setup_group() now check for null
pointers before invoking rb_tainted_str_new2() upon fields extracted
from `struct passwd' and `struct group' since null pointers in some
fields are common on NextStep/OpenStep (especially so for the
`pw_comment' field) and rb_tainted_str_new2() throws an exception
when it receives a null pointer.
* ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup().
* ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
gethostbyaddr(), and gethostbyname() from (const char*) to non-const
(char*) for older platforms such as NextStep and OpenStep.
* ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup(); include
<netinet/in_systm.h> if present for NextStep and OpenStep; cast first
argument of gethostbyaddr() and getservbyname() from (const char*) to
non-const (char*) for older platforms.
* ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22 07:00:03 +03:00
|
|
|
AC_MSG_CHECKING([target architectures])
|
2009-02-07 12:02:50 +03:00
|
|
|
target_archs=`echo $target_archs | tr , ' '`
|
1998-01-16 15:13:05 +03:00
|
|
|
# /usr/lib/arch_tool -archify_list $TARGET_ARCHS
|
2009-02-07 12:02:50 +03:00
|
|
|
for archs in $target_archs
|
1998-01-16 15:13:05 +03:00
|
|
|
do
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE([",$universal_binary,"],[*",$archs,"*], [],[
|
2009-05-22 15:48:52 +04:00
|
|
|
cpu=`$SHELL "$ac_aux_dir/config.sub" "${archs}-${target_os}" 2>&1` || {
|
2009-02-08 07:09:34 +03:00
|
|
|
AC_MSG_RESULT([failed])
|
|
|
|
AC_MSG_ERROR([$cpu])
|
|
|
|
}
|
|
|
|
cpu=`echo $cpu | sed 's/-.*-.*//'`
|
|
|
|
universal_binary="${universal_binary+$universal_binary,}$cpu"
|
|
|
|
universal_archnames="${universal_archnames} ${archs}=${cpu}"
|
2009-02-07 12:02:50 +03:00
|
|
|
ARCH_FLAG="${ARCH_FLAG+$ARCH_FLAG }-arch $archs"
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
1998-01-16 15:13:05 +03:00
|
|
|
done
|
2009-02-07 12:02:50 +03:00
|
|
|
target_archs="$universal_binary"
|
|
|
|
unset universal_binary
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_archs"],
|
2010-01-21 09:10:16 +03:00
|
|
|
[*,*], [universal_binary=yes],
|
|
|
|
[unset universal_archnames])
|
2009-02-07 12:02:50 +03:00
|
|
|
AC_MSG_RESULT([$target_archs])
|
|
|
|
|
2009-10-23 09:25:56 +04:00
|
|
|
target=`echo $target | sed "s/^$target_cpu-/-/"`
|
|
|
|
target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
|
2009-02-07 12:02:50 +03:00
|
|
|
if test "${universal_binary-no}" = yes; then
|
|
|
|
RUBY_PREREQ_AC(2.63, [ to compile universal binary])
|
|
|
|
AC_SUBST(try_header,try_compile)
|
|
|
|
target_cpu=universal
|
2009-08-13 13:40:12 +04:00
|
|
|
real_cross_compiling=$cross_compiling
|
2009-03-25 01:45:13 +03:00
|
|
|
else
|
2010-07-13 15:58:58 +04:00
|
|
|
if test x"$target_cpu" != x"${target_archs}"; then
|
|
|
|
echo 'int main(){return 0;}' > conftest.c
|
2010-12-21 06:45:21 +03:00
|
|
|
if $CC $CFLAGS $ARCH_FLAG -o conftest conftest.c > /dev/null 2>&1; then
|
|
|
|
rm -fr conftest.*
|
2010-07-13 15:58:58 +04:00
|
|
|
else
|
|
|
|
RUBY_DEFAULT_ARCH("$target_archs")
|
|
|
|
fi
|
|
|
|
fi
|
2009-03-25 01:45:13 +03:00
|
|
|
target_cpu=${target_archs}
|
2009-02-07 12:02:50 +03:00
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
|
|
|
|
AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"])
|
2009-02-07 12:02:50 +03:00
|
|
|
else
|
2009-09-11 16:38:15 +04:00
|
|
|
if test x"$target_alias" = x; then
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[darwin*], [
|
2009-09-11 16:38:15 +04:00
|
|
|
AC_MSG_CHECKING([for real target cpu])
|
2009-10-23 09:25:56 +04:00
|
|
|
target=`echo $target | sed "s/^$target_cpu-/-/"`
|
2009-09-11 16:38:15 +04:00
|
|
|
target_cpu=`$CC -E - 2>/dev/null <<EOF |
|
|
|
|
#ifdef __x86_64__
|
|
|
|
"processor-name=x86_64"
|
|
|
|
#endif
|
|
|
|
#ifdef __i386__
|
|
|
|
"processor-name=i386"
|
|
|
|
#endif
|
|
|
|
#ifdef __ppc__
|
|
|
|
"processor-name=powerpc"
|
|
|
|
#endif
|
|
|
|
#ifdef __ppc64__
|
|
|
|
"processor-name=powerpc64"
|
|
|
|
#endif
|
|
|
|
EOF
|
|
|
|
sed -n 's/^"processor-name=\(.*\)"/\1/p'`
|
2009-10-23 09:25:56 +04:00
|
|
|
target="$target_cpu${target}"
|
2009-09-11 16:38:15 +04:00
|
|
|
AC_MSG_RESULT([$target_cpu])
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2009-09-11 16:38:15 +04:00
|
|
|
fi
|
2009-02-07 12:02:50 +03:00
|
|
|
target_archs="$target_cpu"
|
2003-11-30 14:27:34 +03:00
|
|
|
fi
|
2010-03-11 05:16:39 +03:00
|
|
|
if test "${target_archs}" != "${rb_cv_target_archs-${target_archs}}"; then
|
|
|
|
AC_MSG_ERROR([target arch(s) has changed from ${rb_cv_target_archs-nothing} to ${target_archs}])
|
|
|
|
else
|
|
|
|
rb_cv_target_archs=${target_archs}
|
|
|
|
fi
|
2011-07-16 12:29:21 +04:00
|
|
|
if test "x${ARCH_FLAG}" != x; then
|
|
|
|
CFLAGS="$CFLAGS ${ARCH_FLAG}"
|
|
|
|
LDFLAGS="${LDFLAGS+$LDFLAGS }${ARCH_FLAG}"
|
|
|
|
fi
|
2010-07-13 15:58:58 +04:00
|
|
|
# RUBY_UNIVERSAL_ARCH end
|
2009-09-15 07:01:28 +04:00
|
|
|
])
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2009-03-09 18:06:22 +03:00
|
|
|
AC_ARG_ENABLE(load-relative,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--enable-load-relative], [resolve load paths at run time]),
|
2009-03-09 18:06:22 +03:00
|
|
|
[load_relative=$enableval])
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_ARG_PROGRAM
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
2000-02-01 06:12:21 +03:00
|
|
|
|
2009-10-10 13:59:19 +04:00
|
|
|
cflagspat=
|
|
|
|
test -z "$optflags" ||
|
|
|
|
cflagspat="$cflagspat;s|"`eval echo '"'"${optflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
|
|
|
|
test -z "$debugflags" ||
|
|
|
|
cflagspat="$cflagspat;s|"`eval echo '"'"${debugflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
|
|
|
|
test -z "warnflags" ||
|
|
|
|
cflagspat="$cflagspat;s|"`eval echo '"'"${warnflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
|
2009-04-06 15:16:15 +04:00
|
|
|
if test -z "${CFLAGS+set}"; then
|
2009-10-10 13:59:19 +04:00
|
|
|
cflags=`echo " $cflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
|
2009-04-06 15:16:15 +04:00
|
|
|
orig_cflags="$cflags"
|
2009-04-06 18:16:10 +04:00
|
|
|
cflags="$cflags "'${optflags} ${debugflags} ${warnflags}'
|
2009-04-06 15:16:15 +04:00
|
|
|
fi
|
|
|
|
if test -z "${CXXFLAGS+set}"; then
|
2009-10-10 13:59:19 +04:00
|
|
|
cxxflags=`echo " $cxxflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
|
2009-04-06 15:16:15 +04:00
|
|
|
orig_cxxflags="$cxxflags"
|
2009-04-06 18:16:10 +04:00
|
|
|
cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}'
|
2009-04-06 15:16:15 +04:00
|
|
|
fi
|
2009-04-06 18:16:10 +04:00
|
|
|
|
2012-05-17 06:48:59 +04:00
|
|
|
RUBY_NACL
|
2012-08-03 14:21:22 +04:00
|
|
|
AS_CASE(["$host_os:$build_os"],
|
|
|
|
[darwin*:darwin*], [
|
2012-08-05 08:26:24 +04:00
|
|
|
AC_CHECK_TOOLS(CC, [gcc-4.2 clang gcc cc])
|
2012-08-03 14:21:22 +04:00
|
|
|
])
|
2000-02-01 06:12:21 +03:00
|
|
|
if test x"${build}" != x"${host}"; then
|
|
|
|
AC_CHECK_TOOL(CC, gcc)
|
|
|
|
fi
|
* probes.d: add DTrace probe declarations. [ruby-core:27448]
* array.c (empty_ary_alloc, ary_new): added array create DTrace probe.
* compile.c (rb_insns_name): allowing DTrace probes to access
instruction sequence name.
* Makefile.in: translate probes.d file to appropriate header file.
* common.mk: declare dependencies on the DTrace header.
* configure.in: add a test for existence of DTrace.
* eval.c (setup_exception): add a probe for when an exception is
raised.
* gc.c: Add DTrace probes for mark begin and end, and sweep begin and
end.
* hash.c (empty_hash_alloc): Add a probe for hash allocation.
* insns.def: Add probes for function entry and return.
* internal.h: function declaration for compile.c change.
* load.c (rb_f_load): add probes for `load` entry and exit, require
entry and exit, and wrapping search_required for load path search.
* object.c (rb_obj_alloc): added a probe for general object creation.
* parse.y (yycompile0): added a probe around parse and compile phase.
* string.c (empty_str_alloc, str_new): DTrace probes for string
allocation.
* test/dtrace/*: tests for DTrace probes.
* vm.c (vm_invoke_proc): add probes for function return on exception
raise, hash create, and instruction sequence execution.
* vm_core.h: add probe declarations for function entry and exit.
* vm_dump.c: add probes header file.
* vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on
function entry and return.
* vm_exec.c: expose instruction number to instruction name function.
* vm_insnshelper.c: add function entry and exit probes for cfunc
methods.
* vm_insnhelper.h: vm usage information is always collected, so
uncomment the functions.
12 19:14:50 2012 Akinori MUSHA <knu@iDaemons.org>
* configure.in (isinf, isnan): isinf() and isnan() are macros on
DragonFly which cannot be found by AC_REPLACE_FUNCS(). This
workaround enforces the fact that they exist on DragonFly.
12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org>
* vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo),
vm_insnhelper.c (vm_search_method): revert r37616 because it's too
slow. [ruby-dev:46477]
* test/ruby/test_refinement.rb (test_inline_method_cache): skip
the test until the bug is fixed efficiently.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-13 01:52:12 +04:00
|
|
|
|
|
|
|
AC_CHECK_TOOL(DTRACE, dtrace)
|
|
|
|
|
2012-08-03 14:21:22 +04:00
|
|
|
AC_PROG_CC
|
2005-04-21 01:45:43 +04:00
|
|
|
AC_PROG_CXX
|
2012-08-03 12:27:04 +04:00
|
|
|
RUBY_MINGW32
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_PROG_GCC_TRADITIONAL
|
2009-09-12 12:31:44 +04:00
|
|
|
AC_SUBST(GCC)
|
2012-05-16 09:39:06 +04:00
|
|
|
AC_CHECK_TOOL([LD], [ld], [ld])
|
|
|
|
AC_SUBST(LD)
|
2007-04-17 21:17:15 +04:00
|
|
|
if test "$GCC" = yes; then
|
|
|
|
linker_flag=-Wl,
|
2011-07-23 19:57:21 +04:00
|
|
|
: ${optflags=-O3}
|
2010-07-26 09:38:23 +04:00
|
|
|
RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
|
2007-04-17 21:17:15 +04:00
|
|
|
else
|
|
|
|
linker_flag=
|
|
|
|
fi
|
2000-02-01 06:12:21 +03:00
|
|
|
|
2002-10-04 09:18:05 +04:00
|
|
|
RUBY_PROG_GNU_LD
|
2002-09-23 15:01:49 +04:00
|
|
|
RUBY_CPPOUTFILE
|
|
|
|
|
2003-11-30 12:33:03 +03:00
|
|
|
: ${OUTFLAG='-o '}
|
2007-12-24 06:49:56 +03:00
|
|
|
: ${COUTFLAG=${OUTFLAG}}
|
2002-09-15 16:57:21 +04:00
|
|
|
AC_SUBST(OUTFLAG)
|
2007-12-24 06:49:56 +03:00
|
|
|
AC_SUBST(COUTFLAG)
|
2002-09-15 16:57:21 +04:00
|
|
|
|
2009-09-15 07:01:28 +04:00
|
|
|
RUBY_UNIVERSAL_ARCH
|
2010-07-13 16:26:16 +04:00
|
|
|
if test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no -a "$universal_binary" = no; then
|
2010-07-13 15:58:58 +04:00
|
|
|
RUBY_DEFAULT_ARCH("$target_cpu")
|
|
|
|
fi
|
2002-09-23 15:01:49 +04:00
|
|
|
|
2000-02-01 06:12:21 +03:00
|
|
|
AC_CHECK_TOOL(RANLIB, ranlib, :)
|
2002-08-28 10:01:58 +04:00
|
|
|
AC_CHECK_TOOL(AR, ar)
|
2002-08-28 11:38:25 +04:00
|
|
|
if test -z "$AR"; then
|
|
|
|
AC_CHECK_PROGS(AR, aal, ar)
|
|
|
|
fi
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2006-07-26 17:28:17 +04:00
|
|
|
AC_CHECK_TOOL(AS, as)
|
|
|
|
ASFLAGS=$ASFLAGS
|
|
|
|
AC_SUBST(ASFLAGS)
|
|
|
|
|
2010-09-25 05:30:52 +04:00
|
|
|
AS_CASE(["$target_os"],[cygwin*|mingw*], [ac_cv_prog_ac_ct_OBJCOPY=":"])
|
2009-01-29 08:09:01 +03:00
|
|
|
|
2008-12-17 09:37:20 +03:00
|
|
|
# BSD's ports and MacPorts prefix GNU binutils with 'g'
|
2008-12-24 00:29:34 +03:00
|
|
|
AC_CHECK_TOOLS(OBJDUMP, [objdump gobjdump])
|
|
|
|
AC_CHECK_TOOLS(OBJCOPY, [objcopy gobjcopy])
|
2008-12-07 17:17:36 +03:00
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[cygwin*|mingw*], [
|
2001-01-31 17:27:37 +03:00
|
|
|
AC_CHECK_TOOL(WINDRES, windres)
|
2002-06-11 14:26:13 +04:00
|
|
|
AC_CHECK_TOOL(DLLWRAP, dllwrap)
|
2009-10-23 09:25:56 +04:00
|
|
|
target=`echo $target | sed "s/^$target_cpu-/-/"`
|
|
|
|
target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
|
2001-11-30 12:17:30 +03:00
|
|
|
target_cpu=`echo $target_cpu | sed s/i.86/i386/`
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
|
|
|
|
AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"])
|
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[mingw*], [
|
2005-04-13 14:25:41 +04:00
|
|
|
test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
|
|
|
|
AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
|
2010-01-21 03:38:03 +03:00
|
|
|
AC_TRY_LINK([@%:@include <stdio.h>],
|
2005-04-13 14:25:41 +04:00
|
|
|
[FILE* volatile f = stdin; return 0;],
|
|
|
|
[rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
|
2008-08-10 07:15:37 +04:00
|
|
|
tr A-Z a-z |
|
2005-04-13 16:24:40 +04:00
|
|
|
sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
|
2006-07-17 18:32:02 +04:00
|
|
|
[rb_cv_msvcrt=msvcrt])
|
|
|
|
test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
|
2012-04-16 11:08:27 +04:00
|
|
|
RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
|
|
|
|
test "$RT_VER" = "" && RT_VER=60
|
|
|
|
AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER)
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2001-11-30 12:17:30 +03:00
|
|
|
: ${enable_shared=yes}
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
2010-01-21 09:10:16 +03:00
|
|
|
[aix*], [AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)],
|
|
|
|
[hiuxmpp*], [AC_DEFINE(__HIUX_MPP__)]) # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
|
2010-11-07 04:13:33 +03:00
|
|
|
AC_CHECK_TOOL(NM, nm)
|
2002-05-02 11:50:36 +04:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_PROG_LN_S
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_PROG_MAKE_SET
|
2005-04-16 10:27:43 +04:00
|
|
|
AC_PROG_INSTALL
|
2009-08-13 11:20:16 +04:00
|
|
|
AC_PROG_MKDIR_P
|
2009-08-25 18:33:11 +04:00
|
|
|
if test "x$MKDIR_P" = "x -d"; then
|
|
|
|
if test x"$as_mkdir_p" != xfalse; then
|
|
|
|
MKDIR_P='mkdir -p'
|
|
|
|
echo "use 'mkdir -p' as MKDIR_P"
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([mkdir -p is required])
|
|
|
|
fi
|
2009-08-25 17:36:32 +04:00
|
|
|
fi
|
|
|
|
MAKEDIRS="$MKDIR_P"
|
|
|
|
AC_SUBST(MAKEDIRS)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2012-04-18 17:59:00 +04:00
|
|
|
AC_CHECK_PROGS(DOT, dot)
|
|
|
|
AC_CHECK_PROGS(DOXYGEN, doxygen)
|
2012-05-17 06:48:59 +04:00
|
|
|
AS_CASE(["${host_os}"], [nacl], [AC_PATH_PROG(PYTHON, python)])
|
2009-06-29 19:34:05 +04:00
|
|
|
|
2012-04-18 17:59:00 +04:00
|
|
|
AC_CHECK_PROG(PKG_CONFIG, pkg-config, [pkg-config], [], [],
|
|
|
|
[`"$as_dir/$ac_word$ac_exec_ext" --print-errors --version > /dev/null 2>&1 || echo "$as_dir/$ac_word$ac_exec_ext"`])
|
2010-10-30 09:37:43 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
# checks for UNIX variants that set C preprocessor variables
|
2008-04-22 11:03:32 +04:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2004-02-09 11:48:55 +03:00
|
|
|
AC_SUBST(RM, ['rm -f'])
|
2005-04-02 17:30:49 +04:00
|
|
|
AC_SUBST(CP, ['cp'])
|
2010-03-22 12:01:19 +03:00
|
|
|
RMDIRS='$(top_srcdir)/tool/rmdirs'
|
2010-07-22 01:26:56 +04:00
|
|
|
RMDIR=rmdir
|
2010-03-22 12:01:19 +03:00
|
|
|
mkdir "rmdirs_$$_test" "rmdirs_$$_test/a"
|
2010-07-22 01:26:56 +04:00
|
|
|
rmdir --ignore-fail-on-non-empty "rmdirs_$$_test" 2>/dev/null &&
|
|
|
|
RMDIR='rmdir --ignore-fail-on-non-empty'
|
|
|
|
$RMDIR -p "rmdirs_$$_test/a" 2>/dev/null &&
|
|
|
|
{ test -d "rmdirs_$$_test" || RMDIRS="$RMDIR -p"; }
|
2010-03-22 12:01:19 +03:00
|
|
|
rmdir "rmdirs_$$_test/a" "rmdirs_$$_test" 2>/dev/null
|
2010-07-22 01:26:56 +04:00
|
|
|
AC_SUBST(RMDIR)
|
2010-03-22 12:01:19 +03:00
|
|
|
AC_SUBST(RMDIRS)
|
2009-01-25 05:06:29 +03:00
|
|
|
AC_SUBST(RMALL, ['rm -fr'])
|
2004-02-09 11:48:55 +03:00
|
|
|
|
2011-02-08 13:26:42 +03:00
|
|
|
AC_MSG_CHECKING([for cd using physical directory])
|
2009-03-06 12:37:31 +03:00
|
|
|
rm -fr conf$$.dir
|
|
|
|
mkdir conf$$.dir &&
|
|
|
|
(cd conf$$.dir && mkdir src build && cd src &&
|
|
|
|
$as_ln_s ../build . > /dev/null 2>&1 && cd build &&
|
|
|
|
for chdir in 'cd -P' 'PWD= cd'; do
|
2009-03-07 12:47:05 +03:00
|
|
|
/bin/sh -c "$chdir ../src && echo '$chdir' > cdcmd" 2> /dev/null && break
|
2009-03-06 12:37:31 +03:00
|
|
|
done)
|
2011-11-09 05:32:25 +04:00
|
|
|
if test -f conf$$.dir/src/cdcmd; then
|
2009-03-07 12:47:05 +03:00
|
|
|
read CHDIR < conf$$.dir/src/cdcmd 2> /dev/null
|
2009-03-06 12:37:31 +03:00
|
|
|
else
|
|
|
|
CHDIR=cd
|
|
|
|
fi
|
|
|
|
rm -fr conf$$.dir
|
|
|
|
AC_MSG_RESULT([$CHDIR])
|
|
|
|
AC_SUBST(CHDIR)
|
|
|
|
|
2012-08-21 20:18:10 +04:00
|
|
|
}
|
|
|
|
{ # compiler section
|
2009-02-09 22:34:43 +03:00
|
|
|
|
2010-07-23 10:05:43 +04:00
|
|
|
AC_DEFUN([RUBY_WERROR_FLAG], [dnl
|
2011-12-08 07:11:11 +04:00
|
|
|
save_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS $rb_cv_warnflags"
|
2010-07-23 10:05:43 +04:00
|
|
|
if test "${ac_c_werror_flag+set}"; then
|
|
|
|
rb_c_werror_flag="$ac_c_werror_flag"
|
|
|
|
else
|
|
|
|
unset rb_c_werror_flag
|
|
|
|
fi
|
|
|
|
ac_c_werror_flag=yes
|
|
|
|
$1
|
2011-12-08 07:11:11 +04:00
|
|
|
CFLAGS="$save_CFLAGS"
|
|
|
|
save_CFLAGS=
|
2010-07-23 10:05:43 +04:00
|
|
|
if test "${rb_c_werror_flag+set}"; then
|
|
|
|
ac_c_werror_flag="$rb_c_werror_flag"
|
|
|
|
else
|
|
|
|
unset ac_c_werror_flag
|
|
|
|
fi])
|
|
|
|
|
2009-10-23 09:22:53 +04:00
|
|
|
AC_DEFUN(RUBY_TRY_CFLAGS, [
|
2011-12-02 10:43:57 +04:00
|
|
|
AC_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS])
|
2010-07-23 10:05:43 +04:00
|
|
|
RUBY_WERROR_FLAG([
|
2011-12-08 07:11:11 +04:00
|
|
|
CFLAGS="[$]CFLAGS $1"
|
2010-07-23 10:05:43 +04:00
|
|
|
AC_TRY_COMPILE([$4], [$5],
|
2009-10-23 09:22:53 +04:00
|
|
|
[$2
|
|
|
|
AC_MSG_RESULT(yes)],
|
|
|
|
[$3
|
|
|
|
AC_MSG_RESULT(no)])
|
2010-07-23 10:05:43 +04:00
|
|
|
])
|
2009-10-23 09:22:53 +04:00
|
|
|
])
|
|
|
|
|
2010-09-25 05:30:52 +04:00
|
|
|
AC_DEFUN(RUBY_TRY_LDFLAGS, [
|
|
|
|
save_LDFLAGS="$LDFLAGS"
|
|
|
|
LDFLAGS="[$]LDFLAGS $1"
|
2011-12-02 10:43:57 +04:00
|
|
|
AC_MSG_CHECKING([whether $1 is accepted as LDFLAGS])
|
2010-09-25 05:30:52 +04:00
|
|
|
RUBY_WERROR_FLAG([
|
|
|
|
AC_TRY_LINK([$4], [$5],
|
|
|
|
[$2
|
|
|
|
AC_MSG_RESULT(yes)],
|
|
|
|
[$3
|
|
|
|
AC_MSG_RESULT(no)])
|
|
|
|
])
|
|
|
|
LDFLAGS="$save_LDFLAGS"
|
|
|
|
save_LDFLAGS=
|
|
|
|
])
|
|
|
|
|
2011-02-15 13:44:58 +03:00
|
|
|
rb_cv_warnflags="$warnflags"
|
2009-10-23 09:22:53 +04:00
|
|
|
if test "$GCC:${warnflags+set}:no" = yes::no; then
|
2010-12-31 05:46:50 +03:00
|
|
|
particular_werror_flags=yes
|
|
|
|
for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \
|
|
|
|
-Wno-missing-field-initializers \
|
2011-08-07 17:43:37 +04:00
|
|
|
-Wunused-variable \
|
2010-12-31 05:46:50 +03:00
|
|
|
-Werror=pointer-arith \
|
|
|
|
-Werror=write-strings \
|
2010-12-14 05:33:04 +03:00
|
|
|
-Werror=declaration-after-statement \
|
2011-01-15 05:57:36 +03:00
|
|
|
-Werror=shorten-64-to-32 \
|
|
|
|
-Werror-implicit-function-declaration \
|
|
|
|
; do
|
|
|
|
if test "$particular_werror_flags" = yes; then
|
|
|
|
wflag=`echo x$wflag | sed 's/^x-Werror-/-Werror=/;s/^x//'`
|
|
|
|
else
|
|
|
|
wflag=`echo x$wflag | sed 's/^x-Werror=/-W/;s/^x//'`
|
|
|
|
fi
|
2010-12-31 05:46:50 +03:00
|
|
|
ok=no
|
2012-04-30 16:09:09 +04:00
|
|
|
RUBY_TRY_CFLAGS($wflag, [
|
|
|
|
RUBY_APPEND_OPTIONS(warnflags, $wflag)
|
|
|
|
ok=yes
|
|
|
|
])
|
2010-12-31 05:46:50 +03:00
|
|
|
AS_CASE([$ok:$wflag], [no:-Werror=*], [
|
|
|
|
wflag=`echo x$wflag | sed 's/^x-Werror=/-W/'`
|
|
|
|
RUBY_TRY_CFLAGS($wflag, [
|
2012-04-30 16:09:09 +04:00
|
|
|
RUBY_APPEND_OPTIONS(warnflags, $wflag)
|
2010-12-31 05:46:50 +03:00
|
|
|
particular_werror_flags=no
|
|
|
|
])
|
|
|
|
])
|
2009-03-11 23:49:07 +03:00
|
|
|
done
|
2011-11-25 02:49:51 +04:00
|
|
|
AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag="-Wall -Wextra"],
|
2010-01-21 09:10:16 +03:00
|
|
|
[wflag=-Wall])
|
2009-10-23 09:22:53 +04:00
|
|
|
RUBY_TRY_CFLAGS($wflag, [warnflags="$wflag${warnflags+ $warnflags}"])
|
2011-02-15 13:44:58 +03:00
|
|
|
# Disable warnflags while conftest. -Werror=* flags might make bad OS capability guess.
|
2011-03-04 15:16:45 +03:00
|
|
|
rb_cv_warnflags="$warnflags"
|
2011-02-15 13:44:58 +03:00
|
|
|
warnflags=
|
2009-03-11 23:49:07 +03:00
|
|
|
fi
|
2011-11-25 03:04:35 +04:00
|
|
|
if test "$GCC" = yes; then
|
2012-06-12 16:09:16 +04:00
|
|
|
test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb3, [debugflags=-ggdb3])}
|
2012-02-28 06:44:52 +04:00
|
|
|
test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb, [debugflags=-ggdb])}
|
|
|
|
test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-g3, [debugflags=-g3])}
|
|
|
|
|
2011-11-27 16:27:00 +04:00
|
|
|
# -D_FORTIFY_SOURCE
|
2011-11-25 03:04:35 +04:00
|
|
|
RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
|
2011-11-27 16:27:00 +04:00
|
|
|
|
|
|
|
# -fstack-protector
|
2011-11-27 14:09:11 +04:00
|
|
|
AS_CASE(["$target_os"],
|
2012-08-23 06:59:24 +04:00
|
|
|
[mingw*|nacl|haiku], [
|
2011-11-27 14:09:11 +04:00
|
|
|
stack_protector=no
|
|
|
|
],
|
|
|
|
[
|
|
|
|
RUBY_TRY_CFLAGS(-fstack-protector, [stack_protector=yes], [stack_protector=no])
|
2012-02-20 10:50:36 +04:00
|
|
|
if test "x$stack_protector" = xyes; then
|
|
|
|
RUBY_TRY_LDFLAGS(-fstack-protector, [], [stack_protector=broken])
|
|
|
|
fi
|
2011-11-27 14:09:11 +04:00
|
|
|
])
|
2011-11-27 13:25:38 +04:00
|
|
|
if test "x$stack_protector" = xyes; then
|
|
|
|
RUBY_APPEND_OPTION(XCFLAGS, -fstack-protector)
|
|
|
|
RUBY_APPEND_OPTION(XLDFLAGS, -fstack-protector)
|
2011-12-01 05:32:02 +04:00
|
|
|
RUBY_APPEND_OPTION(LDFLAGS, -fstack-protector)
|
2011-11-27 13:25:38 +04:00
|
|
|
fi
|
2011-11-27 16:27:00 +04:00
|
|
|
|
2012-06-13 10:16:46 +04:00
|
|
|
AS_CASE(["$target_os"],[mingw*], [
|
|
|
|
# On Windows platforms, system provided headers are VC++
|
|
|
|
# optimized. That is, C++ habits are often contaminated into
|
|
|
|
# various headers. Most frequent situation is the use of //
|
|
|
|
# comments. We bypass ANSI C mode for them. Otherwise
|
|
|
|
# extension libs cannot include those headers.
|
|
|
|
],
|
2012-06-14 05:16:33 +04:00
|
|
|
[cygwin*|darwin*|netbsd*], [
|
2012-06-13 17:18:05 +04:00
|
|
|
# need lgamma_r(), finite()
|
2012-06-13 12:51:04 +04:00
|
|
|
],
|
2012-08-28 15:05:23 +04:00
|
|
|
[haiku], [
|
|
|
|
# Haiku R1/alpha3 uses gcc-4.4.4 which can not handle anonymous union
|
|
|
|
# with ANSI standard flags. Anonumous union is required to compile
|
|
|
|
# socket extension where <net/if.h> uses anonymous union.
|
|
|
|
],
|
2012-06-13 10:16:46 +04:00
|
|
|
[
|
|
|
|
# ANSI (no XCFLAGS because this is C only)
|
2012-06-14 05:16:33 +04:00
|
|
|
RUBY_TRY_CFLAGS(-ansi -std=iso9899:199409, [
|
2012-09-16 12:41:37 +04:00
|
|
|
RUBY_APPEND_OPTION(warnflags, -ansi -std=iso9899:199409)
|
2012-09-16 03:58:04 +04:00
|
|
|
RUBY_APPEND_OPTION(strict_warnflags, -ansi -std=iso9899:199409)
|
2012-06-13 10:16:46 +04:00
|
|
|
])
|
2012-06-12 13:41:07 +04:00
|
|
|
])
|
|
|
|
|
2011-11-27 16:27:00 +04:00
|
|
|
# suppress annoying -Wstrict-overflow warnings
|
|
|
|
RUBY_TRY_CFLAGS(-fno-strict-overflow, [RUBY_APPEND_OPTION(XCFLAGS, -fno-strict-overflow)])
|
2011-11-25 03:04:35 +04:00
|
|
|
fi
|
2012-02-28 06:44:52 +04:00
|
|
|
test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
|
2011-11-25 03:04:35 +04:00
|
|
|
|
2011-06-30 16:31:53 +04:00
|
|
|
if test "$GCC" = ""; then
|
2012-09-16 03:52:34 +04:00
|
|
|
AS_CASE(["$target_os"],[aix*],[warnflags="$warnflags -qinfo=por" rb_cv_warnflags="$rb_cv_warnflags -qinfo=por"])
|
2011-06-30 16:31:53 +04:00
|
|
|
fi
|
2010-07-22 01:38:25 +04:00
|
|
|
if test "$GCC" = yes; then
|
2012-10-23 09:06:50 +04:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
|
|
|
|
@%:@if !(defined __GNUC__ && __GNUC__ >= 4)
|
|
|
|
@%:@error not GCC 4 or later
|
|
|
|
>>>not GCC 4 or later<<<
|
|
|
|
@%:@endif])],
|
|
|
|
[visibility_option=yes], [visibility_option=no])
|
|
|
|
if test "$visibility_option" = yes; then
|
|
|
|
RUBY_TRY_CFLAGS(-fvisibility=hidden, [visibility_option=yes], [visibility_option=no])
|
|
|
|
fi
|
2010-12-07 02:00:47 +03:00
|
|
|
AC_SUBST(WERRORFLAG, "-Werror")
|
2010-09-25 05:30:52 +04:00
|
|
|
if test "$visibility_option" = yes; then
|
|
|
|
RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)
|
|
|
|
else
|
2010-09-25 17:48:42 +04:00
|
|
|
RUBY_TRY_LDFLAGS([-Wl,-unexported_symbol,_Init_*], [visibility_option=ld], [visibility_option=no])
|
2010-09-25 05:30:52 +04:00
|
|
|
fi
|
|
|
|
test "$visibility_option" = no || OBJCOPY=:
|
|
|
|
fi
|
2009-03-11 23:49:07 +03:00
|
|
|
|
2011-10-30 19:51:33 +04:00
|
|
|
if test "$GCC" = yes; then
|
2012-04-30 16:09:09 +04:00
|
|
|
# optflags
|
|
|
|
|
2011-10-30 19:51:33 +04:00
|
|
|
AS_CASE(["$target_os"], [mingw*], [
|
|
|
|
RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [optflags="${optflags+$optflags }-fno-omit-frame-pointer"])
|
|
|
|
])
|
2012-04-30 16:09:09 +04:00
|
|
|
|
|
|
|
# disable fast-math
|
2012-05-01 00:02:34 +04:00
|
|
|
for oflag in -fno-fast-math; do
|
2012-05-01 00:14:26 +04:00
|
|
|
RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(optflags, $oflag)])
|
2012-05-01 00:02:34 +04:00
|
|
|
done
|
2011-10-30 19:51:33 +04:00
|
|
|
fi
|
|
|
|
|
2009-04-06 21:25:28 +04:00
|
|
|
test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ARCH_FLAG\""
|
|
|
|
test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cxxflags $ARCH_FLAG\""
|
2009-03-13 12:58:05 +03:00
|
|
|
|
2002-03-14 09:23:46 +03:00
|
|
|
dnl check for large file stuff
|
2007-10-13 23:08:37 +04:00
|
|
|
mv confdefs.h confdefs1.h
|
|
|
|
: > confdefs.h
|
2002-03-14 09:23:46 +03:00
|
|
|
AC_SYS_LARGEFILE
|
2007-10-13 23:08:37 +04:00
|
|
|
mv confdefs.h largefile.h
|
|
|
|
mv confdefs1.h confdefs.h
|
|
|
|
cat largefile.h >> confdefs.h
|
2002-03-14 09:23:46 +03:00
|
|
|
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE(["$target_os"],[mingw*], [ac_cv_type_off_t=yes;ac_cv_sizeof_off_t=8])
|
2006-08-12 10:56:09 +04:00
|
|
|
|
2010-11-11 17:32:15 +03:00
|
|
|
AC_C_BIGENDIAN
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_CHAR_UNSIGNED
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_C_VOLATILE
|
|
|
|
|
2010-11-11 17:38:36 +03:00
|
|
|
AS_CASE(":$ac_cv_c_const:$ac_cv_c_volatile:",
|
|
|
|
[*:no:*], [AC_MSG_ERROR(ANSI C-conforming const and volatile are mandatory)])
|
|
|
|
|
2008-12-24 07:33:39 +03:00
|
|
|
AC_CHECK_TYPES([long long, off_t])
|
|
|
|
|
2009-03-08 05:40:00 +03:00
|
|
|
AC_CACHE_CHECK([char bit], [rb_cv_char_bit],
|
2009-08-24 08:14:12 +04:00
|
|
|
[test "$universal_binary" = yes && cross_compiling=yes
|
2009-08-13 13:40:12 +04:00
|
|
|
AC_COMPUTE_INT([rb_cv_char_bit], [CHAR_BIT],
|
|
|
|
[AC_INCLUDES_DEFAULT([@%:@include <limits.h>])], [rb_cv_char_bit=8])
|
2009-08-24 08:14:12 +04:00
|
|
|
test "$universal_binary" = yes && cross_compiling=$real_cross_compiling])
|
2009-03-08 05:40:00 +03:00
|
|
|
|
2009-03-09 22:43:24 +03:00
|
|
|
dnl RUBY_CHECK_SIZEOF [typename], [maybe same size types], [macros], [include]
|
2009-03-08 05:40:00 +03:00
|
|
|
AC_DEFUN([RUBY_CHECK_SIZEOF],
|
2009-03-19 12:49:51 +03:00
|
|
|
[m4_bmatch([$1], [\.], [], [if test "$universal_binary" = yes; then])
|
2009-03-12 03:30:55 +03:00
|
|
|
AC_CACHE_CHECK([size of $1], [AS_TR_SH([ac_cv_sizeof_$1])], [
|
2009-03-08 05:40:00 +03:00
|
|
|
unset AS_TR_SH(ac_cv_sizeof_$1)
|
2009-03-19 12:49:51 +03:00
|
|
|
rbcv_var="
|
|
|
|
typedef m4_bpatsubst([$1], [\..*]) ac__type_sizeof_;
|
|
|
|
static ac__type_sizeof_ *rbcv_ptr;
|
|
|
|
@%:@define AS_TR_CPP(SIZEOF_$1) sizeof((*rbcv_ptr)[]m4_bmatch([$1], [\.], .m4_bpatsubst([$1], [^[^.]*\.])))
|
|
|
|
"
|
2009-03-08 05:40:00 +03:00
|
|
|
m4_ifval([$2], [test -z "${AS_TR_SH(ac_cv_sizeof_$1)+set}" && {
|
|
|
|
for t in $2; do
|
2009-03-07 16:06:05 +03:00
|
|
|
AC_COMPILE_IFELSE(
|
2009-03-24 13:23:45 +03:00
|
|
|
[AC_LANG_BOOL_COMPILE_TRY(AC_INCLUDES_DEFAULT([$4]
|
|
|
|
[$rbcv_var]),
|
2009-03-19 12:49:51 +03:00
|
|
|
[AS_TR_CPP(SIZEOF_$1) == sizeof($t)])], [
|
2009-03-08 05:40:00 +03:00
|
|
|
AS_TR_SH(ac_cv_sizeof_$1)=AS_TR_CPP([SIZEOF_]$t)
|
|
|
|
break])
|
|
|
|
done
|
|
|
|
}])
|
|
|
|
unset cond
|
2009-03-12 03:30:55 +03:00
|
|
|
m4_ifval([$3], [test -z "${AS_TR_SH(ac_cv_sizeof_$1)+set}" && {
|
2009-03-08 05:40:00 +03:00
|
|
|
for s in 32 64 128; do
|
|
|
|
for t in $3; do
|
|
|
|
cond="${cond}
|
|
|
|
@%:@${cond+el}if defined(__${t}${s}__) || defined(__${t}${s}) || defined(_${t}${s}) || defined(${t}${s})"
|
2009-03-24 13:23:45 +03:00
|
|
|
hdr="AC_INCLUDES_DEFAULT([$4
|
2009-03-08 05:40:00 +03:00
|
|
|
@%:@if defined(__${t}${s}__) || defined(__${t}${s}) || defined(_${t}${s}) || defined(${t}${s})
|
|
|
|
@%:@ define AS_TR_CPP(HAVE_$1) 1
|
|
|
|
@%:@else
|
|
|
|
@%:@ define AS_TR_CPP(HAVE_$1) 0
|
|
|
|
@%:@endif])"
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$hdr], [!AS_TR_CPP(HAVE_$1)])], [continue])
|
2009-03-19 12:49:51 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$hdr]
|
|
|
|
[$rbcv_var],
|
|
|
|
[AS_TR_CPP(HAVE_$1) == (AS_TR_CPP(SIZEOF_$1) == ([$[s / rb_cv_char_bit]]))])],
|
2009-03-08 05:40:00 +03:00
|
|
|
[AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}${s}"])
|
|
|
|
done
|
|
|
|
done
|
|
|
|
}])
|
2012-08-21 20:18:02 +04:00
|
|
|
m4_ifval([$2][$3],
|
|
|
|
[test "${AS_TR_SH(ac_cv_sizeof_$1)@%:@SIZEOF_}" = "${AS_TR_SH(ac_cv_sizeof_$1)}" && ]){
|
2009-08-24 08:14:12 +04:00
|
|
|
test "$universal_binary" = yes && cross_compiling=yes
|
2009-08-13 13:40:12 +04:00
|
|
|
AC_COMPUTE_INT([t], AS_TR_CPP(SIZEOF_$1), [AC_INCLUDES_DEFAULT([$4])]
|
2009-03-09 22:43:24 +03:00
|
|
|
[${cond+$cond
|
|
|
|
@%:@else}
|
2009-03-19 12:49:51 +03:00
|
|
|
$rbcv_var
|
2009-03-09 22:43:24 +03:00
|
|
|
${cond+@%:@endif}
|
2009-03-08 05:40:00 +03:00
|
|
|
@%:@ifndef AS_TR_CPP(SIZEOF_$1)
|
|
|
|
@%:@define AS_TR_CPP(SIZEOF_$1) 0
|
2009-08-13 13:22:12 +04:00
|
|
|
@%:@endif], [t=0])
|
2009-08-24 08:14:12 +04:00
|
|
|
test "$universal_binary" = yes && cross_compiling=$real_cross_compiling
|
2009-03-08 05:40:00 +03:00
|
|
|
if test ${t-0} != 0; then
|
|
|
|
AS_TR_SH(ac_cv_sizeof_$1)="${AS_TR_SH(ac_cv_sizeof_$1)+${AS_TR_SH(ac_cv_sizeof_$1)-} }${t}"
|
|
|
|
fi
|
2012-08-21 20:18:02 +04:00
|
|
|
}
|
2009-03-09 22:43:24 +03:00
|
|
|
: ${AS_TR_SH(ac_cv_sizeof_$1)=0}
|
2009-03-08 05:40:00 +03:00
|
|
|
])
|
|
|
|
{
|
|
|
|
unset cond
|
|
|
|
for t in ${AS_TR_SH(ac_cv_sizeof_$1)-}; do
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$t"],
|
|
|
|
[[[0-9]*|SIZEOF_*]], [
|
2009-03-08 05:40:00 +03:00
|
|
|
${cond+echo "@%:@else"}
|
|
|
|
echo "[@%:@define ]AS_TR_CPP(SIZEOF_$1) [$t]"
|
|
|
|
break
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[
|
2009-03-08 05:40:00 +03:00
|
|
|
s=`expr $t : ['.*[^0-9]\([0-9][0-9]*\)$']`
|
|
|
|
echo "@%:@${cond+el}if defined(__${t}__) || defined(__${t}) || defined(_${t}) || defined($t)"
|
|
|
|
echo "@%:@define AS_TR_CPP(SIZEOF_$1) [$[s / rb_cv_char_bit]]"
|
|
|
|
cond=1
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2009-03-07 16:06:05 +03:00
|
|
|
done
|
2009-03-08 05:40:00 +03:00
|
|
|
${cond+echo "@%:@endif"}
|
|
|
|
} >> confdefs.h
|
2009-03-19 12:49:51 +03:00
|
|
|
m4_bmatch([$1], [\.], [], [else
|
2009-03-13 17:01:13 +03:00
|
|
|
AC_CHECK_SIZEOF([$1], 0, [$4])
|
2009-03-19 12:49:51 +03:00
|
|
|
fi])
|
2009-03-08 05:40:00 +03:00
|
|
|
])
|
|
|
|
|
|
|
|
RUBY_CHECK_SIZEOF(int, [], [ILP])
|
|
|
|
RUBY_CHECK_SIZEOF(short)
|
|
|
|
RUBY_CHECK_SIZEOF(long, [int], [ILP LP])
|
|
|
|
RUBY_CHECK_SIZEOF(long long)
|
|
|
|
RUBY_CHECK_SIZEOF(__int64)
|
|
|
|
RUBY_CHECK_SIZEOF(off_t)
|
|
|
|
RUBY_CHECK_SIZEOF(void*, [int long "long long"], [ILP LP LLP])
|
|
|
|
RUBY_CHECK_SIZEOF(float)
|
|
|
|
RUBY_CHECK_SIZEOF(double)
|
2009-03-24 13:23:45 +03:00
|
|
|
RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>])
|
2009-03-07 16:06:05 +03:00
|
|
|
|
2010-11-11 14:49:54 +03:00
|
|
|
AC_DEFUN([RUBY_CHECK_PRINTF_PREFIX], [
|
2010-11-11 17:29:42 +03:00
|
|
|
AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[
|
2010-11-11 14:49:54 +03:00
|
|
|
[rb_cv_pri_prefix_]AS_TR_SH($1)=[NONE]
|
2010-11-11 17:29:42 +03:00
|
|
|
RUBY_WERROR_FLAG(for pri in $2; do
|
|
|
|
AC_TRY_COMPILE(
|
2010-11-11 14:49:54 +03:00
|
|
|
[@%:@include <stdio.h>
|
|
|
|
@%:@include <stddef.h>
|
|
|
|
@%:@ifdef __GNUC__
|
|
|
|
@%:@define PRINTF_ARGS(decl, string_index, first_to_check) \
|
|
|
|
decl __attribute__((format(printf, string_index, first_to_check)))
|
|
|
|
@%:@else
|
|
|
|
@%:@define PRINTF_ARGS(decl, string_index, first_to_check) decl
|
|
|
|
@%:@endif
|
|
|
|
PRINTF_ARGS(void test_sprintf(const char*, ...), 1, 2);],
|
|
|
|
[printf("%]${pri}[d", (]$1[)42);
|
|
|
|
test_sprintf("%]${pri}[d", (]$1[)42);],
|
2010-11-11 17:29:42 +03:00
|
|
|
[rb_cv_pri_prefix_]AS_TR_SH($1)[=[$pri]; break])
|
|
|
|
done)])
|
2010-11-11 14:49:54 +03:00
|
|
|
if test "[$rb_cv_pri_prefix_]AS_TR_SH($1)" != NONE; then
|
|
|
|
AC_DEFINE_UNQUOTED([PRI_]m4_ifval($3,$3,AS_TR_CPP(m4_bpatsubst([$1],[_t$])))[_PREFIX],
|
|
|
|
"[$rb_cv_pri_prefix_]AS_TR_SH($1)")
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "x$ac_cv_type_long_long" = xyes; then
|
|
|
|
RUBY_CHECK_PRINTF_PREFIX(long long, ll I64, LL)
|
|
|
|
elif test "x$ac_cv_type___int64" = xyes; then
|
|
|
|
RUBY_CHECK_PRINTF_PREFIX(__int64, ll I64, LL)
|
|
|
|
fi
|
|
|
|
|
2007-02-19 16:16:12 +03:00
|
|
|
dnl RUBY_REPLACE_TYPE [typename] [default type] [macro type] [included]
|
* configure.in (pid_t, uid_t, gid_t): check if defined.
* intern.h, process.c, rubyio.h, ext/etc/etc.c, ext/pty/pty.c: use
rb_{pid,uid,gid}_t instead of plain int. [ruby-dev:30376]
* ext/etc/extconf.rb (PIDT2NUM, NUM2PIDT, UIDT2NUM, NUM2UIDT, GIDT2NUM,
NUM2GIDT): moved to configure.in.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-18 07:11:57 +03:00
|
|
|
AC_DEFUN([RUBY_REPLACE_TYPE], [dnl
|
2011-03-08 03:07:19 +03:00
|
|
|
AC_CHECK_TYPE([$1],
|
|
|
|
[n="patsubst([$1],["],[\\"])"],
|
|
|
|
[n="patsubst([$2],["],[\\"])"],
|
|
|
|
[$4])
|
2007-02-19 16:16:12 +03:00
|
|
|
AC_CACHE_CHECK([for convertible type of [$1]], rb_cv_[$1]_convertible, [
|
|
|
|
u= t=
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$n "],
|
|
|
|
[*" signed "*], [ ],
|
|
|
|
[*" unsigned "*], [
|
|
|
|
u=U],
|
|
|
|
[
|
2009-01-16 05:41:26 +03:00
|
|
|
AC_COMPILE_IFELSE(
|
2009-03-19 12:49:51 +03:00
|
|
|
[AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])], [($n)-1 > 0])],
|
2010-01-21 03:38:03 +03:00
|
|
|
[u=U])])
|
2009-03-19 12:49:51 +03:00
|
|
|
if test x"$t" = x; then
|
|
|
|
for t in "long long" long int short; do
|
|
|
|
test -n "$u" && t="unsigned $t"
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([$4])]
|
|
|
|
[typedef $n rbcv_conftest_target_type;
|
|
|
|
typedef $t rbcv_conftest_replace_type;
|
|
|
|
extern rbcv_conftest_target_type rbcv_conftest_var;
|
2011-01-31 15:59:54 +03:00
|
|
|
extern rbcv_conftest_replace_type rbcv_conftest_var;
|
2009-03-19 12:49:51 +03:00
|
|
|
extern rbcv_conftest_target_type rbcv_conftest_func(void);
|
2011-01-31 15:59:54 +03:00
|
|
|
extern rbcv_conftest_replace_type rbcv_conftest_func(void);
|
2009-03-19 12:49:51 +03:00
|
|
|
], [sizeof(rbcv_conftest_target_type) == sizeof(rbcv_conftest_replace_type)])],
|
|
|
|
[n="$t"; break])
|
|
|
|
done
|
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE([" $n "],
|
|
|
|
[*" long long "*], [
|
|
|
|
t=LL],
|
|
|
|
[*" long "*], [
|
|
|
|
t=LONG],
|
|
|
|
[
|
|
|
|
t=INT])
|
2007-02-19 16:16:12 +03:00
|
|
|
rb_cv_[$1]_convertible=${u}${t}])
|
2009-09-11 09:17:34 +04:00
|
|
|
test "${AS_TR_SH(ac_cv_type_[$1])}" = "yes" && n="$1"
|
|
|
|
AC_DEFINE_UNQUOTED(rb_[$1], $n)
|
2007-02-19 16:16:12 +03:00
|
|
|
AC_DEFINE_UNQUOTED([$3]2NUM[(v)], [${rb_cv_[$1]_convertible}2NUM(v)])
|
|
|
|
AC_DEFINE_UNQUOTED(NUM2[$3][(v)], [NUM2${rb_cv_[$1]_convertible}(v)])
|
2009-04-07 08:10:21 +04:00
|
|
|
AC_DEFINE_UNQUOTED(PRI_[$3]_PREFIX,
|
2010-11-11 14:49:54 +03:00
|
|
|
[PRI_`echo ${rb_cv_[$1]_convertible} | sed ['s/^U//']`_PREFIX])
|
* configure.in (pid_t, uid_t, gid_t): check if defined.
* intern.h, process.c, rubyio.h, ext/etc/etc.c, ext/pty/pty.c: use
rb_{pid,uid,gid}_t instead of plain int. [ruby-dev:30376]
* ext/etc/extconf.rb (PIDT2NUM, NUM2PIDT, UIDT2NUM, NUM2UIDT, GIDT2NUM,
NUM2GIDT): moved to configure.in.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-18 07:11:57 +03:00
|
|
|
])
|
2007-02-19 16:16:12 +03:00
|
|
|
RUBY_REPLACE_TYPE(pid_t, int, PIDT)
|
|
|
|
RUBY_REPLACE_TYPE(uid_t, int, UIDT)
|
|
|
|
RUBY_REPLACE_TYPE(gid_t, int, GIDT)
|
2009-01-16 05:41:26 +03:00
|
|
|
RUBY_REPLACE_TYPE(time_t, [], TIMET, [@%:@include <time.h>])
|
2010-10-15 15:30:33 +04:00
|
|
|
RUBY_REPLACE_TYPE(dev_t, [int long "long long"], DEVT)
|
2011-01-28 05:00:08 +03:00
|
|
|
RUBY_REPLACE_TYPE(mode_t, ["unsigned int" long], MODET, [@%:@include <sys/stat.h>])
|
2011-03-06 17:47:27 +03:00
|
|
|
RUBY_REPLACE_TYPE(rlim_t, [int long "long long"], RLIM, [@%:@include <sys/resource.h>])
|
2005-05-14 18:57:53 +04:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
|
1999-01-20 07:59:39 +03:00
|
|
|
[AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
|
|
|
|
rb_cv_have_prototypes=yes,
|
|
|
|
rb_cv_have_prototypes=no)])
|
|
|
|
if test "$rb_cv_have_prototypes" = yes; then
|
|
|
|
AC_DEFINE(HAVE_PROTOTYPES)
|
|
|
|
fi
|
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste,
|
2012-08-21 20:18:05 +04:00
|
|
|
[AC_TRY_COMPILE([@%:@define paste(a,b) a@%:@@%:@b],
|
1999-08-13 09:45:20 +04:00
|
|
|
[int xy = 1; return paste(x,y);],
|
|
|
|
rb_cv_tokenpaste=ansi,
|
|
|
|
rb_cv_tokenpaste=knr)])
|
|
|
|
if test "$rb_cv_tokenpaste" = ansi; then
|
2012-08-21 20:18:05 +04:00
|
|
|
AC_DEFINE(TOKEN_PASTE(x,y),[x@%:@@%:@y])
|
1999-08-13 09:45:20 +04:00
|
|
|
else
|
|
|
|
AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y])
|
|
|
|
fi
|
|
|
|
|
2007-12-22 09:14:50 +03:00
|
|
|
AC_CACHE_CHECK(stringization, rb_cv_stringization, [
|
|
|
|
rb_cv_stringization=no
|
|
|
|
for string in "#expr" '"expr"'; do
|
|
|
|
AC_COMPILE_IFELSE([
|
|
|
|
AC_LANG_BOOL_COMPILE_TRY([
|
|
|
|
#define STRINGIZE0(expr) $string
|
|
|
|
#define STRINGIZE(expr) STRINGIZE0(expr)
|
|
|
|
#undef real_test_for_stringization
|
|
|
|
#define test_for_stringization -.real_test_for_stringization.-
|
|
|
|
const char stringized[[]] = STRINGIZE(test_for_stringization);
|
|
|
|
], [sizeof(stringized) == 32])],
|
|
|
|
[rb_cv_stringization="$string"; break],
|
|
|
|
[rb_cv_stringization=no])
|
|
|
|
done]
|
|
|
|
)
|
|
|
|
AC_DEFINE(STRINGIZE(expr),STRINGIZE0(expr))
|
|
|
|
if test x"$rb_cv_stringization" != xno -a "$rb_cv_stringization" != "#expr"; then
|
|
|
|
AC_DEFINE_UNQUOTED(STRINGIZE0(expr),$rb_cv_stringization)
|
|
|
|
AC_DEFINE(OLD_FASHIONED_STRINGIZATION,1)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([string literal concatenation],
|
|
|
|
rb_cv_string_literal_concatenation, [
|
|
|
|
AC_COMPILE_IFELSE([
|
|
|
|
AC_LANG_BOOL_COMPILE_TRY([
|
|
|
|
const char concatenated_literal[[]] = "literals" "to"
|
|
|
|
"be" "concatenated.";
|
|
|
|
], [sizeof(concatenated_literal) == 26])],
|
|
|
|
[rb_cv_string_literal_concatenation=yes],
|
|
|
|
[rb_cv_string_literal_concatenation=no])]
|
|
|
|
)
|
|
|
|
if test "$rb_cv_string_literal_concatenation" = no; then
|
|
|
|
AC_DEFINE(NO_STRING_LITERAL_CONCATENATION,1)
|
|
|
|
fi
|
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg,
|
1999-01-20 07:59:39 +03:00
|
|
|
[AC_TRY_COMPILE([
|
|
|
|
#include <stdarg.h>
|
|
|
|
int foo(int x, ...) {
|
|
|
|
va_list va;
|
|
|
|
va_start(va, x);
|
|
|
|
va_arg(va, int);
|
|
|
|
va_arg(va, char *);
|
|
|
|
va_arg(va, double);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
], [return foo(10, "", 3.14);],
|
|
|
|
rb_cv_stdarg=yes,
|
|
|
|
rb_cv_stdarg=no)])
|
|
|
|
if test "$rb_cv_stdarg" = yes; then
|
|
|
|
AC_DEFINE(HAVE_STDARG_PROTOTYPES)
|
|
|
|
fi
|
|
|
|
|
2008-07-09 15:18:52 +04:00
|
|
|
AC_CACHE_CHECK(for variable length macro, rb_cv_va_args_macro,
|
2011-01-20 18:38:44 +03:00
|
|
|
[AC_TRY_COMPILE([
|
|
|
|
int foo(int x, ...);
|
|
|
|
@%:@define FOO(a, ...) foo(a, @%:@@%:@__VA_ARGS__)
|
|
|
|
], [FOO(1);FOO(1,2);FOO(1,2,3);],
|
2008-07-09 15:18:52 +04:00
|
|
|
rb_cv_va_args_macro=yes,
|
|
|
|
rb_cv_va_args_macro=no)])
|
|
|
|
if test "$rb_cv_va_args_macro" = yes; then
|
|
|
|
AC_DEFINE(HAVE_VA_ARGS_MACRO)
|
|
|
|
fi
|
|
|
|
|
2009-02-07 12:02:50 +03:00
|
|
|
AC_DEFUN([RUBY_DEFINE_IF], [dnl
|
2011-10-27 13:28:21 +04:00
|
|
|
m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
|
|
|
|
@%:@if $1
|
|
|
|
EOH
|
|
|
|
])dnl
|
2011-10-27 09:56:24 +04:00
|
|
|
AC_DEFINE_UNQUOTED($2, $3)dnl
|
2011-10-27 13:28:21 +04:00
|
|
|
m4_ifval([$1], [AS_LITERAL_IF([$1], [], [test "X$1" = X || ])cat <<EOH >> confdefs.h
|
|
|
|
@%:@endif /* $1 */
|
|
|
|
EOH
|
|
|
|
])dnl
|
2009-02-07 12:02:50 +03:00
|
|
|
])dnl
|
|
|
|
|
2010-07-22 07:58:18 +04:00
|
|
|
dnl RUBY_FUNC_ATTRIBUTE(attrib, macroname, cachevar, condition)
|
2006-07-25 20:04:35 +04:00
|
|
|
AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
|
2005-04-30 06:59:44 +04:00
|
|
|
m4_ifval([$2], dnl
|
|
|
|
[AS_VAR_PUSHDEF([attrib],[$2])], dnl
|
|
|
|
[AS_VAR_PUSHDEF([attrib],[FUNC_]AS_TR_CPP($1))] dnl
|
|
|
|
)dnl
|
|
|
|
m4_ifval([$3], dnl
|
|
|
|
[AS_VAR_PUSHDEF([rbcv],[$3])], dnl
|
|
|
|
[AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl
|
|
|
|
)dnl
|
2011-10-27 09:56:24 +04:00
|
|
|
m4_ifval([$4], [rbcv_cond=["$4"]; test "$rbcv_cond" || unset rbcv_cond])
|
2005-04-30 06:59:44 +04:00
|
|
|
AC_CACHE_CHECK(for [$1] function attribute, rbcv,
|
|
|
|
[rbcv=x
|
2010-07-22 07:58:18 +04:00
|
|
|
RUBY_WERROR_FLAG([
|
2005-10-11 16:29:11 +04:00
|
|
|
for mac in "__attribute__ (($1)) x" "x __attribute__ (($1))" "__declspec($1) x" x; do
|
2009-02-07 12:02:50 +03:00
|
|
|
m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"})
|
2001-01-10 11:09:01 +03:00
|
|
|
AC_TRY_COMPILE(
|
2009-02-07 12:02:50 +03:00
|
|
|
m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond})
|
|
|
|
[@%:@define ]attrib[(x) $mac]
|
|
|
|
m4_ifval([$4],${rbcv_cond+[@%:@else]}
|
|
|
|
${rbcv_cond+[@%:@define ]attrib[(x) x]}
|
|
|
|
${rbcv_cond+[@%:@endif]})
|
|
|
|
attrib[(void conftest_attribute_check(void));], [],
|
2005-04-30 06:59:44 +04:00
|
|
|
[rbcv="$mac"; break])
|
|
|
|
done
|
2010-07-22 07:58:18 +04:00
|
|
|
])])
|
2009-02-07 12:02:50 +03:00
|
|
|
if test "$rbcv" != x; then
|
2011-10-27 09:56:24 +04:00
|
|
|
RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[(x)], $rbcv)
|
2009-02-07 12:02:50 +03:00
|
|
|
fi
|
2011-10-27 09:56:24 +04:00
|
|
|
m4_ifval([$4], [unset rbcv_cond])dnl
|
|
|
|
AS_VAR_POPDEF([attrib])dnl
|
|
|
|
AS_VAR_POPDEF([rbcv])dnl
|
2005-04-30 06:59:44 +04:00
|
|
|
])
|
|
|
|
|
|
|
|
RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
|
|
|
|
RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
|
|
|
|
RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)
|
2009-02-07 12:02:50 +03:00
|
|
|
|
|
|
|
if_i386=${universal_binary+[defined __i386__]}
|
|
|
|
RUBY_FUNC_ATTRIBUTE(stdcall, [], [], ${if_i386})
|
|
|
|
RUBY_FUNC_ATTRIBUTE(cdecl, [], [], ${if_i386})
|
|
|
|
RUBY_FUNC_ATTRIBUTE(fastcall, [], [], ${if_i386})
|
2001-01-10 11:09:01 +03:00
|
|
|
|
2008-08-13 19:43:55 +04:00
|
|
|
if test "$GCC" = yes; then
|
|
|
|
AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias],
|
|
|
|
[rb_cv_gcc_function_alias=no
|
|
|
|
for a in alias weak,alias; do
|
|
|
|
AC_TRY_LINK([void foo(void) {}
|
|
|
|
void bar(void) __attribute__(($a("foo")));], [bar()],
|
|
|
|
[rb_cv_gcc_function_alias=$a; break])
|
|
|
|
done])
|
2009-01-19 11:24:10 +03:00
|
|
|
if test "$rb_cv_gcc_function_alias" != no; then
|
2009-01-19 11:28:28 +03:00
|
|
|
AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args)],
|
2009-01-19 11:24:10 +03:00
|
|
|
[type prot __attribute__(($rb_cv_gcc_function_alias(@%:@name)));])
|
|
|
|
AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_VOID(prot, name, args)],
|
2009-01-19 11:28:28 +03:00
|
|
|
[RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)])
|
2008-08-13 19:43:55 +04:00
|
|
|
fi
|
2010-10-26 04:13:37 +04:00
|
|
|
AC_CACHE_CHECK([for atomic builtins], [rb_cv_gcc_atomic_builtins], [
|
|
|
|
AC_TRY_LINK([unsigned char atomic_var;],
|
|
|
|
[
|
|
|
|
__sync_lock_test_and_set(&atomic_var, 0);
|
|
|
|
__sync_lock_test_and_set(&atomic_var, 1);
|
|
|
|
__sync_fetch_and_add(&atomic_var, 1);
|
|
|
|
__sync_fetch_and_sub(&atomic_var, 1);
|
|
|
|
],
|
|
|
|
[rb_cv_gcc_atomic_builtins=yes],
|
|
|
|
[rb_cv_gcc_atomic_builtins=no])])
|
|
|
|
if test "$rb_cv_gcc_atomic_builtins" = yes; then
|
|
|
|
AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
|
|
|
|
fi
|
2012-02-24 10:49:09 +04:00
|
|
|
|
|
|
|
AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
|
2012-04-14 07:55:06 +04:00
|
|
|
[RUBY_WERROR_FLAG(
|
2012-02-24 10:49:09 +04:00
|
|
|
[AC_TRY_LINK([@%:@include <stdlib.h>],
|
|
|
|
[exit(0); __builtin_unreachable();],
|
|
|
|
[rb_cv_func___builtin_unreachable=yes],
|
|
|
|
[rb_cv_func___builtin_unreachable=no])
|
|
|
|
])
|
2012-04-14 07:55:06 +04:00
|
|
|
])
|
2012-02-24 10:49:09 +04:00
|
|
|
if test "$rb_cv_func___builtin_unreachable" = yes; then
|
|
|
|
AC_DEFINE_UNQUOTED(UNREACHABLE, [__builtin_unreachable()])
|
|
|
|
fi
|
2008-08-13 19:43:55 +04:00
|
|
|
fi
|
|
|
|
|
2010-08-14 10:33:06 +04:00
|
|
|
AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
|
|
|
|
rb_cv_func_exported=no
|
|
|
|
RUBY_WERROR_FLAG([
|
|
|
|
for mac in '__attribute__ ((visibility("default")))' '__declspec(dllexport)'; do
|
|
|
|
AC_TRY_COMPILE([@%:@define RUBY_FUNC_EXPORTED $mac extern
|
|
|
|
RUBY_FUNC_EXPORTED void conftest_attribute_check(void);], [],
|
|
|
|
[rb_cv_func_exported="$mac"; break])
|
|
|
|
done
|
|
|
|
])])
|
|
|
|
if test "$rb_cv_func_exported" != no; then
|
|
|
|
AC_DEFINE_UNQUOTED(RUBY_FUNC_EXPORTED, [$rb_cv_func_exported extern])
|
|
|
|
fi
|
|
|
|
|
2009-02-08 07:09:34 +03:00
|
|
|
RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
|
2005-10-25 21:00:03 +04:00
|
|
|
|
2012-08-21 20:18:10 +04:00
|
|
|
}
|
|
|
|
{ # header and library section
|
2009-02-09 22:34:43 +03:00
|
|
|
|
2002-05-02 11:50:36 +04:00
|
|
|
dnl Check whether we need to define sys_nerr locally
|
2002-05-03 15:24:30 +04:00
|
|
|
AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
|
2012-08-21 20:18:05 +04:00
|
|
|
@%:@include <errno.h>])
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2011-12-24 19:05:33 +04:00
|
|
|
AC_ARG_WITH(winnt-ver,
|
|
|
|
AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0501)]),
|
|
|
|
[with_winnt_ver="$withval"], [with_winnt_ver="0x0501"])
|
2011-12-24 18:24:32 +04:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[mingw*], [
|
2011-12-24 19:05:33 +04:00
|
|
|
RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver)
|
2011-12-24 18:24:32 +04:00
|
|
|
])
|
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[freebsd*], [
|
2007-10-05 11:24:19 +04:00
|
|
|
AC_CACHE_CHECK([whether pthread should be enabled by default],
|
|
|
|
rb_cv_enable_pthread_default,
|
|
|
|
[AC_TRY_CPP([
|
|
|
|
#include <osreldate.h>
|
|
|
|
#if __FreeBSD_version < 502102
|
|
|
|
#error pthread should be disabled on this platform
|
|
|
|
#endif
|
|
|
|
],
|
|
|
|
rb_cv_enable_pthread_default=yes,
|
|
|
|
rb_cv_enable_pthread_default=no)])
|
2009-09-29 16:21:16 +04:00
|
|
|
enable_pthread=$rb_cv_enable_pthread_default
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[mingw*], [
|
2009-09-29 16:21:16 +04:00
|
|
|
enable_pthread=no
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[
|
2009-09-29 16:21:16 +04:00
|
|
|
enable_pthread=yes
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2001-04-01 20:53:41 +04:00
|
|
|
|
2003-11-22 16:58:57 +03:00
|
|
|
AC_ARG_ENABLE(pthread,
|
2009-09-29 16:21:16 +04:00
|
|
|
AS_HELP_STRING([--enable-pthread], [obsolete, and ignored]))
|
2003-11-22 16:58:57 +03:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
dnl Checks for libraries.
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE(["$target_os"],[*bsd*|dragonfly*],[],[ac_cv_func_daemon=no])
|
2009-04-25 13:21:49 +04:00
|
|
|
|
2012-05-08 08:36:04 +04:00
|
|
|
POSTLINK=:
|
|
|
|
AC_SUBST(POSTLINK)
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[nextstep*], [ ],
|
|
|
|
[openstep*], [ ],
|
|
|
|
[rhapsody*], [ ],
|
|
|
|
[darwin*], [ RUBY_PREPEND_OPTION(LIBS, -lobjc)
|
2012-06-13 17:18:05 +04:00
|
|
|
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
|
2009-02-07 12:02:50 +03:00
|
|
|
AC_MSG_CHECKING(whether Mac OS X 10.5 or later)
|
2008-01-11 06:27:46 +03:00
|
|
|
AC_TRY_CPP([#include <AvailabilityMacros.h>
|
|
|
|
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040
|
|
|
|
#error pre OS X 10.4
|
|
|
|
[!<===== pre OS X 10.4 =====>]
|
|
|
|
#endif
|
2008-02-01 15:42:40 +03:00
|
|
|
],
|
2009-02-07 12:02:50 +03:00
|
|
|
[macosx_10_5=yes], [macosx_10_5=no])
|
|
|
|
AC_MSG_RESULT($macosx_10_5)
|
|
|
|
if test $macosx_10_5 = yes; then
|
2008-12-16 06:26:51 +03:00
|
|
|
ac_cv_header_ucontext_h=no
|
2009-02-07 12:02:50 +03:00
|
|
|
else
|
2008-01-11 06:27:46 +03:00
|
|
|
AC_DEFINE(BROKEN_SETREUID, 1)
|
|
|
|
AC_DEFINE(BROKEN_SETREGID, 1)
|
2009-02-07 12:02:50 +03:00
|
|
|
fi
|
|
|
|
ac_cv_type_getgroups=gid_t # getgroups() on Rosetta fills garbage
|
2008-09-07 12:57:53 +04:00
|
|
|
ac_cv_lib_crypt_crypt=no
|
2011-04-03 16:35:29 +04:00
|
|
|
ac_cv_func_fdatasync=no # Mac OS X wrongly reports it has fdatasync()
|
2008-09-07 12:57:53 +04:00
|
|
|
AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt,
|
|
|
|
[AC_TRY_RUN([
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
2009-08-12 06:52:00 +04:00
|
|
|
|
2008-09-07 12:57:53 +04:00
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
2009-08-12 06:52:00 +04:00
|
|
|
int i;
|
|
|
|
for (i = 0; i < 128*128; i++) {
|
|
|
|
char salt[2], buf[256], *s;
|
|
|
|
salt[0] = 0x80 | (i & 0x7f);
|
|
|
|
salt[1] = 0x80 | (i >> 7);
|
|
|
|
strcpy(buf, crypt("", salt));
|
|
|
|
if (strcmp(buf, s = crypt("", salt))) {
|
|
|
|
#if 0
|
|
|
|
printf("%.2x%.2x: %s -> %s\n", (unsigned char)salt[0], (unsigned char)salt[1],
|
|
|
|
buf+2, s+2);
|
|
|
|
#endif
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
2008-09-07 12:57:53 +04:00
|
|
|
}
|
|
|
|
],
|
|
|
|
rb_cv_broken_crypt=no,
|
|
|
|
rb_cv_broken_crypt=yes,
|
|
|
|
rb_cv_broken_crypt=yes)])
|
|
|
|
if test "$rb_cv_broken_crypt" = yes; then
|
|
|
|
AC_DEFINE(BROKEN_CRYPT, 1)
|
|
|
|
fi
|
2012-05-07 08:41:02 +04:00
|
|
|
if test "${RUBY_CODESIGN:+set}"; then
|
|
|
|
AC_CHECK_PROGS(codesign, codesign)
|
|
|
|
POSTLINK="$ac_cv_prog_codesign -s '$RUBY_CODESIGN' -f \$@"
|
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[hpux*], [ LIBS="-lm $LIBS"
|
|
|
|
ac_cv_c_inline=no],
|
|
|
|
[beos*|haiku*], [
|
2009-02-09 22:34:43 +03:00
|
|
|
ac_cv_func_link=no
|
2008-08-08 12:03:19 +04:00
|
|
|
ac_cv_func_sched_yield=no
|
|
|
|
ac_cv_func_pthread_attr_setinheritsched=no
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[beos*], [ ac_cv_header_net_socket_h=yes],
|
|
|
|
[haiku*], [ ac_cv_func_shutdown=no])
|
2008-08-08 12:03:19 +04:00
|
|
|
LIBS="$LIBS" # m lib is include in root under BeOS/Haiku
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[cygwin*], [ ac_cv_header_langinfo_h=yes
|
2010-11-11 15:24:41 +03:00
|
|
|
AC_CHECK_FUNCS(cygwin_conv_path)
|
2009-01-05 11:51:44 +03:00
|
|
|
AC_LIBOBJ([langinfo])
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
2012-08-24 07:44:56 +04:00
|
|
|
[mingw*], [ LIBS="-lshell32 -lws2_32 -limagehlp -lshlwapi $LIBS"
|
2000-05-13 20:13:31 +04:00
|
|
|
ac_cv_header_a_out_h=no
|
|
|
|
ac_cv_header_pwd_h=no
|
|
|
|
ac_cv_header_utime_h=no
|
|
|
|
ac_cv_header_sys_ioctl_h=no
|
|
|
|
ac_cv_header_sys_param_h=no
|
|
|
|
ac_cv_header_sys_resource_h=no
|
|
|
|
ac_cv_header_sys_select_h=no
|
2006-06-27 11:21:31 +04:00
|
|
|
ac_cv_header_sys_time_h=no
|
2000-08-15 11:11:13 +04:00
|
|
|
ac_cv_header_sys_times_h=no
|
2008-08-08 12:03:19 +04:00
|
|
|
ac_cv_header_sys_socket_h=no
|
2001-06-01 06:25:28 +04:00
|
|
|
ac_cv_func_times=yes
|
2002-05-22 15:23:11 +04:00
|
|
|
ac_cv_func_waitpid=yes
|
2003-05-13 12:59:36 +04:00
|
|
|
ac_cv_func_fsync=yes
|
2002-06-30 13:07:54 +04:00
|
|
|
ac_cv_func_seekdir=yes
|
|
|
|
ac_cv_func_telldir=yes
|
2003-12-22 11:09:14 +03:00
|
|
|
ac_cv_func_isinf=yes
|
|
|
|
ac_cv_func_isnan=yes
|
|
|
|
ac_cv_func_finite=yes
|
2004-02-12 08:20:09 +03:00
|
|
|
ac_cv_func_link=yes
|
2006-08-12 10:56:09 +04:00
|
|
|
ac_cv_func_fseeko=yes
|
2002-12-26 18:12:06 +03:00
|
|
|
ac_cv_lib_crypt_crypt=no
|
2004-11-07 18:16:27 +03:00
|
|
|
ac_cv_func_getpgrp_void=no
|
|
|
|
ac_cv_func_memcmp_working=yes
|
2006-07-17 08:22:46 +04:00
|
|
|
ac_cv_lib_dl_dlopen=no
|
2004-11-07 18:16:27 +03:00
|
|
|
rb_cv_binary_elf=no
|
|
|
|
rb_cv_negative_time_t=no
|
2007-02-28 15:47:01 +03:00
|
|
|
ac_cv_func_fcntl=yes
|
2009-02-13 03:43:31 +03:00
|
|
|
ac_cv_func_flock=yes
|
2012-04-16 11:22:43 +04:00
|
|
|
ac_cv_func_gmtime_r=yes
|
2010-05-26 05:35:38 +04:00
|
|
|
rb_cv_large_fd_select=yes
|
2009-01-15 07:10:16 +03:00
|
|
|
AC_LIBOBJ([langinfo])
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[os2-emx*], [ LIBS="-lm $LIBS"
|
|
|
|
ac_cv_lib_dir_opendir=no],
|
|
|
|
[bsdi*], [ LIBS="-lm $LIBS"
|
2008-01-11 06:27:46 +03:00
|
|
|
AC_DEFINE(BROKEN_SETREUID, 1)
|
|
|
|
AC_DEFINE(BROKEN_SETREGID, 1)
|
2010-01-21 03:38:03 +03:00
|
|
|
ac_cv_sizeof_rlim_t=8],
|
|
|
|
[freebsd*], [ LIBS="-lm $LIBS"
|
2010-07-07 05:29:22 +04:00
|
|
|
ac_cv_func_getpeername=no
|
|
|
|
ac_cv_func_getsockname=no
|
|
|
|
ac_cv_func_shutdown=no
|
|
|
|
ac_cv_func_close=no
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[dragonfly*], [ LIBS="-lm $LIBS"
|
2012-11-12 14:26:28 +04:00
|
|
|
# isinf() and isnan() are macros on DragonFly.
|
|
|
|
ac_cv_func_isinf=yes
|
|
|
|
ac_cv_func_isnan=yes
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[bow], [ ac_cv_func_setitimer=no
|
|
|
|
],
|
|
|
|
[superux*], [ ac_cv_func_setitimer=no
|
2010-02-03 16:20:43 +03:00
|
|
|
],
|
2012-05-17 06:48:59 +04:00
|
|
|
[nacl], [
|
|
|
|
LIBS="-lm -lnosys $LIBS"
|
|
|
|
if test "${nacl_cv_build_variant}" = "newlib"; then
|
|
|
|
RUBY_APPEND_OPTION(CPPFLAGS, -DNACL_NEWLIB)
|
|
|
|
else
|
|
|
|
RUBY_APPEND_OPTION(XCFLAGS, -fPIC)
|
|
|
|
fi
|
2012-08-22 05:12:52 +04:00
|
|
|
ac_cv_func_shutdown=no
|
2012-05-17 06:48:59 +04:00
|
|
|
],
|
2010-02-03 16:20:43 +03:00
|
|
|
[ LIBS="-lm $LIBS"])
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_CHECK_LIB(crypt, crypt)
|
|
|
|
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
|
|
|
|
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
|
2004-12-06 17:09:33 +03:00
|
|
|
AC_CHECK_LIB(socket, socketpair) # SunOS/Solaris
|
* configure.in: check struct timespec, clock_gettime, utimensat,
struct stat.st_atim,
struct stat.st_atimespec,
struct stat.st_atimensec,
struct stat.st_mtim,
struct stat.st_mtimespec,
struct stat.st_mtimensec,
struct stat.st_ctim,
struct stat.st_ctimespec,
struct stat.st_ctimensec.
* include/ruby/missing.h: provide struct timespec if not available.
* time.c: support nanosecond-resolution using struct timespec.
* include/ruby/intern.h: provide rb_time_nano_new.
* file.c (utime_internal): use utimensat if available.
(rb_file_s_utime): refactored.
(rb_f_test): use stat_atime, stat_mtime, stat_ctime.
(rb_stat_cmp): check tv_nsec.
(stat_atimespec): new function.
(stat_atime): ditto.
(stat_mtimespec): ditto.
(stat_mtime): ditto.
(stat_ctimespec): ditto.
(stat_ctime): ditto.
(rb_stat_atime): use stat_atime.
(rb_file_s_atime): ditto.
(rb_file_atime): ditto.
(rb_stat_mtime): use stat_mtime.
(rb_file_s_mtime): ditto.
(rb_file_mtime): ditto.
(rb_file_ctime): use stat_ctime.
(rb_file_s_ctime): ditto.
(rb_stat_ctime): ditto.
* variable.c (rb_copy_generic_ivar): clear clone's instance variables
if obj has no instance variable.
* marshal.c (w_object): dump instance variables of generated string
for TYPE_USERDEF, even if original object has instance variables.
* lib/time.rb (Time#xmlschema): use nsec instead of usec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-19 12:09:38 +03:00
|
|
|
AC_CHECK_LIB(rt, clock_gettime) # GNU/Linux
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_cpu"],
|
2010-09-25 04:52:20 +04:00
|
|
|
[alpha*|sh4|sh4el|sh4eb], [AS_CASE(["$target_os"::"$GCC"],
|
2010-01-21 03:38:03 +03:00
|
|
|
[*::yes], # gcc
|
|
|
|
[CFLAGS="-mieee $CFLAGS"],
|
|
|
|
[osf*], # ccc
|
|
|
|
[CFLAGS="-ieee $CFLAGS"],
|
2011-11-15 08:42:31 +04:00
|
|
|
)],
|
|
|
|
[sparc*], [AC_LIBOBJ([sparc])])
|
2003-06-23 23:54:41 +04:00
|
|
|
|
2008-08-08 12:03:19 +04:00
|
|
|
ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no}
|
|
|
|
if test "$ac_cv_header_net_socket_h" = yes; then
|
|
|
|
ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=no}
|
|
|
|
else
|
|
|
|
ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes}
|
|
|
|
fi
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_DIRENT
|
2008-12-24 00:29:34 +03:00
|
|
|
dnl AC_HEADER_STDC has been checked in AC_USE_SYSTEM_EXTENSIONS
|
2009-03-13 04:42:21 +03:00
|
|
|
AC_HEADER_STDBOOL
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_HEADER_SYS_WAIT
|
2008-12-24 00:29:34 +03:00
|
|
|
AC_CHECK_HEADERS(limits.h sys/file.h sys/ioctl.h sys/syscall.h\
|
1999-08-13 09:45:20 +04:00
|
|
|
fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
|
2008-12-24 00:29:34 +03:00
|
|
|
syscall.h pwd.h grp.h a.out.h utime.h direct.h sys/resource.h \
|
2009-05-28 02:39:24 +04:00
|
|
|
sys/mkdev.h sys/utime.h xti.h netinet/in_systm.h float.h ieeefp.h \
|
2008-08-08 12:03:19 +04:00
|
|
|
ucontext.h intrinsics.h langinfo.h locale.h sys/sendfile.h time.h \
|
2011-12-01 02:17:48 +04:00
|
|
|
net/socket.h sys/socket.h process.h sys/prctl.h)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
AC_TYPE_SIZE_T
|
2009-04-06 21:27:50 +04:00
|
|
|
RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>])
|
|
|
|
RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include <stddef.h>])
|
2010-10-12 19:03:51 +04:00
|
|
|
RUBY_CHECK_PRINTF_PREFIX(size_t, z)
|
|
|
|
RUBY_CHECK_PRINTF_PREFIX(ptrdiff_t, t)
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_STRUCT_ST_BLKSIZE
|
|
|
|
AC_STRUCT_ST_BLOCKS
|
|
|
|
AC_STRUCT_ST_RDEV
|
2011-01-28 06:07:23 +03:00
|
|
|
RUBY_CHECK_SIZEOF([struct stat.st_size], [int long "long long"], [], [@%:@include <sys/stat.h>])
|
2009-03-11 23:27:07 +03:00
|
|
|
if test "$ac_cv_member_struct_stat_st_blocks" = yes; then
|
2011-01-28 06:12:32 +03:00
|
|
|
RUBY_CHECK_SIZEOF([struct stat.st_blocks], [int long "long long"], [], [@%:@include <sys/stat.h>])
|
2009-03-11 23:27:07 +03:00
|
|
|
fi
|
* configure.in: check struct timespec, clock_gettime, utimensat,
struct stat.st_atim,
struct stat.st_atimespec,
struct stat.st_atimensec,
struct stat.st_mtim,
struct stat.st_mtimespec,
struct stat.st_mtimensec,
struct stat.st_ctim,
struct stat.st_ctimespec,
struct stat.st_ctimensec.
* include/ruby/missing.h: provide struct timespec if not available.
* time.c: support nanosecond-resolution using struct timespec.
* include/ruby/intern.h: provide rb_time_nano_new.
* file.c (utime_internal): use utimensat if available.
(rb_file_s_utime): refactored.
(rb_f_test): use stat_atime, stat_mtime, stat_ctime.
(rb_stat_cmp): check tv_nsec.
(stat_atimespec): new function.
(stat_atime): ditto.
(stat_mtimespec): ditto.
(stat_mtime): ditto.
(stat_ctimespec): ditto.
(stat_ctime): ditto.
(rb_stat_atime): use stat_atime.
(rb_file_s_atime): ditto.
(rb_file_atime): ditto.
(rb_stat_mtime): use stat_mtime.
(rb_file_s_mtime): ditto.
(rb_file_mtime): ditto.
(rb_file_ctime): use stat_ctime.
(rb_file_s_ctime): ditto.
(rb_stat_ctime): ditto.
* variable.c (rb_copy_generic_ivar): clear clone's instance variables
if obj has no instance variable.
* marshal.c (w_object): dump instance variables of generated string
for TYPE_USERDEF, even if original object has instance variables.
* lib/time.rb (Time#xmlschema): use nsec instead of usec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-19 12:09:38 +03:00
|
|
|
AC_CHECK_MEMBERS([struct stat.st_atim])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_atimespec])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_atimensec])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_mtim])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_mtimespec])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_mtimensec])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_ctim])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_ctimespec])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_ctimensec])
|
|
|
|
|
2008-04-22 10:25:05 +04:00
|
|
|
AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H
|
|
|
|
@%:@include <time.h>
|
2012-05-17 06:48:59 +04:00
|
|
|
@%:@endif
|
|
|
|
@%:@ifdef HAVE_SYS_TIME_H
|
|
|
|
@%:@include <sys/time.h>
|
2008-04-22 10:25:05 +04:00
|
|
|
@%:@endif])
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2010-01-13 00:54:47 +03:00
|
|
|
AC_CHECK_TYPES([struct timezone], [], [], [@%:@ifdef HAVE_TIME_H
|
|
|
|
@%:@ include <time.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifdef HAVE_SYS_TIME_H
|
|
|
|
@%:@ include <sys/time.h>
|
|
|
|
@%:@endif])
|
|
|
|
|
2011-05-06 20:47:38 +04:00
|
|
|
AC_CHECK_TYPES([clockid_t], [], [], [@%:@ifdef HAVE_TIME_H
|
|
|
|
@%:@ include <time.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifdef HAVE_SYS_TIME_H
|
|
|
|
@%:@ include <sys/time.h>
|
|
|
|
@%:@endif])
|
|
|
|
|
2010-05-26 05:35:38 +04:00
|
|
|
AC_CACHE_VAL([rb_cv_large_fd_select],
|
|
|
|
[AC_CHECK_TYPE(fd_mask, [rb_cv_large_fd_select=yes], [rb_cv_large_fd_select=no])])
|
|
|
|
if test "$rb_cv_large_fd_select" = yes; then
|
|
|
|
AC_DEFINE(HAVE_RB_FD_INIT, 1)
|
|
|
|
fi
|
2005-11-11 20:11:05 +03:00
|
|
|
|
2008-03-31 13:42:44 +04:00
|
|
|
dnl RUBY_DEFINT TYPENAME, SIZE, [SIGNED-OR-UNSIGNED], [INCLUDES = DEFAULT-INCLUDES]
|
* configure.in (int8_t, uint8_t, int16_t, uint16_t int32_t,
uint32_t int64_t, uint64_t, int128_t, uint128_t,
intptr_t, uintptr_t): check if defined.
* win32/Makefile.sub: follow configure.in.
* ext/digest/defs.h: remove checks for uint8_t, uint32_t and uint64_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-14 04:47:02 +03:00
|
|
|
AC_DEFUN([RUBY_DEFINT], [dnl
|
|
|
|
AC_CACHE_CHECK([for $1], [rb_cv_type_$1],
|
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])
|
|
|
|
typedef $1 t; int s = sizeof(t) == 42;])],
|
|
|
|
[rb_cv_type_$1=yes],
|
2010-01-21 03:38:03 +03:00
|
|
|
[AS_CASE([m4_bmatch([$2], [^[1-9][0-9]*$], $2, [$ac_cv_sizeof_]AS_TR_SH($2))],
|
|
|
|
["1"], [ rb_cv_type_$1="m4_if([$3], [], [signed ], [$3 ])char"],
|
|
|
|
["$ac_cv_sizeof_short"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])short"],
|
|
|
|
["$ac_cv_sizeof_int"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])int"],
|
|
|
|
["$ac_cv_sizeof_long"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long"],
|
|
|
|
["$ac_cv_sizeof_long_long"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long long"],
|
|
|
|
["$ac_cv_sizeof___int64"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])__int64"],
|
|
|
|
[ rb_cv_type_$1=no])])])
|
* configure.in (int8_t, uint8_t, int16_t, uint16_t int32_t,
uint32_t int64_t, uint64_t, int128_t, uint128_t,
intptr_t, uintptr_t): check if defined.
* win32/Makefile.sub: follow configure.in.
* ext/digest/defs.h: remove checks for uint8_t, uint32_t and uint64_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-14 04:47:02 +03:00
|
|
|
if test "${rb_cv_type_$1}" != no; then
|
|
|
|
AC_DEFINE([HAVE_]AS_TR_CPP($1), 1)
|
2009-01-16 05:41:26 +03:00
|
|
|
if test "${rb_cv_type_$1}" = yes; then
|
2009-04-06 21:47:33 +04:00
|
|
|
m4_bmatch([$2], [^[1-9][0-9]*$], [AC_CHECK_SIZEOF([$1], 0, [AC_INCLUDES_DEFAULT([$4])])],
|
|
|
|
[RUBY_CHECK_SIZEOF([$1], [$2], [], [AC_INCLUDES_DEFAULT([$4])])])
|
2009-01-16 05:41:26 +03:00
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED($1, [$rb_cv_type_$1])
|
|
|
|
AC_DEFINE_UNQUOTED([SIZEOF_]AS_TR_CPP($1), [SIZEOF_]AS_TR_CPP([$rb_cv_type_$1]))
|
|
|
|
fi
|
2008-03-12 19:45:28 +03:00
|
|
|
fi
|
* configure.in (int8_t, uint8_t, int16_t, uint16_t int32_t,
uint32_t int64_t, uint64_t, int128_t, uint128_t,
intptr_t, uintptr_t): check if defined.
* win32/Makefile.sub: follow configure.in.
* ext/digest/defs.h: remove checks for uint8_t, uint32_t and uint64_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-14 04:47:02 +03:00
|
|
|
])
|
|
|
|
|
|
|
|
RUBY_DEFINT(int8_t, 1)
|
|
|
|
RUBY_DEFINT(uint8_t, 1, unsigned)
|
|
|
|
RUBY_DEFINT(int16_t, 2)
|
|
|
|
RUBY_DEFINT(uint16_t, 2, unsigned)
|
|
|
|
RUBY_DEFINT(int32_t, 4)
|
|
|
|
RUBY_DEFINT(uint32_t, 4, unsigned)
|
|
|
|
RUBY_DEFINT(int64_t, 8)
|
|
|
|
RUBY_DEFINT(uint64_t, 8, unsigned)
|
|
|
|
RUBY_DEFINT(int128_t, 16)
|
|
|
|
RUBY_DEFINT(uint128_t, 16, unsigned)
|
|
|
|
RUBY_DEFINT(intptr_t, void*)
|
|
|
|
RUBY_DEFINT(uintptr_t, void*, unsigned)
|
2009-04-06 21:27:50 +04:00
|
|
|
RUBY_DEFINT(ssize_t, size_t, [], [@%:@include <sys/types.h>]) dnl may differ from int, so not use AC_TYPE_SSIZE_T.
|
2008-03-12 19:45:28 +03:00
|
|
|
|
2012-05-17 06:48:59 +04:00
|
|
|
RUBY_NACL_CHECK_PEPPER_TYPES
|
|
|
|
|
2004-07-08 14:27:23 +04:00
|
|
|
AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
|
|
|
|
[rb_cv_stack_end_address=no
|
|
|
|
AC_TRY_LINK(
|
2012-06-24 19:42:21 +04:00
|
|
|
[extern void *__libc_stack_end;],
|
|
|
|
[if (!__libc_stack_end) return 1;],
|
|
|
|
[rb_cv_stack_end_address="__libc_stack_end"])
|
|
|
|
])
|
2004-07-08 14:27:23 +04:00
|
|
|
if test $rb_cv_stack_end_address != no; then
|
|
|
|
AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
|
|
|
|
fi
|
|
|
|
|
2012-01-31 16:36:50 +04:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[openbsd*], [
|
|
|
|
AC_CACHE_CHECK(for heap align log on openbsd, rb_cv_page_size_log,
|
|
|
|
[rb_cv_page_size_log=no
|
|
|
|
for page_log in 12 13; do
|
|
|
|
AC_TRY_RUN([
|
|
|
|
#include <math.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main() {
|
|
|
|
if ((int)log2((double)sysconf(_SC_PAGESIZE)) != $page_log) return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
],
|
|
|
|
rb_cv_page_size_log="$page_log"; break)
|
|
|
|
done])
|
|
|
|
if test $rb_cv_page_size_log != no; then
|
|
|
|
AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, $rb_cv_page_size_log)
|
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED(HEAP_ALIGN_LOG, 12)
|
|
|
|
fi
|
|
|
|
])
|
2011-07-07 18:59:09 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
dnl Checks for library functions.
|
|
|
|
AC_TYPE_GETGROUPS
|
|
|
|
AC_TYPE_SIGNAL
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["${target_cpu}-${target_os}:${target_archs}"],
|
|
|
|
[powerpc-darwin*], [
|
2006-10-22 23:09:08 +04:00
|
|
|
AC_LIBSOURCES(alloca.c)
|
|
|
|
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
|
|
|
|
AC_DEFINE(C_ALLOCA)
|
|
|
|
AC_DEFINE_UNQUOTED(alloca, alloca)
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[universal-darwin*:*ppc*], [
|
2009-02-07 12:02:50 +03:00
|
|
|
AC_LIBSOURCES(alloca.c)
|
|
|
|
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
|
2009-02-08 07:09:34 +03:00
|
|
|
RUBY_DEFINE_IF([defined __powerpc__], C_ALLOCA, 1)
|
|
|
|
RUBY_DEFINE_IF([defined __powerpc__], alloca, alloca)
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[
|
2006-10-22 23:09:08 +04:00
|
|
|
AC_FUNC_ALLOCA
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2010-10-26 13:09:45 +04:00
|
|
|
if test "x$ALLOCA" = "x"; then
|
|
|
|
AC_CACHE_CHECK([for dynamic size alloca], rb_cv_dynamic_alloca, [
|
|
|
|
for chk in ok __chkstk; do
|
|
|
|
AC_TRY_LINK([
|
|
|
|
@%:@ifdef HAVE_ALLOCA_H
|
|
|
|
@%:@include <alloca.h>
|
|
|
|
@%:@endif
|
|
|
|
void $chk() {}
|
|
|
|
int dynamic_alloca_test;
|
|
|
|
int dynamic_alloca_result;],
|
|
|
|
[dynamic_alloca_result = alloca(dynamic_alloca_test) != 0;],
|
|
|
|
[rb_cv_dynamic_alloca=$chk; break])
|
|
|
|
done])
|
|
|
|
if test "x$rb_cv_dynamic_alloca" = "x__chkstk"; then
|
|
|
|
AC_DEFINE_UNQUOTED(RUBY_ALLOCA_CHKSTK, _$rb_cv_dynamic_alloca)
|
|
|
|
AS_CASE("$target_cpu",
|
|
|
|
[x64|x86_64], [
|
|
|
|
AC_SUBST([ALLOCA], [\${LIBOBJDIR}x86_64-chkstk.${ac_objext}])
|
|
|
|
],)
|
|
|
|
fi
|
|
|
|
fi
|
1999-01-20 07:59:39 +03:00
|
|
|
AC_FUNC_MEMCMP
|
2008-07-03 11:22:06 +04:00
|
|
|
|
|
|
|
# http://sources.redhat.com/ml/libc-hacker/2005-08/msg00008.html
|
|
|
|
# Debian GNU/Linux Etch's libc6.1 2.3.6.ds1-13etch5 has this problem.
|
|
|
|
# Debian GNU/Linux Lenny's libc6.1 2.7-10 has no problem.
|
2008-08-11 10:11:55 +04:00
|
|
|
AC_CACHE_CHECK(for broken erfc of glibc-2.3.6 on IA64, rb_cv_broken_glibc_ia64_erfc,
|
2008-07-03 11:22:06 +04:00
|
|
|
[AC_TRY_RUN([
|
|
|
|
#include <math.h>
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
erfc(10000.0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
],
|
2008-08-11 10:11:55 +04:00
|
|
|
rb_cv_broken_glibc_ia64_erfc=no,
|
|
|
|
rb_cv_broken_glibc_ia64_erfc=yes,
|
|
|
|
rb_cv_broken_glibc_ia64_erfc=no)])
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE([$rb_cv_broken_glibc_ia64_erfc],[yes],[ac_cv_func_erf=no])
|
2008-07-03 11:22:06 +04:00
|
|
|
|
2010-07-28 21:38:56 +04:00
|
|
|
AS_CASE(["$target_os"],[freebsd*],[
|
2010-07-26 07:05:25 +04:00
|
|
|
AC_DEFINE(BROKEN_CLOSE)
|
|
|
|
AC_REPLACE_FUNCS(close)
|
|
|
|
])
|
2008-08-20 20:04:11 +04:00
|
|
|
AC_REPLACE_FUNCS(dup2 memmove strerror\
|
2010-03-01 11:45:18 +03:00
|
|
|
strchr strstr crypt flock\
|
2010-04-14 13:29:29 +04:00
|
|
|
isnan finite isinf hypot acosh erf tgamma lgamma_r cbrt \
|
2011-05-14 14:49:47 +04:00
|
|
|
strlcpy strlcat ffs setproctitle)
|
|
|
|
|
|
|
|
# for missing/setproctitle.c
|
|
|
|
AS_CASE(["$target_os"],
|
2012-01-17 12:18:46 +04:00
|
|
|
[aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)],
|
2011-05-14 14:49:47 +04:00
|
|
|
[hpux*], [AC_DEFINE(SPT_TYPE,SPT_PSTAT) ],
|
|
|
|
[])
|
|
|
|
|
|
|
|
|
2010-04-14 13:29:29 +04:00
|
|
|
AC_CACHE_CHECK(for signbit, rb_cv_have_signbit,
|
2010-04-17 18:27:54 +04:00
|
|
|
[AC_TRY_LINK([
|
2010-04-14 13:29:29 +04:00
|
|
|
#include <math.h>
|
|
|
|
], [int v = signbit(-0.0);],
|
|
|
|
rb_cv_have_signbit=yes,
|
|
|
|
rb_cv_have_signbit=no)])
|
|
|
|
if test "$rb_cv_have_signbit" = yes; then
|
|
|
|
AC_DEFINE(HAVE_SIGNBIT)
|
|
|
|
else
|
|
|
|
AC_LIBOBJ([signbit])
|
|
|
|
fi
|
2011-01-09 10:39:22 +03:00
|
|
|
AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall __syscall chroot getcwd eaccess\
|
2011-04-11 20:38:10 +04:00
|
|
|
truncate ftruncate ftello chsize times utimes utimensat fcntl lockf lstat\
|
2011-04-26 19:50:09 +04:00
|
|
|
truncate64 ftruncate64 ftello64 fseeko fseeko64 \
|
2010-12-16 18:01:55 +03:00
|
|
|
link symlink readlink readdir_r fsync fdatasync fchown posix_fadvise\
|
2012-01-17 12:10:00 +04:00
|
|
|
setitimer setruid seteuid setreuid setresuid socketpair\
|
2003-07-23 06:39:46 +04:00
|
|
|
setrgid setegid setregid setresgid issetugid pause lchown lchmod\
|
|
|
|
getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
|
2012-03-28 11:40:02 +04:00
|
|
|
getpriority getrlimit setrlimit sysconf close getpwnam_r getgrnam_r\
|
2010-04-04 05:10:53 +04:00
|
|
|
dlopen sigprocmask sigaction sigsetjmp _setjmp _longjmp\
|
2012-05-17 06:48:59 +04:00
|
|
|
setsid telldir seekdir fchmod cosh sinh tanh log2 round llabs\
|
* configure.in: check struct timespec, clock_gettime, utimensat,
struct stat.st_atim,
struct stat.st_atimespec,
struct stat.st_atimensec,
struct stat.st_mtim,
struct stat.st_mtimespec,
struct stat.st_mtimensec,
struct stat.st_ctim,
struct stat.st_ctimespec,
struct stat.st_ctimensec.
* include/ruby/missing.h: provide struct timespec if not available.
* time.c: support nanosecond-resolution using struct timespec.
* include/ruby/intern.h: provide rb_time_nano_new.
* file.c (utime_internal): use utimensat if available.
(rb_file_s_utime): refactored.
(rb_f_test): use stat_atime, stat_mtime, stat_ctime.
(rb_stat_cmp): check tv_nsec.
(stat_atimespec): new function.
(stat_atime): ditto.
(stat_mtimespec): ditto.
(stat_mtime): ditto.
(stat_ctimespec): ditto.
(stat_ctime): ditto.
(rb_stat_atime): use stat_atime.
(rb_file_s_atime): ditto.
(rb_file_atime): ditto.
(rb_stat_mtime): use stat_mtime.
(rb_file_s_mtime): ditto.
(rb_file_mtime): ditto.
(rb_file_ctime): use stat_ctime.
(rb_file_s_ctime): ditto.
(rb_stat_ctime): ditto.
* variable.c (rb_copy_generic_ivar): clear clone's instance variables
if obj has no instance variable.
* marshal.c (w_object): dump instance variables of generated string
for TYPE_USERDEF, even if original object has instance variables.
* lib/time.rb (Time#xmlschema): use nsec instead of usec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-19 12:09:38 +03:00
|
|
|
setuid setgid daemon select_large_fdset setenv unsetenv\
|
2011-05-06 18:58:38 +04:00
|
|
|
mktime timegm gmtime_r clock_gettime gettimeofday poll ppoll\
|
2011-10-30 02:48:41 +04:00
|
|
|
pread sendfile shutdown sigaltstack dl_iterate_phdr\
|
2012-05-17 06:48:59 +04:00
|
|
|
dup3 pipe2 posix_memalign memalign ioctl)
|
2008-03-31 21:58:41 +04:00
|
|
|
|
2010-01-26 15:41:43 +03:00
|
|
|
AC_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value,
|
|
|
|
[AC_TRY_COMPILE([
|
|
|
|
#include <stdlib.h>
|
|
|
|
], [int v = unsetenv("foo");],
|
|
|
|
rb_cv_unsetenv_return_value=yes,
|
|
|
|
rb_cv_unsetenv_return_value=no)])
|
|
|
|
if test "$rb_cv_unsetenv_return_value" = no; then
|
|
|
|
AC_DEFINE(VOID_UNSETENV)
|
|
|
|
fi
|
|
|
|
|
2008-03-31 21:58:41 +04:00
|
|
|
AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
|
|
|
|
[AC_TRY_LINK([@%:@include <setjmp.h>
|
2008-03-31 22:20:42 +04:00
|
|
|
jmp_buf jb; void t(v) int v; {__builtin_longjmp(jb, v);}],
|
2008-03-31 21:58:41 +04:00
|
|
|
[__builtin_setjmp(jb);],
|
|
|
|
[ac_cv_func___builtin_setjmp=yes],
|
|
|
|
[ac_cv_func___builtin_setjmp=no])
|
|
|
|
])
|
|
|
|
|
2008-04-01 08:07:25 +04:00
|
|
|
test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
|
2008-04-01 06:36:21 +04:00
|
|
|
|
2008-03-31 21:58:41 +04:00
|
|
|
AC_MSG_CHECKING(for setjmp type)
|
2009-02-02 12:34:36 +03:00
|
|
|
AC_ARG_WITH(setjmp-type,
|
2009-10-23 09:06:12 +04:00
|
|
|
AS_HELP_STRING([--with-setjmp-type], [select setjmp type]),
|
2009-03-31 10:17:38 +04:00
|
|
|
[
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE([$withval],
|
|
|
|
[__builtin_setjmp], [ setjmp_prefix=__builtin_],
|
|
|
|
[_setjmp], [ setjmp_prefix=_],
|
|
|
|
[sigsetjmp], [ setjmp_prefix=sig],
|
|
|
|
[setjmp], [ setjmp_prefix=],
|
|
|
|
[''], [ unset setjmp_prefix],
|
|
|
|
[ AC_MSG_ERROR(invalid setjmp type: $withval)])], [unset setjmp_prefix])
|
2008-03-31 21:58:41 +04:00
|
|
|
if test ${setjmp_prefix+set}; then
|
2008-04-01 06:36:21 +04:00
|
|
|
if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp = no; then
|
2008-03-31 21:58:41 +04:00
|
|
|
AC_MSG_ERROR(${setjmp_prefix}setjmp is not available)
|
|
|
|
fi
|
|
|
|
elif test "$ac_cv_func___builtin_setjmp" = yes; then
|
|
|
|
setjmp_prefix=__builtin_
|
|
|
|
elif test "$ac_cv_func__setjmp" = yes; then
|
|
|
|
setjmp_prefix=_
|
|
|
|
elif test "$ac_cv_func_sigsetjmp" = yes; then
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig])
|
2008-03-31 21:58:41 +04:00
|
|
|
else
|
|
|
|
setjmp_prefix=
|
|
|
|
fi
|
2008-04-01 09:43:40 +04:00
|
|
|
if test x$setjmp_prefix = xsig; then
|
2008-03-31 21:58:41 +04:00
|
|
|
setjmp_sigmask=yes
|
|
|
|
else
|
|
|
|
unset setjmp_sigmask
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(${setjmp_prefix}setjmp)
|
|
|
|
AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp(env${setjmp_sigmask+,0})])
|
|
|
|
AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)])
|
|
|
|
AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf)
|
|
|
|
|
2003-07-23 20:07:35 +04:00
|
|
|
AC_ARG_ENABLE(setreuid,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--enable-setreuid], [use setreuid()/setregid() according to need even if obsolete]),
|
2003-07-23 20:07:35 +04:00
|
|
|
[use_setreuid=$enableval])
|
|
|
|
if test "$use_setreuid" = yes; then
|
|
|
|
AC_DEFINE(USE_SETREUID)
|
|
|
|
AC_DEFINE(USE_SETREGID)
|
|
|
|
fi
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_STRUCT_TIMEZONE
|
2001-12-17 09:45:37 +03:00
|
|
|
AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
|
2012-08-21 20:18:05 +04:00
|
|
|
[AC_TRY_COMPILE([@%:@include <time.h>],
|
2001-12-17 09:45:37 +03:00
|
|
|
[struct tm t; t.tm_gmtoff = 3600;],
|
|
|
|
[rb_cv_member_struct_tm_tm_gmtoff=yes],
|
|
|
|
[rb_cv_member_struct_tm_tm_gmtoff=no])])
|
|
|
|
if test "$rb_cv_member_struct_tm_tm_gmtoff" = yes; then
|
|
|
|
AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF)
|
|
|
|
fi
|
2000-06-12 11:48:31 +04:00
|
|
|
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
|
2000-06-14 09:15:08 +04:00
|
|
|
[AC_TRY_LINK([#include <time.h>
|
|
|
|
int i;],
|
2008-08-10 07:15:37 +04:00
|
|
|
[i = daylight;],
|
2000-06-12 11:48:31 +04:00
|
|
|
rb_cv_have_daylight=yes,
|
|
|
|
rb_cv_have_daylight=no)])
|
|
|
|
if test "$rb_cv_have_daylight" = yes; then
|
|
|
|
AC_DEFINE(HAVE_DAYLIGHT)
|
1998-01-16 15:13:05 +03:00
|
|
|
fi
|
2007-12-14 04:01:42 +03:00
|
|
|
AC_DEFUN([RUBY_CHECK_VARTYPE], [dnl
|
2009-03-12 03:30:55 +03:00
|
|
|
AC_CACHE_CHECK([for external $1], AS_TR_SH(rb_cv_var_$1),
|
|
|
|
[AS_TR_SH(rb_cv_var_$1)=no
|
2008-02-01 06:43:48 +03:00
|
|
|
AC_TRY_COMPILE([
|
|
|
|
#ifndef _XOPEN_SOURCE
|
|
|
|
#define _XOPEN_SOURCE 1
|
|
|
|
#endif
|
2008-03-14 04:12:32 +03:00
|
|
|
$2
|
|
|
|
;
|
|
|
|
const volatile void *volatile t;],
|
2007-12-14 04:01:42 +03:00
|
|
|
[t = &(&$1)[0];],
|
|
|
|
[for t in $3; do
|
2008-02-01 06:43:48 +03:00
|
|
|
AC_TRY_COMPILE([
|
|
|
|
#ifndef _XOPEN_SOURCE
|
|
|
|
#define _XOPEN_SOURCE 1
|
|
|
|
#endif
|
2008-03-14 04:12:32 +03:00
|
|
|
$2
|
|
|
|
;
|
|
|
|
extern $t $1;
|
|
|
|
const volatile void *volatile t;],
|
2007-12-14 05:54:08 +03:00
|
|
|
[t = &(&$1)[0];],
|
2009-03-12 03:30:55 +03:00
|
|
|
[AS_TR_SH(rb_cv_var_$1)=$t; break])
|
2007-12-14 04:01:42 +03:00
|
|
|
done])])
|
2009-03-12 03:30:55 +03:00
|
|
|
if test "${AS_TR_SH(rb_cv_var_$1)}" != no; then
|
|
|
|
AC_DEFINE(AS_TR_CPP(HAVE_VAR_$1))
|
|
|
|
AC_DEFINE_UNQUOTED(AS_TR_CPP(TYPEOF_VAR_$1), ${AS_TR_SH(rb_cv_var_$1)})
|
2007-12-14 04:01:42 +03:00
|
|
|
fi])
|
2008-03-14 04:12:32 +03:00
|
|
|
RUBY_CHECK_VARTYPE(timezone, [@%:@include <time.h>], [long int])
|
|
|
|
RUBY_CHECK_VARTYPE(altzone, [@%:@include <time.h>], [long int])
|
2008-08-20 21:08:36 +04:00
|
|
|
AC_CHECK_FUNCS(timezone)
|
|
|
|
if test "$ac_cv_func_timezone" = yes; then
|
|
|
|
AC_CACHE_CHECK([whether timezone requires zero arguments], rb_cv_func_timezone_void,
|
|
|
|
[AC_TRY_COMPILE([@%:@include <time.h>],
|
|
|
|
[(void)timezone(0, 0);],
|
|
|
|
[rb_cv_func_timezone_void=no],
|
|
|
|
[rb_cv_func_timezone_void=yes])]
|
|
|
|
)
|
|
|
|
if test $rb_cv_func_timezone_void = yes; then
|
|
|
|
AC_DEFINE(TIMEZONE_VOID)
|
2007-12-19 07:57:46 +03:00
|
|
|
fi
|
2007-12-14 04:01:42 +03:00
|
|
|
fi
|
|
|
|
|
2001-02-20 10:42:03 +03:00
|
|
|
AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t,
|
|
|
|
[AC_TRY_RUN([
|
2011-01-20 06:27:54 +03:00
|
|
|
#include <stdlib.h>
|
2001-02-20 10:42:03 +03:00
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
check(tm, y, m, d, h, s)
|
|
|
|
struct tm *tm;
|
|
|
|
int y, m, d, h, s;
|
|
|
|
{
|
2001-02-26 08:29:06 +03:00
|
|
|
if (!tm ||
|
|
|
|
tm->tm_year != y ||
|
2001-02-20 10:42:03 +03:00
|
|
|
tm->tm_mon != m-1 ||
|
|
|
|
tm->tm_mday != d ||
|
|
|
|
tm->tm_hour != h ||
|
|
|
|
tm->tm_sec != s) {
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
time_t t = -1;
|
|
|
|
struct tm *tm;
|
|
|
|
|
|
|
|
check(gmtime(&t), 69, 12, 31, 23, 59);
|
2001-12-17 09:45:37 +03:00
|
|
|
t = ~(time_t)0 << 31;
|
2001-02-20 10:42:03 +03:00
|
|
|
check(gmtime(&t), 1, 12, 13, 20, 52);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
],
|
|
|
|
rb_cv_negative_time_t=yes,
|
|
|
|
rb_cv_negative_time_t=no,
|
|
|
|
rb_cv_negative_time_t=yes)])
|
|
|
|
if test "$rb_cv_negative_time_t" = yes; then
|
|
|
|
AC_DEFINE(NEGATIVE_TIME_T)
|
|
|
|
fi
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2010-04-06 17:03:43 +04:00
|
|
|
# [ruby-dev:40910] overflow of time on FreeBSD
|
|
|
|
# http://www.freebsd.org/cgi/query-pr.cgi?pr=145341
|
|
|
|
AC_CACHE_CHECK(for localtime(3) overflow correctly, rb_cv_localtime_overflow,
|
|
|
|
[AC_TRY_RUN([
|
2011-01-20 17:34:39 +03:00
|
|
|
#include <stdlib.h>
|
2010-04-06 17:03:43 +04:00
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
check(time_t t1)
|
|
|
|
{
|
|
|
|
struct tm *tm;
|
|
|
|
time_t t2;
|
|
|
|
tm = localtime(&t1);
|
|
|
|
if (!tm)
|
|
|
|
return; /* overflow detected. ok. */
|
|
|
|
t2 = mktime(tm);
|
|
|
|
if (t1 == t2)
|
|
|
|
return; /* round-trip. ok. */
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
time_t t;
|
|
|
|
if (~(time_t)0 <= 0) {
|
|
|
|
t = (((time_t)1) << (sizeof(time_t) * 8 - 2));
|
|
|
|
t |= t - 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
t = ~(time_t)0;
|
|
|
|
}
|
|
|
|
check(t);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
],
|
|
|
|
rb_cv_localtime_overflow=yes,
|
|
|
|
rb_cv_localtime_overflow=no,
|
|
|
|
rb_cv_localtime_overflow=yes)])
|
|
|
|
if test "$rb_cv_localtime_overflow" = no; then
|
|
|
|
AC_DEFINE(LOCALTIME_OVERFLOW_PROBLEM)
|
|
|
|
fi
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
if test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = yes; then
|
|
|
|
AC_DEFINE(POSIX_SIGNAL)
|
|
|
|
else
|
2008-02-14 20:40:56 +03:00
|
|
|
AC_CHECK_FUNCS(sigsetmask)
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal,
|
1998-01-16 15:13:05 +03:00
|
|
|
[AC_TRY_RUN([
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
sig_handler(dummy)
|
|
|
|
int dummy;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
signal(SIGINT, sig_handler);
|
|
|
|
kill(getpid(), SIGINT);
|
|
|
|
kill(getpid(), SIGINT);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
],
|
|
|
|
rb_cv_bsd_signal=yes,
|
1999-08-13 09:45:20 +04:00
|
|
|
rb_cv_bsd_signal=no,
|
2008-02-14 20:40:56 +03:00
|
|
|
rb_cv_bsd_signal=$ac_cv_func_sigsetmask)])
|
1998-01-16 15:13:05 +03:00
|
|
|
if test "$rb_cv_bsd_signal" = yes; then
|
|
|
|
AC_DEFINE(BSD_SIGNAL)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2010-11-09 15:14:58 +03:00
|
|
|
if test "$ac_cv_func_getpgid" = no; then
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_FUNC_GETPGRP
|
2010-11-09 15:14:58 +03:00
|
|
|
fi
|
|
|
|
if test "$ac_cv_func_setpgid:$ac_cv_func_setpgrp" = no:yes; then
|
2009-02-02 12:34:36 +03:00
|
|
|
AC_FUNC_SETPGRP
|
2010-11-09 15:14:58 +03:00
|
|
|
fi
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2004-09-21 07:08:33 +04:00
|
|
|
if test x"$target_cpu" = xia64; then
|
2005-12-27 08:40:04 +03:00
|
|
|
AC_LIBOBJ([ia64])
|
2005-12-27 14:52:54 +03:00
|
|
|
AC_CACHE_CHECK(for __libc_ia64_register_backing_store_base,
|
|
|
|
rb_cv___libc_ia64_register_backing_store_base,
|
|
|
|
[rb_cv___libc_ia64_register_backing_store_base=no
|
2005-12-27 08:40:04 +03:00
|
|
|
AC_TRY_LINK(
|
|
|
|
[extern unsigned long __libc_ia64_register_backing_store_base;],
|
2005-12-27 14:52:54 +03:00
|
|
|
[unsigned long p = __libc_ia64_register_backing_store_base;
|
|
|
|
printf("%ld\n", p);],
|
|
|
|
[rb_cv___libc_ia64_register_backing_store_base=yes])])
|
2005-12-27 08:40:04 +03:00
|
|
|
if test $rb_cv___libc_ia64_register_backing_store_base = yes; then
|
|
|
|
AC_DEFINE(HAVE___LIBC_IA64_REGISTER_BACKING_STORE_BASE)
|
2004-09-21 07:08:33 +04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign,
|
2010-10-09 11:54:42 +04:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [(-1==(-1>>1))])],
|
1999-01-20 07:59:39 +03:00
|
|
|
rb_cv_rshift_sign=yes,
|
2008-08-09 16:10:54 +04:00
|
|
|
rb_cv_rshift_sign=no)])
|
1999-01-20 07:59:39 +03:00
|
|
|
if test "$rb_cv_rshift_sign" = yes; then
|
2010-03-16 08:03:30 +03:00
|
|
|
AC_DEFINE(RSHIFT(x,y), ((x)>>(int)(y)))
|
1999-01-20 07:59:39 +03:00
|
|
|
else
|
2010-03-16 08:03:30 +03:00
|
|
|
AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>(int)(y)) : (x)>>(int)(y)))
|
1999-01-20 07:59:39 +03:00
|
|
|
fi
|
|
|
|
|
2011-11-27 08:55:27 +04:00
|
|
|
# win32.c still use this. Don't remove it.
|
|
|
|
test "$rb_cv_fcnt" = "not found" && rb_cv_fcnt="not found (OK if using GNU libc)"
|
|
|
|
AC_CACHE_CHECK([read count field in FILE structures], rb_cv_fcnt,
|
|
|
|
[rb_cv_fcnt="not found (OK if using GNU libc)"
|
|
|
|
for fcnt in dnl
|
|
|
|
_cnt dnl
|
|
|
|
__cnt dnl
|
|
|
|
_r dnl
|
|
|
|
readCount dnl
|
|
|
|
_rcount dnl for emx0.9c
|
|
|
|
; do
|
|
|
|
AC_TRY_COMPILE([#include <stdio.h>
|
|
|
|
],
|
|
|
|
[FILE *f = stdin; f->$fcnt = 0;],
|
|
|
|
[rb_cv_fcnt="$fcnt"; break])
|
|
|
|
done])
|
|
|
|
AS_CASE("$rb_cv_fcnt",
|
|
|
|
["not found"*], [rb_cv_fcnt="not found"],
|
2011-11-27 12:24:29 +04:00
|
|
|
[AC_DEFINE_UNQUOTED(FILE_COUNT, $rb_cv_fcnt)])
|
2011-11-27 08:55:27 +04:00
|
|
|
|
|
|
|
# win32.c still use this. Don't remove it.
|
|
|
|
AC_CACHE_CHECK([read buffer ptr field in FILE structures], rb_cv_frptr,
|
|
|
|
[for frptr in dnl
|
|
|
|
_IO_read_ptr dnl
|
|
|
|
_ptr dnl
|
|
|
|
__ptr dnl
|
|
|
|
bufpos dnl
|
|
|
|
_p dnl
|
|
|
|
__bufpos dnl
|
|
|
|
; do
|
|
|
|
AC_TRY_COMPILE([#include <stdio.h>
|
|
|
|
],
|
|
|
|
[FILE *f = stdin; char buf[256]; f->$frptr = buf;],
|
|
|
|
rb_cv_frptr="$frptr"; break,
|
|
|
|
rb_cv_frptr="not found")
|
|
|
|
done])
|
|
|
|
if test "$rb_cv_frptr" != "not found"; then
|
|
|
|
AC_DEFINE_UNQUOTED(FILE_READPTR, $rb_cv_frptr)
|
|
|
|
|
|
|
|
if test "$rb_cv_fcnt" = "not found"; then
|
|
|
|
AC_CACHE_CHECK([read buffer end field in FILE structures], rb_cv_frend,
|
|
|
|
[for frend in dnl
|
|
|
|
_IO_read_end dnl
|
|
|
|
bufread dnl
|
|
|
|
__bufread dnl
|
|
|
|
; do
|
|
|
|
AC_TRY_COMPILE([#include <stdio.h>
|
|
|
|
],
|
|
|
|
[FILE *f = stdin; char buf[256]; f->$frend = buf;],
|
|
|
|
rb_cv_frend="$frend"; break,
|
|
|
|
rb_cv_frend="not found")
|
|
|
|
done])
|
|
|
|
if test "$rb_cv_frend" != "not found"; then
|
|
|
|
AC_DEFINE_UNQUOTED(FILE_READEND, $rb_cv_frend)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2009-03-19 12:49:51 +03:00
|
|
|
RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sys/stat.h>])
|
2003-08-15 07:01:52 +04:00
|
|
|
|
2011-09-03 18:56:26 +04:00
|
|
|
AC_CACHE_CHECK([whether struct dirent.d_name is too small], rb_cv_sizeof_struct_dirent_too_small,
|
|
|
|
[AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([
|
|
|
|
@%:@if defined _WIN32
|
|
|
|
@%:@ error <<<struct direct in win32/dir.h has variable length d_name>>>
|
|
|
|
@%:@elif defined HAVE_DIRENT_H
|
|
|
|
@%:@ include <dirent.h>
|
|
|
|
@%:@elif defined HAVE_DIRECT_H
|
|
|
|
@%:@ include <direct.h>
|
|
|
|
@%:@else
|
|
|
|
@%:@ define dirent direct
|
|
|
|
@%:@ if HAVE_SYS_NDIR_H
|
|
|
|
@%:@ include <sys/ndir.h>
|
|
|
|
@%:@ endif
|
|
|
|
@%:@ if HAVE_SYS_DIR_H
|
|
|
|
@%:@ include <sys/dir.h>
|
|
|
|
@%:@ endif
|
|
|
|
@%:@ if HAVE_NDIR_H
|
|
|
|
@%:@ include <ndir.h>
|
|
|
|
@%:@ endif
|
|
|
|
@%:@endif
|
|
|
|
@%:@include <stddef.h>
|
|
|
|
@%:@define numberof(array) [(int)(sizeof(array) / sizeof((array)[0]))]
|
|
|
|
struct dirent d;
|
|
|
|
])],
|
|
|
|
[offsetof(struct dirent, [d_name[numberof(d.d_name)]]) - offsetof(struct dirent, d_name) < 256])],
|
|
|
|
[rb_cv_sizeof_struct_dirent_too_small=yes],
|
|
|
|
[rb_cv_sizeof_struct_dirent_too_small=no])])
|
|
|
|
if test "$rb_cv_sizeof_struct_dirent_too_small" = yes; then
|
|
|
|
AC_DEFINE(SIZEOF_STRUCT_DIRENT_TOO_SMALL, 1)
|
|
|
|
fi
|
|
|
|
|
2006-07-06 18:30:20 +04:00
|
|
|
if test "$ac_cv_func_sysconf" = yes; then
|
2006-07-25 20:04:35 +04:00
|
|
|
AC_DEFUN([RUBY_CHECK_SYSCONF], [dnl
|
2006-07-06 18:30:20 +04:00
|
|
|
AC_CACHE_CHECK([whether _SC_$1 is supported], rb_cv_have_sc_[]m4_tolower($1),
|
|
|
|
[AC_TRY_COMPILE([#include <unistd.h>
|
|
|
|
],
|
|
|
|
[_SC_$1 >= 0],
|
|
|
|
rb_cv_have_sc_[]m4_tolower($1)=yes,
|
|
|
|
rb_cv_have_sc_[]m4_tolower($1)=no)
|
|
|
|
])
|
|
|
|
if test "$rb_cv_have_sc_[]m4_tolower($1)" = yes; then
|
|
|
|
AC_DEFINE(HAVE__SC_$1)
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
RUBY_CHECK_SYSCONF(CLK_TCK)
|
|
|
|
fi
|
|
|
|
|
2009-11-01 10:24:18 +03:00
|
|
|
AC_DEFUN(RUBY_STACK_GROW_DIRECTION, [
|
2011-10-27 09:55:29 +04:00
|
|
|
AS_VAR_PUSHDEF([stack_grow_dir], [rb_cv_stack_grow_dir_$1])
|
|
|
|
AC_CACHE_CHECK(stack growing direction on $1, stack_grow_dir, [
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$1"],
|
2010-10-10 05:20:11 +04:00
|
|
|
[m68*|x86*|x64|i?86|ia64|ppc*|sparc*|alpha*], [ $2=-1],
|
2010-01-21 03:38:03 +03:00
|
|
|
[hppa*], [ $2=+1],
|
|
|
|
[
|
2009-11-01 10:24:18 +03:00
|
|
|
AC_TRY_RUN([
|
2003-06-28 07:29:00 +04:00
|
|
|
/* recurse to get rid of inlining */
|
|
|
|
static int
|
|
|
|
stack_growup_p(addr, n)
|
|
|
|
volatile int *addr, n;
|
|
|
|
{
|
|
|
|
volatile int end;
|
|
|
|
if (n > 0)
|
|
|
|
return *addr = stack_growup_p(addr, n - 1);
|
|
|
|
else
|
|
|
|
return (&end > addr);
|
|
|
|
}
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
return stack_growup_p(&x, 10);
|
|
|
|
}
|
2009-11-01 10:24:18 +03:00
|
|
|
], $2=-1, $2=+1, $2=0)
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2011-10-27 09:55:29 +04:00
|
|
|
eval stack_grow_dir=\$$2])
|
|
|
|
eval $2=\$stack_grow_dir
|
|
|
|
AS_VAR_POPDEF([stack_grow_dir])])
|
2009-11-01 10:24:18 +03:00
|
|
|
if test "${universal_binary-no}" = yes ; then
|
|
|
|
archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
|
|
|
|
save_CFLAGS="$CFLAGS" new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
|
|
|
|
save_LDFLAGS="$LDFLAGS" new_ldflags=`echo "$LDFLAGS" | sed "s|$archflagpat"'||'`
|
|
|
|
stack_dir=
|
|
|
|
for archs in ${universal_archnames}; do
|
|
|
|
archs=`echo $archs | sed 's/=.*//'`
|
|
|
|
CFLAGS="$new_cflags -arch $archs"
|
|
|
|
LDFLAGS="$new_ldflags -arch $archs"
|
|
|
|
RUBY_STACK_GROW_DIRECTION($archs, dir)
|
|
|
|
if test x$stack_dir = x; then
|
|
|
|
stack_dir=$dir
|
|
|
|
elif test x$stack_dir != x$dir; then
|
|
|
|
stack_dir=no
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS"
|
|
|
|
if test x$stack_dir = xno; then
|
|
|
|
for archs in ${universal_archnames}; do
|
|
|
|
archs=`echo $archs | sed 's/=.*//'`
|
2011-10-27 09:55:29 +04:00
|
|
|
eval dir=\$[rb_cv_stack_grow_dir_]AS_TR_SH([$archs])
|
2009-11-01 10:24:18 +03:00
|
|
|
RUBY_DEFINE_IF([defined __${archs}__], STACK_GROW_DIRECTION, $dir)
|
|
|
|
done
|
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $stack_dir)
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
RUBY_STACK_GROW_DIRECTION($target_cpu, dir)
|
|
|
|
AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $dir)
|
|
|
|
fi
|
2003-06-28 07:29:00 +04:00
|
|
|
|
2003-12-27 17:45:48 +03:00
|
|
|
if test x"$enable_pthread" = xyes; then
|
2008-08-07 00:52:44 +04:00
|
|
|
for pthread_lib in thr pthread pthreads c c_r root; do
|
2008-08-10 07:15:37 +04:00
|
|
|
AC_CHECK_LIB($pthread_lib, pthread_kill,
|
2003-12-26 12:34:03 +03:00
|
|
|
rb_with_pthread=yes, rb_with_pthread=no)
|
|
|
|
if test "$rb_with_pthread" = "yes"; then break; fi
|
|
|
|
done
|
2003-12-27 17:45:48 +03:00
|
|
|
if test x"$rb_with_pthread" = xyes; then
|
2003-12-26 12:34:03 +03:00
|
|
|
AC_DEFINE(_REENTRANT)
|
|
|
|
AC_DEFINE(_THREAD_SAFE)
|
|
|
|
AC_DEFINE(HAVE_LIBPTHREAD)
|
2011-09-28 04:14:19 +04:00
|
|
|
AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE([$pthread_lib],
|
2010-01-21 09:10:16 +03:00
|
|
|
[c], [],
|
2010-01-22 08:17:16 +03:00
|
|
|
[root], [],
|
2010-01-21 09:10:16 +03:00
|
|
|
[c_r], [MAINLIBS="-pthread $MAINLIBS"],
|
2011-07-29 11:17:32 +04:00
|
|
|
[AS_CASE(["$target_os"],
|
|
|
|
[openbsd*], [LIBS="-pthread $LIBS"],
|
|
|
|
[LIBS="-l$pthread_lib $LIBS"])])
|
2003-12-26 12:34:03 +03:00
|
|
|
else
|
|
|
|
AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
|
|
|
|
fi
|
2011-05-06 18:18:06 +04:00
|
|
|
AC_CHECK_FUNCS(sched_yield pthread_attr_setinheritsched \
|
2010-02-08 04:32:43 +03:00
|
|
|
pthread_getattr_np pthread_attr_get_np pthread_attr_getstack\
|
2010-02-03 16:22:32 +03:00
|
|
|
pthread_get_stackaddr_np pthread_get_stacksize_np \
|
2011-05-06 20:47:38 +04:00
|
|
|
thr_stksegment pthread_stackseg_np pthread_getthrds_np \
|
2012-05-17 18:04:02 +04:00
|
|
|
pthread_cond_init pthread_condattr_setclock pthread_condattr_init \
|
2012-05-17 06:48:59 +04:00
|
|
|
pthread_sigmask)
|
2012-06-10 16:51:37 +04:00
|
|
|
if test "${host_os}" = "nacl"; then
|
|
|
|
ac_cv_func_pthread_attr_init=no
|
|
|
|
else
|
|
|
|
AC_CHECK_FUNCS(pthread_attr_init)
|
|
|
|
fi
|
2003-12-26 12:34:03 +03:00
|
|
|
fi
|
2003-12-27 17:45:48 +03:00
|
|
|
if test x"$ac_cv_header_ucontext_h" = xyes; then
|
2006-01-05 20:26:23 +03:00
|
|
|
if test x"$rb_with_pthread" = xyes; then
|
2003-12-26 12:34:03 +03:00
|
|
|
AC_CHECK_FUNCS(getcontext setcontext)
|
|
|
|
fi
|
2003-11-20 06:50:32 +03:00
|
|
|
fi
|
|
|
|
|
2008-06-24 12:20:42 +04:00
|
|
|
if test "$ac_cv_func_fork" = "yes" -a "$rb_with_pthread" = "yes"; then
|
|
|
|
AC_CACHE_CHECK([if fork works with pthread], rb_cv_fork_with_pthread,
|
|
|
|
[AC_TRY_RUN([
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#ifndef EXIT_SUCCESS
|
|
|
|
#define EXIT_SUCCESS 0
|
|
|
|
#endif
|
|
|
|
#ifndef EXIT_FAILURE
|
|
|
|
#define EXIT_FAILURE 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void *
|
|
|
|
thread_func(void *dmy)
|
|
|
|
{
|
|
|
|
return dmy;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
use_threads(void)
|
|
|
|
{
|
|
|
|
pthread_t tid;
|
|
|
|
if (pthread_create(&tid, 0, thread_func, 0) != 0) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (pthread_join(tid, 0) != 0) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
pid_t pid;
|
|
|
|
if (use_threads()) return EXIT_FAILURE;
|
|
|
|
pid = fork();
|
|
|
|
|
|
|
|
if (pid) {
|
|
|
|
int loc;
|
|
|
|
sleep(1);
|
|
|
|
if (waitpid(pid, &loc, WNOHANG) == 0) {
|
|
|
|
kill(pid, SIGKILL);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2009-04-01 15:40:38 +04:00
|
|
|
if (!WIFEXITED(loc) || WEXITSTATUS(loc) != EXIT_SUCCESS)
|
|
|
|
return EXIT_FAILURE;
|
2008-06-24 12:20:42 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (use_threads()) return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
2008-06-27 01:53:40 +04:00
|
|
|
}],
|
2008-06-24 12:20:42 +04:00
|
|
|
rb_cv_fork_with_pthread=yes,
|
|
|
|
rb_cv_fork_with_pthread=no,
|
|
|
|
rb_cv_fork_with_pthread=yes)])
|
|
|
|
test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
|
|
|
|
fi
|
|
|
|
|
2007-07-14 11:19:59 +04:00
|
|
|
|
2012-08-21 20:18:10 +04:00
|
|
|
}
|
|
|
|
{ # runtime section
|
2009-02-09 22:34:43 +03:00
|
|
|
|
2001-04-01 20:53:41 +04:00
|
|
|
dnl wheather use dln_a_out or not
|
2009-02-02 12:34:36 +03:00
|
|
|
AC_ARG_WITH(dln-a-out,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--with-dln-a-out], [use dln_a_out if possible]),
|
|
|
|
[
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE([$withval],
|
|
|
|
[yes], [
|
2008-10-29 05:51:00 +03:00
|
|
|
if test "$enable_shared" = yes; then
|
|
|
|
AC_MSG_ERROR(dln_a_out can not make shared library)
|
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
with_dln_a_out=yes],
|
|
|
|
[
|
|
|
|
with_dln_a_out=no])], [with_dln_a_out=no])
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2000-02-01 06:12:21 +03:00
|
|
|
AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
|
2008-08-09 16:10:54 +04:00
|
|
|
[AC_TRY_LINK([],[], [
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["`head -1 conftest$EXEEXT | cat -e`"],
|
2010-02-03 16:20:43 +03:00
|
|
|
['^?ELF'*], [rb_cv_binary_elf=yes], [rb_cv_binary_elf=no])],
|
2008-08-09 16:10:54 +04:00
|
|
|
rb_cv_binary_elf=no)])
|
2000-02-01 06:12:21 +03:00
|
|
|
|
|
|
|
if test "$rb_cv_binary_elf" = yes; then
|
|
|
|
AC_DEFINE(USE_ELF)
|
2008-10-29 05:51:00 +03:00
|
|
|
if test "$with_dln_a_out" = yes; then
|
|
|
|
AC_MSG_ERROR(dln_a_out does not work with ELF)
|
|
|
|
fi
|
2012-05-17 06:48:59 +04:00
|
|
|
AC_CHECK_HEADERS([elf.h elf_abi.h])
|
|
|
|
if test $ac_cv_header_elf_h = yes -o $ac_cv_header_elf_abi_h = yes; then
|
|
|
|
AC_LIBOBJ([addr2line])
|
|
|
|
fi
|
2000-02-01 06:12:21 +03:00
|
|
|
fi
|
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2012-05-17 06:48:59 +04:00
|
|
|
[linux* | gnu* | k*bsd*-gnu | bsdi* | kopensolaris*-gnu | nacl], [
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
if test "$rb_cv_binary_elf" = no; then
|
|
|
|
with_dln_a_out=yes
|
|
|
|
else
|
2003-11-30 12:33:03 +03:00
|
|
|
LDFLAGS="$LDFLAGS -rdynamic"
|
2010-01-21 03:38:03 +03:00
|
|
|
fi])
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
LIBEXT=a
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
AC_SUBST(DLDFLAGS)dnl
|
2003-11-30 14:27:34 +03:00
|
|
|
AC_SUBST(ARCH_FLAG)dnl
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
AC_SUBST(STATIC)dnl
|
|
|
|
AC_SUBST(CCDLFLAGS)dnl
|
|
|
|
AC_SUBST(LDSHARED)dnl
|
2005-04-21 01:45:43 +04:00
|
|
|
AC_SUBST(LDSHAREDXX)dnl
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_SUBST(DLEXT)dnl
|
2000-05-09 08:53:16 +04:00
|
|
|
AC_SUBST(DLEXT2)dnl
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
AC_SUBST(LIBEXT)dnl
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
STATIC=
|
2003-11-30 12:33:03 +03:00
|
|
|
: ${PATHFLAG=''}
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
if test "$with_dln_a_out" != yes; then
|
|
|
|
rb_cv_dlopen=unknown
|
|
|
|
AC_MSG_CHECKING(whether OS depend dynamic link works)
|
|
|
|
if test "$GCC" = yes; then
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2011-09-26 04:19:03 +04:00
|
|
|
[darwin*], [
|
2009-02-08 07:09:34 +03:00
|
|
|
# The -fno-common is needed if we wish to embed the Ruby interpreter
|
|
|
|
# into a plugin module of some project (as opposed to embedding it
|
|
|
|
# within the project's application). The -I/usr/local/include is
|
|
|
|
# needed because CPP as discovered by configure (cc -E -traditional)
|
|
|
|
# fails to consult /usr/local/include by default. This causes
|
|
|
|
# mkmf.rb's have_header() to fail if the desired resource happens to be
|
|
|
|
# installed in the /usr/local tree.
|
2010-01-21 03:38:03 +03:00
|
|
|
RUBY_APPEND_OPTION(CCDLFLAGS, -fno-common)],
|
2011-09-26 04:05:45 +04:00
|
|
|
[bsdi*|beos*|haiku*|cygwin*|mingw*|aix*|interix*], [ ],
|
2010-01-21 03:38:03 +03:00
|
|
|
[
|
|
|
|
RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)])
|
1998-01-16 15:13:05 +03:00
|
|
|
else
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2010-01-21 09:10:16 +03:00
|
|
|
[hpux*], [CCDLFLAGS="$CCDLFLAGS +Z"],
|
|
|
|
[solaris*|irix*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
|
|
|
|
[sunos*], [CCDLFLAGS="$CCDLFLAGS -PIC"],
|
|
|
|
[esix*|uxpds*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
|
|
|
|
[: ${CCDLFLAGS=""}])
|
1998-01-16 15:13:05 +03:00
|
|
|
fi
|
|
|
|
|
2008-02-20 18:01:36 +03:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(rpath,
|
2011-12-07 14:04:26 +04:00
|
|
|
AS_HELP_STRING([--enable-rpath], [embed run path into extension libraries.
|
|
|
|
enabled by default on ELF platforms]),
|
2008-02-20 18:01:36 +03:00
|
|
|
[enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
|
|
|
|
if test "$enable_rpath" = yes; then
|
|
|
|
RPATHFLAG=" ${linker_flag}-R%1\$-s"
|
|
|
|
fi
|
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[hpux*], [ DLDFLAGS="$DLDFLAGS -E"
|
2012-05-16 10:15:56 +04:00
|
|
|
: ${LDSHARED='$(LD) -b'}
|
2003-11-30 12:33:03 +03:00
|
|
|
XLDFLAGS="$XLDFLAGS -Wl,-E"
|
2004-02-09 11:48:55 +03:00
|
|
|
: ${LIBPATHENV=SHLIB_PATH}
|
2008-02-20 18:01:36 +03:00
|
|
|
if test "$rb_cv_prog_gnu_ld" = no; then
|
|
|
|
RPATHFLAG=' +b %1$-s'
|
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes],
|
|
|
|
[solaris*], [ if test "$GCC" = yes; then
|
2009-02-09 22:34:43 +03:00
|
|
|
: ${LDSHARED='$(CC) -shared'}
|
|
|
|
if test "$rb_cv_prog_gnu_ld" = yes; then
|
|
|
|
LDFLAGS="$LDFLAGS -Wl,-E"
|
|
|
|
fi
|
1999-08-13 09:45:20 +04:00
|
|
|
else
|
2011-08-04 15:36:50 +04:00
|
|
|
: ${LDSHARED='$(CC) -G'}
|
1999-08-13 09:45:20 +04:00
|
|
|
fi
|
2011-08-21 09:34:51 +04:00
|
|
|
if test "$ac_cv_sizeof_voidp" = 8; then
|
|
|
|
: ${LIBPATHENV=LD_LIBRARY_PATH_64}
|
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:15:56 +04:00
|
|
|
[sunos*], [ : ${LDSHARED='$(LD) -assert nodefinitions'}
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:15:56 +04:00
|
|
|
[irix*], [ : ${LDSHARED='$(LD) -shared'}
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:15:56 +04:00
|
|
|
[sysv4*], [ : ${LDSHARED='$(LD) -G'}
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-03-24 23:44:45 +03:00
|
|
|
[nto-qnx*], [ : ${LDSHARED='$(CC) -shared'}
|
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:15:56 +04:00
|
|
|
[esix*|uxpds*], [ : ${LDSHARED='$(LD) -G'}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:47:49 +04:00
|
|
|
[osf*], [ : ${LDSHARED='$(LD) -shared -expect_unresolved "*"'}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
|
|
|
[bsdi3*], [ AS_CASE(["$CC"],
|
2010-03-24 23:44:45 +03:00
|
|
|
[*shlicc*], [ : ${LDSHARED='$(CC) -r'}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes])],
|
2010-01-21 03:38:03 +03:00
|
|
|
[linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu], [
|
2010-03-24 23:44:45 +03:00
|
|
|
: ${LDSHARED='$(CC) -shared'}
|
2004-12-19 11:25:36 +03:00
|
|
|
if test "$rb_cv_binary_elf" = yes; then
|
|
|
|
LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
|
|
|
|
fi
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-03-24 23:44:45 +03:00
|
|
|
[interix*], [ : ${LDSHARED='$(CC) -shared'}
|
2004-01-21 17:53:31 +03:00
|
|
|
XLDFLAGS="$XLDFLAGS -Wl,-E"
|
2007-04-20 11:04:35 +04:00
|
|
|
LIBPATHFLAG=" -L%1\$-s"
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-01-21 03:38:03 +03:00
|
|
|
[freebsd*|dragonfly*], [
|
2010-03-24 23:44:45 +03:00
|
|
|
: ${LDSHARED='$(CC) -shared'}
|
2000-02-01 06:12:21 +03:00
|
|
|
if test "$rb_cv_binary_elf" = yes; then
|
2003-11-30 12:33:03 +03:00
|
|
|
LDFLAGS="$LDFLAGS -rdynamic"
|
|
|
|
DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$(.TARGET)'
|
1999-08-13 09:45:20 +04:00
|
|
|
else
|
2012-05-16 10:15:56 +04:00
|
|
|
test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
|
1999-08-13 09:45:20 +04:00
|
|
|
fi
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-03-24 23:44:45 +03:00
|
|
|
[openbsd*], [ : ${LDSHARED='$(CC) -shared ${CCDLFLAGS}'}
|
2002-12-31 13:53:14 +03:00
|
|
|
if test "$rb_cv_binary_elf" = yes; then
|
2003-11-30 12:33:03 +03:00
|
|
|
LDFLAGS="$LDFLAGS -Wl,-E"
|
2002-12-31 13:53:14 +03:00
|
|
|
fi
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-01-21 03:38:03 +03:00
|
|
|
[darwin*], [ : ${LDSHARED='$(CC) -dynamic -bundle'}
|
2012-07-30 08:11:56 +04:00
|
|
|
: ${DLDFLAGS="${linker_flag}-undefined${linker_flag:+,}dynamic_lookup ${linker_flag}-multiply_defined${linker_flag:+,}suppress"}
|
2003-11-30 12:33:03 +03:00
|
|
|
: ${LDFLAGS=""}
|
2004-02-09 11:48:55 +03:00
|
|
|
: ${LIBPATHENV=DYLD_LIBRARY_PATH}
|
2009-01-17 13:20:07 +03:00
|
|
|
# /usr/local/include is always searched for
|
|
|
|
# some reason, but /usr/local/lib is not.
|
|
|
|
hdr=`find /usr/local/include -name \*.h -type f | sed 's:^/usr/local/include/::;q'`
|
2011-09-25 11:45:08 +04:00
|
|
|
if test -n "$hdr" && $CC -E -include "$hdr" -xc /dev/null 2>/dev/null | fgrep -q "$hdr"; then
|
2009-01-17 13:20:07 +03:00
|
|
|
$CC -print-search-dirs | grep -q '^libraries:.*:/usr/local/lib/*' ||
|
|
|
|
echo " $LDFLAGS " | grep -q ' -L */usr/local/lib/* ' ||
|
|
|
|
LDFLAGS="${LDFLAGS:+$LDFLAGS }-L/usr/local/lib"
|
|
|
|
fi
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-05-15 21:25:17 +04:00
|
|
|
[aix*], [ : ${LDSHARED='$(CC)'}
|
2007-08-16 11:46:11 +04:00
|
|
|
LDSHARED="$LDSHARED ${linker_flag}-G"
|
2012-07-18 09:53:23 +04:00
|
|
|
EXTDLDFLAGS='-e$(TARGET_ENTRY)'
|
2009-09-11 09:19:28 +04:00
|
|
|
XLDFLAGS="${linker_flag}"'-bE:$(ARCHFILE)'" ${linker_flag}-brtl"
|
2008-09-08 01:50:32 +04:00
|
|
|
XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
|
2006-12-31 18:02:22 +03:00
|
|
|
: ${ARCHFILE="ruby.imp"}
|
2006-08-07 09:44:43 +04:00
|
|
|
TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
|
|
|
|
TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)'
|
2012-07-23 09:43:37 +04:00
|
|
|
: ${LIBPATHENV=LIBPATH}
|
2010-05-15 21:25:17 +04:00
|
|
|
RPATHFLAG=" ${linker_flag}-blibpath:%1\$-s:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-01-21 03:38:03 +03:00
|
|
|
[beos*], [ AS_CASE(["$target_cpu"],
|
|
|
|
[powerpc*], [
|
2012-05-16 10:15:56 +04:00
|
|
|
: ${LDSHARED='$(LD) -xms'}
|
2012-07-18 09:53:23 +04:00
|
|
|
EXTDLDFLAGS='-export $(TARGET_ENTRY)'
|
|
|
|
DLDFLAGS="$DLDFLAGS -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
|
2008-09-19 04:33:19 +04:00
|
|
|
LDFLAGS="$LDFLAGS -L/boot/home/config/lib -lbe -lroot"
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[i586*], [
|
2012-05-16 10:15:56 +04:00
|
|
|
: ${LDSHARED='$(LD) -shared'}
|
2012-08-23 06:59:24 +04:00
|
|
|
DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib \$(topdir)/_APP_ -lroot"
|
|
|
|
LDFLAGS="$LDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib -lroot"
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2004-02-09 11:48:55 +03:00
|
|
|
: ${LIBPATHENV=LIBRARY_PATH}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-01-21 03:38:03 +03:00
|
|
|
[haiku*], [ AS_CASE(["$target_cpu"],
|
|
|
|
[powerpc*], [
|
2012-05-16 10:15:56 +04:00
|
|
|
: ${LDSHARED='$(LD) -xms'}
|
2012-07-18 09:53:23 +04:00
|
|
|
EXTDLDFLAGS='-export $(TARGET_ENTRY)'
|
2012-08-28 15:05:23 +04:00
|
|
|
DLDFLAGS="$DLDFLAGS -lroot glue-noinit.a init_term_dyn.o start_dyn.o"
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[i586*], [
|
2012-05-16 10:15:56 +04:00
|
|
|
: ${LDSHARED='$(LD) -shared'}
|
2012-08-28 15:05:23 +04:00
|
|
|
DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lroot"
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2008-08-07 00:52:44 +04:00
|
|
|
: ${LIBPATHENV=LIBRARY_PATH}
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes ],
|
|
|
|
[nto-qnx*], [ DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
|
2012-05-16 10:15:56 +04:00
|
|
|
: ${LDSHARED='$(LD) -Bshareable -x'}
|
2003-11-30 12:33:03 +03:00
|
|
|
LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes],
|
|
|
|
[cygwin*|mingw*], [
|
2010-03-24 23:44:45 +03:00
|
|
|
: ${LDSHARED='$(CC) -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)'}
|
2008-09-08 01:50:32 +04:00
|
|
|
XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import"
|
2009-01-20 09:32:36 +03:00
|
|
|
DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
|
2004-02-09 11:48:55 +03:00
|
|
|
: ${LIBPATHENV=""}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:15:56 +04:00
|
|
|
[hiuxmpp], [ : ${LDSHARED='$(LD) -r'}],
|
2010-03-24 23:44:45 +03:00
|
|
|
[atheos*], [ : ${LDSHARED='$(CC) -shared'}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-01-21 03:38:03 +03:00
|
|
|
[os2-emx*], [ LDFLAGS="$LDFLAGS -Zomf"
|
|
|
|
],
|
2012-05-17 06:48:59 +04:00
|
|
|
[nacl], [ LDSHARED='$(CC) -shared' ],
|
2012-05-16 10:15:56 +04:00
|
|
|
[ : ${LDSHARED='$(LD)'}])
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_MSG_RESULT($rb_cv_dlopen)
|
|
|
|
fi
|
2005-04-21 01:45:43 +04:00
|
|
|
if test "${LDSHAREDXX}" = ""; then
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["${LDSHARED}"],
|
|
|
|
[*'$(CC)'*], [
|
2005-04-21 01:45:43 +04:00
|
|
|
LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\$(CC)/$(CXX)/'`
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[*'${CC}'*], [
|
2005-04-21 01:45:43 +04:00
|
|
|
LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\${CC}/${CXX}/'`
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[*$CC*], [
|
2005-04-21 01:45:43 +04:00
|
|
|
LDSHAREDXX=`echo "${LDSHARED}" | sed "s|$CC|$CXX|"`
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[ld" "*], [
|
|
|
|
])
|
|
|
|
fi
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE([${RPATHFLAG}],[*'%1$'*],[: ${LIBPATHFLAG=' -L%1$-s'}],[: ${LIBPATHFLAG=' -L%s'}])
|
2005-04-21 01:45:43 +04:00
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
AC_SUBST(LINK_SO)
|
|
|
|
AC_SUBST(LIBPATHFLAG)
|
2003-10-31 06:58:21 +03:00
|
|
|
AC_SUBST(RPATHFLAG)
|
2004-02-09 11:48:55 +03:00
|
|
|
AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
|
2004-06-26 10:10:52 +04:00
|
|
|
AC_SUBST(TRY_LINK)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2012-08-23 05:50:12 +04:00
|
|
|
AC_ARG_WITH(opt-dir,
|
2012-10-17 10:33:14 +04:00
|
|
|
AS_HELP_STRING([--with-opt-dir=DIR-LIST],
|
|
|
|
[add optional headers and libraries directories separated by $PATH_SEPARATOR]),
|
2012-08-23 05:50:12 +04:00
|
|
|
[
|
2012-11-08 07:09:18 +04:00
|
|
|
val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"`
|
|
|
|
CPPFLAGS="$CPPFLAGS $val"
|
2012-10-17 10:33:14 +04:00
|
|
|
set -x
|
|
|
|
val=`IFS="$PATH_SEPARATOR"
|
|
|
|
for dir in $withval; do
|
|
|
|
echo x ${LIBPATHFLAG} ${RPATHFLAG} |
|
|
|
|
sed -E 's/^x *//;s'"${PATH_SEPARATOR}"'%1\\$-s|%s'"${IFS}${dir}/lib${IFS}g"
|
|
|
|
done | tr '\012' ' '`
|
|
|
|
set +x
|
|
|
|
LDFLAGS="$LDFLAGS${LDFLAGS:+ }$val"
|
|
|
|
DLDFLAGS="$DLDFLAGS${DLDFLAGS:+ }$val"
|
2012-08-23 05:50:12 +04:00
|
|
|
])
|
|
|
|
|
|
|
|
AS_CASE(["$target_cpu-$target_os"],
|
|
|
|
[*-freebsd*|x86_64-netbsd*], [
|
|
|
|
AC_CHECK_HEADERS([execinfo.h])
|
|
|
|
if test "x$ac_cv_header_execinfo_h" = xyes; then
|
|
|
|
AC_CHECK_LIB([execinfo], [backtrace])
|
|
|
|
fi])
|
|
|
|
AC_CHECK_FUNCS(backtrace)
|
|
|
|
|
|
|
|
AC_ARG_WITH(valgrind,
|
|
|
|
AS_HELP_STRING([--without-valgrind],[disable valgrind memcheck support]),
|
|
|
|
[], with_valgrind=yes)
|
|
|
|
AS_IF([test x$with_valgrind != xno],
|
|
|
|
[AC_CHECK_HEADERS(valgrind/memcheck.h)])
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
dln_a_out_works=no
|
|
|
|
if test "$ac_cv_header_a_out_h" = yes; then
|
|
|
|
if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
|
|
|
|
cat confdefs.h > config.h
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_CACHE_CHECK(whether matz's dln works, rb_cv_dln_a_out,
|
1998-01-16 15:13:05 +03:00
|
|
|
[AC_TRY_COMPILE([
|
|
|
|
#define USE_DLN_A_OUT
|
|
|
|
#include "dln.c"
|
|
|
|
],
|
2009-02-02 12:34:36 +03:00
|
|
|
[],
|
1998-01-16 15:13:05 +03:00
|
|
|
rb_cv_dln_a_out=yes,
|
|
|
|
rb_cv_dln_a_out=no)])
|
|
|
|
if test "$rb_cv_dln_a_out" = yes; then
|
|
|
|
dln_a_out_works=yes
|
|
|
|
AC_DEFINE(USE_DLN_A_OUT)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$dln_a_out_works" = yes; then
|
|
|
|
if test "$GCC" = yes; then
|
|
|
|
STATIC=-static
|
|
|
|
else
|
|
|
|
STATIC=-Bstatic
|
|
|
|
fi
|
1999-08-13 09:45:20 +04:00
|
|
|
DLEXT=so
|
1998-01-16 15:13:05 +03:00
|
|
|
CCDLFLAGS=
|
|
|
|
else
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[hpux*], [
|
|
|
|
DLEXT=sl],
|
2011-09-26 04:19:03 +04:00
|
|
|
[darwin*], [
|
2009-09-13 13:48:45 +04:00
|
|
|
RUBY_APPEND_OPTION(XLDFLAGS, [-Wl,-u,_objc_msgSend])
|
2010-01-21 03:38:03 +03:00
|
|
|
DLEXT=bundle],
|
|
|
|
[os2-emx*], [
|
2009-02-19 08:48:14 +03:00
|
|
|
LOAD_RELATIVE=1
|
2010-01-21 03:38:03 +03:00
|
|
|
DLEXT=dll],
|
|
|
|
[cygwin*|mingw*|*djgpp*], [
|
2009-02-19 08:48:14 +03:00
|
|
|
LOAD_RELATIVE=1
|
2010-01-21 03:38:03 +03:00
|
|
|
DLEXT=so],
|
|
|
|
[
|
|
|
|
DLEXT=so])
|
1998-01-16 15:13:05 +03:00
|
|
|
fi
|
2009-03-09 18:06:22 +03:00
|
|
|
if test "$rb_cv_dlopen:$load_relative" = yes:yes; then
|
|
|
|
AC_CHECK_FUNCS(dladdr)
|
|
|
|
if test "$ac_cv_func_dladdr" = yes; then
|
|
|
|
LOAD_RELATIVE=1
|
|
|
|
fi
|
|
|
|
fi
|
2012-07-30 08:11:21 +04:00
|
|
|
if test x"$LOAD_RELATIVE" = x1; then
|
|
|
|
load_relative=yes
|
|
|
|
else
|
|
|
|
unset load_relative
|
|
|
|
fi
|
2009-03-09 18:06:22 +03:00
|
|
|
|
2007-05-03 17:19:11 +04:00
|
|
|
len=2 # .rb
|
|
|
|
n=`expr "$DLEXT" : '.*'`; test "$n" -gt "$len" && len=$n
|
|
|
|
n=`expr "$DLEXT2" : '.*'`; test "$n" -gt "$len" && len=$n
|
|
|
|
AC_DEFINE_UNQUOTED(DLEXT_MAXLEN, `expr $len + 1`)
|
|
|
|
test ".$DLEXT" = "." || AC_DEFINE_UNQUOTED(DLEXT, ".$DLEXT")
|
|
|
|
test ".$DLEXT2" = "." || AC_DEFINE_UNQUOTED(DLEXT2, ".$DLEXT2")
|
2007-12-15 12:56:59 +03:00
|
|
|
AC_SUBST(DLEXT)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
if test "$with_dln_a_out" = yes; then
|
|
|
|
STRIP=true
|
|
|
|
else
|
2011-04-27 02:42:46 +04:00
|
|
|
AC_CHECK_TOOL(STRIP, strip, :)dnl
|
1998-01-16 15:13:05 +03:00
|
|
|
fi
|
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu], [
|
2011-04-27 02:42:46 +04:00
|
|
|
STRIP="$STRIP -S -x"],
|
2011-09-26 04:19:03 +04:00
|
|
|
[darwin*], [
|
2011-04-27 02:42:46 +04:00
|
|
|
STRIP="$STRIP -A -n"])
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2010-02-18 16:33:25 +03:00
|
|
|
AC_ARG_WITH(ext,
|
|
|
|
AC_HELP_STRING([--with-ext=EXTS],
|
|
|
|
[pass to --with-ext option of extmk.rb]))
|
|
|
|
AC_ARG_WITH(out-ext,
|
|
|
|
AC_HELP_STRING([--with-out-ext=EXTS],
|
|
|
|
[pass to --without-ext option of extmk.rb]))
|
1998-01-16 15:13:05 +03:00
|
|
|
EXTSTATIC=
|
|
|
|
AC_SUBST(EXTSTATIC)dnl
|
|
|
|
AC_ARG_WITH(static-linked-ext,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--with-static-linked-ext], [link external modules statically]),
|
2010-01-21 09:10:16 +03:00
|
|
|
[AS_CASE([$withval],[yes],[STATIC=;EXTSTATIC=static])])
|
2012-05-16 09:39:06 +04:00
|
|
|
if test x"$EXTSTATIC" = xstatic; then
|
2012-05-19 06:35:37 +04:00
|
|
|
ENCOBJS='enc/encinit.$(OBJEXT) enc/libenc.$(LIBEXT) enc/libtrans.$(LIBEXT)'
|
2012-05-19 10:02:43 +04:00
|
|
|
EXTOBJS='ext/extinit.$(OBJEXT)'
|
2012-05-16 09:39:06 +04:00
|
|
|
AC_DEFINE_UNQUOTED(EXTSTATIC, 1)
|
|
|
|
fi
|
|
|
|
AC_SUBST(ENCOBJS)
|
|
|
|
AC_SUBST(EXTOBJS)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
1999-08-13 09:45:20 +04:00
|
|
|
dnl OS/2 environment w/ Autoconf 2.1x for EMX
|
2010-01-21 03:38:03 +03:00
|
|
|
[os2-emx], [
|
1999-08-13 09:45:20 +04:00
|
|
|
setup=Setup.emx
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[*djgpp*], [
|
2000-05-21 16:23:51 +04:00
|
|
|
setup=Setup.dj
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
2012-05-17 06:48:59 +04:00
|
|
|
[nacl], [
|
|
|
|
setup=Setup.nacl
|
|
|
|
],
|
2010-01-21 03:38:03 +03:00
|
|
|
[
|
1998-01-16 15:13:05 +03:00
|
|
|
setup=Setup
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
1999-01-20 07:59:39 +03:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_SUBST(setup)
|
|
|
|
|
|
|
|
if test "$prefix" = NONE; then
|
|
|
|
prefix=$ac_default_prefix
|
|
|
|
fi
|
|
|
|
|
2012-05-17 06:48:59 +04:00
|
|
|
BTESTRUBY='$(MINIRUBY)'
|
2000-01-05 07:41:21 +03:00
|
|
|
if test x"$cross_compiling" = xyes; then
|
2012-08-09 18:46:48 +04:00
|
|
|
test x"$MINIRUBY" = x && MINIRUBY="${RUBY-$BASERUBY} -I`$CHDIR .; pwd` "-r'$(arch)-fake'
|
2010-09-24 20:34:56 +04:00
|
|
|
XRUBY_LIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["libdir"]']`
|
|
|
|
XRUBY_RUBYLIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubylibdir"]']`
|
|
|
|
XRUBY_RUBYHDRDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubyhdrdir"]']`
|
|
|
|
AC_SUBST(XRUBY_LIBDIR)
|
|
|
|
AC_SUBST(XRUBY_RUBYLIBDIR)
|
|
|
|
AC_SUBST(XRUBY_RUBYHDRDIR)
|
2009-02-19 09:47:13 +03:00
|
|
|
PREP='$(arch)-fake.rb'
|
2004-02-09 11:48:55 +03:00
|
|
|
RUNRUBY='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
|
2009-10-23 02:32:39 +04:00
|
|
|
XRUBY='$(MINIRUBY)'
|
2009-07-20 06:13:00 +04:00
|
|
|
TEST_RUNNABLE=no
|
2012-05-17 06:48:59 +04:00
|
|
|
|
2012-06-09 02:44:01 +04:00
|
|
|
if test "$host_os" = "nacl"; then
|
2012-05-17 06:48:59 +04:00
|
|
|
if test "$build_cpu" = "$host_cpu" || test "${nacl_cv_cpu_nick}" = "x86" -a "$host_cpu" = "i686"; then
|
|
|
|
nacl_cv_sel_ldr='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb sel_ldr`'
|
|
|
|
nacl_cv_irt_core='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb irt_core`'
|
|
|
|
nacl_cv_runnable_ld='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb runnable_ld`'
|
|
|
|
nacl_cv_host_lib='`$(MINIRUBY) $(srcdir)/nacl/nacl-config.rb host_lib`'
|
|
|
|
TEST_RUNNABLE=yes
|
|
|
|
BTESTRUBY="${nacl_cv_sel_ldr} -a -B ${nacl_cv_irt_core} -w 1:3 -w 2:4"
|
|
|
|
BTESTRUBY="$BTESTRUBY -- ${nacl_cv_runnable_ld} --library-path ${nacl_cv_host_lib}"
|
|
|
|
BTESTRUBY="$BTESTRUBY `pwd`/"'miniruby$(EXEEXT) -I`cd $(srcdir)/lib; pwd` -I.'
|
|
|
|
BTESTRUBY="$BTESTRUBY"' -I$(EXTOUT)/common 3>&1 4>&2 1>/dev/null 2>/dev/null '
|
|
|
|
fi
|
|
|
|
fi
|
2000-01-05 07:41:21 +03:00
|
|
|
else
|
2011-01-14 05:37:34 +03:00
|
|
|
MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib -I.'
|
2010-08-03 02:52:25 +04:00
|
|
|
MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common'
|
2004-03-06 03:53:04 +03:00
|
|
|
PREP='miniruby$(EXEEXT)'
|
2009-05-22 15:48:42 +04:00
|
|
|
RUNRUBY='$(MINIRUBY) $(srcdir)/tool/runruby.rb --extout=$(EXTOUT)'
|
2009-10-23 02:32:39 +04:00
|
|
|
XRUBY='$(RUNRUBY)'
|
2009-07-20 06:13:00 +04:00
|
|
|
TEST_RUNNABLE=yes
|
2000-01-05 07:41:21 +03:00
|
|
|
fi
|
2009-07-20 06:13:00 +04:00
|
|
|
AC_SUBST(TEST_RUNNABLE)
|
2000-01-05 07:41:21 +03:00
|
|
|
AC_SUBST(MINIRUBY)
|
2012-05-17 06:48:59 +04:00
|
|
|
AC_SUBST(BTESTRUBY)
|
2000-01-05 07:41:21 +03:00
|
|
|
AC_SUBST(PREP)
|
2004-02-09 11:48:55 +03:00
|
|
|
AC_SUBST(RUNRUBY)
|
2009-10-23 02:32:39 +04:00
|
|
|
AC_SUBST(XRUBY)
|
2007-06-10 07:06:15 +04:00
|
|
|
AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
|
2000-01-05 07:41:21 +03:00
|
|
|
|
2000-03-13 10:18:45 +03:00
|
|
|
FIRSTMAKEFILE=""
|
2002-11-14 16:51:19 +03:00
|
|
|
LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
|
1999-08-13 09:45:20 +04:00
|
|
|
LIBRUBY='$(LIBRUBY_A)'
|
2002-11-14 16:51:19 +03:00
|
|
|
LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static'
|
|
|
|
LIBRUBYARG='$(LIBRUBYARG_STATIC)'
|
1999-01-20 07:59:39 +03:00
|
|
|
SOLIBS=
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2011-09-26 04:19:03 +04:00
|
|
|
[cygwin*|mingw*|beos*|haiku*|darwin*|os2-emx*], [
|
2003-11-30 12:33:03 +03:00
|
|
|
: ${DLDLIBS=""}
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[
|
2003-11-30 12:33:03 +03:00
|
|
|
DLDLIBS="$DLDLIBS -lc"
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2000-05-09 08:53:16 +04:00
|
|
|
|
2009-05-08 05:14:14 +04:00
|
|
|
AC_ARG_WITH(soname,
|
|
|
|
AS_HELP_STRING([--with-soname=SONAME], [base name of shared library]),
|
|
|
|
[RUBY_SO_NAME=$withval], [RUBY_SO_NAME='$(RUBY_BASE_NAME)'])
|
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
LIBRUBY_LDSHARED=$LDSHARED
|
|
|
|
LIBRUBY_DLDFLAGS=$DLDFLAGS
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
|
|
|
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so'
|
2000-07-02 19:57:18 +04:00
|
|
|
ENABLE_SHARED=no
|
|
|
|
|
2001-11-30 12:17:30 +03:00
|
|
|
AC_ARG_ENABLE(shared,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
|
1999-08-13 09:45:20 +04:00
|
|
|
[enable_shared=$enableval])
|
2010-05-21 08:35:58 +04:00
|
|
|
libprefix='$(libdir)'
|
2012-07-30 08:11:21 +04:00
|
|
|
LIBRUBY_RELATIVE=${load_relative-no}
|
2010-05-21 08:55:48 +04:00
|
|
|
AS_CASE("$enable_shared", [yes], [
|
1999-08-13 09:45:20 +04:00
|
|
|
LIBRUBY='$(LIBRUBY_SO)'
|
2010-05-21 08:55:48 +04:00
|
|
|
LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
|
2002-11-14 16:51:19 +03:00
|
|
|
LIBRUBYARG='$(LIBRUBYARG_SHARED)'
|
2012-07-30 08:11:21 +04:00
|
|
|
LIBRUBY_RELATIVE=no
|
2009-02-08 07:09:34 +03:00
|
|
|
test -z "$CCDLFLAGS" || CFLAGS="$CFLAGS $CCDLFLAGS"
|
2000-07-02 19:57:18 +04:00
|
|
|
ENABLE_SHARED=yes
|
2001-03-16 11:17:44 +03:00
|
|
|
if test "$rb_cv_binary_elf" = yes; then
|
|
|
|
SOLIBS='$(LIBS)'
|
|
|
|
fi
|
2011-11-25 05:41:59 +04:00
|
|
|
|
2012-08-29 10:03:09 +04:00
|
|
|
# libdir can be overridden in config.site file (on OpenSUSE at least).
|
|
|
|
libdir_basename=lib
|
|
|
|
if test "$bindir" = '${exec_prefix}/bin'; then
|
|
|
|
AS_CASE(["$libdir"], ['${exec_prefix}/'*], [libdir_basename=`basename "$libdir"`])
|
|
|
|
fi
|
2012-09-01 09:03:34 +04:00
|
|
|
AC_DEFINE_UNQUOTED(LIBDIR_BASENAME, ["${libdir_basename}"])
|
2012-08-29 10:03:09 +04:00
|
|
|
|
2011-11-26 23:59:13 +04:00
|
|
|
AS_CASE(["$target_os"],
|
2011-11-27 02:49:28 +04:00
|
|
|
[freebsd*|dragonfly*], [],
|
2011-11-26 23:59:13 +04:00
|
|
|
[
|
|
|
|
if test "$GCC" = yes; then
|
2011-12-02 10:18:21 +04:00
|
|
|
RUBY_TRY_LDFLAGS([${linker_flag}--no-undefined], [no_undefined=yes], [no_undefined=no])
|
2011-11-27 08:30:44 +04:00
|
|
|
if test "no_undefined" = yes; then
|
2011-12-02 10:18:21 +04:00
|
|
|
RUBY_APPEND_OPTION(EXTLDFLAGS, [${linker_flag}--no-undefined])
|
2011-11-27 08:30:44 +04:00
|
|
|
fi
|
2011-11-26 23:59:13 +04:00
|
|
|
fi
|
|
|
|
])
|
2011-11-25 05:41:59 +04:00
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[sunos4*], [
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu], [
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
|
|
|
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
|
2010-11-06 01:28:45 +03:00
|
|
|
if test "$load_relative" = yes; then
|
2012-08-29 10:03:09 +04:00
|
|
|
LIBRUBY_RPATHFLAGS="'-Wl,-rpath,\$\${ORIGIN}/../${libdir_basename}'"
|
2010-11-06 01:28:45 +03:00
|
|
|
LIBRUBY_RELATIVE=yes
|
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[freebsd*|dragonfly*], [
|
2001-03-16 11:17:44 +03:00
|
|
|
SOLIBS='$(LIBS)'
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
|
2000-02-01 06:12:21 +03:00
|
|
|
if test "$rb_cv_binary_elf" != "yes" ; then
|
1999-08-13 09:45:20 +04:00
|
|
|
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
|
|
|
|
LIBRUBY_ALIASES=''
|
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[netbsd*], [
|
2001-03-16 11:17:44 +03:00
|
|
|
SOLIBS='$(LIBS)'
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
|
|
|
|
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
|
2000-02-01 06:12:21 +03:00
|
|
|
if test "$rb_cv_binary_elf" = yes; then # ELF platforms
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
|
2001-12-02 21:33:10 +03:00
|
|
|
else # a.out platforms
|
|
|
|
LIBRUBY_ALIASES=""
|
2000-02-01 06:12:21 +03:00
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[openbsd*], [
|
2001-03-16 11:17:44 +03:00
|
|
|
SOLIBS='$(LIBS)'
|
2010-09-19 08:44:31 +04:00
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[solaris*], [
|
2004-12-19 11:25:36 +03:00
|
|
|
SOLIBS='$(LIBS)'
|
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)'
|
|
|
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY) lib$(RUBY_SO_NAME).so'
|
|
|
|
if test "$GCC" = yes; then
|
|
|
|
LIBRUBY_DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(@F)'
|
2010-11-08 06:19:14 +03:00
|
|
|
else
|
|
|
|
LIBRUBY_DLDFLAGS="$DLDFLAGS "'-h $(@F)'
|
2004-12-19 11:25:36 +03:00
|
|
|
fi
|
2003-11-30 12:33:03 +03:00
|
|
|
XLDFLAGS="$XLDFLAGS "'-R${libdir}'
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[hpux*], [
|
2003-11-30 12:33:03 +03:00
|
|
|
XLDFLAGS="$XLDFLAGS "'-Wl,+s,+b,$(libdir)'
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)'
|
|
|
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).sl'
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[aix*], [
|
2007-08-16 11:46:11 +04:00
|
|
|
LIBRUBY_DLDFLAGS="${linker_flag}-bnoentry $XLDFLAGS"
|
2006-10-30 17:41:43 +03:00
|
|
|
LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}'
|
1999-08-13 09:45:20 +04:00
|
|
|
SOLIBS='-lm -lc'
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[beos*], [
|
|
|
|
AS_CASE(["$target_cpu"],
|
|
|
|
[powerpc*], [
|
2000-05-24 08:34:26 +04:00
|
|
|
LIBRUBY_DLDFLAGS='-f ruby.exp -lnet -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
|
|
|
],
|
|
|
|
[darwin*], [
|
2009-02-07 12:02:50 +03:00
|
|
|
RUBY_SO_NAME="$RUBY_SO_NAME"'.$(MAJOR).$(MINOR).$(TEENY)'
|
2009-08-24 21:16:40 +04:00
|
|
|
LIBRUBY_LDSHARED='$(CC) -dynamiclib'
|
2009-03-09 18:06:22 +03:00
|
|
|
if test "$load_relative" = yes; then
|
2012-08-29 10:03:09 +04:00
|
|
|
libprefix="@executable_path/../${libdir_basename}"
|
2010-11-06 01:28:45 +03:00
|
|
|
LIBRUBY_RELATIVE=yes
|
2009-03-09 18:06:22 +03:00
|
|
|
fi
|
2009-08-24 21:16:40 +04:00
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
|
2009-02-19 08:39:55 +03:00
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(MAJOR).$(MINOR).$(TEENY)'
|
2009-04-07 08:14:34 +04:00
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(ruby_version)'
|
2010-09-25 05:30:52 +04:00
|
|
|
if test "$visibility_option" = ld; then
|
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
|
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,*_threadptr_*'
|
|
|
|
fi
|
2009-10-10 13:19:05 +04:00
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "' $(XLDFLAGS)'
|
2009-04-08 04:46:00 +04:00
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).dylib'
|
2009-05-08 05:14:14 +04:00
|
|
|
LIBRUBY_ALIASES='lib$(RUBY_BASE_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib'
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[interix*], [
|
2007-04-17 21:17:15 +04:00
|
|
|
LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
|
2012-07-03 06:16:08 +04:00
|
|
|
],
|
|
|
|
[mingw*|cygwin*|mswin*], [
|
|
|
|
LIBRUBY_RELATIVE=yes
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2010-05-21 08:55:48 +04:00
|
|
|
], [
|
|
|
|
LIBRUBYARG_SHARED=
|
2011-11-25 03:50:00 +04:00
|
|
|
|
|
|
|
# enable PIE if possible
|
2012-09-13 05:22:13 +04:00
|
|
|
pie=
|
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[haiku], [
|
|
|
|
# gcc supports PIE, but doesn't work correctly in Haiku
|
|
|
|
pie=no
|
|
|
|
])
|
|
|
|
if test "$GCC" = yes -a -z "$EXTSTATIC" -a "x$pie" != xno; then
|
2011-12-02 10:41:27 +04:00
|
|
|
RUBY_TRY_CFLAGS(-fPIE, [pie=yes], [pie=no])
|
|
|
|
if test "$pie" = yes; then
|
|
|
|
RUBY_APPEND_OPTION(XCFLAGS, -fPIE)
|
|
|
|
for pie in -pie -Wl,-pie; do
|
|
|
|
RUBY_TRY_LDFLAGS([$pie], [], [pie=])
|
|
|
|
if test "x$pie" != x; then
|
|
|
|
RUBY_APPEND_OPTION(XLDFLAGS, $pie)
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2011-11-25 03:50:00 +04:00
|
|
|
fi
|
2010-05-21 08:55:48 +04:00
|
|
|
])
|
2004-12-19 11:25:36 +03:00
|
|
|
if test "$enable_rpath" = yes; then
|
2010-11-06 01:28:45 +03:00
|
|
|
test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
|
|
|
|
LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${linker_flag}-R ${linker_flag}${libprefix} -L\$(libdir)"
|
2008-11-16 20:19:05 +03:00
|
|
|
LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
|
|
|
|
LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
|
2004-12-19 11:25:36 +03:00
|
|
|
fi
|
2010-11-06 01:28:45 +03:00
|
|
|
AC_SUBST(LIBRUBY_RELATIVE)
|
2004-12-19 11:25:36 +03:00
|
|
|
|
2007-04-17 21:17:15 +04:00
|
|
|
LDFLAGS="-L. $LDFLAGS"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
AC_SUBST(ARCHFILE)
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2009-11-30 10:54:26 +03:00
|
|
|
if test "$EXEEXT" = .exe; then
|
|
|
|
EXECUTABLE_EXTS='".exe",".com",".cmd",".bat"'
|
|
|
|
AC_DEFINE_UNQUOTED(EXECUTABLE_EXTS, $EXECUTABLE_EXTS)
|
2010-01-29 08:21:55 +03:00
|
|
|
EXECUTABLE_EXTS=`echo $EXECUTABLE_EXTS | tr -d '"' | tr , ' '`
|
2009-11-30 10:54:26 +03:00
|
|
|
AC_SUBST(EXECUTABLE_EXTS)
|
|
|
|
fi
|
|
|
|
|
2012-08-21 20:18:10 +04:00
|
|
|
}
|
|
|
|
{ # build section
|
2009-02-09 22:34:43 +03:00
|
|
|
|
2004-01-08 17:58:57 +03:00
|
|
|
dnl build rdoc index if requested
|
|
|
|
RDOCTARGET=""
|
2010-09-19 17:10:27 +04:00
|
|
|
CAPITARGET=""
|
2004-01-08 17:58:57 +03:00
|
|
|
AC_ARG_ENABLE(install-doc,
|
2010-09-19 17:10:27 +04:00
|
|
|
AS_HELP_STRING([--disable-install-doc], [do not install neither rdoc indexes nor C API documents during install]),
|
2004-01-10 20:39:07 +03:00
|
|
|
[install_doc=$enableval], [install_doc=yes])
|
2010-09-19 17:10:27 +04:00
|
|
|
AC_ARG_ENABLE(install-rdoc,
|
|
|
|
AS_HELP_STRING([--disable-install-rdoc], [do not install rdoc indexes during install]),
|
|
|
|
[install_rdoc=$enableval], [install_rdoc=yes])
|
|
|
|
AC_ARG_ENABLE(install-capi,
|
|
|
|
AS_HELP_STRING([--disable-install-capi], [do not install C API documents during install]),
|
|
|
|
[install_capi=$enableval], [install_capi=yes])
|
|
|
|
|
2004-01-08 17:58:57 +03:00
|
|
|
if test "$install_doc" != no; then
|
2010-09-19 17:10:27 +04:00
|
|
|
if test "$install_rdoc" != no; then
|
|
|
|
RDOCTARGET="rdoc"
|
|
|
|
else
|
|
|
|
RDOCTARGET="nodoc"
|
|
|
|
fi
|
|
|
|
if test "$install_capi" != no -a -n "$DOXYGEN"; then
|
|
|
|
CAPITARGET="capi"
|
|
|
|
else
|
|
|
|
CAPITARGET="nodoc"
|
|
|
|
fi
|
2009-09-14 06:23:47 +04:00
|
|
|
else
|
|
|
|
RDOCTARGET="nodoc"
|
2010-04-08 09:35:37 +04:00
|
|
|
CAPITARGET="nodoc"
|
2004-01-08 17:58:57 +03:00
|
|
|
fi
|
2010-09-19 17:10:27 +04:00
|
|
|
|
2004-01-08 17:58:57 +03:00
|
|
|
AC_SUBST(RDOCTARGET)
|
2010-09-19 17:10:27 +04:00
|
|
|
AC_SUBST(CAPITARGET)
|
2004-01-08 17:58:57 +03:00
|
|
|
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE(["$RDOCTARGET:$CAPITARGET"],[nodoc:nodoc],[INSTALLDOC=nodoc],[INSTALLDOC=all])
|
2009-09-16 11:20:19 +04:00
|
|
|
AC_SUBST(INSTALLDOC)
|
|
|
|
|
2007-02-28 04:33:57 +03:00
|
|
|
if test "$rb_with_pthread" = "yes"; then
|
|
|
|
THREAD_MODEL=pthread
|
|
|
|
fi
|
2010-11-11 14:45:32 +03:00
|
|
|
AC_CACHE_CHECK([for prefix of external symbols], rb_cv_symbol_prefix, [
|
|
|
|
AC_TRY_COMPILE([extern void conftest_external(void) {}], [], [
|
|
|
|
rb_cv_symbol_prefix=`$NM conftest.$ac_objext |
|
2011-05-12 13:31:34 +04:00
|
|
|
sed -n ['/.*T[ ]\([^ ]*\)conftest_external.*/!d;s//\1/p;q']`
|
2010-11-06 01:33:18 +03:00
|
|
|
],
|
2010-11-11 14:45:32 +03:00
|
|
|
[rb_cv_symbol_prefix=''])
|
|
|
|
test -n "$rb_cv_symbol_prefix" || rb_cv_symbol_prefix=NONE
|
2010-11-06 01:33:18 +03:00
|
|
|
])
|
2010-11-11 14:45:32 +03:00
|
|
|
SYMBOL_PREFIX="$rb_cv_symbol_prefix"
|
|
|
|
test "x$SYMBOL_PREFIX" = xNONE && SYMBOL_PREFIX=''
|
2009-11-06 06:07:52 +03:00
|
|
|
MINIDLNOBJ=dmydln.o
|
2012-05-17 06:48:59 +04:00
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[linux*], [
|
|
|
|
],
|
|
|
|
[netbsd*], [
|
2009-02-08 07:09:34 +03:00
|
|
|
RUBY_APPEND_OPTION(CFLAGS, -pipe)
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[darwin*], [
|
2009-02-08 07:09:34 +03:00
|
|
|
RUBY_APPEND_OPTION(CFLAGS, -pipe)
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[os2-emx], [
|
2009-02-09 22:34:43 +03:00
|
|
|
AC_LIBOBJ([os2])
|
2011-11-27 12:26:54 +04:00
|
|
|
CFLAGS="$CFLAGS -DOS2"
|
2003-07-30 04:32:03 +04:00
|
|
|
LIBRUBY_A=`echo $LIBRUBY_A | sed 's/^lib//'`
|
|
|
|
LIBRUBY_SO=`echo $LIBRUBY_SO | sed 's/^lib//'`
|
|
|
|
LIBRUBY_ALIASES=`for i in $LIBRUBY_ALIASES; do echo "$i"; done | sed 's/^lib//'`
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[osf*], [
|
2001-12-02 17:10:27 +03:00
|
|
|
if test "$GCC" != "yes" ; then
|
2000-03-15 08:01:17 +03:00
|
|
|
# compile something small: taint.c is fine for this.
|
|
|
|
# the main point is the '-v' flag of 'cc'.
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["`cc -v -I. -c main.c -o /tmp/main.o 2>&1`"],
|
|
|
|
[*/gemc_cc*], [ # we have the new DEC GEM CC
|
2000-03-15 12:09:28 +03:00
|
|
|
CFLAGS="$CFLAGS -oldc"
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[ # we have the old MIPS CC
|
|
|
|
])
|
2000-03-15 08:01:17 +03:00
|
|
|
# cleanup
|
|
|
|
rm -f /tmp/main.o
|
|
|
|
CFLAGS="$CFLAGS -std"
|
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[beos*], [
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE(["$target_cpu"],[powerpc*], [CFLAGS="$CFLAGS -relax_pointers"])
|
2008-09-19 04:33:19 +04:00
|
|
|
CPPFLAGS="$CPPFLAGS -I/boot/home/config/include"
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[cygwin*|mingw*], [
|
2012-04-17 08:55:12 +04:00
|
|
|
RUBY_SO_NAME="${RUBY_SO_NAME}"'$(MAJOR)$(MINOR)$(TEENY)'
|
2005-11-05 07:43:46 +03:00
|
|
|
LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[cygwin*], [
|
2003-08-07 09:43:59 +04:00
|
|
|
if test x"$enable_shared" = xyes; then
|
2009-05-08 05:14:14 +04:00
|
|
|
LIBRUBY_SO='cyg$(RUBY_SO_NAME)'.dll
|
2009-01-20 09:32:36 +03:00
|
|
|
LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
|
2003-08-07 09:43:59 +04:00
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[mingw*], [
|
2009-05-08 05:14:14 +04:00
|
|
|
RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}"
|
2011-05-16 06:22:27 +04:00
|
|
|
if test x"${target_cpu}" != xi386; then
|
|
|
|
RUBY_SO_NAME="${target_cpu}-${RUBY_SO_NAME}"
|
|
|
|
fi
|
2003-08-07 09:43:59 +04:00
|
|
|
if test x"$enable_shared" = xyes; then
|
|
|
|
LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
|
2005-11-05 07:43:46 +03:00
|
|
|
LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
|
2003-08-07 09:43:59 +04:00
|
|
|
fi
|
2010-11-11 14:45:32 +03:00
|
|
|
EXPORT_PREFIX=' '
|
2010-01-29 06:59:39 +03:00
|
|
|
DLDFLAGS="${DLDFLAGS}"' $(DEFFILE)'
|
2012-02-28 19:51:25 +04:00
|
|
|
AC_LIBOBJ([win32/win32])
|
|
|
|
AC_LIBOBJ([win32/file])
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
COMMON_LIBS=m
|
2005-03-25 05:02:54 +03:00
|
|
|
# COMMON_MACROS="WIN32_LEAN_AND_MEAN="
|
2005-02-10 07:55:34 +03:00
|
|
|
COMMON_HEADERS="winsock2.h windows.h"
|
2007-02-28 04:33:57 +03:00
|
|
|
THREAD_MODEL=win32
|
2012-02-29 08:07:06 +04:00
|
|
|
PLATFORM_DIR=win32
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2003-08-07 09:43:59 +04:00
|
|
|
LIBRUBY_ALIASES=''
|
|
|
|
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
|
|
|
|
SOLIBS='$(LIBS)'
|
2005-11-05 07:43:46 +03:00
|
|
|
if test x"$enable_shared" = xyes; then
|
|
|
|
LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
|
|
|
|
else
|
2000-07-26 05:12:31 +04:00
|
|
|
LIBRUBY_SO=dummy
|
2002-06-11 14:26:13 +04:00
|
|
|
LIBRUBY='lib$(RUBY_SO_NAME).a'
|
2002-12-12 13:21:41 +03:00
|
|
|
LIBRUBYARG='-l$(RUBY_SO_NAME)'
|
2000-07-25 18:46:46 +04:00
|
|
|
fi
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[hpux*], [
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE(["$YACC"],[*yacc*], [
|
2003-03-05 06:15:06 +03:00
|
|
|
XCFLAGS="$XCFLAGS -DYYMAXDEPTH=300"
|
|
|
|
YACC="$YACC -Nl40000 -Nm40000"
|
2012-05-17 06:48:59 +04:00
|
|
|
])],
|
|
|
|
[nacl], [
|
|
|
|
FIRSTMAKEFILE=GNUmakefile:nacl/GNUmakefile.in
|
|
|
|
])
|
2008-04-03 07:56:07 +04:00
|
|
|
MINIOBJS="$MINIDLNOBJ"
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$THREAD_MODEL"],
|
2010-01-21 09:10:16 +03:00
|
|
|
[pthread], [AC_CHECK_HEADERS(pthread.h)],
|
|
|
|
[win32], [],
|
|
|
|
[""], [AC_MSG_ERROR(thread model is missing)],
|
|
|
|
[AC_MSG_ERROR(unknown thread model $THREAD_MODEL)])
|
2009-05-28 02:39:24 +04:00
|
|
|
|
2010-06-26 08:07:20 +04:00
|
|
|
AC_ARG_ENABLE(debug-env,
|
|
|
|
AS_HELP_STRING([--enable-debug-env], [enable RUBY_DEBUG environment variable]),
|
|
|
|
[AC_DEFINE(RUBY_DEBUG_ENV)])
|
|
|
|
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE(["$FIRSTMAKEFILE"], [*GNUmakefile:*], [gnumake=yes], [
|
2012-09-14 21:29:40 +04:00
|
|
|
AC_MSG_CHECKING([if ${MAKE-make} is GNU make])
|
2008-08-14 07:01:42 +04:00
|
|
|
mkdir conftest.dir
|
|
|
|
echo "all:; @echo yes" > conftest.dir/GNUmakefile
|
|
|
|
echo "all:; @echo no" > conftest.dir/Makefile
|
|
|
|
gnumake=`(cd conftest.dir; ${MAKE-make})`
|
|
|
|
rm -fr conftest.dir
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$gnumake"],
|
|
|
|
[*yes*], [
|
2008-08-14 07:01:42 +04:00
|
|
|
echo "include Makefile" > GNUmakefile
|
2008-10-17 13:15:00 +04:00
|
|
|
echo "-include uncommon.mk" >> GNUmakefile
|
2010-01-21 03:38:03 +03:00
|
|
|
gnumake=yes],
|
|
|
|
[
|
|
|
|
gnumake=no])
|
2008-08-14 07:01:42 +04:00
|
|
|
AC_MSG_RESULT($gnumake)
|
2010-01-21 09:10:16 +03:00
|
|
|
])
|
2011-07-31 15:31:55 +04:00
|
|
|
AS_IF([test "$gnumake" = yes], [ NULLCMD=: ], [
|
2011-07-31 18:17:45 +04:00
|
|
|
AC_MSG_CHECKING([for safe null command for ${MAKE-make}])
|
2011-07-31 15:31:55 +04:00
|
|
|
mkdir conftest.dir
|
|
|
|
echo 'A=1' > conftest.dir/Makefile
|
|
|
|
echo 'B=$(A:1=@:)' >> conftest.dir/Makefile
|
|
|
|
echo 'all:; $B 1 2 3 4 5 6 7 8 9' >> conftest.dir/Makefile
|
2011-07-31 18:17:45 +04:00
|
|
|
if (cd conftest.dir; ${MAKE-make} >/dev/null 2>/dev/null); then
|
2011-07-31 15:31:55 +04:00
|
|
|
NULLCMD=:
|
|
|
|
else
|
|
|
|
echo 'A=1' > conftest.dir/Makefile
|
|
|
|
echo 'B=$(A:1=@true)' >> conftest.dir/Makefile
|
|
|
|
echo 'all:; $B 1 2 3 4 5 6 7 8 9' >> conftest.dir/Makefile
|
2011-07-31 18:17:45 +04:00
|
|
|
if (cd conftest.dir; ${MAKE-make} >/dev/null 2>/dev/null); then
|
2011-07-31 15:31:55 +04:00
|
|
|
NULLCMD=true
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR(no candidate for safe null command)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
rm -fr conftest.dir
|
|
|
|
AC_MSG_RESULT($NULLCMD)
|
|
|
|
])
|
|
|
|
AC_SUBST(NULLCMD)
|
2003-01-01 12:26:45 +03:00
|
|
|
|
2009-02-08 07:09:34 +03:00
|
|
|
if test "${universal_binary-no}" = yes ; then
|
2010-03-11 05:16:39 +03:00
|
|
|
AC_CACHE_CHECK([for architecture macros], rb_cv_architecture_macros, [
|
2009-02-08 07:09:34 +03:00
|
|
|
mv confdefs.h confdefs1.h
|
|
|
|
: > confdefs.h
|
|
|
|
AC_TRY_COMPILE([@%:@if defined __`echo ${universal_archnames} |
|
|
|
|
sed 's/=[^ ]*//g;s/ /__ || defined __/g'`__
|
|
|
|
@%:@else
|
|
|
|
@%:@error
|
|
|
|
>>>>>><<<<<<
|
|
|
|
@%:@endif], [],
|
|
|
|
[
|
2010-03-11 05:16:39 +03:00
|
|
|
rb_cv_architecture_macros=yes
|
2009-02-08 07:09:34 +03:00
|
|
|
mv -f confdefs1.h confdefs.h
|
|
|
|
], [
|
2010-03-11 05:16:39 +03:00
|
|
|
rb_cv_architecture_macros=no
|
2009-02-08 07:09:34 +03:00
|
|
|
archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
|
2009-04-06 21:25:28 +04:00
|
|
|
new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
|
2009-02-08 07:09:34 +03:00
|
|
|
for archs in ${universal_archnames}; do
|
2012-08-21 20:18:05 +04:00
|
|
|
cpu=${archs@%:@*=}
|
2009-02-08 07:09:34 +03:00
|
|
|
archs=${archs%=*}
|
2009-04-06 21:25:28 +04:00
|
|
|
CFLAGS="$new_cflags -arch $archs"
|
2009-02-08 07:09:34 +03:00
|
|
|
archs="__${archs}__"
|
|
|
|
AC_MSG_CHECKING([for macro ${archs} on ${cpu}])
|
|
|
|
AC_TRY_COMPILE([@%:@ifndef ${archs}
|
|
|
|
@%:@error
|
|
|
|
@%:@endif], [], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
|
|
|
|
done
|
|
|
|
mv -f confdefs1.h confdefs.h
|
|
|
|
AC_MSG_ERROR([failed])
|
2010-03-11 05:16:39 +03:00
|
|
|
])])
|
2009-02-08 07:09:34 +03:00
|
|
|
fi
|
|
|
|
|
2007-10-13 23:08:37 +04:00
|
|
|
CPPFLAGS="$CPPFLAGS "'$(DEFS)'
|
2007-12-22 09:14:50 +03:00
|
|
|
test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
|
2009-04-06 15:16:15 +04:00
|
|
|
if test -n "${cflags+set}"; then
|
2009-05-06 00:34:05 +04:00
|
|
|
cflagspat=`eval echo '"'"${cflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
|
|
|
|
CFLAGS=`echo " $CFLAGS " | sed "s|$cflagspat"'|${cflags}|;s/^ *//;s/ *$//'`
|
2009-04-06 15:16:15 +04:00
|
|
|
fi
|
|
|
|
if test -n "${cxxflags+set}"; then
|
2009-05-06 00:34:05 +04:00
|
|
|
cxxflagspat=`eval echo '"'"${cxxflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
|
|
|
|
CXXFLAGS=`echo " $CXXFLAGS " | sed "s|$cxxflagspat"'|${cxxflags}|;s/^ *//;s/ *$//'`
|
2009-04-06 15:16:15 +04:00
|
|
|
fi
|
2009-02-07 12:02:50 +03:00
|
|
|
if test "${ARCH_FLAG}"; then
|
|
|
|
archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
|
2011-12-03 02:17:34 +04:00
|
|
|
CFLAGS=`echo "$CFLAGS" | sed "s| *$archflagpat"'||'`
|
|
|
|
CXXFLAGS=`echo "$CXXFLAGS" | sed "s| *$archflagpat"'||'`
|
|
|
|
LDFLAGS=`echo "$LDFLAGS" | sed "s| *$archflagpat"'||'`
|
2009-02-07 12:02:50 +03:00
|
|
|
fi
|
2011-02-15 13:44:58 +03:00
|
|
|
warnflags="$rb_cv_warnflags"
|
2007-12-22 09:14:50 +03:00
|
|
|
AC_SUBST(cppflags, [])dnl
|
2009-04-06 18:16:10 +04:00
|
|
|
AC_SUBST(cflags, ["$orig_cflags "'${optflags} ${debugflags} ${warnflags}'])dnl
|
2009-04-06 15:16:15 +04:00
|
|
|
AC_SUBST(cxxflags, ["$orig_cxxflags "'${optflags} ${debugflags} ${warnflags}'])dnl
|
2007-12-22 09:14:50 +03:00
|
|
|
AC_SUBST(optflags)dnl
|
|
|
|
AC_SUBST(debugflags)dnl
|
2008-05-31 10:58:11 +04:00
|
|
|
AC_SUBST(warnflags)dnl
|
2012-09-16 03:58:04 +04:00
|
|
|
AC_SUBST(strict_warnflags)dnl
|
* gc.c (Init_stack): stack region is far smaller than usual if
pthread is used.
* marshal.c (w_extended): singleton methods should not be checked
when dumping via marshal_dump() or _dump(). [ruby-talk:85909]
* file.c (getcwdofdrv): avoid using getcwd() directly, use
my_getcwd() instead.
* merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine
<sunshine@sunshineco.com>. [ruby-core:01596]
* marshal.c (w_object): LINK check earlier than anything else,
i.e. do not dump TYPE_IVAR for already dumped objects.
(ruby-bugs PR#1220)
* eval.c (rb_eval): call "inherited" only when a new class is
generated; not on reopening.
* eval.c (eval): prepend error position in evaluating string to
* configure.in: revived NextStep, OpenStep, and Rhapsody ports which
had become unbuildable; enhanced --enable-fat-binary option so that
it accepts a list of desired architectures (rather than assuming a
fixed list), or defaults to a platform-appropriate list if user does
not provide an explicit list; made the default list of architectures
for MAB (fat binary) more comprehensive; now uses -fno-common even
when building the interpreter (in addition to using it for
extensions), thus allowing the interpreter to be embedded into a
plugin module of an external project (in addition to allowing
embedding directly into an application); added checks for
<netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
ensures that -I/usr/local/include is employed when extensions'
extconf.rb scripts invoke have_header() since extension checks on
NextStep and OpenStep will fail without it if the desired resource
resides in the /usr/local tree; fixed formatting of --help message.
* Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
(see configure's --enable-fat-binary option); added rule for new
missing/getcwd.c.
* defines.h: fixed endian handling during MAB build (see configure's
--enable-fat-binary option) to ensure that all portions of the
project see the correct WORDS_BIGENDIAN value (some extension modules
were getting the wrong endian setting); added missing constants
GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
define in NeXT section.
* dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
NextStep since, on some installations, this value always resolves
uselessly to zero.
* dln.c: added error reporting to NextStep extension loader since the
previous behavior of failing silently was not useful; now ensures
that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
on Rhapsody since this header lacks multiple-include protection,
which resulted in "redefinition" compilation errors.
* main.c: also create hard reference to objc_msgSend() on NeXT
platforms (in addition to Apple platforms).
* lib/mkmf.rb: now exports XCFLAGS from configure script to extension
makefiles so that extensions can be built MAB (see configure's
--enable-fat-binary option); also utilize XCFLAGS in cc_command()
(but not cpp_command() because MAB flags are incompatible with
direct invocation of `cpp').
* ext/curses/extconf.rb: now additionally checks for presence of these
curses functions which are not present on NextStep or Openstep:
bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
wscrl(), wsetscrreg()
* ext/curses/curses.c: added appropriate #ifdef's for additional set of
curses functions now checked by extconf.rb; fixed curses_bkgd() and
window_bkgd() to correctly return boolean result rather than numeric
result; fixed window_getbkgd() to correctly signal an error by
returning nil rather than -1.
* ext/etc/etc.c: setup_passwd() and setup_group() now check for null
pointers before invoking rb_tainted_str_new2() upon fields extracted
from `struct passwd' and `struct group' since null pointers in some
fields are common on NextStep/OpenStep (especially so for the
`pw_comment' field) and rb_tainted_str_new2() throws an exception
when it receives a null pointer.
* ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup().
* ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
gethostbyaddr(), and gethostbyname() from (const char*) to non-const
(char*) for older platforms such as NextStep and OpenStep.
* ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup(); include
<netinet/in_systm.h> if present for NextStep and OpenStep; cast first
argument of gethostbyaddr() and getservbyname() from (const char*) to
non-const (char*) for older platforms.
* ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22 07:00:03 +03:00
|
|
|
AC_SUBST(XCFLAGS)dnl
|
|
|
|
AC_SUBST(XLDFLAGS)dnl
|
2011-11-25 05:41:59 +04:00
|
|
|
AC_SUBST(EXTLDFLAGS)dnl
|
2012-07-18 09:53:23 +04:00
|
|
|
AC_SUBST(EXTDLDFLAGS)dnl
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_SUBST(LIBRUBY_LDSHARED)
|
|
|
|
AC_SUBST(LIBRUBY_DLDFLAGS)
|
|
|
|
AC_SUBST(RUBY_INSTALL_NAME)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
AC_SUBST(rubyw_install_name)
|
|
|
|
AC_SUBST(RUBYW_INSTALL_NAME)
|
2000-08-07 09:05:04 +04:00
|
|
|
AC_SUBST(RUBY_SO_NAME)
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_SUBST(LIBRUBY_A)
|
|
|
|
AC_SUBST(LIBRUBY_SO)
|
|
|
|
AC_SUBST(LIBRUBY_ALIASES)
|
1999-01-20 07:59:39 +03:00
|
|
|
AC_SUBST(LIBRUBY)
|
|
|
|
AC_SUBST(LIBRUBYARG)
|
2002-11-14 16:51:19 +03:00
|
|
|
AC_SUBST(LIBRUBYARG_STATIC)
|
|
|
|
AC_SUBST(LIBRUBYARG_SHARED)
|
1999-01-20 07:59:39 +03:00
|
|
|
AC_SUBST(SOLIBS)
|
2000-05-09 08:53:16 +04:00
|
|
|
AC_SUBST(DLDLIBS)
|
2000-07-02 19:57:18 +04:00
|
|
|
AC_SUBST(ENABLE_SHARED)
|
2001-04-01 20:53:41 +04:00
|
|
|
AC_SUBST(MAINLIBS)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
AC_SUBST(COMMON_LIBS)
|
|
|
|
AC_SUBST(COMMON_MACROS)
|
|
|
|
AC_SUBST(COMMON_HEADERS)
|
|
|
|
AC_SUBST(EXPORT_PREFIX)
|
2010-11-11 14:45:32 +03:00
|
|
|
AC_SUBST(SYMBOL_PREFIX)
|
2005-09-07 03:23:04 +04:00
|
|
|
AC_SUBST(MINIOBJS)
|
2007-02-28 04:33:57 +03:00
|
|
|
AC_SUBST(THREAD_MODEL)
|
2012-02-29 08:07:06 +04:00
|
|
|
AC_SUBST(PLATFORM_DIR)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
|
2007-12-17 11:32:57 +03:00
|
|
|
MAKEFILES="Makefile `echo $FIRSTMAKEFILE | sed 's/:.*//'`"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
MAKEFILES="`echo $MAKEFILES`"
|
|
|
|
AC_SUBST(MAKEFILES)
|
1999-01-20 07:59:39 +03:00
|
|
|
|
|
|
|
ri_prefix=
|
|
|
|
test "$program_prefix" != NONE &&
|
|
|
|
ri_prefix=$program_prefix
|
|
|
|
|
|
|
|
ri_suffix=
|
|
|
|
test "$program_suffix" != NONE &&
|
|
|
|
ri_suffix=$program_suffix
|
|
|
|
|
2009-05-08 05:14:14 +04:00
|
|
|
RUBY_INSTALL_NAME="${ri_prefix}"'$(RUBY_BASE_NAME)'"${ri_suffix}"
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[cygwin*|mingw*], [
|
2009-05-08 05:14:14 +04:00
|
|
|
RUBYW_INSTALL_NAME="${ri_prefix}"'$(RUBYW_BASE_NAME)'"${ri_suffix}"
|
|
|
|
rubyw_install_name='$(RUBYW_INSTALL_NAME)'
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2009-05-08 05:14:14 +04:00
|
|
|
|
|
|
|
rubylibprefix='${libdir}/${RUBY_BASE_NAME}'
|
|
|
|
AC_ARG_WITH(rubylibprefix,
|
2009-05-23 20:07:46 +04:00
|
|
|
AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby libraries [[LIBDIR/RUBY_BASE_NAME]]]),
|
2010-11-23 00:30:22 +03:00
|
|
|
[if test "x$withval" = xno; then
|
|
|
|
AC_MSG_ERROR([No ruby, No libprefix])
|
|
|
|
fi
|
2010-11-25 17:31:36 +03:00
|
|
|
rubylibprefix="$withval"])
|
2009-05-08 05:14:14 +04:00
|
|
|
RUBY_LIB_PREFIX=`eval echo \\"${rubylibprefix}\\"`
|
|
|
|
AC_SUBST(rubylibprefix)
|
2000-09-27 10:48:23 +04:00
|
|
|
|
2009-05-23 20:07:46 +04:00
|
|
|
RI_BASE_NAME=`echo ${RUBY_BASE_NAME} | sed 's/ruby/ri/'`
|
2009-06-17 20:09:30 +04:00
|
|
|
ridir='${datarootdir}/${RI_BASE_NAME}'
|
2009-05-23 20:07:46 +04:00
|
|
|
AC_ARG_WITH(ridir,
|
|
|
|
AS_HELP_STRING([--with-ridir=DIR], [ri documentation [[DATAROOTDIR/ri]]]),
|
|
|
|
[ridir=$withval])
|
|
|
|
RIDIR=`eval echo \\"${ridir}\\"`
|
|
|
|
AC_SUBST(ridir)
|
2009-06-17 20:09:30 +04:00
|
|
|
AC_SUBST(RI_BASE_NAME)
|
2009-05-23 20:07:46 +04:00
|
|
|
|
2008-07-15 16:33:28 +04:00
|
|
|
AC_ARG_WITH(ruby-version,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--with-ruby-version=STR], [ruby version string for version specific directories [[full]] (full|minor|STR)]),
|
2008-07-15 16:33:28 +04:00
|
|
|
[ruby_version=$withval],
|
|
|
|
[ruby_version=full])
|
2009-02-05 05:21:37 +03:00
|
|
|
unset RUBY_LIB_VERSION
|
2009-03-06 13:25:41 +03:00
|
|
|
unset RUBY_LIB_VERSION_STYLE
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$ruby_version"],
|
2010-01-21 09:10:16 +03:00
|
|
|
[full], [RUBY_LIB_VERSION_STYLE='3 /* full */'],
|
|
|
|
[minor], [RUBY_LIB_VERSION_STYLE='2 /* minor */'])
|
2009-03-06 13:25:41 +03:00
|
|
|
if test ${RUBY_LIB_VERSION_STYLE+set}; then
|
2009-02-05 05:21:37 +03:00
|
|
|
{
|
2009-03-06 13:25:41 +03:00
|
|
|
echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
|
|
|
|
echo '#define STRINGIZE(x) x'
|
2009-06-23 11:16:17 +04:00
|
|
|
test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
|
2012-03-27 17:44:25 +04:00
|
|
|
echo '#include "verconf.h"'
|
2009-03-06 13:25:41 +03:00
|
|
|
echo '#include "version.h"'
|
|
|
|
echo 'ruby_version=RUBY_LIB_VERSION'
|
2009-02-05 05:21:37 +03:00
|
|
|
} > conftest.c
|
2012-03-27 17:44:25 +04:00
|
|
|
test -f verconf.h || > verconf.h
|
|
|
|
ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
|
2009-02-05 05:21:37 +03:00
|
|
|
eval $ruby_version
|
|
|
|
else
|
|
|
|
RUBY_LIB_VERSION="\"${ruby_version}\""
|
|
|
|
fi
|
2008-07-15 16:33:28 +04:00
|
|
|
|
2000-04-12 09:06:23 +04:00
|
|
|
AC_ARG_WITH(sitedir,
|
2011-08-12 08:42:13 +04:00
|
|
|
AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
|
2000-09-22 22:15:52 +04:00
|
|
|
[sitedir=$withval],
|
2009-05-08 05:14:14 +04:00
|
|
|
[sitedir='${rubylibprefix}/site_ruby'])
|
|
|
|
dir="${sitedir}"
|
|
|
|
until SITE_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${SITE_DIR}"; do
|
|
|
|
dir="${SITE_DIR}"
|
|
|
|
done
|
2000-02-17 10:11:22 +03:00
|
|
|
|
2007-11-03 14:35:59 +03:00
|
|
|
AC_ARG_WITH(vendordir,
|
2011-08-12 06:42:51 +04:00
|
|
|
AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
|
2007-11-03 14:35:59 +03:00
|
|
|
[vendordir=$withval],
|
2009-05-08 05:14:14 +04:00
|
|
|
[vendordir='${rubylibprefix}/vendor_ruby'])
|
|
|
|
dir="${vendordir}"
|
|
|
|
until VENDOR_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${VENDOR_DIR}"; do
|
|
|
|
dir="${VENDOR_DIR}"
|
|
|
|
done
|
2008-03-14 10:59:25 +03:00
|
|
|
|
2009-02-19 08:48:14 +03:00
|
|
|
if test "${LOAD_RELATIVE+set}"; then
|
|
|
|
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
|
2010-03-18 00:28:36 +03:00
|
|
|
RUBY_EXEC_PREFIX=""
|
2008-03-14 10:59:25 +03:00
|
|
|
RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
|
|
|
|
RUBY_SITE_LIB_PATH="`eval echo "$SITE_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
|
|
|
|
RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
|
2009-02-19 08:48:14 +03:00
|
|
|
else
|
2010-03-18 00:28:36 +03:00
|
|
|
RUBY_EXEC_PREFIX="`eval echo \\"$exec_prefix/\\" | sed 's|^NONE/|'"$prefix"'/|;s|/$||'`"
|
2008-03-14 10:59:25 +03:00
|
|
|
RUBY_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
|
|
|
|
RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
|
|
|
|
RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
|
2009-02-19 08:48:14 +03:00
|
|
|
fi
|
2009-02-05 10:18:15 +03:00
|
|
|
|
2009-10-02 20:01:05 +04:00
|
|
|
pat=`echo "$RUBY_LIB_PREFIX/" | tr -c '\012' .`'\(.*\)'
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$RUBY_SITE_LIB_PATH"],
|
|
|
|
["$RUBY_LIB_PREFIX/"*], [
|
2009-02-05 10:18:15 +03:00
|
|
|
RUBY_SITE_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_SITE_LIB_PATH\" : \"$pat\"`"'"'
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[
|
2009-02-05 05:21:37 +03:00
|
|
|
RUBY_SITE_LIB_PATH="\"${RUBY_SITE_LIB_PATH}\""
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
|
|
|
AS_CASE(["$RUBY_VENDOR_LIB_PATH"],
|
|
|
|
["$RUBY_LIB_PREFIX/"*], [
|
2009-02-05 10:18:15 +03:00
|
|
|
RUBY_VENDOR_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_VENDOR_LIB_PATH\" : \"$pat\"`"'"'
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[
|
2009-02-05 05:21:37 +03:00
|
|
|
RUBY_VENDOR_LIB_PATH="\"${RUBY_VENDOR_LIB_PATH}\""
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2010-03-18 00:28:36 +03:00
|
|
|
pat=`echo "$RUBY_EXEC_PREFIX/" | tr -c '\012' .`'\(.*\)'
|
|
|
|
AS_CASE(["$RUBY_LIB_PREFIX"],
|
|
|
|
["$RUBY_EXEC_PREFIX/"*], [
|
|
|
|
RUBY_LIB_PREFIX='RUBY_EXEC_PREFIX"/'"`expr \"$RUBY_LIB_PREFIX\" : \"$pat\"`"'"'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
RUBY_LIB_PREFIX="\"${RUBY_LIB_PREFIX}\""
|
|
|
|
])
|
2007-11-03 14:35:59 +03:00
|
|
|
|
2009-03-06 13:25:41 +03:00
|
|
|
if test ${RUBY_LIB_VERSION_STYLE+set}; then
|
2012-03-27 17:44:25 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE !<verconf>!)
|
2009-03-06 13:25:41 +03:00
|
|
|
else
|
2012-03-27 17:44:25 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION] !<verconf>!)
|
2009-03-06 13:25:41 +03:00
|
|
|
fi
|
2010-03-18 00:28:36 +03:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, "${RUBY_EXEC_PREFIX}")
|
2012-03-27 17:44:25 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX} !<verconf>!)
|
2010-11-23 00:30:54 +03:00
|
|
|
if test "x$SITE_DIR" = xno; then
|
2012-03-27 17:44:25 +04:00
|
|
|
AC_DEFINE(NO_RUBY_SITE_LIB, [] !<verconf>!)
|
2010-11-23 00:30:54 +03:00
|
|
|
else
|
2012-03-27 17:44:25 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH} !<verconf>!)
|
2010-11-23 00:30:54 +03:00
|
|
|
fi
|
|
|
|
if test "x$VENDOR_DIR" = xno; then
|
2012-04-16 10:19:46 +04:00
|
|
|
AC_DEFINE(NO_RUBY_VENDOR_LIB, [] !<verconf>!)
|
2010-11-23 00:30:54 +03:00
|
|
|
else
|
2012-03-27 17:44:25 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH} !<verconf>!)
|
2010-11-23 00:30:54 +03:00
|
|
|
fi
|
2007-11-03 14:35:59 +03:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_SUBST(arch)dnl
|
2002-08-23 12:18:19 +04:00
|
|
|
AC_SUBST(sitearch)dnl
|
2008-07-15 16:33:28 +04:00
|
|
|
AC_SUBST(ruby_version)dnl
|
2000-04-12 09:06:23 +04:00
|
|
|
AC_SUBST(sitedir)dnl
|
2007-11-03 14:35:59 +03:00
|
|
|
AC_SUBST(vendordir)dnl
|
1998-01-16 15:13:05 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
configure_args=$ac_configure_args
|
|
|
|
AC_SUBST(configure_args)dnl
|
|
|
|
|
2009-02-07 12:02:50 +03:00
|
|
|
if test "${universal_binary-no}" = yes ; then
|
|
|
|
arch="universal-${target_os}"
|
|
|
|
AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available,
|
|
|
|
AC_TRY_COMPILE([const char arch[] = __ARCHITECTURE__;], [puts(arch);],
|
|
|
|
[rb_cv_architecture_available=yes], [rb_cv_architecture_available=no]))
|
2009-02-08 07:09:34 +03:00
|
|
|
if test "${rb_cv_architecture_available}" = yes; then
|
2012-03-27 17:44:25 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__ !<verconf>!)
|
2009-02-08 07:09:34 +03:00
|
|
|
else
|
|
|
|
for archs in ${universal_archnames}; do
|
|
|
|
cpu=`echo $archs | sed 's/.*=//'`
|
|
|
|
archs=`echo $archs | sed 's/=.*//'`
|
|
|
|
RUBY_DEFINE_IF([defined __${archs}__], RUBY_PLATFORM_CPU, ["${cpu}"])
|
|
|
|
done
|
|
|
|
fi
|
2011-12-03 02:14:30 +04:00
|
|
|
ints='long int short'
|
2009-03-19 12:49:51 +03:00
|
|
|
test "$ac_cv_type_long_long" = yes && ints="'long long' $ints"
|
|
|
|
AC_SUBST(UNIVERSAL_ARCHNAMES, "${universal_archnames}")
|
|
|
|
AC_SUBST(UNIVERSAL_INTS, "${ints}")
|
2012-03-27 17:44:25 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}" !<verconf>!)
|
|
|
|
AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-"RUBY_PLATFORM_OS !<verconf>!)
|
|
|
|
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS !<verconf>!)
|
2009-02-07 12:02:50 +03:00
|
|
|
else
|
|
|
|
arch="${target_cpu}-${target_os}"
|
2012-03-27 17:44:25 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}" !<verconf>!)
|
1998-01-16 15:13:05 +03:00
|
|
|
fi
|
2000-02-17 10:11:22 +03:00
|
|
|
|
2009-02-05 05:21:37 +03:00
|
|
|
unset sitearch
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE(["$target_os"],[mingw*],[sitearch="$target_cpu-$rb_cv_msvcrt"])
|
2012-03-27 17:44:25 +04:00
|
|
|
test ${sitearch+set} && AC_DEFINE_UNQUOTED(RUBY_SITEARCH, "${sitearch}" !<verconf>!)
|
2010-10-25 19:29:32 +04:00
|
|
|
: ${sitearch='${arch}'}
|
2002-08-23 12:18:19 +04:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_ARG_WITH(search-path,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--with-search-path=DIR], [specify the additional search path]),
|
1999-08-13 09:45:20 +04:00
|
|
|
[search_path=$withval])
|
|
|
|
if test "$search_path" != ""; then
|
2012-03-27 17:44:25 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path" !<verconf>!)
|
1999-08-13 09:45:20 +04:00
|
|
|
fi
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-06-10 07:06:15 +04:00
|
|
|
AC_ARG_WITH(rubyhdrdir,
|
2009-08-14 09:31:39 +04:00
|
|
|
AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR [[INCLUDEDIR/RUBY_BASE_NAME-RUBY_VERSION]]]),
|
2007-06-10 07:06:15 +04:00
|
|
|
[rubyhdrdir=$withval],
|
2009-05-08 05:14:14 +04:00
|
|
|
[rubyhdrdir='${includedir}/${RUBY_BASE_NAME}-${ruby_version}'])
|
2007-06-10 07:06:15 +04:00
|
|
|
|
|
|
|
AC_ARG_WITH(sitehdrdir,
|
2009-11-01 10:23:05 +03:00
|
|
|
AS_HELP_STRING([--with-sitehdrdir=DIR], [core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
|
2007-06-10 07:06:15 +04:00
|
|
|
[sitehdrdir=$withval],
|
|
|
|
[sitehdrdir='${rubyhdrdir}/site_ruby'])
|
|
|
|
|
2007-11-03 16:30:59 +03:00
|
|
|
AC_ARG_WITH(vendorhdrdir,
|
2009-11-01 10:23:05 +03:00
|
|
|
AS_HELP_STRING([--with-vendorhdrdir=DIR], [core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
|
2007-11-03 16:30:59 +03:00
|
|
|
[vendorhdrdir=$withval],
|
|
|
|
[vendorhdrdir='${rubyhdrdir}/vendor_ruby'])
|
|
|
|
|
2007-06-10 07:06:15 +04:00
|
|
|
AC_SUBST(rubyhdrdir)dnl
|
|
|
|
AC_SUBST(sitehdrdir)dnl
|
2007-11-03 16:30:59 +03:00
|
|
|
AC_SUBST(vendorhdrdir)dnl
|
2007-06-10 07:06:15 +04:00
|
|
|
|
2003-01-20 15:51:50 +03:00
|
|
|
AC_ARG_WITH(mantype,
|
2009-10-23 09:06:12 +04:00
|
|
|
AS_HELP_STRING([--with-mantype=TYPE], [specify man page type; TYPE is one of man and doc]),
|
2003-01-20 15:51:50 +03:00
|
|
|
[
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$withval"],
|
2010-01-21 09:10:16 +03:00
|
|
|
[man|doc], [MANTYPE=$withval],
|
|
|
|
[AC_MSG_ERROR(invalid man type: $withval)])
|
2003-01-20 15:51:50 +03:00
|
|
|
])
|
|
|
|
if test -z "$MANTYPE"; then
|
|
|
|
AC_PATH_PROGS(NROFF, nroff awf, /bin/false, "/usr/bin:/usr/ucb")
|
2008-10-25 21:20:05 +04:00
|
|
|
if ${NROFF} -mdoc ${srcdir}/man/ruby.1 >/dev/null 2>&1; then
|
2003-01-20 15:51:50 +03:00
|
|
|
MANTYPE=doc
|
|
|
|
else
|
|
|
|
MANTYPE=man
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST(MANTYPE)
|
|
|
|
|
2011-02-11 06:03:26 +03:00
|
|
|
AC_ARG_ENABLE(rubygems,
|
|
|
|
AS_HELP_STRING([--disable-rubygems], [disable rubygems by default]),
|
|
|
|
[enable_rubygems="$enableval"], [enable_rubygems=yes])
|
|
|
|
if test x"$enable_rubygems" = xno; then
|
|
|
|
AC_DEFINE(DISABLE_RUBYGEMS, 1)
|
|
|
|
USE_RUBYGEMS=NO
|
|
|
|
else
|
|
|
|
USE_RUBYGEMS=YES
|
|
|
|
fi
|
|
|
|
AC_SUBST(USE_RUBYGEMS)
|
|
|
|
|
2007-06-10 07:06:15 +04:00
|
|
|
arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
|
2009-08-13 11:20:16 +04:00
|
|
|
AS_MKDIR_P("${arch_hdrdir}")
|
2007-06-10 07:06:15 +04:00
|
|
|
config_h="${arch_hdrdir}/config.h"
|
2010-07-26 13:18:21 +04:00
|
|
|
guard=INCLUDE_RUBY_CONFIG_H
|
|
|
|
{
|
|
|
|
echo "#ifndef $guard"
|
|
|
|
echo "#define $guard 1"
|
2012-03-27 17:44:25 +04:00
|
|
|
grep -v "^#define PACKAGE_" confdefs.h | grep -v ' !<verconf>!$'
|
2010-07-26 13:18:21 +04:00
|
|
|
echo "#endif /* $guard */"
|
|
|
|
} | tr -d '\015' |
|
2009-06-23 07:44:01 +04:00
|
|
|
${srcdir}/tool/ifchange "${config_h}" -
|
2012-03-27 17:44:25 +04:00
|
|
|
sed -n 's/ !<verconf>!$//p' confdefs.h | ${srcdir}/tool/ifchange verconf.h -
|
2007-10-13 23:08:37 +04:00
|
|
|
tr -d '\015' < largefile.h > confdefs.h
|
2007-12-30 05:00:59 +03:00
|
|
|
rm largefile.h
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-12-15 16:27:41 +03:00
|
|
|
BUILTIN_ENCS=["`sed -n -e '/^BUILTIN_ENCS[ ]*=/{' \
|
|
|
|
-e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
|
2007-12-16 08:52:01 +03:00
|
|
|
-e '}' "${srcdir}/enc/Makefile.in"`"]
|
2007-12-15 12:56:59 +03:00
|
|
|
BUILTIN_ENCOBJS=
|
2007-12-17 11:17:50 +03:00
|
|
|
for e in $BUILTIN_ENCS; do BUILTIN_ENCOBJS="$BUILTIN_ENCOBJS `basename $e .c`"'.$(OBJEXT)'; done
|
2007-12-15 12:56:59 +03:00
|
|
|
AC_SUBST(BUILTIN_ENCOBJS)
|
|
|
|
|
2008-08-24 19:58:43 +04:00
|
|
|
BUILTIN_TRANSES=["`sed -n -e '/^BUILTIN_TRANSES[ ]*=/{' \
|
|
|
|
-e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
|
|
|
|
-e '}' "${srcdir}/enc/Makefile.in"`"]
|
|
|
|
BUILTIN_TRANSSRCS=
|
|
|
|
BUILTIN_TRANSOBJS=
|
|
|
|
for e in $BUILTIN_TRANSES; do
|
|
|
|
BUILTIN_TRANSSRCS="$BUILTIN_TRANSSRCS `basename $e .trans`"'.c';
|
|
|
|
BUILTIN_TRANSOBJS="$BUILTIN_TRANSOBJS `basename $e .trans`"'.$(OBJEXT)';
|
|
|
|
done
|
|
|
|
AC_SUBST(BUILTIN_TRANSSRCS)
|
|
|
|
AC_SUBST(BUILTIN_TRANSOBJS)
|
|
|
|
|
2009-05-08 05:14:14 +04:00
|
|
|
PACKAGE=$RUBY_BASE_NAME
|
2008-12-22 16:19:08 +03:00
|
|
|
AC_SUBST(PACKAGE)
|
2009-02-05 05:21:37 +03:00
|
|
|
AC_MSG_RESULT($PACKAGE library version = $ruby_version)
|
2008-12-22 16:19:08 +03:00
|
|
|
|
2010-03-24 23:44:45 +03:00
|
|
|
AS_CASE([" $CPP "], [*" $CC "*], [CPP=`echo " $CPP " | sed "s| $CC |"' $(CC) |;s/^ *//;s/ *$//'`])
|
|
|
|
|
2004-03-22 02:21:31 +03:00
|
|
|
AC_CONFIG_FILES($FIRSTMAKEFILE)
|
2012-03-23 04:56:46 +04:00
|
|
|
AC_CONFIG_FILES(Makefile, [
|
|
|
|
tmpmk=confmk$$.tmp
|
|
|
|
{
|
2012-03-22 10:04:09 +04:00
|
|
|
if test ${VCS+set}; then
|
2012-03-22 09:59:48 +04:00
|
|
|
:
|
|
|
|
elif svn info "$srcdir" > /dev/null 2>&1; then
|
2009-01-16 11:33:02 +03:00
|
|
|
VCS='svn'
|
|
|
|
elif test -d "$srcdir/.git/svn"; then
|
|
|
|
VCS='git svn'
|
|
|
|
elif test -d "$srcdir/.git"; then
|
|
|
|
VCS='git'
|
|
|
|
else
|
|
|
|
VCS='echo cannot'
|
|
|
|
fi
|
2012-03-22 09:59:48 +04:00
|
|
|
AS_CASE("$VCS",
|
|
|
|
[svn], [VCSUP='$(VCS) up $(SVNUPOPTIONS)'],
|
|
|
|
["git svn"], [VCSUP='$(VCS) rebase $(GITSVNREBASEOPTIONS)'],
|
|
|
|
[git], [VCSUP='$(VCS) pull $(GITPULLOPTIONS)'],
|
|
|
|
[VCSUP='$(VCS)'])
|
2009-01-16 11:33:02 +03:00
|
|
|
sed '/^MISSING/s/\$U\././g;/^VCS *=/s#@VCS@#'"$VCS"'#;/^VCSUP *=/s#@VCSUP@#'"$VCSUP"'#' Makefile
|
2004-03-25 08:01:15 +03:00
|
|
|
echo; test x"$EXEEXT" = x || echo 'miniruby: miniruby$(EXEEXT)'
|
2008-08-14 07:01:42 +04:00
|
|
|
if test "$gnumake" != yes; then
|
|
|
|
echo ['$(MKFILES): $(srcdir)/common.mk']
|
|
|
|
sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
|
2008-12-24 07:45:34 +03:00
|
|
|
else
|
|
|
|
echo 'distclean-local::; @$(RM) GNUmakefile uncommon.mk'
|
2008-08-14 07:01:42 +04:00
|
|
|
fi
|
2012-03-23 04:56:46 +04:00
|
|
|
} > $tmpmk && if ! grep '^ruby:' $tmpmk > /dev/null; then
|
|
|
|
if test "${gnumake}" = yes; then
|
|
|
|
tmpgmk=confgmk$$.tmp
|
|
|
|
{
|
|
|
|
echo "include $tmpmk"
|
|
|
|
echo "-include uncommon.mk"
|
|
|
|
} > $tmpgmk
|
|
|
|
else
|
|
|
|
tmpgmk=$tmpmk
|
|
|
|
fi &&
|
|
|
|
test -z "`${MAKE-make} -f $tmpgmk info-program | grep '^PROGRAM=ruby$'`" &&
|
|
|
|
echo 'ruby: $(PROGRAM);' >> $tmpmk
|
|
|
|
test "$tmpmk" = "$tmpgmk" || rm -f "$tmpgmk"
|
|
|
|
fi && mv -f $tmpmk Makefile],
|
2010-04-07 11:45:56 +04:00
|
|
|
[EXEEXT='$EXEEXT' gnumake='$gnumake'])
|
2010-10-25 19:29:32 +04:00
|
|
|
|
2012-03-03 01:57:16 +04:00
|
|
|
AC_ARG_WITH([ruby-pc],
|
|
|
|
AC_HELP_STRING([pc file basename]),
|
|
|
|
[ruby_pc="$withval"],
|
|
|
|
[ruby_pc="${RUBY_BASE_NAME}-${MAJOR}.${MINOR}.pc"])
|
2010-10-25 19:29:32 +04:00
|
|
|
AC_SUBST(ruby_pc)
|
2011-03-08 03:33:05 +03:00
|
|
|
AC_SUBST(exec, [exec])
|
|
|
|
|
2010-10-25 19:29:32 +04:00
|
|
|
AC_CONFIG_FILES($ruby_pc:template/ruby.pc.in,
|
|
|
|
[
|
2010-10-30 09:37:43 +04:00
|
|
|
if sed ['s/\$(\([A-Za-z_][A-Za-z0-9_]*\))/${\1}/g;s/@[A-Za-z_][A-Za-z0-9_]*@//'] $ruby_pc > ruby.tmp.pc &&
|
|
|
|
{
|
|
|
|
test -z "$PKG_CONFIG" ||
|
|
|
|
PKG_CONFIG_PATH=. $PKG_CONFIG --print-errors ruby.tmp
|
|
|
|
}
|
|
|
|
then
|
|
|
|
mv -f ruby.tmp.pc $ruby_pc
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-10-25 19:29:32 +04:00
|
|
|
],
|
2010-10-30 09:37:43 +04:00
|
|
|
[ruby_pc='$ruby_pc' PKG_CONFIG='$PKG_CONFIG'])
|
2010-10-25 19:29:32 +04:00
|
|
|
|
2002-04-19 11:39:40 +04:00
|
|
|
AC_OUTPUT
|
2012-08-21 20:18:10 +04:00
|
|
|
}
|
|
|
|
}
|