rpms/cudd/F-9 cudd-2.4.1-64bit.patch, NONE, 1.1 cudd-2.4.1-init.patch, NONE, 1.1 cudd-2.4.1-retval.patch, NONE, 1.1 cudd-2.4.1-sharedlib.patch, NONE, 1.1 cudd-2.4.1-signedness.patch, NONE, 1.1 cudd-2.4.1-strcat.patch, NONE, 1.1 cudd.spec, 1.1, 1.2

Jerry James jjames at fedoraproject.org
Thu Jan 22 21:03:44 UTC 2009


Author: jjames

Update of /cvs/pkgs/rpms/cudd/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32285/F-9

Modified Files:
	cudd.spec 
Added Files:
	cudd-2.4.1-64bit.patch cudd-2.4.1-init.patch 
	cudd-2.4.1-retval.patch cudd-2.4.1-sharedlib.patch 
	cudd-2.4.1-signedness.patch cudd-2.4.1-strcat.patch 
Log Message:
* Thu Jan 22 2009 Jerry James <loganjerry at gmail.com> - 2.4.1-3
- Add patches to address various minor build infelicities
- Build both shared and static libraries
- Install the test binary, nanotrav, and its man page
- Gather documentation from all of the subdirectories


cudd-2.4.1-64bit.patch:

--- NEW FILE cudd-2.4.1-64bit.patch ---
diff -dur cudd-2.4.1.ORIG/cudd/cudd.h cudd-2.4.1/cudd/cudd.h
--- cudd-2.4.1.ORIG/cudd/cudd.h	2005-05-18 00:08:59.000000000 -0600
+++ cudd-2.4.1/cudd/cudd.h	2007-10-18 16:44:37.000000000 -0600
@@ -61,6 +61,7 @@
 /* Nested includes                                                           */
 /*---------------------------------------------------------------------------*/
 
+#include <bits/wordsize.h>
 #include "mtr.h"
 #include "epd.h"
 
@@ -75,14 +76,22 @@
 #define CUDD_VERSION "2.4.1"
 
 #ifndef SIZEOF_VOID_P
+#if __WORDSIZE == 64
+#define SIZEOF_VOID_P 8
+#else
 #define SIZEOF_VOID_P 4
 #endif
+#endif
 #ifndef SIZEOF_INT
 #define SIZEOF_INT 4
 #endif
 #ifndef SIZEOF_LONG
+#if __WORDSIZE == 64
+#define SIZEOF_LONG 8
+#else
 #define SIZEOF_LONG 4
 #endif
+#endif
 
 #ifndef TRUE
 #define TRUE 1
diff -dur cudd-2.4.1.ORIG/mtr/mtr.h cudd-2.4.1/mtr/mtr.h
--- cudd-2.4.1.ORIG/mtr/mtr.h	2004-08-24 15:30:36.000000000 -0600
+++ cudd-2.4.1/mtr/mtr.h	2007-10-18 16:45:19.000000000 -0600
@@ -63,6 +63,8 @@
 /* Nested includes                                                           */
 /*---------------------------------------------------------------------------*/
 
+#include <bits/wordsize.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -72,8 +74,12 @@
 /*---------------------------------------------------------------------------*/
 
 #ifndef SIZEOF_VOID_P
+#if __WORDSIZE == 64
+#define SIZEOF_VOID_P 8
+#else
 #define SIZEOF_VOID_P 4
 #endif
+#endif
 #ifndef SIZEOF_INT
 #define SIZEOF_INT 4
 #endif
diff -dur cudd-2.4.1.ORIG/util/util.h cudd-2.4.1/util/util.h
--- cudd-2.4.1.ORIG/util/util.h	2004-02-05 18:15:36.000000000 -0700
+++ cudd-2.4.1/util/util.h	2007-10-18 16:45:58.000000000 -0600
@@ -3,6 +3,8 @@
 #ifndef UTIL_H
 #define UTIL_H
 
+#include <bits/wordsize.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -20,14 +22,22 @@
 #endif
 
 #ifndef SIZEOF_VOID_P
+#if __WORDSIZE == 64
+#define SIZEOF_VOID_P 8
+#else
 #define SIZEOF_VOID_P 4
 #endif
+#endif
 #ifndef SIZEOF_INT
 #define SIZEOF_INT 4
 #endif
 #ifndef SIZEOF_LONG
+#if __WORDSIZE == 64
+#define SIZEOF_LONG 8
+#else
 #define SIZEOF_LONG 4
 #endif
+#endif
 
 #if SIZEOF_VOID_P == 8 && SIZEOF_INT == 4
 typedef long util_ptrint;

cudd-2.4.1-init.patch:

--- NEW FILE cudd-2.4.1-init.patch ---
diff -dur cudd-2.4.1.ORIG/cudd/cuddAddIte.c cudd-2.4.1/cudd/cuddAddIte.c
--- cudd-2.4.1.ORIG/cudd/cuddAddIte.c	2004-08-24 15:37:42.000000000 -0600
+++ cudd-2.4.1/cudd/cuddAddIte.c	2006-07-17 16:04:43.000000000 -0600
@@ -447,7 +447,7 @@
     DdNode *one,*zero;
     DdNode *r,*Fv,*Fnv,*Gv,*Gnv,*Hv,*Hnv,*t,*e;
     unsigned int topf,topg,toph,v;
-    int index;
+    int index = 0;
 
     statLine(dd);
     /* Trivial cases. */
diff -dur cudd-2.4.1.ORIG/cudd/cuddAddWalsh.c cudd-2.4.1/cudd/cuddAddWalsh.c
--- cudd-2.4.1.ORIG/cudd/cuddAddWalsh.c	2004-08-24 15:37:42.000000000 -0600
+++ cudd-2.4.1/cudd/cuddAddWalsh.c	2006-07-17 16:04:43.000000000 -0600
@@ -298,7 +298,7 @@
   int  n)
 {
     DdNode *one, *minusone;
-    DdNode *t, *u, *t1, *u1, *v, *w;
+    DdNode *t = NULL, *u, *t1, *u1, *v, *w;
     int     i;
 
     one = DD_ONE(dd);
diff -dur cudd-2.4.1.ORIG/cudd/cuddBddIte.c cudd-2.4.1/cudd/cuddBddIte.c
--- cudd-2.4.1.ORIG/cudd/cuddBddIte.c	2004-08-24 15:37:43.000000000 -0600
+++ cudd-2.4.1/cudd/cuddBddIte.c	2006-07-17 16:04:43.000000000 -0600
@@ -635,7 +635,7 @@
     DdNode	 *one, *zero, *res;
     DdNode	 *r, *Fv, *Fnv, *Gv, *Gnv, *H, *Hv, *Hnv, *t, *e;
     unsigned int topf, topg, toph, v;
-    int		 index;
+    int		 index = 0;
     int		 comple;
 
     statLine(dd);
diff -dur cudd-2.4.1.ORIG/cudd/cuddDecomp.c cudd-2.4.1/cudd/cuddDecomp.c
--- cudd-2.4.1.ORIG/cudd/cuddDecomp.c	2004-08-24 15:37:43.000000000 -0600
+++ cudd-2.4.1/cudd/cuddDecomp.c	2006-07-17 16:04:43.000000000 -0600
@@ -1689,7 +1689,7 @@
   st_table * mintermTable)
 {
     int topid, distance;
-    Conjuncts *factorsNv, *factorsNnv, *factors;
+    Conjuncts *factorsNv = NULL, *factorsNnv = NULL, *factors;
     Conjuncts *dummy;
     DdNode *N, *Nv, *Nnv, *temp, *g1, *g2, *h1, *h2, *topv;
     double minNv = 0.0, minNnv = 0.0;
diff -dur cudd-2.4.1.ORIG/cudd/cuddGroup.c cudd-2.4.1/cudd/cuddGroup.c
--- cudd-2.4.1.ORIG/cudd/cuddGroup.c	2006-07-17 16:04:04.000000000 -0600
+++ cudd-2.4.1/cudd/cuddGroup.c	2006-07-17 16:04:43.000000000 -0600
@@ -454,7 +454,7 @@
   Cudd_ReorderingType method)
 {
     int lower;
-    int upper;
+    int upper = 0;
     int result;
     unsigned int initialSize;
 
@@ -1492,7 +1492,7 @@
     Move *move;
     int  size;
     int  i,j,xtop,xbot,xsize,ytop,ybot,ysize,newxtop;
-    int  swapx,swapy;
+    int  swapx = 0, swapy = 0;
 #if defined(DD_DEBUG) && defined(DD_VERBOSE)
     int  initialSize,bestSize;
 #endif
@@ -1672,7 +1672,7 @@
 {
     Move *move;
     int  res;
-    Move *end_move;
+    Move *end_move = NULL;
     int diff, tmp_diff;
     int index, pairlev;
 
diff -dur cudd-2.4.1.ORIG/cudd/cuddHarwell.c cudd-2.4.1/cudd/cuddHarwell.c
--- cudd-2.4.1.ORIG/cudd/cuddHarwell.c	2004-08-24 15:37:44.000000000 -0600
+++ cudd-2.4.1/cudd/cuddHarwell.c	2006-07-17 16:04:43.000000000 -0600
@@ -152,6 +152,7 @@
     int	*rhsptr, *rhsind;
 #endif
 
+    lx = ly = lxn = lyn = NULL;
     if (*nx < 0 || *ny < 0) return(0);
 
     one = DD_ONE(dd);
diff -dur cudd-2.4.1.ORIG/cudd/cuddLinear.c cudd-2.4.1/cudd/cuddLinear.c
--- cudd-2.4.1.ORIG/cudd/cuddLinear.c	2004-08-24 15:37:45.000000000 -0600
+++ cudd-2.4.1/cudd/cuddLinear.c	2006-07-17 16:04:43.000000000 -0600
@@ -373,7 +373,7 @@
     int    posn;
     int    isolated;
     DdNode *f,*f0,*f1,*f01,*f00,*f11,*f10,*newf1,*newf0;
-    DdNode *g,*next,*last;
+    DdNode *g,*next,*last = NULL;
     DdNodePtr *previousP;
     DdNode *tmp;
     DdNode *sentinel = &(table->sentinel);
diff -dur cudd-2.4.1.ORIG/cudd/cuddPriority.c cudd-2.4.1/cudd/cuddPriority.c
--- cudd-2.4.1.ORIG/cudd/cuddPriority.c	2004-08-24 15:37:45.000000000 -0600
+++ cudd-2.4.1/cudd/cuddPriority.c	2006-07-17 16:04:43.000000000 -0600
@@ -965,7 +965,7 @@
 {
     DdNode *res, *res1, *res2, *resA;
     DdNode *r, *y, *RT, *RE, *YT, *YE, *Yrest, *Ra, *Ran, *Gamma, *Alpha;
-    unsigned int topR, topY, top, index;
+    unsigned int topR, topY, top, index = 0U;
     DdNode *one = DD_ONE(dd);
 
     statLine(dd);
diff -dur cudd-2.4.1.ORIG/cudd/cuddReorder.c cudd-2.4.1/cudd/cuddReorder.c
--- cudd-2.4.1.ORIG/cudd/cuddReorder.c	2004-08-24 15:37:45.000000000 -0600
+++ cudd-2.4.1/cudd/cuddReorder.c	2006-07-17 16:04:43.000000000 -0600
@@ -606,7 +606,7 @@
     int	iterate;
     int previousSize;
     Move *moves, *move;
-    int	pivot;
+    int	pivot = 0;
     int	modulo;
     int result;
 
diff -dur cudd-2.4.1.ORIG/cudd/cuddSubsetSP.c cudd-2.4.1/cudd/cuddSubsetSP.c
--- cudd-2.4.1.ORIG/cudd/cuddSubsetSP.c	2004-08-24 15:37:45.000000000 -0600
+++ cudd-2.4.1/cudd/cuddSubsetSP.c	2006-07-17 16:04:43.000000000 -0600
@@ -1255,17 +1255,17 @@
 {
     DdNode *N, *Nv, *Nnv;
     DdNode *ThenBranch, *ElseBranch, *childBranch;
-    DdNode *child, *regChild, *regNnv, *regNv;
+    DdNode *child, *regChild, *regNnv = NULL, *regNv = NULL;
     NodeDist_t *nodeStatNv, *nodeStat, *nodeStatNnv;
     DdNode *neW, *topv, *regNew;
     char *entry;
     unsigned int topid;
-    unsigned int childPathLength, oddLen, evenLen, NnvPathLength, NvPathLength;
+    unsigned int childPathLength, oddLen, evenLen;
+    unsigned int NnvPathLength = 0U, NvPathLength = 0U;
     unsigned int NvBotDist, NnvBotDist;
     int tiebreakChild;
     int  processingDone, thenDone, elseDone;
 
-
 #ifdef DD_DEBUG
     numCalls++;
 #endif
diff -dur cudd-2.4.1.ORIG/cudd/cuddSymmetry.c cudd-2.4.1/cudd/cuddSymmetry.c
--- cudd-2.4.1.ORIG/cudd/cuddSymmetry.c	2004-08-24 15:37:46.000000000 -0600
+++ cudd-2.4.1/cudd/cuddSymmetry.c	2006-07-17 16:04:43.000000000 -0600
@@ -1472,10 +1472,10 @@
   Move ** moves)
 {
     Move *move;
-    int	 size;
+    int	 size = 0;
     int  i,j;
     int  xtop,xbot,xsize,ytop,ybot,ysize,newxtop;
-    int  swapx,swapy;
+    int  swapx = 0, swapy = 0;
 
 #if DD_DEBUG
     assert(x < y);	/* we assume that x < y */
@@ -1551,7 +1551,7 @@
   int  x,
   int  y)
 {
-    int	size;
+    int	size = 0;
     int i,j;
     int	xtop,xbot,xsize,ytop,ybot,ysize,newxtop;
 
diff -dur cudd-2.4.1.ORIG/cudd/cuddTable.c cudd-2.4.1/cudd/cuddTable.c
--- cudd-2.4.1.ORIG/cudd/cuddTable.c	2004-08-24 15:37:46.000000000 -0600
+++ cudd-2.4.1/cudd/cuddTable.c	2006-07-17 16:04:43.000000000 -0600
@@ -1726,7 +1726,7 @@
     int oldsize,newsize;
     int i,j,index,reorderSave;
     unsigned int numSlots = unique->initSlots;
-    int *newperm, *newinvperm, *newmap;
+    int *newperm, *newinvperm, *newmap = NULL;
     DdNode *one, *zero;
 
 #ifdef DD_DEBUG
@@ -2454,7 +2454,7 @@
     int oldsize,newsize;
     int i,j,reorderSave;
     int numSlots = unique->initSlots;
-    int *newperm, *newinvperm, *newmap;
+    int *newperm, *newinvperm, *newmap = NULL;
     DdNode *one, *zero;
 
     oldsize = unique->size;
diff -dur cudd-2.4.1.ORIG/cudd/cuddUtil.c cudd-2.4.1/cudd/cuddUtil.c
--- cudd-2.4.1.ORIG/cudd/cuddUtil.c	2005-05-14 11:28:01.000000000 -0600
+++ cudd-2.4.1/cudd/cuddUtil.c	2006-07-17 16:04:43.000000000 -0600
@@ -1400,7 +1400,7 @@
     DdNode **old, *neW;
     double minterms;
     char *saveString;
-    int saveFlag, savePoint, isSame;
+    int saveFlag, savePoint = 0, isSame;
 
     minterms = Cudd_CountMinterm(dd,f,n);
     if ((double)k > minterms) {
diff -dur cudd-2.4.1.ORIG/cudd/cuddZddGroup.c cudd-2.4.1/cudd/cuddZddGroup.c
--- cudd-2.4.1.ORIG/cudd/cuddZddGroup.c	2006-07-17 16:04:04.000000000 -0600
+++ cudd-2.4.1/cudd/cuddZddGroup.c	2006-07-17 16:04:43.000000000 -0600
@@ -434,7 +434,7 @@
   Cudd_ReorderingType method)
 {
     int lower;
-    int upper;
+    int upper = 0;
     int result;
     unsigned int initialSize;
 
@@ -1082,7 +1082,7 @@
     Move *move;
     int  size;
     int  i,j,xtop,xbot,xsize,ytop,ybot,ysize,newxtop;
-    int  swapx,swapy;
+    int  swapx = 0, swapy = 0;
 #if defined(DD_DEBUG) && defined(DD_VERBOSE)
     int  initialSize,bestSize;
 #endif
diff -dur cudd-2.4.1.ORIG/cudd/cuddZddReord.c cudd-2.4.1/cudd/cuddZddReord.c
--- cudd-2.4.1.ORIG/cudd/cuddZddReord.c	2004-08-24 15:37:47.000000000 -0600
+++ cudd-2.4.1/cudd/cuddZddReord.c	2006-07-17 16:04:43.000000000 -0600
@@ -491,7 +491,7 @@
     int		i;
     int		posn;
     DdNode	*f, *f1, *f0, *f11, *f10, *f01, *f00;
-    DdNode	*newf1, *newf0, *next;
+    DdNode	*newf1 = NULL, *newf0, *next;
     DdNodePtr	g, *lastP, *previousP;
 
 #ifdef DD_DEBUG
@@ -752,7 +752,7 @@
     int iterate;
     int previousSize;
     Move *moves, *move;
-    int	pivot;
+    int	pivot = 0;
     int modulo;
     int result;
 
diff -dur cudd-2.4.1.ORIG/cudd/cuddZddSymm.c cudd-2.4.1/cudd/cuddZddSymm.c
--- cudd-2.4.1.ORIG/cudd/cuddZddSymm.c	2004-08-24 15:37:47.000000000 -0600
+++ cudd-2.4.1/cudd/cuddZddSymm.c	2006-07-17 16:04:43.000000000 -0600
@@ -1483,7 +1483,7 @@
     Move	*move;
     int		size;
     int		i, temp, gxtop, gxbot, gybot, yprev;
-    int		swapx, swapy;
+    int		swapx = 0, swapy = 0;
 
 #ifdef DD_DEBUG
     assert(x < y);	/* we assume that x < y */
@@ -1586,7 +1586,7 @@
   int  x,
   int  y)
 {
-    int	       size;
+    int	       size = 0;
     int        i, temp, gxtop, gxbot, gybot, yprev;
 
 #ifdef DD_DEBUG
diff -dur cudd-2.4.1.ORIG/nanotrav/bnet.c cudd-2.4.1/nanotrav/bnet.c
--- cudd-2.4.1.ORIG/nanotrav/bnet.c	2004-08-24 15:34:48.000000000 -0600
+++ cudd-2.4.1/nanotrav/bnet.c	2006-07-17 16:04:43.000000000 -0600
@@ -1884,6 +1884,7 @@
     DdNode *func, *f, *g, *h;
     BnetNode *auxnd;
 
+    mux[0] = mux[1] = phase[0] = phase[1] = 0;
     if (nd->ninp != 3) return(0);
 
     for (line = nd->f; line != NULL; line = line->next) {
diff -dur cudd-2.4.1.ORIG/nanotrav/ntr.c cudd-2.4.1/nanotrav/ntr.c
--- cudd-2.4.1.ORIG/nanotrav/ntr.c	2004-08-24 15:34:47.000000000 -0600
+++ cudd-2.4.1/nanotrav/ntr.c	2006-07-17 16:07:12.000000000 -0600
@@ -964,7 +964,7 @@
     DdNode *neW;
     DdNode *one, *zero;
     DdNode *states, *scc;
-    DdNode *tmp;
+    DdNode *tmp = NULL;
     DdNode *SCCs[10];
     int depth;
     int nscc = 0;

cudd-2.4.1-retval.patch:

--- NEW FILE cudd-2.4.1-retval.patch ---
diff -dur cudd-2.4.1.ORIG/dddmp/dddmpDbg.c cudd-2.4.1/dddmp/dddmpDbg.c
--- cudd-2.4.1.ORIG/dddmp/dddmpDbg.c	2004-02-18 09:23:31.000000000 -0700
+++ cudd-2.4.1/dddmp/dddmpDbg.c	2006-02-20 16:05:04.000000000 -0700
@@ -97,7 +97,8 @@
   while (fgets(buf, 999,fp)!=NULL) {
     fprintf (fpo, "%s", buf);
     if (strncmp(buf, ".nnodes", 7) == 0) {
-      sscanf (buf, "%*s %d", &nnodes);
+      if (sscanf (buf, "%*s %d", &nnodes) == EOF)
+	break;
     }
     if (strncmp(buf, ".rootids", 8) == 0) {
       break;
@@ -141,7 +142,8 @@
 
   }
 
-  fgets(buf, 999,fp);
+  if (fgets(buf, 999,fp) == NULL)
+    buf[0] = '\0';
   if (strncmp(buf, ".end", 4) != 0) {
     return (0);
   }
diff -dur cudd-2.4.1.ORIG/dddmp/dddmpLoad.c cudd-2.4.1/dddmp/dddmpLoad.c
--- cudd-2.4.1.ORIG/dddmp/dddmpLoad.c	2004-02-18 09:24:00.000000000 -0700
+++ cudd-2.4.1/dddmp/dddmpLoad.c	2006-02-20 16:02:11.000000000 -0700
@@ -1109,7 +1109,8 @@
 
   /*------------------------ Deal With the File Tail -----------------------*/
 
-  fgets (buf, DDDMP_MAXSTRLEN-1,fp);
+  if (fgets (buf, DDDMP_MAXSTRLEN-1,fp) == NULL)
+    buf[0] = '\0';
   Dddmp_CheckAndGotoLabel (!matchkeywd(buf, ".end"),
     "Error .end not found.", failure);
 
@@ -1273,7 +1274,8 @@
 
     /* comment */
     if (buf[0] == '#') {
-      fgets(buf,DDDMP_MAXSTRLEN,fp);
+      if (fgets(buf,DDDMP_MAXSTRLEN,fp) == NULL)
+	buf[0] = '\0';
       continue;
     }
 
@@ -1424,7 +1426,8 @@
     }
 
     if (matchkeywd(buf, ".nodes")) {
-      fgets(buf,DDDMP_MAXSTRLEN,fp);
+      if (fgets(buf,DDDMP_MAXSTRLEN,fp) == NULL)
+	buf[0] = '\0';
       break;
     }
 
diff -dur cudd-2.4.1.ORIG/dddmp/dddmpLoadCnf.c cudd-2.4.1/dddmp/dddmpLoadCnf.c
--- cudd-2.4.1.ORIG/dddmp/dddmpLoadCnf.c	2004-02-20 01:35:56.000000000 -0700
+++ cudd-2.4.1/dddmp/dddmpLoadCnf.c	2006-02-20 16:04:02.000000000 -0700
@@ -554,7 +554,8 @@
 
     /* Init Problem Line */ 
     if (buf[0] == 'p') {
-      fscanf (fp, "%*s %d %d", &nv, &nc);
+      if (fscanf (fp, "%*s %d %d", &nv, &nc) == EOF)
+	break;
       Hdr->nVarsCnf = nv;
       Hdr->nClausesCnf = nc;
       break;
@@ -569,7 +570,8 @@
 
     /* Skip Comment? */
     if (buf[0] != '.') {
-      fgets (buf, DDDMP_MAXSTRLEN, fp);
+      if (fgets (buf, DDDMP_MAXSTRLEN, fp) == NULL)
+	buf[0] = '\0';
       continue;
     }
 
@@ -811,7 +813,8 @@
     /* Check for Comment */
     if (word[0] == 'c') {
       /* Comment Found: Skip line */
-      fgets (word, DDDMP_MAX_CNF_ROW_LENGTH-1, fp);
+      if (fgets (word, DDDMP_MAX_CNF_ROW_LENGTH-1, fp) == NULL)
+	word[0] = '\0';
       break;
     }
 
diff -dur cudd-2.4.1.ORIG/epd/epd.c cudd-2.4.1/epd/epd.c
--- cudd-2.4.1.ORIG/epd/epd.c	2004-08-24 15:33:13.000000000 -0600
+++ cudd-2.4.1/epd/epd.c	2006-02-20 16:07:56.000000000 -0700
@@ -1094,7 +1094,8 @@
 
   sprintf(str, "%E", value);
   pos = strstr(str, "E");
-  sscanf(pos, "E%d", &exponent);
+  if (sscanf(pos, "E%d", &exponent) == EOF)
+    exponent = 0;
   return(exponent);
 }
 
diff -dur cudd-2.4.1.ORIG/util/pipefork.c cudd-2.4.1/util/pipefork.c
--- cudd-2.4.1.ORIG/util/pipefork.c	2004-08-17 18:07:57.000000000 -0600
+++ cudd-2.4.1/util/pipefork.c	2006-02-20 16:07:06.000000000 -0700
@@ -39,8 +39,10 @@
      * fildes[0] for reading from command
      * fildes[1] for writing to command
      */
-    (void) pipe(topipe);
-    (void) pipe(frompipe);
+    if (pipe(topipe) < 0 || pipe(frompipe) < 0) {
+      fputs("Pipe creation failed.\n", stderr);
+      return 1;
+    }
 
 #ifdef __CYGWIN32__
     if ((forkpid = fork()) == 0) {

cudd-2.4.1-sharedlib.patch:

--- NEW FILE cudd-2.4.1-sharedlib.patch ---
diff -dur cudd-2.4.1.ORIG/cudd/doc/node3.html cudd-2.4.1/cudd/doc/node3.html
--- cudd-2.4.1.ORIG/cudd/doc/node3.html	2005-05-17 23:20:29.000000000 -0600
+++ cudd-2.4.1/cudd/doc/node3.html	2009-01-22 09:19:03.000000000 -0700
@@ -153,16 +153,18 @@
 <P>
 To build an application that uses the CUDD package, you should add
 <PRE>
-#include "util.h"
-#include "cudd.h"
+#include &lt;util.h&gt;
+#include &lt;cudd.h&gt;
 </PRE>
 <A NAME="81"></A>
-to your source files, and should link
+to your source files, compile with <CODE>-I/usr/include/cudd</CODE>, and link
 <code>libcudd.a</code><A NAME="82"></A>,
 <code>libmtr.a</code><A NAME="83"></A>,
 <code>libst.a</code><A NAME="84"></A>, and
 <code>libutil.a</code><A NAME="85"></A> to your executable. (All these
-libraries are part of the distribution.) Some
+libraries are part of the distribution.)  Note that shared library equivalents
+are also available, and are linked to one another appropriately; i.e., it is
+sufficient to add <CODE>-lcudd</CODE> to your link command.  Some
 platforms require specific compiler and linker flags.  Refer to the
 <TT>Makefile<A NAME="86"></A></TT> in the top level directory of the
 distribution.
diff -dur cudd-2.4.1.ORIG/cudd/Makefile cudd-2.4.1/cudd/Makefile
--- cudd-2.4.1.ORIG/cudd/Makefile	1999-08-19 16:34:24.000000000 -0600
+++ cudd-2.4.1/cudd/Makefile	2009-01-22 09:46:31.000000000 -0700
@@ -27,6 +27,10 @@
 
 INCLUDE = $(WHERE)/include
 
+SHLINK	= -shared -Xlinker -soname -Xlinker lib$(P).so.2 \
+	-L$(WHERE)/mtr -L$(WHERE)/st -L$(WHERE)/util -L$(WHERE)/epd \
+	-lmtr -lcuddst -lcuddutil -lepd -lm
+
 LIBS	= ./libcudd.a $(WHERE)/mtr/libmtr.a \
 	$(WHERE)/st/libst.a $(WHERE)/util/libutil.a $(WHERE)/epd/libepd.a
 
@@ -71,6 +75,11 @@
 
 #------------------------------------------------------
 
+lib$(P).so.2.4.1: $(POBJ)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(POBJ) $(SHLINK)
+	ln -s lib$(P).so.2.4.1 lib$(P).so.2
+	ln -s lib$(P).so.2 lib$(P).so
+
 lib$(P).a: $(POBJ)
 	ar rv $@ $?
 	$(RANLIB) $@
@@ -111,7 +120,9 @@
 tags: $(PSRC) $(PHDR)
 	ctags $(PSRC) $(PHDR)
 
-all: lib$(P).a lib$(P).b llib-l$(P).ln tags
+all: lib$(P).so.2.4.1 lib$(P).b llib-l$(P).ln tags
+
+static: lib$(P).a
 
 programs: $(TARGET) $(TARGETu) lintpgm
 
diff -dur cudd-2.4.1.ORIG/dddmp/Makefile cudd-2.4.1/dddmp/Makefile
--- cudd-2.4.1.ORIG/dddmp/Makefile	2004-02-20 09:13:24.000000000 -0700
+++ cudd-2.4.1/dddmp/Makefile	2009-01-22 09:46:18.000000000 -0700
@@ -170,6 +170,10 @@
 LINTFLAGS = -u -n
 LINTSWITCH = -o
 
+SHLINK	= -shared -Xlinker -soname -Xlinker lib$(P).so.2 \
+	-L$(WHERE)/cudd -L$(WHERE)/mtr -L$(WHERE)/st -L$(WHERE)/util \
+	-L$(WHERE)/epd -lcudd -lcuddst -lcuddutil
+
 LIBS	= ./libdddmp.a $(WHERE)/cudd/libcudd.a $(WHERE)/mtr/libmtr.a \
 	$(WHERE)/st/libst.a $(WHERE)/util/libutil.a $(WHERE)/epd/libepd.a
 
@@ -182,6 +186,11 @@
 	$(WHERE)/mtr/llib-lmtr.ln $(WHERE)/st/llib-lst.ln \
 	$(WHERE)/util/llib-lutil.ln
 
+lib$(P).so.2.4.1: $(POBJ)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(POBJ) $(SHLINK)
+	ln -s lib$(P).so.2.4.1 lib$(P).so.2
+	ln -s lib$(P).so.2 lib$(P).so
+
 lib$(P).a: $(POBJ)
 	ar rv $@ $?
 	$(RANLIB) $@
@@ -222,7 +231,9 @@
 tags: $(PSRC) $(PHDR)
 	ctags $(PSRC) $(PHDR)
 
-all: lib$(P).a lib$(P).b llib-l$(P).ln tags
+all: lib$(P).so.2.4.1 lib$(P).b llib-l$(P).ln tags
+
+static: lib$(P).a
 
 programs: $(TARGET) $(TARGETu) lintpgm
 
diff -dur cudd-2.4.1.ORIG/epd/Makefile cudd-2.4.1/epd/Makefile
--- cudd-2.4.1.ORIG/epd/Makefile	2003-12-31 09:31:30.000000000 -0700
+++ cudd-2.4.1/epd/Makefile	2009-01-22 09:50:20.000000000 -0700
@@ -11,6 +11,9 @@
 ICFLAGS = -g -O6 -Wall
 CFLAGS  = $(ICFLAGS) $(MFLAG) $(XCFLAGS)
 
+SHLINK	= -shared -Xlinker -soname -Xlinker lib$(P).so.2 -L$(WHERE)/util \
+	-lcuddutil -lm
+
 LINTFLAGS = -u -n
 
 # this is to create the lint library
@@ -27,6 +30,11 @@
 
 #---------------------------
 
+lib$(P).so.2.4.1: $(POBJ)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(POBJ) $(SHLINK)
+	ln -s lib$(P).so.2.4.1 lib$(P).so.2
+	ln -s lib$(P).so.2 lib$(P).so
+
 lib$(P).a: $(POBJ)
 	ar rv $@ $?
 	$(RANLIB) $@
@@ -55,7 +63,9 @@
 tags: $(PSRC) $(PHDR)
 	ctags $(PSRC) $(PHDR)
 
-all: lib$(P).a lib$(P).b llib-l$(P).ln tags
+all: lib$(P).so.2.4.1 lib$(P).b llib-l$(P).ln tags
+
+static: lib$(P).a
 
 clean:
 	rm -f *.o *.u .pure *.warnings
diff -dur cudd-2.4.1.ORIG/Makefile cudd-2.4.1/Makefile
--- cudd-2.4.1.ORIG/Makefile	2004-08-17 18:18:45.000000000 -0600
+++ cudd-2.4.1/Makefile	2009-01-22 13:10:24.000000000 -0700
@@ -194,7 +194,7 @@
 IDIR	= $(DDWDIR)/include
 INCLUDE = -I$(IDIR)
 
-BDIRS	= cudd dddmp mtr st util epd
+BDIRS	= util epd mtr st cudd dddmp
 DIRS	= $(BDIRS) nanotrav
 
 #------------------------------------------------------------------------
@@ -210,6 +210,7 @@
 .PHONY : testmtr
 .PHONY : lint
 .PHONY : all
+.PHONY : static
 .PHONY : clean
 .PHONY : distclean
 
@@ -219,17 +220,22 @@
 	@for dir in $(DIRS); do \
 		(cd $$dir; \
 		echo Making $$dir ...; \
-		make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )\
+		$(MAKE) CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )\
 	done
 
-nanotrav: build
+cudd: mtr st util epd
+dddmp: cudd
+epd: util
+mtr: util
+nanotrav: dddmp
+st: util
 
 check_leaks:
 	sh ./setup.sh
 	@for dir in mnemosyne $(DIRS); do \
 		(cd $$dir; \
 		echo Making $$dir ...; \
-		make CC=$(CC) RANLIB=$(RANLIB) MFLAG=$(MFLAG) MNEMLIB=$(MNEMLIB) ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" EXE="$(EXE)" )\
+		$(MAKE) CC=$(CC) RANLIB=$(RANLIB) MFLAG=$(MFLAG) MNEMLIB=$(MNEMLIB) ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" EXE="$(EXE)" )\
 	done
 
 optimize_dec:
@@ -237,7 +243,7 @@
 	@for dir in $(DIRS); do \
 		(cd $$dir; \
 		echo Making $$dir ...; \
-		make CC=$(CC) RANLIB=$(RANLIB) XCFLAGS="$(XCFLAGS)" LDFLAGS="$(LDFLAGS)" optimize_dec )\
+		$(MAKE) CC=$(CC) RANLIB=$(RANLIB) XCFLAGS="$(XCFLAGS)" LDFLAGS="$(LDFLAGS)" optimize_dec )\
 	done
 
 lint:
@@ -245,7 +251,7 @@
 	@for dir in $(DIRS) obj; do \
 		(cd $$dir; \
 		echo Making lint in $$dir ...; \
-		make CC=$(CC) lint )\
+		$(MAKE) CC=$(CC) lint )\
 	done
 
 tags:
@@ -253,7 +259,7 @@
 	@for dir in $(DIRS) obj; do \
 		(cd $$dir; \
 		echo Making tags in $$dir ...; \
-		make CC=$(CC) tags )\
+		$(MAKE) CC=$(CC) tags )\
 	done
 
 all:
@@ -261,7 +267,15 @@
 	@for dir in $(DIRS); do \
 		(cd $$dir; \
 		echo Making all in $$dir ...; \
-		make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" all )\
+		$(MAKE) CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" all )\
+	done
+
+static:
+	sh ./setup.sh
+	@for dir in $(DIRS); do \
+		(cd $$dir; \
+		echo Making static in $$dir ...; \
+		$(MAKE) CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" static )\
 	done
 
 testcudd:
@@ -269,49 +283,49 @@
 	@for dir in util st mtr epd; do \
 		(cd $$dir; \
 		echo Making $$dir ...; \
-		make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )\
+		$(MAKE) CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )\
 	done
 	@(cd cudd; \
 	echo Making testcudd ...; \
-	make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testcudd$(EXE) )
+	$(MAKE) CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testcudd$(EXE) )
 
 objlib:
 	sh ./setup.sh
 	@for dir in $(BDIRS); do \
 		(cd $$dir; \
 		echo Making $$dir ...; \
-		make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )\
+		$(MAKE) CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )\
 	done
 	@(cd obj; \
 	echo Making obj ...; \
-	make CPP=$(CPP) CPPFLAGS=$(CPPFLAGS) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )
+	$(MAKE) CPP=$(CPP) CPPFLAGS=$(CPPFLAGS) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" )
 
 testobj: objlib
 	@(cd obj; \
 	echo Making testobj ...; \
-	make CPP=$(CPP) CPPFLAGS=$(CPPFLAGS) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testobj$(EXE) )
+	$(MAKE) CPP=$(CPP) CPPFLAGS=$(CPPFLAGS) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testobj$(EXE) )
 
 testdddmp: build
 	@(cd dddmp; \
 	echo Making testdddmp ...; \
-	make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testdddmp$(EXE) )
+	$(MAKE) CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testdddmp$(EXE) )
 
 testmtr: build
 	@(cd mtr; \
 	echo Making testmtr ...; \
-	make CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testmtr$(EXE) )
+	$(MAKE) CC=$(CC) RANLIB=$(RANLIB) MFLAG= MNEMLIB= ICFLAGS="$(ICFLAGS)" XCFLAGS="$(XCFLAGS)" DDDEBUG="$(DDDEBUG)" MTRDEBUG="$(MTRDEBUG)" LDFLAGS="$(LDFLAGS)" PURE="$(PURE)" EXE="$(EXE)" testmtr$(EXE) )
 
 clean:
 	@for dir in mnemosyne $(DIRS) obj; do	\
 	    (cd $$dir; 	\
 	     echo Cleaning $$dir ...; \
-	     make -s clean	) \
+	     $(MAKE) -s clean	) \
 	done
 
 distclean:
 	@for dir in mnemosyne $(DIRS) obj; do	\
 	    (cd $$dir; 	\
 	     echo Cleaning $$dir ...; \
-	     make -s EXE="$(EXE)" distclean	) \
+	     $(MAKE) -s EXE="$(EXE)" distclean	) \
 	done
 	sh ./shutdown.sh
diff -dur cudd-2.4.1.ORIG/mnemosyne/Makefile cudd-2.4.1/mnemosyne/Makefile
--- cudd-2.4.1.ORIG/mnemosyne/Makefile	1996-07-23 14:33:34.000000000 -0600
+++ cudd-2.4.1/mnemosyne/Makefile	2009-01-22 10:04:31.000000000 -0700
@@ -8,8 +8,8 @@
 # define MALLOC_IS_VOIDSTAR if your system's malloc is declared as a (void *)
 # otherwise, it is assumed to be a (char *). a "mall_t" is typedeffed in
 # mnemconf.h and mnemosyne.h to implement this.
-#OPTNS	=	-DMALLOC_IS_VOIDSTAR
-OPTNS	=
+OPTNS	=	-DMALLOC_IS_VOIDSTAR
+#OPTNS	=
 
 CC	= cc
 RANLIB	= ranlib
@@ -19,14 +19,22 @@
 
 #loader flags
 LDFLGS	=
+SHLINK	= -shared -Xlinker -soname -Xlinker libmnem.so.2
 
 HDRS	=	mnemosyne.h mnemconf.h
 
-all: mnemalyse libmnem.a
+all: mnemalyse libmnem.so.2.4.1
+
+static: libmnem.a
 
 mnemalyse: mnemalyse.o
 	$(CC) $(LDFLGS) -o $@ mnemalyse.o
 
+libmnem.so.2.4.1: mnemosyne.o
+	$(CC) $(CFLAGS) $(LDFLAGS) $(SHLINK) -o $@ mnemosyne.o
+	ln -s libmnem.so.2.4.1 libmnem.so.2
+	ln -s libmnem.so.2 libmnem.so
+
 libmnem.a: mnemosyne.o
 	ar rcv $@ mnemosyne.o
 	$(RANLIB) $@
diff -dur cudd-2.4.1.ORIG/mtr/Makefile cudd-2.4.1/mtr/Makefile
--- cudd-2.4.1.ORIG/mtr/Makefile	2004-01-01 11:47:16.000000000 -0700
+++ cudd-2.4.1/mtr/Makefile	2009-01-22 10:08:45.000000000 -0700
@@ -39,6 +39,9 @@
 TARGET	= test$(P)$(EXE)
 TARGETu	= test$(P)-u
 
+SHLINK	= -shared -Xlinker -soname -Xlinker lib$(P).so.2 -L$(WHERE)/util \
+	-lcuddutil
+
 LIBS	= ./libmtr.a $(WHERE)/util/libutil.a
 
 BLIBS	= -kL. -klmtr -kL$(WHERE)/util -klutil
@@ -49,6 +52,11 @@
 
 #---------------------------
 
+lib$(P).so.2.4.1: $(POBJ)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(POBJ) $(SHLINK)
+	ln -s lib$(P).so.2.4.1 lib$(P).so.2
+	ln -s lib$(P).so.2 lib$(P).so
+
 lib$(P).a: $(POBJ)
 	ar rv $@ $?
 	$(RANLIB) $@
@@ -79,7 +87,9 @@
 tags: $(PSRC) $(PHDR)
 	ctags $(PSRC) $(PHDR)
 
-all: lib$(P).a lib$(P).b llib-l$(P).ln tags
+all: lib$(P).so.2.4.1 lib$(P).b llib-l$(P).ln tags
+
+static: lib$(P).a
 
 $(TARGET): $(POBJ) $(OBJ) $(LIBS) $(MNEMLIB)
 	$(PURE) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(MNEMLIB) -lm
diff -dur cudd-2.4.1.ORIG/nanotrav/Makefile cudd-2.4.1/nanotrav/Makefile
--- cudd-2.4.1.ORIG/nanotrav/Makefile	1999-08-31 13:12:55.000000000 -0600
+++ cudd-2.4.1/nanotrav/Makefile	2009-01-22 10:11:36.000000000 -0700
@@ -19,6 +19,14 @@
 
 INCLUDE = $(WHERE)/include
 
+SHLINK	= -L$(WHERE)/dddmp -L$(WHERE)/cudd -L$(WHERE)/mtr -L$(WHERE)/st \
+	-L$(WHERE)/util -L$(WHERE)/epd -ldddmp -lcudd -lmtr -lcuddst \
+	-lcuddutil -lepd
+
+SHLIBS	= $(WHERE)/dddmp/libdddmp.so.2.4.1 $(WHERE)/cudd/libcudd.so.2.4.1 \
+	$(WHERE)/mtr/libmtr.so.2.4.1 $(WHERE)/st/libcuddst.so.2.4.1 \
+	$(WHERE)/util/libcuddutil.so.2.4.1 $(WHERE)/epd/libepd.so.2.4.1
+
 LIBS	= $(WHERE)/dddmp/libdddmp.a $(WHERE)/cudd/libcudd.a \
 	$(WHERE)/mtr/libmtr.a $(WHERE)/st/libst.a $(WHERE)/util/libutil.a \
 	$(WHERE)/epd/libepd.a
@@ -60,8 +68,8 @@
 
 #------------------------------------------------------
 
-$(TARGET): $(SRC) $(OBJ) $(HDR) $(LIBS) $(MNEMLIB)
-	$(PURE) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(MNEMLIB) -lm
+$(TARGET): $(SRC) $(OBJ) $(HDR) $(SHLIBS) $(MNEMLIB)
+	$(PURE) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(SHLINK) $(MNEMLIB) -lm
 
 .c.o: $(HDR)
 	$(CC) -c $< -I$(INCLUDE) $(CFLAGS) $(DDDEBUG)
@@ -87,6 +95,8 @@
 
 all: $(TARGET) $(TARGETu) lint tags
 
+static:
+
 pixie: $(TARGETu)
 	pixie $(TARGETu)
 
diff -dur cudd-2.4.1.ORIG/obj/Makefile cudd-2.4.1/obj/Makefile
--- cudd-2.4.1.ORIG/obj/Makefile	2001-03-19 00:35:09.000000000 -0700
+++ cudd-2.4.1/obj/Makefile	2009-01-22 12:58:56.000000000 -0700
@@ -27,6 +27,8 @@
 
 INCLUDE = $(WHERE)/include
 
+SHLINK	= -shared -Xlinker -soname -Xlinker lib$(P).so.2
+
 LIBS	= ./libobj.a $(WHERE)/cudd/libcudd.a $(WHERE)/mtr/libmtr.a \
 	$(WHERE)/st/libst.a $(WHERE)/util/libutil.a $(WHERE)/epd/libepd.a
 
@@ -57,6 +59,11 @@
 
 #------------------------------------------------------
 
+libs$(P).so.2.4.1: $(POBJ)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(POBJ) $(SHLINK)
+	ln -s lib$(P).so.2.4.1 lib$(P).so.2
+	ln -s lib$(P).so.2 lib$(P).so
+
 lib$(P).a: $(POBJ)
 	ar rv $@ $?
 	$(RANLIB) $@
@@ -97,7 +104,9 @@
 tags: $(PSRC) $(PHDR)
 	ctags $(PSRC) $(PHDR)
 
-all: lib$(P).a lib$(P).b llib-l$(P).ln tags
+all: lib$(P).so.2.4.1 lib$(P).b llib-l$(P).ln tags
+
+static: lib$(P).a
 
 programs: $(TARGET) $(TARGETu) lintpgm
 
diff -dur cudd-2.4.1.ORIG/st/Makefile cudd-2.4.1/st/Makefile
--- cudd-2.4.1.ORIG/st/Makefile	2004-01-01 09:53:24.000000000 -0700
+++ cudd-2.4.1/st/Makefile	2009-01-22 13:02:29.000000000 -0700
@@ -11,6 +11,9 @@
 ICFLAGS = -g -O6 -Wall
 CFLAGS  = $(ICFLAGS) $(MFLAG) $(XCFLAGS)
 
+SHLINK	= -shared -Xlinker -soname -Xlinker libcudd$(P).so.2 -L$(WHERE)/util \
+	-lcuddutil
+
 LINTFLAGS = -u -n
 
 # this is to create the lint library
@@ -27,6 +30,11 @@
 
 #---------------------------
 
+libcudd$(P).so.2.4.1: $(POBJ)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(POBJ) $(SHLINK)
+	ln -s libcudd$(P).so.2.4.1 libcudd$(P).so.2
+	ln -s libcudd$(P).so.2 libcudd$(P).so
+
 lib$(P).a: $(POBJ)
 	ar rv $@ $?
 	$(RANLIB) $@
@@ -55,7 +63,9 @@
 tags: $(PSRC) $(PHDR)
 	ctags $(PSRC) $(PHDR)
 
-all: lib$(P).a lib$(P).b llib-l$(P).ln tags
+all: libcudd$(P).so.2.4.1 lib$(P).b llib-l$(P).ln tags
+
+static: lib$(P).a
 
 clean:
 	rm -f *.o *.u .pure *.warnings
diff -dur cudd-2.4.1.ORIG/util/Makefile cudd-2.4.1/util/Makefile
--- cudd-2.4.1.ORIG/util/Makefile	2004-01-03 10:15:30.000000000 -0700
+++ cudd-2.4.1/util/Makefile	2009-01-22 13:04:48.000000000 -0700
@@ -12,6 +12,8 @@
 ICFLAGS = -g
 CFLAGS  = $(ICFLAGS) $(MFLAG) $(XCFLAGS)
 
+SHLINK	= -shared -Xlinker -soname -Xlinker libcudd$(P).so.2
+
 LINTFLAGS = -u -n
 
 # this is to create the lint library
@@ -28,6 +30,11 @@
 WHERE	= ..
 INCLUDE = $(WHERE)/include
 
+libcudd$(P).so.2.4.1: $(POBJ)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(POBJ) $(SHLINK)
+	ln -s libcudd$(P).so.2.4.1 libcudd$(P).so.2
+	ln -s libcudd$(P).so.2 libcudd$(P).so
+
 lib$(P).a: $(POBJ)
 	ar rv $@ $?
 	$(RANLIB) $@
@@ -56,7 +63,9 @@
 tags: $(PSRC) $(PHDR)
 	ctags $(PSRC) $(PHDR)
 
-all: lib$(P).a lib$(P).b llib-l$(P).ln tags
+all: libcudd$(P).so.2.4.1 lib$(P).b llib-l$(P).ln tags
+
+static: lib$(P).a
 
 clean:
 	rm -f *.o *.u core *.warnings

cudd-2.4.1-signedness.patch:

--- NEW FILE cudd-2.4.1-signedness.patch ---
diff -dur cudd-2.4.1.ORIG/cudd/cuddGroup.c cudd-2.4.1/cudd/cuddGroup.c
--- cudd-2.4.1.ORIG/cudd/cuddGroup.c	2004-08-24 15:37:44.000000000 -0600
+++ cudd-2.4.1/cudd/cuddGroup.c	2006-02-20 15:04:32.000000000 -0700
@@ -214,7 +214,9 @@
     ** Cudd_bddNewVarAtLevel or Cudd_addNewVarAtLevel to create new
     ** variables have to create the variables before they group them.
     */
-    level = (low < (unsigned int) dd->size) ? dd->perm[low] : low;
+    level = (low < (unsigned int) dd->size)
+      ? (unsigned int) dd->perm[low]
+      : low;
 
     if (level + size - 1> (int) MTR_MAXHIGH)
 	return(NULL);
diff -dur cudd-2.4.1.ORIG/cudd/cuddZddGroup.c cudd-2.4.1/cudd/cuddZddGroup.c
--- cudd-2.4.1.ORIG/cudd/cuddZddGroup.c	2004-08-24 15:37:47.000000000 -0600
+++ cudd-2.4.1/cudd/cuddZddGroup.c	2006-02-20 15:05:24.000000000 -0700
@@ -171,7 +171,9 @@
     ** Cudd_bddNewVarAtLevel or Cudd_addNewVarAtLevel to create new
     ** variables have to create the variables before they group them.
     */
-    level = (low < (unsigned int) dd->sizeZ) ? dd->permZ[low] : low;
+    level = (low < (unsigned int) dd->sizeZ)
+      ? (unsigned int) dd->permZ[low]
+      : low;
 
     if (level + size - 1> (int) MTR_MAXHIGH)
 	return(NULL);
diff -dur cudd-2.4.1.ORIG/st/st.c cudd-2.4.1/st/st.c
--- cudd-2.4.1.ORIG/st/st.c	2004-02-11 15:33:16.000000000 -0700
+++ cudd-2.4.1/st/st.c	2006-02-20 15:55:51.000000000 -0700
@@ -54,7 +54,7 @@
 #define st_shift 2
 #endif
 
-#define ST_PTRHASH(x,size) ((unsigned int)((unsigned long)(x)>>st_shift)%size)
+#define ST_PTRHASH(x,size) ((int)((unsigned long)(x)>>st_shift)%size)
 
 #define EQUAL(func, x, y) \
     ((((func) == st_numcmp) || ((func) == st_ptrcmp)) ?\

cudd-2.4.1-strcat.patch:

--- NEW FILE cudd-2.4.1-strcat.patch ---
diff -dur cudd-2.4.1.ORIG/util/texpand.c cudd-2.4.1/util/texpand.c
--- cudd-2.4.1.ORIG/util/texpand.c	2004-01-01 09:49:21.000000000 -0700
+++ cudd-2.4.1/util/texpand.c	2006-02-20 14:57:37.000000000 -0700
@@ -14,9 +14,6 @@
 #ifdef BSD
     struct passwd *userRecord;
     char username[256], *filename;
-#ifndef _IBMR2
-    char *strcat (char *, const char *);
-#endif
     register int i, j;
 
     filename = ALLOC(char, strlen(fname) + 256);


Index: cudd.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cudd/F-9/cudd.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cudd.spec	7 Jan 2009 03:31:04 -0000	1.1
+++ cudd.spec	22 Jan 2009 21:03:13 -0000	1.2
@@ -1,14 +1,30 @@
-%define debug_package %{nil}
-# rpmbuild doesn't get useful debuginfo from .a libs
-
 Name:           cudd
 Version:        2.4.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        CU Decision Diagram Package
 Group:          Development/Libraries
 License:        BSD
 URL:            http://vlsi.colorado.edu/~fabio/CUDD/
 Source0:        ftp://vlsi.Colorado.EDU/pub/cudd-%{version}.tar.gz
+# This patch was sent upstream in September 2005.
+# Build shared libraries as well as static archives, and incidentally unbreak
+# parallel make.
+Patch0:         cudd-2.4.1-sharedlib.patch
+# This patch was sent upstream in September 2005.
+# Extern declarations of strcat get mangled by the preprocessor
+Patch1:         cudd-2.4.1-strcat.patch
+# This patch was sent upstream in September 2005.
+# Fix some mixed signed/unsigned operations
+Patch2:         cudd-2.4.1-signedness.patch
+# This patch was sent upstream in September 2005.
+# Don't ignore the return values of certain functions
+Patch3:         cudd-2.4.1-retval.patch
+# This patch was sent upstream in September 2005.
+# Fix a bunch of "used without being initialized" warnings
+Patch4:         cudd-2.4.1-init.patch
+# This patch was sent upstream in September 2005.
+# On 64 bit platforms, fix the size definitions of void * and long
+Patch5:         cudd-2.4.1-64bit.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 
@@ -19,48 +35,128 @@
 
 
 %package        devel
-Summary:        Development files for %{name}
+Summary:        Header files and man pages for %{name}
 Group:          Development/Libraries
-Provides:       %{name}-static = %{version}-%{release}
+Requires:       %{name} = %{version}-%{release}
 
 
 %description    devel
-Development headers and libraries for %{name}.
+Development headers and man pages for %{name}.
+
+
+%package        static
+Summary:        Static libraries for %{name}
+Group:          Development/Libraries
+
+
+%description    static
+Static libraries for %{name}.
 
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+
+# Fix two doc files with DOS line endings
+sed -i 's/\r//' dddmp/README.dddmp
+sed -i 's/\r//' dddmp/README.testdddmp
 
 
 %build
-make %{?_smp_mflags} CPPFLAGS="%{optflags}" ICFLAGS="%{optflags}" \
-  XCFLAGS=""
+# Build the shared libraries and binaries
+make %{?_smp_mflags} CPPFLAGS="%{optflags}" ICFLAGS="%{optflags} -fPIC" \
+  XCFLAGS="-DHAVE_IEEE_754 -DBSD"
+
+# Build the static libraries
+make clean
+make %{?_smp_mflags} static CPPFLAGS="%{optflags}" ICFLAGS="%{optflags}" \
+  XCFLAGS="-DHAVE_IEEE_754 -DBSD"
 
 
 %install
 rm -rf $RPM_BUILD_ROOT
+
+# Install the shared libraries
+mkdir -p $RPM_BUILD_ROOT%{_libdir}
+for slib in */*.so; do
+  install -p -m 755 ${slib}.2.4.1 $RPM_BUILD_ROOT%{_libdir}/
+  mv ${slib}.2 $RPM_BUILD_ROOT%{_libdir}
+  mv ${slib} $RPM_BUILD_ROOT%{_libdir}
+done
+
+# Install the static libraries
 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}
 for slib in */*.a; do
   install -p -m 644 ${slib} $RPM_BUILD_ROOT%{_libdir}/%{name}/
 done
+
+# Install the header files
 mkdir -p $RPM_BUILD_ROOT%{_includedir}/%{name}
 for hdr in include/*; do
   install -p -m 644 ${hdr} $RPM_BUILD_ROOT%{_includedir}/%{name}/
 done
 
+# Install the test binary
+mkdir -p $RPM_BUILD_ROOT%{_bindir}
+install -p -m 0755 nanotrav/nanotrav $RPM_BUILD_ROOT%{_bindir}
+
+# Install the test binary man page
+mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
+install -p -m 0644 nanotrav/nanotrav.1 $RPM_BUILD_ROOT%{_mandir}/man1
+
+# Put all the documentation in one place for easy installation
+mkdir doc
+mv cudd/doc doc/cudd
+mv dddmp/doc doc/dddmp
+mv dddmp/R* doc/dddmp
+mv mtr/doc doc/mtr
+mv nanotrav/doc doc/nanotrav
+mv nanotrav/README doc/nanotrav
+mv st/doc doc/st
+
+
+%post -p /sbin/ldconfig
+
+
+%postun -p /sbin/ldconfig
+
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 
+%files
+%defattr(-,root,root,-)
+%doc README LICENSE RELEASE.NOTES doc/nanotrav
+%{_bindir}/nanotrav
+%{_libdir}/*.so.*
+%{_mandir}/man1/*
+
+
 %files devel
 %defattr(-,root,root,-)
-%doc README LICENSE cudd/doc
-%{_libdir}/%{name}
+%doc README LICENSE doc/cudd doc/dddmp doc/mtr doc/st
 %{_includedir}/%{name}
+%{_libdir}/*.so
+
+
+%files static
+%defattr(-,root,root,-)
+%{_libdir}/%{name}
 
 
 %changelog
+* Thu Jan 22 2009 Jerry James <loganjerry at gmail.com> - 2.4.1-3
+- Add patches to address various minor build infelicities
+- Build both shared and static libraries
+- Install the test binary, nanotrav, and its man page
+- Gather documentation from all of the subdirectories
+
 * Sun Jan 4 2009 Conrad Meyer <konrad at tylerc.org> - 2.4.1-2
 - Add LICENSE, cudd/doc to docs.
 




More information about the scm-commits mailing list