#!/bin/sh


if [ `getconf LONG_BIT` = "64" ]; then
   echo "ARCH: 64-bit" 

   #compile
   gcc `pkg-config gtk+-x11-2.0 --cflags` -DGTK_NO_CHECK_CASTS -DG_DISABLE_CAST_CHECKS \
   sdesk.c -o sdesk `pkg-config gtk+-x11-2.0 --libs` && strip --strip-all -R .note -R .comment sdesk

else
   echo "ARCH: 32-bit" 

	#compile
	gcc `pkg-config gtk+-x11-2.0 --cflags` -DGTK_NO_CHECK_CASTS -DG_DISABLE_CAST_CHECKS \
	-Os -fmerge-all-constants -mno-accumulate-outgoing-args -march=i486 -mtune=i686 \
	-Wl,-O2,--gc-sections,--as-needed,--sort-common,-s sdesk.c -o sdesk \
	-lgtk-x11-2.0 -lgdk-x11-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0

	strip --strip-all -R .note -R .comment sdesk

fi

#run a test
#./sdesk -b /usr/share/backgrounds/default.jpg \
#	-t /usr/share/mini-icons/mini-dog.xpm "sit test" "geany" "abiword" \
#	-t /usr/share/mini-icons/mini-gnome.xpm "sit test" "hello" "kill_sit"
