-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
138 lines (101 loc) · 3.07 KB
/
configure.in
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
dnl Process this file with autoconf to produce a configure script.
AC_INIT(cptutils, 1.59, j.j.green@gmx.fr)
m4_include([m4/ax_check_define.m4])
m4_include([m4/ax_check_compile_flag.m4])
dnl Checks for programs.
AC_PROG_CC
AX_CHECK_COMPILE_FLAG([-Wall],
AC_SUBST(CFEXTRA, [-Wall]),
AC_SUBST(CFEXTRA, []))
AX_CHECK_COMPILE_FLAG([-Wno-unused-but-set-variable],
AC_SUBST(CFNUBS, [-Wno-unused-but-set-variable]),
AC_SUBST(CFNUBS, []))
AC_PROG_CC_STDC
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PATH_PROG(PYTHON, python, no)
if test "$PYTHON" = no; then
AC_MSG_WARN(no python! (no convert-gradient for you))
fi
AC_PATH_PROG(GGO, gengetopt, no)
if test "$GGO" = no; then
AC_MSG_WARN(no gengetopt! (not needed for compile))
fi
AC_PATH_PROG(GPERF, gperf, no)
if test "$GPERF" = no; then
AC_MSG_WARN(no gperf! (not needed for compile))
fi
AC_PATH_PROG(XML2C, xml2-config, no)
if test "$XML2C" = no
then
AC_MSG_ERROR(no xml2-config! please install libxml2)
else
CFLAGS="$CFLAGS `$XML2C --cflags`"
LIBS="$LIBS `$XML2C --libs`"
fi
AC_PATH_PROG(XSLTP, xsltproc, no)
if test "$XSLTP" = no; then
AC_MSG_WARN(no xsltproc! (not needed for compile))
fi
if test "$GCC"x = yesx; then
CFLAGS="$CFLAGS $CFXTRA"
fi
AC_PATH_PROG(BC, bc, no)
if test "$BC" = no; then
AC_MSG_WARN(no bc! (not needed for compile))
fi
dnl Checks for libraries.
AC_CHECK_LIB(m, pow)
AC_CHECK_LIB(png, png_create_read_struct, [], AC_MSG_ERROR(libpng not found))
AC_CHECK_LIB(jansson, json_pack, [], AC_MSG_WARN(libjansson not found))
AC_SEARCH_LIBS(iconv, iconv, [], AC_MSG_ERROR(iconv not found))
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(iconv.h)
AC_CHECK_HEADERS(locale.h)
AC_CHECK_HEADERS(png.h)
AC_CHECK_HEADERS(search.h)
AC_CHECK_HEADERS(jansson.h)
dnl Checks for library functions.
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(getopt)
AC_CHECK_FUNCS(tsearch)
AC_CHECK_FUNCS(hsearch)
dnl special case, check for be64toh which is usually a
dnl macro defined in endian.h
AC_CHECK_HEADERS([endian.h],
AX_CHECK_DEFINE([endian.h], [be64toh],,
AC_CHECK_FUNCS(be64toh)))
AC_CHECK_HEADERS([sys/endian.h],
AX_CHECK_DEFINE([endian.h], [be64toh],,
AC_CHECK_FUNCS(be64toh)))
dnl cunit option
opt_enable_tests=no
AC_ARG_ENABLE(tests,
AC_HELP_STRING([--enable-tests],[unit testing support (default is no)]),
[ opt_enable_tests=$enableval ])
if test $opt_enable_tests = yes; then
AC_CHECK_LIB(cunit, CU_add_test)
AC_SUBST(WITH_UNIT, 1)
AC_PATH_PROG(XML2, xml2, no)
if test "$XML2" = no ; then
AC_MSG_ERROR(need xml2 program)
fi
fi
opt_enable_coverage=no
AC_ARG_ENABLE(coverage,
AC_HELP_STRING([--enable-coverage], [code coverage (default is no)]),
[ opt_enable_coverage=$enableval ])
if test $opt_enable_coverage = yes; then
CFLAGS="$CFLAGS --coverage"
LDFLAGS="$LDFLAGS --coverage"
fi
dnl used by gengetop output
AC_DEFINE(VERSION, PACKAGE_VERSION, "version of package")
dnl used in Common.mk
AC_SUBST(PACKAGE_VERSION)
dnl Make a config.h
AC_CONFIG_HEADER(src/common/config.h)
dnl Create Makefile data
AC_OUTPUT([Makefile src/Common.mk])