binutils-gdb/sim/bfin/configure.ac
Simon Marchi 5798d69f03 sim/bfin: include config/pkg.m4 in configure.ac
When trying to re-generate configure in sim/bfin, I get:

    $ autoreconf -vf
    autoreconf: Entering directory `.'
    autoreconf: configure.ac: not using Gettext
    autoreconf: running: aclocal --force
    autoreconf: configure.ac: tracing
    autoreconf: configure.ac: not running libtoolize: --install not given
    autoreconf: running: /opt/autostuff/bin/autoconf --force
    configure.ac:57: error: possibly undefined macro: AC_CHECK_LIB
          If this token and others are legitimate, please use m4_pattern_allow.
          See the Autoconf documentation.
    autoreconf: /opt/autostuff/bin/autoconf failed with exit status: 1

This happens since commit f693213d12 ("Run `autoreconf -vf` throughout").

The problem (not clear from the error message) is that the
PKG_CHECK_MODULES macro used in configure.ac is undefined.  In the past, I
suppose that it relied on the person running autoconf having pkg.m4 (from
pkg-config) in their include path.  That's not my case.

Since we recently added a local version of PKG_CHECK_MODULES to our tree,
we can just make sim/bfin/configure.ac use it.  This patch makes
configure.ac include config/pkg.m4, and re-generates configure.  With this,
the configure script appears to be generated correctly, I am able to
configure and build the bfin simulator.

Note: using sinclude to include the required m4 files makes no sense to
me.  These files contain macros we need, if they are not defined then
the resulting file is unusable.  And sinclude fails silently if the file
is not found.  So, better use include/m4_include.

sim/bfin/ChangeLog:

	* configure.ac: Include config/pkg.m4.

Change-Id: I7d8012e5ed510cd7746b94e918f0feb1c701cd83
2020-08-21 11:55:08 -04:00

67 lines
1.2 KiB
Plaintext

dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.in)
sinclude(../common/acinclude.m4)
m4_include([../../config/pkg.m4])
SIM_AC_COMMON
SIM_AC_OPTION_ENDIAN(LITTLE)
SIM_AC_OPTION_ALIGNMENT(STRICT_ALIGNMENT,STRICT_ALIGNMENT)
SIM_AC_OPTION_DEFAULT_MODEL(bf537)
SIM_AC_OPTION_WARNINGS
SIM_AC_OPTION_HARDWARE(yes,,\
bfin_cec \
bfin_ctimer \
bfin_dma \
bfin_dmac \
bfin_ebiu_amc \
bfin_ebiu_ddrc \
bfin_ebiu_sdc \
bfin_emac \
bfin_eppi \
bfin_evt \
bfin_gpio \
bfin_gpio2 \
bfin_gptimer \
bfin_jtag \
bfin_mmu \
bfin_nfc \
bfin_otp \
bfin_pfmon \
bfin_pint \
bfin_pll \
bfin_ppi \
bfin_rtc \
bfin_sic \
bfin_spi \
bfin_trace \
bfin_twi \
bfin_uart \
bfin_uart2 \
bfin_wdog \
bfin_wp \
eth_phy \
)
AC_CHECK_FUNCS([getuid getgid geteuid getegid setuid setgid mmap munmap kill pread])
AC_CHECK_HEADERS([ \
linux/if_tun.h \
linux/mii.h \
linux/types.h \
net/if.h \
sys/ioctl.h \
sys/mman.h \
])
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES(SDL, sdl, [
AC_CHECK_LIB(dl, dlopen, [
SDL_CFLAGS="${SDL_CFLAGS} -DHAVE_SDL"
SDL_LIBS="-ldl"
], [SDL_CFLAGS= SDL_LIBS=])
], [:])
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
SIM_AC_OUTPUT