Page MenuHomeFreeBSD

wpa: Restructure wpa build

Authored by cy on May 20 2021, 11:53 PM.



The current WPA build assumes a flat namespace. However the latest sources
from now have a duplicate config.c, in two separate subdirectories.
The flat namespace will overwrite config.o with the output from the most
recently modified config.c, of which there are two of them.

This commit resolves this problem by building each component in
wpa's src subdirectory tree into its own .a archive, just as the
upstream build as used by the port does. The advantages of this approach

  1. Duplicate source file names, i.e. config.c in the wpa_supplicant direcory and another config.c in src/utils in the next wpa will result in both compiles writing to the same .o file.
  1. This restructure simplifies maintanence. A develper needs only to add new files as identified by git status in the vendor branch to the appropriate Makefile within the usr.sbin/wpa tree. This also reduces time required to prepare a new import and should reduce error.
  1. The new wpa build structure more closely represents the build as performed by the upstream tarball.

This is in preparation for the next wpa update from

Test Plan

Currently running locally.

A prior tinderbox build has succeeded.

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

cy requested review of this revision.May 20 2021, 11:53 PM

I have been running with this change on my access points at home and at my local hackerspace for a while. It seems to work fine.

This revision is now accepted and ready to land.May 30 2021, 2:58 AM

It occurs to me that I've not actually tried to build with MK_OPENSSL=no. I wonder if we shouldn't simplify maintenance considerably and basically make this depend on OpenSSL?

Building WITHOUT_OPENSSL doesn't make it far enough to test wpa build, libradius needs a little love:

make[6]: stopped in /home/cy/src/src/lib/libradius
/home/cy/src/src/lib/libradius/radlib.c:190:6: error: unused variable 'alen' [-W

int alen, len;

/home/cy/src/src/lib/libradius/radlib.c:287:6: error: unused variable 'alen' [-W

int alen, len;

2 errors generated.

Probably a todo for someone (or me) when time permits.

This revision was automatically updated to reflect the committed changes.