[1365] | 1 | dnl Process this file with autoconf to produce a configure script.
|
---|
[1477] | 2 | AC_INIT(kernel/toi.cc)
|
---|
[1365] | 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 |
|
---|
[1477] | 18 | AC_PROG_CC
|
---|
[1365] | 19 | AC_PROG_CXX
|
---|
| 20 |
|
---|
| 21 | AC_CHECK_SIZEOF(short)
|
---|
| 22 | AC_CHECK_SIZEOF(int)
|
---|
| 23 | AC_CHECK_SIZEOF(long)
|
---|
| 24 | AC_CHECK_SIZEOF(float)
|
---|
| 25 | AC_CHECK_SIZEOF(double)
|
---|
| 26 | AC_CHECK_SIZEOF(long double)
|
---|
| 27 |
|
---|
| 28 | dnl look for cfitsio include and cfitsio library
|
---|
| 29 | dnl if installed in /usr/local, nothing to do
|
---|
| 30 |
|
---|
| 31 | AC_MSG_CHECKING("for cfitsio lib")
|
---|
| 32 | MACHDIR=`uname`-$CXX
|
---|
| 33 | if test -f $ARCHBASEREP/$MACHDIR/Libs/libcfitsio.a; then
|
---|
| 34 | cfitslibdir='-L$(ARCHBASEREP)/$(MACHDIR)/Libs'
|
---|
| 35 | elif test -f $CFITSIOLIBDIR/$MACHDIR/Libs/libcfitsio.a; then
|
---|
| 36 | cfitslibdir='-L$(CFITSIOLIBDIR)/$(MACHDIR)/Libs'
|
---|
| 37 | elif test -f $CFITSIOLIBDIR/$MACHDIR/libcfitsio.a; then
|
---|
| 38 | cfitslibdir='-L$(CFITSIOLIBDIR)/$(MACHDIR)'
|
---|
| 39 | elif test -f $CFITSIOLIBDIR/`uname`/lib/libcfitsio.a; then
|
---|
| 40 | cfitslibdir='-L$(CFITSIOLIBDIR)/'`uname`/lib
|
---|
| 41 | elif test -f $CFITSIOLIBDIR/`uname`/libcfitsio.a; then
|
---|
| 42 | cfitslibdir='-L$(CFITSIOLIBDIR)/'`uname`
|
---|
| 43 | elif test -f $CFITSIOLIBDIR/libcfitsio.a; then
|
---|
| 44 | cfitslibdir='-L$(CFITSIOLIBDIR)'
|
---|
| 45 | elif test -f $CFITSIODIR/libcfitsio.a; then
|
---|
| 46 | cfitslibdir='-L$(CFITSIODIR)'
|
---|
| 47 | elif test -f /usr/local/lib/libcfitsio.a; then
|
---|
| 48 | cfitslibdir=""
|
---|
| 49 | else
|
---|
| 50 | AC_MSG_ERROR("Cannot find cfitsio library")
|
---|
| 51 | fi
|
---|
| 52 | AC_MSG_RESULT($cfitslibdir)
|
---|
| 53 | AC_SUBST(cfitslibdir)
|
---|
| 54 |
|
---|
| 55 | AC_MSG_CHECKING("for cfitsio includes")
|
---|
| 56 | if test -f $CFITSIODIR/fitsio.h; then
|
---|
| 57 | cfitsincdir='-I$(CFITSIODIR)'
|
---|
| 58 | elif test -f /usr/local/include/fitsio.h; then
|
---|
| 59 | cfitsincdir=""
|
---|
| 60 | else
|
---|
| 61 | AC_MSG_ERROR("Cannot find cfitsio include fitsio.h")
|
---|
| 62 | fi
|
---|
| 63 | AC_MSG_RESULT($cfitsincdir)
|
---|
| 64 | AC_SUBST(cfitsincdir)
|
---|
| 65 |
|
---|
| 66 | dnl Checks for libraries.
|
---|
| 67 | dnl AC_CHECK_LIB(cfitsio, ffread,,AC_MSG_ERROR("Cannot find cfitsio library"))
|
---|
| 68 | AC_CHECK_LIB(m, sin)
|
---|
| 69 |
|
---|
| 70 | dnl Checks for header files.
|
---|
| 71 | AC_HEADER_STDC
|
---|
| 72 |
|
---|
[1477] | 73 | outfiles="Makefile kernel/Makefile processors/Makefile pipes/Makefile"
|
---|
| 74 | if [[ $use_sophya = 1 ]]; then
|
---|
| 75 | outfiles="$outfiles sophya/Makefile"
|
---|
| 76 | fi
|
---|
| 77 |
|
---|
| 78 | AC_OUTPUT($outfiles)
|
---|
| 79 |
|
---|