]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
split config.c in 1000 parts; new main; new unfinished objective-C module
authorGuido van Rossum <guido@python.org>
Fri, 4 Aug 1995 04:20:45 +0000 (04:20 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 4 Aug 1995 04:20:45 +0000 (04:20 +0000)
Modules/Makefile.pre.in
Modules/Setup.in
Modules/config.c.in

index 588e953ce802749d06b901078636bb8ae956c1cd..b48a4ab9de81efa9614657872e12c468ed6a7b25 100644 (file)
@@ -29,9 +29,6 @@ LIBS=         @LIBS@
 LIBM=          @LIBM@
 LIBC=          @LIBC@
 
-# Machine-dependent subdirectories
-MACHDEP=       @MACHDEP@
-
 # Install prefix for architecture-independent files
 prefix=                @prefix@
 
@@ -61,6 +58,8 @@ MAKESETUP=    $(srcdir)/makesetup
 
 OBJS=          $(MODOBJS)
 
+ADDOBJS=       main.o config.o getpath.o
+
 LIB=           libModules.a
 
 MYLIBS=                $(LIB) \
@@ -80,15 +79,11 @@ $(LIB):             $& $(OBJS) Makefile
                $(AR) cr $(LIB) $(OBJS)
                $(RANLIB) $(LIB)
 
-../python:     config.o $(MYLIBS) Makefile
-               $(LINKCC) $(OPT) config.o $(LINKFORSHARED) \
+../python:     $(MYLIBS) $(ADDOBJS) Makefile
+               $(LINKCC) $(OPT) $(LINKFORSHARED) $(ADDOBJS) \
                      $(MYLIBS) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python
                mv python ../python
 
-config.o:      config.c Makefile $(MYLIBS)
-               $(LINKCC) $(CFLAGS) -DPYTHONPATH=\"$(PYTHONPATH)\" \
-                         -DPLATFORM=\"$(MACHDEP)\" -c config.c
-
 clean:
                -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej
 
@@ -96,6 +91,10 @@ clobber:     clean
                -rm -f *.a tags TAGS config.c glmodule.c Makefile.pre
                -rm -f *.so so_locations
 
+getpath.o:     getpath.c Makefile
+               $(CC) -c $(CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
+                     $(srcdir)/getpath.c
+
 config.c Makefile: Makefile.pre config.c.in $(MAKESETUP) Setup
                $(SHELL) $(MAKESETUP) Setup
 
@@ -127,6 +126,7 @@ fmmodule.o: fmmodule.c
 glmodule.o: glmodule.c
 imageop.o: imageop.c
 imgfile.o: imgfile.c
+main.o: main.c
 mathmodule.o: mathmodule.c
 md5c.o: md5c.c
 md5module.o: md5module.c
index efc195e1f7b139decbc8782125164996ac139388..0f9a2ffc3943d2b12ae9459de0753962d4acd2ca 100644 (file)
@@ -245,7 +245,8 @@ rotor rotormodule.c         # enigma-inspired encryption
 
 # Lance's curses module.  This requires the System V version of
 # curses, sometimes known as ncurses (e.g. on Linux, link with
-# -lncurses).
+# -lncurses instead of -lcurses; on SunOS 4.1.3, insert -I/usr/5include
+# -L/usr/5lib before -lcurses).
 
 #curses cursesmodule.c -lcurses -ltermcap
 
@@ -296,6 +297,9 @@ rotor rotormodule.c         # enigma-inspired encryption
 # David Wayne Williams' soundex module
 #soundex soundex.c
 
+# Objective-C (incomplete!!!)
+#objc.c
+
 
 # Example -- included for reference only:
 # xx xxmodule.c
index 6ade6828c07d77fa1d8945223eedf0f0d5ef7470..b0db7f35749c7b7c94c4aa59d813575a069c6c17 100644 (file)
@@ -22,222 +22,19 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 ******************************************************************/
 
-/* Universal Python configuration file */
+/* Module configuration */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+/* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */
 
-#ifdef macintosh
-/* The Macintosh main program is in macmain.c */
-#define NO_MAIN
-#endif
+/* This file contains the table of built-in modules.
+   See init_builtin() in import.c. */
 
-#include <stdio.h>
-#include <string.h>
+#include "Python.h"
 
-#include "myproto.h"
-#include "mymalloc.h"
-#include "osdefs.h"
-#include "intrcheck.h"
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-#ifndef NO_MAIN
-
-/* Normally, the main program is called from here (so everything else
-   can be in libPython.a).  We save a pointer to argv[0] because it
-   may be needed for dynamic loading of modules in import.c.  If you
-   have your own main program and want to use non-SunOS dynamic
-   loading, you will have to provide your own version of
-   getprogramname(). */
-
-static char *argv0;
-
-/* These are made available for other modules that might need them.
-   This is rare, but it is needed by the secureware module. */
-
-static char **orig_argv;
-static int  orig_argc;
-
-extern int realmain PROTO((int, char**));
-
-#if defined(__cplusplus)
-main(int argc, char **argv)
-#else
-main(argc, argv)
-       int argc;
-       char **argv;
-#endif
-{
-       orig_argc = argc;
-       orig_argv = argv;
-       argv0 = argv[0];
-       realmain(argc, argv);
-}
-
-char *
-getprogramname()
-{
-       return argv0;
-}
-
-void
-#if defined(__cplusplus)
-getargcargv(int *argc, char ***argv)
-#else
-getargcargv(argc,argv)
-       int *argc;
-       char ***argv;
-#endif
-{
-       *argc = orig_argc;
-       *argv = orig_argv;
-}
-
-#endif
-
-
-/* Python version information */
-
-#include "patchlevel.h"
-
-/* Return the version string.  This is constructed from the official
-   version number (from patchlevel.h), and the current date (if known
-   to the compiler, else a manually inserted date). */
-
-#define VERSION "%s (%s)%s"
-
-#ifdef __DATE__
-#define DATE __DATE__
-#else
-#define DATE "July 7 1995"
-#endif
-
-#ifdef THINK_C
-#define COMPILER " [THINK C]"
-#endif
-
-#ifdef __MWERKS__
-#ifdef __powerc
-#define COMPILER " [CW PPC]"
-#else
-#define COMPILER " [CW 68K]"
-#endif
-#endif
-
-#ifdef MPW
-#ifdef __SC__
-#define COMPILER " [Symantec MPW]"
-#else
-#define COMPILER " [Apple MPW]"
-#endif
-#endif
-
-#ifdef __GNUC__
-#define COMPILER " [GCC " __VERSION__ "]"
-#endif
-
-#ifndef COMPILER
-#define COMPILER ""
-#endif
-
-char *
-getversion()
-{
-       static char version[80];
-       sprintf(version, VERSION, PATCHLEVEL, DATE, COMPILER);
-       return version;
-}
-
-
-/* Return the copyright string.  This is updated manually. */
-
-char *
-getcopyright()
-{
-       return "Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam";
-}
-
-
-/* Return the initial python search path.  This is called once from
-   initsys() to initialize sys.path.
-   The environment variable PYTHONPATH is fetched and the default path
-   appended.  (The Mac has no environment variables, so there the
-   default path is always returned.)  The default path may be passed
-   to the preprocessor; if not, a system-dependent default is used. */
-
-#ifndef PYTHONPATH
-#ifdef macintosh
-#define PYTHONPATH ": :Lib :Lib:stdwin :Lib:test :Lib:mac"
-#endif /* macintosh */
-#endif /* !PYTHONPATH */
-
-#ifndef PYTHONPATH
-#if defined(MSDOS) || defined(NT)
-#define PYTHONPATH ".;..\\lib;\\python\\lib"
-#endif /* MSDOS || NT */
-#endif /* !PYTHONPATH */
-
-#ifndef PYTHONPATH
-#define PYTHONPATH ".:/usr/local/lib/python"
-#endif /* !PYTHONPATH */
-
-#ifndef __cplusplus
-extern char *getenv();
-#endif
-
-#ifndef PLATFORM
-#define PLATFORM "unknown"
-#endif
-
-char *
-getplatform()
-{
-       return PLATFORM;
-}
-
-char *
-getpythonpath()
-{
-#ifdef __cplusplus
-       void fatal(char *);
-#endif
-       char *path = getenv("PYTHONPATH");
-       char *defpath = PYTHONPATH;
-       static char *buf = NULL;
-       char *p;
-       int n;
-
-       if (path == NULL)
-               path = "";
-       n = strlen(path) + strlen(defpath) + 2;
-       if (buf != NULL) {
-               free(buf);
-               buf = NULL;
-       }
-       buf = malloc(n);
-       if (buf == NULL)
-               fatal("not enough memory to copy module search path");
-       strcpy(buf, path);
-       p = buf + strlen(buf);
-       if (p != buf)
-               *p++ = DELIM;
-       strcpy(p, defpath);
-       return buf;
-}
-
-
-/* Table of built-in modules.
-   These are initialized when first imported.
-   Note: selection of optional extensions is now generally done by the
-   makesetup script. */
 
 /* -- ADDMODULE MARKER 1 -- */
 
-extern void initmarshal();
+extern void PyMarshal_Init();
 extern void initimp();
 
 struct {
@@ -248,7 +45,7 @@ struct {
 /* -- ADDMODULE MARKER 2 -- */
 
        /* This module "lives in" with marshal.c */
-       {"marshal", initmarshal},
+       {"marshal", PyMarshal_Init},
 
        /* This lives it with import.c */
        {"imp", initimp},
@@ -261,17 +58,3 @@ struct {
        /* Sentinel */
        {0, 0}
 };
-
-#ifndef USE_FROZEN
-struct frozen {
-       char *name;
-       char *code;
-       int size;
-} frozen_modules[] = {
-       {0, 0, 0}
-};
-#endif
-
-#if defined(__cplusplus)
-}
-#endif