How To Compile Everything: Difference between revisions

From OpenHatch wiki
Content added Content deleted
imported>Geofft
No edit summary
imported>Paulproteus
Line 30: Line 30:
** To set a prefix, run <code>./configure --prefix=''/home/geofft''</code>.
** To set a prefix, run <code>./configure --prefix=''/home/geofft''</code>.
** Running configure will error out if it requires something you don't have installed. But check its output, as it might be skipping something optional but useful, that you should have installed.
** Running configure will error out if it requires something you don't have installed. But check its output, as it might be skipping something optional but useful, that you should have installed.
* Is there a <code>autogen.sh</code>, but no <code>configure</code> (with no extension)? Sometimes this file is called <code>bootstrap</code> or something.
* Is there a <code>autogen.sh</code>, but no <code>configure</code> (with no extension)? Sometimes <code>autogen.sh</code> is called <code>bootstrap</code> or something.
** Make sure you have autoconf and automake installed.
** Make sure you have autoconf and automake installed.
** Run <code>./autogen.sh</code>, then start from the <code>configure</code> decision branch.
** Run <code>./autogen.sh</code>, then start from the <code>configure</code> decision branch.

Revision as of 15:33, 29 June 2013

  • Is there a README?
    • Read it.

Dynamic languages

  • Is it mostly PHP?
    • Does it need PHP libraries?
    • It probably needs a web server
    • Does it need a database?
  • Is it mostly Python?
    • Is there a setup.py?
      • python setup.py build, python setup.py install, I think.
    • Is there a requirements.txt?
      • Install the things there, maybe with pip or something??
    • Does it need a web server? (Does it need a web server, or does a builtin one suffice?)
    • Does it need a database? (Does it need a database, or does SQLite suffice?)
  • Is it mostly Ruby?
    • Ask someone not me.
  • Is it mostly Perl?
    • Is there a Makefile.PL at the top level, and no Makefile?
      • Run perl Makefile.PL, then follow the Makefile instructions.
      • If you want to set a prefix, run perl Makefile.PL PREFIX=/home/geofft. You don't need to pass the prefix to any other commands.

C

  • Is there a Makefile or GNUmakefile?
    • Usually you can just run make to compile it.
    • Often you can also run sudo make install to install it systemwide. Sometimes this won't exist, and all you get is compiled code in the same directory.
    • If you want to install it, but not systemwide, generally you can use a prefix variable to make it install elsewhere; for instance I might want to set the prefix to /home/geofft so things are in /home/geofft/bin, etc. If there was just a Makefile and nothing special, try running make PREFIX=/home/geofft and make install PREFIX=/home/geofft, without sudo. Or read the Makefile or README.
  • Is there a configure?
    • Usually you can just run ./configure, followed by make and sudo make install, as per the Makefile decision branch.
    • To set a prefix, run ./configure --prefix=/home/geofft.
    • Running configure will error out if it requires something you don't have installed. But check its output, as it might be skipping something optional but useful, that you should have installed.
  • Is there a autogen.sh, but no configure (with no extension)? Sometimes autogen.sh is called bootstrap or something.
    • Make sure you have autoconf and automake installed.
    • Run ./autogen.sh, then start from the configure decision branch.
    • Rarely, autogen.sh will also run configure for you; if you want to pass options, you can either rerun ./configure yourself, or pass them to ./autogen.sh.
  • Is there a configure.ac or configure.in, but no autogen.sh? (If there is one, prefer that)
    • Make sure you have autoconf and automake installed.
    • Run autoreconf -fvi, then start from the configure decision branch.

Java

  • Is there a build.xml?
    • Are there files with Android-y names?
      • Install the Android utilities, then run android update project so that your paths to the Android SDK are set
    • Run ant build
  • Is there a pom.xml?
    • Curse at Maven a bit, then run mvn compile and hope for the best
    • Consider using Eclipse
  • Sometimes Java programs are servlets, which you can tell by, like, WEB-INF directories or web.xml files running around
    • You'll want a "servlet container" like Tomcat or Jetty, which is a fancy word for a web server that runs Java servlets
    • Jetty can run standalone, with no advance setup, and there's often a Maven target for that

Other things

  • Is there a debian directory? Are you building something Debian-specific?
    • Make sure everything in the Build-Depends line of debian/control is installed. If the package is in the Debian/Ubuntu archive, the easiest way to do this is sudo apt-get build-dep package. This works even if you're building a package from a slightly different source than the one in the archive; it'll get you at least 90% of the way there.
    • Run debuild, which is in the devscripts package.