Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d0308aae
提交
d0308aae
authored
9月 02, 2011
作者:
Stefan Knoblich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SDK] Clean up symbol visibility flags and compiler vendor handling
Signed-off-by:
Stefan Knoblich
<
stkn@openisdn.net
>
上级
6d76dda7
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
45 行增加
和
63 行删除
+45
-63
configure.ac
src/mod/sdk/autotools/configure.ac
+35
-47
Makefile.am
src/mod/sdk/autotools/src/Makefile.am
+10
-16
没有找到文件。
src/mod/sdk/autotools/configure.ac
浏览文件 @
d0308aae
...
@@ -22,35 +22,42 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
...
@@ -22,35 +22,42 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Checks for programs.
# Checks for programs.
AC_PROG_CC
AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_CC_C_O
AC_PROG_CC_C99
AC_PROG_LIBTOOL
AC_PROG_LIBTOOL
# pkgconfig
# pkgconfig
AC_PATH_PROG([PKG_CONFIG], [pkg-config], ["no"])
AC_PATH_PROG([PKG_CONFIG], [pkg-config], ["no"])
if test "x${PKG_CONFIG}" = "xno"
AS_IF([test "x${PKG_CONFIG}" = "xno"],
then
[AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed in your PATH])]
AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed in your PATH])
)
fi
PKG_PROG_PKG_CONFIG
PKG_PROG_PKG_CONFIG
# Checks for cflags
##
## Checks for cflags
##
AC_MSG_RESULT([${as_nl}<<>> Compiler vendor and features])
AC_MSG_RESULT([${as_nl}<<>> Compiler vendor and features])
AX_COMPILER_VENDOR
AM_CONDITIONAL([CC_VENDOR_GNU], [test "x${ax_cv_c_compiler_vendor}" = "xgnu"])
AM_CONDITIONAL([CC_VENDOR_SUN], [test "x${ax_cv_c_compiler_vendor}" = "xsun"])
##
##
## Compiler vendor and flag checks
## Compiler vendor and flag checks
##
##
HAVE_VISIBILITY="no"
HAVE_VISIBILITY="no"
AC_ARG_ENABLE([visibility],
AC_ARG_ENABLE([visibility],
[AS_HELP_STRING([--disable-visibility], [Disable symbol visibility support (default: enabled, if available)])],
[AS_HELP_STRING([--disable-visibility], [Disable symbol visibility support (default: enabled, if available)])],
[case "${enableval}" in
[case "${enableval}" in
yes) enable_visibility="yes" ;;
yes|no) enable_visibility="${enableval}" ;;
no) enable_visibility="no" ;;
*) AC_MSG_ERROR([Invalid value ${enableval} for parameter --disable-visibility]) ;;
*) AC_MSG_ERROR([Invalid value ${enableval} for parameter --disable-visibility]) ;;
esac],
esac],
[enable_visibility="yes"]
[enable_visibility="yes"]
)
)
AX_COMPILER_VENDOR
case "${ax_cv_c_compiler_vendor}" in
case "${ax_cv_c_compiler_vendor}" in
gnu)
gnu)
AC_MSG_CHECKING([whether the compiler supports -fvisibility=hidden])
AC_MSG_CHECKING([whether the compiler supports -fvisibility=hidden])
...
@@ -63,36 +70,16 @@ gnu)
...
@@ -63,36 +70,16 @@ gnu)
[;]
[;]
)],
)],
[AC_MSG_RESULT([yes])
[HAVE_VISIBILITY="yes"
AC_DEFINE([HAVE_VISIBILITY],[1],[GCC visibility support])
AC_DEFINE([HAVE_VISIBILITY], [1], [Symbol visibility support])
HAVE_VISIBILITY="yes"],
AC_SUBST([VISIBILITY_CFLAGS], [-fvisibility=hidden])
AC_SUBST([VISIBILITY_CXXFLAGS], [-fvisibility=hidden])],
[AC_MSG_RESULT([no])
[HAVE_VISIBILITY="no"]
HAVE_VISIBILITY="no"]
)
)
AC_MSG_RESULT([${HAVE_VISIBILITY}])
CFLAGS="${save_CFLAGS}"],
CFLAGS="${save_CFLAGS}"],
[AC_MSG_RESULT([disabled by user])]
[AC_MSG_RESULT([disabled by user])]
)
)
AS_IF([test "x${HAVE_VISIBILITY}" != "xno"],
[save_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
AC_MSG_CHECKING([whether the compiler supports -fvisibility-inlines-hidden])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[;], [;]
)],
[AC_MSG_RESULT([yes])
HAVE_VISIBILITY_INLINES_HIDDEN="yes"],
[AC_MSG_RESULT([no])
HAVE_VISIBILITY_INLINES_HIDDEN="no"]
)
CFLAGS="${save_CFLAGS}"],
[:]
)
AC_DEFINE([COMPILER_GCC], [1], [Compiler is GCC])
;;
;;
sun)
sun)
AC_MSG_CHECKING([whether the compiler supports -xldscope=hidden])
AC_MSG_CHECKING([whether the compiler supports -xldscope=hidden])
...
@@ -105,28 +92,24 @@ sun)
...
@@ -105,28 +92,24 @@ sun)
[;]
[;]
)],
)],
[AC_MSG_RESULT([yes])
[HAVE_VISIBILITY="yes"
AC_DEFINE([HAVE_VISIBILITY],[1],[SUNCC visibility support])
AC_DEFINE([HAVE_VISIBILITY], [1], [Symbol visibility support])
HAVE_VISIBILITY="yes"],
AC_SUBST([VISIBILITY_CFLAGS], [-xldscope=hidden])
AC_SUBST([VISIBILITY_CXXFLAGS], [-xldscope=hidden])],
[AC_MSG_RESULT([no])
[HAVE_VISIBILITY="no"]
HAVE_VISIBILITY="no"]
)
)
AC_MSG_RESULT([${HAVE_VISIBILITY}])
CFLAGS="${save_CFLAGS}"],
CFLAGS="${save_CFLAGS}"],
[AC_MSG_RESULT([disabled by user])]
[AC_MSG_RESULT([disabled by user])]
)
)
AC_DEFINE([COMPILER_SUNCC], [1], [Compiler is SunCC])
;;
;;
*)
*)
AC_MSG_WARN([No visibility checks for this compiler defined])
AC_MSG_WARN([No visibility checks for this compiler defined])
;;
;;
esac
esac
AM_CONDITIONAL([COMPILER_GCC], [test "x${ax_cv_c_compiler_vendor}" = "xgnu"])
AM_CONDITIONAL([CC_HAS_VISIBILITY], [test "x${HAVE_VISIBILITY}" = "xyes"])
AM_CONDITIONAL([COMPILER_SUNCC], [test "x${ax_cv_c_compiler_vendor}" = "xsun"])
AM_CONDITIONAL([HAVE_VISIBILITY], [test "x${HAVE_VISIBILITY}" = "xyes"])
AM_CONDITIONAL([HAVE_VISIBILITY_INLINES_HIDDEN], [test "x${HAVE_VISIBILITY_INLINES_HIDDEN}" = "xyes"])
##
##
## pkgconfig based freeswitch detection code
## pkgconfig based freeswitch detection code
...
@@ -210,6 +193,7 @@ PKG_CHECK_MODULES([freeswitch], [freeswitch],
...
@@ -210,6 +193,7 @@ PKG_CHECK_MODULES([freeswitch], [freeswitch],
[AC_MSG_ERROR([FreeSWITCH not found])]
[AC_MSG_ERROR([FreeSWITCH not found])]
)
)
##
##
## Add your other dependency checks here
## Add your other dependency checks here
##
##
...
@@ -221,6 +205,10 @@ AC_MSG_RESULT([${as_nl}<<>> Other dependencies])
...
@@ -221,6 +205,10 @@ AC_MSG_RESULT([${as_nl}<<>> Other dependencies])
# Checks for library functions.
# Checks for library functions.
##
## Done, create output files and print summary
##
AC_MSG_RESULT([${as_nl}<<>> Create output files])
AC_MSG_RESULT([${as_nl}<<>> Create output files])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
AC_OUTPUT
...
...
src/mod/sdk/autotools/src/Makefile.am
浏览文件 @
d0308aae
...
@@ -10,33 +10,27 @@ AM_CPPFLAGS= -I. -I$(includedir)
...
@@ -10,33 +10,27 @@ AM_CPPFLAGS= -I. -I$(includedir)
AM_LDFLAGS
=
-L
.
-L
$(libdir)
-avoid-version
-module
-no-undefined
-shared
AM_LDFLAGS
=
-L
.
-L
$(libdir)
-avoid-version
-module
-no-undefined
-shared
###
###
# GCC specific flags
# GCC
(and compatible)
specific flags
#
#
if
C
OMPILER_GCC
if
C
C_VENDOR_GNU
AM_CFLAGS
+=
-Wall
AM_CFLAGS
+=
-Wall
# symbol visibility support
if
HAVE_VISIBILITY
AM_CFLAGS
+=
-fvisibility
=
hidden
AM_CXXFLAGS
+=
-fvisibility
=
hidden
AM_CPPFLAGS
+=
-DSWITCH_API_VISIBILITY
=
1
endif
if
HAVE_VISIBILITY_INLINES_HIDDEN
AM_CXXFLAGS
+=
-fvisibility-inlines-hidden
endif
endif
endif
###
###
# SunCC specific flags
# SunCC specific flags
#
#
if
C
OMPILER_SUNCC
if
C
C_VENDOR_SUN
AM_CFLAGS
+=
AM_CFLAGS
+=
endif
###
# symbol visibility support
# symbol visibility support
if
HAVE_VISIBILITY
#
AM_CFLAGS
+=
-xldscope
=
hidden
if
CC_HAS_VISIBILITY
AM_CXXFLAGS
+=
-xldscope
=
hidden
AM_CFLAGS
+=
$(VISIBILITY_CFLAGS)
AM_CXXFLAGS
+=
$(VISIBILITY_CXXFLAGS)
AM_CPPFLAGS
+=
-DSWITCH_API_VISIBILITY
=
1
AM_CPPFLAGS
+=
-DSWITCH_API_VISIBILITY
=
1
endif
endif
endif
###
###
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论