Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fba715a

Browse files
committed
Added some files to new module
1 parent f30adc8 commit fba715a

3 files changed

Lines changed: 302 additions & 0 deletions

File tree

Modules/Makefile.pre.in

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# NOTE: Makefile.in.in is converted into Makefile.in by running the
2+
# makesetup script in the current directory. Makefile.in is converted
3+
# into Makefile by the configure script in the toplevel directory.
4+
# Once Makefile exists, it can be brought up to date by running
5+
# "make Makefile".
6+
7+
# === Variables set by ./makesetup ===
8+
9+
MODOBJS= @MODOBJS@
10+
MODLIBS= @MODLIBS@
11+
MODCPPS= @MODCPPS@
12+
13+
# === Definitions added by ./makesetup ===
14+
15+
# === Variables set by $(TOP)/configure ===
16+
17+
srcdir= @srcdir@
18+
VPATH= @srcdir@
19+
20+
CC= @CC@
21+
RANLIB= @RANLIB@
22+
DEFS= @DEFS@
23+
LIBS= @LIBS@
24+
25+
26+
# === Variables that are customizable by hand ===
27+
28+
TOP= ..
29+
INCLDIR= $(TOP)/Include
30+
OPT= -g
31+
CFLAGS= $(OPT) -I$(INCLDIR) $(DEFS)
32+
33+
AR= ar
34+
MKDEP= mkdep
35+
SHELL= /bin/sh
36+
37+
38+
# === Fixed definitions ===
39+
40+
OBJS= $(MODOBJS)
41+
42+
LIB= libModules.a
43+
44+
MYLIBS= $(LIB) \
45+
../Python/libPython.a \
46+
../Objects/libObjects.a \
47+
../Parser/libParser.a
48+
49+
SYSLIBS= $(MODLIBS) -lm
50+
51+
52+
# === Rules ===
53+
54+
all: $(LIB) $(TOP)/python
55+
56+
$(LIB): $(OBJS)
57+
$(AR) cr $(LIB) $(OBJS)
58+
$(RANLIB) $(LIB)
59+
60+
$(TOP)/python: config.o $(MYLIBS)
61+
$(CC) config.o $(MYLIBS) $(LIBS) $(SYSLIBS) -o python
62+
mv python $(TOP)/python
63+
64+
config.o: Makefile
65+
66+
clean:
67+
-rm -f *.o python core *~ [@,#]* *.old *.orig *.rej
68+
69+
clobber: clean
70+
-rm -f *.a tags TAGS
71+
72+
Makefile: Makefile.in $(TOP)/config.status
73+
CONFIG_FILES=Makefile CONFIG_HEADERS= \
74+
$(SHELL) $(TOP)/config.status
75+
76+
config.c Makefile.in: Makefile.in.in config.c.in Setup makesetup
77+
$(SHELL) ./makesetup Setup
78+
79+
depend:
80+
$(MKDEP) $(CFLAGS) \
81+
`echo $(OBJS) | tr ' ' '\012' | sed 's/\.o/.c/'`
82+
83+
.PRECIOUS: Makefile.in Makefile config.c
84+
85+
glmodule.c: cgen.py cstubs
86+
python cgen.py <cstubs >glmodule.c
87+
88+
# === Rules added by ./makesetup ===
89+
90+
# DO NOT DELETE THIS LINE -- mkdep uses it.
91+
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
92+
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY

Modules/Setup.in

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# This file is used by the makesetup script to construct Makefile.in
2+
# and config.c, from Makefile.in.in (sic!) and config.c.in,
3+
# respectively.
4+
#
5+
# Each line in this file describes one or more optional modules.
6+
# Comment out lines to suppress modules.
7+
# Lines have the following structure:
8+
#
9+
# <module> ... [<objectfile> ...] [<cpparg> ...] [<library> ...]
10+
#
11+
# <objectfile> is anything ending in .o
12+
# <cpparg> is anything starting with -I, -D, -U or -C
13+
# <library> is anything ending in .a or beginning with -l or -L
14+
# <module> is anything else but should be a valid Python
15+
# identifier (letters, digits, underscores, beginning with non-digit)
16+
#
17+
# Lines can also have the form
18+
#
19+
# <name> = <value>
20+
#
21+
# which defines a Make variable definition inserted into Makefile.in
22+
#
23+
# NOTE: As a standard policy, as many modules as can be supported by a
24+
# platform should be present. The distribution comes with all modules
25+
# enabled that are supported by most platforms and don't require you
26+
# to ftp sources from elsewhere. To make this easier for SGI
27+
# platforms, you can copy Setup.sgi to Setup (or edit Makefile.in.in
28+
# to use Setup.sgi instead of Setup).
29+
30+
31+
# Modules that should always be present (non UNIX dependent)
32+
33+
array arraymodule.o # array objects
34+
math mathmodule.o # math library functions, e.g. sin()
35+
parser parsermodule.o # raw interface to the Python parser
36+
posix posixmodule.o # posix (UNIX) system calls
37+
regex regexmodule.o regexpr.o # Regular expressions, GNU Emacs style
38+
strop stropmodule.o # fast string operations implemented in C
39+
struct structmodule.o # binary structure packing/unpacking
40+
time timemodule.o # time operations and variables
41+
42+
43+
# Modules with some UNIX dependencies -- on by default.
44+
# Note that some UNIX versions still don't support all of these
45+
# so you may have to comment them out before the build completes.
46+
47+
dbm dbmmodule.o # dbm(3) may require -ldbm or similar
48+
fcntl fcntlmodule.o # fcntl(2) and ioctl(2)
49+
nis nismodule.o # Sun yellow pages -- not everywhere
50+
pwd grp pwdmodule.o # pwd(3) and grp(3)
51+
select selectmodule.o # select(2); not on ancient System V
52+
socket socketmodule.o # socket(2); not on ancient System V
53+
54+
55+
# Multimedia modules -- off by default
56+
# These represent audio samples or images as strings
57+
58+
audioop audioopmodule.o # Operations on audio samples
59+
imageop imageopmodule.o # Operations on images
60+
rgbimg rgbimgmodule.o # Read SGI RGB image files (but coded portably)
61+
62+
63+
# The stdwin module provides a simple, portable (between X11 and Mac)
64+
# windowing interface. You need to ftp the STDWIN library, e.g. from
65+
# ftp://ftp.cwi.nl/pub/stdwin. The STDWIN variable must point to the
66+
# STDWIN toplevel directory. The ARCH variable must be set to the
67+
# architecture identifier used to build STDWIN. NB if you combine this
68+
# with the gl module on an SGI machine, you should replace "-lX11" with
69+
# "-lX11_s".
70+
71+
#STDWIN=/ufs/guido/src/stdwin
72+
#ARCH=sgi
73+
#stdwin stdwinmodule.o -I$(STDWIN)/H $(STDWIN)/Build/$(ARCH)/x11/lib/lib.a -lX11
74+
75+
76+
# The md5 module implements the RSA Data Security, Inc. MD5
77+
# Message-Digest Algorithm, described in RFC 1321. The necessary files
78+
# md5c.c and md5.h are included here.
79+
80+
md5 md5module.o md5c.o
81+
82+
83+
# The mpz module interfaces to the GNU Multiple Precision library.
84+
# You need to ftp the GNU MP library. This was last tested with a
85+
# somewhat modified (to get around bugs) version of GMP 1.2; it will
86+
# likely need some work for more recent versions. The GMP variable
87+
# must point to the GMP source directory.
88+
89+
#GMP=/ufs/guido/src/gmp
90+
#mpz mpzmodule.o -I$(GMP) $(GMP)/libgmp.a
91+
92+
93+
# The rotor module (contributed by Lance Ellinghouse) implements a
94+
# rotor-based encryption algorithm. It is self-contained.
95+
96+
rotor rotormodule.o
97+
98+
99+
# SGI IRIX specific modules -- off by default.
100+
# Switch this on if you have an SGI machine.
101+
# Note that some required libraries and header files aren't always
102+
# installed; you may be better off switching on only 'fm' and 'gl'
103+
# (Font Manager and Graphics Library).
104+
105+
#al almodule.o -laudio # audio
106+
#cd cdmodule.o -lcdaudio -lds #
107+
#cl clmodule.o -lcl
108+
#fm fmmodule.o -lfm_s -lgl_s
109+
#gl glmodule.o -lgl_s
110+
#imgfile imgfilemodule.o -limage -lgutil -lm
111+
#sgi sgimodule.o
112+
#sv svmodule.o yuvconvert.o -lsvideo -lXext -lX11_s
113+
114+
# The FORMS library, by Mark Overmars, implements user interface
115+
# components such as dialogs and buttons using SGI's GL and FM
116+
# libraries. You must ftp the FORMS library separately from
117+
# ftp://ftp.cs.ruu.nl/pub/SGI/FORMS. It was tested with FORMS 2.2a.
118+
# The FORMS variable must point to the FORMS subdirectory of the forms
119+
# toplevel directory.
120+
121+
#FORMS=/ufs/guido/src/forms/FORMS
122+
#fl flmodule.o -I$(FORMS) $(FORMS)/libforms.a
123+
124+
125+
# SunOS specific modules -- off by default
126+
127+
# sunaudiodev sunaudiodevmodule.o
128+
129+
130+
# Thread module -- works on SGI IRIX and on SunOS 5.x (SOLARIS) only.
131+
# Note that you must have configured (and built!) Python with the
132+
# --with-thread option passed to the configure script for this to work.
133+
134+
# thread threadmodule.o
135+
136+
137+
# Example -- included for reference only
138+
139+
# xx xxmodule.o

Modules/makesetup

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#! /bin/sh
2+
3+
# This script converts Makefile.in.in and config.c.in into Makefile.in
4+
# and config.c, based on the module definitions found in the file
5+
# Setup.
6+
7+
NL="\\
8+
"
9+
10+
sed -e 's/#.*//' -e '/^[ ]*$/d' ${1-Setup} |
11+
(
12+
DEFS=
13+
MODS=
14+
OBJS=
15+
LIBS=
16+
RULES=
17+
18+
while read line
19+
do
20+
case $line in
21+
*=*) DEFS="$DEFS$line$NL"; continue;;
22+
esac
23+
objs=
24+
cpps=
25+
set $line
26+
for arg
27+
do
28+
case $arg in
29+
-[IDUC]*) cpps="$cpps $arg";;
30+
-[Ll]*) LIBS="$LIBS $arg";;
31+
*.a) LIBS="$LIBS $arg";;
32+
*.o) objs="$objs $arg";;
33+
*.*) echo 1>&2 "bad word $arg in $line"
34+
exit 1;;
35+
[a-zA-Z_]*) MODS="$MODS $arg";;
36+
*) echo 1>&2 "bad word $arg in $line"
37+
exit 1;;
38+
esac
39+
done
40+
for obj in $objs
41+
do
42+
src=`basename $obj .o`.c
43+
RULES="$RULES$obj: $src; \$(CC) \$(CFLAGS) $cpps -c $src$NL"
44+
done
45+
OBJS="$OBJS $objs"
46+
done
47+
48+
EXTDECLS=
49+
INITBITS=
50+
for mod in $MODS
51+
do
52+
EXTDECLS="${EXTDECLS}extern void init$mod();$NL"
53+
INITBITS="${INITBITS} {\"$mod\", init$mod},$NL"
54+
done
55+
sed -e "
56+
/MARKER 1/i$NL$EXTDECLS
57+
58+
/MARKER 2/i$NL$INITBITS
59+
60+
" config.c.in >config.c
61+
62+
sed -e "
63+
s%@MODOBJS@%$OBJS%
64+
s%@MODLIBS@%$LIBS%
65+
/Rules added by ..makesetup/a$NL$NL$RULES
66+
67+
/Definitions added by ..makesetup/a$NL$NL$DEFS
68+
69+
" Makefile.in.in >Makefile.in
70+
71+
)

0 commit comments

Comments
 (0)