Changeset 392a79


Ignore:
Timestamp:
Dec 23, 2010, 6:16:06 PM (15 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

FIX: Some fixes to macro ax_codepatterns.m4.

  • FIX: Lib test used still wrong include paths.
  • FIX: internally set PKG_CONFIG_PATH from --with... was not working yet.
  • we check lib usability even in case of pkg-config
  • changed what debug argument might be [yes,no,full]
File:
1 edited

Legend:

Unmodified
Added
Removed
  • m4/ax_codepatterns.m4

    rcdf2e4 r392a79  
    11dnl
    2 dnl AM_PATH_CODEPATTERNS(MINIMUM-VERSION, [no]debug, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
     2dnl AM_PATH_CODEPATTERNS(MINIMUM-VERSION, [HAVE_DEBUG=no,yes,full], [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
    33dnl
    44
     
    2525  # try to set PKG_CONFIG_PATH
    2626  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
    2832  fi
    2933  # 1. test whether pkg-config works
    3034  CodePatterns_CONFIG="no"
    31   #AC_MSG_NOTICE([PKG_CONFIG_PATH is $PKG_CONFIG_PATH])
    32   if test x$codepatterns_debug != x0; then
     35  #AC_MSG_NOTICE([PKG_CONFIG_PATH is $PKG_CONFIG_PATH.])
     36  if test x$codepatterns_debug != xno; then
    3337    codepatterns_libname="CodePatterns-debug"
    3438    PKG_CHECK_MODULES([CodePatterns_debug], [CodePatterns >= $codepatterns_version_min], [
     
    5559      AC_PATH_PROG(CodePatterns_CONFIG, codepatterns-config, no)
    5660      if test "x$CodePatterns_CONFIG" = xno && test x$codepatterns_prefix != x ; then
     61        AC_MSG_CHECKING([for alternative codepatterns-config location])
    5762        if test -e $codepatterns_prefix/bin/codepatterns-config; then
    5863          codepatterns_pkgconfig=no
    5964          CodePatterns_CONFIG="$codepatterns_prefix/bin/codepatterns-config"
     65          AC_MSG_RESULT([yes])
     66        else
     67          AC_MSG_RESULT([no])
    6068        fi
    6169      fi
     
    6775  if test "x$CodePatterns_CONFIG" != xno; then
    6876    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.])
    7183  fi
    7284
     
    7587    if test -e $codepatterns_include_prefix/include; then
    7688      CodePatterns_CFLAGS="$codepatterns_include_prefix/include"
    77       AC_MSG_NOTICE([codepatterns include found and used.])
     89      #AC_MSG_NOTICE([codepatterns include found and used.])
    7890    else
    7991      AC_MSG_WARN([codepatterns include not found at $codepatterns_include_prefix/include.])
     
    8395    if test -e "$cp_cv_codepatterns_libs_prefix/lib/lib$codepatterns_libname.so"; then
    8496      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.])
    8698    else
    8799      AC_MSG_WARN([codepatterns libs not found at $cp_cv_codepatterns_libs_prefix.])
     
    166178      fi
    167179    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"
    182197
    183198// some necessary stubs
     
    206221SingletonStub::getInstance();
    207222])
    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])
    228242  fi
    229243 
Note: See TracChangeset for help on using the changeset viewer.