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