
# wrapper script to simplify building a statically linked slgtk module

# no debugging, and optimized, to minimize size
export CFLAGS=-O2; export CFLAGS

slgtk=${slgtk:-$HOME/src/modules/slgtk}

# Copy static module loader from SLgtk distro into Gtk distro

PixbufIO=gdk-pixbuf/gdk-pixbuf-io.c
if test -f gtk/gtkwidget.c && test -f $PixbufIO ; then

   grep -c gdk_pixbuf_add_module $PixbufIO >/dev/null 2>&1
   if test $? -eq 1 ; then
	echo "Adding gdk_pixbuf_add_module() to $PixbufIO ..."
	cat $PixbufIO $slgtk/contrib/gdk-pixbuf/loadstatic.c > pbio.c
	mv pbio.c $PixbufIO
   fi

fi

# CFA static build notes:
#
#  Mac:     S-Lang built with -Ddlsym=dlsym_prepend_underscore in [ELF_]CFLAGS
#  Solaris: added -lXext after -lX11 to installed pangox.pc
#  Tru64:   issued gtk-configure with --with-libiconv=gnu when building glib

sh $slgtk/admin/gtk-configure $HOME/install/$ARCH \
   		--enable-static \
		--with-included-loaders \
		--with-included-modules \
		--disable-modules 
