Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / external / python3 / python-3.3.3-aix.patch.1
blob571d69a88f6bd07aaf1846aae03beda784f664b6
1 build with GCC on AIX
3 diff -ru python3.orig/configure python3/configure
4 --- python3.orig/configure      2015-07-26 17:10:18.218393484 +0200
5 +++ python3/configure   2015-07-26 17:29:44.460471779 +0200
6 @@ -3534,8 +3534,6 @@
7  else
8  
9         case $ac_sys_system in
10 -       AIX*)   CC=${CC:-xlc_r}
11 -               without_gcc=;;
12         *)      without_gcc=no;;
13         esac
14  fi
15 @@ -5787,10 +5785,18 @@
16               PY3LIBRARY=libpython3.so
17           fi
18            ;;
19 -    Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
20 +    Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|AIX*)
21           LDLIBRARY='libpython$(LDVERSION).so'
22 -         BLDLIBRARY='-L. -lpython$(LDVERSION)'
23 -         RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
24 +         case $ac_sys_system in
25 +           AIX*)
26 +             BLDLIBRARY='-Wl,-brtl -L. -lpython$(LDVERSION)'
27 +             RUNSHARED=LIBPATH=`pwd`:${LIBPATH}
28 +             ;;
29 +           *)
30 +             BLDLIBRARY='-L. -lpython$(LDVERSION)'
31 +             RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
32 +             ;;
33 +         esac
34           INSTSONAME="$LDLIBRARY".$SOVERSION
35           if test "$with_pydebug" != yes
36            then
37 @@ -8789,8 +8795,13 @@
38  then
39         case $ac_sys_system/$ac_sys_release in
40         AIX*)
41 -               BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
42 -               LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
43 +               if test "$GCC" = "yes"; then
44 +                 LDSHARED='$(CC) -shared'
45 +                 BLDSHARED='$(CC) -Wl,-brtl -shared'
46 +               else
47 +                 BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
48 +                 LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
49 +               fi
50                 ;;
51         IRIX/5*) LDSHARED="ld -shared";;
52         IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
53 diff -ru python3.orig/configure.ac python3/configure.ac
54 --- python3.orig/configure.ac   2015-07-05 18:50:08.000000000 +0200
55 +++ python3/configure.ac        2015-07-26 17:32:10.445481579 +0200
56 @@ -587,8 +587,6 @@
57                 without_gcc=$withval;;
58         esac], [
59         case $ac_sys_system in
60 -       AIX*)   CC=${CC:-xlc_r}
61 -               without_gcc=;;
62         *)      without_gcc=no;;
63         esac])
64  AC_MSG_RESULT($without_gcc)
65 @@ -1090,10 +1088,18 @@
66               PY3LIBRARY=libpython3.so
67           fi
68            ;;
69 -    Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
70 +    Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|AIX*)Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
71           LDLIBRARY='libpython$(LDVERSION).so'
72 -         BLDLIBRARY='-L. -lpython$(LDVERSION)'
73 -         RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
74 +         case $ac_sys_system in
75 +           AIX*)
76 +             BLDLIBRARY='-Wl,-brtl -L. -lpython$(LDVERSION)'
77 +             RUNSHARED=LIBPATH=`pwd`:${LIBPATH}
78 +             ;;
79 +           *)
80 +             BLDLIBRARY='-L. -lpython$(LDVERSION)'
81 +             RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
82 +             ;;
83 +         esac
84           INSTSONAME="$LDLIBRARY".$SOVERSION
85           if test "$with_pydebug" != yes
86            then
87 @@ -2164,8 +2170,13 @@
88  then
89         case $ac_sys_system/$ac_sys_release in
90         AIX*)
91 -               BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
92 -               LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
93 +               if test "$GCC" = "yes"; then
94 +                       LDSHARED='$(CC) -shared'
95 +                       BLDSHARED='$(CC) -Wl,-brtl -shared'
96 +               else
97 +                       BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp"
98 +                       LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
99 +               fi
100                 ;;
101         IRIX/5*) LDSHARED="ld -shared";;
102         IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
103 diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in
104 --- python3.orig/Makefile.pre.in        2015-07-05 18:50:07.000000000 +0200
105 +++ python3/Makefile.pre.in     2015-07-26 17:34:00.386488960 +0200
106 @@ -598,14 +598,17 @@
108  libpython$(LDVERSION).so: $(LIBRARY_OBJS)
109         if test $(INSTSONAME) != $(LDLIBRARY); then \
110 -               $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
111 +               $(BLDSHARED) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
112                 $(LN) -f $(INSTSONAME) $@; \
113         else \
114                 $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
115         fi
117  libpython3.so: libpython$(LDVERSION).so
118 -       $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
119 +       if [ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" != "aix" ]; then \
120 +               SONAME="-Wl,-h$@"; \
121 +       fi; \
122 +       $(BLDSHARED) $(NO_AS_NEEDED) -o $@ $(SONAME) $^
124  libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
125          $(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
126 @@ -1299,6 +1305,8 @@
127         export PATH; PATH="`pwd`:$$PATH"; \
128         export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
129         export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
130 +       export LD_LIBRARY_PATH; LD_LIBRARY_PATH="`pwd`${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"; \
131 +       export LIBPATH; LIBPATH="`pwd`${LIBPATH:+:$LIBPATH}"; \
132         export EXE; EXE="$(BUILDEXE)"; \
133         if [ -n "$(MULTIARCH)" ]; then export MULTIARCH; MULTIARCH=$(MULTIARCH); fi; \
134         export PYTHON_FOR_BUILD; \
135 diff -ru python3.orig/Modules/Setup.dist python3/Modules/Setup.dist
136 --- python3.orig/Modules/Setup.dist     2015-07-05 18:50:07.000000000 +0200
137 +++ python3/Modules/Setup.dist  2015-07-26 17:34:27.951490811 +0200
138 @@ -181,7 +181,7 @@
139  #_bisect _bisectmodule.c       # Bisection algorithms
140  #_heapq _heapqmodule.c # Heap queue algorithm
142 -#unicodedata unicodedata.c    # static Unicode character database
143 +unicodedata unicodedata.c    # static Unicode character database
146  # Modules with some UNIX dependencies -- on by default: