Changeset 18 for trunk/aclocal.m4
- Timestamp:
- Jan 28, 2006, 9:07:52 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/aclocal.m4
r1 r18 1202 1202 ])dnl 1203 1203 1204 dnl checks for a known 64 bit programming environment 1205 dnl AC_RUN_IFELSE(PROGRAM, 1206 dnl [ACTION-IF-TRUE], [ACTION-IF-FALSE], 1207 dnl [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR]) 1208 dnl 1209 AC_DEFUN([SAMHAIN_PRG_ENV],[ 1210 AC_MSG_CHECKING([for a known 64 bit programming environment]) 1211 # Compile and run a program that determines the programming environment 1212 AC_RUN_IFELSE([ 1213 AC_LANG_SOURCE([[ 1214 #include <stdio.h> 1215 int main(int argc,char **argv) 1216 { 1217 if (argc > 1) { 1218 #if defined(__arch64__) 1219 printf("__arch64__\n"); 1220 #elif defined(__ia64__) 1221 printf("__ia64__\n"); 1222 #elif defined(__x86_64__) 1223 printf("__x86_64__\n"); 1224 #elif defined(__LP64__) 1225 printf("__LP64__\n"); 1226 #elif defined(__64BIT__) 1227 printf("__64BIT__\n"); 1228 #elif defined(_LP64) 1229 printf("_LP64\n"); 1230 #elif defined(_M_IA64) 1231 printf("_M_IA64\n"); 1232 #elif defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64) 1233 printf("_MIPS_64\n"); 1234 #else 1235 choke me 1236 #endif 1237 } 1238 return 0; 1239 } 1240 ]]) 1241 ],[ 1242 # Program compiled and ran, so get version by adding argument. 1243 samhain_prg_ENV=`./conftest$ac_exeext x` 1244 samhain_64=yes 1245 AC_MSG_RESULT([$samhain_prg_ENV]) 1246 ],[ 1247 AC_MSG_RESULT([none]) 1248 ],[ 1249 AC_MSG_RESULT([none]) 1250 ]) 1251 ])dnl 1252 1253 AC_DEFUN([SAMHAIN_X86_64],[ 1254 AC_MSG_CHECKING([for x86_64]) 1255 AC_TRY_RUN([ 1256 int main() { 1257 __asm__ volatile ( 1258 "movq %rax, %rax" 1259 ); 1260 return 0; 1261 } 1262 ], 1263 [ 1264 AC_MSG_RESULT(yes) 1265 samhain_64=yes 1266 tiger_src=sh_tiger1_64.c 1267 AC_DEFINE([TIGER_OPT_ASM],1,[Define to use tiger x86_64 optimized assembly]) 1268 ], 1269 [ 1270 AC_MSG_RESULT([no]) 1271 ],[ 1272 AC_MSG_RESULT([no]) 1273 ]) 1274 ])dnl 1275 1276 1277 AC_DEFUN([SAMHAIN_64],[ 1278 samhain_64=no 1279 tiger_src=sh_tiger1.c 1280 # 1281 # if sizeof(unsigned long) = 4, try compiler macros for 64bit 1282 # 1283 if test "x$ac_cv_sizeof_unsigned_long" = x4; then 1284 if test "x$ac_cv_sizeof_unsigned_long_long" = x8; then 1285 SAMHAIN_PRG_ENV 1286 if test "x$samhain_64" = xyes; then 1287 tiger_src=sh_tiger1_64.c 1288 fi 1289 # 1290 # if GCC and __i386__, use precompiled assembler 1291 # 1292 if test "x$GCC" = xyes; then 1293 AC_MSG_CHECKING([for i386]) 1294 samhain_i386=no 1295 touch conf_foo.h 1296 $CC -E -dM conf_foo.h | egrep '__i386__' >/dev/null 2>&1 && samhain_i386=yes 1297 rm -f conf_foo.h 1298 if test "x$samhain_i386" = xyes; then 1299 tiger_src=sh_tiger1.s 1300 AC_DEFINE([TIGER_32_BIT_S],1,[Define to use tiger 32 bit i386 assembler]) 1301 fi 1302 AC_MSG_RESULT([$samhain_i386]) 1303 fi 1304 # 1305 # 1306 # 1307 else 1308 samhain_64=no 1309 tiger_src=sh_tiger1.c 1310 fi 1311 else 1312 # 1313 # sizeof(unsigned long) = 8 1314 # 1315 tiger_src=sh_tiger1_64.c 1316 samhain_64=yes 1317 # 1318 # check for x86_64 (enables assembly optimizations) 1319 # 1320 if test "x$GCC" = xyes; then 1321 SAMHAIN_X86_64 1322 fi 1323 fi 1324 if test "x$samhain_64" = xyes; then 1325 AC_DEFINE([TIGER_64_BIT],1,[Define to use tiger 64 bit implementation]) 1326 fi 1327 AC_MSG_CHECKING([for 64 bit environment]) 1328 AC_MSG_RESULT([$samhain_64]) 1329 AC_MSG_CHECKING([for tiger source to use]) 1330 AC_MSG_RESULT([$tiger_src]) 1331 AC_SUBST(tiger_src) 1332 ])dnl 1333 1334 1204 1335 dnl Autoconf macros for libprelude 1205 1336 dnl $id$
Note:
See TracChangeset
for help on using the changeset viewer.