Compiling in Linux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • trickypig
    Rookie
    • Nov 2008
    • 2

    Compiling in Linux

    I downloaded Angband from the CVS trunk, but I'm unable to compile it.

    I am trying to run it on my own personal computer running Ubuntu.

    I downloaded the source to "/home/trickypig/Projects/angband/trunk/"
    so, the src folder location is: "/home/trickypig/Projects/angband/
    trunk/src/" and so forth...

    from within the "trunk" folder, I ran "./configure" and everything
    comes up clean, with the last few lines being:

    Configuration:

    Install path: /usr/local
    lib/ path: /usr/local/share/angband/

    -- Frontends --
    - Curses Yes
    - GTK 2.x Disabled
    - X11 Yes
    - SDL Disabled

    - SDL sound Yes
    Then, I try running "make" from within the "trunk" folder, but I get
    the following error messages:

    make[3]: Makefile: No such file or directory
    make[3]: *** No rule to make target `Makefile'. Stop.
    make[2]: *** [depend] Error 2
    make[1]: *** [depend] Error 2
    make: *** [depend] Error 2
    Any idea what is going on?

    My original plan was to have both the code and the compiled
    executables in the "/home/trickypig/Projects/angband/trunk/"
    folder in my home directory, but I have a feeling
    that the compiler may be confused by that.

    Should I be putting it somewhere else? If so, where should I put the
    source code?

    Thanks
  • s0be
    Apprentice
    • Jan 2008
    • 96

    #2
    My only guess is something else is failing, and the Makefile error is covering for it. I've compiled it a few dozen times in a similar fashion and never had problems.

    Comment

    • PowerDiver
      Prophet
      • Mar 2008
      • 2820

      #3
      Try going into src and doing a make there, rather than from the trunk.

      Comment

      • trickypig
        Rookie
        • Nov 2008
        • 2

        #4
        Originally posted by PowerDiver
        Try going into src and doing a make there, rather than from the trunk.
        right, I had tried that, and here's what happens;

        when I run make from within the "src" directory, it runs through each .c file and compiles it ("CC file.c")
        then does "LINK angband"
        I don't see any error messages or anything.

        when I try to run "./angband" I get the following:
        ./angband: Failed to open sound config (/usr/local/share/angband/xtra/sound/sound.cfg):
        No such file or directory
        ./angband: Failed to load sound config
        ./angband: cannot access the '/usr/local/share/angband/file/news.txt' file!

        The 'lib' directory is probably missing or broken.
        Perhaps the archive was not exracted correctly.
        See the 'readme.txt' file for more information.
        SO, the issue seems to be that Autoconfig thinks I'm running from "/usr/local/shared/angband" instead of from "/home/trickypig/Projects/angband/trunk".

        I re-ran "./configure" using the options "--prefix=$HOME/Projects/angband/trunk" and "--with-libpath=$HOME/Projects/angband/trunk/lib".
        Config worked fine.

        make from the trunk directory produced the same errors.

        make from the "src" directory worked fine.

        now when I run "./angband", the game starts up. So, I guess that solves my problem.

        I'm not missing anything by not being able to make from the base directory am I?

        Thanks for the help.

        Comment

        • PowerDiver
          Prophet
          • Mar 2008
          • 2820

          #5
          Originally posted by trickypig
          right, I had tried that, and here's what happens;

          when I run make from within the "src" directory, it runs through each .c file and compiles it ("CC file.c")
          then does "LINK angband"
          I don't see any error messages or anything.
          After you make the executable, you need to install it.
          The default location it needs to be is in the trunk directory.
          Configure stuff may possibly make it work in /usr/local/whatever, but I wouldn't count on it.

          make install may or may not work

          You can always copy the executable directly.

          I set up my sgid stuff manually, and make a change, then make, then cp ..
          Presumably make install would also work, but I started in a time when it didn't and have not checked recently.

          Comment

          • s0be
            Apprentice
            • Jan 2008
            • 96

            #6
            You can also edit the config file before making and run angband without installing it. The relevant lines are:

            Code:
            #ifndef DEFAULT_PATH
            # define DEFAULT_PATH "./lib/"
            #endif /* DEFAULT_PATH */

            Comment

            • d_m
              Angband Devteam member
              • Aug 2008
              • 1517

              #7
              I actually just emailed the dev list about this issue... commit 1024 on October 10th changed a Makefile which breaks "make" (for me, also on linux).

              It's possible to fix by either adding *another* Makefile (in lib/xtra/icon) or reverting the file.
              linux->xterm->screen->pmacs

              Comment

              Working...
              😀
              😂
              🥰
              😘
              🤢
              😎
              😞
              😡
              👍
              👎