diff -Nru ocaml-4.01.0/debian/changelog ocaml-4.01.0/debian/changelog --- ocaml-4.01.0/debian/changelog 2014-05-17 13:26:13.000000000 +0000 +++ ocaml-4.01.0/debian/changelog 2014-07-31 21:36:07.000000000 +0000 @@ -1,3 +1,12 @@ +ocaml (4.01.0-4+rpi1) jessie-staging; urgency=low + + * Add logic in debian/rules to detect raspbian and give the upstream + configure script the correct instructions. + * Fix upstream build scripts to pass "model" when building .p.o files + from assembler files. + + -- Peter Michael Green Thu, 31 Jul 2014 21:35:32 +0000 + ocaml (4.01.0-4) unstable; urgency=medium * debian/patches: diff -Nru ocaml-4.01.0/debian/patches/pass-model-p.o.patch ocaml-4.01.0/debian/patches/pass-model-p.o.patch --- ocaml-4.01.0/debian/patches/pass-model-p.o.patch 1970-01-01 00:00:00.000000000 +0000 +++ ocaml-4.01.0/debian/patches/pass-model-p.o.patch 2014-07-31 21:36:07.000000000 +0000 @@ -0,0 +1,30 @@ +Description: Pass "model" when building .p.o files from assembler files. + The upstream build system passed -DMODEL_$(MODEL) when building .o files but + not when building .p.o files. When building for raspbian (with the correct + v6 configuration) this resulted in arm.p.o coming out with v7 code. +Author: Peter Michael Green + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- ocaml-4.01.0.orig/asmrun/Makefile ++++ ocaml-4.01.0/asmrun/Makefile +@@ -180,7 +180,7 @@ clean:: + exit 2; } + + .S.p.o: +- $(ASPP) -DSYS_$(SYSTEM) $(ASPPPROFFLAGS) -o $*.p.o $*.S ++ $(ASPP) -DSYS_$(SYSTEM) -DMODEL_$(MODEL) $(ASPPPROFFLAGS) -o $*.p.o $*.S + + .c.d.o: + ln -s -f $*.c $*.d.c diff -Nru ocaml-4.01.0/debian/patches/series ocaml-4.01.0/debian/patches/series --- ocaml-4.01.0/debian/patches/series 2014-05-17 13:23:54.000000000 +0000 +++ ocaml-4.01.0/debian/patches/series 2014-07-31 21:36:51.000000000 +0000 @@ -15,3 +15,4 @@ 0015-Fix-native-backtraces-on-arm.patch 0016-Make-ocamlopt-g-more-resistant-to-ill-formed-locatio.patch 0017-Fix-lost-locations-in-out-of-bounds-exceptions.patch +pass-model-p.o.patch diff -Nru ocaml-4.01.0/debian/rules ocaml-4.01.0/debian/rules --- ocaml-4.01.0/debian/rules 2014-05-17 13:23:54.000000000 +0000 +++ ocaml-4.01.0/debian/rules 2014-07-31 21:36:07.000000000 +0000 @@ -59,8 +59,19 @@ export OCAML_OPT_ARCH export OCAML_STDLIB_DIR -CONFIGURE_OPTS := \ - --host $(DEB_BUILD_GNU_TYPE)\ +ifeq ($(DEB_BUILD_ARCH),armhf) + IS_RASPBIAN := $(shell dpkg-vendor --derives-from Raspbian && echo yes || echo no) +else + IS_RASPBIAN := no +endif + +ifeq ($(IS_RASPBIAN),yes) + CONFIGURE_OPTS := --host armv6-unknown-linux-gnueabihf +else + CONFIGURE_OPTS := --host $(DEB_BUILD_GNU_TYPE) +endif + +CONFIGURE_OPTS += \ --with-pthread -prefix $(DEB_TEST_BUILD_PREFIX)/usr \ -libdir $(DEB_TEST_BUILD_PREFIX)$(OCAML_STDLIB_DIR) \ -x11lib "$(shell pkg-config --variable=libdir x11)" \