Ruby/C/Makefile,-lpcap/#include中使用的默认 pcap.h 文件是什么?
如何确定通过 Makefile 编译/安装的 C 源代码中包含哪些 pcap.h 文件?
具体来说,它是一个 Ruby 库 (pcaprub),通过以下方式安装:
ruby extconf.rb && make && make install
extconf.rb 是:
require 'mkmf'
if /i386-mswin32/ =~ RUBY_PLATFORM
pcap_dir = with_config("pcap-dir", "C:\WpdPack")
pcap_includedir = with_config("pcap-includedir", pcap_dir + "\\include")
pcap_libdir = with_config("pcap-libdir", pcap_dir + "\\lib")
$CFLAGS = "-DWIN32 -I#{pcap_includedir}"
$LDFLAGS = "/link /LIBPATH:#{pcap_libdir}"
have_library("wpcap", "pcap_open_live")
have_library("wpcap", "pcap_setnonblock")
else
have_library("pcap", "pcap_open_live")
have_library("pcap", "pcap_setnonblock")
end
if ( RUBY_VERSION =~ /^1\.9/ )
$CFLAGS += " -DRUBY_19"
end
create_makefile("pcaprub")
How can I determine what pcap.h file is being included in a C source that is being compiled/installed via a Makefile?
Specifically, it is a Ruby library (pcaprub) that is being installed via:
ruby extconf.rb && make && make install
and the extconf.rb is:
require 'mkmf'
if /i386-mswin32/ =~ RUBY_PLATFORM
pcap_dir = with_config("pcap-dir", "C:\WpdPack")
pcap_includedir = with_config("pcap-includedir", pcap_dir + "\\include")
pcap_libdir = with_config("pcap-libdir", pcap_dir + "\\lib")
$CFLAGS = "-DWIN32 -I#{pcap_includedir}"
$LDFLAGS = "/link /LIBPATH:#{pcap_libdir}"
have_library("wpcap", "pcap_open_live")
have_library("wpcap", "pcap_setnonblock")
else
have_library("pcap", "pcap_open_live")
have_library("pcap", "pcap_setnonblock")
end
if ( RUBY_VERSION =~ /^1\.9/ )
$CFLAGS += " -DRUBY_19"
end
create_makefile("pcaprub")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查看生成的
Makefile
以了解哪些-I
选项被传递给gcc
吗?您还可以将-H
传递给gcc
以显示它最终使用的头文件:Can you look at the generated
Makefile
to see what-I
options are being passed togcc
? You can also pass-H
togcc
to display the header file that it ends up using: