Changeset 5512 for trunk/psLib/configure.ac
- Timestamp:
- Nov 14, 2005, 12:18:48 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/configure.ac (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/configure.ac
r5318 r5512 1 AC_PREREQ(2.5 7)1 AC_PREREQ(2.59) 2 2 3 3 AC_INIT([pslib],[0.8.99],[http://pan-starrs.ifa.hawaii.edu/bugzilla]) … … 6 6 7 7 AM_INIT_AUTOMAKE([1.7 foreign dist-bzip2]) 8 A M_CONFIG_HEADER(src/config.h)8 AC_CONFIG_HEADERS([src/config.h]) 9 9 AM_MAINTAINER_MODE 10 10 … … 12 12 AC_SUBST(PSLIB_LT_VERSION,$PSLIB_LT_VERSION) 13 13 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}]) 14 dnl ------------------- 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) 21 24 22 25 SUBDIR="etc src test" dnl don't include 'swig', as it is optional … … 24 27 SRCPATH='${top_srcdir}/src' 25 28 SRCDIRS="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 30 SRCINC=`echo "${SRCDIRS=}" | ${PERL} -pe "s|(\w+)|-I\\\\${SRCPATH=}/\1|g"` 27 31 SRCINC="-I${SRCPATH=} ${SRCINC=}" 28 SRCSUBLIBS=`echo "${SRCDIRS=}" | ${ SED} "s|\(\\w\+\)|\1/libpslib\1.la|g"`32 SRCSUBLIBS=`echo "${SRCDIRS=}" | ${PERL} -pe "s|(\w+)|\1/libpslib\1.la|g"` 29 33 AC_SUBST(SRCSUBLIBS,${SRCSUBLIBS=}) 30 34 AC_SUBST(SRCINC,${SRCINC=}) … … 49 53 ) 50 54 51 case $host in52 *-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 esac57 58 55 AC_LANG(C) 59 56 AC_PROG_CC … … 69 66 70 67 dnl 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 68 AC_CHECK_HEADERS([fcntl.h float.h limits.h stdint.h stdlib.h string.h sys/time.h unistd.h]) 75 69 AC_C_CONST 76 70 AC_C_INLINE 77 AC_TYPE_PID_T 78 AC_C_RESTRICT 79 AC_TYPE_SIZE_T 71 AC_HEADER_STDBOOL 72 AC_HEADER_SYS_WAIT 80 73 AC_HEADER_TIME 81 74 AC_STRUCT_TM 75 AC_TYPE_SIZE_T 82 76 83 77 dnl Checks for library functions. … … 160 154 [CFITSIO_LDFLAGS="-L$withval"]) 161 155 PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${CFITSIO_CFLAGS}" 162 PSLIB_LIBS="${PSLIB_LIBS=} $CFITSIO_LDFLAGS -lcfitsio" 156 PSLIB_LIBS="${PSLIB_LIBS=} $CFITSIO_LDFLAGS -lcfitsio -lm" 157 158 dnl Store off CFLAGS/LDFLAGS so that they can be restored after tests 163 159 TMP_CFLAGS=${CFLAGS} 164 CFLAGS=${CFITSIO_CFLAGS} 160 TMP_LDFLAGS=${LDFLAGS} 161 162 CFLAGS=${PSLIB_CFLAGS} 163 LDFLAGS=${PSLIB_LIBS} 165 164 AC_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 ) 167 TMP_LIBS=${LIBS} 168 AC_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 ) 171 dnl Now check if CFITSIO supports fits_open_diskfile, i.e., is at least version 2.501 172 AC_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 ) 177 LIBS=${TMP_LIBS} 178 179 dnl restore the CFLAGS/LDFLAGS 167 180 CFLAGS=${TMP_CFLAGS} 168 181 LDFLAGS=${TMP_LDFLAGS} 182 183 AC_DEFINE_UNQUOTED([CFITSIO_DISKFILE],${CFITSIO_DISKFILE},[Define to 1 if you have fits_open_diskfile in CFITSIO]) 169 184 AC_SUBST([CFITSIO_CFLAGS]) 170 185 … … 182 197 PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${FFTW3_CFLAGS}" 183 198 PSLIB_LIBS="${PSLIB_LIBS=} $FFTW3_LDFLAGS -lfftw3f" 199 200 dnl Store off CFLAGS/LDFLAGS so that they can be restored after tests 184 201 TMP_CFLAGS=${CFLAGS} 185 CFLAGS=${FFTW3_CFLAGS} 202 TMP_LDFLAGS=${LDFLAGS} 203 204 CFLAGS="${TMP_CFLAGS} ${PSLIB_CFLAGS}" 205 LDFLAGS="${TMP_LDFLAGS} ${PSLIB_LIBS}" 186 206 AC_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 ) 209 TMP_LIBS=${LIBS} 210 AC_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 ) 213 LIBS=${TMP_LIBS} 214 215 dnl restore the CFLAGS/LDFLAGS 188 216 CFLAGS=${TMP_CFLAGS} 217 LDFLAGS=${TMP_LDFLAGS} 189 218 190 219 AC_SUBST([FFTW3_CFLAGS]) … … 197 226 AC_CHECK_FILE($GSL_CONFIG,[], 198 227 [AC_MSG_ERROR([GSL is required. Obtain it at http://www.gnu.org/software/gsl or use --with-gsl-config to specify location.])]) 228 199 229 AC_MSG_CHECKING([GSL cflags]) 200 230 GSL_CFLAGS="`${GSL_CONFIG} --cflags`" 201 231 AC_MSG_RESULT([${GSL_CFLAGS}]) 232 233 AC_MSG_CHECKING([GSL ldflags]) 234 GSL_LDFLAGS="`${GSL_CONFIG} --libs`" 235 AC_MSG_RESULT([${GSL_LDFLAGS}]) 236 202 237 PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${GSL_CFLAGS}" 203 PSLIB_LIBS="${PSLIB_LIBS=} `${GSL_CONFIG} --libs`"238 PSLIB_LIBS="${PSLIB_LIBS=} ${GSL_LDFLAGS}" 204 239 205 240 AC_SUBST([GSL_CFLAGS]) … … 212 247 AC_CHECK_FILE($XML_CONFIG,[], 213 248 [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 214 250 AC_MSG_CHECKING([xml2 cflags]) 215 251 XML_CFLAGS="`${XML_CONFIG} --cflags`" 216 252 AC_MSG_RESULT([${XML_CFLAGS}]) 253 254 AC_MSG_CHECKING([xml2 ldflags]) 255 XML_LDFLAGS="`${XML_CONFIG} --libs`" 256 AC_MSG_RESULT([${XML_LDFLAGS}]) 257 217 258 PSLIB_CFLAGS="${PSLIB_CFLAGS=} ${XML_CFLAGS}" 218 PSLIB_LIBS="${PSLIB_LIBS=} `${XML_CONFIG} --libs`"259 PSLIB_LIBS="${PSLIB_LIBS=} ${XML_LDFLAGS}" 219 260 220 261 AC_SUBST([XML_CFLAGS]) … … 239 280 SUBDIR="${SUBDIR=} swig" 240 281 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 then248 AC_MSG_ERROR([PERL is required. Use --with-perl to specify its install location.])249 fi250 AC_SUBST(PERL,$PERL)251 252 282 dnl ---------------- PERLPREFIX option ------------------- 253 283 AC_ARG_WITH(perlprefix, … … 262 292 fi 263 293 264 dnl for MacOSX, check if sqrtf is in mx library. 294 dnl for MacOSX suppport -- check if sqrtf is in mx library. 295 TMP_LIBS=${LIBS} 265 296 AC_CHECK_LIB(mx,sqrtf, 266 297 [PSLIB_LIBS="${PSLIB_LIBS=} -lmx"]) 298 LIBS=${TMP_LIBS} 267 299 AC_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 302 AC_CHECK_PROG(doxygen,[doxygen],[true],[false]) 303 AM_CONDITIONAL(DOXYGEN, test x$doxygen = xtrue) 304 305 306 dnl ------- restore CFLAGS / LDFLAGS (tests done) -------- 307 CFLAGS="${CFLAGS} -Wall -Werror" 308 AC_MSG_RESULT([CFLAGS is ${CFLAGS}]) 309 AC_MSG_RESULT([LDFLAGS is ${LDFLAGS}]) 275 310 276 311 dnl ---------------- export variables --------------------
Note:
See TracChangeset
for help on using the changeset viewer.
