]> git.donarmstrong.com Git - lilypond.git/blobdiff - debian/rules
Disable optimization on i386 and kfreebsd-i386 to avoid segfaults with python7; thank...
[lilypond.git] / debian / rules
index 339a7070d12a04a8aae7f3df63325a09c4e4e919..3e87307aed5482ca5eed04b58dbb9af3af33300b 100755 (executable)
@@ -22,7 +22,6 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
     MAKEFLAGS += -j$(NUMJOBS) CPU_COUNT=$(NUMJOBS)
 endif
 
-
 include VERSION
 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
 
@@ -49,13 +48,25 @@ export HOME = /tmp
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
 
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
+CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
+ifneq (,$(filter $(DEB_HOST_ARCH), i386 kfreebsd-i386))
+  config_opt = --disable-optimising
+  CFLAGS := $(filter-out -O%, $(CFLAGS))
+  CXXFLAGS := $(filter-out -O%, $(CXXFLAGS))
+else
+  config_opt = --enable-optimising
+endif
+
+
 build: build-stamp
 build-stamp:
        dh_testdir
 
        cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./stepmake/bin/
        ./configure --disable-checking --enable-debugging \
-               --prefix=/usr --enable-optimising \
+               --prefix=/usr $(config_opt) \
                --infodir='$${prefix}/share/info' \
                --mandir='$${prefix}/share/man'
        ulimit -c unlimited && $(MAKE)