add new configure option to disable VIDIX PCI device name database (saves a 300 kB on mplayer binary)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25299 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ben 2007-12-04 18:10:20 +00:00
parent 298578466c
commit cee668bb27
3 changed files with 22 additions and 4 deletions

11
configure vendored
View File

@ -337,6 +337,7 @@ Video output:
--with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
nvidia,pm2,pm3,radeon,rage128,savage,sis,unichrome
--disable-vidix-pcidb disable VIDIX PCI device name database
--enable-gl enable OpenGL video output [autodetect]
--enable-dga2 enable DGA 2 support [autodetect]
--enable-dga1 enable DGA 1 support [autodetect]
@ -610,6 +611,7 @@ _winsock2=auto
_smbsupport=auto
_vidix_internal=auto
_vidix_external=auto
_vidix_pcidb=yes
_joystick=no
_xvid=auto
_x264=auto
@ -997,6 +999,7 @@ for ac_option do
--with-vidix-drivers=*)
_vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
;;
--disable-vidix-pcidb) _vidix_pcidb=no ;;
--enable-joystick) _joystick=yes ;;
--disable-joystick) _joystick=no ;;
--enable-xvid) _xvid=yes ;;
@ -4257,6 +4260,13 @@ else
_novomodules="xvidix $_novomodules"
fi
echocheck "VIDIX PCI device name database"
echores "$_vidix_pcidb"
if test "$_vidix_pcidb" = yes ; then
_vidix_pcidb_val=1
else
_vidix_pcidb_val=0
fi
echocheck "/dev/mga_vid"
if test "$_mga" = auto ; then
@ -7574,6 +7584,7 @@ DVBIN = $_dvbin
VIDIX = $_vidix
VIDIX_INTERNAL = $_vidix_internal
VIDIX_EXTERNAL = $_vidix_external
VIDIX_PCIDB = $_vidix_pcidb_val
CONFIG_PP = yes
MP3LAME = $_mp3lame
LIBMENU = $_menu

View File

@ -47,7 +47,7 @@ rage128_vid.o: radeon_vid.c
$(CC) -c $(CFLAGS) -DRAGE128 -o $@ $<
pci_names.c pci_dev_ids.c: pci.db
LC_ALL=C awk -f pci_db2c.awk $<
LC_ALL=C awk -f pci_db2c.awk $< $(VIDIX_PCIDB)
clean::
rm -f pci_*.c pci_*.h

View File

@ -26,12 +26,13 @@
BEGIN {
if(ARGC != 2) {
if(ARGC != 3) {
# check for arguments:
print "Usage awk -f pci_db2c.awk pci.db (and make sure pci.db file exists first)";
exit(1);
}
in_file = ARGV[1];
with_pci_db = ARGV[2];
vendor_file = "pci_vendors.h";
ids_file = "pci_ids.h"
name_file = "pci_names.c"
@ -60,9 +61,11 @@ BEGIN {
print_name_struct(name_h_file);
print "#include <stddef.h>">name_file
print "#include \"pci_names.h\"">name_file
if (with_pci_db) {
print "#include \"pci_dev_ids.c\"">name_file
print "">name_file
print "static struct vendor_id_s vendor_ids[] = {">name_file
}
first_pass=1;
init_name_db();
while(getline <in_file)
@ -78,7 +81,7 @@ BEGIN {
printf("#define VENDOR_%s\t", svend_name) >vendor_file;
if(length(svend_name) < 9) printf("\t") >vendor_file;
printf("0x%s /*%s*/\n",field[2], name_field) >vendor_file;
printf("{ 0x%s, \"%s\", dev_lst_%s },\n",field[2], name_field, field[2]) >name_file;
if (with_pci_db) printf("{ 0x%s, \"%s\", dev_lst_%s },\n",field[2], name_field, field[2]) >name_file;
printf("/* Vendor: %s: %s */\n", field[2], name_field) > ids_file
if(first_pass == 1) { first_pass=0; }
else { print "{ 0xFFFF, NULL }\n};" >dev_ids_file; }
@ -118,7 +121,7 @@ BEGIN {
print "#endif/*PCI_IDS_INCLUDED*/">ids_file
print "">name_h_file
print "#endif/*PCI_NAMES_INCLUDED*/">name_h_file
print "};">name_file
if (with_pci_db) print "};">name_file
print "{ 0xFFFF, NULL }" >dev_ids_file;
print "};">dev_ids_file
print_func_bodies(name_file);
@ -172,16 +175,19 @@ function print_func_bodies(out_file)
print "">out_file
print "const char *pci_vendor_name(unsigned short id)" >out_file
print "{" >out_file
if (with_pci_db) {
print " unsigned i;" >out_file
print " for(i=0;i<sizeof(vendor_ids)/sizeof(struct vendor_id_s);i++)">out_file
print " {" >out_file
print "\tif(vendor_ids[i].id == id) return vendor_ids[i].name;" >out_file
print " }" >out_file
}
print " return NULL;" >out_file
print "}">out_file
print "" >out_file
print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id)" >out_file
print "{" >out_file
if (with_pci_db) {
print " unsigned i, j;" >out_file
print " for(i=0;i<sizeof(vendor_ids)/sizeof(struct vendor_id_s);i++)">out_file
print " {" >out_file
@ -196,6 +202,7 @@ function print_func_bodies(out_file)
print "\t break;" >out_file
print "\t}" >out_file
print " }" >out_file
}
print " return NULL;">out_file
print "}">out_file
return