Merge Trond.
[m6w6/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 AC_BEFORE([$0], [AC_LIB_PREFIX])
11
12
13 AC_ARG_ENABLE([64bit],[
14 AS_HELP_STRING([--disable-64bit],
15 [Build 64 bit binary @<:@default=on@:>@])],
16 [ac_enable_64bit="$enableval"],
17 [ac_enable_64bit="yes"])
18
19 AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
20 AS_IF([test "x$ISAINFO" != "xno"],
21 [isainfo_b=`${ISAINFO} -b`],
22 [isainfo_b="x"])
23
24 AS_IF([test "$isainfo_b" != "x"],[
25
26 isainfo_k=`${ISAINFO} -k`
27 DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_k}"
28
29 AS_IF([test "x${ac_cv_env_CPPFLAGS_set}" = "x"],[
30 CPPFLAGS="-I/usr/local ${CPPFLAGS}"
31 ])
32
33 AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
34 LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}"
35 ])
36
37 AS_IF([test "x$ac_enable_64bit" = "xyes"],[
38 AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[
39 dnl The user hasn't overridden the default libdir, so we'll
40 dnl the dir suffix to match solaris 32/64-bit policy
41 libdir="${libdir}/${isainfo_k}"
42 ])
43
44 CPPFLAGS="-m64 ${CPPFLAGS}"
45 LDFLAGS="-m64 ${LDFLAGS}"
46 AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"],[
47 AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}"
48 AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}"
49 ])
50 ])
51 ])
52 ])
53 dnl ---------------------------------------------------------------------------
54 dnl End Macro: PANDORA_64BIT
55 dnl ---------------------------------------------------------------------------