Commit 7f5e71fa authored by David Nusinow's avatar David Nusinow
Browse files

Make PCI text file directory configurable

parent 4b14c9a9
......@@ -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])
......
......@@ -94,4 +94,6 @@ if LNXACPI
XORG_CFLAGS += -DHAVE_ACPI
endif
XORG_CFLAGS += -DPCITXTIDSPATH=\"$(PCI_TXT_IDS_PATH)\"
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
......@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment