diff --git a/ocaml.spec b/ocaml.spec index 45c3133a8c536aabe9ebe5706b75cece0e2b40e8..acc4faa8d52bf50958fa6071983bbbfef653d90c 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -1,6 +1,18 @@ +%ifnarch loongarch64 +%global native_compiler 1 +%else +%global native_compiler 0 +%endif + +%ifnarch loongarch64 +%global natdynlink 1 +%else +%global natdynlink 0 +%endif + Name: ocaml Version: 4.13.1 -Release: 6 +Release: 7 Summary: OCaml compiler and programming environment License: LGPL-2.1-only URL: http://www.ocaml.org @@ -64,6 +76,12 @@ Help files for %{name} %autosetup -n %{name}-%{version} -p1 autoconf --force +# add for loongarch64 +%ifarch loongarch64 +%_update_config_guess +%_update_config_sub +%endif + %build %configure \ @@ -72,8 +90,10 @@ autoconf --force --libdir=%{_libdir}/ocaml \ --host=`./build-aux/config.guess` %make_build world +%if %{native_compiler} %make_build opt %make_build opt.opt +%endif %check cd testsuite @@ -122,6 +142,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %{_bindir}/ocamloptp.byte %{_bindir}/ocamlprof.byte +%if %{native_compiler} # native code versions %{_bindir}/ocamlc.opt %{_bindir}/ocamlcp.opt @@ -136,6 +157,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %{_bindir}/ocamlopt %{_bindir}/ocamlopt.byte %{_bindir}/ocamlopt.opt +%endif %{_libdir}/ocaml/camlheader %{_libdir}/ocaml/camlheader_ur @@ -144,17 +166,26 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %{_libdir}/ocaml/ld.conf %{_libdir}/ocaml/Makefile.config %{_libdir}/ocaml/*.a +%if %{natdynlink} %{_libdir}/ocaml/*.cmxs +%endif + +%if %{native_compiler} %{_libdir}/ocaml/*.cmxa %{_libdir}/ocaml/*.cmx %{_libdir}/ocaml/*.o %{_libdir}/ocaml/libasmrun_shared.so +%endif + %{_libdir}/ocaml/*.mli %{_libdir}/ocaml/libcamlrun_shared.so %{_libdir}/ocaml/threads/*.mli + +%if %{native_compiler} %{_libdir}/ocaml/threads/*.a %{_libdir}/ocaml/threads/*.cmxa %{_libdir}/ocaml/threads/*.cmx +%endif %{_libdir}/ocaml/caml #runtime @@ -191,17 +222,23 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/ocaml/eventlog_metadata %{_libdir}/ocaml/compiler-libs/*.cmi %{_libdir}/ocaml/compiler-libs/*.cmo %{_libdir}/ocaml/compiler-libs/*.cma + +%if %{native_compiler} %{_libdir}/ocaml/compiler-libs/*.a %{_libdir}/ocaml/compiler-libs/*.cmxa %{_libdir}/ocaml/compiler-libs/*.cmx %{_libdir}/ocaml/compiler-libs/*.o - +%endif %files help %{_mandir}/man1/* %{_mandir}/man3/* %changelog +* Sun Apr 23 2023 herengui - 4.13.1-7 +- update config.guess and config.sub +- loongarch64 does not support native_compiler + * Thu Jan 18 2023 xingxing - 4.13.1-6 - fix build on RISC-V