build with ibm's xlc throws an error and stops.
/usr/bin/ksh ../libtool --tag=CC --mode=compile xlc_r -D_LARGE_FILES -DHAVE_CONFIG_H -I. -I.. -I/opt/freeware/include -qmaxmem=16384 -qlanglvl=extc99 -qbitfields=unsigned -qhalt=s -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include -c -o libgcrypt_la-visibility.lo `test -f 'visibility.c' || echo './'`visibility.c
libtool: compile: xlc_r -D_LARGE_FILES -DHAVE_CONFIG_H -I. -I.. -I/opt/freeware/include -qmaxmem=16384 -qlanglvl=extc99 -qbitfields=unsigned -qhalt=s -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include -c visibility.c -Wp,-qmakedep=gcc,-MF.deps/libgcrypt_la-visibility.TPlo -DPIC -o .libs/libgcrypt_la-visibility.o
"visibility.c", line 61.1: 1506-343 (S) Redeclaration of gcry_error_from_errno differs from previous declaration on line 192 of "gcrypt.h".
"visibility.c", line 61.1: 1506-050 (I) Return type "unsigned int" in redeclaration is not compatible with the previous return type "enum {...}".
"visibility.c", line 1178.1: 1506-343 (S) Redeclaration of gcry_md_extract differs from previous declaration on line 1293 of "gcrypt.h".
"visibility.c", line 1178.1: 1506-050 (I) Return type "enum {...}" in redeclaration is not compatible with the previous return type "unsigned int".
Makefile:798: recipe for target 'libgcrypt_la-visibility.lo' failed
gmake[2]: *** [libgcrypt_la-visibility.lo] Error 1
gmake[2]: Leaving directory '/opt/freeware/src/packages/BUILD/libgcrypt-1.7.8/src'
Makefile:477: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/opt/freeware/src/packages/BUILD/libgcrypt-1.7.8'
Makefile:408: recipe for target 'all' failed
gmake: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.aflaab (%build)spec file
Name: libgcrypt
Version: 1.7.8
Release: 1
Source0: ftp://ftp.gnupg.org/gcrypt/%{name}/%{name}-%{version}.tar.bz2
Source1: ftp://ftp.gnupg.org/gcrypt/%{name}/%{name}-%{version}.tar.bz2.sig
Source2: %{name}.so.11-aix32
Source3: %{name}.so.11-aix64
Patch0: %{name}-%{version}-aix.patch
Group: System Environment/Libraries
License: LGPL
Summary: A general-purpose cryptography library.
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: libgpg-error-devel >= 1.27-1, pkg-config
Requires: libgpg-error >= 1.27-1
%ifos aix5.1
BuildRequires: prngd
Requires: prngd
Requires: AIX-rpm >= 5.1.0.0
Requires: AIX-rpm < 5.2.0.0
%else
Requires: AIX-rpm >= 5.2.0.0
%endif
%description
Libgcrypt is a general purpose crypto library based on the code used
in GNU Privacy Guard.
The library is available as 32-bit and 64-bit.
%package devel
Summary: Development files for the %{name} package.
Group: Development/Libraries
Requires: /sbin/install-info
Requires: info
Requires: libgpg-error-devel >= 1.27-1
Requires: %{name} = %{version}-%{release}
%description devel
Libgcrypt is a general purpose crypto library based on the code used
in GNU Privacy Guard. This package contains files needed to develop
applications using libgcrypt.
If you are compiling a 32-bit program, no special compiler options are
needed.
If you are compiling a 64-bit program, you have to compile and link your
application with "xlc_r -q64" or "gcc -maix64".
%prep
%setup -q
%patch0 -p1
%build
# setup environment for 32-bit and 64-bit builds
export CONFIG_SHELL=/usr/bin/ksh
export CONFIG_ENV_ARGS=/usr/bin/ksh
export CC="xlc_r -D_LARGE_FILES"
export CFLAGS="-qmaxmem=16384 -qlanglvl=extc99 -qbitfields=unsigned -qhalt=s -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 \
-D_AIX53 -D_AIX61 -D_AIX71 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"
export AR="ar -X32_64"
export NM="nm -X32_64"
# first build the 64-bit version
export OBJECT_MODE=64
export LDFLAGS="-L/opt/freeware/lib64 -Wl,-blibpath:/opt/freeware/lib64:/usr/lib:/lib -Wl,-bmaxdata:0x80000000 -Wl,-bexpall"
./configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--enable-shared --enable-static \
--disable-aesni-support \
--disable-pclmul-support \
--disable-avx-support \
--disable-avx2-support \
--disable-neon-support \
--disable-amd64-as-feature-detection \
--disable-asm
gmake %{?_smp_mflags}
cp src/.libs/%{name}.so.20 .
gmake distclean
# now build the 32-bit version
export OBJECT_MODE=32
export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000 -Wl,-bexpall"
./configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--enable-static --enable-shared \
--disable-asm
gmake %{?_smp_mflags}
# add the 64-bit shared objects to the shared library containing already the
# 32-bit shared objects
${AR} -q src/.libs/%{name}.a ./%{name}.so.20
# Add the older 1.5.4 shared members for compatibility with older apps
# (gmake sure they're set for LOADONLY with 'strip -e')
cp %{SOURCE2} %{name}.so.11
/usr/bin/strip -X32 -e %{name}.so.11
/usr/bin/ar -X32 -q src/.libs/%{name}.a ./%{name}.so.11
cp %{SOURCE3} %{name}.so.11
/usr/bin/strip -X64 -e %{name}.so.11
/usr/bin/ar -X64 -q src/.libs/%{name}.a ./%{name}.so.11
%install
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
gmake DESTDIR=${RPM_BUILD_ROOT} install
/usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || :
rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir
gzip --best ${RPM_BUILD_ROOT}%{_infodir}/gcrypt.info
(
cd ${RPM_BUILD_ROOT}
for dir in bin include lib
do
mkdir -p usr/${dir}
cd usr/${dir}
ln -sf ../..%{_prefix}/${dir}/* .
cd -
done
)
%post devel
/sbin/install-info %{_infodir}/gcrypt.info.gz %{_infodir}/dir
%preun devel
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/gcrypt.info.gz %{_infodir}/dir
fi
%clean
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,root,system)
%{_bindir}/dumpsexp
%{_bindir}/hmac256
%{_libdir}/*.a
/usr/bin/dumpsexp
/usr/bin/hmac256
/usr/lib/*.a
%files devel
%defattr(-,root,system)
%{_bindir}/%{name}-config
%{_includedir}/*
%{_libdir}/*.la
%{_datadir}/aclocal/*
%{_infodir}/gcrypt.info*
/usr/bin/%{name}-config
/usr/include/*
/usr/lib/*.la