AC_REVISION("$Id$") |
AC_INIT(interpret.c) |
AC_CONFIG_HEADER(machine.h) |
|
rm -f config.warnings 2>/dev/null |
|
if_autoconf(2,50,[ |
if test "x$cache_file" = "x/dev/null"; then |
cache_file=./config.cache |
if test -r "$cache_file"; then |
echo "loading cache $cache_file" |
. $cache_file |
else |
echo "creating cache $cache_file" |
> $cache_file |
fi |
fi |
], [ |
PIKE_MSG_WARN([configure script has been generated with autoconf 2.13 or earlier.]) |
]) |
|
# We want an absolute path to the source-dir. |
case "$srcdir" in |
/*) |
;; |
*) |
oldsrcdir="$srcdir" |
srcdir="`cd \"$srcdir\";pwd`" |
AC_MSG_WARN([Converted $oldsrcdir to $srcdir, |
If this does not work, please use an absolute path to the configure script.]) |
;; |
esac |
|
# Check that we can write to the source directory. |
sleep 1 |
if touch "$srcdir/configure~"; then |
# Check that the system time is reasonably correct. |
if test `cd "$srcdir" && ls -1t configure configure~ | head -n 1` = "configure"; then |
echo "Current system time is `date`." |
AC_MSG_ERROR([ |
$srcdir/configure has modification time in the future. |
Check and set your system time. |
]) |
fi |
else |
ls -ld "$srcdir" |
AC_MSG_ERROR([ |
Failed to write in source directory. |
Fix your permissions. |
]) |
fi |
|
# Attempt to use bash instead of /bin/sh to run configure |
# since bash is usually several orders of magnitude faster |
# on machines that have a real /bin/sh. |
# Some OS's also have a seriously broken /bin/sh (eg NetBSD). |
if test "x$CONFIG_SHELL" = "x" -a "x$BASH" = x; then |
AC_PATH_PROG(bash_prog, bash, no) |
if test "x$ac_cv_path_bash_prog" = "xno"; then :; else |
AC_MSG_CHECKING([if $ac_cv_path_bash_prog works]) |
if "$ac_cv_path_bash_prog" --norc -c : 2>&AC_FD_CC; then |
AC_MSG_RESULT(yes) |
else |
AC_MSG_RESULT(no) |
ac_cv_path_bash_prog=no |
fi |
fi |
if test "x$ac_cv_path_bash_prog" = "xno"; then :; else |
AC_MSG_WARN([Found bash as $ac_cv_path_bash_prog. |
Will attempt to restart configure with bash for performance. |
If this fails, please set CONFIG_SHELL to /bin/sh before starting configure.]) |
CONFIG_SHELL="$ac_cv_path_bash_prog --norc" |
export CONFIG_SHELL |
echo $CONFIG_SHELL "$srcdir/configure" $ac_configure_args |
eval exec $CONFIG_SHELL "$srcdir/configure" $ac_configure_args |
exit 17 |
fi |
else :; fi |
|
AC_PROG_MAKE_SET |
|
|
rm -f "conftest_VPATH.in" 2>/dev/null |
touch "$srcdir/conftest_VPATH.in" |
if test -f conftest_VPATH.in; then :; else |
# Not building in source tree. |
AC_MSG_CHECKING([whether ${MAKE-make} supports VPATH]) |
AC_CACHE_VAL(pike_cv_make_supports_VPATH, [ |
cat > conftestmake <<EOF |
VPATH=.:$srcdir |
.SUFFIXES: .in .out |
.in.out: |
cat "\$<" >"\$@" |
EOF |
pike_cv_make_supports_VPATH=no |
if ${MAKE-make} -f conftestmake conftest_VPATH.out >/dev/null 2>&AC_FD_CC; then |
if test -f conftest_VPATH.out; then |
pike_cv_make_supports_VPATH=yes |
else :; fi |
else :; fi |
rm -f conftestmake conftest_VPATH.out |
]) |
AC_MSG_RESULT($pike_cv_make_supports_VPATH) |
if test "x$pike_cv_make_supports_VPATH" = "xno"; then |
AC_ERROR([ |
Building in a separate directory is not supported without VPATH. |
|
Build in the source directory, or try another make (eg gnumake). |
]) |
exit 1 |
else :; fi |
fi |
rm -f "$srcdir/conftest_VPATH.in" 2>/dev/null |
|
if test -d "$srcdir/../bundles"; then |
# Some of the bundled libraries (eg nettle) set SHELL. |
AC_MSG_CHECKING([whether ${MAKE-make} supports spaces in SHELL]) |
AC_CACHE_VAL(pike_cv_make_supports_spaces_in_SHELL, [ |
cat > conftestmake <<EOF |
SHELL=/bin/sh -n |
false: |
/bin/false |
true: |
: |
complex_false: |
test "foo" = "foo" && /bin/false |
complex_true: |
test "foo" = "bar" || : |
EOF |
if ${MAKE-make} -f conftestmake false >&AC_FD_CC 2>&AC_FD_CC; then |
# /bin/sh was found, and /bin/false was not executed. |
pike_cv_make_supports_spaces_in_SHELL=yes |
elif ${MAKE-make} -f conftestmake complex_false >&AC_FD_CC 2>&AC_FD_CC; then |
# SHELL is ignored for simple targets, but not for more |
# complex expressions. |
# When SHELL is used, spaces are supported. |
pike_cv_make_supports_spaces_in_SHELL="complex only" |
elif ${MAKE-make} -f conftestmake complex_true >&AC_FD_CC 2>&AC_FD_CC; then |
# SHELL is ignored for all targets. |
pike_cv_make_supports_spaces_in_SHELL=ignored |
elif ${MAKE-make} -f conftestmake true >&AC_FD_CC 2>&AC_FD_CC; then |
# SHELL is ignored for simple targets, but not for more |
# complex expressions. |
# When SHELL is used, spaces are not supported. |
pike_cv_make_supports_spaces_in_SHELL=no |
else |
# Spaces are not supported in SHELL. |
pike_cv_make_supports_spaces_in_SHELL=no |
fi |
rm -f conftestmake |
]) |
AC_MSG_RESULT($pike_cv_make_supports_spaces_in_SHELL) |
else :; fi |
|
AC_ARG_ENABLE(pikelib, MY_DESCR([--enable-pikelib], |
[build pike as a library]), |
[enable_pikelib=yes], [enable_pikelib=no]) |
|
if test "x$enable_pikelib" != "xno"; then |
PIKE_MSG_WARN([BUILDING PIKE AS A LIBRARY -- HIGHLY EXPERIMENTAL!]) |
AC_DEFINE(LIBPIKE) |
fi |
|
AC_ARG_ENABLE(make_conf, MY_DESCR([--disable-make.conf], |
[do not use settings from /etc/make.conf]), |
[], [enable_make_conf=yes]) |
|
initial_cflags="${CFLAGS}" |
initial_cppflags="${CPPFLAGS}" |
initial_ldflags="${LDFLAGS}" |
|
if test "x${CFLAGS-}" = x ; then |
cflags_is_set=no |
else |
cflags_is_set=yes |
fi |
|
if test "x${CPPFLAGS-}" = x ; then |
cppflags_is_set=no |
else |
cppflags_is_set=yes |
fi |
|
if test "x${LDFLAGS-}" = x ; then |
ldflags_is_set=no |
else |
ldflags_is_set=yes |
fi |
|
# if test "x$enable_make_conf" = x"yes" -a -f /etc/make.conf; then |
# set >conftest.tmp |
# echo Using settings from /etc/make.conf... |
# . /etc/make.conf |
# set | diff -u conftest.tmp - | grep '^+C' |
# PIKE_MSG_WARN([Using settings from /etc/make.conf.]) |
# fi |
|
AC_ARG_WITH(cflags, MY_DESCR([--with-cflags=cflags], |
[specify extra c compiler flags]), |
[ CFLAGS="$with_cflags $CFLAGS" ]) |
AC_ARG_WITH(cppflags, MY_DESCR([--with-cppflags=cppflags], |
[specify extra c preprocessor flags]), |
[ CPPFLAGS="$with_cppflags $CPPFLAGS" ]) |
AC_ARG_WITH(ldflags, MY_DESCR([--with-ldflags=ldflags], |
[specify extra linker flags]), |
[ LDFLAGS="$with_ldflags $LDFLAGS" ]) |
|
# Force use of thread libs LIBS |
AC_ARG_WITH(thread-library, |
MY_DESCR([--with-thread-library=lib], |
[Use a specific thread library]), |
[ |
case "x$withval" in |
x-*) |
with_thread_library="$withval" |
;; |
*) |
with_thread_library="-l$withval" |
;; |
esac |
], [ with_thread_library=no ]) |
|
for ac_site_file in $CONFIG_SITE; do |
if test -r "$ac_site_file"; then |
PIKE_MSG_WARN([You are using a site file to initialize configure, please |
note that this can lead to problems if anything in |
$ac_site_file is not correct. If Pike does not compile, or |
does not run, please try this to compile Pike again: |
rm -f ./config.cache ; CONFIG_SITE=x ./configure ; make]) |
fi |
done |
|
AC_ARG_ENABLE(binary, MY_DESCR([--disable-binary], |
[do not configure for binary build, only do tests for precompilation stuff]), |
[], [enable_binary=yes]) |
|
if test "x$enable_binary" = "xno"; then |
PIKE_MSG_WARN([Short-circuiting configure tests for binary building. Only some |
targets in the Makefile can be used, typically those that only |
operates on the source directory, e.g. depend.]) |
AC_DEFINE(DISABLE_BINARY) |
else |
|
if test ! -z "$pike_cv_prog_CC_save" -a ! -z "$CC" -a "$CC" != "$pike_cv_prog_CC_save" |
then |
PIKE_MSG_WARN([CC is different than last time Pike was compiled, |
It is probably best to delete ./config.cache before proceeding.]) |
fi |
|
pike_cv_prog_CC_save="$CC" |
|
fi |
|
AC_ARG_ENABLE(noopt-retry, MY_DESCR([--disable-noopty-retry], |
[do not retry compilation without optimizations if it fails]), |
[], [noopt_retry=yes]) |
|
# Do the below even when --disable-binary is used, since we need a |
# real $CPP, and AC_PROG_CPP wants AC_PROG_CC to be called earlier. |
# $CC will be overridden with a dummy later on. |
|
# MY_AC_PROG_CC |
# The above has problems if the smartlink binary is removed. /grubba |
|
AC_LANG_C |
|
# Workaround for COMPILER_EXEEXT bailing out with icc and too new gcc. |
# "Command-line error: invalid GNU version number: 403". |
# The following seem to be the max gcc-versions: |
# |
# icc gcc-version |
# 8.1 340 |
# 9.0 400? |
# 9.1 410? |
if test "x$CC" = "x"; then :; else |
AC_MSG_CHECKING([whether we need an icc workaround]) |
AC_CACHE_VAL(pike_cv_need_icc_gcc_version, [ |
cat >conftest.c <<EOF |
int main() { return 0; } |
EOF |
ORIG_CFLAGS="$CFLAGS" |
for pike_cv_need_icc_gcc_version in no 420 410 400 340 330 320 310 no; do |
if test "x$pike_cv_need_icc_gcc_version" = "xno"; then :; else |
CFLAGS="$ORIG_CFLAGS -gcc-version=$pike_cv_need_icc_gcc_version" |
fi |
if AC_TRY_EVAL(ac_compile); then |
break; |
fi |
done |
CFLAGS="$ORIG_CFLAGS" |
]) |
AC_MSG_RESULT($pike_cv_need_icc_gcc_version) |
if test "x$pike_cv_need_icc_gcc_version" = "xno"; then :; else |
CFLAGS="$CFLAGS -gcc-version=$pike_cv_need_icc_gcc_version" |
fi |
fi |
|
# AC_PROG_CC won't modify CFLAGS if it's already set from the icc |
# workaround test above, so we make sure it's always set and then |
# modify CFLAGS ourselves afterwards. |
${CFLAGS:=} |
|
AC_PROG_CC |
AC_PROG_CXX |
|
# Only need to think of -g since -O2 or other optimization flags gets |
# added through other configure tests. |
test "$ac_cv_prog_cc_g" = yes && CFLAGS="-g $CFLAGS" |
|
AC_PROG_CPP |
AC_PROG_EGREP |
|
AC_MSG_CHECKING([whether we are using Intel C]) |
AC_CACHE_VAL(pike_cv_prog_icc, [ |
AC_EGREP_CPP([oui], [ |
#if defined(__ECC) || defined(__ICC) || defined(__INTEL_COMPILER) |
oui; |
#endif |
], pike_cv_prog_icc=yes, pike_cv_prog_icc=no) |
]) |
AC_MSG_RESULT($pike_cv_prog_icc) |
if test "$pike_cv_prog_icc" = "yes"; then |
ICC=yes |
fi |
|
# This segment is disabled for now. |
if :; then :; else |
AC_MSG_CHECKING([for option to enter C99-mode]) |
AC_CACHE_VAL(pike_cv_flag_c99, [ |
ORIG_CPPFLAGS="$CPPFLAGS" |
for pike_cv_flag_c99 in '' '-std=gnu99' '-std=gnu9x' '-xc99' no; do |
if test "x$pike_cv_flag_c99" = "xno"; then break; fi |
# C99 is supported only in XPG6/POSIX.1-2001. |
pike_cv_flag_c99="$pike_cv_flag_c99 -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -DPOSIX_C_SOURCE=200112" |
CPPFLAGS="$ORIG_CPPFLAGS $pike_cv_flag_c99" |
AC_EGREP_CPP([oui], [ |
/* Include THE standard header file to check for C99 compliance. */ |
#include <stdio.h> |
#if __STDC_VERSION__ - 0 >= 199901 |
oui |
#endif |
], [ |
# Ok. |
break; |
]) |
done |
ORIG_CPPFLAGS="$CPPFLAGS" |
]) |
if test "x$pike_cv_flag_c99" = "xno"; then |
AC_MSG_RESULT(not supported) |
AC_MSG_CHECKING([for level of XPG support]) |
AC_CACHE_VAL(pike_cv_flag_xpg, [ |
# FIXME: How determine what the max level of XPG support is? |
:; |
]) |
AC_MSG_RESULT([$pike_cv_flag_xpg]) |
else |
AC_MSG_RESULT([${pike_cv_flag_c99:-(none)}]) |
CPPFLAGS="$CPPFLAGS $pike_cv_flag_c99" |
fi |
fi |
|
############################################################################# |
|
if test "x$enable_binary" != "xno"; then |
AC_ISC_POSIX |
AC_AIX |
AC_MINIX |
fi |
|
############################################################################# |
|
# ABI selection. |
|
PIKE_SELECT_ABI |
|
############################################################################# |
|
if test "x$GCC" = "x"; then |
GCC=no |
else |
:; |
fi |
|
if test "x$GCC" = "xno" -a "x$TCC" = "xno"; then |
|
if test "x$ac_cv_prog_cc_cross" = "xyes"; then |
# The AIX 5L/cc beta can not generate working binaries without a |
# data-segment... |
AC_MSG_CHECKING([if we are really using a cross-compiler]) |
|
AC_CACHE_VAL(pike_cv_datasegment_required, [ |
ac_cv_prog_cc_cross=no; |
AC_TRY_RUN([int foo;main(){return(0);}], [ |
pike_cv_datasegment_required=yes |
], [ |
pike_cv_datasegment_required=no |
ac_cv_prog_cc_cross=yes |
], [ |
pike_cv_datasegment_required=no |
ac_cv_prog_cc_cross=yes |
]) |
]) |
if test "x$pike_cv_datasegment_required" = "xyes"; then |
AC_MSG_RESULT([no -- Applying data-segment kludge]) |
ac_cv_prog_cc_cross=no |
cat >conftest.c <<EOF |
static int foo; |
EOF |
pike_cv_datasegemnt_file=no |
if AC_TRY_EVAL(ac_compile); then |
if test -f "conftest.$ac_objext"; then |
rm -f "data-segment.$ac_objext" |
if mv "conftest.$ac_objext" "data-segment.$ac_objext"; then |
if test -f "`pwd`/data-segment.$ac_objext"; then |
pike_cv_datasegemnt_file="`pwd`/data-segment.$ac_objext" |
else |
PIKE_MSG_WARN(Lost track of data-segment kludge-file.) |
fi |
else |
PIKE_MSG_WARN(Failed to rename data-segment kludge-file.) |
fi |
else |
PIKE_MSG_WARN(Can not find data-segment kludgefile.) |
fi |
else |
PIKE_MSG_WARN(Failed to compile data-segment kludge.) |
fi |
if test "x$pike_cv_datasegment_file" = "xno"; then |
PIKE_MSG_WARN(Some tests may yield false results.) |
else |
LIBS="$pike_cv_datasegment_file $LIBS" |
export LIBS |
PIKE_MSG_WARN(Data-segment kludge applied.) |
fi |
else |
AC_MSG_RESULT(yes) |
fi |
fi |
elif test "x$TCC" = "xyes"; then |
AC_MSG_CHECKING(if we can use pragma TenDRA longlong) |
AC_CACHE_VAL(pike_cv_pragma_tendra_longlong, [ |
AC_TRY_COMPILE([ |
#pragma TenDRA longlong type allow |
], [], [ pike_cv_pragma_tendra_longlong=yes |
], [ pike_cv_pragma_tendra_longlong=no ]) |
]) |
if test "x$pike_cv_pragma_tendra_longlong" = "xyes"; then |
AC_MSG_RESULT(yes) |
AC_DEFINE(HAVE_PRAGMA_TENDRA_LONGLONG) |
else |
AC_MSG_RESULT(no) |
fi |
|
AC_MSG_CHECKING(if we can use pragma TenDRA set longlong type) |
AC_CACHE_VAL(pike_cv_pragma_tendra_set_longlong_type, [ |
AC_TRY_COMPILE([ |
#ifdef HAVE_TENDRA_LONGLONG |
#pragma TenDRA longlong type allow |
#endif /* HAVE_TENDRA_LONGLONG */ |
#pragma TenDRA set longlong type : long long |
|
long long foo; |
], [], [ pike_cv_pragma_tendra_set_longlong_type=yes |
], [ pike_cv_pragma_tendra_set_longlong_type=no ]) |
]) |
if test "x$pike_cv_pragma_tendra_set_longlong_type" = "xyes"; then |
AC_MSG_RESULT(yes) |
AC_DEFINE(HAVE_PRAGMA_TENDRA_SET_LONGLONG_TYPE) |
else |
AC_MSG_RESULT(no) |
fi |
else :; fi |
|
############################################################################# |
|
if test "x$enable_binary" != "xno"; then |
|
# |
# The purpose of this test is to check that there is no filesystem |
# caching preventing pike from compiling correctly. |
# |
AC_MSG_CHECKING([filesystem synchronization]) |
|
AC_CACHE_VAL(pike_cv_filesystem_syncronization, |
[ |
pike_cv_filesystem_syncronization=working |
|
AC_EGREP_CPP(true, [ true ], , pike_cv_filesystem_syncronization=broken) |
AC_EGREP_CPP(false, [ false ], , pike_cv_filesystem_syncronization=broken) |
AC_EGREP_CPP(oui, [ oui ], , pike_cv_filesystem_syncronization=broken) |
AC_EGREP_CPP(no, [ no ], , pike_cv_filesystem_syncronization=broken) |
AC_EGREP_CPP(near, [ far ], pike_cv_filesystem_syncronization=broken, ) |
AC_EGREP_CPP(up, [ up ], , pike_cv_filesystem_syncronization=broken) |
AC_EGREP_CPP(down, [ down], , pike_cv_filesystem_syncronization=broken) |
]) |
|
AC_MSG_RESULT($pike_cv_filesystem_syncronization) |
if test "x$pike_cv_filesystem_syncronization" = xbroken ; then |
AC_MSG_ERROR([Filesystem caching is too aggressive. If you are using |
Samba, make sure to have the following line in your smb.conf: |
oplocks = False |
]) |
exit 1 |
fi |
|
fi |
|
############################################################################# |
|
LIBDIR=`(cd $srcdir/../lib ; pwd)` |
BINDIR=`(cd $srcdir/../bin ; pwd)` |
MANDIR=`(cd $srcdir/../man ; pwd)` |
DOCDIR=`(cd $srcdir/../refdoc ; pwd)` |
BASEDIR=`(cd $srcdir/.. ; pwd)` |
BUILDDIR=`pwd` |
AC_SUBST(LIBDIR) |
AC_SUBST(BINDIR) |
AC_SUBST(MANDIR) |
AC_SUBST(DOCDIR) |
AC_SUBST(BASEDIR) |
AC_SUBST(BUILDDIR) |
|
############################################################################# |
|
# |
# Some cross-compilation support and --disable-binary stuff |
# |
|
if test "x$enable_binary" = "xno"; then |
CROSS=yes |
else |
CROSS="$ac_cv_prog_cc_cross" |
fi |
AC_SUBST(CROSS) |
|
if test "x$enable_binary" = "xno"; then |
CC="$BINDIR/nobinary_dummy cc" |
RUNPIKE="USE_PIKE" |
RUNTPIKE="USE_PIKE" |
elif test "x$cross_compiling" = "xyes"; then |
RUNPIKE="DEFAULT_RUNPIKE" |
RUNTPIKE="USE_PIKE" |
else |
RUNPIKE="DEFAULT_RUNPIKE" |
RUNTPIKE="USE_TPIKE" |
fi |
AC_SUBST(RUNPIKE) |
AC_SUBST(RUNTPIKE) |
|
############################################################################# |
if test "x$enable_binary" != "xno"; then |
# The following tests are only relevant if we intend to build binaries. |
############################################################################# |
|
AC_CHECK_HEADERS(fnord/fnord/fnord.h) |
|
AC_MSG_CHECKING([if CHECK_HEADERS works]) |
if test "x$ac_cv_header_fnord_fnord_fnord_h" = xyes ; then |
AC_MSG_RESULT(no) |
exit 1 |
fi |
AC_MSG_RESULT(yes) |
|
############################################################################# |
|
AC_MSG_CHECKING(if we can allocate large auto variables) |
AC_CACHE_VAL(pike_cv_C_supports_large_auto, [ |
AC_TRY_LINK([ |
#include <stdio.h> |
int eat_stack(int foo) |
{ |
char large_array[131072] = ""; |
int i, sum = 0; |
|
for (i = 0; i < foo; i++) { |
/* Make sure the compiler does not optimize away the array. */ |
large_array[i] = sum; |
sum += foo; |
} |
for (i = 0; i < foo; i++) { |
sum += large_array[i] - large_array[foo-1-i]; |
} |
return sum; |
} |
], [ |
return !eat_stack(4711); |
], [ |
pike_cv_C_supports_large_auto=yes |
], [ |
pike_cv_C_supports_large_auto=no |
]) |
]) |
if test "$pike_cv_C_supports_large_auto" = "yes"; then |
AC_MSG_RESULT([yes - good]) |
else |
AC_MSG_RESULT([no]) |
AC_MSG_CHECKING([if we can make a workaround by defining _chkstk to call __chkstk]) |
AC_CACHE_VAL([pike_cv_kludge__chkstk], |
[ |
AC_TRY_LINK([ |
#include <stdio.h> |
int eat_stack(int foo) |
{ |
char large_array[131072] = ""; |
int i, sum = 0; |
|
for (i = 0; i < foo; i++) { |
/* Make sure the compiler does not optimize away the array. */ |
large_array[i] = sum; |
sum += foo; |
} |
for (i = 0; i < foo; i++) { |
sum += large_array[i] - large_array[foo-1-i]; |
} |
return sum; |
} |
|
extern size_t __chkstk(); |
size_t _chkstk() { return __chkstk(); } |
|
], [ |
return !eat_stack(4711); |
], [ |
pike_cv_kludge__chkstk=yes |
], [ |
pike_cv_kludge__chkstk=no |
]) |
]) |
if test "$pike_cv_kludge__chkstk" = "yes"; then |
AC_MSG_RESULT([yes - applying workaround]) |
AC_DEFINE(HAVE_BROKEN_CHKSTK) |
else |
AC_MSG_RESULT([no]) |
AC_ERROR([Your C compiler does not link code that uses large auto variables. |
|
Please check config.log, and fix the problem.]) |
exit 1 |
fi |
fi |
|
############################################################################# |
|
## Build smartlink |
AC_ARG_ENABLE(smartlink_binary, MY_DESCR([--disable-smartlink-binary], |
[do not build and use the smartlink binary]), |
[if test "x$enableval" = "xno"; then |
force_smartlink_script_only=yes |
fi]) |
|
if test -x /usr/bin/uname 2>/dev/null; then |
UNAME=`/usr/bin/uname -sr` |
elif test -x /bin/uname 2>/dev/null; then |
UNAME=`/bin/uname -sr` |
else |
UNAME=unknown |
fi |
|
# We need some special hacks when running slowaris |
AC_PATH_PROG(uname_prog,uname,no) |
AC_MSG_CHECKING(operating system) |
AC_CACHE_VAL(pike_cv_sys_os, |
[ |
if test "$cross_compiling" = "yes"; then |
case "$host_alias" in |
*amigaos*) pike_cv_sys_os="AmigaOS";; |
*linux*) pike_cv_sys_os="Linux";; |
*solaris*) pike_cv_sys_os="Solaris";; |
*sunos*) pike_cv_sys_os="SunOS";; |
*windows*) pike_cv_sys_os="Windows_NT";; |
*mingw*|*MINGW*) |
pike_cv_sys_os="Windows_NT" |
pike_cv_is_mingw="yes";; |
*) pike_cv_sys_os="Unknown";; |
esac |
elif test "$uname_prog" != "no"; then |
# uname on UNICOS doesn't work like other people's uname... |
if getconf CRAY_RELEASE >/dev/null 2>&1; then |
pike_cv_sys_os="UNICOS" |
else |
pike_cv_sys_os="`uname`" |
fi |
|
case "$pike_cv_sys_os" in |
SunOS) |
case "`uname -r`" in |
5.*) pike_cv_sys_os="Solaris" ;; |
esac |
;; |
Monterey64) |
# According to the release notes, the string "Monterey64" |
# will be changed to "AIX" in the final release. |
# (Monterey 64 is also known as AIX 5L). |
pike_cv_sys_os="AIX" |
;; |
*Windows*|*windows*) |
pike_cv_sys_os="Windows_NT" |
;; |
*MINGW*|*mingw*) |
pike_cv_is_mingw="yes" |
pike_cv_sys_os="Windows_NT" |
;; |
|
esac |
else |
pike_cv_sys_os="Not Solaris" |
fi |
]) |
AC_MSG_RESULT($pike_cv_sys_os) |
|
if test "x$pike_cv_sys_os" = xWindows_NT; then |
PIKE_FUNCS_NEED_DECLS(yes) |
fi |
|
AC_CHECK_HEADERS(stdlib.h string.h unistd.h sys/stat.h sys/types.h sys/errno.h) |
|
if test "$GCC" = "yes"; then :; else |
# |
# Special hack for HP-UX stupid cc |
# |
if test "$pike_cv_sys_os" = "HP-UX"; then |
AC_TRY_COMPILE([int foo(int bar);],[],[], |
[ |
OLD_CC="${CC-cc}" |
OLD_CFLAGS="$CFLAGS" |
case "/$CC" in |
*/smartlink\ cc) |
if test -x /usr/bin/cc; then |
CC="`echo $CC|sed -e 's/ cc/ \/usr\/bin\/cc/'`" |
else |
: ; |
fi |
;; |
esac |
CFLAGS="-Ae +Olibcalls $CFLAGS" |
AC_TRY_COMPILE([int foo(int bar);],[],[],[ |
CC="$OLD_CC" |
CFLAGS="$OLD_CFLAGS" |
]) |
pike_cv_prog_CC="${CC}" |
]) |
fi |
fi |
|
if test "$pike_cv_sys_os" = "Solaris" ; then |
AC_DEFINE(SOLARIS) |
else |
: |
fi |
|
# Workaround for compiling Pike on some OS that have some clues |
case "$pike_cv_sys_os" in |
CYGWIN*) |
# Cygwin has both Windows includes and Unix ones. |
# Hiding them makes it a somewhat Unix compliant OS. |
echo 'Cygwin host detected. Enabling workarounds...' |
# winsock.h, winbase.h, winsock2.h, windows.h, wingdi.h, windef.h |
# are part of VC api but given as headers in cygwin. We |
# should not detect them when using cygwin |
ac_cv_header_wingdi_h="no" |
ac_cv_header_windef_h="no" |
ac_cv_header_winsock_h="no" |
ac_cv_header_winsock2_h="no" |
ac_cv_header_winbase_h="no" |
ac_cv_header_windows_h="no" |
with_machine_code="no" |
;; |
Windows_NT) |
if test "$pike_cv_is_mingw" = "yes"; then |
#with_machine_code="no" |
ac_cv_func_fpclass="no" |
fi |
;; |
FreeBSD*) |
# FreeBSD has different naming convention for gtk-config and sdl-config |
if test "x${GTK_CONFIG}" = "x"; then |
GTK_CONFIG=`which ${ac_tool_prefix}gtk12-config` |
export GTK_CONFIG |
fi |
if test "x${SDL_CONFIG}" = "x"; then |
SDL_CONFIG=`which ${ac_tool_prefix}sdl11-config` |
export SDL_CONFIG |
fi |
;; |
esac |
|
# Skip if user does not wish to use smartlink binary. |
if test "x$force_smartlink_script_only" = "x"; then |
# Strip smartlink from $CC |
REALCC="`echo $CC|sed -e 's/.*smartlink //'`" |
|
|
# FIXME: Add proper tests |
AC_MSG_CHECKING([for ld.so run path method]) |
AC_CACHE_VAL(pike_cv_ld_so_run_path_method, [ |
case "$UNAME" in |
OSF1\ V4.*|OSF1\ V5.*|OSF1\ V6.*) |
pike_cv_run_path_method=rpath |
;; |
HPUX\ 11.*) |
pike_cv_run_path_method=plus_b |
;; |
IRIX\ 6.*) |
pike_cv_run_path_method=rpath |
;; |
IRIX\ 5.*) |
pike_cv_run_path_method=rpath |
;; |
SunOS\ 5.*) |
if test "$TCC" = "yes"; then |
# tcc doesn't know about -R |
pike_cv_run_path_method=wl_r |
else |
pike_cv_run_path_method=r |
fi |
;; |
Linux\ 2.* | GNU/kFreeBSD* ) |
if test "$ICC" = "yes"; then |
# icc or ecc. |
pike_cv_run_path_method=qoption |
else |
pike_cv_run_path_method=wl |
fi |
;; |
UnixWare\ 7.*|OpenUNIX\ 8.*) |
if test "$ac_cv_prog_gcc" = "yes"; then |
pike_cv_run_path_method=xlinker_yp_ |
else |
pike_cv_run_path_method=yp_ |
fi |
;; |
*) |
pike_cv_run_path_method=ld_library_path |
;; |
esac |
]) |
case "$pike_cv_run_path_method" in |
rpath) |
AC_DEFINE(USE_RPATH) |
AC_MSG_RESULT([use -rpath]) |
;; |
plus_b) |
AC_DEFINE(USE_PLUS_b) |
AC_MSG_RESULT([use +b]) |
;; |
yp_) |
AC_DEFINE(USE_YP_) |
AC_MSG_RESULT([use -Yp,]) |
;; |
xlinker_yp_) |
AC_DEFINE(USE_XLINKER_YP_) |
AC_MSG_RESULT([use -Xlinker -Yp, -Xlinker]) |
;; |
wl_r) |
AC_DEFINE(USE_Wl_R) |
AC_MSG_RESULT([use -Wl,-R]) |
;; |
r) |
AC_DEFINE(USE_R) |
AC_MSG_RESULT([use -R]) |
;; |
wl) |
AC_DEFINE(USE_Wl) |
AC_MSG_RESULT([use -Wl,-rpath]) |
;; |
qoption) |
AC_DEFINE(USE_Qoption) |
AC_MSG_RESULT([use -Qoption,ld,-rpath]) |
;; |
ld_library_path|*) |
AC_DEFINE(USE_LD_LIBRARY_PATH) |
AC_MSG_RESULT([use LD_LIBRARY_PATH/LD_RUN_PATH]) |
;; |
esac |
|
# Smartlink needs to know if OS X uses flat or two-level namespace |
if test "$pike_cv_sys_os" = "Darwin" ; then |
AC_MSG_CHECKING([for Darwin linker namespace]) |
case "`uname -r`" in |
[1-6].*) |
AC_MSG_RESULT([flat (10.2 or older)]) |
pike_cv_osx_twolevel_namespace=no |
;; |
*) |
AC_DEFINE(USE_OSX_TWOLEVEL_NAMESPACE) |
AC_MSG_RESULT([two-level (10.3 or newer)]) |
pike_cv_osx_twolevel_namespace=yes |
;; |
esac |
fi |
|
|
# Fix a smartlink |
SMARTLINK="$BUILDDIR/smartlink" |
|
AC_MSG_CHECKING(if $SMARTLINK exists is up to date and works) |
if ls -1tr "$SMARTLINK${ac_exeext}" "$srcdir/smartlink.$ac_ext" 2>/dev/null | head -n 1 | grep "smartlink.$ac_ext" >/dev/null 2>&AC_FD_CC && "$SMARTLINK" -v >/dev/null 2>&AC_FD_CC; then |
AC_MSG_RESULT(yes) |
else |
AC_MSG_RESULT(no) |
SMARTBUILDCC="${REALCC-cc}" |
|
if echo foo "$CC" | egrep 'rntc.|rnt.cl' >/dev/null; then |
PIKE_MSG_WARN([rntcc/rntcl/rnticl/rntecl detected.]) |
AC_PATH_PROGS(SMARTBUILDCC,gcc cc egcs,gcc, $PATH:$EXTRA_PATH) |
echo Using $SMARTBUILDCC to compile smartlink. |
elif test "x$ac_cv_prog_cc_cross" = "xyes"; then |
PIKE_MSG_WARN([Crosscompiler detected.]) |
AC_PATH_PROGS(SMARTBUILDCC, gcc cc egcs, gcc, /usr/bin:/bin/:/usr/ccs/bin:/usr/local/bin:/usr/sfw/bin:/opt/sfw/bin:/opt/csw/bin:$PATH:$EXTRA_PATH) |
echo Using $SMARTBUILDCC to compile smartlink. |
fi |
|
rm -f "$SMARTLINK" |
|
AC_MSG_CHECKING(whether smartlink compiles) |
|
link_cmd='${SMARTBUILDCC-cc} -o smartlink${ac_exeext} $CFLAGS -I. $CPPFLAGS $LDFLAGS $srcdir/smartlink.$ac_ext $LIBS 2>&AC_FD_CC' |
if { (eval echo Compiling smartlink: \"$link_cmd\") 1>&AC_FD_CC; (eval $link_cmd) 2>&AC_FD_CC; } && "$BUILDDIR/smartlink" -v >/dev/null 2>&AC_FD_CC; then |
AC_MSG_RESULT(yes) |
else |
AC_MSG_RESULT(no - use the sh script) |
SMARTLINK="$BINDIR/smartlink" |
fi |
fi |
else # force_smartlink_script_only |
AC_MSG_CHECKING(for smartlink build script) |
SMARTLINK="$BINDIR/smartlink" |
REALCC="$CC" |
AC_MSG_RESULT($SMARTLINK) |
fi # force_smartlink_script_only |
|
CC="$SMARTLINK $REALCC" |
pike_cv_prog_CC="$CC" |
|
# Strip smartlink from $CXX |
REALCXX="`echo $CXX|sed -e 's/.*smartlink //'`" |
CXX="$SMARTLINK $REALCXX" |
pike_cv_prog_CXX="$CXX" |
|
AC_SUBST(SMARTLINK) |
AC_SUBST(REALCC) |
AC_SUBST(REALCXX) |
export CC CXX REALCC REALCXX SMARTLINK |
|
AC_MSG_CHECKING([for a fallback compiler]) |
# Strip smartlink from $FALLBACK_CC |
FALLBACK_CC="`echo $FALLBACK_CC|sed -e 's/.*smartlink //'`" |
if test "x$FALLBACK_CC" = "x"; then |
AC_MSG_RESULT(no) |
else |
FALLBACK_CC="$SMARTLINK $FALLBACK_CC" |
AC_MSG_RESULT($FALLBACK_CC) |
fi |
AC_SUBST(FALLBACK_CC) |
export FALLBACK_CC |
|
############################################################################# |
fi #if test "x$enable_binary" != "xno" |
############################################################################# |
|
# Something seems to mess with the stack ulimit on some architectures... |
# |
# Cause found. GNU make 3.81 apparently raises the stack ulimit to max |
# without restoring it for the subprocesses. (Bug 18396 and 22010 at |
# http://savannah.gnu.org/projects/make) |
AC_DEFUN(PIKE_AC_DEBUG, [ |
echo "DEBUG: ----------------------------------" 1>&AC_FD_CC |
echo "Current limits: " 1>&AC_FD_CC |
ulimit -a 1>&AC_FD_CC |
echo "DEBUG: ++++++++++++++++++++++++++++++++++" 1>&AC_FD_CC |
]) |
|
PIKE_AC_DEBUG |
|
if :; then :; else |
# Disabled for now. |
# It looks this makes it even worse... |
# It seems to cause bash to loop on a SIGSEGV in the signal handler |
# on Gentoo Linux/IA64. |
AC_MSG_CHECKING([if the stack ulimit is excessive]) |
if ulimit -s 1>&AC_FD_CC 2>&AC_FD_CC; then |
orig_ulimit="`ulimit -s 2>&AC_FD_CC`" |
if test "$orig_ulimit" -gt "65536"; then |
AC_MSG_RESULT([yes, $orig_ulimit - reducing to 8192.]) |
if ulimit -s 8192 1>&AC_FD_CC 2>&AC_FD_CC; then :; else |
AC_MSG_WARN([Failed to reduce stack ulimit to 8192.]) |
fi |
PIKE_AC_DEBUG |
else |
AC_MSG_RESULT([no, $orig_ulimit]) |
fi |
else |
AC_MSG_RESULT([unknown, ulimit -s failed.]) |
fi |
fi |
|
AC_SYS_COMPILER_FLAG([-fvisibility=hidden],[fvisibility_hidden],CFLAGS) |
|
AC_SYS_COMPILER_FLAG(+O3,plus_O3,OPTIMIZE, [ |
AC_SYS_COMPILER_FLAG(-O3,O3,OPTIMIZE, [ |
AC_SYS_COMPILER_FLAG(-O2,O2,OPTIMIZE, [ |
AC_SYS_COMPILER_FLAG(-O,O,OPTIMIZE) |
]) |
]) |
]) |
|
if test "$GCC" = "yes"; then |
|
if test "$cflags_is_set" = "no"; then |
AC_SYS_COMPILER_FLAG(-pipe, pipe, OPTIMIZE) |
|
# The following segment is obsolete, since executable memory is |
# now allocated with mmap instead of with malloc(). |
# /grubba 2005-06-09 |
# |
# #### For exec-shield in newer linux kernels. |
# #### Linux's mprotect(2) is broken, so we unfortunately |
# #### need to enable executabe stack. |
# #### This test crashes under mingw32 so let's disable for win32 for now. |
# if test "$pike_cv_sys_os" != "Windows_NT"; then |
# AC_SYS_COMPILER_FLAG([[-Wa,--execstack]],executableheap,CFLAGS) |
# fi |
fi |
fi |
|
LD='$(CC) $(CFLAGS)' |
LC_REQ="-lc" |
|
case "$pike_cv_sys_os" in |
Darwin*) |
;; |
SCO*) |
case "$CFLAGS" in |
*-belf*) |
AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[ |
case "$LDFLAGS" in |
*-belf*) ;; |
*) |
echo "Adding -belf option to ldflags." |
LDFLAGS="$LDFLAGS -belf" |
;; |
esac |
]) |
;; |
*) |
AC_SYS_COMPILER_FLAG(-belf,belf,CFLAGS) |
;; |
esac |
case "$LDFLAGS" in |
*-belf*) ;; |
*) |
AC_SYS_COMPILER_FLAG(-belf,belf,LDFLAGS) |
;; |
esac |
;; |
SunOS*) |
# gcc on SunOS 4 forgets to define this: |
echo "SunOS. Adding -D__USE_FIXED_PROTOTYPES__" |
CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__" |
;; |
BSD/OS*) |
case "`uname -r`" in |
[4-9].*) ;; |
*) LD="$BINDIR/smartlink shlicc";; |
esac |
;; |
UnixWare*|OpenUNIX*) |
case "$CFLAGS" in |
*-Kalloca*) ;; |
*) |
if test "$GCC" != "yes"; then |
# We are using built-in inline function |
CFLAGS="$CFLAGS -Kalloca" |
CXX="$CXX -DNO_CPLUSPLUS_ALLOCA" |
LC_REQ="" |
fi |
;; |
esac |
;; |
Linux*) |
if $REALCC -V 2>&1 | head -1 | grep "Intel(R) C" >/dev/null; then |
# icc or ecc. |
LC_REQ="" |
fi |
;; |
esac |
|
AC_SUBST(LD) |
AC_SUBST(LC_REQ) |
|
############################################################################# |
|
AC_ARG_WITH(extra_debug_checks, |
MY_DESCR([--with-extra-debug-checks], |
[enable some extra (possibly verbose) debug checks.]), |
[], [ |
if test "x$pike_cv_sys_os" = "xOSF1"; then |
# Attempt to detect the cause for test_resolv to fail on Unicode.so. |
with_extra_debug_checks="yes" |
elif test "x$pike_cv_sys_os" = "xOpenBSD"; then |
# Attempt to detect cause of dmalloc failure on OpenBSD. |
with_extra_debug_checks="yes" |
else |
with_extra_debug_checks=no |
fi |
]) |
|
if test "x$with_extra_debug_checks" = "xno"; then :; else |
AC_MSG_WARN([Enabling extra debug checks.]) |
AC_DEFINE([PIKE_EXTRA_DEBUG]) |
fi |
|
############################################################################# |
|
AC_ARG_WITH(patch_gcc, MY_DESCR([--with-patch-gcc], |
[attempt to patch the UA32 relocation bug.]), |
[], [with_patch_gcc=no]) |
|
AC_ARG_WITH(force_ua32, MY_DESCR([--with-force-ua32], |
[ignore the UA32 relocation bug.]), |
[], [with_force_ua32=no]) |
|
# Some sanity checks. |
|
if test "$GCC" = "yes" -a "$pike_cv_sys_os" = "Solaris" && test "`uname -p`" = "sparc"; then |
# Solaris/sparc: |
# Check that gnu ld isn't used. |
# It's usually hidden in $prefix/sparc-sun-solaris2.?/bin/. |
# NOTE: M4 uses [] as quotes. |
gcc_ld_path="`$CC -v 2>&1 | sed -e '1,1s/[[^\/]]*\(\/.*\/\)[[^\/]]*$/\1/p;d' | sed -e '/lib\/gcc-lib\//s/lib\/gcc-lib\///;s/\/[[0-9]]*\.[[0-9]]*\.[[0-9]]*\/$/\/bin/'`" |
if test "x$gcc_ld_path" = "x"; then :; |
elif test -d "$gcc_ld_path/."; then |
if "$gcc_ld_path/ld" -v 2>&1 | grep -i GNU >/dev/null; then |
PIKE_MSG_WARN([GNU ld found on Solaris sparc system ($gcc_ld_path/ld). |
This may cause the dynamic module support to fail.]) |
else :; fi |
else :; fi |
unset gcc_ld_path |
|
|
# Watch out for gcc-2.8.1 on Solaris 7 sparc machines. It generates |
# assembler code which contains .uaword directives, which in turn |
# generates code with R_SPARC_UA32 relocations, which /usr/bin/ld.so |
# has buggy support for (it doesn't relocate the MSB). |
|
# Check that gcc doesn't generate uaword opcodes |
AC_MSG_CHECKING(if your gcc generates uaword opcodes) |
AC_CACHE_VAL(pike_cv_gcc_uaword, [ |
cat > conftest.c <<EOF |
char *foo[[]] = { "bar" }; |
EOF |
pike_compile='${CC-cc} -S $CPPFLAGS conftest.c 1>&AC_FD_CC' |
pike_cv_gcc_uaword=no |
if { (eval echo configure: \"$pike_compile\") >&AC_FD_CC; (eval $pike_compile) 2>&AC_FD_CC; }; then |
if grep ".uaword" conftest.s 2>&AC_FD_CC >/dev/null; then |
echo "configure: result contains .uaword:" >&AC_FD_CC |
cat conftest.s >&AC_FD_CC |
pike_cv_gcc_uaword=yes |
else :; fi |
else |
echo "configure: failed program was:" >&AC_FD_CC |
cat conftest.c >&AC_FD_CC |
fi |
rm -rf conftest.* |
]) |
AC_MSG_RESULT($pike_cv_gcc_uaword) |
|
# Check if as generates R_SPARC_UA32 relocations from .uaword. |
if test "$pike_cv_gcc_uaword" = "yes"; then |
AC_MSG_CHECKING([if your as generates R_SPARC_UA32 relocations]) |
AC_CACHE_VAL(pike_cv_as_r_sparc_ua32, [ |
AC_TRY_ASSEMBLE([ |
.section ".rodata" |
.align 8 |
.STRING: |
.asciz "String" |
.section ".data" |
.align 4 |
.type string,#object |
.size string,4 |
string: |
.uaword .STRING |
],[ |
if /usr/ccs/bin/elfdump -r conftest.o | grep -i R_SPARC_UA32 >/dev/null 2>&AC_FD_CC; then |
pike_cv_ac_r_sparc_ua32=yes |
else |
pike_cv_ac_r_sparc_ua32=no |
fi |
],[ |
pike_cv_ac_r_sparc_ua32=no |
]) |
]) |
AC_MSG_RESULT($pike_cv_ac_r_sparc_ua32) |
if test "$pike_cv_ac_r_sparc_ua32" = "yes"; then |
PIKE_MSG_WARN([Your gcc/as combo may generate R_SPARC_UA32 relocations. |
R_SPARC_UA32 relocations are unsupported in Solaris >= 2.3, |
and have broken support in Solaris 7.]) |
|
if test "x$with_patch_gcc$with_force_ua32" = "xnono"; then |
if test -d "/var/sadm/patch/107058-01/."; then |
PIKE_MSG_WARN([Back out patch 107058-01, or |
recompile gcc with a modified config/sparc/sol2.h.]) |
else |
PIKE_MSG_WARN([Recompile gcc with a modified config/sparc/sol2.h.]) |
fi |
|
PIKE_MSG_WARN([You may want to try binary patching gcc. |
In that case rerun configure with --with-patch-gcc. |
NOTE: Binary patching is highly experimental and risky, |
and may break your existing gcc even more. |
|
R_SPARC_UA32 relocations are supported on some versions |
of Solaris. If you want to try a binary with R_SPARC_UA32 |
relocations, rerun configure with --with-force-ua32.]) |
exit 1 |
fi |
|
if test "x$with_patch_gcc" = "xno"; then :; else |
AC_MSG_WARN([Will attempt to patch gcc.]) |
|
AC_MSG_CHECKING([for cc1]) |
if test "x$with_patch_gcc" = "xyes"; then |
cc1="`$CC -v 2>&1|sed -e '/\//s!^[[^/]]*\(/.*\)/specs$!\1/cc1!p' -ed`" |
else |
cc1="$with_patch_gcc"; |
fi |
if test -f "$cc1"; then |
AC_MSG_RESULT($cc1) |
else |
AC_MSG_RESULT(not found. Tried $cc1) |
exit 1 |
fi |
|
AC_MSG_CHECKING(if $cc1 looks unpatched) |
if /usr/bin/strings "$cc1" | grep uaword >/dev/null 2>&1; then |
AC_MSG_RESULT(yes) |
else |
AC_MSG_RESULT(no -- strange) |
exit 1 |
fi |
|
AC_MSG_CHECKING(if patch_cc1 compiles) |
link_cmd='${CC-cc} -o patch_cc1${ac_exeext} $CFLAGS -I. $CPPFLAGS $LDFLAGS $srcdir/patch_cc1.$ac_ext $LIBS 2>&AC_FD_CC' |
if { (eval echo Compiling patch_cc1: \"$link_cmd\") 1>&AC_FD_CC; (eval $link_cmd) 2>&AC_FD_CC; } && "$BUILDDIR/patch_cc1" -v >/dev/null 2>&AC_FD_CC; then |
AC_MSG_RESULT(yes) |
|
if test -f "$cc1.patched"; then |
AC_MSG_ERROR([$cc1.patched already exists. |
Please move it out of the way.]) |
exit 1; |
fi |
|
if test -f "$cc1.orig"; then |
AC_MSG_ERROR([$cc1.orig already exists. |
Please move it out of the way.]) |
exit 1; |
fi |
|
AC_MSG_CHECKING(if patch_cc1 works) |
if ./patch_cc1 "$cc1" 2>&AC_FD_CC >"$cc1.patched"; then |
if test -f "$cc1.patched"; then :; else |
AC_MSG_RESULT(no - failed to create $cc1.patched) |
exit 1 |
fi |
if chmod 755 "$cc1.patched"; then :; else |
AC_MSG_RESULT(no - failed to set permission to 755 on $cc1.patched) |
exit 1 |
fi |
|
if test "`/bin/ls -l \"$cc1\"|awk '{print $5}'`" = "`/bin/ls -l \"$cc1.patched\"|awk '{print $5}'`"; then |
if /usr/bin/strings "$cc1.patched" | grep uaword >/dev/null 2>&1; then |
rm -f "$cc1.patched" |
AC_MSG_RESULT(no -- patching failed) |
exit 1 |
fi |
|
if "$cc1.patched" --help >/dev/null 2>&1; then :; else |
AC_MSG_RESULT(no -- the patched binary does not seem to work) |
exit 1 |
fi |
|
AC_MSG_RESULT(yes) |
|
AC_MSG_WARN([Activating the patched cc1. |
NOTE: Entering critical section. |
If configure fails at this point a broken gcc my result.]) |
if /usr/bin/mv -f "$cc1" "$cc1.orig"; then |
|
AC_MSG_WARN([Moved $cc1 to $cc1.orig.]) |
|
if /usr/bin/mv -f "$cc1.patched" "$cc1"; then |
AC_MSG_WARN([Patching seems to have succeeded. |
Please rerun configure.]) |
exit 1 |
fi |
|
AC_MSG_WARN([Moving the patched cc1 into place failed. |
Will try to restore the old cc1.]) |
|
if /usr/bin/mv -f "$cc1.orig" "$cc1"; then |
AC_MSG_WARN([The old cc1 has been restored.]) |
exit 1 |
fi |
|
AC_MSG_ERROR([Restoring the old cc1 failed. |
Your installation of gcc is most likely broken now. |
Sorry, you will have to restore it yourself. |
Please move $cc1.orig to $cc1.]) |
exit 1 |
else |
AC_MSG_ERROR([Failed to move the old cc1 to safety. |
Please replace $cc1 with $cc1.patched by hand.]) |
exit 1 |
fi |
else |
rm -f "$cc1.patched" |
AC_MSG_ERROR([The size has changed. |
You need to patch cc1 by hand.]) |
exit 1 |
fi |
else |
AC_MSG_RESULT(no -- you need to patch cc1 by hand) |
exit 1 |
fi |
else |
AC_MSG_RESULT(no -- you need to patch cc1 by hand) |
exit 1 |
fi |
fi |
else :; fi |
else :; fi |
else :; fi |
|
############################################################################# |
|
|
AC_ARG_WITH(root, MY_DESCR([--with-root=path], |
[specify a cross-compilation root-directory]),[ |
case "$with_root" in |
/) |
with_root="" |
;; |
/*) |
;; |
no) |
with_root="" |
;; |
*) |
PIKE_MSG_WARN([Root path $with_root is not absolute. Ignored.]) |
with_root="" |
;; |
esac |
],[with_root=""]) |
MY_AC_ARG_WITH(relocatable_dumped_modules, |
MY_DESCR([--with-relocatable-dumped-modules], |
[make dumped modules relocatable]), |
[with_relocatable_dumped_modules=yes]) |
AC_ARG_WITH(dynamic_modules, MY_DESCR([--without-dynamic-modules], |
[link modules statically])) |
MY_AC_ARG_WITH(static_linking, MY_DESCR([--with-static-linking], |
[link statically, if possible]), |
[with_static_linking=yes]) |
AC_ARG_ENABLE(dll, MY_DESCR([--disable-dll], |
[don't link dynamic modules to DLLs on Windows]), |
[], [enable_dll=yes]) |
AC_ARG_WITH(crt, MY_DESCR([--with-crt=dynamic|static], |
[force linking with dynamic or static CRT in Visual Studio])) |
|
# --with-debug-crt is a nop on most systems since a debug C runtime |
# lib normally is used simply by setting LD_LIBRARY_PATH, but in MSVC |
# the choice affects both the compiler and the linker. |
# |
# Note that all libs need to be linked to the same CRT in VC8 if they |
# are linked to the DLL variant (i.e. using -MD), otherwise the MS |
# loader won't load them. This restriction is reinforced by the |
# manifest stuff that's used in VC8, and it doesn't apply when running |
# directly in the build dir. See |
# http://msdn2.microsoft.com/en-us/library/ms235299.aspx |
# |
# Also note that the debug CRT DLL in VC8 isn't redistributable. |
AC_ARG_WITH(debug-crt, MY_DESCR([--with-debug-crt], |
[compile and link with debug CRT in Visual Studio]), |
[], [with_debug_crt=no]) |
|
AC_ARG_WITH(bundles, |
MY_DESCR([--without-bundles], |
[do not enable bundled libraries]), |
[], [with_bundles=yes]) |
pike_bundle_dir="" |
if test "$with_bundles" = "no"; then |
:; |
elif test -d "$with_bundles/."; then |
# The user has specified a bundle directory. Use it. |
pike_bundle_dir="$with_bundles" |
elif test -d "$srcdir/../bundles/."; then |
# We have a bundle directory; enable them if needed. |
pike_bundle_dir=`cd "$srcdir/../bundles" && pwd` |
fi |
test -d bundles/. || mkdir bundles |
if test -d bundles/.; then |
touch bundles/no_testsuites |
pike_bundle_prefix="`pwd`/bundles" |
test -d bundles/installed/. || mkdir bundles/installed |
test -d bundles/include/. || mkdir bundles/include |
CPPFLAGS="$CPPFLAGS -I$pike_bundle_prefix/include" |
test -d bundles/lib/. || mkdir bundles/lib |
touch bundles/lib/keep |
for d in $pike_cv_abi_suffixes; do |
test -d "bundles/lib$d/." || mkdir "bundles/lib$d" |
touch "bundles/lib$d/keep" |
LDFLAGS="$LDFLAGS -L$pike_bundle_prefix/lib$d" |
done |
test -d bundles/lib/pkgconfig/. || mkdir bundles/lib/pkgconfig |
if test "x$PKG_CONFIG_PATH" = "x"; then |
PKG_CONFIG_PATH="${pike_bundle_prefix}/lib/pkgconfig" |
else |
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${pike_bundle_prefix}/lib/pkgconfig" |
fi |
export PKG_CONFIG_PATH |
fi |
export pike_bundle_dir |
export pike_bundle_prefix |
AC_ARG_WITH(site-prefixes, |
MY_DESCR([--with-site-prefixes], |
[:-separated list of prefixes to search for include, lib and bin dirs.])) |
AC_ARG_WITH(include-path, |
MY_DESCR([--with-include-path], |
[a list of paths to search for include files.])) |
AC_ARG_WITH(lib-path, |
MY_DESCR([--with-lib-path], |
[a list of paths to search for libraries.])) |
|
AC_ARG_WITH(long-double-precision, MY_DESCR([--with-long-double-precision], |
[use long double precision floats])) |
AC_ARG_WITH(double-precision, MY_DESCR([--with-double-precision], |
[use double precision floats])) |
|
AC_ARG_WITH(long-long-int, MY_DESCR([--with-long-long-int], |
[use long long native type int])) |
AC_ARG_WITH(long-int, MY_DESCR([--with-long-int], |
[use long native type int])) |
AC_ARG_WITH(int-int, MY_DESCR([--with-int-int], |
[use int native type int])) |
dnl AC_ARG_WITH(short-int, MY_DESCR([--with-short-int], |
dnl [use short native type int (EXPERIMENTAL)])) |
dnl AC_ARG_WITH(unsigned-long-int, MY_DESCR([--with-unsigned-long-int], |
dnl [use short native type int (EXPERIMENTAL)])) |
dnl AC_ARG_WITH(unsigned-long-long-int, MY_DESCR([--with-unsigned-long-longint], |
dnl [use short native type int (EXPERIMENTAL)])) |
|
AC_ARG_ENABLE(dlmalloc, MY_DESCR([--enable-dlmalloc], |
[use Doug Leas malloc implementation instead of system malloc]), |
[], [test "$pike_cv_sys_os" = Windows_NT && enable_dlmalloc=yes]) |
# dlmalloc is enabled by default on windows since the OS heap manager |
# Sucketh. (Well, it's possible to enable a "low-fragmentation heap" |
# but it only works for blocks up to 16kb.) |
if test "x$enable_dlmalloc" = xyes; then |
EXTRA_OBJS="$EXTRA_OBJS malloc.o" |
AC_DEFINE(USE_DL_MALLOC) |
else |
enable_dlmalloc=no |
fi |
|
MY_AC_ARG_WITH(cleanup-on-exit, |
MY_DESCR([--with-cleanup-on-exit], |
[Do full cleanup at exit to detect leaks better.]), |
[AC_DEFINE(DO_PIKE_CLEANUP)]) |
MY_AC_ARG_WITH(dmalloc, MY_DESCR([--with-dmalloc],[Enable memory leak checks.]), |
[AC_DEFINE(DEBUG_MALLOC,10)]) |
MY_AC_ARG_WITH(dmalloc-malloc, MY_DESCR([--with-dmalloc-malloc], |
[Enable overloading of malloc(3)]), |
[ AC_DEFINE(ENCAPSULATE_MALLOC,1) ]) |
MY_AC_ARG_WITH(dmalloc-malloc-leaks, |
MY_DESCR([--with-dmalloc-malloc-leaks], |
[Report memory allocated by malloc(3) as leaks.]), |
[ AC_DEFINE(REPORT_ENCAPSULATED_MALLOC,1) ]) |
MY_AC_ARG_WITH(dmalloc-trace, MY_DESCR([--with-dmalloc-trace], |
[enable tracepoints]), |
[with_dmalloc_trace="yes" AC_DEFINE(DMALLOC_TRACE,10)]) |
MY_AC_ARG_WITH(dmalloc-c-stack-trace, MY_DESCR([--with-dmalloc-c-stack-trace], |
[record C stack traces for block allocations]), |
[AC_DEFINE(DMALLOC_C_STACK_TRACE)]) |
MY_AC_ARG_WITH(dmalloc-track-free, MY_DESCR([--with-dmalloc-track-free], |
[track freed memory too]), |
[ with_dmalloc_track_free="yes" |
AC_DEFINE(DMALLOC_TRACK_FREE,10)]) |
AC_ARG_WITH(debug, MY_DESCR([--with-debug],[same as --with-cdebug --with-rtldebug]), |
[],[with_debug=]) |
AC_ARG_WITH(debug, MY_DESCR([--without-debug],[same as --without-cdebug --without-rtldebug]), |
[],[with_debug=]) |
AC_ARG_WITH(rtldebug, MY_DESCR([--with-rtldebug],[enable run time self tests]), |
[],[with_rtldebug=]) |
AC_ARG_WITH(cdebug, MY_DESCR([--without-cdebug],[disable -g]),[],[ |
case "$pike_cv_sys_os:$GCC" in |
Solaris:no) |
# Solaris/cc has problems with combining optimizations and debuginfo. |
PIKE_MSG_WARN([Defaulting to --without-cdebug since the OS is Solaris, |
and gcc is not being used.]) |
with_cdebug=no |
;; |
HP-UX:no|HPUX:no) |
# HP-UX/cc has problems with combining optimizations and debuginfo. |
# |
# cc: internal panic 7815: Malloc: underflow detected in free(). (7815) |
PIKE_MSG_WARN([Defaulting to --without-cdebug since the OS is HP-UX, |
and gcc is not being used.]) |
with_cdebug=no |
;; |
*) |
with_cdebug= |
;; |
esac |
]) |
AC_ARG_WITH(copt, MY_DESCR([--without-copt], [disable -O2]), [], [with_copt=]) |
AC_ARG_WITH(threads, MY_DESCR([--without-threads], [disable threads support]), |
[],[ |
case "x$pike_cv_sys_os" in |
xFreeBSD*) |
if test "`uname -r|sed -e 's/\([[0-9]]*\).*/\1/'`" -lt 4; then |
PIKE_MSG_WARN([FreeBSD <= 3.x detected, disabling threads. |
Use --with-threads to force threads support.]) |
with_threads=no |
fi |
;; |
xOpenBSD*) |
if test "`uname -r|sed -e 's/\([[0-9]]*\).*/\1/'`" -lt 4 \ |
-a "x`uname -m`" = "xalpha"; then |
PIKE_MSG_WARN([OpenBSD/alpha <= 3.x detected, disabling threads. |
Use --with-threads to force threads support.]) |
with_threads=no |
fi |
;; |
esac |
|
if test "x${with_threads-}" = x; then |
with_threads=yes |
fi |
]) |
|
PIKE_AC_DEBUG |
|
AC_ARG_WITH(malloc_overhead, |
MY_DESCR([--with-malloc-overhead=n], |
[tune the malloc block overhead (default is 2 * sizeof(void *))]), |
[AC_DEFINE(PIKE_MALLOC_OVERHEAD,($withval))], |
[AC_DEFINE(PIKE_MALLOC_OVERHEAD,(2 * sizeof(void *)))]) |
AC_ARG_WITH(malloc_page_size, |
MY_DESCR([--with-malloc-page-size=n], |
[tune to the memory page size (default is 4 kb)]), |
[AC_DEFINE(PIKE_MALLOC_PAGE_SIZE,($withval))], |
[AC_DEFINE(PIKE_MALLOC_PAGE_SIZE,(4 * 1024))]) |
|
PIKE_AC_DEBUG |
|
AC_ARG_WITH(thread_c_stack, |
MY_DESCR([--with-thread-c-stack=n], |
[tune the thread c-stack (default is 256 * 1024)]), |
[AC_DEFINE_UNQUOTED(PIKE_THREAD_C_STACK_SIZE,($withval))], |
[AC_DEFINE(PIKE_THREAD_C_STACK_SIZE,(256 * 1024))]) |
|
AC_ARG_WITH(devpoll, MY_DESCR([--without-devpoll], |
[disable support for /dev/poll]), |
[],[with_devpoll=yes]) |
AC_ARG_WITH(gdbm, MY_DESCR([--without-gdbm],[no GNU database manager support])) |
AC_ARG_WITH(gmp, MY_DESCR([--without-gmp],[no support for Gmp bignums])) |
AC_ARG_WITH(zlib, MY_DESCR([--without-zlib],[disable gz compression support]), |
[],[with_zlib=yes]) |
AC_ARG_WITH(mysql, MY_DESCR([--without-mysql], |
[disable support for the Mysql database]), |
[],[with_mysql=yes]) |
AC_ARG_WITH(valgrind, MY_DESCR([--with-valgrind=path], |
[Support for running with valgrind. Implies --with-cleanup-on-exit.]) |
MY_DESCR([],[Specify --without-cleanup-on-exit if you do not want this.]), |
[ |
if test "x$with_valgrind" = "xyes"; then |
AC_PATH_PROG(with_valgrind, valgrind, no) |
if test "x$with_valgrind" = "xno"; then |
PIKE_MSG_WARN(valgrind not found, disabled.) |
else :; fi |
else :; fi |
], [with_valgrind=no]) |
AC_ARG_WITH(dtrace, MY_DESCR([--with-dtrace],[embed DTrace probes])) |
AC_ARG_WITH(checker, MY_DESCR([--with-checker], |
[add extra memory checking overhead (Purify)])) |
AC_ARG_WITH(gcov, MY_DESCR([--with-gcov], |
[compile with support for gcov (gcc-only)])) |
MY_AC_ARG_WITH(profiling, MY_DESCR([--with-profiling], |
[add code used to profile pike code]), |
[AC_DEFINE(PROFILING)]) |
MY_AC_ARG_WITH(internal-profiling, MY_DESCR([--with-internal-profiling], |
[add profiling code for various internal things]), |
[AC_DEFINE(INTERNAL_PROFILING)]) |
MY_AC_ARG_WITH(pg, MY_DESCR([--with-pg],[use the gcc -pg option]), |
[PROFIL=-pg]) |
AC_ARG_WITH(poll, MY_DESCR([--with-poll], [use poll instead of select]), [], [ |
# Neither --with-poll nor --without-poll was specified |
case "$pike_cv_sys_os" in |
Solaris|HP-UX|OSF1|IRIX|Linux|UnixWare|OpenUNIX) |
# PIKE_MSG_WARN([Defaulting to --with-poll since the OS is $pike_cv_sys_os.]) |
# Nothing to warn about, really... |
with_poll=yes |
;; |
AIX) |
# poll(2) is broken on AIX 4.1 and earlier. |
if test "`uname -r`" -ge 2 -a "`uname -v`" -ge 4 ; then |
with_poll=yes |
elif test "`uname -v`" -gt 4 ; then |
with_poll=yes |
else :; fi |
;; |
esac |
]) |
AC_ARG_WITH(max-fd, |
MY_DESCR([--with-max-fd=X], |
[set how many filedescriptors can be used at once]), |
[pike_cv_max_open_fd=$withval]) |
MY_AC_ARG_WITH(oob, MY_DESCR([--without-oob], |
[disable out-of-band data handling (INVALID)]), |
[],[ |
AC_MSG_ERROR([Support for out of band data is mandatory in Pike 7.5 and later.]) |
]) |
MY_AC_ARG_WITH(compiler-trace, MY_DESCR([--with-compiler-trace], |
[enable tracing of the compiler]), |
[AC_DEFINE(YYDEBUG)]) |
AC_ARG_WITH(security, MY_DESCR([--with-security], |
[enable internal pike security system]), |
[AC_DEFINE(PIKE_SECURITY)]) |
AC_ARG_WITH(bignums, MY_DESCR([--without-bignums], |
[disable internal conversion to bignums (not recommended)]), |
[],[with_bignums=yes]) |
dnl Shared nodes has been disabled in an ugly way. To enable it you |
dnl need to remove the line that sets the OPT_NOT_SHARED flag at the |
dnl top of freeze_node in src/las.c. /mast |
dnl AC_ARG_WITH(shared-nodes, |
dnl MY_DESCR([--without-shared-nodes], |
dnl [disable the SHARED_NODES mode of the optimizer]), |
dnl [],[with_shared_nodes=yes]) |
AC_ARG_WITH(typechecker, MY_DESCR([--with-typechecker=new|old],[])) |
AC_ARG_WITH(type-checker, |
MY_DESCR([--with-type-checker=new|old], |
[select type-checker behaviour]), |
[],[with_type_checker="${with_typechecker:-new}"]) |
if test "x$with_type_checker" = "xold"; then :; |
PIKE_MSG_WARN([Old type checker selected.]) |
else |
AC_DEFINE(NEW_ARG_CHECK) |
fi |
AC_ARG_WITH(computed-goto, |
MY_DESCR([--with-computed-goto], |
[enable use of gcc-style computed goto (EXPERIMENTAL).]), |
[], [with_computed_goto=no]) |
AC_ARG_WITH(machine-code, |
MY_DESCR([--without-machine-code], |
[do not try to use of machine code on supported architectures.]), |
[], [ |
case "x$pike_cv_sys_os" in |
xOpenBSD*) |
PIKE_MSG_WARN([OpenBSD detected, disabling machine code. |
Use --with-machine-code to force usage of machine code support.]) |
with_machine_code="no" |
;; |
xFreeBSD*) |
PIKE_MSG_WARN([FreeBSD detected, disabling machine code. |
Use --with-machine-code to force usage of machine code support.]) |
with_machine_code="no" |
;; |
|
esac |
|
if test "x${with_machine_code-}" = x; then |
with_machine_code="yes" |
fi |
|
]) |
AC_ARG_WITH(small-eval-instruction, |
MY_DESCR([--with-small-eval-instruction], |
[attempt to reduce the size of eval_instruction (EXPERIMENTAL).]), [ |
AC_DEFINE(PIKE_SMALL_EVAL_INSTRUCTION) |
with_machine_code="no" |
with_computed_goto="no" |
]) |
|
MY_AC_ARG_WITH(keypair-loop, |
MY_DESCR([--with-keypair-loop], |
[enable use of keypair mapping loop method.]), |
[AC_DEFINE(PIKE_MAPPING_KEYPAIR_LOOP)],[], |
[]) |
|
MY_AC_ARG_WITH(portable-bytecode, |
MY_DESCR([--without-portable-bytecode], |
[disable portable bytecode support.]), |
[AC_DEFINE(PIKE_PORTABLE_BYTECODE)],[], |
[AC_DEFINE(PIKE_PORTABLE_BYTECODE)]) |
|
MY_AC_ARG_WITH(lock, |
MY_DESCR([--without-lock], |
[enable experimental code for multicpu machines (EXPERIMENTAL).]), |
[],[AC_DEFINE(PIKE_RUN_UNLOCKED)]) |
|
AC_ARG_WITH(facets, MY_DESCR([--with-facets], |
[enable experimental facet support (EXPERIMENTAL).]), |
[AC_DEFINE(WITH_FACETS)]) |
|
AC_ARG_WITH(pike-type, MY_DESCR([--without-pike-type], |
[disable struct pike_type (IGNORED).])) |
|
if test "x$with_pike_type" = "xno"; then |
PIKE_MSG_WARN([Disabling of USE_PIKE_TYPE is no longer supported.]) |
fi |
|
if test "x$with_bignums" = xyes; then |
AC_DEFINE(AUTO_BIGNUM) |
if test "x$with_gmp" = xno; then |
AC_MSG_ERROR([Cannot compile --with-bignums without the GMP library |
It is highly recommended that you install a working GMP |
library on your system as that will add features to Pike |
required by many applications (such as Roxen). However, |
if you know that you do not need GMP, you may re-run configure |
with the option --without-bignums instead.]) |
else :; fi |
else |
PIKE_MSG_WARN([****** Compiling without bignum support. This is discouraged. Many |
****** Pike applications might not work correctly.]) |
sleep 10 |
fi |
|
dnl Pike currently breaks miserably if SHARED_NODES is not defined. |
dnl Shared nodes are still disabled bluntly. (See note above.) |
dnl if test "x$with_shared_nodes" != xno; then |
dnl echo 'Enabling the SHARED_NODES mode of the optimizer.' |
AC_DEFINE(SHARED_NODES) |
dnl else :; fi |
|
if test "x$with_poll" = "xyes"; then |
AC_DEFINE(HAVE_AND_USE_POLL) |
else :; fi |
|
if test "x$with_valgrind" = "xno"; then |
VALGRIND="" |
VALGRINDARGS="" |
else |
VALGRIND="$with_valgrind" |
# Make valgrind a bit silent by default. |
VALGRINDARGS="-q --tool=memcheck" |
AC_DEFINE(USE_VALGRIND) |
|
if test "x$with_cleanup_on_exit" = "x"; then |
AC_DEFINE(DO_PIKE_CLEANUP) |
fi |
|
if test "x$with_copt" != "xno"; then |
PIKE_MSG_WARN([--without-copt is advisable when using valgrind!]) |
fi |
fi |
export VALGRIND VALGRINDARGS |
AC_SUBST(VALGRIND) |
AC_SUBST(VALGRINDARGS) |
|
# DTrace probes |
if test "x$with_dtrace" = "xyes"; then |
AC_PATH_PROG(dtrace_prog, dtrace, no) |
if test "x$ac_cv_path_dtrace_prog" != "xno"; then |
AC_DEFINE(USE_DTRACE) |
DTRACE_REQUIREMENTS="dtrace_probes.h" |
fi |
fi |
|
if test "x$with_checker" = "xyes"; then |
AC_DEFINE(__CHECKER__) |
else :; fi |
|
if test "x$with_relocatable_dumped_modules" = xyes; then |
PIKE_MODULE_RELOC=1 |
else |
PIKE_MODULE_RELOC="" |
fi |
AC_SUBST(PIKE_MODULE_RELOC) |
|
|
# |
# Allow --with(out)-debug to toggle both cdebug and rtldebug, but |
# let --with(out)-{c,rtl}debug take precedence. |
# |
if test "x$with_cdebug" = x ; then |
with_cdebug="$with_debug" |
fi |
|
if test "x$with_rtldebug" = x ; then |
with_rtldebug="$with_debug" |
fi |
|
|
# |
# --with-dmalloc requires --with-rtldebug |
# |
if test "x$with_dmalloc" = "x"; then |
:; |
elif test "x$with_rtldebug" = "xyes"; then :; else |
PIKE_MSG_WARN([Debug malloc requires rtldebug. Enabling rtldebug.]) |
with_rtldebug=yes |
fi |
|
|
# |
# Defaults for cdebug and rtldebug here: |
# |
|
if test "x$with_cdebug" = x ; then |
with_cdebug=yes |
fi |
|
if test "x$with_rtldebug" = x ; then |
with_rtldebug=no |
# with_rtldebug=yes |
fi |
|
if test "x$with_rtldebug" = xyes ; then |
AC_DEFINE(PIKE_DEBUG) |
fi |
|
############################################################################# |
|
|
DLOPEN_O="" |
OSFLAGS="" |
WARN="" |
OPTIMIZE="${OPTFLAGS-}" |
|
AC_ARG_ENABLE(pedantic, MY_DESCR([--enable-pedantic], |
[enable -pedantic compilation])) |
|
if test "$cflags_is_set" = "no"; then |
if test "x$with_cdebug" = "xno" ; then |
CFLAGS=`echo " $CFLAGS " | sed -e 's@ -g @ @g'` |
else |
: |
fi |
|
if test "x$enable_pedantic" = "xyes"; then |
AC_SYS_COMPILER_FLAG(-pedantic,pedantic,WARN) |
fi |
|
|
if test "x${GCC-}" = xyes ; then |
# Do not use -Wall, since that produces a lot of warnings that are not |
# really interresting (such as the warning for if( ... ) ... if( |
# ... ) .... else |
AC_SYS_COMPILER_FLAG(-W,W,WARN) |
AC_SYS_COMPILER_FLAG(-Wall,Wall,WARN) |
AC_SYS_COMPILER_FLAG(-Wno-unused,Wno_unused,WARN) |
AC_SYS_COMPILER_FLAG(-Wcomment,Wcomment,WARN) |
AC_SYS_COMPILER_FLAG(-Wformat,Wformat,WARN) |
AC_SYS_COMPILER_FLAG(-Wformat-security,Wformat_security,WARN) |
AC_SYS_COMPILER_FLAG(-Wimplicit-function-declaration,Wimplicit_function_declaration,WARN) |
AC_SYS_COMPILER_FLAG(-Wmultichar,Wmultichar,WARN) |
AC_SYS_COMPILER_FLAG(-Wswitch,Wswitch,WARN) |
|
if test "x$with_copt" != xno; then |
# gcc complains that it doesn't support this when compiling |
# without optimizations. |
AC_SYS_COMPILER_FLAG(-Wuninitialized,Wuninitialized,WARN) |
fi |
AC_SYS_COMPILER_FLAG(-Wpointer-arith,Wpointer_arith,WARN) |
AC_SYS_COMPILER_FLAG(-Wchar-subscripts,Wchar_subscripts,WARN) |
AC_SYS_COMPILER_FLAG(-Wno-long-long,Wno_long_long,WARN) |
AC_SYS_COMPILER_FLAG(-Wdeclaration-after-statement,Wdeclaration_after_statement,WARN) |
|
if test "x${with_static_linking-}" = "xyes" ; then |
AC_SYS_COMPILER_FLAG(-static,link_static,CFLAGS) |
else |
: |
fi |
|
if test "x$with_gcov" = "xyes"; then |
# Support for gcov |
AC_SYS_COMPILER_FLAG(-fprofile-arcs, fprofile_arcs, CFLAGS) |
AC_SYS_COMPILER_FLAG(-ftest-coverage, ftest_coverage, CFLAGS) |
else :; fi |
|
if test "x$with_cdebug" = "xyes" ; then |
AC_SYS_COMPILER_FLAG(-ggdb3,ggdb3,CFLAGS) |
fi |
|
## |
## -fomit-frame-pointer does not work with egcs 1.1.1 |
## /Hubbe 1998-12-20 |
## |
#if test "x$with_cdebug" = "xno" ; then |
# AC_SYS_COMPILER_FLAG(-fomit-frame-pointer,fomit_frame_pointer,OPTIMIZE) |
#else |
# : |
#fi |
|
|
### Optimize for different SUN machines. If there is no working 'uname' |
### no extra optimization will be done, but nothing should break either. |
case "`uname -m 2>/dev/null`" in |
sun4c) |
# The -msparclite option seems to generate assembler that /bin/as doesn't |
# understand. /grubba 1998-07-17 |
# AC_SYS_COMPILER_FLAG(-msparclite,sparclite,CFLAGS) |
;; |
sun4m) |
AC_SYS_COMPILER_FLAG(-mv8,microsparc,CFLAGS) |
;; |
sun4d) |
AC_SYS_COMPILER_FLAG(-msupersparc,supersparc,CFLAGS) |
;; |
sun4u) |
AC_SYS_COMPILER_FLAG(-mcpu=ultrasparc,mcpu_ultrasparc,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-msupersparc,supersparc,CFLAGS) |
],[],[ |
# Some versions of gcc define __sparcv9 but aren't LP64. |
# Definition of __sparcv9 causes <sys/isa_defs.h> to define _LP64, |
# which is not a good thing for ILP32 systems... |
# Some versions of gcc define __sparc_v9__, which causes the |
# fix-included <limits.h> to think the same... |
AC_TRY_CPP([#include <limits.h> |
#include <sys/types.h> |
#if defined(_LP64) || (LONG_MAX != 2147483647L) |
#error "We might have a problem." |
#endif |
],[],[ |
# We might have a problem... |
# Check that we indeed have a LP64 system. |
AC_MSG_RESULT([yes, but LP64]) |
AC_CHECK_SIZEOF(long, 4) |
# Note: the result for the following message is provided |
# by SYS_COMPILER_FLAG |
AC_MSG_CHECKING([are we really an LP64 system]) |
if test "x$ac_cv_sizeof_long" = "x8"; then |
:; #OK, we have an LP64 system! |
else |
pike_cv_option_mcpu_ultrasparc=no |
fi |
]) |
]) |
;; |
i586) |
AC_SYS_COMPILER_FLAG(-mtune=pentium,mtune_pentium,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS) |
]) |
]) |
;; |
i686) |
AC_SYS_COMPILER_FLAG(-mtune=i686,mtune_i686,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mcpu=i686,mcpu_i686,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mpentiumpro,pentiumpro,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS) |
]) |
]) |
]) |
]) |
# AC_SYS_COMPILER_FLAG(-march=i686,march_i686,CFLAGS) |
;; |
x86_64) |
AC_SYS_COMPILER_FLAG(-m64,m64,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mtune=i686,mtune_i686,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mcpu=i686,mcpu_i686,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mpentiumpro,pentiumpro,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS) |
]) |
]) |
]) |
]) |
], [ |
BUNDLE_FLAGS="$BUNDLE_FLAGS --build=x86_64" |
]) |
;; |
i86pc) |
# Solaris x86 |
case "`optisa \`isalist 2>/dev/null\` 2>/dev/null || isalist 2>/dev/null`" in |
*amd64*) |
AC_SYS_COMPILER_FLAG(-m64,m64,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mtune=i686,mtune_i686,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mcpu=i686,mcpu_i686,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mpentiumpro,pentiumpro,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS) |
]) |
]) |
]) |
]) |
], [ |
BUNDLE_FLAGS="$BUNDLE_FLAGS --build=x86_64" |
]) |
# AC_SYS_COMPILER_FLAG(-march=i686,march_i686,CFLAGS) |
;; |
*pentium_pro*) |
AC_SYS_COMPILER_FLAG(-mtune=i686,mtune_i686,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mcpu=i686,mcpu_i686,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mpentiumpro,pentiumpro,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS) |
]) |
]) |
]) |
]) |
# AC_SYS_COMPILER_FLAG(-march=i686,march_i686,CFLAGS) |
;; |
*pentium*) |
AC_SYS_COMPILER_FLAG(-mtune=pentium,mtune_pentium,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS,[ |
AC_SYS_COMPILER_FLAG(-m486,486,CFLAGS) |
]) |
]) |
]) |
;; |
esac |
;; |
ia64) |
case "`uname -p`" in |
[Ii]tanium*2) |
AC_SYS_COMPILER_FLAG(-mtune=itanium2,mtune_itanium2,CFLAGS) |
;; |
[Ii]tanium) |
AC_SYS_COMPILER_FLAG(-mtune=itanium1,mtune_itanium1,CFLAGS) |
;; |
esac |
;; |
ppc64) |
case "`uname -p 2>/dev/null`" in |
Cell\ Broadband\ Engine*) |
AC_SYS_COMPILER_FLAG(-mcpu=cell,mcpu_cell,CFLAGS) |
;; |
esac |
;; |
esac |
|
# AIX |
DO_IF_OS(AIX, |
[ |
# Tell the linker to generate a large toc if needed |
# |
# This option is not needed on AIX 5L/ia64. |
if test "x`uname -p`" = "xia64"; then :; else |
AC_SYS_COMPILER_FLAG(-bbigtoc,bbigtoc,LDFLAGS) |
AC_SYS_COMPILER_FLAG([-Wl,-bbigtoc],Wlbbigtoc,LDFLAGS) |
fi |
]) |
|
DO_IF_OS(Darwin, |
[ |
# aka MacOS X. |
# Foundation framework needed by JavaVM.framework. The OS X 10.1 linker |
# no longer includes indirect dependencies so we need to add them here. |
AC_SYS_COMPILER_FLAG(-framework Foundation, framework_Foundation, LDFLAGS) |
AC_SYS_COMPILER_FLAG(-framework System, framework_System, LDFLAGS) |
|
# Needed for MakeDataExecutable which comes from CarbonLib |
AC_SYS_COMPILER_FLAG(-framework CoreServices, framework_CoreServices, LDFLAGS) |
|
# -flat_namespace only needed for linking with libMallocDebug |
# AC_SYS_COMPILER_FLAG(-flat_namespace, flat_namespace, LDFLAGS) |
|
# Take care of warning when linking with GMP libraries |
AC_SYS_COMPILER_FLAG(-read_only_relocs warning, ro_relocs_warn, LDFLAGS) |
|
# Tune based on processor family |
case "`machine`" in |
i486) |
# Darwin x86 runs on Intel Core Solo/Duo (based on Pentium M) and newer |
AC_SYS_COMPILER_FLAG(-march=pentium-m, arch_pentium_m, OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-msse3, opt_sse3, OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-mfpmath=sse, opt_mfpmath_sse, OPTIMIZE) |
|
# no-pic required for machine code to work |
AC_SYS_COMPILER_FLAG(-mdynamic-no-pic, dynamicnopic, OSFLAGS) |
|
# Silence warnings about not working on systems older than the base |
# version of the current machine. We'll convert e.g. 10.5.8 to 1050. |
AC_SYS_COMPILER_FLAG(-DMAC_OS_X_VERSION_MIN_REQUIRED=`sw_vers -productVersion | tr -d . | cut -c -3`0, osxminversion, CFLAGS) |
;; |
ppc970|ppc7450|ppc7400) |
# Improve performance on G4 and G5. Note that if the build machine |
# is a G4 or newer the resulting pike won't run on a G3. |
AC_SYS_COMPILER_FLAG(-mcpu=7400, cpu7400, OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-mtune=7400, tune7400, OPTIMIZE) |
;; |
*) |
# G3 is the baseline on PPC since Mac OS X doesn't support anything |
# older. |
AC_SYS_COMPILER_FLAG(-mcpu=750, cpu750, OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-mtune=750, tune750, OPTIMIZE) |
;; |
esac |
]) |
|
DO_IF_OS(Linux, |
[ |
: |
# The following segment is obsolete, since executable memory is |
# now allocated with mmap instead of with malloc(). |
# /grubba 2005-06-09 |
# |
# if test "x$with_machine_code" = "xno"; then :; else |
# # WORKAROUND: mprotect(PROT_EXEC) doesn't work on Linux/x86. |
# # Try to set the stackexec flag on the binary. |
# # First try -z execstack (ld). |
# AC_SYS_COMPILER_FLAG([-z execstack], z_execstack, LDFLAGS, [ |
# # No, try passing it directly to the linker. |
# AC_SYS_COMPILER_FLAG([-Wl,-z,execstack], Wl_z_execstack, LDFLAGS, [ |
# # No, try --execstack (gas). |
# AC_SYS_COMPILER_FLAG([--execstack], execstack, CFLAGS, [ |
# # No, try passing it directly to the assembler. |
# AC_SYS_COMPILER_FLAG([-Wa,--execstack], Wa_execstack, CFLAGS, [ |
# # No. |
# # FIXME: Add support for use of chstk(1). |
# PIKE_MSG_WARN([Could not find any way to enable executable stack.]) |
# ]) |
# ]) |
# ]) |
# ]) |
# fi |
]) |
|
elif test "x${TCC-}" = xyes ; then |
|
# Yikes! We're using the TenDRA compiler! |
|
# Make sure we can use the system headerfiles... |
# Already done by the CC test in aclocal.m4. |
# AC_SYS_COMPILER_FLAG(-Ysystem, ysystem, CPPFLAGS) |
|
# Use lenient ANSI compliance... |
#AC_SYS_COMPILER_FLAG(-Xa, xa, CFLAGS) |
|
# Find out where libtdf.a is hidden. |
AC_MSG_CHECKING(for machine dependant library directory) |
AC_CACHE_VAL(pike_cv_tcc_lib_path, |
[ |
pike_cv_tcc_lib_path="`${CC-cc} -dry conftest.c -i 2>&1 | sed -e '/tdfc/s/bin\/tdfc.*/lib\/sys/p' -ed| head -n 1`" |
if test -d "$pike_cv_tcc_lib_path/." ; then :; else |
# Failed. |
pike_cv_tcc_lib_path="no" |
fi |
]) |
AC_MSG_RESULT($pike_cv_tcc_lib_path) |
|
if test "$pike_cv_tcc_lib_path" = "no" ; then :; else |
LDFLAGS="$LDFLAGS -L$pike_cv_tcc_lib_path" |
|
# This library is needed for 64bit support on 32bit machines/OS's. |
AC_CHECK_LIB(tdf, __TDFUnot) |
fi |
|
else |
|
# Assume system compiler "cc". |
|
if test "x${with_static_linking-}" = "xyes" ; then |
DO_IF_OS(AIX, |
[ |
AC_SYS_COMPILER_FLAG([-Wl,-bstatic],wl_link_static,CFLAGS) |
LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS} -bstatic" |
]) |
|
DO_IF_OS(OSF1, |
[ |
AC_SYS_COMPILER_FLAG(-non_shared,non_shared,CFLAGS) |
LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS} -non_shared" |
]) |
|
DO_IF_OS(IRIX, |
[ |
AC_SYS_COMPILER_FLAG(-non_shared,non_shared,CFLAGS) |
LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS} -B static" |
]) |
|
# how do you link statically on HP-UX ? |
else |
: |
fi |
|
### Non-gcc thingies. This should probably be enhanced... |
|
|
if test "x$with_cdebug" = "xyes" ; then |
# FIXME: |
# Maybe should remove the -g flag if this succeeds. |
AC_SYS_COMPILER_FLAG(-g3,g3,CFLAGS) |
AC_SYS_COMPILER_FLAG(-trapuv,trapuv,WARN) |
fi |
|
# Solaris |
DO_IF_OS(Solaris, |
[ |
AC_SYS_COMPILER_FLAG(-fast,fast,OPTIMIZE,,[ |
if test "x$with_abi" = "x64"; then |
# -fast implies -xarch=native, which implies 32-bit ABI. |
AC_SYS_COMPILER_FLAG(-xtarget=generic64, xtarget_generic64, OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-xarch=generic64, xarch_generic64, OPTIMIZE) |
fi |
# -fast implies -fns, which turns off gradual underflow. |
AC_SYS_COMPILER_FLAG(-fns=no, fns_no, OPTIMIZE) |
]) |
AC_SYS_COMPILER_FLAG(-xdepend,xdepend,OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-xs,xs,CFLAGS) |
# Causes __STDC__ to be 1 which causes several headerfiles to behave |
# differently. |
# AC_SYS_OS_COMPILER_FLAG(-Xc,Xc,WARN) |
]) |
|
# AIX |
DO_IF_OS(AIX, |
[ |
# This one is needed to get the compiler to fail on errors, |
# which is needed for several configure-tests. |
AC_SYS_COMPILER_FLAG(-qhalt=e,qhalt_e,CFLAGS) |
AC_SYS_COMPILER_FLAG(-qro,qro,OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-qfold,qfold,OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-qwarn64,qwarn64,WARN) |
AC_SYS_COMPILER_FLAG(-qflag=w:w,qflag_w_w,WARN) |
AC_DEFUN(AC_SYS_COMPILER_FLAG_QINFO, [ |
AC_SYS_COMPILER_FLAG(-qinfo=$1,qinfo_$1,WARN) |
]) |
AC_SYS_COMPILER_FLAG_QINFO(cmp) |
AC_SYS_COMPILER_FLAG_QINFO(cnd) |
AC_SYS_COMPILER_FLAG_QINFO(cns) |
AC_SYS_COMPILER_FLAG_QINFO(cnv) |
AC_SYS_COMPILER_FLAG_QINFO(dcl) |
AC_SYS_COMPILER_FLAG_QINFO(eff) |
AC_SYS_COMPILER_FLAG_QINFO(enu) |
AC_SYS_COMPILER_FLAG_QINFO(ext) |
AC_SYS_COMPILER_FLAG_QINFO(gen) |
AC_SYS_COMPILER_FLAG_QINFO(gnr) |
AC_SYS_COMPILER_FLAG_QINFO(got) |
AC_SYS_COMPILER_FLAG_QINFO(ini) |
AC_SYS_COMPILER_FLAG_QINFO(inl) |
AC_SYS_COMPILER_FLAG_QINFO(lan) |
AC_SYS_COMPILER_FLAG_QINFO(obs) |
AC_SYS_COMPILER_FLAG_QINFO(ord) |
AC_SYS_COMPILER_FLAG_QINFO(par) |
AC_SYS_COMPILER_FLAG_QINFO(por) |
# ppc disabled since it complains about the system header files. |
# AC_SYS_COMPILER_FLAG_QINFO(ppc) |
# ppt disabled since tracing the preprocessor isn't interresting. |
# AC_SYS_COMPILER_FLAG_QINFO(ppt) |
AC_SYS_COMPILER_FLAG_QINFO(pro) |
AC_SYS_COMPILER_FLAG_QINFO(rea) |
AC_SYS_COMPILER_FLAG_QINFO(ret) |
# trd disabled, since it adds extra errors (in particular 1506-419). |
# AC_SYS_COMPILER_FLAG_QINFO(trd) |
AC_SYS_COMPILER_FLAG_QINFO(tru) |
AC_SYS_COMPILER_FLAG_QINFO(uni) |
AC_SYS_COMPILER_FLAG_QINFO(use) |
# AC_SYS_COMPILER_FLAG(-qalias=addr,qalias_addr,OPTIMIZE) |
# AC_SYS_COMPILER_FLAG(-qlibansi,qlibansi,OPTIMIZE) |
|
# Suppress warnings and informational messages we aren't interested in. |
AC_DEFUN(AC_SYS_COMPILER_FLAG_QSUPPRESS, [ |
AC_SYS_COMPILER_FLAG(-qsuppress=$1, |
translit([qsuppress_$1],[-:],[__]), |
ifelse([$2],,WARN,[$2])) |
]) |
# 1506-010 (W) Macro XX invoked with a null argument for parameter Z. |
AC_SYS_COMPILER_FLAG_QSUPPRESS(1506-010) |
# 1506-219 (W) #line value 40140 too large. |
AC_SYS_COMPILER_FLAG_QSUPPRESS(1506-219, CPPFLAGS) |
|
# Tell the linker to generate a large toc if needed |
# |
# This option is not needed on AIX 5L/ia64. |
if test "x`uname -p`" = "xia64"; then :; else |
AC_SYS_COMPILER_FLAG(-bbigtoc,bbigtoc,LDFLAGS) |
fi |
]) |
|
# HP-UX |
DO_IF_OS(HP-UX, |
[ |
AC_SYS_COMPILER_FLAG(-D__STDC_EXT__,stdc_ext,CFLAGS) |
AC_SYS_COMPILER_FLAG([-Wp,-H50000],cpp_buffer_size,CFLAGS) |
AC_SYS_COMPILER_FLAG(+ESlit,plus_ESlit,OPTIMIZE) |
AC_SYS_COMPILER_FLAG(+Odataprefetch,plus_Odataprefetch,OPTIMIZE) |
AC_SYS_COMPILER_FLAG(+Ofailsafe,plus_Ofailsafe,OPTIMIZE) |
# Ignore the following warnings if you enable +w1 |
# 414 Optimization reduced to +O2 for compatibility with Debug. |
# 530 Casting from loose to strict alignment |
# 558 Empty declaration. |
# AC_SYS_COMPILER_FLAG(+w1,plus_w1,WARN) |
]) |
|
# OSF/1 |
DO_IF_OS(OSF1, |
[ |
AC_SYS_COMPILER_FLAG(-fast,fast,OPTIMIZE) |
# The need for -ieee is not detected properly by the FPE tests below. |
# AC_SYS_COMPILER_FLAG(-ieee,ieee,CFLAGS) |
AC_SYS_COMPILER_FLAG(-readonly_strings,readonly_strings,OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-assume trusted_short_alignment, |
assume_trusted_short_alignment,OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-assume aligned_objects, |
assume_aligned_objects,OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-no_misalign,no_misalign,OPTIMIZE) |
|
AC_SYS_COMPILER_FLAG(-host,host,OPTIMIZE) |
|
# Flags that cause errors or change compiler behaviour |
# must go in CFLAGS, they can not go in WARN |
# /Hubbe |
AC_SYS_COMPILER_FLAG(-std1,std1,CFLAGS) |
AC_SYS_COMPILER_FLAG(-warnprotos,warnprotos,WARN) |
]) |
|
# IRIX |
DO_IF_OS(IRIX, |
[ |
# sopt disabled since it takes too long time on interpret.c (>45min on an O²) |
# AC_SYS_COMPILER_FLAG(-sopt,sopt,OPTIMIZE) |
|
# -n32 moved to smartlink so it will affect cc as well as linker |
# this way the user can override it by setting LDFLAGS and/or CFLAGS |
# AC_SYS_COMPILER_FLAG(-n32,n32,CFLAGS) |
AC_SYS_COMPILER_FLAG(-fullwarn,fullwarn,WARN) |
AC_SYS_COMPILER_FLAG(-woff 1209,woff_1209,WARN) |
AC_SYS_COMPILER_FLAG(-OPT:Olimit_opt=on,OPT_Olimit_opt_on,OPTIMIZE) |
if test x$with_cdebug = xyes ; then |
AC_SYS_COMPILER_FLAG(-g3,g3,CFLAGS) |
fi |
if test x$with_rtldebug = xyes ; then |
AC_SYS_COMPILER_FLAG(-trapuw,trapuw,WARN) |
fi |
]) |
|
# Windows NT |
DO_IF_OS(Windows_NT, |
[ |
case "x$CC" in |
*rntecl*) |
# Some options used by ecl (Intel's IA64 compiler). |
|
# We want threads, and link libc statically. |
AC_SYS_COMPILER_FLAG(-MT,MT,LDFLAGS) |
|
# Interprocedural optimizations. |
# For some reason this seems to cause the error: |
# dynamic_buffer.obj : error LNK2001: unresolved external symbol "[Entry] ?1memcpy" (.?1memcpy) |
# AC_SYS_COMPILER_FLAG(-Qip,Qip,OPTIMIZE) |
|
# More warnings. |
AC_SYS_COMPILER_FLAG(-W3,W3,WARN) |
|
if test x$with_rtldebug = xyes ; then |
# Initialize auto variables to 0xcc. |
# (Only if optimizations are turned off with -Od). |
AC_SYS_COMPILER_FLAG(-GZ,GZ,WARN) |
fi |
;; |
|
*rntcl*) |
if test x$with_debug_crt = xyes; then |
dynamic_crt_flag=-MDd |
static_crt_flag=-MTd |
else |
dynamic_crt_flag=-MD |
static_crt_flag=-MT |
fi |
;; |
esac |
|
if test x$with_dynamic_modules != xno; then |
pike_cv_sys_dynamic_loading=yes |
if test x$enable_dll != xyes; then |
PIKE_MSG_NOTE([Enabling dynamic modules for Win32.]) |
# EXTRA_MODULE_REQUIREMENTS="${EXTRA_MODULE_REQUIREMENTS} import_functions.h" |
DLOPEN_O="dlopen.o" |
AC_DEFINE(USE_MY_WIN32_DLOPEN) |
fi |
fi |
]) |
|
dnl |
dnl This does not work with Digital UNIX cc/ld (cc thinks it is ok, ld does not) |
dnl |
dnl AC_SYS_COMPILER_FLAG(-native,native,OPTIMIZE) |
dnl |
|
dnl ### Ok. This is for apcc... |
case "$CC" in |
*apcc) |
AC_SYS_COMPILER_FLAG(-XO=5,apcc_opt,OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-Xcallmod=2,apcc_opt_2,OPTIMIZE) |
;; |
esac |
|
# Old cc for solaris. |
# AC_SYS_CPU_COMPILER_FLAG(sun4m,-Xpipe=micro,microsparc,OPTIMIZE) |
# AC_SYS_CPU_COMPILER_FLAG(sun4d,-Xpipe=super,supersparc,OPTIMIZE) |
# AC_SYS_CPU_COMPILER_FLAG(sun4u,-Xpipe=super,ultrasparc,OPTIMIZE) |
|
case "${CFLAGS-} $OPTIMIZE" in |
*-O*) ;; |
*+O*) ;; |
*-fast*) ;; |
*) |
case "$pike_cv_sys_os:$GCC" in |
UnixWare*:no|OpenUNIX*:no) |
;; |
*) |
;; |
esac |
;; |
esac |
fi |
|
if test "$ICC" = "yes"; then |
# icc or ecc. |
|
# Modern versions of icc and ecc claim to be gcc, so we need to have |
# this outside the main if-else segment. |
|
DO_IF_OS(Linux, |
[ |
# Linux with Intel C++ |
|
# Disable excessive warnings from Linux's header files: |
# warning #1292: attribute "__nothrow__" ignored |
AC_SYS_COMPILER_FLAG(-wd1292,wd1292,WARN) |
# And from Pike: |
# remark #177: function "MKPCHARP" was declared but never referenced |
AC_SYS_COMPILER_FLAG(-wd177,wd177,WARN) |
# remark #279: controlling expression is constant |
AC_SYS_COMPILER_FLAG(-wd279,wd279,WARN) |
# remark #869: parameter was never referenced |
AC_SYS_COMPILER_FLAG(-wd869,wd869,WARN) |
|
AC_SYS_COMPILER_FLAG(-Ob2,Ob2,OPTIMIZE) |
AC_SYS_COMPILER_FLAG(-ip,ip,OPTIMIZE) |
# Iterprocedural optimization accross object files. |
# This slows down the compiler quite a bit with Pike's |
# large number of object files. |
# AC_SYS_COMPILER_FLAG(-ipo,ipo,OPTIMIZE) |
# AC_SYS_COMPILER_FLAG(-ipo,ipo,EXTRALDFLAGS) |
# AC_SYS_COMPILER_FLAG(-ipo_obj,ipo_obj,OPTIMIZE) |
# -parallel seems to generate broken code with icc 8.0/ia64. |
# AC_SYS_COMPILER_FLAG(-parallel, parallel,OPTIMIZE) |
# AC_SYS_COMPILER_FLAG(-parallel, parallel,LDFLAGS) |
# arch dependent optimizations while maintaining |
# i386 compatibility |
AC_SYS_COMPILER_FLAG(-axKW,axKW,OPTIMIZE) |
]) |
fi |
else |
# CFLAGS has already been set by the user. |
# Avoid adding anything that isn't essential. |
DO_IF_OS(AIX, |
[ |
# This one is needed to get the compiler to fail on errors, |
# which is needed for several configure-tests. |
AC_SYS_COMPILER_FLAG(-qhalt=e,qhalt_e,CFLAGS) |
]) |
fi |
|
AC_SUBST(DLOPEN_O) |
|
AC_MSG_CHECKING([crc32 intrinsics]) |
AC_CACHE_VAL(pike_cv_sys_have_crc_intrinsics,[ |
AC_TRY_LINK([ |
__attribute__((target("sse4"))) int c(int a) { |
return __builtin_ia32_crc32si(0,a); |
}],[ |
return c(0); |
], |
[pike_cv_sys_have_crc_intrinsics=yes], |
[pike_cv_sys_have_crc_intrinsics=no]) |
]) |
AC_MSG_RESULT($pike_cv_sys_have_crc_intrinsics) |
|
if test "x$pike_cv_sys_have_crc_intrinsics" = "xyes" ; then |
AC_DEFINE(HAVE_CRC32_INTRINSICS,[], [True if crc32 intrinsics are available]) |
fi |
|
############################################################################# |
|
# Script to translate from POSIX paths to native paths. |
echo "Creating posix_to_native.sh..." |
if test "x$PIKE_PATH_TRANSLATE" = "x"; then |
if test "x$pike_cv_is_mingw" = "xyes"; then |
# MinGW system. |
cat <<\EOF |
#!/bin/sh |
# Automatically generated by $Id$. |
# MinGW-version. Do NOT edit. |
posix_name="`cat`" |
posix_prefix="/" |
native_prefix="/" |
case "$posix_name" in |
/*) ;; |
*) posix_name="`pwd`/$posix_name" ;; |
esac |
case "$posix_name" in |
EOF |
# Split and recombine the lines. |
# Sort the lines according to longest path first. |
# Convert backslashes to forward slashes. |
# Escape spaces, tabs and dollars. |
# Note, dollars must be escaped both for sed, sh and sed. |
# Split, and generate the case entries. |
# Remove any duplicate sequences of slashes. |
mount | \ |
sed -e 's/\(.*\) on \(.*\) type user.*/\2 _split_ \1/p' -ed | \ |
sort -r | \ |
sed -e 's/\\/\//g' | \ |
sed -e 's/\([[ ]]\)/\\\1/g' -e 's/\$/\\\\\\\$/g' | \ |
sed -e 's/\(.*\)\\ _split_\\ \(.*\)/ \1|\1\/*)\ |
posix_prefix=\1\ |
native_prefix=\2\/\ |
\;\;/p' -ed | \ |
sed -e 's/\/\//\//g' |
cat <<\EOF |
esac |
echo "$posix_name" | \ |
sed -e "s,^$posix_prefix,$native_prefix," | \ |
sed -e 's/\/\//\//g' |
EOF |
else |
# Native POSIX system. |
cat <<\EOF |
#!/bin/sh |
# Automatically generated by $Id$. |
# POSIX-version. Do NOT edit. |
cat |
EOF |
fi |
else |
# rntcl-style |
cat <<\EOF |
#!/bin/sh |
# Automatically generated by $Id$. |
# RNTCL-version. Do NOT edit. |
sed -e "$PIKE_PATH_TRANSLATE" |
EOF |
fi >posix_to_native.sh |
|
chmod a+x posix_to_native.sh |
|
############################################################################# |
|
if test ! -d modules/. ; then |
mkdir modules |
fi |
|
############################################################################# |
|
## Search for some popular places where libraries may b |