|
|
@ -430,7 +430,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [ |
|
|
|
], [ |
|
|
|
], [ |
|
|
|
for x in ${$1_CFLAGS}; do |
|
|
|
for x in ${$1_CFLAGS}; do |
|
|
|
AC_MSG_NOTICE([search for $3 in ${x[#]-I}]) |
|
|
|
AC_MSG_NOTICE([search for $3 in ${x[#]-I}]) |
|
|
|
for f in $(find ${x[#]-I} -name "$3"); do |
|
|
|
for f in $(find ${x[#]-I} -name "$3" 2> /dev/null); do |
|
|
|
if test -f "$f"; then |
|
|
|
if test -f "$f"; then |
|
|
|
$1_found=${tmp_package} |
|
|
|
$1_found=${tmp_package} |
|
|
|
$1_CFLAGS+=" -I${f%/*}" |
|
|
|
$1_CFLAGS+=" -I${f%/*}" |
|
|
@ -446,7 +446,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [ |
|
|
|
tmp_includedir=$(${PKG_CONFIG} --variable=includedir $tmp_package) |
|
|
|
tmp_includedir=$(${PKG_CONFIG} --variable=includedir $tmp_package) |
|
|
|
for x in ${tmp_includedir}; do |
|
|
|
for x in ${tmp_includedir}; do |
|
|
|
AC_MSG_NOTICE([search for $3 in $x]) |
|
|
|
AC_MSG_NOTICE([search for $3 in $x]) |
|
|
|
for f in $(find ${x} -name "$3"); do |
|
|
|
for f in $(find ${x} -name "$3" 2> /dev/null); do |
|
|
|
if test -f "$f"; then |
|
|
|
if test -f "$f"; then |
|
|
|
$1_found=${tmp_package} |
|
|
|
$1_found=${tmp_package} |
|
|
|
$1_CFLAGS+=" -I${f%/*}" |
|
|
|
$1_CFLAGS+=" -I${f%/*}" |
|
|
@ -501,7 +501,7 @@ AC_DEFUN([AX_PKG_CHECK], [ |
|
|
|
], [ |
|
|
|
], [ |
|
|
|
HAVE_$1=0 |
|
|
|
HAVE_$1=0 |
|
|
|
]) |
|
|
|
]) |
|
|
|
AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) |
|
|
|
AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1) |
|
|
|
AC_SUBST(HAVE_$1) |
|
|
|
AC_SUBST(HAVE_$1) |
|
|
|
AC_SUBST(CPPFLAGS) |
|
|
|
AC_SUBST(CPPFLAGS) |
|
|
|
AC_SUBST(CXXFLAGS) |
|
|
|
AC_SUBST(CXXFLAGS) |
|
|
@ -532,3 +532,95 @@ AC_DEFUN([AX_REQUIRE_HEADER], [ |
|
|
|
], []) |
|
|
|
], []) |
|
|
|
], []) |
|
|
|
], []) |
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check within a list of CPP-Flags for the first that is usable and |
|
|
|
|
|
|
|
# configure it |
|
|
|
|
|
|
|
# - parameter: |
|
|
|
|
|
|
|
# $1 = white-space separated list of alternative flags |
|
|
|
|
|
|
|
# $2 = module name (optional, if different from id) |
|
|
|
|
|
|
|
AC_DEFUN([AX_CHECK_VALID_CPP_FLAG], [ |
|
|
|
|
|
|
|
AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) |
|
|
|
|
|
|
|
save_cppflags="$CPPFLAGS" |
|
|
|
|
|
|
|
newflag="no" |
|
|
|
|
|
|
|
for test_flag in $1; do |
|
|
|
|
|
|
|
CPPFLAGS+=" ${test_flag}" |
|
|
|
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ |
|
|
|
|
|
|
|
newflag="$test_flag" |
|
|
|
|
|
|
|
CPPFLAGS="$save_cppflags" |
|
|
|
|
|
|
|
CPPFLAGS+=" ${test_flag}" |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
CPPFLAGS="$save_cppflags" |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
AC_SUBST(CPPFLAGS) |
|
|
|
|
|
|
|
AC_MSG_RESULT([$newflag in $CPPFLAGS]) |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check within a list of CXX-Flags for the first that is usable and |
|
|
|
|
|
|
|
# configure it |
|
|
|
|
|
|
|
# - parameter: |
|
|
|
|
|
|
|
# $1 = white-space separated list of alternative flags |
|
|
|
|
|
|
|
# $2 = module name (optional, if different from id) |
|
|
|
|
|
|
|
AC_DEFUN([AX_CHECK_VALID_CXX_FLAG], [ |
|
|
|
|
|
|
|
AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) |
|
|
|
|
|
|
|
save_cxxflags="$CXXFLAGS" |
|
|
|
|
|
|
|
newflag="no" |
|
|
|
|
|
|
|
for test_flag in $1; do |
|
|
|
|
|
|
|
CXXFLAGS+=" ${test_flag}" |
|
|
|
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ |
|
|
|
|
|
|
|
newflag="$test_flag" |
|
|
|
|
|
|
|
CXXFLAGS="$save_cxxflags" |
|
|
|
|
|
|
|
CXXFLAGS+=" ${test_flag}" |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
CXXFLAGS="$save_cxxflags" |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
AC_SUBST(CXXFLAGS) |
|
|
|
|
|
|
|
AC_MSG_RESULT([$newflag in $CXXFLAGS]) |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check within a list of C-Flags for the first that is usable and |
|
|
|
|
|
|
|
# configure it |
|
|
|
|
|
|
|
# - parameter: |
|
|
|
|
|
|
|
# $1 = white-space separated list of alternative flags |
|
|
|
|
|
|
|
# $2 = module name (optional, if different from id) |
|
|
|
|
|
|
|
AC_DEFUN([AX_CHECK_VALID_C_FLAG], [ |
|
|
|
|
|
|
|
AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) |
|
|
|
|
|
|
|
save_cflags="$CFLAGS" |
|
|
|
|
|
|
|
newflag="no" |
|
|
|
|
|
|
|
for test_flag in $1; do |
|
|
|
|
|
|
|
CFLAGS+=" ${test_flag}" |
|
|
|
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ |
|
|
|
|
|
|
|
newflag="$test_flag" |
|
|
|
|
|
|
|
CFLAGS="$save_cflags" |
|
|
|
|
|
|
|
CFLAGS+=" ${test_flag}" |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
CFLAGS="$save_cflags" |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
AC_SUBST(CFLAGS) |
|
|
|
|
|
|
|
AC_MSG_RESULT([$newflag in $CFLAGS]) |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check within a list of LD-Flags for the first that is usable and |
|
|
|
|
|
|
|
# configure it |
|
|
|
|
|
|
|
# - parameter: |
|
|
|
|
|
|
|
# $1 = white-space separated list of alternative flags |
|
|
|
|
|
|
|
# $2 = module name (optional, if different from id) |
|
|
|
|
|
|
|
AC_DEFUN([AX_CHECK_VALID_LD_FLAG], [ |
|
|
|
|
|
|
|
AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) |
|
|
|
|
|
|
|
save_ldflags="$LDFLAGS" |
|
|
|
|
|
|
|
newflag="no" |
|
|
|
|
|
|
|
for test_flag in $1; do |
|
|
|
|
|
|
|
LDFLAGS+=" ${test_flag}" |
|
|
|
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ |
|
|
|
|
|
|
|
newflag="$test_flag" |
|
|
|
|
|
|
|
LDFLAGS="$save_ldflags" |
|
|
|
|
|
|
|
LDFLAGS+=" ${test_flag}" |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
LDFLAGS="$save_ldflags" |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
AC_SUBST(LDFLAGS) |
|
|
|
|
|
|
|
AC_MSG_RESULT([$newflag in $LDFLAGS]) |
|
|
|
|
|
|
|
]) |
|
|
|