acxpm.m4
上传用户:shenzhenrh
上传日期:2013-05-12
资源大小:2904k
文件大小:2k
源码类别:

信息检索与抽取

开发平台:

Unix_Linux

  1. AC_DEFUN([md_FIND_XPM],
  2. [test -z "$xpmlibdir" && xpmlibdir=$x_libraries
  3. found=no
  4. for name in $xpmlibname Xpm; do
  5.   md_FIND_LIB(xpm,$name,,1)
  6.   if test -n "$_ldflags" ; then
  7.     xpmlibname=$name
  8.     found=yes
  9.     break
  10.   fi
  11. done
  12. gnuwin32=no
  13. if test $found = yes; then
  14.   XPMLDFLAGS=$_ldflags
  15.   XPMLIB=-l$xpmlibname
  16. else
  17. AC_TRY_COMPILE([#ifdef __CYGWIN__
  18. #error
  19. #endif],[],,gnuwin32=yes)
  20.   if test $gnuwin32 = yes; then
  21.     XPMLDFLAGS=''
  22.     XPMLIB=''
  23.   else
  24.     AC_MSG_ERROR(Please use --with-xpmlibdir to specify location of XPM.)
  25.   fi
  26. fi
  27. AC_SUBST(xpmlibdir)
  28. AC_SUBST(xpmincludedir)
  29. AC_SUBST(XPMLDFLAGS)
  30. AC_SUBST(XPMLIB)
  31. test -z "$xpmincludedir" && xpmincludedir="$x_includes"
  32. if test "$xpmincludedir" = "$x_includes"; then
  33.   XPMINCLUDES=''
  34. else
  35.   XPMINCLUDES='-I${xpmincludedir}'
  36. fi
  37. AC_SUBST(XPMINCLUDES)
  38. if test "$gnuwin32" = no; then
  39. last_cppflags=$CPPFLAGS
  40. test -n "$xpmincludedir" && CPPFLAGS="-I$xpmincludedir -I$x_includes $CPPFLAGS"
  41. AC_MSG_CHECKING(for X11/xpm.h)
  42. AC_TRY_COMPILE([#include <X11/xpm.h>],[],have_x11_xpm_h=yes,have_x11_xpm_h=no)
  43. if test $have_x11_xpm_h = yes; then
  44.   AC_DEFINE(HAVE_X11_XPM_H,1,[define if xpm.h is available])
  45.   AC_MSG_RESULT(yes)
  46. else 
  47.   AC_MSG_RESULT(no)
  48.   AC_MSG_CHECKING(for xpm.h)
  49.   AC_TRY_COMPILE([#include <xpm.h>],[],have_xpm_h=yes,have_xpm_h=no)
  50.   if test $have_xpm_h = yes; then
  51.     AC_DEFINE(HAVE_XPM_H,1,[define if xpm.h is available])
  52.     AC_MSG_RESULT(yes)
  53.   else
  54.     AC_MSG_ERROR(Cannot find xpm.h)
  55.   fi
  56. fi
  57. CPPFLAGS=$last_cppflags
  58. fi
  59. ])
  60. AC_DEFUN([md_STRUCT_XPM_ALLOCPIXELS],
  61. [last_cppflags=$CPPFLAGS
  62. test -n "$xpmincludedir" && CPPFLAGS="-I$xpmincludedir -I$x_includes $CPPFLAGS"
  63. AC_MSG_CHECKING(for nalloc_pixels in XpmAttributes)
  64. AC_TRY_COMPILE([#ifdef HAVE_X11_XPM_H 
  65. #include <X11/xpm.h>
  66. #elif defined(HAVE_XPM_H)
  67. #include <xpm.h>
  68. #else
  69. #error
  70. #endif], 
  71. [XpmAttributes attr; attr.nalloc_pixels = 0;],
  72. AC_MSG_RESULT(yes)
  73. AC_DEFINE(HAVE_XPM_ALLOCPIXELS,1,[define if nalloc_pixels is available]),
  74. AC_MSG_RESULT(no))
  75. CPPFLAGS=$last_cppflags
  76. ])