Skip to content

Move include Python.h up #5

@mpasserini

Description

@mpasserini

I'm getting this error when compiling on:
CentOS Linux release 7.6.1810 (Core)
gcc-4.8.5-36.el7_6.1.x86_64
python-pam-0.1.4-1.el7.noarch
Python 2.7.5

`[root@marco-http-server pam-python]# make
[...]
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Werror -I/usr/local/lib/ -fPIC -DLIBPYTHON_SO="libpython2.7.so.1.0" -I/usr/include/python2.7 -c pam_python.c -o build/temp.linux-x86_64-2.7/pam_python.o
In file included from /usr/include/python2.7/pyconfig.h:6:0,
from /usr/include/python2.7/Python.h:8,
from pam_python.c:43:
/usr/include/python2.7/pyconfig-64.h:1213:0: error: "_XOPEN_SOURCE" redefined [-Werror]
#define _XOPEN_SOURCE 600
^
In file included from /usr/include/stdlib.h:24:0,
from /usr/include/security/_pam_macros.h:12,
from pam_python.c:33:
/usr/include/features.h:170:0: note: this is the location of the previous definition

define _XOPEN_SOURCE 700

^
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1
make[1]: *** [pam_python.so] Error 1
make[1]: Leaving directory /root/pam-python/src'
make: *** [lib] Error 2`

I think it's related to AcademySoftwareFoundation/OpenImageIO#1938

The solution for me was to move the following include of Python.h up to line 30
https://github.com/Ralnoc/pam-python/blob/master/src/pam_python.c#L43

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions