Post #73,588
1/9/03 4:14:56 AM
|

Could autoconf help?
I've seen lot of programs do build-type checks in autoconf.
Wade.
Microsoft are clearly boiling the frogs.
|
Post #73,608
1/9/03 8:19:36 AM
|

We have our own build system; autoconf not a part of it
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #73,689
1/9/03 1:24:15 PM
|

Autoconf could still be useful
The way it works is that it runs a bunch of tests to figure out what the environment is. Even if you have your own system, you could download autoconf and steal the tricks they are using.
|
Post #73,691
1/9/03 1:34:45 PM
|

Autoconf does so at runtime.
ie. through uname, etc.
Which isn't particularly useful during compile time. :-)
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #73,712
1/9/03 3:42:14 PM
|

Are we talking about "configure" script?
As used by scores of Open Source apps? It works _before_ compile time.
--
We have only 2 things to worry about: That things will never get back to normal, and that they already have.
|
Post #73,714
1/9/03 3:46:40 PM
|

You misunderstand me.
The techniques that configure/autoconf use are runtime techniques, and hence useless to my goal of doing the configuration at compile time. :-) Basically, I ended up using stuff like: \n#if defined(MSC_VER)\n// windows stuff\n#elif defined(linux) || defined(__linux__)\n// linux stuff\n#elif defined(sun) || defined(__sun__)\n// solaris stuff\n#else\n#error Unknown or unsupported OS\n#endif\n
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #73,717
1/9/03 4:04:20 PM
|

One man's compile time...
...is another man's run time. How about having the make file run a configuration procedure that generates a header file with the constants in it. Something with pipes or grep or awk or.... :-)
|
Post #73,724
1/9/03 4:38:25 PM
|

I already do that; I don't want to. :-)
Or at least, something similar. I want the entire detection to happen in the source code, not as the result of something that runs before the compile.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #73,728
1/9/03 4:46:21 PM
|

So what you're really wanting is...
...to know if the compiler itself is autodetecting the environment and whether that detection is available in the conditional compilation?
|
Post #73,735
1/9/03 5:01:51 PM
|

s/wanting/using
Here's what I came up with, which seems to work fine:
[link|http://z.iwethey.org/forums/render/content/show?contentid=73714|http://z.iwethey.org...w?contentid=73714]
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|