Asterisk Make Fails with chan_pjsip

I am trying to recompile my Asterisk with chan_pjsip support. I have installed pjproject-2.3 (and tried from the master branch in Git).

./configure works fine and completes
make menuselect works and shows me that the chan_pjsip and the associated resource modules are available.

When I go to make Asterisk, I get the following error:

[LD] chan_pjsip.o pjsip/dialplan_functions.o -> /usr/bin/ld: /usr/local/lib/libpjsip-ua-x86_64-unknown-linux-gnu.a(sip_inv.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libpjsip-ua-x86_64-unknown-linux-gnu.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[1]: *** [] Error 1 make: *** [channels] Error 2

System Info:
Ubuntu 10.10
Linux servername 2.6.35-32-server #67-Ubuntu SMP Mon Mar 5 21:13:25 UTC 2012 x86_64 GNU/Linux

I have tried compiling Asterisk 13.1.0 and 13.2.0. 13.1.0 is what is currently running and compiles fine without chan_pjsip.

Any idea why this isn’t compiling?

It looks like I have resolved this. I don’t know which step actually made it work, but I uninstalled pjproject and then recompiled/installed pjproject using ./configure -enable-shared. I thought that I had done that the first time, but I may not have.

I also did a make dist-clean on Asterisk in case something was leftover from the previous makes, and I did the entire Asterisk configuration all over again.