2009-06-09 22:19:32 +03:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
2009-06-23 12:42:21 +03:00
|
|
|
AC_PREREQ(2.63)
|
2011-04-08 10:48:59 +03:00
|
|
|
AC_INIT([xburst-tools], [201104])
|
2009-06-09 22:19:32 +03:00
|
|
|
AC_CONFIG_AUX_DIR(m4)
|
2010-09-23 12:02:18 +03:00
|
|
|
AM_INIT_AUTOMAKE([foreign])
|
2011-04-08 10:48:59 +03:00
|
|
|
AM_CONFIG_HEADER([xburst-tools-config.h])
|
2009-06-09 22:19:32 +03:00
|
|
|
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
2010-04-05 06:41:05 +03:00
|
|
|
AC_ARG_ENABLE([firmware],
|
2010-09-23 12:02:18 +03:00
|
|
|
[AS_HELP_STRING([--disable-firmware],
|
|
|
|
[Do not build initialization code]
|
|
|
|
[(for example, because some other package contains it).])],
|
|
|
|
[AS_CASE([$enableval], [yes], [firmware=true], [no], [firmware=false],
|
|
|
|
[AC_MSG_ERROR([bad value $enableval for --enable-firmware])])],
|
|
|
|
[firmware=true])
|
2010-04-05 06:41:05 +03:00
|
|
|
AM_CONDITIONAL([COND_FIRMWARE], [test "$firmware" = true])
|
|
|
|
|
2010-09-23 11:54:05 +03:00
|
|
|
AC_ARG_VAR([CROSS_COMPILE],
|
|
|
|
[Cross compiler prefix for building firmware, ]
|
|
|
|
[e.g. CROSS_COMPILE=mipsel-openwrt-linux-.])
|
|
|
|
|
2010-09-23 12:01:04 +03:00
|
|
|
AS_VAR_IF([firmware], [true],
|
|
|
|
[
|
|
|
|
AS_VAR_IF([CROSS_COMPILE], [],
|
|
|
|
[AC_MSG_ERROR([CROSS_COMPILE prefix is not set, set to cross-prefix- use --disable-firmware])])
|
|
|
|
AC_CHECK_PROG([CROSS_GCC], [${CROSS_COMPILE}gcc], [yes], [no])
|
|
|
|
AS_VAR_IF([CROSS_GCC], [no],
|
|
|
|
[AC_MSG_ERROR([No cross compiler, check CROSS_COMPILE value])])
|
|
|
|
],
|
|
|
|
[CROSS_COMPILE="dummy-"]
|
|
|
|
)
|
|
|
|
|
2009-06-09 22:19:32 +03:00
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
2009-06-23 12:42:21 +03:00
|
|
|
AC_PROG_CXX
|
2009-06-09 22:19:32 +03:00
|
|
|
|
|
|
|
# Checks for libraries.
|
2009-06-23 12:42:21 +03:00
|
|
|
AC_CHECK_LIB([c], [main])
|
|
|
|
AC_CHECK_LIB([m], [main])
|
2011-04-08 10:48:59 +03:00
|
|
|
AC_CHECK_LIB([gcc], [main])
|
|
|
|
|
|
|
|
AC_CHECK_LIB([confuse], [main], [], [
|
|
|
|
echo "Error! You need to have libconfuse."
|
|
|
|
echo "Maybe run 'sudo apt-get install libconfuse-dev' under debian"
|
|
|
|
exit -1 ])
|
2009-08-05 03:09:27 +03:00
|
|
|
AC_CHECK_LIB([usb], [main], [], [
|
2011-04-08 10:48:59 +03:00
|
|
|
echo "Error! You need to have libusb-0.1. \n"
|
|
|
|
echo "Maybe run 'sudo apt-get install libusb-dev' under debian"
|
|
|
|
exit -1 ])
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES(LIBUSB, libusb-1.0 > 1.0,
|
|
|
|
[LIBS="$LIBS $LIBUSB_LIBS" CFLAGS="$CFLAGS $LIBUSB_CFLAGS"],
|
2011-05-27 11:01:11 +03:00
|
|
|
AC_MSG_ERROR(Maybe run 'sudo apt-get install libusb-1.0-0-dev' under debian"))
|
2011-04-05 18:56:25 +03:00
|
|
|
|
|
|
|
AC_ARG_WITH([readline],
|
|
|
|
[AS_HELP_STRING([--with-readline],
|
|
|
|
[support fancy command line editing @<:@default=check@:>@])],
|
|
|
|
[],
|
|
|
|
[with_readline=check])
|
|
|
|
|
|
|
|
READLINE_LIBS=
|
|
|
|
AS_IF([test "x$with_readline" != xno],
|
|
|
|
[AC_CHECK_LIB([readline], [main],
|
|
|
|
[AC_SUBST([READLINE_LIBS], ["-lreadline -lncurses"])
|
|
|
|
AC_DEFINE([HAVE_READLINE], [1],
|
|
|
|
[Define if you have libreadline])
|
|
|
|
],
|
|
|
|
[if test "x$with_readline" != xcheck; then
|
|
|
|
AC_MSG_FAILURE(
|
|
|
|
[--with-readline was given, but test for readline failed])
|
|
|
|
fi
|
|
|
|
], -lncurses)])
|
2009-06-09 22:19:32 +03:00
|
|
|
|
2011-04-08 10:48:59 +03:00
|
|
|
LIBS="$LIBS $USB_LIBS $READLINE_LIBS"
|
|
|
|
CFLAGS="$CFLAGS $USB_CFLAGS"
|
2009-06-09 22:19:32 +03:00
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2009-06-23 12:42:21 +03:00
|
|
|
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h unistd.h])
|
2009-06-09 22:19:32 +03:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
2009-06-23 12:42:21 +03:00
|
|
|
AC_C_INLINE
|
2009-06-09 22:19:32 +03:00
|
|
|
AC_TYPE_SIZE_T
|
2009-06-23 12:42:21 +03:00
|
|
|
AC_TYPE_UINT8_T
|
2009-06-09 22:19:32 +03:00
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_FUNC_MEMCMP
|
2009-06-23 12:42:21 +03:00
|
|
|
AC_CHECK_FUNCS([memset strerror])
|
2009-06-09 22:19:32 +03:00
|
|
|
|
2010-05-05 06:04:03 +03:00
|
|
|
AC_CONFIG_FILES(Makefile \
|
|
|
|
usbboot/Makefile usbboot/src/Makefile \
|
2011-04-05 16:10:53 +03:00
|
|
|
xbboot/Makefile xbboot/host-app/Makefile \
|
2011-04-05 18:56:25 +03:00
|
|
|
jzboot/Makefile jzboot/src/Makefile)
|
2009-06-09 22:19:32 +03:00
|
|
|
AC_OUTPUT
|