Xanda's Blog !~!

Fix for Spidermonkey Build Issue in Darwin

Oct
15

If any you found the following error msg while compiling Spidermonkey on Darwin / Mac ?

jsobj.c: In function ‘js_ConstructObject’:
jsobj.c:2686: warning: comparison is always true due to limited range of data type
cc -o Darwin_DBG.OBJ/jsopcode.o -c -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN -DX86_LINUX  -DDEBUG -DDEBUG_adnan -DEDITLINE -IDarwin_DBG.OBJ  jsopcode.c
cc -o Darwin_DBG.OBJ/jsparse.o -c -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN -DX86_LINUX  -DDEBUG -DDEBUG_adnan -DEDITLINE -IDarwin_DBG.OBJ  jsparse.c
cc -o Darwin_DBG.OBJ/jsprf.o -c -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN -DX86_LINUX  -DDEBUG -DDEBUG_adnan -DEDITLINE -IDarwin_DBG.OBJ  jsprf.c
jsprf.c: In function ‘BuildArgArray’:
jsprf.c:644: error: incompatible types in assignment
make[1]: *** [Darwin_DBG.OBJ/jsprf.o] Error 1
make: *** [all] Error 2

Personally, i’ll answer yes 🙂

And here is a quick fix for the issue:

1) Open jsprf.c
2) Add the following lines in line 61 (js-1.7.0)

#elif defined(va_copy)
#define VARARGS_ASSIGN(foo, bar) va_copy(foo,bar)

Make sure it is now somehow similar to the following:

#ifdef HAVE_VA_COPY
#define VARARGS_ASSIGN(foo, bar)        VA_COPY(foo,bar)
#elif defined(va_copy)
#define VARARGS_ASSIGN(foo, bar)        va_copy(foo,bar)
#elif defined(HAVE_VA_LIST_AS_ARRAY)
#define VARARGS_ASSIGN(foo, bar)        foo[0] = bar[0]

3) make -f Makefile.ref
4) your spider monkey is ready in Darwin_DBG.OBJ directory 🙂

Credit: http://github.com/janl/couchdbx-core/blob/ff47372552d10df00d74cb7989dfed4a19a6040d/patches/js/patch-jsprf.c

Bug in Pidgin 2.4.1 with Ubuntu (8.04) Patch

May
08

I’ve installed the latest pidgin (currently 2.4.1) using default repo from ubuntu 8.04 and i’ve found a bug. If my Yahoo Messenger buddy invisible and suddenly he/she appear online with status, I’m not be able to see they appear online until he/she change her/his status to available (with no status).

I’ve done several tests and finally come out with this solution: Compile it from source without ubuntu patch.

First, remove your old Pidgin configuration files and update your package list

rm -dfr ~/.purple
sudo apt-get update

Now install build-essential

sudo apt-get install build-essential

Now install the Pidgin’s dependencies

sudo apt-get build-dep pidgin

Ok.. you need to download the original pidgin source code

wget http://heanet.dl.sourceforge.net/sourceforge/pidgin/pidgin-2.4.1.tar.bz2

Extract the file and enter the extracted directory

tar -jxvf pidgin-2.4.1.tar.bz2
cd pidgin-2.4.1

Run configure with –enable-gnutls=yes because it is required for MSN and Google Talk

./configure --prefix=/usr --enable-gnutls=yes

In my case (Intel Pentium Core Duo), I’ve enable CFLAGS options for processor optimization

CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer" ./configure --prefix=/usr --enable-gnutls=yes

You can simply use the command without the CFLAGS above, or if you want to optimize the pidgin to suit your processor, you can refer to Safe_Cflags page (yeah.. I’m a fanatic Gentoo user)

Now, run make and it will start compiling. Owh ya, it gonna takes some time

make

Finally, become root and run make install

sudo make install

Enjoy!~

Ubuntu 8.04 is a mistake!

Credits:
Thanks to Munzir, Adib and Yeh. They are my tester. Hahaha..
Gentoo wiki for the CFLAGS