instead of ".dll.a". The way I did this is NOT good because
it affects libltdl/libtool too, but I only wanted to affect config.h.
But I haven't found any other way...
to do if they cannot be found.
- in try_dlopen, after find_handle() is called and returns 0 over
and over, it was ignoring the return value of tryall_dlopen. As
a result, sometimes the dlopen would fail and return 1 or more
errors but nobody would notice. The handle would be returned as
if the open had succeed, then any use of the handle would segfault
because handle->loader was NULL. I have solved this problem by
capturing the return value in errors, and then checking if errors>0
in the next if statement.
- fix faulty boolean logic in lt_dlopenext that caused it to only
search for libraries ending with .la. Now it says: if try_dlopen
created a nonzero handle, return it. Otherwise, if there were
any errors OTHER THAN file-not-found, return the NULL handle. If
the only errors were file-not-found, continue to search.
- just before loading the module in tryall_dlopen, do one final
call to access() to check for existence of the file. Without
this check, you sometimes get the "can't load module" error
when in fact the problem is "file not found".