On Fri, Dec 16, 2011 at 6:47 PM, Marcelo Vanzin <mvan...@vmware.com> wrote:
> Hi Natanael,
>
> On 12/15/2011 05:29 AM, Natanael Copa wrote:
>> I'm looking at the issue with building on Alpine Linux (uclibc):
>> https://sourceforge.net/tracker/?func=detail&aid=3459926&group_id=204462&atid=989708
>>
>> I wonder if it wouldn't be better to use AC_CONFIG_HEADERS and from
>> configure script check for the features and then:
>
> I'm not sure how AC_CONFIG_HEADERS has anything to do with the problem you're
> describing in the bug.

I has nothing to do with it really. I was looking at the code and felt
an urgent need to clean up things since this is not first time i get a
build failure with uClibc. I tend to like fix things properly rather
than just add another quick and dirty fix.

I was actully thinking of the getloadavg since my current patch for
that no longer applied. Looking at the changelog and diffing the
source (any public git/svn/mercural?) there was added yet another
bunnch if #ifdefs....

> It seems that, in your case, you need to change this
> check in lib/stubs/Makefile.am to not ignore Linux:
>
> if !LINUX
>   libStubsCS_la_SOURCES += stub-msgfmt-fbsd.c
> endif

ah... that explains. very helpful thanks!

>> Are there any particular reasons that AC_CONFIG_HEADERS is not used?
>
> The source code in open-vm-tools is shared with lots of other VMware products.
> Our team doesn't own a lot of that code, and autoconf is not generally used to
> build our products. So the checks in the code are not generally based on
> autoconf-style variables.

I'm no big fan of autotools myself really but one of the stronger
points is that they help with portability. The code seems to have
checks for glibc, different versions of glibc, sun, uclibc, linux,
apple (darwin?) and android and have various code paths depending on
which system it is.

By using autotools "properly" you could have checked for a particular
feature by test compiling it in the configure script (thats what
autotools normally do) and then use HAVE_SOMEFEATURE rather than
keeping track of (or assume) what system that has support for that
feature or not.

In this parituclar case I'd prefer a

if !HAVE_MSGFMT
  libStubsCS_la_SOURCES += stub-msgfmt-fbsd.c
endif

than

if !LINUX || __UCLIBC__
  libStubsCS_la_SOURCES += stub-msgfmt-fbsd.c
endif

or similar.

I would like to do the same thing with the geloadavg() test, but that
would use of AC_CONFIG_HEADERS and a config.h (or autoconf.h to not
clash with your current config.h thats used for other purposes)

SO my question is basically: woudl you be interested in some help
cleaning up parts of the configure.ac and #ifdefs?

I would initally aim for getting rid of all #if defined(__UCLIBC__) to
minimize the risk that future releases does not fail to build due to
some missing #ifdef.

-- 
Natanael Copa

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
open-vm-tools-devel mailing list
open-vm-tools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-vm-tools-devel

Reply via email to