axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] openpty patch again


From: humberto
Subject: [Axiom-developer] openpty patch again
Date: Thu, 30 Nov 2006 19:40:32 -0400

I'm resubmitting a shorter version of a 300K patch I sent this
morning. This time I generated the patch without the diffs for configure
and a couple of Makefile.in files. I guess my version of configure is
different from Gaby's, it basically changed every line in configure.

I think I got a working build of axiom on Mac OS X 10.4 again.

http://www.hpcf.upr.edu/~humberto/axiom-macos-ppc-20061130.tar.gz

untar this somewhere, then point AXIOM at the
target/powerpc-apple-darwin8.8.0 directory:

$ tar zxf axiom-macos-ppc-20061130.tar.gz
$ export AXIOM=`pwd`/target/powerpc-apple-darwin8.8.0
$ PATH=$AXIOM/bin:$PATH
$ axiom

Success!

This was built from the svk mirror:

$ svk info
Checkout Path: /Users/humberto/src/axiom/build-improvements
Depot Path: /mirror/axiom/branches/build-improvements
Revision: 328
Last Changed Rev.: 327
Mirrored From: https://svn.sourceforge.net/svnroot/axiom, Rev. 327
Copied From: /axiom/trunk/axiom, Rev. 32
Merged From: /axiom/trunk/axiom, Rev. 32

that I checked out on Tuesday. That revision builds on Mac OS X, but
axiom won't work because sman and clef build without working pty support
(AXIOMsys does work).

I reworked Waldek's better pty patch to work with the new
config/axiom-c-macro.h file, and to check for the proper include file
for openpty, at least on Mac and linux. I don't know if ptys work on MS
Windows.

The original openpty patch is:

http://lists.nongnu.org/archive/html/axiom-developer/2006-11/msg00236.html

My version is below.

The procedure to build this version of axiom is not too bad. Fink still
seems to cause problems if the build machinery can see it, so I delete
it from the path. One caveat is that you need latex, makeindex, and
maybe tex for the axiom build to succeed, so I install them from fink,
and link them to /usr/local/bin.


$ PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin
$ ./configure
$ make

The darn build takes like 6 hours on my dual G5 2.5 GHz Mac.

I have some doubts about the patch, since I'm not really sure how to
build configure, I'm not certain I did it right.

I don't have commit priviledges on the code base, and I don't want them
until I'm more familiar with svn/svk, so could someone else please check
in the patch?

Finally, this patch is against revision 326, because svk complains my
axiom tree isn't local when I try to revise the patch against the
current build-improvements head. I followed the svk instructions at:

http://wiki.axiom-developer.org/AxiomSilverBranch

but svk patch complains:
  
$ svk patch --view pty-again
Target not local nor mirrored, unable to view patch.

Anyway, here's the patch:

==== Patch <pty-again> level 1
Source: [No source]
Target: 54bea96e-1511-0410-8851-aaeae44645fa:/branches/build-improvements:326
        (https://svn.sourceforge.net/svnroot/axiom)
Log:

=== ChangeLog.build-improvements
==================================================================
--- ChangeLog.build-improvements        (revision 326)
+++ ChangeLog.build-improvements        (patch pty-again level 1)
@@ -1,3 +1,8 @@
+2006-11-29  Humberto Ortiz-Zuazaga <address@hidden>
+
+       * configure.ac.pamphlet: added tests for openpty, pty.h,
+       util.h and libutil
+
 2006-11-26  Gabriel Dos Reis  <address@hidden>
 
        * Makefile.pamphlet (build_srcdir): Restore from previous
=== config/axiom-c-macros.h.in
==================================================================
--- config/axiom-c-macros.h.in  (revision 326)
+++ config/axiom-c-macros.h.in  (patch pty-again level 1)
@@ -9,6 +9,12 @@
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
+/* Define to 1 if you have the `openpty' function. */
+#undef HAVE_OPENPTY
+
+/* Define to 1 if you have the <pty.h> header file. */
+#undef HAVE_PTY_H
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
@@ -30,6 +36,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the <util.h> header file. */
+#undef HAVE_UTIL_H
+
 /* Linux flavour */
 #undef LINUXplatform
 
=== config/var-def.mk
==================================================================
--- config/var-def.mk   (revision 326)
+++ config/var-def.mk   (patch pty-again level 1)
@@ -118,6 +118,7 @@
 
 AXIOM_X11_CFLAGS = @X_CFLAGS@ 
 AXIOM_X11_LDFLAGS = @X_LIBS@ @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@
+EXTRA_LIBS = @EXTRA_LIBS@
 
 axiom_includes = -I$(axiom_src_srcdir)/include -I$(axiom_configdir)
 
=== configure.ac.pamphlet
==================================================================
--- configure.ac.pamphlet       (revision 326)
+++ configure.ac.pamphlet       (patch pty-again level 1)
@@ -676,8 +676,28 @@
 AC_CHECK_HEADER([regex.h], [], [AC_MSG_ERROR([Axiom needs <regex.h>])])
 @
 
+\subsubsection{openpty}
 
+[[clef]] and [[sman]] use ptys to communicate with [[AXIOMsys]]. The
+existing code in silver doesn't work on MacOS X. We will try to build
+with the Unix98 standard [[openpty]] function. We need to detect two
+headers and a library. Linux has openpty defined in [[pty.h]], MacOS X
+define it in [[util.h]]. FreeBSD is supposed to have a definition in
+[[libutil.h]].
 
+<<headers>>=
+AC_CHECK_HEADERS([pty.h util.h])
+@
+
+On linux the openpty function is in [[libutil]]. We need to add that to
+the list of libraries, at least for [[sman]] and [[clef]].
+
+<<extra libraries>>=
+AC_CHECK_FUNCS(openpty,, AC_CHECK_LIB(util,
+                       openpty,[AC_DEFINE(HAVE_OPENPTY)] 
[EXTRA_LIBS="$EXTRA_LIBS -lutil"]))
+AC_SUBST(EXTRA_LIBS)
+@
+
 \section{A note about comments}
 \label{sec:comment}
 
@@ -718,6 +738,8 @@
 
 <<headers>>
 
+<<extra libraries>>
+
 <<locate X11>>
 
 <<define AXIOM>>
=== src/clef/ChangeLog.build-improvements
==================================================================
--- src/clef/ChangeLog.build-improvements       (revision 326)
+++ src/clef/ChangeLog.build-improvements       (patch pty-again level 1)
@@ -1,3 +1,7 @@
+2006-11-29  Humberto Ortiz-Zuazaga <address@hidden>
+
+       * Makefile.pamphlet: add -lutil to clef link flags if needed
+
 2006-11-26  Gabriel Dos Reis  <address@hidden>
 
        * edible.c.pamphlet: Include "axiom-c-macros.h"
=== src/clef/Makefile.pamphlet
==================================================================
--- src/clef/Makefile.pamphlet  (revision 326)
+++ src/clef/Makefile.pamphlet  (patch pty-again level 1)
@@ -23,7 +23,7 @@
 
 clef_objects = $(clef_sources:.c=.$(OBJEXT)) 
 
-clef_LDADD = -L$(abs_top_builddir)/src/lib -lspad
+clef_LDADD = -L$(abs_top_builddir)/src/lib -lspad $(EXTRA_LIBS)
 clef_DEPENDENCIES =
 @
 
=== src/lib/ChangeLog.build-improvements
==================================================================
--- src/lib/ChangeLog.build-improvements        (revision 326)
+++ src/lib/ChangeLog.build-improvements        (patch pty-again level 1)
@@ -1,3 +1,7 @@
+2006-11-29  Humberto Ortiz Zuazaga <address@hidden>
+
+       * openpty.c.pamphlet: use openpty if available
+
 2006-11-26  Gabriel Dos Reis  <address@hidden>
 
        * XDither.c.pamphlet: Include axiom-c-macros.h
=== src/lib/openpty.c.pamphlet
==================================================================
--- src/lib/openpty.c.pamphlet  (revision 326)
+++ src/lib/openpty.c.pamphlet  (patch pty-again level 1)
@@ -10,17 +10,9 @@
 \tableofcontents
 \eject
 \section{MAC OSX and BSD platform changes}
-Since we have no other information we are adding the [[MACOSXplatform]] 
variable
-to the list everywhere we find [[LINUXplatform]]. This may not be correct but
-we have no way to know yet. We have also added the [[BSDplatform]] variable.
-MAC OSX is some variant of BSD. These should probably be merged but we
-cannot yet prove that.
-<<mac osx platform change 1>>=
-#if defined(SUN4OS5platform) ||defined(ALPHAplatform) || defined(HP10platform) 
|| defined(LINUXplatform) || defined(MACOSXplatform) || defined(BSDplatform)
-@
-<<mac osx platform change 2>>=
-#if defined(SUNplatform) || defined(HP9platform) || defined(LINUXplatform) || 
defined(MACOSXplatform) || defined(BSDplatform)
-@
+We should really use autotools to check for Unix 98 pty support.
+Before this is done below we hardcode information about each platform.
+
 \section{License}
 <<license>>=
 /*
@@ -71,6 +63,11 @@
 #include <stropts.h>
 #endif
 
+#ifdef HAVE_PTY_H
+#include <pty.h>
+#elifdef HAVE_UTIL_H
+#include <util.h>
+#endif
 
 #include "openpty.H1"
 
@@ -97,6 +94,9 @@
 int  
 ptyopen(int *controller,int * server, char *controllerPath,char * serverPath)
 {
+#ifdef HAVE_OPENPTY
+  return openpty(controller, server, serverPath, 0, 0);
+#else
 #if defined(SUNplatform) || defined (HP9platform) || defined(RTplatform) 
||defined(AIX370platform) || defined(BSDplatform)
   int looking = 1, i;
   int oflag = O_RDWR;                  /* flag for opening the pty */
@@ -140,7 +140,8 @@
   return(fdm);
 #endif
 
-<<mac osx platform change 1>>
+/* MAC OS X 10.3 does not support Unix 98 pty's */
+#if defined(SUN4OS5platform) ||defined(ALPHAplatform) || defined(HP10platform) 
|| defined(LINUXplatform) || defined(BSDplatform)
 extern int grantpt(int);
 extern int unlockpt(int);
 extern char* ptsname(int);
@@ -192,6 +193,7 @@
   return (*controller);
 
 #endif
+#endif
 }
 
 
@@ -204,7 +206,7 @@
        sprintf(serv, "/dev/ttyp%02x", channelNo);
        channelNo++;
 #endif
-<<mac osx platform change 2>>
+#if defined(SUNplatform) || defined(HP9platform) || defined(LINUXplatform) || 
defined(MACOSXplatform) || defined(BSDplatform)
        static int channelNo = 0;
        static char group[] = "pqrstuvwxyzPQRST";
        static int groupNo = 0;
=== src/sman/ChangeLog.build-improvements
==================================================================
--- src/sman/ChangeLog.build-improvements       (revision 326)
+++ src/sman/ChangeLog.build-improvements       (patch pty-again level 1)
@@ -1,3 +1,7 @@
+2006-11-29  Humberto Ortiz-Zuazaga <address@hidden>
+
+       * Makefile.pamphlet: add -lutil to sman link flags if needed
+
 2006-11-26  Gabriel Dos Reis  <address@hidden>
 
        * nagman.c.pamphlet: Include axiom-c-macros.h.
=== src/sman/Makefile.pamphlet
==================================================================
--- src/sman/Makefile.pamphlet  (revision 326)
+++ src/sman/Makefile.pamphlet  (patch pty-again level 1)
@@ -47,7 +47,7 @@
 sman_sources = sman.c
 sman_SOURCES = $(addsuffix .pamphlet, $(sman_sources))
 sman_objects = $(sman_sources:.c=.$(OBJEXT))
-sman_LDADD = -L$(build_libdir) -lspad
+sman_LDADD = -L$(build_libdir) -lspad $(EXTRA_LIBS)
 sman_DEPENDENCI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U6YJRSJFxkNJmBoOgNbL0jigfgyktMTmPZt3DroQWZ1ADEQkaRpj7wOs+AdxI
z/Gh88ARk8ivd/6iXuvsdeDNBFShV0HViwHNGvIcDmsAEd/iScqjVI3F0dD7kLhRSHweU5dDjagb
uzIisMhwQlUQT+oqk3BtwguIyyOPCO4QFQVBpLCndxkWEBlJ0aA47Cfg32/+623yUFr7v7H29l+3
ni398c29W9aTn3y9snfDejr17fIPVv1o+Qvr87f+/q61f++fyPr9k7esP2z/8HMgmLKd16lEheJp
umuC5XWVV3me9teFthL3DaNoGkfA4zoPhiuLqmVfVHCkV0DNXiVsCMCykUrzbbStgEULOVghQKrD
Dc3xKK8rpLhoo27KK33Qsk8n8ciieXfjCnyTibSWB7upfVqlI0J6lTwiNdg/QSyTI3LDDRhBgFVd
ZMNKTsFiXxV5mqpiGpWq2Dr8D8+o7WnkwOvsB/rWUsH2fH1hEelNAmGnRcwihLK8GuZhNDdnSlh7
YaUYBndMJ5sSe0BXKgwpjSKPUlheQyyo70YwQwPp0OCwk71x5KA55qWtTI+0MhvXysbOi+wwonx8
K9PJSDZrMzCDpMxTgWJh5EexjGIv8FgoAMVUhfSQID776PNrhiA+++j/ThA66lcniGEsWHkBcxhz
ZRDB3k5j6kgWOQrGlQutKSenw6wuEshBBb5gmFAPy5DAA0sofeAZ6cODbXjAEN/88psZYIinC8AQ
X33ydOFVGMLcwF39hAzPGIxjT/qBcoTExJUOU5IqRc0vDk4PsACAbUImk2xuzgWAuP2fa1bNLziz
swBraIiSp++zXoP2utAZAIhCbcGHuk6k/pFlBja1DKZEOTMGfxo9TBOPR+EBKWSqiT0oqUOx0wwC
DzdhOOrnPEa9mP8XOZj4sA==
==== END SVK PATCH BLOCK ====

-- 
Humberto Ortiz Zuazaga
Programmer-Archaeologist
High Performance Computing facility
University of Puerto Rico
http://www.hpcf.upr.edu/~humberto/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]