Description: Change buildsystem setup for Debian
 We cannot use --march, because we need to support many of them -- not even
 'native', as it will over-optimize for the build machine.
 We set an RPATH to let binaries find the private shared lib. This is
 safe, because the shared library is built by and shipped in the same package
 as the binaries.
Forwarded: not-needed
Author: Michael Hanke <michael.hanke@gmail.com>
--- a/sysconf/linux.py
+++ b/sysconf/linux.py
@@ -6,7 +6,7 @@
 lib_suffix = '.so'
 
 cpp = [ 'g++', '-c', '$flags$', '$gtk$', '$path$', '$src$', '-o', '$obj$' ]
-cpp_flags = [ '-Wall', '-march=native', '-fPIC', '-fno-strict-aliasing', '-DGL_GLEXT_PROTOTYPES', '-DUSE_TR1' ]
+cpp_flags = [ '-Wall', '-fPIC', '-fno-strict-aliasing', '-DGL_GLEXT_PROTOTYPES', '-DUSE_TR1' ]
 
 ld = [ 'g++', '$flags$', '$path$', '$obj$', '$mrtrix$', '$gsl$', '$gtk$', '$lz$', '-o', '$bin$' ]
 ld_flags = []
@@ -16,7 +16,7 @@
 ld_lib_flags = []
 
 cpp_flags_debug = cpp_flags + [ '-g' ]
-ld_flags_debug = ld_flags + [ '-g' ]
+ld_flags_debug = ld_flags + [ '-g', '-Wl,--rpath=/usr/lib/mrtrix/lib' ]
 ld_lib_flags_debug = ld_lib_flags + [ '-g' ]
 
 cpp_flags_profile = [ '-pg' ] + cpp_flags_debug
--- a/build
+++ b/build
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python
 
 import platform, sys, os, time, threading, subprocess, shutil, stat
 
@@ -177,12 +177,12 @@
   if verbose:
     print svn_revision
   svn_revision = '#define SVN_REVISION ' + svn_revision + '\n'
+  if svn_revision != open(svn_revision_file).read():
+    with open(svn_revision_file, 'wb') as fd:
+      fd.write (svn_revision)
 except:
   pass
 
-if svn_revision != open(svn_revision_file).read():
-  with open(svn_revision_file, 'wb') as fd:
-    fd.write (svn_revision)
 
 
 
