1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.59)dnl
3AC_INIT(Makefile.in)
4AC_CONFIG_HEADER(config.h:config.in)
5
6sinclude(../common/aclocal.m4)
7
8# Bugs in autoconf 2.59 break the call to SIM_AC_COMMON, hack around
9# it by inlining the macro's contents.
10sinclude(../common/common.m4)
11
12SIM_AC_OPTION_ENDIAN(LITTLE_ENDIAN)
13SIM_AC_OPTION_ALIGNMENT(STRICT_ALIGNMENT,STRICT_ALIGNMENT)
14SIM_AC_OPTION_HOSTENDIAN
15SIM_AC_OPTION_DEFAULT_MODEL(bf537)
16SIM_AC_OPTION_ENVIRONMENT
17SIM_AC_OPTION_INLINE
18SIM_AC_OPTION_WARNINGS
19SIM_AC_OPTION_HARDWARE(yes,,\
20	bfin_cec \
21	bfin_ctimer \
22	bfin_dma \
23	bfin_dmac \
24	bfin_ebiu_amc \
25	bfin_ebiu_ddrc \
26	bfin_ebiu_sdc \
27	bfin_emac \
28	bfin_eppi \
29	bfin_evt \
30	bfin_gpio \
31	bfin_gptimer \
32	bfin_jtag \
33	bfin_mmu \
34	bfin_nfc \
35	bfin_otp \
36	bfin_pll \
37	bfin_ppi \
38	bfin_rtc \
39	bfin_sic \
40	bfin_spi \
41	bfin_trace \
42	bfin_twi \
43	bfin_uart \
44	bfin_uart2 \
45	bfin_wdog \
46	bfin_wp \
47	eth_phy \
48)
49
50AC_CHECK_FUNCS([getuid getgid geteuid getegid setuid setgid mmap munmap kill pread])
51AC_CHECK_HEADERS([sys/ioctl.h sys/mman.h net/if.h linux/if_tun.h linux/mii.h])
52
53BFIN_SIM_EXTRA_OBJS=
54
55dnl make sure the dv-sockser code can be supported (i.e. windows)
56case ${host} in
57  *mingw32*) ;;
58  *)
59    AC_DEFINE_UNQUOTED([HAVE_DV_SOCKSER], 1, [Define if dv-sockser is usable.])
60    BFIN_SIM_EXTRA_OBJS="${BFIN_SIM_EXTRA_OBJS} dv-sockser.o"
61    ;;
62esac
63
64AC_SUBST([BFIN_SIM_EXTRA_OBJS], ${BFIN_SIM_EXTRA_OBJS})
65
66PKG_PROG_PKG_CONFIG
67PKG_CHECK_MODULES(SDL, sdl, [
68	AC_CHECK_LIB(dl, dlopen, [
69		SDL_CFLAGS="${SDL_CFLAGS} -DHAVE_SDL"
70		SDL_LIBS="-ldl"
71		], [SDL_CFLAGS= SDL_LIBS=])
72	], [:])
73AC_SUBST(SDL_CFLAGS)
74AC_SUBST(SDL_LIBS)
75
76SIM_AC_OUTPUT
77