Ignore:
Timestamp:
Dec 22, 2010, 5:39:32 PM (15 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

From now on we create two libs, one with and one without debug.

  • We specifically create two libs, as the debug one is not just the old lib but with some debug symbols. MemDebug, Asserts and ObserverLog implementations are clearly missing in these. This justifies to have two distinct (in an odd way) libraries.
  • additional CodePattern-debug.pc file
  • extended ax_codepatterns.m4 macro to have debug as an extra argument
File:
1 edited

Legend:

Unmodified
Added
Removed
  • m4/ax_codepatterns.m4

    r70672e3 rcdf2e4  
    11dnl
    2 dnl AM_PATH_CODEPATTERNS(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
     2dnl AM_PATH_CODEPATTERNS(MINIMUM-VERSION, [no]debug, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
    33dnl
    44
     
    1515
    1616  codepatterns_version_min=$1
     17  codepatterns_debug=$2
    1718
    1819  CodePatterns_CFLAGS=""
     
    2728  fi
    2829  # 1. test whether pkg-config works
    29   CodePatterns_CONFIG=""
     30  CodePatterns_CONFIG="no"
    3031  #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], [
    3235      codepatterns_pkgconfig=yes
    33       CodePatterns_CONFIG="pkg-config CodePatterns"
     36      CodePatterns_CONFIG="pkg-config $codepatterns_libname"
    3437    ], [
    3538    # 2. if failed, test for binary codepatterns-config
    3639      AC_PATH_PROG(CodePatterns_CONFIG, codepatterns-config, no)
    37       if test x$CodePatterns_CONFIG = xno && test x$codepatterns_prefix != x ; then
     40      if test "x$CodePatterns_CONFIG" = xno && test x$codepatterns_prefix != x ; then
    3841        if test -e $codepatterns_prefix/bin/codepatterns-config; then
    3942          codepatterns_pkgconfig=no
     
    4144        fi
    4245      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
    4565
    4666  # try to set values via CodePatterns_CONFIG
    47   if test ! -z "$CodePatterns_CONFIG"; then
     67  if test "x$CodePatterns_CONFIG" != xno; then
    4868    CodePatterns_CFLAGS=`$CodePatterns_CONFIG --cflags`
    4969    CodePatterns_LIBS=`$CodePatterns_CONFIG --libs`
     
    6181  fi
    6282  if test x$cp_cv_codepatterns_libs_prefix != x ; then
    63     if test -e "$cp_cv_codepatterns_libs_prefix/lib/libCodePatterns.so"; then
    64       CodePatterns_LIBS="-L$cp_cv_codepatterns_libs_prefix/lib -lCodePatterns"
     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"
    6585      AC_MSG_NOTICE([codepatterns libs found and used.])
    6686    else
     
    82102    codepatterns_version=no
    83103    if test x$codepatterns = xyes; then
    84       AC_MSG_CHECKING(for CodePatterns - version >= $codepatterns_version_min)
    85       if test "x$CodePatterns_CONFIG" != "x"; then
     104      AC_MSG_CHECKING(for $codepatterns_libname - version >= $codepatterns_version_min)
     105      if test "x$CodePatterns_CONFIG" != xno; then
    86106        codepatterns_version=`$CodePatterns_CONFIG --version`
    87107      else
     
    153173    LIBS="$CodePatterns_LIBS -lboost_thread"
    154174    if test x$codepatterns_version = xyes; then
    155       AC_CACHE_CHECK(for CodePatterns lib, cp_cv_codepatterns_lib, [
     175      AC_CACHE_CHECK(for $codepatterns_libname lib, cp_cv_codepatterns_lib, [
    156176        AC_LANG_PUSH([C++])
    157177        AC_LINK_IFELSE(
     
    199219
    200220    if test "x$cp_cv_codepatterns_lib" = xyes ; then
    201        ifelse([$2], , :, [$2])     
     221       ifelse([$3], , :, [$3])     
    202222    else
    203223       CodePatterns_CFLAGS=""
    204224       CodePatterns_LDFLAGS=""
    205225       CodePatterns_LIBS=""
    206        ifelse([$3], , :, [$3])
     226       ifelse([$4], , :, [$4])
    207227    fi
    208228  fi
Note: See TracChangeset for help on using the changeset viewer.