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.
 
 
 
 
 
 

253 lines
8.1 KiB

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