xaw.m4 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. dnl Copyright 2005 Red Hat, Inc
  2. dnl
  3. dnl Permission to use, copy, modify, distribute, and sell this software and its
  4. dnl documentation for any purpose is hereby granted without fee, provided that
  5. dnl the above copyright notice appear in all copies and that both that
  6. dnl copyright notice and this permission notice appear in supporting
  7. dnl documentation.
  8. dnl
  9. dnl The above copyright notice and this permission notice shall be included
  10. dnl in all copies or substantial portions of the Software.
  11. dnl
  12. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  13. dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  15. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  16. dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  17. dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  18. dnl OTHER DEALINGS IN THE SOFTWARE.
  19. dnl
  20. dnl Except as contained in this notice, the name of the copyright holders shall
  21. dnl not be used in advertising or otherwise to promote the sale, use or
  22. dnl other dealings in this Software without prior written authorization
  23. dnl from the copyright holders.
  24. dnl
  25. # XAW_CHECK_XPRINT_SUPPORT()
  26. # --------------------------
  27. # Adds --enable/disable-xprint and selects the appropriate version of the Xaw
  28. # library. If neither --enable-xprint nor --disable-xprint are given,
  29. # the presence of an Xaw with Xprint support will be auto detected
  30. AC_DEFUN([XAW_CHECK_XPRINT_SUPPORT],[
  31. AC_ARG_ENABLE(xprint, AC_HELP_STRING([--enable-xprint], [Enable XPrint support]),
  32. [use_xprint=$enableval],[use_xprint=auto])
  33. if test "x$use_xprint" = "xyes"; then
  34. TMP_CHECK1=xaw8
  35. TMP_CHECK2=
  36. xaw_use_xprint=yes
  37. elif test "x$use_xprint" = "xno"; then
  38. TMP_CHECK1=xaw7
  39. TMP_CHECK2=
  40. xaw_use_xprint=no
  41. else
  42. TMP_CHECK1=xaw8
  43. TMP_CHECK2=xaw7
  44. xaw_use_xprint=yes
  45. fi
  46. PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK1, success=yes, success=no)
  47. if [[ ! -z $TMP_CHECK2 ]] ; then
  48. if test $success = no ; then
  49. PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK2, success=yes, success=no)
  50. xaw_use_xprint=no
  51. fi
  52. fi
  53. if test "x$success" = "xyes"; then
  54. $1_CFLAGS=$TMP_XAW_CFLAGS
  55. $1_LIBS=$TMP_XAW_LIBS
  56. AM_CONDITIONAL([XAW_USE_XPRINT], [test "x$xaw_use_xprint" = "xyes"])
  57. else
  58. AC_MSG_ERROR([No suitable version of Xaw found])
  59. fi
  60. ])