Do not unnecessarily link libraries.

This commit is contained in:
Michael Jumper 2013-07-08 17:40:20 -07:00
parent 0f609cb666
commit 2b93deaac6
6 changed files with 28 additions and 13 deletions

View File

@ -56,16 +56,31 @@ AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h time.h sys/time.h syslo
AC_DEFINE([_POSIX_C_SOURCE], [199309L], [Uses POSIX APIs])
AC_DEFINE([_BSD_SOURCE], [], [Uses BSD APIs])
# Libraries
AC_CHECK_LIB([dl], [dlopen],, AC_MSG_ERROR("libdl is required for loading client plugins"))
AC_CHECK_LIB([png], [png_write_png],, AC_MSG_ERROR("libpng is required for writing png messages"))
AC_CHECK_LIB([cairo], [cairo_create],, AC_MSG_ERROR("cairo is required for drawing instructions"))
AC_CHECK_LIB([pthread], [pthread_create],
[PTHREAD_LIBS=-lpthread
# libdl
AC_CHECK_LIB([dl], [dlopen], [DL_LIBS=-lpng],
AC_MSG_ERROR("libdl is required for loading client plugins"))
# libpng
AC_CHECK_LIB([png], [png_write_png], [PNG_LIBS=-lpng],
AC_MSG_ERROR("libpng is required for writing png messages"))
# Cairo
AC_CHECK_LIB([cairo], [cairo_create], [CAIRO_LIBS=-lcairo],
AC_MSG_ERROR("Cairo is required for drawing instructions"))
# libpthread
AC_CHECK_LIB([pthread], [pthread_create], [PTHREAD_LIBS=-lpthread
AC_DEFINE([HAVE_LIBPTHREAD])])
# cunit
AC_CHECK_LIB([cunit], [CU_run_test], [CUNIT_LIBS=-lcunit])
# WinSock
AC_CHECK_LIB([wsock32], [main])
AC_SUBST(DL_LIBS)
AC_SUBST(PNG_LIBS)
AC_SUBST(CAIRO_LIBS)
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(CUNIT_LIBS)

View File

@ -44,7 +44,7 @@ man_MANS = man/guacd.8
noinst_HEADERS = client.h log.h
guacd_SOURCES = daemon.c client.c log.c
guacd_LDADD = @LIBGUAC_LTLIB@
guacd_LDFLAGS = @PTHREAD_LIBS@
guacd_LDFLAGS = @PTHREAD_LIBS@ @DL_LIBS@
EXTRA_DIST = init.d/guacd.in man/guacd.8
CLEANFILES = $(init_SCRIPTS)

View File

@ -74,5 +74,5 @@ libguac_la_SOURCES = \
unicode.c
lib_LTLIBRARIES = libguac.la
libguac_la_LDFLAGS = -version-info 5:0:0 @PTHREAD_LIBS@
libguac_la_LDFLAGS = -version-info 5:0:0 @PTHREAD_LIBS@ @CAIRO_LIBS@ @PNG_LIBS@

View File

@ -95,7 +95,7 @@ if ENABLE_OGG
noinst_HEADERS += ogg_encoder.h
endif
libguac_client_rdp_la_LDFLAGS = -version-info 0:0:0 @RDP_LIBS@ @VORBIS_LIBS@ @PTHREAD_LIBS@
libguac_client_rdp_la_LDFLAGS = -version-info 0:0:0 @RDP_LIBS@ @VORBIS_LIBS@ @PTHREAD_LIBS@ @CAIRO_LIBS@
guac_rdpsnd_la_LDFLAGS = -module -avoid-version -shared @RDP_LIBS@ @VORBIS_LIBS@ @PTHREAD_LIBS@
guac_rdpdr_la_LDFLAGS = -module -avoid-version -shared @RDP_LIBS@ @PTHREAD_LIBS@

View File

@ -71,6 +71,6 @@ noinst_HEADERS = \
types.h
libguac_client_ssh_la_CFLAGS = -Werror -Wall -pedantic -Iinclude @PANGO_CFLAGS@ @PANGOCAIRO_CFLAGS@ @LIBGUAC_INCLUDE@
libguac_client_ssh_la_LIBADD = @PANGO_LIBS@ @PANGOCAIRO_LIBS@ @LIBGUAC_LTLIB@
libguac_client_ssh_la_LDFLAGS = -version-info 0:0:0 @SSH_LIBS@ @PTHREAD_LIBS@
libguac_client_ssh_la_LIBADD = @LIBGUAC_LTLIB@
libguac_client_ssh_la_LDFLAGS = -version-info 0:0:0 @SSH_LIBS@ @PTHREAD_LIBS@ @PANGO_LIBS@ @PANGOCAIRO_LIBS@ @CAIRO_LIBS@

View File

@ -44,6 +44,6 @@ lib_LTLIBRARIES = libguac-client-vnc.la
libguac_client_vnc_la_SOURCES = client.c vnc_handlers.c guac_handlers.c convert.c
noinst_HEADERS = client.h vnc_handlers.h guac_handlers.h convert.h
libguac_client_vnc_la_LDFLAGS = -version-info 0:0:0 @VNC_LIBS@
libguac_client_vnc_la_LDFLAGS = -version-info 0:0:0 @VNC_LIBS@ @CAIRO_LIBS@
libguac_client_vnc_la_LIBADD = @LIBGUAC_LTLIB@