Skip to content

Cleanup autotools scripts #16

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

Merged
merged 4 commits into from
Jan 31, 2023
Merged

Cleanup autotools scripts #16

merged 4 commits into from
Jan 31, 2023

Conversation

NattyNarwhal
Copy link
Member

  • Assumes PHP's autotools functions are from at least 2005.
  • Simplify the search for libraries and includes.
  • For PASE, simplify search, and support SG's libdb400 wrapper (used because of AIX loader limitatioons).

Fixes GH-14

This massively simplifies the logic, removes spurious messages,
and adds support for Seiden Group's libdb400 shim.
@NattyNarwhal
Copy link
Member Author

Two thoughts:

  • I don't know what the AIX check is for. It's been there from the beginning.
  • The PASE check could be simplified further if we convert all references of the PASE define to __PASE__.

Copy link

@kadler kadler left a comment

Choose a reason for hiding this comment

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

LGTM

@kadler
Copy link

kadler commented Jan 30, 2023

Looks like __H_LOCALEDEF prevents inclusion of sys/localedef.h in ctype.h, langinfo.h, and stdlib.h. I have no idea why that would matter, though. Perhaps a workaround for some old bug? Certainly doesn't seem to be a problem when building on PASE, which would have the same issue as AIX.

@NattyNarwhal
Copy link
Member Author

Looking at the 32/64-bit check, could avoid checking the "wrong" one by:

  1. what PHP exts do, i.e. ldap:
    AC_CHECK_SIZEOF([long])
    AC_MSG_CHECKING([if we're at 64-bit platform])
    AS_IF([test "$ac_cv_sizeof_long" -eq 4],[
      AC_MSG_RESULT([no])
      PHP_OCI8_IC_LIBDIR_SUFFIX=""
    ],[
      AC_MSG_RESULT([yes])
      PHP_OCI8_IC_LIBDIR_SUFFIX=64
    ])
  1. what ibm_db2 does, calling PHP at runtime (might be fragile?):
  AC_MSG_CHECKING(PHP)
  if test `php -r 'echo PHP_INT_SIZE;'` = 8; then
    machine_bits=64
    libDir=lib64
    AC_MSG_RESULT(Detected 64-bit PHP)
  else
    machine_bits=32
    libDir=lib32
    AC_MSG_RESULT(Detected 32-bit PHP)
  fi

kadler points out this wouldn't have triggered on PASE, which should
have in theory the same issues as AIX. We'll have to see if this
breaks AIX LUW.
@kadler
Copy link

kadler commented Jan 30, 2023

Yeah, checking ac_cv_sizeof_long and checking lib32/lib64 as appropriate would be good.

NattyNarwhal added a commit to php/pecl-database-ibm_db2 that referenced this pull request Jan 30, 2023
@NattyNarwhal NattyNarwhal merged commit 638febe into master Jan 31, 2023
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

Successfully merging this pull request may close these issues.

PHP 8.1.11 (phpenv) cannot find pdo_ibm.so on Ubuntu 20.04
2 participants