mdbtools icon indicating copy to clipboard operation
mdbtools copied to clipboard

reconfigure fails --> "error: possibly undefined macro: AC_LIB_PREPARE_PREFIX", AC_LIB_RPATH, AC_LIB_LINKFLAGS_BODY, AC_LIB_APPENDTOVAR on Ubuntu

Open daiplusplus opened this issue 3 years ago • 4 comments

Repro steps:

  • Running Ubuntu 20.04 LTS
  • Installed libtool 2.4.6-14.
  • Installed automake 1:1.16.1-4ubuntu6
  • Installed autoconf 2.69-11.1
git clone https://github.com/mdbtools/mdbtools.git
cd mdbtools
autoreconf -i -f

Output:

$ autoreconf -i -f
configure.ac:99: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not m4_defun'd
m4/iconv.m4:16: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:27: AM_ICONV_LINK is expanded from...
m4/iconv.m4:243: AM_ICONV is expanded from...
configure.ac:99: the top level
configure.ac:99: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:16: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:27: AM_ICONV_LINK is expanded from...
m4/iconv.m4:243: AM_ICONV is expanded from...
configure.ac:99: the top level
configure.ac:99: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not m4_defun'd
m4/iconv.m4:16: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:27: AM_ICONV_LINK is expanded from...
m4/iconv.m4:243: AM_ICONV is expanded from...
configure.ac:99: the top level
configure.ac:99: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:16: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:27: AM_ICONV_LINK is expanded from...
m4/iconv.m4:243: AM_ICONV is expanded from...
configure.ac:99: the top level
configure.ac:99: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not m4_defun'd
m4/iconv.m4:16: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:27: AM_ICONV_LINK is expanded from...
m4/iconv.m4:243: AM_ICONV is expanded from...
configure.ac:99: the top level
configure.ac:99: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:16: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:27: AM_ICONV_LINK is expanded from...
m4/iconv.m4:243: AM_ICONV is expanded from...
configure.ac:99: the top level
configure.ac:99: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not m4_defun'd
m4/iconv.m4:16: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:27: AM_ICONV_LINK is expanded from...
m4/iconv.m4:243: AM_ICONV is expanded from...
configure.ac:99: the top level
configure.ac:99: warning: AC_LIB_RPATH is m4_require'd but not m4_defun'd
m4/iconv.m4:16: AM_ICONV_LINKFLAGS_BODY is expanded from...
m4/iconv.m4:27: AM_ICONV_LINK is expanded from...
m4/iconv.m4:243: AM_ICONV is expanded from...
configure.ac:99: the top level
configure:6553: error: possibly undefined macro: AC_LIB_PREPARE_PREFIX
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure:6554: error: possibly undefined macro: AC_LIB_RPATH
configure:6559: error: possibly undefined macro: AC_LIB_LINKFLAGS_BODY
configure:6567: error: possibly undefined macro: AC_LIB_APPENDTOVAR
autoreconf: /usr/bin/autoconf failed with exit status: 1

Oddly enough, the configure file is still generated.

...but running ./configure fails:

$ ./configure
configure: error: cannot find install-sh, install.sh, or shtool in build-aux "."/build-aux

daiplusplus avatar Dec 10 '21 04:12 daiplusplus

Peeking at the build.yml file I see there's a dependency on gettext, after installing that I'm able to run autoreconf but then ./configure fails:

$ sudo apt install gettext

# ...

$ autoreconf -i -f
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:20: installing 'build-aux/compile'
configure.ac:28: installing 'build-aux/config.guess'
configure.ac:28: installing 'build-aux/config.sub'
configure.ac:6: installing 'build-aux/install-sh'
configure.ac:6: installing 'build-aux/missing'
src/extras/Makefile.am: installing 'build-aux/depcomp'
configure.ac: installing 'build-aux/ylwrap'

but ./configure fails:

$ ./configure
hecking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
# (etc)
checking whether the target supports symbol aliases... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking Are we using flex ... no - SQL engine disable
./configure: line 13446: yacc: command not found
configure: WARNING: Bison 3.0+ is not available: SQL disabled.
checking for ld used by gcc... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking for iconv... yes
checking for working iconv... yes
checking whether iconv is compatible with its POSIX signature... yes
checking whether /usr/bin/ld -m elf_x86_64 accepts --as-needed... yes
checking pkg-config m4 macros... no
configure: error:
pkg-config is required.
See pkg-config.freedesktop.org

After installing pkg-config the ./configure script still fails with the same error.

After some more experimentation I needed to install these additional dependencies not mentioned in the README file:

sudo apt-get install pkg-config
sudo apt-get install bison flex
sudo apt-get install libglib2.0-*

I needed to re-run autoreconf -f -i to regenerate the configure script which now runs:

$ sudo apt-get install -y pkg-config bison flex ibglib2.0-*
# etc
$ autoreconf -f -i
# etc
$ ./configure
# etc
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating src/Makefile
config.status: creating include/mdbtools.h
config.status: creating libmdb.pc
config.status: creating libmdbsql.pc
config.status: creating src/util/Makefile
config.status: creating src/util/bash-completion/Makefile
config.status: creating src/extras/Makefile
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating src/libmdb/Makefile
config.status: creating src/sql/Makefile
config.status: creating src/odbc/Makefile
config.status: creating src/fuzz/Makefile
config.status: creating doc/Makefile
config.status: creating include/mdbver.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure:
configure: MDB Tools 1.0.0 - Configuration summary
configure:
configure:    SQL             : enabled
configure:    ODBC            : disabled
configure:    GLib            : enabled
configure:    iconv           : enabled
configure:    man pages       : enabled
configure:    bash-completion : enabled
configure:
$ 

daiplusplus avatar Dec 10 '21 04:12 daiplusplus

I had the same error on fedora, installing gettext-devel solved it for me

robalar avatar Mar 12 '23 12:03 robalar