Fix for sasl compile.
[m6w6/libmemcached] / m4 / pandora_64bit.m4
1 dnl Copyright (C) 2009 Sun Microsystems, Inc.
2 dnl This file is free software; Sun Microsystems, Inc.
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 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"])
17
18 AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
19 AS_IF([test "x$ISAINFO" != "xno"],
20 [isainfo_b=`${ISAINFO} -b`],
21 [isainfo_b="x"])
22
23 AS_IF([test "$isainfo_b" != "x" -a "$isainfo_b" != "32"],[
24
25 isainfo_k=`${ISAINFO} -k`
26 DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_b}"
27
28 AS_IF([test "x$ac_enable_64bit" = "xyes"],[
29
30 AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[
31 LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}"
32 ])
33
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}"
38 ])
39
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'
44 ])
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'
49 ])
50
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}"
54 ])
55 ])
56 ])
57 ])
58 dnl ---------------------------------------------------------------------------
59 dnl End Macro: PANDORA_64BIT
60 dnl ---------------------------------------------------------------------------