1 | dnl Process this file with autoconf to produce a configure script.
|
---|
2 | AC_INIT(toi.cc)
|
---|
3 | AC_CONFIG_HEADER(conf.h)
|
---|
4 |
|
---|
5 | AC_ARG_WITH(sophya, [ --with-sophya Compile and link with SOPHYA],
|
---|
6 | use_sophya=1, use_sophya=0)
|
---|
7 |
|
---|
8 | AC_SUBST(use_sophya)
|
---|
9 |
|
---|
10 | if test `uname` = OSF1 -a -z "$CXX"; then
|
---|
11 | if test -x /usr/bin/cxx; then
|
---|
12 | echo "using cxx on alpha"
|
---|
13 | CXX=cxx
|
---|
14 | export CXX
|
---|
15 | fi
|
---|
16 | fi
|
---|
17 |
|
---|
18 | AC_PROG_CXX
|
---|
19 |
|
---|
20 | AC_CHECK_SIZEOF(short)
|
---|
21 | AC_CHECK_SIZEOF(int)
|
---|
22 | AC_CHECK_SIZEOF(long)
|
---|
23 | AC_CHECK_SIZEOF(float)
|
---|
24 | AC_CHECK_SIZEOF(double)
|
---|
25 | AC_CHECK_SIZEOF(long double)
|
---|
26 |
|
---|
27 | dnl look for cfitsio include and cfitsio library
|
---|
28 | dnl if installed in /usr/local, nothing to do
|
---|
29 |
|
---|
30 | AC_MSG_CHECKING("for cfitsio lib")
|
---|
31 | MACHDIR=`uname`-$CXX
|
---|
32 | if test -f $ARCHBASEREP/$MACHDIR/Libs/libcfitsio.a; then
|
---|
33 | cfitslibdir='-L$(ARCHBASEREP)/$(MACHDIR)/Libs'
|
---|
34 | elif test -f $CFITSIOLIBDIR/$MACHDIR/Libs/libcfitsio.a; then
|
---|
35 | cfitslibdir='-L$(CFITSIOLIBDIR)/$(MACHDIR)/Libs'
|
---|
36 | elif test -f $CFITSIOLIBDIR/$MACHDIR/libcfitsio.a; then
|
---|
37 | cfitslibdir='-L$(CFITSIOLIBDIR)/$(MACHDIR)'
|
---|
38 | elif test -f $CFITSIOLIBDIR/`uname`/lib/libcfitsio.a; then
|
---|
39 | cfitslibdir='-L$(CFITSIOLIBDIR)/'`uname`/lib
|
---|
40 | elif test -f $CFITSIOLIBDIR/`uname`/libcfitsio.a; then
|
---|
41 | cfitslibdir='-L$(CFITSIOLIBDIR)/'`uname`
|
---|
42 | elif test -f $CFITSIOLIBDIR/libcfitsio.a; then
|
---|
43 | cfitslibdir='-L$(CFITSIOLIBDIR)'
|
---|
44 | elif test -f $CFITSIODIR/libcfitsio.a; then
|
---|
45 | cfitslibdir='-L$(CFITSIODIR)'
|
---|
46 | elif test -f /usr/local/lib/libcfitsio.a; then
|
---|
47 | cfitslibdir=""
|
---|
48 | else
|
---|
49 | AC_MSG_ERROR("Cannot find cfitsio library")
|
---|
50 | fi
|
---|
51 | AC_MSG_RESULT($cfitslibdir)
|
---|
52 | AC_SUBST(cfitslibdir)
|
---|
53 |
|
---|
54 | AC_MSG_CHECKING("for cfitsio includes")
|
---|
55 | if test -f $CFITSIODIR/fitsio.h; then
|
---|
56 | cfitsincdir='-I$(CFITSIODIR)'
|
---|
57 | elif test -f /usr/local/include/fitsio.h; then
|
---|
58 | cfitsincdir=""
|
---|
59 | else
|
---|
60 | AC_MSG_ERROR("Cannot find cfitsio include fitsio.h")
|
---|
61 | fi
|
---|
62 | AC_MSG_RESULT($cfitsincdir)
|
---|
63 | AC_SUBST(cfitsincdir)
|
---|
64 |
|
---|
65 | dnl Checks for libraries.
|
---|
66 | dnl AC_CHECK_LIB(cfitsio, ffread,,AC_MSG_ERROR("Cannot find cfitsio library"))
|
---|
67 | AC_CHECK_LIB(m, sin)
|
---|
68 |
|
---|
69 | AC_MSG_CHECKING("for source files in distribution")
|
---|
70 | srcfiles=""
|
---|
71 | curd=`pwd`
|
---|
72 | cd $srcdir
|
---|
73 | for n in *.cc; do
|
---|
74 | grep -q 'main(.*)' $n || srcfiles="$srcfiles $n"
|
---|
75 | done
|
---|
76 | cd $curd
|
---|
77 | AC_SUBST(srcfiles)
|
---|
78 | AC_MSG_RESULT("done")
|
---|
79 |
|
---|
80 | dnl Checks for header files.
|
---|
81 | AC_HEADER_STDC
|
---|
82 |
|
---|
83 | AC_OUTPUT(Makefile)
|
---|