您的位置:首页 > 理论基础 > 计算机网络

UNIX网络编程 源码如何编译

2009-06-14 22:49 399 查看
1、你的机器要装GCC(我试过别的编译器,好像是不支持的),如果没有装就到网上下一个GCC编译器,和标准库。安装过程没有什么特别的,记得最后在PATH里加上GCC的路径和在LD_LIBRARY_PATH里面加上标准库的路径。

2、按照README的操作执行:

    gunzip -c unpv12e.tar.gz | tar xvf -

    cd unpv12e
    ./configure    # try to figure out all implementation differences

    cd lib         # build the basic library that all programs need
    make           # use "gmake" everywhere on BSD/OS systems

    cd ../libfree  # continue building the basic library
    make

    cd ../libgai   # the getaddrinfo() and getnameinfo() functions
    make

    cd ../libroute # only if your system supports 4.4BSD style routing sockets
    make           # only if your system supports 4.4BSD style routing sockets

    cd ../libxti   # only if your system supports XTI
    make           # only if your system supports XTI

    cd ../intro    # build and test a basic client program
    make daytimetcpcli
    ./daytimetcpcli 127.0.0.1

3、按照上面的每一步执行就行了,不过我在编译libroute 时没有编译过,目前还没有发现这个包的作用。等以后有问题了再看吧。

4、以上就是源码使用的全过程,你必须掌握以下几点:GCC的使用,安装;拿到源码后有先看一下README文档的习惯;熟悉make,至少要看的懂别人的MAKEFILE文件。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息