Himanshu Srivastava
Himanshu Srivastava

Reputation: 95

possibly undefined macro: AC_SUBST

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

Upvotes: 6

Views: 11238

Answers (2)

geohat
geohat

Reputation: 239

apt install pkg-config m4 libtool automake autoconf

Upvotes: 23

Diego Elio Pettenò
Diego Elio Pettenò

Reputation: 3240

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.

Upvotes: 3

Related Questions