LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-06-2007, 01:20 AM   #16
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69

I am afraid there is too much escaping involved in putting this into Makefile itself. It is way easier to have a separate script; do you have a real reason against it (it can be generated by Makefile and later deleted, by the way). One time I wanted to create a Makefile that asks confirmation; I found it too complicated to do in normal way and so it turned out to be much simpler just to run a 'bash -c ' command which will set an environment variable and invoke make again.
 
Old 08-06-2007, 01:54 AM   #17
munna_dude
Member
 
Registered: Dec 2006
Posts: 362

Original Poster
Rep: Reputation: 30
sorry to remove the code.. my project had check this... so, there is some problem.

yeah! ok... am doing this way..
am writing a seperate script and placed it in "src" name of the script file is "makelink"
i wrote the code in gtk make file like this


it is not working..

can you please tell me

how to write this in make script..

thank you in advacne

Last edited by munna_dude; 08-11-2007 at 04:52 AM.
 
Old 08-06-2007, 02:14 AM   #18
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
MOZLIB=$(shell ./makelink)

- in Makefile. What ./makelink outputs when run from command-line?
 
Old 08-06-2007, 03:51 AM   #19
munna_dude
Member
 
Registered: Dec 2006
Posts: 362

Original Poster
Rep: Reputation: 30
sorry.
again same problem with if condition check...
Code:

initially.. i have seamonkey and firefox...

the above code output shows..
seamonkey.....

then i removed seamonkey... now in my machine firefox is there...
but the output is blank...

i think if condition not excuting properly...

the all problem with condition checking...


please help me

thank you in advance

Last edited by munna_dude; 08-11-2007 at 04:53 AM.
 
Old 08-06-2007, 03:56 AM   #20
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Well, you add / in the wrong moment. $mozlib is not empty because it is just '/'. So you need to test if $k is empty.
 
Old 08-06-2007, 06:09 AM   #21
munna_dude
Member
 
Registered: Dec 2006
Posts: 362

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by raskin
Well, you add / in the wrong moment. $mozlib is not empty because it is just '/'. So you need to test if $k is empty.
hi..
yes.. i did this..
now i got a strange problem..

let me explain....
my source exe name is "phone" and placed it in /usr/bin
i wrote a script file to excute the "phone" exe i.e "phonnes" and placed in /usr/bin .

initially i have seamonkey and firefox installed in my machine...
am checking this with your code..
then it will take the seamonkey, ".so" files...
i compiled my source and copy the "phone" exe then paste it in /usr/bin

i ran the "phonnes" script... it is excuting correctly and linking correct so's (i.e seamonkey's)

but the problem is.....
i remove the seamonkey from my machine...(now i have only firefox)
then ran "phonnes" script.. to excute "phone" exe...

it saying this error....
Quote:
./phone: error while loading shared libraries: libgtkembedmoz.so: cannot open shared object file: No such file or directory
coz, "phone" exe compiled with the seamonkey ".so" then i removed the seamonkey... so that the exe not excuting properly...

i dont know why my "phone" exe behaving like this...
in make script i given the "makelink" script to linkup ".so"
by using this, when i ran the "phone" exe it have to check the installed browser and then have to linkup the ".so" to that...

my exe not behaving like this...

what i have to do..
sorry for the lenghty post...

please help me

thank you in advance
 
Old 08-06-2007, 02:12 PM   #22
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
I am afraid you are wrong. Probably linker hardcodes mozilla paths as additional paths to search for libraries, and all evaluation is compile-time. What you can do is to write a wrapper script that will at the start of your program find mozilla libraries and add path to them to LD_LIBRARY_PATH.
 
Old 08-06-2007, 11:13 PM   #23
munna_dude
Member
 
Registered: Dec 2006
Posts: 362

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by raskin
I am afraid you are wrong. Probably linker hardcodes mozilla paths as additional paths to search for libraries, and all evaluation is compile-time. What you can do is to write a wrapper script that will at the start of your program find mozilla libraries and add path to them to LD_LIBRARY_PATH.
yes! you are correct..

for fedora5..
initially i given the link with mozilla ".so" files...
and my exe(rpm) uploaded to the site...
there cause a problem.. that is user upgrad his mozilla version..
now mozila (especially mozilla browser) not releasing any versions...
i.e. he installed seamonkey...
but we are linked the ".so" with mozilla ,, so that the exe(rpm ) doesnot run properly saying that libgtkembedmoz.so not found..


so that i decided to do this mozilla amd seamonkey and firefox(with version ) in exe itself..

but this idea also fails...

is there any way to do this...
my exe have to run independent of browser..(with any browser exe have to run)..

please help me

thank you in advance
 
Old 08-07-2007, 02:12 AM   #24
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
You should go mozilla's way: have a shell script launcher and a phones-bin executable.
phones-launcher should do all the work about finding mozilla libraries and export LD_LIBRARY_PATH containing them all. phones-bin should just be linked against these libraries referenced by generic names (just .so, without version). It will be run having them in one of the directories in LD_LIBRARY_PATH, so it can be happy.
 
Old 08-07-2007, 07:55 AM   #25
munna_dude
Member
 
Registered: Dec 2006
Posts: 362

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by raskin
You should go mozilla's way: have a shell script launcher and a phones-bin executable.
phones-launcher should do all the work about finding mozilla libraries and export LD_LIBRARY_PATH containing them all. phones-bin should just be linked against these libraries referenced by generic names (just .so, without version). It will be run having them in one of the directories in LD_LIBRARY_PATH, so it can be happy.
yeah! this idea is great...
i had already applied this...

for my source...
phone is my gtk exe and
phonnes is the script... it is a launcher of phone exe..

till now here am doing the modifications..(in phonnes script)

actually my exe(phone) depends on ".so " files...
so at the time of excuting the source... this needed by ".so"..

without ".so" it will not compiles(this all about gtk source of phone exe)

is it possible to change behaviour of phone exe after compilation...means at the time of excuting...


thank you in advance

Last edited by munna_dude; 08-07-2007 at 07:58 AM.
 
Old 08-07-2007, 11:03 AM   #26
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Sorry, I do not understand what you want. Do you want to compile and link against shared libraries without having them? I think it would not be easy, as linker needs to look at library at least to know which symbols (functions) are defined in it.
 
Old 08-08-2007, 07:42 AM   #27
munna_dude
Member
 
Registered: Dec 2006
Posts: 362

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by raskin
Sorry, I do not understand what you want. Do you want to compile and link against shared libraries without having them? I think it would not be easy, as linker needs to look at library at least to know which symbols (functions) are defined in it.
is there any way to linkup the libfiles(".so") to the exe(phone exe)...
like suppose if i run the command like this
./phone -L/usr/lib/firefox-1.5.0.12 -lgtkembedmoz -lxpcom

means linking the libraries dynamically..

i got a strange problem now..
i created a rpm..
it is installing only in mozilla
not in firefox..(means there is no mozilla na d seamonkey)
asking dependancies...
but in my machine i have dependencies in firefox.. the unable to take the firefox ".so" files..

why??


please help me

thank you in advance..
 
Old 08-08-2007, 11:03 AM   #28
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
I do not know exactly how RPM dependencies work - haven't used RPM for quite a long time.. Maybe the way you specified dependencies is not formally satisfied by firefox.
 
Old 08-08-2007, 11:18 PM   #29
munna_dude
Member
 
Registered: Dec 2006
Posts: 362

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by raskin
I do not know exactly how RPM dependencies work - haven't used RPM for quite a long time.. Maybe the way you specified dependencies is not formally satisfied by firefox.
how to give the path of the firefox lib files(".so" ) in make script...

for mozilla and seamonkey i not given any path to link the ".so".....
i just given that -lgtkembedmoz -lxpcom..

what the deference....
i dontknow why the firefox ".so" s are not detecting by the rpm...

facing somany problems with this...
i think it is over... next minute the new problem raising..

oh!...

please help me


thank you in advance
 
Old 08-09-2007, 12:03 AM   #30
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Do you have any dependencies for your RPM specified? Do you run your executable with LD_LIBRARY_PATH set to include paths to all the libraries you need?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
same awk script running on linux 7.2 and linux 10 suchi_s Programming 2 11-22-2004 07:47 AM
Converting a Windows Perl script to a Linux Perl script. rubbercash Programming 2 07-19-2004 10:22 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM
Exp. Windows/Linux-Script Programmer - Need Linux Programming Mentor! ruttiger Linux - Newbie 2 10-28-2001 11:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration