You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

201 lines
5.4 KiB

AC_INIT(dt_ctrl, git)
AC_SUBST(HOSTSYS,["$ac_cv_env_host_alias_value"])
AC_SUBST(BUILDSYS,["$ac_cv_env_build_alias_value"])
AS_IF([test "$HOSTSYS" == ""],[HOSTSYS_TMP=`uname -m`],[HOSTSYS_TMP="$HOSTSYS"])
AS_IF([echo "$HOSTSYS_TMP" | grep "arm"],[HAVE_ARM=1],[HAVE_ARM=0])
#######################################################################
#
# Enable/disable controller
#
AC_ARG_ENABLE([ethercat],
[AS_HELP_STRING([--disable-ethercat], [Enable/Disable Ethercat master @<:@yes@:>@])],
[:],
[enable_ethercat=yes])
AC_ARG_ENABLE([vesp],
[AS_HELP_STRING([--disable-vesp], [Enable/Disable vesp bus @<:@yes@:>@])],
[:],
[enable_vesp=yes])
AC_ARG_ENABLE([am335x],
[AS_HELP_STRING([--disable-am335x], [Enable/Disable am335x blocks @<:@yes@:>@])],
[:],
[enable_am335x=yes])
AC_ARG_ENABLE([test],
[AS_HELP_STRING([--disable-test], [Enable/Disable test blocks @<:@yes@:>@])],
[:],
[enable_test=yes])
#######################################################################
#
# Enable/disable console
#
AC_ARG_ENABLE([console],
[AS_HELP_STRING([--disable-console], [Enable/Disable console @<:@yes@:>@])],
[:],
[enable_console=yes])
#######################################################################
#
# Check for libwebsockets
#
AC_ARG_WITH([libwebsockets],
[AS_HELP_STRING([--with-libwebsockets],
[use libwebsockets @<:@default=check@:>@])],
[],
[with_libwebsocket=check])
AS_CASE(["$with_libwebsockets"],
[yes],
[AC_CHECK_LIB(websockets,lws_create_context,[HAVE_LIBWEBSOCKETS=1])]
[AC_CHECK_HEADERS([libwebsockets.h])],
[no],
[],
[AC_CHECK_LIB(websockets,lws_create_context,[HAVE_LIBWEBSOCKETS=1],[HAVE_LIBWEBSOCKETS=0])]
[AC_CHECK_HEADERS([libwebsockets.h])]
)
AS_IF([test "$ac_cv_header_libwebsockets_h" != yes],[HAVE_LIBWEBSOCKETS=0],[])
#######################################################################
#
# Check for libindi
#
AC_ARG_WITH([libindi],
[AS_HELP_STRING([--with-libindi],
[use indi library @<:@default=check@:>@])],
[],
[with_libindi=check])
AS_CASE(["$with_libindi"],
[yes],
[AC_CHECK_LIB(indi,IDLog,[HAVE_LIBINDI=1])]
[AC_CHECK_HEADERS([libindi/indidevapi.h])],
[no],
[],
[AC_CHECK_LIB(indi,IDLog,[HAVE_LIBINDI=1],[HAVE_LIBINDI=0])]
[AC_CHECK_HEADERS([libindi/indidevapi.h])]
)
#######################################################################
#
# Check for libnova
#
AC_ARG_WITH([libnova],
[AS_HELP_STRING([--with-libnova],
[use nova library @<:@default=check@:>@])],
[],
[with_libnova=check])
AS_CASE(["$with_libnova"],
[yes],
[AC_CHECK_LIB(nova,ln_get_version,[HAVE_LIBNOVA=1])]
[AC_CHECK_HEADERS([libnova/libnova.h])],
[no],
[],
[AC_CHECK_LIB(nova,ln_get_version,[HAVE_LIBNOVA=1],[HAVE_LIBNOVA=0])]
[AC_CHECK_HEADERS([libnova/libnova.h])]
)
#######################################################################
#
# Some conclusions based on test results
#
AS_IF([test "$enable_console" = "yes"],
[AC_SUBST(BUILD_CONSOLE,["yes"])],
[AC_SUBST(BUILD_CONSOLE,[""])])
AS_IF([test "$BUILD_CONSOLE" == "yes" && test "$HAVE_LIBWEBSOCKETS" == "1"],
[AC_SUBST(BUILD_CONSOLE_HTTPD,["yes"])],
[AC_SUBST(BUILD_CONSOLE_HTTPD,[""])])
AS_IF([test "$BUILD_CONSOLE" = "yes" && test "$HAVE_LIBNOVA" = "1"],
[AC_SUBST(BUILD_CONSOLE_J2000,["yes"])],
[AC_SUBST(BUILD_CONSOLE_J2000,[""])])
AS_IF([test "$BUILD_CONSOLE" = "yes" && test "$HAVE_LIBNOVA" = "1"],
[AC_SUBST(BUILD_CONSOLE_SATTRACKER,["yes"])],
[AC_SUBST(BUILD_CONSOLE_SATTRACKER,[""])])
AS_IF([test "$BUILD_CONSOLE_J2000" = "yes" && test "$HAVE_LIBINDI" = "1"],
[AC_SUBST(BUILD_CONSOLE_J2000_INDI,["yes"])],
[AC_SUBST(BUILD_CONSOLE_J2000_INDI,[""])])
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,[""])])
AS_IF([test "$enable_test" = "yes"],
[AC_SUBST(BUILD_TEST,["yes"])],
[AC_SUBST(BUILD_TEST,[""])])
#######################################################################
#
# 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" != ""],
AC_MSG_NOTICE([ console_j2000_tracker: yes]),
AC_MSG_NOTICE([ console_j2000_tracker: no]))
AS_IF([test "$BUILD_CONSOLE_J2000_INDI" != ""],
AC_MSG_NOTICE([ console_j2000_indi: yes]),
AC_MSG_NOTICE([ console_j2000_indi: no]))
AS_IF([test "$BUILD_CONSOLE_SATTRACKER" != ""],
AC_MSG_NOTICE([ console_sattracker: yes]),
AC_MSG_NOTICE([ console_sattracker: no]))
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]))
AS_IF([test "$BUILD_TEST" != ""],
AC_MSG_NOTICE([ test: yes]),
AC_MSG_NOTICE([ test: no]))