forked from libxls/libxls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
109 lines (86 loc) · 3.22 KB
/
configure.ac
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
AC_INIT([libxls],[1.6.2],[https://github.com/libxls/libxls/issues], [libxls], [https://github.com/libxls/libxls])
AC_CONFIG_SRCDIR([test/test.c])
LIBXLS_MAJOR_VERSION=1
LIBXLS_MINOR_VERSION=6
LIBXLS_MICRO_VERSION=2
VERSION=$LIBXLS_MAJOR_VERSION.$LIBXLS_MINOR_VERSION.$LIBXLS_MICRO_VERSION
# if libxls ever goes to 2.0 you will need to change the following line to
# start at whatever the ending value was in the 1.x series E.g. if the last
# minor release was 1.9 then the value of "current" was 11 so the line should
# be changed to `expr 12 + $LIBXLS_MINOR_VERSION`
VERSION_INFO=`expr 2 + $LIBXLS_MINOR_VERSION`:$LIBXLS_MICRO_VERSION
AC_SUBST(VERSION_INFO)
AC_SUBST(LIBXLS_MAJOR_VERSION)
AC_SUBST(LIBXLS_MINOR_VERSION)
AC_SUBST(LIBXLS_MICRO_VERSION)
# Define those values into C code
AC_DEFINE_UNQUOTED([LIBXLS_MAJOR_VERSION],$LIBXLS_MAJOR_VERSION,[Major version])
AC_DEFINE_UNQUOTED([LIBXLS_MINOR_VERSION],$LIBXLS_MINOR_VERSION,[Minor version])
AC_DEFINE_UNQUOTED([LIBXLS_MICRO_VERSION],$LIBXLS_MICRO_VERSION,[Micro version])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_SILENT_RULES([yes])
LT_INIT([win32-dll disable-static])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CONFIG_HEADERS([config.h])
AC_PREFIX_DEFAULT(/usr/local)
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11([], [optional])
AS_IF([test "x$HAVE_CXX11" != x1], [
AC_MSG_NOTICE([---])
AC_MSG_NOTICE([No C++11 support, will skip C++ tests.])
AC_MSG_NOTICE([---])
])
AM_CONDITIONAL([HAVE_CXX11], [test x$HAVE_CXX11 = x1])
AC_CHECK_FUNCS([strdup wcstombs_l])
AC_CHECK_HEADERS([wchar.h xlocale.h])
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_TYPE_SIZE_T
AC_ARG_ENABLE([fuzz-testing], AS_HELP_STRING([--enable-fuzz-testing], ["Enable fuzz testing (requires Clang 6 or later)"]), [
AC_MSG_CHECKING([whether $CC accepts -fsanitize=fuzzer])
tmp_saved_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS -fsanitize=fuzzer"
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
[
AC_MSG_RESULT(yes)
fuzzer=yes],
AC_MSG_RESULT(no)
AC_MSG_FAILURE([-fsanitize=fuzzer not supported (Required with --enable-fuzz-testing)]))
_AC_LANG_PREFIX[]FLAGS=$tmp_saved_flags
], [fuzzer=no])
AM_CONDITIONAL([FUZZER_ENABLED], test "x$fuzzer" = "xyes")
AC_ARG_VAR([LIB_FUZZING_ENGINE], [Location of prebuilt fuzzing engine library])
AC_SUBST([LIB_FUZZING_ENGINE])
AS_CASE([$host],
[*mingw*|*cygwin*], [EXTRA_LDFLAGS="-no-undefined"], [EXTRA_LDFLAGS=""])
AC_SUBST([EXTRA_LDFLAGS])
AM_ICONV
m4_ifdef([PKG_INSTALLDIR], [
PKG_INSTALLDIR
], [
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir],
[pkg-config installation directory @<:@'${libdir}/pkgconfig'@:>@])],,
[with_pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
])
LIBXLS_LIBS="$LTLIBICONV $LIBS"
AC_SUBST(LIBXLS_LIBS)
AC_CONFIG_FILES([Makefile libxls.pc])
AC_OUTPUT
AC_MSG_NOTICE([---])
AC_MSG_NOTICE([catdoc users: avoid xls2csv conflicts, use ./configure --program-prefix=lib to get libxls2csv])
AC_MSG_NOTICE([---])
AC_MSG_RESULT([
Configuration:
C compiler: $CC
C++ compiler: $CXX
CFLAGS: $CFLAGS
CXXFLAGS: $CXXFLAGS
LIBS: $LIBXLS_LIBS
Host: $host
Extra ld flags: $EXTRA_LDFLAGS])