pandora-build v0.1
[awesomized/libmemcached] / m4 / pandora_64bit.m4
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.
5
6 dnl ---------------------------------------------------------------------------
7 dnl Macro: PANDORA_64BIT
8 dnl ---------------------------------------------------------------------------
9 AC_DEFUN([PANDORA_64BIT],[
10
11 AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
12 AS_IF([test "x$ISAINFO" != "xno"],
13 [isainfo_b=`${ISAINFO} -b`],
14 [isainfo_b="x"])
15
16 AS_IF([test "$isainfo_b" != "x"],
17 [AC_ARG_ENABLE([64bit],
18 [AS_HELP_STRING([--disable-64bit],
19 [Build 64 bit binary @<:@default=on@:>@])],
20 [ac_enable_64bit="$enableval"],
21 [ac_enable_64bit="yes"])])
22
23 AS_IF([test "x$ac_enable_64bit" = "xyes"],[
24 if test "x$libdir" = "x\${exec_prefix}/lib" ; then
25 # The user hasn't overridden the default libdir, so we'll
26 # the dir suffix to match solaris 32/64-bit policy
27 isainfo_k=`${ISAINFO} -k`
28 libdir="${libdir}/${isainfo_k}"
29 fi
30 CPPFLAGS="-m64 ${CPPFLAGS}"
31 LDFLAGS="-m64 ${LDFLAGS}"
32 DTRACEFLAGS="${DTRACEFLAGS} -64"
33 if test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"
34 then
35 AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}"
36 AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}"
37 fi
38 ],[DTRACEFLAGS="${DTRACEFLAGS} -32"])
39 ])
40 dnl ---------------------------------------------------------------------------
41 dnl End Macro: PANDORA_64BIT
42 dnl ---------------------------------------------------------------------------