====make file
使用autoscan把目录中的所有源码文件生成一个configure.scan。
mv configure.scan configure.in
sublime configure.in #修改其中内容
aclocal #create m4
autoconf #create configure using m4
创建Makefile.am,并加入内容。
automake --add-missing #create Makefile.in from am
./configure #create Makefile
make #make
./hellomake #run it
===configure.in内容说明(抄录)
AC_INIT(FILE)
这个宏用来检查源代码所在的路径。
AM_INIT_AUTOMAKE(PACKAGE, VERSION)
这个宏是必须的,它描述了我们将要生成的软件包的名字及其版本号:PACKAGE 是软件包的名字,VERSION 是版本号。当你使用make dist 命令时,它会给你生成一个类似helloworld-1.0.tar.gz 的软件发行包,其中就有对应的软件包的名字和版本号。
AC_PROG_CC
这个宏将检查系统所用的C 编译器。
AC_OUTPUT(FILE)
这个宏是我们要输出的Makefile 的名字。
===Makefile.am内容说明(抄录)
AUTOMAKE_OPTIONS
这个是automake 的选项。在执行automake 时,它会检查目录下是否存在标准GNU 软件包中应具备的各种文件,例如AUTHORS 、ChangeLog 、NEWS 等文件。我们将其设置成foreign 时,automake 会改用一般软件包的标准来检查。
bin_PROGRAMS
这个是指定我们所要产生的可执行文件的文件名。如果你要产生多个可执行文件,那么在各个名字间用空格隔开。
helloworld_SOURCES
这个是指定产生“helloworld” 时所需要的源代码。如果它用到了多个源文件,那么请使用空格符号将它们隔开。比如需要 helloworld.h ,helloworld.c 那么请写成helloworld_SOURCES= helloworld.h helloworld.c 。
如果你在bin_PROGRAMS 定义了多个可执行文件,则对应每个可执行文件都要定义相对的filename_SOURCES 。
===更多命令(抄录)
make install
将编译成功的可执行文件安装到系统目录中,一般为/usr/local/bin 目录。
make dist
产生发布软件包文件(即distribution package )。这个命令将会将可执行文件及相关文件打包成一个tar.gz 压缩的文件用来作为发布软件的软件包。
它会在当前目录下生成一个名字类似“PACKAGE-VERSION.tar.gz” 的文件。PACKAGE 和VERSION ,是我们在configure.in 中定义的AM_INIT_AUTOMAKE(PACKAGE, VERSION) 。
make distcheck
生成发布软件包并对其进行测试检查,以确定发布包的正确性。这个操作将自动把压缩包文件解开,然后执行configure 命令,并且执行make ,来确认编译不出现错误,最后提示你软件包已经准备好,可以发布了。
====configure支持arm指令集或cpu类型的配置
类比有配置优化的configure.in。
推导发散:
不一定是configure.in,不一定都通过这个来生成configure,比如也可能为configure.ac。
ffmpeg(ios)的configrue.in?--not found
https://autotools.io/autoconf/arguments.html
====install autoconf and automake(抄录)
curl -O http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz
tar -xzvf m4-1.4.13.tar.gz
cd m4-1.4.13
./configure --prefix=/usr/local
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz
tar -xzvf autoconf-2.65.tar.gz
cd autoconf-2.65
./configure --prefix=/usr/local # ironic, isn't it?
make
sudo make install
cd ..
# here you might want to restart your terminal session, to ensure the new autoconf is picked up and used in the rest of the script
curl -O http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz
tar xzvf automake-1.11.tar.gz
cd automake-1.11
./configure --prefix=/usr/local
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz
tar xzvf libtool-2.2.6b.tar.gz
cd libtool-2.2.6b
./configure --prefix=/usr/local
make
sudo make install
使用autoscan把目录中的所有源码文件生成一个configure.scan。
mv configure.scan configure.in
sublime configure.in #修改其中内容
aclocal #create m4
autoconf #create configure using m4
创建Makefile.am,并加入内容。
automake --add-missing #create Makefile.in from am
./configure #create Makefile
make #make
./hellomake #run it
===configure.in内容说明(抄录)
AC_INIT(FILE)
这个宏用来检查源代码所在的路径。
AM_INIT_AUTOMAKE(PACKAGE, VERSION)
这个宏是必须的,它描述了我们将要生成的软件包的名字及其版本号:PACKAGE 是软件包的名字,VERSION 是版本号。当你使用make dist 命令时,它会给你生成一个类似helloworld-1.0.tar.gz 的软件发行包,其中就有对应的软件包的名字和版本号。
AC_PROG_CC
这个宏将检查系统所用的C 编译器。
AC_OUTPUT(FILE)
这个宏是我们要输出的Makefile 的名字。
===Makefile.am内容说明(抄录)
AUTOMAKE_OPTIONS
这个是automake 的选项。在执行automake 时,它会检查目录下是否存在标准GNU 软件包中应具备的各种文件,例如AUTHORS 、ChangeLog 、NEWS 等文件。我们将其设置成foreign 时,automake 会改用一般软件包的标准来检查。
bin_PROGRAMS
这个是指定我们所要产生的可执行文件的文件名。如果你要产生多个可执行文件,那么在各个名字间用空格隔开。
helloworld_SOURCES
这个是指定产生“helloworld” 时所需要的源代码。如果它用到了多个源文件,那么请使用空格符号将它们隔开。比如需要 helloworld.h ,helloworld.c 那么请写成helloworld_SOURCES= helloworld.h helloworld.c 。
如果你在bin_PROGRAMS 定义了多个可执行文件,则对应每个可执行文件都要定义相对的filename_SOURCES 。
===更多命令(抄录)
make install
将编译成功的可执行文件安装到系统目录中,一般为/usr/local/bin 目录。
make dist
产生发布软件包文件(即distribution package )。这个命令将会将可执行文件及相关文件打包成一个tar.gz 压缩的文件用来作为发布软件的软件包。
它会在当前目录下生成一个名字类似“PACKAGE-VERSION.tar.gz” 的文件。PACKAGE 和VERSION ,是我们在configure.in 中定义的AM_INIT_AUTOMAKE(PACKAGE, VERSION) 。
make distcheck
生成发布软件包并对其进行测试检查,以确定发布包的正确性。这个操作将自动把压缩包文件解开,然后执行configure 命令,并且执行make ,来确认编译不出现错误,最后提示你软件包已经准备好,可以发布了。
====configure支持arm指令集或cpu类型的配置
类比有配置优化的configure.in。
推导发散:
不一定是configure.in,不一定都通过这个来生成configure,比如也可能为configure.ac。
ffmpeg(ios)的configrue.in?--not found
https://autotools.io/autoconf/arguments.html
====install autoconf and automake(抄录)
curl -O http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz
tar -xzvf m4-1.4.13.tar.gz
cd m4-1.4.13
./configure --prefix=/usr/local
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz
tar -xzvf autoconf-2.65.tar.gz
cd autoconf-2.65
./configure --prefix=/usr/local # ironic, isn't it?
make
sudo make install
cd ..
# here you might want to restart your terminal session, to ensure the new autoconf is picked up and used in the rest of the script
curl -O http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz
tar xzvf automake-1.11.tar.gz
cd automake-1.11
./configure --prefix=/usr/local
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz
tar xzvf libtool-2.2.6b.tar.gz
cd libtool-2.2.6b
./configure --prefix=/usr/local
make
sudo make install