Re: GDB Python extension on AIX

David Edelsohn <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAGWvny=hQZD+dEo3HCisM7m7A5ajoa1ne_pGEXQ424YU0cO1sQ@mail.gmail.com>
On Fri, Aug 19, 2016 at 1:49 AM, Joel Brobecker <[email protected]> wrote:
>> I'm not sure what a "standard" location is on AIX.  I was using the
>> Bull Freeware installation of Python in /opt/freeware.
>>
>> Was the Python installation found and recognized on your AIX system?
>> Until some of my more recent changes, GDB configure did not consider
>> the installation correct to try to build the GDB feature.
>
> In our case, we configure GDB with --with-python=/path/to/python,
> so it doesn't need to be a location that the configury would find
> by itself. In your case, I think what's happening is that you have
> /opt/freeware/bin in your PATH, and that allows the GDB configury
> to find that python and therefore use it.

This probably relates to the original conflict between implicit and
explicit paths that you were trying to fix

Would the appended patch be an acceptable approach?

Thanks, David

gdb/
* python/python-internal.h: Don't redefine _POSIX_C_SOURCE and
_XOPEN_SOURCE on AIX.

diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 8545c7b..6378ccc 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -72,8 +72,12 @@
    To work around this, undef _POSIX_C_SOURCE before we include Python.h.

    Same problem with _XOPEN_SOURCE.  */
+
+/* A kludge to avoid overriding on AIX.  */
+#ifndef _AIX
 #undef _POSIX_C_SOURCE
 #undef _XOPEN_SOURCE
+#endif

 /* On sparc-solaris, /usr/include/sys/feature_tests.h defines
    _FILE_OFFSET_BITS, which pyconfig.h also defines.  Same work
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.