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.
 
 
 
 
 
 

254 lines
8.1 KiB

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