configure.ac 12.3 KB
Newer Older
1 2
# Process this file with autoconf to produce a configure script.

Raphal Poss's avatar
Raphal Poss committed
3
AC_PREREQ([2.54])
Raphal Poss's avatar
empty  
Raphal Poss committed
4

Nicolas Burrus's avatar
Nicolas Burrus committed
5
AC_INIT([Olena], OLN_VERSION, OLN_CONTACT, [olena])
Nicolas Burrus's avatar
Nicolas Burrus committed
6 7
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_SRCDIR([config/oln.m4])
Raphal Poss's avatar
Raphal Poss committed
8
AM_INIT_AUTOMAKE([1.7 no-define foreign dist-bzip2])
Raphal Poss's avatar
Raphal Poss committed
9
AC_CONFIG_HEADERS([config.h:config.hin])
10

Raphal Poss's avatar
Raphal Poss committed
11
# Use included Olena version.
Nicolas Burrus's avatar
Nicolas Burrus committed
12 13
NTG_PATH_LOCAL([integre])
MLC_PATH_LOCAL([metalic])
Nicolas Burrus's avatar
Nicolas Burrus committed
14
OLN_PATH_LOCAL([olena])
Raphal Poss's avatar
Raphal Poss committed
15
AC_WITH_OLN
Nicolas Burrus's avatar
Nicolas Burrus committed
16

Raphal Poss's avatar
Raphal Poss committed
17 18 19 20 21 22 23 24 25 26 27 28
# Some library archives are used. Some C code used.
AC_PROG_RANLIB
AC_PROG_CC

# If available, use these.
AC_WITH_CXX_ZLIB
AC_WITH_CXX_FFTW

# Attempt to use strict language conformance checking.
AC_CXX_FLAGS

AC_CONFIG_FILES([Makefile
29 30
		 integre/Makefile
		 integre/ntg/Makefile
Nicolas Burrus's avatar
Nicolas Burrus committed
31
                 metalic/Makefile
Raphal Poss's avatar
Raphal Poss committed
32
                 metalic/mlc/Makefile
Nicolas Burrus's avatar
Nicolas Burrus committed
33 34
		 olena/Makefile
		 olena/img/Makefile
Nicolas Burrus's avatar
Nicolas Burrus committed
35
		 olena/oln/Makefile
Nicolas Burrus's avatar
Nicolas Burrus committed
36
		 olena/oln/config/pconf.hh:olena/oln/config/pconf-hh.in])
Raphal Poss's avatar
Raphal Poss committed
37 38

### Olena components.
Raphal Poss's avatar
empty  
Raphal Poss committed
39

Raphal Poss's avatar
Raphal Poss committed
40 41
OLN_COLLECTION([OLN_TOP], 
[dnl
Raphal Poss's avatar
Raphal Poss committed
42 43 44 45 46 47 48 49

###
### Stuff pertaining to the main source tree
###

  OLN_COLLECTION([OLN_SRC], 
  [dnl

Raphal Poss's avatar
Raphal Poss committed
50 51
### Checks pertaining to the generation of auxiliary images

Raphal Poss's avatar
Raphal Poss committed
52
     AC_ARG_VAR([GZIP], [the gzip program])
Raphal Poss's avatar
Raphal Poss committed
53
     AC_CHECK_PROGS([GZIP], [gzip], [$am_aux_dir/missing gzip])
Raphal Poss's avatar
Raphal Poss committed
54
     AC_ARG_VAR([PNGTOPNM], [program to convert Portable Network Graphics files to Portable Anymaps])
Raphal Poss's avatar
Raphal Poss committed
55
     AC_CHECK_PROGS([PNGTOPNM], [pngtopnm], [$am_aux_dir/missing pngtopnm])
Raphal Poss's avatar
Raphal Poss committed
56
     AC_ARG_VAR([PPMTOPGM], [program to convert Portable Pixmaps to Portable Greymaps])
Raphal Poss's avatar
Raphal Poss committed
57
     AC_CHECK_PROGS([PPMTOPGM], [ppmtopgm], [$am_aux_dir/missing ppmtopgm])
Raphal Poss's avatar
Raphal Poss committed
58
     AC_ARG_VAR([PGMTOPBM], [program to convert Portable Greymaps to Portable Bitmaps])
Raphal Poss's avatar
Raphal Poss committed
59
     AC_CHECK_PROGS([PGMTOPBM], [pgmtopbm], [$am_aux_dir/missing pgmtopbm])
Raphal Poss's avatar
Raphal Poss committed
60
     AC_ARG_VAR([PNMTOPLAINPNM], [program to convert Portable Anymaps to plain text])
Raphal Poss's avatar
Raphal Poss committed
61
     AC_CHECK_PROGS([PNMTOPLAINPNM], [pnmtoplainpnm], [$am_aux_dir/missing pnmtoplainpnm])
Jean-Sébastien Mouret's avatar
Jean-Sébastien Mouret committed
62 63
     AC_ARG_VAR([PNMDEPTH], [program to change depth of Portable Anymaps])
     AC_CHECK_PROGS([PNMDEPTH], [pnmdepth], [$am_aux_dir/missing pnmdepth])
Raphal Poss's avatar
Raphal Poss committed
64
     AC_ARG_VAR([IMAGEMAGICK_CONVERT], [the `convert' utility from ImageMagick])
Raphal Poss's avatar
Raphal Poss committed
65 66
     AC_CHECK_PROGS([IMAGEMAGICK_CONVERT], [convert], [$am_aux_dir/missing convert])

Raphal Poss's avatar
Raphal Poss committed
67 68 69 70 71 72
### Checks pertaining to the generation of man pages

     AC_ARG_VAR([HELP2MAN], [utility to make man pages from program options])
     AC_CHECK_PROGS([HELP2MAN], [help2man], [$am_aux_dir/missing help2man])
     AC_CACHE_CHECK([whether to re-generate manual pages from programs],
                    [oln_cv_regen_manpages],
Raphal Poss's avatar
Raphal Poss committed
73
                    [oln_cv_regen_manpages=yes
Raphal Poss's avatar
Raphal Poss committed
74 75
                     AC_ARG_ENABLE([manpages-regen],
                                   [AC_HELP_STRING([--disable-manpages-regen],
Raphal Poss's avatar
Raphal Poss committed
76
                                                   [force disable regeneration of manual pages])],
Raphal Poss's avatar
Raphal Poss committed
77 78 79 80
                                   [oln_cv_regen_manpages=$enableval])
                    ])
                     

Raphal Poss's avatar
Raphal Poss committed
81
     AM_CONDITIONAL([REGEN_MANPAGES], [test "x$oln_cv_regen_manpages" != xno])
Raphal Poss's avatar
Raphal Poss committed
82

Raphal Poss's avatar
Raphal Poss committed
83 84 85 86 87 88 89 90 91 92 93
### Compiler-specific auto-configuration
    AC_CACHE_CHECK([whether to enable auto-configuration for multiple compilers],
                   [oln_cv_enable_config_sh],
                   [oln_cv_enable_config_sh=yes
                    AC_ARG_WITH([config-sh],
                          [AC_HELP_STRING([--without-config-sh],
                          [disable generation of oln-config-xxx.sh])],
                          [oln_cv_enable_config_sh=$withval])])
    AM_CONDITIONAL([OLN_CONFIG_SH], [test "x$oln_cv_enable_config_sh" != xno])
       

Raphal Poss's avatar
Raphal Poss committed
94 95
### The testsuite is a component.

Nicolas Burrus's avatar
Nicolas Burrus committed
96 97 98 99
    ##
    ## olena testsuite
    ##
   
Nicolas Burrus's avatar
Nicolas Burrus committed
100
    OLN_COMPONENT([olena/tests], 
Nicolas Burrus's avatar
Nicolas Burrus committed
101
		  [oln-testsuite], 
Raphal Poss's avatar
Raphal Poss committed
102
		  [oln_cv_build_tests], 
Nicolas Burrus's avatar
Nicolas Burrus committed
103
		  [the olena's testsuite], 
Raphal Poss's avatar
Raphal Poss committed
104
		  [OLN_SRC], 
Nicolas Burrus's avatar
Nicolas Burrus committed
105
	          [olena/tests/Makefile
Nicolas Burrus's avatar
Nicolas Burrus committed
106 107
		   olena/tests/check/Makefile
		   olena/tests/check/defs],
Raphal Poss's avatar
Raphal Poss committed
108 109 110 111 112 113
    [dnl Configuration for the testsuite

      OLN_TESTS_SUBDIRS=""

      AC_CACHE_CHECK([for selection of tests],
                     [oln_cv_tests_selection],
Nicolas Burrus's avatar
Nicolas Burrus committed
114 115
                     [AC_ARG_WITH([oln-tests],
    	                          [AC_HELP_STRING([--with-oln-tests=<list>],
Nicolas Burrus's avatar
Nicolas Burrus committed
116
                                                  [none,all,convert,convol,io,morpho,sanity,transforms])],
Raphal Poss's avatar
Raphal Poss committed
117 118 119 120 121
                                  [oln_cv_tests_selection=$withval],
                                  [oln_cv_tests_selection=all])dnl
                     ])dnl
      

Raphal Poss's avatar
Raphal Poss committed
122
      # OLN_TESTS defined in oln-local.m4
Raphal Poss's avatar
Raphal Poss committed
123 124 125
      OLN_TESTS([arith])
      OLN_TESTS([convert])
      OLN_TESTS([convol])
Nicolas Burrus's avatar
Nicolas Burrus committed
126
      OLN_TESTS([core])
Raphal Poss's avatar
Raphal Poss committed
127 128 129
      OLN_TESTS([io])
      OLN_TESTS([morpho])
      OLN_TESTS([sanity])
Sylvain Berlemont's avatar
Sylvain Berlemont committed
130
      OLN_TESTS([topo])
Raphal Poss's avatar
Raphal Poss committed
131 132 133 134
      OLN_TESTS([transforms])

      AC_SUBST([OLN_TESTS_SUBDIRS])

Nicolas Burrus's avatar
Nicolas Burrus committed
135
    ], [tests])dnl End of OLN_COMPONENT([olena/tests])
Raphal Poss's avatar
Raphal Poss committed
136

Nicolas Burrus's avatar
Nicolas Burrus committed
137 138 139 140 141
  ])dnl End of OLN_COLLECTION([OLN_SRC])

  OLN_COLLECTION([NTG_SRC], 
  [dnl

Nicolas Burrus's avatar
Nicolas Burrus committed
142 143 144 145 146 147 148 149
    ##
    ## integre testsuite
    ##
   
    OLN_COMPONENT([integre/tests], 
		  [ntg-testsuite], 
		  [ntg_cv_build_tests], 
		  [the integre's testsuite], 
Nicolas Burrus's avatar
Nicolas Burrus committed
150
		  [NTG_SRC], 
Nicolas Burrus's avatar
Nicolas Burrus committed
151
	          [integre/tests/Makefile
Nicolas Burrus's avatar
Nicolas Burrus committed
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
		   integre/tests/check/defs],
    [dnl Configuration for the testsuite

      NTG_TESTS_SUBDIRS=""

      AC_CACHE_CHECK([for selection of tests],
                     [ntg_cv_tests_selection],
                     [AC_ARG_WITH([ntg-tests],
    	                          [AC_HELP_STRING([--with-ntg-tests=<list>],
                                                  [none,types])],
                                  [ntg_cv_tests_selection=$withval],
                                  [ntg_cv_tests_selection=all])dnl
                     ])dnl
      

      # NTG_TESTS defined in oln-local.m4
      NTG_TESTS([types])

      AC_SUBST([NTG_TESTS_SUBDIRS])

    ], [tests])dnl End of OLN_COMPONENT([integre/tests])

Nicolas Burrus's avatar
Nicolas Burrus committed
174 175 176 177 178
  ])dnl End of OLN_COLLECTION([NTG_SRC])

  OLN_COLLECTION([MLC_SRC], 
  [dnl

Nicolas Burrus's avatar
Nicolas Burrus committed
179 180 181 182 183 184 185 186
    ##
    ## metalic testsuite
    ##
   
    OLN_COMPONENT([metalic/tests], 
		  [mlc-testsuite], 
		  [mlc_cv_build_tests], 
		  [the metalic's testsuite], 
Nicolas Burrus's avatar
Nicolas Burrus committed
187
		  [MLC_SRC], 
Nicolas Burrus's avatar
Nicolas Burrus committed
188 189 190
	          [metalic/tests/Makefile
                   metalic/tests/check/Makefile
		   metalic/tests/check/defs],
Nicolas Burrus's avatar
Nicolas Burrus committed
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
    [dnl Configuration for the testsuite

      MLC_TESTS_SUBDIRS=""

      AC_CACHE_CHECK([for selection of tests],
                     [mlc_cv_tests_selection],
                     [AC_ARG_WITH([mlc-tests],
    	                          [AC_HELP_STRING([--with-mlc-tests=<list>],
                                                  [none,array,main])],
                                  [mlc_cv_tests_selection=$withval],
                                  [mlc_cv_tests_selection=all])dnl
                     ])dnl
      

      # MLC_TESTS defined in oln-local.m4
      MLC_TESTS([array])
      MLC_TESTS([main])

      AC_SUBST([MLC_TESTS_SUBDIRS])

Nicolas Burrus's avatar
Nicolas Burrus committed
211
    ], [tests])dnl End of OLN_COMPONENT([metalic/tests])
Raphal Poss's avatar
Raphal Poss committed
212

Nicolas Burrus's avatar
Nicolas Burrus committed
213
  ])dnl End of OLN_COLLECTION([MLC_SRC])
Nicolas Burrus's avatar
Nicolas Burrus committed
214

Raphal Poss's avatar
Raphal Poss committed
215 216 217 218 219 220
###
### Stuff pertaining to the documentation
###  

### The documentation tree is both a component...

Raphal Poss's avatar
Raphal Poss committed
221 222 223 224 225
  OLN_COMPONENT([doc], 
	        [doc], 
	        [oln_cv_build_doc], 
	        [the documentation], 
	        [OLN_TOP],
Raphal Poss's avatar
Raphal Poss committed
226 227 228 229
	        [doc/Makefile],
  [OLN_COLLECTION([OLN_DOC], dnl ... and a collection.
  [dnl

Raphal Poss's avatar
Raphal Poss committed
230
### The reference manuals directory is a component.
Raphal Poss's avatar
Raphal Poss committed
231

Raphal Poss's avatar
Raphal Poss committed
232 233
    OLN_COMPONENT([doc/ref], 
	          [doc-ref], 
Raphal Poss's avatar
Raphal Poss committed
234
	          [oln_cv_build_ref], 
Raphal Poss's avatar
Raphal Poss committed
235
	          [the Olena reference manuals], 
Raphal Poss's avatar
Raphal Poss committed
236
	          [OLN_DOC], 
Raphal Poss's avatar
Raphal Poss committed
237
		  [doc/ref/Makefile],
Raphal Poss's avatar
Raphal Poss committed
238 239
    [dnl Configuration for the manuals directory.

Raphal Poss's avatar
Raphal Poss committed
240
     AC_ARG_VAR([TAR], [the tape archiver program])
Raphal Poss's avatar
Raphal Poss committed
241
     AC_CHECK_PROGS([TAR], [tar], [$am_aux_dir/missing tar])
Raphal Poss's avatar
Raphal Poss committed
242
     AC_ARG_VAR([DVIPS], [program to make Postscript from TeX DVI files])
Raphal Poss's avatar
Raphal Poss committed
243
     AC_CHECK_PROGS([DVIPS], [dvips], [$am_aux_dir/missing dvips])
Raphal Poss's avatar
Raphal Poss committed
244
     AC_ARG_VAR([TEXI2DVI], [program to create DVI from Texinfo files])
Raphal Poss's avatar
Raphal Poss committed
245
     AC_CHECK_PROGS([TEXI2DVI], [texi2dvi], [$am_aux_dir/missing texi2dvi])
Raphal Poss's avatar
Raphal Poss committed
246
     AC_ARG_VAR([GETDEFS], [the `getdefs' utility from Autogen])
Raphal Poss's avatar
Raphal Poss committed
247
     AC_CHECK_PROGS([GETDEFS], [getdefs], [$am_aux_dir/missing getdefs])
Raphal Poss's avatar
Raphal Poss committed
248
     AC_ARG_VAR([HEVEA], [program to make HTML pages from TeX])
Raphal Poss's avatar
Raphal Poss committed
249
     AC_CHECK_PROGS([HEVEA], [hevea], [$am_aux_dir/missing hevea])
Raphal Poss's avatar
Raphal Poss committed
250
     AC_ARG_VAR([EPSTOPDF], [program to convert Encapsulated Postscript images to PDF])
Raphal Poss's avatar
Raphal Poss committed
251
     AC_CHECK_PROGS([EPSTOPDF], [epstopdf], [$am_aux_dir/missing epstopdf])
Raphal Poss's avatar
Raphal Poss committed
252

Raphal Poss's avatar
Raphal Poss committed
253
    ], [ref])dnl End of OLN_COMPONENT([doc/ref])
Raphal Poss's avatar
Raphal Poss committed
254 255 256 257 258 259 260 261 262

### The development manuals directory is a component.

    OLN_COMPONENT([doc/dev], 
	          [doc-dev], 
	          [oln_cv_build_devdoc], 
	          [the Olena development manual], 
	          [OLN_DOC], 
		  [doc/dev/Makefile],
Raphal Poss's avatar
Raphal Poss committed
263 264
    [dnl Configuration for the dev directory.

Raphal Poss's avatar
Raphal Poss committed
265
     AC_ARG_VAR([DVIPS], [program to make Postscript from TeX DVI files])
Raphal Poss's avatar
Raphal Poss committed
266
     AC_CHECK_PROGS([DVIPS], [dvips], [$am_aux_dir/missing dvips])
Raphal Poss's avatar
Raphal Poss committed
267
     AC_ARG_VAR([TEXI2DVI], [program to create DVI from Texinfo files])
Raphal Poss's avatar
Raphal Poss committed
268 269 270
     AC_CHECK_PROGS([TEXI2DVI], [texi2dvi], [$am_aux_dir/missing texi2dvi])

    ], [dev])dnl End of OLN_COMPONENT([doc/dev])
Raphal Poss's avatar
Raphal Poss committed
271 272 273

### The demonstration programs are a component.

Raphal Poss's avatar
Raphal Poss committed
274 275 276 277 278
    OLN_COMPONENT([doc/demo], 
	          [demo], 
	          [oln_cv_build_demo], 
	          [the demonstration programs], 
	          [OLN_DOC], 
Raphal Poss's avatar
Raphal Poss committed
279 280 281 282 283 284 285 286 287 288 289
	          [doc/demo/Makefile],
                  [], [demo])

  ])dnl End of OLN_COLLECTION([OLN_DOC])
  ])dnl End of OLN_COMPONENT([OLN_DOC])

###
### Stuff pertaining to the tools
###

### The tools tree is both a component...
Raphal Poss's avatar
Raphal Poss committed
290 291 292 293 294
  OLN_COMPONENT([tools], 
	        [tools], 
	        [oln_cv_build_tools], 
	        [the run-time tools], 
	        [OLN_TOP], 
Raphal Poss's avatar
Raphal Poss committed
295 296 297 298 299
                [tools/Makefile tools/lib/Makefile],
  [OLN_COLLECTION([OLN_TOOLS],dnl ... and a collection.
  [dnl 

### The utilities tree is both a component...
Raphal Poss's avatar
Raphal Poss committed
300 301 302 303 304
    OLN_COMPONENT([tools/utilities], 
	          [utilities], 
	          [oln_cv_build_utilities], 
	          [the command-line utilities], 
	          [OLN_TOOLS], 
Raphal Poss's avatar
Raphal Poss committed
305 306 307 308 309
                  [tools/utilities/Makefile],
    [OLN_COLLECTION([OLN_UTILITIES], dnl ... and a collection.
    [dnl

### The morpho utilities are a component.
Raphal Poss's avatar
Raphal Poss committed
310 311 312 313 314
      OLN_COMPONENT([tools/utilities/morpho], 
	            [morpho-utilities], 
	            [oln_cv_build_morpho_utils], 
	            [the morpho utilities], 
	            [OLN_UTILITIES], 
Raphal Poss's avatar
Raphal Poss committed
315 316 317 318 319 320
	            [tools/utilities/morpho/Makefile], 
                    [], [morpho])

    ])dnl End of OLN_COLLECTION([OLN_UTILITIES])
    ], [utilities])dnl End of OLN_COMPONENT([tools/utilities])

Raphal Poss's avatar
Raphal Poss committed
321 322 323 324 325 326
### Swilena is a component...
    OLN_COMPONENT([tools/swilena],
	          [swilena],
                  [oln_cv_build_swilena],
	          [the SWIG interface to Olena],
                  [OLN_TOOLS],
Raphal Poss's avatar
Raphal Poss committed
327 328 329 330
                  [tools/swilena/Makefile 
	           tools/swilena/meta/Makefile
	           tools/swilena/src/Makefile	
	           tools/swilena/doc/Makefile],
Raphal Poss's avatar
Raphal Poss committed
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354
    [OLN_COLLECTION([OLN_SWILENA], dnl ... and a collection.
    [dnl
       
      AC_CHECK_SWIG13 dnl definition in oln-local.m4
 
      AC_ARG_VAR([DVIPS], [program to make Postscript from TeX DVI files])
      AC_CHECK_PROGS([DVIPS], [dvips], [$am_aux_dir/missing dvips])
      AC_ARG_VAR([TEXI2DVI], [program to create DVI from Texinfo files])
      AC_CHECK_PROGS([TEXI2DVI], [texi2dvi], [$am_aux_dir/missing texi2dvi])

      OLN_COMPONENT([tools/swilena/python],
                    [pylena],
                    [oln_cv_build_pylena],
                    [the Python interface to Olena],
                    [OLN_SWILENA],
                    [tools/swilena/python/Makefile],
      [
         AM_PATH_PYTHON([2.1])
      ], [python])dnl End of OLN_COMPONENT([tools/swilena/python])
        

    ])dnl End of OLN_COLLECTION([OLN_SWILENA])
    ], [swilena])dnl End of OLN_COMPONENT([tools/swilena])

Raphal Poss's avatar
Raphal Poss committed
355 356 357
   ])dnl End of OLN_COLLECTION([OLN_TOOLS])
   ])dnl End of OLN_COMPONENT([tools])

Raphal Poss's avatar
Raphal Poss committed
358 359
   AM_CONDITIONAL([HAVE_DOC_DEV], [test "x$oln_cv_build_doc" != xno -a "x$oln_cv_build_devdoc" != xno])

Raphal Poss's avatar
Raphal Poss committed
360 361
])dnl End of OLN_COLLECTION([OLN_TOP])

Raphal Poss's avatar
Raphal Poss committed
362

363
AC_OUTPUT
Raphal Poss's avatar
Raphal Poss committed
364

Raphal Poss's avatar
Raphal Poss committed
365 366 367 368 369 370 371 372 373 374 375 376
if test "x$oln_cxxflags_clean" = xno; then
  AC_MSG_WARN([CXXFLAGS seems to contain both optimization and debugging flags ($CXXFLAGS).])
  AC_MSG_NOTICE([*])
  AC_MSG_NOTICE([* note that Olena sources are configured to add heavy optimization flags])
  AC_MSG_NOTICE([* by appending CXXFLAGS_OPTIMIZE ($CXXFLAGS_OPTIMIZE) to CXXFLAGS;])
  AC_MSG_NOTICE([* this can yield to compiler problems (bugs, invalid generated code)])
  AC_MSG_NOTICE([* when used with debugging options, or conflict with preset optimization])
  AC_MSG_NOTICE([* flags.])
  AC_MSG_NOTICE([*])
  AC_MSG_NOTICE([* Please read the file `BUILD' before continuing.])
  AC_MSG_NOTICE([*])
fi