Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support Remove Unwanted Libraries - optimizing Post 302393525 by Andre_Merzky on Tuesday 9th of February 2010 04:07:43 AM
Old 02-09-2010
Quote:
Originally Posted by uunniixx
This is what I want to avoid - hit and trial method, the problem will get worse when inclusion of one object / static library file I have another dependency. Further this will take lots of workload and days to drive it to completion
I don't think that trial/error would be so tough. In pseudo perl code:

Code:
my @all_libs  = split (/\s+/, `ls $LIBPATH/*.a`);
my $good_libs = "";

# get number of unresolved messages w/o any static lib:
my $n_symbols = `make target | grep 'unresolved' | wc -l`;
chomp ($n_symbols);

foreach my $lib ( @all_libs )
{
  # try to add that static lib, and see if the number of unresolved syms decreases

  $lib =~ s/^lib//;
  $lib =~ s/\.a$//;
  
  my $check = `/bin/env LDFLAGS=-l$lib make target | grep 'unresolved' | wc -l`;
  chomp ($check);

  if ( $check < $n_symbols )
  {
     # good lib, well done!
     $good_libs .= " -l$lib");
  }    
}

# we want to link against all good libs
print "$good_libs\n";

You may getting symbols resolved twice - but that is a situation you should have stumbled over previously, so I guess thats unlikely. In any case, that will be simplier then the more formal, and elegant Smilie, way via nm, which was proposed earlier.

The above won't work if some of your static libs depend on other static libs - in that case, you need to add those 'good' libs you found to the test linking step.

Last edited by Andre_Merzky; 02-09-2010 at 05:14 AM.. Reason: simplified code
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove unwanted data?

Hi Can any one help me remove the unwanted data? I would want to remove the complete event id 4910 ( the type there is INFO), that means, I have to remove starting from 7th - 19th lines. can any one of you please help? Thanks, (24 Replies)
Discussion started by: hitmansilentass
24 Replies

2. Shell Programming and Scripting

Remove unwanted XML Tags

I have set of sources and the respective resolution. Please advice how to resolve the same using Unix shell scripting. Source 1: ======= <ext:ContactInfo xmlns:ext="urn:AOL.FLOWS.Extensions"> <ext:InternetEmailAddress>AOL@AOL.COM</ext:InternetEmailAddress> </ext:ContactInfo> Resoultion... (1 Reply)
Discussion started by: ambals123
1 Replies

3. UNIX for Advanced & Expert Users

How to Remove the unwanted Blank Lines

I have a file with the below data, i would like to remove the end blank lines with no data. I used the below commands but could not able to succeed, could you please shed some light. Commands Used: sed '/^$/d' input.txt > output.txt grep -v '^$' input.txt > output.txt input.txt file... (5 Replies)
Discussion started by: Ariean
5 Replies

4. Solaris

Remove unwanted packages

I got a system which was installed with SUNWCXall cluster installed on it and i want remove unwanted software like GMNOME, Java Desktop System, Staroffice and numerous other softwares .. i want to do an automated removal of these packages where its uninstalled by itself ..from the is there any... (4 Replies)
Discussion started by: fugitive
4 Replies

5. Shell Programming and Scripting

awk - need to remove unwanted newlines on match

Context: I need to remove unwanted newlines from a data file listing books and associated data. Here is a sample listing ( line numbers included ): 1 360762| Skip-beat! 14 /| 9781421517544| nb | 2008.| Nakamura, Yoshiki.| NAKAMUR | Kyoko Mogami followed 2 her true love Sho to Tokyo to... (6 Replies)
Discussion started by: Bubnoff
6 Replies

6. Shell Programming and Scripting

Remove unwanted lines

I have a .xml file, where i need some output. The xml file is like: Code: <?******?></ddddd><sssss>234</dfdffsdf><sdhjh>534</dfdfa>......... /Code I need the output like: code 234 534 . . . /code How can i do it? (5 Replies)
Discussion started by: anupdas
5 Replies

7. Shell Programming and Scripting

remove unwanted text using perl

Hello..I have a text file that need to remove unwanted text. This is the original file. No. Time Source Destination Protocol Info 16 0.649949 10.1.1.101 209.225.11.237 HTTP POST /scripts/cms/xcms.asp HTTP/1.1 ... (9 Replies)
Discussion started by: taxi
9 Replies

8. Shell Programming and Scripting

How to remove unwanted strings?

Hi Guys, Can someone give me a hand on how I can remove unwanted strings like "<Number>" and "</Number>" and retain only the numbers from the input file below. INPUT FILE: <Number>10050000</Number> <Number>1001340001</Number> <Number>1001750002</Number> <Number>100750003</Number>... (8 Replies)
Discussion started by: pinpe
8 Replies

9. Shell Programming and Scripting

How to remove unwanted " from string...

I have this Input File with extra double quotes in the middle. Please suggest how to handle this condition. Input File: "123985","SAW CUT CONCRETE SLAB 20"THICK",,"98.57","","EACH","N" "204312","ARMAFLEX-1 3/8 X 3"",,"2.48","","PER FOOT","N" "205745","MISTING HEAD HOLLOW CONE "C"... (3 Replies)
Discussion started by: BICC
3 Replies

10. Shell Programming and Scripting

Remove unwanted white space

Hi, I have a very big file 25GB with information present in it like $ head ind_stats update index statistics pfirm001.dbo.Office using 200 values go ... (11 Replies)
Discussion started by: sam05121988
11 Replies
XINE(1) 						      General Commands Manual							   XINE(1)

NAME
xine-config - script to get information about the installed version of libxine SYNOPSIS
xine-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags] [--objcflags] [--plugindir] [--datadir] [--scriptdir] [--localedir] DESCRIPTION
xine-config is a tool that is used to determine the compiler and linker flags that should be used to compile and link programs that use libxine. It can also be used to determine the directories where libxine expects plugins and skins. Finally, it's also used internally by the .m4 macros for GNU autoconf that are included with xine-lib. OPTIONS
xine-config accepts the following options: --version Print the currently installed version of libxine on the standard output. --libs Print the linker flags that are necessary to link libxine to a program. --cflags --objcflags Print the compiler flags (for C and Objective C, respectively) that are necessary to compile a program that uses libxine. --bindir --plugindir --datadir --scriptdir --localedir Print the directory where, respectively, libxine binaries, plugins, data files, scripts and locale data are stored/expected. --prefix=PREFIX If specified, use PREFIX instead of the installation prefix that xine-lib was built with when computing the output for the --cflags and --libs options. This option is also used for the exec prefix if --exec-prefix was not specified. This option must be specified before any --libs or --cflags options. --exec-prefix=PREFIX If specified, use PREFIX instead of the installation exec prefix that xine-lib was built with when computing the output for the --cflags and --libs options. This option must be specified before any --libs or --cflags options. SEE ALSO
xine-lib(3), xine(1) COPYRIGHT
Copyright (C) 2001 Siggi Langauf, (C) 2001-2008 the xine project. Based on the man page for gtk-config, (C) 1998 Owen Taylor. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, pro- vided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in sup- porting documentation. The xine project 2001-08-28 XINE(1)
All times are GMT -4. The time now is 02:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy