dnl Process this file with autoconf to produce a configure script. AC_INIT(dcmtk, 3.6.2, [bugs@dcmtk.org], [dcmtk-3.6.2], [http://www.dcmtk.org/]) AC_PREREQ(2.60) AC_CONFIG_SRCDIR(Makefile.in) AC_CONFIG_HEADER(include/dcmtk/config/osconfig.h) m4_include([stdcxx.m4]) dnl ------------------------------------------------------- dnl Additional Package Information dnl ------------------------------------------------------- PACKAGE_VERSION_NUMBER=362 PACKAGE_VERSION_SUFFIX="" PACKAGE_DATE="2017-07-14" AC_DEFINE_UNQUOTED(PACKAGE_VERSION_NUMBER,${PACKAGE_VERSION_NUMBER},[Define to the version number of this package.]) AC_DEFINE_UNQUOTED(PACKAGE_VERSION_SUFFIX,"${PACKAGE_VERSION_SUFFIX}",[Define to the version suffix of this package.]) AC_DEFINE_UNQUOTED(PACKAGE_DATE,"${PACKAGE_DATE}",[Define to the release date of this package.]) AC_SUBST(PACKAGE_VERSION_NUMBER) AC_SUBST(PACKAGE_VERSION_SUFFIX) AC_SUBST(PACKAGE_DATE) dnl ------------------------------------------------------- dnl Identify the host platform we're compiling for, dnl using config.guess and config.sub. dnl ------------------------------------------------------- AC_CANONICAL_HOST AC_DEFINE_UNQUOTED(CANONICAL_HOST_TYPE, "${host}", [Define the canonical host system type as a string constant.]) case "${host}" in *-*-cygwin) BINEXT=".exe" ;; *-*-mingw32) BINEXT=".exe" ;; *) BINEXT="" ;; esac dnl ------------------------------------------------------- dnl Configuration Utilities dnl ------------------------------------------------------- if test "x$prefix" = xNONE ; then AC_DEFINE_UNQUOTED(DCMTK_PREFIX, "${ac_default_prefix}", [Define the DCMTK default path.]) else AC_DEFINE_UNQUOTED(DCMTK_PREFIX, "${prefix}", [Define the DCMTK default path.]) fi DATA_DIR="${datadir}" DATA_DIR=`( test "$prefix" = NONE && prefix=${ac_default_prefix} test "$exec_prefix" = NONE && exec_prefix=${prefix} eval eval echo "$DATA_DIR" )` AC_DEFINE_UNQUOTED(DCM_DICT_DEFAULT_PATH, "${DATA_DIR}/dicom.dic", [Define the default data dictionary path for the dcmdata library package.]) AC_DEFINE_UNQUOTED(DEFAULT_SUPPORT_DATA_DIR, "${DATA_DIR}/", [Define the default directory where support data files reside.]) CONF_DIR="${sysconfdir}" CONF_DIR=`( test "$prefix" = NONE && prefix=${ac_default_prefix} test "$exec_prefix" = NONE && exec_prefix=${prefix} eval echo "$CONF_DIR" )` AC_DEFINE_UNQUOTED(DEFAULT_CONFIGURATION_DIR, "${CONF_DIR}/", [Define the default directory where configuration files reside.]) AH_VERBATIM([PATH_SEPARATOR], [/* Define path separator. */ #define PATH_SEPARATOR '/']) AH_VERBATIM([ENVIRONMENT_PATH_SEPARATOR], [/* Define the environment variable path separator. */ #ifndef ENVIRONMENT_PATH_SEPARATOR #define ENVIRONMENT_PATH_SEPARATOR ':' #endif]) AH_VERBATIM([HAVE_EMPTY_ARGC_ARGV], [/* Define if your system cannot pass command line arguments into main() (e.g. Macintosh). */ /* #undef HAVE_EMPTY_ARGC_ARGV */]) AH_TOP([#ifndef OSCONFIG_H #define OSCONFIG_H /* ** Define enclosures for include files with C linkage (mostly system headers) */ #ifdef __cplusplus #define BEGIN_EXTERN_C extern "C" { #define END_EXTERN_C } #else #define BEGIN_EXTERN_C #define END_EXTERN_C #endif /* MinGW needs some special handling because it is a mixture of WIN32 and Posix. * The following settings are not tested by configure but need to be set for MinGW. */ #ifdef __MINGW32__ #define HAVE_WINDOWS_H 1 #define HAVE_WINSOCK_H 1 #define ENVIRONMENT_PATH_SEPARATOR ';' #endif]) AH_BOTTOM([#if defined(HAVE_CXX11) && defined(__cplusplus) && __cplusplus < 201103L #error\ DCMTK was configured to use C++11 features, but your compiler does not or was not configured to provide them. #endif #endif /* OSCONFIG_H */]) dnl Include general file sinclude(general.m4)dnl AC_CONFIG_AUX_DIR([.]) dnl Checks for programs. AC_PROG_INSTALL AC_PROG_CC AC_PROG_CPP AC_CHECK_PROGS(CXX, $CCC c++ cc++ g++ gcc CC cxx, gcc) pedantic="" if test -f /bin/uname ; then os=`uname -s` rev=`uname -r` if test \( "$os" = SunOS \) ; then case "$rev" in # only use the -pedantic compiler option on # Solaris 2 machines. 5.*) pedantic="-pedantic" ;; esac fi fi if test "${CXXFLAGS}set" = set ; then case "$CXX" in c++|g++|gcc) CXXFLAGS="-Wall $pedantic" CFLAGS="-Wall $pedantic" ;; cc++) CXXFLAGS="-Wall" CFLAGS="-Wall" ;; *) CXXFLAGS="" CFLAGS="" ;; esac fi AC_PROG_CXXCPP dnl The next test is equivalent to AC_PROG_RANLIB dnl Do not use AC_PROG_RANLIB because this produces dnl an error on LINUX-systems in the configure script AC_CHECK_PROGS(RANLIB, ranlib, :) dnl Check for "ar" and "libtool". On certain systems, e.g. NeXTStep, we must dnl prefer "libtool" over "ar" if both are present. However, we don't use dnl GNU libtool at the moment which is something completely different dnl (not an "ar" replacement). AC_CHECK_PROGS(AR, ar, :) AC_CHECK_PROGS(LIBTOOL, libtool, :) if test "${LIBTOOL}set" = libtoolset ; then AC_CHECK_GNU_LIBTOOL if test $ac_cv_check_gnu_libtool = yes ; then : else AR=$LIBTOOL fi fi case "$AR" in libtool) ARFLAGS=-o ;; ar) ARFLAGS=cruv ;; esac if test "${LIBEXT}set" = set ; then LIBEXT="a" fi AC_SUBST(ARFLAGS) AC_SUBST(LIBEXT) AC_SUBST(BINEXT) # Try to find a strip utility AC_CHECK_PROGS(STRIP, strip, :) dnl ------------------------------------------------------- dnl Check special systems dnl ------------------------------------------------------- AC_AIX AC_ISC_POSIX AC_SYS_LONG_FILE_NAMES dnl ------------------------------------------------------- dnl Perform some tests with the C compiler, needed for dcmjpeg dnl ------------------------------------------------------- AC_MY_C_INLINE AC_MY_C_CONST AC_MY_C_CHAR_UNSIGNED AC_MY_C_RIGHTSHIFT_UNSIGNED dnl ------------------------------------------------------- dnl Check some typedefs versus definitions in , dnl needed for JasPer support dnl ------------------------------------------------------- AC_TYPEDEF(uchar, unsigned char) AC_TYPEDEF(ushort, unsigned short) AC_TYPEDEF(uint, unsigned int) AC_TYPEDEF(ulong, unsigned long) AC_CHECK_TYPES(longlong) AC_CHECK_TYPES(ulonglong) AC_CHECK_TYPES(long long) AC_CHECK_TYPES(unsigned long long) CHECK_VLA dnl File access stuff AC_CHECK_TYPES(fpos64_t) AC_CHECK_TYPES(off64_t) dnl stdbool.h and stdint.h are only defined in ANSI C, not in C++ AC_CHECK_HEADERS(stdbool.h) AC_CHECK_HEADERS(stdint.h) AC_CHECK_HEADERS(cstdint) AC_CHECK_TYPES(int64_t) AC_CHECK_TYPES(uint64_t) AC_CHECK_TYPES([sigjmp_buf], [], [], [[#include ]]) dnl ------------------------------------------------------- dnl Checks for libc library functions. dnl ------------------------------------------------------- AC_FUNC_MEMCMP AC_FUNC_VPRINTF AC_TYPE_SIGNAL AC_FUNC_WAIT3 AC_CHECK_FUNCS(gethostname gethostid socket sysinfo) AC_CHECK_FUNCS(strchr strstr strtoul itoa) AC_CHECK_FUNCS(memcpy memset memmove memcmp bcopy bcmp) AC_CHECK_FUNCS(getpid mktemp tempnam tmpnam getenv mkstemp) AC_CHECK_FUNCS(stat) AC_CHECK_FUNCS(malloc_debug) AC_CHECK_FUNCS(strerror strdup bzero index rindex access) AC_CHECK_FUNCS(uname cuserid getlogin getlogin_r) AC_CHECK_FUNCS(usleep) AC_CHECK_FUNCS(flock lockf) AC_CHECK_FUNCS(listen connect setsockopt getsockopt select) AC_CHECK_FUNCS(gethostbyname gethostbyname_r) AC_CHECK_FUNCS(gethostbyaddr_r getgrnam_r getpwnam_r) AC_CHECK_FUNCS(bind accept getsockname getaddrinfo) AC_CHECK_FUNCS(waitpid) AC_CHECK_FUNCS(getuid geteuid setuid getpwnam getgrnam) AC_CHECK_FUNCS(sleep fork) AC_CHECK_FUNCS(_findfirst) AC_CHECK_FUNCS(strlcpy strlcat) AC_CHECK_FUNCS(vsnprintf) AC_CHECK_FUNCS(mbstowcs wcstombs) AC_CHECK_FUNCS(popen pclose) AC_CHECK_FUNCS(readdir_r) AC_FUNC_FSEEKO dnl ------------------------------------------------------- dnl Checks for libcs library functions needed by oflog dnl ------------------------------------------------------- AC_DEFUN([TYPE_SOCKLEN_T], [ AH_TEMPLATE([socklen_t], [Define to int if undefined.]) AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[socklen_t len = 42; return 0;]])],[ac_cv_type_socklen_t=yes],[ac_cv_type_socklen_t=no]) ]) if test $ac_cv_type_socklen_t != yes; then AC_DEFINE(socklen_t, int) fi ]) AC_CHECK_FUNCS(ftime gmtime_r localtime_r lstat nanosleep fcntl) AC_CHECK_FUNCS(htons htonl ntohs ntohl) AC_CHECK_HEADERS(netinet/in.h) AC_CHECK_HEADERS(syslog.h) TYPE_SOCKLEN_T AH_TEMPLATE([HAVE_ENAMETOOLONG]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([#include ], [int value = ENAMETOOLONG;])], [AC_DEFINE([HAVE_ENAMETOOLONG], , [Define if your system provides ENAMETOOLONG errno value.])]) dnl ------------------------------------------------------- dnl Checks for libm library functions. dnl ------------------------------------------------------- SAVELIBS="$LIBS" LIBS="$LIBS -lm" AC_CHECK_FUNCS(finite isinf isnan) LIBS="$SAVELIBS" dnl ------------------------------------------------------- dnl Perform remaining tests with C++ compiler dnl ------------------------------------------------------- AC_LANG(C++) AC_CXX_CONST_CAST AC_CXX_DYNAMIC_CAST AC_CXX_REINTERPRET_CAST AC_CXX_STATIC_CAST AC_CXX_STD_NOTHROW AC_CXX_NOTHROW_DELETE dnl ------------------------------------------------------- dnl Check for Debug Mode dnl ------------------------------------------------------- DEBUG="-DNDEBUG" DEBUGCXXFLAGS= DEBUGCFLAGS= AC_MSG_CHECKING(whether to compile in debug mode) AC_ARG_ENABLE(debug, [ --enable-debug compile with debug code, don't optimize --disable-debug compile without debug code (default)], [ case "$enableval" in yes) AC_MSG_RESULT(yes) DEBUGCXXFLAGS="-g" DEBUGCFLAGS="-g" DEBUG="-DDEBUG" ;; *) AC_MSG_RESULT(no) DEBUGCXXFLAGS="-O" DEBUGCFLAGS="-O" ;; esac ], AC_MSG_RESULT(no) DEBUGCXXFLAGS="-O" DEBUGCFLAGS="-O" ) dnl ------------------------------------------------------- dnl Check for thread support dnl ------------------------------------------------------- THREADSUPPORT="auto" AC_MSG_CHECKING(whether to enable thread support) AC_ARG_ENABLE(threads, [ --enable-threads=TYPE compile with MT support (posix/solaris/auto=default) --disable-threads compile without MT support], [ case "$enableval" in yes|auto) AC_MSG_RESULT(automatic detection) ;; posix) AC_MSG_RESULT([yes, type=posix]) THREADSUPPORT="posix" ;; solaris) AC_MSG_RESULT([yes, type=solaris]) THREADSUPPORT="solaris" ;; no) AC_MSG_RESULT(no) THREADSUPPORT="no" ;; *) AC_MSG_RESULT([yes - type $enableval is unknown - using automatic detection]) ;; esac ], AC_MSG_RESULT(automatic detection) ) dnl ------------------------------------------------------- dnl Check for large file support dnl ------------------------------------------------------- LFSSUPPORT="auto" AC_MSG_CHECKING(whether to enable large file support) AC_ARG_ENABLE(lfs, [ --enable-lfs=TYPE compile with LFS support (lfs/lfs64/auto=default) --disable-lfs compile without LFS support], [ case "$enableval" in yes|auto) AC_MSG_RESULT(automatic detection) ;; lfs) AC_MSG_RESULT([yes, type=LFS]) LFSSUPPORT="lfs" ;; lfs64) AC_MSG_RESULT([yes, type=LFS64]) LFSSUPPORT="lfs64" ;; no) AC_MSG_RESULT(no) LFSSUPPORT="no" ;; *) AC_MSG_RESULT([yes - type $enableval is unknown - using automatic detection]) ;; esac ], AC_MSG_RESULT(automatic detection) ) dnl ------------------------------------------------------- dnl Checks for libraries. dnl ------------------------------------------------------- AC_CHECK_GXXLIB AC_CHECK_LIB(iostream, main) dnl Some C++ compilers have problems with recursive main calls dnl (e.g. Sun C++ 4.2). In this case we must test another function dnl to link. AC_CHECK_LIB(nsl, main) if test $ac_cv_lib_nsl_main = no ; then AC_CHECK_LIB(nsl, gethostbyname) fi AC_CHECK_LIB(socket, main) if test $ac_cv_lib_socket_main = no ; then AC_CHECK_LIB(socket, socket) fi dnl Some newer versions of OpenSSL must be linked against libdl. dnl We just check whether libdl exists and in this case always dnl add -ldl to OPENSSLLIBS. dnl OPENSSLLIBS="" AC_CHECK_LIB(dl, main,[ OPENSSLLIBS="-ldl" ]) if test $ac_cv_lib_dl_main = no ; then AC_CHECK_LIB(dl, dlopen,[ OPENSSLLIBS="-ldl" ]) fi MATHLIBS="" AC_CHECK_LIB(m, main,[ MATHLIBS="-lm" ]) if test $ac_cv_lib_m_main = no ; then AC_CHECK_LIB(m, sin,[ MATHLIBS="-lm" ]) fi dnl On MinGW we have to link against the winsock32 library dnl AC_CHECK_LIB(wsock32, main,[ LIBS="$LIBS -lwsock32" ]) dnl On MinGW we have to link against the netapi32 library dnl AC_CHECK_LIB(netapi32, main,[ LIBS="$LIBS -lnetapi32" ]) dnl ------------------------------------------------------- dnl Checks for header files. dnl ------------------------------------------------------- AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_DIRENT AC_CHECK_TCP_H AC_CHECK_HEADERS(alloca.h) AC_CHECK_HEADERS(arpa/inet.h) AC_CHECK_HEADERS(assert.h) AC_CHECK_HEADERS(ctype.h) AC_CHECK_HEADERS(errno.h) AC_CHECK_HEADERS(fcntl.h) AC_CHECK_HEADERS(float.h) AC_CHECK_HEADERS(fnmatch.h) AC_CHECK_HEADERS(fstream) AC_CHECK_HEADERS(fstream.h) AC_CHECK_HEADERS(grp.h) AC_CHECK_HEADERS(ieeefp.h) AC_CHECK_HEADERS(io.h) AC_CHECK_HEADERS(iomanip) AC_CHECK_HEADERS(iomanip.h) AC_CHECK_HEADERS(iostream) AC_CHECK_HEADERS(iostream.h) AC_CHECK_HEADERS(iso646.h) AC_CHECK_HEADERS(libc.h) AC_CHECK_HEADERS(limits.h) AC_CHECK_HEADERS(climits) AC_CHECK_HEADERS(locale.h) AC_CHECK_HEADERS(malloc.h) AC_CHECK_HEADERS(math.h) AC_CHECK_HEADERS(cmath) AC_CHECK_HEADERS(new) AC_CHECK_HEADERS(new.h) AC_CHECK_HEADERS(netdb.h) AC_CHECK_HEADERS(pthread.h) AC_CHECK_HEADERS(pwd.h) AC_CHECK_HEADERS(semaphore.h) AC_CHECK_HEADERS(setjmp.h) AC_CHECK_HEADERS(signal.h) AC_CHECK_HEADERS(sstream) AC_CHECK_HEADERS(sstream.h) AC_CHECK_HEADERS(stat.h) AC_CHECK_HEADERS(cstdarg) AC_CHECK_HEADERS(stdarg.h) AC_CHECK_HEADERS(stddef.h) AC_CHECK_HEADERS(cstddef) AC_CHECK_HEADERS(cstdio) AC_CHECK_HEADERS(stdio.h) AC_CHECK_HEADERS(stdint.h) AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(string.h) AC_CHECK_HEADERS(strings.h) AC_CHECK_HEADERS(strstrea.h) AC_CHECK_HEADERS(strstream) AC_CHECK_HEADERS(strstream.h) AC_CHECK_HEADERS(synch.h) AC_CHECK_HEADERS(sys/errno.h) AC_CHECK_HEADERS(sys/file.h) AC_CHECK_HEADERS(sys/param.h) AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/select.h) AC_CHECK_HEADERS(sys/socket.h) AC_CHECK_HEADERS(sys/stat.h) AC_CHECK_HEADERS(sys/syscall.h) AC_CHECK_HEADERS(sys/systeminfo.h) AC_CHECK_HEADERS(sys/time.h) AC_CHECK_HEADERS(sys/timeb.h) AC_CHECK_HEADERS(sys/types.h) AC_CHECK_HEADERS(sys/utime.h) AC_CHECK_HEADERS(sys/utsname.h) AC_CHECK_HEADERS(thread.h) AC_CHECK_HEADERS(time.h) AC_CHECK_HEADERS(unistd.h) AC_CHECK_HEADERS(unix.h) AC_CHECK_HEADERS(utime.h) AC_CHECK_HEADERS(wchar.h) AC_CHECK_HEADERS(wctype.h) AC_CHECK_HEADERS(fenv.h) if test $ac_cv_header_libc_h = yes ; then if test $ac_cv_header_math_h = yes ; then AC_CXX_LIBC_H_EXTERN_C fi fi dnl ------------------------------------------------------- dnl Tests for pointer vs. integer types dnl These tests REQUIRE as a prerequisite AC_CXX_STATIC_CAST dnl ------------------------------------------------------- if test $ac_cv_header_pthread_h = yes ; then AC_CHECK_POINTER_TYPE(pthread_t, pthread.h) fi dnl ------------------------------------------------------- dnl Check for thread support dnl ------------------------------------------------------- dnl dnl in auto mode, check whether we use solaris or posix threads dnl if test $THREADSUPPORT = auto ; then if test $ac_cv_header_synch_h = yes ; then THREADSUPPORT="solaris" fi fi if test $THREADSUPPORT = auto ; then if test $ac_cv_header_pthread_h = yes ; then THREADSUPPORT="posix" fi fi if test $THREADSUPPORT = auto ; then THREADSUPPORT="no" fi dnl dnl in solaris mode, check for -lthread dnl if test $THREADSUPPORT = solaris ; then AC_CHECK_LIB(thread, sema_init, [ ac_tr_lib=HAVE_LIBTHREAD AC_DEFINE_UNQUOTED($ac_tr_lib) LIBS="-lthread $LIBS" ]) fi if test $THREADSUPPORT = posix ; then dnl dnl check Posix MT libraries -lrt and -lpthread dnl OSF/1 re-#defines most of the pthread function names. dnl This is why we use pthread_key_create for the test. dnl AC_CHECK_LIB(pthread, pthread_key_create, [ ac_tr_lib=HAVE_LIBPTHREAD AC_DEFINE_UNQUOTED($ac_tr_lib) LIBS="-lpthread $LIBS" ]) AC_CHECK_LIB(rt, sem_init, [ ac_tr_lib=HAVE_LIBRT AC_DEFINE_UNQUOTED($ac_tr_lib) LIBS="-lrt $LIBS" ], , $LIBS ) dnl dnl check whether the compiler required the -pthread option dnl to correctly link code containing posix thread calls. dnl This is true on FreeBSD. dnl AC_CHECK_PTHREAD_OPTION dnl dnl check whether Posix read/write locks are available dnl POSIXRWLOCKSAVAILABLE="no" AC_CHECK_LIB(pthread, pthread_rwlock_init, [ AC_DEFINE(HAVE_PTHREAD_RWLOCK, , [Define if your system supports POSIX read/write locks.]) dnl dnl we're going to use POSIX threads with read/write locks. dnl Linux 2.2.x only declares all prototypes if _XOPEN_SOURCE=500 and _BSD_SOURCE dnl OSF/1 requires _XOPEN_SOURCE=500, _XOPEN_SOURCE_EXTENDED, _OSF_SOURCE and _POSIX_C_SOURCE=199506L dnl Irix 6.x does not like _XOPEN_SOURCE=500 and _POSIX_C_SOURCE=199506L dnl POSIXRWLOCKSAVAILABLE="yes" case "${host}" in mips-sgi-irix6*) CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CFLAGS" ;; *-*-openbsd3*) CXXFLAGS="-D_POSIX_C_SOURCE=199506L $CXXFLAGS" CFLAGS="-D_POSIX_C_SOURCE=199506L $CFLAGS" ;; *-*-openbsd4*) ;; *-*-openbsd5*) ;; *-*-freebsd*) ;; *-*-netbsdelf2*) ;; *-*-netbsd*) CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CFLAGS" ;; *-*-darwin*) dnl On Mac OS X we need to have _DARWIN_C_SOURCE defined to enable UNIX standard API for system headers CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" ;; *) CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CXXFLAGS" CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CFLAGS" ;; esac ], [ dnl dnl We did not find pthread_rwlock_init in libpthread. Maybe it is somewhere else, e.g. in libc_r on FreeBSD. dnl We give it another try by just linking against the default libraries. dnl AC_MSG_CHECKING(for pthread_rwlock_init in default libraries) AC_TRY_LINK([extern "C" int pthread_rwlock_init(void *rwlock, void *attr); ] , [(void) pthread_rwlock_init(NULL, NULL);], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PTHREAD_RWLOCK, , [Define if your system supports POSIX read/write locks.]) dnl dnl we're going to use POSIX threads with read/write locks. dnl Linux 2.2.x only declares all prototypes if _XOPEN_SOURCE=500 and _BSD_SOURCE dnl OSF/1 requires _XOPEN_SOURCE=500, _XOPEN_SOURCE_EXTENDED, _OSF_SOURCE and _POSIX_C_SOURCE=199506L dnl Irix 6.x does not like _XOPEN_SOURCE=500 and _POSIX_C_SOURCE=199506L dnl POSIXRWLOCKSAVAILABLE="yes" case "${host}" in mips-sgi-irix6*) CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT $CFLAGS" ;; *-*-openbsd3*) CXXFLAGS="-D_POSIX_C_SOURCE=199506L $CXXFLAGS" CFLAGS="-D_POSIX_C_SOURCE=199506L $CFLAGS" ;; *-*-openbsd4*) ;; *-*-openbsd5*) ;; *-*-freebsd*) ;; *-*-netbsdelf2*) ;; *-*-netbsd*) CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CXXFLAGS" CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_NETBSD_SOURCE -D_BSD_COMPAT $CFLAGS" ;; *-*-darwin*) dnl On Mac OS X we need to have _DARWIN_C_SOURCE source defined to enable UNIX standard API for system headers CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS" ;; *) CXXFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CXXFLAGS" CFLAGS="-D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L $CFLAGS" ;; esac ], AC_MSG_RESULT(no)) ] ) fi AC_MSG_CHECKING(multi-thread support) case "$THREADSUPPORT" in solaris) AC_MSG_RESULT([yes, solaris threads]) CXXFLAGS="-D_REENTRANT $CXXFLAGS" CFLAGS="-D_REENTRANT $CFLAGS" AC_DEFINE(WITH_THREADS, , [Define if we are compiling with any type of multi-thread support.]) ;; posix) if test $POSIXRWLOCKSAVAILABLE = yes ; then AC_MSG_RESULT([yes, posix threads with rwlock]) else AC_MSG_RESULT([yes, posix threads without rwlock]) fi CXXFLAGS="-D_REENTRANT $CXXFLAGS" CFLAGS="-D_REENTRANT $CFLAGS" AC_DEFINE(WITH_THREADS, , [Define if we are compiling with any type of multi-thread support.]) ;; *) AC_MSG_RESULT(none) ;; esac dnl ------------------------------------------------------- dnl Check for LFS support dnl ------------------------------------------------------- if test $LFSSUPPORT = auto -o $LFSSUPPORT = lfs64; then AC_LFS64 if test $ac_cv_lfs64_support = yes ; then LFSSUPPORT="lfs64" fi fi if test $LFSSUPPORT = auto -o $LFSSUPPORT = lfs; then MY_AC_SYS_LARGEFILE fi dnl ------------------------------------------------------- dnl Checks for typedefs, structures, and compiler characteristics. dnl ------------------------------------------------------- AC_TYPEDEF(size_t, unsigned) AC_TYPEDEF(ssize_t, long) AC_TYPEDEF(pid_t, int) AC_C_CHAR_UNSIGNED AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(float) AC_CHECK_SIZEOF(double) AC_CHECK_SIZEOF(void *) AC_STRUCT_TM AC_MY_SYMBOL_EXISTS([__FUNCTION__]) AC_MY_SYMBOL_EXISTS([__PRETTY_FUNCTION__]) AC_MY_SYMBOL_EXISTS([__func__]) dnl ------------------------------------------------------- dnl Checks for prototypes dnl ------------------------------------------------------- dnl dnl The following AC_CHECK_* macros _must_ have corresponding entries in dnl the acconfig.h file. This is because the macros are specific to the dnl DCMTK project and are not supported by GNU autoheader. AC_CHECK_PROTOTYPE(feenableexcept, fenv.h) AC_CHECK_PROTOTYPE(_stricmp, string.h) AC_CHECK_PROTOTYPE(accept, sys/types.h sys/socket.h) if test $ac_cv_prototype_accept = yes ; then AC_CHECK_INTP_ACCEPT(sys/types.h sys/socket.h) fi AC_CHECK_PROTOTYPE(bind, sys/types.h sys/socket.h) AC_CHECK_PROTOTYPE(bzero, string.h strings.h libc.h unistd.h stdlib.h) AC_CHECK_PROTOTYPE(connect, sys/types.h sys/socket.h) AC_CHECK_PROTOTYPE(finite, math.h) AC_CHECK_PROTOTYPE(isinf, math.h) AC_CHECK_PROTOTYPE(isnan, math.h) AC_CHECK_PROTOTYPE(std::finite, cmath) AC_CHECK_PROTOTYPE(std::isinf, cmath) AC_CHECK_PROTOTYPE(std::isnan, cmath) AC_CHECK_PROTOTYPE(flock, sys/file.h) AC_CHECK_PROTOTYPE(gethostbyname, libc.h unistd.h stdlib.h netdb.h) AC_CHECK_PROTOTYPE(gethostbyname_r, libc.h unistd.h stdlib.h netdb.h) AC_CHECK_PROTOTYPE(gethostbyaddr_r, libc.h unistd.h stdlib.h netdb.h) AC_CHECK_PROTOTYPE(gethostid, libc.h unistd.h stdlib.h netdb.h) AC_CHECK_PROTOTYPE(gethostname, unistd.h libc.h stdlib.h netdb.h) AC_CHECK_PROTOTYPE(getsockname, sys/types.h sys/socket.h) AC_CHECK_PROTOTYPE(getsockopt, sys/types.h sys/socket.h) AC_CHECK_PROTOTYPE(strerror_r, string.h) if test $ac_cv_prototype_strerror_r = yes ; then AC_CHECK_CHARP_STRERROR_R(string.h) fi if test $ac_cv_prototype_getsockopt = yes ; then AC_CHECK_INTP_GETSOCKOPT(sys/types.h sys/socket.h) fi AC_CHECK_PROTOTYPE(gettimeofday, sys/time.h unistd.h) AC_CHECK_PROTOTYPE(listen, sys/types.h sys/socket.h) AC_CHECK_PROTOTYPE(mktemp, libc.h unistd.h stdlib.h) AC_CHECK_PROTOTYPE(mkstemp, libc.h unistd.h stdlib.h) AC_CHECK_PROTOTYPE(select, sys/select.h sys/types.h sys/socket.h sys/time.h) if test $ac_cv_prototype_select = yes ; then AC_CHECK_INTP_SELECT(sys/select.h sys/types.h sys/socket.h sys/time.h) fi AC_CHECK_PROTOTYPE(setsockopt, sys/types.h sys/socket.h) AC_CHECK_PROTOTYPE(socket, sys/types.h sys/socket.h) AC_CHECK_PROTOTYPE(strcasecmp, string.h) AC_CHECK_PROTOTYPE(strncasecmp, string.h) AC_CHECK_PROTOTYPE(usleep, libc.h unistd.h stdlib.h) AC_CHECK_PROTOTYPE(vsnprintf, stdio.h stdarg.h) AC_CHECK_PROTOTYPE(wait3, libc.h sys/wait.h sys/time.h sys/resource.h) AC_CHECK_PROTOTYPE(waitpid, sys/wait.h sys/time.h sys/resource.h) AC_CHECK_DECLARATION(struct utimbuf, sys/types.h utime.h sys/utime.h) AC_CHECK_DECLARATION(socklen_t, sys/types.h sys/socket.h) AC_CHECK_OLD_READDIR_R AC_CHECK_ELLIPSE_SIGNAL_HANDLER(signal.h) if test $ac_cv_header_math_h = yes ; then AC_INCLUDE_MATH_H_AS_CXX fi dnl ------------------------------------------------------- dnl Checks for the usage of standard C++ headers. dnl ------------------------------------------------------- AC_MSG_CHECKING(whether to use C++ standard includes) ac_use_std_includes="auto" AC_ARG_ENABLE(std-includes, [ --enable-std-includes use C++ ANSI standard includes (default: auto) --disable-std-includes use old C++ includes ], [ case "$enableval" in yes) ac_use_std_includes="yes" ;; *) ac_use_std_includes="no" ;; esac ] ) if test "$ac_cv_header_fstream" = "yes" -a "$ac_cv_header_iostream" = "yes" -a "$ac_cv_header_iomanip" = "yes"; then ac_have_std_includes="yes" else ac_have_std_includes="no" fi if test "$ac_cv_header_fstream_h" = "yes" -a "$ac_cv_header_iostream_h" = "yes" -a "$ac_cv_header_iomanip_h" = "yes"; then ac_have_old_includes="yes" else ac_have_old_includes="no" fi if test "$ac_use_std_includes" = "yes"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_STD_CXX_INCLUDES, , [Define if ANSI standard C++ includes are used.]) elif test "$ac_use_std_includes" = "no"; then AC_MSG_RESULT(no) elif test "$ac_have_std_includes" = "yes"; then AC_MSG_RESULT(yes) AC_DEFINE(USE_STD_CXX_INCLUDES, , [Define if ANSI standard C++ includes are used.]) ac_use_std_includes="yes" else AC_MSG_RESULT(no) ac_use_std_includes="no" fi if test "$ac_use_std_includes" = "yes"; then AC_CHECK_STD_NAMESPACE AC_CHECK_DECLARATION(std::ios_base::openmode, , iostream) AC_CHECK_IOS_NOCREATE(std::ios, fstream) AC_CHECK_COMPILES(std::vfprintf, cstdarg cstdio, [FILE *stream; va_list ap; std::vfprintf(stream, "", ap);]) AC_CHECK_COMPILES(std::vsnprintf, cstdarg cstdio, [char buf[256]; va_list ap; std::vsnprintf(buf, 0, "", ap);]) else AC_CHECK_DECLARATION(std::ios_base::openmode, , iostream.h) AC_CHECK_IOS_NOCREATE(ios, fstream.h) AC_CHECK_COMPILES(std::vfprintf, stdarg.h stdio.h, [FILE *stream; va_list ap; std::vfprintf(stream, "", ap);]) AC_CHECK_COMPILES(std::vsnprintf, stdarg.h stdio.h, [char buf[256]; va_list ap; std::vsnprintf(buf, 0, "", ap);]) fi AC_CHECK_CLASS_TEMPLATE AC_CHECK_STATIC_TEMPLATE_METHOD AC_CHECK_FUNCTION_TEMPLATE AC_CHECK_EXPLICIT_TEMPLATE_SPECIALIZATION AC_CHECK_CXX_BOOL AC_CHECK_CXX_VOLATILE AC_CXX_TYPENAME AC_STDIO_NAMESPACE dnl ------------------------------------------------------- dnl Check for Private Tag support dnl ------------------------------------------------------- AC_MSG_CHECKING(whether to enable private tag dictionary) AC_ARG_ENABLE(private-tags, [ --enable-private-tags enable private tag dictionary --disable-private-tags don't enable private tag dictionary (default)], [ case "$enableval" in yes) AC_MSG_RESULT(yes) AC_DEFINE(ENABLE_PRIVATE_TAGS, , [Define if we are compiling for enabling external private tag dictionary.]) AC_DEFINE_UNQUOTED(DCM_DICT_DEFAULT_PATH, "${DATA_DIR}/dicom.dic:${DATA_DIR}/private.dic", [Define the default data dictionary path for the dcmdata library package.]) ;; *) AC_MSG_RESULT(no) ;; esac ], AC_MSG_RESULT(no) ) dnl ------------------------------------------------------- dnl Check for External Dictionary support dnl ------------------------------------------------------- AC_MSG_CHECKING(whether to enable loading external dictionary from default path) AC_ARG_ENABLE(external-dict, [ --enable-external-dict enable loading of external dictionary (default) --disable-external-dict don't load external dictionary], [ case "$enableval" in yes) AC_MSG_RESULT(yes) AC_DEFINE(ENABLE_EXTERNAL_DICTIONARY, , [Define if we are compiling for loading external dictionary from default path.]) ;; *) AC_MSG_RESULT(no) dnl Reset default path so the dictionary is not loaded automatically on startup AC_DEFINE_UNQUOTED(DCM_DICT_DEFAULT_PATH, "", [Empty default data dictionary path for the dcmdata library package.]) ;; esac ], AC_MSG_RESULT(yes) AC_DEFINE(ENABLE_EXTERNAL_DICTIONARY, , [Define if we are compiling for loading external dictionary from default path.]) ) dnl ------------------------------------------------------- dnl Check for Built-in (compiled-in) Dictionary support dnl ------------------------------------------------------- AC_MSG_CHECKING(whether to enable built-in dictionary loading) AC_ARG_ENABLE(builtin-dict, [ --enable-builtin-dict enable loading of built-in dictionary --disable-builtin-dict don't load built-in dictionary (default)], [ case "$enableval" in yes) AC_MSG_RESULT(yes) AC_DEFINE(ENABLE_BUILTIN_DICTIONARY, , [Define if we are compiling with built-in (compiled-in) dictionary enabled.]) ;; *) AC_MSG_RESULT(no) ;; esac ], AC_MSG_RESULT(no) ) dnl ------------------------------------------------------- dnl Check for OpenSSL support dnl ------------------------------------------------------- AC_MY_LIB_PATH([openssl], [OpenSSL]) AC_MSG_CHECKING([whether to include OpenSSL support]) AC_ARG_WITH(openssl, [AS_HELP_STRING([--with-openssl], [include OpenSSL support (default: auto)]) AS_HELP_STRING([--without-openssl], [don't include OpenSSL support])], [ case "$withval" in yes) AC_MSG_RESULT(yes) AC_DEFINE(WITH_OPENSSL, , [Define if we are compiling with OpenSSL support.]) OPENSSLLIBS="-lssl -lcrypto $OPENSSLLIBS" ;; *) AC_MSG_RESULT(no) ;; esac ], [ SAVELIBS="$LIBS" LIBS="$LIBS -lssl -lcrypto" AC_TRY_LINK([#include ], [(void) TLSv1_method()], [ AC_MSG_RESULT(yes) AC_DEFINE(WITH_OPENSSL, , [Define if we are compiling with OpenSSL support.]) OPENSSLLIBS="-lssl -lcrypto $OPENSSLLIBS" ], [AC_MSG_RESULT(no)]) LIBS="$SAVELIBS"] ) AC_CHECK_SSL_CTX_GET0_PARAM AC_CHECK_RAND_EGD dnl ------------------------------------------------------- dnl Check for libjpeg, which is needed by libtiff on some platforms dnl ------------------------------------------------------- JPEGLIBS="" AC_CHECK_LIB(jpeg, jpeg_set_defaults,[ JPEGLIBS="-ljpeg" ]) if test $ac_cv_lib_jpeg_jpeg_set_defaults = no ; then AC_CHECK_LIB(jpeg, jSetDefaults,[ JPEGLIBS="-ljpeg" ]) fi dnl ------------------------------------------------------- dnl Check for zlib support dnl ------------------------------------------------------- AC_MY_LIB_PATH([zlib]) ZLIBLIBS="" AC_MSG_CHECKING(whether to include zlib support) AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib], [include zlib support (default: auto)]) AS_HELP_STRING([--without-zlib], [don't include zlib support])], [ case "$withval" in yes) AC_MSG_RESULT(yes) AC_DEFINE(WITH_ZLIB, , [Define if we are compiling with zlib support.]) ZLIBLIBS="-lz" ;; *) AC_MSG_RESULT(no) ;; esac ], [ SAVELIBS="$LIBS" LIBS="$LIBS -lz" AC_TRY_LINK([#include ], [(void) zlibVersion()], [ AC_MSG_RESULT(yes) AC_DEFINE(WITH_ZLIB, , [Define if we are compiling with zlib support.]) ZLIBLIBS="-lz" ], [AC_MSG_RESULT(no)]) LIBS="$SAVELIBS"] ) dnl ------------------------------------------------------- dnl Check for libtiff support dnl ------------------------------------------------------- AC_MY_LIB_PATH([libtiff]) TIFFLIBS="" AC_MSG_CHECKING(whether to include libtiff support) AC_ARG_WITH(libtiff, [AS_HELP_STRING([--with-libtiff], [include libtiff support (default: auto)]) AS_HELP_STRING([--without-libtiff], [don't include libtiff support])], [ case "$withval" in yes) AC_MSG_RESULT(yes) AC_DEFINE(WITH_LIBTIFF, , [Define if we are compiling with libtiff support.]) TIFFLIBS="-ltiff $JPEGLIBS $ZLIBLIBS" SAVELIBS="$LIBS" LIBS="$LIBS -ltiff $JPEGLIBS $ZLIBLIBS" AC_LIBTIFF_LZW_COMPRESSION LIBS="$SAVELIBS" ;; *) AC_MSG_RESULT(no) ;; esac ], [ SAVELIBS="$LIBS" LIBS="$LIBS -ltiff $JPEGLIBS $ZLIBLIBS" AC_TRY_LINK([#include ], [(void) TIFFGetVersion()], [ AC_MSG_RESULT(yes) AC_DEFINE(WITH_LIBTIFF, , [Define if we are compiling with libtiff support.]) TIFFLIBS="-ltiff $JPEGLIBS $ZLIBLIBS" AC_LIBTIFF_LZW_COMPRESSION ], [AC_MSG_RESULT(no)]) LIBS="$SAVELIBS"] ) dnl ------------------------------------------------------- dnl Check for libpng support dnl ------------------------------------------------------- AC_MY_LIB_PATH([libpng]) dnl perform check for only after we have evaluated --with-libpnginc AC_CHECK_HEADERS(libpng/png.h) PNGLIBS="" AC_MSG_CHECKING(whether to include libpng support) AC_ARG_WITH(libpng, [AS_HELP_STRING([--with-libpng], [include libpng support (default: auto)]) AS_HELP_STRING([--without-libpng], [don't include libpng support])], [ case "$withval" in yes) if test "x$ZLIBLIBS" != x; then AC_MSG_RESULT(yes) AC_DEFINE(WITH_LIBPNG, , [Define if we are compiling with libpng support.]) PNGLIBS="-lpng" else AC_MSG_RESULT(no because libpng requires zlib) fi ;; *) AC_MSG_RESULT(no) ;; esac ], [ if test "x$ZLIBLIBS" != x; then SAVELIBS="$LIBS" LIBS="$LIBS -lpng $ZLIBLIBS" AC_TRY_LINK([#ifdef HAVE_LIBPNG_PNG_H #include #else #include #endif], [(void) png_access_version_number()], [ AC_MSG_RESULT(yes) AC_DEFINE(WITH_LIBPNG, , [Define if we are compiling with libpng support.]) PNGLIBS="-lpng" ], [AC_MSG_RESULT(no)]) LIBS="$SAVELIBS" else AC_MSG_RESULT(no because libpng requires zlib) fi ] ) dnl ------------------------------------------------------- dnl Check for libxml support dnl ------------------------------------------------------- AC_MY_LIB_PATH([libxml]) LIBXMLCFLAGS=`xml2-config --cflags 2>/dev/null` if test "${LIBXMLCFLAGS+set}" = set; then CXXFLAGS="$LIBXMLCFLAGS $CXXFLAGS" CFLAGS="$LIBXMLCFLAGS $CFLAGS" fi LIBXMLLIBS=`xml2-config --libs 2>/dev/null` XMLLIBS="" AC_MSG_CHECKING(whether to include libxml support) AC_ARG_WITH(libxml, [AS_HELP_STRING([--with-libxml], [include libxml support (default: auto)]) AS_HELP_STRING([--without-libxml], [don't include libxml support])], [ case "$withval" in yes) AC_MSG_RESULT(yes) AC_DEFINE(WITH_LIBXML, , [Define if we are compiling with libxml support.]) XMLLIBS=$LIBXMLLIBS ;; *) AC_MSG_RESULT(no) ;; esac ], [ SAVELIBS="$LIBS" LIBS="$LIBS $LIBXMLLIBS" AC_TRY_LINK([#include ], [(void) xmlInitParser()], [ AC_MSG_RESULT(yes) AC_DEFINE(WITH_LIBXML, , [Define if we are compiling with libxml support.]) XMLLIBS=$LIBXMLLIBS ], [AC_MSG_RESULT(no)]) LIBS="$SAVELIBS"] ) dnl ------------------------------------------------------- dnl Check for libwrap (TCP wrapper) support dnl ------------------------------------------------------- AC_MY_LIB_PATH([libwrap]) TCPWRAPPERLIBS="" AC_MSG_CHECKING(whether to include libwrap support) AC_ARG_WITH(libwrap, [AS_HELP_STRING([--with-libwrap], [include libwrap support (default: auto)]) AS_HELP_STRING([--without-libwrap], [don't include libwrap support])], [ case "$withval" in yes) AC_MSG_RESULT(yes) AC_DEFINE(WITH_TCPWRAPPER, , [Define if we are compiling with libwrap (TCP wrapper) support.]) TCPWRAPPERLIBS="-lwrap" ;; *) AC_MSG_RESULT(no) ;; esac ], [ SAVELIBS="$LIBS" LIBS="-lwrap $LIBS" AC_TRY_LINK( [#ifdef __cplusplus extern "C" { #endif #ifdef HAVE_STDIO_H /* on some platforms, tcpd.h needs stdio.h */ #include #endif #ifdef HAVE_SYS_TYPES_H /* on some platforms, tcpd.h needs sys/types.h */ #include #endif #include #ifdef __cplusplus } #endif int deny_severity = 0; int allow_severity = 0;], [struct request_info r; (void) hosts_access(&r)], [ AC_MSG_RESULT(yes) AC_DEFINE(WITH_TCPWRAPPER, , [Define if we are compiling with libwrap (TCP wrapper) support.]) TCPWRAPPERLIBS="-lwrap" ], [AC_MSG_RESULT(no)]) LIBS="$SAVELIBS"] ) dnl ------------------------------------------------------- dnl Check for libsndfile support dnl ------------------------------------------------------- AC_MY_LIB_PATH([libsndfile]) SNDFILELIBS="" AC_MSG_CHECKING(whether to include libsndfile support) AC_ARG_WITH(libsndfile, [AS_HELP_STRING([--with-libsndfile], [include libsndfile support (default: auto)]) AS_HELP_STRING([--without-libsndfile], [don't include libsndfile support])], [ case "$withval" in yes) AC_MSG_RESULT(yes) AC_DEFINE(WITH_SNDFILE, , [Define if we are compiling with libsndfile support.]) SNDFILELIBS="-lsndfile" ;; *) AC_MSG_RESULT(no) ;; esac ], [ SAVELIBS="$LIBS" LIBS="$LIBS -lsndfile" AC_TRY_LINK([#include ], [char buffer [128]; sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer));], [ AC_MSG_RESULT(yes) AC_DEFINE(WITH_SNDFILE, , [Define if we are compiling with libsndfile support.]) SNDFILELIBS="-lsndfile" ], [AC_MSG_RESULT(no)]) LIBS="$SAVELIBS"] ) dnl ------------------------------------------------------- dnl Check for libiconv support dnl ------------------------------------------------------- AC_MY_LIB_PATH([libiconv]) AH_TEMPLATE(WITH_LIBICONV, [Define if we are compiling with libiconv support.]) WITH_LIBICONV=no ICONVLIBS="" AC_MSG_CHECKING(whether to include libiconv support) AC_ARG_WITH(libiconv, [AS_HELP_STRING([--with-libiconv], [include libiconv support (default: auto)]) AS_HELP_STRING([--without-libiconv], [don't include libiconv support])], [ case "$withval" in yes) WITH_LIBICONV=yes AC_DEFINE(WITH_LIBICONV) ICONVLIBS="-liconv -lcharset" ;; *) ;; esac ], [ SAVELIBS="$LIBS" LIBS="$LIBS -liconv -lcharset" AC_TRY_LINK([#include ], [iconv_t cd = iconv_open("", ""); iconv(cd, 0, 0, 0, 0); iconv_close(cd);], [ WITH_LIBICONV=yes AC_DEFINE(WITH_LIBICONV) ICONVLIBS="-liconv -lcharset" ]) LIBS="$SAVELIBS"] ) AC_MSG_RESULT($WITH_LIBICONV) AC_MSG_CHECKING(whether the second argument to iconv() is const) SAVELIBS="$LIBS" LIBS="$LIBS $ICONVLIBS" AC_TRY_COMPILE([#include ], [iconv_t cd = iconv_open("", ""); const char *in = 0; iconv(cd, &in, 0, 0, 0); iconv_close(cd);], [ AC_MSG_RESULT(yes) AC_DEFINE(LIBICONV_SECOND_ARGUMENT_CONST, , [Define if the second argument to iconv() is const.]) ], [AC_MSG_RESULT(no)]) LIBS="$SAVELIBS" dnl ------------------------------------------------------- dnl Check for iconv inside C standard library dnl ------------------------------------------------------- AH_TEMPLATE([WITH_STDLIBC_ICONV], [Define if the C standard library has iconv builtin.])dnl WITH_STDLIBC_ICONV=no AC_MSG_CHECKING([whether the C standard library provides iconv functionality]) SAVELIBS="$LIBS" LIBS="" AC_TRY_LINK([#include ], [iconv_t cd=iconv_open("","");iconv(cd,0,0,0,0);iconv_close(cd);], [WITH_STDLIBC_ICONV=yes AC_DEFINE(WITH_STDLIBC_ICONV)]) AC_MSG_RESULT($WITH_STDLIBC_ICONV) LIBS="$SAVELIBS" dnl ------------------------------------------------------- dnl Check for libicu support dnl ------------------------------------------------------- AC_MY_LIB_PATH([libicu]) AH_TEMPLATE([WITH_LIBICU], [Define if we are compiling with ICU support.]) WITH_LIBICU=no AC_ARG_WITH(libicu, [AS_HELP_STRING([--with-libicu], [include libicu support (default: auto)]) AS_HELP_STRING([--without-libicu], [don't include libicu support])], [ AC_MSG_CHECKING(whether to include ICU support) case "$withval" in yes) WITH_LIBICU=yes AC_DEFINE(WITH_LIBICU) ICULIBS="-licui18n -licuuc -licudata" ;; *) ;; esac ], [ if test -z "$ICU_CONFIG"; then AC_PATH_PROG(ICU_CONFIG, icu-config, no) AC_MSG_CHECKING(whether to include ICU support) fi if [[ ! "$ICU_CONFIG" = "no" ]]; then ICU_VERSION=`$ICU_CONFIG --version` VERSION_CHECK=`expr $ICU_VERSION \>\= 3.4.1` if test VERSION_CHECK=1; then WITH_LIBICU=yes AC_DEFINE(WITH_LIBICU) ICUINCLUDES=`$ICU_CONFIG --cppflags` ICULIBS=`$ICU_CONFIG --ldflags` fi fi ]) AC_MSG_RESULT($WITH_LIBICU) dnl ------------------------------------------------------- dnl character set conversion support dnl ------------------------------------------------------- AH_VERBATIM([DCMTK_CHARSET_CONVERSION_CONSTANTS], [/* character set conversion constants. */ #define DCMTK_CHARSET_CONVERSION_ICU 1 #define DCMTK_CHARSET_CONVERSION_ICONV 2 #define DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV 3 /* LFS mode constants. */ #define DCMTK_LFS 1 #define DCMTK_LFS64 2]) CHARCONVINCLUDES="" CHARCONVLIBS="" AC_DEFUN([AC_CHOOSE_CHARSET_LIBICONV], [ AC_MSG_RESULT([yes, type=libiconv]) CHARCONVLIBS="$ICONVLIBS" DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICONV" ]) AC_DEFUN([AC_CHOOSE_CHARSET_LIBICU], [ AC_MSG_RESULT([yes, type=libicu]) CHARCONVINCLUDES="$ICUINCLUDES" CHARCONVLIBS="$ICULIBS" DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_ICU" ]) AC_DEFUN([AC_CHOOSE_CHARSET_STDLIBC_ICONV], [ AC_MSG_RESULT([yes, type=stdlibc]) DCMTK_ENABLE_CHARSET_CONVERSION="DCMTK_CHARSET_CONVERSION_STDLIBC_ICONV" ]) AC_DEFUN([AC_CHOOSE_CHARSET_IMPL], [ if test "$WITH_LIBICONV" = "yes"; then AC_CHOOSE_CHARSET_LIBICONV() elif test "$WITH_LIBICU" = "yes"; then AC_CHOOSE_CHARSET_LIBICU() elif test "$WITH_STDLIBC_ICONV" = "yes"; then AC_CHOOSE_CHARSET_STDLIBC_ICONV() else AC_MSG_RESULT(no) fi ]) AC_MSG_CHECKING(whether to enable character set conversion support) AC_ARG_ENABLE(charconv, [ --enable-charconv=TYPE enable character set conversion support (libiconv/libicu/stdlibc/auto=default) --disable-charconv disable character set conversion support], [ case "$enableval" in yes|auto) AC_CHOOSE_CHARSET_IMPL() ;; libiconv) AC_CHOOSE_CHARSET_LIBICONV() ;; libicu) AC_CHOOSE_CHARSET_LIBICU() ;; stdlibc) AC_CHOOSE_CHARSET_STDLIBC_ICONV() ;; no) AC_MSG_RESULT(no) ;; *) AC_CHOOSE_CHARSET_IMPL() ;; esac ], [AC_CHOOSE_CHARSET_IMPL()] ) AC_SUBST(CHARCONVINCLUDES) AC_SUBST(CHARCONVLIBS) if [[ ! -z "$DCMTK_ENABLE_CHARSET_CONVERSION" ]]; then AC_DEFINE_UNQUOTED(DCMTK_ENABLE_CHARSET_CONVERSION, [$DCMTK_ENABLE_CHARSET_CONVERSION], [Define to select character set conversion implementation.]) fi dnl ------------------------------------------------------- dnl include config test code from config/tests dnl ------------------------------------------------------- ac_enable_cxx11="no" AC_MSG_CHECKING(whether to enable C++11 support) AC_ARG_ENABLE(cxx11, [ --enable-cxx11 use C++11 --disable-cxx11 do not use C++11 (default)], [ case "$enableval" in yes) AC_MSG_RESULT() AX_CXX_COMPILE_STDCXX([11], [noext], [optional]) if test "$HAVE_CXX11 == 1"; then ac_enable_cxx11="yes" fi AC_MSG_CHECKING(whether to enable C++11 support) ;; *) ac_enable_cxx11="no" ;; esac ] ) AC_MSG_RESULT($ac_enable_cxx11) dnl ------------------------------------------------------- dnl Enable/disable STL support. dnl ------------------------------------------------------- ac_enable_stl="no" AC_MSG_CHECKING(whether to enable STL support) AC_ARG_ENABLE(stl, [ --enable-stl use C++ STL --disable-stl do not use C++ STL (default)], [ case "$enableval" in yes) ac_enable_stl="yes" ;; *) ac_enable_stl="no" ;; esac ] ) AC_MSG_RESULT($ac_enable_stl) ac_enable_stl_vector="auto" AC_MSG_CHECKING(whether to enable STL vector support) AC_ARG_ENABLE(stl-vector, [ --enable-stl-vector use C++ STL vector --disable-stl-vector do not use C++ STL vector], [ case "$enableval" in yes) ac_enable_stl_vector="yes" ;; *) ac_enable_stl_vector="no" ;; esac] ) if test "$ac_enable_stl_vector" = "auto"; then ac_enable_stl_vector="$ac_enable_stl" fi if test "$ac_enable_stl_vector" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/vector.cc"]])], [AC_DEFINE(HAVE_STL_VECTOR, , [Define if STL's vector should be used.])], [ac_enable_stl_vector="unsupported -> no"]) fi AC_MSG_RESULT($ac_enable_stl_vector) ac_enable_stl_algorithm="auto" AC_MSG_CHECKING(whether to enable STL algorithm support) AC_ARG_ENABLE(stl-algorithm, [ --enable-stl-algorithm use C++ STL algorithm --disable-stl-algorithm do not use C++ STL algorithm], [ case "$enableval" in yes) ac_enable_stl_algorithm="yes" ;; *) ac_enable_stl_algorithm="no" ;; esac ] ) if test "$ac_enable_stl_algorithm" = "auto"; then ac_enable_stl_algorithm="$ac_enable_stl" fi if test "$ac_enable_stl_algorithm" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/algo.cc"]])], [AC_DEFINE(HAVE_STL_ALGORITHM, , [Define if STL's algorithm should be used.])], [ac_enable_stl_algorithm="unsupported -> no"]) fi AC_MSG_RESULT($ac_enable_stl_algorithm) ac_enable_stl_limits="auto" AC_MSG_CHECKING(whether to enable STL limits support) AC_ARG_ENABLE(stl-limits, [ --enable-stl-limits use C++ STL limits --disable-stl-limits do not use C++ STL limits], [ case "$enableval" in yes) ac_enable_stl_limits="yes" ;; *) ac_enable_stl_limits="no" ;; esac ] ) if test "$ac_enable_stl_limits" = "auto"; then ac_enable_stl_limits="$ac_enable_stl" fi if test "$ac_enable_stl_limits" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/limits.cc"]])], [AC_DEFINE(HAVE_STL_LIMITS, , [Define if STL's limits should be used.])], [ac_enable_stl_limits="unsupported -> no"]) fi AC_MSG_RESULT($ac_enable_stl_limits) ac_enable_stl_list="auto" AC_MSG_CHECKING(whether to enable STL list support) AC_ARG_ENABLE(stl-list, [ --enable-stl-list use C++ STL list --disable-stl-list do not use C++ STL list], [ case "$enableval" in yes) ac_enable_stl_list="yes" ;; *) ac_enable_stl_list="no" ;; esac ] ) if test "$ac_enable_stl_list" = "auto"; then ac_enable_stl_list="$ac_enable_stl" fi if test "$ac_enable_stl_list" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/list.cc"]])], [AC_DEFINE(HAVE_STL_LIST, , [Define if STL's list should be used.])], [ac_enable_stl_list="unsupported -> no"]) fi AC_MSG_RESULT($ac_enable_stl_list) ac_enable_stl_map="auto" AC_MSG_CHECKING(whether to enable STL map support) AC_ARG_ENABLE(stl-map, [ --enable-stl-map use C++ STL map --disable-stl-map do not use C++ STL map], [ case "$enableval" in yes) ac_enable_stl_map="yes" ;; *) ac_enable_stl_map="no" ;; esac ] ) if test "$ac_enable_stl_map" = "auto"; then ac_enable_stl_map="$ac_enable_stl" fi if test "$ac_enable_stl_map" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/map.cc"]])], [AC_DEFINE(HAVE_STL_MAP, , [Define if STL's map should be used.])], [ac_enable_stl_map="unsupported -> no"]) fi AC_MSG_RESULT($ac_enable_stl_map) ac_enable_stl_memory="auto" AC_MSG_CHECKING(whether to enable STL memory support) AC_ARG_ENABLE(stl-memory, [ --enable-stl-memory use C++ STL memory --disable-stl-memory do not use C++ STL memory], [ case "$enableval" in yes) ac_enable_stl_memory="yes" ;; *) ac_enable_stl_memory="no" ;; esac ] ) if test "$ac_enable_stl_memory" = "auto"; then ac_enable_stl_memory="$ac_enable_stl" fi if test "$ac_enable_stl_memory" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/memory.cc"]])], [AC_DEFINE(HAVE_STL_MEMORY, , [Define if STL's memory should be used.])], [ac_enable_stl_memory="unsupported -> no"]) fi AC_MSG_RESULT($ac_enable_stl_memory) ac_enable_stl_stack="auto" AC_MSG_CHECKING(whether to enable STL stack support) AC_ARG_ENABLE(stl-stack, [ --enable-stl-stack use C++ STL stack --disable-stl-stack do not use C++ STL stack], [ case "$enableval" in yes) ac_enable_stl_stack="yes" ;; *) ac_enable_stl_stack="no" ;; esac ] ) if test "$ac_enable_stl_stack" = "auto"; then ac_enable_stl_stack="$ac_enable_stl" fi if test "$ac_enable_stl_stack" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/stack.cc"]])], [AC_DEFINE(HAVE_STL_STACK, , [Define if STL's stack should be used.])], []ac_enable_stl_stack="unsupported -> no") fi AC_MSG_RESULT($ac_enable_stl_stack) ac_enable_stl_string="auto" AC_MSG_CHECKING(whether to enable STL string support) AC_ARG_ENABLE(stl-string, [ --enable-stl-string use C++ STL string --disable-stl-string do not use C++ STL string], [ case "$enableval" in yes) ac_enable_stl_string="yes" ;; *) ac_enable_stl_string="no" ;; esac ] ) if test "$ac_enable_stl_string" = "auto"; then ac_enable_stl_string="$ac_enable_stl" fi if test "$ac_enable_stl_string" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/string.cc"]])], [AC_DEFINE(HAVE_STL_STRING, , [Define if STL's string should be used.])], [ac_enable_stl_string="unsupported -> no"]) fi AC_MSG_RESULT($ac_enable_stl_string) ac_enable_stl_type_traits="auto" AC_MSG_CHECKING(whether to enable STL type-traits support) AC_ARG_ENABLE(stl-type-traits, [ --enable-stl-type-traits use C++ STL type-traits --disable-stl-type-traits do not use C++ STL type-traits], [ case "$enableval" in yes) ac_enable_stl_type_traits="yes" ;; *) ac_enable_stl_type_traits="no" ;; esac ] ) if test "$ac_enable_stl_type_traits" = "auto"; then ac_enable_stl_type_traits="$ac_enable_stl" fi if test "$ac_enable_stl_type_traits" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/ttraits.cc"]])], [AC_DEFINE(HAVE_STL_TYPE_TRAITS, , [Define if STL's type traits should be used.])], [ac_enable_stl_type_traits="unsupported -> no"]) fi AC_MSG_RESULT($ac_enable_stl_type_traits) ac_enable_stl_tuple="auto" AC_MSG_CHECKING(whether to enable STL tuple support) AC_ARG_ENABLE(stl-tuple, [ --enable-stl-tuple use C++ STL tuple --disable-stl-tuple do not use C++ STL tuple], [ case "$enableval" in yes) ac_enable_stl_tuple="yes" ;; *) ac_enable_stl_tuple="no" ;; esac ] ) if test "$ac_enable_stl_tuple" = "auto"; then ac_enable_stl_tuple="$ac_enable_stl" fi if test "$ac_enable_stl_tuple" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/tuple.cc"]])], [AC_DEFINE(HAVE_STL_TUPLE, , [Define if STL's tuple should be used.])], [ac_enable_stl_tuple="unsupported -> no"]) fi AC_MSG_RESULT($ac_enable_stl_tuple) ac_enable_stl_system_error="auto" AC_MSG_CHECKING(whether to enable STL system_error support) AC_ARG_ENABLE(stl-system-error, [ --enable-stl-system-error use C++ STL system_error --disable-stl-system_error do not use C++ STL system_error], [ case "$enableval" in yes) ac_enable_stl_system_error="yes" ;; *) ac_enable_stl_system_error="no" ;; esac ] ) if test "$ac_enable_stl_system_error" = "auto"; then ac_enable_stl_system_error="$ac_enable_stl" fi if test "$ac_enable_stl_system_error" = "yes"; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include "tests/syserr.cc"]])], [AC_DEFINE(HAVE_STL_SYSTEM_ERROR, , [Define if STL's system_error should be used.])], [ac_enable_stl_system_error="unsupported -> no"]) fi AC_MSG_RESULT($ac_enable_stl_system_error) dnl ------------------------------------------------------- dnl Test for some additional functions and keywords dnl ------------------------------------------------------- AC_CHECK_SYNC_FN([__sync_add_and_fetch],[HAVE_SYNC_ADD_AND_FETCH]) AC_CHECK_SYNC_FN([__sync_sub_and_fetch],[HAVE_SYNC_SUB_AND_FETCH]) AC_CHECK_ALIGNOF([HAVE_GNU_ALIGNOF]) AC_CHECK_ATTRIBUTE_ALIGNED([HAVE_ATTRIBUTE_ALIGNED]) AC_CHECK_ATTRIBUTE_ALIGNED_SUPPORTS_TEMPLATES([ATTRIBUTE_ALIGNED_SUPPORTS_TEMPLATES]) AC_CHECK_DEFAULT_CONSTRUCTOR_DETECTION_VIA_SFINAE([HAVE_DEFAULT_CONSTRUCTOR_DETECTION_VIA_SFINAE]) dnl ------------------------------------------------------- dnl Test if passwd has the pw_gecos field dnl ------------------------------------------------------- AC_MSG_CHECKING(whether struct pwd contains the field pw_gecos) AC_TRY_COMPILE([#include ], [&passwd::pw_gecos;], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PASSWD_GECOS, , [Define if passwd::pw_gecos is available.]) ], [AC_MSG_RESULT(no)]) dnl ------------------------------------------------------- dnl Test if SYS_gettid is available dnl ------------------------------------------------------- AC_MSG_CHECKING(for SYS_gettid in sys/syscall.h) AC_TRY_COMPILE([#include ], [SYS_gettid;], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SYS_GETTID, , [Define if your system has a prototype for gettid.]) ], [AC_MSG_RESULT(no)]) dnl ------------------------------------------------------- dnl Set optimizer and debug compiler flags dnl ------------------------------------------------------- CFLAGS="$DEBUGCFLAGS $CFLAGS" CXXFLAGS="$DEBUGCXXFLAGS $CXXFLAGS" dnl ------------------------------------------------------- dnl Special Definitions for output dnl ------------------------------------------------------- AC_SUBST(CXXFLAGS) AC_SUBST(OPENSSLLIBS) AC_SUBST(TIFFLIBS) AC_SUBST(PNGLIBS) AC_SUBST(MATHLIBS) AC_SUBST(ZLIBLIBS) AC_SUBST(XMLLIBS) AC_SUBST(TCPWRAPPERLIBS) AC_SUBST(SNDFILELIBS) AC_SUBST(ICONVLIBS) AC_SUBST(DEBUG) AC_OUTPUT(Makefile.def Makefile) dnl disabled: AC_ARG_PROGRAM