Changeset 4728 for trunk/admin

Show
Ignore:
Timestamp:
10/25/06 05:19:15 (2 years ago)
Author:
erijo
Message:

Apparently gpgme-config --libs returns "-lgpgme -lgpg-error" even if libgpg-error isn't installed. Since -lgpg-error is added to LDFLAGS, all subsequent configure tests will fail with "ld: cannot find -lgpg-error". The result of all this is that configure fails with "Please install the iconv library", which is highly confusing. This commit extends the gpgme configure check to try to compile and link a small gpgme program before accepting gpgme as installed.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/admin/acinclude.m4.in

    r4526 r4728  
    253253     fi 
    254254  fi 
     255 
     256  if test $ok = yes; then 
     257    CPPFLAGS_SAVE="$CPPFLAGS" 
     258    LIBS_SAVE="$LIBS" 
     259 
     260    GPGME_CFLAGS=`$GPGME_CONFIG --cflags` 
     261    GPGME_LIBS=`$GPGME_CONFIG --libs` 
     262    CPPFLAGS="$CPPFLAGS $GPGME_CFLAGS" 
     263    LIBS="$LIBS $GPGME_LIBS" 
     264 
     265    AC_TRY_LINK([ 
     266      #include <gpgme.h> 
     267    ],[ 
     268      gpgme_data_t data; 
     269      if (gpgme_data_new(&data) == GPG_ERR_NO_ERROR) 
     270        gpgme_data_release(data); 
     271    ],[ 
     272      ok=yes 
     273    ],[ 
     274      ok=no 
     275    ]) 
     276 
     277    CPPFLAGS="$CPPFLAGS_SAVE" 
     278    LIBS="$LIBS_SAVE" 
     279  fi 
     280 
    255281  if test $ok = yes; then 
    256282    GPGME_CFLAGS=`$GPGME_CONFIG --cflags`