AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_SRCDIR([ustctl/ustctl.c])
-AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_HEADERS([config.h include/ust/config.h])
+AH_TEMPLATE([HAVE_EFFICIENT_UNALIGNED_ACCESS], [Use efficient unaligned access.])
# Checks for programs.
AC_PROG_CC
ppc64) LIBFORMAT="elf64-powerpc" ;;
s390) LIBFORMAT="elf32-s390" ;;
s390x) LIBFORMAT="elf64-s390" ;;
+ armv5) LIBFORMAT="elf32-littlearm"; NO_UNALIGNED_ACCESS=1 ;;
arm) LIBFORMAT="elf32-littlearm" ;;
mips*) LIBFORMAT="" ;;
*) AC_MSG_ERROR([unable to detect library format (unsupported architecture ($host_cpu)?)]) ;;
AC_SUBST(LIBFORMAT)
AC_MSG_RESULT($LIBFORMAT)
+if test "x$host_cpu" = "xarm" ; then
+AC_MSG_CHECKING([checking for armv5])
+AC_TRY_COMPILE(
+[
+],
+[
+#ifndef __ARM_ARCH_5TEJ__
+#error "no arm5 here"
+#endif
+],
+[
+ AC_MSG_RESULT([yes])
+ NO_UNALIGNED_ACCESS=1
+]
+,
+[
+ AC_MSG_RESULT([no])
+]
+)
+fi
+if test x$NO_UNALIGNED_ACCESS = x ; then
+AC_DEFINE([HAVE_EFFICIENT_UNALIGNED_ACCESS], [1])
+fi
+
AC_CONFIG_FILES([
Makefile
doc/Makefile
--- /dev/null
+/* ust/config.h.in. Manually generated for control over the contained defs. */
+
+/* Use efficient unaligned access. */
+#undef HAVE_EFFICIENT_UNALIGNED_ACCESS
+
#define UST_CORE_H
#include <sys/types.h>
+#include <ust/config.h>
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
-#if defined(CONFIG_LTT) && defined(CONFIG_LTT_ALIGNMENT)
+#ifndef HAVE_EFFICIENT_UNALIGNED_ACCESS
/*
* Calculate the offset needed to align the type.
return sizeof(void *);
}
-#else
+#else /* HAVE_EFFICIENT_UNALIGNED_ACCESS */
static inline unsigned int ltt_align(size_t align_drift,
size_t size_of_type)
{
return 0;
}
-#endif /* defined(CONFIG_LTT) && defined(CONFIG_LTT_ALIGNMENT) */
+#endif /* HAVE_EFFICIENT_UNALIGNED_ACCESS */
/* ARRAYS */