1
0

configure.ac 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.61)
  4. AC_INIT(u3-tool, 0.3, daviedev@users.sourceforge.net)
  5. AM_INIT_AUTOMAKE
  6. AC_CONFIG_SRCDIR([config.h.in])
  7. AC_CONFIG_HEADER([config.h])
  8. AC_CANONICAL_HOST
  9. # Checks for programs.
  10. AC_PROG_CC
  11. AM_PROG_CC_C_O
  12. AC_PROG_INSTALL
  13. # Parse arguments
  14. AC_ARG_ENABLE([libusb],
  15. [ --enable-libusb Force using libUSB subsystem instead of platform specific],
  16. [case "${enableval}" in
  17. yes) force_libusb=true ;;
  18. no) force_libusb=false ;;
  19. *) AC_MSG_ERROR([bad value ${enableval} for --enable-libusb]) ;;
  20. esac],[force_libusb=false])
  21. # Determine subsystem
  22. AS_IF([test x$force_libusb = xtrue],
  23. [ subsystem=libusb ],
  24. [ AS_CASE([$host_os],
  25. [linux*], [subsystem=sg],
  26. [mingw32], [subsystem=spt],
  27. [subsystem=libusb])]
  28. )
  29. AS_IF([test x$subsystem = xlibusb ], [ AC_DEFINE([SUBSYS_LIBUSB], [1], [Use libusb subsystem]) ])
  30. AS_IF([test x$subsystem = xsg ], [ AC_DEFINE([SUBSYS_SG], [1], [Use sg subsystem]) ])
  31. AS_IF([test x$subsystem = xspt ], [ AC_DEFINE([SUBSYS_SPT], [1], [Use spt subsystem]) ])
  32. # Checks for libraries.
  33. #FIXME: PKG_CHECK_MODULES not provided on MinGW
  34. #AS_IF([ test x$subsystem = xlibusb ],
  35. # [ PKG_CHECK_MODULES([LIBUSB], [libusb],
  36. # [ ],
  37. # [ AC_MSG_FAILURE([libusb is required but not found.]) ])
  38. # ])
  39. # Checks for header files.
  40. AC_HEADER_STDC
  41. AC_CHECK_HEADERS([arpa/inet.h fcntl.h stdint.h stdlib.h string.h sys/ioctl.h termios.h unistd.h])
  42. # Checks for typedefs, structures, and compiler characteristics.
  43. AC_C_CONST
  44. AC_TYPE_SIZE_T
  45. AC_TYPE_UINT16_T
  46. AC_TYPE_UINT32_T
  47. AC_TYPE_UINT64_T
  48. AC_TYPE_UINT8_T
  49. # Checks for library functions.
  50. AC_PROG_GCC_TRADITIONAL
  51. AC_FUNC_MALLOC
  52. AC_FUNC_MEMCMP
  53. AC_FUNC_STAT
  54. AC_CHECK_FUNCS([memset regcomp strdup strerror strtoul])
  55. AC_CONFIG_FILES([Makefile
  56. doc/Makefile
  57. src/Makefile])
  58. AC_OUTPUT
  59. echo ""
  60. echo "Subsystem: ${subsystem}"
  61. echo ""