tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Any interest in #pragma(lib) and CGI extensions?


From: Steven G. Messervey
Subject: Re: [Tinycc-devel] Any interest in #pragma(lib) and CGI extensions?
Date: Thu, 9 Apr 2015 23:15:55 -0400


-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Sergey Korshunoff
Sent: Thursday, April 09, 2015 11:01 PM
To: address@hidden
Subject: Re: [Tinycc-devel] Any interest in #pragma(lib) and CGI extensions?

Hi!
Can you show an exaple of the usage?
 * a compilation of the *.cgi
 * #pragma(lib)

Is #pragma(lib) supported by gcc?

_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

The example usage of .cgi:
tcc -run foo.cgi
Or, more commonly in my case, in a file with .cgi extension:
#!/usr/local/bin/tcc -run

  My primary use case for #pragma(lib) is also in CGI, or CGI-like
processing; rather than adding many libs
to the #! line, one could simply list them in the source.
(Dynamic) code generators might also benefit from this ability.

  I had originally conceived the need for pragma lib while playing around
with embedding
Interpreters into http server; rather than spawn a CGI process, I've been
experimenting with embedding
various interpreters 'inline', as it were.  The thought occurred to me to
embed tcc, but there
I was stuck: how do indicate from the source file alone what libraries I
need to link to?
With CGI, there is the #! line and the corresponding command line options.

  When embedding  tcc as a dynamic code generator, using
#pragma(lib,"foo.dll") provides a
neat solution for specifying link libraries without using other hackerey.
(I had considering scanning comments in the file before handing it off to
tcc).

  I don't think GCC has anything like it; MS C/C++ has it as #pragma
comment(lib,"foo.dll"),
and I think it can do more than just specifying libraries.

Steven G.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]