-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
206 lines (181 loc) · 5.77 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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#
# configure.ac
#
# Process this file with autoconf to generate a configure script.
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#
# This file part of: EyE
#
# Copyright: (C) 2002-2010 Emmanuel Bertin -- IAP/CNRS/UPMC
# & Chiara Maramo -- IAP/CNRS
#
# License: GNU General Public License
#
# EyE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# EyE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with EyE. If not, see <http://www.gnu.org/licenses/>.
#
# Last modified: 09/10/2010
#
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# First, disable the annoying config.cache
define([AC_CACHE_LOAD],)
define([AC_CACHE_SAVE],)
# This is your standard Bertin source code...
AC_INIT(eye, 1.6.0, [bertin@iap.fr])
AC_CONFIG_SRCDIR(src/makeit.c)
AC_CONFIG_AUX_DIR(autoconf)
AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
date=`date +%Y-%m-%d`
date2=`date +"%a %b %d %Y"`
date3=`date +"%B %Y"`
AC_DEFINE_UNQUOTED(DATE, "$date", [Archive creation date])
AC_SUBST(PACKAGER, "Emmanuel Bertin")
AC_SUBST(DATE2, "$date2")
AC_SUBST(DATE3, "$date3")
# Include macros
sinclude(acx_pthread.m4)
sinclude(acx_prog_cc_optim.m4)
# Display pakage and version number
AC_MSG_RESULT([*********** Configuring: $PACKAGE $VERSION ($date) **********])
# Initialize the list of compilers to consider
cclist="cc gcc"
AC_MSG_CHECKING([if compilation flags are set automatically])
AC_ARG_ENABLE(auto-flags,
[AC_HELP_STRING([--enable-auto-flags],
[Let the configure script choose the compilation flags \
(off by default)])],
use_autoflag="yes"
AC_MSG_RESULT([yes]),
use_autoflag="no"
AC_MSG_RESULT([no]))
# Provide special option for the Linux Intel C compiler
AC_MSG_CHECKING([for Linux Intel C compiler mode])
AC_ARG_ENABLE(icc,
[AC_HELP_STRING([--enable-icc],
[Enable special mode for compilation with the Intel compiler \
(off by default)])],
use_icc="yes"
cclist="icc $cclist"
AC_MSG_RESULT([yes]),
use_icc="no"
AC_MSG_RESULT([no]))
# Checks for programs.
# GCC is chosen last because it is likely to yield less optimized code
AC_LANG(C)
AC_PROG_CC([$cclist])
# C Compiler: Check that it is ANSI C and POSIX-compliant
AM_PROG_CC_STDC
AC_ISC_POSIX
# Override automatic CFLAGS and LDFLAGS with those of user
if test "$use_autoflag" = "yes"; then
CFLAGS=""
LDFLAGS =""
ACX_PROG_CC_OPTIM
fi
AC_PROG_INSTALL
AC_PROG_RANLIB
# Checks for libraries.
AC_CHECK_LIB(m, sin)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/mman.h time.h unistd.h)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_CHECK_TYPES([unsigned long long, long long])
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MMAP
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([atexit getenv gethostname memcpy memmove memset mmap time])
# Check support for large files
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
# Set flags for multithreading
n_pthreads=16
AC_ARG_ENABLE(threads,
[AC_HELP_STRING([--enable-threads@<:@=<max_number_of_threads>@:>@],
[Enable multhreading (on with up to 16 threads by default)])],
if test "$enableval" = "no"; then
use_pthreads="no"
else
use_pthreads="yes"
if test "$enableval" != "yes"; then
n_pthreads=$enableval
fi
fi,
use_pthreads=yes
)
# Provide special option for gprof profiling
AC_MSG_CHECKING([for gprof profiler mode])
AC_ARG_ENABLE(gprof,
[AC_HELP_STRING([--enable-gprof],
[Enable special mode for compilation with the gprof profiler \
(off by default)])],
use_gprof="yes"
AC_MSG_RESULT([yes]),
use_gprof="no"
AC_MSG_RESULT([no]))
# Enable linking options for making the executable as portable as possible.
AC_MSG_CHECKING([best linking option])
AC_ARG_ENABLE(best-link,
[AC_HELP_STRING([--enable-best-link],
[Choose the right combination of static and dynamic linking to make \
the executable as portable as possible (off by default)])],
use_best="yes"
AC_MSG_RESULT([yes]),
use_best="no"
AC_MSG_RESULT([no]))
################# Actions to complete in case of multhreading ################
AC_DEFINE_UNQUOTED(THREADS_NMAX, $n_pthreads,[Maximum number of POSIX threads])
if test "$use_pthreads" = "yes"; then
AC_MSG_CHECKING([for multithreading])
AC_MSG_RESULT([maximum of $n_pthreads thread(s)])
AC_DEFINE(USE_THREADS, 1, [Triggers multhreading])
# CC, CFLAGS and LIBS are system and compiler-dependent
ACX_PTHREAD
CC="$PTHREAD_CC"
[AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS -D_REENTRANT"]
LIBS="$PTHREAD_LIBS $LIBS"
fi
AM_CONDITIONAL(USE_THREADS, test $use_pthreads = "yes")
if test "$use_gprof" = "yes"; then
if test "$use_icc" = "yes"; then
AM_CFLAGS="$AM_CFLAGS -pq"
else
AM_CFLAGS="$AM_CFLAGS -pg"
fi
use_best="no"
fi
# "Best" linking option
if test "$use_best" = "yes"; then
AM_LDFLAGS="-shared-libgcc -static-libtool-libs $AM_LDFLAGS"
fi
# Display compiler and linker flags
AC_MSG_RESULT([***************************************************************])
AC_MSG_RESULT([Compile cmdline: $CC $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS])
AC_MSG_RESULT([Link cmdline: $CC $AM_LDFLAGS $LDFLAGS $LIBS])
AC_MSG_RESULT([Default XSLT URL: $xsl_url])
AC_MSG_RESULT([***************************************************************])
AC_CONFIG_FILES([
Makefile
src/Makefile
src/fits/Makefile
man/Makefile
eye.spec
man/eye.1])
AC_OUTPUT