1 /* -*- C -*- ***********************************************
2 Copyright 1991-1994 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)"
113 #define DATE __DATE__
115 #define DATE "Aug 17 1994"
121 static char version
[80];
122 sprintf(version
, VERSION
, PATCHLEVEL
, DATE
);
127 /* Return the copyright string. This is updated manually. */
132 return "Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam";
136 /* Return the initial python search path. This is called once from
137 initsys() to initialize sys.path.
138 The environment variable PYTHONPATH is fetched and the default path
139 appended. (The Mac has no environment variables, so there the
140 default path is always returned.) The default path may be passed
141 to the preprocessor; if not, a system-dependent default is used. */
145 #define PYTHONPATH ": :Lib :Lib:stdwin :Lib:test :Lib:mac"
146 #endif /* macintosh */
147 #endif /* !PYTHONPATH */
150 #if defined(MSDOS) || defined(NT)
151 #define PYTHONPATH ".;..\\lib;\\python\\lib"
152 #endif /* MSDOS || NT */
153 #endif /* !PYTHONPATH */
156 #define PYTHONPATH ".:/usr/local/lib/python"
157 #endif /* !PYTHONPATH */
160 extern char *getenv();
169 char *path
= getenv("PYTHONPATH");
170 char *defpath
= PYTHONPATH
;
171 static char *buf
= NULL
;
177 n
= strlen(path
) + strlen(defpath
) + 2;
184 fatal("not enough memory to copy module search path");
186 p
= buf
+ strlen(buf
);
194 /* Table of built-in modules.
195 These are initialized when first imported.
196 Note: selection of optional extensions is now generally done by the
199 /* -- ADDMODULE MARKER 1 -- */
201 extern void initmarshal();
202 extern void initimp();
209 /* -- ADDMODULE MARKER 2 -- */
211 /* This module "lives in" with marshal.c */
212 {"marshal", initmarshal
},
214 /* This lives it with import.c */
217 /* These entries are here for sys.builtin_module_names */
219 {"__builtin__", NULL
},
231 } frozen_modules
[] = {
236 #if defined(__cplusplus)