]> git.pld-linux.org Git - packages/ghostscript.git/blob - ghostscript-find_devs.sh
- some pld.org.pl->pld-linux.org cosmetics
[packages/ghostscript.git] / ghostscript-find_devs.sh
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.
8 # Expects parameters: name (without path!) of makefile to scan and
9 # additional list of drivers that won't be built.
10
11 # Authors:
12 #   Michal Kochanowicz <mkochano@pld.org.pl>
13 #   Sebastian Zagrodzki <zagrodzki@pld.org.pl>
14 ######################################################################
15
16 # MAKENAME is a name of makefile to scan
17 MAKENAME="$1"
18 shift
19
20 # BLACKLIST contains list of drivers which should *not* be activated.
21 BLACKLIST="$@"
22 BLACKLIST="$BLACKLIST ali atiw cirr tseng tvga" # MSDOS - direct hw access.
23 BLACKLIST="$BLACKLIST vesa s3vga"
24 BLACKLIST="$BLACKLIST herc ega vga svga16 pe"
25 BLACKLIST="$BLACKLIST att3b1"                   # Console - who needs it?!
26 BLACKLIST="$BLACKLIST sonyfb"                   # Sony Frame Buffer device.
27 BLACKLIST="$BLACKLIST nwp533"                   # Sony NWP-533.
28 BLACKLIST="$BLACKLIST sunview sunhmono"         # Sun-specific.
29 BLACKLIST="$BLACKLIST sparc"                    # Sparc printer - no headers.
30 BLACKLIST="$BLACKLIST omni"                     # omni - no source in 7.00
31 # BLACKLIST="$BLACKLIST cdj880"                 # There is no driver in *.c?!
32
33 MAKEFILE="src/unix-gcc.mak"
34
35 is_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
43 scan_file() {
44         awk 'BEGIN { FS="[: ]+" } /^\$\(DD\).*:/ { print $1 }' \
45                 < $1 \
46                 | while read DEV; do
47                         is_on_blacklist $DEV || continue
48                         # grep -q $DEV $MAKEFILE, but who needs grep?! ;)
49                         awk -v DEV="$DEV" '/^DEVICE_DEVS/ { if(index($0, DEV) > 0) exit 1 }' < $MAKEFILE && echo -n "$DEV "
50                 done
51 }
52
53 scan_file "src/$MAKENAME"
This page took 0.088271 seconds and 3 git commands to generate.