Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#970 closed patch (invalid)

MythPlugins configure script on OSX fails with fink and --enable-new-exif option.

Reported by: dsnider@… Owned by: Nigel
Priority: major Milestone: unknown
Component: mythgallery Version: head
Severity: high Keywords:
Cc: Ticket locked: no

Description (last modified by Nigel)

The OSX packager script broke after I installed fink on my mac mini. Basically, it fails when compiling mythgallery with the new exif flag. I finally tracked the problem down to the mythplugins configure script, in this section of code:

        if test x`which pkg-config 2>/dev/null` != x"" ; then
            if `pkg-config --atleast-version 0.6.9 libexif` ; then
                echo "#define NEW_LIB_EXIF 1" >> \
                    ./mythgallery/mythgallery/config.h
            fi
        else
            if test x"$newexif" = x"yes" ; then
                echo "#define NEW_LIB_EXIF 1" >> \
                    ./mythgallery/mythgallery/config.h
            else
                echo
                echo "Could not determine libexif version, if it is greater"
                echo "than or equal to 0.6.9 you need to add"
                echo "--enable-new-exif to the configure flags"
                echo
            fi
        fi

Before I installed fink, I did not have pkg-config, so it would go to the else statement and and put the proper line in my config.h. If I now manually run the 'pkg-config --atleast-version 0.6.9 libexif', I get a 1 for the return code, so the NEW_LIB_EXIF doesn't get set. Fink installed pkg-config, however fink has an older version of libexif. Since the osx-packager script downloads the correct version, I do have the "New" libraries available for install.

The configure script should be rewritten as:

         if test x"$newexif" = x"yes" ; then
              echo "#define NEW_LIB_EXIF 1" >> \
                 ./mythgallery/mythgallery/config.h
        else
            if test x`which pkg-config 2>/dev/null` != x"" ; then
                if `pkg-config --atleast-version 0.6.9 libexif` ; then
                    echo "#define NEW_LIB_EXIF 1" >> \
                       ./mythgallery/mythgallery/config.h
            fi
            else
                echo
                echo "Could not determine libexif version, if it is greater"
                echo "than or equal to 0.6.9 you need to add"
                echo "--enable-new-exif to the configure flags"
                echo
            fi
        fi

This way, I can force the NEW_LIB_EXIF with the --enable-new-exif flag. If I don't set that flag, the script will still correctly find it with the pkg-config line. The reason I think this is a bug is that with the current logic in the configure script, even if you add the flag --enable-new-exif, the configure script will disable that flag with the pkg-config if statement. If I manually specify --enable-new-exif, I would expect the configure script to honor that setting, if it fails because I don't really have it, that's my own fault. But it shouldn't unset the flag because one utility can't find the proper library.

Just as an FYI, here is the error I was getting:

distcc g++ -c -pipe -faltivec -Wall -W -O3 -Wall -Wno-switch -I/nobackup/myth/.osx-packager/build/include -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare -fno-inline-functions -DPIC -fPIC -D_GNU_SOURCE -DPREFIX=\"/nobackup/myth/.osx-packager/build\" -DUSING_DBOX2 -DHAVE_DVDNAV -D_FILE_OFFSET_BITS=64 -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_PLUGIN -DQT_SHARED -DQT_ACCESSIBILITY_SUPPORT -I/nobackup/myth/.osx-packager/src/qt-mac-free-3.3.4/mkspecs/default -I. -I../../../../../build/include -I../../../../../build/include -I/usr/kde/3.3/include -I../../../../../build/include -I/nobackup/myth/.osx-packager/src/qt-mac-free-3.3.4/include -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Versions/A/Headers -o galleryutil.o galleryutil.cpp /nobackup/myth/.osx-packager/build/include/libexif/exif-entry.h: In static member function `static long int GalleryUtil::getNaturalRotation(const char*)': /nobackup/myth/.osx-packager/build/include/libexif/exif-entry.h:61: error: too few arguments to function `const char* exif_entry_get_value(ExifEntry?*, char*, unsigned int)' galleryutil.cpp:67: error: at this point in file make[2]: * [galleryutil.o] Error 1 make[1]: * [sub-mythgallery] Error 2 make: * [sub-mythgallery] Error 2 [osx-pkg] Failed system call: " /usr/bin/make " with error code 2 Died at /usr/local/bin/osx-packager.pl line 722.

Attachments (1)

configure.diff (1.7 KB) - added by dsnider@… 14 years ago.
unified diff with patch for configure script.

Download all attachments as: .zip

Change History (7)

Changed 14 years ago by dsnider@…

Attachment: configure.diff added

unified diff with patch for configure script.

comment:1 Changed 14 years ago by Nigel

Owner: changed from Isaac Richards to Nigel
Status: newassigned

comment:2 Changed 14 years ago by Nigel

Description: modified (diff)

Not as simple as I thought:
1) I think the real problem here is that fink's pkg-config is lying.
2) Making the suggested change, which basically inverts the default vs autodetect logic, would basically make the default of newexif="yes" always manifest in the config file. Not what we want

I will try and install Fink on a spare Mac tomorrow and investigate further

comment:3 Changed 14 years ago by David Snider <dsnider@…>

You're right, I missed that the default to yes comes from line 34 which says

newexif="yes"

So, the IF statement does always default to yes. However if we changed line 34 to

newexif="no"

Then I think all will work well, the default will not have newexif=yes, unless,

  1. --enable-new-exif is specified on the command line

or

  1. pkg-config detects it...

comment:4 Changed 14 years ago by Nigel

Resolution: invalid
Status: assignedclosed

Installed Fink on a 10.3 Mac. No pkg-config there. Did apt-get install libexif (which installed 0.5.12-2), then apt-get install pkgconfig:[code]$ pkg-config --modversion libexif Package libexif was not found in the pkg-config search path. Perhaps you should add the directory containing `libexif.pc' to the PKG_CONFIG_PATH environment variable No package 'libexif' found $ pkg-config --list-all fontconfig Fontconfig - Font configuration and customization library xcursor Xcursor - X Cursor library xft Xft - X FreeType? librarycode Looked for the .pc file it mentions. Not anywhere under /sw. In my opinion, either the libexif or pkgconfig packages are broken. I don't think configure should be modified to work around the broken Fink stuff.
Dave, I would suggest apt-get remove pkgconfig

comment:5 Changed 14 years ago by dsnider@…

Did that, with the recursive options and it removed QT3 as well. Then builds failed due to invalid QT environment variables. Removed qt3-* packages from fink with the recursive option and it removed mplayer as well. Compiling now...

I respect your decision, but I still think that the command line options should trump everything. If I specify --enable-new-exif, IMO nothing should remove it.

comment:6 Changed 14 years ago by Nigel

It would be logical for command-line overrides to trump, but the concensus among the devs was that the configure scripts should always autodetect everything because that is more likely to result in a good compile for inexperienced code jockeys (assuming that autodetection is possible).
To properly allow command-line overrides, we would need 4 states for each variable! (default no, default autodetect, user override yes, user override no)
But, for now, setting PKG_CONFIG_PATH to "$PREFIX/lib/pkgconfig" in the packager script should prevent this pkg-config problem once and for all?

Note: See TracTickets for help on using tickets.