Skip to content

Commit

Permalink
Cleanup a bit more by getting rid of useless version defines. Also ma…
Browse files Browse the repository at this point in the history
…ke library detection use passed CFLAGS.

(closes issue #17309)
 Reported by: stuarth


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
  • Loading branch information
tilghman committed May 9, 2010
1 parent 49b292b commit 92a8650
Show file tree
Hide file tree
Showing 5 changed files with 498 additions and 718 deletions.
2 changes: 1 addition & 1 deletion autoconf/ast_c_compile_check.m4
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AC_DEFUN([AST_C_COMPILE_CHECK],
[ AC_MSG_RESULT(yes)
PBX_$1=1
AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
m4_ifval([$4], [AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])])
],
[ AC_MSG_RESULT(no) ]
)
Expand Down
2 changes: 1 addition & 1 deletion autoconf/ast_c_define_check.m4
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ AC_DEFUN([AST_C_DEFINE_CHECK],
[ AC_MSG_RESULT(yes)
PBX_$1=1
AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
m4_ifval([$4], [AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])])
],
[ AC_MSG_RESULT(no) ]
)
Expand Down
15 changes: 11 additions & 4 deletions autoconf/ast_ext_lib.m4
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ AC_DEFUN([AST_EXT_LIB_SETUP],
esac
])
AH_TEMPLATE(m4_bpatsubst([[HAVE_$1]], [(.*)]), [Define to 1 if you have the $2 library.])
AH_TEMPLATE(m4_bpatsubst([[HAVE_$1_VERSION]], [(.*)]), [Define to the version of the $2 library.])
AC_SUBST([$1_LIB])
AC_SUBST([$1_INCLUDE])
AC_SUBST([$1_DIR])
Expand Down Expand Up @@ -81,7 +80,10 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
AST_$1_FOUND=yes
else
AC_CHECK_LIB([$2], [${pbxfuncname}], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} $6"
AC_CHECK_LIB([$2], [${pbxfuncname}], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], [${pbxlibdir} $5])
CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
fi
# now check for the header.
Expand All @@ -95,10 +97,10 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
if test "x$4" = "x" ; then # no header, assume found
$1_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
CPPFLAGS="${saved_cppflags}"
CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
fi
if test "x${$1_HEADER_FOUND}" = "x0" ; then
$1_LIB=""
Expand All @@ -110,9 +112,14 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
PBX_$1=1
cat >>confdefs.h <<_ACEOF
[@%:@define] HAVE_$1 1
_ACEOF
m4_ifval([$7], [
cat >>confdefs.h <<_ACEOF
[@%:@define] HAVE_$1_VERSION $7
_ACEOF
])
fi
fi
fi
m4_ifval([$7], [AH_TEMPLATE(m4_bpatsubst([[HAVE_$1_VERSION]], [(.*)]), [Define to the version of the $2 library.])])
])
Loading

0 comments on commit 92a8650

Please sign in to comment.