]> granicus.if.org Git - php/commitdiff
Fix shared module generation on AIX bug #77676
authorKevin Adler <kadler@us.ibm.com>
Mon, 18 Feb 2019 17:01:23 +0000 (11:01 -0600)
committerPeter Kokot <peterkokot@gmail.com>
Sat, 2 Mar 2019 17:45:55 +0000 (18:45 +0100)
Makefiles for PHP extensions generated by phpize expect the PHP_MODULES
to contain a list of libtool .la files so that it can read the $dlname
variable from them by sourcing them in to a shell. On AIX, the code was
setting PHP_MODULES to a list of .so files, which meant the dlname was
blank, preventing the tests from being able to run.

Change the AIX code path in the PHP_SHARED_MODULE macro to match the
output on other platforms, using libtool .la files.

acinclude.m4

index 6249cb92e6f115f0305012a7bd18924aa0eb8561..6b94af5dd74241e9646d21f61cf7a6ba6ece3c52 100644 (file)
@@ -836,15 +836,11 @@ dnl from object_var in build-dir.
 dnl
 AC_DEFUN([PHP_SHARED_MODULE],[
   install_modules="install-modules"
+  suffix=la
 
   case $host_alias in
     *aix*[)]
-      suffix=so
-      link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$3'/$1.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD) && mv -f '$3'/.libs/$1.so '$3'/$1.so'
-      ;;
-    *[)]
-      suffix=la
-      link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
+      additional_flags="-Wl,-G"
       ;;
   esac
 
@@ -859,7 +855,7 @@ AC_DEFUN([PHP_SHARED_MODULE],[
        \$(LIBTOOL) --mode=install cp $3/$1.$suffix \$(phplibdir)
 
 $3/$1.$suffix: \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_DEPENDENCIES)
-       $link_cmd
+       \$(LIBTOOL) --mode=link ifelse($4,,[\$(CC)],[\$(CXX)]) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) $additional_flags -o [\$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
 
 EOF
 ])