Re: shell pwd: non-POSIX variable name ??

2007-03-30 Thread Jules Colding
Hi Stepan,

On Thu, 2007-03-29 at 16:19 +0200, Stepan Kasal wrote:
 On Thu, Mar 29, 2007 at 02:25:31PM +0200, Jules Colding posted an
 Automake question to the Autoconf list.  (Understandable mistake, of
 course.)

Oops... stupid, stupid mistake. Sorry, should be to old for that :-(


 I suppose the question can be deduced from my answer.  :-)
 
  What is the recommended and portable way of doing what I do above to
  avoid the warnings and to be nice to automake?
 
 OBJS= $(patsubst %.c,%.o,$(STUB_SRC))
 
 this can ce written portably as:
 
 OBJS = $(STUB_SRC:.c=.o)

OK, thanks.


 EXTRA_DIST = 
  $(pkgconfig_DATA:-$(LIBBRUTUS_CURRENT).$(LIBBRUTUS_REVISION).pc=.pc.in)
 
 It is not portable to use immersed variable expansion.
 But if LIBBRUTUS_CURRENT and LIBBRUTUS_REVISION are AC_SUBSTed
 variables, you can use the @...@ form here:
 
 EXTRA_DIST = $(pkgconfig_DATA:[EMAIL PROTECTED]@[EMAIL PROTECTED]@.pc=.pc.in)

OK.


 CWD = $(shell pwd)
 BARE_NAMES  = $(notdir $(IDL_FILES))
 LOCAL_IDL_FILES = $(addprefix $(CWD)/,$(BARE_NAMES))
 
 I do not know any easy way to replace these.  You would have to change
 the logic of the makefile.

I was afraid some of those was in that category. Damn, must think
then...


  Needless to say that all of this worked without any warnings prior to
  automake-1.10. 
 
 To switch these warnings off for a particular Makefile.am, use
 
 AUTOMAKE_OPTIONS = -Wno-portability
 
 To switch them off glibally, use
 
 AM_INIT_AUTOMAKE([-Wno-portability])
 
 in your configure.ac.

OK, good tip.


 For your information, I found this comment in Automake 1.9.5:
 (and I believe is was there since 1.7 till 1.9.6)
 
   # FIXME: 'portability' warnings are currently disabled by default.
   # Eventually we want to turn them on in GNU and GNITS modes, but
   # we don't do this yet in Automake 1.7 to help the 1.6/1.7
   # transition.
   #
   # Indeed there would be only two ways to get rid of these new
   # warnings:
   #  1. adjusting Makefile.am
   # This is not always easy (or wanted).  Consider %-rules or
   # $(function args) variables.
   #  2. using -Wno-portability
   # This means there is no way to have the same Makefile.am
   # working both with Automake 1.6 and 1.7 (since 1.6 does not
   # understand -Wno-portability).
   #
   # In Automake 1.8 (or whatever it is called) we can turn these
   # warnings on, since -Wno-portability will not be an issue for
   # the 1.7/1.8 transition.
 
 Have a nice day,

You too and thanks for your help,
  jules






Re: shell pwd: non-POSIX variable name ??

2007-03-29 Thread Stepan Kasal
Hi,

On Thu, Mar 29, 2007 at 02:25:31PM +0200, Jules Colding posted an
Automake question to the Autoconf list.  (Understandable mistake, of
course.)

I suppose the question can be deduced from my answer.  :-)

 What is the recommended and portable way of doing what I do above to
 avoid the warnings and to be nice to automake?

OBJS= $(patsubst %.c,%.o,$(STUB_SRC))

this can ce written portably as:

OBJS = $(STUB_SRC:.c=.o)

EXTRA_DIST = 
 $(pkgconfig_DATA:-$(LIBBRUTUS_CURRENT).$(LIBBRUTUS_REVISION).pc=.pc.in)

It is not portable to use immersed variable expansion.
But if LIBBRUTUS_CURRENT and LIBBRUTUS_REVISION are AC_SUBSTed
variables, you can use the @...@ form here:

EXTRA_DIST = $(pkgconfig_DATA:[EMAIL PROTECTED]@[EMAIL PROTECTED]@.pc=.pc.in)

CWD = $(shell pwd)
BARE_NAMES  = $(notdir $(IDL_FILES))
LOCAL_IDL_FILES = $(addprefix $(CWD)/,$(BARE_NAMES))

I do not know any easy way to replace these.  You would have to change
the logic of the makefile.

 Needless to say that all of this worked without any warnings prior to
 automake-1.10. 

To switch these warnings off for a particular Makefile.am, use

AUTOMAKE_OPTIONS = -Wno-portability

To switch them off glibally, use

AM_INIT_AUTOMAKE([-Wno-portability])

in your configure.ac.

For your information, I found this comment in Automake 1.9.5:
(and I believe is was there since 1.7 till 1.9.6)

  # FIXME: 'portability' warnings are currently disabled by default.
  # Eventually we want to turn them on in GNU and GNITS modes, but
  # we don't do this yet in Automake 1.7 to help the 1.6/1.7
  # transition.
  #
  # Indeed there would be only two ways to get rid of these new
  # warnings:
  #  1. adjusting Makefile.am
  # This is not always easy (or wanted).  Consider %-rules or
  # $(function args) variables.
  #  2. using -Wno-portability
  # This means there is no way to have the same Makefile.am
  # working both with Automake 1.6 and 1.7 (since 1.6 does not
  # understand -Wno-portability).
  #
  # In Automake 1.8 (or whatever it is called) we can turn these
  # warnings on, since -Wno-portability will not be an issue for
  # the 1.7/1.8 transition.

Have a nice day,
Stepan Kasal




Re: shell pwd: non-POSIX variable name ??

2007-03-29 Thread Ralf Wildenhues
* Stepan Kasal wrote on Thu, Mar 29, 2007 at 04:19:33PM CEST:
 
 For your information, I found this comment in Automake 1.9.5:
 (and I believe is was there since 1.7 till 1.9.6)
[...]

 Needless to say that all of this worked without any warnings prior to
 automake-1.10.

Yes, and Automake 1.10's NEWS file contains the missing bit here:

|  - `-Wportability' has finally been turned on by default for `gnu' and
|`gnits' strictness.  This means, automake will complain about %-rules
|or $(GNU Make functions) unless you switch to `foreign' strictness or
|use `-Wno-portability'.

Cheers,
Ralf