diff options
author | Guido van Rossum <guido@python.org> | 1994-08-23 13:49:15 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1994-08-23 13:49:15 (GMT) |
commit | 0b498beea2fd512ace928a2768c7382ac586a533 (patch) | |
tree | 36acc0cad190434155c27bdddbd5c52882eecc6e /Modules/makesetup | |
parent | 794d81313b5a986ae3063899df6f7c93c99921a7 (diff) | |
download | cpython-0b498beea2fd512ace928a2768c7382ac586a533.zip cpython-0b498beea2fd512ace928a2768c7382ac586a533.tar.gz cpython-0b498beea2fd512ace928a2768c7382ac586a533.tar.bz2 |
* Modules/makesetup: support C++ files now; these should be given
as file.C or file.cc or file.c++; C files can be given as file.c
(instead of file.o, which is still supported)
Diffstat (limited to 'Modules/makesetup')
-rwxr-xr-x | Modules/makesetup | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/Modules/makesetup b/Modules/makesetup index 69159f7..e78ff4f 100755 --- a/Modules/makesetup +++ b/Modules/makesetup @@ -92,14 +92,23 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | OBJS= LIBS= RULES= + LOCALLIBS= + BASELIBS= while read line do # Output DEFS in reverse order so first definition overrides case $line in *=*) DEFS="$line$NL$DEFS"; continue;; - '<noobjects>') noobjects=yes; continue;; + '<noobjects>') + case $noobjects in + yes) ;; + *) LOCALLIBS=$LIBS; LIBS=;; + esac + noobjects=yes; + continue;; esac objs= + srcs= cpps= set $line for arg @@ -109,6 +118,9 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | -[A-Zl]*) LIBS="$LIBS $arg";; *.a) LIBS="$LIBS $arg";; *.o) objs="$objs $arg";; + *.[cC]) srcs="$srcs $arg";; + *.cc) srcs="$srcs $arg";; + *.c++) srcs="$srcs $arg";; *.*) echo 1>&2 "bad word $arg in $line" exit 1;; [a-zA-Z_]*) MODS="$MODS $arg";; @@ -129,8 +141,31 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | RULES="$RULES$obj: $src; \$(CC) \$(CFLAGS) $cpps -c $src$NL" done OBJS="$OBJS $objs" + for src in $srcs + do + case $src in + *.c) obj=`basename $src .c`.o; cc='$(CC)';; + *.cc) obj=`basename $src .cc`.o; cc='$(CCC)';; + *.c++) obj=`basename $src .c++`.o; cc='$(CCC)';; + *.C) obj=`basename $src .C`.o; cc='$(CCC)';; + *) continue;; + esac + case $src in + glmodule.c) ;; + *) src='$(srcdir)/'$src;; + esac + RULES="$RULES$obj: $src; $cc \$(CFLAGS) $cpps -c $src$NL" + done done + case $noobjects in + yes) BASELIBS=$LIBS;; + *) LOCALLIBS=$LIBS;; + esac + LIBS='$(LOCALMODLIBS) $(BASEMODLIBS)' + DEFS="BASEMODLIBS=$BASELIBS$NL$DEFS" + DEFS="LOCALMODLIBS=$LOCALLIBS$NL$DEFS" + EXTDECLS= INITBITS= for mod in $MODS |