Fix multilib conflicts in js-config.h

The multilib header handling is copied verbatim from libjpeg-turbo.
This commit is contained in:
Kalev Lember 2019-09-10 11:34:25 +02:00
parent f00bcf36c0
commit d2795ed492

View File

@ -16,7 +16,7 @@
Name: mozjs%{major} Name: mozjs%{major}
Version: 60.9.0 Version: 60.9.0
Release: 2%{?dist} Release: 3%{?dist}
Summary: SpiderMonkey JavaScript library Summary: SpiderMonkey JavaScript library
License: MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2+ and AFL and ASL 2.0 License: MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2+ and AFL and ASL 2.0
@ -160,6 +160,43 @@ popd
# Fix permissions # Fix permissions
chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc
# Avoid multilib conflicts
case `uname -i` in
i386 | ppc | s390 | sparc )
wordsize="32"
;;
x86_64 | ppc64 | s390x | sparc64 )
wordsize="64"
;;
*)
wordsize=""
;;
esac
if test -n "$wordsize"
then
mv %{buildroot}%{_includedir}/mozjs-60/js-config.h \
%{buildroot}%{_includedir}/mozjs-60/js-config-$wordsize.h
cat >%{buildroot}%{_includedir}/mozjs-60/js-config.h <<EOF
#ifndef JS_CONFIG_H_MULTILIB
#define JS_CONFIG_H_MULTILIB
#include <bits/wordsize.h>
#if __WORDSIZE == 32
# include "js-config-32.h"
#elif __WORDSIZE == 64
# include "js-config-64.h"
#else
# error "unexpected value for __WORDSIZE macro"
#endif
#endif
EOF
fi
# Remove unneeded files # Remove unneeded files
rm %{buildroot}%{_bindir}/js%{major}-config rm %{buildroot}%{_bindir}/js%{major}-config
rm %{buildroot}%{_libdir}/libjs_static.ajs rm %{buildroot}%{_libdir}/libjs_static.ajs
@ -200,6 +237,9 @@ ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so
%{_includedir}/mozjs-%{major}/ %{_includedir}/mozjs-%{major}/
%changelog %changelog
* Tue Sep 10 2019 Kalev Lember <klember@redhat.com> - 60.9.0-3
- Fix multilib conflicts in js-config.h
* Sat Sep 07 2019 Kalev Lember <klember@redhat.com> - 60.9.0-2 * Sat Sep 07 2019 Kalev Lember <klember@redhat.com> - 60.9.0-2
- Backport patches for s390x support - Backport patches for s390x support