summaryrefslogtreecommitdiffstats
path: root/tdeioslave/media/configure.in.in
blob: 413848b649d04e34bab39c21c87b250778f483d7 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
########### Check for linux/cdrom.h

AC_CHECK_HEADER(linux/cdrom.h,
[
  AC_DEFINE_UNQUOTED([COMPILE_LINUXCDPOLLING], 1, [media linux cd polling compilation])
  LINUXCDPOLLING=yes
  AC_SUBST(LINUXCDPOLLING)
])


AC_ARG_WITH(hal,AC_HELP_STRING([--with-hal],[Enable HAL support  [default=check]]),[hal_test="$withval"],[hal_test="yes"])

if test "x$hal_test" = "xyes" ; then

########### Check for the HAL
  AC_MSG_CHECKING(for the HAL)

  hal_inc=NOTFOUND
  hal_lib=NOTFOUND
  hal=NOTFOUND

  search_incs="$kde_includes $kde_extra_includes /usr/include /usr/include/hal /usr/local/include /usr/local/include/hal"
  AC_FIND_FILE(libhal.h libhal-storage.h, $search_incs, hal_incdir)

  if test -r $hal_incdir/libhal.h && test -r $hal_incdir/libhal-storage.h && grep LibHalVolume $hal_incdir/libhal-storage.h > /dev/null 2>&1; then
    HAL_INCS="-I$hal_incdir"
    hal_inc=FOUND
  fi

  search_libs="$kde_libraries $kde_extra_libs /usr/lib$tdelibsuff /usr/local/lib$tdelibsuff"
  AC_FIND_FILE(libhal.so libhal-storage.so, $search_libs, hal_libdir)

  if test -r $hal_libdir/libhal.so && test -r $hal_libdir/libhal-storage.so ; then
    HAL_LIBS="-L$hal_libdir -lhal -lhal-storage"
    hal_lib=FOUND
  fi

  if test "$hal_inc" != FOUND || test "$hal_lib" != FOUND; then 
    KDE_PKG_CHECK_MODULES( HAL, hal > 0.5, [ HAL_INCS=$HAL_CFLAGS; hal_inc=FOUND; hal_lib=FOUND; ] , AC_MSG_RESULT(Nothing found on PKG_CONFIG_PATH) )
  fi

  if test "$hal_inc" = FOUND && test "$hal_lib" = FOUND ; then
      AC_MSG_RESULT(headers $HAL_INCS  libraries $HAL_LIBS)
      hal=FOUND
  else
      AC_MSG_RESULT(searched but not found)
  fi


  AC_SUBST(HAL_INCS)
  AC_SUBST(HAL_LIBS)


########### Check for DBus

  AC_MSG_CHECKING(for DBus)

  dbus_inc=NOTFOUND
  dbus_lib=NOTFOUND
  dbus=NOTFOUND

  search_incs="$kde_includes $kde_extra_includes /usr/include /usr/include/dbus-1.0 /usr/local/include /usr/local/include/dbus-1.0"
  AC_FIND_FILE(dbus/dbus.h, $search_incs, dbus_incdir)

  search_incs_arch_deps="$kde_includes $kde_extra_includes /usr/lib$tdelibsuff/dbus-1.0/include /usr/local/lib$tdelibsuff/dbus-1.0/include"
  AC_FIND_FILE(dbus/dbus-arch-deps.h, $search_incs_arch_deps, dbus_incdir_arch_deps)

  if test -r $dbus_incdir/dbus/dbus.h && test -r $dbus_incdir_arch_deps/dbus/dbus-arch-deps.h ; then
    DBUS_INCS="-I$dbus_incdir -I$dbus_incdir_arch_deps"
    dbus_inc=FOUND
  fi

  search_libs="$kde_libraries $kde_extra_libs /usr/lib$tdelibsuff /usr/local/lib$tdelibsuff"
  AC_FIND_FILE(libdbus-1.so, $search_libs, dbus_libdir)

  if test -r $dbus_libdir/libdbus-1.so ; then
    DBUS_LIBS="-L$dbus_libdir -ldbus-1"
    dbus_lib=FOUND
  fi

  if test $dbus_inc != FOUND || test $dbus_lib != FOUND ; then 
    KDE_PKG_CHECK_MODULES( DBUS, "dbus-1", [ DBUS_INCS=$DBUS_CFLAGS; dbus_inc=FOUND; dbus_lib=FOUND; ] , AC_MSG_RESULT( Nothing found on PKG_CONFIG_PATH ) )
  fi

  dbus_bus_var=`pkg-config --variable=system_bus_default_address dbus-1 2>/dev/null`
  if test -z "$dbus_bus_var"; then
        dbus_bus_var="unix:path=/var/run/dbus/system_bus_socket"
  fi
  AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS, "$dbus_bus_var", [Define the unix domain path for dbus system bus])

  if test $dbus_inc = FOUND && test $dbus_lib = FOUND ; then
    AC_MSG_RESULT(headers $DBUS_INCS libraries $DBUS_LIBS)
    dbus=FOUND
  else
    AC_MSG_RESULT(searched but not found)
  fi

  AC_SUBST(DBUS_INCS)
  AC_SUBST(DBUS_LIBS)

########### Check for DBus-Qt3 bindings

  AC_MSG_CHECKING(for DBus-Qt3 bindings)

  dbusqt_inc=NOTFOUND
  dbusqt_lib=NOTFOUND
  dbusqt=NOTFOUND

  search_incs="$kde_includes $kde_extra_includes /usr/include /usr/include/dbus-1.0 /usr/local/include /usr/local/include/dbus-1.0"
  AC_FIND_FILE(dbus/connection.h, $search_incs, dbusqt_incdir)

  if test -r $dbusqt_incdir/dbus/connection.h ; then
    have_qt_patch=0
    grep dbus_connection_setup_with_qt_main $dbusqt_incdir/dbus/connection.h \
    > /dev/null 2>&1 && have_qt_patch=1
    if test $have_qt_patch = 1 ; then
      DBUSTQT_INCS="-I$dbusqt_incdir"
      dbusqt_inc=FOUND
    fi
  fi

  search_libs="$kde_libraries $kde_extra_libs /usr/lib$tdelibsuff /usr/local/lib$tdelibsuff"
  AC_FIND_FILE(libdbus-qt-1.so, $search_libs, dbusqt_libdir)

  if test -r $dbusqt_libdir/libdbus-qt-1.so ; then
    DBUSTQT_LIBS="-L$dbusqt_libdir -ldbus-qt-1"
    dbusqt_lib=FOUND
  fi

  if test $dbusqt_inc != FOUND  || test $dbusqt_lib != FOUND ; then 

    search_incs="`pkg-config --cflags dbus-1  |sed 's/-I//g'`"
    AC_FIND_FILE(dbus/connection.h, $search_incs, dbusqt_incdir)
    if test -r $dbusqt_incdir/dbus/connection.h ; then
      have_qt_patch=0
      grep dbus_connection_setup_with_qt_main $dbusqt_incdir/dbus/connection.h \
      > /dev/null 2>&1 && have_qt_patch=1
      if test $have_qt_patch = 1 ; then
        DBUSTQT_INCS="-I$dbusqt_incdir"
        dbusqt_inc=FOUND
      fi
    fi

    search_libs="`pkg-config --libs dbus-1 --libs-only-L | sed 's/-L//g'`"
    AC_FIND_FILE(libdbus-qt-1.so, $search_libs, dbusqt_libdir)

    if test -r $dbusqt_libdir/libdbus-qt-1.so ; then
      DBUSTQT_LIBS="-L$dbusqt_libdir -ldbus-qt-1"
      dbusqt_lib=FOUND
    fi

  fi


  if test $dbusqt_inc = FOUND && test $dbusqt_lib = FOUND ; then
    AC_MSG_RESULT(headers $dbusqt_incdir libraries $dbusqt_libdir)
    dbusqt=FOUND
  else
    AC_MSG_RESULT(searched but not found)
  fi

  AC_SUBST(DBUSTQT_INCS)
  AC_SUBST(DBUSTQT_LIBS)
fi

########### Check if media HAL backend sould be compiled

AC_MSG_CHECKING(if the HAL backend for media:/ should be compiled)

HALBACKEND=no
if test "x$hal" = "xFOUND" && test "x$dbus" = "xFOUND" && test "x$dbusqt" = "xFOUND" ; then
  AC_DEFINE_UNQUOTED([COMPILE_HALBACKEND],1, [media HAL backend compilation])
  HALBACKEND=yes
  AC_SUBST(HALBACKEND)
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
fi

AM_CONDITIONAL(include_media_linuxcdpolling, test "$LINUXCDPOLLING" = "yes")
AM_CONDITIONAL(include_media_halbackend, test "$HALBACKEND" = yes)

AC_CHECK_FUNCS(statvfs)