ok -- I've refurnished the patch... due to quite outdated build system
in ctn and a layer of changes on top of it, patch came out to be
a bit intrusive and not very nice so you might like to have a look at it
-- it is attached.

Tentative NMU is available from
http://itanix.rutgers.edu/rumba/dists/sid/perspect/source/graphics/ctn_3.0.6-9.1.dsc

(orig.tar.gz is not there of cause ;-))

and binaries for amd64
http://itanix.rutgers.edu/rumba/dists/sid/perspect/binary-amd64/devel/ctn-dev_3.0.6-9.1_amd64.deb
http://itanix.rutgers.edu/rumba/dists/sid/perspect/binary-amd64/graphics/ctn_3.0.6-9.1_amd64.deb

Let me know if you want me to proceed with NMU (7days delayed if you
like or just like a sponsored upload -  directly into the queue)
the maintainer of dicomnifti is anxious for that to appear to close his
RC bug with the upload which would use proper dicom.h ;-)

-- 
Yaroslav Halchenko
Research Assistant, Psychology Department, Rutgers-Newark
Student  Ph.D. @ CS Dept. NJIT
Office: (973) 353-5440x263 | FWD: 82823 | Fax: (973) 353-1171
        101 Warren Str, Smith Hall, Rm 4-105, Newark NJ 07102
WWW:     http://www.linkedin.com/in/yarik        
diff -Naur ctn-3.0.6.orig/debian/changelog ctn-3.0.6/debian/changelog
--- ctn-3.0.6.orig/debian/changelog	2007-01-26 17:02:17.000000000 -0500
+++ ctn-3.0.6/debian/changelog	2007-01-26 15:55:21.791508467 -0500
@@ -1,3 +1,11 @@
+ctn (3.0.6-9.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fixing built on 64bit platforms and providing *INT preprocessor
+    definitions for the applications built using ctn-dev
+
+ -- Yaroslav Halchenko <[EMAIL PROTECTED]>  Fri, 26 Jan 2007 15:54:49 -0500
+
 ctn (3.0.6-9) unstable; urgency=low
 
   * Acknowledge NMU (Closes: #388612), thanks Steinar Gunderson!
diff -Naur ctn-3.0.6.orig/debian/ctnmake.debian.mysql.options ctn-3.0.6/debian/ctnmake.debian.mysql.options
--- ctn-3.0.6.orig/debian/ctnmake.debian.mysql.options	2007-01-26 17:02:17.000000000 -0500
+++ ctn-3.0.6/debian/ctnmake.debian.mysql.options	2007-01-26 15:08:17.237741880 -0500
@@ -23,9 +23,6 @@
 CFLAGS_MOTIF = -I$(XM_INCLUDE)
 
 #DEBUG_LIBS = -lmalloc
-LONGSIZE=32
-INTSIZE=32
-SHORTSIZE=16
 C_OPTS = -g -DDEBUG -D$(ARCHITECTURE) -D$(OS) -DSHARED_MEMORY \
 -DSEMAPHORE -DX11 -DATHENA -DX11R4 -DUSLEEP -DMYSQLDB \
 -I$(DICOM_INCLUDE) -I$(MYSQL_INCLUDE) \
diff -Naur ctn-3.0.6.orig/debian/debian.mysql.options.env ctn-3.0.6/debian/debian.mysql.options.env
--- ctn-3.0.6.orig/debian/debian.mysql.options.env	2007-01-26 17:02:17.000000000 -0500
+++ ctn-3.0.6/debian/debian.mysql.options.env	2007-01-26 15:08:17.241742262 -0500
@@ -6,7 +6,7 @@
 export DICOM_LIB=$DICOM_ROOT/lib/ctn-mysql
 export DICOM_LIBSRC=$DICOM_ROOT/libsrc
 export DICOM_INCLUDE=$DICOM_ROOT/include 
-export DICOM_MAKE=$DICOM_ROOT/debian/ctnmake.debian.mysql.options
+export DICOM_MAKE=$DICOM_ROOT/debian/ctnmake.debian.mysql.options.full
 
 export MYSQL_LIB=/usr/lib
 export MYSQL_INCLUDE=/usr/include/mysql
diff -Naur ctn-3.0.6.orig/debian/intsizes_h.sh ctn-3.0.6/debian/intsizes_h.sh
--- ctn-3.0.6.orig/debian/intsizes_h.sh	1969-12-31 19:00:00.000000000 -0500
+++ ctn-3.0.6/debian/intsizes_h.sh	2007-01-26 15:19:04.207458428 -0500
@@ -0,0 +1,56 @@
+#!/bin/bash
+#-------------------------- =+- Shell script -+= --------------------------
+#
+# @file      intsizes_h.sh
+# @date      Fri Jan 26 15:18:19 2007
+# @brief
+#
+#
+#  Yaroslav Halchenko                                      [EMAIL PROTECTED], [EMAIL PROTECTED]
+#  web:     http://www.onerussian.com                      & [EMAIL PROTECTED]
+#  e-mail:  [EMAIL PROTECTED]                              ICQ#: 60653192
+#
+# DESCRIPTION (NOTES):
+#
+# COPYRIGHT: Yaroslav Halchenko 2007
+#
+# LICENSE:
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the 
+#  Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+#  MA 02110-1301, USA.
+#
+# On Debian system see /usr/share/common-licenses/GPL for the full license.
+#
+#-----------------\____________________________________/------------------
+export `debian/test-sizes`
+
+cat > debian/intsizes.h <<EOF
+#ifndef INTSIZES_IS_IN
+#define INTSIZES_IS_IN 1
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+# define INTSIZE $INTSIZE
+# define LONGSIZE $LONGSIZE
+# define SHORTSIZE $SHORTSIZE
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
+EOF
diff -Naur ctn-3.0.6.orig/debian/README.Debian ctn-3.0.6/debian/README.Debian
--- ctn-3.0.6.orig/debian/README.Debian	2007-01-26 17:02:17.000000000 -0500
+++ ctn-3.0.6/debian/README.Debian	2007-01-26 15:03:54.328662785 -0500
@@ -26,15 +26,3 @@
 
   4. Added man pages. 
 
-
-Using CTN with other code on 64 bit platforms
----------------------------------------------
-Michael Hanke writes:
-"If I got it right LONGSIZE has to be defined 32 in any code that uses
-CTN no matter what the actual size of long is. 
-
-I have some code that normally determines the size of long in a platform check
-(obviously 64 on amd64). If I define LONGSIZE to match the size of long
-on amd64 I get a segfault when calling CTN stuff."
-
-
diff -Naur ctn-3.0.6.orig/debian/rules ctn-3.0.6/debian/rules
--- ctn-3.0.6.orig/debian/rules	2007-01-26 17:02:17.000000000 -0500
+++ ctn-3.0.6/debian/rules	2007-01-26 16:23:02.901923065 -0500
@@ -15,8 +15,17 @@
 
 build: build-stamp
 
-build-stamp: 
+# we must provide *SIZE inside dicom.h or otherwise applications which
+# would use ctn might be doomed to get improper U32 types etc
+# that file will be included in dicom.h - hard patched
+debian/intsizes.h: debian/test-sizes
+	sh debian/intsizes_h.sh
+
+build-stamp: debian/test-sizes debian/intsizes.h
 	dh_testdir
+	debian/test-sizes >| debian/ctnmake.debian.mysql.options.full
+	cat debian/ctnmake.debian.mysql.options >> debian/ctnmake.debian.mysql.options.full
+	mv debian/intsizes.h facilities/dicom/
 
 	# Add here commands to compile the package.
 	(. debian/debian.mysql.options.env; make install)
@@ -30,6 +39,8 @@
 	# Add here commands to clean up after the build process.
 	-$(MAKE) clean
 	rm -f debian/ctn*.postinst.* debian/ctn*.prerm.*
+	rm -f debian/ctnmake.debian.mysql.options.full debian/test-sizes
+	rm -f facilities/dicom/intsizes.h
 	rm -rf ${build}
 	rm -f libsrc/*.c libsrc/*.h
 	rm -f `find . -name \*.o -or -name \*.a`
diff -Naur ctn-3.0.6.orig/debian/test-sizes.c ctn-3.0.6/debian/test-sizes.c
--- ctn-3.0.6.orig/debian/test-sizes.c	1969-12-31 19:00:00.000000000 -0500
+++ ctn-3.0.6/debian/test-sizes.c	2007-01-26 15:05:23.689186908 -0500
@@ -0,0 +1,7 @@
+#include <stdio.h>
+int main(){ 
+    printf("LONGSIZE=%d\n", 8*sizeof(long int));
+    printf("INTSIZE=%d\n", 8*sizeof(int));
+    printf("SHORTSIZE=%d\n", 8*sizeof(short));
+return 0;
+}
diff -Naur ctn-3.0.6.orig/facilities/dicom/dicom.h ctn-3.0.6/facilities/dicom/dicom.h
--- ctn-3.0.6.orig/facilities/dicom/dicom.h	1999-09-23 22:53:14.000000000 -0400
+++ ctn-3.0.6/facilities/dicom/dicom.h	2007-01-26 16:24:45.183676038 -0500
@@ -57,6 +57,8 @@
 
 #ifdef _MSC_VER
 #include "dicom_platform.h"
+#else
+#include "intsizes.h"
 #endif
 
 #ifdef  __cplusplus
@@ -85,14 +87,13 @@
     typedef unsigned short U16;	/* unsigned, 16 bit */
     typedef short S16;		/* signed, 16 bit */
 
-#if LONGSIZE == 64 && INTSIZE == 32	/* Such as an Alpha */
+#if LONGSIZE == 64 && INTSIZE == 32    /* Such as an Alpha */
     typedef unsigned int U32;
     typedef int S32;
 
 #elif LONGSIZE == 32		/* Most 32 bit workstations */
     typedef unsigned long U32;
     typedef long S32;
-
 #else				/* Something we do not support */
 
 /* The writers of this code assume that we can find a 32 bit integer
diff -Naur ctn-3.0.6.orig/facilities/dicom/Makefile ctn-3.0.6/facilities/dicom/Makefile
--- ctn-3.0.6.orig/facilities/dicom/Makefile	2002-02-27 09:50:09.000000000 -0500
+++ ctn-3.0.6/facilities/dicom/Makefile	2007-01-26 15:21:47.147025813 -0500
@@ -8,6 +8,7 @@
 install:
 	$(INSTALLINCLUDE) ctn_os.h $(DICOM_INCLUDE)
 	$(INSTALLINCLUDE) dicom.h $(DICOM_INCLUDE)
+	$(INSTALLINCLUDE) intsizes.h $(DICOM_INCLUDE)
 	$(INSTALLINCLUDE) dicom_platform.h $(DICOM_INCLUDE)
 
 export:
@@ -21,6 +22,7 @@
 	rm -f $(DICOM_LIBSRC)/dicom.h $(DICOM_LIBSRC)/dicom_platform.h $(DICOM_LIBSRC)/ctn_os.h
 	ln -s ../facilities/dicom/ctn_os.h $(DICOM_LIBSRC)
 	ln -s ../facilities/dicom/dicom.h $(DICOM_LIBSRC)
+	ln -s ../facilities/dicom/intsizes.h $(DICOM_LIBSRC)
 	ln -s ../facilities/dicom/dicom_platform.h $(DICOM_LIBSRC)
 
 clean:
diff -Naur ctn-3.0.6.orig/libsrc/Makefile ctn-3.0.6/libsrc/Makefile
--- ctn-3.0.6.orig/libsrc/Makefile	2007-01-26 17:02:17.000000000 -0500
+++ ctn-3.0.6/libsrc/Makefile	2007-01-26 15:36:18.918458211 -0500
@@ -25,7 +25,7 @@
 OBJS = $(BASE_OBJS) $(TBL_DB) tblcond.o idb.o idbcond.o
 OBJS_MBCTN = $(BASE_OBJS) dicom_chr.o $(TBLMB_DB) tblmbcond.o idbmb.o idbmbcond.o xutl_mb.o
 
-BASE_HEADER_FILES = cfg.h condition.h ctn_os.h ctnthread.h dbquery.h decode.h dicom.h \
+BASE_HEADER_FILES = cfg.h condition.h ctn_os.h ctnthread.h dbquery.h decode.h dicom.h intsizes.h \
 dicom_ddr.h dicom_ie.h dicom_irs.h dicom_messages.h \
 dicom_objects.h dicom_platform.h dicom_print.h dicom_services.h \
 dicom_sq.h dicom_uids.h dulfsm.h dulprotocol.h dulsnoop.h \
diff -Naur ctn-3.0.6.orig/libsrc/Makefile.psql ctn-3.0.6/libsrc/Makefile.psql
--- ctn-3.0.6.orig/libsrc/Makefile.psql	2002-04-17 13:22:22.000000000 -0400
+++ ctn-3.0.6/libsrc/Makefile.psql	2007-01-26 15:36:31.907700954 -0500
@@ -24,7 +24,7 @@
 OBJS = $(BASE_OBJS) tbl_psql.o tblcond.o idb.o idbcond.o
 OBJS_MBCTN = $(BASE_OBJS) dicom_chr.o tblmb_psql.o tblmbcond.o idbmb.o idbmbcond.o xutl_mb.o
 
-BASE_HEADER_FILES = cfg.h condition.h ctn_os.h ctnthread.h dbquery.h decode.h dicom.h \
+BASE_HEADER_FILES = cfg.h condition.h ctn_os.h ctnthread.h dbquery.h decode.h dicom.h intsizes.h \
 dicom_ddr.h dicom_ie.h dicom_irs.h dicom_messages.h \
 dicom_objects.h dicom_platform.h dicom_print.h dicom_services.h \
 dicom_sq.h dicom_uids.h dulfsm.h dulprotocol.h dulsnoop.h \

Reply via email to