C_INCLUDE_PATH and gcc -I option

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Madhur

    C_INCLUDE_PATH and gcc -I option

    Hi,

    I would like to know the difference between using the
    C_INCLUDE_PATH and using the -I option with compilers. How are they
    different?

    The problem which I am facing is that I am having a
    source base which uses python. I am currently enabling compile time
    option _POSIX_C_SOURCE in my Makefile. The compilaiton fails if i
    include -I option to /usr/include/python2.4

    /usr/include/python2.4/pyconfig-32.h:838:1: error: "_POSIX_C_SOURC E"
    redefined

    but if i do

    export C_INCLUDE_PATH=/usr/include/python2.4

    I do not face any compilation issues.

    I would like to know if there is anything i am missing on this.


    Regards,
    Madhur
  • Antoninus Twink

    #2
    Re: C_INCLUDE_PATH and gcc -I option

    On 9 Jun 2008 at 13:46, Madhur wrote:
    The problem which I am facing is that I am having a
    source base which uses python. I am currently enabling compile time
    option _POSIX_C_SOURCE in my Makefile. The compilaiton fails if i
    include -I option to /usr/include/python2.4
    >
    /usr/include/python2.4/pyconfig-32.h:838:1: error: "_POSIX_C_SOURC E"
    redefined
    >
    but if i do
    >
    export C_INCLUDE_PATH=/usr/include/python2.4
    >
    I do not face any compilation issues.
    [guess]
    Does your build procedure include running some python script that reads
    the C_INCLUDE_PATH envrionment variable, but doesn't see -I... in
    CFLAGS?
    [/guess]

    Comment

    • Madhur

      #3
      Re: C_INCLUDE_PATH and gcc -I option

      There aren't any python scripts which reads C_INCLUDE_PATH.

      On Jun 9, 7:04 am, Antoninus Twink <nos...@nospam. invalidwrote:
      On 9 Jun 2008 at 13:46, Madhur wrote:
      >
      The problem which I am facing is that I am having a
      source base which uses python. I am currently enabling compile time
      option _POSIX_C_SOURCE in my Makefile. The compilaiton fails if i
      include -I option to /usr/include/python2.4
      >
      /usr/include/python2.4/pyconfig-32.h:838:1: error: "_POSIX_C_SOURC E"
      redefined
      >
      but if i do
      >
      export C_INCLUDE_PATH=/usr/include/python2.4
      >
      I do not face any compilation issues.
      >
      [guess]
      Does your build procedure include running some python script that reads
      the C_INCLUDE_PATH envrionment variable, but doesn't see -I... in
      CFLAGS?
      [/guess]

      Comment

      • Ben Bacarisse

        #4
        Re: C_INCLUDE_PATH and gcc -I option

        Madhur <madhurrajn@gma il.comwrites:
        I would like to know the difference between using the
        C_INCLUDE_PATH and using the -I option with compilers. How are they
        different?
        Best not to ask this sort of question. It asks for an essay on the
        differences when there may be only one detail that matters.
        The problem which I am facing is that I am having a
        source base which uses python. I am currently enabling compile time
        option _POSIX_C_SOURCE in my Makefile. The compilaiton fails if i
        include -I option to /usr/include/python2.4
        >
        /usr/include/python2.4/pyconfig-32.h:838:1: error: "_POSIX_C_SOURC E"
        redefined
        >
        but if i do
        >
        export C_INCLUDE_PATH=/usr/include/python2.4
        >
        I do not face any compilation issues.
        That is clear enough but it is better asked in gnu.gcc.help. I have
        sent this there and set followups-to.

        You can make it non-python specific if you like. I have just got the
        same behaviour from:

        --- m.c ---
        #define MACRO 0
        #include <x.h>

        MACRO
        -----------
        --- x.h ---
        #define MACRO 1
        -----------

        $ gcc -E -I. m.c

        gives the expected error, but setting C_INCLUDE_PATH= . makes the error
        vanish (even if the -I. parameter is kept).

        --
        Ben.

        Comment

        Working...