[augeas-devel] Compiling Augeas on AIX 6.1

Matthew Booth mbooth at redhat.com
Thu Mar 3 17:04:49 UTC 2011


On 02/03/11 17:51, Matthew Booth wrote:
> James,
>
> Thanks for this. Some comments inline below.
>
> Matt
>
> On 02/03/11 13:56, James Conner wrote:
>> Hi Folks,
>>
>> I'm involved in a puppet deployment project at the moment, and the fact
>> that Augeas wasn't working on AIX was starting to make my life
>> complicated.
>> Although I'm a newbie to Augeas, have little or no experience on AIX,
>> and don't really know a lot about C coding, I decided not to let my
>> ignorance stop me from having a go, and I am very pleased to say that I
>> now have a working Augeas 0.8.0 setup on AIX6.1
>>
>> I have to patch quite a few different things to get everything working
>> correctly, so here are the patches I've created so far.
>> I'll apologise in advance as I'm sure my patches will be the wrong way
>> of doing things, but hopefully someone who knows how to write code will
>> be able to work out a better way.
>> It is also possible that my fix is in violation of the gnulib license -
>> I just wanted to get things compiling for now.
>>
>> Once all these patches are applied, Augeas will compile successfully,
>> and 'make check' will pass most of the test.
>> There are still problems with four of the lenses - sudoers, nrpe,
>> sysconfig and grub - I just deleted them from
>> /usr/local/share/augeas/lenses and now augeas seems happy.
>> I haven't tested Augeas very thoroughly, but I can confirm that it has
>> at least enough functionality to get/change/save settings in sshd_config
>>
>>
>> Fix no. 1:
>> There is no getopt_long in AIX's libc and including getopt.h causes
>> compilation to fail.
>> I fixed this by downloading a copies of getopt_long.c and getopt_long.h
>> with google, and including them instead.
>> I had to slightly tweak getopt_long.h to get rid of the dependency on
>> gettext - I've included the full sources for getopt_long.c/h as
>> attachments (which hopefully work on this mailing list)
>
> Sounds like a job for a gnulib module! The getopt-gnu module explicitly
> mentions AIX support, so I suspect this is the right solution.
>
> Unfortunately, it seems that the license of gnulib's getopt-gnu module
> is a bit quirky, and gnulib-tool currently barfs when trying to install
> it. I'm pretty sure that it should actually be ok, though, so I've fired
> off a bug report to bug-gnulib about it.

Update: this is now fixed upstream in gnulib. However, the gnulib update 
breaks augeas's bootstrap. I'm currently brewing a patch to update 
gnulib and fix bootstrap.

>> Fix no. 2:
>> 'make' check was failing on test-readlink - Apparently this is because
>> AIX will return EINVAL instead of ENOTDIR
>>
>> diff -ru augeas-0.8.0-orig/gnulib/tests/test-readlink.h
>> augeas-0.8.0-aix6/gnulib/tests/test-readlink.h
>> --- augeas-0.8.0-orig/gnulib/tests/test-readlink.h 2011-01-08
>> 00:45:45.000000000 +0000
>> +++ augeas-0.8.0-aix6/gnulib/tests/test-readlink.h 2011-02-25
>> 23:15:00.000000000 +0000
>> @@ -51,7 +51,7 @@
>> ASSERT (errno == EINVAL);
>> errno = 0;
>> ASSERT (func (BASE "file/", buf, sizeof buf) == -1);
>> - ASSERT (errno == ENOTDIR);
>> + ASSERT (errno == ENOTDIR || errno == EINVAL);
>>
>> /* Now test actual symlinks. */
>> if (symlink (BASE "dir", BASE "link"))
>> @@ -74,7 +74,7 @@
>> ASSERT (symlink (BASE "file", BASE "link2") == 0);
>> errno = 0;
>> ASSERT (func (BASE "link2/", buf, sizeof buf) == -1);
>> - ASSERT (errno == ENOTDIR);
>> + ASSERT (errno == ENOTDIR || errno == EINVAL);
>> ASSERT (unlink (BASE "file") == 0);
>> ASSERT (unlink (BASE "link2") == 0);
>> {
>
> These are patches in gnulib, not augeas. Eric, I noticed your name at
> the top of this module. Any comments?

Turns out these are already fixed in the latest upstream gnulib. They 
should fall out with the gnulib update patch.

>> Fix no.3:
>> The test for fatest was failing to compile, complaining about spurious $
>> characters in the struct names
>> I just removed the $ symbols, which appears to have made things compile
>> and work OK
>>
>> diff -ru augeas-0.8.0-orig/tests/fatest.c
>> augeas-0.8.0-aix6/tests/fatest.c
>> --- augeas-0.8.0-orig/tests/fatest.c 2011-02-24 01:07:26.000000000 +0000
>> +++ augeas-0.8.0-aix6/tests/fatest.c 2011-03-02 13:08:57.207708117 +0000
>> @@ -255,12 +255,12 @@
>> struct fa *ss = make_good_fa(tc, "(X(.|\n))*YX");
>>
>> struct fa *a1f_mp = mark(fa_concat(a1f, mp));
>> - struct fa *a1f_mp$a1t = mark(fa_intersect(a1f_mp, a1t));
>> - struct fa *b1 = mark(fa_concat(a1f_mp$a1t, ms));
>> + struct fa *a1f_mpa1t = mark(fa_intersect(a1f_mp, a1t));
>> + struct fa *b1 = mark(fa_concat(a1f_mpa1t, ms));
>>
>> struct fa *sp_a2f = mark(fa_concat(sp, a2f));
>> - struct fa *sp_a2f$a2t = mark(fa_intersect(sp_a2f, a2t));
>> - struct fa *b2 = mark(fa_concat(ss, sp_a2f$a2t));
>> + struct fa *sp_a2fa2t = mark(fa_intersect(sp_a2f, a2t));
>> + struct fa *b2 = mark(fa_concat(ss, sp_a2fa2t));
>>
>> struct fa *amb = mark(fa_intersect(b1, b2));
>> struct fa *exp = make_good_fa(tc, "XaYXXbYXXa");
>
> I'll let David comment on this.

David already fixed this one.

Hopefully this should build for you soon :)

Matt
-- 
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team

GPG ID:  D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490




More information about the augeas-devel mailing list