Changeset 392a79
- Timestamp:
- Dec 23, 2010, 6:16:06 PM (15 years ago)
- Children:
- 746ff1
- Parents:
- cdf2e4
- git-author:
- Frederik Heber <heber@…> (12/23/10 11:38:22)
- git-committer:
- Frederik Heber <heber@…> (12/23/10 18:16:06)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
m4/ax_codepatterns.m4
rcdf2e4 r392a79 1 1 dnl 2 dnl AM_PATH_CODEPATTERNS(MINIMUM-VERSION, [ no]debug, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])2 dnl AM_PATH_CODEPATTERNS(MINIMUM-VERSION, [HAVE_DEBUG=no,yes,full], [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 3 3 dnl 4 4 … … 25 25 # try to set PKG_CONFIG_PATH 26 26 if test x$codepatterns_prefix != xno; then 27 PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$codepatterns_prefix/lib/pkgconfig/" 27 if test -z $PKG_CONFIG_PATH; then 28 export PKG_CONFIG_PATH="$codepatterns_prefix/lib/pkgconfig/" 29 else 30 export PKG_CONFIG_PATH="$codepatterns_prefix/lib/pkgconfig/:$PKG_CONFIG_PATH" 31 fi 28 32 fi 29 33 # 1. test whether pkg-config works 30 34 CodePatterns_CONFIG="no" 31 #AC_MSG_NOTICE([PKG_CONFIG_PATH is $PKG_CONFIG_PATH ])32 if test x$codepatterns_debug != x 0; then35 #AC_MSG_NOTICE([PKG_CONFIG_PATH is $PKG_CONFIG_PATH.]) 36 if test x$codepatterns_debug != xno; then 33 37 codepatterns_libname="CodePatterns-debug" 34 38 PKG_CHECK_MODULES([CodePatterns_debug], [CodePatterns >= $codepatterns_version_min], [ … … 55 59 AC_PATH_PROG(CodePatterns_CONFIG, codepatterns-config, no) 56 60 if test "x$CodePatterns_CONFIG" = xno && test x$codepatterns_prefix != x ; then 61 AC_MSG_CHECKING([for alternative codepatterns-config location]) 57 62 if test -e $codepatterns_prefix/bin/codepatterns-config; then 58 63 codepatterns_pkgconfig=no 59 64 CodePatterns_CONFIG="$codepatterns_prefix/bin/codepatterns-config" 65 AC_MSG_RESULT([yes]) 66 else 67 AC_MSG_RESULT([no]) 60 68 fi 61 69 fi … … 67 75 if test "x$CodePatterns_CONFIG" != xno; then 68 76 CodePatterns_CFLAGS=`$CodePatterns_CONFIG --cflags` 69 CodePatterns_LIBS=`$CodePatterns_CONFIG --libs` 70 AC_MSG_NOTICE([codepatterns-config found and used.]) 77 if test x$codepatterns_pkgconfig = xno; then 78 CodePatterns_LIBS=`$CodePatterns_CONFIG --ldflags --libs` 79 else 80 CodePatterns_LIBS=`$CodePatterns_CONFIG --libs` 81 fi 82 #AC_MSG_NOTICE([codepatterns-config found and used.]) 71 83 fi 72 84 … … 75 87 if test -e $codepatterns_include_prefix/include; then 76 88 CodePatterns_CFLAGS="$codepatterns_include_prefix/include" 77 AC_MSG_NOTICE([codepatterns include found and used.])89 #AC_MSG_NOTICE([codepatterns include found and used.]) 78 90 else 79 91 AC_MSG_WARN([codepatterns include not found at $codepatterns_include_prefix/include.]) … … 83 95 if test -e "$cp_cv_codepatterns_libs_prefix/lib/lib$codepatterns_libname.so"; then 84 96 CodePatterns_LIBS="-L$cp_cv_codepatterns_libs_prefix/lib -l$codepatterns_libname" 85 AC_MSG_NOTICE([codepatterns libs found and used.])97 #AC_MSG_NOTICE([codepatterns libs found and used.]) 86 98 else 87 99 AC_MSG_WARN([codepatterns libs not found at $cp_cv_codepatterns_libs_prefix.]) … … 166 178 fi 167 179 fi 168 169 # check presence of lib 170 SAVE_CPPFLAGS="$CPPFLAGS" 171 SAVE_LIBS="$LIBS" 172 CPPFLAGS="$CodePatterns_CFLAGS" 173 LIBS="$CodePatterns_LIBS -lboost_thread" 174 if test x$codepatterns_version = xyes; then 175 AC_CACHE_CHECK(for $codepatterns_libname lib, cp_cv_codepatterns_lib, [ 176 AC_LANG_PUSH([C++]) 177 AC_LINK_IFELSE( 178 [ 179 AC_LANG_PROGRAM([ 180 #include "Patterns/Singleton.hpp" 181 #include "Patterns/Singleton_impl.hpp" 180 else 181 # with pkg-config version is checked 182 codepatterns_version=yes 183 fi 184 # check presence of lib 185 SAVE_CPPFLAGS="$CPPFLAGS" 186 SAVE_LIBS="$LIBS" 187 CPPFLAGS="$CodePatterns_CFLAGS" 188 LIBS="$CodePatterns_LIBS -lboost_thread" 189 if test x$codepatterns_version = xyes; then 190 AC_CACHE_CHECK(for $codepatterns_libname lib, cp_cv_codepatterns_lib, [ 191 AC_LANG_PUSH([C++]) 192 AC_LINK_IFELSE( 193 [ 194 AC_LANG_PROGRAM([ 195 #include "CodePatterns/Singleton.hpp" 196 #include "CodePatterns/Singleton_impl.hpp" 182 197 183 198 // some necessary stubs … … 206 221 SingletonStub::getInstance(); 207 222 ]) 208 ],[ 209 cp_cv_codepatterns_lib="yes" 210 ], [ 211 cp_cv_codepatterns_lib="no" 212 ] 213 ) 214 AC_LANG_POP([C++]) 215 ]) 216 fi 217 CPPFLAGS="$SAVE_CPPFLAGS" 218 LIBS="$SAVE_LIBS" 219 220 if test "x$cp_cv_codepatterns_lib" = xyes ; then 221 ifelse([$3], , :, [$3]) 222 else 223 CodePatterns_CFLAGS="" 224 CodePatterns_LDFLAGS="" 225 CodePatterns_LIBS="" 226 ifelse([$4], , :, [$4]) 227 fi 223 ],[ 224 cp_cv_codepatterns_lib="yes" 225 ], [ 226 cp_cv_codepatterns_lib="no" 227 ] 228 ) 229 AC_LANG_POP([C++]) 230 ]) 231 fi 232 CPPFLAGS="$SAVE_CPPFLAGS" 233 LIBS="$SAVE_LIBS" 234 235 if test "x$cp_cv_codepatterns_lib" = xyes ; then 236 ifelse([$3], , :, [$3]) 237 else 238 CodePatterns_CFLAGS="" 239 CodePatterns_LDFLAGS="" 240 CodePatterns_LIBS="" 241 ifelse([$4], , :, [$4]) 228 242 fi 229 243
Note:
See TracChangeset
for help on using the changeset viewer.