1 dnl Copyright (C) 2009 Sun Microsystems
2 dnl This file is free software; Sun Microsystems
3 dnl gives unlimited permission to copy and/or distribute it,
4 dnl with or without modifications, as long as this notice is preserved.
6 dnl ---------------------------------------------------------------------------
7 dnl Macro: PANDORA_64BIT
8 dnl ---------------------------------------------------------------------------
9 AC_DEFUN([PANDORA_64BIT],[
10 AC_BEFORE([$0], [AC_LIB_PREFIX])
12 AC_ARG_ENABLE([64bit],
13 [AS_HELP_STRING([--disable-64bit],
14 [Build 64 bit binary @<:@default=on@:>@])],
15 [ac_enable_64bit="$enableval"],
16 [ac_enable_64bit="yes"])
18 AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
19 AS_IF([test "x$ISAINFO" != "xno"],
20 [isainfo_b=`${ISAINFO} -b`],
23 AS_IF([test "$isainfo_b" != "x"],[
25 isainfo_k=`${ISAINFO} -k`
26 DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_b}"
28 AS_IF([test "x$ac_enable_64bit" = "xyes"],[
30 AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
31 LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}"
34 AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[
35 dnl The user hasn't overridden the default libdir, so we'll
36 dnl the dir suffix to match solaris 32/64-bit policy
37 libdir="${libdir}/${isainfo_k}"
40 AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],[
41 CFLAGS="${CFLAGS} -m64"
42 ac_cv_env_CFLAGS_set=set
43 ac_cv_env_CFLAGS_value='-m64'
45 AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[
46 CXXFLAGS="${CXXFLAGS} -m64"
47 ac_cv_env_CXXFLAGS_set=set
48 ac_cv_env_CXXFLAGS_value='-m64'
51 AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"],[
52 AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}"
53 AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}"
58 dnl ---------------------------------------------------------------------------
59 dnl End Macro: PANDORA_64BIT
60 dnl ---------------------------------------------------------------------------