Bug 138616 - cannot compile: cannot verify exiv2 version
Summary: cannot compile: cannot verify exiv2 version
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Portability-Compilation (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: VHI normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-10 11:01 UTC by Mikolaj Machowski
Modified: 2017-08-19 20:58 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.0


Attachments
patch for exiv2 (kipi-plugins) (1.29 KB, patch)
2006-12-13 15:25 UTC, Angelo Naselli
Details
Patch for exiv2 checks in digikam (3.97 KB, patch)
2006-12-14 18:40 UTC, Fabien
Details
patch for exiv2 (digikam) (3.58 KB, patch)
2006-12-14 22:40 UTC, Angelo Naselli
Details
configure.in.bot.patch (516 bytes, text/x-diff)
2006-12-18 21:58 UTC, Angelo Naselli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikolaj Machowski 2006-12-10 11:01:13 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

Configure script cannot find exiv2. I have exiv2 0.12 but pkg-config cannot verify that and refuses to compile digikam and digikamimageplugins.
Comment 1 caulier.gilles 2006-12-10 11:21:22 UTC
Fixed this morning in svn. Please checkout, cleanup, and try again.

Gilles
Comment 2 Mikolaj Machowski 2006-12-10 14:01:50 UTC
Removed and did checkout of whole extragear/graphics and still the same
error exiv2 >= 12 ... no.

:r!exiv2-config --version
0.12
:read /usr/local/lib/pkgconfig/exiv2.pc
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: exiv2
Description: Exif and IPTC metadata library and tools
Version: 0.12
URL: http://www.exiv2.org
Libs: -L${libdir} -lexiv2
Libs.private:  -lz  -lm
Cflags: -I${includedir}

m.
Comment 3 caulier.gilles 2006-12-10 14:15:22 UTC
Mikolaj,

Are you installed properlly Exiv2 library ? Here, i'm use "./configure --prefix=/usr" under Mandriva...

Angelo,

What's wrong in .configure.in about Exiv2 version check ?

Gilles
Comment 4 Mikolaj Machowski 2006-12-10 15:13:10 UTC
> Are you installed properlly Exiv2 library ? Here, i'm use "./configure
> --prefix=/usr" under Mandriva...


Yes. I installed properly and as usual programs compiled from sources
are going to /usr/local

Looks like pkg-config has problems with that. Since exiv2-config
supports libs/flags options maybe you should scratch pkg-config and use
exiv2-config instead?

m.
Comment 5 Angelo Naselli 2006-12-10 17:20:21 UTC
About comment#2 error exiv2 >= 12 ... no. (12?) strange.
Anyway it works here (mandriva 2007), did you try to download the
srpm from cooker and backporting it? as soon as possible i'll try to provide
a backport package for mandriva. 
Anyway to comment#4 I should say it's not on a conventional directory,
mandriva installs all into /usr -i strongly recomend to use srpm anyway-
so you should use PKG_CONFIG_PATH in order to provide /usr/local/lib/pkgconfig
to compile, in the same way I believe you do with LD_LIBRARY_PATH to provide /usr/local/lib first for share libraries to run your applications.

Angelo
 
Comment 6 caulier.gilles 2006-12-10 17:57:15 UTC
Mikolaj,

Also, if you can compile kipi-plugins, why you cannot do it with digiKam ?

kipi-plugins Exiv2 check from .configure.in is the same on both...

Gilles
Comment 7 Mikolaj Machowski 2006-12-10 18:49:40 UTC
> Also, if you can compile kipi-plugins, why you cannot do it with digiKam

I've had an "old" kipi-plugins. Didn't want to recompile them, just went
straight to Digikam.
Comment 8 Angelo Naselli 2006-12-10 18:55:55 UTC
did you try to use PKG_CONFIG_PATH?
Comment 9 Andreas Huggel 2006-12-11 04:20:40 UTC
To comment #4: Please use pkg-config with exiv2.pc, not exiv2-config. exiv2-config has been marked as deprecated since (I think) 0.10, I don't plan to ship it with the next version anymore. 

If there is something wrong with exiv2.pc, report it as a bug.

-ahu.
Comment 10 Thorsten Schnebeck 2006-12-11 09:15:34 UTC
(Maybe its the same "bug" that Daniel already triggered)

Do you have a second version of exiv2 installed? If yes, where are the two exiv2.pc installed?

Bye

  Thorsten
Comment 11 Angelo Naselli 2006-12-11 09:24:21 UTC
Andreas, with that I believe i won't go back on my steps, but, 
there's always a but, I found this problem using  pkg-config alone:
#exiv2-config --libs 
-L/usr/lib -lexiv2 -lz -lm
while
#pkg-config exiv2 --libs
-lexiv2

#pkg-config exiv2 --modversion
0.12

Regards,	
	Angelo
Comment 12 Andreas Huggel 2006-12-11 16:52:56 UTC
That's ok. -lz and -lm are only needed when linking statically:

ahuggel@mowgli> pkg-config --libs exiv2
-L/usr/local/lib -lexiv2

ahuggel@mowgli> pkg-config --libs --static exiv2
-L/usr/local/lib -lexiv2 -lz -lm

-ahu.
Comment 13 Angelo Naselli 2006-12-11 17:26:51 UTC
> ahuggel mowgli> pkg-config --libs exiv2
> -L/usr/local/lib -lexiv2

[anaselli@proj9 src]$ pkg-config --libs exiv2
-lexiv2

there's no -L/usr/lib but maybe that's ok because it's standard...

Angelo
Comment 14 caulier.gilles 2006-12-12 14:18:08 UTC
Angelo,

Look like Andreas recommend to use pkg-config with exiv2.pc, not exiv2-config. 
See comments #9...

It's the case actually in .configure script ?

Gilles
Comment 15 Angelo Naselli 2006-12-12 15:57:35 UTC
> It's the case actually in .configure script ?

almost, it's a hybrid yet, we use  pkg-config to get the module isntalled and 
exiv2-config to get [c|ld]flags. I'll change it asap
Comment 16 caulier.gilles 2006-12-13 07:59:29 UTC
Angelo,

I just tag this file like VHI because it must be fixed before digiKam 0.9.0-final release planed at Christmast...

Gilles
Comment 17 Angelo Naselli 2006-12-13 09:00:25 UTC
> Angelo,
> 
> I just tag this file like VHI because it must be fixed before digiKam 0.9.0-final release planed at Christmast...

Gilles, I can't see the problem, the reporter doesn't want pkg-config
while Andreas said it's a must. I cannot fix it in the way the reporter wants,
I can only use pkg-config alone instead of a mix. Tell me what to do,
but as far as i can say this bug is invalid, but if the reporter shows 
that PKG_CONFIG_PATH doesn't work.
 
Angelo

P.S. BTW I'm not a digikam developer :p
Comment 18 caulier.gilles 2006-12-13 09:16:07 UTC
> P.S. BTW I'm not a digikam developer :p 

Sure (:=))), but .configure Exiv2 detection is common on kipi-plugins and digiKam (the same in fact). If something must be fixed into digiKam, the same thing must be done in kipi-plugins.

Gilles
Comment 19 Fabien 2006-12-13 14:45:33 UTC
As exiv2-config is marked as deprecated by Andreas, I would suggest to only use pkg-config. IMHO, pkg-config is ok, if there are troubles, it could be because of some scripts using it, but not pkg-config itself...

And, this will also solve the problem I mentionned in my email here :
http://mail.kde.org/pipermail/digikam-users/2006-December/002628.html

<<
But, in any case, it's true that there's something confusing in the 
configure script :
- first, EXIV2_CFLAGS and LIB_EXIV2 are defined :

EXIV2_CFLAGS="`$EXIV2_CONFIG --cflags`"
LIB_EXIV2="`$EXIV2_CONFIG --libs`"

- then, EXIV2_CFLAGS is redefined and a new EXIV2_LIBS is defined (and 
not LIB_EXIV2) :

EXIV2_CFLAGS=`$PKG_CONFIG --cflags "exiv2 >= 0.12"`
EXIV2_LIBS=`$PKG_CONFIG --libs "exiv2 >= 0.12"`

I don't know yet which one is the right one, but I guess we shouldn't 
have both LIB_EXIV2 and EXIV2_LIBS at the same time...
>>
Comment 20 Angelo Naselli 2006-12-13 15:25:11 UTC
Created attachment 18912 [details]
patch for exiv2 (kipi-plugins)

> EXIV2_LIBS
You're right i changed EXIV2_LIBS to LIB_EXIV2 to maintain Gilles Makefile.am
but I believe this patch should be right and enough ;)

Gilles this patch is for kipi-plugins, I haven't digikam here, so I cannot
provide
one untill tonight. 
Can you test this one and see if it's ok?
Comment 21 caulier.gilles 2006-12-13 15:30:00 UTC
Fabien, 

I'm busy until tomorrow. Can you check if all is ok ?

Gilles
Comment 22 Angelo Naselli 2006-12-13 15:42:16 UTC
> I'm busy until tomorrow. Can you check if all is ok ?

Good, I'll provide a digkam pach tonight then...
Comment 23 Fabien 2006-12-13 18:20:33 UTC
I just tried and it looks good, at least on my system :)
Comment 24 Mikolaj Machowski 2006-12-13 18:42:16 UTC
> Gilles, I can't see the problem, the reporter doesn't want pkg-config
> while Andreas said it's a must. I cannot fix it in the way the reporter


Hey, hey, hey. I want it to *work*, I don't want some exact solution.
I suggested getting rid of pkg-config because I know it was causing
problems also in some other programs. If Andreas et al. can make it work
with pkg-config - fine by me :)
Comment 25 Fabien 2006-12-13 18:55:25 UTC
Mikolaj, could you check if you have another exiv2 version on your computer ?

Please also try to do :
pkg-config --debug  --exists "exiv2 >= 0.12"

Comment 26 Mikolaj Machowski 2006-12-13 19:40:19 UTC
OK, I see the problem (at least for Mandriva).

Pkg doesn't by default look for alternative locations of .pc files.

So, when I've had exiv2.pc in /usr/local/lib/pkgconfig pkg-config
couldn't find it there because it was looking only in
/usr/lib/pkgconfig.

I've had to create $PKG_CONFIG_PATH variable to include
/usr/local/lib/pkgconfig directory and now it works.

Now, from one side I understand that when someone wants to use sources
he makes it on his own risk but this situation doesn't feel good. On the
other side not everyone using bleeding edge software needs to know all
tricks of system.

Please at least add more info for configure output, something like:

exiv2 not found. Maybe pkg-config couldn't find data file. Check
location of exiv2.pc file and value of $PKG_CONFIG_PATH.

This is not complete info, but should give enough info for proper
googling - configure output isn't manual.
With such info added to configure scripts I can accept closing of this
bug (or close it myself).

m.
Comment 27 Angelo Naselli 2006-12-14 08:47:23 UTC
Alle 19:40, mercoledì 13 dicembre 2006, Mikolaj Machowski ha scritto:
[bugs.kde.org quoted mail]
No, it's general.
for mandriva 2007 you can get it (by now waiting a Gilles/Andreas answer)
here: http://www.linux.it/~anaselli/kipi-plugins/

> I've had to create $PKG_CONFIG_PATH variable to include
> /usr/local/lib/pkgconfig directory and now it works.


Well that's the way to, I don't know if it's pkg-config or configure or system
related, but in linux/unix systems, environment variables changes the behaviour,
and that's it. I believe you can find documents on it googling somewhere, I know
it's not easy for a user, but compiling sources neither... and who changes the
normal behavior of a distro should be aware of what he's doing.
I'm in a hurry by now, so i hope not to be misunderstood in what i said.
Regards,
	Angelo
Comment 28 Fabien 2006-12-14 18:40:10 UTC
Created attachment 18932 [details]
Patch for exiv2 checks in digikam

This is a patch to modify how exiv2 is checked by digikam configure.
It uses the same method as for kipi-plugins (by Angelo).
Comment 29 Fabien 2006-12-14 18:42:59 UTC
Ok, I just uploaded a patch for digikam. I tested it, recompiled everything and it looks fine.

I may solve as well the problem Mikolaj has.
Mikolaj, could you try it against latest svn version ?
Comment 30 Thorsten Schnebeck 2006-12-14 20:47:26 UTC
Am Do Dez 14 2006 schrieb Fabien:
> Ok, I just uploaded a patch for digikam. I tested it, recompiled
> everything and it looks fine.


--- digikam/configure.in.in	(revision 613686)
+++ digikam/configure.in.in	(working copy)
@@ -215,23 +215,19 @@
 [...]
-  AC_MSG_WARN([Exiv2 library not found, digiKam will not be compiled.])
-  DO_NOT_COMPILE="digikam digikamimageplugins $DO_NOT_COMPILE"
+  AC_MSG_ERROR([Exiv2 library is required by kipi-plugins.])
+  DO_NOT_COMPILE="$DO_NOT_COMPILE kipi-plugins"
 fi

^^^^
Is this correct?? IMHO Exiv2 is also required by digikam & 
digikamimageplugins.

Bye

  Thorsten
Comment 31 Mikolaj Machowski 2006-12-14 21:11:36 UTC
> Mikolaj, could you try it against latest svn version ?


OK, with two remarks. First, This text:

    Exiv2 library is required by kipi-plugins.

Should mention digikam, digikamimageplugins not kipi-plugins. Second,
I would add mention about pkg-config:

    Exiv2 library is required by digikam, digikamimageplugins. Check if
    exiv2.pc is in path of pkg-config.

m.
Comment 32 Angelo Naselli 2006-12-14 22:40:09 UTC
Created attachment 18935 [details]
patch for exiv2 (digikam)

The attached one should work.
Comment 33 Angelo Naselli 2006-12-14 22:43:32 UTC
about comment #31, can you explain better what you mean with 
"Check if exiv2.pc is in path of pkg-config"?
I mean the check should be consistent:
[anaselli@proj9 digikam]$ pkg-config sqlite3 --libs
-lsqlite3
[anaselli@proj9 digikam]$ pkg-config sqlite2 --libs
Package sqlite2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sqlite2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sqlite2' found

If xxxx.pc is not in the path the check fails.
Comment 34 Angelo Naselli 2006-12-14 22:48:41 UTC
about the patch (comment #32)
there's something i don't like though, if you're compiling under svn all graphics, missing exiv2 or sqlite3 could be ok because digikam is not
the only project under. But if you're packaging those checks should make
failing configure, a warning message and "$DO_NOT_COMPILE digikam digikamimageplugins" is not enough, I believe. You could have a pretty empty
package ;)
Gilles please take care of testing and commit it,
   Angelo
Comment 35 caulier.gilles 2006-12-15 07:33:55 UTC
>Gilles please take care of testing and commit it

sure...

I'm waiting feedback at this moment. I wil commit that later.

Gilles
Comment 36 Fabien 2006-12-15 09:52:06 UTC
About comments #30 and #31
Sorry, next time I'll do a bit more that just copy & paste :)
Comment 37 Angelo Naselli 2006-12-15 11:06:13 UTC
Fabien, never mind thanks for your help anyway
Comment 38 caulier.gilles 2006-12-15 11:11:12 UTC
(:=)))... Well let's me hear when all will ready to commit on svn...

Gilles
Comment 39 Angelo Naselli 2006-12-15 11:18:10 UTC
> (:=)))... Well let's me hear when all will ready to commit on svn...

Gilles, kipi's already released it ;)
Comment 40 Fabien 2006-12-15 16:16:16 UTC
I tried it (with checks with and without exiv2) and it works fine.
So, I think it's ready and you can commit it...
Comment 41 caulier.gilles 2006-12-15 16:32:08 UTC
SVN commit 613892 by cgilles:

digikam from trunk : patch about Exiv2 0.12 version detection from Angelo.
BUG: 138616

 M  +2 -10     configure.in.in  
 M  +1 -1      digikam/Makefile.am  
 M  +3 -3      kioslave/Makefile.am  
 M  +1 -1      showfoto/Makefile.am  


--- trunk/extragear/graphics/digikam/configure.in.in #613891:613892
@@ -215,19 +215,11 @@
 #------------------------------------------------------------------
 
 have_exiv2='no'
-AC_PATH_PROG(EXIV2_CONFIG,exiv2-config)
-if test -n "${EXIV2_CONFIG}"; then
-  EXIV2_CFLAGS="`$EXIV2_CONFIG --cflags`"
-  AC_SUBST(EXIV2_CFLAGS)
-  LIB_EXIV2="`$EXIV2_CONFIG --libs`"
-  AC_SUBST(LIB_EXIV2)
-  KDE_PKG_CHECK_MODULES(EXIV2, exiv2 >= 0.12, have_exiv2=yes,have_exiv2=no)
+if test "$PKGCONFIGFOUND" = "yes" ; then
+ KDE_PKG_CHECK_MODULES(EXIV2, exiv2 >= 0.12, have_exiv2=yes,have_exiv2=no)
 fi
 
 if test "x$have_exiv2" != "xyes"; then
-  if test -n "${EXIV2_CONFIG}"; then
-    AC_MSG_RESULT($have_exiv2)
-  fi
   AC_MSG_WARN([Exiv2 library not found, digiKam will not be compiled.])
   DO_NOT_COMPILE="digikam digikamimageplugins $DO_NOT_COMPILE"
 fi
--- trunk/extragear/graphics/digikam/digikam/Makefile.am #613891:613892
@@ -91,7 +91,7 @@
 	                    upgradedb_sqlite2tosqlite3.cpp 
 
 libdigikam_la_LIBADD = $(LIB_KIO) $(LIB_SQLITE3) $(LIB_KABC) \
-		               $(LIBKIPI_LIBS) $(LIB_KUTILS) $(LIB_EXIV2) \
+		               $(LIBKIPI_LIBS) $(LIB_KUTILS) $(EXIV2_LIBS) \
 		               $(top_builddir)/digikam/sqlite/libsqlite.la \
 		               $(top_builddir)/digikam/libs/thumbbar/libthumbbar.la \
 		               $(top_builddir)/digikam/libs/themeengine/libthemeengine.la \
--- trunk/extragear/graphics/digikam/kioslave/Makefile.am #613891:613892
@@ -21,7 +21,7 @@
 
 kio_digikamthumbnail_la_SOURCES = digikamthumbnail.cpp 
 
-kio_digikamthumbnail_la_LIBADD  = $(LIB_KIO) $(LIBJPEG) $(LIBPNG) $(LIB_EXIV2) \
+kio_digikamthumbnail_la_LIBADD  = $(LIB_KIO) $(LIBJPEG) $(LIBPNG) $(EXIV2_LIBS) \
 	                          $(top_builddir)/digikam/libs/dimg/libdimg.la 
 
 kio_digikamthumbnail_la_LDFLAGS = -module -avoid-version $(KDE_PLUGIN) $(all_libraries)	                          
@@ -30,7 +30,7 @@
 
 kio_digikampreview_la_SOURCES = digikampreview.cpp 
 
-kio_digikampreview_la_LIBADD  = $(LIB_KIO) $(LIB_EXIV2) \
+kio_digikampreview_la_LIBADD  = $(LIB_KIO) $(EXIV2_LIBS) \
 	                        $(top_builddir)/digikam/libs/dimg/libdimg.la 
 
 kio_digikampreview_la_LDFLAGS = -module -avoid-version $(KDE_PLUGIN) $(all_libraries) 
@@ -48,7 +48,7 @@
 kio_digikamalbums_la_SOURCES = digikamalbums.cpp sqlitedb.cpp
 
 kio_digikamalbums_la_LIBADD  = $(top_builddir)/digikam/libs/jpegutils/libjpegutils.la \
-	                       $(LIB_KIO) $(LIB_SQLITE3) $(LIB_EXIV2) \
+	                       $(LIB_KIO) $(LIB_SQLITE3) $(EXIV2_LIBS) \
 	                       $(top_builddir)/digikam/libs/dimg/libdimg.la 
 
 kio_digikamalbums_la_LDFLAGS = -module -avoid-version $(all_libraries) $(KDE_PLUGIN) 
--- trunk/extragear/graphics/digikam/showfoto/Makefile.am #613891:613892
@@ -32,7 +32,7 @@
 	               $(top_builddir)/digikam/utilities/splashscreen/libsplashscreen.la \
 	               $(top_builddir)/digikam/libs/threadimageio/libthreadimageio.la \
 	               $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KUTILS) \
-	               $(LIB_KFILE) $(LIB_KPARTS) $(LIBJPEG) $(LIB_EXIV2) 
+	               $(LIB_KFILE) $(LIB_KPARTS) $(LIBJPEG) $(EXIV2_LIBS) 
 
 showfoto_LDFLAGS = $(KDE_RPATH) $(all_libraries)
 
Comment 42 Matthew Arnold 2006-12-18 16:53:04 UTC
The error message should be made more clear. I had exiv2 0.11 installed and ./configure kept telling me that I did not have exiv2 installed at all. It should say "Exiv2 library => 0.12 not found".
Comment 43 Angelo Naselli 2006-12-18 21:58:30 UTC
> The error message should be made more clear. I had exiv2 0.11 installed 
> and ./configure kept telling me that I did not have exiv2 installed
> at all. It should say "Exiv2 library => 0.12 not found".  


Ok I see what you mean, not configure output but the final message,
so it should be configure.in.bot
Can you check the attached patch please?


Created an attachment (id=18971)
configure.in.bot.patch
Comment 44 Mikolaj Machowski 2006-12-18 22:37:33 UTC
Works OK for me. One thought. There is plenty of 0.12 there. Maybe some
variable for easier future upgrade?
Comment 45 Angelo Naselli 2006-12-18 22:46:16 UTC
> ------- Additional Comments From mikmach wp pl  2006-12-18 22:37 -------
> Works OK for me. One thought. There is plenty of 0.12 there. Maybe some
> variable for easier future upgrade?

Yep I thought to it too, but you saw exiv2, there are libkipi, sqlite, libpng,...
as well.

I believe the problem is due to a missing stable (and working) exiv on most
distro by now, maybe next digikam/kipi-plugins release won't be affected by this
problem...

Angelo

P.S. Gilles wake up and commit ;)
Comment 46 caulier.gilles 2006-12-19 07:41:18 UTC
Angelo, 

I have do it yesterday on both : digiKam and kipi-plugins (:=)))...

Gilles
Comment 47 Angelo Naselli 2006-12-19 09:23:59 UTC
Alle 07:41, martedì 19 dicembre 2006, Gilles Caulier ha scritto:
[bugs.kde.org quoted mail]
yep, i saw it after. I wonder why it didn't svn up it first.... bah.

Angelo
Comment 48 Matthew Arnold 2006-12-21 18:10:05 UTC
I'm not a programmer per se, so I'm not sure what to do with that attachment. My comments were directed at the patch for configure.in.in in #41. The error message is "Exiv2 library not found, digiKam will not be compiled." It would be better worded the way it is in the patch in #43. I hope I'm making sense. The long and short of it is that at the end of the ./configure output, it shouldn't say that Exiv2 is not found but rather that Exiv2 => 0.12 is not found.
Comment 49 Angelo Naselli 2006-12-21 18:13:06 UTC
so it is, in svn.

Angelo