configure.ac 3.98 KB
Newer Older
1
2
AC_INIT(dt_ctrl, git)

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
AC_SUBST(HOSTSYS,["$ac_cv_env_host_alias_value"])
AC_SUBST(BUILDSYS,["$ac_cv_env_build_alias_value"])
AS_IF([echo "$HOSTSYS" | grep "arm"],[HAVE_ARM=1],[HAVE_ARM=0])

#######################################################################
#
#	Enable/disable controller
#

AC_ARG_ENABLE([ethercat],
  [AS_HELP_STRING([--disable-ethercat], [Enable/Disable Ethercat @<:@yes@:>@])],
  [:],
  [enable_ethercat=yes])

AC_ARG_ENABLE([vesp],
  [AS_HELP_STRING([--disable-vesp], [Enable/Disable vesp @<:@yes@:>@])],
  [:],
  [enable_vesp=yes])

AC_ARG_ENABLE([am335x],
  [AS_HELP_STRING([--disable-am335x], [Enable/Disable am335x @<:@yes@:>@])],
  [:],
  [enable_am335x=yes])

27
28
29
30
31
32
#######################################################################
#
#	Enable/disable console
#

AC_ARG_ENABLE([console],
33
  [AS_HELP_STRING([--disable-console], [Enable/Disable console @<:@yes@:>@])],
34
35
36
37
38
  [:],
  [enable_console=yes])

#######################################################################
#
39
#	Check for libwebsockets
40
41
#

42
43
44
AC_ARG_WITH([libwebsockets],
  [AS_HELP_STRING([--with-libwebsockets],
    [use libwebsockets @<:@default=check@:>@])],
45
46
  [],
  [with_libwebsocket=check])
47
AS_CASE(["$with_libwebsockets"],
48
  [yes], 
49
    [AC_CHECK_LIB(websockets,libwebsocket_create_context,[HAVE_LIBWEBSOCKETS=1])]
50
51
52
    [AC_CHECK_HEADERS([libwebsockets.h])],
  [no], 
    [],
53
    [AC_CHECK_LIB(websockets,libwebsocket_create_context,[HAVE_LIBWEBSOCKETS=1],[HAVE_LIBWEBSOCKETS=0])]
54
55
    [AC_CHECK_HEADERS([libwebsockets.h])]
  )
56
AS_IF([test "$ac_cv_header_libwebsockets_h" != yes],[HAVE_LIBWEBSOCKETS=0],[])
57
58
59
60
61
62
63
64
65


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

AC_ARG_WITH([libindi],
  [AS_HELP_STRING([--with-libindi],
66
    [use indi library @<:@default=check@:>@])],
67
68
69
70
71
  [],
  [with_libindi=check])
AS_CASE(["$with_libindi"],
  [yes],
    [AC_CHECK_LIB(indi,IDLog,[HAVE_LIBINDI=1])]
72
    [AC_CHECK_HEADERS([libindi/indidevapi.h])],
73
74
75
  [no], 
    [],
    [AC_CHECK_LIB(indi,IDLog,[HAVE_LIBINDI=1],[HAVE_LIBINDI=0])]
76
    [AC_CHECK_HEADERS([libindi/indidevapi.h])]
77
  )
78
#AS_IF([test "$ac_cv_header_linindi_indidevapi_h" != yes],[HAVE_LIBINDI=0],[])
79
80
81
82
83
84
85
86



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

Jeroen Vreeken's avatar
Jeroen Vreeken committed
87

88
89
90
91
AS_IF([test "$enable_console" = "yes"],
  [AC_SUBST(BUILD_CONSOLE,["yes"])],
  [AC_SUBST(BUILD_CONSOLE,[""])])

92
AS_IF([test "$BUILD_CONSOLE" == "yes" && test "$HAVE_LIBWEBSOCKETS" == "1"],
93
94
95
  [AC_SUBST(BUILD_CONSOLE_HTTPD,["yes"])],
  [AC_SUBST(BUILD_CONSOLE_HTTPD,[""])])

96
AS_IF([test "$BUILD_CONSOLE" = "yes" && test "$HAVE_LIBINDI" = "1"],
97
98
99
100
  [AC_SUBST(BUILD_CONSOLE_J2000_INDI,["yes"])],
  [AC_SUBST(BUILD_CONSOLE_J2000_INDI,[""])])


101
102
103
104
105
106
107
108
109
110
111
112
113
114

AS_IF([test "$enable_ethercat" = "yes"],
  [AC_SUBST(BUILD_ETHERCAT,["yes"])],
  [AC_SUBST(BUILD_ETHERCAT,[""])])

AS_IF([test "$enable_vesp" = "yes"],
  [AC_SUBST(BUILD_VESP,["yes"])],
  [AC_SUBST(BUILD_VESP,[""])])

AS_IF([test "$enable_am335x" = "yes" && test "$HAVE_ARM" = "1"],
  [AC_SUBST(BUILD_AM335X,["yes"])],
  [AC_SUBST(BUILD_AM335X,[""])])


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
#######################################################################
#
#	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]))
142
143
144
145
146
147
148
149
150
151
152
153
154


AS_IF([test "$BUILD_ETHERCAT" != ""],
   AC_MSG_NOTICE([    ethercat: yes]),
   AC_MSG_NOTICE([    ethercat: no]))

AS_IF([test "$BUILD_VESP" != ""],
   AC_MSG_NOTICE([    vesp: yes]),
   AC_MSG_NOTICE([    vesp: no]))

AS_IF([test "$BUILD_AM335X" != ""],
   AC_MSG_NOTICE([    am335x: yes]),
   AC_MSG_NOTICE([    am335x: no]))