Fixed DevStudio 2003 build with memory check code.
[pwlib.git] / plugins / configure.in
blob8e72ca7c6560b1dd4f6bcfd490a73992c0c65c57
1 AC_INIT(../include/ptlib.h)
3 AC_PROG_CXX
5 dnl ########################################################################
6 dnl set the PWLIB directory to the current directory
8 PWLIBDIR=`pwd`
9 echo "Plugin source directory is $PWLIBDIR";
10 AC_SUBST(PWLIBDIR)
11 dnl set the pwlib installation dir for pwlib-config
12 AC_SUBST(PWINSTDIR)
14 dnl ########################################################################
15 dnl set the PREFIX accordingly
16 if test "x$prefix" = "xNONE"; then
17    INSTALLPREFIX="/usr/local"
18 else
19    INSTALLPREFIX="${prefix}"
22 AC_SUBST(INSTALLPREFIX)
24 dnl ########################################################################
25 dnl set LIBDIR accordingly
26 LIBDIR="${libdir}"
27 AC_SUBST(LIBDIR)
29 AC_ARG_ENABLE(plugins,           disable plugin support])
30 if test "${enable_plugins}z" = "z" ; then
31   enable_plugins=yes
33 if test "$enable_plugins" = "no" ; then
34   AC_MSG_NOTICE(Plugins disabled)
35 else
38 AC_ARG_ENABLE(audio,
39        [  --disable-audio        disable audio support])
40 if test "${enable_audio}z" = "z" ; then
41   enable_audio=yes
44 if test "${enable_audio}" = "yes" ; then
46 dnl #########################################################################
47 dnl check for Alsa sound support
48 dnl ########################################################################
50 AC_ARG_ENABLE(alsa, [  --enable-alsa           enable ALSA audio support],,enable_alsa=yes)
52 if test "${enable_alsa}z" = "yesz" ; then
53   AC_CHECK_HEADER(alsa/asoundlib.h, ALSAHDR=1)
54   AC_MSG_CHECKING(for ALSA sound support)
55   if test "${ALSAHDR}z" != "z"; then
56     AC_SUBST(HAS_ALSA, 1)
57     AC_MSG_RESULT(yes)
58   else
59     AC_MSG_RESULT(no)
60   fi
63 dnl #########################################################################
64 dnl check for ESD sound support
65 dnl ########################################################################
67 AC_ARG_ENABLE(esd, [  --enable-esd            enable ESD audio support],,enable_esd=no)
69 if test "${enable_esd}z" = "yesz" ; then
70   AC_CHECK_HEADER(esd.h, ESDHDR=1)
71   AC_MSG_CHECKING(for ESD sound support)
72   if test "${ESDHDR}z" != "z"; then
73     AC_SUBST(HAS_ESD, 1)
74     AC_MSG_RESULT(yes)
75   else
76     AC_MSG_RESULT(no)
77   fi
80 dnl #########################################################################
81 dnl check for OSS sound support
82 dnl ########################################################################
84 AC_ARG_ENABLE(oss, [  --enable-oss            enable OSS audio support],,enable_oss=no)
86 if test "${enable_oss}z" = "yesz" ; then
87   AC_CHECK_HEADER(sys/soundcard.h, SNDCARDHDR=1)
88   AC_MSG_CHECKING(for OSS sound support)
89   if test "${SNDCARDHDR}z" != "z"; then
90     AC_SUBST(HAS_OSS, 1)
91     AC_MSG_RESULT(yes)
92   else
93     AC_MSG_RESULT(no)
94   fi
97 dnl #########################################################################
98 dnl check for sunaudio sound support
99 dnl ########################################################################
101 AC_ARG_ENABLE(sunaudio, [  --enable-sunaudio            enable  Sun audio support],,enable_sunaudio=no)
103 if test "${enable_sunaudio}z" = "yesz" ; then
104   AC_CHECK_HEADER(sys/conf.h, SNDCARDHDR=1)
105   AC_MSG_CHECKING(for Sun audio sound support)
106   if test "${SNDCARDHDR}z" != "z"; then
107     AC_SUBST(HAS_SUNAUDIO, 1)
108     AC_MSG_RESULT(yes)
109   else
110     AC_MSG_RESULT(no)
111   fi
113 fi # enable_audio
115 AC_ARG_ENABLE(video,
116        [  --disable-video         disable video device support in PWLIB])
118 if test "${enable_video}z" = "z" ; then
119   enable_video=yes
122 if test "$enable_video" = "yes" ; then
124 dnl #########################################################################
125 dnl check for V4L video support
126 dnl ########################################################################
128 AC_ARG_ENABLE(v4l, [  --enable-v4l            enable V4L video support],,enable_v4l=yes)
130 if test "${enable_v4l}z" = "yesz" ; then
131   AC_CHECK_HEADER(linux/videodev.h, V4LHDR=1)
132   AC_MSG_CHECKING(for V4L video support)
133   if test "${V4LHDR}z" != "z"; then
134     AC_SUBST(HAS_V4L, 1)
135     AC_MSG_RESULT(yes)
136   else
137     AC_MSG_RESULT(no)
138   fi
141 dnl #########################################################################
142 dnl check for V4L2 video support
143 dnl ########################################################################
145 AC_ARG_ENABLE(v4l2, [  --enable-v4l2            enable V4L2 video support],,enable_v4l2=yes)
147 if test "${enable_v4l2}z" = "yesz" ; then
148   if test "${OSTYPE}z" = "solaris2.11z"; then
149     VIDEODEV="sys/videodev2.h"
150   else
151     VIDEODEV="linux/videodev2.h"
152   fi
153   AC_CHECK_HEADER($VIDEODEV, 
154                   [V4L2HDR=1],
155                   [
156                     # We can't use AC_CHECK_HEADER again because
157                     # the value is cached, perhaps we have another
158                     # method to do this more cleanly ?
159                     AC_MSG_CHECKING([for $VIDEODEV with sys/types.h])
160                     AC_TRY_COMPILE([
161                                         #ifdef __linux__
162                                         #include <sys/types.h>
163                                         #include <linux/types.h>
164                                         #else
165                                         #ifdef __sun
166                                         #include <sys/types.h>
167                                         #include <sys/time.h>
168                                         #else
169                                         #error "not supported"
170                                         #endif
171                                         #endif
172                                         #include "$VIDEODEV"
173                                     ],
174                                     [
175                                         return 0;
176                                     ],
177                                     [
178                                         V4L2HDR=1
179                                         AC_MSG_RESULT(yes)
180                                     ],
181                                     [
182                                         AC_MSG_RESULT(no)
183                                     ])
184                   ], 
185                 [
186                 #ifdef __linux__
187                 #include <linux/types.h>
188                 #endif
189                 ])
190   AC_MSG_CHECKING(for V4L2 video support)
191   if test "${V4L2HDR}z" != "z"; then
192     AC_SUBST(HAS_V4L2, 1)
193     AC_MSG_RESULT(yes)
194   else
195     AC_MSG_RESULT(no)
196   fi
199 dnl #########################################################################
200 dnl check for BSD video capture support
201 dnl ########################################################################
203 AC_ARG_ENABLE(bsdvideo, [  --enable-bsdvideo       enable BSD video support],,enable_bsdvideo=yes)
205 if test "${enable_bsdvideo}z" = "yesz" ; then
206   AC_CHECK_HEADER(machine/ioctl_meteor.h, BSDVIDEOHDR=1)
207   AC_CHECK_HEADER(i386/ioctl_meteor.h, BSDVIDEOHDR=1)
208   AC_CHECK_HEADER(dev/ic/bt8xx.h, BSDVIDEOHDR=1)
209   AC_MSG_CHECKING(for BSD video support)
210   if test "${BSDVIDEOHDR}z" != "z"; then
211     AC_SUBST(HAS_BSDVIDEOCAP, 1)
212     AC_MSG_RESULT(yes)
213   else
214     AC_MSG_RESULT(no)
215   fi
218 dnl #########################################################################
219 dnl check for AVC video support
220 dnl ########################################################################
222 AC_ARG_ENABLE(avc, [  --enable-avc            enable IEEE1394/AVC video support],,enable_avc=yes)
224 if test "${enable_avc}z" = "yesz" ; then
225   AC_CHECK_HEADER(libavc1394/avc1394.h, AVC1394HDR=1)
226   AC_CHECK_HEADER(libdv/dv.h, DVHDR=1)
227   AC_CHECK_HEADER(libraw1394/raw1394.h, RAW1394HDR=1)
228   AC_MSG_CHECKING(for IEEE1394/AVC video support)
229   if test "${AVC1394HDR}z" != "z" -a "${DVHDR}z" != "z" -a "${RAW1394HDR}z" != "z"; then
230     AC_SUBST(HAS_AVC1394, 1)
231     AC_MSG_RESULT(yes)
232   else
233     AC_MSG_RESULT(no)
234   fi
237 dnl #########################################################################
238 dnl check for DC video support
239 dnl ########################################################################
241 AC_ARG_ENABLE(dc, [  --enable-dc             enable IEEE1394/DC video support],,enable_dc=yes)
243 if test "${enable_dc}z" = "yesz" ; then
244   AC_CHECK_HEADER(libdc1394/dc1394_control.h, DC1394HDR=1)
245   AC_CHECK_HEADER(libraw1394/raw1394.h, RAW1394HDR=1)
246   AC_MSG_CHECKING(for IEEE1394/DC video support)
247   if test "${DC1394HDR}z" != "z" -a "${RAW1394HDR}z" != "z"; then
248     AC_SUBST(HAS_DC1394, 1)
249     AC_MSG_RESULT(yes)
250     AC_MSG_CHECKING(if dc1394_dma_setup_capture has 12 parms)
251     AC_COMPILE_IFELSE([[
252 #include "libdc1394/dc1394_control.h"
253 int main(int ac,char **av)
255   raw1394handle_t handle;
256   nodeid_t node;
257   int channel;
258   int format;
259   int mode;
260   int speed;
261   int frame_rate; 
262   int num_dma_buffers;
263   int do_extra_buffering;
264   int drop_frames;
265   const char *dma_device_file;
266   dc1394_cameracapture *camera;
267   dc1394_dma_setup_capture(handle, node, channel, format, mode, speed, frame_rate, num_dma_buffers,
268                            do_extra_buffering, drop_frames, dma_device_file, camera);
269   return 0;
271 ]],NEW_DC_API=1, NEW_DC_API=0)
272     if test "$NEW_DC_API" = "1" ; then
273       AC_SUBST(DC_CFLAGS, -DNEW_DC_API)
274       AC_MSG_RESULT(yes)
275     else
276       AC_SUBST(DC_CFLAGS)
277       AC_MSG_RESULT(no)
278     fi
279   else
280     AC_MSG_RESULT(no)
281   fi
285 dnl end of test for video
287 fi # enable_plugins
289 dnl ########################################################################
290 dnl output header file
292 AC_CONFIG_FILES(Makefile)
293 AC_CONFIG_FILES(vidinput_dc/Makefile)
295 AC_OUTPUT()