bkuemmer wrote:
I am building dcmtk using
Code: Select all
./configure --prefix=/sw
make install prefix=/sw mandir=/sw/share/man
From looking at configure.in, it seems that the location of the dicom.dic which is installed is different when using the --prefix option:
Without a --prefix, the dicom.dic is put into /usr/local/lib, with --prefix, it is put into $prefix/lib, but the compiled binaries expect the dicom.dic in $datadir/dcmtk, which defaults to $prefix/share/dcmtk.
Am I doing something wrong? Is it supposed to work like this?
Hmm, for the Debian DCMTK-3.5.3 port we have slightly patched
the original sources because there was no straightforward way to install
DCMTK in compliance with the Unix Filesystem Hierarchy Standard (see e.g.
http://www.pathname.com/fhs/) without kludging the build scripts in some way.
Thus, the Debian DCMTK-3.5.3 package includes a number of patches
that change the semantics of the --datadir and --libdir configure options
in order to separate read-only architecture-independent data (e.g. the
dicom.dic DICOM dictionary) from architecture-dependent object libraries.
For backward compatibility, the original (i.e. violating FHS) behavior has
been preserved in case ./configure is invoked without --prefix option.
It seems, these Debian patches to DCMTK-3.5.3 has been adapted for
DCMTK-3.5.4 by the Offis team -- but only partially.
The following patch was adapted for DCMTK-3.5.4:
Code: Select all
diff -ur 3.5.3.orig/config/configure.in 3.5.3/dcmtk-3.5.3/config/configure.in
--- 3.5.3.orig/config/configure.in 2004-05-07 13:24:26.000000000 +0200
+++ 3.5.3/dcmtk-3.5.3/config/configure.in 2005-07-11 22:44:49.000000000 +0200
@@ -1,5 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(DCMTK, 3.5.3, [dicom-bugs@offis.de], [dcmtk-3.5.3])
+AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(Makefile.in)
AC_CONFIG_HEADER(include/cfunix.h)
@@ -29,10 +30,13 @@
if test "x$prefix" = xNONE ; then
AC_DEFINE_UNQUOTED(DCMTK_PREFIX, "${ac_default_prefix}", [Define the DCMTK default path])
+eval dcm_dict="${ac_default_prefix}/lib/dicom.dic"
else
AC_DEFINE_UNQUOTED(DCMTK_PREFIX, "${prefix}", [Define the DCMTK default path])
+eval dcm_dict="${datadir}/dcmtk/dicom.dic"
fi
-AC_DEFINE_UNQUOTED(DCM_DICT_DEFAULT_PATH, DCMTK_PREFIX "/lib/dicom.dic", [Define the default data dictionary path for the dcmdata library package])
+
+AC_DEFINE_UNQUOTED(DCM_DICT_DEFAULT_PATH, "${dcm_dict}", [Define the default data dictionary path for the dcmdata library package])
AH_VERBATIM([PATH_SEPARATOR], [/* Define path separator */
#define PATH_SEPARATOR '/'])
[...]
But the following parts have not been applied for DCMTK-3.5.4:
Code: Select all
diff -ur 3.5.3.orig/dcmdata/libsrc/Makefile.in 3.5.3/dcmtk-3.5.3/dcmdata/libsrc/Makefile.in
--- 3.5.3.orig/dcmdata/libsrc/Makefile.in 2004-05-05 15:11:32.000000000 +0200
+++ 3.5.3/dcmtk-3.5.3/dcmdata/libsrc/Makefile.in 2005-07-06 21:03:17.000000000 +0200
@@ -56,12 +56,17 @@
$(INSTALL_DATA) $(library) $(libdir)/$(library)
install-support: $(DICTFILE) $(PRIVDICTFILE)
- $(configdir)/mkinstalldirs $(libdir)
+ if [ "x$(prefix)" = "x" ] ; then \
+ DICTPATH="$(libdir)" ; \
+ else \
+ DICTPATH="$(datadir)" ; \
+ fi ; \
+ $(configdir)/mkinstalldirs $$DICTPATH ; \
if [ "x$(INSTALL_PRIVATE_DICTIONARY)" = "xYES" ] ; then \
cat $(DICTFILE) $(PRIVDICTFILE) >dicom.tmp ; \
- $(INSTALL_DATA) dicom.tmp $(libdir)/dicom.dic ; \
+ $(INSTALL_DATA) dicom.tmp $$DICTPATH/dicom.dic ; \
else \
- $(INSTALL_DATA) $(DICTFILE) $(libdir)/dicom.dic ; \
+ $(INSTALL_DATA) $(DICTFILE) $$DICTPATH/dicom.dic ; \
fi
diff -ur 3.5.3.orig/dcmdata/apps/Makefile.in 3.5.3/dcmtk-3.5.3/dcmdata/apps/Makefile.in
--- 3.5.3.orig/dcmdata/apps/Makefile.in 2004-05-05 15:10:10.000000000 +0200
+++ 3.5.3/dcmtk-3.5.3/dcmdata/apps/Makefile.in 2005-07-06 21:03:17.000000000 +0200
@@ -69,13 +69,18 @@
done
install-support:
- $(configdir)/mkinstalldirs $(libdir)
+ if [ "x$(prefix)" = "x" ] ; then \
+ SUPPORTPATH="$(libdir)" ;\
+ else \
+ SUPPORTPATH="$(datadir)" ;\
+ fi ; \
+ $(configdir)/mkinstalldirs $$SUPPORTPATH ;\
for file in $(support_lib); do \
- $(INSTALL_DATA) $$file $(libdir) ;\
- done
- $(configdir)/mkinstalldirs $(datadir)
+ $(INSTALL_DATA) $$file $$SUPPORTPATH ;\
+ done ;\
+ $(configdir)/mkinstalldirs $$SUPPORTPATH ;\
for file in $(support_data); do \
- $(INSTALL_DATA) $$file $(datadir) ;\
+ $(INSTALL_DATA) $$file $$SUPPORTPATH ;\
done
clean:
diff -ur 3.5.3.orig/dcmsr/apps/Makefile.in 3.5.3/dcmtk-3.5.3/dcmsr/apps/Makefile.in
--- 3.5.3.orig/dcmsr/apps/Makefile.in 2004-05-05 15:37:17.000000000 +0200
+++ 3.5.3/dcmtk-3.5.3/dcmsr/apps/Makefile.in 2005-07-06 21:03:17.000000000 +0200
@@ -49,9 +49,14 @@
done
install-support:
- $(configdir)/mkinstalldirs $(libdir)
+ if [ "x$(prefix)" = "x" ] ; then \
+ SUPPORTPATH="$(libdir)" ;\
+ else \
+ SUPPORTPATH="$(datadir)" ;\
+ fi ; \
+ $(configdir)/mkinstalldirs $$SUPPORTPATH ;\
for file in $(support); do \
- $(INSTALL_DATA) $$file $(libdir) ;\
+ $(INSTALL_DATA) $$file $$SUPPORTPATH ;\
done
clean:
I think, this can explain the strange behaviour, you described.
Best regards - Juergen