[med-svn] r185 - in trunk/packages/ctn/ctn: apps/dcm_modify_object debian facilities/dicom libsrc

Thijs Kinkhorst thijs at alioth.debian.org
Sat Jan 27 19:34:49 CET 2007


Author: thijs
Date: 2007-01-27 19:34:48 +0100 (Sat, 27 Jan 2007)
New Revision: 185

Added:
   trunk/packages/ctn/ctn/debian/intsizes.h
   trunk/packages/ctn/ctn/debian/intsizes_h.sh
   trunk/packages/ctn/ctn/debian/test-sizes.c
Modified:
   trunk/packages/ctn/ctn/apps/dcm_modify_object/gram.h
   trunk/packages/ctn/ctn/debian/README.Debian
   trunk/packages/ctn/ctn/debian/changelog
   trunk/packages/ctn/ctn/debian/ctnmake.debian.mysql.options
   trunk/packages/ctn/ctn/debian/debian.mysql.options.env
   trunk/packages/ctn/ctn/debian/rules
   trunk/packages/ctn/ctn/facilities/dicom/Makefile
   trunk/packages/ctn/ctn/facilities/dicom/dicom.h
   trunk/packages/ctn/ctn/libsrc/Makefile
   trunk/packages/ctn/ctn/libsrc/Makefile.psql
Log:
* Fixing build on 64bit platforms and providing *INT preprocessor
  definitions for the applications built using ctn-dev.
  Patch by Yaroslav Halchenko, thanks! (Closes: 387183)

Modified: trunk/packages/ctn/ctn/apps/dcm_modify_object/gram.h
===================================================================
--- trunk/packages/ctn/ctn/apps/dcm_modify_object/gram.h	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/apps/dcm_modify_object/gram.h	2007-01-27 18:34:48 UTC (rev 185)
@@ -1,8 +1,10 @@
-/* A Bison parser, made by GNU Bison 2.1.  */
+/* A Bison parser, made by GNU Bison 2.3.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Skeleton interface for Bison's Yacc-like parsers in C
 
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
    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, or (at your option)
@@ -18,11 +20,19 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
 
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
 /* Tokens.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
@@ -40,18 +50,20 @@
 
 
 
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
 #line 25 "gram.y"
-typedef union YYSTYPE {
+{
 	unsigned long	num;
 	char		str[DICOM_LO_LENGTH+1];
 	char		*s;
 	DCM_ELEMENT	*e;
 	LST_HEAD	*l;
 	void		*v;
-} YYSTYPE;
-/* Line 1447 of yacc.c.  */
-#line 55 "y.tab.h"
+}
+/* Line 1489 of yacc.c.  */
+#line 66 "y.tab.h"
+	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 # define YYSTYPE_IS_TRIVIAL 1
@@ -59,5 +71,3 @@
 
 extern YYSTYPE yylval;
 
-
-

Modified: trunk/packages/ctn/ctn/debian/README.Debian
===================================================================
--- trunk/packages/ctn/ctn/debian/README.Debian	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/debian/README.Debian	2007-01-27 18:34:48 UTC (rev 185)
@@ -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."
-
-

Modified: trunk/packages/ctn/ctn/debian/changelog
===================================================================
--- trunk/packages/ctn/ctn/debian/changelog	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/debian/changelog	2007-01-27 18:34:48 UTC (rev 185)
@@ -1,3 +1,11 @@
+ctn (3.0.6-10) unstable; urgency=medium
+
+  * Fixing build on 64bit platforms and providing *INT preprocessor
+    definitions for the applications built using ctn-dev.
+    Patch by Yaroslav Halchenko, thanks! (Closes: 387183)
+
+ -- Thijs Kinkhorst <thijs at debian.org>  Sat, 27 Jan 2007 19:23:09 +0100
+
 ctn (3.0.6-9) unstable; urgency=low
 
   * Acknowledge NMU (Closes: #388612), thanks Steinar Gunderson!

Modified: trunk/packages/ctn/ctn/debian/ctnmake.debian.mysql.options
===================================================================
--- trunk/packages/ctn/ctn/debian/ctnmake.debian.mysql.options	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/debian/ctnmake.debian.mysql.options	2007-01-27 18:34:48 UTC (rev 185)
@@ -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) \

Modified: trunk/packages/ctn/ctn/debian/debian.mysql.options.env
===================================================================
--- trunk/packages/ctn/ctn/debian/debian.mysql.options.env	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/debian/debian.mysql.options.env	2007-01-27 18:34:48 UTC (rev 185)
@@ -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

Added: trunk/packages/ctn/ctn/debian/intsizes.h
===================================================================
--- trunk/packages/ctn/ctn/debian/intsizes.h	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/debian/intsizes.h	2007-01-27 18:34:48 UTC (rev 185)
@@ -0,0 +1,16 @@
+#ifndef INTSIZES_IS_IN
+#define INTSIZES_IS_IN 1
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+# define INTSIZE 32
+# define LONGSIZE 32
+# define SHORTSIZE 16
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif

Added: trunk/packages/ctn/ctn/debian/intsizes_h.sh
===================================================================
--- trunk/packages/ctn/ctn/debian/intsizes_h.sh	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/debian/intsizes_h.sh	2007-01-27 18:34:48 UTC (rev 185)
@@ -0,0 +1,56 @@
+#!/bin/bash
+#-------------------------- =+- Shell script -+= --------------------------
+#
+# @file      intsizes_h.sh
+# @date      Fri Jan 26 15:18:19 2007
+# @brief
+#
+#
+#  Yaroslav Halchenko                                      CS at UNM, CS at NJIT
+#  web:     http://www.onerussian.com                      & PSYCH at RUTGERS
+#  e-mail:  yoh at onerussian.com                              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

Modified: trunk/packages/ctn/ctn/debian/rules
===================================================================
--- trunk/packages/ctn/ctn/debian/rules	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/debian/rules	2007-01-27 18:34:48 UTC (rev 185)
@@ -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`

Added: trunk/packages/ctn/ctn/debian/test-sizes.c
===================================================================
--- trunk/packages/ctn/ctn/debian/test-sizes.c	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/debian/test-sizes.c	2007-01-27 18:34:48 UTC (rev 185)
@@ -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;
+}

Modified: trunk/packages/ctn/ctn/facilities/dicom/Makefile
===================================================================
--- trunk/packages/ctn/ctn/facilities/dicom/Makefile	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/facilities/dicom/Makefile	2007-01-27 18:34:48 UTC (rev 185)
@@ -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:

Modified: trunk/packages/ctn/ctn/facilities/dicom/dicom.h
===================================================================
--- trunk/packages/ctn/ctn/facilities/dicom/dicom.h	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/facilities/dicom/dicom.h	2007-01-27 18:34:48 UTC (rev 185)
@@ -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

Modified: trunk/packages/ctn/ctn/libsrc/Makefile
===================================================================
--- trunk/packages/ctn/ctn/libsrc/Makefile	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/libsrc/Makefile	2007-01-27 18:34:48 UTC (rev 185)
@@ -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 \

Modified: trunk/packages/ctn/ctn/libsrc/Makefile.psql
===================================================================
--- trunk/packages/ctn/ctn/libsrc/Makefile.psql	2007-01-13 01:24:03 UTC (rev 184)
+++ trunk/packages/ctn/ctn/libsrc/Makefile.psql	2007-01-27 18:34:48 UTC (rev 185)
@@ -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 \




More information about the debian-med-commit mailing list