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