File: virt-static.m4

package info (click to toggle)
libvirt-sandbox 0.5.1%2Bgit20160404-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,104 kB
  • ctags: 1,964
  • sloc: ansic: 12,696; python: 2,110; makefile: 447; sh: 302; xml: 151; perl: 110
file content (32 lines) | stat: -rw-r--r-- 858 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# LIBVIRT_SANDBOX_STATIC_LIB(NAME, CFLAGS, LDFLAGS, PROLOG, PROGRAM)
# ------------------------------------------------------------------
# Check if the program can be linked with static libraries only.
#
AC_DEFUN([LIBVIRT_SANDBOX_STATIC_LIB], [
    AC_MSG_CHECKING([for static $1])

    SAVED_LDFLAGS=$LDFLAGS
    SAVED_CFLAGS=$CFLAGS
    CFLAGS="$2"
    LDFLAGS="-static $3"
    AC_LINK_IFELSE(
        [AC_LANG_PROGRAM([$4],
                         [$5])],
        [],
        [AC_MSG_RESULT([no])]
        [AC_MSG_ERROR([static $1 is required in order to build virt-sandbox-init-qemu])]
    )
    LDFLAGS=$SAVED_LDFLAGS
    CFLAGS=$SAVED_CFLAGS

    AC_MSG_RESULT([yes])
])

AC_DEFUN([LIBVIRT_SANDBOX_STATIC_LIBC], [
    LIBVIRT_SANDBOX_STATIC_LIB(
         [LIBC],
         [],
         [],
         [#include <stdio.h>],
         [printf("bar");])
])