xc/programs/Xserver/hw/xfree86/xf86config/Imakefile

xc/programs/Xserver/hw/xfree86/xf86config/xorgconfig.c
- Clean up server name changes from TM branch
- Set default XKB rules file name correctly
- Use default font path from Imake configuration for the default font path
    in generated xorg.conf files.
- Use path variables from Imake configuration for paths to files, in case
    vendor has configured them to install somewhere other than the
    defaults.
This commit is contained in:
Alan Coopersmith 2004-05-16 00:03:54 +00:00
parent b1aa9499ff
commit fc2dd516c3

View File

@ -94,6 +94,7 @@
* Chisato Yamauchi(cyamauch@phyas.aichi-edu.ac.jp) * Chisato Yamauchi(cyamauch@phyas.aichi-edu.ac.jp)
*/ */
/* $XConsortium: xf86config.c /main/21 1996/10/28 05:43:57 kaleb $ */ /* $XConsortium: xf86config.c /main/21 1996/10/28 05:43:57 kaleb $ */
/* $XdotOrg: $ */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
@ -169,6 +170,11 @@ static int getuid() { return 0; }
#define TREEROOT PROJECTROOT #define TREEROOT PROJECTROOT
#define TREEROOTLX TREEROOT "/lib/X11" #define TREEROOTLX TREEROOT "/lib/X11"
#define TREEROOTCFG TREEROOT "/etc/X11" #define TREEROOTCFG TREEROOT "/etc/X11"
#ifdef XDOCDIR
# define TREEROOTDOC XDOCDIR
#else
# define TREEROOTDOC TREEROOTLX "/doc"
#endif
#define MODULEPATH TREEROOT "/lib/modules" #define MODULEPATH TREEROOT "/lib/modules"
#ifndef XCONFIGFILE #ifndef XCONFIGFILE
@ -256,7 +262,7 @@ CONFIGNAME " file is supplied with "__XSERVERNAME__"; it is configured for a sta
"configuration, or let this program produce a base " CONFIGNAME " file for your\n" "configuration, or let this program produce a base " CONFIGNAME " file for your\n"
"configuration and fine-tune it.\n" "configuration and fine-tune it.\n"
#if 0 #if 0
" Refer to " TREEROOTLX "/doc/README.Config\n" " Refer to " TREEROOTDOC "/README.Config\n"
"for a detailed overview of the configuration process.\n" "for a detailed overview of the configuration process.\n"
"\n" "\n"
"(what should we change this section to?)\n" "(what should we change this section to?)\n"
@ -706,7 +712,7 @@ keyboard_configuration(void)
rulesfile = XKB_RULES_DIR "/xfree98"; rulesfile = XKB_RULES_DIR "/xfree98";
#else #else
config_xkbrules = __XKBDEFRULES__; /* static */ config_xkbrules = __XKBDEFRULES__; /* static */
rulesfile = XKB_RULES_DIR "/"; rulesfile = XKB_RULES_DIR "/" __XKBDEFRULES__;
#endif #endif
rules = XkbRF_Load(rulesfile, "", True, False); rules = XkbRF_Load(rulesfile, "", True, False);
@ -839,7 +845,7 @@ static char *monitorintro_text =
"\n" "\n"
"The valid range for horizontal sync and vertical sync should be documented\n" "The valid range for horizontal sync and vertical sync should be documented\n"
"in the manual of your monitor. If in doubt, check the monitor database\n" "in the manual of your monitor. If in doubt, check the monitor database\n"
TREEROOTLX "/doc/Monitors to see if your monitor is there.\n" TREEROOTDOC "/Monitors to see if your monitor is there.\n"
"\n"; "\n";
static char *hsyncintro_text = static char *hsyncintro_text =
@ -1852,10 +1858,10 @@ depth_configuration(void)
*/ */
static char *XF86Config_firstchunk_text = static char *XF86Config_firstchunk_text =
"# File generated by xf86config.\n" "# File generated by xorgconfig.\n"
"\n" "\n"
"#\n" "#\n"
"# Copyright (c) 2004, by the "XVENDORNAMESHORT"\n" "# Copyright 2004 "XVENDORNAME"\n"
"#\n" "#\n"
"# Permission is hereby granted, free of charge, to any person obtaining a\n" "# Permission is hereby granted, free of charge, to any person obtaining a\n"
"# copy of this software and associated documentation files (the \"Software\"),\n" "# copy of this software and associated documentation files (the \"Software\"),\n"
@ -1875,14 +1881,14 @@ static char *XF86Config_firstchunk_text =
"# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n" "# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n"
"# SOFTWARE.\n" "# SOFTWARE.\n"
"# \n" "# \n"
"# Except as contained in this notice, the name of "XVENDORNAMESHORT" shall\n" "# Except as contained in this notice, the name of "XVENDORNAME" shall\n"
"# not be used in advertising or otherwise to promote the sale, use or other\n" "# not be used in advertising or otherwise to promote the sale, use or other\n"
"# dealings in this Software without prior written authorization from the\n" "# dealings in this Software without prior written authorization from\n"
"# "XVENDORNAMESHORT".\n" "# "XVENDORNAME".\n"
"#\n" "#\n"
"\n" "\n"
"# **********************************************************************\n" "# **********************************************************************\n"
"# Refer to the XF86Config(4/5) man page for details about the format of \n" "# Refer to the " CONFIGNAME "(" FILEMANSUFFIX ") man page for details about the format of \n"
"# this file.\n" "# this file.\n"
"# **********************************************************************\n" "# **********************************************************************\n"
"\n" "\n"
@ -1932,9 +1938,11 @@ static char *XF86Config_firstchunk_text =
"# as well as specifying multiple comma-separated entries in one FontPath\n" "# as well as specifying multiple comma-separated entries in one FontPath\n"
"# command (or a combination of both methods)\n" "# command (or a combination of both methods)\n"
"# \n" "# \n"
#if 0
"# If you don't have a floating point coprocessor and emacs, Mosaic or other\n" "# If you don't have a floating point coprocessor and emacs, Mosaic or other\n"
"# programs take long to start up, try moving the Type1 and Speedo directory\n" "# programs take long to start up, try moving the Type1 and Speedo directory\n"
"# to the end of this list (or comment them out).\n" "# to the end of this list (or comment them out).\n"
#endif
"# \n" "# \n"
"\n"; "\n";
@ -2061,8 +2069,8 @@ static char *keyboardchunk3_text =
"# control keys, use:\n" "# control keys, use:\n"
"# Option \"XkbOptions\" \"ctrl:swapcaps\"\n" "# Option \"XkbOptions\" \"ctrl:swapcaps\"\n"
"\n" "\n"
"# These are the default XKB settings for "XVENDORNAMESHORT"\n" "# These are the default XKB settings for "__XSERVERNAME__"\n"
"# Option \"XkbRules\" \"__XKBDEFRULES__\"\n" "# Option \"XkbRules\" \""__XKBDEFRULES__"\"\n"
"# Option \"XkbModel\" \"pc101\"\n" "# Option \"XkbModel\" \"pc101\"\n"
"# Option \"XkbLayout\" \"us\"\n" "# Option \"XkbLayout\" \"us\"\n"
"# Option \"XkbVariant\" \"\"\n" "# Option \"XkbVariant\" \"\"\n"
@ -2114,7 +2122,7 @@ static char *xinputsection_text =
"# Other input device sections \n" "# Other input device sections \n"
"# this is optional and is required only if you\n" "# this is optional and is required only if you\n"
"# are using extended input devices. This is for example only. Refer\n" "# are using extended input devices. This is for example only. Refer\n"
"# to the XF86Config man page for a description of the options.\n" "# to the " CONFIGNAME " man page for a description of the options.\n"
"# **********************************************************************\n" "# **********************************************************************\n"
"#\n" "#\n"
"# Section \"InputDevice\" \n" "# Section \"InputDevice\" \n"
@ -2384,7 +2392,7 @@ static char *devicesection_text =
"\n" "\n"
"EndSection\n" "EndSection\n"
"\n" "\n"
"# Device configured by xf86config:\n" "# Device configured by xorgconfig:\n"
"\n"; "\n";
static char *screensection_text1 = static char *screensection_text1 =
@ -2448,12 +2456,43 @@ write_fontpath_section(FILE *f)
int i; int i;
char cur[256+20],*colon, *hash; char cur[256+20],*colon, *hash;
#ifdef COMPILEDDEFAULTFONTPATH
static const char dfp[] = COMPILEDDEFAULTFONTPATH;
const char *thisdir;
const char *nextdir;
int len;
for (thisdir = dfp; thisdir != NULL; thisdir = nextdir) {
nextdir = strchr(thisdir, ',');
if (nextdir == NULL) {
len = strlen(thisdir);
} else {
len = nextdir - thisdir;
nextdir++;
}
if (len > sizeof(cur))
continue;
strncpy(cur, thisdir, len);
cur[len] = '\0';
colon = strchr(cur+2,':'); /* OS/2: C:/...:scaled */
if (colon) *colon = 0;
hash = exists_dir(cur) ? "" : "#";
if (colon) *colon = ':';
fprintf(f,"%s FontPath \"%s\"\n", hash, cur);
}
#endif
for (i=0; XF86Config_fontpaths[i]; i++) { for (i=0; XF86Config_fontpaths[i]; i++) {
strcpy(cur,TREEROOTLX); strcpy(cur,TREEROOTLX);
strcat(cur,XF86Config_fontpaths[i]); strcat(cur,XF86Config_fontpaths[i]);
/* remove a ':' */ /* remove a ':' */
colon = strchr(cur+2,':'); /* OS/2: C:/...:scaled */ colon = strchr(cur+2,':'); /* OS/2: C:/...:scaled */
if (colon) *colon = 0; if (colon) *colon = 0;
#ifdef COMPILEDDEFAULTFONTPATH
/* skip if we already added it as part of the default font path */
if (strstr(dfp, cur) != NULL)
continue;
#endif
hash = exists_dir(cur) ? "" : "#"; hash = exists_dir(cur) ? "" : "#";
fprintf(f,"%s FontPath \"%s%s\"\n", fprintf(f,"%s FontPath \"%s%s\"\n",
hash, hash,
@ -2701,7 +2740,7 @@ ask_XF86Config_location(void) {
char *filename = NULL; char *filename = NULL;
printf( printf(
"I am going to write the XF86Config file now. Make sure you don't accidently\n" "I am going to write the " CONFIGNAME " file now. Make sure you don't accidently\n"
"overwrite a previously configured one.\n\n"); "overwrite a previously configured one.\n\n");
#ifndef __EMX__ #ifndef __EMX__
@ -2778,22 +2817,23 @@ ask_XF86Config_location(void) {
static char *notinstalled_text = static char *notinstalled_text =
"The directory " TREEROOT " does not exist. This probably means that you have\n" "The directory " TREEROOT " does not exist. This probably means that you have\n"
"not yet installed an X11R6-based version of "__XSERVERNAME__". Please install\n" "not yet installed the version of "__XSERVERNAME__" that this program was built\n"
"XFree86 3.1+ before running this program, following the instructions in\n" "to configure. Please install "__XSERVERNAME__" "XVERSIONSTRING" before running this program,\n"
"the INSTALL or README that comes with the "__XSERVERNAME__" distribution for your OS.\n" "following the instructions in the INSTALL or README that comes with the\n"
__XSERVERNAME__" distribution for your OS.\n"
"For a minimal installation it is sufficient to only install base binaries,\n" "For a minimal installation it is sufficient to only install base binaries,\n"
"libraries, configuration files and a server that you want to use.\n" "libraries, configuration files and a server that you want to use.\n"
"\n"; "\n";
#ifndef __UNIXOS2__ #ifndef __UNIXOS2__
static char *oldxfree86_text = static char *oldxfree86_text =
"The directory '/usr/X386/bin' exists. You probably have an old version of\n" "The directory '/usr/X386/bin' exists. You probably have a very old version of\n"
"__XSERVERNAME__ installed (XFree86 3.1 installs in '" TREEROOT "' instead of\n" "XFree86 installed, but this program was built to configure "__XSERVERNAME__" "XVERSIONSTRING"\n"
"'/usr/X386').\n" "installed in '" TREEROOT "' instead of '/usr/X386'.\n"
"\n" "\n"
"It is important that the directory '" TREEROOT "' is present in your\n" "It is important that the directory '" TREEROOT "' is present in your\n"
"search path, *before* any occurrence of '/usr/X386/bin'. If you have installed\n" "search path, *before* any occurrence of '/usr/X386/bin'. If you have installed\n"
"X program binaries that are not in the base __XSERVERNAME__ distribution in\n" "X program binaries that are not in the base "__XSERVERNAME__" distribution in\n"
"'/usr/X386/bin', you can keep the directory in your path as long as it is\n" "'/usr/X386/bin', you can keep the directory in your path as long as it is\n"
"after '" TREEROOT "'.\n" "after '" TREEROOT "'.\n"
"\n"; "\n";