From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 12 Jul 2000 14:16:20 -0700 From: Randolph Fritz To: 9fans@cse.psu.edu Subject: [9fans] Silly porting fun Message-ID: <20000712141620.A1017@cyber-dyne.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Topicbox-Message-UUID: d9067fde-eac8-11e9-9e20-41e7f4b1d025 So...having cut and ground my teeth on some basics of Plan 9, and being temporarily unable to download Kenji Arisawa's port of Python, I decided to try building Python in the APE. The GNU configure script provided with Python wouldn't work. (I am now downloading Arisawa's port.) Upon study, I found the source of the difficulty, and I would be interested in a solution for it, since many widely-available programs depend on such scripts. A GNU "configure" script is a shell script which tests the local system for various features. It does this, in part, by compiling many small test programs. Often the point of the test programs is a check for the presence of an include file or symbol, and the main program is trivial. And therein lies the problem. The typical minimal main program from a GNU configure script is: main() { return(0); } The compiler, reasonably enough, decides that this routine never does anything and is never called, and optimizes it out of existence! The linker then cannot find main(), and fails. Is there an option switch (preferably) or #pragma I can give to alter this behavior? Failing that, would adding "USED(main);" to the program do the trick? -- Randolph Fritz Eugene, Oregon, USA