1
dnl Copyright (C) 2005-2006 IOhannes m zm�lnig
2
dnl This file is free software; IOhannes m zm�lnig
3
dnl gives unlimited permission to copy and/or distribute it,
4
dnl with or without modifications, as long as this notice is preserved.
6
# AC_CHECK_CXXFLAGS(ADDITIONAL-CXXFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
8
# checks whether the $(CXX) compiler accepts the ADDITIONAL-CXXFLAGS
9
# if so, they are added to the CXXFLAGS
10
AC_DEFUN([AC_CHECK_CXXFLAGS],
12
AC_MSG_CHECKING([whether $CXX accepts "$1"])
13
cat > conftest.c++ << EOF
18
if $CXX $CPPFLAGS $CXXFLAGS -o conftest.o conftest.c++ [$1] > /dev/null 2>&1
21
CXXFLAGS="${CXXFLAGS} [$1]"
29
# AC_CHECK_CFLAGS(ADDITIONAL-CFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
31
# checks whether the $(C) compiler accepts the ADDITIONAL-CFLAGS
32
# if so, they are added to the CFLAGS
33
AC_DEFUN([AC_CHECK_CFLAGS],
35
AC_MSG_CHECKING([whether $CC accepts "$1"])
36
cat > conftest.c << EOF
41
if $CC $CFLAGS [$1] -o conftest.o conftest.c > /dev/null 2>&1
44
CFLAGS="${CFLAGS} [$1]"
52
# AC_CHECK_FRAMEWORK(FRAMEWORK, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
55
AC_DEFUN([AC_CHECK_FRAMEWORK],
57
AC_MSG_CHECKING([for "$1"-framework])
59
temp_check_ldflags_org="${LDFLAGS}"
60
LDFLAGS="-framework [$1] ${LDFLAGS}"
62
AC_LINK_IFELSE(AC_LANG_PROGRAM(,), [temp_check_ldflags_success="yes"],[temp_check_ldflags_success="no"])
64
if test "x$temp_check_ldflags_success" = "xyes"; then
69
LDFLAGS="$temp_check_ldflags_org"
72
])# AC_CHECK_FRAMEWORK
74
# AC_CHECK_LDFLAGS(ADDITIONAL-LDFLAGS, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
76
# checks whether the $(LD) linker accepts the ADDITIONAL-LDFLAGS
77
# if so, they are added to the LDFLAGS
78
AC_DEFUN([AC_CHECK_LDFLAGS],
80
AC_MSG_CHECKING([whether linker accepts "$1"])
81
temp_check_ldflags_org="${LDFLAGS}"
82
LDFLAGS="$1 ${LDFLAGS}"
84
AC_LINK_IFELSE(AC_LANG_PROGRAM(,), [temp_check_ldflags_success="yes"],[temp_check_ldflags_success="no"])
86
if test "x$temp_check_ldflags_success" = "xyes"; then
91
LDFLAGS="$temp_check_ldflags_org"