1 /* -*- C -*- ***********************************************
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
7 Permission to use, copy, modify, and distribute this software and its
8 documentation for any purpose and without fee is hereby granted,
9 provided that the above copyright notice appear in all copies and that
10 both that copyright notice and this permission notice appear in
11 supporting documentation, and that the names of Stichting Mathematisch
12 Centrum or CWI not be used in advertising or publicity pertaining to
13 distribution of the software without specific, written prior permission.
15 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 ******************************************************************/
25 /* Universal Python configuration file */
32 /* The Macintosh main program is in macmain.c */
42 #include "intrcheck.h"
44 #if defined(__cplusplus)
50 /* Normally, the main program is called from here (so everything else
51 can be in libPython.a). We save a pointer to argv[0] because it
52 may be needed for dynamic loading of modules in import.c. If you
53 have your own main program and want to use non-SunOS dynamic
54 loading, you will have to provide your own version of
59 /* These are made available for other modules that might need them.
60 This is rare, but it is needed by the secureware module. */
62 static char **orig_argv
;
65 #if defined(__cplusplus)
66 int realmain(int, char**);
67 main(int argc
, char **argv
)
87 #if defined(__cplusplus)
88 getargcargv(int *argc
, char ***argv
)
90 getargcargv(argc
,argv
)
102 /* Python version information */
104 #include "patchlevel.h"
106 /* Return the version string. This is constructed from the official
107 version number (from patchlevel.h), and the current date (if known
108 to the compiler, else a manually inserted date). */
110 #define VERSION "%s (%s)%s"
113 #define DATE __DATE__
115 #define DATE "Feb 13 1995"
119 #define COMPILER " [THINK C]"
124 #define COMPILER " [CW PPC]"
126 #define COMPILER " [CW 68K]"
132 #define COMPILER " [Symantec MPW]"
134 #define COMPILER " [Apple MPW]"
139 #define COMPILER " [GCC " __VERSION__ "]"
149 static char version
[80];
150 sprintf(version
, VERSION
, PATCHLEVEL
, DATE
, COMPILER
);
155 /* Return the copyright string. This is updated manually. */
160 return "Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam";
164 /* Return the initial python search path. This is called once from
165 initsys() to initialize sys.path.
166 The environment variable PYTHONPATH is fetched and the default path
167 appended. (The Mac has no environment variables, so there the
168 default path is always returned.) The default path may be passed
169 to the preprocessor; if not, a system-dependent default is used. */
173 #define PYTHONPATH ": :Lib :Lib:stdwin :Lib:test :Lib:mac"
174 #endif /* macintosh */
175 #endif /* !PYTHONPATH */
178 #if defined(MSDOS) || defined(NT)
179 #define PYTHONPATH ".;..\\lib;\\python\\lib"
180 #endif /* MSDOS || NT */
181 #endif /* !PYTHONPATH */
184 #define PYTHONPATH ".:/usr/local/lib/python"
185 #endif /* !PYTHONPATH */
188 extern char *getenv();
197 char *path
= getenv("PYTHONPATH");
198 char *defpath
= PYTHONPATH
;
199 static char *buf
= NULL
;
205 n
= strlen(path
) + strlen(defpath
) + 2;
212 fatal("not enough memory to copy module search path");
214 p
= buf
+ strlen(buf
);
222 /* Table of built-in modules.
223 These are initialized when first imported.
224 Note: selection of optional extensions is now generally done by the
227 /* -- ADDMODULE MARKER 1 -- */
229 extern void initmarshal();
230 extern void initimp();
237 /* -- ADDMODULE MARKER 2 -- */
239 /* This module "lives in" with marshal.c */
240 {"marshal", initmarshal
},
242 /* This lives it with import.c */
245 /* These entries are here for sys.builtin_module_names */
247 {"__builtin__", NULL
},
259 } frozen_modules
[] = {
264 #if defined(__cplusplus)