Author wdebruij
Recipients wdebruij
Date 2010-02-16.00:44:30
SpamBayes Score 2.06884e-06
Marked as misclassified No
Message-id <1266281072.48.0.268109023834.issue7938@psf.upfronthosting.co.za>
In-reply-to
Content
(this is very low priority: an issue in a nonstandard build)

I am porting Python 2.6.4 to a system with only partial Posix support that requires static linking for all modules. To enable sqlite, I added the line 

_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -DMODULE_NAME='"sqlite3"' -IModules/_sqlite ...

to Modules/Setup, but found that it would not end up in the main binary. Instead of adding it to MODOBJS, makesetup put it in BASEMODLIBS

The problem occurs in Modules/makesetup, line 131, which matches all lines containing "=" and treats them as Make definitions. In this case, it matches the equal sign in the C macro MODULE_NAME. 

The problem goes away when I tighten the check at that line:

-		*=*)	DEFS="$line$NL$DEFS"; continue;;
+		[[:alpha:]]*=*) DEFS="$line$NL$DEFS"; continue;;

(see the attached file for the trivial patch in diff -Nur format)

This patch comes with a big warning: my sh-regex foo is very poor. I wanted to write a test that only accepted ^[:alpha:][^ ]*=*, but that
did not work. The above did, but I cannot oversee all consequences.

cheers,

  Willem
History
Date User Action Args
2010-02-16 00:44:32wdebruijsetrecipients: + wdebruij
2010-02-16 00:44:32wdebruijsetmessageid: <1266281072.48.0.268109023834.issue7938@psf.upfronthosting.co.za>
2010-02-16 00:44:31wdebruijlinkissue7938 messages
2010-02-16 00:44:30wdebruijcreate