[racket] Detecting 32/64-bit racket

From: Norman Gray (norman at astro.gla.ac.uk)
Date: Sat Oct 29 09:43:47 EDT 2011

Greetings.

Is there a recommended way to detect whether racket is a 32- or 64-bit executable?

I'm writing a racket extension to wrap a C library <http://purl.org/nxg/dist/racket-librdf>, and in the configure.ac, I want to be able to detect whether racket is a 32- or 64-bit executable, so I know whether to (adjust CFLAGS to) check for a suitably-compiled version of the library being wrapped -- a 32-bit racket needs a 32-bit underlying library, and so on.

I can't find any guidance in the list archive about this.  Things like (system-library-subpath) could be parsed for hints, but that's obviously rather fragile.  Nothing else in "14.7 Environment and Runtime Information" seems to give this information.

I could just press ahead and let the eventual raco link fail, if there's a mismatch, during the build.  But since the default racket download (on OS X) is 32-bit, and most libraries will be build 64-bit by default, there's a reasonable likelihood of a mismatch, and it seems at least polite to let the user know about this at configure time, rather than build time.

Thanks for any pointers.  Best wishes,

Norman


-- 
Norman Gray  :  http://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK




Posted on the users mailing list.