You must supply some compile and link options via environment variables.
‘srcdir’
In case the option definition file lives in a different directory.
‘CFLAGS’
Any special flags required to compile. The flags from
autoopts-config cflags will be included automatically. Since
the creation of the option parsing code includes creating a program
that prints out help text, if it is necessary to include files from
various directories to compile that program, you will need to specify
those directories with -Idirpath text in the CFLAGS.
Some experimentation may be necessary in that case.
NOTE: the -Idirpath text is only needed if your option
callback functions include code that require additional #include
directives.
‘LDFLAGS’
Any special flags required to link. The flags from
autoopts-config ldflags will be included automatically. This
is required only if additional link flags for the help text emission
program might be needed.
‘CC’
This is needed only if cc cannot be found in $PATH
(or it is not the one you want).
To use this, set the exported environment variables and specify getopt
as the default template in your option definitions file
(see Identification). You will have four new files. Assuming your
definitions were in a file named myprog-opts.def and your program name
was specified as progname, the resulting files would be created:
myprog-opts.h, myprog-opts.c, getopt-progname.h and
getopt-progname.c. You must compile and link both .c files into
your program. If there are link failures, then you are using AutoOpts
features that require the libopts library. You must remove these
features, See getopt limitations.
These generated files depend upon configure defines to work correctly.
Therefore, you must specify a config-header attribute
(see programming attributes) and ensure it has #defines for
either HAVE_STDINT_H or HAVE_INTTYPES_H; either
HAVE_SYS_LIMITS_H or HAVE_LIMITS_H; and
HAVE_SYSEXITS_H, if the sysexits.h header is available.
The required header files for these defines are, respectively,
the /usr/include files named:
stdint.h
inttypes.h
sys/limits.h
limits.h
sysexits.h
The following header files must also exist on the build platform: