| 1 | # -*- Autoconf -*- |
| 2 | # Process this file with autoconf to produce a configure script. |
| 3 | |
| 4 | AC_PREREQ(2.63) |
| 5 | AC_INIT([xburst-tools], [0.1]) |
| 6 | AC_CONFIG_AUX_DIR(m4) |
| 7 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
| 8 | AM_CONFIG_HEADER([config.h]) |
| 9 | |
| 10 | AM_MAINTAINER_MODE |
| 11 | |
| 12 | AC_ARG_ENABLE([firmware], |
| 13 | [AS_HELP_STRING([--disable-firmware], |
| 14 | [Do not build initialization code] |
| 15 | [(for example, because some other package contains it).])], |
| 16 | [ |
| 17 | case "$enableval" in |
| 18 | yes) firmware=true ;; |
| 19 | no) firmware=false ;; |
| 20 | *) AC_MSG_ERROR([bad value $enableval for --enable-firmware]) ;; |
| 21 | esac],[firmware=false]) |
| 22 | AM_CONDITIONAL([COND_FIRMWARE], [test "$firmware" = true]) |
| 23 | |
| 24 | # Checks for programs. |
| 25 | AC_PROG_CC |
| 26 | AC_PROG_CXX |
| 27 | |
| 28 | # Checks for libraries. |
| 29 | AC_CHECK_LIB([c], [main]) |
| 30 | AC_CHECK_LIB([confuse], [main], [], [ |
| 31 | echo "Error! You need to have libconfuse." |
| 32 | echo "Maybe run 'sudo apt-get install libconfuse-dev' under debian" |
| 33 | exit -1 ]) |
| 34 | AC_CHECK_LIB([gcc], [main]) |
| 35 | AC_CHECK_LIB([m], [main]) |
| 36 | AC_CHECK_LIB([usb], [main], [], [ |
| 37 | echo "Error! You need to have libusb. \n" |
| 38 | echo "Maybe run 'sudo apt-get install libusb-dev' under debian" |
| 39 | exit -1 ]) |
| 40 | |
| 41 | LIBS="$LIBS $USB_LIBS" |
| 42 | CFLAGS="$CFLAGS $USB_CFLAGS" |
| 43 | |
| 44 | # Checks for header files. |
| 45 | AC_HEADER_STDC |
| 46 | AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h unistd.h]) |
| 47 | |
| 48 | # Checks for typedefs, structures, and compiler characteristics. |
| 49 | AC_C_INLINE |
| 50 | AC_TYPE_SIZE_T |
| 51 | AC_TYPE_UINT8_T |
| 52 | |
| 53 | # Checks for library functions. |
| 54 | AC_FUNC_MALLOC |
| 55 | AC_FUNC_MEMCMP |
| 56 | AC_CHECK_FUNCS([memset strerror]) |
| 57 | |
| 58 | AC_CONFIG_FILES(Makefile \ |
| 59 | usbboot/Makefile usbboot/src/Makefile \ |
| 60 | xbboot/Makefile xbboot/host-app/Makefile) |
| 61 | AC_OUTPUT |
| 62 | |