On changeset f1d2bf8408 support for libtool 2.2 was broken as libtool_set_error was not defined anymore on that version. Fix this by also putting under #ifdef the calls to that function.
f1d2bf8408