|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 04/20] autoconf: New test for openpty et al.
On Fri, 2012-04-13 at 19:39 +0100, Ian Jackson wrote:
> We may need to #include <libutil.h>, and/or link with -lutil, to use
> openpty, login_tty, and the like. Provide INCLUDE_LIBUTIL_H
> (preprocessor constant, not always defined) and PTYFUNCS_LIBS
> (makefile variable).
>
> We link libxl against PTYFUNCS_LIBS (which comes from autoconf) rather
> than UTIL_LIBS, and #include <libutil.h> where appropriate.
>
> Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> ---
> config/Tools.mk.in | 2 +
> tools/configure | 51
> ++++++++++++++++++++++++++++++++++++++++
> tools/configure.ac | 2 +
> tools/libxl/Makefile | 2 +-
> tools/libxl/libxl_bootloader.c | 4 +++
> tools/m4/ptyfuncs.m4 | 24 ++++++++++++++++++
> 6 files changed, 84 insertions(+), 1 deletions(-)
> create mode 100644 tools/m4/ptyfuncs.m4
>
> diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
> index e5ea867..5ba144f 100644
> --- a/tools/libxl/Makefile
> +++ b/tools/libxl/Makefile
> @@ -20,7 +20,7 @@ LIBUUID_LIBS += -luuid
> endif
>
> LIBXL_LIBS =
> -LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest)
> $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(UTIL_LIBS) $(LIBUUID_LIBS)
> +LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest)
> $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
Did you intend to remove the definition of UTIL_LIBS? I don't see a hunk
which does that.
> diff --git a/tools/m4/ptyfuncs.m4 b/tools/m4/ptyfuncs.m4
> new file mode 100644
> index 0000000..2846a6d
> --- /dev/null
> +++ b/tools/m4/ptyfuncs.m4
> @@ -0,0 +1,24 @@
> +AC_DEFUN([AX_CHECK_PTYFUNCS], [
> + AC_CHECK_HEADER([libutil.h],[
> + AC_DEFINE([INCLUDE_LIBUTIL_H],[<libutil.h>],[libutil header file name])
> + ])
> + AC_CACHE_CHECK([for openpty et al], [ax_cv_ptyfuncs_libs], [
> + ax_cv_ptyfuncs_libs=-lutil
> + AX_SAVEVAR_SAVE(LIBS)
> + LIBS="$LIBS $ax_cv_ptyfuncs_libs"
> + AC_LINK_IFELSE([
> +#ifdef INCLUDE_LIBUTIL_H
> +#include INCLUDE_LIBUTIL_H
> +#endif
> +int main(void) {
> + openpty(0,0,0,0,0);
> + login_tty(0);
> +}
> +])
> + AX_SAVEVAR_RESTORE(LIBS)],
> + [],[
> + AC_MSG_FAILURE([Unable to find -lutil for openpty and login_tty])
> + ])
> + PTYFUNCS_LIBS="$ax_cv_ptyfuncs_libs"
> + AC_SUBST(PTYFUNCS_LIBS)
> +])
Does this fail if -lutil isn't available? My (perhaps mistaken) reading
of the commit message was that -lutil was only needed on some platforms?
On the other hand the AC_MSG_FAILURE doesn't see to have appeared in the
configure output -- so maybe I just understand what all these macros are
actually doing.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |