Changeset cdf2e4 for m4/ax_codepatterns.m4
- Timestamp:
- Dec 22, 2010, 5:39:32 PM (15 years ago)
- Children:
- 392a79
- Parents:
- 70672e3
- git-author:
- Frederik Heber <heber@…> (12/22/10 17:20:51)
- git-committer:
- Frederik Heber <heber@…> (12/22/10 17:39:32)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
m4/ax_codepatterns.m4
r70672e3 rcdf2e4 1 1 dnl 2 dnl AM_PATH_CODEPATTERNS(MINIMUM-VERSION, [ ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])2 dnl AM_PATH_CODEPATTERNS(MINIMUM-VERSION, [no]debug, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 3 3 dnl 4 4 … … 15 15 16 16 codepatterns_version_min=$1 17 codepatterns_debug=$2 17 18 18 19 CodePatterns_CFLAGS="" … … 27 28 fi 28 29 # 1. test whether pkg-config works 29 CodePatterns_CONFIG=" "30 CodePatterns_CONFIG="no" 30 31 #AC_MSG_NOTICE([PKG_CONFIG_PATH is $PKG_CONFIG_PATH]) 31 PKG_CHECK_MODULES([CodePatterns], [CodePatterns >= $codepatterns_version_min], [ 32 if test x$codepatterns_debug != x0; then 33 codepatterns_libname="CodePatterns-debug" 34 PKG_CHECK_MODULES([CodePatterns_debug], [CodePatterns >= $codepatterns_version_min], [ 32 35 codepatterns_pkgconfig=yes 33 CodePatterns_CONFIG="pkg-config CodePatterns"36 CodePatterns_CONFIG="pkg-config $codepatterns_libname" 34 37 ], [ 35 38 # 2. if failed, test for binary codepatterns-config 36 39 AC_PATH_PROG(CodePatterns_CONFIG, codepatterns-config, no) 37 if test x$CodePatterns_CONFIG= xno && test x$codepatterns_prefix != x ; then40 if test "x$CodePatterns_CONFIG" = xno && test x$codepatterns_prefix != x ; then 38 41 if test -e $codepatterns_prefix/bin/codepatterns-config; then 39 42 codepatterns_pkgconfig=no … … 41 44 fi 42 45 fi 43 ] 44 ) 46 ]) 47 48 else 49 codepatterns_libname="CodePatterns" 50 PKG_CHECK_MODULES([CodePatterns], [CodePatterns >= $codepatterns_version_min], [ 51 codepatterns_pkgconfig=yes 52 CodePatterns_CONFIG="pkg-config $codepatterns_libname" 53 ], [ 54 # 2. if failed, test for binary codepatterns-config 55 AC_PATH_PROG(CodePatterns_CONFIG, codepatterns-config, no) 56 if test "x$CodePatterns_CONFIG" = xno && test x$codepatterns_prefix != x ; then 57 if test -e $codepatterns_prefix/bin/codepatterns-config; then 58 codepatterns_pkgconfig=no 59 CodePatterns_CONFIG="$codepatterns_prefix/bin/codepatterns-config" 60 fi 61 fi 62 ]) 63 64 fi 45 65 46 66 # try to set values via CodePatterns_CONFIG 47 if test ! -z "$CodePatterns_CONFIG"; then67 if test "x$CodePatterns_CONFIG" != xno; then 48 68 CodePatterns_CFLAGS=`$CodePatterns_CONFIG --cflags` 49 69 CodePatterns_LIBS=`$CodePatterns_CONFIG --libs` … … 61 81 fi 62 82 if test x$cp_cv_codepatterns_libs_prefix != x ; then 63 if test -e "$cp_cv_codepatterns_libs_prefix/lib/lib CodePatterns.so"; then64 CodePatterns_LIBS="-L$cp_cv_codepatterns_libs_prefix/lib -l CodePatterns"83 if test -e "$cp_cv_codepatterns_libs_prefix/lib/lib$codepatterns_libname.so"; then 84 CodePatterns_LIBS="-L$cp_cv_codepatterns_libs_prefix/lib -l$codepatterns_libname" 65 85 AC_MSG_NOTICE([codepatterns libs found and used.]) 66 86 else … … 82 102 codepatterns_version=no 83 103 if test x$codepatterns = xyes; then 84 AC_MSG_CHECKING(for CodePatterns- version >= $codepatterns_version_min)85 if test "x$CodePatterns_CONFIG" != "x"; then104 AC_MSG_CHECKING(for $codepatterns_libname - version >= $codepatterns_version_min) 105 if test "x$CodePatterns_CONFIG" != xno; then 86 106 codepatterns_version=`$CodePatterns_CONFIG --version` 87 107 else … … 153 173 LIBS="$CodePatterns_LIBS -lboost_thread" 154 174 if test x$codepatterns_version = xyes; then 155 AC_CACHE_CHECK(for CodePatternslib, cp_cv_codepatterns_lib, [175 AC_CACHE_CHECK(for $codepatterns_libname lib, cp_cv_codepatterns_lib, [ 156 176 AC_LANG_PUSH([C++]) 157 177 AC_LINK_IFELSE( … … 199 219 200 220 if test "x$cp_cv_codepatterns_lib" = xyes ; then 201 ifelse([$ 2], , :, [$2])221 ifelse([$3], , :, [$3]) 202 222 else 203 223 CodePatterns_CFLAGS="" 204 224 CodePatterns_LDFLAGS="" 205 225 CodePatterns_LIBS="" 206 ifelse([$ 3], , :, [$3])226 ifelse([$4], , :, [$4]) 207 227 fi 208 228 fi
Note:
See TracChangeset
for help on using the changeset viewer.