]> git.pld-linux.org Git - packages/ghostscript.git/blame - ghostscript-find_devs.sh
- Bit simpler.
[packages/ghostscript.git] / ghostscript-find_devs.sh
CommitLineData
c1d11d96 1#!/bin/sh
2######################################################################
3# $Revision$, $Date$
4######################################################################
5# This scripts scans devs.mak and contrib.mak provided with
6# Ghostsctipt and prints list of devices which aren't present in
7# master Makefile.
0dd88365
SZ
8# Expects parameters: name (without path!) of makefile to scan and
9# additional list of drivers that won't be built.
10#
11# Authors:
c1d11d96 12# Michal Kochanowicz <mkochano@pld.org.pl>
0dd88365 13# Sebastian Zagrodzki <zagrodzki@pld.org.pl>
c1d11d96 14######################################################################
15
0dd88365
SZ
16# MAKENAME is a name of makefile to scan
17MAKENAME="$1"
18shift
19
c1d11d96 20# BLACKLIST contains list of drivers which should *not* be activated.
0dd88365
SZ
21BLACKLIST="$@"
22BLACKLIST="$BLACKLIST ali atiw cirr tseng tvga" # MSDOS - direct hw access.
23BLACKLIST="$BLACKLIST vesa s3vga"
8e5b5dda 24BLACKLIST="$BLACKLIST herc ega vga svga16 pe"
c1d11d96 25BLACKLIST="$BLACKLIST att3b1" # Console - who needs it?!
26BLACKLIST="$BLACKLIST sonyfb" # Sony Frame Buffer device.
27BLACKLIST="$BLACKLIST nwp533" # Sony NWP-533.
28BLACKLIST="$BLACKLIST sunview sunhmono" # Sun-specific.
29BLACKLIST="$BLACKLIST sparc" # Sparc printer - no headers.
e2253853 30BLACKLIST="$BLACKLIST omni" # omni - no source in 7.00
fdf3e339 31# BLACKLIST="$BLACKLIST cdj880" # There is no driver in *.c?!
c1d11d96 32
c1d11d96 33MAKEFILE="src/unix-gcc.mak"
34
35is_on_blacklist() {
36 DEVNAME=`echo $1 | sed -e 's/$(DD)//'`
37 for X in $BLACKLIST; do
38 if [ "$X.dev" = "$DEVNAME" ]; then return 1; fi
39 done
40 return 0
41}
42
43scan_file() {
ea6ed7ee 44 awk 'BEGIN { FS="[: ]+" } /^\$\(DD\).*:/ { print $1 }' \
c1d11d96 45 < $1 \
46 | while read DEV; do
47 is_on_blacklist $DEV || continue
48 # grep -q $DEV $MAKEFILE, but who needs grep?! ;)
d108019b 49 awk -v DEV="$DEV" '/^DEVICE_DEVS/ { if(index($0, DEV) > 0) exit 1 }' < $MAKEFILE && echo -n "$DEV "
c1d11d96 50 done
51}
52
0dd88365 53scan_file "src/$MAKENAME"
This page took 0.083902 seconds and 4 git commands to generate.