From: johan Date: Sun, 16 Feb 2003 17:53:13 +0000 (+0000) Subject: added autoconf tools for library (src) and C++ test (Test) compilation X-Git-Tag: April2003~43 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=5581a576a5749e2335205ece834b92afad111ad8;p=gdcm.git added autoconf tools for library (src) and C++ test (Test) compilation --- diff --git a/.cvsignore b/.cvsignore index e69de29b..b1a0530f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -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 67f032ae..93ffa792 100644 --- 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 index 00000000..93175fdc --- /dev/null +++ b/Makefile.am @@ -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"` diff --git a/Testing/.cvsignore b/Testing/.cvsignore index 9daeafb9..2cad7ce3 100644 --- a/Testing/.cvsignore +++ b/Testing/.cvsignore @@ -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 index 00000000..3671df0b --- /dev/null +++ b/autogen.sh @@ -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 index 00000000..75710ec1 --- /dev/null +++ b/configure.in @@ -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]) diff --git a/src/.cvsignore b/src/.cvsignore index 9d22eb46..4727c1b0 100644 --- a/src/.cvsignore +++ b/src/.cvsignore @@ -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 index bd17a737..00000000 --- a/src/Makefile +++ /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 index 00000000..cf5612db --- /dev/null +++ b/src/Makefile.am @@ -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 index 00000000..67e1b84e --- /dev/null +++ b/src/config.h @@ -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 doesn't define. */ +/* #undef size_t */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if your 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 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 index 00000000..552bf6bc --- /dev/null +++ b/src/config.h.in @@ -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 doesn't define. */ +#undef size_t + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if your 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 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 index 00000000..9788f702 --- /dev/null +++ b/src/stamp-h @@ -0,0 +1 @@ +timestamp diff --git a/src/stamp-h.in b/src/stamp-h.in new file mode 100644 index 00000000..9788f702 --- /dev/null +++ b/src/stamp-h.in @@ -0,0 +1 @@ +timestamp