summaryrefslogtreecommitdiffstats
path: root/kscreensaver/kxsconfig/configure.in.in
blob: 26072e43165ba2d9dafe564bbe196c061606c177 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
AC_DEFUN([KDE_CHECK_XSREENSAVER],
[
     XSCREENSAVER_CONFIG=NO
     AC_FIND_FILE($1/flame.xml, [ $xscreensaver_prefixes ], XSCREENSAVER_CONFIG)
     if test "$XSCREENSAVER_CONFIG" != NO; then
	XSCREENSAVER_CONFIG="$XSCREENSAVER_CONFIG/$1"
     fi
])


xscreensaver_prefixes="$exec_prefix $prefix /usr /usr/local /opt/local /usr/X11R6 /usr/X11R6 /opt/kde /opt/trinity /usr/kde /usr/local/kde /usr/local/xscreensaver /usr/openwin/lib/xscreensaver /etc"

old_IFS=$IFS
IFS=:
for path in $PATH; do 
   case $path in
      */bin)
	path=`echo $path | sed -e 's,/bin$,,'`
	xscreensaver_prefixes="$path $xscreensaver_prefixes"
        ;;
   esac
done
IFS=$old_IFS

AC_ARG_WITH(xscreensaver,
  [AC_HELP_STRING(--with-xscreensaver,
    [enable support for xscreensaver @<:@default=check@:>@])],
  [], with_xscreensaver=check)

XSCREENSAVER=''
echo "Searching in $xscreensaver_prefixes"
if test "x$with_xscreensaver" != xno; then
  for xsdir in lib$kdelibsuff/xscreensaver lib/xscreensaver \
               lib$kdelibsuff/misc/xscreensaver lib/misc/xscreensaver \
               libexec$kdelibsuff/xscreensaver libexec/xscreensaver \
               bin/xscreensaver-hacks hacks; do
    test -n "$XSCREENSAVER" && break
    KDE_FIND_PATH("$xsdir/flame", XSCREENSAVER, [ $xscreensaver_prefixes ])
  done

  if test "x$with_xscreensaver" != xcheck && test "x$XSCREENSAVER" = x; then
    AC_MSG_ERROR([--with-xscreensaver was given, but test for xscreensaver failed])
  fi
fi

XSCREENSAVER_HACKS_DIR=

if test -n "$XSCREENSAVER"; then
     XSCREENSAVER_HACKS_DIR=`echo $XSCREENSAVER | sed -e 's,/flame$,,'`
     AC_DEFINE_UNQUOTED(XSCREENSAVER_HACKS_DIR, "$XSCREENSAVER_HACKS_DIR", [Defines where xscreensaver stores its graphic hacks])

     AC_MSG_CHECKING([for flame.xml])
     for subdir in lib/xscreensaver/config \
		   lib/X11/xscreensaver/config \
		   share/control-center/screensavers \
		   share/xscreensaver/config \
                   xscreensaver \
		   config/control-center-2.0; do
         KDE_CHECK_XSREENSAVER($subdir)
         if test "$XSCREENSAVER_CONFIG" != NO; then
		break
         fi
     done
     AC_MSG_RESULT([$XSCREENSAVER_CONFIG])
     AC_DEFINE_UNQUOTED(XSCREENSAVER_CONFIG_DIR, "$XSCREENSAVER_CONFIG", 
	[Defines where xscreensaver stores it's config files])
fi

AM_CONDITIONAL(include_XSCREENSAVER, test -n "$XSCREENSAVER")
AC_SUBST(XSCREENSAVER_HACKS_DIR)