Wednesday, June 23, 2010

apache apxs perl "^M: bad interpreter: No such file or directory"

I am trying to compile or make something and get this stupid error that perl is not there, but i have checked and both perl and apxs file are there and have the right permissions.

Solution:
Your apxs file has come from a windows machine and is in dos format, therefore perl is unable to properly understand the commands you're sending it.

run:
dos2unix apxs

and you should be good to go.

How to compile a 32bit dynamic library on a 64bit linux

You can use -m32 or -m64 flag to tell the gcc compiler to compile in 32 or 64 bit.

Now, the trick is that configure and make will accept this flags, if you insert them in the CC variable like this:

./configure CC="gcc -m32"

or when with make

make CC="gcc -m32"

Hope this saves you some frustration i had gone through trying to compile it by hand.