File: configure.ac

package info (click to toggle)
libbytesize 1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 564 kB
  • sloc: python: 1,721; ansic: 952; sh: 681; makefile: 249; xml: 7
file content (103 lines) | stat: -rw-r--r-- 3,279 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# configure.ac for libbytesize

AC_INIT([libbytesize], [1.4], [vpodzime@redhat.com])

# Disable building static libraries.
# This needs to be set before initializing automake
AC_DISABLE_STATIC

AM_INIT_AUTOMAKE([foreign -Wall -Werror -Wno-syntax -Wno-portability])
AC_CONFIG_MACRO_DIR([m4])

# Check for the gettext programs
AC_PATH_PROG([XGETTEXT], [xgettext])
AC_PATH_PROG([MSGFMT], [msgfmt])
AC_PATH_PROG([MSGMERGE], [msgmerge])
AC_PATH_PROG([MSGCAT], [msgcat])
AS_IF([test -z "$XGETTEXT" -o -z "$MSGFMT" -o -z "$MSGMERGE" -o -z "$MSGCAT"],
      [AC_MSG_FAILURE([gettext not found])])

# Define this so gettext.h works without requiring the whole gettext macro
CFLAGS="${CFLAGS} -DENABLE_NLS"

AM_PATH_PYTHON

AM_PROG_AR
AC_PROG_CC

LT_INIT

AC_CONFIG_FILES([Makefile src/Makefile src/bytesize.pc \
                 po/Makefile \
                 src/python/Makefile \
                 dist/Makefile dist/libbytesize.spec \
                 docs/Makefile docs/libbytesize-docs.xml \
                 tests/Makefile])

AC_CONFIG_FILES([tests/libbytesize_unittest.sh],
                [chmod +x tests/libbytesize_unittest.sh])

AC_CONFIG_FILES([tests/canary_tests.sh],
                [chmod +x tests/canary_tests.sh])


LIBBYTESIZE_PKG_CHECK_MODULES([PCRE], [libpcre >= 8.32])

AC_CHECK_LIB(gmp, __gmpz_init)

AC_CHECK_HEADERS([langinfo.h gmp.h mpfr.h stdint.h stdbool.h stdarg.h string.h stdio.h ctype.h],
                 [],
                 [LIBBYTESIZE_SOFT_FAILURE([Header file $ac_header not found.])],
                 [])

AC_ARG_WITH([python2],
    AS_HELP_STRING([--with-python2], [support python2 @<:@default=check@:>@]),
    [],
    [with_python2=check])

AC_SUBST(WITH_PYTHON2, 0)
if test "x$with_python2" != "xno"; then
    AC_PATH_PROG([python2], [python2], [no])
    AS_IF([test "x$python2" == "xno"],
    [if test "x$with_python2" = "xyes"; then
      LIBBYTESIZE_SOFT_FAILURE([Python2 support requested, but python2 is not available])
      fi],
    [AC_SUBST(WITH_PYTHON2, 1)])
fi
AM_CONDITIONAL(WITH_PYTHON2, test "x$with_python2" != "xno" -a "x$python2" != "xno")

AC_ARG_WITH([python3],
    AS_HELP_STRING([--with-python3], [support python3 @<:@default=check@:>@]),
    [],
    [with_python3=check])

AC_SUBST(WITH_PYTHON3, 0)
if test "x$with_python3" != "xno"; then
    AC_PATH_PROG([python3], [python3], [no])
    AS_IF([test "x$python3" == "xno"],
    [if test "x$with_python3" = "xyes"; then
      LIBBYTESIZE_SOFT_FAILURE([Python3 support requested, but python3 is not available])
      fi],
    [AC_SUBST(WITH_PYTHON3, 1)])
fi
AM_CONDITIONAL(WITH_PYTHON3, test "x$with_python3" != "xno" -a "x$python3" != "xno")


AC_ARG_WITH([gtk-doc],
    AS_HELP_STRING([--with-gtk-doc], [generate documentation with gtk-doc @<:@default=check@:>@]),
    [],
    [with_gtk_doc=check])

AC_SUBST(WITH_GTK_DOC, 0)
if test "x$with_gtk_doc" != "xno"; then
    AC_PATH_PROG([gtkdoc_scan], [gtkdoc-scan], [no])
    AS_IF([test "x$gtkdoc_scan" == "xno"],
    [if test "x$with_gtk_doc" = "xyes"; then
      LIBBYTESIZE_SOFT_FAILURE([Building documentation with gtk-doc requested, but not available])
      fi],
      [AC_SUBST(WITH_GTK_DOC, 1)])
fi
AM_CONDITIONAL(WITH_GTK_DOC, test "x$with_gtk_doc" != "xno" -a "x$gtkdoc_scan" != "xno")

AC_OUTPUT
LIBBYTESIZE_FAILURES