[cig-commits] r7046 - in cs/spike/trunk: . Lib Modules Python

leif at geodynamics.org leif at geodynamics.org
Fri Jun 1 18:12:38 PDT 2007


Author: leif
Date: 2007-06-01 18:12:38 -0700 (Fri, 01 Jun 2007)
New Revision: 7046

Added:
   cs/spike/trunk/Include/
   cs/spike/trunk/Lib/
   cs/spike/trunk/Lib/copy_reg.py
   cs/spike/trunk/Lib/os.py
   cs/spike/trunk/Lib/posixfile.py
   cs/spike/trunk/Lib/posixpath.py
   cs/spike/trunk/Lib/site.py
   cs/spike/trunk/Lib/stat.py
   cs/spike/trunk/Lib/types.py
   cs/spike/trunk/Modules/
   cs/spike/trunk/Modules/_typesmodule.c
   cs/spike/trunk/Modules/config.c
   cs/spike/trunk/Modules/gcmodule.c
   cs/spike/trunk/Modules/getbuildinfo.c
   cs/spike/trunk/Modules/getpath.c
   cs/spike/trunk/Modules/main.c
   cs/spike/trunk/Modules/posixmodule.c
   cs/spike/trunk/Modules/python.c
   cs/spike/trunk/Modules/signalmodule.c
   cs/spike/trunk/Objects/
   cs/spike/trunk/Parser/
   cs/spike/trunk/Python/
   cs/spike/trunk/pyconfig.h
Modified:
   cs/spike/trunk/Makefile.am
   cs/spike/trunk/Python/ast.c
   cs/spike/trunk/configure.ac
Log:
Incorporated a minimal subset of Python.


Copied: cs/spike/trunk/Include (from rev 7045, vendor/Python/v2.5.1/Include)

Copied: cs/spike/trunk/Lib/copy_reg.py (from rev 7045, vendor/Python/v2.5.1/Lib/copy_reg.py)

Copied: cs/spike/trunk/Lib/os.py (from rev 7045, vendor/Python/v2.5.1/Lib/os.py)

Copied: cs/spike/trunk/Lib/posixfile.py (from rev 7045, vendor/Python/v2.5.1/Lib/posixfile.py)

Copied: cs/spike/trunk/Lib/posixpath.py (from rev 7045, vendor/Python/v2.5.1/Lib/posixpath.py)

Copied: cs/spike/trunk/Lib/site.py (from rev 7045, vendor/Python/v2.5.1/Lib/site.py)

Copied: cs/spike/trunk/Lib/stat.py (from rev 7045, vendor/Python/v2.5.1/Lib/stat.py)

Copied: cs/spike/trunk/Lib/types.py (from rev 7045, vendor/Python/v2.5.1/Lib/types.py)

Modified: cs/spike/trunk/Makefile.am
===================================================================
--- cs/spike/trunk/Makefile.am	2007-06-02 00:25:39 UTC (rev 7045)
+++ cs/spike/trunk/Makefile.am	2007-06-02 01:12:38 UTC (rev 7046)
@@ -3,14 +3,17 @@
 ACLOCAL_AMFLAGS = -I ./m4
 SUBDIRS = elsa
 
-bin_PROGRAMS = cspk mkpyxm
+bin_PROGRAMS = mkpyxm cspk spike
 
 INCLUDES =
+AM_CPPFLAGS =
+EXTRA_DIST =
+CLEANFILES =
 
 
 # ~~~ mkpyxm ~~~
 
-INCLUDES += -Ielsa/elsa -Ielsa/elkhound -Ielsa/ast -Ielsa/smbase
+mkpyxm_CPPFLAGS = -Ielsa/elsa -Ielsa/elkhound -Ielsa/ast -Ielsa/smbase
 mkpyxm_SOURCES = mkpyxm.cc
 mkpyxm_LDADD = \
 	elsa/elsa/libelsa.a \
@@ -19,7 +22,7 @@
 	elsa/smbase/libsmbase.a
 
 
-# ~~~ spike ~~~
+# ~~~ cspk ~~~
 
 AM_YFLAGS = -dv
 
@@ -29,15 +32,274 @@
 	scan.l \
 	$(empty)
 
-EXTRA_DIST = \
+EXTRA_DIST += \
 	gram.h \
 	$(empty)
 
-CLEANFILES = \
+CLEANFILES += \
 	scan.c \
 	gram.c \
 	gram.output \
 	$(empty)
 
 
+# ~~~ spike ~~~
+
+spike_CPPFLAGS = \
+	-IInclude \
+	-DPREFIX='"$(prefix)"' \
+	-DEXEC_PREFIX='"$(exec_prefix)"' \
+	-DVERSION='"$(VERSION)"' \
+	$(empty)
+
+spike_SOURCES = \
+	Include/Python-ast.h \
+	Include/Python.h \
+	Include/abstract.h \
+	Include/asdl.h \
+	Include/ast.h \
+	Include/bitset.h \
+	Include/boolobject.h \
+	Include/bufferobject.h \
+	Include/cStringIO.h \
+	Include/cellobject.h \
+	Include/ceval.h \
+	Include/classobject.h \
+	Include/cobject.h \
+	Include/code.h \
+	Include/codecs.h \
+	Include/compile.h \
+	Include/complexobject.h \
+	Include/datetime.h \
+	Include/descrobject.h \
+	Include/dictobject.h \
+	Include/enumobject.h \
+	Include/errcode.h \
+	Include/eval.h \
+	Include/fileobject.h \
+	Include/floatobject.h \
+	Include/frameobject.h \
+	Include/funcobject.h \
+	Include/genobject.h \
+	Include/graminit.h \
+	Include/grammar.h \
+	Include/import.h \
+	Include/intobject.h \
+	Include/intrcheck.h \
+	Include/iterobject.h \
+	Include/listobject.h \
+	Include/longintrepr.h \
+	Include/longobject.h \
+	Include/marshal.h \
+	Include/metagrammar.h \
+	Include/methodobject.h \
+	Include/modsupport.h \
+	Include/moduleobject.h \
+	Include/node.h \
+	Include/object.h \
+	Include/objimpl.h \
+	Include/opcode.h \
+	Include/osdefs.h \
+	Include/parsetok.h \
+	Include/patchlevel.h \
+	Include/pgen.h \
+	Include/pgenheaders.h \
+	Include/py_curses.h \
+	Include/pyarena.h \
+	Include/pydebug.h \
+	Include/pyerrors.h \
+	Include/pyexpat.h \
+	Include/pyfpe.h \
+	Include/pygetopt.h \
+	Include/pymactoolbox.h \
+	Include/pymem.h \
+	Include/pyport.h \
+	Include/pystate.h \
+	Include/pystrtod.h \
+	Include/pythonrun.h \
+	Include/pythread.h \
+	Include/rangeobject.h \
+	Include/setobject.h \
+	Include/sliceobject.h \
+	Include/stringobject.h \
+	Include/structmember.h \
+	Include/structseq.h \
+	Include/symtable.h \
+	Include/sysmodule.h \
+	Include/timefuncs.h \
+	Include/token.h \
+	Include/traceback.h \
+	Include/tupleobject.h \
+	Include/ucnhash.h \
+	Include/unicodeobject.h \
+	Include/weakrefobject.h \
+	Modules/_typesmodule.c \
+	Modules/config.c \
+	Modules/gcmodule.c \
+	Modules/getbuildinfo.c \
+	Modules/getpath.c \
+	Modules/main.c \
+	Modules/posixmodule.c \
+	Modules/python.c \
+	Modules/signalmodule.c \
+	Objects/abstract.c \
+	Objects/boolobject.c \
+	Objects/bufferobject.c \
+	Objects/cellobject.c \
+	Objects/classobject.c \
+	Objects/cobject.c \
+	Objects/codeobject.c \
+	Objects/complexobject.c \
+	Objects/descrobject.c \
+	Objects/dictobject.c \
+	Objects/enumobject.c \
+	Objects/exceptions.c \
+	Objects/fileobject.c \
+	Objects/floatobject.c \
+	Objects/frameobject.c \
+	Objects/funcobject.c \
+	Objects/genobject.c \
+	Objects/intobject.c \
+	Objects/iterobject.c \
+	Objects/listobject.c \
+	Objects/longobject.c \
+	Objects/methodobject.c \
+	Objects/moduleobject.c \
+	Objects/object.c \
+	Objects/obmalloc.c \
+	Objects/rangeobject.c \
+	Objects/setobject.c \
+	Objects/sliceobject.c \
+	Objects/stringlib/count.h \
+	Objects/stringlib/fastsearch.h \
+	Objects/stringlib/find.h \
+	Objects/stringlib/partition.h \
+	Objects/stringobject.c \
+	Objects/structseq.c \
+	Objects/tupleobject.c \
+	Objects/typeobject.c \
+	Objects/weakrefobject.c \
+	Parser/acceler.c \
+	Parser/bitset.c \
+	Parser/firstsets.c \
+	Parser/grammar.c \
+	Parser/grammar1.c \
+	Parser/listnode.c \
+	Parser/metagrammar.c \
+	Parser/myreadline.c \
+	Parser/node.c \
+	Parser/parser.c \
+	Parser/parser.h \
+	Parser/parsetok.c \
+	Parser/pgen.c \
+	Parser/printgrammar.c \
+	Parser/tokenizer.c \
+	Parser/tokenizer.h \
+	Python/Python-ast.c \
+	Python/asdl.c \
+	Python/ast.c \
+	Python/atof.c \
+	Python/bltinmodule.c \
+	Python/ceval.c \
+	Python/codecs.c \
+	Python/compile.c \
+	Python/dup2.c \
+	Python/dynload_shlib.c \
+	Python/errors.c \
+	Python/fmod.c \
+	Python/frozen.c \
+	Python/frozenmain.c \
+	Python/future.c \
+	Python/getargs.c \
+	Python/getcompiler.c \
+	Python/getcopyright.c \
+	Python/getcwd.c \
+	Python/getmtime.c \
+	Python/getopt.c \
+	Python/getplatform.c \
+	Python/getversion.c \
+	Python/graminit.c \
+	Python/hypot.c \
+	Python/import.c \
+	Python/importdl.c \
+	Python/importdl.h \
+	Python/marshal.c \
+	Python/memmove.c \
+	Python/modsupport.c \
+	Python/mysnprintf.c \
+	Python/mystrtoul.c \
+	Python/pyarena.c \
+	Python/pyfpe.c \
+	Python/pystate.c \
+	Python/pystrtod.c \
+	Python/pythonrun.c \
+	Python/strtod.c \
+	Python/structmember.c \
+	Python/symtable.c \
+	Python/sysmodule.c \
+	Python/traceback.c \
+	$(empty)
+
+#PYTHON = spike
+#pylibdir = $(pkglibdir)-$(VERSION)
+pylibdir = $(libdir)/python$(VERSION)
+libdynloaddir = $(libdir)/python$(VERSION)/lib-dynload
+#pylib_PYTHON =
+pylib_DATA = \
+	Lib/copy_reg.py \
+	Lib/os.py \
+	Lib/posixfile.py \
+	Lib/posixpath.py \
+	Lib/site.py \
+	Lib/stat.py \
+	Lib/types.py \
+	$(empty)
+libdynload_DATA =
+
+later = \
+	Objects/unicodectype.c \
+	Objects/unicodeobject.c \
+	Objects/unicodetype_db.h \
+	Python/dynload_aix.c \
+	Python/dynload_atheos.c \
+	Python/dynload_beos.c \
+	Python/dynload_dl.c \
+	Python/dynload_hpux.c \
+	Python/dynload_next.c \
+	Python/dynload_os2.c \
+	Python/dynload_stub.c \
+	Python/dynload_win.c \
+	Python/mactoolboxglue.c \
+	Python/strdup.c \
+	Python/strerror.c \
+	Python/thread.c \
+	Python/thread_atheos.h \
+	Python/thread_beos.h \
+	Python/thread_cthread.h \
+	Python/thread_foobar.h \
+	Python/thread_lwp.h \
+	Python/thread_nt.h \
+	Python/thread_os2.h \
+	Python/thread_pth.h \
+	Python/thread_pthread.h \
+	Python/thread_sgi.h \
+	Python/thread_solaris.h \
+	Python/thread_wince.h \
+	$(empty)
+
+EXTRA_DIST += \
+	Objects/dictnotes.txt \
+	Objects/listsort.txt \
+	Objects/stringlib/README.txt \
+	Parser/Python.asdl \
+	Parser/asdl.py \
+	Parser/asdl_c.py \
+	Parser/grammar.mak \
+	Parser/intrcheck.c \
+	Parser/pgenmain.c \
+	Parser/spark.py \
+	Parser/tokenizer_pgen.c \
+	Python/sigcheck.c \
+	$(empty)
+
 ## end of Makefile.am

Copied: cs/spike/trunk/Modules/_typesmodule.c (from rev 7045, vendor/Python/v2.5.1/Modules/_typesmodule.c)

Copied: cs/spike/trunk/Modules/config.c (from rev 7045, vendor/Python/v2.5.1/Modules/config.c.in)
===================================================================
--- vendor/Python/v2.5.1/Modules/config.c.in	2007-06-02 00:25:39 UTC (rev 7045)
+++ cs/spike/trunk/Modules/config.c	2007-06-02 01:12:38 UTC (rev 7046)
@@ -0,0 +1,99 @@
+/* Generated automatically from ./Modules/config.c.in by makesetup. */
+/* -*- C -*- ***********************************************
+Copyright (c) 2000, BeOpen.com.
+Copyright (c) 1995-2000, Corporation for National Research Initiatives.
+Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
+All rights reserved.
+
+See the file "Misc/COPYRIGHT" for information on usage and
+redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+******************************************************************/
+
+/* Module configuration */
+
+/* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */
+
+/* This file contains the table of built-in modules.
+   See init_builtin() in import.c. */
+
+#include "Python.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    
+#if 0
+extern void initthread(void);
+extern void initsignal(void);
+extern void initposix(void);
+extern void initerrno(void);
+extern void initpwd(void);
+extern void init_sre(void);
+extern void init_codecs(void);
+extern void initzipimport(void);
+extern void init_symtable(void);
+extern void initxxsubtype(void);
+#else
+extern void initsignal(void);
+extern void initposix(void);
+#endif
+
+/* -- ADDMODULE MARKER 1 -- */
+
+extern void PyMarshal_Init(void);
+extern void initimp(void);
+extern void initgc(void);
+extern void init_ast(void);
+extern void init_types(void);
+
+struct _inittab _PyImport_Inittab[] = {
+    
+#if 0
+	{"thread", initthread},
+	{"signal", initsignal},
+	{"posix", initposix},
+	{"errno", initerrno},
+	{"pwd", initpwd},
+	{"_sre", init_sre},
+	{"_codecs", init_codecs},
+	{"zipimport", initzipimport},
+	{"_symtable", init_symtable},
+	{"xxsubtype", initxxsubtype},
+#else
+	{"signal", initsignal},
+	{"posix", initposix},
+#endif
+
+/* -- ADDMODULE MARKER 2 -- */
+
+	/* This module lives in marshal.c */
+	{"marshal", PyMarshal_Init},
+
+	/* This lives in import.c */
+	{"imp", initimp},
+
+	/* This lives in Python/Python-ast.c */
+	{"_ast", init_ast},
+
+	/* This lives in Python/_types.c */
+	{"_types", init_types},
+
+	/* These entries are here for sys.builtin_module_names */
+	{"__main__", NULL},
+	{"__builtin__", NULL},
+	{"sys", NULL},
+	{"exceptions", NULL},
+
+	/* This lives in gcmodule.c */
+	{"gc", initgc},
+
+	/* Sentinel */
+	{0, 0}
+};
+
+
+#ifdef __cplusplus
+}
+#endif
+

Copied: cs/spike/trunk/Modules/gcmodule.c (from rev 7045, vendor/Python/v2.5.1/Modules/gcmodule.c)

Copied: cs/spike/trunk/Modules/getbuildinfo.c (from rev 7045, vendor/Python/v2.5.1/Modules/getbuildinfo.c)

Copied: cs/spike/trunk/Modules/getpath.c (from rev 7045, vendor/Python/v2.5.1/Modules/getpath.c)

Copied: cs/spike/trunk/Modules/main.c (from rev 7045, vendor/Python/v2.5.1/Modules/main.c)

Copied: cs/spike/trunk/Modules/posixmodule.c (from rev 7045, vendor/Python/v2.5.1/Modules/posixmodule.c)

Copied: cs/spike/trunk/Modules/python.c (from rev 7045, vendor/Python/v2.5.1/Modules/python.c)

Copied: cs/spike/trunk/Modules/signalmodule.c (from rev 7045, vendor/Python/v2.5.1/Modules/signalmodule.c)

Copied: cs/spike/trunk/Objects (from rev 7045, vendor/Python/v2.5.1/Objects)

Copied: cs/spike/trunk/Parser (from rev 7045, vendor/Python/v2.5.1/Parser)

Copied: cs/spike/trunk/Python (from rev 7045, vendor/Python/v2.5.1/Python)

Modified: cs/spike/trunk/Python/ast.c
===================================================================
--- vendor/Python/v2.5.1/Python/ast.c	2007-06-02 00:25:39 UTC (rev 7045)
+++ cs/spike/trunk/Python/ast.c	2007-06-02 01:12:38 UTC (rev 7046)
@@ -3110,6 +3110,7 @@
 #endif
 }
 
+#ifdef Py_USING_UNICODE
 static PyObject *
 decode_unicode(const char *s, size_t len, int rawmode, const char *encoding)
 {
@@ -3171,6 +3172,7 @@
 	Py_XDECREF(u);
 	return v;
 }
+#endif
 
 /* s is a Python string literal, including the bracketing quote characters,
  * and r &/or u prefixes (if any), and embedded escape sequences (if any).

Modified: cs/spike/trunk/configure.ac
===================================================================
--- cs/spike/trunk/configure.ac	2007-06-02 00:25:39 UTC (rev 7045)
+++ cs/spike/trunk/configure.ac	2007-06-02 01:12:38 UTC (rev 7046)
@@ -3,27 +3,121 @@
 dnl
 
 AC_PREREQ(2.59)
-AC_INIT([spike], [0.1.0], [cig-cs at geodynamics.org])
+AC_INIT([spike], [0.1], [cig-cs at geodynamics.org])
 AC_CONFIG_SRCDIR([cspk.cc])
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([foreign])
 
-# 'configure' options
 
+#
 # Checks for programs.
+#
+
 AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_LEX
 AC_PROG_YACC
 dnl AC_PROG_LIBTOOL
 
+
+#
 # Checks for header files.
+#
 
+AC_HEADER_STDC
+AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
+fcntl.h grp.h \
+io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
+shadow.h signal.h stdint.h stropts.h termios.h thread.h \
+unistd.h utime.h \
+sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \
+sys/modem.h \
+sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
+sys/time.h \
+sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
+sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
+bluetooth/bluetooth.h)
+AC_HEADER_DIRENT
+AC_HEADER_MAJOR
+
+# On Solaris, term.h requires curses.h
+AC_CHECK_HEADERS(term.h,,,[
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+])
+
+# On Linux, netlink.h requires asm/types.h
+AC_CHECK_HEADERS(linux/netlink.h,,,[
+#ifdef HAVE_ASM_TYPES_H
+#include <asm/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+])
+
+
+#
 # Checks for typedefs, structures, and compiler characteristics.
+#
 
+# Sizes of various common basic types
+# ANSI C requires sizeof(char) == 1, so no need to check it
+AC_CHECK_SIZEOF(int, 4)
+AC_CHECK_SIZEOF(long, 4)
+AC_CHECK_SIZEOF(void *, 4)
+AC_CHECK_SIZEOF(short, 2)
+AC_CHECK_SIZEOF(float, 4)
+AC_CHECK_SIZEOF(double, 8)
+AC_CHECK_SIZEOF(fpos_t, 4)
+AC_CHECK_SIZEOF(size_t, 4)
+
+AC_MSG_CHECKING(for long long support)
+have_long_long=no
+AC_TRY_COMPILE([], [long long x; x = (long long)0;], [
+  AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.]) 
+  have_long_long=yes
+])
+AC_MSG_RESULT($have_long_long)
+if test "$have_long_long" = yes ; then
+AC_CHECK_SIZEOF(long long, 8)
+fi
+
+works=no
+AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
+AC_TRY_COMPILE([
+#include <stdarg.h>
+int foo(int x, ...) {
+	va_list va;
+	va_start(va, x);
+	va_arg(va, int);
+	va_arg(va, char *);
+	va_arg(va, double);
+	return 0;
+}
+], [return foo(10, "", 3.14);], [
+  AC_DEFINE(HAVE_STDARG_PROTOTYPES, 1,
+   [Define if your compiler supports variable length function prototypes
+   (e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h>]) 
+  works=yes
+])
+AC_MSG_RESULT($works)
+
+
+#
 # Checks for library functions.
+#
+AC_SEARCH_LIBS([sqrt], [m])
+AC_CHECK_LIB(dl, dlopen)	# Dynamic linking for SunOS/Solaris and SYSV
+AC_CHECK_FUNCS(dlopen)
 
+
+#
+# Output
+#
+
 AC_CONFIG_FILES([Makefile
                  elsa/Makefile])
 

Added: cs/spike/trunk/pyconfig.h
===================================================================
--- cs/spike/trunk/pyconfig.h	2007-06-02 00:25:39 UTC (rev 7045)
+++ cs/spike/trunk/pyconfig.h	2007-06-02 01:12:38 UTC (rev 7046)
@@ -0,0 +1,2 @@
+
+#include "config.h"



More information about the cig-commits mailing list