Changeset 1198


Ignore:
Timestamp:
Oct 12, 2006, 11:33:49 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Use pkg-config to check for Imlib2. Patch adapted from Alt Linux.
Location:
libcaca/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/configure.ac

    r1186 r1198  
    3232PKG_PROG_PKG_CONFIG()
    3333m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
    34 if test "$build" != "$host" -a "${PKG_CONFIG_LIBDIR}" = ""; then
     34if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then
    3535  export PKG_CONFIG_LIBDIR=/dev/null
    3636fi
     
    223223  AC_MSG_ERROR([no output drivers were selected!])
    224224else
     225  CACA_DRIVERS="${CACA_DRIVERS# *}"
    225226  AC_MSG_RESULT([${CACA_DRIVERS}])
    226227fi
     
    252253
    253254# Use Imlib2?
    254 ac_cv_my_have_imlib2="no"
    255 save_CPPFLAGS="${CPPFLAGS}"
    256255if test "${enable_imlib2}" != "no"; then
    257   AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no)
    258   if test "${IMLIB2_CONFIG}" != "no"; then
    259     CPPFLAGS="${CPPFLAGS} `imlib2-config --cflags` -DX_DISPLAY_MISSING=1"
    260   fi
    261   AC_CHECK_HEADERS(Imlib2.h,
    262     ac_cv_my_have_imlib2="yes",
    263    [ac_cv_my_have_imlib2="no"
    264     AC_MSG_ERROR([[cannot find Imlib2 development files. Without Imlib2, cacaview will only open BMP files; if this is really what you want, re-run configure with '--disable-imlib2'.]])])
    265   CPPFLAGS="${save_CPPFLAGS}"
    266 fi
    267 AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
     256  IMLIB2="no"
     257  PKG_CHECK_MODULES(imlib2, imlib2, [IMLIB2="yes"], [AC_MSG_RESULT(no)])
     258  if test "${IMLIB2}" = no; then
     259    AC_MSG_ERROR([[cannot find Imlib2 development files. Without Imlib2, cacaview will only open BMP files; if this is really what you want, re-run configure with '--disable-imlib2'.]])
     260  fi
     261fi
    268262
    269263# Build development tools?
  • libcaca/trunk/src/Makefile.am

    r1048 r1198  
    1717cacaview_SOURCES = cacaview.c common-image.c common-image.h
    1818cacaview_LDADD = ../caca/libcaca.la ../cucul/libcucul.la @CACA_LIBS@
    19 cacaview_CFLAGS = $(img_cflags)
    20 cacaview_LDFLAGS = $(img_ldflags)
     19cacaview_CFLAGS = @IMLIB2_CFLAGS@
     20cacaview_LDFLAGS = @IMLIB2_LIBS@
    2121
    2222cacadraw_SOURCES = cacadraw.c
     
    3131img2irc_SOURCES = img2irc.c common-image.c common-image.h
    3232img2irc_LDADD = ../cucul/libcucul.la @CACA_LIBS@
    33 img2irc_CFLAGS = $(img_cflags)
    34 img2irc_LDFLAGS = $(img_ldflags)
    35 
    36 if USE_IMLIB2
    37 img_cflags = `imlib2-config --cflags`
    38 img_ldflags = `imlib2-config --libs`
    39 else
    40 img_cflags =
    41 img_ldflags =
    42 endif
     33img2irc_CFLAGS = @IMLIB2_CFLAGS@
     34img2irc_LDFLAGS = @IMLIB2_LIBS@
    4335
    4436if USE_NETWORK
Note: See TracChangeset for help on using the changeset viewer.