diff options
author | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2005-08-15 19:53:37 +0000 |
---|---|---|
committer | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2005-08-15 19:53:37 +0000 |
commit | 7c9a7b7fb4955cef87cd4403c0f36b5f1a84d9c9 (patch) | |
tree | 35bbd79317e28d330bb1200cb3ae6dc40be88b86 | |
parent | 9161e0233a932f88a79d228f538565c48dba58d4 (diff) |
Move RAWCPP macro to xorg-macros.m4 so other modules can use it Add check
for whether or not RAWCPP needs -traditional instead of hardcoding it,
so non-gcc cpp's can be used
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | xorg-macros.m4 | 51 |
2 files changed, 52 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index be3db32..87463d9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,6 +20,6 @@ # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. aclocaldir = $(datadir)/aclocal -aclocal_DATA = xorgversion.m4 +aclocal_DATA = xorgversion.m4 xorg-macros.m4 EXTRA_DIST = $(aclocal_DATA) diff --git a/xorg-macros.m4 b/xorg-macros.m4 new file mode 100644 index 0000000..ae122cc --- /dev/null +++ b/xorg-macros.m4 @@ -0,0 +1,51 @@ +dnl $XdotOrg: $ +dnl +dnl Copyright 2005 Sun Microsystems, Inc. All rights reserved. +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 + +# XORG_PROG_RAWCPP() +# ------------------ +# Find cpp program and necessary flags for use in pre-processing text files +# such as man pages and config files +AC_DEFUN([XORG_PROG_RAWCPP],[ +AC_REQUIRE([AC_PROG_CPP]) +AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], + [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) + +AC_MSG_CHECKING([if $RAWCPP requires -traditional]) +AC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + AC_MSG_RESULT([no]) +else + if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + RAWCPPFLAGS=-traditional + AC_SUBST(RAWCPPFLAGS) + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([${CPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) + fi +fi +rm -f conftest.$ac_ext +]) # XORG_PROG_RAWCPP |