ソースから gperf (Google のプロファイラー) をビルドしようとしています。ビルド プロセス中に、次のエラーが発生します。
src/stacktrace_config.h:58:5: error: #error Cannnot calculate stack trace: need either libunwind or frame-pointers (see INSTALL file)
src/stacktrace.cc:109:3: error: #error Cannot calculate stack trace: will need to write for your environment
make: *** [stacktrace.lo] Error 1
だから私は必要なようですlibunwind。
1) サバンナの git リポジトリからライブラリを取得しました。2) にインストールしました/opt/unwind。3) にも追加/opt/unwind/lib/pkgconfigしましたPKG_CONFIG_PATH。libunwind.pc4)両方pkg-config --cflags --libs libunwindが正しい値になるように編集しました。5) を指すlibunwind.confinを追加しました。/etc/ld.so.conf.d//opt/unwind/lib
これらすべての後./configure、gperfルートディレクトリで再実行しました。
次のconfig.log読み取り:
configure:15852: checking libunwind.h usability
configure:15852: gcc -c -g -O2 conftest.c >&5
conftest.c:67:23: fatal error: libunwind.h: No such file or directory
compilation terminated.
configure:15852: result: no
<***snip****>
configure:15852: checking libunwind.h presence
configure:15852: gcc -E conftest.c
conftest.c:34:23: fatal error: libunwind.h: No such file or directory
compilation terminated.
<***snip***>
ac_cv_header_libunwind_h=no
ということで、まだどこにあるのかわからないそうlibunwindです。
次に、次のように CFLAGS と LDFLAGS を使用して環境変数を設定しようとしました。
arif@khost:~/src/gperf$ CFLAGS=`pkg-config --cflags libunwind` LDFLAGS=`pkg-config --libs libunwind` ./configure
今config.logはもっと不可解に思えます:
configure:15852: checking libunwind.h usability
configure:15852: gcc -c -I/opt/unwind/include conftest.c >&5
configure:15852: $? = 0
configure:15852: result: yes
configure:15852: checking libunwind.h presence
configure:15852: gcc -E conftest.c
conftest.c:34:23: fatal error: libunwind.h: No such file or directory
compilation terminated.
最初にあると報告しますがlibunwind.h、後でそれを見つけることができません。
config.logこの興味深いエントリもあります:
configure:15852: WARNING: libunwind.h: accepted by the compiler, rejected b y the preprocessor!
configure:15852: WARNING: libunwind.h: proceeding with the compiler's result
また、その我慢ac_cv_header_libunwind_h=yes
ここで行うmakeと、次のエラーで停止します。
In file included from src/stacktrace.cc:65:0:
src/stacktrace_libunwind-inl.h:46:23: fatal error: libunwind.h: No such file or directory
compilation terminated.
make: *** [stacktrace.lo] Error 1