TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Trouble installing on Solaris 10 (SPARC)

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
geekmasterflash



Joined: 06 Jan 2009
Posts: 6

PostPosted: Tue Jan 06, 2009 3:29 am    Post subject: Trouble installing on Solaris 10 (SPARC) Reply with quote

Code:
bash-3.00# make
---- Linking...
gcc -Wall -lxnet  -D_GNU_SOURCE -DHAVE_CONFIG_H    -o tt++ action.o alias.o files.o help.o highlight.o strhash.o llist.o log.o  main.o misc.o net.o parse.o path.o update.o history.o tab.o vt102.o  terminal.o session.o function.o text.o substitute.o tick.o telopt.o  math.o split.o debug.o tinexp.o mapper.o tables.o buffer.o prompt.o  class.o  event.o utils.o chat.o macro.o  config.o gag.o variables.o  array.o input.o cursor.o memory.o system.o line.o -lnsl -lpthread -lz
Undefined                       first referenced
 symbol                             in file
forkpty                             system.o
ld: fatal: Symbol referencing errors. No output written to tt++
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `tt++'


As you can see, I added the -lxnet option as per the instructions on the install page. Anyone know what I need to do to fix this?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Tue Jan 06, 2009 8:41 am    Post subject: Reply with quote

Apparently Solaris doesn't have forkpty, so you can try editing system.c and comment out the forkpty call in the #run command.
Back to top
View user's profile Send private message Send e-mail
lorenzo



Joined: 15 May 2009
Posts: 2

PostPosted: Fri May 15, 2009 4:15 pm    Post subject: [PATCH] Fixes for Solaris and other non-BSD/non-GNU platform Reply with quote

forkpty and its family are nonstandard extensions from BSD and GNU libc. They are not part of UNIX98 or SUS, so Solaris isn't the only platform affected.

Here's a patch, if it survives the forum. You will need to apply this patch and run 'autoconf' to recreate the configure script, then re-run configure.

Code:
cd tt
patch -p1 <file_that_you_saved_the_patch_in
cd src
autoconf
./configure
make


Code:

diff -r 101ad23923e1 -r 82497f2b9900 src/Makefile.in
--- a/src/Makefile.in   Fri May 15 14:24:59 2009 -0500
+++ b/src/Makefile.in   Fri May 15 16:10:54 2009 -0500
@@ -61,7 +61,7 @@
          terminal.o session.o function.o text.o substitute.o tick.o telopt.o \
          math.o split.o debug.o tinexp.o mapper.o tables.o buffer.o prompt.o \
          class.o  event.o utils.o chat.o macro.o  config.o gag.o variables.o \
-         array.o input.o cursor.o memory.o system.o line.o tokenize.o
+         array.o input.o cursor.o memory.o system.o line.o tokenize.o fake_forkpty.o
 
 
 default: all
diff -r 101ad23923e1 -r 82497f2b9900 src/config.h.in
--- a/src/config.h.in   Fri May 15 14:24:59 2009 -0500
+++ b/src/config.h.in   Fri May 15 16:10:54 2009 -0500
@@ -18,6 +18,9 @@
 
 /* Define to 1 if you have the `forkpty' function. */
 #undef HAVE_FORKPTY
+
+/* Define to 1 if your system has /dev/ptms (STREAMS pseudoterminal mux). */
+#undef HAVE__DEV_PTMX
 
 /* Define to 1 if you have the `getaddrinfo' function. */
 #undef HAVE_GETADDRINFO
diff -r 101ad23923e1 -r 82497f2b9900 src/configure.in
--- a/src/configure.in   Fri May 15 14:24:59 2009 -0500
+++ b/src/configure.in   Fri May 15 16:10:54 2009 -0500
@@ -92,9 +92,12 @@
 AC_CHECK_LIB(z, inflate)
 AC_CHECK_LIB(pthread, pthread_create)
 AC_CHECK_LIB(nsl, gethostbyname)
+AC_CHECK_LIB(socket, rresvport)
 AC_CHECK_LIB(util, forkpty)
 AC_CHECK_LIB(pcre, pcre_compile)
 AC_CHECK_PROGS(MAKE, gmake make)
+
+AC_CHECK_FILES([/dev/ptmx])
 
 AC_FUNC_GETMNTENT
 AC_HEADER_DIRENT
diff -r 101ad23923e1 -r 82497f2b9900 src/fake_forkpty.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src/fake_forkpty.c   Fri May 15 16:10:54 2009 -0500
@@ -0,0 +1,169 @@
+#include "config.h"
+
+#if defined(HAVE__DEV_PTMX) && !defined(HAVE_FORKPTY)
+
+/*
+ * Substitute for the nonstandard BSD/GNU extension 'forkpty' using
+ * SysV STREAMS (the /dev/ptmx pseudoterminal multiplexer).
+ *
+ * dgc@uchicago.edu
+ */
+
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <limits.h> /* PATH_MAX */
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/termios.h>
+#include <stropts.h>
+
+#define DEV_PTMX "/dev/ptmx"
+
+enum {
+   EPTMX_OK = 0,
+   EPTMX_OPEN,
+   EPTMX_GRANT,
+   EPTMX_UNLOCK,
+   EPTMX_NAME,
+   EPTMX_FIND,
+   EPTMX_PUSH_PTEM,
+   EPTMX_PUSH_LDTERM,
+   EPTMX_PUSH_TTCOMPAT,
+   EPTMX_END
+} ptmx_errs;
+
+int
+open_master(char *name, int sz)
+{
+   char *sname;
+   int fd;
+
+   strncpy(name, DEV_PTMX, sz);
+   name[sz-1] = '\0';
+
+   fd = open(name, O_RDWR);
+   if (fd < 0)
+      return EPTMX_OPEN;
+
+   if (grantpt(fd) < 0) {
+      close(fd);
+      return EPTMX_GRANT;
+   }
+
+   if (unlockpt(fd) < 0) {
+      close(fd);
+      return EPTMX_UNLOCK;
+   }
+
+   sname = ptsname(fd);
+   if (sname == NULL) {
+      close(fd);
+      return EPTMX_NAME;
+   }
+
+   strncpy(name, sname, sz);
+   name[sz-1] = '\0';
+   return fd;
+}
+
+int
+open_slave(char *name)
+{
+   int fd;
+   int status;
+
+   fd = open(name, O_RDWR);
+   if (fd < 0)
+      return EPTMX_OPEN;
+
+   status = ioctl(fd, I_FIND, "ldterm");
+   if (status < 0) {
+      close(fd);
+      return EPTMX_FIND;
+   }
+
+   if (status > 0)
+      return fd;
+
+   if (ioctl(fd, I_PUSH, "ptem") < 0) {
+      close(fd);
+      return EPTMX_PUSH_PTEM;
+   }
+
+   if (ioctl(fd, I_PUSH, "ldterm") < 0) {
+      close(fd);
+      return EPTMX_PUSH_LDTERM;
+   }
+
+   if (ioctl(fd, I_PUSH, "ttcompat") < 0) {
+      close(fd);
+      return EPTMX_PUSH_TTCOMPAT;
+   }
+
+   return fd;
+}
+
+
+int
+login_tty(int fd)
+{
+   setsid();
+   if (ioctl(fd, TIOCSCTTY, NULL) == -1)
+      return -1;
+   dup2(fd, 0);
+   dup2(fd, 1);
+   dup2(fd, 2);
+   if (fd > 2)
+      close(fd);
+   return 0;
+}
+
+
+pid_t
+forkpty(int *masterp, char *name, struct termios *termp, struct winsize *winp)
+{
+   int master, slave;
+   char ptname[PATH_MAX];
+   pid_t pid;
+
+   master = open_master(ptname, sizeof(ptname));
+   if (master < 0) {
+      return -1;
+   }
+
+   slave = open_slave(ptname);
+   if (slave < 0) {
+      close(master);
+      return -1;
+   }
+
+   if (name)
+      strcpy(name, ptname);
+
+   if (termp)
+      tcsetattr(slave, TCSAFLUSH, termp);
+   if (winp)
+      ioctl(slave, TIOCSWINSZ, winp);
+
+   pid = fork();
+   if (pid < 0) {
+      close(slave);
+      close(master);
+      return -1;
+   }
+
+   else if (pid == 0) {
+      /* child/slave */
+      close(master);
+      login_tty(slave);
+      return 0;
+   }
+
+   /* parent/master */
+   *masterp = master;
+   close(slave);
+   return pid;
+}
+
+#endif
Back to top
View user's profile Send private message
lorenzo



Joined: 15 May 2009
Posts: 2

PostPosted: Fri May 15, 2009 4:25 pm    Post subject: Reply with quote

P.S. This patch also fixes the networking stuff for Solaris. It adds -lsocket -lnsl as needed (via autoconf), which is a more portable alternative to -lxnet. Apply this patch to a clean copy of tintin; it should work as-is.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Fri May 15, 2009 10:47 pm    Post subject: Reply with quote

Thanks for the patch, it'll be included with the next release.

Updated the beta file (as usual) at: http://tintin.sf.net/download/tintin-beta.tar.gz
Back to top
View user's profile Send private message Send e-mail
geekmasterflash



Joined: 06 Jan 2009
Posts: 6

PostPosted: Tue May 26, 2009 12:43 am    Post subject: Reply with quote

Hey, thank you for getting back to me.

One problem: When I issue the patch -p1 command it hangs.
Back to top
View user's profile Send private message
geekmasterflash



Joined: 06 Jan 2009
Posts: 6

PostPosted: Thu May 28, 2009 6:44 pm    Post subject: Reply with quote

After hanging for 40 minutes, I gave a cntrl+c and tried from there:

Code:
bash-3.00# gmake
gcc -Wall -Wno-trigraphs  -D_GNU_SOURCE -DHAVE_CONFIG_H     -c action.c
In file included from action.c:28:
tintin.h:37:18: pcre.h: No such file or directory
In file included from action.c:28:
tintin.h:513: error: syntax error before "pcre"
tintin.h:513: warning: no semicolon at end of struct or union
tintin.h:516: error: syntax error before '}' token
tintin.h:1110: error: syntax error before '*' token
tintin.h:1112: error: syntax error before '*' token
tintin.h:1116: error: syntax error before '*' token
tintin.h:1116: warning: type defaults to `int' in declaration of `tintin_regexp_compile'
tintin.h:1116: warning: data definition has no type or storage class
action.c: In function `check_all_actions':
action.c:85: error: dereferencing pointer to incomplete type
action.c:89: error: dereferencing pointer to incomplete type
action.c:91: error: dereferencing pointer to incomplete type
gmake: *** [action.o] Error 1
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Thu May 28, 2009 7:57 pm    Post subject: Reply with quote

You'll have to compile and install pcre: http://www.pcre.org/

And I'd suggest downloading the beta instead, since it already has the patch included.
Back to top
View user's profile Send private message Send e-mail
geekmasterflash



Joined: 06 Jan 2009
Posts: 6

PostPosted: Fri May 29, 2009 5:23 am    Post subject: Reply with quote

I have pcre, and the beta doesnt work either.

Code:
# pkgutil -i pcre
Parsing catalog, may take a while...
Current packages: CSWcommon-1.4.6,REV=2008.04.28 CSWisaexec-0.2,REV=2009.03.26 CSWncurses-5.7,REV=2009.04.06 CSWreadline-6.0,REV=2009.03.31 CSWbzip2-1.0.5,REV=2009.01.17 CSWzlib-1.2.3,REV=2007.05.12 CSWpcrert-7.8,REV=2009.02.04 CSWpcre-7.8,REV=2009.02.04


CSW does place all of this in /opt/csw however that is the first place listed in PATH.

Edit: This is the beta version failing ...
Code:
Configure has finished.  To compile, type: make

bash-3.00# gmake
ld.so.1: gmake: fatal: libintl.so.3: open failed: No such file or directory
Killed


This is located in /opt/csw/lib... which is also in PATH.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Fri May 29, 2009 7:44 am    Post subject: Reply with quote

I'm not sure, but I guess you may need to install libintl ?

http://www.sunfreeware.com/programlistsparc8.html#libintl
Back to top
View user's profile Send private message Send e-mail
geekmasterflash



Joined: 06 Jan 2009
Posts: 6

PostPosted: Fri May 29, 2009 11:52 am    Post subject: Reply with quote

I am sure I already have it, but for humor sake:

Code:
bash-3.00# cd /opt/csw
bash-3.00# pkgadd -d libintl-3.4.0-sol8-sparc-local

The following packages are available:
  1  SMClintl     libintl
                  (sparc) 3.4.0

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: all

Processing package instance <SMClintl> from </opt/csw/libintl-3.4.0-sol8-sparc-local>

libintl(sparc) 3.4.0

This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.

FSF
Using </usr/local> as the package base directory.
## Processing package information.
## Processing system information.
   10 package pathnames are already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

Installing libintl as <SMClintl>

## Installing part 1 of 1.
[ verifying class <none> ]

Installation of <SMClintl> was successful.
bash-3.00# cd /usr/MUD/tt/src
bash-3.00# ./configure
Configuring TinTin++
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether make sets $(MAKE)... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/sfw/bin/ggrep
checking for egrep... /usr/sfw/bin/ggrep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking net/errno.h usability... no
checking net/errno.h presence... no
checking for net/errno.h... no
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking param.h usability... no
checking param.h presence... no
checking for param.h... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking socks.h usability... no
checking socks.h presence... no
checking for socks.h... no
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/ptem.h usability... no
checking sys/ptem.h presence... yes
configure: WARNING: sys/ptem.h: present but cannot be compiled
configure: WARNING: sys/ptem.h:     check for missing prerequisite headers?
configure: WARNING: sys/ptem.h: see the Autoconf documentation
configure: WARNING: sys/ptem.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/ptem.h: proceeding with the preprocessor's result
configure: WARNING: sys/ptem.h: in the future, the compiler will take precedencechecking for sys/ptem.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/termio.h usability... yes
checking sys/termio.h presence... yes
checking for sys/termio.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking util.h usability... no
checking util.h presence... no
checking for util.h... no
checking pty.h usability... no
checking pty.h presence... no
checking for pty.h... no
checking for an ANSI C-conforming const... yes
checking for stdbool.h that conforms to C99... no
checking for _Bool... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for working memcmp... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking return type of signal handlers... void
checking whether lstat dereferences a symlink specified with a trailing slash... yes
checking whether stat accepts an empty string... no
checking for strftime... yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking whether utime accepts a null argument... yes
checking for vprintf... yes
checking for _doprnt... yes
checking for gethostbyname... no
checking for gethostname... yes
checking for gettimeofday... yes
checking for inet_ntoa... no
checking for memset... yes
checking for select... yes
checking for socket... no
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strftime... (cached) yes
checking for strncasecmp... yes
checking for strstr... yes
checking for utime... yes
checking for getaddrinfo... no
checking for forkpty... no
checking for popen... yes
checking for inflate in -lz... yes
checking for pthread_create in -lpthread... yes
checking for gethostbyname in -lnsl... yes
checking for rresvport in -lsocket... yes
checking for forkpty in -lutil... no
checking for pcre_compile in -lpcre... no
checking for gmake... gmake
checking for /dev/ptmx... yes
checking for library containing getmntent... none required
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged

Configure has finished.  To compile, type: make

bash-3.00# gmake
ld.so.1: gmake: fatal: libintl.so.3: open failed: No such file or directory
Killed
Back to top
View user's profile Send private message
geekmasterflash



Joined: 06 Jan 2009
Posts: 6

PostPosted: Fri May 29, 2009 1:28 pm    Post subject: Reply with quote

I am happy to report it works now, the problem was gettext. Solaris comes with xgettext and symbolically links it to gettext. I just had to erase that, and link gettext to ggettext.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group