blob: 60f2cf2e11a370100197086cfc78a58455009465 [file] [log] [blame]
Guido van Rossumaec78551990-12-20 23:03:58 +00001/* Configuration containing EVERYTHING */
2
3/* At CWI, this implies stdwin, audio, Amoeba and the NASA Panel Library */
4#define USE_AUDIO
5#define USE_AMOEBA
6#define USE_PANEL
7
8static int use_stdwin;
9
10/*ARGSUSED*/
11void
12initargs(p_argc, p_argv)
13 int *p_argc;
14 char ***p_argv;
15{
16 extern char *getenv();
17 char *display;
18
19 /* Assume we have to initialize stdwin if either of the following
20 conditions holds:
21 - the environment variable $DISPLAY is set
22 - there is an argument "-display" somewhere
23 */
24
25 display = getenv("DISPLAY");
26 if (display != 0)
27 use_stdwin = 1;
28 else {
29 int i;
30 /* Scan through the arguments looking for "-display" */
31 for (i = 1; i < *p_argc; i++) {
32 if (strcmp((*p_argv)[i], "-display") == 0) {
33 use_stdwin = 1;
34 break;
35 }
36 }
37 }
38
39 if (use_stdwin)
40 winitargs(p_argc, p_argv);
41}
42
43void
44initcalls()
45{
46 inittime();
47 initmath();
48 initposix();
49#ifdef USE_AUDIO
50 initaudio();
51#endif
52#ifdef USE_AMOEBA
53 initamoeba();
54#endif
55 initgl();
56#ifdef USE_PANEL
57 initpanel();
58#endif
59 if (use_stdwin)
60 initstdwin();
61}
62
63void
64donecalls()
65{
66 if (use_stdwin)
67 wdone();
68#ifdef USE_AUDIO
69 asa_done();
70#endif
71}
72
73#ifndef PYTHONPATH
74#define PYTHONPATH ".:/usr/local/lib/python"
75#endif
76
77extern char *getenv();
78
79char *
80getpythonpath()
81{
82 char *path = getenv("PYTHONPATH");
83 if (path == 0)
84 path = PYTHONPATH;
85 return path;
86}