Home > pgsql > PostgreSQLのconfigure時の環境変数

PostgreSQLのconfigure時の環境変数

PostgreSQL で ./configure --help すると、

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
          nonstandard directory <lib dir>
  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
          headers in a nonstandard directory <include dir>
  CPP         C preprocessor
  LDFLAGS_SL
  DOCBOOKSTYLE
          location of DocBook stylesheets

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

と出てくるわけだけど、全てが上手く動作するわけではないらしい。

src/template/win32 なんかは LDFLAGS を思いっきり上書きしちゃってるじゃないか。

$ cat src/template/win32
# This is required to link pg_dump because it finds pg_toupper() in
# libpq and pgport
LDFLAGS="-Wl,--allow-multiple-definition"

で、-L を追加したい場合は、LDFLAGS ではなく --with-libs=DIRS を、-I を追加したいときは CPPFLAGS ではなく --with-includes=DIRS を使った方が安全。

ちなみに src/template/* が CFLAGS を上書きしていたとしても、configure の中でうまいこと処理してくれているみたいなので問題無い。

Writeback:1

from 2007/01/30 (Tue) 14:37:39
Comment Form

writeback message: Ready to post a comment.

TrackBack ping me at
http://www.mono-space.net/blog/pgsql/e061006_configure.trackback

Page Top