aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 19 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 3d93d12..3a2d511 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,12 @@ case $host_os in
45 *) ;; 45 *) ;;
46esac 46esac
47 47
48case $host_cpu in
49 *sparc*)
50 CFLAGS="$CFLAGS -D__STRICT_ALIGNMENT"
51 ;;
52esac
53
48AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin]) 54AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin])
49AM_CONDITIONAL([HOST_FREEBSD], [test x$HOST_OS = xfreebsd]) 55AM_CONDITIONAL([HOST_FREEBSD], [test x$HOST_OS = xfreebsd])
50AM_CONDITIONAL([HOST_LINUX], [test x$HOST_OS = xlinux]) 56AM_CONDITIONAL([HOST_LINUX], [test x$HOST_OS = xlinux])
@@ -57,7 +63,6 @@ AC_CHECK_FUNC([clock_gettime],,
57AC_CHECK_FUNC([dl_iterate_phdr],, 63AC_CHECK_FUNC([dl_iterate_phdr],,
58 [AC_SEARCH_LIBS([dl_iterate_phdr],[dl])]) 64 [AC_SEARCH_LIBS([dl_iterate_phdr],[dl])])
59 65
60AM_PROG_AS
61AC_PROG_CC 66AC_PROG_CC
62AC_PROG_LIBTOOL 67AC_PROG_LIBTOOL
63AC_PROG_CC_STDC 68AC_PROG_CC_STDC
@@ -73,6 +78,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
73 [CLANG=no] 78 [CLANG=no]
74) 79)
75AC_MSG_RESULT([CLANG]) 80AC_MSG_RESULT([CLANG])
81AS_IF([test "x$CLANG" == "xyes"], [CLANG_FLAGS=-Qunused-arguments])
76 82
77# We want to check for compiler flag support, but there is no way to make 83# We want to check for compiler flag support, but there is no way to make
78# clang's "argument unused" warning fatal. So we invoke the compiler through a 84# clang's "argument unused" warning fatal. So we invoke the compiler through a
@@ -146,9 +152,18 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
146) 152)
147CFLAGS="$save_cflags $AM_CFLAGS" 153CFLAGS="$save_cflags $AM_CFLAGS"
148 154
149# TODO: note CFLAGS=...CLANG_CFLAGS has no effect since the latter is undefined 155save_cflags="$CFLAGS"
150# investigate its effect 156CFLAGS=
151AS_IF([test "x$CLANG" == "xyes"], [CLANG_FLAGS=-Qunused-arguments]) 157AC_MSG_CHECKING([whether AS supports .note.GNU-stack])
158AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
159__asm__(".section .note.GNU-stack,\"\",@progbits");]])],
160 [AC_MSG_RESULT([yes])]
161 [AM_CFLAGS=-DHAVE_GNU_STACK],
162 [AC_MSG_RESULT([no])]
163)
164CFLAGS="$save_cflags $AM_CFLAGS"
165AM_PROG_AS
166
152CFLAGS="$CFLAGS $CLANG_CFLAGS" 167CFLAGS="$CFLAGS $CLANG_CFLAGS"
153LDFLAGS="$LDFLAGS $CLANG_FLAGS" 168LDFLAGS="$LDFLAGS $CLANG_FLAGS"
154 169