Cross Compiling Header Generation Rework [Patch 1/3]

From: rc LSW <rc lsw collaborate gmail com>

To: linux-audit redhat com

Subject: Cross Compiling Header Generation Rework [Patch 1/3]

Date: Fri, 23 Aug 2013 11:12:19 -0500

I am attempting to cross compile audit 2.3.2 and I ran into issues generating the header files in the lib and auparse directories. Compiling an executable and running it to build the header files does not work when they are compiled for my target. To work around this, I wrote a python script to generate the header files based on the pre-processor output from the cross compiler.

A couple of caveats are introduced by this script. Firstly, the build now required Python 2.7 (or greater but I have not tested this) and the Pyparsing library. I chose to use Python because it is fairly standard and easily accessible. Pyparsing was chosen out of necessity to parse the enum values the pre-processor dumps out. There might be a way around using this but I am not sure what could replace it.

This is the first of three patches to add the functionality. The first one adds in the python script. The second changes the Makefiles to use it and modifies the gen_tables.c file to remove extra functionality. The final patch adds checks into the configure script for Python and Pyparsing.