perl

 view release on metacpan or  search on metacpan

hints/linux.sh  view on Meta::CPAN


# SuSE Linux can be used as cross-compilation host for Cray XT4 Catamount/Qk.
if test -d /opt/xt-pe
then
  case "`${cc:-cc} -V 2>&1`" in
  *catamount*) . hints/catamount.sh; return ;;
  esac
fi

# Some operating systems (e.g., Solaris 2.6) will link to a versioned shared
# library implicitly.  For example, on Solaris, `ld foo.o -lgdbm' will find an
# appropriate version of libgdbm, if one is available; Linux, however, doesn't
# do the implicit mapping.
ignore_versioned_solibs='y'

# BSD compatibility library no longer needed
# 'kaffe' has a /usr/lib/libnet.so which is not at all relevant for perl.
# bind causes issues with several reentrant functions
set `echo X "$libswanted "| sed -e 's/ bsd / /' -e 's/ net / /' -e 's/ bind / /'`
shift
libswanted="$*"

# Debian 4.0 puts ndbm in the -lgdbm_compat library.
echo $libs
if echo " $libswanted " | grep -q ' gdbm '; then
    # Only add if gdbm is in libswanted.
    libswanted="$libswanted gdbm_compat"
fi

# Configure may fail to find lstat() since it's a static/inline
# function in <sys/stat.h>.
d_lstat=define

# malloc wrap works
case "$usemallocwrap" in
'') usemallocwrap='define' ;;
esac

# The system malloc() is about as fast and as frugal as perl's.
# Since the system malloc() has been the default since at least
# 5.001, we might as well leave it that way.  --AD  10 Jan 2002
case "$usemymalloc" in
'') usemymalloc='n' ;;
esac

uname_minus_m="`$run uname -m 2>/dev/null`"
uname_minus_m="${uname_minus_m:-"$targetarch"}"

# Check if we're about to use Intel's ICC compiler
case "`${cc:-cc} -V 2>&1`" in
*"Intel(R) C"*" Compiler"*)
    # record the version, formats:
    # icc (ICC) 10.1 20080801
    # icpc (ICC) 10.1 20080801
    # followed by a copyright on the second line
    ccversion=`${cc:-cc} --version | sed -n -e 's/^icp\?c \((ICC) \)\?//p'`
    # This is needed for Configure's prototype checks to work correctly
    # The -mp flag is needed to pass various floating point related tests
    # The -no-gcc flag is needed otherwise, icc pretends (poorly) to be gcc
    ccflags="-we147 -mp -no-gcc $ccflags"
    # Prevent relocation errors on 64bits arch
    case "$uname_minus_m" in
	*ia64*|*x86_64*)
	    cccdlflags='-fPIC'
	;;
    esac
    # If we're using ICC, we usually want the best performance
    case "$optimize" in
    '') optimize='-O3' ;;
    esac
    ;;

# the new Intel C/C++ compiler, LLVM based, replaces ICC which
# is no longer maintained from around October 2023
*"Intel(R) oneAPI DPC++/C++ Compiler"*)
    # version from end of first line, like:
    # Intel(R) oneAPI DPC++/C++ Compiler 2024.1.0 (2024.1.0.20240308)
    ccversion=`${cc:-cc} --version | sed -n -e 's/^Intel.*(\(.*\))/\1/p'`
    # If we're using ICX, we usually want the best performance
    case "$optimize" in
    '') optimize='-O3' ;;
    esac
    # fp-model defaults to "fast" which mis-handles NaNs
    ccflags="-fp-model=precise $ccflags"
    ;;

*" Sun "*"C"*)
    # Sun's C compiler, which might have a 'tag' name between
    # 'Sun' and the 'C':  Examples:
    # cc: Sun C 5.9 Linux_i386 Patch 124871-01 2007/07/31
    # cc: Sun Ceres C 5.10 Linux_i386 2008/07/10
    # cc: Studio 12.6 Sun C 5.15 Linux_i386 2017/05/30
    # GH #21535 - apparent optimization bug in workshop cc
    test "$optimize" || optimize='-O1'
    cccdlflags='-KPIC'
    lddlflags='-G -Bdynamic'
    # Sun C doesn't support gcc attributes, but, in many cases, doesn't
    # complain either.  Not all cases, though.
    d_attribute_format='undef'
    d_attribute_malloc='undef'
    d_attribute_nonnull='undef'
    d_attribute_noreturn='undef'
    d_attribute_pure='undef'
    d_attribute_unused='undef'
    d_attribute_warn_unused_result='undef'
    case "$cc" in
    *c99)   # Without -Xa c99 errors on some Linux system headers
            # in particular zero sized arrays at the end of structs
	    case "$ccflags" in
		*-Xa*)	;;
		*) ccflags="$ccflags -Xa" ;;
	    esac
	    ;;
    esac
    ;;
esac

case "$optimize" in
# use -O2 by default ; -O3 doesn't seem to bring significant benefits with gcc
'')
    optimize='-O2'



( run in 0.671 second using v1.01-cache-2.11-cpan-5511b514fd6 )