blob: 1ddc518d8ce77ecf0efb050fade00b67586c63c6 [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;
Guido van Rossum6607f441991-01-02 13:50:48 +000018
19 /* Ignore an initial argument of '-s', for backward compatibility */
20 if (*p_argc > 1 && strcmp((*p_argv)[1], "-s") == 0) {
21 (*p_argv)[1] = (*p_argv)[0];
22 (*p_argc)--, (*p_argv)++;
23 }
24
Guido van Rossumaec78551990-12-20 23:03:58 +000025 /* Assume we have to initialize stdwin if either of the following
26 conditions holds:
27 - the environment variable $DISPLAY is set
28 - there is an argument "-display" somewhere
29 */
30
31 display = getenv("DISPLAY");
32 if (display != 0)
33 use_stdwin = 1;
34 else {
35 int i;
36 /* Scan through the arguments looking for "-display" */
37 for (i = 1; i < *p_argc; i++) {
38 if (strcmp((*p_argv)[i], "-display") == 0) {
39 use_stdwin = 1;
40 break;
41 }
42 }
43 }
44
45 if (use_stdwin)
46 winitargs(p_argc, p_argv);
47}
48
49void
50initcalls()
51{
52 inittime();
53 initmath();
Guido van Rossum6607f441991-01-02 13:50:48 +000054 initregexp();
Guido van Rossumaec78551990-12-20 23:03:58 +000055 initposix();
56#ifdef USE_AUDIO
57 initaudio();
58#endif
59#ifdef USE_AMOEBA
60 initamoeba();
61#endif
62 initgl();
63#ifdef USE_PANEL
64 initpanel();
65#endif
66 if (use_stdwin)
67 initstdwin();
68}
69
70void
71donecalls()
72{
73 if (use_stdwin)
74 wdone();
75#ifdef USE_AUDIO
76 asa_done();
77#endif
78}
79
80#ifndef PYTHONPATH
81#define PYTHONPATH ".:/usr/local/lib/python"
82#endif
83
84extern char *getenv();
85
86char *
87getpythonpath()
88{
89 char *path = getenv("PYTHONPATH");
90 if (path == 0)
91 path = PYTHONPATH;
92 return path;
93}