Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-09-21
05:11 • Closed ticket [859072ffff]: sample extension make file broken plus 7 other c... artifact: 4b1b04050c user: hobbs
2004-04-19
16:36 • Ticket [859072ffff]: 4 changes artifact: f43d7ad837 user: dkf
2004-04-18
18:28 • Ticket [859072ffff]: 4 changes artifact: 82329899f9 user: lvirden
18:24 • Ticket [859072ffff]: 4 changes artifact: 9988e9e6aa user: lvirden
18:24 • Ticket [859072ffff]: 1 change artifact: b6cde43eab user: lvirden
2003-12-15
16:40 • Ticket [859072ffff]: 1 change artifact: d555ee1fa7 user: dkf
2003-12-12
18:13 • New ticket [859072ffff]. artifact: 32316ae307 user: lvirden

sample extension make file broken

Closed / Fixed859072ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 22 years ago
Descriptionplain2003-12-12 18:13:01
I am trying to build the latest sample extension on a
sparc solaris 8
machine with Sun's C compiler.

After everything builds and tests fine, when the
install is executed this is
what occurs:

 /projects/gnu/sparc-sun-solaris2.8/bin/ginstall -c
libsample0.5g.so /volws/lwv2
6/ldatae/lib/sample0.5/libsample0.5g.so
 : /volws/lwv26/ldatae/lib/sample0.5/libsample0.5g.so
if test "x1" = "x1"; then \
    /projects/gnu/sparc-sun-solaris2.8/bin/ginstall -c
-m 644 pkgIndex.tcl /volws/lwv26/ldatae/lib/sample0.5; \
fi
Installing header files in /volws/lwv26/ldatae/include
/bin/bash: -c: line 1: syntax error near unexpected
token `;'
/bin/bash: -c: line 1: `for i in  ; do  echo
"Installing ../$i" ;  /projects/gnu
/sparc-sun-solaris2.8/bin/ginstall -c -m 644 ../$i
/volws/lwv26/ldatae/include ;
  done;'
make: *** [install-libraries] Error 2
dkf Ticket [859072ffff]: 1 change [History diff]2003-12-15 16:40:05
lvirden Ticket [859072ffff]: 1 change [History diff]2004-04-18 18:24:13
lvirdenplain2004-04-18 18:24:14
Logged In: YES 
user_id=15949

One thing I have noticed:
install-libraries: libraries
        @mkdir -p $(DESTDIR)$(includedir)
        @echo "Installing header files in
$(DESTDIR)$(includedir)"
        @for i in $(PKG_HEADERS) ; do \
            echo "Installing $(srcdir)/$$i" ; \
            $(INSTALL_DATA) $(srcdir)/$$i
$(DESTDIR)$(includedir) ; \
        done;
is the code generated in the Makefile for same.
But PKG_HEADERS is empty - causing the for loop to be
for i in ; do

that isn't going to work very well...

The for loop should either be surrounded by an if or there needs
to be something added to the for loop so that there is
always at least
one entry to process...

It's really important to fix this kind of thing if we are
going to tell people
to use the sample code as a basis of their development.
lvirdenplain2004-04-18 18:28:10
Logged In: YES 
user_id=15949

I tried to modify the Makefile to use an if, but I couldn't
figure out a syntax for it.  It looks to me like the code
needs to be conditionally generated or something.
dkfplain2004-04-19 16:36:39
Logged In: YES 
user_id=79902

Perhaps something like this would do the trick:

        @test -n "$(PKG_HEADERS)" || \
            for i in $(PKG_HEADERS) ; do \
            echo "Installing $(srcdir)/$$i" ; \
            $(INSTALL_DATA) $(srcdir)/$$i \
            $(DESTDIR)$(includedir) ; done

Basically, I'm adding a 'test -n "$(PKG_HEADERS)" ||' guard
to the for line. If it doesn't work, there are other (less
neat) formulations with test that should work.
hobbsplain2004-09-21 05:11:43
Logged In: YES 
user_id=72656

Using a construct like:

@list='$(PKG_HEADERS)'; for i in $$list; do ...

I have avoided the empty list issues.
Log in (anonymous is fine) to add a comment.