-
Notifications
You must be signed in to change notification settings - Fork 138
Expand file tree
/
Copy pathconfigure.ac
More file actions
135 lines (110 loc) · 4.45 KB
/
Copy pathconfigure.ac
File metadata and controls
135 lines (110 loc) · 4.45 KB
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([vsearch], [2.31.0], [torognes@ifi.uio.no], [vsearch], [https://github.com/torognes/vsearch])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([subdir-objects])
# Ship the generated build files (configure, Makefile.in, ...) and treat them
# as authoritative: do NOT let `make` regenerate them from configure.ac/*.am
# via the autotools rebuild rules. This decouples an ordinary build from having
# a specific autoconf/automake version installed (a fresh checkout has no
# reason to match the exact version that produced the committed files, and git
# does not preserve mtimes, so the rebuild rules would otherwise fire and fail).
# Regenerate deliberately with `./autogen.sh` after editing configure.ac/*.am;
# CI does this explicitly. Pass --enable-maintainer-mode to opt back in.
AM_MAINTAINER_MODE([disable])
AC_LANG([C++])
AC_CONFIG_SRCDIR([src/vsearch.cc])
AC_CONFIG_HEADERS([config.h])
AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
MACOSX_DEPLOYMENT_TARGET="10.9"
# Checks for programs.
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_INSTALL
# Threading support for C++11 std::thread. The -pthread flag is applied
# at both compile and link time (CXXFLAGS is used for linking too): it
# defines _REENTRANT and pulls in the correct platform threading library
# (-lpthread on glibc, -lthr on FreeBSD, winpthreads on MinGW, the
# native library on macOS), which a bare -lpthread does not do portably.
CXXFLAGS="$CXXFLAGS -pthread"
# Checks for libraries.
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([psapi], [GetProcessMemoryInfo])
# Checks for header files.
AC_CHECK_HEADERS([getopt.h fcntl.h regex.h string.h sys/time.h dlfcn.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_UINT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_CHECK_FUNCS([memmove memcpy posix_memalign gettimeofday localtime memchr memset pow regcomp strchr strcspn sysinfo])
have_bzip2=no
AC_ARG_ENABLE(bzip2, AS_HELP_STRING([--disable-bzip2], [Disable bzip2 support]))
AS_IF([test "x$enable_bzip2" != "xno"], [
have_bzip2=yes
])
if test "x${have_bzip2}" = "xyes"; then
AC_CHECK_HEADERS([bzlib.h], [], [have_bzip2=no])
fi
have_zlib=no
AC_ARG_ENABLE(zlib, AS_HELP_STRING([--disable-zlib], [Disable zlib support]))
AS_IF([test "x$enable_zlib" != "xno"], [
have_zlib=yes
])
if test "x${have_zlib}" = "xyes"; then
AC_CHECK_HEADERS([zlib.h], [], [have_zlib=no])
fi
have_ps2pdf=no
AC_ARG_ENABLE(pdfman, AS_HELP_STRING([--disable-pdfman], [Disable PDF manual creation]))
AS_IF([test "x$enable_pdfman" != "xno"], [
have_ps2pdf=yes
AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, yes, no)
if test "x$HAVE_PS2PDF" = "xno"; then
AC_MSG_WARN([*** ps2pdf is required to build a PDF version of the manual])
have_ps2pdf=no
fi
])
# Check for --enable-profiling option
AC_ARG_ENABLE([profiling],
[AS_HELP_STRING([--enable-profiling], [Enable profiling build])],
[enable_profiling=$enableval],
[enable_profiling=no])
# Define AM_CONDITIONAL for profiling
AM_CONDITIONAL([ENABLE_PROFILING], [test "x$enable_profiling" = "xyes"])
# Check for --enable-debug option
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [Enable debug build])],
[enable_debug=$enableval],
[enable_debug=no])
# Define AM_CONDITIONAL for debug
AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = "xyes"])
have_man_html=no
case $target in
aarch64*) target_aarch64="yes" ;;
powerpc64*) target_ppc="yes" ;;
x86_64* | amd64*) target_x86_64="yes" ;;
esac
case $target in
*-apple-*) target_apple="yes" ;;
esac
case $target in
*freebsd*) target_freebsd="yes" ;;
esac
AC_CHECK_HEADERS([windows.h], [AM_CONDITIONAL(TARGET_WIN, true)], [AM_CONDITIONAL(TARGET_WIN, false)])
AM_CONDITIONAL(HAVE_PS2PDF, test "x${have_ps2pdf}" = "xyes")
AM_CONDITIONAL(HAVE_MAN_HTML, test "x${have_man_html}" = "xyes")
AM_CONDITIONAL(TARGET_PPC, test "x${target_ppc}" = "xyes")
AM_CONDITIONAL(TARGET_AARCH64, test "x${target_aarch64}" = "xyes")
AM_CONDITIONAL(TARGET_X86_64, test "x${target_x86_64}" = "xyes")
AM_CONDITIONAL(TARGET_APPLE, test "x${target_apple}" = "xyes")
AM_CONDITIONAL(TARGET_FREEBSD, test "x${target_freebsd}" = "xyes")
AM_CONDITIONAL(TARGET_X86_64_SIMD, test "x${target_x86_64}" = "xyes" -a "x${target_apple}" != "xyes")
AM_PROG_CC_C_O
AC_CONFIG_FILES([Makefile
src/Makefile
man/Makefile])
AC_OUTPUT