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

PKG_CHECK_VAR macro fails #200

Closed
junka opened this issue Oct 29, 2018 · 6 comments
Closed

PKG_CHECK_VAR macro fails #200

junka opened this issue Oct 29, 2018 · 6 comments

Comments

@junka
Copy link

junka commented Oct 29, 2018

Since 0.23.13, PKG_CHECK_VAR was introduced, but it fails on most older os version.
Do you plan to consider adding a PKG_CHECK_VAR.m4 to make the source compatible with older os.

@ueno
Copy link
Member

ueno commented Oct 30, 2018

I doubt it would be useful because:

  • normal users are recommended to build from the released tarballs which doesn't need the macro (because it's inlined in aclocal.m4)
  • users bootstrapping from the git wouldn't mind copying the latest pkg.m4 from the upstream

So I would rather add something like:

m4_ifdef([PKG_PREREQ], [PKG_PREREQ(0.29)], [
  [m4_fatal([pkg.m4 is too old; put the latest version in build/m4])])

@Mythracis
Copy link

Mythracis commented Aug 21, 2023

Excuse me. I'm new to autoconf, but where can I copy the latest pkg.m4?
I tried copying this one (https://github.com/pkgconf/pkgconf/blob/master/pkg.m4) to p11-kit/build/m4 and then run
./autogen.sh --prefix=$HOME
but I still got
configure.ac:35: error: pkg.m4 is too old; copy the latest version in build/m4

Besides, I actually tried the released tarballs (https://github.com/p11-glue/p11-kit/releases/download/0.25.0/p11-kit-0.25.0.tar.xz) as you recommend to normal users. I managed to get it work, but still feel like to learn about pkg.m4. Thank you!

(For released tarball I did:
./configure --build=i686-pc-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 bashcompdir=$HOME/bash-completion/completion --prefix=$HOME make make install

@ueno
Copy link
Member

ueno commented Aug 21, 2023

https://github.com/pkgconf/pkgconf/blob/master/pkg.m4 seems like the canonical one.

I just tried to reproduce your problem by decreasing the PKG_MACROS_VERSION in /usr/share/aclocal/pkg.m4 and then copying the latest pkg.m4 in build/m4, but it worked as expected. It would be helpful if you could provide the complete log of autogen.sh.

@Mythracis
Copy link

Mythracis commented Aug 22, 2023

Thanks! @ueno

I downloaded pkg.m4
cd build/m4/
wget https://github.com/pkgconf/pkgconf/blob/master/pkg.m4
ls
. .. build-to-host.m4 .empty gettext.m4 host-cpu-c-abi.m4 iconv.m4 intlmacosx.m4 ld-version-script.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 pkg.m4 po.m4 progtest.m4

Then I ran
cd ../../
./autogen.sh --prefix=$HOME/local64 > autogen.log 2&1
cat autogen.log
autopoint: using AM_GNU_GETTEXT_REQUIRE_VERSION instead of AM_GNU_GETTEXT_VERSION

cat autogen.err
+ autoreconf --force --install --verbose
autoreconf: Entering directory `.'
autoreconf: running: autopoint --force
autoreconf: running: aclocal -I <$HOME>/local64/share/aclocal/ --force -I build/m4
configure.ac:35: error: pkg.m4 is too old; copy the latest version in build/m4
configure.ac:35: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

@ueno
Copy link
Member

ueno commented Aug 22, 2023

autoreconf: running: aclocal -I <$HOME>/local64/share/aclocal/ --force -I build/m4

This line is apparently causing the issue, though I'm not sure why this is happening. On my environment it is autoreconf: running: aclocal --force -I build/m4.

Is your autotools installation pristine?

I guess a workaround would be to directly call autoreconf instead of the autogen.sh script, with -B.

@Mythracis
Copy link

Sorry, aclocal -I <$HOME>/local64/share/aclocal/ is from my .bashrc for some other package. If I remove that I get
autoreconf: running: aclocal --force -I build/m4
configure.ac:35: error: pkg.m4 is too old; copy the latest version in build/m4

I tried direct autoreconf
autoreconf --install --force --prepend-include=/mnt/mbi/home/mbiwh/wine_lib_src/p11-kit/build/m4
autopoint: using AM_GNU_GETTEXT_REQUIRE_VERSION instead of AM_GNU_GETTEXT_VERSION
configure.ac:35: error: pkg.m4 is too old; copy the latest version in build/m4
configure.ac:35: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

Is that how -B is supposed to be used?

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

3 participants