How do I manually cross-compile the Sterling supplicant from source?

Answer

It is best practice to include the source in your build system. If using Yocto, our external layer will do this for you.
Here is an example manually compiling using our SOM60 as a target in a Buildroot environment:

 

  1. Download and extract the Sterling supplicant source.
  2. Navigate to the "laird" directory.
  3. Edit the config_laird file:
  4. Find the following line, uncomment and change the path to your "openssl/include" directory:
    original line:
    #CFLAGS += -I/usr/local/openssl/include
    modified line:
    CFLAGS += -I/wb/buildroot/output/som60sd/build/host-libopenssl-1.1.1d/include
  5. Run make with the following flags
    set:
    CC="" for your cross-compile binary
    PKG_CONFIG="" for your pkg-config binary
    PKG_CONFIG_PATH="" for your pkgconfig directory
    OBJCOPY="" for your objcopy binary

 

Note the following example is a single line command:
make CC="/wb/buildroot/output/som60sd/host/bin/arm-buildroot-linux-gnueabihf-gcc" PKG_CONFIG="/wb/buildroot/output/som60sd/host/bin/pkg-config" OBJCOPY="/wb/buildroot/output/som60sd/host/arm-buildroot-linux-gnueabihf/bin/objcopy" PKG_CONFIG_PATH="/wb/buildroot/output/som60sd/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/pkgconfig"