IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7426


Ignore:
Timestamp:
Jun 8, 2006, 4:00:31 AM (20 years ago)
Author:
rhl
Message:

Updated --with-jpeg from [fixed] psphot code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/configure.ac

    r7338 r7426  
    3131)
    3232
    33 dnl ------------------------------------------------------------
    34 dnl Find libjpeg. The library may not be in a well-known place,
    35 dnl and AC_CHECK_LIB has no way of adding a library to the
    36 dnl search path for the duration of the test
    37 dnl
     33dnl ------------------ libjpeg options ---------------------
    3834
    39 AC_ARG_WITH(libjpeg,
    40             [AS_HELP_STRING(--with-libjpeg=DIR, Specify location of libjpg library)],
    41             [JPEG_LIB="-L$withval"])
    42 SAVE_LIBS="${LIBS}"
    43 LIBS="${LIBS=} $JPEG_LIB"
     35AC_ARG_WITH(jpeg,
     36[AS_HELP_STRING(--with-jpeg=DIR,Specify location of libjpeg.)],
     37[JPEG_CFLAGS="-I$withval/include"
     38 JPEG_LDFLAGS="-L$withval/lib"])
     39AC_ARG_WITH(jpeg-include,
     40[AS_HELP_STRING(--with-jpeg-include=DIR,Specify libjpeg include directory.)],
     41[JPEG_CFLAGS="-I$withval"])
     42AC_ARG_WITH(fftw3-lib,
     43[AS_HELP_STRING(--with-jpeg-lib=DIR,Specify libjpeg library directory.)],
     44[JPEG_LDFLAGS="-L$withval"])
    4445
    45 AC_CHECK_LIB(jpeg,jpeg_CreateCompress,
    46         [LIBS="${SAVE_LIBS} $JPEG_LIB -ljpeg"],
    47         [LIBS="${SAVE_LIBS}"
    48          AC_MSG_ERROR([jpeg library not found.])])
     46dnl Store off CFLAGS/LDFLAGS so that they can be restored after tests
     47TMP_CFLAGS=${CFLAGS}
     48TMP_LDFLAGS=${LDFLAGS}
     49
     50CFLAGS="${TMP_CFLAGS} ${JPEG_CFLAGS}"
     51LDFLAGS="${TMP_LDFLAGS} ${JPEG_LDFLAGS}"
     52
     53AC_CHECK_HEADERS([jpeglib.h],[TMP_CFLAGS="$CFLAGS" # keep the change],
     54  [AC_MSG_ERROR([libjpeg headers not found.  Obtain libjpeg from http://www.ijg.org/ or use --with-jpeg to specify location.])]
     55)
     56
     57AC_CHECK_LIB(jpeg,jpeg_CreateCompress,[TMP_LDFLAGS="$LDFLAGS" # keep the change],
     58  [AC_MSG_ERROR([libjpeg library not found.  Obtain libjpeg from http://www.ijg.org/ or use --with-jpeg to specify location.])]
     59)
     60
     61dnl restore the CFLAGS/LDFLAGS in case we decide to make missing libjpeg only a warning
     62CFLAGS=${TMP_CFLAGS}
     63LDFLAGS=${TMP_LDFLAGS}
    4964
    5065dnl ------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.