Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 660
Himanshu Srivastava Avatar asked Dec 07 '22 20:12

Himanshu Srivastava


2 Answers

apt install pkg-config m4 libtool automake autoconf

like image 152
geohat Avatar answered Feb 04 '23 22:02

geohat


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.

like image 31
Diego Elio Pettenò Avatar answered Feb 04 '23 23:02

Diego Elio Pettenò