]> git.sur5r.net Git - openocd/blob - configure.in
- endianess fixes everywhere but in the flash code. flashing might still be broken...
[openocd] / configure.in
1 AC_INIT(configure.in)
2
3 AC_SEARCH_LIBS([ioperm], [ioperm])
4
5 AC_CANONICAL_HOST
6
7 AC_C_BIGENDIAN
8
9 AC_CHECK_FUNCS(strndup)
10 AC_CHECK_FUNCS(strnlen)
11 AC_CHECK_FUNCS(gettimeofday)
12 AC_CHECK_FUNCS(usleep)
13
14 build_bitbang=no
15 is_cygwin=no
16 is_mingw=no
17 is_win32=no
18
19 AC_ARG_ENABLE(parport,
20   AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]), 
21   [build_parport=$enableval], [build_parport=no])
22
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 AC_ARG_ENABLE(ft2232_libftdi,
28   AS_HELP_STRING([--enable-ft2232_libftdi], [Enable building support for FT2232 based devices using the libftdi driver]), 
29   [build_ft2232_libftdi=$enableval], [build_ft2232_libftdi=no])
30
31 AC_ARG_ENABLE(ft2232_ftd2xx,
32   AS_HELP_STRING([--enable-ft2232_ftd2xx], [Enable building support for FT2232 based devices using the FTD2XX driver]), 
33   [build_ft2232_ftd2xx=$enableval], [build_ft2232_ftd2xx=no])
34  
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
39 AC_ARG_ENABLE(ep93xx,
40   AS_HELP_STRING([--enable-ep93xx], [Enable building support for EP93xx based SBCs]), 
41   [build_ep93xx=$enableval], [build_ep93xx=no])
42
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 AC_ARG_WITH(ftd2xx,
48         [AS_HELP_STRING(--with-ftd2xx,
49            [Where libftd2xx can be found <default=search>])],
50         [],
51         with_ftd2xx=search)
52
53 case $host in 
54   *-*-cygwin*) 
55     is_win32=yes
56
57     AC_ARG_ENABLE(parport_giveio,
58     AS_HELP_STRING([--enable-parport_giveio], [Enable use of giveio for parport instead of ioperm]), 
59     [parport_use_giveio=$enableval], [parport_use_giveio=no])
60         
61         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[return __MINGW32__;]),[is_mingw=yes],[is_mingw=no])
62         if test $is_mingw = yes; then
63                 AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.])
64                 parport_use_giveio=yes
65                 is_cygwin=no
66         else
67                 is_cygwin=yes
68                 AC_DEFINE(IS_CYGWIN, 1, [1 if building for Cygwin.])
69         fi
70         
71     AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.])
72     ;; 
73   *-*-mingw*) 
74     is_mingw=yes
75     is_win32=yes
76
77     parport_use_giveio=yes
78
79     AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.])
80     AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.])
81     ;; 
82   *) 
83         parport_use_giveio=no
84     AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.])
85     AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.])
86     ;;
87 esac
88
89 if test $build_parport = yes; then
90   build_bitbang=yes
91   AC_DEFINE(BUILD_PARPORT, 1, [1 if you want parport.])
92 else
93   AC_DEFINE(BUILD_PARPORT, 0, [0 if you don't want parport.])
94 fi
95
96 if test $build_ep93xx = yes; then
97   build_bitbang=yes
98   AC_DEFINE(BUILD_EP93XX, 1, [1 if you want ep93xx.])
99 else
100   AC_DEFINE(BUILD_EP93XX, 0, [0 if you don't want ep93xx.])
101 fi
102
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
110 if test $parport_use_ppdev = yes; then
111   AC_DEFINE(PARPORT_USE_PPDEV, 1, [1 if you want parport to use ppdev.])
112 else
113   AC_DEFINE(PARPORT_USE_PPDEV, 0, [0 if you don't want parport to use ppdev.])
114 fi
115
116 if test $parport_use_giveio = yes; then
117   AC_DEFINE(PARPORT_USE_GIVEIO, 1, [1 if you want parport to use giveio.])
118 else
119   AC_DEFINE(PARPORT_USE_GIVEIO, 0, [0 if you don't want parport to use giveio.])
120 fi
121
122 if test $build_bitbang = yes; then
123   AC_DEFINE(BUILD_BITBANG, 1, [1 if you want a bitbang interface.])
124 else
125   AC_DEFINE(BUILD_BITBANG, 0, [0 if you don't want a bitbang interface.])
126 fi
127
128 if test $build_ft2232_libftdi = yes; then
129   AC_DEFINE(BUILD_FT2232_LIBFTDI, 1, [1 if you want libftdi ft2232.])
130 else
131   AC_DEFINE(BUILD_FT2232_LIBFTDI, 0, [0 if you don't want libftdi ft2232.])
132 fi
133
134 if test $build_ft2232_ftd2xx = yes; then
135   AC_DEFINE(BUILD_FT2232_FTD2XX, 1, [1 if you want ftd2xx ft2232.])
136 else
137   AC_DEFINE(BUILD_FT2232_FTD2XX, 0, [0 if you don't want ftd2xx ft2232.])
138 fi
139
140 if test $build_amtjtagaccel = yes; then
141   AC_DEFINE(BUILD_AMTJTAGACCEL, 1, [1 if you want the Amontec JTAG-Accelerator driver.])
142 else
143   AC_DEFINE(BUILD_AMTJTAGACCEL, 0, [0 if you don't want the Amontec JTAG-Accelerator driver.])
144 fi
145
146 AM_CONFIG_HEADER(config.h)
147 AM_INIT_AUTOMAKE(openocd, 0.1)
148
149 AM_CONDITIONAL(PARPORT, test $build_parport = yes)
150 AM_CONDITIONAL(GIVEIO, test $parport_use_giveio = yes)
151 AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes)
152 AM_CONDITIONAL(AT91RM9200, test $build_at91rm9200 = yes)
153 AM_CONDITIONAL(BITBANG, test $build_bitbang = yes)
154 AM_CONDITIONAL(FT2232_LIBFTDI, test $build_ft2232_libftdi = yes)
155 AM_CONDITIONAL(FT2232_FTD2XX, test $build_ft2232_ftd2xx = yes)
156 AM_CONDITIONAL(AMTJTAGACCEL, test $build_amtjtagaccel = yes)
157 AM_CONDITIONAL(IS_CYGWIN, test $is_cygwin = yes)
158 AM_CONDITIONAL(IS_MINGW, test $is_mingw = yes)
159 AM_CONDITIONAL(IS_WIN32, test $is_win32 = yes)
160 AM_CONDITIONAL(FTD2XXDIR, test $with_ftd2xx != search)
161
162 AC_LANG_C
163 AC_PROG_CC
164 AC_PROG_RANLIB
165
166 AC_SUBST(WITH_FTD2XX, $with_ftd2xx)
167
168 AC_OUTPUT(Makefile src/Makefile src/helper/Makefile src/jtag/Makefile src/xsvf/Makefile src/target/Makefile src/server/Makefile src/flash/Makefile)