[PATCH modular] Per-component configure options

Peter Hutterer peter.hutterer at who-t.net
Wed Jan 18 13:53:33 PST 2012


On Wed, Jan 18, 2012 at 02:32:48PM -0500, Gaetan Nadon wrote:
> On 12-01-16 06:22 PM, Trevor Woerner wrote:
> > From: Trevor Woerner <twoerner at gmail.com>
> >
> > Allow a user to specify per-component configure options by
> > providing them in the --modfile file. Any text remaining on
> > a line following a given module/component is assumed to be
> > options which will be passed to the configuration script.
> How will anyone know that this feature even exists?
> It does not show up in the --help as it is not a command line option or
> an env var. One day we will need a man page :-)

fwiw, if we do that, please let's rename the script first into a xorg-build
or somesuch. also, while it is overkill I heartily recommend asciidoc as man
page source since I suspect few people will install it and thus have it in
their manpath - asciidoc at least makes the man page human-readable without
special tools.

otoh, since it is just a shell script to build from git, you could also
prefix the output with a 
For a manual on build.sh, see http://wiki.x.org/wiki/build-script
and use that wiki page as manual.

Cheers,
  Peter
 
> We already have --confflags option (and CONFFLAGS env var). I suppose
> the per module conf option will be in addition to the (global) confflags.
> 
> 
> > Signed-off-by: Trevor Woerner <twoerner at gmail.com>
> > ---
> >  build.sh |   40 +++++++++++++++++++++++++++-------------
> >  1 files changed, 27 insertions(+), 13 deletions(-)
> >
> > diff --git a/build.sh b/build.sh
> > index b01d652..5c34eb7 100755
> > --- a/build.sh
> > +++ b/build.sh
> > @@ -148,11 +148,13 @@ failed() {
> >  # arguments:
> >  #   $1 - module
> >  #   $2 - component
> > +#   $3 - configuration options
> >  # returns:
> >  #   (irrelevant)
> >  module_title() {
> >      module=$1
> >      component=$2
> > +    confopts="$3"
> >      # preconds
> >      if [ X"$module" = X ]; then
> >  	return
> > @@ -161,6 +163,7 @@ module_title() {
> >      echo ""
> >      echo "======================================================================"
> >      echo "==  Processing module/component:  \"$module/$component\""
> > +    echo "==        configuration options:  \"$confopts\""
> Should it not also show the $CONFFLAGS option? They were not shown
> before, but now it would be misleading to only show the per module
> option. A popular one is --without-fop.
> >  }
> >  
> >  checkfortars() {
> > @@ -341,7 +344,8 @@ clone() {
> >  # perform processing of each module/component
> >  # arguments:
> >  #   $1 - module
> > -#   $2 - component (optional)
> > +#   $2 - component
> > +#   $3 - configure options
> >  # returns:
> >  #   0 - good
> >  #   1 - bad
> > @@ -349,29 +353,30 @@ process() {
> >      needs_config=0
> >  
> >      module=$1
> > -    component=$2
> > +    component="$2"
> > +    confopts="$3"
> >      # preconds
> >      if [ X"$module" = X ]; then
> >  	echo "process() required first argument is missing"
> >  	return 1
> >      fi
> >  
> > -    module_title $module $component
> > +    module_title $module "$component" "$confopts"
> >  
> >      SRCDIR=""
> >      CONFCMD=""
> > -    if [ -f $module/$component/autogen.sh ]; then
> > +    if [ -f $module/"$component"/autogen.sh ]; then
> >          SRCDIR="$module/$component"
> >          CONFCMD="autogen.sh"
> >      elif [ X"$CLONE" != X ]; then
> > -        clone $module $component
> > +        clone $module "$component"
> >          if [ $? -eq 0 ]; then
> >  	    SRCDIR="$module/$component"
> >  	    CONFCMD="autogen.sh"
> >          fi
> >  	needs_config=1
> >      else
> > -        checkfortars $module $component
> > +        checkfortars $module "$component"
> >          CONFCMD="configure"
> >      fi
> >  
> > @@ -451,7 +456,8 @@ process() {
> >  	    ${CPP:+CPP="$CPP"} \
> >  	    ${CPPFLAGS:+CPPFLAGS="$CPPFLAGS"} \
> >  	    ${CFLAGS:+CFLAGS="$CFLAGS"} \
> > -	    ${LDFLAGS:+LDFLAGS="$LDFLAGS"}
> > +	    ${LDFLAGS:+LDFLAGS="$LDFLAGS"} \
> > +	    $confopts
> Perhaps it should be following CONFFLAGS to alert the reader.
> Would it need ${} like CONFFLAGS?
> >  	if [ $? -ne 0 ]; then
> >  	    failed ${CONFCMD} $module $component
> >  	    cd $old_pwd
> > @@ -536,13 +542,15 @@ process() {
> >  # LISTONLY, RESUME, NOQUIT, and BUILD_ONE
> >  # arguments:
> >  #   $1 - module
> > -#   $2 - component (optional)
> > +#   $2 - component
> > +#   $3 - configure options
> >  # returns:
> >  #   0 - good
> >  #   1 - bad
> >  build() {
> >      module=$1
> > -    component=$2
> > +    component="$2"
> > +    confopts="$3"
> >      if [ X"$LISTONLY" != X ]; then
> >  	echo "$module/$component"
> >  	return 0
> > @@ -558,7 +566,7 @@ build() {
> >  	fi
> >      fi
> >  
> > -    process $module $component
> > +    process $module "$component" "$confopts"
> >      if [ $? -ne 0 ]; then
> >  	echo "build.sh: error processing module/component:  \"$module/$component\""
> >  	if [ X"$NOQUIT" = X ]; then
> > @@ -1009,9 +1017,15 @@ process_module_file() {
> >  	    continue
> >  	fi
> >  
> > -	module=`echo $line | cut -d'/' -f1`
> > -	component=`echo $line | cut -d'/' -f2`
> > -	build $module $component
> > +	module=`echo $line | cut -d' ' -f1 | cut -d'/' -f1`
> > +	component=`echo $line | cut -d' ' -f1 | cut -d'/' -f2`
> > +	confopts_check=`echo $line | cut -d' ' -f2-`
> > +	if [ "$module/$component" = "$confopts_check" ]; then
> > +	    confopts=""
> > +	else
> > +	    confopts="$confopts_check"
> > +	fi
> > +	build $module "$component" "$confopts"
> >      done <"$MODFILE"
> >  
> >      return 0
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list