summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2004-05-16 00:03:54 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2004-05-16 00:03:54 +0000
commitfc2dd516c3c7382915452207180a1c483d0d73ca (patch)
tree76f7b415e66f321baf72e4e35984e3a6ae37ad7a
parentb1aa9499ffb827f4b1acc75f197e332bba382565 (diff)
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.
-rw-r--r--hw/xfree86/utils/xorgconfig/xorgconfig.c82
1 files changed, 61 insertions, 21 deletions
diff --git a/hw/xfree86/utils/xorgconfig/xorgconfig.c b/hw/xfree86/utils/xorgconfig/xorgconfig.c
index 7f4c18d6a..c3c89d649 100644
--- a/hw/xfree86/utils/xorgconfig/xorgconfig.c
+++ b/hw/xfree86/utils/xorgconfig/xorgconfig.c
@@ -94,6 +94,7 @@
* Chisato Yamauchi(cyamauch@phyas.aichi-edu.ac.jp)
*/
/* $XConsortium: xf86config.c /main/21 1996/10/28 05:43:57 kaleb $ */
+/* $XdotOrg: $ */
#include <stdlib.h>
#include <stdio.h>
@@ -169,6 +170,11 @@ static int getuid() { return 0; }
#define TREEROOT PROJECTROOT
#define TREEROOTLX TREEROOT "/lib/X11"
#define TREEROOTCFG TREEROOT "/etc/X11"
+#ifdef XDOCDIR
+# define TREEROOTDOC XDOCDIR
+#else
+# define TREEROOTDOC TREEROOTLX "/doc"
+#endif
#define MODULEPATH TREEROOT "/lib/modules"
#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 and fine-tune it.\n"
#if 0
-" Refer to " TREEROOTLX "/doc/README.Config\n"
+" Refer to " TREEROOTDOC "/README.Config\n"
"for a detailed overview of the configuration process.\n"
"\n"
"(what should we change this section to?)\n"
@@ -706,7 +712,7 @@ keyboard_configuration(void)
rulesfile = XKB_RULES_DIR "/xfree98";
#else
config_xkbrules = __XKBDEFRULES__; /* static */
- rulesfile = XKB_RULES_DIR "/";
+ rulesfile = XKB_RULES_DIR "/" __XKBDEFRULES__;
#endif
rules = XkbRF_Load(rulesfile, "", True, False);
@@ -839,7 +845,7 @@ static char *monitorintro_text =
"\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"
-TREEROOTLX "/doc/Monitors to see if your monitor is there.\n"
+TREEROOTDOC "/Monitors to see if your monitor is there.\n"
"\n";
static char *hsyncintro_text =
@@ -1852,10 +1858,10 @@ depth_configuration(void)
*/
static char *XF86Config_firstchunk_text =
-"# File generated by xf86config.\n"
+"# File generated by xorgconfig.\n"
"\n"
"#\n"
-"# Copyright (c) 2004, by the "XVENDORNAMESHORT"\n"
+"# Copyright 2004 "XVENDORNAME"\n"
"#\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"
@@ -1875,14 +1881,14 @@ static char *XF86Config_firstchunk_text =
"# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n"
"# SOFTWARE.\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"
-"# dealings in this Software without prior written authorization from the\n"
-"# "XVENDORNAMESHORT".\n"
+"# dealings in this Software without prior written authorization from\n"
+"# "XVENDORNAME".\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"
"# **********************************************************************\n"
"\n"
@@ -1932,9 +1938,11 @@ static char *XF86Config_firstchunk_text =
"# as well as specifying multiple comma-separated entries in one FontPath\n"
"# command (or a combination of both methods)\n"
"# \n"
+#if 0
"# 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"
"# to the end of this list (or comment them out).\n"
+#endif
"# \n"
"\n";
@@ -2061,8 +2069,8 @@ static char *keyboardchunk3_text =
"# control keys, use:\n"
"# Option \"XkbOptions\" \"ctrl:swapcaps\"\n"
"\n"
-"# These are the default XKB settings for "XVENDORNAMESHORT"\n"
-"# Option \"XkbRules\" \"__XKBDEFRULES__\"\n"
+"# These are the default XKB settings for "__XSERVERNAME__"\n"
+"# Option \"XkbRules\" \""__XKBDEFRULES__"\"\n"
"# Option \"XkbModel\" \"pc101\"\n"
"# Option \"XkbLayout\" \"us\"\n"
"# Option \"XkbVariant\" \"\"\n"
@@ -2114,7 +2122,7 @@ static char *xinputsection_text =
"# Other input device sections \n"
"# this is optional and is required only if you\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"
"# Section \"InputDevice\" \n"
@@ -2384,7 +2392,7 @@ static char *devicesection_text =
"\n"
"EndSection\n"
"\n"
-"# Device configured by xf86config:\n"
+"# Device configured by xorgconfig:\n"
"\n";
static char *screensection_text1 =
@@ -2448,12 +2456,43 @@ write_fontpath_section(FILE *f)
int i;
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++) {
strcpy(cur,TREEROOTLX);
strcat(cur,XF86Config_fontpaths[i]);
/* remove a ':' */
colon = strchr(cur+2,':'); /* OS/2: C:/...:scaled */
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) ? "" : "#";
fprintf(f,"%s FontPath \"%s%s\"\n",
hash,
@@ -2701,7 +2740,7 @@ ask_XF86Config_location(void) {
char *filename = NULL;
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");
#ifndef __EMX__
@@ -2778,22 +2817,23 @@ ask_XF86Config_location(void) {
static char *notinstalled_text =
"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"
-"XFree86 3.1+ before running this program, following the instructions in\n"
-"the INSTALL or README that comes with the "__XSERVERNAME__" distribution for your OS.\n"
+"not yet installed the version of "__XSERVERNAME__" that this program was built\n"
+"to configure. Please install "__XSERVERNAME__" "XVERSIONSTRING" before running this program,\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"
"libraries, configuration files and a server that you want to use.\n"
"\n";
#ifndef __UNIXOS2__
static char *oldxfree86_text =
-"The directory '/usr/X386/bin' exists. You probably have an old version of\n"
-"__XSERVERNAME__ installed (XFree86 3.1 installs in '" TREEROOT "' instead of\n"
-"'/usr/X386').\n"
+"The directory '/usr/X386/bin' exists. You probably have a very old version of\n"
+"XFree86 installed, but this program was built to configure "__XSERVERNAME__" "XVERSIONSTRING"\n"
+"installed in '" TREEROOT "' instead of '/usr/X386'.\n"
"\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"
-"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"
"after '" TREEROOT "'.\n"
"\n";