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