Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder1.news.weretis.net!news.albasani.net!.POSTED!not-for-mail From: BGB Newsgroups: comp.lang.java.programmer Subject: Re: =?UTF-8?B?QW5kcm9pZOKAlFdoeSBEYWx2aWs/?= Date: Tue, 31 May 2011 12:11:32 -0700 Organization: albasani.net Lines: 71 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net QT0XogQKe3R6NGRt+gG1vif/WzhKNkoeO9TDuXrwVU8tfE/71XEPPgvW0ejH7giIhA26tpv6lU//P/KMjgx+sQ== NNTP-Posting-Date: Tue, 31 May 2011 19:14:35 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="3CqG7kuxHnRcK4CjVxBh0YatzOnVnkRp5iRLnUIkOKJvqXBrz3VR9pBHeP886ll6Ypp7JqL54+YiGzZ2Pkj7gTZ4NaD/XbuskMh9o3EtW22NO3neek4pioSz6o8SaENY"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:JRn39+OupZlwS6b4wPFvcxAFGmg= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4809 On 5/31/2011 8:10 AM, Joshua Cranmer wrote: > On 05/30/2011 09:56 PM, Lawrence D'Oliveiro wrote: >> In message, Nasser M. Abbasi wrote: >> >>> Just understanding the makefiles, never mind the 2 million >>> lines or so source code with the #ifdefs in them, was a >>> nightmare :) >> >> Didn’t you have GNU autoconf to deal with all of that for you? > > Understanding GNU autoconf is half the battle. It's written in a macro > language no one really understands, so half the code is copy-pasted. > > Besides, all autoconf gets you is setting up the hundreds of #defines. > It does nothing else with respect to the #ifdef mess. > yeah, and it doesn't exactly tend to work well for non-Linux operating systems (such as Windows...). apparently its main point is mostly to deal with a lot of the internal inconsistency between the various Linux distros. hence, my personal preference for plain makefiles (with none of the autoconf mess). with care, one can get Windows+MSVC and Linux+GCC to work with pretty much the same core makefiles, reducing the pain of doing the whole parallel-makefile-tree thing. I guess there is also CMake and similar, but personally I have been a bit too lazy to bother with it (although not perfect, my makefiles work well enough, so it is hard to justify replacing them). personally, I have found it to be less effort to not bother excluding platform-specific source-files from the build, and instead make the files essentially no-op if not being compiled on the correct target. #include #ifdef MY_OS_OF_INTEREST ... stuff ... #endif //EOF also, having headers which examine information generally already provided by the compiler (things like the OS, CPU architecture, ... are generally already provided by various defines, although typically they are compiler-specific, so it makes sense in the headers to "normalize them"), and thus setting up lots of relevant #defines. for example: #ifdef _MSC_VER #ifdef _M_IX86 #define X86 #define LITTLEENDIAN ... #endif #ifdef _M_IX64 #define X86_64 #define LITTLEENDIAN ... #endif ... #endif #ifdef __GNUC__ #ifdef __i386__ ... #endif ... #endif ...