intel / ledmon

Enclosure LED Utilities
GNU General Public License v2.0
72 stars 49 forks source link

configure.ac: Require --enable-library if --enable-test #156

Closed tasleson closed 1 year ago

tasleson commented 1 year ago

If you --enable-test during configure we also need to have the library enabled, otherwise we cannot build and thus cannot run the unit test.

mtkaczyk commented 1 year ago

I see one problem:

./configure --enable-test=yes --enable-library=no
{...}
 configure parameters:    --enable-systemd=no --enable-library=yes --enable-test=yes

User request is not respected and is overwritten quietly. Personally, I don't like command line interfaces projected this way. I that case we should raise error and abort. I would say that we should make explicit dependency- f you want tests you need to --enable-library too, otherwise configure will fail.

tasleson commented 1 year ago

User request is not respected and is overwritten quietly. Personally, I don't like command line interfaces projected this way. I that case we should raise error and abort.

Updated to fail ./configure in this case

$ ./configure --enable-test
...
checking for LIBCHECK... yes
configure: error: --enable-library is required when specifying --enable-test