Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure:7350: error: possibly undefined macro: AC_DEFINE #787

Closed
Dmole opened this issue Feb 15, 2021 · 7 comments
Closed

configure:7350: error: possibly undefined macro: AC_DEFINE #787

Dmole opened this issue Feb 15, 2021 · 7 comments
Assignees

Comments

@Dmole
Copy link

Dmole commented Feb 15, 2021

#make autotools
sed -n '1{s:LTP-:m4_define([LTP_VERSION],[:;s:$:]):;p;q}' VERSION > m4/ltp-version.m4
aclocal -I m4
autoconf
configure:7350: error: possibly undefined macro: AC_DEFINE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
make: *** [/media/btrfs/ltp/include/mk/automake.mk:51: configure] Error 1
@pevik pevik self-assigned this Feb 15, 2021
@pevik
Copy link
Member

pevik commented Feb 15, 2021

You need to install pkg-config or pkgconfig. You can have look for dependencies for some major distros in https://github.com/linux-test-project/ltp/tree/master/travis. But I'll have look how to improve this error message to be more obvious.

pevik added a commit to pevik/ltp that referenced this issue Feb 15, 2021
make autotools
configure:7350: error: possibly undefined macro: AC_DEFINE

Fixes: linux-test-project#787

Signed-off-by: Petr Vorel <pvorel@suse.cz>
@pevik
Copy link
Member

pevik commented Feb 15, 2021

Proposed fix posted to https://patchwork.ozlabs.org/project/ltp/patch/20210215110419.2964-1-pvorel@suse.cz/
Feel free to test it and add your Reviewed-by / Tested-by tag.

@Dmole
Copy link
Author

Dmole commented Feb 15, 2021

Thanks @pevik but that patch breaks with a false positive.

# make headers_install
# cd ../ltp
# apt-get -qq install gcc git make pkgconf autoconf automake bison flex m4 libc6-dev
# git apply ~/ltp.patch
# make clean > /dev/null 2>&1
# make autotools
autoconf
configure.ac:33: error: must install pkg-config or pkgconfig and pkg.m4 macro (usual dependency)
configure.ac:33: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
make: *** [/media/btrfs/ltp/include/mk/automake.mk:51: configure] Error 1


# git reset --hard
# make clean > /dev/null 2>&1
# make autotools
autoheader
automake -c -a
configure.ac:22: installing './compile'
configure.ac:20: installing './config.guess'
configure.ac:20: installing './config.sub'
configure.ac:4: installing './install-sh'
configure.ac:4: installing './missing'
make -C testcases/realtime autotools
make[1]: Entering directory '/media/btrfs/ltp/testcases/realtime'
aclocal -I /media/btrfs/ltp/testcases/realtime/m4
autoconf
autoheader
autoheader
automake -c -a
configure.ac:9: installing './compile'
configure.ac:12: installing './config.guess'
configure.ac:12: installing './config.sub'
configure.ac:4: installing './install-sh'
configure.ac:4: installing './missing'
make[1]: Leaving directory '/media/btrfs/ltp/testcases/realtime'

@Dmole Dmole closed this as completed Feb 15, 2021
@Dmole Dmole reopened this Feb 15, 2021
@Dmole
Copy link
Author

Dmole commented Feb 15, 2021

but now

# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
...
checking for add_key in -lkeyutils... no
./configure: line 7229: syntax error near unexpected token `LIBMNL,'
./configure: line 7229: `    PKG_CHECK_MODULES(LIBMNL, libmnl,'

apt install libmnl-dev

did not help.

I did a reset and clean and got the original AC_DEFINE error... how is this issue intermittent?
I think clean is not working properly as install-sh exists after it is run.

I'll use

rm -r ./*
git reset --hard

instead. Building...

@Dmole
Copy link
Author

Dmole commented Feb 15, 2021

Building worked.
I made a separate issue #788 for clean.
The patch is now testable and works, though I'd recommend re-wording it to something like

Missing dependency, please read the ./INSTALL file.

@pevik
Copy link
Member

pevik commented Feb 16, 2021

Yep, I should mention INSTALL file as well. But I'll certainly want to keep in the message what is missing: pkg-config and/or pkg.m4 macro.

@pevik pevik closed this as completed in 6e17e2b Feb 18, 2021
@pevik
Copy link
Member

pevik commented Feb 18, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants