How to generate 32-bit binaries on 64 bit system

I have a 64 bit intel linux system that I want to use to generate 32 bit Asterisk (and zaptel) binaries. I’ve tried a number to things - and I think I got the Asterisk piece working by doing the following:

  1. Updating menuselect/makeopts.in with:
  1. Running this from the command line

./configure export ASTCFLAGS="-m32" export ASTLDFLAGS="-m32" make

I was hoping that I wouldn’t have to update any files to do this since I don’t want to be merging my changes back in on every update. Has anybody found a more elegant way to do this?

As for Zaptel, it looks like it will involve updating even more files. Once again, does anybody know if there is a way to build zaptel with no/minimal updates to the make-related files?

Thanks.

Are you sure that you need to manually edit files?

$ ./configure --help

seems to suggest that autoconfig accepts environment variables such as CFLAGS. Latest zaptel also uses autoconfig.

That is similar to one thing I tried, for both Asterisk and Zaptel and neither one worked.

I also tried this (this seems like the ideal method to me)

I can’t recall the exact problems but I’m quite sure that 64 bit binaries were still being generated. The config.log file seemed to indicate the the values were being picked up, but they didn’t have any effect on the compiles and links. I’ll go back and try your suggestion and see what happens.