configure.ac 2.75 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
AC_INIT(dt_ctrl, git)

#######################################################################
#
#	Enable/disable console
#

AC_ARG_ENABLE([console],
  [AS_HELP_STRING([--disable-console], [Enable console @<:@yes@:>@])],
  [:],
  [enable_console=yes])

#######################################################################
#
15
#	Check for libwebsockets
16
17
#

18
19
20
AC_ARG_WITH([libwebsockets],
  [AS_HELP_STRING([--with-libwebsockets],
    [use libwebsockets @<:@default=check@:>@])],
21
22
  [],
  [with_libwebsocket=check])
23
AS_CASE(["$with_libwebsockets"],
24
  [yes], 
25
    [AC_CHECK_LIB(websockets,libwebsocket_create_context,[HAVE_LIBWEBSOCKETS=1])]
26
27
28
    [AC_CHECK_HEADERS([libwebsockets.h])],
  [no], 
    [],
29
    [AC_CHECK_LIB(websockets,libwebsocket_create_context,[HAVE_LIBWEBSOCKETS=1],[HAVE_LIBWEBSOCKETS=0])]
30
31
    [AC_CHECK_HEADERS([libwebsockets.h])]
  )
32
AS_IF([test "$ac_cv_header_libwebsockets_h" != yes],[HAVE_LIBWEBSOCKETS=0],[])
33
34
35
36
37
38
39
40
41


#######################################################################
#
#	Check for libindi
#

AC_ARG_WITH([libindi],
  [AS_HELP_STRING([--with-libindi],
42
    [use indi library @<:@default=check@:>@])],
43
44
45
46
47
  [],
  [with_libindi=check])
AS_CASE(["$with_libindi"],
  [yes],
    [AC_CHECK_LIB(indi,IDLog,[HAVE_LIBINDI=1])]
48
    [AC_CHECK_HEADERS([libindi/indidevapi.h])],
49
50
51
  [no], 
    [],
    [AC_CHECK_LIB(indi,IDLog,[HAVE_LIBINDI=1],[HAVE_LIBINDI=0])]
52
    [AC_CHECK_HEADERS([libindi/indidevapi.h])]
53
  )
54
#AS_IF([test "$ac_cv_header_linindi_indidevapi_h" != yes],[HAVE_LIBINDI=0],[])
55
56
57
58
59
60
61
62



#######################################################################
#
#	Some conclusions based on test results
#

Jeroen Vreeken's avatar
Jeroen Vreeken committed
63
64
65
AC_SUBST(HOSTSYS,["$ac_cv_env_host_alias_value"])
AC_SUBST(BUILDSYS,["$ac_cv_env_build_alias_value"])

66
67
68
69
AS_IF([test "$enable_console" = "yes"],
  [AC_SUBST(BUILD_CONSOLE,["yes"])],
  [AC_SUBST(BUILD_CONSOLE,[""])])

70
AS_IF([test "$BUILD_CONSOLE" == "yes" && test "$HAVE_LIBWEBSOCKETS" == "1"],
71
72
73
  [AC_SUBST(BUILD_CONSOLE_HTTPD,["yes"])],
  [AC_SUBST(BUILD_CONSOLE_HTTPD,[""])])

74
AS_IF([test "$BUILD_CONSOLE" = "yes" && test "$HAVE_LIBINDI" = "1"],
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
  [AC_SUBST(BUILD_CONSOLE_J2000_INDI,["yes"])],
  [AC_SUBST(BUILD_CONSOLE_J2000_INDI,[""])])


#######################################################################
#
#	Output
#

AC_CONFIG_FILES(buildflags.mk)
AC_OUTPUT


#######################################################################
#
#	Tell the user our findings
#

AC_MSG_NOTICE([Build:])

AS_IF([test "$BUILD_CONSOLE" != ""],
   AC_MSG_NOTICE([    console: yes]),
   AC_MSG_NOTICE([    console: no]))

AS_IF([test "$BUILD_CONSOLE_HTTPD" != ""],
   AC_MSG_NOTICE([    console_httpd: yes]),
   AC_MSG_NOTICE([    console_httpd: no]))

AS_IF([test "$BUILD_CONSOLE_J2000_INDI" != ""],
   AC_MSG_NOTICE([    console_j2000_indi: yes]),
   AC_MSG_NOTICE([    console_j2000_indi: no]))