|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] configure: check for argp
commit 4b950fbb2a86573076f9f9ae7a73632be1c2bfed
Author: Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Fri Jun 19 10:58:25 2015 +0200
Commit: Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Thu Jun 25 12:12:38 2015 +0100
configure: check for argp
argp is only present in the GNU C library, so add a specific check for it in
configure. Also check if -largp is needed for linking against it.
Please run autoconf after applying.
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Cc: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
Cc: Olaf Hering <olaf@xxxxxxxxx>
Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Acked-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
[ ijc -- ran autogen.sh ]
---
config/Tools.mk.in | 1 +
tools/configure | 51 +++++++++++++++++++++++++++++++++++++++++++++++
tools/configure.ac | 4 +++
tools/xentrace/Makefile | 2 +-
4 files changed, 57 insertions(+), 1 deletions(-)
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index aef9ed6..9bd5f6c 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -78,5 +78,6 @@ CONFIG_GCRYPT := @libgcrypt@
EXTFS_LIBS := @EXTFS_LIBS@
CURSES_LIBS := @CURSES_LIBS@
TINFO_LIBS := @TINFO_LIBS@
+ARGP_LDFLAGS := @argp_ldflags@
FILE_OFFSET_BITS := @FILE_OFFSET_BITS@
diff --git a/tools/configure b/tools/configure
index 9e87e90..c940dd1 100755
--- a/tools/configure
+++ b/tools/configure
@@ -632,6 +632,7 @@ systemd
remus_netbuf
LIBNL3_LIBS
LIBNL3_CFLAGS
+argp_ldflags
libiconv
PTYFUNCS_LIBS
PTHREAD_LIBS
@@ -8793,6 +8794,56 @@ else
fi
+ac_fn_c_check_header_mongrel "$LINENO" "argp.h" "ac_cv_header_argp_h"
"$ac_includes_default"
+if test "x$ac_cv_header_argp_h" = xyes; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for argp_usage in -largp" >&5
+$as_echo_n "checking for argp_usage in -largp... " >&6; }
+if ${ac_cv_lib_argp_argp_usage+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-largp $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char argp_usage ();
+int
+main ()
+{
+return argp_usage ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_argp_argp_usage=yes
+else
+ ac_cv_lib_argp_argp_usage=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_argp_argp_usage"
>&5
+$as_echo "$ac_cv_lib_argp_argp_usage" >&6; }
+if test "x$ac_cv_lib_argp_argp_usage" = xyes; then :
+ argp_ldflags="-largp"
+fi
+
+
+else
+ as_fn_error $? "Could not find argp" "$LINENO" 5
+fi
+
+
+
# FDT is needed only on ARM
case "$host_cpu" in
diff --git a/tools/configure.ac b/tools/configure.ac
index 2886cb5..2d371f4 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -356,6 +356,10 @@ AC_CHECK_LIB([yajl], [yajl_alloc], [],
AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
AC_CHECK_LIB([iconv], [libiconv_open], [libiconv="y"], [libiconv="n"])
AC_SUBST(libiconv)
+AC_CHECK_HEADER([argp.h], [
+AC_CHECK_LIB([argp], [argp_usage], [argp_ldflags="-largp"])
+], [AC_MSG_ERROR([Could not find argp])])
+AC_SUBST(argp_ldflags)
# FDT is needed only on ARM
case "$host_cpu" in
diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
index 7d874a3..2f57bda 100644
--- a/tools/xentrace/Makefile
+++ b/tools/xentrace/Makefile
@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
CFLAGS += -Werror
CFLAGS += $(CFLAGS_libxenctrl)
-LDLIBS += $(LDLIBS_libxenctrl)
+LDLIBS += $(LDLIBS_libxenctrl) $(ARGP_LDFLAGS)
BIN-$(CONFIG_X86) = xenalyze
BIN = $(BIN-y)
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |