How to specify include directory for configure script

后端 未结 4 1792
隐瞒了意图╮
隐瞒了意图╮ 2021-02-04 03:34

I have a linux system at my workplace with pretty old packages and no root access. I\'m compiling packages that I need from source with --prefix=[somewhere in homedir]

相关标签:
4条回答
  • 2021-02-04 04:04

    It's better to use CPPFLAGS to specify include directories.

    ./configure CPPFLAGS="-I/your/whatever/includedir"
    
    0 讨论(0)
  • 2021-02-04 04:11
    CPPFLAGS = C Preprocessor Flags, these flags will be used for C and C++ compilation.
    
    CFLAGS = C Flags, these flags will be used when compiling C.
    
    CXXFLAGS = C++ Flags, these flags will be used when compiling C++.
    

    The -I flag specifies an additional include directory to be used during compilation.

    Generally it's a good idea to use CPPFLAGS when specifying include directories, that way you know it will be used even if the project has some source that is compiled as C.

    Of course, there might also be circumstances where you only want the include directory to be used by C or C++, but not both. In which case you would obviously be better served by using CFLAGS or CXXFLAGS instead.

    0 讨论(0)
  • 2021-02-04 04:14

    Usually you can pass additional compiler flags inside CXXFLAGS. For gcc you can specify more include directories with -I/some/dir, e.g.

    $ ./configure CXXFLAGS="-I/some/dir/"
    

    where /some/dir/ contains your headers.

    0 讨论(0)
  • 2021-02-04 04:24

    The normal way to do this is --with-<feature>=<header directory>.

    0 讨论(0)
提交回复
热议问题