[M3devel] quake c_source, gcc -I directive

Jay K jay.krell at cornell.edu
Mon Mar 26 04:40:15 CEST 2012


We should support something like
CFLAGS = CFLAGS & " -I/whatever" 
but we don't currently. ? 
SYSTEM_CC = SYSTEM_CC & " -I/whatever"almost works, but I don't believe generally does.
 - in the past, because SYSTEM_CC was readonly
 - currently because SYSTEM_CC is in some systems dynamically determined if/when any C code needs
   to be via configure_c_compiler (see cm3cfg.common) 
I don't know if Quake works this, way, but it'd be nice to be able to this: 
if defined(configure_c_compiler)
  previous_configure_c_compiler = configure_c_compiler
else
  proc previous_configure_c_compiler() is end
endproc configure_c_compiler() is
  previous_configure_c_compiler()
  SYSTEM_CC = SYSTEM_CC & " -I/whatever
end 
more generally though, this should be somehow abstracted per-platform like SYSTEM_LIBS? 
Granted, it is kind of the same for all C compilers, the -I switch.
The idea of a mult-dimensional abstraction per-library/include per-target per-host per-compiler (cc vs. gcc)
is kind of annoying, esp. given that -I is pretty universial. 
I feel like I'm missing something though.
We did have something like "CFLAGS".
But I don't see it currently..I'm not looking in a smart way..maybe more later....maybe... 
  - Jay



 > From: dragisha at m3w.org
> Date: Sun, 25 Mar 2012 21:33:18 +0200
> To: antony.hosking at gmail.com
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] quake c_source, gcc -I directive
> 
> I tried obvious thing :)
> 
> "/Users/dragisha/m3/libevent/src/m3makefile", line 9: quake runtime error: wrong number of parameters passed to procedure c_source (expected 1, received 2)
> 
> 
> On Mar 25, 2012, at 3:49 PM, Antony Hosking wrote:
> 
> > I am sure there is a way to do what you want with a simple one-liner in the m3makefile.
> > Anyone remember?
> > 
> > On Mar 25, 2012, at 3:46 AM, Dragiša Durić wrote:
> > 
> >> Read through Darwin.common,Unix.common. No mention.
> >> 
> >> SYSTEM_LIBS is for -L
> >> 
> >> dd
> >> 
> >> On Mar 25, 2012, at 3:39 AM, Antony Hosking wrote:
> >> 
> >>> Can you not augment the standard system .h include paths as per the m3.cfg?
> >>> 
> >>> On Mar 24, 2012, at 7:41 PM, Dragiša Durić wrote:
> >>> 
> >>>> c_source("file") will compile file.c in same directory as m3makefile with that line is. And put object in ../$TARGET/file.o
> >>>> 
> >>>> My question is, can I dd -I/sw/include so if my source has
> >>>> 
> >>>> #include <event2/event.h>
> >>>> 
> >>>> It will be found in /sw/include/event2/event.h
> >>>> 
> >>>> Of course, /usr/include, for system .h's, should work at same time.
> >>>> 
> >>>> dd
> >>>> 
> >>>> 
> >>>> On Mar 25, 2012, at 12:37 AM, Daniel Alejandro Benavides D. wrote:
> >>>> 
> >>>>> Hi all:
> >>>>> I thought the c_source file had to be named in the same way your modula-3 sources (src), but for any other purposes like finding utilities inside your src tree src/D
> >>>>> But if that's not the implementation you need but to link against I had to actually call the var outside the Modula-3 environment to override it in Modula-3 system linker.
> >>>>> 
> >>>>> 
> >>>>> Thanks in advance
> >>>>> 
> >>>>> --- El sáb, 24/3/12, Dragiša Durić <dragisha at m3w.org> escribió:
> >>>>> 
> >>>>>> De: Dragiša Durić <dragisha at m3w.org>
> >>>>>> Asunto: [M3devel] quake c_source, gcc -I directive
> >>>>>> Para: "m3devel" <m3devel at elegosoft.com>
> >>>>>> Fecha: sábado, 24 de marzo, 2012 17:12
> >>>>>> Anybody worked out an easy method
> >>>>>> resembling import_lib() to inform C compiler where to find
> >>>>>> include files in case it is not /usr/include? Like when I am
> >>>>>> using fink on a Mac, for example.
> >>>>>> 
> >>>>>> TIA,
> >>>>>> dd
> >>>>>> 
> >>>>>> 
> >>>> 
> >>> 
> >> 
> > 
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20120326/c6284489/attachment-0002.html>


More information about the M3devel mailing list