public software.sextractor

[/] [trunk/] [configure.ac] - Blame information for rev 194

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 bertin
# configure.in for SExtractor
2 177 bertin
# (C) E.Bertin 2002-2009
3 2 bertin
# Process this file with autoconf to produce a configure script.
4
# First, disable the annoying config.cache
5
define([AC_CACHE_LOAD],)
6
define([AC_CACHE_SAVE],)
7
 
8
# This is your standard Bertin source code...
9 194 bertin
AC_INIT(sextractor, 2.8.7, [bertin@iap.fr])
10 2 bertin
AC_CONFIG_SRCDIR(src/makeit.c)
11
AC_CONFIG_AUX_DIR(autoconf)
12
AM_CONFIG_HEADER(config.h)
13
AM_INIT_AUTOMAKE
14
date=`date +%Y-%m-%d`
15
date2=`date +"%a %b %d %Y"`
16
date3=`date +"%B %Y"`
17
AC_DEFINE_UNQUOTED(DATE, "$date", [Archive creation date])
18
AC_SUBST(PACKAGER, "Emmanuel Bertin")
19
AC_SUBST(DATE2, "$date2")
20
AC_SUBST(DATE3, "$date3")
21
 
22
# Include macros
23 173 bertin
sinclude(acx_atlas.m4)
24
sinclude(acx_fftw.m4)
25 2 bertin
sinclude(acx_prog_cc_optim.m4)
26 173 bertin
sinclude(acx_pthread.m4)
27
sinclude(acx_urbi_resolve_dir.m4)
28 2 bertin
 
29
# Display pakage and version number
30
AC_MSG_RESULT([*********** Configuring:  $PACKAGE $VERSION ($date) **********])
31
 
32
# Initialize the list of compilers to consider
33
cclist="cc gcc"
34
 
35
# Backup and reset the input CFLAGS and LDFLAGS
36
mycflags="$CFLAGS"
37
CFLAGS=""
38
myldflags="$LDFLAGS"
39
LDFLAGS=""
40
 
41
# Provide special option for the Linux Intel C compiler
42
AC_MSG_CHECKING([for Linux Intel C compiler mode])
43
AC_ARG_ENABLE(icc,
44
        [AC_HELP_STRING([--enable-icc],
45
        [Enable special mode for compilation with the Intel compiler \
46
(off by default)])],
47
        use_icc="yes"
48
        cclist="icc $cclist"
49
        AC_MSG_RESULT([yes]),
50
        use_icc="no"
51
        AC_MSG_RESULT([no]))
52
 
53
# Checks for programs.
54
# GCC is chosen last because it is likely to yield less optimized code
55 173 bertin
AC_LANG(C)
56 2 bertin
AC_PROG_CC([$cclist])
57 173 bertin
# C Compiler: Check that it is ANSI C and POSIX-compliant
58 2 bertin
AM_PROG_CC_STDC
59
AC_ISC_POSIX
60
ACX_PROG_CC_OPTIM
61 173 bertin
AC_DISABLE_STATIC
62
#AC_DISABLE_SHARED
63
AC_PROG_LIBTOOL
64 2 bertin
AC_PROG_INSTALL
65
 
66
# Checks for libraries.
67
AC_CHECK_LIB(m, sin)
68
 
69
# Checks for header files.
70
AC_HEADER_STDC
71 173 bertin
AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdlib.h string.h sys/mman.h \
72
                sys/types.h unistd.h])
73 2 bertin
 
74
# Checks for typedefs, structures, and compiler characteristics.
75
AC_C_CONST
76
AC_TYPE_OFF_T
77
AC_TYPE_SIZE_T
78
AC_STRUCT_TM
79
AC_TYPE_UID_T
80
 
81
# Checks for library functions.
82
AC_FUNC_ERROR_AT_LINE
83 173 bertin
#AC_FUNC_MALLOC
84 2 bertin
AC_FUNC_MMAP
85
AC_TYPE_SIGNAL
86
AC_FUNC_STAT
87
AC_FUNC_STRFTIME
88 173 bertin
AC_CHECK_FUNCS([atexit getenv memcpy memmove memset mkdir munmap strstr \
89
                sincos logf])
90 2 bertin
 
91
# Check support for large files
92
AC_SYS_LARGEFILE
93
AC_FUNC_FSEEKO
94
 
95 173 bertin
# Set the data directory to a true absolute path
96
datadir2=$(URBI_RESOLVE_DIR([$datadir]))
97 8 bertin
 
98 173 bertin
# Provide special options for ATLAS
99
AC_ARG_WITH(atlas,
100
        [AC_HELP_STRING([--with-atlas=],
101
        [Provide an alternative path to the ATLAS library])],
102
    atlas_libdir=$withval,
103
    atlas_libdir=""
104
    )
105
AC_ARG_WITH(atlas-incdir,
106
        [AC_HELP_STRING([--with-atlas-incdir=],
107
        [Provide an alternative path to the ATLAS include directory])],
108
    atlas_incdir=$withval,
109
    atlas_incdir=""
110
    )
111
 
112
# Provide special options for FFTW
113
AC_ARG_WITH(fftw,
114
        [AC_HELP_STRING([--with-fftw=],
115
        [Provide an alternative path to the FFTW library])],
116
    fftw_libdir=$withval,
117
    fftw_libdir=""
118
    )
119
AC_ARG_WITH(fftw-incdir,
120
        [AC_HELP_STRING([--with-fftw-incdir=],
121
        [Provide an alternative path to the FFTW include directory])],
122
    fftw_incdir=$withval,
123
    fftw_incdir=""
124
    )
125
 
126
# Provide a special option for the default XSLT URL
127
AC_ARG_WITH(xsl_url,
128
        [AC_HELP_STRING([--with-xsl_url=],
129
        [Provide an alternative default URL of the XSLT filter])],
130
        [xsl_url=$withval],
131
        [xsl_url="file://$datadir2/$PACKAGE_NAME/$PACKAGE_NAME.xsl"]
132
        )
133
 
134
AC_DEFINE_UNQUOTED([XSL_URL], "$xsl_url",[Default URL of the XSLT filter])
135
 
136
# Set flags for multithreading
137
n_pthreads=16
138
AC_ARG_ENABLE(threads,
139
        [AC_HELP_STRING([--enable-threads@<:@=@:>@],
140 181 bertin
        [Enable multhreading (on with up to 16 threads by default)])],
141 173 bertin
    if test "$enableval" = "no"; then
142
      use_pthreads="no"
143
    else
144
      use_pthreads="yes"
145
      if test "$enableval" != "yes"; then
146
        n_pthreads=$enableval
147
      fi
148
    fi,
149
    use_pthreads=yes
150
    )
151 194 bertin
# Deactivate multithreading for now
152
use_pthreads="no"
153 173 bertin
 
154
# Provide special option for gprof profiling
155
AC_MSG_CHECKING([for gprof profiler mode])
156
AC_ARG_ENABLE(gprof,
157
        [AC_HELP_STRING([--enable-gprof],
158
        [Enable special mode for compilation with the gprof profiler \
159
(off by default)])],
160
        use_gprof="yes"
161
        AC_MSG_RESULT([yes]),
162
        use_gprof="no"
163
        AC_MSG_RESULT([no]))
164
 
165
# Enable static linking
166
AC_MSG_CHECKING([static linking])
167
AC_ARG_ENABLE(static,
168
        [AC_HELP_STRING([--enable-static],
169
        [Enable static linking \
170
(off by default)])],
171
        use_static="yes"
172
        AC_MSG_RESULT([yes]),
173
        use_static="no"
174
        AC_MSG_RESULT([no]))
175
 
176
################# Actions to complete in case of multhreading ################
177
AC_DEFINE_UNQUOTED(THREADS_NMAX, $n_pthreads,[Maximum number of POSIX threads])
178
if test "$use_pthreads" = "yes"; then
179
  AC_MSG_CHECKING([for multithreading])
180
  AC_MSG_RESULT([maximum of $n_pthreads thread(s)])
181
  AC_DEFINE(USE_THREADS, 1, [Triggers multhreading])
182
# CC, CFLAGS and LIBS are system and compiler-dependent
183
  ACX_PTHREAD
184
  CC="$PTHREAD_CC"
185
  [CFLAGS="$CFLAGS $PTHREAD_CFLAGS -D_REENTRANT"]
186
  LIBS="$PTHREAD_LIBS $LIBS"
187 2 bertin
fi
188 173 bertin
AM_CONDITIONAL(USE_THREADS, test $use_pthreads = "yes")
189 2 bertin
 
190 173 bertin
################ handle the FFTW library (Fourier transforms) ################
191
ACX_FFTW($fftw_libdir,$fftw_incdir,$use_pthreads,no,
192
        [use_fftw=yes],[use_fftw=no])
193
if test "$use_fftw" = "yes"; then
194
  LIBS="$FFTW_LIBS $LIBS"
195
else
196
  AC_MSG_ERROR([$FFTW_ERROR Exiting.])
197
fi
198
 
199
################## handle the ATLAS library(linear algebra) ##################
200
ACX_ATLAS($atlas_libdir,$atlas_incdir,$use_pthreads,
201
        [use_atlas=yes],[use_atlas=no])
202
if test "$use_atlas" = "yes"; then
203
  LIBS="$ATLAS_LIB $LIBS"
204
else
205
  AC_MSG_ERROR([$ATLAS_ERROR Exiting.])
206
fi
207
 
208 2 bertin
# Link with gprof option
209
if test "$use_gprof" = "yes"; then
210
  if test "$use_icc" = "yes"; then
211
    CFLAGS="$CFLAGS -pq"
212
  else
213 173 bertin
    CFLAGS="$CFLAGS -pg"
214 2 bertin
  fi
215
  use_static="no"
216
fi
217
 
218 173 bertin
# Static linking option
219 2 bertin
if test "$use_static" = "yes"; then
220 173 bertin
  LDFLAGS="-static -shared-libgcc $LDFLAGS"
221 2 bertin
fi
222
 
223
# Override automatic CFLAGS and LDFLAGS with those of user
224 173 bertin
#if test -n "$mycflags"; then
225
#CFLAGS="$mycflags"
226
#fi
227
#if test -n "$myldflags"; then
228
#LDFLAGS="$myldflags"
229
#fi
230 2 bertin
 
231
# Display compiler and linker flags
232 173 bertin
AC_MSG_RESULT([***************************************************************])
233
AC_MSG_RESULT([Compile cmdline:  $CC $CFLAGS])
234
AC_MSG_RESULT([Link    cmdline:  $CC $LDFLAGS $LIBS])
235
AC_MSG_RESULT([Default XSLT URL: $xsl_url])
236
AC_MSG_RESULT([***************************************************************])
237 2 bertin
 
238 173 bertin
AC_CONFIG_FILES([
239
Makefile
240
src/Makefile
241
src/fits/Makefile
242
src/levmar/Makefile
243
src/wcs/Makefile
244
man/Makefile
245
tests/Makefile
246
sextractor.spec
247
man/sex.1])
248 2 bertin
AC_OUTPUT