Help - Search - Members - Calendar
Full Version: Source Code
Linuxhelp > Support > Technical Support
I downloaded a program and i dont know what to do what to do witht he source. Can someone help.
I can give you a vague answer, and ask a couple of questions, and someone with more skill can give you a much better answer based on that.

When you download the sourcecode to a program, the first thing to do is make sure you are able to compile it. That means you need to have a compiler that works with the same language as the source. Secondly, you've got to give the right commands to the compiler to get it to turn your sourcecode into a bytecode program.

So we need to know two things: What OS distribution are you using?, and second, What language is the source? (C++? Pascal? VisualBasic?)
I asume you downloaded a tar.gz file, commonly called a tarball. The first think you need to do is unpack it, much like the windows zip file or mac dmg.

Use the command tar-xfvz file.tar.gz to unpack the file. You should now have a folder with a similar name to the file, minux the extension. Change directory over to that folder (cd foler).

Now its time to compile the code, but first we have to make sure everything is ready. The command ./configure should go though and check things, if you get any errors you need to address those before moving on. Some programs don't include config files, which isn't bad, but it isn't good either.

Than you just type the command make and make install you can run them in the same line by running make && make install but its often best to do them one at time so you can see errors.

In general, most programs will have a README file of some sorts ounce you unpack the tarball. You should always read that first, but if its not there, these general steps should get you rolling.
I'm learnin a lot too. ;p

Yesterday, I was allergic to "make". I said "See if I ever compile anything on linux! If they don't provide me a binary, they don't deserve me runnin their program!" And a lot of people do.

But today, I found that you can configure mandrake's local browser to open a command-line in the current directory of the window. I found that there's not some weird and evil conspiracy to confuse me, and all I have to do is type make and ./filename to do funky things like "compile a program". Who'd have thought!

I imagined there might be a distro that doesn't include the "make" command. So I asked for a version. And still: If the makefile isn't included, you do have to find out what kind of source it is, and compilation gets a whole lot trickier, I'm sure.
You post Chibix was a little unclear, so let me just say a couple things to clarify what I think was said.

Every distro will include the make function, thats the compiler, you can't have a linux distro with out it, because the kernel its self has to be compiled by the make compiler. No, some binaries may not include the script to tell the make command what to do. As you may have noticed you don't type "make filename" you just type make, thats because there is a file in there that knows what to do with that command. If a binary doesn't include that script, than its probably some other language, like java or I don't know, cobalt. And than you realy need that README file. Any body who puts out a program in a different language should include a REAMME, if they don't, well I would just like to reach through my CAT5 cable and smack them. In general, any body who doesn't include a README with something is dumb. Ok, there is my rant.
*applauds* Bravo!

I have one question;
There is this application I want to port to Linux. Natively, it is a win9x-based app, and it was compiled in Pascal. It is, dare I say, my favorite application I've ever used in win9x, and the source was recently released. Is there a simple way to "make" this application, do I just have to download a pascal compiler, or worse, do I have to wade through the pascal sources, changing all the function calls from w9x-native to mandrake-native system calls, and then compile it? I don't want to think of what might be worse than that. (Converting pascal to c++ by hand?)

Just wondering.
From what I remember in my 1901 and 1902 CSci classes, the only language thats really cross platform is java, but maybe thats just because it has a run-time enviroment, source code should still be pretty cross platform.

My guess would be that if its a command-line program you should just need to find a pascal compiler for linux. But thats just a guess. If its a GUI its probably going to get ugly. It is all ready going to depend on how complicated of a program it is. Odds are if its a program that does anything worth doing, and does it well, its going to take a little tweaking to get it working.
Aww crud. Time to get a sourceforge account!
But linux users will love me if I ever get it complete. Then the next day, they'll come out with a 3d version.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.