diff options
author | Quentin Glidic <sardemff7+git@sardemff7.net> | 2016-04-23 12:02:58 +0200 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2016-04-25 13:37:10 +0300 |
commit | 9992bdcbe6b4071c7d04059955171dec183cacfe (patch) | |
tree | 0c62bb3df894473863c97760e59728fb8d807d7b /configure.ac | |
parent | 57c83f65348afdc894cec5b08c440539d35d4352 (diff) | |
download | weston-9992bdcbe6b4071c7d04059955171dec183cacfe.tar.gz |
build: Add (and use) an AC_SEARCH_LIBS wrapper
AC_SEARCH_LIBS is the recommended macro for these checks, unfortunately,
we use AC_CHECK_LIB instead, and even AC_CHECK_FUNC, when only one
AC_SEARCH_LIBS would be enough.
This wrapper macro is used much like PKG_CHECK_MODULES, as it defines
(and AC_SUBST) the PREFIX_LIBS variable itself.
It also avoids adding unnecessary stuff to LIBS.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index 670200cf..41996168 100644 --- a/configure.ac +++ b/configure.ac @@ -42,14 +42,10 @@ AC_ARG_VAR([WESTON_SHELL_CLIENT], PKG_PROG_PKG_CONFIG() -AC_CHECK_FUNC([dlopen], [], - AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) -AC_SUBST(DLOPEN_LIBS) +WESTON_SEARCH_LIBS([DLOPEN], [dl], [dlopen]) # In old glibc versions (< 2.17) clock_gettime() is in librt -AC_SEARCH_LIBS([clock_gettime], [rt], - [CLOCK_GETTIME_LIBS="-lrt"]) -AC_SUBST([CLOCK_GETTIME_LIBS]) +WESTON_SEARCH_LIBS([CLOCK_GETTIME], [rt], [clock_gettime]) AC_CHECK_DECL(SFD_CLOEXEC,[], [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")], @@ -303,12 +299,10 @@ AC_ARG_WITH([jpeg], AS_HELP_STRING([--without-jpeg], [Use jpeglib for JPEG decoding support [default=auto]])) AS_IF([test "x$with_jpeg" != "xno"], - [AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], [have_jpeglib=yes], [have_jpeglib=no])], + [WESTON_SEARCH_LIBS([JPEG], [jpeg], [jpeg_CreateDecompress], [have_jpeglib=yes], [have_jpeglib=no])], [have_jpeglib=no]) AS_IF([test "x$have_jpeglib" = "xyes"], - [JPEG_LIBS="-ljpeg" - AC_SUBST([JPEG_LIBS]) - AC_DEFINE([HAVE_JPEG], [1], [Have jpeglib])], + [AC_DEFINE([HAVE_JPEG], [1], [Have jpeglib])], [AS_IF([test "x$with_jpeg" = "xyes"], [AC_MSG_ERROR([JPEG support explicitly requested, but jpeglib couldn't be found])])]) @@ -418,12 +412,10 @@ AS_IF([test "x$enable_resize_optimization" = "xyes"], AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes) AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes) if test x$enable_weston_launch == xyes; then - AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no]) + WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no]) if test x$have_pam == xno; then AC_ERROR([weston-launch requires pam]) fi - PAM_LIBS=-lpam - AC_SUBST(PAM_LIBS) fi AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes") |