2 dnl Sherman's aquarium 3.0.1 configure script.
3 dnl Written by Jonas Aaberg <cja@gmx.net> 2002-2005
5 dnl run autoconf to generate a configure script from this file.
11 dnl **************************************************************************
12 dnl Change those things between the star lines.
13 dnl ***************************************************************************
15 dnl This is the name of your applet, low level. $(APPLET_NAME).c is the main
17 APPLET_NAME="shermans_applet"
19 dnl The version of your applet
20 APPLET_VERSION="3.0.1"
22 dnl The display name in the gnome 2 menu and for the About box.
23 APPLET_NICE_NAME="Sherman's aquarium"
25 dnl Your name and email for the "Written by " field in the about box
26 APPLET_AUTHOR="Jonas Aaberg, <cja@gmx.net> 2002-2005. Graphics by Jim Toomey."
28 dnl Change the group. (This is just for gnome)
30 dnl "Accessories", "Amusements", "Internet", "Multimedia" and "Utility"
31 APPLET_GROUP="Amusements"
33 dnl The name file of the icon for the menu.
34 APPLET_NAME_ICON="shermans_icon.png"
36 dnl Images to install.
37 APPLET_IMAGES="aquarium/*"
39 dnl A one line description for the gnome menu.
40 APPLET_DESCRIPTION_SHORT="Bringer of life."
42 dnl This is the text displayed in the about box.
43 APPLET_DESCRIPTION="Sherman's aquarium is an applet with the\ncreatures from Jim Toomey's\nwonderful comic, Sherman's Lagoon\n(www.slagoon.com)."
45 dnl This is for the license line in the about box.
46 APPLET_LICENSE="Program released under GNU GPL.\nMost graphics Copyrighted by Jim Toomey and is NOT under GNU GPL."
48 dnl Version of GAI that is required
49 APPLET_REQUIRES_GAI_VERSION="0.5.3"
51 dnl Require XMMS (yes or no or checkfor)
54 dnl ****************************************************************************
57 AC_MSG_CHECKING(whether to try to include Screensaver support)
58 AC_ARG_ENABLE(sdl, [ --disable-sdl Compile Sherman's aquarium without Screensaver support],[
59 if test x$withval = xyes; then
65 if test x$with_sdl = xno; then
73 AC_MSG_CHECKING(whether to try to compile applet support )
74 AC_ARG_ENABLE(gai, [ --disable-gai Compile Sherman's aquarium without applet support],[
75 if test x$withval = xyes; then
81 if test x$with_gai = xno; then
90 AC_SUBST(APPLET_VERSION)
91 AC_SUBST(APPLET_NICE_NAME)
92 AC_SUBST(APPLET_AUTHOR)
93 AC_SUBST(APPLET_GROUP)
94 AC_SUBST(APPLET_NAME_ICON)
95 AC_SUBST(APPLET_IMAGES)
96 AC_SUBST(APPLET_DESCRIPTION_SHORT)
97 AC_SUBST(APPLET_DESCRIPTION)
98 AC_SUBST(APPLET_LICENSE)
102 AC_MSG_CHECKING(operating system)
104 AC_MSG_RESULT($OSTYPE)
107 SYSTEM_SPECIFIC_LIBS=
112 MINOR=`uname -r | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)\(.*\)/\2/'`
113 if test x$MINOR = x4 ; then
114 STATUS="status_linux24.o"
116 STATUS="status_linux26.o"
121 STATUS="status_drawin.o"
125 STATUS="status_freebsd.o"
126 SYSTEM_SPECIFIC_LIBS="-lkvm"
139 AC_SUBST(SYSTEM_SPECIFIC_LIBS)
153 if test x$with_gai = xyes ; then
154 AC_CHECK_PROG(PKGCONF, pkg-config, true, false)
157 AC_MSG_CHECKING(for gai)
158 if `pkg-config --exists gai` ; then
160 GAI_CFLAGS=`pkg-config --cflags gai`
161 GAI_LIBS=`pkg-config --libs gai`
165 GAI is needed for applet support! Please visit http://gai.sf.net)
168 AC_MSG_ERROR("can't find pkg-config!")
172 if test x$FOUND_GAI_LIBS = xyes ; then
174 AC_MSG_CHECKING(for gai version >= $APPLET_REQUIRES_GAI_VERSION)
175 if `pkg-config gai --atleast-version $APPLET_REQUIRES_GAI_VERSION` ; then
179 APPLET=shermans_applet
180 INSTALL_APPLET=install_applet
183 a newer version of GAI is needed! Please visit http://gai.sf.net)
190 if test x$GAI = xyes ; then
191 AC_MSG_CHECKING(if gai is compiled with gnome support)
196 if test `pkg-config gai --variable=gnome` = yes; then
199 AC_MSG_CHECKING([for gnome prefix])
200 with_gnome_prefix=`(pkg-config --variable=prefix libpanelapplet-2.0) 2>/dev/null`
201 if test $? -ne 0; then
202 with_gnome_prefix='${prefix}'
204 AC_MSG_RESULT([$with_gnome_prefix])
206 GNOMEDIR=$with_gnome_prefix
207 INSTALL_GNOME=install-gnome
208 INSTALL_PATH='$(GNOMEDIR)'
210 GNOMESERVER=`echo -n GNOME_$APPLET_NAME;echo -n "Applet.server"`
211 cat >$GNOMESERVER.in << EOF
213 <oaf_server iid="OAFIID:GNOME_@APPLET_NAME@Applet_Factory" type="exe" location="@GNOMEDIR@/bin/@APPLET_NAME@">
214 <oaf_attribute name="repo_ids" type="stringv">
215 <item value="IDL:Bonobo/GenericFactory:1.0"/>
216 <item value="IDL:Bonobo/Unknown:1.0"/>
218 <oaf_attribute name="name" type="string" value="@APPLET_NAME@ applet Factory"/>
219 <oaf_attribute name="description" type="string" value="Factory for @APPLET_NAME@ applet"/>
222 <oaf_server iid="OAFIID:GNOME_@APPLET_NAME@Applet" type="factory" location="OAFIID:GNOME_@APPLET_NAME@Applet_Factory">
223 <oaf_attribute name="repo_ids" type="stringv">
224 <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/>
225 <item value="IDL:Bonobo/Control:1.0"/>
226 <item value="IDL:Bonobo/Unknown:1.0"/>
228 <oaf_attribute name="name" type="string" value="@APPLET_NICE_NAME@"/>
229 <oaf_attribute name="description" type="string" value="@APPLET_DESCRIPTION_SHORT@"/>
230 <oaf_attribute name="panel:category" type="string" value="@APPLET_GROUP@"/>
231 <oaf_attribute name="panel:icon" type="string" value="@APPLET_NAME_ICON@"/>
240 if test x$prefix = xNONE ; then
242 INSTALL_PATH=/usr/local/
260 AC_MSG_CHECKING(if gai knows about the ROX panel)
261 if test `pkg-config gai --variable=rox` = yes; then
265 cat >AppRun.in << EOF
267 # Slightly modified by Jonas Aaberg <cja@gmx.net> to suit GAI applets.
271 APP_DIR=\`dirname "\$0"\`
272 APP_DIR=\`cd "\$APP_DIR";pwd\`; export APP_DIR
274 BIN="\$APP_DIR/\$PROG"
276 exec "\$BIN" --gai-rox "\$@"
279 ROX_APPINFO=AppInfo.xml
281 cat >AppInfo.xml.in << EOF
282 <?xml version="1.0"?>
284 <Summary>@APPLET_DESCRIPTION_SHORT@</Summary>
290 INSTALL_ROX=install-rox
291 ROX_PATH=`pkg-config gai --variable=roxpath`
292 AC_MSG_CHECKING(for ROX path)
293 AC_MSG_RESULT($ROX_PATH)
299 dnl endif gai lib not found
306 if test x$GAI = xno ; then
307 if test x$prefix = xNONE ; then
309 INSTALL_PATH=/usr/local/
321 AC_SUBST(INSTALL_APPLET)
322 AC_SUBST(INSTALL_GNOME)
323 AC_SUBST(INSTALL_PATH)
327 AC_SUBST(INSTALL_ROX)
333 if test x$APPLET_IMAGES = x; then
336 INSTALL_IMAGES=install-images
338 AC_SUBST(INSTALL_IMAGES)
340 dnl Setup image path and icon
341 if test x$GNOME = xyes ; then
342 APPLET_IMAGE_PATH=$GNOMEDIR/share/pixmaps/shermans
343 APPLET_ICON=$GNOMEDIR/share/pixmaps/$APPLET_NAME_ICON
345 if test x$prefix = xNONE ; then
346 APPLET_IMAGE_PATH=/usr/local/share/pixmaps/shermans
347 APPLET_ICON=/usr/local/share/pixmaps/$APPLET_NAME_ICON
349 APPLET_IMAGE_PATH=$prefix/share/pixmaps/shermans
350 APPLET_ICON=$prefix/share/pixmaps/$APPLET_NAME_ICON
354 AC_SUBST(APPLET_IMAGE_PATH)
355 AC_SUBST(APPLET_ICON)
365 if test x$with_sdl = xyes ; then
366 AC_CHECK_PROG(SDLCONF, sdl-config, true, false)
369 sdl_version=`sdl-config --version`
370 AC_MSG_CHECKING([for SDL version ($sdl_version) >= 1.2.0])
371 dnl copied from yawmppp that copied it from gtk+'s aclocal.m4. These guys must love sed
372 SDL_MAJOR=`sdl-config --version | \
373 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
374 SDL_MINOR=`sdl-config --version | \
375 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
376 SDL_MICRO=`sdl-config --version | \
377 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
380 if test $SDL_MAJOR -eq 1 ; then
381 if test $SDL_MINOR -eq 2 ; then
390 if test x$SDL = xyes ; then
391 SDL_CFLAGS=`sdl-config --cflags`
392 SDL_LIBS=`sdl-config --libs`
394 INSTALL_SCREENSAVER=install_screensaver
397 AC_MSG_CHECKING(for gtk+ version >= 2.2.0)
398 if `pkg-config gtk+-2.0 --atleast-version 2.2.0` ; then
400 GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
401 GTK_LIBS=`pkg-config --libs gtk+-2.0`
406 AC_MSG_ERROR(GTK+ v2.2.0 or later is needed for Sherman's aquarium!)
418 AC_SUBST(INSTALL_SCREENSAVER)
422 AC_SUBST(SCREENSAVER)
429 if test x$FOUND_GAI_LIBS = xyes ; then
430 if test x$with_gai = xyes ; then
431 if test x$APPLET_XMMS = xyes ; then
432 AC_CHECK_PROG(XMMS_CONFIG, xmms-config, true, false)
434 if $XMMS_CONFIG ; then
435 XMMS_CFLAGS=`xmms-config --cflags`
436 XMMS_LIBS=`xmms-config --libs`
439 AC_MSG_ERROR("can't find xmms-config! XMMS installed?")
442 if test x$APPLET_XMMS = xcheckfor ; then
443 AC_CHECK_PROG(XMMS_CONFIG, xmms-config, true, false)
445 if $XMMS_CONFIG ; then
446 XMMS_CFLAGS=`xmms-config --cflags`
447 XMMS_LIBS=`xmms-config --libs`
456 AC_SUBST(XMMS_CFLAGS)
460 REMARK="This file is autogenerated by the configure script."
461 REMARK2="So don't add things you want permanent here."
466 AC_OUTPUT($GNOMESERVER $ROX_APPRUN $ROX_APPINFO Makefile config.h shermans/Makefile)
469 echo " Sherman's aquarium v$APPLET_VERSION"
470 echo "==========================="
471 echo " - Compile Sherman's aquarium - dockapp/wmapplet: $GAI"
472 echo " - Compile Sherman's aquarium - Gnome 2 Panel applet: $GNOME"
473 echo " - Compile Sherman's aquarium - Screensaver: $SDL"