Re: adding to CFLAGS for all objects in subdir

2001-03-13 Thread Tom Tromey

> "Jeremy" == Jeremy Slade <[EMAIL PROTECTED]> writes:

Jeremy> In a project, I want all objects (both C and C++) in a certain
Jeremy> subdirectory to include additional flags (defined by
Jeremy> PERL_CFLAGS) in the compile line, but I don't want those flags
Jeremy> used to build object in other directories.

Use AM_CFLAGS.

Jeremy> CFLAGS = $(PERL_CFLAGS)

CFLAGS is a user variable.  Don't set it yourself.

Jeremy> CPPFLAGS=$(PERL_CFLAGS)

CPPFLAGS is also a user variable.

Jeremy> # Must create the $perllibarchdir/auto directory to enable auto-loading
Jeremy> # Also have to chmod Module.sl to be executable after install --
Jeremy> # not initially made executable since it is a _DATA object.
Jeremy> install-data-local:
Jeremy> $(mkinstalldirs) $(DESTDIR)$(perllibarchdir)/auto
Jeremy> chmod +x $(DESTDIR)$(perllibarchdir)/Module.sl

That's a bit ugly :-(.
I wouldn't object to a cleaner way to build Perl modules.

Jeremy> Please tell me there's an easier way to do this...

I thought everybody who wrote Perl modules used Perl's MakeMaker
mechanism (isn't that what it is called?  I haven't looked at it since
1996...).

Tom




Re: "unknown extension in source" perl error (with patch)

2001-03-13 Thread Tom Tromey

> "edward" == edward  <[EMAIL PROTECTED]> writes:

edward> +   if (!defined($extension_map{$extension}))
edward> +   {
edward> +   &am_error ("unknown extension for `$full' in $var");
edward> +   next;
edward> +   }

We can't do this.  We intentionally don't warn in this case.  See the
comment later in that same function:

# No error message here.  Used to have one, but it was
# very unpopular.

This error message was the number one bug report generator for a
while.

I agree that something should be done though.

Tom




adding to CFLAGS for all objects in subdir

2001-03-13 Thread Jeremy Slade

In a project, I want all objects (both C and C++) in a certain
subdirectory to include additional flags (defined by PERL_CFLAGS) in
the compile line, but I don't want those flags used to build object in
other directories.  I'm not sure how to accomplish this.

If I do this in the Makefile.am:

CFLAGS = $(PERL_CFLAGS)

Doesn't that clobber the standard CFLAGS, such as '-g -O2'?


What I'm ultimately trying to do is build a shared library that can be
dynamically loaded into a perl interpreter -- perhaps this is a
problem someone has already solved?  If anyone has pointers, I'd
appreciate it.

I currently have a Makefile.am that looks something like this:
--
perllib_DATA = Module.pm
perllibarch_DATA = Module.sl

# Do noinst libtool library to handle building the objects
noinst_LTLIBRARIES = lib_Module.la
lib_Module_la_SOURCES = Module.C

INCLUDES = -I$(PERL_ARCHLIBCORE)
CPPFLAGS=$(PERL_CFLAGS)

Module.sl: Module.lo
ld -b -E -o $@ $^ 

# Must create the $perllibarchdir/auto directory to enable auto-loading
# Also have to chmod Module.sl to be executable after install --
# not initially made executable since it is a _DATA object.
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(perllibarchdir)/auto
chmod +x $(DESTDIR)$(perllibarchdir)/Module.sl
--
I have other macros defined that set perllib, perllibarch,
PERL_CFLAGS, etc.  Ideally, those same macros would change the CFLAGS,
INCLUDES, etc for this specific directory to include all of the
perl-related stuff.

My platform is HP-UX 10.20, gcc-2.95.2, perl 5.6.0, autoconf-2.49c,
automake-1.4b, libtool-1.3.5

Please tell me there's an easier way to do this...

Thanks,
Jeremy
-- 
Jeremy Slade
Hewlett-Packard Company  VLSI Technology Center - http://cpus.hp.com/
[EMAIL PROTECTED](970) 898-7881





--Werror and --add-missing don't work toghether

2001-03-13 Thread Pavel Roskin

Hello!

CVS Automake uses am_line_error() to inform the user that it's installing
files. As a result, --Werror causes Automake to exit after it installs the
first file:

$ automake --Werror --add-missing; echo $?
automake: Makefile.am: installing `./INSTALL'
2
$ automake --Werror --add-missing; echo $?
automake: Makefile.am: required file `./NEWS' not found
2

Sorry, no patch.

Regards,
Pavel Roskin





Re: plea for case-insensitive, but case preserving (was: Re: 45-fix-yacc2-test.patch)

2001-03-13 Thread Akim Demaille

> "Lars" == Lars Hecking <[EMAIL PROTECTED]> writes:

Lars> edward writes:
>> hi akim,
>> 
>> this is a plea to avoid using constructs like the "cp Makefile.am
>> Makefile.AM" below. this kills us cygwin/windows people, and i for
>> one, very much would like to keep automake, etc. working on window
>> based platforms!
 
Lars>  I fully support this. There are more platforms with
Lars> case-preserving case-insensitive filesystems out there.

Yes, I'm sorry, this was really stupid.  Had I paid more attention, I
would have not written this.  Sorry.




Re: plea for case-insensitive, but case preserving (was: Re: 45-fix-yacc2-test.patch)

2001-03-13 Thread Lars Hecking

edward writes:
> hi akim,
> 
> this is a plea to avoid using constructs like the "cp Makefile.am
> Makefile.AM" below. this kills us cygwin/windows people, and i for one, very
> much would like to keep automake, etc. working on window based platforms!
 
 I fully support this. There are more platforms with case-preserving
 case-insensitive filesystems out there.





Re: pr19.test

2001-03-13 Thread Robert Collins

Right, I reset my automake dir to CVS no patches,


 test log in testSubDir  (running on cygwin 1.1.8-2)===
$ perl -pi.old -e 's/^\t\@/\t/g' Makefile
$ make distdir
chmod -R a+w ./am_lex_bug-0.1.1 >/dev/null 2>&1; rm -rf
./am_lex_bug-0.1.1
mkdir ./am_lex_bug-0.1.1
for file in Makefile.am Makefile.in aclocal.m4 configure configure.in
depcomp foo.c instal
l-sh missing mkinstalldirs foo.l  ; do \
  d=.; \
  if test -d $d/$file; then \
cp -pR $d/$file ./am_lex_bug-0.1.1 \
|| exit 1; \
  else \
test -f ./am_lex_bug-0.1.1/$file \
|| cp -p $d/$file ./am_lex_bug-0.1.1/$file \
|| exit 1; \
  fi; \
done
find ./am_lex_bug-0.1.1 -type d ! -perm -777 -exec chmod a+rwx {} \; -o
\
  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -444 -exec /bin/sh ./install-sh -c -m a+r {} {} \; \
|| chmod -R a+r ./am_lex_bug-0.1.1

=== end test log ===

For the sake of completeness,
== test log in testSubDir (running under ksh on openBSD 2.8)

$ perl -pi -e 's/^\t\@/\t/g' Makefile
$ make distdir
chmod -R a+w ./am_lex_bug-0.1.1 >/dev/null 2>&1; rm -rf
./am_lex_bug-0.1.1
mkdir ./am_lex_bug-0.1.1
for file in Makefile.am Makefile.in aclocal.m4 configure configure.in
depcomp f\
oo.c install-sh missing mkinstalldirs foo.l  ; do  d=.;  if test -d
$d/$file; th\
en  cp -pR $d/$file ./am_lex_bug-0.1.1  || exit 1;  else  test -f
./am_lex_bug-0\
.1.1/$file  || cp -p $d/$file ./am_lex_bug-0.1.1/$file  || exit 1;  fi;
done
find ./am_lex_bug-0.1.1 -type d ! -perm -777 -exec chmod a+rwx {} \; -o
! -type\
 d ! -perm -444 -links 1 -exec chmod a+r {} \; -o  ! -type d
! -perm -400 -exec\
chmod a+r {} \; -o  ! -type d ! -perm -444 -exec /bin/sh
./install-sh -c -m a+r\
{} {} \;  || chmod -R a+r ./am_lex_bug-0.1.1
=== end test log 

Rob

Bonus content:
   make check VERBOSE=e TESTS=pr19.test log ((from cygwin) don't
know if it's useful I haven't included the openBSD one, because we're
AFAIK we're not chasing a platform bug.===
=== Running test ./pr19.test
configure.in:8: warning: AC_PROG_LEX invoked multiple times
checking for a BSD compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for mawk... no
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking for gcc... gcc
checking for C compiler default output... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for executable suffix... .exe
checking for object suffix... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking for style of include used by make... #
checking dependency style of gcc... gcc
checking for flex... flex
checking for flex... (cached) flex
checking for yywrap in -lfl... yes
checking lex output file root... lex.yy
checking whether yytext is a pointer... yes
checking for bison... bison -y
configure: creating ./config.status
config.status: creating Makefile
make[3]: Entering directory `/usr/src/automake/tests/testSubDir'
flex   foo.l && mv lex.yy.c foo.c
source='foo.c' object='foo.o' libtool=no \
depfile='.deps/foo.Po' tmpdepfile='.deps/foo.TPo' \
depmode=gcc /bin/sh ./depcomp \
gcc -DPACKAGE=\"am_lex_bug\" -DVERSION=\"0.1.1\" -DYYTEXT_POINTER=1  -I.
 -I. -g -O2 -c
 -o foo.o `test -f foo.c || echo './'`foo.c
gcc  -g -O2   -o foo  foo.o -lfl
make[3]: Leaving directory `/usr/src/automake/tests/testSubDir'
make[3]: Entering directory `/usr/src/automake/tests/testSubDir'
chmod -R a+w ./am_lex_bug-0.1.1 >/dev/null 2>&1; rm -rf
./am_lex_bug-0.1.1
mkdir ./am_lex_bug-0.1.1
find ./am_lex_bug-0.1.1 -type d ! -perm -777 -exec chmod a+rwx {} \; -o
\
  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -444 -exec /bin/sh ./install-sh -c -m a+r {} {} \; \
|| chmod -R a+r ./am_lex_bug-0.1.1
/bin/sh /usr/src/automake/tests/testSubDir/missing --run tar chof -
./am_lex_bug-0.1.1 | G
ZIP=--best gzip -c >./am_lex_bug-0.1.1.tar.gz
chmod -R a+w ./am_lex_bug-0.1.1 >/dev/null 2>&1; rm -rf
./am_lex_bug-0.1.1
chmod -R a+w ./am_lex_bug-0.1.1 > /dev/null 2>&1; rm -rf
./am_lex_bug-0.1.1
GZIP=--best gunzip -c ./am_lex_bug-0.1.1.tar.gz | /bin/sh
/usr/src/automake/tests/testSubD
ir/missing --run tar xf -
chmod -R a-w ./am_lex_bug-0.1.1; chmod a+w ./am_lex_bug-0.1.1
mkdir ./am_lex_bug-0.1.1/=build
mkdir ./am_lex_bug-0.1.1/=inst
chmod a-w ./am_lex_bug-0.1.1
dc_install_base=`CDPATH=: && cd ./am_lex_bug-0.1.1/=inst && pwd` \
  && cd ./am_lex_bug-0.1.1/=build \
  && ../configure --srcdir=.. --prefix=$dc_install_base \
  && make  \
  && make  dvi \
  && make  check \
  && make  install \
  && make  installcheck \
  && make  uninstall \
  && test `find $dc_install_base -type f -print | wc -l` -le 1 \
  && make  dist \
  && make  distclean \
  && rm -f ./am_lex_bug-0.1.1.tar.gz \
  && (test `find . -type f

plea for case-insensitive, but case preserving (was: Re: 45-fix-yacc2-test.patch)

2001-03-13 Thread edward

hi akim,

this is a plea to avoid using constructs like the "cp Makefile.am
Makefile.AM" below. this kills us cygwin/windows people, and i for one, very
much would like to keep automake, etc. working on window based platforms!

cheers,
edward

> +cp Makefile.am Makefile.AM

- Original Message -
From: "Akim Demaille" <[EMAIL PROTECTED]>
To: "Automake" <[EMAIL PROTECTED]>
Sent: Sunday, March 11, 2001 1:09 PM
Subject: 45-fix-yacc2-test.patch



>
> Index: ChangeLog
> from  Akim Demaille  <[EMAIL PROTECTED]>
> * tests/yacc2.test: Don't define several times a variable, as
> automake complains.
>
> Index: tests/yacc2.test
> --- tests/yacc2.test Sat, 13 Jan 2001 18:11:09 +0100 akim (am/6_yacc2.test
1.1 775)
> +++ tests/yacc2.test Sun, 11 Mar 2001 16:55:21 +0100 akim (am/6_yacc2.test
1.1 775)
> @@ -15,11 +15,20 @@
>  zardoz_SOURCES = zardoz.y
>  END
>
> +# Don't redefine several times the same variable.
> +cp Makefile.am Makefile.AM
> +
> +








"unknown extension in source" perl error (with patch)

2001-03-13 Thread edward

hi peeps:

given the following Makefile.am:

noinst_PROGRAMS = foo
foo_SOURCES = foo.i

automake will die with:

+ perl ../../automake --amdir=/usr/beta/src/automake/tests/.. --foreign
-a
Use of uninitialized value in string eq at ../../automake line 5417.

unknown extensions are not tested before used.

ChangeLog:

2001-03-13  Edward M. Lee  <[EMAIL PROTECTED]>

* automake.in (handle_single_transform_list): test (and warn the
user) for unknown extensions before doing language features.

Suggested Patch:

--- automake.in.origTue Mar 13 04:49:55 2001
+++ automake.in Tue Mar 13 06:28:11 2001
@@ -1633,6 +1633,11 @@
 my $renamed = 0;
 my ($linker, $object);

+   if (!defined($extension_map{$extension}))
+   {
+   &am_error ("unknown extension for `$full' in $var");
+   next;
+   }
 $extension = &derive_suffix ($extension);
 my $lang = $extension_map{$extension};
 if ($lang)


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/




Re: pr19.test

2001-03-13 Thread edward


- Original Message -
From: "Akim Demaille" <[EMAIL PROTECTED]>
To: "edward" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, March 13, 2001 5:39 AM
Subject: Re: pr19.test



> Thanks for the details.  As I'm currently working on DIST_COMMON
> etc. (I have another bunch of patches waiting at home), I'm not
> inclined to fix this now (collisions...).
>
> But still, I fail to understand the relationship between your
> explanation and the failure you observe.  In what way is this related
> to Cygwin?  _That_ is the real question.  The scenario you depict
> seems to imply that Automake should have pr19 fail everywhere, which
> is not the case.  So why do _you_ observe a failure?

hi Akim,

On systems with make programs which delete intermediate targets
(including cygwin), I expect pr19 to fail with foo.c not found. I
haven't verified this since I don't have access to non-gnu make, but it
seems consistent with what others have reported here.

On cygwin itself, there is an additional problem due to the "make
clean"
test failing. foo.exe isn't removed properly. That can be fixed by
putting AC_EXEEXT into configure.in

cheers,
edward

ps. looking again at the Makefile.am of pr19.test, foo is listed as
noinst. i suppose lang_*_rewrite should at least check for noinst/check
targets before pushing into dist common, similar to what happens in
am_install_var. that's a separate issue though =)




__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/




Re: pr19.test

2001-03-13 Thread Akim Demaille


| From
| http://sources.redhat.com/ml/automake/2001-03/msg00183.html
| 
| 2) lines 4946-4947 of automake.in version 1.977
| 
| # FIXME: nodist.
| &push_dist_common ($pfx . $base . '.' . $ext);
| 
| commenting out the last line removes foo.c (which is a temporary file)
| from the make distdir target, which fails because according to automake,
| foo.c is supposed to be redistributed. however, (gnu) make removes temporary
| files like foo.c (generated from foo.l). in my opinion, this is correct and
| should not be redistributed. the Makefile.am writer can always explicitly
| include foo.c if they really want to. from the comment in the automake.in
| file, it seems the automake peeps are aware of this. there are similar
| comments in automake.in with other generated files as well.
| 
| Here is the context:
| 
| foo.o: foo.l
| 
| make has enough information to convert foo.l -> foo.c (via lex/flex)
| then compile foo.c to foo.o. However, since foo.c is an intermediate file
| it is deleted.
| 
| automake adds foo.c to the list of dist files though, via push_dist_common.
| from the comments in the automake source, it appears this is already known,
| but i don't know if anyone plans on doing anything about it. by the way,
| same
| issue for other auto-generated files. just search automake.in for "FIXME:
| nodist"

Thanks for the details.  As I'm currently working on DIST_COMMON
etc. (I have another bunch of patches waiting at home), I'm not
inclined to fix this now (collisions...).

But still, I fail to understand the relationship between your
explanation and the failure you observe.  In what way is this related
to Cygwin?  _That_ is the real question.  The scenario you depict
seems to imply that Automake should have pr19 fail everywhere, which
is not the case.  So why do _you_ observe a failure?




Re: pr19.test

2001-03-13 Thread edward

From

http://sources.redhat.com/ml/automake/2001-03/msg00183.html

2) lines 4946-4947 of automake.in version 1.977

# FIXME: nodist.
&push_dist_common ($pfx . $base . '.' . $ext);

commenting out the last line removes foo.c (which is a temporary file)
from the make distdir target, which fails because according to automake,
foo.c is supposed to be redistributed. however, (gnu) make removes temporary
files like foo.c (generated from foo.l). in my opinion, this is correct and
should not be redistributed. the Makefile.am writer can always explicitly
include foo.c if they really want to. from the comment in the automake.in
file, it seems the automake peeps are aware of this. there are similar
comments in automake.in with other generated files as well.

Here is the context:

foo.o: foo.l

make has enough information to convert foo.l -> foo.c (via lex/flex)
then compile foo.c to foo.o. However, since foo.c is an intermediate file
it is deleted.

automake adds foo.c to the list of dist files though, via push_dist_common.
from the comments in the automake source, it appears this is already known,
but i don't know if anyone plans on doing anything about it. by the way,
same
issue for other auto-generated files. just search automake.in for "FIXME:
nodist"

cheers






Re: pr19.test

2001-03-13 Thread Akim Demaille


> make[2]: Leaving directory `/usr/src/automake/tests/testSubDir'
> make[2]: Entering directory `/usr/src/automake/tests/testSubDir'
> chmod -R a+w ./am_lex_bug-0.1.1 >/dev/null 2>&1; rm -rf
> ./am_lex_bug-0.1.1
> mkdir ./am_lex_bug-0.1.1
> cp: ./foo.c: No such file or directory

I have this.

make[3]: Leaving directory `/mnt/nostromo/home/lrde/prof/akim/src/am/tests/testSubDir'
make[3]: Entering directory `/mnt/nostromo/home/lrde/prof/akim/src/am/tests/testSubDir'
chmod -R a+w ./am_lex_bug-0.1.1 >/dev/null 2>&1; rm -rf ./am_lex_bug-0.1.1
mkdir ./am_lex_bug-0.1.1
find ./am_lex_bug-0.1.1 -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -444 -exec /bin/sh ./install-sh -c -m a+r {} {} \; \
|| chmod -R a+r ./am_lex_bug-0.1.1

Could you try to find the guilty lines in tests/testSubDir/Makefile?

I'd suggest that you

make check VERBOSE=e TESTS=pr19.test
perl -pi 's/^\t\@/\t/g' testSubDir/Makefile
cd testSubDir
make distdir

And send the logs.