Only link with libdl on gnu/linux
|Status:||Closed||Start date:||13 Jun 2016|
|Assignee:||Robin Mills||% Done:|
|Category:||build||Estimated time:||3.00 hours|
At the end of the configure script, the LDFLAGS will be appended with -ldl on the condition "host_os != windows". This should be done only for gnu/linux (*BSD, (Mac)OSX, &co put the dlopen() family in libc, as defined in posix... while android provides a fake libdl).
Here's a patch that naively complete the case block. If one was overly prudent, maybe a libdl presence should be checked...
Thanks for your work,
#1 Updated by Robin Mills 11 months ago
- Status changed from New to Assigned
- Target version set to 0.26
- % Done changed from 0 to 50
- Estimated time set to 2.00
I've submitted your patch: r4325. I've made an equivalent change in src/CMakeLists.txt. The buildserver has built/tested Mac/Linux/MinGW/Cygwin using ./configure http://exiv2.dyndns.org:8080/job/Exiv2-trunk/2477/ Looks good. Thanks. Your patch is accepted for v0.26.
Overnight the buildserver will build/test using CMake. If the CMake build fails, I will revert my changes to src/CMakeLists.txt. I'm working to get finished on v0.26 in June and don't want to be side tracked by this. Linking dl has been in CMakeLists.txt for years without complaint or incident.
I am interested in your comments about Android which is one of the Features to be added for v0.27. http://dev.exiv2.org/news/3
Thanks for saying "Thanks". Encouragement is very much appreciated. Thank You.
#2 Updated by Matthieu Volat 10 months ago
Ho thanks, I did not even thought of updating the CMake files!!
Great news about 0.26, then I won't try to push 0.25 yet to FreeBSD ports, but maybe I'll try to push an issue for another problem I'd really like to see solved in a stable version soon.
Regarding android, you can see bionic (android libc) source:
If that helps, comments from google engineers were that bionic was now almost vanilla openbsd libc ( http://marc.info/?l=openbsd-tech&m=139906913532531&w=2 ), so for the native code, so I don't think that will be hard.
#3 Updated by Robin Mills 10 months ago
My fix to CMake isn't correct. However, I think I've remedied it this morning: r4326
Don't hit me with anything heavy for v0.26. I'm very overloaded already with a major home remodelling project which we want to finish by July 10 for a family gathering to celebrate my wife's birthday, my 65th birthday and our retirement.
I downloaded Android Studio a couple of weeks ago and haven't had time to look at it. I believe it supports native C++ apps. So, I expect Exiv2/Android shouldn't be difficult. A couple of contributors sent iOS build code in 2013. Nobody on the team could get their contributions to build, so they were rejected. I don't believe iOS supports shared libraries. I hope it supports static libraries. Anyway, this misery awaits in v0.27.
#4 Updated by Matthieu Volat 10 months ago
- File cmake_libdl.diff added
Hum, in fact, I tested the cmake patch this morning, but it still confuse unix and linux, would the attached patch be acceptable? As is, I'm not sure it would set android apart (depending on what the custom toolchain will define), but that's not really a problem since they provide this fake libdl.
#6 Updated by Robin Mills 10 months ago
- Status changed from Assigned to Closed
- % Done changed from 50 to 100
- Estimated time changed from 2.00 to 3.00
Thanks for your second patch. I'm not going to spend more time on this. I also considered using STREQUAL as an alternative to the LINUX variable (which in my opinion should be defined by CMake). As you know there's more than one way to do everything. Fix r4326 has been successfully built and passed our test suite on all supported platforms using CMake. If r4326 doesn't work correctly on Android (or any other unsupported platform), it will be dealt with in v0.27. http://exiv2.dyndns.org:8080/userContent/builds/Categorized/Date/2016-06-14/test-svn-4326-date-2016-06-14+09-03-30.txt
I've still have 76 hours of work in June for v0.26 in addition to the house project (another 8 hours/day). Retirement? I've never worked harder! http://dev.exiv2.org/news/2