diff options
author | David Nusinow <dnusinow@debian.org> | 2007-10-21 23:41:49 -0400 |
---|---|---|
committer | David Nusinow <dnusinow@debian.org> | 2007-10-21 23:41:49 -0400 |
commit | 7f5e71fa7347fb4ec2657ccc453831c04a0f288d (patch) | |
tree | 2ef6db305d0e7bbc4d1e9924bea07ac271999e50 | |
parent | 4b14c9a9cd2033d3839c4ba364d41ab4c4b198ab (diff) |
Make PCI text file directory configurable
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | hw/xfree86/common/Makefile.am | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86AutoConfig.c | 11 |
3 files changed, 13 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index e7d229c4f..c8b2b7838 100644 --- a/configure.ac +++ b/configure.ac @@ -464,6 +464,10 @@ APPLE_APPLICATIONS_DIR="${bindir}/Applications" AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: ${bindir}/Applications)]), [ APPLE_APPLICATIONS_DIR="${withval}" ]. [ APPLE_APPLICATIONS_DIR="${bindir}/Applications" ]) +AC_ARG_WITH(pci-txt-ids-dir, AS_HELP_STRING([--with-pci-txt-ids-dir=PATH], +[Path to pci id directory (default: ${datadir}/X11/pci)]), + [ PCI_TXT_IDS_DIR="$withval" ], + [ PCI_TXT_IDS_DIR="${datadir}/X11/pci" ]) AC_ARG_ENABLE(builddocs, AS_HELP_STRING([--enable-builddocs], [Build docs (default: disabled)]), [BUILDDOCS=$enableval], [BUILDDOCS=no]) @@ -1003,6 +1007,7 @@ fi AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path]) AC_DEFINE_DIR(RGB_DB, RGBPATH, [Default RGB path]) +AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path]) AC_DEFINE_DIR(SERVERCONFIGdir, SERVERCONFIG, [Server config path]) AC_DEFINE_DIR(BASE_FONT_PATH, FONTDIR, [Default base font path]) AC_DEFINE_DIR(DRI_DRIVER_PATH, DRI_DRIVER_PATH, [Default DRI driver path]) diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am index db726fea1..05c088c96 100644 --- a/hw/xfree86/common/Makefile.am +++ b/hw/xfree86/common/Makefile.am @@ -94,4 +94,6 @@ if LNXACPI XORG_CFLAGS += -DHAVE_ACPI endif +XORG_CFLAGS += -DPCITXTIDSPATH=\"$(PCI_TXT_IDS_PATH)\" + AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 8117ace24..524e14eb5 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -342,9 +342,10 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip char path_name[256], vendor_str[5], chip_str[5]; uint16_t vendor, chip; int i, j; - idsdir = opendir("/usr/share/xserver-xorg/pci"); + idsdir = opendir(PCITXTIDSPATH); if (idsdir) { + xf86Msg(X_INFO, "Scanning %s directory for additional PCI ID's supported by the drivers\n", PCITXTIDSPATH); direntry = readdir(idsdir); /* Read the directory */ while (direntry) { @@ -356,8 +357,9 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip /* A tiny bit of sanity checking. We should probably do better */ if (strncmp(&(direntry->d_name[len-4]), ".ids", 4) == 0) { /* We need the full path name to open the file */ - strncpy(path_name, "/usr/share/xserver-xorg/pci/", 256); - strncat(path_name, direntry->d_name, (256 - strlen(path_name))); + strncpy(path_name, PCITXTIDSPATH, 256); + strncat(path_name, "/", 1); + strncat(path_name, direntry->d_name, (256 - strlen(path_name) - 1)); fp = fopen(path_name, "r"); if (fp == NULL) { xf86Msg(X_ERROR, "Could not open %s for reading. Exiting.\n", path_name); @@ -406,8 +408,7 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip matches[i][j] = direntry->d_name[j]; } } - xf86Msg(X_INFO, "Matched %s from file name %s in autoconfig\n", matches[i], direntry->d_name); - + xf86Msg(X_INFO, "Matched %s from file name %s\n", matches[i], direntry->d_name); } } else { /* TODO Handle driver overrides here */ |