On Wednesday, March 5, 2014 7:02:42 AM UTC+9, spamwax wrote:
>
> 1- I am trying to get some environment variables into the Tupfile.lua
> file, what's the best way of doing this?
> (I tried os.getenv("HOME") but it obviously doesn't work since most
> modules are disabled)
>
>
Environment variables can't be read by Tup itself. tup.export allows you
to pass environment variables to rule commands (and monitors them for
changes). You can sometimes use this to defer environment-variable-based
logic to the command shell language processing, rather than have it
processed with the Tupfile.
> 2- I have a project that I build on the 3 major platform. I'd like to be
> able to run some sort of configure step before tup,
> in which platform dependent variables (name of compiler, location of 3rd
> party libraries...) are properly set.
> (For example, on OSX I have libboost_system-mt.a and on Linux I have
> libboost_system.a)
>
> Is this possible using the Lua API? Or I need to have a separate script
> that creates, say, Tuprules.lua before invoking 'tup'
>
> Thanks in advance,
> Hamid
>
The only real difference between the Tupfile parsers should be the syntax -
the API's are roughly equivalent. Tup doesn't have any configuration
facilities itself. I think the reasoning for that is that configuration
and building occur together frequently but are unrelated problems and Tup
is focused on the building only.
My recommendation for passing configuration to Tup is through the
tup.config file. Currently I just make a tup.config.template file and
distribute it with my project, with all the build settings, defaults, and
documentation inside. I strongly prefer this to autoconfiguration, since I
get detection errors almost every time I configure something and the
defaults are 95% of the way there for most of the platforms I work on.
I've tried making a configure shell script for a couple projects to
generate the tup.config file from the system. There was also a discussion
here for stand-alone configuration systems here:
https://groups.google.com/d/topic/tup-users/lai7GbD_GQA/discussion ... I
had a candidate too, but I've since abandoned it. My conclusion was that
adequate automated configuration is impossible since there are too many
platform variations, package variations, project-specific needs,
instability from updates, and the configuration platform itself adds
another layer of complexity and fluidity.
In short, you'll have to write a script. You might be able to somehow
harness the configuration systems for CMake or Autoconfig or pkg-config,
but if you decide to go it alone I can only offer you my prayers.
--
--
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.