I am trying to set up the PHP pecl memcache extension on my small Mac for my local development atmosphere, and it'll only install the 64 bit version which isn't suitable for 32 bit php from XAMPP.

Fundamental essentials steps I have taken:

cd /tmp/
c-66-31-208-39:/tmp casey$ pecl download memcache-2.2.5
c-66-31-208-39:/tmp casey$ tar xzf memcache-2.2.5.tgz
c-66-31-208-39:/tmp casey$ cd memcache-2.5.5

c-66-31-208-39:memcache-2.2.5 casey$ sudo /Applications/XAMPP/xamppfiles/bin/phpize-5.3.1 MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64'

c-66-31-208-39:memcache-2.2.5 casey$ ./configure --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config-5.3.1

c-66-31-208-39:memcache-2.2.5 casey$ make

c-66-31-208-39:memcache-2.2.5 casey$ sudo make install

In the end of this completes effectively, I run:

c-66-31-208-39:memcache-2.2.5 casey$ file /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/memcache.so 
/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/memcache.so: Mach-O 64-bit bundle x86_64

And it is the 64 bit version? I am no expert on building software from source, can anybody let me know what I am doing improperly?

configure line needs CFLAGS too.

something similar to:

CFLAGS='-arch i386 -arch x86_64' CCFLAGS='-arch i386 -arch x86_64' CXXFLAGS='-arch i386 -arch x86_64' ./configure ...rest of your configure args...

You may want the -O3 and -fno-common in the lines above inside too.