spice-common/configure.ac
Christophe Fergeau f7ec855af3 build-sys: Rework SPICE_CHECK_* m4 macros
These macros were automatically appending the needed CFLAGS/LIBS to
variables passed as arguments. This is how spice-common uses them, but
now how spice-gtk/spice want to use them, and is making the macros more
complicated than they could (in particular this makes them use
AS_VAR_APPEND).
This  is also not flexible enough as spice-gtk uses libcacard libraries,
while spice-common does not need them. If SPICE_CHECK_SMARTCARD
unconditionnally libcacard libraries to the variable spice-common passes
it as an argument, we'll end up linking with an unneeded library.

This commit removes this automatic appending from the SPICE_CHECK_*
macros and moves it to spice-common as it's the only one which needs it.
2015-10-13 11:26:01 +02:00

64 lines
1.4 KiB
Plaintext

AC_PREREQ([2.63])
AC_INIT([spice-common],
[noversion],
[spice-devel@lists.freedesktop.org])
AC_CONFIG_SRCDIR([common/bitops.h])
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR([build-aux])
# For automake >= 1.12
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
# Checks for programs
AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip tar-ustar foreign -Wall -Werror])
AM_MAINTAINER_MODE
AM_SILENT_RULES([yes])
LT_INIT
AC_PROG_CC
AC_PROG_CC_C99
if test "x$ac_cv_prog_cc_c99" = xno; then
AC_MSG_ERROR([C99 compiler is required.])
fi
AM_PROG_CC_C_O
SPICE_CHECK_SYSDEPS
# Checks for libraries
PKG_CHECK_MODULES([PROTOCOL], [spice-protocol >= 0.12.10])
CODE_GENERATOR_BASEDIR=`${PKG_CONFIG} --variable=codegendir spice-protocol`
AC_SUBST([CODE_GENERATOR_BASEDIR])
SPICE_CHECK_PYTHON_MODULES()
SPICE_CHECK_PIXMAN
SPICE_CHECK_SMARTCARD
SPICE_CHECK_CELT051
SPICE_CHECK_GLIB2
SPICE_CHECK_OPUS
SPICE_CHECK_OPENGL
SPICE_COMMON_CFLAGS='$(PIXMAN_CFLAGS) $(SMARTCARD_CFLAGS) $(CELT051_CFLAGS) $(GLIB2_CFLAGS) $(OPUS_CFLAGS) $(GL_CFLAGS)'
SPICE_COMMON_LIBS='$(PIXMAN_LIBS) $(CELT051_LIBS) $(GLIB2_LIBS) $(OPUS_LIBS) $(GL_LIBS)'
AC_SUBST(SPICE_COMMON_CFLAGS)
AC_SUBST(SPICE_COMMON_LIBS)
# The End!
AC_CONFIG_FILES([
Makefile
common/Makefile
tests/Makefile
])
AH_BOTTOM([
/* argh.. this is evil */
#if defined(FIXME_SERVER_SMARTCARD) && defined(USE_SMARTCARD)
%:undef USE_SMARTCARD
#endif
])
AC_OUTPUT