diff options
Diffstat (limited to 'm4')
-rw-r--r-- | m4/attributes.m4 | 42 | ||||
-rw-r--r-- | m4/optimizations.m4 | 9 | ||||
-rw-r--r-- | m4/pthreads.m4 | 10 | ||||
-rw-r--r-- | m4/xv.m4 | 5 |
4 files changed, 56 insertions, 10 deletions
diff --git a/m4/attributes.m4 b/m4/attributes.m4 index eaa788c5f..23b5f2ee4 100644 --- a/m4/attributes.m4 +++ b/m4/attributes.m4 @@ -119,7 +119,7 @@ AC_DEFUN([CC_ATTRIBUTE_FORMAT_ARG], [ AC_CACHE_CHECK([if compiler supports __attribute__((format_arg(printf)))], [cc_cv_attribute_format_arg], [AC_COMPILE_IFELSE([ - void __attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; } + char *__attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; } ], [cc_cv_attribute_format_arg=yes], [cc_cv_attribute_format_arg=no]) @@ -322,3 +322,43 @@ AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [ [Define the highest alignment supported]) fi ]) + +AC_DEFUN([CC_ATTRIBUTE_PACKED], [ + AC_REQUIRE([CC_CHECK_WERROR]) + AC_CACHE_CHECK([if $CC supports __attribute__((packed))], + [cc_cv_attribute_packed], + [ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $cc_cv_werror" + AC_COMPILE_IFELSE([struct { char a; short b; int c; } __attribute__((packed)) foo;], + [cc_cv_attribute_packed=yes], + [cc_cv_attribute_packed=no]) + CFLAGS="$ac_save_CFLAGS" + ]) + + if test x$cc_cv_attribute_packed = xyes; then + AC_DEFINE([SUPPORT_ATTRIBUTE_PACKED], 1, [Define this if the compiler supports __attribute__((packed))]) + ifelse([$1], , [:], [$1]) + else + ifelse([$2], , [:], [$2]) + fi +]) + +AC_DEFUN([CC_ATTRIBUTE_MALLOC], [ + AC_REQUIRE([CC_CHECK_WERROR]) + AC_CACHE_CHECK([if $CC supports __attribute__((__malloc__))], + [cc_cv_attribute_malloc], + [ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $cc_cv_werror" + AC_COMPILE_IFELSE([void *fooalloc(int size) __attribute__((__malloc__));], + [cc_cv_attribute_malloc=yes], + [cc_cv_attribute_malloc=no]) + CFLAGS="$ac_save_CFLAGS" + ]) + + if test x$cc_cv_attribute_malloc = xyes; then + AC_DEFINE([SUPPORT_ATTRIBUTE_MALLOC], 1, [Define this if the compiler supports __attribute__((__malloc__))]) + ifelse([$1], , [:], [$1]) + else + ifelse([$2], , [:], [$2]) + fi +]) diff --git a/m4/optimizations.m4 b/m4/optimizations.m4 index a1f2f2f00..cc5e7c524 100644 --- a/m4/optimizations.m4 +++ b/m4/optimizations.m4 @@ -74,7 +74,13 @@ AC_DEFUN([AC_OPTIMIZATIONS], [ CFLAGS="$wall ${CFLAGS}" DEBUG_CFLAGS="$wall ${DEBUG_CFLAGS}" - case "$host_or_hostalias" in + if test "$enable_macosx_universal"; then + optimize_for_host="universal-darwin" + else + optimize_for_host="$host_or_hostalias" + fi + + case "$optimize_for_host" in i?86-* | k?-* | athlon-* | pentium*) if test "$GCC" = yes -o "${CC##*/}x" = "iccx" ; then @@ -182,6 +188,7 @@ AC_DEFUN([AC_OPTIMIZATIONS], [ ;; *darwin*) CFLAGS="-O3 -pipe -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si -ffast-math $INLINE_FUNCTIONS -no-cpp-precomp -D_INTL_REDIRECT_MACROS $CFLAGS" + OBJCFLAGS="-O3 -pipe -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si -ffast-math $INLINE_FUNCTIONS -no-cpp-precomp -D_INTL_REDIRECT_MACROS $CFLAGS" DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS" ;; ppc-*-linux* | powerpc-*) diff --git a/m4/pthreads.m4 b/m4/pthreads.m4 index 28d72dd4f..363a8b4b2 100644 --- a/m4/pthreads.m4 +++ b/m4/pthreads.m4 @@ -36,11 +36,15 @@ AC_DEFUN([CC_PTHREAD_FLAGS], [ [ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $cc_cv_werror $PTHREAD_CFLAGS" + LIBS="$LIBS $PTHREAD_LIBS" - AC_COMPILE_IFELSE( + AC_LINK_IFELSE( [AC_LANG_PROGRAM( - [[#include <pthread.h>]], - [[pthread_create(NULL, NULL, NULL, NULL);]] + [[#include <pthread.h> + void *fakethread(void *arg) { return NULL; } + pthread_t fakevariable; + ]], + [[pthread_create(&fakevariable, NULL, &fakethread, NULL);]] )], [cc_cv_pthreads=yes], [cc_cv_pthreads=no]) @@ -68,11 +68,6 @@ AC_DEFUN([AC_FIND_LIBXV], # Ensure that AC_PATH_XTRA is executed before this AC_REQUIRE([AC_PATH_XTRA]) - # Set xv_path if its not done already - if test x$xv_path = x; then - xv_path=`echo $X_LIBS | sed -e 's/\-L\(.*\)/\1/'` - fi - if test x$xv_path = x; then xv_path=/usr/X11R6/lib fi |