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.
 
 
 
 
 
 

232 lines
7.4 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. AC_ARG_ENABLE(ep93xx,
  39. AS_HELP_STRING([--enable-ep93xx], [Enable building support for EP93xx based SBCs]),
  40. [build_ep93xx=$enableval], [build_ep93xx=no])
  41. AC_ARG_ENABLE(at91rm9200,
  42. AS_HELP_STRING([--enable-at91rm9200], [Enable building support for AT91RM9200 based SBCs]),
  43. [build_at91rm9200=$enableval], [build_at91rm9200=no])
  44. AC_ARG_ENABLE(gw16012,
  45. AS_HELP_STRING([--enable-gw16012], [Enable building support for the Gateworks GW16012 JTAG Programmer]),
  46. [build_gw16012=$enableval], [build_gw16012=no])
  47. AC_ARG_ENABLE(presto,
  48. AS_HELP_STRING([--enable-presto], [Enable building support for ASIX Presto Programmer]),
  49. [build_presto=$enableval], [build_presto=no])
  50. AC_ARG_ENABLE(usbprog,
  51. AS_HELP_STRING([--enable-usbprog], [Enable building support for the usbprog JTAG Programmer]),
  52. [build_usbprog=$enableval], [build_usbprog=no])
  53. AC_ARG_ENABLE(oocd_trace,
  54. AS_HELP_STRING([--enable-oocd_trace], [Enable building support for the OpenOCD+trace ETM capture device]),
  55. [build_oocd_trace=$enableval], [build_oocd_trace=no])
  56. AC_ARG_WITH(ftd2xx,
  57. [AS_HELP_STRING(--with-ftd2xx,
  58. [Where libftd2xx can be found <default=search>])],
  59. [],
  60. with_ftd2xx=search)
  61. case $host in
  62. *-*-cygwin*)
  63. is_win32=yes
  64. AC_ARG_ENABLE(parport_giveio,
  65. AS_HELP_STRING([--enable-parport_giveio], [Enable use of giveio for parport instead of ioperm]),
  66. [parport_use_giveio=$enableval], [parport_use_giveio=no])
  67. AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[return __MINGW32__;]),[is_mingw=yes],[is_mingw=no])
  68. if test $is_mingw = yes; then
  69. AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.])
  70. parport_use_giveio=yes
  71. is_cygwin=no
  72. else
  73. is_cygwin=yes
  74. AC_DEFINE(IS_CYGWIN, 1, [1 if building for Cygwin.])
  75. fi
  76. AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.])
  77. ;;
  78. *-*-mingw*)
  79. is_mingw=yes
  80. is_win32=yes
  81. parport_use_giveio=yes
  82. AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.])
  83. AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.])
  84. ;;
  85. *)
  86. parport_use_giveio=no
  87. AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.])
  88. AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.])
  89. ;;
  90. esac
  91. if test $build_parport = yes; then
  92. build_bitbang=yes
  93. AC_DEFINE(BUILD_PARPORT, 1, [1 if you want parport.])
  94. else
  95. AC_DEFINE(BUILD_PARPORT, 0, [0 if you don't want parport.])
  96. fi
  97. if test $build_ep93xx = yes; then
  98. build_bitbang=yes
  99. AC_DEFINE(BUILD_EP93XX, 1, [1 if you want ep93xx.])
  100. else
  101. AC_DEFINE(BUILD_EP93XX, 0, [0 if you don't want ep93xx.])
  102. fi
  103. if test $build_at91rm9200 = yes; then
  104. build_bitbang=yes
  105. AC_DEFINE(BUILD_AT91RM9200, 1, [1 if you want at91rm9200.])
  106. else
  107. AC_DEFINE(BUILD_AT91RM9200, 0, [0 if you don't want at91rm9200.])
  108. fi
  109. if test $parport_use_ppdev = yes; then
  110. AC_DEFINE(PARPORT_USE_PPDEV, 1, [1 if you want parport to use ppdev.])
  111. else
  112. AC_DEFINE(PARPORT_USE_PPDEV, 0, [0 if you don't want parport to use ppdev.])
  113. fi
  114. if test $parport_use_giveio = yes; then
  115. AC_DEFINE(PARPORT_USE_GIVEIO, 1, [1 if you want parport to use giveio.])
  116. else
  117. AC_DEFINE(PARPORT_USE_GIVEIO, 0, [0 if you don't want parport to use giveio.])
  118. fi
  119. if test $build_bitbang = yes; then
  120. AC_DEFINE(BUILD_BITBANG, 1, [1 if you want a bitbang interface.])
  121. else
  122. AC_DEFINE(BUILD_BITBANG, 0, [0 if you don't want a bitbang interface.])
  123. fi
  124. if test $build_ft2232_libftdi = yes; then
  125. AC_DEFINE(BUILD_FT2232_LIBFTDI, 1, [1 if you want libftdi ft2232.])
  126. else
  127. AC_DEFINE(BUILD_FT2232_LIBFTDI, 0, [0 if you don't want libftdi ft2232.])
  128. fi
  129. if test $build_ft2232_ftd2xx = yes; then
  130. AC_DEFINE(BUILD_FT2232_FTD2XX, 1, [1 if you want ftd2xx ft2232.])
  131. else
  132. AC_DEFINE(BUILD_FT2232_FTD2XX, 0, [0 if you don't want ftd2xx ft2232.])
  133. fi
  134. if test $build_amtjtagaccel = yes; then
  135. AC_DEFINE(BUILD_AMTJTAGACCEL, 1, [1 if you want the Amontec JTAG-Accelerator driver.])
  136. else
  137. AC_DEFINE(BUILD_AMTJTAGACCEL, 0, [0 if you don't want the Amontec JTAG-Accelerator driver.])
  138. fi
  139. if test $build_gw16012 = yes; then
  140. AC_DEFINE(BUILD_GW16012, 1, [1 if you want the Gateworks GW16012 driver.])
  141. else
  142. AC_DEFINE(BUILD_GW16012, 0, [0 if you don't want the Gateworks GW16012 driver.])
  143. fi
  144. if test $build_presto = yes; then
  145. build_bitq=yes
  146. AC_DEFINE(BUILD_PRESTO, 1, [1 if you want the ASIX PRESTO driver.])
  147. else
  148. AC_DEFINE(BUILD_PRESTO, 0, [0 if you don't want the ASIX PRESTO driver.])
  149. fi
  150. if test $build_bitq = yes; then
  151. AC_DEFINE(BUILD_BITQ, 1, [1 if you want a bitq interface.])
  152. else
  153. AC_DEFINE(BUILD_BITQ, 0, [0 if you don't want a bitq interface.])
  154. fi
  155. if test $build_usbprog = yes; then
  156. AC_DEFINE(BUILD_USBPROG, 1, [1 if you want the usbprog JTAG driver.])
  157. else
  158. AC_DEFINE(BUILD_USBPROG, 0, [0 if you don't want the usbprog JTAG driver.])
  159. fi
  160. if test $build_oocd_trace = yes; then
  161. AC_DEFINE(BUILD_OOCD_TRACE, 1, [1 if you want the OpenOCD+trace ETM capture driver.])
  162. else
  163. AC_DEFINE(BUILD_OOCD_TRACE, 0, [0 if you don't want the OpenOCD+trace ETM capture driver.])
  164. fi
  165. AM_CONFIG_HEADER(config.h)
  166. AM_INIT_AUTOMAKE(openocd, 0.1)
  167. AM_CONDITIONAL(PARPORT, test $build_parport = yes)
  168. AM_CONDITIONAL(GIVEIO, test $parport_use_giveio = yes)
  169. AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes)
  170. AM_CONDITIONAL(AT91RM9200, test $build_at91rm9200 = yes)
  171. AM_CONDITIONAL(BITBANG, test $build_bitbang = yes)
  172. AM_CONDITIONAL(FT2232_LIBFTDI, test $build_ft2232_libftdi = yes)
  173. AM_CONDITIONAL(FT2232_FTD2XX, test $build_ft2232_ftd2xx = yes)
  174. AM_CONDITIONAL(AMTJTAGACCEL, test $build_amtjtagaccel = yes)
  175. AM_CONDITIONAL(GW16012, test $build_gw16012 = yes)
  176. AM_CONDITIONAL(PRESTO, test $build_presto = yes)
  177. AM_CONDITIONAL(USBPROG, test $build_usbprog = yes)
  178. AM_CONDITIONAL(OOCD_TRACE, test $build_oocd_trace = yes)
  179. AM_CONDITIONAL(IS_CYGWIN, test $is_cygwin = yes)
  180. AM_CONDITIONAL(IS_MINGW, test $is_mingw = yes)
  181. AM_CONDITIONAL(IS_WIN32, test $is_win32 = yes)
  182. AM_CONDITIONAL(FTD2XXDIR, test $with_ftd2xx != search)
  183. AM_CONDITIONAL(BITQ, test $build_bitq = yes)
  184. AC_LANG_C
  185. AC_PROG_CC
  186. AC_PROG_RANLIB
  187. AC_SUBST(WITH_FTD2XX, $with_ftd2xx)
  188. 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)