source: tags/release-1.0.1/configure.ac

Last change on this file was 112, checked in by Matthew Whiting, 18 years ago

Several bug fixes:

  • The determination of the blank pixel value was not working correctly, due

to confusion between which out of par and head had the correct values.
getCube now reads the header values into the FitsHeader? class, and then these
are copied into the Param class by the new function Param::copyHeaderInfo.

  • The zoom box in the spectral output was scaling the flux scale by all data

points, and this caused problems when the MW channels were in view. These
channels are now omitted in the determination of the flux axis range.

  • The precision in the implied position given by the IAU name has been

increased -- it is now of the format J125345-362412 or G323.124+05.457.

Also added a CHANGES file, as we want to go to v.1.0.1, and updated
the version number in configure.ac.

File size: 7.0 KB
Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.57)
5AC_INIT([Duchamp], [1.0.1], [matthew.whiting@csiro.au])
6AC_CONFIG_SRCDIR([src/param.cc])
7AC_CONFIG_HEADER([src/config.h])
8
9# Checks for programs.
10AC_PROG_CXX
11AC_PROG_CC
12AC_PROG_CPP
13
14# Checks for libraries.
15AC_CHECK_LIB([stdc++], [vector])
16AC_CHECK_LIB([g2c], [gerror_])
17AC_CHECK_LIB([m], [log])
18
19# Checks for header files.
20AC_HEADER_STDC
21AC_CHECK_HEADERS([stdlib.h string.h unistd.h time.h math.h])
22
23# Checks for typedefs, structures, and compiler characteristics.
24AC_HEADER_STDBOOL
25AC_C_CONST
26AC_C_INLINE
27
28# Checks for library functions.
29AC_FUNC_STRTOD
30AC_CHECK_FUNCS([floor pow sqrt strtol log atan fabs])
31
32# Look for a Fortran compiler.
33AC_PROG_F77
34if test "x$F77" = x; then
35  AC_MSG_WARN([Fortran compiler not found])
36else
37  if test "x$ac_cv_f77_compiler_gnu" = xyes ; then
38    FFLAGS="$FFLAGS -Wno-globals"
39  fi
40
41  AC_MSG_CHECKING(whether $F77 accepts -I)
42  AC_LANG_PUSH(Fortran 77)
43  FFLAGS_save=$FFLAGS
44  FFLAGS=-I.
45  AC_TRY_COMPILE([], [], [FFLAGS="$FFLAGS_save -I."; AC_MSG_RESULT(yes)],
46    [FFLAGS="$FFLAGS_save"; AC_MSG_RESULT(no)])
47  AC_LANG_POP(Fortran 77)
48fi
49
50# Extra places to look for third-party include files and libraries.
51INCDIRS="$INCDIRS           \
52         /usr/include       \
53         /usr/local/include \
54         /usr/local/pgplot  \
55         /usr/local/cfitsio \
56         /usr/local/wcslib  \
57         /local/pgplot      \
58         /local/cfitsio     \
59         /opt/local/include"
60
61LIBDIRS="$LIBDIRS           \
62         /usr/lib           \
63         /usr/local/lib     \
64         /usr/local/pgplot  \
65         /usr/local/cfitsio \
66         /usr/local/wcslib  \
67         /local/lib         \
68         /local/pgplot      \
69         /local/cfitsio     \
70         /opt/SUNWspro/lib  \
71         /opt/local/lib"
72
73AC_MSG_NOTICE(LIBDIRS)
74
75for LIBDIR in $LIBDIRS ; do
76  AC_CHECK_FILE([$LIBDIR], [LDFLAGS="$LDFLAGS -L$LIBDIR"], [continue])
77done
78
79##########################################################################
80# Search for PGPLOT
81
82for INCDIR in $INCDIRS ; do
83  AC_CHECK_FILE([$INCDIR/cpgplot.h], [PGPLOTINC=-I$INCDIR; break])
84  INCDIR=$INCDIR/pgplot
85  AC_CHECK_FILE([$INCDIR/cpgplot.h], [PGPLOTINC=-I$INCDIR; break])
86done
87
88# PGPLOT compiled with a SUN compiler but linked with something else.
89AC_CHECK_LIB([sunmath], [cosd],      [PGPLOTLIB="-lsunmath $PGPLOTLIB"],
90             [], [$PGPLOTLIB $LIBS])
91AC_CHECK_LIB([M77],     [iand_],     [PGPLOTLIB="-lM77 $PGPLOTLIB"],
92             [], [$PGPLOTLIB $LIBS])
93AC_CHECK_LIB([F77],     [f77_init],  [PGPLOTLIB="-lF77 $PGPLOTLIB"],
94             [], [$PGPLOTLIB $LIBS])
95# PGPLOT compiled with a GNU compiler but linked with something else.
96AC_CHECK_LIB([m],       [log],       [PGPLOTLIB="-lm $PGPLOTLIB"])
97AC_CHECK_LIB([g2c],     [gerror_],   [PGPLOTLIB="-lg2c $PGPLOTLIB"],
98             [], [$PGPLOTLIB $LIBS])
99
100# Search for X11 includes and libraries.
101AC_PATH_X
102if test "x$ac_x_libraries" != x; then
103  LDFLAGS="$LDFLAGS -L$ac_x_libraries"
104  PGPLOTLIB="-lX11 $PGPLOTLIB"
105fi
106
107# It is possible that other libraries may be required depending on what
108# graphics drivers were installed with PGPLOT.
109AC_CHECK_LIB([z],       [deflate],   [PGPLOTLIB="-lz $PGPLOTLIB"],
110             [], [$PGPLOTLIB $LIBS])
111AC_CHECK_LIB([png],     [png_error], [PGPLOTLIB="-lpng $PGPLOTLIB"],
112             [], [$PGPLOTLIB $LIBS])
113AC_CHECK_LIB([pgplot],  [pgbeg_],    [PGPLOTLIB="-lpgplot $PGPLOTLIB"],
114             [], [$PGPLOTLIB $LIBS])
115AC_CHECK_LIB([cpgplot], [cpgopen],   [PGPLOTLIB="-lcpgplot $PGPLOTLIB"],
116             [PGPLOTLIB=], [$PGPLOTLIB $LIBS])
117
118if test "x$PGPLOTLIB" = x; then
119  AC_MSG_ERROR([
120    -------------------------------------------------------
121    Could not find the PGPLOT library.
122
123    ERROR: Duchamp configuration failure.
124    -------------------------------------------------------], [1])
125else
126  AC_MSG_NOTICE([PGPLOT appears to be available.])
127  AC_DEFINE([HAVE_PGPLOT], [1], [Define to 1 if PGPLOT is available.])
128fi
129
130AC_SUBST([PGPLOTINC])
131AC_SUBST([PGPLOTLIB])
132##########################################################################
133
134##########################################################################
135# Search for CFITSIO.
136for INCDIR in $INCDIRS ; do
137  AC_CHECK_FILE([$INCDIR/fitsio.h], [CFITSIOINC=-I$INCDIR; break])
138  INCDIR=$INCDIR/cfitsio
139  AC_CHECK_FILE([$INCDIR/fitsio.h], [CFITSIOINC=-I$INCDIR; break])
140done
141
142AC_CHECK_LIB([socket],  [recv],   [CFITSIOLIB="-lsocket"], [], [$LIBS])
143AC_CHECK_LIB([cfitsio], [ffopen], [CFITSIOLIB="-lcfitsio $CFITSIOLIB"], [],
144             [$CFITSIOLIB $LIBS])
145
146if test "x$CFITSIOINC" = x -o "x$CFITSIOLIB" = x; then
147  AC_MSG_ERROR([
148    -------------------------------------------------------
149    Could not find the CFITSIO library.
150
151    ERROR: Duchamp configuration failure.
152    -------------------------------------------------------], [1])
153else
154  for LIBDIR in $LIBDIRS ; do
155    AC_CHECK_FILE([$LIBDIR/libcfitsio.a], [CFITSIOLIB="-L$LIBDIR $CFITSIOLIB"; break])
156    LIBDIR=$LIBDIR/cfitsio
157    AC_CHECK_FILE([$LIBDIR/libcfitsio.a], [CFITSIOLIB="-L$LIBDIR $CFITSIOLIB"; break])
158  done
159  AC_MSG_NOTICE([CFITSIO appears to be available.])
160  AC_DEFINE([HAVE_CFITSIO], [1], [Define to 1 if CFITSIO is available.])
161fi
162
163AC_SUBST([CFITSIOINC])
164AC_SUBST([CFITSIOLIB])
165##########################################################################
166
167##########################################################################
168# Search for WCSLIB.
169for INCDIR in $INCDIRS ; do
170  AC_CHECK_FILE([$INCDIR/wcs.h], [WCSINC="-I$INCDIR $WCSINC"; break])
171  INCDIR=$INCDIR/wcslib
172  AC_CHECK_FILE([$INCDIR/wcs.h], [WCSINC="-I$INCDIR $WCSINC"; break])
173done
174for INCDIR in $INCDIRS ; do
175  AC_CHECK_FILE([$INCDIR/cpgsbox.h], [WCSINC="-I$INCDIR $WCSINC"; break])
176  INCDIR=$INCDIR/wcslib
177  AC_CHECK_FILE([$INCDIR/cpgsbox.h], [WCSINC="-I$INCDIR $WCSINC"; break])
178done
179
180AC_CHECK_LIB([wcs], [wcss2p], [WCSLIB="-lwcs $WCSLIB"], [],
181             [$WCSLIB $LIBS $CFITSIOLIB $PGPLOTLIB])
182AC_CHECK_LIB([pgsbox], [cpgsbox], [WCSLIB="-lpgsbox $WCSLIB"], [],
183             [$WCSLIB $LIBS $CFITSIOLIB $PGPLOTLIB])
184
185if test "x$WCSINC" = x -o "x$WCSLIB" = x; then
186  AC_MSG_ERROR([
187    -------------------------------------------------------
188    Could not find the WCSLIB library.
189
190    ERROR: Duchamp configuration failure.
191    -------------------------------------------------------], [1])
192else
193  for LIBDIR in $LIBDIRS ; do
194    AC_CHECK_FILE([$LIBDIR/libwcs.a], [WCSLIB="-L$LIBDIR $WCSLIB"; break])
195    LIBDIR=$LIBDIR/wcs
196    AC_CHECK_FILE([$LIBDIR/libwcs.a], [WCSLIB="-L$LIBDIR $WCSLIB"; break])
197  done
198  for LIBDIR in $LIBDIRS ; do
199    AC_CHECK_FILE([$LIBDIR/libpgsbox.a], [WCSLIB="-L$LIBDIR $WCSLIB"; break])
200    LIBDIR=$LIBDIR/wcs
201    AC_CHECK_FILE([$LIBDIR/libpgsbox.a], [WCSLIB="-L$LIBDIR $WCSLIB"; break])
202  done
203  AC_MSG_NOTICE([WCSLIB appears to be available.])
204  AC_DEFINE([HAVE_WCSLIB], [1], [Define to 1 if WCSLIB is available.])
205fi
206
207AC_SUBST([WCSINC])
208AC_SUBST([WCSLIB])
209##########################################################################
210
211AC_SUBST([LDFLAGS])
212
213AC_CONFIG_FILES([Makefile])
214AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.