From aa29a7b3090e5b649612364333950488abd3c3d7 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Sun, 14 Nov 2010 21:39:11 +0000
Subject: [PATCH] try to detect TARGET and ARCH values for more optimisation.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40252 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 buildout/software-profiles/haproxy.cfg | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/buildout/software-profiles/haproxy.cfg b/buildout/software-profiles/haproxy.cfg
index 681a461717..9f676f34cc 100644
--- a/buildout/software-profiles/haproxy.cfg
+++ b/buildout/software-profiles/haproxy.cfg
@@ -6,9 +6,10 @@ recipe = hexagonit.recipe.cmmi
 url = http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.9.tar.gz
 md5sum = 2cbcc95b54c0d803edaa13e7b4aeec25
 configure-command = true
-# XXX-Luke: autodetection shall be provided by erp5.recipe.softwarebuild
-#           with possible overriding customisation
-# linux26 might be better target, but on this level portability is a must
+# If the system is running on Linux 2.6, we use "linux26" as the TARGET,
+# otherwise use "generic".
+# For ARCH value, x86_64 and i[3456]86 are supported.
 make-options =
-  TARGET=generic
+  TARGET="$(uname -sr 2>/dev/null|grep -q '^Linux 2\.6' && echo linux26 || echo generic)"
+  ARCH="$(uname -m 2>/dev/null|grep -qE '^(x86_64|i[3456]86)$' && uname -m)"
   PREFIX=${buildout:parts-directory}/haproxy
-- 
2.30.9