AC_INIT([CADS_fits2jpeg], [1.90], [cads@iiap.res.in]) AC_LANG_C AM_INIT_AUTOMAKE([-Wall -Werror]) AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADERS([config.h]) # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET # Checks for libraries. # Checks for header files. AC_CHECK_HEADERS([stdio.h stdlib.h string.h math.h]) # Checks for typedefs, structures, and compiler characteristics. # Checks for library functions. AC_FUNC_MALLOC LIBS="$LIBS -L/usr/lib64 -L/usr/lib -lm -ljpeg -lcfitsio" CFLAGS="-ansi $CFLAGS -I/usr/include -I/usr/include/cfitsio" #---------------------------------------------------------------------# # Now we check for cfitsio headers and library # #---------------------------------------------------------------------# fitserror=" +------------------------------------------------------------------+ | Unable to find cfitsio distribution. You may need to get it from | | http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html | +------------------------------------------------------------------+ " AC_ARG_WITH(cfitsio, [ --with-cfitsio[=DIR] Location of the cfitsio distribution], [CFITS=$with_cfitsio] ) if test x"$CFITS" != 'x'; then LIBS="-L$CFITS -L$CFITS/lib64 -L$CFITS/lib $LIBS" CFLAGS="$CFLAGS -I$CFITS -I$CFITS/include -I$CFITS/include/cfitsio" fi AC_MSG_CHECKING(for cfitsio) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ fitsfile *fptr]])], [cfitsio=yes],[cfitsio=no]) AC_MSG_RESULT([$cfitsio]) if test "$cfitsio" != "yes"; then AC_MSG_ERROR($fitserror) fi #---------------------------------------------------------------------# # And the jpeg headers and library # #---------------------------------------------------------------------# jpegerror=" +------------------------------------------------------------------+ | Unable to find jpeg library and headers | +------------------------------------------------------------------+ " AC_ARG_WITH(jpeglib, [ --with-jpeglib[=DIR] Location of the jpeg library], [LJPG=$with_jpeglib] ) if test x"$LJPG" != 'x'; then LIBS="-L$LJPG -L$LJPG/lib64 -L$LJPG/lib $LIBS" CFLAGS="$CFLAGS -I$LJPG -I$LJPG/include -I$LJPG/include/jpeglib" fi AC_MSG_CHECKING(for jpeglib) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ FILE *jpeg_file]])], [jpeg=yes],[jpeg=no]) AC_MSG_RESULT([$jpeg]) if test "$jpeg" != "yes"; then AC_MSG_ERROR($jpegerror) fi AC_OUTPUT(Makefile src/Makefile) echo echo " +------------------------------------------------------------------+" echo " | Configuration complete |" echo " | Type 'make' to compile the software, followed by 'make install' |" echo " | All the very best! :-) |" echo " | --CADS Software Team |" echo " +------------------------------------------------------------------+" echo