3 dnl Determine if the platform can handle 64 bit binaries
5 dnl Assumes AC_CANONICAL_SYSTEM has already been called
6 dnl assumes we are on a 32bit system
13 rc=`lsconf -k | grep -c 64-bit`
14 if test $rc -eq 1; then
28 rc=`isainfo -v | grep -c 64-bit`
29 if test $rc -eq 1; then
38 if test "$mach" = "x86_64" -o "$mach" = "ia86" -o "$mach" = "alpha" -o "$mach" = "ppc64"; then
53 dnl ---------------------- check 32/64 bit -----------------------
54 dnl allow --with-32bit to ensure that 32bit libraries are used
56 [ --enable-32bit specify if 32bit libraries are to be used],
60 dnl allow --with-64bit to ensure that 64bit libraries are used
62 [ --enable-64bit specify if 64bit libraries are to be used],
67 if test "x$bitflag32" = "xyes" -a "x$bitflag64" = "xyes"; then
68 AC_MSG_ERROR(--enable-32bit and --enable-64bit flags cannot both be specified.)
71 if test "x$bitflag64" = "xyes" -a "$osis64bit" = "no"; then
72 AC_MSG_ERROR(--enable-64bit cannot be specified on non-64bit OS.)
76 if test "x$bitflag32" = "xyes"; then
78 if test "$osis64bit" = "yes"; then
81 elif test "x$bitflag64" = "xyes"; then
85 dnl following variable used to name 32bit binaries on a 64bit system
86 dnl allows 32bit and 64bit binaries t co-exist on a 64bit system
87 AC_SUBST(binarybitprefix)
90 dnl Now set the correct compiler flags
92 if test "$ac_cv_prog_CC" = "gcc" -o "$ac_cv_prog_CC" = "g++"; then
93 if test "$bitflag" = "32"; then
94 CFLAGS="${CFLAGS} -m32"
95 LDFLAGS="${LDFLAGS} -m32"
96 elif test "$bitflag" = "64"; then
97 CFLAGS="${CFLAGS} -m64"
98 LDFLAGS="${LDFLAGS} -m64"
102 elif test "$ac_cv_prog_CC" = "xlc" -o "$ac_cv_prog_CC" = "xlC"; then
103 if test "$bitflag" = "32"; then
104 CFLAGS="${CFLAGS} -q32"
105 LDFLAGS="${LDFLAGS} -q32"
106 elif test "$bitflag" = "64"; then
107 CFLAGS="${CFLAGS} -q64"
108 LDFLAGS="${LDFLAGS} -q64"
115 dnl If the user hasn't specified libdir, check if there is a /usr/lib32 or /usr/lib64
117 if test "$libdir" = '${exec_prefix}/lib'; then
118 if test "$osis64bit" = "yes"; then
119 if test -d "/usr/lib64"; then
120 libdir64='${exec_prefix}/lib64'
121 libdir32='${exec_prefix}/lib'
122 elif test -d "/usr/lib32"; then
123 libdir32='${exec_prefix}/lib32'
124 libdir64='${exec_prefix}/lib'
126 libdir64='${exec_prefix}/lib64'
127 libdir32='${exec_prefix}/lib'
130 libdir64='${exec_prefix}/lib'
131 libdir32='${exec_prefix}/lib'
133 if test "$bitflag" = "64"; then