bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tweak lib-link.m4


From: Bruno Haible
Subject: tweak lib-link.m4
Date: Wed, 12 Mar 2008 02:57:21 +0100
User-agent: KMail/1.5.4

This fixes an interaction between
  define([NAME], ...)
in one macro and
  undefine([NAME])
in another macro.


2008-03-11  Bruno Haible  <address@hidden>

        Avoid conflicts between local macro definitions.
        * m4/lib-link.m4 (AC_LIB_LINKFLAGS, AC_LIB_HAVE_LINKFLAGS,
        AC_LIB_LINKFLAGS_BODY): Use pushdef/popdef instead of define/undefine.

*** m4/lib-link.m4.orig 2008-03-12 02:53:26.000000000 +0100
--- m4/lib-link.m4      2008-03-12 02:51:35.000000000 +0100
***************
*** 1,5 ****
! # lib-link.m4 serial 13 (gettext-0.17)
! dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
  dnl with or without modifications, as long as this notice is preserved.
--- 1,5 ----
! # lib-link.m4 serial 14 (gettext-0.18)
! dnl Copyright (C) 2001-2008 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
  dnl with or without modifications, as long as this notice is preserved.
***************
*** 18,26 ****
  [
    AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
    AC_REQUIRE([AC_LIB_RPATH])
!   define([Name],[translit([$1],[./-], [___])])
!   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
!                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
    AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
      AC_LIB_LINKFLAGS_BODY([$1], [$2])
      ac_cv_lib[]Name[]_libs="$LIB[]NAME"
--- 18,26 ----
  [
    AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
    AC_REQUIRE([AC_LIB_RPATH])
!   pushdef([Name],[translit([$1],[./-], [___])])
!   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
!                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
    AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
      AC_LIB_LINKFLAGS_BODY([$1], [$2])
      ac_cv_lib[]Name[]_libs="$LIB[]NAME"
***************
*** 39,46 ****
    dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
    dnl results of this search when this library appears as a dependency.
    HAVE_LIB[]NAME=yes
!   undefine([Name])
!   undefine([NAME])
  ])
  
  dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
--- 39,46 ----
    dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
    dnl results of this search when this library appears as a dependency.
    HAVE_LIB[]NAME=yes
!   popdef([NAME])
!   popdef([Name])
  ])
  
  dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
***************
*** 57,65 ****
  [
    AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
    AC_REQUIRE([AC_LIB_RPATH])
!   define([Name],[translit([$1],[./-], [___])])
!   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
!                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
  
    dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
    dnl accordingly.
--- 57,65 ----
  [
    AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
    AC_REQUIRE([AC_LIB_RPATH])
!   pushdef([Name],[translit([$1],[./-], [___])])
!   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
!                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
  
    dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
    dnl accordingly.
***************
*** 95,102 ****
    AC_SUBST([LIB]NAME)
    AC_SUBST([LTLIB]NAME)
    AC_SUBST([LIB]NAME[_PREFIX])
!   undefine([Name])
!   undefine([NAME])
  ])
  
  dnl Determine the platform dependent parameters needed to use rpath:
--- 95,102 ----
    AC_SUBST([LIB]NAME)
    AC_SUBST([LTLIB]NAME)
    AC_SUBST([LIB]NAME[_PREFIX])
!   popdef([NAME])
!   popdef([Name])
  ])
  
  dnl Determine the platform dependent parameters needed to use rpath:
***************
*** 144,153 ****
  AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
  [
    AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
!   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
!                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
    dnl Autoconf >= 2.61 supports dots in --with options.
!   
define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
    dnl By default, look in $includedir and $libdir.
    use_additional=yes
    AC_LIB_WITH_FINAL_PREFIX([
--- 144,153 ----
  AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
  [
    AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
!   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
!                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
    dnl Autoconf >= 2.61 supports dots in --with options.
!   
pushdef([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
    dnl By default, look in $includedir and $libdir.
    use_additional=yes
    AC_LIB_WITH_FINAL_PREFIX([
***************
*** 609,614 ****
--- 609,616 ----
        LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
      done
    fi
+   popdef([N_A_M_E])
+   popdef([NAME])
  ])
  
  dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]