IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10386


Ignore:
Timestamp:
Dec 1, 2006, 12:23:27 PM (19 years ago)
Author:
eugene
Message:

added test for libkapa and dependencies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_01_branch/psphot/configure.ac

    r10281 r10386  
    2222  [AS_HELP_STRING(--enable-optimize,enable compiler optimization)],
    2323  [AC_MSG_RESULT(compile optimization enabled)
    24    CFLAGS="-O2"],
     24   CFLAGS="${CFLAGS=} -O2 -g"],
    2525  [AC_MSG_RESULT([compile optimization disabled])
    26    CFLAGS="-O0 -g"]
     26    if test x"${CFLAGS}" == x; then
     27      CFLAGS="-O0 -g"
     28    fi
     29  ]
    2730)
    2831
     
    3134  [AS_HELP_STRING(--enable-profile,enable compiler profiler information inclusion)],
    3235  [AC_MSG_RESULT(compile optimization enabled)
    33    CFLAGS="${CFLAGS=} -pg"]
     36   CFLAGS="${CFLAGS=} -pg -g"
     37   LDFLAGS="${LDFLAGS=} -pg"]
     38)
     39
     40dnl turn off trace messages
     41AC_ARG_ENABLE(trace,
     42  [AS_HELP_STRING(--disable-trace,disable psTrace functionality)],
     43  [AC_MSG_RESULT(psTrace disabled)
     44   PSPHOT_CFLAGS="${PSPHOT_CFLAGS=} -DPS_NO_TRACE"]
    3445)
    3546
     
    5061TMP_CPPFLAGS=${CPPFLAGS}
    5162
     63dnl test for command-line options: use ohana-config if not supplied
     64KAPA_CFLAGS_CONFIG="true"
     65KAPA_LIBS_CONFIG="true"
    5266AC_ARG_WITH(kapa,
    5367[AS_HELP_STRING(--with-kapa=DIR,Specify location of libkapa)],
    54 [KAPA_CFLAGS="-I$withval/include"
    55  KAPA_LDFLAGS="-L$withval/lib"])
     68[KAPA_CFLAGS="-I$withval/include" KAPA_LIBS="-L$withval/lib"
     69 KAPA_CFLAGS_CONFIG="false"       KAPA_LIBS_CONFIG="false"])
    5670AC_ARG_WITH(kapa-include,
    5771[AS_HELP_STRING(--with-kapa-include=DIR,Specify libkapa include directory.)],
    58 [KAPA_CFLAGS="-I$withval"])
     72[KAPA_CFLAGS="-I$withval" KAPA_CFLAGS_CONFIG="false"])
    5973AC_ARG_WITH(kapa-lib,
    6074[AS_HELP_STRING(--with-kapa-lib=DIR,Specify libkapa library directory.)],
    61 [KAPA_LDFLAGS="-L$withval"])
    62 
    63 CFLAGS="${CFLAGS} ${KAPA_CFLAGS}"
    64 CPPFLAGS=${CFLAGS}
    65 LDFLAGS="${LDFLAGS} ${KAPA_LIBS}"
    66 
    67 AC_CHECK_HEADERS([kapa.h],[],
    68   [AC_MSG_ERROR([libkapa headers not found.  Obtain it at http://kiawe.ifa.hawaii.edu/Elixir/Ohana or use --with-kapa to specify location.])]
    69 )
    70 AC_CHECK_LIB(kapa,KapaInitGraph,[],
    71   [AC_MSG_ERROR([libkapa headers not found.  Obtain it at http://kiawe.ifa.hawaii.edu/Elixir/Ohana or use --with-kapa to specify location.])],[-lm]
    72 )
    73 
    74 AC_SUBST([KAPA_CFLAGS])
     75[KAPA_LIBS="-L$withval" KAPA_LIBS_CONFIG="false"])
     76
     77echo "KAPA_CFLAGS_CONFIG: $KAPA_CFLAGS_CONFIG"
     78echo "KAPA_LIBS_CONFIG: $KAPA_LIBS_CONFIG"
     79echo "KAPA_CFLAGS: $KAPA_CFLAGS"
     80echo "KAPA_LIBS: $KAPA_LIBS"
     81
     82if test "true" = "true" ; then
     83  echo "success"
     84else
     85  echo "failure"
     86fi
     87
     88dnl HAVE_KAPA is set to false if any of the tests fail
     89HAVE_KAPA="true"
     90AC_MSG_NOTICE([checking for libkapa])
     91if test "$KAPA_CFLAGS_CONFIG" = "true" -o "$KAPA_LIBS_CONFIG" = "true"; then
     92  AC_MSG_NOTICE([kapa info supplied by ohana-config])
     93  KAPA_CONFIG=`which ohana-config`
     94  AC_CHECK_FILE($KAPA_CONFIG,[],
     95    [HAVE_KAPA="false"; AC_MSG_ERROR([libkapa is not found: output plots disabled.  Obtain libkapa at http://kiawe.ifa.hawaii.edu/Elixir/Ohana or use --with-kapa to specify location])])
     96 
     97  echo "HAVE_KAPA: $HAVE_KAPA"
     98  echo "KAPA_CFLAGS_CONFIG: $KAPA_CFLAGS_CONFIG"
     99
     100  if test "$HAVE_KAPA" = "true" -a "$KAPA_CFLAGS_CONFIG" = "true" ; then
     101   AC_MSG_NOTICE([libkapa cflags info supplied by ohana-config])
     102   AC_MSG_CHECKING([libkapa cflags])
     103   KAPA_CFLAGS="`${KAPA_CONFIG} --cflags`"
     104   AC_MSG_RESULT([${KAPA_CFLAGS}])
     105  fi
     106
     107  if test "$HAVE_KAPA" = "true" -a "$KAPA_LIBS_CONFIG" = "true" ; then
     108   AC_MSG_NOTICE([libkapa ldflags info supplied by ohana-config])
     109   AC_MSG_CHECKING([libkapa ldflags])
     110   KAPA_LIBS="`${KAPA_CONFIG} --libs` -lX11"
     111   AC_MSG_RESULT([${KAPA_LIBS}])
     112  fi
     113fi
     114
     115if test "$HAVE_KAPA" = "true" ; then
     116 AC_MSG_NOTICE([libkapa supplied])
     117 PSPHOT_CFLAGS="${PSPHOT_CFLAGS} ${KAPA_CFLAGS}"
     118 PSPHOT_LIBS="${PSPHOT_LIBS} ${KAPA_LIBS}"
     119else
     120 AC_MSG_NOTICE([libkapa ignored])
     121fi
     122
     123dnl HAVE_KAPA is set to false if any of the tests fail
     124dnl HAVE_KAPA=true
     125dnl AC_CHECK_HEADERS([kapa.h],
     126dnl  [PSPHOT_CFLAGS="$PSPHOT_CFLAGS $KAPA_CFLAGS" AC_SUBST(KAPA_CFLAGS)],
     127dnl  [HAVE_KAPA=false; AC_MSG_WARN([libkapa headers not found: output plots disabled.  Obtain libkapa at http://kiawe.ifa.hawaii.edu/Elixir/Ohana or use --with-kapa to specify location.])]
     128dnl )
     129dnl AC_CHECK_LIB(kapa,KapaInitGraph,
     130dnl  [PSPHOT_LIBS="$PSPHOT_LIBS $JPEG_LDFLAGS -ljpeg"], 
     131dnl  [HAVE_KAPA=false; AC_MSG_WARN([libkapa headers not found: output plots disabled.  Obtain libkapa at http://kiawe.ifa.hawaii.edu/Elixir/Ohana or use --with-kapa to specify location.])],[-lm]
     132dnl )
    75133
    76134dnl restore the CFLAGS/LDFLAGS
     
    80138CPPFLAGS=${TMP_CPPFLAGS}
    81139
     140dnl ------------------ libjpeg options ---------------------
     141
     142dnl save LIBS/CFLAGS/LDFLAGS
     143TMP_LIBS=${LIBS}
     144TMP_CFLAGS=${CFLAGS}
     145TMP_LDFLAGS=${LDFLAGS}
     146TMP_CPPFLAGS=${CPPFLAGS}
     147
     148AC_ARG_WITH(jpeg,
     149[AS_HELP_STRING(--with-jpeg=DIR,Specify location of libjpeg.)],
     150[JPEG_CFLAGS="-I$withval/include"
     151 JPEG_LDFLAGS="-L$withval/lib"])
     152AC_ARG_WITH(jpeg-include,
     153[AS_HELP_STRING(--with-jpeg-include=DIR,Specify libjpeg include directory.)],
     154[JPEG_CFLAGS="-I$withval"])
     155AC_ARG_WITH(jpeg-lib,
     156[AS_HELP_STRING(--with-jpeg-lib=DIR,Specify libjpeg library directory.)],
     157[JPEG_LDFLAGS="-L$withval"])
     158
     159CFLAGS="${CFLAGS} ${JPEG_CFLAGS}"
     160CPPFLAGS=${CFLAGS}
     161LDFLAGS="${LDFLAGS} ${JPEG_LDFLAGS}"
     162
     163AC_CHECK_HEADERS([jpeglib.h],
     164  [PSPHOT_CFLAGS="$PSPHOT_CFLAGS $JPEG_CFLAGS" AC_SUBST(JPEG_CFLAGS)],
     165  [HAVE_KAPA=false; AC_MSG_WARN([libjpeg headers not found: output plots disabled.  Obtain libjpeg from http://www.ijg.org/ or use --with-jpeg to specify location.])]
     166)
     167
     168AC_CHECK_LIB(jpeg,jpeg_CreateCompress,
     169  [PSPHOT_LIBS="$PSPHOT_LIBS $JPEG_LDFLAGS -ljpeg"],
     170  [HAVE_KAPA=false; AC_MSG_WARN([libjpeg library not found: output plots disabled.  Obtain libjpeg from http://www.ijg.org/ or use --with-jpeg to specify location.])]
     171)
     172
     173dnl restore the CFLAGS/LDFLAGS
     174LIBS=${TMP_LIBS}
     175CFLAGS=${TMP_CFLAGS}
     176LDFLAGS=${TMP_LDFLAGS}
     177CPPFLAGS=${TMP_CPPFLAGS}
     178
     179dnl ------------------ libpng options ---------------------
     180
     181dnl save LIBS/CFLAGS/LDFLAGS
     182TMP_LIBS=${LIBS}
     183TMP_CFLAGS=${CFLAGS}
     184TMP_LDFLAGS=${LDFLAGS}
     185TMP_CPPFLAGS=${CPPFLAGS}
     186
     187AC_ARG_WITH(png,
     188[AS_HELP_STRING(--with-png=DIR,Specify location of libpng.)],
     189[PNG_CFLAGS="-I$withval/include"
     190 PNG_LDFLAGS="-L$withval/lib"])
     191AC_ARG_WITH(png-include,
     192[AS_HELP_STRING(--with-png-include=DIR,Specify libpng include directory.)],
     193[PNG_CFLAGS="-I$withval"])
     194AC_ARG_WITH(png-lib,
     195[AS_HELP_STRING(--with-png-lib=DIR,Specify libpng library directory.)],
     196[PNG_LDFLAGS="-L$withval"])
     197
     198CFLAGS="${CFLAGS} ${PNG_CFLAGS}"
     199CPPFLAGS=${CFLAGS}
     200LDFLAGS="${LDFLAGS} ${PNG_LDFLAGS}"
     201
     202AC_CHECK_HEADERS([png.h],
     203  [PSPHOT_CFLAGS="$PSPHOT_CFLAGS $PNG_CFLAGS" AC_SUBST(PNG_CFLAGS)],
     204  [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.])]
     205)
     206
     207AC_CHECK_LIB(png,png_init_io,
     208  [PSPHOT_LIBS="$PSPHOT_LIBS $PNG_LDFLAGS -lpng"],
     209  [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.])]
     210)
     211
     212dnl restore the CFLAGS/LDFLAGS
     213LIBS=${TMP_LIBS}
     214CFLAGS=${TMP_CFLAGS}
     215LDFLAGS=${TMP_LDFLAGS}
     216CPPFLAGS=${TMP_CPPFLAGS}
     217
     218dnl ------------------ use kapa or not? ---------------------
     219
     220if test "$HAVE_KAPA" == "true" ; then
     221  AC_MSG_RESULT([including plotting functions])
     222  AC_DEFINE([HAVE_KAPA],[1],[enable use of libkapa])
     223else
     224  AC_MSG_RESULT([skipping plotting functions])
     225  AC_DEFINE([HAVE_KAPA],[0],[disable use of libkapa])
     226fi
     227
    82228dnl ------------- psLib, psModules ---------------
    83229PKG_CHECK_MODULES(PSLIB, pslib >= 0.12.99)
     
    86232dnl Set CFLAGS for build
    87233CFLAGS="${CFLAGS} -Wall -Werror -std=c99"
     234echo "PSPHOT_CFLAGS: $PSPHOT_CFLAGS"
     235echo "PSPHOT_LIBS: $PSPHOT_LIBS"
    88236
    89237AC_SUBST([PSPHOT_CFLAGS])
Note: See TracChangeset for help on using the changeset viewer.