gnu.utils.help
  Home FAQ Contact Sign in
gnu.utils.help only
 
Advanced search
September 2008
motuwethfrsasuw
1234567 36
891011121314 37
15161718192021 38
22232425262728 39
2930      40
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
gnu.utils.help Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  linking and symbol placement         


Author: tns1
Date: Sep 19, 2008 19:29

I am porting some older gnu makefiles and linker scripts to a newer
version of GCC. I have one linker script that I don't see how to update.

SECTIONS
{
GROUP :
{
COMMON :
{
a.o
b.o
c.o
}
}
}

This generated a segfault until I removed the GROUP : { } encapsulation.
It links, but the order in which the symbols appear in the map is not
what I expect, and not the same as under the older tool.
Show full article (0.93Kb)
no comments
  Re: copy with extension rename         


Author: Karl Berry
Date: Sep 15, 2008 15:03

simplest way to copy and rename all *.a files to *.b ???

Different people will have different answers. What I do is:

rename.pl 's/a$/b/' *.a

where rename.pl is the appended Perl script (it exists in many versions
around the net). This version is slightly modified by me from lwall's
original to print the successful renames.

karl

#!/usr/bin/env perl
# print changes --karl
#
# Revision 4.0 91/03/20 01:11:53 lwall
# 4.0 baseline.
#
# Revision 3.0.1.2 90/08/09 03:17:57 lwall
# patch19: added man page for relink and rename
'di';
'ig00';
Show full article (2.43Kb)
3 Comments
  copy with extension rename         


Author: tns1
Date: Sep 15, 2008 11:33

simplest way to copy and rename all *.a files to *.b ???
no comments
  Re: how to use "if" with awk?         


Author: Bob Proulx
Date: Sep 11, 2008 09:37

Chris wrote:
> I'm trying to use an if query in combination with awk.

I am not an awk syntax expert but AFAIK you don't want to split up the
awk program string into separate arguments. Quote the entire program
into one string argument. I think that is the root of your problem.
Your example shows an "if" in program argument one and the rest of the
program in program argument two.
> I'm therefore using this commandline:
> n@test ~]$ gawk if '($8<0.001) {print "SNP:" $2 " P="$8}' Batch_Call_dev-bs.model.P1.model

I would do that this way using pattern-action pairs where the pattern
acts as an if statement. It just seems the most awk-ish way to me.

gawk '$8<0.001 {print "SNP:" $2 " P="$8}' Batch_Call_dev-bs.model.P1.model

I tested with this:

printf "1 one\n2 two\n3 three\n" | awk '$1<3 {print $0}'
1 one
2 two

But using the awk if control syntax in the awk program itself also
works okay. Here is a test using it:
Show full article (1.06Kb)
no comments
  How can I make indent leave pointer type *s alone?         


Author: Chris Nelson
Date: Sep 10, 2008 06:56

When I run indent with various options I want against my source, it
does what I want but also messes with the placement of *s in pointer
types:

-int send_pkt(tpkt_t* pkt, void* opt_data);
-void dump(tpkt_t* bp);
+int send_pkt(tpkt_t * pkt, void *opt_data);
+void dump(tpkt * bp);

I know my placement of *s next to the type not the variable is
unconventional but how can I get indent to just leave them alone?
I've looked in the man page, the info page, and visited a half a dozen
pages that Google suggested and I can't find an option to do this.
no comments
  partial linking         


Author: tns1
Date: Sep 4, 2008 13:12

I have source tree with many folders containing many .o files each. I
wish to partially link the contents of each folder so I have one
combined .o file (library?) for each folder. These combined (object
files?, libraries?) will go thru a final link step at a later stage in
the build.

Is there anything special about how this partial linking or can I just
do something like:

$(OBJS)=a.o b.o c.o
mylink.b : $(OBJS)
ld -o mylink.b $(OBJS)

Does building in this multi-tiered fashion result in a larger final
image, or can the final link still remove redundancies?
4 Comments
  make question (depend on content of a file)         


Author: James
Date: Sep 2, 2008 13:33

The goal is to satisfy both (a) and (b):

(a) the target(T) depends on a generated file(F) as well as
on the content of the file (file F contains a list of files).
(b) parallel make enabled

content = $(shell cat F)

T: F $(content)

F:
Rule to generate F

How do I do it?
TIA

James
1 Comment
  backtick help         


Author: Gisle Vanem
Date: Aug 31, 2008 09:42

I'm pulling my hairs trying to get 'sed' to work in a simple
makefile (under MingW/MSYS/Win32). I have the following in a
makefile:

VERSION = `grep WATTCP_VER_STRING inc/tcp.h | cut -d' ' -f4`
...
show_ver:
@echo This is version $(VERSION)

and '#define WATTCP_VER_STRING "2.2.11"' in inc/tcp.h.

This produces the expected ' This is version "2.2.11"'. But I really need
an output w/o the quotes. So I tried:
VERSION = `grep WATTCP_VER_STRING inc/tcp.h | cut -d' ' -f4 | sed -e /\\"//`

This does not work however. Anybody can explain me why? What should
the proper command be? I'm pretty lost here.

PS. The output from bash is:
/usr/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
/usr/bin/sh: -c: line 1: syntax error: unexpected end of file

--
Gisle V.
Show full article (0.87Kb)
3 Comments
  feature wish for diff - flag to split change hunks using shared context         


Author: Michael Zeilfelder
Date: Aug 15, 2008 07:20

Hi!

I'm somewhat a newbie with diff, so maybe I'm missing that or there is a good
reason why it does not exist, but well, the gnu-website send me to this
mailaddress to ask for features, so I just do...

The current behaviour of diff (2.8.1) seems to be that if context between two
changes overlaps then only a single change hunk is created. Which is
certainly a good default. Still I found that there are situation where I
would prefer to create two change hunks instead which both use the same
contextlines. As the contextlines don't change this shouldn't conflict with
patch, right? So having an additional flag to control this would be great
(like --small_hunks or --no_shared_context)

Well, just a proposal, maybe someone likes it and codes it, or tells me about
a tool which already does that, or maybe someone tells me why this is a
really really stupid idea :-)

- Michael
no comments
  Re: Using grep (or some other tool) to highlight, instead of grepping?         


Author: Ralf Wildenhues
Date: Aug 14, 2008 21:02

* Ralf Wildenhues wrote on Fri, Aug 15, 2008 at 05:48:23AM CEST:
>
> I guess if you translate your basic regex into an extended one, then you
> should be able to use egrep/grep -E, and also match end-of-line:
> grep -E --color=auto 'foo|$'

Erm, or just
grep --color=auto -e foo -e '$'
> Hmm. Using ^ instead of $ destroys the coloring, that looks like a bug
> (Debian package grep-2.5.1.ds2-6).

Seems to have been fixed since upstream.

Cheers,
Ralf
no comments
1 2 3 4 5 6 7 8 9