Home | History | Annotate | Line # | Download | only in sets
makeflist revision 1.62
      1 #!/bin/sh
      2 #
      3 # $NetBSD: makeflist,v 1.62 2003/08/04 05:53:20 mrg Exp $
      4 #
      5 # Print out the files in some or all lists.
      6 # Usage: makeflist [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...]
      7 #
      8 
      9 # set defaults
     10 make="${MAKE:-make} -j 1 -f `dirname $0`/Makefile"
     11 machine=`${make} print_machine`
     12 machine_arch=`${make} print_machine_arch`
     13 machine_cpu=`${make} print_machine_cpu`
     14 object_fmt=`${make} print_object_fmt`
     15 toolchain_missing=`${make} print_toolchain_missing`
     16 use_tools_toolchain=`${make} print_use_tools_toolchain`
     17 x11_version=`${make} print_x11_version`
     18 setd=`pwd`
     19 nlists="base comp etc games man misc text"
     20 xlists="xbase xcomp xcontrib xfont xserver xmisc"
     21 lists=$nlists
     22 
     23 . ./sets.subr
     24 
     25 # handle args
     26 while : ; do
     27 	case $1 in
     28 	-b*)
     29 		lists="$xlists $nlists"
     30 		;;
     31 	-x*)
     32 		lists=$xlists
     33 		;;
     34 	-a*)
     35 		machine_arch=`MACHINE_ARCH=${2} ${make} print_machine_arch`
     36 		machine_cpu=`MACHINE_ARCH=${2} ${make} print_machine_cpu`
     37 		shift
     38 		;;
     39 	-m*)
     40 		machine=$2; shift
     41 		;;
     42 	-s*)
     43 		setd=$2; shift
     44 		;;
     45 	-*)
     46 		cat 1>&2 <<USAGE
     47 Usage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...]
     48 	-b		make netbsd + x11 lists
     49 	-x		only make x11 lists
     50 	-a arch		set arch (e.g, m68k, mipseb, mipsel, powerpc) [$machine_arch]
     51 	-m machine	set machine (e.g, amiga, i386, macppc) [$machine]
     52 	-s setsdir	directory to find sets [$setd]
     53 	[setname ...]	sets to build [$lists]
     54 USAGE
     55 		exit 1
     56 		;;
     57 	*)
     58 		break
     59 		;;
     60 	esac
     61 	shift
     62 done
     63 if [ -n "$1" ]; then
     64 	lists="$@"
     65 fi
     66 
     67 # Determine lib type.
     68 if [ "$object_fmt" = "ELF" ]; then
     69 	shlib=elf
     70 else
     71 	shlib=aout
     72 fi
     73 stlib=$shlib
     74 
     75 # Turn off shlibs for some ports.
     76 if [ "$machine_cpu" = "sh3" -o "$machine_arch" = "m68000" ]; then
     77 	shlib=no
     78 fi
     79 lkm=yes
     80 # Turn off LKMs for some ports.
     81 if [ "$machine" = "evbppc" ]; then
     82 	lkm=no
     83 fi
     84 
     85 # Turn off lintlibs for some ports.
     86 # Not needed anymore, leave the hook here for future use.
     87 lintlibs=
     88 
     89 # Automatically add XFree86 version specific sets
     90 for list in $lists
     91 do
     92  if [ -z "$_lists" ]
     93  then
     94   _lists=$list
     95  else
     96   _lists="$_lists $list"
     97  fi
     98  if [ -d "$setd/lists/$list${x11_version}" ]
     99  then
    100   _lists="$_lists $list${x11_version}"
    101  fi
    102 done
    103 lists=$_lists
    104 unset _lists
    105 
    106 for setname in $lists; do
    107 	list_set_files $setname
    108 done | awk -- '/^[^#]/ {print $1}' | sort -u
    109