mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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@citrix.com> Cc: George Dunlap <george.dunlap@eu.citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Cc: Olaf Hering <olaf@aepfle.de> Acked-by: Wei Liu <wei.liu2@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> [ ijc -- ran autogen.sh ]
This commit is contained in:
1 parent
8c21339be4
commit
4b950fbb2a
4 files changed
+57
-1
No files matched your search
@@ -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@
|
||||
Vendored
+51
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||