possibly undefined macro: AC_SUBST
Asked Answered
C

2

6

I am trying to build a project and it throws me an error :

autoreconf: running: /usr/bin/autoconf --force
configure.ac:19: error: possibly undefined macro: AC_SUBST
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

I am very new to build tools, thats why this error is driving me crazy.

Can someone help me figure out what I should do to resolve this issue?

EDIT : Corresponding line in configure.ac is :

Hey I still not able to figure out whats wrong with my configure.ac. My configure.ac looks like this :

PKG_CHECK_MODULES(libcurl, libcurl)

AP_VERSION=2.2.4
AP_CHECK_APACHE([$AP_VERSION], [
  LIBTOOL="`$APR_CONFIG --apr-libtool`"
  AC_SUBST([LIBTOOL])

  MODULE_CFLAGS="$AP_CFLAGS"
  AC_SUBST([MODULE_CFLAGS])

  MODULE_LDFLAGS="`$APR_CONFIG --link-libtool` `$APU_CONFIG --link-libtool`"
  AC_SUBST([MODULE_LDFLAGS])

  BIN_LDFLAGS="`$APR_CONFIG --link-libtool` `$APU_CONFIG --link-libtool` `$APR_CONFIG --ldflags --libs` `$APU_CONFIG --ldflags --libs`"
  AC_SUBST([BIN_LDFLAGS])

  prefix="$AP_PREFIX"
], AC_MSG_ERROR([*** Apache version $AP_VERSION not found!]))

It breaks at AC_SUBST([LIBTOOL]). Please help

Concentre answered 16/12, 2016 at 10:21 Comment(0)
A
23

apt install pkg-config m4 libtool automake autoconf

Authoritative answered 16/4, 2020 at 10:23 Comment(3)
When sharing an executable command, please make sure you explain clearly what the command does and why it can be used to address the author's question. Asking users to execute commands with no context can be dangerous.Skinny
Not works for me, with all these pkg installed, still failing with the same error.Bluey
Thank you, it works. pkg-config was missing in my case.Avow
R
3

This is an unfortunate way autoconf tends to fail. Check for the last macro that was called before AC_SUBST, that's the real undefined one.

Reuter answered 17/12, 2016 at 15:39 Comment(2)
Hi, Diego thanks for helping, but I am still not able to figure out whats wrong with my configure.ac. You can check my configure.ac in the question above.Concentre
I would expect the problem is to be found in AP_CHECK_APACHE not being available. There are two projects that reference this macro (both on GitHub) and both have it in a m4 file in the m4/ directory of them. Both have different generation scripts, but for both it should work fine if you ignore them all and do autoreconf -fis -I m4Sleepless

© 2022 - 2024 — McMap. All rights reserved.