AC_DEFUN([_XC_CHECK_VAR_LIBS], [
xc_bad_var_libs=no
for xc_word in $LIBS; do
case "$xc_word" in
-l* | --library=*)
:
;;
*)
xc_bad_var_libs=yes
;;
esac
done
if test $xc_bad_var_libs = yes; then
AC_MSG_NOTICE([using LIBS: $LIBS])
AC_MSG_NOTICE([LIBS error: LIBS may only be used to specify libraries (-lname).])
fi
])
AC_DEFUN([_XC_CHECK_VAR_LDFLAGS], [
xc_bad_var_ldflags=no
for xc_word in $LDFLAGS; do
case "$xc_word" in
-D*)
xc_bad_var_ldflags=yes
;;
-U*)
xc_bad_var_ldflags=yes
;;
-I*)
xc_bad_var_ldflags=yes
;;
-l* | --library=*)
xc_bad_var_ldflags=yes
;;
esac
done
if test $xc_bad_var_ldflags = yes; then
AC_MSG_NOTICE([using LDFLAGS: $LDFLAGS])
xc_bad_var_msg="LDFLAGS error: LDFLAGS may only be used to specify linker flags, not"
for xc_word in $LDFLAGS; do
case "$xc_word" in
-D*)
AC_MSG_NOTICE([$xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word])
;;
-U*)
AC_MSG_NOTICE([$xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word])
;;
-I*)
AC_MSG_NOTICE([$xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word])
;;
-l* | --library=*)
AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word])
;;
esac
done
fi
])
AC_DEFUN([_XC_CHECK_VAR_CPPFLAGS], [
xc_bad_var_cppflags=no
for xc_word in $CPPFLAGS; do
case "$xc_word" in
-rpath*)
xc_bad_var_cppflags=yes
;;
-L* | --library-path=*)
xc_bad_var_cppflags=yes
;;
-l* | --library=*)
xc_bad_var_cppflags=yes
;;
esac
done
if test $xc_bad_var_cppflags = yes; then
AC_MSG_NOTICE([using CPPFLAGS: $CPPFLAGS])
xc_bad_var_msg="CPPFLAGS error: CPPFLAGS may only be used to specify C preprocessor flags, not"
for xc_word in $CPPFLAGS; do
case "$xc_word" in
-rpath*)
AC_MSG_NOTICE([$xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word])
;;
-L* | --library-path=*)
AC_MSG_NOTICE([$xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word])
;;
-l* | --library=*)
AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word])
;;
esac
done
fi
])
AC_DEFUN([_XC_CHECK_VAR_CFLAGS], [
xc_bad_var_cflags=no
for xc_word in $CFLAGS; do
case "$xc_word" in
-D*)
xc_bad_var_cflags=yes
;;
-U*)
xc_bad_var_cflags=yes
;;
-I*)
xc_bad_var_cflags=yes
;;
-rpath*)
xc_bad_var_cflags=yes
;;
-L* | --library-path=*)
xc_bad_var_cflags=yes
;;
-l* | --library=*)
xc_bad_var_cflags=yes
;;
esac
done
if test $xc_bad_var_cflags = yes; then
AC_MSG_NOTICE([using CFLAGS: $CFLAGS])
xc_bad_var_msg="CFLAGS error: CFLAGS may only be used to specify C compiler flags, not"
for xc_word in $CFLAGS; do
case "$xc_word" in
-D*)
AC_MSG_NOTICE([$xc_bad_var_msg macro definitions. Use CPPFLAGS for: $xc_word])
;;
-U*)
AC_MSG_NOTICE([$xc_bad_var_msg macro suppressions. Use CPPFLAGS for: $xc_word])
;;
-I*)
AC_MSG_NOTICE([$xc_bad_var_msg include directories. Use CPPFLAGS for: $xc_word])
;;
-rpath*)
AC_MSG_NOTICE([$xc_bad_var_msg library runtime directories. Use LDFLAGS for: $xc_word])
;;
-L* | --library-path=*)
AC_MSG_NOTICE([$xc_bad_var_msg library directories. Use LDFLAGS for: $xc_word])
;;
-l* | --library=*)
AC_MSG_NOTICE([$xc_bad_var_msg libraries. Use LIBS for: $xc_word])
;;
esac
done
fi
])
AC_DEFUN([XC_CHECK_USER_FLAGS], [
AC_PREREQ([2.50]) AC_BEFORE([$0],[XC_CHECK_PROG_CC]) _XC_CHECK_VAR_LIBS
_XC_CHECK_VAR_LDFLAGS
_XC_CHECK_VAR_CPPFLAGS
_XC_CHECK_VAR_CFLAGS
if test $xc_bad_var_libs = yes ||
test $xc_bad_var_cflags = yes ||
test $xc_bad_var_ldflags = yes ||
test $xc_bad_var_cppflags = yes; then
AC_MSG_ERROR([Can not continue. Fix errors mentioned immediately above this line.])
fi
])
AC_DEFUN([XC_CHECK_BUILD_FLAGS], [
AC_PREREQ([2.50]) _XC_CHECK_VAR_LIBS
_XC_CHECK_VAR_LDFLAGS
_XC_CHECK_VAR_CPPFLAGS
_XC_CHECK_VAR_CFLAGS
if test $xc_bad_var_libs = yes ||
test $xc_bad_var_cflags = yes ||
test $xc_bad_var_ldflags = yes ||
test $xc_bad_var_cppflags = yes; then
AC_MSG_WARN([Continuing even with errors mentioned immediately above this line.])
fi
])