Sil for Unix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • half
    Knight
    • Jan 2009
    • 910

    Sil for Unix

    I'd like to get Sil working for as many Linux systems as possible.

    Theoretically there is code there for X11, GTK, GCU, and a monochrome terminal mode called CAP. These are from Vanilla before the move to the new Make system.

    With the help of Alejandro, I've managed to get it working for some systems.

    He has got it working for X11 on his Linux system.
    I have got it working for CAP on my Mac OS X 10.6 system.

    I've put the most recent source code collection which has allowed us to get this far on the Sil download page:



    I'd love it if anyone could help me get it working in more forms, so this thread is for us to pool our efforts. (Do keep in mind that I'm not very good at Makefiles or Unix!)
  • half
    Knight
    • Jan 2009
    • 910

    #2
    Edit: You can ignore this one here as I have now solved X11 on Mac

    When I try compiling for X11 on my Mac, I get two error messages. First:

    main-x11.c: In function ‘paste_x11_send’:
    main-x11.c:1879: warning: pointer targets in passing argument 7 of ‘XChangeProperty’ differ in signedness

    Then at the time of linking:

    ld: library not found for -lX11

    I'm not sure if the first of these is really a bug, but the second aborts compilation. Perhaps under OS X I need to use a different way of building for X11?
    Last edited by half; January 25, 2012, 18:32.

    Comment

    • half
      Knight
      • Jan 2009
      • 910

      #3
      Neither of us can get it working under GCU.

      Alejandro get this error using curses:

      In file included from main-gcu.c:67:0:
      /usr/include/curses.h:564:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘->’ token

      And the same one with ncurses:

      In file included from main-gcu.c:65:0:
      /usr/include/ncurses.h:564:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘->’ token

      On my Mac, I get a very similar message (ncurses.h on OS X just seems to be a symbolic link to curses.h):

      In file included from main-gcu.c:65:
      /usr/include/ncurses.h:533: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘->’ token

      Any ideas?

      Comment

      • half
        Knight
        • Jan 2009
        • 910

        #4
        Edit: snipped, since the X11 on Mac problem is solved and will be added to the Makefile
        Last edited by half; January 25, 2012, 18:31.

        Comment

        • mtadd
          Rookie
          • Nov 2011
          • 24

          #5
          I've gotten sil to run under X11 on my mac using macports X11 library (port install xorg-libX11). I removed the following from OBJS:

          main-xaw.o main-gtk.o main-lsl.o main-sla.o main-vcs.o main-xpj.o

          and modified the defines as follows (under variation only support main-x11.c):

          LIBS = -L /opt/local/lib -lX11

          Then, run the compiled binary from a working directory with the sil lib/ as a subdirectory.

          Comment

          • half
            Knight
            • Jan 2009
            • 910

            #6
            Originally posted by mtadd
            LIBS = -L /opt/local/lib -lX11
            Thanks for that. You have solved the X11 problem for Macs. I didn't realise you had to have the -L option as well as the -l option. Using that (and the default X11 libraries that came with my system) it works.

            This means that I can add some of the user interface improvements to X11 because I can test them at home. The main thing is the starting menu that lets you choose whether to start a new game, or continue an old one, or run the tutorial.

            Comment

            • SaThaRiel
              Adept
              • Nov 2009
              • 174

              #7
              Just could compile it...but it crashes my X when i start it. Sadly there are no logs of what happened, just a coredump from scrotwm (my window manager).

              Since i wont test further under this circumstances i may setup a VM with my current configuration.

              Running Archlinux with Kernel 3.2.1 and X.Org X Server 1.11.3, Windowmanager scrotwm 0.10.0. gcc version 4.6.2 20111223. Architecture is 64-Bit.
              Proud candidate for the Angband Darwin Award!

              Comment

              • PowerDiver
                Prophet
                • Mar 2008
                • 2820

                #8
                Originally posted by half
                http://www.amirrorclear.net/flowers/game/sil/index.html

                I'd love it if anyone could help me get it working in more forms, so this thread is for us to pool our efforts. (Do keep in mind that I'm not very good at Makefiles or Unix!)
                FWIW, I compiled and got something that worked well enough to at least let me take a couple of steps. Using Makefile.std in Ubuntu Linux.

                Would you like me to try any particular Linux experiment? I'm not clear what you are after.

                Comment

                • demauk
                  Rookie
                  • Jan 2012
                  • 1

                  #9
                  CAP works on Linux! I must have messed that part of the Makefile while snooping around trying to get X11 to work, because it's fine now.

                  All I did this time was to download a fresh copy of the source, comment/uncomment Makefile.std to attempt a CAP/X11 binary, and call make on it. It worked.

                  I'm Alejandro, btw.

                  Playing with CAP is a bit difficult, however, because of the whole monochrome thing. Maybe tweaking the terminal emulator settings would make it look better? I'm not particularly curious about it.

                  On the other hand, any ideas on how to deal with the n/curses compilation errors will be appreciated!

                  Edit after reading PowerDiver: which CFLAGS/LIBS lines did you leave uncommented? The problem has been compiling against n/curses. And XAW is untested, yet.
                  Last edited by demauk; January 26, 2012, 08:31.

                  Comment

                  • PowerDiver
                    Prophet
                    • Mar 2008
                    • 2820

                    #10
                    Originally posted by demauk
                    Edit after reading PowerDiver: which CFLAGS/LIBS lines did you leave uncommented? The problem has been compiling against n/curses. And XAW is untested, yet.
                    I didn't edit anything. make -f Makefile.std
                    The first variation for main-x11.c is what is uncommented.
                    Is there any reason to bother with curses?

                    I just tried to compile with curses, and got the error. beep is defined in the code, but is also defined [differently] by curses. Someone with a clue should require actual naming standards on all things externed.

                    Change beep to something else, say ANG_UTIL_beep, in src/defines.h and src/util.c. That let me compile.

                    Code:
                    $ grep -n ANG_UTIL *[ch]
                    defines.h:2601:#define ANG_UTIL_beep					op_ptr->opt[OPT_beep]
                    util.c:2179:	if (ANG_UTIL_beep) Term_xtra(TERM_XTRA_NOISE, 0);

                    Comment

                    • half
                      Knight
                      • Jan 2009
                      • 910

                      #11
                      Originally posted by PowerDiver
                      Is there any reason to bother with curses?
                      I'm not sure. I wouldn't use it, but some people seem to like it.

                      For some reason I thought something on the line might be redefined and then stupidly forgot that lowercase words can be macros too. Ah macros, the cause of so many crazy seeming bugs. Thank you for that.

                      I now have it running for GCU in development. The restriction in the available colours seems to be a killer though: it is slightly better than the monochrome CAP mode, but not much. I don't know if there is a way to change the base colours for GCU players, but I'll look into it briefly. I'm not even sure if I've got 16 colours here... Indeed I think I have 8 + bold versions, which doesn't leave the game very playable when it was written for 32 colours.

                      Comment

                      • half
                        Knight
                        • Jan 2009
                        • 910

                        #12
                        Following on from PowerDiver's questions about what I'm trying to achieve, I thought I'd ask any linux *band players:

                        What versions do you like to play with?
                        X11?
                        GTK?
                        GCU?
                        SDL?
                        other?

                        I branched off from V before the new build system and before the SDL version, so that might be hard. Is focusing on X11 for Linux players enough? I don't have GTK so getting that working might be tough. Also, getting GCU to work sensibly with its meagre 8 colours (+ bold) might be tough as well.

                        Comment

                        • Magnate
                          Angband Devteam member
                          • May 2007
                          • 5110

                          #13
                          Originally posted by half
                          Following on from PowerDiver's questions about what I'm trying to achieve, I thought I'd ask any linux *band players:

                          What versions do you like to play with?
                          X11?
                          GTK?
                          GCU?
                          SDL?
                          other?

                          I branched off from V before the new build system and before the SDL version, so that might be hard. Is focusing on X11 for Linux players enough? I don't have GTK so getting that working might be tough. Also, getting GCU to work sensibly with its meagre 8 colours (+ bold) might be tough as well.
                          I play with GCU when I don't need subwindows, SDL when I do. (As an aside, I guess you must have forked before the SDL port was introduced? That was a while ago!) If Eddie's change is the only one necessary to make the GCU port work, that's great. d_m is the devteam's main expert with GCU and might be able to help with supporting additional colours.

                          The devteam's experience says that very few people use the GTK port, but obviously no harm keeping it if it works. On deb-based systems the libglade2-dev package pulls in all the necessary dependencies.
                          "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                          Comment

                          • SaThaRiel
                            Adept
                            • Nov 2009
                            • 174

                            #14
                            Well, i only play GCU (and sometimes X11 when i forget the switch since it is the default ).
                            Tried SDL, but thats not for me...so would be great to have at least GCU
                            Proud candidate for the Angband Darwin Award!

                            Comment

                            • dionysian
                              Apprentice
                              • Apr 2007
                              • 77

                              #15
                              make -f Makefile.std install

                              Was going fine, until...

                              gcc -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" -c -o maid-x11.o maid-x11.c
                              gcc -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" -c -o main-gtk.o main-gtk.c
                              gcc -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" -c -o main.o main.c
                              gcc -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" -o sil z-util.o z-virt.o z-form.o z-rand.o z-term.o variable.o tables.o util.o cave.o object1.o object2.o monster1.o monster2.o xtra1.o xtra2.o spells1.o spells2.o melee1.o melee2.o save.o files.o cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o birth.o load.o squelch.o wizard1.o wizard2.o obj-info.o generate.o dungeon.o init1.o init2.o randart.o use-obj.o main-cap.o main-gcu.o main-x11.o maid-x11.o main-gtk.o main.o -lX11 -lcurses -ltermcap
                              /usr/bin/ld: cannot find -ltermcap
                              collect2: ld returned 1 exit status
                              make: *** [sil] Error 1

                              Looks like I am missing some libraries. Not sure which ones I still need. Vanilla compiles fine...
                              Oh, Mr. Speaker, I had underestimated the tenderness of the feelings of the members opposite.
                              --Barney Frank

                              Comment

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