IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 25, 2010, 12:54:22 PM (16 years ago)
Author:
eugene
Message:

merge changes from eam_branches/ipp-20100823

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/configure.ac

    r24322 r29542  
    202202CPPFLAGS=${TMP_CPPFLAGS}
    203203
     204dnl ------------------ kapa,libkapa options -------------------------
     205dnl -- libkapa implies the requirement for libpng, libjpeg as well --
     206
     207dnl save LIBS/CFLAGS/LDFLAGS
     208TMP_LIBS=${LIBS}
     209TMP_CFLAGS=${CFLAGS}
     210TMP_LDFLAGS=${LDFLAGS}
     211TMP_CPPFLAGS=${CPPFLAGS}
     212
     213dnl test for command-line options: use ohana-config if not supplied
     214KAPA_CFLAGS_CONFIG="true"
     215KAPA_LIBS_CONFIG="true"
     216AC_ARG_WITH(kapa,
     217[AS_HELP_STRING(--with-kapa=DIR,Specify location of libkapa)],
     218[KAPA_CFLAGS="-I$withval/include" KAPA_LIBS="-L$withval/lib"
     219 KAPA_CFLAGS_CONFIG="false"       KAPA_LIBS_CONFIG="false"])
     220AC_ARG_WITH(kapa-include,
     221[AS_HELP_STRING(--with-kapa-include=DIR,Specify libkapa include directory.)],
     222[KAPA_CFLAGS="-I$withval" KAPA_CFLAGS_CONFIG="false"])
     223AC_ARG_WITH(kapa-lib,
     224[AS_HELP_STRING(--with-kapa-lib=DIR,Specify libkapa library directory.)],
     225[KAPA_LIBS="-L$withval" KAPA_LIBS_CONFIG="false"])
     226
     227echo "KAPA_CFLAGS_CONFIG: $KAPA_CFLAGS_CONFIG"
     228echo "KAPA_LIBS_CONFIG: $KAPA_LIBS_CONFIG"
     229echo "KAPA_CFLAGS: $KAPA_CFLAGS"
     230echo "KAPA_LIBS: $KAPA_LIBS"
     231
     232dnl HAVE_KAPA is set to false if any of the tests fail
     233HAVE_KAPA="true"
     234AC_MSG_NOTICE([checking for libkapa])
     235if test "$KAPA_CFLAGS_CONFIG" = "true" -o "$KAPA_LIBS_CONFIG" = "true"; then
     236  AC_MSG_NOTICE([kapa info supplied by ohana-config])
     237  KAPA_CONFIG=`which ohana-config`
     238  AC_CHECK_FILE($KAPA_CONFIG,[],
     239    [HAVE_KAPA="false"; AC_MSG_WARN([libkapa is not found: output plots disabled.  Obtain libkapa at http://kiawe.ifa.hawaii.edu/Elixir/Ohana or use --with-kapa to specify location])])
     240 
     241  echo "HAVE_KAPA: $HAVE_KAPA"
     242  echo "KAPA_CFLAGS_CONFIG: $KAPA_CFLAGS_CONFIG"
     243
     244  if test "$HAVE_KAPA" = "true" -a "$KAPA_CFLAGS_CONFIG" = "true" ; then
     245   AC_MSG_NOTICE([libkapa cflags info supplied by ohana-config])
     246   AC_MSG_CHECKING([libkapa cflags])
     247   KAPA_CFLAGS="`${KAPA_CONFIG} --cflags`"
     248   AC_MSG_RESULT([${KAPA_CFLAGS}])
     249  fi
     250
     251  if test "$HAVE_KAPA" = "true" -a "$KAPA_LIBS_CONFIG" = "true" ; then
     252   AC_PATH_X
     253   if test "$no_x" = "yes" ; then
     254      AC_MSG_WARN([X11 not found: output plots using kapa disabled.  Use --x-includes and --x-libraries if required.])
     255      HAVE_KAPA="false"
     256   else
     257      AC_MSG_NOTICE([libkapa ldflags info supplied by ohana-config])
     258      AC_MSG_CHECKING([libkapa ldflags])
     259      if test -n "$x_libraries" ; then
     260            KAPA_LIBS="`${KAPA_CONFIG} --libs` -L$x_libraries -lX11"
     261      else
     262            KAPA_LIBS="`${KAPA_CONFIG} --libs` -lX11"
     263      fi
     264      if test -n "$x_includes" ; then
     265            KAPA_CFLAGS="${KAPA_CFLAGS} -I$x_includes"
     266      else
     267            KAPA_CFLAGS="${KAPA_CFLAGS}"
     268      fi
     269      AC_MSG_RESULT([${KAPA_LIBS}])
     270   fi
     271  fi
     272fi
     273
     274if test "$HAVE_KAPA" = "true" ; then
     275 AC_MSG_NOTICE([libkapa supplied])
     276 PSLIB_CFLAGS="${PSLIB_CFLAGS} ${KAPA_CFLAGS}"
     277 PSLIB_LIBS="${PSLIB_LIBS} ${KAPA_LIBS}"
     278else
     279 AC_MSG_NOTICE([libkapa ignored])
     280fi
     281
    204282dnl ------------------ libjpeg options ---------------------
    205283
     
    239317LDFLAGS=${TMP_LDFLAGS}
    240318CPPFLAGS=${TMP_CPPFLAGS}
     319
     320dnl ------------------ libpng options ---------------------
     321
     322dnl save LIBS/CFLAGS/LDFLAGS
     323TMP_LIBS=${LIBS}
     324TMP_CFLAGS=${CFLAGS}
     325TMP_LDFLAGS=${LDFLAGS}
     326TMP_CPPFLAGS=${CPPFLAGS}
     327
     328AC_ARG_WITH(png,
     329[AS_HELP_STRING(--with-png=DIR,Specify location of libpng.)],
     330[PNG_CFLAGS="-I$withval/include"
     331 PNG_LDFLAGS="-L$withval/lib"])
     332AC_ARG_WITH(png-include,
     333[AS_HELP_STRING(--with-png-include=DIR,Specify libpng include directory.)],
     334[PNG_CFLAGS="-I$withval"])
     335AC_ARG_WITH(png-lib,
     336[AS_HELP_STRING(--with-png-lib=DIR,Specify libpng library directory.)],
     337[PNG_LDFLAGS="-L$withval"])
     338
     339CFLAGS="${CFLAGS} ${PNG_CFLAGS}"
     340CPPFLAGS=${CFLAGS}
     341LDFLAGS="${LDFLAGS} ${PNG_LDFLAGS}"
     342
     343AC_CHECK_HEADERS([png.h],
     344  [PSLIB_CFLAGS="$PSLIB_CFLAGS $PNG_CFLAGS" AC_SUBST(PNG_CFLAGS)],
     345  [HAVE_KAPA=false; AC_MSG_WARN([libpng headers not found: output plots disabled.  Obtain libpng from http://www.ijg.org/ or use --with-png to specify location.])]
     346)
     347
     348AC_CHECK_LIB(png,png_init_io,
     349  [PSLIB_LIBS="$PSLIB_LIBS $PNG_LDFLAGS -lpng"],
     350  [HAVE_KAPA=false; AC_MSG_WARN([libpng library not found: output plots disabled.  Obtain libpng from http://www.ijg.org/ or use --with-png to specify location.])]
     351)
     352
     353dnl restore the CFLAGS/LDFLAGS
     354LIBS=${TMP_LIBS}
     355CFLAGS=${TMP_CFLAGS}
     356LDFLAGS=${TMP_LDFLAGS}
     357CPPFLAGS=${TMP_CPPFLAGS}
     358
     359dnl ------------------ use kapa or not? ---------------------
     360
     361if test "$HAVE_KAPA" == "true" ; then
     362  AC_MSG_RESULT([including plotting functions])
     363  AC_DEFINE([HAVE_KAPA],[1],[enable use of libkapa])
     364else
     365  AC_MSG_RESULT([skipping plotting functions])
     366  AC_DEFINE([HAVE_KAPA],[0],[disable use of libkapa])
     367fi
    241368
    242369dnl ------------------- SWIG options ---------------------
Note: See TracChangeset for help on using the changeset viewer.