-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
113 lines (93 loc) · 3.51 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
110
111
112
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT(OPTICS, 1.2.0, jens@jkleinj.eu)
AC_CONFIG_SRCDIR([src/arg.c])
AC_CONFIG_HEADERS([src/config.h])
AM_INIT_AUTOMAKE
AC_SUBST(INTI_CFLAGS)
AC_SUBST(INTI_LIBS)
# Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
# Checks for libraries.
AC_CHECK_LIB([m], [cos])
# Checks for header files.
AC_CHECK_HEADERS([float.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
# Enable the use of angle coordinates
# allow Makefile.am to use DATAANG in conditional compilation and disable option by default
AM_CONDITIONAL(DATAANG, false)
# 'configure --enable-data-ang' enables DATAANG and defines it in config.h
AC_ARG_ENABLE(data-ang,
[ --enable-data-ang Enable data-ang],
[AM_CONDITIONAL(DATAANG, true) AC_DEFINE(DATAANG, [], [input data in angle format])]
)
# Enable the use of strings
# allow Makefile.am to use DATASTR in conditional compilation and disable option by default
AM_CONDITIONAL(DATASTR, false)
# 'configure --enable-data-str' enables DATASTR and defines it in config.h
AC_ARG_ENABLE(data-str,
[ --enable-data-str Enable data-str],
[AM_CONDITIONAL(DATASTR, true) AC_DEFINE(DATASTR, [], [input data in str format])]
)
# Enable the use of vec coordinates
# allow Makefile.am to use DATAVEC in conditional compilation and disable by default
AM_CONDITIONAL(DATAVEC, false)
# 'configure --enable-data-vec' enables DATAVEC and defines it in config.h
AC_ARG_ENABLE(data-vec,
[ --enable-data-vec Enable data-vec],
[AM_CONDITIONAL(DATAVEC, true) AC_DEFINE(DATAVEC, [], [input data in vec format])]
)
# Enable the use of xyz coordinates
# allow Makefile.am to use DATAXYZ in conditional compilation and disable by default
AM_CONDITIONAL(DATAXYZ, false)
# 'configure --enable-data-xyz' enables DATAXYZ and defines it in config.h
AC_ARG_ENABLE(data-xyz,
[ --enable-data-xyz Enable data-xyz],
[AM_CONDITIONAL(DATAXYZ, true) AC_DEFINE(DATAXYZ, [], [input data in xyz format])]
)
# Enable the use of distance matrix
# allow Makefile.am to use DATADIST in conditional compilation and disable by default
AM_CONDITIONAL(DATADIST, false)
# 'configure --enable-data-dist' enables DATADIST and defines it in config.h
AC_ARG_ENABLE(data-dist,
[ --enable-data-dist Enable data-dist],
[AM_CONDITIONAL(DATADIST, true) AC_DEFINE(DATADIST, [], [input data in distance format])]
)
# Enable pattern matching library
AC_ARG_WITH(pcre,
[ --with-pcre=<path> prefix of pcre installation (eg /usr/local)],
[
CPPFLAGS="$CPPFLAGS -I $withval/include"
LDFLAGS="$LDFLAGS -L $withval/lib"
]
)
# look for pcre pattern matching library
AC_CHECK_HEADERS(pcre.h,
AC_SEARCH_LIBS([pcre_compile], [pcre]),
AC_MSG_WARN([*** pcre.h not found -- consider using --with-pcre])
)
# enable debug
AC_ARG_ENABLE(debug,
[ --enable-debug Turn on debugging], [ac_use_debug="yes"], [ac_use_debug="no"])
if test "$ac_use_debug" = "yes"; then
CFLAGS="-ggdb"
AC_DEFINE(DEBUG,1,[Define to compile with DEBUG settings.])
fi
# enable profiling
AC_ARG_ENABLE(profiling,
[ --enable-profiling Turn on profiling], [ac_use_profiling="yes"], [ac_use_profiling="no"])
if test "$ac_use_profiling" = "yes"; then
CFLAGS="-pg -O2"
AC_DEFINE(PROFILING,1,[Define to compile with PROFILING settings.])
fi
AC_CHECK_FUNCS([pow sqrt])
AC_CONFIG_FILES([Makefile
src/Makefile
tests/Makefile])
AC_OUTPUT