$Id: xmkmf-patch,v 3.3 1995/03/17 15:04:15 bjoerns Exp $

This patch adds functionality to xmkmf to specify additional defines.  It
can be used to specify your own config file to override the values
specified in Local.config, e.g.:

	xmkmf -a -DMY_CONFIG_FILE=\"My.config\"

950317 <bjoerns@acm.org>

*** /usr/bin/X11/xmkmf	Sun May 22 18:37:18 1994
--- xmkmf	Thu Mar 16 21:08:38 1995
***************
*** 5,23 ****
  # 
  # $XConsortium: xmkmf.cpp,v 1.18 91/08/22 11:08:01 rws Exp $
  
! usage="usage:  $0 [-a] [top_of_sources_pathname [current_directory]]"
  
  topdir=
  curdir=.
  do_all=
  
! case "$1" in
! -a)
!     do_all="yes"
!     shift
!     ;;
! esac
  
  case $# in 
      0) ;;
      1) topdir=$1 ;;
--- 5,31 ----
  # 
  # $XConsortium: xmkmf.cpp,v 1.18 91/08/22 11:08:01 rws Exp $
  
! usage="usage:  $0 [-a] [-Ddefine] [top_of_sources_pathname [current_directory]]"
  
  topdir=
  curdir=.
  do_all=
+ defs=
  
! set -- `getopt aD: $*`
! if [ $? != 0 ] ; then
!     echo "$usage" 1>&2; exit 1
! fi
  
+ for arg in $*
+ do
+     case "$arg" in
+     -a) do_all="yes"; shift ;;
+     -D) defs="$defs -D$2"; shift 2 ;;
+     --) shift; break ;;
+     esac
+ done
+ 
  case $# in 
      0) ;;
      1) topdir=$1 ;;
***************
*** 35,51 ****
  fi
  
  if [ "$topdir" = "" ]; then
- 
      args="-DUseInstalled ""-I$ROOT/usr/lib/X11/config"
- 
  else
      args="-I$topdir/config -DTOPDIR=$topdir -DCURDIR=$curdir"
  fi
  
! echo imake $args
  case "$do_all" in
  yes)
!     imake $args && 
      echo "make Makefiles" &&
      make Makefiles &&
      echo "make includes" &&
--- 43,57 ----
  fi
  
  if [ "$topdir" = "" ]; then
      args="-DUseInstalled ""-I$ROOT/usr/lib/X11/config"
  else
      args="-I$topdir/config -DTOPDIR=$topdir -DCURDIR=$curdir"
  fi
  
! echo imake $defs $args
  case "$do_all" in
  yes)
!     imake $defs $args && 
      echo "make Makefiles" &&
      make Makefiles &&
      echo "make includes" &&
***************
*** 54,59 ****
      make depend
      ;;
  *)
!     imake $args
      ;;
  esac
--- 60,65 ----
      make depend
      ;;
  *)
!     imake $defs $args
      ;;
  esac
