Skip to content

Update autoconf script #8514

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

Closed
wants to merge 2 commits into from
Closed

Update autoconf script #8514

wants to merge 2 commits into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented May 8, 2022

Fixes autoconf warnings

@nikic
Copy link
Member

nikic commented May 8, 2022

libtool.m4 is a bundled file.

@Girgias
Copy link
Member Author

Girgias commented May 8, 2022

I cloned the latest version of libtools and it seems those issues are fixed, but I'm not sure how I'm meant to upgrade our bundled copy.

@cmb69
Copy link
Member

cmb69 commented May 11, 2022

Ugh, looks like we're having a patched libtool.m4 1.5.26 (which was released 14 years ago).

@arnaud-lb
Copy link
Member

Fortunately the diff is not huge: https://gist.github.com/arnaud-lb/71a04e27eb3699a534defe0871bfa3cd. Some the changes do not appear to exist in the latest libtool, but others are cosmetic or backports.

@adoy adoy removed this from the PHP 8.2 milestone Feb 16, 2023
@@ -16,7 +16,7 @@ m4_include([TSRM/tsrm.m4])
dnl Basic autoconf initialization, generation of config.nice.
dnl ----------------------------------------------------------------------------

AC_PREREQ([2.68])
AC_PREREQ([2.69])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AC_PREREQ([2.69])
AC_PREREQ([2.68])

I'd leave this for now as it is.

AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
AC_LANG_RESTORE])
[AC_LANG_PUSH([C])
AC_LINK_IFELSE(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AC_LINK_IFELSE(
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])

In one line it is simpler to compare it with possible upstream version.

@petk
Copy link
Member

petk commented Mar 9, 2023

I'd also add this one:

@@ -271,7 +271,7 @@ $rm -r conftest*
 
 dnl autoconf 2.13 compatibility
 dnl _LT_AC_TRY_LINK()
-AC_DEFUN(_LT_AC_TRY_LINK, [
+AC_DEFUN([_LT_AC_TRY_LINK], [
 cat > conftest.$ac_ext <<EOF
 dnl This sometimes fails to find confdefs.h, for some reason.
 dnl [#]line __oline__ "[$]0"

@petk
Copy link
Member

petk commented Mar 9, 2023

For the libtool.m4 file upgrade I'd suggest that PHP stays with a forked Libtool 1.5.26. Upgrade to the latest 2.4.x version is possible but contains so many annoyances and possible breakages that I don't think is worth of trouble. And another issue is that this latest libtool 2.4.x would also need some heavy patching from various places and pull requests. Maintenance at GNU hasn't followed all the requests out there.

We've already discussed this in the past, btw.

This is how unbundling libtool would look like approximately:

And this is how upgrade would look like approximately:

@andypost
Copy link
Contributor

andypost commented Apr 8, 2023

Used to apply as patch and build on Alpinelinux - all warnings are gone!

Meantime when I build apache2 SAPI (--with-apxs2) I see some debug listed, checked build logs and looks it's here last few years

example https://gitlab.alpinelinux.org/andypost/aports/-/jobs/1006143

Configuring SAPI modules
checking for Apache 2 handler module support via DSO through APXS... APACHE_CFLAGS=' -I/usr/include/apache2   -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1   -I/usr/include/apr-1  -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1'
APORTSDIR='/mnt'
APR_BINDIR='/usr/bin'
APR_CFLAGS='  -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1 '
APR_CONFIG='/usr/bin/apr-1-config'
APU_BINDIR='/usr/bin'
APU_CFLAGS=' -I/usr/include/apr-1 '
APU_CONFIG='/usr/bin/apu-1-config'
APXS='apxs'
APXS_BINDIR='/usr/bin'
APXS_CFLAGS='-Os -fomit-frame-pointer'
APXS_HTTPD='/usr/sbin/httpd'
APXS_INCLUDEDIR='/usr/include/apache2'
...

@andypost
Copy link
Contributor

andypost commented May 7, 2023

What's left here to make it commitable?

@Girgias
Copy link
Member Author

Girgias commented May 8, 2023

Everything? I don't understand libtools nor how we should go about updating our built-in libtools.

I'm going to close this as I don't know how I can proceed but feel free to open a new PR as you seems to have more expertise in build systems than I do.

@Girgias Girgias closed this May 8, 2023
@Girgias Girgias deleted the libtools branch May 8, 2023 09:09
@petk
Copy link
Member

petk commented May 8, 2023

I'll make a patch for this issue: #11207

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

Successfully merging this pull request may close these issues.

8 participants