Topic: Required Configuration Files (config.h, settings.h, options.h)

I'm building for two platforms: one is Linux, the other is bare-metal with an OEM board support package, and they both use the same processor (Arm 926 EJS). I've got the Linux version working fine and am about to move to the bare-metal version. I'm confused about the various configuration files such as config.h, settings.h, and options.h. I was particularly surprised that rerunning the configure script did not seem to modify config.h.

When I go to the non-Linux make system of the OEM BSP (that will not use the makefile generated by the configure script), which header files do I need to be concerned with to make sure all the required #define's are correct? More generally, what are the outputs of the configure script.



Re: Required Configuration Files (config.h, settings.h, options.h)

Hi Mark,

config.h is only modified by ./ which uses and various other files to generate ./configure script. You should never need to include this file... ever.

The output of the configure script is options.h only.

settings.h is for user to control which math libraries are used, whether to use fast or slow sha operations, and many other things to tweak how the crypto libraries work.
settings.h will allow you to increase or decrease performance and / or footprint size. One example would be "USE_SLOW_SHA" in settings.h will trade fast performance for small footprint (sha will take longer to run but take up less room on an embedded system).

<wolfssl_root>/wolfssl/options.h                 = configure script settings and output
<wolfssl_root>/wolfssl/wolfcrypt/settings.h  = more control over the crypto operations

Sincerest Regards,


Re: Required Configuration Files (config.h, settings.h, options.h)

Thanks for your quick reply Kaleb. The explanation of options.h and settings.h makes sense to me, but I'm even more confused now by the presence in many files like aes.c of
   #include <config.h>

What got me concerned originally was I noticed when I built the library using make, I got an mp_digit size of 4 because SIZEOF_LONG_LONG was defined as 8. Then when I moved the code to the OEM build system, I got an mp_digit size of 2 because SIZEOF_LONG_LONG was undefined. That's when I found that SIZEOF_LONG_LONG was defined in config.h, which seems like a strange place for it to be anyway. The library worked with my test code built either way, but the difference worried me. To get the OEM build to give me an mp_digit of 4, I had to define HAVE_CONFIG_H.

Thanks again for your help.