autotools build (make config ; ./configure ; make) is broken
|Status:||Closed||Start date:||20 Sep 2012|
|Assignee:||Robin Mills||% Done:|
1) compiler error from matroskavideo.cpp can't find exv_conf.h
2) Thousands of warnings/errors about types
3) Cannot compile version.cpp (can't find EXV_PACKAGE_STRING)
./configure did not generate src/exv_conf.h. It creates a file config/config.h which is similar, but different. config/config.h contains entries such as #define PACKAGE_STRING "exiv2 0.23" and src/exv_conf.h contains entries such as #define EXV_PACKAGE_STRING "exiv2 0.23". Note: the EXV_ leading embellishment.
I've been through recent commits to the config/ directory without finding the culprit. In the meanwhile, you may have an old copy of src/exv_conf.h Or you can generate one with cmake:
$ cd exiv2
$ mkdir build ; cd build ; cmake .. <-- CMAKE will generate exv_conf.h for you
$ cp exv_conf.h ../src
$ cd exiv2
$ make config ; ./configure ; make
#1 Updated by Robin Mills about 5 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100
The file exv_conf.h is generated by a sed script applied to config/config.h. The list of files on which exv_conf.h depends hadn't been update for a while and so exv_conf.h did not exist when matroskavideo.cpp compiles. The submitted fix is to make most of the cpp files to be dependent on exv_conf.h. A better fix would be to get ./configure to creates this file.
#2 Updated by Robin Mills about 5 years ago
I decided to add the code to config/config.ac and so ./configure now generates src/exv_conf.h. SVN:2882
This avoids maintenance of the dependency line for exv_conf.h in src/Makefile which tells make to generate src/exv_conf.h before compiling version.cpp and friends. The sed script to convert config/config.h to src/exv_conf.h remains in src/Makefile. Better to have 2 people (make and ./configure) generating src/exv_conf.h. Additionally I'm not sure how CMake knows to generate this file. So, I've left the version.cpp : src/exv_conf.h dependency in src/Makefile.
#3 Updated by Andreas Huggel about 5 years ago
Robin, your analysis is spot on. I've now updated the Makefile so that all source files depend on exv_conf.h (whether or not they actually need it). That should ensure it is always there. Very simple actually, but I only saw it thanks to your comments.
I've then removed your new code from configure.ac. It's actually a neat trick to run make there, but 1) with the above it should not ever be needed anymore, 2) it's easier to debug problems with the creation of exv_conf.h if the errors are written to the screen when make is run and 3) I try to minimize the changes to configure.ac to avoid breaking things accidentally on platforms with more or less defunct shells.