开发者

How to specify makeargs in configure script?

while building how to give includ开发者_运维知识库e paths and library paths in configure script with --makeargs= ? I mean what is the syntax for makeargs.


You set these flags either in the environment or on the ./configure command line. There are three variables to set:

  • CPPFLAGS is flags for the C preprocessor. Include flags (-I) go here, as do -D definitions.
  • CFLAGS are flags for the C compiler. Optimisation flags and machine-specific flags go here.
  • LDFLAGS are for the linker. -L flags go here.

You can set them in the evironment:

$ export CPPFLAGS='-I/foo/bar/baz/include'
$ export LDFLAGS='-L/foo/bar/baz/lib'
$ ./configure

Or you can set them on the command line:

$ ./configure CFLAGS='-I/foo/bar/baz/include' LDFLAGS='-L/foo/bar/baz/lib'


Generally it's safer to use two macros instead of one. One for include directives and one for linking directives:

AC_ARG_WITH(cflags,
[  --with-cflags=CFLAGS            use CFLAGS as compile time arguments.],
    [CFLAGS=$with_cflags; export CFLAGS])

AC_ARG_WITH(ldflags,
[  --with-ldflags=LDFLAGS          use LDFLAGS as link time arguments to ld.],
    [LDFLAGS=$with_ldflags; export LDFLAGS])

Then ./configure --with-cflags="-I/path/one -I/path/two" --with-ldflags="-L/path/other" work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜