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.

configure.in 8.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. AC_PREREQ(2.59)
  2. AC_INIT(configure.in)
  3. AC_SEARCH_LIBS([ioperm], [ioperm])
  4. AC_CANONICAL_HOST
  5. AC_CHECK_HEADERS(jtag_minidriver.h)
  6. AC_CHECK_HEADERS(sys/param.h)
  7. AC_CHECK_HEADERS(elf.h)
  8. AC_C_BIGENDIAN
  9. AC_CHECK_FUNCS(strndup)
  10. AC_CHECK_FUNCS(strnlen)
  11. AC_CHECK_FUNCS(gettimeofday)
  12. AC_CHECK_FUNCS(usleep)
  13. build_bitbang=no
  14. build_bitq=no
  15. is_cygwin=no
  16. is_mingw=no
  17. is_win32=no
  18. AC_ARG_ENABLE(parport,
  19. AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]),
  20. [build_parport=$enableval], [build_parport=no])
  21. case "${host_cpu}" in
  22. i?86|x86*)
  23. AC_ARG_ENABLE(parport_ppdev,
  24. AS_HELP_STRING([--enable-parport_ppdev], [Enable use of ppdev (/dev/parportN) for parport]),
  25. [parport_use_ppdev=$enableval], [parport_use_ppdev=no])
  26. ;;
  27. *)
  28. parport_use_ppdev=yes
  29. ;;
  30. esac
  31. AC_ARG_ENABLE(ft2232_libftdi,
  32. AS_HELP_STRING([--enable-ft2232_libftdi], [Enable building support for FT2232 based devices using the libftdi driver]),
  33. [build_ft2232_libftdi=$enableval], [build_ft2232_libftdi=no])
  34. AC_ARG_ENABLE(ft2232_ftd2xx,
  35. AS_HELP_STRING([--enable-ft2232_ftd2xx], [Enable building support for FT2232 based devices using the FTD2XX driver]),
  36. [build_ft2232_ftd2xx=$enableval], [build_ft2232_ftd2xx=no])
  37. AC_ARG_ENABLE(amtjtagaccel,
  38. AS_HELP_STRING([--enable-amtjtagaccel], [Enable building the Amontec JTAG-Accelerator driver]),
  39. [build_amtjtagaccel=$enableval], [build_amtjtagaccel=no])
  40. case "${host_cpu}" in
  41. arm*)
  42. AC_ARG_ENABLE(ep93xx,
  43. AS_HELP_STRING([--enable-ep93xx], [Enable building support for EP93xx based SBCs]),
  44. [build_ep93xx=$enableval], [build_ep93xx=no])
  45. AC_ARG_ENABLE(ecosboard,
  46. AS_HELP_STRING([--enable-ecosboard], [Enable building support for eCosBoard based JTAG debugger]),
  47. [build_ecosboard=$enableval], [build_ecosboard=no])
  48. AC_ARG_ENABLE(at91rm9200,
  49. AS_HELP_STRING([--enable-at91rm9200], [Enable building support for AT91RM9200 based SBCs]),
  50. [build_at91rm9200=$enableval], [build_at91rm9200=no])
  51. ;;
  52. *)
  53. build_ep93xx=no
  54. build_at91rm9200=no
  55. ;;
  56. esac
  57. AC_ARG_ENABLE(gw16012,
  58. AS_HELP_STRING([--enable-gw16012], [Enable building support for the Gateworks GW16012 JTAG Programmer]),
  59. [build_gw16012=$enableval], [build_gw16012=no])
  60. AC_ARG_ENABLE(presto_libftdi,
  61. AS_HELP_STRING([--enable-presto_libftdi], [Enable building support for ASIX Presto Programmer using the libftdi driver]),
  62. [build_presto_libftdi=$enableval], [build_presto_libftdi=no])
  63. AC_ARG_ENABLE(presto_ftd2xx,
  64. AS_HELP_STRING([--enable-presto_ftd2xx], [Enable building support for ASIX Presto Programmer using the FTD2XX driver]),
  65. [build_presto_ftd2xx=$enableval], [build_presto_ftd2xx=no])
  66. AC_ARG_ENABLE(usbprog,
  67. AS_HELP_STRING([--enable-usbprog], [Enable building support for the usbprog JTAG Programmer]),
  68. [build_usbprog=$enableval], [build_usbprog=no])
  69. AC_ARG_ENABLE(oocd_trace,
  70. AS_HELP_STRING([--enable-oocd_trace], [Enable building support for the OpenOCD+trace ETM capture device]),
  71. [build_oocd_trace=$enableval], [build_oocd_trace=no])
  72. AC_ARG_WITH(ftd2xx,
  73. [AS_HELP_STRING(--with-ftd2xx,
  74. [Where libftd2xx can be found <default=search>])],
  75. [],
  76. with_ftd2xx=search)
  77. case $host in
  78. *-cygwin*)
  79. is_win32=yes
  80. AC_ARG_ENABLE(parport_giveio,
  81. AS_HELP_STRING([--enable-parport_giveio], [Enable use of giveio for parport instead of ioperm]),
  82. [parport_use_giveio=$enableval], [parport_use_giveio=no])
  83. AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[return __MINGW32__;]),[is_mingw=yes],[is_mingw=no])
  84. if test $is_mingw = yes; then
  85. AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.])
  86. parport_use_giveio=yes
  87. is_cygwin=no
  88. else
  89. is_cygwin=yes
  90. AC_DEFINE(IS_CYGWIN, 1, [1 if building for Cygwin.])
  91. fi
  92. AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.])
  93. ;;
  94. *-mingw*)
  95. is_mingw=yes
  96. is_win32=yes
  97. parport_use_giveio=yes
  98. AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.])
  99. AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.])
  100. ;;
  101. *)
  102. parport_use_giveio=no
  103. AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.])
  104. AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.])
  105. ;;
  106. esac
  107. if test $build_parport = yes; then
  108. build_bitbang=yes
  109. AC_DEFINE(BUILD_PARPORT, 1, [1 if you want parport.])
  110. else
  111. AC_DEFINE(BUILD_PARPORT, 0, [0 if you don't want parport.])
  112. fi
  113. if test $build_ep93xx = yes; then
  114. build_bitbang=yes
  115. AC_DEFINE(BUILD_EP93XX, 1, [1 if you want ep93xx.])
  116. else
  117. AC_DEFINE(BUILD_EP93XX, 0, [0 if you don't want ep93xx.])
  118. fi
  119. if test $build_ecosboard = yes; then
  120. build_bitbang=yes
  121. AC_DEFINE(BUILD_ECOSBOARD, 1, [1 if you want eCosBoard.])
  122. else
  123. AC_DEFINE(BUILD_ECOSBOARD, 0, [0 if you don't want eCosBoard.])
  124. fi
  125. if test $build_at91rm9200 = yes; then
  126. build_bitbang=yes
  127. AC_DEFINE(BUILD_AT91RM9200, 1, [1 if you want at91rm9200.])
  128. else
  129. AC_DEFINE(BUILD_AT91RM9200, 0, [0 if you don't want at91rm9200.])
  130. fi
  131. if test $parport_use_ppdev = yes; then
  132. AC_DEFINE(PARPORT_USE_PPDEV, 1, [1 if you want parport to use ppdev.])
  133. else
  134. AC_DEFINE(PARPORT_USE_PPDEV, 0, [0 if you don't want parport to use ppdev.])
  135. fi
  136. if test $parport_use_giveio = yes; then
  137. AC_DEFINE(PARPORT_USE_GIVEIO, 1, [1 if you want parport to use giveio.])
  138. else
  139. AC_DEFINE(PARPORT_USE_GIVEIO, 0, [0 if you don't want parport to use giveio.])
  140. fi
  141. if test $build_bitbang = yes; then
  142. AC_DEFINE(BUILD_BITBANG, 1, [1 if you want a bitbang interface.])
  143. else
  144. AC_DEFINE(BUILD_BITBANG, 0, [0 if you don't want a bitbang interface.])
  145. fi
  146. if test $build_ft2232_libftdi = yes; then
  147. AC_DEFINE(BUILD_FT2232_LIBFTDI, 1, [1 if you want libftdi ft2232.])
  148. else
  149. AC_DEFINE(BUILD_FT2232_LIBFTDI, 0, [0 if you don't want libftdi ft2232.])
  150. fi
  151. if test $build_ft2232_ftd2xx = yes; then
  152. AC_DEFINE(BUILD_FT2232_FTD2XX, 1, [1 if you want ftd2xx ft2232.])
  153. else
  154. AC_DEFINE(BUILD_FT2232_FTD2XX, 0, [0 if you don't want ftd2xx ft2232.])
  155. fi
  156. if test $build_amtjtagaccel = yes; then
  157. AC_DEFINE(BUILD_AMTJTAGACCEL, 1, [1 if you want the Amontec JTAG-Accelerator driver.])
  158. else
  159. AC_DEFINE(BUILD_AMTJTAGACCEL, 0, [0 if you don't want the Amontec JTAG-Accelerator driver.])
  160. fi
  161. if test $build_gw16012 = yes; then
  162. AC_DEFINE(BUILD_GW16012, 1, [1 if you want the Gateworks GW16012 driver.])
  163. else
  164. AC_DEFINE(BUILD_GW16012, 0, [0 if you don't want the Gateworks GW16012 driver.])
  165. fi
  166. if test $build_presto_libftdi = yes; then
  167. build_bitq=yes
  168. AC_DEFINE(BUILD_PRESTO_LIBFTDI, 1, [1 if you want the ASIX PRESTO driver using libftdi.])
  169. else
  170. AC_DEFINE(BUILD_PRESTO_LIBFTDI, 0, [0 if you don't want the ASIX PRESTO driver using libftdi.])
  171. fi
  172. if test $build_presto_ftd2xx = yes; then
  173. build_bitq=yes
  174. AC_DEFINE(BUILD_PRESTO_FTD2XX, 1, [1 if you want the ASIX PRESTO driver using FTD2XX.])
  175. else
  176. AC_DEFINE(BUILD_PRESTO_FTD2XX, 0, [0 if you don't want the ASIX PRESTO driver using FTD2XX.])
  177. fi
  178. if test $build_bitq = yes; then
  179. AC_DEFINE(BUILD_BITQ, 1, [1 if you want a bitq interface.])
  180. else
  181. AC_DEFINE(BUILD_BITQ, 0, [0 if you don't want a bitq interface.])
  182. fi
  183. if test $build_usbprog = yes; then
  184. AC_DEFINE(BUILD_USBPROG, 1, [1 if you want the usbprog JTAG driver.])
  185. else
  186. AC_DEFINE(BUILD_USBPROG, 0, [0 if you don't want the usbprog JTAG driver.])
  187. fi
  188. if test $build_oocd_trace = yes; then
  189. AC_DEFINE(BUILD_OOCD_TRACE, 1, [1 if you want the OpenOCD+trace ETM capture driver.])
  190. else
  191. AC_DEFINE(BUILD_OOCD_TRACE, 0, [0 if you don't want the OpenOCD+trace ETM capture driver.])
  192. fi
  193. AM_CONFIG_HEADER(config.h)
  194. AM_INIT_AUTOMAKE(openocd, 1.0)
  195. AM_CONDITIONAL(PARPORT, test $build_parport = yes)
  196. AM_CONDITIONAL(GIVEIO, test $parport_use_giveio = yes)
  197. AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes)
  198. AM_CONDITIONAL(ECOSBOARD, test $build_ecosboard = yes)
  199. AM_CONDITIONAL(AT91RM9200, test $build_at91rm9200 = yes)
  200. AM_CONDITIONAL(BITBANG, test $build_bitbang = yes)
  201. AM_CONDITIONAL(FT2232_LIBFTDI, test $build_ft2232_libftdi = yes)
  202. AM_CONDITIONAL(FT2232_FTD2XX, test $build_ft2232_ftd2xx = yes)
  203. AM_CONDITIONAL(AMTJTAGACCEL, test $build_amtjtagaccel = yes)
  204. AM_CONDITIONAL(GW16012, test $build_gw16012 = yes)
  205. AM_CONDITIONAL(PRESTO_LIBFTDI, test $build_presto_libftdi = yes)
  206. AM_CONDITIONAL(PRESTO_FTD2XX, test $build_presto_ftd2xx = yes)
  207. AM_CONDITIONAL(USBPROG, test $build_usbprog = yes)
  208. AM_CONDITIONAL(OOCD_TRACE, test $build_oocd_trace = yes)
  209. AM_CONDITIONAL(IS_CYGWIN, test $is_cygwin = yes)
  210. AM_CONDITIONAL(IS_MINGW, test $is_mingw = yes)
  211. AM_CONDITIONAL(IS_WIN32, test $is_win32 = yes)
  212. AM_CONDITIONAL(FTD2XXDIR, test $with_ftd2xx != search)
  213. AM_CONDITIONAL(BITQ, test $build_bitq = yes)
  214. AC_LANG_C
  215. AC_PROG_CC
  216. AC_PROG_RANLIB
  217. AC_SUBST(WITH_FTD2XX, $with_ftd2xx)
  218. 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 doc/Makefile)