linux用autoconf系列工具產生makefile和可執行檔__linux

來源:互聯網
上載者:User

進入xx.cpp的目錄,運行shell指令:

dpkg --configure -aapt-get install autoconfautoscancp configure.scan configure.acvim configure.ac

在configure.ac中,需要添加 AM_INIT_AUTOMAKE 宏,send_rtp是最後產生的檔案名稱,別的不用管,xx.cpp有一個就行,例如:

AC_PREREQ([2.69])AC_INIT(send_rtp, 1.0, dongzy08@163.com)AM_INIT_AUTOMAKE(send_rtp,1.0)AC_CONFIG_SRCDIR([H264Encoder.cpp])AC_CONFIG_HEADERS([config.h])# Checks for programs.AC_PROG_CXXAC_PROG_CC

還有一處,指定輸出的名稱為Makefile

AC_OUTPUT(Makefile)

繼續執行shell指令:

aclocalautoconf autoheadervim Makefile.am
對於Makefile.am,需要編輯一下,如下:

AUTOMAKE_OPTIONS=foreignbin_PROGRAMS=send_rtpsend_rtp_SOURCES=H264Encoder.cpp inttypes.h rtpframe.h H264Encoder.h main.cpp h264frame.cxx h264frame.h
其中bin_PROGRAMS是最後產生的檔案名稱,send_rtp_SOURCES是所有的源檔案名稱。

繼續執行shell指令:

automake --add-missing./configure  make make all

最後就能產生send_rtp的可執行檔了。


相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.