From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 31928 invoked from network); 25 Sep 1998 10:19:38 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 25 Sep 1998 10:19:38 -0000 Received: from mail.sun.ac.za (mail.sun.ac.za [146.232.128.1]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id GAA16856 for ; Fri, 25 Sep 1998 06:19:35 -0400 Received: from angst.dsp.sun.ac.za ([146.232.147.165]) by mail.sun.ac.za with esmtp (Exim 1.92 #1) for axp-list@redhat.com id 0zMUxm-0003aq-00; Fri, 25 Sep 1998 12:18:58 +0200 Received: from localhost (cpbotha@localhost) by angst.dsp.sun.ac.za (8.8.7/8.8.7) with SMTP id MAA24703 for ; Fri, 25 Sep 1998 12:18:51 +0200 X-Authentication-Warning: angst.dsp.sun.ac.za: cpbotha owned process doing -bs Date: Fri, 25 Sep 1998 12:18:51 +0200 (SAST) From: Charl Botha X-Sender: cpbotha@angst.dsp.sun.ac.za To: axp-list@redhat.com Subject: Re: imake/xmkmf on rh5.1 alpha, egcs1.1b In-Reply-To: <199809241546.JAA11620@ellpspace.math.ualberta.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 24 Sep 1998, Michal Jaegermann wrote: > Jeff Sturm wrote: > > On Thu, 24 Sep 1998, Jochen Kuepper wrote: > > > IIRC, only X11 needs /lib/cpp. > > OK, that's fine for systems with gcc, what about the others? > > There have been many packages which depend on /lib/cpp, not many are > > still around (PostgreSQL still does, IIRC). > AFAIK having /lib/cpp as a link to on of copies of a preprocessor > which I happen to have around (one with every C compiler :-) serves > the goal admirably. If this link does not exist then, for example, > you will not see your host name in xdm login window. If you have > some macros or defines in your ~/.Xdefaults they will be not > preprocessed (this seems to be buggy in places anyway and you can > force an explicit preprocessor with options to xrdb); and so on, > and so on.... > > I indeed noticed that this link vanished, for some reason or another, > on one of my Intel boxes after a Red Hat update. Maybe this was the > problem Charles orignally had with xmkmf and vnc sources? Honestly, > I used xmkmf on Alpha on multiple occasions, not only for vnc, and never > noticed troubles he described. '/lib/cpp' is not a script calling > 'gcc -E' on any of boxes I have around. > A trivial 'gcc -E $1', or even 'gcc -E $@', ***will not*** do!! > Various programs expect, for example, that '-traditional' flag > is present. With simple '#define THIS' only this does not matter. If > something plays more complicated preprocessor games and you forgot > to pass that flag, or maybe another, you will be for nasty surprises. > Calls to cpp may be hidden inside of programs and you may not even > be aware of them. 'xdm' provides an example. I ran into that whilst trying to write a script to replace /lib/cpp. Michal is right, it's not trivial. I *did* have /lib/cpp as a link to cpp itself (of egcs-1.1b). The problem is, just that cpp doesn't have many of the necessary internal defines, such as the ones used for indicating the present architecture; this is why xmkmf didn't work, there were no architecture flags. When one replaces /lib/cpp with a trivial script calling gcc -E, all the necessary flags are there, but other problems pop up. First, some applications call cpp and utilise it via standard input. Default behaviour of the true cpp when called without parameters is to accept input from stdin, whilst gcc -E bombs with an error message when no other parameters are specified. I coded up a quick script which checks for no parameters and then rather invokes "gcc -E -" which does the trick. The second problem is that some programs, e.g. xdm and WindowMaker, use /lib/cpp to parse configuration files. "gcc -E" works on files with the expected .{c,cc,C,h} (and others) extensions, but when passed a file with an unknown extension, also does not work, but rather exits with an error message. This problem will have to be looked into somewhat more... Best regards, Charl --------------------------------------------------------------------------- Charl Botha E-Mail cpbotha@sun.ac.za Image Processing and Pattern Recognition Digital Signal Processing Group Department of Electronic Engineering University of Stellenbosch South Africa