Need help compiling gpgme fat

Stéphane Corthésy stephane at sente.ch
Sat Mar 4 19:04:08 CET 2006


Hi,

I'm trying to compile gpgme 1.1.2 on MacOSX, as a fat static library.

I could compile gpg-error 1.2 as a fat library; I had some troubles,  
but could solve them: that new version needs now libintl (version 1.0  
didn't), and the configure script doesn't say anything when it  
doesn't find it; user notices it only when compiling library. I  
needed to modify the libtool after having configured the build; on  
OSX, to compile as fat binary (ppc+i386) we need to use gcc 4's - 
isysroot option, but libtool doesn't use that root path when building  
system library search path, that's why I needed to patch it.

env CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch  
i386 -I/usr/local/include" \
     LDFLAGS="-L/usr/local/lib -lintl -framework CoreFoundation" \
     ./configure --disable-shared --disable-dependency-tracking -- 
with-libintl-prefix=/usr/local
mv libtool libtool-original
sed 's,/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../../ ,/Developer/ 
SDKs/MacOSX10.4u.sdk&,;s, /usr/lib",/Developer/SDKs/ 
MacOSX10.4u.sdk&,' < libtool-original > libtool
sudo make install

$ file /usr/local/lib/libgpg-error.a
/usr/local/lib/libgpg-error.a: Mach-O fat file with 2 architectures
/usr/local/lib/libgpg-error.a (for architecture i386):  current ar  
archive random library
/usr/local/lib/libgpg-error.a (for architecture ppc):   current ar  
archive


I applied the same patch to gpgme's libtool, but it seems it is not  
enough, as I think gpgme is not built/linked the same way as gpg-error:

env CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 - 
arch ppc -I/usr/local/include" \
     LDFLAGS="-L/usr/local/lib -lintl -framework CoreFoundation" \
     ./configure --disable-shared --disable-dependency-tracking -- 
with-gpg-error-prefix=/usr/local --with-gpg=/usr/local/bin/gpg -- 
without-pth
mv libtool libtool-original
sed 's,/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../../ ,/Developer/ 
SDKs/MacOSX10.4u.sdk&,;s, /usr/lib",/Developer/SDKs/ 
MacOSX10.4u.sdk&,' < libtool-original > libtool
sudo make install
...
make  all-recursive
Making all in gpgme
make  all-am
/bin/sh ../libtool --tag=CC --mode=link gcc  -isysroot /Developer/ 
SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -I/usr/local/include -Wall - 
Wcast-align -Wshadow -Wstrict-prototypes  -L/usr/local/lib -lintl - 
framework CoreFoundation -o libgpgme.la -rpath /usr/local/lib     - 
version-info 17:1:6 ath.lo  libgpgme-real.la   memrchr.lo -L/usr/ 
local/lib -lgpg-error
rm -fr  .libs/libgpgme.lax
rm -fr .libs/libgpgme.lax
mkdir .libs/libgpgme.lax
rm -fr .libs/libgpgme.lax/libgpgme-real.a
mkdir .libs/libgpgme.lax/libgpgme-real.a
(cd .libs/libgpgme.lax/libgpgme-real.a && ar x /tmp/gpgme-1.1.2/ 
gpgme/./.libs/libgpgme-real.a)
ar: /tmp/gpgme-1.1.2/gpgme/./.libs/libgpgme-real.a is a fat file (use  
libtool(1) or lipo(1) and ar(1) on it)
ar: /tmp/gpgme-1.1.2/gpgme/./.libs/libgpgme-real.a: Inappropriate  
file type or format
make[3]: *** [libgpgme.la] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Can anyone help me? Why is ar used here (it is not, when building  
libgpg-error, else it would have failed the same way)? Couldn't  
libgpgme be built the same way as libgpg-error? If so, what do I need  
to modify?
BTW, I tried to use libgpg-error's libtool instead of libgpgme's, as  
it is more recent, but it makes no difference.


Cheers,

Stéphane





More information about the Gnupg-devel mailing list