Root/tools/missing-macros/src/m4/xaw.m4

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

Archive Download this file



interactive