[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 |
|
---|
[1751] | 18 | if test `uname` = IRIX64 -a -z "$CXX"; then
|
---|
| 19 | if test -x /usr/bin/CC; then
|
---|
| 20 | echo "using CC on IRIX"
|
---|
| 21 | CXX=CC
|
---|
| 22 | export CXX
|
---|
| 23 | fi
|
---|
| 24 | fi
|
---|
| 25 |
|
---|
[1732] | 26 | dnl on donne priorite a g++ sur c++ sur Linux
|
---|
| 27 | if test `uname` = Linux -a -f /usr/bin/g++; then
|
---|
| 28 | CXX=/usr/bin/g++
|
---|
| 29 | fi
|
---|
| 30 |
|
---|
[1477] | 31 | AC_PROG_CC
|
---|
[1365] | 32 | AC_PROG_CXX
|
---|
[1706] | 33 | AC_PATH_PROG(AR, ar, /usr/bin/ar, /usr/bin:$PATH)
|
---|
[1707] | 34 | AC_PATH_PROG(RANLIB, ranlib, /usr/bin/ranlib, /usr/bin:$PATH)
|
---|
[1745] | 35 | AC_PROG_INSTALL
|
---|
[1365] | 36 |
|
---|
[1692] | 37 | if test $GCC = "yes"; then
|
---|
| 38 | gcc=$CC
|
---|
| 39 | else
|
---|
| 40 | gcc=gcc
|
---|
| 41 | fi
|
---|
| 42 | AC_SUBST(gcc)
|
---|
| 43 |
|
---|
[1365] | 44 | AC_CHECK_SIZEOF(short)
|
---|
| 45 | AC_CHECK_SIZEOF(int)
|
---|
| 46 | AC_CHECK_SIZEOF(long)
|
---|
[1663] | 47 | AC_CHECK_SIZEOF(long long)
|
---|
[1365] | 48 | AC_CHECK_SIZEOF(float)
|
---|
| 49 | AC_CHECK_SIZEOF(double)
|
---|
| 50 | AC_CHECK_SIZEOF(long double)
|
---|
| 51 |
|
---|
| 52 | dnl look for cfitsio include and cfitsio library
|
---|
| 53 | dnl if installed in /usr/local, nothing to do
|
---|
| 54 |
|
---|
| 55 | AC_MSG_CHECKING("for cfitsio lib")
|
---|
| 56 | MACHDIR=`uname`-$CXX
|
---|
| 57 | if test -f $ARCHBASEREP/$MACHDIR/Libs/libcfitsio.a; then
|
---|
| 58 | cfitslibdir='-L$(ARCHBASEREP)/$(MACHDIR)/Libs'
|
---|
[1730] | 59 | elif test -f $EXTLIBDIR/$MACHDIR/Libs/libcfitsio.a; then
|
---|
| 60 | cfitslibdir='-L$(EXTLIBDIR)/$(MACHDIR)/Libs'
|
---|
[1365] | 61 | elif test -f $CFITSIOLIBDIR/$MACHDIR/Libs/libcfitsio.a; then
|
---|
| 62 | cfitslibdir='-L$(CFITSIOLIBDIR)/$(MACHDIR)/Libs'
|
---|
| 63 | elif test -f $CFITSIOLIBDIR/$MACHDIR/libcfitsio.a; then
|
---|
| 64 | cfitslibdir='-L$(CFITSIOLIBDIR)/$(MACHDIR)'
|
---|
| 65 | elif test -f $CFITSIOLIBDIR/`uname`/lib/libcfitsio.a; then
|
---|
| 66 | cfitslibdir='-L$(CFITSIOLIBDIR)/'`uname`/lib
|
---|
| 67 | elif test -f $CFITSIOLIBDIR/`uname`/libcfitsio.a; then
|
---|
| 68 | cfitslibdir='-L$(CFITSIOLIBDIR)/'`uname`
|
---|
| 69 | elif test -f $CFITSIOLIBDIR/libcfitsio.a; then
|
---|
| 70 | cfitslibdir='-L$(CFITSIOLIBDIR)'
|
---|
| 71 | elif test -f $CFITSIODIR/libcfitsio.a; then
|
---|
| 72 | cfitslibdir='-L$(CFITSIODIR)'
|
---|
| 73 | elif test -f /usr/local/lib/libcfitsio.a; then
|
---|
| 74 | cfitslibdir=""
|
---|
| 75 | else
|
---|
| 76 | AC_MSG_ERROR("Cannot find cfitsio library")
|
---|
| 77 | fi
|
---|
| 78 | AC_MSG_RESULT($cfitslibdir)
|
---|
| 79 | AC_SUBST(cfitslibdir)
|
---|
| 80 |
|
---|
| 81 | AC_MSG_CHECKING("for cfitsio includes")
|
---|
| 82 | if test -f $CFITSIODIR/fitsio.h; then
|
---|
| 83 | cfitsincdir='-I$(CFITSIODIR)'
|
---|
[1730] | 84 | elif test -f $EXTLIBDIR/Include/FitsIO/fitsio.h; then
|
---|
[1738] | 85 | cfitsincdir='-I$(EXTLIBDIR)/Include/FitsIO'
|
---|
[1365] | 86 | elif test -f /usr/local/include/fitsio.h; then
|
---|
| 87 | cfitsincdir=""
|
---|
| 88 | else
|
---|
| 89 | AC_MSG_ERROR("Cannot find cfitsio include fitsio.h")
|
---|
| 90 | fi
|
---|
| 91 | AC_MSG_RESULT($cfitsincdir)
|
---|
| 92 | AC_SUBST(cfitsincdir)
|
---|
| 93 |
|
---|
| 94 | dnl Checks for libraries.
|
---|
| 95 | dnl AC_CHECK_LIB(cfitsio, ffread,,AC_MSG_ERROR("Cannot find cfitsio library"))
|
---|
| 96 | AC_CHECK_LIB(m, sin)
|
---|
[1732] | 97 | AC_CHECK_LIB(pthread, pthread_create)
|
---|
| 98 | AC_CHECK_LIB(blas, scopy_)
|
---|
| 99 | AC_CHECK_LIB(g2c, s_copy)
|
---|
[1365] | 100 |
|
---|
| 101 | dnl Checks for header files.
|
---|
| 102 | AC_HEADER_STDC
|
---|
[1663] | 103 | AC_CHECK_HEADERS(values.h stdint.h)
|
---|
[1365] | 104 |
|
---|
[1477] | 105 | outfiles="Makefile kernel/Makefile processors/Makefile pipes/Makefile"
|
---|
| 106 | if [[ $use_sophya = 1 ]]; then
|
---|
| 107 | outfiles="$outfiles sophya/Makefile"
|
---|
| 108 | fi
|
---|
| 109 |
|
---|
| 110 | AC_OUTPUT($outfiles)
|
---|
| 111 |
|
---|