Red hat下使用automake自动配置wxWidgets的makefile
2011-05-16 14:30
357 查看
前提:假设这个程序叫做vso
路径为:
/vso
/vso/src
/vso/test
下面的步骤只包含的源代码目录,如果创建test的makefile,类似。
1. cd /vso
autoscan
2. mv configure.scan configure.in
3. vim configure.in
as:
---------------------------------
AC_PREREQ(2.59)
AC_INIT(vso, 0.0.1, sun.noon@gmail.com)
AC_CONFIG_SRCDIR([src/PlotWindow.cpp])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE(vso,0.0.1)
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
# Checks for libraries.
AM_OPTIONS_WXCONFIG
reqwx=2.8.10
AM_PATH_WXCONFIG($reqwx, wxWin=1)
if test "$wxWin" != 1; then
AC_MSG_ERROR([
wxWidgets must be installed on your system.
Please check that wx-config is in path, the directory
where wxWidgets libraries are installed (returned by
'wx-config --libs' or 'wx-config --static --libs' command)
is in LD_LIBRARY_PATH or equivalent variable and
wxWidgets version is $reqwx or above.
])
fi
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
LIBS="$LIBS $WX_LIBS"
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_CHECK_FUNCS([sqrt])
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT
----------------------------------
4. touch NEWS README ChangeLog AUTHORS
5. cd src
vim Makefile.am
as:
--------------
bin_PROGRAMS=vso
vso_SOURCES=a.h a.cpp b.h b.cpp c.h c.cpp
vso_LDADD = @LIBS@
vso_CXXFLAGS = @CXXFLAGS@
--------------
6. cd ..
vim Makefile.am
as:
--------------
AUTOMAKE_OPTIONS=foreign
SUBDIRS=src
--------------
7.
aclocal
autoheader
autoconf
automake --add-missing
8. Finished!!
usage:
./configure
make
enjoy it!
路径为:
/vso
/vso/src
/vso/test
下面的步骤只包含的源代码目录,如果创建test的makefile,类似。
1. cd /vso
autoscan
2. mv configure.scan configure.in
3. vim configure.in
as:
---------------------------------
AC_PREREQ(2.59)
AC_INIT(vso, 0.0.1, sun.noon@gmail.com)
AC_CONFIG_SRCDIR([src/PlotWindow.cpp])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE(vso,0.0.1)
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
# Checks for libraries.
AM_OPTIONS_WXCONFIG
reqwx=2.8.10
AM_PATH_WXCONFIG($reqwx, wxWin=1)
if test "$wxWin" != 1; then
AC_MSG_ERROR([
wxWidgets must be installed on your system.
Please check that wx-config is in path, the directory
where wxWidgets libraries are installed (returned by
'wx-config --libs' or 'wx-config --static --libs' command)
is in LD_LIBRARY_PATH or equivalent variable and
wxWidgets version is $reqwx or above.
])
fi
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
LIBS="$LIBS $WX_LIBS"
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_CHECK_FUNCS([sqrt])
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT
----------------------------------
4. touch NEWS README ChangeLog AUTHORS
5. cd src
vim Makefile.am
as:
--------------
bin_PROGRAMS=vso
vso_SOURCES=a.h a.cpp b.h b.cpp c.h c.cpp
vso_LDADD = @LIBS@
vso_CXXFLAGS = @CXXFLAGS@
--------------
6. cd ..
vim Makefile.am
as:
--------------
AUTOMAKE_OPTIONS=foreign
SUBDIRS=src
--------------
7.
aclocal
autoheader
autoconf
automake --add-missing
8. Finished!!
usage:
./configure
make
enjoy it!
相关文章推荐
- 使用工具 autoconf 和automake 自动创建 Makefile
- 使用automake 与 autoconf 自动生成 Makefile
- 使用automake自动生成makefile文件(中)
- 使用automake 与 autoconf 自动生成 Makefile
- 【探索wireshark】 使用autoconf, automake等自动生成Makefile
- Ubuntu下使用automake自动生成makefile
- 使用autoconf、automake自动生成Makefile实例讲解
- 使用automake自动生成makefile(上)
- 使用python自动生成docker nginx反向代理配置
- 【Git笔记】使用技巧:命令自动补全及命令别名的配置方法
- 使用Spring AOP 自动代理配置声明式事务
- 【技术贴】局域网设置 使用自动配置脚本 有对钩被选中取消不掉的解决办法
- QT使用MySql的配置(使用addLibraryPath载入插件),编译QT的MySql驱动问题及解决方案(自己使用libmysql.lib进行编译mysql.pro,万不得已可以查看Makefile.Debug以解决问题)
- 自动构建工具Ant深入剖析(一) 配置环境及初步使用
- CentOS6.7下使用非root用户(普通用户)编译安装与配置mysql数据库并使用shell脚本定时任务方式实现mysql数据库服务随机自动启动
- SrpingCloud ---github上面如何使用webHook实现配置文件修改 ,客户端自动刷新
- Mybatis使用generator自动生成映射配置文件信息
- Ubuntu 16.04 vim YouCompleteMe自动补全的安装配置与使用
- 使用autotool工具自动生成 Makefile
- java代码使用.pac脚本自动配置代理服务器策略