如何让libtool不链接生成脚本文件

3120阅读 0评论2013-05-08 moon_rock
分类:LINUX

对于很多开源库,他们一般都提供automake的编译发布形式,也就是三步曲:./configure && make && make install。
gdb hello-world如下:
  1. flushthink@gentoo64 ~/work/libevent-2.0.21-stable/sample $ gdb hello-world
  2. GNU gdb (Gentoo 7.5.1 p2) 7.5.1
  3. Copyright (C) 2012 Free Software Foundation, Inc.
  4. License GPLv3+: GNU GPL version 3 or later <
  5. This is free software: you are free to change and redistribute it.
  6. There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"
  7. and \"show warranty\" for details.
  8. This GDB was configured as \"x86_64-pc-linux-gnu\".
  9. For bug reporting instructions, please see:
  10. <
  11. \"/home/flushthink/work/libevent-2.0.21-stable/sample/hello-world\": not in executable format: File format not recognized
  12. (gdb)
file hello-world如下:
  1. flushthink@gentoo64 ~/work/libevent-2.0.21-stable/sample $ file hello-world
  2. hello-world: POSIX shell script, ASCII text executable
vim hello-world如下:
  1. flushthink@gentoo64 ~/work/libevent-2.0.21-stable/sample $ vim hello-world
  2. #! /bin/sh
  3. # hello-world - temporary wrapper script for .libs/hello-world
  4. # Generated by libtool (GNU libtool) 2.4.2
  5. #
  6. # The hello-world program cannot be directly executed until all the libtool
  7. # libraries that it depends on are installed.
  8. #
  9. # This wrapper script should never be moved out of the build directory.
  10. # If it is, it will not operate correctly.
  11. # Sed substitution that helps us do robust quoting. It backslashifies
  12. # metacharacters that are still active within double-quoted strings.
查automake在线文档发现:
-no-install Link an executable output-file that can't be installed and therefore doesn't need a wrapper script on systems that allow hardcoding of library paths. Useful if the program is only used in the build tree, e.g., for testing or generating other files.

得出了结论(可以./configure --help查看):
./configure --disable-libevent-install && make
这样就可以直接调试了。
上一篇:zeromq自称最快纯粹是个噱头
下一篇:mmorpg到底难做在那?