~ubuntu-branches/ubuntu/natty/xmedcon/natty

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Roland Marcus Rutschmann
  • Date: 2008-03-20 16:30:00 UTC
  • mfrom: (1.1.11 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080320163000-tvridqxpeahbkax8
Tags: 0.10.4-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
2
 
# filename: configure.in                                                  #
3
 
#                                                                         #
4
 
# UTIL Make   : Medical Image Conversion Utility                          #
5
 
#                                                                         #
6
 
# purpose     : configure script template (autoconf)                      #
7
 
#                                                                         #
8
 
# project     : (X)MedCon by Erik Nolf                                    #
9
 
#                                                                         #
10
 
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
11
 
# $Id: configure.in,v 1.136 2007/11/19 21:07:14 enlf Exp $
12
 
 
13
 
# Copyright (C) 1997-2007 by Erik Nolf
14
 
 
15
 
# This program is free software; you can redistribute it and/or modify
16
 
# it under the terms of the GNU General Public License as published by
17
 
# the Free Software Foundation; either version 2, or (at your option)
18
 
# any later version.
19
 
 
20
 
# This program is distributed in the hope that it will be useful,
21
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 
# GNU General Public License for more details.
24
 
 
25
 
# You should have received a copy of the GNU General Public License
26
 
# along with this program; if not, write to the Free Software
27
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28
 
# 02111-1307, USA.
29
 
 
30
 
AC_INIT([XMedCon], [0.10.1], [enlf-at-users.sf.net], [xmedcon])
31
 
 
32
 
 
33
 
XMEDCON_MAJOR="0"
34
 
XMEDCON_MINOR="10"
35
 
XMEDCON_MICRO="1"
36
 
XMEDCON_PRGR="(X)MedCon"
37
 
XMEDCON_DATE="19-Nov-2007"
38
 
XMEDCON_VERSION="${XMEDCON_MAJOR}.${XMEDCON_MINOR}.${XMEDCON_MICRO}"
39
 
XMEDCON_LIBVERS="${XMEDCON_PRGR} ${XMEDCON_VERSION} by Erik Nolf"
40
 
 
41
 
dnl Do not use env variable, not set yet for this.
42
 
AC_PREFIX_DEFAULT( /usr/local/xmedcon ) 
43
 
 
44
 
dnl Do some specific configurations.
45
 
echo ""
46
 
echo "BEGIN SPECIFIC CONFIG:"
47
 
 
48
 
dnl Format Acr/Nema 2.0.
49
 
AC_ARG_ENABLE(acr,
50
 
[
51
 
  --enable-acr            enable  Acr/Nema 2.0 format (default).
52
 
  --disable-acr           disable Acr/Nema 2.0 format. ],
53
 
[
54
 
  case "$enableval" in 
55
 
        no)
56
 
                AC_CACHE_VAL(mdc_cv_include_acr,mdc_cv_include_acr=no)
57
 
                ENABLE_ACR=0
58
 
                ;;
59
 
        *)
60
 
                AC_CACHE_VAL(mdc_cv_include_acr,mdc_cv_include_acr=yes)
61
 
                ENABLE_ACR=1
62
 
                ;;
63
 
  esac ],
64
 
  AC_CACHE_VAL(mdc_cv_include_acr,mdc_cv_include_acr=yes)
65
 
  ENABLE_ACR=1
66
 
)
67
 
AC_MSG_RESULT([Format Acr/Nema 2.0     enabled? ${mdc_cv_include_acr}])
68
 
 
69
 
dnl Format Gif87a/89a.
70
 
AC_ARG_ENABLE(gif,
71
 
[
72
 
  --enable-gif            enable  Gif87a/89a format (default).
73
 
  --disable-gif           disable Gif87a/89a format. ],
74
 
[
75
 
  case "$enableval" in
76
 
        no)
77
 
                AC_CACHE_VAL(mdc_cv_include_gif,mdc_cv_include_gif=no)
78
 
                ENABLE_GIF=0
79
 
                ;;
80
 
        *)
81
 
                AC_CACHE_VAL(mdc_cv_include_acr,mdc_cv_include_gif=yes)
82
 
                ENABLE_GIF=1
83
 
                ;;
84
 
  esac ],
85
 
  AC_CACHE_VAL(mdc_cv_include_gif,mdc_cv_include_gif=yes)
86
 
  ENABLE_GIF=1
87
 
)
88
 
AC_MSG_RESULT([Format Gif87a/89a       enabled? ${mdc_cv_include_gif}])
89
 
 
90
 
dnl Format INW (RUG).
91
 
AC_ARG_ENABLE(inw,
92
 
[
93
 
  --enable-inw            enable  INW (RUG) format (default).
94
 
  --disable-inw           disable INW (RUG) format. ],
95
 
[
96
 
  case "$enableval" in
97
 
        no)
98
 
                AC_CACHE_VAL(mdc_cv_include_inw,mdc_cv_include_inw=no)
99
 
                ENABLE_INW=0
100
 
                ;;
101
 
        *)
102
 
                AC_CACHE_VAL(mdc_cv_include_inw,mdc_cv_include_inw=yes)
103
 
                ENABLE_INW=1
104
 
                ;;
105
 
  esac ],
106
 
  AC_CACHE_VAL(mdc_cv_include_inw,mdc_cv_include_inw=yes)
107
 
  ENABLE_INW=1
108
 
)
109
 
AC_MSG_RESULT([Format INW (RUG)        enabled? ${mdc_cv_include_inw}])
110
 
 
111
 
dnl Format Analyze (SPM).
112
 
AC_ARG_ENABLE(anlz,
113
 
[
114
 
  --enable-anlz           enable  Analyze (SPM) format (default).
115
 
  --disable-anlz          disable Analyze (SPM) format. ],
116
 
[
117
 
  case "$enableval" in
118
 
        no)
119
 
                AC_CACHE_VAL(mdc_cv_include_anlz,mdc_cv_include_anlz=no)
120
 
                ENABLE_ANLZ=0
121
 
                ;;
122
 
        *)
123
 
                AC_CACHE_VAL(mdc_cv_include_anlz,mdc_cv_include_anlz=yes)
124
 
                ENABLE_ANLZ=1
125
 
                ;;
126
 
  esac ],
127
 
  AC_CACHE_VAL(mdc_cv_include_anlz,mdc_cv_include_anlz=yes)
128
 
  ENABLE_ANLZ=1
129
 
)
130
 
AC_MSG_RESULT([Format Analyze (SPM)    enabled? ${mdc_cv_include_anlz}])
131
 
 
132
 
dnl Format Concorde microPET
133
 
AC_ARG_ENABLE(conc,
134
 
[
135
 
  --enable-conc           enable  Concorde microPET format (default).
136
 
  --disable-conc          disable Concorde microPET format. ],
137
 
[
138
 
  case "$enableval" in
139
 
        no)
140
 
                AC_CACHE_VAL(mdc_cv_include_conc,mdc_cv_include_conc=no)
141
 
                ENABLE_CONC=0
142
 
                ;;
143
 
        *)
144
 
                AC_CACHE_VAL(mdc_cv_include_conc,mdc_cv_include_conc=yes)
145
 
                ENABLE_CONC=1
146
 
                ;;
147
 
  esac ],
148
 
  AC_CACHE_VAL(mdc_cv_include_conc,mdc_cv_include_conc=yes)
149
 
  ENABLE_CONC=1
150
 
)
151
 
AC_MSG_RESULT([Format Concorde uPET    enabled? ${mdc_cv_include_conc}])
152
 
 
153
 
dnl Format CTI ECAT 6/7.
154
 
AC_ARG_ENABLE(ecat,
155
 
[
156
 
  --enable-ecat           enable  CTI ECAT 6/7 format (default).
157
 
  --disable-ecat          disable CTI ECAT 6/7 format. ],
158
 
[
159
 
  case "$enableval" in
160
 
        no)
161
 
                AC_CACHE_VAL(mdc_cv_include_ecat,mdc_cv_include_ecat=no)
162
 
                ENABLE_ECAT=0
163
 
                ;;
164
 
        *)
165
 
                AC_CACHE_VAL(mdc_cv_include_ecat,mdc_cv_include_ecat=yes)
166
 
                ENABLE_ECAT=1
167
 
                ;;
168
 
  esac ],
169
 
  AC_CACHE_VAL(mdc_cv_include_ecat,mdc_cv_include_ecat=yes)
170
 
  ENABLE_ECAT=1
171
 
)
172
 
AC_MSG_RESULT([Format CTI ECAT 6/7     enabled? ${mdc_cv_include_ecat}])
173
 
 
174
 
dnl Format InterFile 3.3.
175
 
AC_ARG_ENABLE(intf,
176
 
[
177
 
  --enable-intf           enable  InterFile 3.3 format (default).
178
 
  --disable-intf          disable InterFile 3.3 format. ],
179
 
[
180
 
  case "$enableval" in
181
 
        no)
182
 
                AC_CACHE_VAL(mdc_cv_include_intf,mdc_cv_include_intf=no)
183
 
                ENABLE_INTF=0
184
 
                ;;
185
 
        *)
186
 
                AC_CACHE_VAL(mdc_cv_include_intf,mdc_cv_include_intf=yes)
187
 
                ENABLE_INTF=1
188
 
                ;;
189
 
  esac ],
190
 
  AC_CACHE_VAL(mdc_cv_include_intf,mdc_cv_include_intf=yes)
191
 
  ENABLE_INTF=1
192
 
)
193
 
AC_MSG_RESULT([Format InterFile 3.3    enabled? ${mdc_cv_include_intf}])
194
 
 
195
 
dnl Format DICOM 3.0.
196
 
AC_ARG_ENABLE(dicom,
197
 
[
198
 
  --enable-dicom          enable  DICOM 3.0 format (default).
199
 
  --disable-dicom         disable DICOM 3.0 format. ],
200
 
[
201
 
  case "$enableval" in
202
 
        no)
203
 
                AC_CACHE_VAL(mdc_cv_include_dicm,mdc_cv_include_dicm=no)
204
 
                ENABLE_DICM=0
205
 
                ;;
206
 
        *)
207
 
                AC_CACHE_VAL(mdc_cv_include_dicm,mdc_cv_include_dicm=yes)
208
 
                ENABLE_DICM=1
209
 
                ;;
210
 
  esac ],
211
 
  AC_CACHE_VAL(mdc_cv_include_dicm,mdc_cv_include_dicm=yes)
212
 
  ENABLE_DICM=1
213
 
)
214
 
AC_MSG_RESULT([Format DICOM 3.0        enabled? ${mdc_cv_include_dicm}])
215
 
dnl DICOM needs Acr/Nema.
216
 
if test x$mdc_cv_include_dicm = xyes; then 
217
 
  if test x$mdc_cv_include_acr != xyes; then
218
 
    echo "***"
219
 
    echo "*** Oeps. DICOM needs Acr/Nema to be enabled."
220
 
    echo "*** Therefore rerun configure to do so ..."
221
 
    echo "***"
222
 
    rm -f config.cache
223
 
    exit 1
224
 
  fi
225
 
fi
226
 
 
227
 
dnl Format PNG, test later for required components
228
 
AC_ARG_ENABLE(png,
229
 
[
230
 
  --enable-png            enable  PNG format (default).
231
 
  --disable-png           disable PNG format. ],
232
 
[
233
 
  case "$enableval" in
234
 
        no)
235
 
                AC_CACHE_VAL(mdc_cv_include_png,mdc_cv_include_png=no)
236
 
                ENABLE_PNG=0
237
 
                ;;
238
 
        *)
239
 
                AC_CACHE_VAL(mdc_cv_include_png,mdc_cv_include_png=yes)
240
 
                ENABLE_PNG=1
241
 
                ;;
242
 
  esac ],
243
 
  AC_CACHE_VAL(mdc_cv_include_png,mdc_cv_include_png=yes)
244
 
  ENABLE_PNG=1
245
 
)
246
 
AC_MSG_RESULT([Format PNG              enabled? ${mdc_cv_include_png}])
247
 
 
248
 
dnl Format NIFTI, test later for required components
249
 
AC_ARG_ENABLE(nifti,
250
 
[
251
 
  --enable-nifti          enable  NIFTI format (default).
252
 
  --disable-nifti         disable NIFTI format. ],
253
 
[
254
 
  case "$enableval" in
255
 
        no)
256
 
                AC_CACHE_VAL(mdc_cv_include_nifti,mdc_cv_include_nifti=no)
257
 
                ENABLE_NIFTI=0
258
 
                ;;
259
 
        *)
260
 
                AC_CACHE_VAL(mdc_cv_include_nifti,mdc_cv_include_nifti=yes)
261
 
                ENABLE_NIFTI=1
262
 
                ;;
263
 
  esac ],
264
 
  AC_CACHE_VAL(mdc_cv_include_nifti,mdc_cv_include_nifti=yes)
265
 
  ENABLE_NIFTI=1
266
 
)
267
 
AC_MSG_RESULT([Format NIFTI            enabled? ${mdc_cv_include_nifti}])
268
 
 
269
 
dnl DICOM LossLess JPEG ...
270
 
if test x$mdc_cv_include_dicm = xyes; then
271
 
AC_ARG_ENABLE(ljpg,
272
 
[
273
 
  --enable-ljpg           enable  DICOM lossless jpeg (default).
274
 
  --disable-ljpg          disable DICOM lossless jpeg. ],
275
 
[
276
 
  case "$enableval" in
277
 
        no)
278
 
                AC_CACHE_VAL(mdc_cv_ljpg,mdc_cv_ljpg=no)
279
 
                ;;
280
 
        *)
281
 
                AC_CACHE_VAL(mdc_cv_ljpg,mdc_cv_ljpg=yes)
282
 
                ;;
283
 
  esac ],
284
 
  AC_CACHE_VAL(mdc_cv_ljpg,mdc_cv_ljpg=yes)
285
 
)
286
 
else
287
 
  AC_CACHE_VAL(mdc_cv_ljpg,mdc_cv_ljpg=no)
288
 
fi
289
 
AC_MSG_RESULT([Enable DICOM 3.0 lossless jpeg ? ${mdc_cv_ljpg}])
290
 
 
291
 
dnl TPC library for ecat7 writing, test later for required components
292
 
AC_ARG_ENABLE(tpc,
293
 
[
294
 
  --enable-tpc            enable  TPC ecat7 writing support.
295
 
  --disable-tpc           disable TPC ecat7 writing support (default). ],
296
 
[
297
 
  case "$enableval" in
298
 
        yes)
299
 
                AC_CACHE_VAL(mdc_cv_include_tpc,mdc_cv_include_tpc=yes)
300
 
                ENABLE_TPC=1
301
 
                ;;
302
 
        *)
303
 
                AC_CACHE_VAL(mdc_cv_include_tpc,mdc_cv_include_tpc=no)
304
 
                ENABLE_TPC=0
305
 
                ;;
306
 
  esac ],
307
 
  AC_CACHE_VAL(mdc_cv_include_tpc,mdc_cv_include_tpc=no)
308
 
  ENABLE_TPC=0
309
 
)
310
 
AC_MSG_RESULT([Enable TPC ecat7 write support ? ${mdc_cv_include_tpc}])
311
 
 
312
 
dnl glib library (availability tests later).
313
 
AC_ARG_ENABLE(glib,
314
 
[
315
 
  --enable-glib           enable  glib convience functions (default).
316
 
  --disable-glib          disable glib convience functions. ],
317
 
[
318
 
  case "$enableval" in
319
 
        no)
320
 
                AC_CACHE_VAL(mdc_cv_glibsupport,mdc_cv_glibsupport=no)
321
 
                ;;
322
 
        *)
323
 
                AC_CACHE_VAL(mdc_cv_glibsupport,mdc_cv_glibsupport=yes)
324
 
                ;;
325
 
  esac ],
326
 
  AC_CACHE_VAL(mdc_cv_glibsupport,mdc_cv_glibsupport=yes)
327
 
)
328
 
AC_MSG_RESULT([Enable glib convenience func's ? ${mdc_cv_glibsupport}])
329
 
 
330
 
dnl GUI (Gtk+ toolkit availability tests later).
331
 
AC_ARG_ENABLE(gui,
332
 
[
333
 
  --enable-gui            enable  graphical user interface (default).
334
 
  --disable-gui           disable graphical user interface. ],
335
 
[
336
 
  case "$enableval" in
337
 
        no)
338
 
                AC_CACHE_VAL(mdc_cv_gui,mdc_cv_gui=no)
339
 
                ;;
340
 
        *)
341
 
                AC_CACHE_VAL(mdc_cv_gui,mdc_cv_gui=yes)
342
 
                ;;
343
 
  esac ],
344
 
  AC_CACHE_VAL(mdc_cv_gui,mdc_cv_gui=yes)
345
 
)
346
 
AC_MSG_RESULT([Enable graphical user interface? ${mdc_cv_gui}])
347
 
 
348
 
dnl use version 1 of glib/gtk
349
 
AC_ARG_ENABLE(gtk1,
350
 
[
351
 
  --enable-gtk1           compile with older glib/gtk version 1 instead of 2. ],
352
 
[
353
 
  case "$enableval" in
354
 
        yes)
355
 
                AC_CACHE_VAL(mdc_cv_gtk_one,mdc_cv_gtk_one=yes)
356
 
                ;;
357
 
        *)
358
 
                AC_CACHE_VAL(mdc_cv_gtk_one,mdc_cv_gtk_one=no)
359
 
                ;;
360
 
  esac ],
361
 
  AC_CACHE_VAL(mdc_cv_gtk_one, mdc_cv_gtk_one=no)
362
 
)
363
 
AC_MSG_RESULT([Enable older glib/gtk version 1? ${mdc_cv_gtk_one}])
364
 
 
365
 
dnl Checks for long long type.
366
 
AC_ARG_ENABLE(llcheck,
367
 
[
368
 
  --enable-llcheck        enable  long long type check.
369
 
  --disable-llcheck       disable long long type check (default). ],
370
 
[
371
 
  case "$enableval" in
372
 
        yes)
373
 
                AC_CACHE_VAL(mdc_cv_lnglngcheck,mdc_cv_lnglngcheck=yes)
374
 
                ;;
375
 
        *)
376
 
                AC_CACHE_VAL(mdc_cv_lnglngcheck,mdc_cv_lnglngcheck=no)
377
 
                ;;
378
 
  esac ],
379
 
  AC_CACHE_VAL(mdc_cv_lnglngcheck,mdc_cv_lnglngcheck=no)
380
 
)
381
 
AC_MSG_RESULT([Enable check for long long type? ${mdc_cv_lnglngcheck}])
382
 
 
383
 
echo ""
384
 
echo "BEGIN AUTO CONFIG:"
385
 
AM_INIT_AUTOMAKE(xmedcon, ${XMEDCON_VERSION})
386
 
AC_LIBTOOL_WIN32_DLL
387
 
AM_PROG_LIBTOOL
388
 
 
389
 
dnl Checks for programs.
390
 
AC_PROG_AWK
391
 
AC_PROG_INSTALL
392
 
AC_PROG_LN_S
393
 
 
394
 
 
395
 
AC_MSG_CHECKING([for native Win32])
396
 
case "$host" in
397
 
  *-*-mingw*)
398
 
    native_win32=yes
399
 
    ;;
400
 
  *)
401
 
    native_win32=no
402
 
    ;;
403
 
esac
404
 
AC_MSG_RESULT([$native_win32])
405
 
AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)
406
 
 
407
 
AC_MSG_CHECKING([for Win32 platform in general])
408
 
case "$host" in
409
 
  *-*-mingw*|*-*-cygwin*)
410
 
    platform_win32=yes
411
 
    ;;
412
 
  *)
413
 
    platform_win32=no
414
 
    ;;
415
 
esac
416
 
AC_MSG_RESULT($platform_win32)
417
 
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = yes)
418
 
 
419
 
# Ensure MSVC-compatible struct packing convention is used when
420
 
# compiling for Win32 with gcc. GTK+ uses this convention, so we must, too.
421
 
# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
422
 
# gcc2 uses "-fnative-struct".
423
 
if test x"$native_win32" = xyes; then
424
 
  if test x"$GCC" = xyes; then
425
 
    msnative_struct=''
426
 
    AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
427
 
    if test -z "$ac_cv_prog_CC"; then
428
 
      our_gcc="$CC"
429
 
    else
430
 
      our_gcc="$ac_cv_prog_CC"
431
 
    fi
432
 
    case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
433
 
      2.)
434
 
        if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
435
 
          msnative_struct='-fnative-struct'
436
 
        fi
437
 
        ;;
438
 
      *)
439
 
        if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
440
 
          msnative_struct='-mms-bitfields'
441
 
        fi
442
 
        ;;
443
 
    esac
444
 
    if test x"$msnative_struct" = x ; then
445
 
      AC_MSG_RESULT([no way])
446
 
      AC_MSG_WARN([produced libraries will be incompatible with prebuilt GTK+ DLLs])
447
 
    else
448
 
      CFLAGS="$CFLAGS $msnative_struct"
449
 
      AC_MSG_RESULT([${msnative_struct}])
450
 
    fi
451
 
  fi
452
 
fi
453
 
 
454
 
 
455
 
dnl Checks for libraries.
456
 
dnl Replace `main' with a function in -libs:
457
 
AC_CHECK_LIB(ibs, main)
458
 
 
459
 
dnl Check for libz
460
 
if test $ENABLE_PNG -gt 0 -o $ENABLE_NIFTI -gt 0; then
461
 
  AC_CHECK_LIB(z, uncompress, ZLIB_LDFLAGS="-lz", ZLIB_LDFLAGS="")
462
 
 
463
 
  if test x"$ZLIB_LDFLAGS" != "x"; then
464
 
    ZLIB_CFLAGS="-DHAVE_ZLIB"
465
 
  else
466
 
    ZLIB_CFLAGS=""
467
 
  fi
468
 
fi
469
 
 
470
 
dnl Check for libpng
471
 
prev_LDFLAGS="$LDFLAGS"
472
 
prev_CPPFLAGS="$CPPFLAGS"
473
 
AC_ARG_WITH(png-prefix,
474
 
   [  --with-png-prefix=PFX   Prefix where PNG library is installed (optional)]
475
 
 , png_prefix="$withval", png_prefix="")
476
 
if test x"$png_prefix" != "x"; then
477
 
    PNG_LDFLAGS="-L$png_prefix/lib -lpng"
478
 
    PNG_CFLAGS="-I$png_prefix/include"
479
 
 
480
 
    LDFLAGS="$LDFLAGS -lm $PNG_LDFLAGS $ZLIB_FLAGS"
481
 
    CPPFLAGS="$CPPFLAGS $PNG_CFLAGS"
482
 
else
483
 
    PNG_LDFLAGS="-lpng"
484
 
    PNG_CFLAGS=""
485
 
fi
486
 
 
487
 
if test x"$ZLIB_LDFLAGS" = "x"; then
488
 
  ENABLE_PNG=0;
489
 
fi
490
 
 
491
 
if test $ENABLE_PNG -gt 0; then
492
 
  AC_MSG_CHECKING(for PNG support)
493
 
  AC_MSG_RESULT
494
 
  failed=0;
495
 
  passed=0;
496
 
  AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
497
 
  AC_CHECK_LIB(png,png_read_png,passed=`expr $passed + 1`,failed=`expr $failed + 1`, $ZLIB_LDFLAGS)
498
 
  AC_MSG_CHECKING(if PNG package is complete)
499
 
  if test $passed -gt 0
500
 
  then
501
 
    if test $failed -gt 0
502
 
    then
503
 
      AC_MSG_RESULT(no)
504
 
      ENABLE_PNG=0
505
 
    else
506
 
      AC_MSG_RESULT(yes)
507
 
      ENABLE_PNG=1
508
 
    fi
509
 
  else 
510
 
    AC_MSG_RESULT(no)
511
 
    ENABLE_PNG=0
512
 
  fi
513
 
  if test $ENABLE_PNG -lt 1; then
514
 
    echo "***"
515
 
    echo "***  Oeps. Components required for PNG support are missing."
516
 
    echo "***  You will need to rerun the configure script with argument"
517
 
    echo "***  --disable-png or give a proper value to --with-png-prefix."
518
 
    echo "***"
519
 
    rm -f config.cache
520
 
    exit 1
521
 
  fi
522
 
fi
523
 
LDFLAGS="$prev_LDFLAGS"
524
 
CPPFLAGS="$prev_CPPFLAGS"
525
 
 
526
 
dnl Prepare build flags for libniftiio
527
 
prev_LDFLAGS="$LDFLAGS"
528
 
prev_CPPFLAGS="$CPPFLAGS"
529
 
AC_ARG_WITH(nifti-prefix,
530
 
   [  --with-nifti-prefix=PFX   Prefix where NIFTI library is installed (optional)]
531
 
 , nifti_prefix="$withval", nifti_prefix="")
532
 
if test x"$nifti_prefix" != "x"; then
533
 
    ZNZ_LDFLAGS="-L$nifti_prefix/lib -lznz"
534
 
    NIFTI_LDFLAGS="-L$nifti_prefix/lib -lniftiio $ZNZ_LDFLAGS"
535
 
    NIFTI_CFLAGS=""
536
 
    AC_CHECK_FILE($nifti_prefix/include/nifti/nifti1_io.h,NIFTI_CFLAGS="-I$nifti_prefix/include/nifti",NIFTI_CFLAGS="-I$nifti_prefix/include")
537
 
    LDFLAGS="$LDFLAGS -lm $NIFTI_LDFLAGS $ZLIB_LDFLAGS"
538
 
    CPPFLAGS="$CPPFLAGS $NIFTI_CFLAGS $ZLIB_LDFLAGS"
539
 
else
540
 
    ZNZ_LDFLAGS="-L../libs/nifti -lznz"
541
 
    NIFTI_LDFLAGS="-L../libs/nifti -lniftiio $ZNZ_LDFLAGS"
542
 
    NIFTI_CFLAGS="-I../libs/nifti"
543
 
fi
544
 
 
545
 
dnl Check for installed libniftiio
546
 
if test $ENABLE_NIFTI -gt 0 -a x"$nifti_prefix" != "x"; then
547
 
  AC_MSG_CHECKING(for NIFTI support)
548
 
  AC_MSG_RESULT
549
 
  failed=0;
550
 
  passed=0;
551
 
  AC_CHECK_HEADER(nifti1_io.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
552
 
  AC_CHECK_LIB(niftiio,nifti_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`, $ZNZ_LDFLAGS)
553
 
  AC_MSG_CHECKING(if NIFTI package is complete)
554
 
  if test $passed -gt 0
555
 
  then
556
 
    if test $failed -gt 0
557
 
    then
558
 
      AC_MSG_RESULT(no)
559
 
      ENABLE_NIFTI=0
560
 
    else
561
 
      AC_MSG_RESULT(yes)
562
 
      ENABLE_NIFTI=1
563
 
    fi
564
 
  else 
565
 
    AC_MSG_RESULT(no)
566
 
    ENABLE_NIFTI=0
567
 
  fi
568
 
  if test $ENABLE_NIFTI -lt 1; then
569
 
    echo "***"
570
 
    echo "***  Oeps. Components required for NIFTI support are missing."
571
 
    echo "***  You will need to rerun the configure script with argument"
572
 
    echo "***  --disable-nifti or give a proper value to --with-nifti-prefix."
573
 
    echo "***"
574
 
    rm -f config.cache
575
 
    exit 1
576
 
  fi
577
 
fi
578
 
LDFLAGS="$prev_LDFLAGS"
579
 
CPPFLAGS="$prev_CPPFLAGS"
580
 
 
581
 
dnl Check for libtpcimgio and tpcmisc
582
 
prev_LDFLAGS="$LDFLAGS"
583
 
prev_CPPFLAGS="$CPPFLAGS"
584
 
AC_ARG_WITH(tpc-prefix,
585
 
   [  --with-tpc-prefix=PFX   Prefix where TPC library is installed (optional)]
586
 
 , tpc_prefix="$withval", tpc_prefix="")
587
 
if test x"$tpc_prefix" != "x"; then
588
 
    TPC_LDFLAGS="-L$tpc_prefix/lib -ltpcimgio -L$tpc_prefix/lib -ltpcmisc"
589
 
    TPC_CFLAGS="-I$tpc_prefix/include"
590
 
    LDFLAGS="$LDFLAGS $TPC_LDFLAGS"
591
 
    CPPFLAGS="$CPPFLAGS $TPC_CFLAGS"
592
 
else
593
 
    TPC_LDFLAGS="-ltpcimgio -ltpcmisc"
594
 
    TPC_CFLAGS=""
595
 
fi
596
 
if test $ENABLE_TPC -gt 0; then
597
 
  AC_MSG_CHECKING(for TPC ecat7 writing support)
598
 
  AC_MSG_RESULT
599
 
  failed=0;
600
 
  passed=0;
601
 
  AC_CHECK_HEADER(ecat7.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
602
 
  AC_CHECK_LIB(tpcimgio,ecat7Create,passed=`expr $passed + 1`,failed=`expr $failed + 1`, $TPC_LDFLAGS)
603
 
  AC_MSG_CHECKING(if TPC library is complete)
604
 
  if test $passed -gt 0
605
 
  then
606
 
    if test $failed -gt 0
607
 
    then
608
 
      AC_MSG_RESULT(no)
609
 
      ENABLE_TPC=0
610
 
    else
611
 
      AC_MSG_RESULT(yes)
612
 
      ENABLE_TPC=1
613
 
    fi
614
 
  else 
615
 
    AC_MSG_RESULT(no)
616
 
    ENABLE_TPC=0
617
 
  fi
618
 
  if test $ENABLE_TPC -lt 1; then
619
 
    echo "***"
620
 
    echo "***  Oeps. Components required for TPC ecat7 writing are missing."
621
 
    echo "***  You will need to rerun the configure script with argument"
622
 
    echo "***  --disable-tpc or give a proper value to --with-tpc-prefix."
623
 
    echo "***"
624
 
    rm -f config.cache
625
 
    exit 1
626
 
  fi
627
 
fi
628
 
LDFLAGS="$prev_LDFLAGS"
629
 
CPPFLAGS="$prev_CPPFLAGS"
630
 
 
631
 
dnl Checks for header files.
632
 
AC_HEADER_STDC
633
 
AC_CHECK_HEADERS(strings.h unistd.h)
634
 
 
635
 
dnl Checks for typedefs, structures, and compiler characteristics.
636
 
AC_C_CONST
637
 
 
638
 
dnl Checks for library functions.
639
 
AC_TYPE_SIGNAL
640
 
AC_CHECK_FUNCS(strptime)
641
 
AC_CHECK_FUNCS(localtime_r)
642
 
AC_CHECK_FUNCS(isnan)
643
 
AC_CHECK_FUNCS(isinf)
644
 
 
645
 
dnl the old glib/gtk version 1 stuff
646
 
AC_MSG_CHECKING([whether to use older glib/gtk version 1])
647
 
AC_MSG_RESULT([$mdc_cv_gtk_one])
648
 
if (test $mdc_cv_gtk_one = yes); then
649
 
 
650
 
  dnl Checks for glib1 supported medcon
651
 
  if test $mdc_cv_glibsupport = yes; then
652
 
    GLIB_LIBS=""
653
 
    GLIB_CFLAGS=""
654
 
    AM_PATH_GLIB(1.2.0,[ac_cv_prog_glib=yes],[ac_cv_prog_glib=no])
655
 
    XMEDCON_GLIB_LIBS=$GLIB_LIBS
656
 
    XMEDCON_GLIB_CFLAGS=$GLIB_CFLAGS
657
 
    AC_SUBST(XMEDCON_GLIB_LIBS)
658
 
    AC_SUBST(XMEDCON_GLIB_CFLAGS)
659
 
 
660
 
    AC_DEFINE(GTKONE, 1, Define to compile with glib/gtk 1 instead of 2)
661
 
  fi
662
 
  MDC_CHECK_GLIBSUPPORT($mdc_cv_glibsupport)
663
 
 
664
 
  dnl Checks for gtk1 GUI
665
 
  if test $mdc_cv_gui = yes; then
666
 
    GTK_LIBS=""
667
 
    GDK_PIXBUF_LIBS=""
668
 
    GTK_CFLAGS=""
669
 
    GDK_PIXBUF_CFLAGS=""
670
 
    AM_PATH_GTK(1.2.0,[ac_cv_prog_gtk=yes],[ac_cv_prog_gtk=no])
671
 
    AM_PATH_GDK_PIXBUF(0.8.0,[ac_cv_prog_gdk_pixbuf=yes],[ac_cv_prog_gdk_pixbuf=no])
672
 
    XMEDCON_GTK_LIBS="$GTK_LIBS $GDK_PIXBUF_LIBS"
673
 
    XMEDCON_GTK_CFLAGS="$GTK_CFLAGS $GDK_PIXBUF_CFLAGS"
674
 
    AC_SUBST(XMEDCON_GTK_LIBS)
675
 
    AC_SUBST(XMEDCON_GTK_CFLAGS)
676
 
  fi
677
 
 
678
 
  if test x$ac_cv_prog_gtk = xno -o x$ac_cv_prog_gdk_pixbuf = xno ; then
679
 
    GTKSUPPORTED=0
680
 
  else
681
 
    GTKSUPPORTED=1
682
 
  fi
683
 
 
684
 
else
685
 
 
686
 
  dnl Checks for glib2 supported medcon
687
 
  if test $mdc_cv_glibsupport = yes; then
688
 
    PKG_CHECK_MODULES(XMEDCON_GLIB,[
689
 
       glib-2.0        >= 2.0.0
690
 
    ])
691
 
    AC_SUBST(XMEDCON_GLIB_LIBS)
692
 
    AC_SUBST(XMEDCON_GLIB_CFLAGS)
693
 
    GLIBSUPPORTED=1
694
 
  else
695
 
    GLIBSUPPORTED=0
696
 
  fi
697
 
 
698
 
  dnl Checks for gtk2 GUI.
699
 
  if test $mdc_cv_gui = yes; then
700
 
    PKG_CHECK_MODULES(XMEDCON_GTK,[
701
 
        gdk-pixbuf-2.0  >= 2.0.0
702
 
        gtk+-2.0        >= 2.0.0
703
 
    ])
704
 
    AC_SUBST(XMEDCON_GTK_LIBS)
705
 
    AC_SUBST(XMEDCON_GTK_CFLAGS)
706
 
    GTKSUPPORTED=1
707
 
  else
708
 
    GTKSUPPORTED=0
709
 
  fi
710
 
fi
711
 
 
712
 
MDC_CHECK_GUI($GTKSUPPORTED)
713
 
 
714
 
AM_CONDITIONAL(DO_ACR,  test x$mdc_cv_include_acr = xyes)
715
 
AM_CONDITIONAL(DO_GIF,  test x$mdc_cv_include_gif = xyes)
716
 
AM_CONDITIONAL(DO_INW,  test x$mdc_cv_include_inw = xyes)
717
 
AM_CONDITIONAL(DO_ANLZ, test x$mdc_cv_include_anlz = xyes)
718
 
AM_CONDITIONAL(DO_CONC, test x$mdc_cv_include_conc = xyes)
719
 
AM_CONDITIONAL(DO_ECAT, test x$mdc_cv_include_ecat = xyes)
720
 
AM_CONDITIONAL(DO_INTF, test x$mdc_cv_include_intf = xyes)
721
 
AM_CONDITIONAL(DO_DICM, test x$mdc_cv_include_dicm = xyes)
722
 
AM_CONDITIONAL(DO_PNG,  test x$mdc_cv_include_png  = xyes)
723
 
 
724
 
AM_CONDITIONAL(DO_NIFTI,test x$mdc_cv_include_nifti = xyes)
725
 
AM_CONDITIONAL(DO_NIFTI_INTERNAL, test x"$nifti_prefix" = "x")
726
 
 
727
 
AM_CONDITIONAL(DO_TPC,  test x$mdc_cv_include_tpc = xyes)
728
 
AM_CONDITIONAL(DO_LJPG, test x$mdc_cv_ljpg = xyes)
729
 
 
730
 
AM_CONDITIONAL(DO_GLIBSUPPORT, test x$mdc_cv_glibsupport = xyes)
731
 
 
732
 
AM_CONDITIONAL(DO_GUI, test x$mdc_cv_gui = xyes)
733
 
 
734
 
dnl Make substitutions.
735
 
AC_SUBST(XMEDCON_MAJOR)
736
 
AC_SUBST(XMEDCON_MINOR)
737
 
AC_SUBST(XMEDCON_MICRO)
738
 
AC_SUBST(XMEDCON_PRGR)
739
 
AC_SUBST(XMEDCON_DATE)
740
 
AC_SUBST(XMEDCON_VERSION)
741
 
AC_SUBST(XMEDCON_LIBVERS)
742
 
AC_SUBST(ENABLE_ACR)
743
 
AC_SUBST(ENABLE_GIF)
744
 
AC_SUBST(ENABLE_INW)
745
 
AC_SUBST(ENABLE_ANLZ)
746
 
AC_SUBST(ENABLE_CONC)
747
 
AC_SUBST(ENABLE_ECAT)
748
 
AC_SUBST(ENABLE_INTF)
749
 
AC_SUBST(ENABLE_DICM)
750
 
AC_SUBST(ENABLE_PNG)
751
 
AC_SUBST(ENABLE_NIFTI)
752
 
AC_SUBST(ENABLE_TPC)
753
 
 
754
 
AC_SUBST(ZLIB_LDFLAGS)
755
 
AC_SUBST(ZLIB_CFLAGS)
756
 
AC_SUBST(PNG_LDFLAGS)
757
 
AC_SUBST(PNG_CFLAGS)
758
 
AC_SUBST(NIFTI_LDFLAGS)
759
 
AC_SUBST(NIFTI_CFLAGS)
760
 
AC_SUBST(TPC_LDFLAGS)
761
 
AC_SUBST(TPC_CFLAGS)
762
 
 
763
 
AC_SUBST(mdc_cv_include_gif)
764
 
AC_SUBST(mdc_cv_include_acr)
765
 
AC_SUBST(mdc_cv_include_inw)
766
 
AC_SUBST(mdc_cv_include_conc)
767
 
AC_SUBST(mdc_cv_include_ecat)
768
 
AC_SUBST(mdc_cv_include_intf)
769
 
AC_SUBST(mdc_cv_include_anlz)
770
 
AC_SUBST(mdc_cv_include_dicm)
771
 
AC_SUBST(mdc_cv_include_png)
772
 
AC_SUBST(mdc_cv_include_nifti)
773
 
AC_SUBST(mdc_cv_include_tpc)
774
 
AC_SUBST(mdc_cv_ljpg)
775
 
AC_SUBST(mdc_cv_glibsupport)
776
 
AC_SUBST(mdc_cv_gui)
777
 
 
778
 
AC_SUBST(GLIBSUPPORTED)
779
 
AC_SUBST(GLIBMDCETC)
780
 
AC_SUBST(GTKONE)
781
 
AC_SUBST(GTKSUPPORTED)
782
 
AC_SUBST(XMDCETC)
783
 
 
784
 
dnl Checks for machine dependencies.
785
 
AC_C_BIGENDIAN
786
 
if test x$ac_cv_c_bigendian = xyes; then
787
 
  mdc_cv_bigendian=1
788
 
else
789
 
  mdc_cv_bigendian=0
790
 
fi
791
 
AC_CHECK_SIZEOF(short,2)
792
 
AC_CHECK_SIZEOF(int,4)
793
 
AC_CHECK_SIZEOF(long,4)
794
 
if test x$mdc_cv_lnglngcheck = xyes; then
795
 
  AC_CHECK_SIZEOF(long long,8) 
796
 
fi
797
 
 
798
 
dnl Checks for gzip or compress.
799
 
AC_CHECK_PROGS(DECOMPRESS, gunzip uncompress, none)
800
 
 
801
 
AM_CONFIG_HEADER(source/m-depend.h)
802
 
 
803
 
dnl Pass types for m-config.h
804
 
AC_SUBST(mdc_cv_bigendian)
805
 
AC_SUBST(ac_cv_sizeof_short)
806
 
AC_SUBST(ac_cv_sizeof_int)
807
 
AC_SUBST(ac_cv_sizeof_long)
808
 
if test x$mdc_cv_lnglngcheck = xyes; then
809
 
  mdc_cv_enable_lnglng=1
810
 
  AC_SUBST(ac_cv_sizeof_long_long)
811
 
else
812
 
  mdc_cv_enable_lnglng=0
813
 
fi
814
 
AC_SUBST(mdc_cv_enable_lnglng)
815
 
 
816
 
AC_OUTPUT([
817
 
 Makefile
818
 
 xmedcon-config
819
 
 libs/Makefile
820
 
 libs/ljpg/Makefile
821
 
 libs/dicom/Makefile
822
 
 libs/nifti/Makefile
823
 
 macros/Makefile
824
 
 source/Makefile
825
 
 source/m-config.h
826
 
 etc/Makefile
827
 
 etc/xmedcon.spec
828
 
 etc/xmedcon-$VERSION-1.iss:etc/xmedcon.iss.in
829
 
 etc/xmedcon-$VERSION-1.info:etc/xmedcon.info.in
830
 
 etc/xmedcon-$VERSION.ebuild:etc/xmedcon.ebuild.in
831
 
 man/Makefile
832
 
])
833