]> Creatis software - gdcm.git/commitdiff
added autoconf tools for library (src) and C++ test (Test) compilation
authorjohan <johan>
Sun, 16 Feb 2003 17:53:13 +0000 (17:53 +0000)
committerjohan <johan>
Sun, 16 Feb 2003 17:53:13 +0000 (17:53 +0000)
13 files changed:
.cvsignore
INSTALL
Makefile.am [new file with mode: 0644]
Testing/.cvsignore
autogen.sh [new file with mode: 0755]
configure.in [new file with mode: 0644]
src/.cvsignore
src/Makefile [deleted file]
src/Makefile.am [new file with mode: 0644]
src/config.h [new file with mode: 0644]
src/config.h.in [new file with mode: 0644]
src/stamp-h [new file with mode: 0644]
src/stamp-h.in [new file with mode: 0644]

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b1a0530fabeb6128f733e8311732cc07f04ab31e 100644 (file)
@@ -0,0 +1,11 @@
+Makefile.in
+Makefile
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+libtool
+ltmain.sh
+aclocal.m4
diff --git a/INSTALL b/INSTALL
index 67f032ae0c8d1d48b994e6e37d7ee40029a3af3c..93ffa792a2773615e0880a16322b0e5c1ef7ba69 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,16 +1,25 @@
-cd src
-make
+* For compiling the library and C++ test programs:
 
-For testing in C++:
-cd Test
+./configure
 make
-./test ../Data/CR-MONO1-10-chest.dcm (or any other file in there)
+make install
+
+You can use the --prefix option of the configure script to force installation
+in some place (default is /usr/local/DCMlib):
+
+./configure --prefix=/where/ever/you/want
+
 
-For testing in Python:
-cd python
+* For testing in C++:
+./Test/test ../Data/CR-MONO1-10-chest.dcm (or any other file in there)
+
+
+* For testing in Python:
+cd python/gdcmPython
 make  (requires SWIG Version 1.3.16u i.e. the contemporary devel version)
-python testSuite.py (test suite written in unittest)
+python testSuite.py (test suite written in unittest, you should use python2)
+
 
-For manual test in python:
+For manual test in python:
 cd python/demo
 python test.py ../../Data/CR-MONO1-10-chest.dcm (or any other file)
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..93175fd
--- /dev/null
@@ -0,0 +1,9 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = src Test
+
+release:
+       $(MAKE) dist distdir=$(PACKAGE)-$(VERSION)
+
+snapshot:
+       $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"`
index 9daeafb9864cf43055ae93beb0afd6c7d144bfa4..2cad7ce3fe7d39564c9c6a48ca4bd63057392c9d 100644 (file)
@@ -1 +1,9 @@
 test
+.deps
+.libs
+Makefile.in
+Makefile
+hashtest
+image.dcm
+image.raw
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..3671df0
--- /dev/null
@@ -0,0 +1,139 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+PKG_NAME="crea"
+
+(test -f $srcdir/configure.in \
+  && test -d $srcdir/src) || {
+     echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+     echo " top-level crea directory"
+     exit 1
+}
+
+
+DIE=0
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+  echo
+  echo "**Error**: You must have \`autoconf' installed to compile Gnome."
+  echo "Download the appropriate package for your distribution,"
+  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+  DIE=1
+}
+
+(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
+  (libtool --version) < /dev/null > /dev/null 2>&1 || {
+    echo
+    echo "**Error**: You must have \`libtool' installed to compile Gnome."
+    echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
+    echo "(or a newer version if it is available)"
+    DIE=1
+  }
+}
+
+grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
+  grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
+  (gettext --version) < /dev/null > /dev/null 2>&1 || {
+    echo
+    echo "**Error**: You must have \`gettext' installed to compile Gnome."
+    echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
+    echo "(or a newer version if it is available)"
+    DIE=1
+  }
+}
+
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+  echo
+  echo "**Error**: You must have \`automake' installed to compile Gnome."
+  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
+  echo "(or a newer version if it is available)"
+  DIE=1
+  NO_AUTOMAKE=yes
+}
+
+
+# if no automake, don't bother testing for aclocal
+test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
+  echo
+  echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
+  echo "installed doesn't appear recent enough."
+  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
+  echo "(or a newer version if it is available)"
+  DIE=1
+}
+
+if test "$DIE" -eq 1; then
+  exit 1
+fi
+
+if test -z "$*"; then
+  echo "**Warning**: I am going to run \`configure' with no arguments."
+  echo "If you wish to pass any to it, please specify them on the"
+  echo \`$0\'" command line."
+  echo
+fi
+
+case $CC in
+xlc )
+  am_opt=--include-deps;;
+esac
+
+for coin in `find $srcdir -name configure.in -print`
+do 
+  dr=`dirname $coin`
+  if test -f $dr/NO-AUTO-GEN; then
+    echo skipping $dr -- flagged as no auto-gen
+  else
+    echo processing $dr
+    macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
+    ( cd $dr
+      aclocalinclude="-I . $ACLOCAL_FLAGS"
+      for k in $macrodirs; do
+       if test -d $k; then
+          aclocalinclude="$aclocalinclude -I $k"
+       ##else 
+       ##  echo "**Warning**: No such directory \`$k'.  Ignored."
+        fi
+      done
+      if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
+       if grep "sed.*POTFILES" configure.in >/dev/null; then
+         : do nothing -- we still have an old unmodified configure.in
+       else
+         echo "Creating $dr/aclocal.m4 ..."
+         test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+         echo "Running gettextize...  Ignore non-fatal messages."
+         echo "no" | gettextize --force --copy
+         echo "Making $dr/aclocal.m4 writable ..."
+         test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+        fi
+      fi
+      if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
+       echo "Running libtoolize..."
+       libtoolize --force --copy
+      fi
+      echo "Running aclocal $aclocalinclude ..."
+      aclocal $aclocalinclude
+      if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
+       echo "Running autoheader..."
+       autoheader
+      fi
+      echo "Running automake --gnu $am_opt ..."
+      automake --add-missing --gnu $am_opt
+      echo "Running autoconf ..."
+      autoconf
+    )
+  fi
+done
+
+conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
+
+if test x$NOCONFIGURE = x; then
+  echo Running $srcdir/configure $conf_flags "$@" ...
+  $srcdir/configure $conf_flags "$@" \
+  && echo Now type \`make\' to compile $PKG_NAME || exit 1
+else
+  echo Skipping configure process.
+fi
diff --git a/configure.in b/configure.in
new file mode 100644 (file)
index 0000000..75710ec
--- /dev/null
@@ -0,0 +1,44 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(src/gdcmDict.cxx)
+
+AC_PREFIX_DEFAULT(/usr/local/DCMlib)
+
+AM_INIT_AUTOMAKE(DCMlib, 0.1.0)
+AM_MAINTAINER_MODE
+AM_CONFIG_HEADER(src/config.h)
+
+CFLAGS="-Wall -g"
+CXXFLAGS="-Wall -g"
+
+dnl Checks for programs.
+AM_PROG_LIBTOOL
+AC_PROG_CXX
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+
+dnl Checks for header files.
+AC_HEADER_STDC
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_STRUCT_TM
+
+dnl Checks for endianness
+AC_C_BIGENDIAN
+
+dnl Checks for int and long size
+AC_CHECK_SIZEOF(char, 1)
+AC_CHECK_SIZEOF(short, 2)
+AC_CHECK_SIZEOF(int, 4)
+AC_CHECK_SIZEOF(long, 4)
+AC_CHECK_SIZEOF(long long, 8)
+
+dnl produce Makefile.in files
+AC_OUTPUT([
+Makefile 
+src/Makefile
+Test/Makefile])
index 9d22eb46a9c8ce7e6f0d17b751d0e192ed89fefe..4727c1b0c93d396756ff4bdc43dcb67f91263093 100644 (file)
@@ -1,2 +1,8 @@
 *.o
 *.so
+.deps
+.libs
+Makefile.in
+Makefile
+*.lo
+*.la
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644 (file)
index bd17a73..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-CPPFLAGS=-g -Wall -Wunused-variable
-LDFLAGS=-g
-
-OBJECTS=gdcmUtil.o \
-       gdcmHeader.o    \
-       gdcmElValue.o   \
-       gdcmDictEntry.o \
-       gdcmDict.o      \
-       gdcmDictSet.o   \
-       gdcmElValSet.o  \
-       gdcmHeaderIdo.o \
-       gdcmFile.o
-
-%.o : %.cxx
-       $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
-
-all: libgdcm.so libgdcm.a
-
-libgdcm.so: $(OBJECTS)
-       g++ -shared -o $@ $^ $(LDFLAGS)
-
-libgdcm.a: $(OBJECTS)
-       ar cr $@ $^
-
-clean:
-       rm -f *.so *.a *.o
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..cf5612d
--- /dev/null
@@ -0,0 +1,33 @@
+#
+# Targets
+#
+
+# Before making a release, the LTVERSION string should be modified.
+# The string is of the form C:R:A.
+# - If interfaces have been changed or added, but binary compatibility has
+#   been preserved, change to C+1:0:A+1
+# - If binary compatibility has been broken (eg removed or changed interfaces)
+#   change to C+1:0:0
+# - If the interface is the same as the previous version, change to C:R+1:A
+
+LTVERSION = 0:1:0
+
+lib_LTLIBRARIES = libgdcm.la
+
+libgdcm_la_SOURCES=            \
+       gdcmUtil.cxx    \
+       gdcmHeader.cxx    \
+       gdcmElValue.cxx   \
+       gdcmDictEntry.cxx \
+       gdcmDict.cxx      \
+       gdcmDictSet.cxx   \
+       gdcmElValSet.cxx  \
+       gdcmHeaderIdo.cxx \
+       gdcmFile.cxx
+
+libgdcmincludedir = $(includedir)
+libgdcminclude_HEADERS =       \
+       config.h        \
+       gdcm.h          \
+       gdcmIdo.h       \
+       gdcmUtil.h
diff --git a/src/config.h b/src/config.h
new file mode 100644 (file)
index 0000000..67e1b84
--- /dev/null
@@ -0,0 +1,43 @@
+/* src/config.h.  Generated automatically by configure.  */
+/* src/config.h.in.  Generated automatically from configure.in by autoheader.  */
+
+/* Define to empty if the keyword does not work.  */
+/* #undef const */
+
+/* Define to `unsigned' if <sys/types.h> doesn't define.  */
+/* #undef size_t */
+
+/* Define if you have the ANSI C header files.  */
+#define STDC_HEADERS 1
+
+/* Define if your <sys/time.h> declares struct tm.  */
+/* #undef TM_IN_SYS_TIME */
+
+/* Define if your processor stores words with the most significant
+   byte first (like Motorola and SPARC, unlike Intel and VAX).  */
+/* #undef WORDS_BIGENDIAN */
+
+/* The number of bytes in a char.  */
+#define SIZEOF_CHAR 1
+
+/* The number of bytes in a int.  */
+#define SIZEOF_INT 4
+
+/* The number of bytes in a long.  */
+#define SIZEOF_LONG 4
+
+/* The number of bytes in a long long.  */
+#define SIZEOF_LONG_LONG 8
+
+/* The number of bytes in a short.  */
+#define SIZEOF_SHORT 2
+
+/* Define if you have the <dlfcn.h> header file.  */
+#define HAVE_DLFCN_H 1
+
+/* Name of package */
+#define PACKAGE "DCMlib"
+
+/* Version number of package */
+#define VERSION "0.1.0"
+
diff --git a/src/config.h.in b/src/config.h.in
new file mode 100644 (file)
index 0000000..552bf6b
--- /dev/null
@@ -0,0 +1,42 @@
+/* src/config.h.in.  Generated automatically from configure.in by autoheader.  */
+
+/* Define to empty if the keyword does not work.  */
+#undef const
+
+/* Define to `unsigned' if <sys/types.h> doesn't define.  */
+#undef size_t
+
+/* Define if you have the ANSI C header files.  */
+#undef STDC_HEADERS
+
+/* Define if your <sys/time.h> declares struct tm.  */
+#undef TM_IN_SYS_TIME
+
+/* Define if your processor stores words with the most significant
+   byte first (like Motorola and SPARC, unlike Intel and VAX).  */
+#undef WORDS_BIGENDIAN
+
+/* The number of bytes in a char.  */
+#undef SIZEOF_CHAR
+
+/* The number of bytes in a int.  */
+#undef SIZEOF_INT
+
+/* The number of bytes in a long.  */
+#undef SIZEOF_LONG
+
+/* The number of bytes in a long long.  */
+#undef SIZEOF_LONG_LONG
+
+/* The number of bytes in a short.  */
+#undef SIZEOF_SHORT
+
+/* Define if you have the <dlfcn.h> header file.  */
+#undef HAVE_DLFCN_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
diff --git a/src/stamp-h b/src/stamp-h
new file mode 100644 (file)
index 0000000..9788f70
--- /dev/null
@@ -0,0 +1 @@
+timestamp
diff --git a/src/stamp-h.in b/src/stamp-h.in
new file mode 100644 (file)
index 0000000..9788f70
--- /dev/null
@@ -0,0 +1 @@
+timestamp