#
# The following libraries are currently tested: DNET, FUSE, GLIB2, GMODULE,
# GOBJECT, GTHREAD, GTK, GTKMM, ICU, LIBPNG, PAM, PROCPS, URIPARSER, ZLIB
+#
+# For the procps library: you can provide the name of the procps library on
+# your system by defining CUSTOM_PROCPS_NAME. By default the configure script
+# will try both "-lproc" and "-lproc-3.2.7".
################################################################################
###
# libraries.
if test "$enable_unity" != "no"; then
- # Unity needs the X11 Screen Saver extension library. It should be
+ # Unity needs the X11 Screen Saver extension library. It should be
# in the same place as the X11 libraries, so no need for any fancy
# path checking.
- AC_CHECK_LIB(
- [Xss],
- [XScreenSaverQueryExtension],
- [COMMON_XLIBS="-lXss $COMMON_XLIBS"],
- [AC_MSG_ERROR(
- [libXss not found. Please configure without Unity (using --disable-unity) or install the libXss devel package.])],
- [$COMMON_XLIBS])
+ AC_VMW_CHECK_X11_LIB(
+ [Xss],
+ [X11/extensions/scrnsaver.h],
+ [XScreenSaverQueryExtension],
+ [AC_MSG_ERROR([libXss or headers not found. Please configure without Unity (using --disable-unity) or install the libXss devel package.])])
# Check for the uriparser library and headers. The upstream uriparser
# doesn't appear to ship with either a pkg-config file or a
fi
if test "$with_procps" = "yes"; then
- # XXX: Force CUSTOM_PROCPS_LIBS to have something so that AC_VMW_CHECK_LIB
- # properly performs the library check.
+ if test -z "$CUSTOM_PROCPS_NAME"; then
+ CUSTOM_PROCPS_NAME=proc
+ fi
+
+ # XXX: no pkg-config and no procps-config means we need to
+ # hard-code a sensible default.
if test -z "$CUSTOM_PROCPS_LIBS"; then
CUSTOM_PROCPS_LIBS="-L/lib"
fi
- AC_VMW_CHECK_LIB([proc-3.2.7],
+
+ # Some distros provide libproc-${version}.so only, others provide the
+ # libproc.so symlink. Try both to see what sticks (but only try the 3.2.7
+ # version - adding every possible version here would be a mess).
+ #
+ # Users can help by providing CUSTOM_PROCPS_NAME / CUSTOM_PROCPS_LIBS if
+ # necessary.
+ have_procps=no
+
+ AC_VMW_CHECK_LIB([$CUSTOM_PROCPS_NAME],
[PROCPS],
[],
[],
[],
[],
[getstat],
- [VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS"],
- [AC_MSG_ERROR([libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net])])
+ [
+ have_procps=yes;
+ VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS"
+ ],
+ [])
+
+ if test "$have_procps" = "no"; then
+ AC_VMW_CHECK_LIB([proc-3.2.7],
+ [PROCPS],
+ [],
+ [],
+ [],
+ [],
+ [getstat],
+ [VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS"],
+ [AC_MSG_ERROR([libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net])])
+ fi
fi
if test "$with_procps" != "yes"; then
ac_vmw_have_lib=0
ac_vmw_have_lib_func=0
ac_vmw_have_lib_header=0
+ ac_vmw_custom_libs=
#
# First, try any user-defined CUSTOM_* flags.
#
if test -n "${CUSTOM_$2_CPPFLAGS}" || test -n "${CUSTOM_$2_LIBS}"; then
- CUSTOM_$2_LIBS="${CUSTOM_$2_LIBS} -l$1"
+ ac_vmw_custom_libs="${CUSTOM_$2_LIBS} -l$1"
if test -n "$6"; then
ORIGINAL_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="${CUSTOM_$2_CPPFLAGS} $CPPFLAGS"
[$ac_vmw_function],
[ac_vmw_have_lib_func=1],
[],
- [${CUSTOM_$2_LIBS}])
+ [$ac_vmw_custom_libs])
fi
if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then
$2_CPPFLAGS="${CUSTOM_$2_CPPFLAGS}"
- $2_LIBS="${CUSTOM_$2_LIBS}"
+ $2_LIBS="$ac_vmw_custom_libs"
ac_vmw_have_lib=1
fi
fi
])
+#
+# AC_VMW_CHECK_X11_LIB(library, header, function, action-if-not-found)
+#
+# Special handling for X11 library checking. This macro checks that both the
+# library provides the given function, and that the header exists, making use
+# of COMMON_XLIBS when linking. On success, it modifies COMMON_XLIBS to include
+# the library.
+#
+# library ($1): library name (value passed to ld with -l)
+# header ($2): header file to look for, may be empty.
+# function ($3): function to look for in the library.
+# action-if-not-found ($4): code to execute if failed to find the library.
+#
+#
+AC_DEFUN([AC_VMW_CHECK_X11_LIB],[
+ have_header=1
+ if test -n "$2"; then
+ AC_CHECK_HEADER(
+ [X11/extensions/scrnsaver.h],
+ [],
+ [
+ $have_header=0;
+ ${action-if-not-found}
+ ],
+ [])
+ fi
+
+ if test $have_header = 1; then
+ AC_CHECK_LIB(
+ [$1],
+ [$3],
+ [COMMON_XLIBS="-l$1 $COMMON_XLIBS"],
+ [${action-if-not-found}],
+ [$COMMON_XLIBS])
+ fi
+])
+
+
#
# AC_VMW_LIB_ERROR(library, disable)
#