[weston V2 2/2] Use AC_SEARCH_LIBS instead of AC_CHECK_LIBS for dl, jpeg, pam

Javier Jardón jjardon at gnome.org
Thu Oct 30 07:23:51 PDT 2014


---
 Makefile.am  |  8 +++-----
 configure.ac | 23 ++++++-----------------
 2 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 1557953..077efbc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -44,7 +44,7 @@ weston_LDFLAGS = -export-dynamic
 weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
 weston_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
 weston_LDADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
-	$(DLOPEN_LIBS) libshared.la
+	libshared.la
 
 weston_SOURCES =					\
 	src/git-version.h				\
@@ -130,10 +130,9 @@ weston_launch_SOURCES = src/weston-launch.c src/weston-launch.h
 weston_launch_CPPFLAGS = -DBINDIR='"$(bindir)"'
 weston_launch_CFLAGS=				\
 	$(GCC_CFLAGS)				\
-	$(PAM_CFLAGS)				\
 	$(SYSTEMD_LOGIN_CFLAGS)			\
 	$(LIBDRM_CFLAGS)
-weston_launch_LDADD = $(PAM_LIBS) $(SYSTEMD_LOGIN_LIBS) $(LIBDRM_LIBS)
+weston_launch_LDADD = $(SYSTEMD_LOGIN_LIBS) $(LIBDRM_LIBS)
 
 if ENABLE_SETUID_INSTALL
 install-exec-hook:
@@ -818,8 +817,7 @@ libshared_cairo_la_LIBADD =			\
 	$(PIXMAN_LIBS)				\
 	$(CAIRO_LIBS)				\
 	$(PNG_LIBS)				\
-	$(WEBP_LIBS)				\
-	$(JPEG_LIBS)
+	$(WEBP_LIBS)
 
 libshared_cairo_la_SOURCES =			\
 	$(libshared_la_SOURCES)			\
diff --git a/configure.ac b/configure.ac
index e78f6c8..a1fd94a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,9 +42,8 @@ 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)
+AC_SEARCH_LIBS([dlopen], [dl], [],
+               [AC_MSG_FAILURE([Dynamic linking loader missing])])
 
 AC_SEARCH_LIBS([sqrt], [m], [],
                [AC_MSG_FAILURE([Math library missing])])
@@ -292,14 +291,8 @@ if test x$enable_vaapi_recorder != xno; then
 fi
 AM_CONDITIONAL(ENABLE_VAAPI_RECORDER, test "x$have_libva" = xyes)
 
-
-AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes)
-if test x$have_jpeglib = xyes; then
-  JPEG_LIBS="-ljpeg"
-else
-  AC_ERROR([libjpeg not found])
-fi
-AC_SUBST(JPEG_LIBS)
+AC_SEARCH_LIBS([jpeg_CreateDecompress], [jpeg], [],
+               [AC_MSG_FAILURE([libjpeg not found])])
 
 PKG_CHECK_MODULES(CAIRO, [cairo])
 
@@ -366,12 +359,8 @@ AS_IF([test "x$have_systemd_login_209" = "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])
-  if test x$have_pam == xno; then
-    AC_ERROR([weston-launch requires pam])
-  fi
-  PAM_LIBS=-lpam
-  AC_SUBST(PAM_LIBS)
+  AC_SEARCH_LIBS([pam_open_session], [pam], [],
+                 [AC_MSG_FAILURE([weston-launch requires pam])])
 fi
 
 if test x$enable_egl = xyes; then
-- 
2.1.2



More information about the wayland-devel mailing list