delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/01/09/05:00:20

X-Spam-Check-By: sourceware.org
Date: Mon, 9 Jan 2006 10:58:00 +0100
From: Peter Ekberg <peda AT lysator DOT liu DOT se>
To: cygwin AT cygwin DOT com
Subject: cpp does not honor the -undef option.
Message-ID: <20060109095759.GB24524@sellafield.lysator.liu.se>
Mime-Version: 1.0
User-Agent: Mutt/1.5.10i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--IS0zKkzwUGydFO0o
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello!

I recently tried to build a package that was using cpp for other
purposes than preprocessing C files. Its configure script was
looking for a way to not have cpp predefine anything, and it
specifically tried the -undef option, but failed. From reading the
docs, I couldn't figure out why. Here's a quote from "info cpp":

'-undef'
     Do not predefine any system-specific or GCC-specific macros.  The
     standard predefined macros remain defined.  *Note Standard
     Predefined Macros::.

So I searched the web a bit and figured that I could probably fix
it in the specs file. I realise that the specs file probably isn't
the canonical place to change this, but I'll leave that to the gcc
maintainer.

Attached is a patch for the specs file that wraps all old define
rules for cpp inside the following:

%{!undef:old define rules}

I don't know if this is the correct thing to do, but it works for
me<TM>.

Cheers,
Peter

--IS0zKkzwUGydFO0o
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="cpp-undef.diff"

--- /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs.orig	2005-06-08 00:02:40.001000000 +0200
+++ /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs	2006-01-05 11:33:49.087107900 +0100
@@ -15,7 +15,7 @@
  as %(asm_options) %m.s %A }
 
 *cpp:
-%(cpp_cpu) %{posix:-D_POSIX_SOURCE}   %{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}}   %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{!ansi:%{mthreads:-D_MT}}}  %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ %{!ansi:-Dunix} -D__unix__ -D__unix }  %{mwin32|mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}}  %{!nostdinc:%{!mno-win32|mno-cygwin:-idirafter ../include/w32api%s -idirafter ../../include/w32api%s}}
+%(cpp_cpu) %{!undef:%{posix:-D_POSIX_SOURCE}   %{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}}   %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{!ansi:%{mthreads:-D_MT}}}  %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ %{!ansi:-Dunix} -D__unix__ -D__unix }  %{mwin32|mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}}}  %{!nostdinc:%{!mno-win32|mno-cygwin:-idirafter ../include/w32api%s -idirafter ../../include/w32api%s}}
 
 *cpp_options:
 %(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef}


--IS0zKkzwUGydFO0o
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
--IS0zKkzwUGydFO0o--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019