Re: [chrony-dev] Build scripts.

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Thu, Nov 05, 2009 at 02:08:21PM +0000, Jonathan Cameron wrote:
> > What's missing? I think running configure with appropriate CC should
> > work. We can add --target option to prefix the compiler name if
> > that's what you are referring to.
> The problem is with the bit in configure where it uses uname to query what
> the operating system is.  Obviously this could be handled via --target etc
> but it isn't currently.

Ah, ok. Do you think it would be better with this patch?

It allows to override the system detection, but the correct compiler
still needs to be specified with CC variable. I'm not sure we can do
much better here without involving a config.guess magic.

-- 
Miroslav Lichvar
diff --git a/configure b/configure
index a8dd51a..ba937d2 100755
--- a/configure
+++ b/configure
@@ -194,6 +194,11 @@ Fine tuning of the installation directories:
   --infodir=DIR          info documentation [PREFIX/info]
   --mandir=DIR           man documentation [PREFIX/man]
 
+Overriding system detection when cross-compiling:
+  --host-system=OS       Specify system name (uname -s)
+  --host-release=REL     Specify system release (uname -r)
+  --host-machine=CPU     Specify machine (uname -m)
+
 Some influential environment variables:
   CC          C compiler command
   CFLAGS      C compiler flags
@@ -219,8 +224,6 @@ OPERATINGSYSTEM=`uname -s`
 VERSION=`uname -r`
 MACHINE=`uname -m`
 
-SYSTEM=${OPERATINGSYSTEM}-${MACHINE}
-
 EXTRA_LIBS=""
 EXTRA_CLI_LIBS=""
 EXTRA_OBJECTS=""
@@ -280,6 +283,15 @@ do
     --enable-linuxcaps)
       feat_linuxcaps=1
     ;;
+    --host-system=* )
+      OPERATINGSYSTEM=`echo $option | sed -e 's/^.*=//;'`
+    ;;
+    --host-release=* )
+      VERSION=`echo $option | sed -e 's/^.*=//;'`
+    ;;
+    --host-machine=* )
+      MACHINE=`echo $option | sed -e 's/^.*=//;'`
+    ;;
     --help | -h )
       usage
       exit 0
@@ -289,6 +301,8 @@ do
     esac
 done
 
+SYSTEM=${OPERATINGSYSTEM}-${MACHINE}
+
 case $SYSTEM in
     SunOS-sun4* )
     case $VERSION in


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/