c_cpp:autoconf

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
c_cpp:autoconf [2019/02/04 18:52] – [参考文献] ともやんc_cpp:autoconf [2023/09/27 05:30] (現在) ともやん
行 2: 行 2:
 Autoconf は、さまざまなシステムに適応するようにソースコードパッケージを自動的に設定するシェルスクリプトを作成するためのツールです。\\ Autoconf は、さまざまなシステムに適応するようにソースコードパッケージを自動的に設定するシェルスクリプトを作成するためのツールです。\\
 Autoconf によって生成された設定スクリプトは、実行時に Autoconf から独立しているため、ユーザーは Autoconf をインストールしている必要はありません。\\ Autoconf によって生成された設定スクリプトは、実行時に Autoconf から独立しているため、ユーザーは Autoconf をインストールしている必要はありません。\\
 +\\
 +各種コマンドは以下のパッケージに含まれる。\\
 +<code>
 +$ sudo dnf install automake
 +</code>
 +
 ===== ビルドまでの流れ ===== ===== ビルドまでの流れ =====
 <html> <html>
行 18: 行 24:
   </style>   </style>
   <script>   <script>
-    jQuery(function() {+    /*jQuery(function() {
       // toc をフロー図の上に重ねて、フロー図の幅が縮まない様にする       // toc をフロー図の上に重ねて、フロー図の幅が縮まない様にする
       jQuery("#dw__toc > div").css({"position": "absolute", "background-color": "white"});       jQuery("#dw__toc > div").css({"position": "absolute", "background-color": "white"});
行 31: 行 37:
       // rowspan でフロー図の列を連結する       // rowspan でフロー図の列を連結する
       jQuery("#autoconf_workflow > div > table > tbody > tr.row1 > td.col2").attr('rowspan', row);       jQuery("#autoconf_workflow > div > table > tbody > tr.row1 > td.col2").attr('rowspan', row);
-    });+    });*/
   </script>   </script>
 </html> </html>
行 64: 行 70:
 </WRAP> </WRAP>
 ※開発者ではない一般ユーザーは、STEP8 で ./configure; make のみでビルドを行う。\\ ※開発者ではない一般ユーザーは、STEP8 で ./configure; make のみでビルドを行う。\\
 +
 +===== ディレクトリ構成 =====
 +以下の構造を想定している。
 +<code>
 +autoconf_sample  (directory)
 +   +-AUTHORS     (file)
 +   +-ChangeLog   (file)
 +   +-INSTALL     (file)
 +   +-LICENSE     (file)
 +   +-Makefile.am (file)
 +   +-NEWS        (file)
 +   +-README      (file)
 +   +-configure.ac (file)
 +   +-src         (directory)
 +      +hello.cpp (file)
 +</code>
  
 ===== C++ サンプルの準備 ===== ===== C++ サンプルの準備 =====
行 108: 行 130:
 空ファイルでも構わないので、INSTALL、NEWS、README、LICENSE、AUTHORS、ChangeLog のファイルを準備する。\\ 空ファイルでも構わないので、INSTALL、NEWS、README、LICENSE、AUTHORS、ChangeLog のファイルを準備する。\\
 <WRAP prewrap 100%><code> <WRAP prewrap 100%><code>
-$ touch INSTALL NEWS README LICENSE AUTHORS ChangeLog+$ touch AUTHORS ChangeLog INSTALL LICENSE NEWS README
 </code></WRAP> </code></WRAP>
 Makefile.am を作成する。\\ Makefile.am を作成する。\\
行 115: 行 137:
 </code> </code>
 <file autoconf Makefile.am> <file autoconf Makefile.am>
-# ソースファイルのサブディレクトリの指定 
-SUBDIRS = src 
-</file> 
-src/Makefile.am を作成する。\\ 
-<code> 
-$ vi src/Makefile.am 
-</code> 
-<file autoconf src/Makefile.am> 
 # 作成する実行ファイル名 # 作成する実行ファイル名
 bin_PROGRAMS = hello bin_PROGRAMS = hello
 # 実行ファイルのソースコード # 実行ファイルのソースコード
-hello_SOURCES = hello.cpp+hello_SOURCES = src/hello.cpp
  
 # C++コンパイラオプション # C++コンパイラオプション
行 183: 行 197:
 AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
  
-AM_INIT_AUTOMAKE([1.16 foreign])+AM_INIT_AUTOMAKE([1.16 subdir-objects foreign])
  
 # Checks for programs. # Checks for programs.
行 217: 行 231:
 # Checks for library functions. # Checks for library functions.
  
-AC_CONFIG_FILES([Makefile +AC_CONFIG_FILES([Makefile])
-                 src/Makefile])+
 AC_OUTPUT AC_OUTPUT
 </file> </file>
行 247: 行 260:
 configure.ac:9: installing './install-sh' configure.ac:9: installing './install-sh'
 configure.ac:9: installing './missing' configure.ac:9: installing './missing'
-src/Makefile.am: installing './depcomp'+Makefile.am: installing './depcomp'
 </code> </code>
  
行 297: 行 310:
 configure: creating ./config.status configure: creating ./config.status
 config.status: creating Makefile config.status: creating Makefile
-config.status: creating src/Makefile 
 config.status: creating config.h config.status: creating config.h
 config.status: config.h is unchanged config.status: config.h is unchanged
 config.status: executing depfiles commands config.status: executing depfiles commands
-make  all-recursive +make  all-am 
-make[1]: ディレクトリ '/home/tomoyan/my_projects/Autoconf_Sample' に入ります +make[1]: ディレクトリ '/home/tomoyan/my_projects/autoconf_sample' に入ります 
-Making all in src +depbase=`echo src/hello.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ 
-make[2]: ディレクトリ '/home/tomoyan/my_projects/Autoconf_Sample/srcに入ります +g++ -DHAVE_CONFIG_H -I.   -I/usr/lib64/wx/include/gtk3-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__  -g -O2  -MT src/hello.o -MD -MP -MF $depbase.Tpo -c -o src/hello.o src/hello.cpp &&\ 
-g++ -DHAVE_CONFIG_H -I. -I..   -I/usr/lib64/wx/include/gtk3-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__  -g -O2  -MT hello.o -MD -MP -MF .deps/hello.Tpo -c -o hello.o hello.cpp +mv -f $depbase.Tpo $depbase.Po 
-mv -f .deps/hello.Tpo .deps/hello.Po +g++  -g -O2    -o hello src/hello.o  -pthread   -lwx_gtk3u_xrc-3.0 -lwx_gtk3u_webview-3.0 -lwx_gtk3u_html-3.0 -lwx_gtk3u_qa-3.0 -lwx_gtk3u_adv-3.0 -lwx_gtk3u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0  
-g++  -g -O2    -o hello hello.o  -pthread   -lwx_gtk3u_xrc-3.0 -lwx_gtk3u_webview-3.0 -lwx_gtk3u_html-3.0 -lwx_gtk3u_qa-3.0 -lwx_gtk3u_adv-3.0 -lwx_gtk3u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0  +make[1]: ディレクトリ '/home/tomoyan/my_projects/autoconf_sample' から出ます
-make[2]: ディレクトリ '/home/tomoyan/my_projects/Autoconf_Sample/src' から出ます +
-make[2]: ディレクトリ '/home/tomoyan/my_projects/Autoconf_Sample' に入ります +
-make[2]: ディレクトリ '/home/tomoyan/my_projects/Autoconf_Sample' から出ます +
-make[1]: ディレクトリ '/home/tomoyan/my_projects/Autoconf_Sample' から出ます+
 </code> </code>
  
 ===== hello の実行 ===== ===== hello の実行 =====
 <code> <code>
-src/hello+./hello
 10 20 30 10 20 30
 </code> </code>
行 322: 行 330:
 ===== 参考文献 ===== ===== 参考文献 =====
 [[https://www.gnu.org/software/autoconf/manual/autoconf.html|Autoconf]]\\ [[https://www.gnu.org/software/autoconf/manual/autoconf.html|Autoconf]]\\
-[[http://web.sfc.wide.ad.jp/~sagawa/gnujdoc/autoconf-2.59/index.html|Autoconf: Autoconf]]\\+[[http://web.sfc.wide.ad.jp/~sagawa/gnujdoc/autoconf-2.59/index.html|Autoconf: Autoconf-2.59(日本語訳)]]\\
 [[https://sourceware.org/autobook/|GNU Autoconf, Automake and Libtool]]\\ [[https://sourceware.org/autobook/|GNU Autoconf, Automake and Libtool]]\\
 [[https://qiita.com/kagemiku/items/5aed05f7bd70d8035f54|Autotoolsを使ってプロジェクトのMakefileを生成する]]\\ [[https://qiita.com/kagemiku/items/5aed05f7bd70d8035f54|Autotoolsを使ってプロジェクトのMakefileを生成する]]\\
  
  • c_cpp/autoconf.1549273932.txt.gz
  • 最終更新: 2019/05/18 02:23
  • (外部編集)