From fba715ab6c851e9769480788e218b2992ed992d7 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Sun, 2 Jan 1994 00:26:09 +0000 Subject: Added some files to new module --- Modules/Makefile.pre.in | 92 ++++++++++++++++++++++++++++++++ Modules/Setup.in | 139 ++++++++++++++++++++++++++++++++++++++++++++++++ Modules/makesetup | 71 +++++++++++++++++++++++++ 3 files changed, 302 insertions(+) create mode 100644 Modules/Makefile.pre.in create mode 100644 Modules/Setup.in create mode 100755 Modules/makesetup diff --git a/Modules/Makefile.pre.in b/Modules/Makefile.pre.in new file mode 100644 index 0000000..e8e4a20 --- /dev/null +++ b/Modules/Makefile.pre.in @@ -0,0 +1,92 @@ +# NOTE: Makefile.in.in is converted into Makefile.in by running the +# makesetup script in the current directory. Makefile.in is converted +# into Makefile by the configure script in the toplevel directory. +# Once Makefile exists, it can be brought up to date by running +# "make Makefile". + +# === Variables set by ./makesetup === + +MODOBJS= @MODOBJS@ +MODLIBS= @MODLIBS@ +MODCPPS= @MODCPPS@ + +# === Definitions added by ./makesetup === + +# === Variables set by $(TOP)/configure === + +srcdir= @srcdir@ +VPATH= @srcdir@ + +CC= @CC@ +RANLIB= @RANLIB@ +DEFS= @DEFS@ +LIBS= @LIBS@ + + +# === Variables that are customizable by hand === + +TOP= .. +INCLDIR= $(TOP)/Include +OPT= -g +CFLAGS= $(OPT) -I$(INCLDIR) $(DEFS) + +AR= ar +MKDEP= mkdep +SHELL= /bin/sh + + +# === Fixed definitions === + +OBJS= $(MODOBJS) + +LIB= libModules.a + +MYLIBS= $(LIB) \ + ../Python/libPython.a \ + ../Objects/libObjects.a \ + ../Parser/libParser.a + +SYSLIBS= $(MODLIBS) -lm + + +# === Rules === + +all: $(LIB) $(TOP)/python + +$(LIB): $(OBJS) + $(AR) cr $(LIB) $(OBJS) + $(RANLIB) $(LIB) + +$(TOP)/python: config.o $(MYLIBS) + $(CC) config.o $(MYLIBS) $(LIBS) $(SYSLIBS) -o python + mv python $(TOP)/python + +config.o: Makefile + +clean: + -rm -f *.o python core *~ [@,#]* *.old *.orig *.rej + +clobber: clean + -rm -f *.a tags TAGS + +Makefile: Makefile.in $(TOP)/config.status + CONFIG_FILES=Makefile CONFIG_HEADERS= \ + $(SHELL) $(TOP)/config.status + +config.c Makefile.in: Makefile.in.in config.c.in Setup makesetup + $(SHELL) ./makesetup Setup + +depend: + $(MKDEP) $(CFLAGS) \ + `echo $(OBJS) | tr ' ' '\012' | sed 's/\.o/.c/'` + +.PRECIOUS: Makefile.in Makefile config.c + +glmodule.c: cgen.py cstubs + python cgen.py glmodule.c + +# === Rules added by ./makesetup === + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/Modules/Setup.in b/Modules/Setup.in new file mode 100644 index 0000000..7dd40fd --- /dev/null +++ b/Modules/Setup.in @@ -0,0 +1,139 @@ +# This file is used by the makesetup script to construct Makefile.in +# and config.c, from Makefile.in.in (sic!) and config.c.in, +# respectively. +# +# Each line in this file describes one or more optional modules. +# Comment out lines to suppress modules. +# Lines have the following structure: +# +# ... [ ...] [ ...] [ ...] +# +# is anything ending in .o +# is anything starting with -I, -D, -U or -C +# is anything ending in .a or beginning with -l or -L +# is anything else but should be a valid Python +# identifier (letters, digits, underscores, beginning with non-digit) +# +# Lines can also have the form +# +# = +# +# which defines a Make variable definition inserted into Makefile.in +# +# NOTE: As a standard policy, as many modules as can be supported by a +# platform should be present. The distribution comes with all modules +# enabled that are supported by most platforms and don't require you +# to ftp sources from elsewhere. To make this easier for SGI +# platforms, you can copy Setup.sgi to Setup (or edit Makefile.in.in +# to use Setup.sgi instead of Setup). + + +# Modules that should always be present (non UNIX dependent) + +array arraymodule.o # array objects +math mathmodule.o # math library functions, e.g. sin() +parser parsermodule.o # raw interface to the Python parser +posix posixmodule.o # posix (UNIX) system calls +regex regexmodule.o regexpr.o # Regular expressions, GNU Emacs style +strop stropmodule.o # fast string operations implemented in C +struct structmodule.o # binary structure packing/unpacking +time timemodule.o # time operations and variables + + +# Modules with some UNIX dependencies -- on by default. +# Note that some UNIX versions still don't support all of these +# so you may have to comment them out before the build completes. + +dbm dbmmodule.o # dbm(3) may require -ldbm or similar +fcntl fcntlmodule.o # fcntl(2) and ioctl(2) +nis nismodule.o # Sun yellow pages -- not everywhere +pwd grp pwdmodule.o # pwd(3) and grp(3) +select selectmodule.o # select(2); not on ancient System V +socket socketmodule.o # socket(2); not on ancient System V + + +# Multimedia modules -- off by default +# These represent audio samples or images as strings + +audioop audioopmodule.o # Operations on audio samples +imageop imageopmodule.o # Operations on images +rgbimg rgbimgmodule.o # Read SGI RGB image files (but coded portably) + + +# The stdwin module provides a simple, portable (between X11 and Mac) +# windowing interface. You need to ftp the STDWIN library, e.g. from +# ftp://ftp.cwi.nl/pub/stdwin. The STDWIN variable must point to the +# STDWIN toplevel directory. The ARCH variable must be set to the +# architecture identifier used to build STDWIN. NB if you combine this +# with the gl module on an SGI machine, you should replace "-lX11" with +# "-lX11_s". + +#STDWIN=/ufs/guido/src/stdwin +#ARCH=sgi +#stdwin stdwinmodule.o -I$(STDWIN)/H $(STDWIN)/Build/$(ARCH)/x11/lib/lib.a -lX11 + + +# The md5 module implements the RSA Data Security, Inc. MD5 +# Message-Digest Algorithm, described in RFC 1321. The necessary files +# md5c.c and md5.h are included here. + +md5 md5module.o md5c.o + + +# The mpz module interfaces to the GNU Multiple Precision library. +# You need to ftp the GNU MP library. This was last tested with a +# somewhat modified (to get around bugs) version of GMP 1.2; it will +# likely need some work for more recent versions. The GMP variable +# must point to the GMP source directory. + +#GMP=/ufs/guido/src/gmp +#mpz mpzmodule.o -I$(GMP) $(GMP)/libgmp.a + + +# The rotor module (contributed by Lance Ellinghouse) implements a +# rotor-based encryption algorithm. It is self-contained. + +rotor rotormodule.o + + +# SGI IRIX specific modules -- off by default. +# Switch this on if you have an SGI machine. +# Note that some required libraries and header files aren't always +# installed; you may be better off switching on only 'fm' and 'gl' +# (Font Manager and Graphics Library). + +#al almodule.o -laudio # audio +#cd cdmodule.o -lcdaudio -lds # +#cl clmodule.o -lcl +#fm fmmodule.o -lfm_s -lgl_s +#gl glmodule.o -lgl_s +#imgfile imgfilemodule.o -limage -lgutil -lm +#sgi sgimodule.o +#sv svmodule.o yuvconvert.o -lsvideo -lXext -lX11_s + +# The FORMS library, by Mark Overmars, implements user interface +# components such as dialogs and buttons using SGI's GL and FM +# libraries. You must ftp the FORMS library separately from +# ftp://ftp.cs.ruu.nl/pub/SGI/FORMS. It was tested with FORMS 2.2a. +# The FORMS variable must point to the FORMS subdirectory of the forms +# toplevel directory. + +#FORMS=/ufs/guido/src/forms/FORMS +#fl flmodule.o -I$(FORMS) $(FORMS)/libforms.a + + +# SunOS specific modules -- off by default + +# sunaudiodev sunaudiodevmodule.o + + +# Thread module -- works on SGI IRIX and on SunOS 5.x (SOLARIS) only. +# Note that you must have configured (and built!) Python with the +# --with-thread option passed to the configure script for this to work. + +# thread threadmodule.o + + +# Example -- included for reference only + +# xx xxmodule.o diff --git a/Modules/makesetup b/Modules/makesetup new file mode 100755 index 0000000..b5cc57b --- /dev/null +++ b/Modules/makesetup @@ -0,0 +1,71 @@ +#! /bin/sh + +# This script converts Makefile.in.in and config.c.in into Makefile.in +# and config.c, based on the module definitions found in the file +# Setup. + +NL="\\ +" + +sed -e 's/#.*//' -e '/^[ ]*$/d' ${1-Setup} | +( + DEFS= + MODS= + OBJS= + LIBS= + RULES= + + while read line + do + case $line in + *=*) DEFS="$DEFS$line$NL"; continue;; + esac + objs= + cpps= + set $line + for arg + do + case $arg in + -[IDUC]*) cpps="$cpps $arg";; + -[Ll]*) LIBS="$LIBS $arg";; + *.a) LIBS="$LIBS $arg";; + *.o) objs="$objs $arg";; + *.*) echo 1>&2 "bad word $arg in $line" + exit 1;; + [a-zA-Z_]*) MODS="$MODS $arg";; + *) echo 1>&2 "bad word $arg in $line" + exit 1;; + esac + done + for obj in $objs + do + src=`basename $obj .o`.c + RULES="$RULES$obj: $src; \$(CC) \$(CFLAGS) $cpps -c $src$NL" + done + OBJS="$OBJS $objs" + done + + EXTDECLS= + INITBITS= + for mod in $MODS + do + EXTDECLS="${EXTDECLS}extern void init$mod();$NL" + INITBITS="${INITBITS} {\"$mod\", init$mod},$NL" + done + sed -e " + /MARKER 1/i$NL$EXTDECLS + + /MARKER 2/i$NL$INITBITS + + " config.c.in >config.c + + sed -e " + s%@MODOBJS@%$OBJS% + s%@MODLIBS@%$LIBS% + /Rules added by ..makesetup/a$NL$NL$RULES + + /Definitions added by ..makesetup/a$NL$NL$DEFS + + " Makefile.in.in >Makefile.in + +) -- cgit v0.12