IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 14, 2005, 12:18:48 PM (21 years ago)
Author:
desonia
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/configure.ac

    r5318 r5512  
    1 AC_PREREQ(2.57)
     1AC_PREREQ(2.59)
    22
    33AC_INIT([pslib],[0.8.99],[http://pan-starrs.ifa.hawaii.edu/bugzilla])
     
    66
    77AM_INIT_AUTOMAKE([1.7 foreign dist-bzip2])
    8 AM_CONFIG_HEADER(src/config.h)
     8AC_CONFIG_HEADERS([src/config.h])
    99AM_MAINTAINER_MODE
    1010
     
    1212AC_SUBST(PSLIB_LT_VERSION,$PSLIB_LT_VERSION)
    1313
    14 dnl Determine the location of GNU sed
    15 AC_CHECK_PROGS([SED],[gsed sed])
    16 if test "${SED}" == ""
    17 then
    18   AC_MSG_ERROR([GNU SED is required.])
    19 fi
    20 AC_SUBST(SED,[${SED}])
     14dnl ------------------- PERL options ---------------------
     15  AC_ARG_WITH(perl,
     16    [AS_HELP_STRING(--with-perl=FILE,Specify location of PERL executable.)],
     17    [AC_CHECK_PROG(PERL, $withval, $withval)],
     18    [AC_CHECK_PROG(PERL, perl, `which perl`)])
     19    if test "$PERL" == ""
     20    then
     21      AC_MSG_ERROR([PERL is required.  Use --with-perl to specify its install location.])
     22    fi
     23    AC_SUBST(PERL,$PERL)
    2124
    2225SUBDIR="etc src test" dnl don't include 'swig', as it is optional
     
    2427SRCPATH='${top_srcdir}/src'
    2528SRCDIRS="sys astro db fft fits imageops math mathtypes types xml"
    26 SRCINC=`echo "${SRCDIRS=}" | ${SED} "s|\(\\w\+\)|-I\${SRCPATH=}/\1|g"`
     29# escape two escapes at this level so \\ gets passed to the shell and \ to perl
     30SRCINC=`echo "${SRCDIRS=}" | ${PERL} -pe "s|(\w+)|-I\\\\${SRCPATH=}/\1|g"`
    2731SRCINC="-I${SRCPATH=} ${SRCINC=}"
    28 SRCSUBLIBS=`echo "${SRCDIRS=}" | ${SED} "s|\(\\w\+\)|\1/libpslib\1.la|g"`
     32SRCSUBLIBS=`echo "${SRCDIRS=}" | ${PERL} -pe "s|(\w+)|\1/libpslib\1.la|g"`
    2933AC_SUBST(SRCSUBLIBS,${SRCSUBLIBS=})
    3034AC_SUBST(SRCINC,${SRCINC=})
     
    4953)
    5054
    51 case $host in
    52   *-apple-darwin*)
    53 dnl    CFLAGS="${CFLAGS=} -Wno-long-double -fno-strict-aliasing"
    54 dnl GCC 4.0 on OSX seems to hate that.
    55     ;;
    56 esac
    57 
    5855AC_LANG(C)
    5956AC_PROG_CC
     
    6966
    7067dnl check for standard language functionality
    71 AC_HEADER_STDC
    72 AC_HEADER_SYS_WAIT
    73 AC_CHECK_HEADERS([float.h limits.h stdint.h stdlib.h string.h sys/time.h unistd.h])
    74 AC_HEADER_STDBOOL
     68AC_CHECK_HEADERS([fcntl.h float.h limits.h stdint.h stdlib.h string.h sys/time.h unistd.h])
    7569AC_C_CONST
    7670AC_C_INLINE
    77 AC_TYPE_PID_T
    78 AC_C_RESTRICT
    79 AC_TYPE_SIZE_T
     71AC_HEADER_STDBOOL
     72AC_HEADER_SYS_WAIT
    8073AC_HEADER_TIME
    8174AC_STRUCT_TM
     75AC_TYPE_SIZE_T
    8276
    8377dnl Checks for library functions.
     
    160154[CFITSIO_LDFLAGS="-L$withval"])
    161155PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${CFITSIO_CFLAGS}"
    162 PSLIB_LIBS="${PSLIB_LIBS=} $CFITSIO_LDFLAGS -lcfitsio"
     156PSLIB_LIBS="${PSLIB_LIBS=} $CFITSIO_LDFLAGS -lcfitsio -lm"
     157
     158dnl Store off CFLAGS/LDFLAGS so that they can be restored after tests
    163159TMP_CFLAGS=${CFLAGS}
    164 CFLAGS=${CFITSIO_CFLAGS}
     160TMP_LDFLAGS=${LDFLAGS}
     161
     162CFLAGS=${PSLIB_CFLAGS}
     163LDFLAGS=${PSLIB_LIBS}
    165164AC_CHECK_HEADERS([fitsio.h],[],
    166    [AC_MSG_ERROR([CFITSIO is required.  Obtain it at  http://heasarc.gsfc.nasa.gov/docs/software/fitsio or use --with-cfitsio to specify location.])])
     165   [AC_MSG_ERROR([CFITSIO headers not found.  Obtain CFITSIO at  http://heasarc.gsfc.nasa.gov/docs/software/fitsio or use --with-cfitsio to specify location.])]
     166)
     167TMP_LIBS=${LIBS}
     168AC_CHECK_LIB(cfitsio,ffopen,[],
     169  [AC_MSG_ERROR([CFITSIO library not found.  Obtain it at  http://heasarc.gsfc.nasa.gov/docs/software/fitsio or use --with-cfitsio to specify location.])]
     170)
     171dnl Now check if CFITSIO supports fits_open_diskfile, i.e., is at least version 2.501
     172AC_CHECK_LIB(cfitsio,ffdkopen,
     173  [CFITSIO_DISKFILE=1],
     174  [AC_MSG_WARN([The CFITSIO library version is rather old.  Suggested version is 2.501 or greater.])
     175   CFITSIO_DISKFILE=0]
     176)
     177LIBS=${TMP_LIBS}
     178
     179dnl restore the CFLAGS/LDFLAGS
    167180CFLAGS=${TMP_CFLAGS}
    168 
     181LDFLAGS=${TMP_LDFLAGS}
     182
     183AC_DEFINE_UNQUOTED([CFITSIO_DISKFILE],${CFITSIO_DISKFILE},[Define to 1 if you have fits_open_diskfile in CFITSIO])
    169184AC_SUBST([CFITSIO_CFLAGS])
    170185
     
    182197PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${FFTW3_CFLAGS}"
    183198PSLIB_LIBS="${PSLIB_LIBS=} $FFTW3_LDFLAGS -lfftw3f"
     199
     200dnl Store off CFLAGS/LDFLAGS so that they can be restored after tests
    184201TMP_CFLAGS=${CFLAGS}
    185 CFLAGS=${FFTW3_CFLAGS}
     202TMP_LDFLAGS=${LDFLAGS}
     203
     204CFLAGS="${TMP_CFLAGS} ${PSLIB_CFLAGS}"
     205LDFLAGS="${TMP_LDFLAGS} ${PSLIB_LIBS}"
    186206AC_CHECK_HEADERS([fftw3.h],[],
    187    [AC_MSG_ERROR([FFTW version 3 with float support is required.  Obtain it at http://www.fftw.org/or use --with-fftw3 to specify location.])])
     207  [AC_MSG_ERROR([FFTW version 3 (--withfloat) headers not found.  Obtain it at http://www.fftw.org/or use --with-fftw3 to specify location.])]
     208)
     209TMP_LIBS=${LIBS}
     210AC_CHECK_LIB(fftw3f,fftwf_plan_dft_2d,[],
     211  [AC_MSG_ERROR([FFTW version 3 (--withfloat) library not found.  Obtain it at http://www.fftw.org/or use --with-fftw3 to specify location.])]
     212)
     213LIBS=${TMP_LIBS}
     214
     215dnl restore the CFLAGS/LDFLAGS
    188216CFLAGS=${TMP_CFLAGS}
     217LDFLAGS=${TMP_LDFLAGS}
    189218
    190219AC_SUBST([FFTW3_CFLAGS])
     
    197226AC_CHECK_FILE($GSL_CONFIG,[],
    198227    [AC_MSG_ERROR([GSL is required.  Obtain it at http://www.gnu.org/software/gsl or use --with-gsl-config to specify location.])])
     228
    199229AC_MSG_CHECKING([GSL cflags])
    200230GSL_CFLAGS="`${GSL_CONFIG} --cflags`"
    201231AC_MSG_RESULT([${GSL_CFLAGS}])
     232
     233AC_MSG_CHECKING([GSL ldflags])
     234GSL_LDFLAGS="`${GSL_CONFIG} --libs`"
     235AC_MSG_RESULT([${GSL_LDFLAGS}])
     236
    202237PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${GSL_CFLAGS}"
    203 PSLIB_LIBS="${PSLIB_LIBS=} `${GSL_CONFIG} --libs`"
     238PSLIB_LIBS="${PSLIB_LIBS=} ${GSL_LDFLAGS}"
    204239
    205240AC_SUBST([GSL_CFLAGS])
     
    212247AC_CHECK_FILE($XML_CONFIG,[],
    213248    [AC_MSG_ERROR([GNOME XML C parser is required.  Obtain it at http://www.xmlsoft.org or use --with-xml2-config to specify location.])])
     249
    214250AC_MSG_CHECKING([xml2 cflags])
    215251XML_CFLAGS="`${XML_CONFIG} --cflags`"
    216252AC_MSG_RESULT([${XML_CFLAGS}])
     253
     254AC_MSG_CHECKING([xml2 ldflags])
     255XML_LDFLAGS="`${XML_CONFIG} --libs`"
     256AC_MSG_RESULT([${XML_LDFLAGS}])
     257
    217258PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${XML_CFLAGS}"
    218 PSLIB_LIBS="${PSLIB_LIBS=} `${XML_CONFIG} --libs`"
     259PSLIB_LIBS="${PSLIB_LIBS=} ${XML_LDFLAGS}"
    219260
    220261AC_SUBST([XML_CFLAGS])
     
    239280  SUBDIR="${SUBDIR=} swig"
    240281
    241 dnl ------------------- PERL options ---------------------
    242   AC_ARG_WITH(perl,
    243     [AS_HELP_STRING(--with-perl=FILE,Specify location of PERL executable.)],
    244     [AC_CHECK_PROG(PERL, $withval, $withval)],
    245     [AC_CHECK_PROG(PERL, perl, `which perl`)])
    246     if test "$PERL" == ""
    247     then
    248       AC_MSG_ERROR([PERL is required.  Use --with-perl to specify its install location.])
    249     fi
    250     AC_SUBST(PERL,$PERL)
    251 
    252282dnl ---------------- PERLPREFIX option -------------------
    253283  AC_ARG_WITH(perlprefix,
     
    262292fi
    263293
    264 dnl for MacOSX, check if sqrtf is in mx library.
     294dnl for MacOSX suppport -- check if sqrtf is in mx library.
     295TMP_LIBS=${LIBS}
    265296AC_CHECK_LIB(mx,sqrtf,
    266297  [PSLIB_LIBS="${PSLIB_LIBS=} -lmx"])
     298LIBS=${TMP_LIBS}
    267299AC_CHECK_FUNC(atoll, [],
    268   [AC_MSG_ERROR([The C99 function, atoll, is required; update your compiler?])])
    269 
    270 DOXYGEN="doxygen Doxyfile"
    271 AC_CHECK_PROG(DOXYGEN,doxygen,[echo Doxygen not detected in configure stage.])
    272 AC_SUBST(DOXYGEN,$DOXYGEN)
    273 
    274 CFLAGS="${CFLAGS=} -Wall -Werror"
     300  [AC_MSG_ERROR([The C99 function, atoll, is required; update your compiler version?])])
     301
     302AC_CHECK_PROG(doxygen,[doxygen],[true],[false])
     303AM_CONDITIONAL(DOXYGEN, test x$doxygen = xtrue)
     304
     305
     306dnl ------- restore CFLAGS / LDFLAGS (tests done) --------
     307CFLAGS="${CFLAGS} -Wall -Werror"
     308AC_MSG_RESULT([CFLAGS is ${CFLAGS}])
     309AC_MSG_RESULT([LDFLAGS is ${LDFLAGS}])
    275310
    276311dnl ---------------- export variables --------------------
Note: See TracChangeset for help on using the changeset viewer.