diff options
author | Søren Sandmann Pedersen <sandmann@daimi.au.dk> | 2005-06-24 22:54:24 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@daimi.au.dk> | 2005-06-24 22:54:24 +0000 |
commit | f6c298f70e13ecf37b4824f6ac01007b876dd3cb (patch) | |
tree | 387ae8b596e0eabb455183fee858452a8001ef33 | |
parent | e3e78cd7815716d8af729c19833bec51d7e3f19c (diff) | |
download | xorg-lib-libXaw-f6c298f70e13ecf37b4824f6ac01007b876dd3cb.tar.gz |
Add m4 macro to check for versions of the Xaw library
-rw-r--r-- | Makefile.am | 5 | ||||
-rw-r--r-- | xaw.m4 | 56 |
2 files changed, 60 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 266c766..7b741b4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,8 @@ SUBDIRS = include Xaw6 Xaw7 Xaw8 man +aclocaldir = $(datadir)/aclocal +aclocal_DATA = xaw.m4 + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = @@ -24,7 +27,7 @@ DEFAULT_LIB = libXaw8.so endif -EXTRA_DIST = xaw6.pc.in xaw7.pc.in xaw8.pc.in autogen.sh +EXTRA_DIST = xaw6.pc.in xaw7.pc.in xaw8.pc.in autogen.sh xaw.m4 install-exec-hook: cd $(libdir) && rm -f libXaw.so && ln -s $(DEFAULT_LIB) libXaw.so @@ -0,0 +1,56 @@ +dnl Copyright 2005 Red Hat, Inc +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation. +dnl +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +dnl OTHER DEALINGS IN THE SOFTWARE. +dnl +dnl Except as contained in this notice, the name of the copyright holders shall +dnl not be used in advertising or otherwise to promote the sale, use or +dnl other dealings in this Software without prior written authorization +dnl from the copyright holders. +dnl + +# XAW_CHECK_XPRINT_SUPPORT() +# -------------------------- +# Adds --enable/disable-xprint and selects the appropriate version of the Xaw +# library. If neither --enable-xprint nor --disable-xprint are given, +# the presence of an Xaw with Xprint support will be auto detected + +AC_DEFUN([XAW_CHECK_XPRINT_SUPPORT],[ + AC_ARG_ENABLE(xprint, AC_HELP_STRING([--disable-xprint], [Disable XPrint support]), + [use_xprint=$enableval],[use_xprint=auto]) + if test "x$use_xprint" = "xyes"; then + # definitely use xprint + TMP_CHECK1=xaw8 + TMP_CHECK2= + elif test "x$use_xprint" = "xno"; then + TMP_CHECK1=xaw7 + TMP_CHECK2= + else + TMP_CHECK1=xaw8 + TMP_CHECK2=xaw7 + fi + + PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK1, success=yes, success=no) + if [[ ! -z $TMP_CHECK2 ]] ; then + if [[ $success=no ]] ; then + PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK2, success=yes, success=no) + fi + fi + + $1_CFLAGS=$TMP_XAW_CFLAGS + $1_LIBS=$TMP_XAW_LIBS +]) |