mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-31 19:12:32 +01:00
Clean up library linking
On the one hand, libWINGs wasn't linking against -lX11 when it should have been. And on the other, only libWINGs needs Xft, only wmaker needs Xrandr, only wmaker and wmsetbg need Xinerama, only libwraster needs Xmu, and -lpng may not need -lz. Cleaning this up can help distributions get their dependencies correct, and might even avoid loading the unused libraries at runtime, so we may as well do it. Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
This commit is contained in:
committed by
Carlos R. Mafra
parent
8ca05fd4be
commit
f38aa69e40
@@ -13,7 +13,7 @@ lib_LTLIBRARIES = libWUtil.la libWINGs.la
|
|||||||
|
|
||||||
|
|
||||||
LDADD= libWUtil.la libWINGs.la $(top_builddir)/wrlib/libwraster.la @INTLIBS@
|
LDADD= libWUtil.la libWINGs.la $(top_builddir)/wrlib/libwraster.la @INTLIBS@
|
||||||
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XFTLIBS@ @FCLIBS@ @LIBM@ @LIBBSD@
|
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFTLIBS@ @FCLIBS@ @LIBM@
|
||||||
libWUtil_la_LIBADD = @LIBBSD@
|
libWUtil_la_LIBADD = @LIBBSD@
|
||||||
|
|
||||||
EXTRA_DIST = BUGS make-rgb Examples Extras Tests
|
EXTRA_DIST = BUGS make-rgb Examples Extras Tests
|
||||||
|
|||||||
@@ -54,6 +54,5 @@ WPrefs_LDADD = \
|
|||||||
$(top_builddir)/WINGs/libWUtil.la\
|
$(top_builddir)/WINGs/libWUtil.la\
|
||||||
$(top_builddir)/wrlib/libwraster.la \
|
$(top_builddir)/wrlib/libwraster.la \
|
||||||
@XLFLAGS@ @XLIBS@ \
|
@XLFLAGS@ @XLIBS@ \
|
||||||
@XFTLIBS@ \
|
|
||||||
@FCLIBS@ \
|
@FCLIBS@ \
|
||||||
@INTLIBS@
|
@INTLIBS@
|
||||||
|
|||||||
31
configure.ac
31
configure.ac
@@ -386,7 +386,9 @@ fi
|
|||||||
X_LIBRARY_PATH=$x_libraries
|
X_LIBRARY_PATH=$x_libraries
|
||||||
XCFLAGS="$X_CFLAGS"
|
XCFLAGS="$X_CFLAGS"
|
||||||
XLFLAGS="$X_LIBS"
|
XLFLAGS="$X_LIBS"
|
||||||
XLIBS="-lX11 -lXmu $X_EXTRA_LIBS"
|
XLIBS="-lX11 $X_EXTRA_LIBS"
|
||||||
|
LIBXMU="-lXmu"
|
||||||
|
AC_SUBST(LIBXMU)
|
||||||
|
|
||||||
lib_search_path="$lib_search_path $XLFLAGS"
|
lib_search_path="$lib_search_path $XLFLAGS"
|
||||||
inc_search_path="$inc_search_path $XCFLAGS"
|
inc_search_path="$inc_search_path $XCFLAGS"
|
||||||
@@ -444,12 +446,14 @@ AC_ARG_ENABLE(xrandr, AS_HELP_STRING([--enable-xrandr], [enable XRandR window ex
|
|||||||
xrandr=$enableval, xrandr=no)
|
xrandr=$enableval, xrandr=no)
|
||||||
added_xext=no
|
added_xext=no
|
||||||
|
|
||||||
|
LIBXRANDR=
|
||||||
if test "$xrandr" = yes; then
|
if test "$xrandr" = yes; then
|
||||||
AC_CHECK_LIB(Xrandr, XRRQueryExtension, [XLIBS="-lXrandr $XLIBS"
|
AC_CHECK_LIB(Xrandr, XRRQueryExtension, [LIBXRANDR=-lXrandr
|
||||||
added_xext=yes
|
added_xext=yes
|
||||||
AC_DEFINE(HAVE_XRANDR, 1, [define if you want support for XRandR (set by configure)])],
|
AC_DEFINE(HAVE_XRANDR, 1, [define if you want support for XRandR (set by configure)])],
|
||||||
xrandr=no, $XLFLAGS $XLIBS)
|
xrandr=no, $XLFLAGS $XLIBS)
|
||||||
fi
|
fi
|
||||||
|
AC_SUBST(LIBXRANDR)
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl libWINGS uses math functions, check whether usage requires linking
|
dnl libWINGS uses math functions, check whether usage requires linking
|
||||||
@@ -530,9 +534,10 @@ xinerama=no
|
|||||||
AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--enable-xinerama], [enable Xinerama extension support]),
|
AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--enable-xinerama], [enable Xinerama extension support]),
|
||||||
xinerama=$enableval, xinerama=no)
|
xinerama=$enableval, xinerama=no)
|
||||||
|
|
||||||
|
LIBXINERAMA=
|
||||||
if test "$xinerama" = yes; then
|
if test "$xinerama" = yes; then
|
||||||
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
|
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
|
||||||
[XLIBS="-lXinerama $XLIBS"
|
[LIBXINERAMA=-lXinerama
|
||||||
xfxine=yes],
|
xfxine=yes],
|
||||||
xfxine=no, $XLFLAGS $XLIBS)
|
xfxine=no, $XLFLAGS $XLIBS)
|
||||||
|
|
||||||
@@ -555,7 +560,7 @@ if test "$xinerama" = yes; then
|
|||||||
[define if you want support for the XINERAMA extension (set by configure)])
|
[define if you want support for the XINERAMA extension (set by configure)])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
AC_SUBST(LIBXINERAMA)
|
||||||
|
|
||||||
|
|
||||||
dnl MIT-SHM support
|
dnl MIT-SHM support
|
||||||
@@ -630,12 +635,26 @@ AC_ARG_ENABLE(png, AS_HELP_STRING([--disable-png], [disable PNG support through
|
|||||||
png=$enableval, png=yes, png=no)
|
png=$enableval, png=yes, png=no)
|
||||||
|
|
||||||
if test "$png" = yes ; then
|
if test "$png" = yes ; then
|
||||||
WM_CHECK_LIB(png, png_get_valid, [-lz -lm])
|
my_libname=""
|
||||||
|
WM_CHECK_LIB(png, png_get_valid, [-lm])
|
||||||
|
if test "x$ac_cv_lib_png_png_get_valid" = xyes; then
|
||||||
|
my_libname="-lpng"
|
||||||
|
fi
|
||||||
|
dnl
|
||||||
|
dnl Retry with zlib
|
||||||
|
dnl
|
||||||
|
if test "x$my_libname" = x; then
|
||||||
|
unset ac_cv_lib_png_png_get_valid
|
||||||
|
WM_CHECK_LIB(png, png_get_valid, [-lz -lm])
|
||||||
|
if test "x$ac_cv_lib_png_png_get_valid" = xyes; then
|
||||||
|
my_libname="-lpng -lz"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if test "x$ac_cv_lib_png_png_get_valid" = xyes; then
|
if test "x$ac_cv_lib_png_png_get_valid" = xyes; then
|
||||||
WM_CHECK_HEADER(png.h)
|
WM_CHECK_HEADER(png.h)
|
||||||
if test "x$ac_cv_header_png_h" = xyes; then
|
if test "x$ac_cv_header_png_h" = xyes; then
|
||||||
GFXLIBS="$GFXLIBS -lpng -lz"
|
GFXLIBS="$GFXLIBS $my_libname"
|
||||||
supported_gfx="$supported_gfx PNG"
|
supported_gfx="$supported_gfx PNG"
|
||||||
AC_DEFINE(USE_PNG, 1, [define if PNG libraries are available (set by configure)])
|
AC_DEFINE(USE_PNG, 1, [define if PNG libraries are available (set by configure)])
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -116,7 +116,8 @@ wmaker_LDADD = \
|
|||||||
$(top_builddir)/WINGs/libWUtil.la\
|
$(top_builddir)/WINGs/libWUtil.la\
|
||||||
$(top_builddir)/wrlib/libwraster.la\
|
$(top_builddir)/wrlib/libwraster.la\
|
||||||
@XLFLAGS@ \
|
@XLFLAGS@ \
|
||||||
@XFTLIBS@ \
|
@LIBXRANDR@ \
|
||||||
|
@LIBXINERAMA@ \
|
||||||
@XLIBS@ \
|
@XLIBS@ \
|
||||||
@LIBM@ \
|
@LIBM@ \
|
||||||
@INTLIBS@
|
@INTLIBS@
|
||||||
|
|||||||
@@ -49,13 +49,13 @@ wmagnify_LDADD = \
|
|||||||
$(top_builddir)/WINGs/libWINGs.la \
|
$(top_builddir)/WINGs/libWINGs.la \
|
||||||
$(top_builddir)/WINGs/libWUtil.la \
|
$(top_builddir)/WINGs/libWUtil.la \
|
||||||
$(top_builddir)/wrlib/libwraster.la \
|
$(top_builddir)/wrlib/libwraster.la \
|
||||||
@XLFLAGS@ @XLIBS@ @XFTLIBS@ @INTLIBS@
|
@XLFLAGS@ @XLIBS@ @INTLIBS@
|
||||||
|
|
||||||
wmsetbg_LDADD = \
|
wmsetbg_LDADD = \
|
||||||
$(top_builddir)/WINGs/libWINGs.la \
|
$(top_builddir)/WINGs/libWINGs.la \
|
||||||
$(top_builddir)/WINGs/libWUtil.la \
|
$(top_builddir)/WINGs/libWUtil.la \
|
||||||
$(top_builddir)/wrlib/libwraster.la \
|
$(top_builddir)/wrlib/libwraster.la \
|
||||||
@XLFLAGS@ @XLIBS@ @XFTLIBS@ @INTLIBS@
|
@XLFLAGS@ @LIBXINERAMA@ @XLIBS@ @INTLIBS@
|
||||||
|
|
||||||
wmgenmenu_LDADD = \
|
wmgenmenu_LDADD = \
|
||||||
$(top_builddir)/WINGs/libWUtil.la \
|
$(top_builddir)/WINGs/libWUtil.la \
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ COMPILE2=`echo $(COMPILE) | sed -e s/-fomit-frame-pointer//`
|
|||||||
|
|
||||||
INCLUDES = $(DFLAGS) @HEADER_SEARCH_PATH@
|
INCLUDES = $(DFLAGS) @HEADER_SEARCH_PATH@
|
||||||
|
|
||||||
libwraster_la_LIBADD = @LIBRARY_SEARCH_PATH@ @GFXLIBS@ @XLIBS@ -lm
|
libwraster_la_LIBADD = @LIBRARY_SEARCH_PATH@ @GFXLIBS@ @XLIBS@ @LIBXMU@ -lm
|
||||||
|
|
||||||
DISTCLEANFILES = wrlib.pc
|
DISTCLEANFILES = wrlib.pc
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user