moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / configure.in.in
blob5bc872a47ce3d7c1a3ee93db78f7dda7cfa02da4
1 dnl KStars configuration
3 timezone_int=no
4 AC_TRY_COMPILE(
5         #include <time.h>
6         ,
7         daylight = 0;
8         timezone = 0;
9         ,
10         AC_DEFINE(TIMEZONE_IS_INT,1,[The symbol timezone is an int, not a function])
11         ,
12         AC_DEFINE(TIMEZONE_IS_INT,0,[The symbol timezone is an int, not a function])
13         )
15 # KStars INDI driver for the FLI CCD
16 case "${host_os}" in
17        *linux* ) OSDIR=linux ;;
18        *bsd*   ) OSDIR=bsd   ;;
19        *       ) OSDIR=null  ;;
20 esac
22 # This variable to is check for the availability of libusb
23 have_libusb="no"
25 dnl --enable-libusb=PATH
26 AC_ARG_ENABLE(libusb,
27         AC_HELP_STRING([--enable-libusb=PATH],[libusb path (default /usr)]),
28         [
29                 case ${enableval} in
30                         "" | "yes" | "YES")
31                                 ;;
32                         "no" | "NO")
33                                 use_libusb=false
34                                 ;;
35                         *)
36                                 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
37                                 LDFLAGS="$LDFLAGS -L${enableval}/lib"
38                                 ;;
39                 esac
40         ]
43 dnl check if libusb is available
44 if test "${use_libusb}" != false ; then
45         AC_SUBST(LIBUSB)
46         AC_CHECK_HEADERS(usb.h, [have_libusb="yes"],
47                 [ AC_MSG_WARN([usb.h not found, use --enable-libusb=PATH. Otherwise, INDI will compile without Apogee USB support.]) ])
49         ac_save_LIBS="$LIBS"
50         LIBS="$LIBS $COREFOUNDATION $IOKIT"
51         AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb" have_libusb="yes"],
52                 [ AC_MSG_WARN([libusb not found. INDI will compile without Apogee USB support.]) ])
53         LIBS="$ac_save_LIBS"
57 dnl check if v4l2 is available
58 have_v4l2=false
59 case "$target" in
60    *-*-linux*)
61         AC_ARG_ENABLE(v4l2,
62                       [AC_HELP_STRING([--disable-v4l2],
63                                       [disable V4L2 interface for KStars])],
64                       [ case "${enableval}" in
65                         no)  disable_v4l2=yes ;;
66                         yes) disable_v4l2=no ;;
67                          *) AC_MSG_ERROR(bad value ${enableval} for --disable-v4l2) ;;
68                          esac],
69                       [disable_v4l2=no])
70         if test x$disable_v4l2 = xno; then
71           AC_CHECK_TYPE([struct v4l2_buffer], 
72                         [have_v4l2=true],
73                         [have_v4l2=false],
74                         [#include <sys/time.h>
75 #include <linux/videodev.h>])
76          if test x$have_v4l2 = xfalse; then
77             KERNEL_VERSION=`uname -r`
78             AC_CHECK_FILE(/lib/modules/$KERNEL_VERSION/build/include/linux/videodev2.h,
79                           [AC_MSG_WARN([])
80                            AC_MSG_WARN([])
81                           AC_MSG_WARN([We cannot locate videodev2.h in /usr/include/linux])
82                           AC_MSG_WARN([])
83                           AC_MSG_WARN([This file is responsible for V4L2 in KStars])
84                            AC_MSG_WARN([This file is correct in /lib/modules/$KERNEL_VERSION/build/include])
85                            AC_MSG_WARN([It is recommended that you copy this file and videodev.h to /usr/include/linux])
86                            AC_MSG_WARN([])
87                            ])
88           fi
89         else
90             have_v4l2=false
91         fi
92         ;;
93     *)
94         ;;
95    esac
97 if test x$have_v4l2 = xtrue; then
98   AC_DEFINE(HAVE_LINUX_VIDEODEV2_H, 1, [Define to 1 if you have the <linux/videodev2.h> header file.])
101 AM_CONDITIONAL(BSD, test x$OSDIR = xbsd)
102 AM_CONDITIONAL(LINUX, test x$OSDIR = xlinux)
103 AM_CONDITIONAL(NULL, test x$OSDIR = xnull)
104 AM_CONDITIONAL(HAVE_LIBUSB, test x$have_libusb = xyes)
105 AM_CONDITIONAL(HAVE_V4L2, [test x$have_v4l2 = xtrue])