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.
 
 
 
 
 
 

180 lines
5.7 KiB

  1. AC_INIT(configure.in)
  2. AC_SEARCH_LIBS([ioperm], [ioperm])
  3. AC_CANONICAL_HOST
  4. AC_C_BIGENDIAN
  5. AC_CHECK_FUNCS(strndup)
  6. AC_CHECK_FUNCS(strnlen)
  7. AC_CHECK_FUNCS(gettimeofday)
  8. AC_CHECK_FUNCS(usleep)
  9. build_bitbang=no
  10. is_cygwin=no
  11. is_mingw=no
  12. is_win32=no
  13. AC_ARG_ENABLE(parport,
  14. AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]),
  15. [build_parport=$enableval], [build_parport=no])
  16. AC_ARG_ENABLE(parport_ppdev,
  17. AS_HELP_STRING([--enable-parport_ppdev], [Enable use of ppdev (/dev/parportN) for parport]),
  18. [parport_use_ppdev=$enableval], [parport_use_ppdev=no])
  19. AC_ARG_ENABLE(ft2232_libftdi,
  20. AS_HELP_STRING([--enable-ft2232_libftdi], [Enable building support for FT2232 based devices using the libftdi driver]),
  21. [build_ft2232_libftdi=$enableval], [build_ft2232_libftdi=no])
  22. AC_ARG_ENABLE(ft2232_ftd2xx,
  23. AS_HELP_STRING([--enable-ft2232_ftd2xx], [Enable building support for FT2232 based devices using the FTD2XX driver]),
  24. [build_ft2232_ftd2xx=$enableval], [build_ft2232_ftd2xx=no])
  25. AC_ARG_ENABLE(amtjtagaccel,
  26. AS_HELP_STRING([--enable-amtjtagaccel], [Enable building the Amontec JTAG-Accelerator driver]),
  27. [build_amtjtagaccel=$enableval], [build_amtjtagaccel=no])
  28. AC_ARG_ENABLE(ep93xx,
  29. AS_HELP_STRING([--enable-ep93xx], [Enable building support for EP93xx based SBCs]),
  30. [build_ep93xx=$enableval], [build_ep93xx=no])
  31. AC_ARG_ENABLE(at91rm9200,
  32. AS_HELP_STRING([--enable-at91rm9200], [Enable building support for AT91RM9200 based SBCs]),
  33. [build_at91rm9200=$enableval], [build_at91rm9200=no])
  34. AC_ARG_ENABLE(gw16012,
  35. AS_HELP_STRING([--enable-gw16012], [Enable building support for the Gateworks GW16012 JTAG Programmer]),
  36. [build_gw16012=$enableval], [build_gw16012=no])
  37. AC_ARG_WITH(ftd2xx,
  38. [AS_HELP_STRING(--with-ftd2xx,
  39. [Where libftd2xx can be found <default=search>])],
  40. [],
  41. with_ftd2xx=search)
  42. case $host in
  43. *-*-cygwin*)
  44. is_win32=yes
  45. AC_ARG_ENABLE(parport_giveio,
  46. AS_HELP_STRING([--enable-parport_giveio], [Enable use of giveio for parport instead of ioperm]),
  47. [parport_use_giveio=$enableval], [parport_use_giveio=no])
  48. AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[return __MINGW32__;]),[is_mingw=yes],[is_mingw=no])
  49. if test $is_mingw = yes; then
  50. AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.])
  51. parport_use_giveio=yes
  52. is_cygwin=no
  53. else
  54. is_cygwin=yes
  55. AC_DEFINE(IS_CYGWIN, 1, [1 if building for Cygwin.])
  56. fi
  57. AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.])
  58. ;;
  59. *-*-mingw*)
  60. is_mingw=yes
  61. is_win32=yes
  62. parport_use_giveio=yes
  63. AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.])
  64. AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.])
  65. ;;
  66. *)
  67. parport_use_giveio=no
  68. AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.])
  69. AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.])
  70. ;;
  71. esac
  72. if test $build_parport = yes; then
  73. build_bitbang=yes
  74. AC_DEFINE(BUILD_PARPORT, 1, [1 if you want parport.])
  75. else
  76. AC_DEFINE(BUILD_PARPORT, 0, [0 if you don't want parport.])
  77. fi
  78. if test $build_ep93xx = yes; then
  79. build_bitbang=yes
  80. AC_DEFINE(BUILD_EP93XX, 1, [1 if you want ep93xx.])
  81. else
  82. AC_DEFINE(BUILD_EP93XX, 0, [0 if you don't want ep93xx.])
  83. fi
  84. if test $build_at91rm9200 = yes; then
  85. build_bitbang=yes
  86. AC_DEFINE(BUILD_AT91RM9200, 1, [1 if you want at91rm9200.])
  87. else
  88. AC_DEFINE(BUILD_AT91RM9200, 0, [0 if you don't want at91rm9200.])
  89. fi
  90. if test $parport_use_ppdev = yes; then
  91. AC_DEFINE(PARPORT_USE_PPDEV, 1, [1 if you want parport to use ppdev.])
  92. else
  93. AC_DEFINE(PARPORT_USE_PPDEV, 0, [0 if you don't want parport to use ppdev.])
  94. fi
  95. if test $parport_use_giveio = yes; then
  96. AC_DEFINE(PARPORT_USE_GIVEIO, 1, [1 if you want parport to use giveio.])
  97. else
  98. AC_DEFINE(PARPORT_USE_GIVEIO, 0, [0 if you don't want parport to use giveio.])
  99. fi
  100. if test $build_bitbang = yes; then
  101. AC_DEFINE(BUILD_BITBANG, 1, [1 if you want a bitbang interface.])
  102. else
  103. AC_DEFINE(BUILD_BITBANG, 0, [0 if you don't want a bitbang interface.])
  104. fi
  105. if test $build_ft2232_libftdi = yes; then
  106. AC_DEFINE(BUILD_FT2232_LIBFTDI, 1, [1 if you want libftdi ft2232.])
  107. else
  108. AC_DEFINE(BUILD_FT2232_LIBFTDI, 0, [0 if you don't want libftdi ft2232.])
  109. fi
  110. if test $build_ft2232_ftd2xx = yes; then
  111. AC_DEFINE(BUILD_FT2232_FTD2XX, 1, [1 if you want ftd2xx ft2232.])
  112. else
  113. AC_DEFINE(BUILD_FT2232_FTD2XX, 0, [0 if you don't want ftd2xx ft2232.])
  114. fi
  115. if test $build_amtjtagaccel = yes; then
  116. AC_DEFINE(BUILD_AMTJTAGACCEL, 1, [1 if you want the Amontec JTAG-Accelerator driver.])
  117. else
  118. AC_DEFINE(BUILD_AMTJTAGACCEL, 0, [0 if you don't want the Amontec JTAG-Accelerator driver.])
  119. fi
  120. if test $build_gw16012 = yes; then
  121. AC_DEFINE(BUILD_GW16012, 1, [1 if you want the Gateworks GW16012 driver.])
  122. else
  123. AC_DEFINE(BUILD_GW16012, 0, [0 if you don't want the Gateworks GW16012 driver.])
  124. fi
  125. AM_CONFIG_HEADER(config.h)
  126. AM_INIT_AUTOMAKE(openocd, 0.1)
  127. AM_CONDITIONAL(PARPORT, test $build_parport = yes)
  128. AM_CONDITIONAL(GIVEIO, test $parport_use_giveio = yes)
  129. AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes)
  130. AM_CONDITIONAL(AT91RM9200, test $build_at91rm9200 = yes)
  131. AM_CONDITIONAL(BITBANG, test $build_bitbang = yes)
  132. AM_CONDITIONAL(FT2232_LIBFTDI, test $build_ft2232_libftdi = yes)
  133. AM_CONDITIONAL(FT2232_FTD2XX, test $build_ft2232_ftd2xx = yes)
  134. AM_CONDITIONAL(AMTJTAGACCEL, test $build_amtjtagaccel = yes)
  135. AM_CONDITIONAL(GW16012, test $build_gw16012 = yes)
  136. AM_CONDITIONAL(IS_CYGWIN, test $is_cygwin = yes)
  137. AM_CONDITIONAL(IS_MINGW, test $is_mingw = yes)
  138. AM_CONDITIONAL(IS_WIN32, test $is_win32 = yes)
  139. AM_CONDITIONAL(FTD2XXDIR, test $with_ftd2xx != search)
  140. AC_LANG_C
  141. AC_PROG_CC
  142. AC_PROG_RANLIB
  143. AC_SUBST(WITH_FTD2XX, $with_ftd2xx)
  144. AC_OUTPUT(Makefile src/Makefile src/helper/Makefile src/jtag/Makefile src/xsvf/Makefile src/target/Makefile src/server/Makefile src/flash/Makefile src/pld/Makefile)