commit 99e771a223dfcff09fa35269b6a6effb8d1fc87e Author: Andrea Rigoni Date: Mon Nov 3 10:27:52 2014 +0000 [uLib Geometry] non working version! + adds ProgrammableAccessor + renaming of some Image structures ... diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..129c2ad --- /dev/null +++ b/AUTHORS @@ -0,0 +1,8 @@ +/** + * CMT - Written and Mantained by: + * + * A. Rigoni ( andrea.rigoni@pd.infn.it ) + * M. Furlan ( matteo.furlan@pd.infn.it ) + * S. Vanini ( sara.vanini@pd.infn.it ) + * + **/ diff --git a/CMake/FindEigen3.cmake b/CMake/FindEigen3.cmake new file mode 100644 index 0000000..9c546a0 --- /dev/null +++ b/CMake/FindEigen3.cmake @@ -0,0 +1,81 @@ +# - Try to find Eigen3 lib +# +# This module supports requiring a minimum version, e.g. you can do +# find_package(Eigen3 3.1.2) +# to require version 3.1.2 or newer of Eigen3. +# +# Once done this will define +# +# EIGEN3_FOUND - system has eigen lib with correct version +# EIGEN3_INCLUDE_DIR - the eigen include directory +# EIGEN3_VERSION - eigen version + +# Copyright (c) 2006, 2007 Montel Laurent, +# Copyright (c) 2008, 2009 Gael Guennebaud, +# Copyright (c) 2009 Benoit Jacob +# Redistribution and use is allowed according to the terms of the 2-clause BSD license. + +if(NOT Eigen3_FIND_VERSION) + if(NOT Eigen3_FIND_VERSION_MAJOR) + set(Eigen3_FIND_VERSION_MAJOR 2) + endif(NOT Eigen3_FIND_VERSION_MAJOR) + if(NOT Eigen3_FIND_VERSION_MINOR) + set(Eigen3_FIND_VERSION_MINOR 91) + endif(NOT Eigen3_FIND_VERSION_MINOR) + if(NOT Eigen3_FIND_VERSION_PATCH) + set(Eigen3_FIND_VERSION_PATCH 0) + endif(NOT Eigen3_FIND_VERSION_PATCH) + + set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") +endif(NOT Eigen3_FIND_VERSION) + +macro(_eigen3_check_version) + file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) + + string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}") + set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}") + set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}") + set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}") + + set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}) + if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + set(EIGEN3_VERSION_OK FALSE) + else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + set(EIGEN3_VERSION_OK TRUE) + endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + + if(NOT EIGEN3_VERSION_OK) + + message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, " + "but at least version ${Eigen3_FIND_VERSION} is required") + endif(NOT EIGEN3_VERSION_OK) +endmacro(_eigen3_check_version) + +if (EIGEN3_INCLUDE_DIR) + + # in cache already + _eigen3_check_version() + set(EIGEN3_FOUND ${EIGEN3_VERSION_OK}) + +else (EIGEN3_INCLUDE_DIR) + + find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library + PATHS + ${CMAKE_INSTALL_PREFIX}/include + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen3 eigen + ) + + if(EIGEN3_INCLUDE_DIR) + _eigen3_check_version() + endif(EIGEN3_INCLUDE_DIR) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) + + mark_as_advanced(EIGEN3_INCLUDE_DIR) + +endif(EIGEN3_INCLUDE_DIR) + diff --git a/CMake/FindGEANT4.cmake b/CMake/FindGEANT4.cmake new file mode 100644 index 0000000..b351c08 --- /dev/null +++ b/CMake/FindGEANT4.cmake @@ -0,0 +1,63 @@ +# - Try to find GEANT4 +# Once done this will define +# +# GEANT4_FOUND - system has GEANT4 +# GEANT4_INCLUDE_DIR - the GEANT4 include directory +# GEANT4_LIBRARIES - The libraries needed to use GEANT4 +# GEANT4_DEFINITIONS - Compiler switches required for using GEANT4 +# + +if (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR) + SET (GEANT4_INCLUDE_DIR GEANT4_INCLUDE_DIR-NOTFOUND) + SET (GEANT4_LIB_DIR GEANT4_LIB_DIR-NOTFOUND) + SET (GEANT4_PLISTS_LIB_DIR GEANT4_PLISTS_LIB_DIR-NOTFOUND) + SET (GEANT4_DIR GEANT4_DIR-NOTFOUND) +endif (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR) + +MESSAGE(STATUS "Looking for GEANT4...") + +FIND_PATH(GEANT4_DIR NAMES env.sh PATHS + ${SIMPATH}/transport/geant4 + ${SIMPATH}/transport/geant4/source + NO_DEFAULT_PATH +) + +FIND_PATH(GEANT4_INCLUDE_DIR NAMES G4Event.hh PATHS + ${SIMPATH}/transport/geant4/include + NO_DEFAULT_PATH +) + +SET(GEANT4_INCLUDE_DIR +${SIMPATH}/transport/geant4/include +${SIMPATH}/transport/geant4/source/interfaces/common/include +${SIMPATH}/transport/geant4/physics_lists/hadronic/Packaging/include +${SIMPATH}/transport/geant4/physics_lists/hadronic/QGSP/include +) + +FIND_PATH(GEANT4_LIB_DIR NAMES libG4baryons.so libG4baryons.dylib PATHS + ${SIMPATH}/transport/geant4/lib/Linux-g++ + ${SIMPATH}/transport/geant4/lib/Linux-icc + ${SIMPATH}/transport/geant4/lib + NO_DEFAULT_PATH +) + +IF (GEANT4_LIB_DIR) + SET(GEANT4_LIBRARY_DIR ${GEANT4_LIB_DIR}) +ENDIF (GEANT4_LIB_DIR) + +if (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR) + set(GEANT4_FOUND TRUE) +endif (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR) + +if (GEANT4_FOUND) + if (NOT GEANT4_FIND_QUIETLY) + MESSAGE(STATUS "Looking for GEANT4... - found ${GEANT4_LIBRARY_DIR}") +# message(STATUS "Found ${GEANT4_LIBRARY_DIR}") + endif (NOT GEANT4_FIND_QUIETLY) + SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${GEANT4_LIBRARY_DIR}) +else (GEANT4_FOUND) + if (GEANT4_FIND_REQUIRED) + message(FATAL_ERROR "Looking for GEANT4... - Not found") + endif (GEANT4_FIND_REQUIRED) +endif (GEANT4_FOUND) + diff --git a/CMake/FindGEANT4VMC.cmake b/CMake/FindGEANT4VMC.cmake new file mode 100644 index 0000000..5dec1b5 --- /dev/null +++ b/CMake/FindGEANT4VMC.cmake @@ -0,0 +1,97 @@ +# - Try to find GEANT4VMC +# Once done this will define +# +# GEANT4VMC_FOUND - system has GEANT3 +# GEANT4VMC_INCLUDE_DIR - the GEANT3 include directory +# GEANT4VMC_LIBRARIES - The libraries needed to use GEANT3 +# GEANT4VMC_DEFINITIONS - Compiler switches required for using GEANT3 +# + +if (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR) + SET (GEANT4VMC_INCLUDE_DIR GEANT4VMC_INCLUDE_DIR-NOTFOUND) + SET (GEANT4VMC_LIB_DIR GEANT4VMC_LIB_DIR-NOTFOUND) + SET (GEANT4VMC_PLISTS_LIB_DIR GEANT4VMC_PLISTS_LIB_DIR-NOTFOUND) +endif (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR) + +MESSAGE(STATUS "Looking for GEANT4VMC...") + +FIND_PATH(GEANT4VMC_INCLUDE_DIR NAMES TG4G3Units.h PATHS + ${SIMPATH}/transport/geant4_vmc/include + NO_DEFAULT_PATH +) + +set(GEANT4VMC_INCLUDE_DIR +${SIMPATH}/transport/geant4_vmc/source/global/include +${SIMPATH}/transport/geant4_vmc/source/geometry/include +${SIMPATH}/transport/geant4_vmc/source/digits+hits/include +${SIMPATH}/transport/geant4_vmc/source/physics/include +${SIMPATH}/transport/geant4_vmc/source/event/include +${SIMPATH}/transport/geant4_vmc/source/run/include +${SIMPATH}/transport/geant4_vmc/source/interfaces/include +${SIMPATH}/transport/geant4_vmc/source/visualization/include +${SIMPATH}/transport/geant4_vmc/include +${SIMPATH}/transport/vgm/packages/BaseVGM/include +${SIMPATH}/transport/vgm/packages/ClhepVGM/include +${SIMPATH}/transport/vgm/packages/Geant4GM/include +${SIMPATH}/transport/vgm/packages/RootGM/include +${SIMPATH}/transport/vgm/packages/VGM/include +${SIMPATH}/transport/vgm/packages/XmlVGM/include +) + + +FIND_PATH(GEANT4VMC_LIBRARY_DIR NAMES libgeant4vmc.so libgeant4vmc.dylib PATHS + ${SIMPATH}/transport/geant4_vmc/lib/tgt_linux + ${SIMPATH}/transport/geant4_vmc/lib/tgt_linuxicc + ${SIMPATH}/transport/geant4_vmc/lib/tgt_linuxx8664gcc + ${SIMPATH}/transport/geant4_vmc/lib + NO_DEFAULT_PATH +) + +# check for existence of header file, which is needed in CbmRunConfiguration +# The file is only present in old versions of VMC +FIND_FILE(GEANT4_MODULAR_PHYSICS_LIST TG4ModularPhysicsList.h PATHS + ${GEANT4VMC_INCLUDE_DIR} + NO_DEFAULT_PATH +) + +if (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR) + if (NOT GEANT4VMC_FIND_QUIETLY) + MESSAGE(STATUS "Looking for GEANT4VMC... - found ${GEANT4VMC_LIBRARY_DIR}") + endif (NOT GEANT4VMC_FIND_QUIETLY) +else (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR) + if (GEANT4VMC_FIND_REQUIRED) + message(FATAL_ERROR "Looking for GEANT4VMC... - Not found ") + endif (GEANT4VMC_FIND_REQUIRED) +endif (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR) + + +MESSAGE(STATUS "Looking for VGM...") + +FIND_PATH(VGM_LIBRARY_DIR NAMES libBaseVGM.so libBaseVGM.dylib PATHS + ${SIMPATH}/transport/vgm/lib/Linux-g++ + ${SIMPATH}/transport/vgm.2.08.04/lib/Linux-g++ + ${SIMPATH}/transport/vgm/lib/Linux-icc + ${SIMPATH}/transport/vgm/lib + NO_DEFAULT_PATH +) + +if (VGM_LIBRARY_DIR) + if (NOT GEANT4VMC_FIND_QUIETLY) + MESSAGE(STATUS "Looking for VGM... - found ${VGM_LIBRARY_DIR}") + endif (NOT GEANT4VMC_FIND_QUIETLY) +else (VGM_LIBRARY_DIR) + if (GEANT4VMC_FIND_REQUIRED) + message(FATAL_ERROR "Looking for VGM... - Not found ") + endif (GEANT4VMC_FIND_REQUIRED) +endif (VGM_LIBRARY_DIR) + + +if (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR AND VGM_LIBRARY_DIR) + set(GEANT4VMC_FOUND TRUE) +endif (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR AND VGM_LIBRARY_DIR) + +if (GEANT4VMC_FOUND) + SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${GEANT4VMC_LIBRARY_DIR} + ${VGM_LIBRARY_DIR}) +endif (GEANT4VMC_FOUND) + diff --git a/CMake/FindROOT.cmake b/CMake/FindROOT.cmake new file mode 100644 index 0000000..34aed7c --- /dev/null +++ b/CMake/FindROOT.cmake @@ -0,0 +1,279 @@ +# - Find ROOT instalation +# This module tries to find the ROOT installation on your system. +# It tries to find the root-config script which gives you all the needed information. +# If the system variable ROOTSYS is set this is straight forward. +# If not the module uses the pathes given in ROOT_CONFIG_SEARCHPATH. +# If you need an other path you should add this path to this varaible. +# The root-config script is then used to detect basically everything else. +# This module defines a number of key variables and macros. + +# F.Uhlig@gsi.de (fairroot.gsi.de) + + +MESSAGE(STATUS "Looking for Root...") + +SET(ROOT_CONFIG_SEARCHPATH + /usr/local/bin + ${SIMPATH}/tools/root/bin + $ENV{ROOTSYS}/bin +) + +SET(ROOT_DEFINITIONS "") + +SET(ROOT_INSTALLED_VERSION_TOO_OLD FALSE) + +SET(ROOT_CONFIG_EXECUTABLE ROOT_CONFIG_EXECUTABLE-NOTFOUND) + +FIND_PROGRAM(ROOT_CONFIG_EXECUTABLE NAMES root-config PATHS + ${ROOT_CONFIG_SEARCHPATH} + NO_DEFAULT_PATH) + +IF (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND") + MESSAGE( FATAL_ERROR "ROOT not installed in the searchpath and ROOTSYS is not set. Please + set ROOTSYS or add the path to your ROOT installation in the Macro FindROOT.cmake in the + subdirectory cmake/modules.") +ELSE (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND") + STRING(REGEX REPLACE "(^.*)/bin/root-config" "\\1" test ${ROOT_CONFIG_EXECUTABLE}) + SET( ENV{ROOTSYS} ${test}) + set( ROOTSYS ${test}) +ENDIF (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND") + + +IF (ROOT_CONFIG_EXECUTABLE) + + SET(ROOT_FOUND FALSE) + + EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE} ARGS "--version" OUTPUT_VARIABLE ROOTVERSION) + + MESSAGE(STATUS "Looking for Root... - found $ENV{ROOTSYS}/bin/root") + MESSAGE(STATUS "Looking for Root... - version ${ROOTVERSION} ") + + # we need at least version 5.00/00 + IF (NOT ROOT_MIN_VERSION) + SET(ROOT_MIN_VERSION "5.00/00") + ENDIF (NOT ROOT_MIN_VERSION) + + # now parse the parts of the user given version string into variables + STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+" "\\1" req_root_major_vers "${ROOT_MIN_VERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" req_root_minor_vers "${ROOT_MIN_VERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+)" "\\1" req_root_patch_vers "${ROOT_MIN_VERSION}") + + # and now the version string given by qmake + STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1" found_root_major_vers "${ROOTVERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" found_root_minor_vers "${ROOTVERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+).*" "\\1" found_root_patch_vers "${ROOTVERSION}") + + IF (found_root_major_vers LESS 5) + MESSAGE( FATAL_ERROR "Invalid ROOT version \"${ROOTERSION}\", at least major version 4 is required, e.g. \"5.00/00\"") + ENDIF (found_root_major_vers LESS 5) + + # compute an overall version number which can be compared at once + MATH(EXPR req_vers "${req_root_major_vers}*10000 + ${req_root_minor_vers}*100 + ${req_root_patch_vers}") + MATH(EXPR found_vers "${found_root_major_vers}*10000 + ${found_root_minor_vers}*100 + ${found_root_patch_vers}") + + IF (found_vers LESS req_vers) + SET(ROOT_FOUND FALSE) + SET(ROOT_INSTALLED_VERSION_TOO_OLD TRUE) + ELSE (found_vers LESS req_vers) + SET(ROOT_FOUND TRUE) + ENDIF (found_vers LESS req_vers) + +ENDIF (ROOT_CONFIG_EXECUTABLE) + + +IF (ROOT_FOUND) + + # ask root-config for the library dir + # Set ROOT_LIBRARY_DIR + + EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} + ARGS "--libdir" + OUTPUT_VARIABLE ROOT_LIBRARY_DIR_TMP ) + + IF(EXISTS "${ROOT_LIBRARY_DIR_TMP}") + SET(ROOT_LIBRARY_DIR ${ROOT_LIBRARY_DIR_TMP} ) + ELSE(EXISTS "${ROOT_LIBRARY_DIR_TMP}") + MESSAGE("Warning: ROOT_CONFIG_EXECUTABLE reported ${ROOT_LIBRARY_DIR_TMP} as library path,") + MESSAGE("Warning: but ${ROOT_LIBRARY_DIR_TMP} does NOT exist, ROOT must NOT be installed correctly.") + ENDIF(EXISTS "${ROOT_LIBRARY_DIR_TMP}") + + # ask root-config for the binary dir + EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE} + ARGS "--bindir" + OUTPUT_VARIABLE root_bins ) + SET(ROOT_BINARY_DIR ${root_bins}) + + # ask root-config for the include dir + EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} + ARGS "--incdir" + OUTPUT_VARIABLE root_headers ) + SET(ROOT_INCLUDE_DIR ${root_headers}) + # CACHE INTERNAL "") + + # ask root-config for the library varaibles + EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} +# ARGS "--noldflags --noauxlibs --libs" + ARGS "--glibs" + OUTPUT_VARIABLE root_flags ) + +# STRING(REGEX MATCHALL "([^ ])+" root_libs_all ${root_flags}) +# STRING(REGEX MATCHALL "-L([^ ])+" root_library ${root_flags}) +# REMOVE_FROM_LIST(root_flags "${root_libs_all}" "${root_library}") + + SET(ROOT_LIBRARIES ${root_flags}) + + # Make variables changeble to the advanced user + MARK_AS_ADVANCED( ROOT_LIBRARY_DIR ROOT_INCLUDE_DIR ROOT_DEFINITIONS) + + # Set ROOT_INCLUDES + SET( ROOT_INCLUDES ${ROOT_INCLUDE_DIR}) + + SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${ROOT_LIBRARY_DIR}) + + ####################################### + # + # Check the executables of ROOT + # ( rootcint ) + # + ####################################### + + FIND_PROGRAM(ROOT_CINT_EXECUTABLE + NAMES rootcint + PATHS ${ROOT_BINARY_DIR} + NO_DEFAULT_PATH + ) + +ENDIF (ROOT_FOUND) + + + + ########################################### + # + # Macros for building ROOT dictionary + # + ########################################### + +MACRO (ROOT_GENERATE_DICTIONARY_OLD ) + + set(INFILES "") + + foreach (_current_FILE ${ARGN}) + + IF (${_current_FILE} MATCHES "^.*\\.h$") + IF (${_current_FILE} MATCHES "^.*Link.*$") + set(LINKDEF_FILE ${_current_FILE}) + ELSE (${_current_FILE} MATCHES "^.*Link.*$") + set(INFILES ${INFILES} ${_current_FILE}) + ENDIF (${_current_FILE} MATCHES "^.*Link.*$") + ELSE (${_current_FILE} MATCHES "^.*\\.h$") + IF (${_current_FILE} MATCHES "^.*\\.cxx$") + set(OUTFILE ${_current_FILE}) + ELSE (${_current_FILE} MATCHES "^.*\\.cxx$") + set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE}) + ENDIF (${_current_FILE} MATCHES "^.*\\.cxx$") + ENDIF (${_current_FILE} MATCHES "^.*\\.h$") + + endforeach (_current_FILE ${ARGN}) + +# MESSAGE("INFILES: ${INFILES}") +# MESSAGE("OutFILE: ${OUTFILE}") +# MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}") +# MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}") + + STRING(REGEX REPLACE "(^.*).cxx" "\\1.h" bla "${OUTFILE}") +# MESSAGE("BLA: ${bla}") + SET (OUTFILES ${OUTFILE} ${bla}) + + ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} + COMMAND ${ROOT_CINT_EXECUTABLE} + ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES}) + +# MESSAGE("ROOT_CINT_EXECUTABLE has created the dictionary ${OUTFILE}") + +ENDMACRO (ROOT_GENERATE_DICTIONARY_OLD) + + ########################################### + # + # Macros for building ROOT dictionary + # + ########################################### + +MACRO (ROOT_GENERATE_DICTIONARY INFILES LINKDEF_FILE OUTFILE INCLUDE_DIRS_IN) + + set(INCLUDE_DIRS) + + foreach (_current_FILE ${INCLUDE_DIRS_IN}) + set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE}) + endforeach (_current_FILE ${INCLUDE_DIRS_IN}) + + +# MESSAGE("INFILES: ${INFILES}") +# MESSAGE("OutFILE: ${OUTFILE}") +# MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}") +# MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}") + + STRING(REGEX REPLACE "^(.*)\\.(.*)$" "\\1.h" bla "${OUTFILE}") +# MESSAGE("BLA: ${bla}") + SET (OUTFILES ${OUTFILE} ${bla}) + + + if (CMAKE_SYSTEM_NAME MATCHES Linux) + ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} + COMMAND LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR} ROOTSYS=${ROOTSYS} ${ROOT_CINT_EXECUTABLE} + ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES} ${LINKDEF_FILE}) + else (CMAKE_SYSTEM_NAME MATCHES Linux) + if (CMAKE_SYSTEM_NAME MATCHES Darwin) + ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} + COMMAND DYLD_LIBRARY_PATH=${ROOT_LIBRARY_DIR} ROOTSYS=${ROOTSYS} ${ROOT_CINT_EXECUTABLE} + ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES} ${LINKDEF_FILE}) + endif (CMAKE_SYSTEM_NAME MATCHES Darwin) + endif (CMAKE_SYSTEM_NAME MATCHES Linux) + +ENDMACRO (ROOT_GENERATE_DICTIONARY) + + + + + + + + + + +MACRO (GENERATE_ROOT_TEST_SCRIPT SCRIPT_FULL_NAME) + + get_filename_component(path_name ${SCRIPT_FULL_NAME} PATH) + get_filename_component(file_extension ${SCRIPT_FULL_NAME} EXT) + get_filename_component(file_name ${SCRIPT_FULL_NAME} NAME_WE) + set(shell_script_name "${file_name}.sh") + + #MESSAGE("PATH: ${path_name}") + #MESSAGE("Ext: ${file_extension}") + #MESSAGE("Name: ${file_name}") + #MESSAGE("Shell Name: ${shell_script_name}") + + string(REPLACE ${PROJECT_SOURCE_DIR} + ${PROJECT_BINARY_DIR} new_path ${path_name} + ) + + #MESSAGE("New PATH: ${new_path}") + + file(MAKE_DIRECTORY ${new_path}/data) + + CONVERT_LIST_TO_STRING(${LD_LIBRARY_PATH}) + set(MY_LD_LIBRARY_PATH ${output}) + set(my_script_name ${SCRIPT_FULL_NAME}) + + if(CMAKE_SYSTEM MATCHES Darwin) + configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/root_macro_macos.sh.in + ${new_path}/${shell_script_name} + ) + else(CMAKE_SYSTEM MATCHES Darwin) + configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/root_macro.sh.in + ${new_path}/${shell_script_name} + ) + endif(CMAKE_SYSTEM MATCHES Darwin) + + EXEC_PROGRAM(/bin/chmod ARGS "u+x ${new_path}/${shell_script_name}") + +ENDMACRO (GENERATE_ROOT_TEST_SCRIPT) diff --git a/CMake/FindROOTv6.cmake b/CMake/FindROOTv6.cmake new file mode 100644 index 0000000..414d0a4 --- /dev/null +++ b/CMake/FindROOTv6.cmake @@ -0,0 +1,164 @@ +# - Finds ROOT instalation +# This module sets up ROOT information +# It defines: +# ROOT_FOUND If the ROOT is found +# ROOT_INCLUDE_DIR PATH to the include directory +# ROOT_LIBRARIES Most common libraries +# ROOT_LIBRARY_DIR PATH to the library directory +# +# Updated by K. Smith (ksmith37@nd.edu) to properly handle +# dependncies in ROOT_GENERATE_DICTIONARY + +set(ROOT_ROOTSYS $ENV{ROOTSYS} CACHE PATH "path of root installation") + + +unset(ROOT_CONFIG_EXECUTABLE CACHE) +find_program(ROOT_CONFIG_EXECUTABLE root-config + PATHS ${ROOT_ROOTSYS}/bin NO_DEFAULT_PATH) + +if(NOT ROOT_CONFIG_EXECUTABLE) + set(ROOT_FOUND FALSE) +else() + set(ROOT_FOUND TRUE) + + execute_process( + COMMAND ${ROOT_CONFIG_EXECUTABLE} --prefix + OUTPUT_VARIABLE ROOTSYS + OUTPUT_STRIP_TRAILING_WHITESPACE) + + execute_process( + COMMAND ${ROOT_CONFIG_EXECUTABLE} --version + OUTPUT_VARIABLE ROOT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + + execute_process( + COMMAND ${ROOT_CONFIG_EXECUTABLE} --incdir + OUTPUT_VARIABLE ROOT_INCLUDE_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + + execute_process( + COMMAND ${ROOT_CONFIG_EXECUTABLE} --libs + OUTPUT_VARIABLE ROOT_LIBRARIES + OUTPUT_STRIP_TRAILING_WHITESPACE) + + #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lThread -lMinuit -lHtml -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lProof) + #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lProofPlayer -lMLP -lSpectrum -lEve -lRGL -lGed -lXMLParser -lPhysics) + set(ROOT_LIBRARY_DIR ${ROOTSYS}/lib) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ROOT DEFAULT_MSG ROOT_CONFIG_EXECUTABLE + ROOTSYS ROOT_VERSION ROOT_INCLUDE_DIR ROOT_LIBRARIES ROOT_LIBRARY_DIR) + +mark_as_advanced(ROOT_CONFIG_EXECUTABLE) + +include(CMakeParseArguments) +unset(ROOT_CINT_EXECUTABLE CACHE) +find_program(ROOT_CINT_EXECUTABLE rootcint PATHS ${ROOT_ROOTSYS}/bin NO_DEFAULT_PATH ) +mark_as_advanced(ROOT_CINT_EXECUTABLE) + + +unset(ROOT_GENREFLEX_EXECUTABLE CACHE) +find_program(ROOT_GENREFLEX_EXECUTABLE genreflex PATHS ${ROOT_ROOTSYS}/bin NO_DEFAULT_PATH) +mark_as_advanced(ROOT_GENREFLEX_EXECUTABLE) + +find_package(GCCXML) + +include(uLibDebugMacro) +#---------------------------------------------------------------------------- +# function ROOT_GENERATE_DICTIONARY( dictionary +# header1 header2 ... +# LINKDEF linkdef1 ... +# OPTIONS opt1...) +function(ROOT_GENERATE_DICTIONARY dictionary) + CMAKE_PARSE_ARGUMENTS(ARG "" "" "LINKDEF;OPTIONS" "" ${ARGN}) + message(" -- generating rootcint dictionary --------------------------------------- ") + #---Get the list of include directories------------------ + get_directory_property(incdirs INCLUDE_DIRECTORIES) + set(includedirs) + foreach( d ${incdirs}) + set(includedirs ${includedirs} -I${d}) + endforeach() + #---Get the list of header files------------------------- + set(headerfiles) + foreach(fp ${ARG_UNPARSED_ARGUMENTS}) + find_file(headerFile ${fp} PATHS ${incdirs}) + set(headerfiles ${headerfiles} ${headerFile}) + debug(headerFile) + unset(headerFile CACHE) + endforeach() + #---Get LinkDef.h file------------------------------------ + set(linkdefs) + foreach( f ${ARG_LINKDEF}) + find_file(linkFile ${f} PATHS ${incdirs}) + set(linkdefs ${linkdefs} ${linkFile}) + debug(linkdefs) + unset(linkFile CACHE) + endforeach() + #---call rootcint------------------------------------------ + add_custom_command(OUTPUT ${dictionary}.cxx ${dictionary}.h + COMMAND ${ROOT_CINT_EXECUTABLE} -cint -f ${dictionary}.cxx + -c -p ${ARG_OPTIONS} ${includedirs} ${headerfiles} ${linkdefs} + DEPENDS ${headerfiles} ${linkdefs} VERBATIM) + message(" -- ---------------------------------------------------------------------- ") +endfunction() + +#---------------------------------------------------------------------------- +# function REFLEX_GENERATE_DICTIONARY(dictionary +# header1 header2 ... +# SELECTION selectionfile ... +# OPTIONS opt1...) +function(REFLEX_GENERATE_DICTIONARY dictionary) + CMAKE_PARSE_ARGUMENTS(ARG "" "" "SELECTION;OPTIONS" "" ${ARGN}) + #---Get the list of header files------------------------- + set(headerfiles) + foreach(fp ${ARG_UNPARSED_ARGUMENTS}) + file(GLOB files ${fp}) + if(files) + foreach(f ${files}) + set(headerfiles ${headerfiles} ${f}) + endforeach() + else() + set(headerfiles ${headerfiles} ${fp}) + endif() + endforeach() + #---Get Selection file------------------------------------ + if(IS_ABSOLUTE ${ARG_SELECTION}) + set(selectionfile ${ARG_SELECTION}) + else() + set(selectionfile ${CMAKE_CURRENT_SOURCE_DIR}/${ARG_SELECTION}) + endif() + #---Get the list of include directories------------------ + get_directory_property(incdirs INCLUDE_DIRECTORIES) + set(includedirs) + foreach( d ${incdirs}) + set(includedirs ${includedirs} -I${d}) + endforeach() + #---Get preprocessor definitions-------------------------- + get_directory_property(defs COMPILE_DEFINITIONS) + foreach( d ${defs}) + set(definitions ${definitions} -D${d}) + endforeach() + #---Nanes and others--------------------------------------- + set(gensrcdict ${dictionary}.cpp) + if(MSVC) + set(gccxmlopts "--gccxmlopt=\"--gccxml-compiler cl\"") + else() + #set(gccxmlopts "--gccxmlopt=\'--gccxml-cxxflags -m64 \'") + set(gccxmlopts) + endif() + #set(rootmapname ${dictionary}Dict.rootmap) + #set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict) + #---Check GCCXML and get path----------------------------- + if(GCCXML) + get_filename_component(gccxmlpath ${GCCXML} PATH) + else() + message(WARNING "GCCXML not found. Install and setup your environment to find 'gccxml' executable") + endif() + #---Actual command---------------------------------------- + add_custom_command(OUTPUT ${gensrcdict} ${rootmapname} + COMMAND ${GENREFLEX_EXECUTABLE} ${headerfiles} -o ${gensrcdict} ${gccxmlopts} ${rootmapopts} --select=${selectionfile} + --gccxmlpath=${gccxmlpath} ${ARG_OPTIONS} ${includedirs} ${definitions} + DEPENDS ${headerfiles} ${selectionfile}) +endfunction() + diff --git a/CMake/FindReadLine.cmake b/CMake/FindReadLine.cmake new file mode 100644 index 0000000..70ec5b8 --- /dev/null +++ b/CMake/FindReadLine.cmake @@ -0,0 +1,23 @@ +# Base Io build system +# Written by Jeremy Tregunna +# +# Find libreadline. + +FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h readline/history.h) + +SET(READLINE_NAMES ${READLINE_NAMES} readline libreadline history libhistory) +FIND_LIBRARY(READLINE_LIBRARY NAMES ${READLINE_NAMES} PATH) + +IF(READLINE_INCLUDE_DIR AND READLINE_LIBRARY) + SET(READLINE_FOUND TRUE) +ENDIF(READLINE_INCLUDE_DIR AND READLINE_LIBRARY) + +IF(READLINE_FOUND) + IF(NOT Readline_FIND_QUIETLY) + MESSAGE(STATUS "Found Readline: ${READLINE_LIBRARY}") + ENDIF (NOT Readline_FIND_QUIETLY) +ELSE(READLINE_FOUND) + IF(Readline_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find readline") + ENDIF(Readline_FIND_REQUIRED) +ENDIF (READLINE_FOUND) diff --git a/CMake/FindVTK.cmake b/CMake/FindVTK.cmake new file mode 100644 index 0000000..6b1772f --- /dev/null +++ b/CMake/FindVTK.cmake @@ -0,0 +1,141 @@ +# - Find a VTK installation or build tree. +# The following variables are set if VTK is found. If VTK is not +# found, VTK_FOUND is set to false. +# VTK_FOUND - Set to true when VTK is found. +# VTK_USE_FILE - CMake file to use VTK. +# VTK_MAJOR_VERSION - The VTK major version number. +# VTK_MINOR_VERSION - The VTK minor version number +# (odd non-release). +# VTK_BUILD_VERSION - The VTK patch level +# (meaningless for odd minor). +# VTK_INCLUDE_DIRS - Include directories for VTK +# VTK_LIBRARY_DIRS - Link directories for VTK libraries +# VTK_KITS - List of VTK kits, in CAPS +# (COMMON,IO,) etc. +# VTK_LANGUAGES - List of wrapped languages, in CAPS +# (TCL, PYHTON,) etc. +# The following cache entries must be set by the user to locate VTK: +# VTK_DIR - The directory containing VTKConfig.cmake. +# This is either the root of the build tree, +# or the lib/vtk directory. This is the +# only cache entry. +# The following variables are set for backward compatibility and +# should not be used in new code: +# USE_VTK_FILE - The full path to the UseVTK.cmake file. +# This is provided for backward +# compatibility. Use VTK_USE_FILE +# instead. +# + +#============================================================================= +# Copyright 2001-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# Assume not found. +SET(VTK_FOUND 0) + +# VTK 4.0 did not provide VTKConfig.cmake. +IF("${VTK_FIND_VERSION}" VERSION_LESS 4.1) + SET(_VTK_40_ALLOW 1) + IF(VTK_FIND_VERSION) + SET(_VTK_40_ONLY 1) + ENDIF() +ENDIF() + +# Construct consitent error messages for use below. +SET(VTK_DIR_DESCRIPTION "directory containing VTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/vtk for an installation.") +IF(_VTK_40_ALLOW) + SET(VTK_DIR_DESCRIPTION "${VTK_DIR_DESCRIPTION} For VTK 4.0, this is the location of UseVTK.cmake. This is either the root of the build tree or PREFIX/include/vtk for an installation.") +ENDIF() +SET(VTK_DIR_MESSAGE "VTK not found. Set the VTK_DIR cmake cache entry to the ${VTK_DIR_DESCRIPTION}") + +# Check whether VTK 4.0 has already been found. +IF(_VTK_40_ALLOW AND VTK_DIR) + IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake) + SET(VTK_FOUND 1) + INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings. + ENDIF() +ENDIF() + +# Use the Config mode of the find_package() command to find VTKConfig. +# If this succeeds (possibly because VTK_DIR is already set), the +# command will have already loaded VTKConfig.cmake and set VTK_FOUND. +IF(NOT _VTK_40_ONLY AND NOT VTK_FOUND) + FIND_PACKAGE(VTK QUIET NO_MODULE) +ENDIF() + +# Special search for VTK 4.0. +IF(_VTK_40_ALLOW AND NOT VTK_DIR) + # Old scripts may set these directories in the CMakeCache.txt file. + # They can tell us where to find VTKConfig.cmake. + SET(VTK_DIR_SEARCH_LEGACY "") + IF(VTK_BINARY_PATH AND USE_BUILT_VTK) + SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_BINARY_PATH}) + ENDIF(VTK_BINARY_PATH AND USE_BUILT_VTK) + IF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK) + SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} + ${VTK_INSTALL_PATH}/lib/vtk) + ENDIF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK) + + # Look for UseVTK.cmake in build trees or under /include/vtk. + FIND_PATH(VTK_DIR + NAMES UseVTK.cmake + PATH_SUFFIXES vtk-4.0 vtk + HINTS $ENV{VTK_DIR} + + PATHS + + # Support legacy cache files. + ${VTK_DIR_SEARCH_LEGACY} + + # Read from the CMakeSetup registry entries. It is likely that + # VTK will have been recently built. + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10] + + # Help the user find it if we cannot. + DOC "The ${VTK_DIR_DESCRIPTION}" + ) + + IF(VTK_DIR) + IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake) + SET(VTK_FOUND 1) + INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings. + ELSE() + # We found the wrong version. Pretend we did not find it. + SET(VTK_DIR "VTK_DIR-NOTFOUND" CACHE PATH "The ${VTK_DIR_DESCRIPTION}" FORCE) + ENDIF() + ENDIF() +ENDIF() + +#----------------------------------------------------------------------------- +IF(VTK_FOUND) + # Set USE_VTK_FILE for backward-compatability. + SET(USE_VTK_FILE ${VTK_USE_FILE}) +ELSE(VTK_FOUND) + # VTK not found, explain to the user how to specify its location. + IF(VTK_FIND_REQUIRED) + MESSAGE(FATAL_ERROR ${VTK_DIR_MESSAGE}) + ELSE(VTK_FIND_REQUIRED) + IF(NOT VTK_FIND_QUIETLY) + MESSAGE(STATUS ${VTK_DIR_MESSAGE}) + ENDIF(NOT VTK_FIND_QUIETLY) + ENDIF(VTK_FIND_REQUIRED) +ENDIF(VTK_FOUND) diff --git a/CMake/FinduLib.cmake b/CMake/FinduLib.cmake new file mode 100644 index 0000000..63470df --- /dev/null +++ b/CMake/FinduLib.cmake @@ -0,0 +1,62 @@ +# - Finds ROOT instalation +# This module sets up ROOT information +# It defines: +# ULIB_FOUND If the uLib is found +# ULIB_INCLUDE_DIRS PATH to the include directory +# ULIB_LIBRARIES Most common libraries +# ULIB_LIBRARY_DIRS PATH to the library directory +# + +include(uLibFindDependencies) +include(uLibDebugMacro) + +## CONFIG FIND -------------------------------------------------------------- ## + +set(CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}/lib/cmake") +unset(ULIB_CONFIG) +find_package(ULIB ${ULIB_PACKAGE_VERSION} CONFIG + NAMES uLib + PATH_SUFFIXES ${ULIB_PACKAGE_NAME} +) + +debug(ULIB_CONFIG) +debug(ULIB_CONSIDERED_CONFIGS) +debug(ULIB_CONSIDERED_VERSIONS) +debug(ULIB_INCLUDE_DIRS) +debug(ULIB_LIBRARIES) + +if(ULIB_CONFIG) + set(ULIB_FOUND true) +endif() + +## MODULE FIND -------------------------------------------------------------- ## + +#find_path(uLib_INCLUDE_DIR +# NAMES ulib.h +# PATH_SUFFIXES mutom-0.2 +#) +#debug(uLib_INCLUDE_DIR) + +#find_file(uLib_USE_FILE +# NAMES uLib_exported_targets.cmake +# PATHS lib lib64 +# PATH_SUFFIXES mutom-0.2 +#) +#debug(uLib_USE_FILE) + +#find_library(uLib_LIBRARY +# NAMES libmutomCore.so +# PATH_SUFFIXES mutom-0.2 +# ) +#debug(uLib_LIBRARY) + +##set( uLib_PROCESS_INCLUDES uLib_INCLUDE_DIR ULIB_INCLUDE_DIRS ) +##set( uLib_PROCESS_LIBS uLib_LIBRARY ULIB_LIBRARIES ) +##libfind_process(uLib) + +#set( ULIB_INCLUDE_DIRS ${uLib_INCLUDE_DIR} ) +#set( ULIB_LIBRARIES ${uLib_LIBRARY} ) +#include(FindPackageHandleStandardArgs) +#find_package_handle_standard_args(uLib DEFAULT_MSG +# uLib_LIBRARY uLib_INCLUDE_DIR) +#mark_as_advanced(uLib_INCLUDE_DIR uLib_LIBRARY) diff --git a/CMake/clean-all.cmake b/CMake/clean-all.cmake new file mode 100644 index 0000000..dc152af --- /dev/null +++ b/CMake/clean-all.cmake @@ -0,0 +1,11 @@ +set(cmake_generated ${CMAKE_BINARY_DIR}/CMakeCache.txt + ${CMAKE_BINARY_DIR}/cmake_install.cmake + ${CMAKE_BINARY_DIR}/Makefile + ${CMAKE_BINARY_DIR}/CMakeFiles +) + +foreach(file ${cmake_generated}) + if (EXISTS ${file}) + file(REMOVE_RECURSE ${file}) + endif() +endforeach(file) diff --git a/CMake/rmake.in b/CMake/rmake.in new file mode 100644 index 0000000..0d16648 --- /dev/null +++ b/CMake/rmake.in @@ -0,0 +1,47 @@ +#!/bin/bash + +# CONNECTION ---------------------------------------------------------------- ## +USER=@REMOTE_BUILD_USER@ +MACHINES="@REMOTE_BUILD_MACHINES@" +SSH=@REMOTE_BUILD_SSHBIN@ +PORT=@REMOTE_BUILD_SSHPORT@ + +# BUILD --------------------------------------------------------------------- ## + +MAKE=@REMOTE_BUILD_MAKEBIN@ +BUILD_DIR=@REMOTE_BUILD_BULIDIR@ +SOURCE_DIR=@REMOTE_BUILD_SRCDIR@ +CURRENT_DIR=`pwd` +ARGS=$@ + + +# FIND RELATIVE PATH -------------------------------------------------------- ## + +function relpath { +# both $1 and $2 are absolute paths +# returns $2 relative to $1 +source=$1 +target=$2 +common_part=$source +back= +while [ "${target#$common_part}" = "${target}" ]; do + common_part=$(dirname $common_part) + back="../${back}" +done +echo ${back}${target#$common_part/} +} + +CURRENT_SRCDIR=$(cd -- ${CURRENT_DIR}/$(relpath $BUILD_DIR/ $SOURCE_DIR/)/ && pwd) + + + +for m in ${MACHINES}; do + echo "building into machine: ${m}" + echo "remote commands: --------------------------------------------------------------------------------------------------------------" + echo "source dir = ${SOURCE_DIR}" + echo "build dir = ${BUILD_DIR}" + echo "repath to LOCAL MACHINE source dir = ${CURRENT_SRCDIR}" + echo "${SSH} -p ${PORT} ${USER}@${m} ${MAKE} -C ${BUILD_DIR} ${ARGS} 3>&1 1>&2 2>&3 | sed -e 's|${SOURCE_DIR}|${CURRENT_SRCDIR}|g' 3>&1 1>&2 2>&3" + echo " ------------------------------------------------------------------------------------------------------------------------------" + ${SSH} -p ${PORT} ${USER}@${m} "${MAKE} -C ${BUILD_DIR} ${ARGS} 3>&1 1>&2 2>&3 | sed -e 's|${SOURCE_DIR}|${CURRENT_SRCDIR}|g'" 3>&1 1>&2 2>&3 +done diff --git a/CMake/uLibCommon.cmake b/CMake/uLibCommon.cmake new file mode 100644 index 0000000..ad120ad --- /dev/null +++ b/CMake/uLibCommon.cmake @@ -0,0 +1,64 @@ +include(uLibMacros) +include_guard(ULIB_COMMON_CMAKE) + +include(uLibDebugMacro) + +## DIRECTORIES -------------------------------------------------------------- ## + +set(ULIB_PARENT_PATH "${PROJECT_SOURCE_DIR}") +message(STATUS "Setting uLib parent path to: ${ULIB_PARENT_PATH}") + +## Build directories ## +set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib CACHE PATH "build path for lib") +mark_as_advanced(LIBRARY_OUTPUT_PATH) +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "build path for binaries") +mark_as_advanced(EXECUTABLE_OUTPUT_PATH) + +## Install directories ## +set(PACKAGE_INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables") +set(PACKAGE_INSTALL_LIB_DIR lib/${PACKAGE_NAME} CACHE PATH "Installation directory for libraries") +set(PACKAGE_INSTALL_INC_DIR include/${PACKAGE_NAME} CACHE PATH "Installation directory for headers") +set(PACKAGE_INSTALL_DATA_DIR share/${PACKAGE_NAME} CACHE PATH "Installation directory for data files") +if(WIN32 AND NOT CYGWIN) + set(DEF_INSTALL_CMAKE_DIR CMake) +else() + set(DEF_INSTALL_CMAKE_DIR lib/cmake/${PACKAGE_NAME}) +endif() +set(PACKAGE_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files") + +# Make relative paths absolute (needed later on) +foreach(p LIB BIN INC DATA CMAKE) + set(var PACKAGE_INSTALL_${p}_DIR) + if(NOT IS_ABSOLUTE "${${var}}") + set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}") + endif() + mark_as_advanced(PACKAGE_INSTALL_${p}_DIR) + debug(PACKAGE_INSTALL_${p}_DIR) +endforeach() + +# add the binary tree to the search path for include files +# so that we will find config.h +set(SRC_DIR ${PROJECT_SOURCE_DIR}/src) +include_directories(${PROJECT_BINARY_DIR}) +include_directories(${SRC_DIR}) + + +## GLOBAL OPTIONS ----------------------------------------------------------- ## + +# Set a default build type to RELEASE WITH DEBUG INFO if none was specified +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'Release' as none was specified.") + set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + "MinSizeRel" "RelWithDebInfo") +endif() + +set(CMAKE_CXX_WARNING_OPTION "" CACHE STRING "Warning level -WAll to verbose all warnings") +set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE STRING "Verbose compile output switch") + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x ${CMAKE_CXX_WARNING_OPTION}") + + + + diff --git a/CMake/uLibConfigHeader.cmake b/CMake/uLibConfigHeader.cmake new file mode 100644 index 0000000..363bbe3 --- /dev/null +++ b/CMake/uLibConfigHeader.cmake @@ -0,0 +1,57 @@ +include(uLibMacros) +include_guard(ULIB_CONFIG_HEADER_CMAKE) + + +## CONFIG ------------------------------------------------------------------- ## + +message("/////////// CONFIG HEADER //////////////") + +include(CheckIncludeFiles) +include(CheckFunctionExists) +include(CheckSymbolExists) + +## force to use PP variadics (FIX) ## +set(BOOST_PP_VARIADICS ON) + +message(STATUS "PROJECT NAME = ${PROJECT_NAME}") +message(STATUS "PACKAGE VERSION = ${PACKAGE_VERSION}") +message(STATUS "PACKAGE NAME = ${PACKAGE_NAME}") +execute_process(COMMAND "svnversion" + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE SVN_REVISION + OUTPUT_STRIP_TRAILING_WHITESPACE ) + +message(STATUS "SVN REVISION = ${SVN_REVISION}") + +CHECK_INCLUDE_FILES(inittypes.h HAVE_INITTYPES_H) +CHECK_INCLUDE_FILES(stdbool.h HAVE_STDBOOL_H) +CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H) +CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H) + +CHECK_INCLUDE_FILES(dlfcn.h HAVE_DLFCN_H) +CHECK_INCLUDE_FILES(malloc.h HAVE_MALLOC_H) +CHECK_FUNCTION_EXISTS(malloc HAVE_MALLOC) +CHECK_INCLUDE_FILES(memory.h HAVE_MEMORY_H) + +CHECK_INCLUDE_FILES(math.h HAVE_MATH_H) +CHECK_FUNCTION_EXISTS(fsetround HAVE_FSETROUND) +CHECK_FUNCTION_EXISTS(floor HAVE_FLOOR) +CHECK_FUNCTION_EXISTS(pow HAVE_POW) +CHECK_FUNCTION_EXISTS(sqrt HAVE_SQRT) + +CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP) +CHECK_FUNCTION_EXISTS(strstr HAVE_STRSTR) +CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H) +CHECK_INCLUDE_FILES(string.h HAVE_STRING_H) + +CHECK_INCLUDE_FILES(sys/stat.h HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) + +CHECK_INCLUDE_FILES(assert.h HAVE_ASSERT_H) + + +configure_file( + "${PROJECT_SOURCE_DIR}/CMakeConfig.in.h" + "${PROJECT_BINARY_DIR}/config.h" + ) diff --git a/CMake/uLibDebugMacro.cmake b/CMake/uLibDebugMacro.cmake new file mode 100644 index 0000000..1529ae3 --- /dev/null +++ b/CMake/uLibDebugMacro.cmake @@ -0,0 +1,54 @@ +include(uLibMacros) +include_guard(ULIB_DEBUG_MACRO_CMAKE) + + +set(CMAKE_CONFIGURE_DEBUG_ENABLE ON CACHE BOOL "cmake configure debugger") +set(CMAKE_CONFIGURE_DEBUG_LIST OFF CACHE BOOL "cmake debugger show list enable") +mark_as_advanced( + CMAKE_CONFIGURE_DEBUG_ENABLE + CMAKE_CONFIGURE_DEBUG_LIST +) + +macro(debug str) + if(CMAKE_CONFIGURE_DEBUG_ENABLE) + set(var ${${str}}) + list(LENGTH var len) + if((${len} GREATER 1) AND CMAKE_CONFIGURE_DEBUG_LIST) + message(STATUS "[DEBUG] [${str}] list: ") + foreach(item ${var}) + message(STATUS " -> ${item}") + endforeach() + else() + message(STATUS "[DEBUG] [${str}] ${var}") + endif() + endif() +endmacro() + +macro(debug_list str) + if(CMAKE_CONFIGURE_DEBUG_ENABLE) + set(var ${${str}}) + list(LENGTH var len) + if((${len} GREATER 1)) + message(STATUS "[DEBUG] [${str}] list: ") + foreach(item ${var}) + message(STATUS " -> ${item}") + endforeach() + else() + message(STATUS "[DEBUG] [${str}] ${var}") + endif() + endif() +endmacro() + +macro(debug_package str) + if(CMAKE_CONFIGURE_DEBUG_ENABLE) + set(have ${str}_FOUND) + if(${have}) + debug("${str}_INCLUDE_DIRS") + debug("${str}_LIBRARIES") + debug("${str}_LIBRARY_DIRS") + debug("${str}_DEFINITIONS") + else(${have}) + message(WARNING "package ${str} not found") + endif(${have}) + endif(CMAKE_CONFIGURE_DEBUG_ENABLE) +endmacro() diff --git a/CMake/uLibFindDependencies.cmake b/CMake/uLibFindDependencies.cmake new file mode 100644 index 0000000..828f3ec --- /dev/null +++ b/CMake/uLibFindDependencies.cmake @@ -0,0 +1,122 @@ +include(uLibMacros) +include_guard(ULIB_FIND_DEPENDENCIES_CMAKE) + +include(uLibDebugMacro) + +################################################################################ +## PKG FIND ## +message("/////////// LOOKING FOR EXTERNAL PACKAGES //////////////") + +## BOOST ## +message(STATUS "## BOOST ##") +set(Boost_USE_STATIC_LIBS OFF) +set(Boost_USE_MULTITHREADED ON) +set(Boost_USE_STATIC_RUNTIME OFF) + +find_package(Boost 1.45.0 COMPONENTS serialization signals program_options REQUIRED) +if(Boost_FOUND) + set(HAVE_BOOST true) +endif(Boost_FOUND) +include_directories(${Boost_INCLUDE_DIRS}) + +## OPEN MP ## +message(STATUS "## OPEN MP ##") +find_package(OpenMP) +option(OpenMP_ACTIVE "Activate OpenMP parallel compilation" ON) +if(OPENMP_FOUND AND OpenMP_ACTIVE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" ) +endif(OPENMP_FOUND AND OpenMP_ACTIVE) + +## EIGEN ## +message(STATUS "## EIGEN ##") +# option(USE_EIGEN ON) ## REQUIRED +find_package(Eigen3 REQUIRED) +debug(EIGEN3_INCLUDE_DIR) +include_directories(${EIGEN3_INCLUDE_DIR}) + +## ROOT ## +message(STATUS "## ROOT ##") +option(ULIB_USE_ROOT "Activate use of Root integration" ON) +### <<<--- ROOT IS REQUIRED FOR THE MOMENT ### +#if(ULIB_USE_ROOT) +include(FindROOTv6) +find_package(ROOT REQUIRED) +if(ROOT_FOUND) + set(HAVE_ROOT true) + include_directories(${ROOT_INCLUDE_DIR}) + link_directories(${ROOT_LIBRARY_DIR}) + debug(ROOT_INCLUDE_DIR) + debug(ROOT_LIBRARY_DIR) + debug(ROOT_LIBRARIES) +else() + message(WARNING "Root not found") +endif(ROOT_FOUND) +#endif(ULIB_USE_ROOT) + + +## VTK ## +option(ULIB_USE_VTK "Activate use of Vtk Visual Pipelines" ON) +if(ULIB_USE_VTK) + message(STATUS "## VTK ##") + message(STATUS "Looking for VTK...") + set(VTK_DIR "PATH/TO/VTK/BUILD/DIRECTORY") + mark_as_advanced(VTK_DIR) + find_package(VTK REQUIRED) + include(${VTK_USE_FILE}) + #message(STATUS "VTK included libraries: ${VTK_LIBRARIES}") + debug(VTK_USE_FILE) + debug(VTK_INCLUDE_DIRS) + debug(VTK_LIBRARY_DIRS) + debug(VTK_LIBRARIES) +# get_directory_property(compile_def COMPILE_DEFINITIONS) +# debug(compile_def) +endif(ULIB_USE_VTK) + + +## GEANT ## +option(ULIB_USE_GEANT4 "Activate use of GEANT Integration" ON) +message(STATUS "## GEANT 4 ##") +#include(FindGEANT4) # disabled using system finder +find_package(Geant4) +set(GEANT4_FOUND Geant4_DIR) +if(GEANT4_FOUND AND ULIB_USE_GEANT4) + message(STATUS "Looking for Geant4... - Geant4 found in ${Geant4_DIR}") + set(HAVE_GEANT4 true) + include_directories(${Geant4_INCLUDE_DIRS}) # Add -I type paths + add_definitions(${Geant4_DEFINITIONS}) # Add -D type defs + debug_package(Geant4) +endif(GEANT4_FOUND AND ULIB_USE_GEANT4) + +## QT4 ## +option(ULIB_USE_QT4 "Activate use of Qt Framework" ON) +if(ULIB_USE_QT4) + message(STATUS "## QT4 ##") + find_package(Qt4) +# include_directories(${Qt4_INCLUDE_DIRS}) +# debug(Qt4_INCLUDE_DIRS) +endif(ULIB_USE_QT4) + +## QT5 ## +option(ULIB_USE_QT5 "Activate use of Qt Framework" ON) +if(ULIB_USE_QT5) + message(STATUS "## QT5 ##") + find_package(Qt5Widgets) +# include_directories(${Qt5_INCLUDE_DIRS}) +# debug(Qt5_INCLUDE_DIRS) +endif(ULIB_USE_QT5) + +## READLINE ## +message(STATUS "## READLINE ##") +find_package(ReadLine) +include_directories(${READLINE_INCLUDE_DIR}) +debug(READLINE_INCLUDE_DIR) + +## STD MATH REQUIRED ## +#message(STATUS "## STD MATH ##") +set(CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_INCLUDES math.h) +set(CMAKE_REQUIRED_LIBRARIES CMAKE_REQUIRED_LIBRARIES m) + + + +################################################################################ diff --git a/CMake/uLibGenerateRMake.cmake b/CMake/uLibGenerateRMake.cmake new file mode 100644 index 0000000..962ce0b --- /dev/null +++ b/CMake/uLibGenerateRMake.cmake @@ -0,0 +1,47 @@ + + +include(uLibMacros) +include(uLibDebugMacro) + +## MAKE REMOTE -------------------------------------------------------------- ## + +#set(BUILD_REMOTE_MACHINES "10.62.19.4" CACHE STRING "remote build in cloud machine") +#set(BUILD_REMOTE_USER "rigoni" CACHE STRING "remote build user") +#set(BUILD_REMOTE_CMD "${SSH_COMMAND} ${BUILD_REMOTE_USER}@${BUILD_REMOTE_MACHINES} \"make -C \"") +#add_custom_target(cloud COMMAND ${SSH_COMMAND}) + + + +set(REMOTE_BUILD_USER "$ENV{USER}" CACHE STRING "ssh remote build user name") + +execute_process(COMMAND hostname -I OUTPUT_VARIABLE HOSTNAME_IP) +set(REMOTE_BUILD_MACHINES ${HOSTNAME_IP} CACHE STRING "ssh remote build machines") + +find_file(SSH_EXECUTABLE ssh PATHS /bin/local/bin /usr/bin /bin) +set(REMOTE_BUILD_SSHBIN ${SSH_EXECUTABLE} CACHE FILEPATH "ssh remote build command path") +set(REMOTE_BUILD_SSHPORT 22 CACHE STRING "ssh remote build port") + +find_file(MAKE_EXECUTABLE make PATHS /usr/local/bin /usr/bin /bin) +set(REMOTE_BUILD_MAKEBIN ${MAKE_EXECUTABLE} CACHE FILEPATH "ssh remote build make path") +set(REMOTE_BUILD_BULIDIR ${PROJECT_BINARY_DIR} CACHE PATH "ssh remote build build path") +set(REMOTE_BUILD_SRCDIR ${PROJECT_SOURCE_DIR} CACHE PATH "ssh remote build source path") + +message("remote build ----------------------------------------------------------") +debug(REMOTE_BUILD_USER) +debug(REMOTE_BUILD_MACHINES) +debug(REMOTE_BUILD_SSHBIN) +debug(REMOTE_BUILD_SSHPORT) +debug(REMOTE_BUILD_MAKEBIN) +message("-----------------------------------------------------------------------") + + +find_file(RMAKE_IN_FILE rmake.in PATHS ${CMAKE_MODULE_PATH}) +configure_file( + "${RMAKE_IN_FILE}" + "${PROJECT_BINARY_DIR}/CMake/rmake" @ONLY +) + +file(COPY "${PROJECT_BINARY_DIR}/CMake/rmake" + DESTINATION "${PROJECT_BINARY_DIR}" + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ + GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) diff --git a/CMake/uLibMacros.cmake b/CMake/uLibMacros.cmake new file mode 100644 index 0000000..608dd7c --- /dev/null +++ b/CMake/uLibMacros.cmake @@ -0,0 +1,12 @@ +#if(ULIB_MACROS_CMAKE) +# return() +#endif() +#set(ULIB_MACROS_CMAKE 1) + + +function(include_guard var) + if(${var}) + return() + endif() + set(${var} 1) +endfunction() diff --git a/CMake/uLibTargetMacros.cmake b/CMake/uLibTargetMacros.cmake new file mode 100644 index 0000000..e954758 --- /dev/null +++ b/CMake/uLibTargetMacros.cmake @@ -0,0 +1,186 @@ + +include(uLibMacros) +include_guard(ULIB_TARGET_MACRO_CMAKE) + +## adds library target +macro(uLib_add_library name) + add_library(${name} ${ARGN}) + if(NOT ULIB_INSTALL_NO_LIBRARIES) + set_property(GLOBAL APPEND PROPERTY ULIB_TARGETS ${name}) + endif(NOT ULIB_INSTALL_NO_LIBRARIES) +endmacro(uLib_add_library) + +################################################################################ +## Add SHARED library target ## + +# HEADERS and SOURCES must be defined as list of library headers and sources +macro(uLib_add_shared_library name) + if(COMMAND cmake_policy) + # cmake_policy( SET CMP0022 NEW ) + endif(COMMAND cmake_policy) + + set(mname ${PACKAGE_LIBPREFIX}${name}) + + if(SOURCES) + uLib_add_library(${mname} SHARED ${SOURCES}) + set(shared ${ULIB_SHARED_LIBRARIES}) + list(APPEND shared ${mname}) + set(ULIB_SHARED_LIBRARIES ${shared} PARENT_SCOPE) + source_group("${project_name}\\${name}" FILES ${SOURCES}) + set_target_properties(${mname} PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_SOVERSION} + INTERFACE_LINK_LIBRARIES "${LIBRARIES}" + LINK_INTERFACE_LIBRARIES "${LIBRARIES}" ## <- ok for cmake from 2.12 ? + IMPORTED_LINK_INTERFACE_LIBRARIES "${LIBRARIES}" ## <- breaks cmake after 2.11 ? +# PUBLIC_HEADER "" + ) + debug(LIBRARIES) + + install(TARGETS ${mname} + EXPORT "${PROJECT_NAME}Targets" + RUNTIME DESTINATION ${PACKAGE_INSTALL_BIN_DIR} COMPONENT bin + LIBRARY DESTINATION ${PACKAGE_INSTALL_LIB_DIR} COMPONENT lib + # PUBLIC_HEADER DESTINATION ${PACKAGE_INSTALL_INC_DIR} COMPONENT dev + ) + endif(SOURCES) + + if(HEADERS) + foreach(header ${HEADERS}) + install(FILES ${header} DESTINATION ${PACKAGE_INSTALL_INC_DIR}/${name}) + endforeach(header) + endif(HEADERS) + +endmacro(uLib_add_shared_library) + + +################################################################################ +## Add Target ## + +macro(uLib_add_target name) + debug(${name}) + add_executable(${name} ${ARGN}) + set_property(GLOBAL APPEND PROPERTY ULIB_TARGETS ${name}) + + set(exported ${ULIB_EXPORTED_TARGETS}) + list(APPEND exported ${name}) + set(ULIB_EXPORTED_TARGETS ${exported} PARENT_SCOPE) + + install(TARGETS ${name} + EXPORT "${PROJECT_NAME}Targets" + RUNTIME DESTINATION ${PACKAGE_INSTALL_BIN_DIR} COMPONENT bin + ) +ENDMACRO(uLib_add_target) + + + +################################################################################ +## TESTS ## + +# TESTS and LIBRARIES must be defined +macro(uLib_add_tests name) + foreach(tn ${TESTS}) + add_executable(${tn} EXCLUDE_FROM_ALL ${tn}.cpp) + add_test(${tn} ${PACKAGE_INSTALL_BIN_DIR}/${tn}) + + # adds dependencies to all selected modules in uLib + # foreach(module ${ULIB_SELECTED_MODULES}) + # add_dependencies(${tn} ${project_name}${module}) + # endforeach(module) + + # adds libraries dependencies + foreach(library ${LIBRARIES}) + target_link_libraries(${tn} ${library}) + endforeach(library) + + endforeach(tn) + + # custom target to compile all tests + add_custom_target(all-${name}-tests) + add_dependencies(all-${name}-tests ${TESTS}) +endmacro(uLib_add_tests name) + + +################################################################################ +## UTILS ## + +# UTILS and LIBRARIES must be defined +macro(uLib_add_utils name) + foreach(tn ${UTILS}) + add_executable(${tn} ${tn}.cpp) + install(TARGETS ${tn} RUNTIME DESTINATION bin) + + # adds dependencies to all selected modules in uLib + # foreach(module ${ULIB_SELECTED_MODULES}) + # add_dependencies(${tn} ${project_name}${module}) + # endforeach(module) + + # adds libraries dependencies + foreach(library ${LIBRARIES}) + target_link_libraries(${tn} ${library}) + endforeach(library) + + endforeach(tn) + + # custom target to compile all tests + add_custom_target(all-${name}) + add_dependencies(all-${name} ${UTILS}) + +endmacro(uLib_add_utils name) + + + + + + +function(get_gcc_compile_flags target out_flags) + string(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" name) + set(flags "${${name}} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_COMPILER_ARG1}") + get_target_property(value ${target} COMPILE_FLAGS) + if (value) + list(APPEND flags ${value}) + endif() + get_target_property(value ${target} TYPE) + get_target_property(value ${target} COMPILE_DEFINITIONS) + if (value) + foreach(item ${value}) + list(APPEND flags "-D${item}") + endforeach() + endif() + STRING(TOUPPER "COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE}" name) + get_target_property(value ${target} ${name}) + if (value) + foreach(item ${value}) + list(APPEND flags "-D${item}") + endforeach() + endif() + get_directory_property(value DEFINITIONS) + if (value) + list(APPEND flags ${value}) + endif() + get_directory_property(value INCLUDE_DIRECTORIES) + if (value) + foreach(item ${value}) + list(APPEND flags "-I${item}") + endforeach() + endif() + set(${out_flags} ${flags} PARENT_SCOPE) +endfunction() + +function(get_gcc_link_flags target out_flags) + set(flags) + get_target_property(value ${target} LINK_FLAGS_RELEASE) + if (value) + message(STATUS "-> ${flags}") + list(APPEND flags ${value}) + endif() + get_directory_property(value LINK_DIRECTORIES) + if (value) + message(STATUS "-> ${flags}") + foreach(item ${value}) + list(APPEND flags "-L${item}") + endforeach() + endif() + message(STATUS "-> ${flags}") + set(${out_flags} ${flags} PARENT_SCOPE) +endfunction() diff --git a/CMakeConfig.in.h b/CMakeConfig.in.h new file mode 100644 index 0000000..3080ed2 --- /dev/null +++ b/CMakeConfig.in.h @@ -0,0 +1,128 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +#ifndef HAVE_CONFIG_H +#define HAVE_CONFIG_H + +/* Compiler must have variadic macros */ +//#cmakedefine BOOST_PP_VARIADICS + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ASSERT_H + +/* Defined if the requested minimum BOOST version is satisfied */ +#cmakedefine HAVE_BOOST + +/* Define to 1 if you have */ +#cmakedefine HAVE_BOOST_ARCHIVE_TEXT_OARCHIVE_HPP + +/* Define to 1 if you have */ +#cmakedefine HAVE_BOOST_ARRAY_HPP + +/* Define to 1 if you have */ +#cmakedefine HAVE_BOOST_PROGRAM_OPTIONS_HPP + +/* Define to 1 if you have */ +#cmakedefine HAVE_BOOST_SIGNAL_HPP + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DLFCN_H + +/* Define to 1 if you have the `fesetround' function. */ +#cmakedefine HAVE_FESETROUND + +/* Define to 1 if you have the `floor' function. */ +#cmakedefine HAVE_FLOOR + +/* Having Geant4 installed */ +#cmakedefine HAVE_GEANT4 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H + +/* Define if you have libreadline */ +#cmakedefine HAVE_LIBREADLINE + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#cmakedefine HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H + +/* Define to 1 if you have the `pow' function. */ +#cmakedefine HAVE_POW + +/* Having root installed */ +#cmakedefine HAVE_ROOT + +/* Define to 1 if you have the `sqrt' function. */ +#cmakedefine HAVE_SQRT + +/* Define to 1 if stdbool.h conforms to C99. */ +#cmakedefine HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H + +/* Define to 1 if you have the `strdup' function. */ +#cmakedefine HAVE_STRDUP + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H + +/* Define to 1 if you have the `strstr' function. */ +#cmakedefine HAVE_STRSTR + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H + +/* Define to 1 if the system has the type `_Bool'. */ +#cmakedefine HAVE__BOOL + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#cmakedefine LT_OBJDIR + +/* Define to the address where bug reports for this package should be sent. */ +#cmakedefine PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#cmakedefine PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#cmakedefine PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#cmakedefine PACKAGE_URL "@PACKAGE_URL@" + +/* Define to the version of this package. */ +#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@" + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine STDC_HEADERS + +/* SVN revision number */ +#cmakedefine SVN_REVISION "@SVN_REVISION@" + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +#endif // HAVE_CONFIG_H diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..f571e46 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,234 @@ + +################################################################################ +##### CMAKE LISTS ############################################################## +################################################################################ + +cmake_minimum_required (VERSION 2.6) + +execute_process(COMMAND "clear") +message("//////////////////////////////////////////////////////////////////////") +message("/////////////////// CMAKE PJOJECT CONFIGURATION //////////////////////") +message("//////////////////////////////////////////////////////////////////////") + +## -------------------------------------------------------------------------- ## + +project(uLib) + +# The version number. +set(PROJECT_VERSION_MAJOR 0) +set(PROJECT_VERSION_MINOR 2) +set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") +set(PROJECT_SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") + +set(PACKAGE_VERSION ${PROJECT_VERSION}) +set(PACKAGE_NAME "mutom-${PROJECT_VERSION}" CACHE STRING "name of the package defined inside code (config.h)") +set(PACKAGE_LIBPREFIX "mutom" CACHE STRING "suffix for each library component name") +set(PACKAGE_URL "http:://mutom.pd.infn.it" CACHE STRING "url of the project") +set(PACKAGE_AUTHOR "Andrea Rigoni Garola ") + + +## MACROS ------------------------------------------------------------------- ## + +set(ULIB_CMAKE_DIR "${PROJECT_SOURCE_DIR}/CMake") +set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH}) +message(STATUS "Module path: ${CMAKE_MODULE_PATH}") + +include(uLibMacros) +include(uLibDebugMacro) +include(uLibTargetMacros) +include(uLibGenerateRMake) + + + +## GLOBALS ------------------------------------------------------------------ ## + +include(uLibCommon) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ") ## Add flags here ## + +enable_testing() + +## FIND PACKAGES ------------------------------------------------------------ ## + +include(uLibFindDependencies) + + +## CONFIG ------------------------------------------------------------------- ## + +include(uLibConfigHeader) + +## ADD LIBRARIES SUBDIRECTORIES --------------------------------------------- ## + +## select modules ## +set(ULIB_SELECTED_MODULES + ltk + Core + Math + Detectors + Root +) + +## uLib_add_shared_library puts names there +set(ULIB_SHARED_LIBRARIES) + +if(ULIB_USE_VTK) + LIST(APPEND ULIB_SELECTED_MODULES Vtk) +endif(ULIB_USE_VTK) + +## this gets ulib modules into a variable ## +function(uLib_modules result) + set(out) + foreach(module ${ULIB_SELECTED_MODULES}) + list(APPEND out ${PACKAGE_LIBPREFIX}${module}) + endforeach(module) + set(${result} "${out}" PARENT_SCOPE) +endfunction() + + +## ENTERING MODULES SUBDIRECTORIES ## +message("/////////// SELECTED MODULES //////////////") +foreach(module ${ULIB_SELECTED_MODULES}) + message(STATUS "adding module: ${module}") + set( uLib-module ${module}) + include_directories(${SRC_DIR}/${module}) + add_subdirectory(${SRC_DIR}/${module}) +endforeach(module) + +## SINGLE LIBRARY LINKING ## (work in progress ... ) +option(ULIB_SINGLELIBRARY "Link everything to a single library" OFF) +if(ULIB_SINGLELIBRARY) +# set(modgrp) +# foreach(module ${ULIB_SELECTED_MODULES}) +# set(grpn srcgrp_${module}) +# list(APPEND modgrp ${grpn}) +# endforeach(module) +# add_library(${project_name} SHARED ${srcgrp_Core}) +endif(ULIB_SINGLELIBRARY) + +## UTILITIES ## +add_subdirectory("${SRC_DIR}/utils/make_recipe") + + +## PKG CONFIG compatible file ----------------------------------------------- ## + +set(PKGCONFIG_FILE_ENABLE OFF CACHE BOOL "enable pkg-config file") +if(PKGCONFIG_FILE_ENABLE) +message("/////////// PKG-CONFIG DISTILLER //////////////") +set(PKGCONFIG_FILE_DESTDIR "/lib/pkgconfig/" CACHE PATH "destination path for pkg-config file") +set(PKGCONFIG_LIBS) + +message(STATUS "[cflags] ${CMAKE_C_FLAGS}") +message(STATUS "[cxxflags] ${CMAKE_CXX_FLAGS}") + +foreach(module ${ULIB_SHARED_LIBRARIES}) +set(PKGCONFIG_LIBS "${PKGCONFIG_LIBS} ${CMAKE_LINK_LIBRARY_FLAG}${module}") +endforeach(module) +message(STATUS "[libs] ${PKGCONFIG_LIBS}") + +set(PKGCONFIG_FLAGS) +#add_custom_target(Dummy) + +# add the executable +uLib_add_target(Dummy test.cpp) +target_link_libraries(Dummy ${PACKAGE_LIBPREFIX}Core) +target_link_libraries(Dummy ${Boost_SERIALIZATION_LIBRARY}) +target_link_libraries(Dummy ${Boost_SIGNALS_LIBRARY}) +target_link_libraries(Dummy ${Boost_PROGRAM_OPTIONS_LIBRARY}) +target_link_libraries(Dummy ${Geant4_LIBRARIES}) +target_link_libraries(Dummy ${ROOT_LIBRARIES}) +target_link_libraries(Dummy ${VTK_LIBRARIES}) + +get_gcc_compile_flags(Dummy, gcc_flags_list) +foreach(item ${gcc_flags_list}) + message(STATUS "[gcc cflags] ${item}") + set(PKGCONFIG_FLAGS "${PKGCONFIG_FLAGS} ${item}") +endforeach(item) +message(STATUS "[includes] ${PKGCONFIG_FLAGS}") + +get_gcc_link_flags(Dummy, gcc_flags_list) +foreach(item ${gcc_flags_list}) + message(STATUS "[gcc libs] ${item}") +endforeach(item) + +configure_file( + "${PROJECT_SOURCE_DIR}/CMakePkgConfig.pc.in" + "${PROJECT_BINARY_DIR}/libmutom-${PACKAGE_VERSION}.pc" + ) +INSTALL_FILES(${PKGCONFIG_FILE_DESTDIR} FILES ${PROJECT_BINARY_DIR}/libmutom-${PACKAGE_VERSION}.pc) + +message("///////////////////////////////////////////") +endif(PKGCONFIG_FILE_ENABLE) + + + + + +## INSTALLS AND EXPORTS ----------------------------------------------------- ## + +#export(PACKAGE uLib) +export(PACKAGE ULIB) +export(TARGETS ${ULIB_SHARED_LIBRARIES} ${ULIB_EXPORTED_TARGETS} + FILE "${PROJECT_BINARY_DIR}/uLibTargets.cmake" ) +#export(TARGETS ${ULIB_EXPORTED_TARGETS} +# FILE "${PROJECT_BINARY_DIR}/uLibExeTargets.cmake" ) + + +# Create the FooBarConfig.cmake and FooBarConfigVersion files +file(RELATIVE_PATH REL_INCLUDE_DIR "${PACKAGE_INSTALL_CMAKE_DIR}" + "${PACKAGE_INSTALL_INC_DIR}") +# ... for the build tree +set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src" "${PROJECT_BINARY_DIR}") +configure_file(uLibConfig.cmake.in + "${PROJECT_BINARY_DIR}/uLibConfig.cmake" @ONLY) +# ... for the install tree +set(CONF_INCLUDE_DIRS "\${ULIB_CMAKE_DIR}/${REL_INCLUDE_DIR}") +configure_file(uLibConfig.cmake.in + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/uLibConfig.cmake" @ONLY) +# ... for both +configure_file(uLibConfigVersion.cmake.in + "${PROJECT_BINARY_DIR}/uLibConfigVersion.cmake" @ONLY) + +# Install the FooBarConfig.cmake and FooBarConfigVersion.cmake +install(FILES + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/uLibConfig.cmake" + "${PROJECT_BINARY_DIR}/uLibConfigVersion.cmake" + DESTINATION "${PACKAGE_INSTALL_CMAKE_DIR}" COMPONENT dev) + +# Install the export set for use with the install-tree +install(EXPORT "${PROJECT_NAME}Targets" DESTINATION + "${PACKAGE_INSTALL_CMAKE_DIR}" COMPONENT dev) + +install(FILES ${PROJECT_SOURCE_DIR}/ulib.h DESTINATION ${PACKAGE_INSTALL_INC_DIR}) + + + +## dummy main executable ---------------------------------------------------- ## + +# add the executable +add_executable(Coretest test.cpp) +target_link_libraries(Coretest ${PACKAGE_LIBPREFIX}Core) +#target_link_libraries(Coretest ${Boost_SERIALIZATION_LIBRARY}) +#target_link_libraries(Coretest ${Boost_SIGNALS_LIBRARY}) +#target_link_libraries(Coretest ${Boost_PROGRAM_OPTIONS_LIBRARY}) +#target_link_libraries(Coretest ${Geant4_LIBRARIES}) +#target_link_libraries(Coretest ${ROOT_LIBRARIES}) +#target_link_libraries(Coretest ${VTK_LIBRARIES}) + +#message( "---------------------------------------------------------------------" ) +#execute_process(COMMAND +# "ls" +## "cmake --find-package -DNAME=uLib -DLANGUAGE=C -DCOMPILER_ID=GNU -DMODE=COMPILE" +# ) +#message( "---------------------------------------------------------------------" ) + +## -------------------------------------------------------------------------- ## + + +# TODO clean also subdirectories +add_custom_target(clean-cmake-files + COMMAND ${CMAKE_COMMAND} -P ${ULIB_CMAKE_DIR}/clean-all.cmake +) + + + + + diff --git a/CMakePkgConfig.pc.in b/CMakePkgConfig.pc.in new file mode 100644 index 0000000..408288f --- /dev/null +++ b/CMakePkgConfig.pc.in @@ -0,0 +1,13 @@ + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Mutom Library (INFN) +Description: Library for Muon Tomography experiments. +Url: @PACKAGE_URL@ +Version: @PACKAGE_VERSION@ +Requires: eigen3 +Libs: -L${libdir} @PKGCONFIG_LIBS@ +Cflags: @CMAKE_C_FLAGS@ @CMAKE_CXX_FLAGS@ @PKGCONFIG_INCLUDES@ diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Common.am b/Common.am new file mode 100644 index 0000000..6c97929 --- /dev/null +++ b/Common.am @@ -0,0 +1,54 @@ + + +if DEBUG +OPT = -D_DEBUG -g3 -O0 +OPT_LD = -no-install +else +OPT = -DNDEBUG -O3 +OPT_LD = +endif + +if PARAL_MP +OPEN_MP = -fopenmp +else +OPEN_MP = +endif + + + +# fix it with proper macro expansion +EIGEN = $(EIGEN3_CFLAGS) + +# Root Flags +ROOTCFLAGS = @ROOTCFLAGS@ +ROOTLDFLAGS = -L@ROOTLIBDIR@ + +# Boost required libraries +BOOST_FLAGS = $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SIGNALS_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LDFLAGS) +BOOST_LIBS = $(BOOST_SERIALIZATION_LIBS) $(BOOST_SIGNALS_LIBS) $(BOOST_PROGRAM_OPTIONS_LIBS) + +ULIB_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/src/ltk + +AM_CFLAGS = $(OPT) $(OPEN_MP) +AM_CXXFLAGS = -std=c++0x $(OPT) $(OPEN_MP) $(EIGEN) $(ROOTCFLAGS) $(GEANT4CFLAGS) $(BOOST_CPPFLAGS) $(ULIB_INCLUDES) $(QT4_CFLAGS) +AM_LDFLAGS = $(OPT_LD) $(ROOTLDFLAGS) # $(BOOST_FLAGS) + +AM_LIBS_ROOT = @ROOTLIBS@ +AM_LIBS_GEANT4 = $(GEANT4LIBS) +AM_LIBS_QT4 = $(QT4_LIBS) +AM_LIBS_BOOST = $(BOOST_LIBS) + +AM_LIBS_ALL = @LIBS@ \ + @LIBADD_DL@ \ + @LIBREADLINE@ \ + $(AM_LIBS_ROOT) \ + $(AM_LIBS_BOOST) \ + $(AM_LIBS_GEANT4) \ + $(AM_LIBS_QT4) + +AM_DEFAULT_SOURCE_EXT = .cpp + + +# clean_all: +# rm -f *~ *# *.vtk *.vti *.ply +# @echo "all cleaned up!" diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..01fbe1d --- /dev/null +++ b/Makefile.am @@ -0,0 +1,52 @@ +if ENABLE_VTK +VTK_SUBDIR = src/Vtk +VTK_CONLIB = src/Vtk/libconvtk.la +endif + +SUBDIRS = src $(VTK_SUBDIR) . + +ACLOCAL_AMFLAGS = -I m4 + +include Common.am + +if ENABLE_VTK +include src/Vtk/Vtk.am +endif + + +_uLib_SOURCES = + +library_includedir = $(includedir)/libmutom-${PACKAGE_VERSION}/ +library_include_HEADERS = config.h \ + ulib.h + + +bin_PROGRAMS = test +test_LDADD = libmutom-${PACKAGE_VERSION}.la $(AM_LIBS_BOOST) $(AM_LIBS_ROOT) + +if ENABLE_VTK +bin_PROGRAMS += vtk_test +vtk_test_LDADD = libmutom-${PACKAGE_VERSION}.la $(AM_LIBS_BOOST) $(AM_LIBS_ROOT) +endif + + +##PACKAGE_MAJOR=@PACKAGE_MAJOR@ +##PACKAGE_MINOR=@PACKAGE_MINOR@ + +LIBRARY_VERSION = 1:0:0 + +CONLIBS = src/Core/libmutomcore.la \ + src/Root/libmutomroot.la \ + src/Math/libmutommath.la \ + src/Detectors/libmutomdetectors.la + + +lib_LTLIBRARIES = libmutom-0.2.la +libmutom_0_2_la_SOURCES = ${_uLib_SOURCES} +libmutom_0_2_la_LDFLAGS = -version-info $(LIBRARY_VERSION) +libmutom_0_2_la_LIBADD = $(AM_LIBS_ALL) ${CONLIBS} ${VTK_CONLIB} +###libmutom_0_2_la_LDFLAGS = -release $(PACKAGE_VERSION) -version-info $(LIBRARY_VERSION) + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libmutom-${PACKAGE_VERSION}.pc + diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..4636cd2 --- /dev/null +++ b/README @@ -0,0 +1,2 @@ +//////////////// mugraphix ////////////////////// + diff --git a/SCRATCH.org b/SCRATCH.org new file mode 100644 index 0000000..e9e3bcb --- /dev/null +++ b/SCRATCH.org @@ -0,0 +1,14 @@ + + #+TITLE: Documento Scratch per la raccolta delle idee: + + +* IDEAS + +** TODO Uso dell __atribute__ transparent_union per l'accesso trasparente ai membri della union data in un vettore. +L'accesso union dichiarato anonimo e' incompatibile con il c99 questo potrebbe sistemare la cosa? + +** TODO Uso dell __attribute__ packed per salvare lo spazio dedicato alle union per i bitfield dei flags + + + +* ISSUES diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..c98ad8a --- /dev/null +++ b/bootstrap @@ -0,0 +1,21 @@ +#! /bin/sh + +ROOTDIR=`root-config --prefix` + +if [ -e /usr/share/aclocal/root.m4 ] +then + ROOTM4=. +elif [ -e $ROOTDIR/build/misc/root.m4 ] +then + ROOTM4=$ROOTDIR/build/misc +fi + +aclocal -I ./m4 + +autoheader + +libtoolize + +automake --add-missing --gnu + +autoconf diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..a906e6c --- /dev/null +++ b/configure.ac @@ -0,0 +1,210 @@ + +######################## +## CONFIG FILE FOR AC ## +######################## + +# M4 PREABLE + +# uLib version: +m4_define([uLib_major_version], [0]) +m4_define([uLib_minor_version], [2]) +# if the minor version number is odd, then we want debugging. Otherwise +# we only want minimal debugging support. +##m4_define([IB_debug_default], +## [m4_if(m4_eval(IB_minor_version % 2), [1], [yes])]) + + +########### INIT ####################################### +AC_INIT([MuSteel uLib],[uLib_major_version.uLib_minor_version],[andrea.rigoni@pd.infn.it]) +AM_INIT_AUTOMAKE([subdir-objects]) + +##AC_PREREQ([2.67]) +AC_CONFIG_MACRO_DIR([m4]) + + +AC_CONFIG_SRCDIR([ulib.h]) +AC_CONFIG_HEADERS([config.h]) + +# Checks for programs. +CFLAGS="" +CXXFLAGS="" +AC_PROG_CC +AC_PROG_CXX + + +######### ROOT MACROS ################################### +AC_DEFINE([HAVE_ROOT], [no], [Having root installed]) +ROOT_PATH( [5.0] , [HAVE_ROOT=1], [HAVE_ROOT=0]) +AM_CONDITIONAL(HAVE_ROOT, [test HAVE_ROOT=1]) +AS_IF([test HAVE_ROOT=1],[AC_DEFINE([HAVE_ROOT],[1],[])] ) + +AC_DEFINE([HAVE_GEANT4], [no], [Having Geant4 installed]) +GEANT4_PATH( [9.6] , [HAVE_GEANT4=1], [HAVE_GEANT4=0]) +AM_CONDITIONAL(HAVE_GEANT4, [test HAVE_GEANT4]) +AS_IF([test HAVE_GEANT4=1],[AC_DEFINE([HAVE_GEANT4],[1],[])] ) + +######### LIBTOOL ######################################## +AC_PROG_LIBTOOL +LIBADD_DL="-ldl" +AC_SUBST(LIBADD_DL) + +AC_SEARCH_LIBS([strerror],[cposix]) + +LT_INIT() +AC_SUBST([LIBTOOL_DEPS]) + + + +######### CHECKS ######################################## +# Checks for header files. +AC_CHECK_HEADERS([stdlib.h string.h assert.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_HEADER_STDBOOL +AC_C_INLINE +AC_TYPE_SIZE_T + +# Checks for library functions. +AC_FUNC_MALLOC +AC_CHECK_FUNCS([fesetround floor pow sqrt strdup strstr]) + +AC_SEARCH_LIBS([strerror],[cposix]) + +# Check for BOOST Libraries +BOOST_REQUIRE([1.34]) + +BOOST_ARRAY +# BOOST_DATE_TIME +BOOST_SERIALIZATION +BOOST_SIGNALS +BOOST_PROGRAM_OPTIONS(mt-p) + + +# Check for Vtk installation +AM_OPTIONS_VTK +AM_PATH_VTK([5.0],[HAVE_VTK=1],[HAVE_VTK=0]) +# AM_CONDITIONAL([HAVE_VTK], [test HAVE_VTK=1] ) # fix? +AM_CONDITIONAL([VTK_5_x], [1]) + + +PKG_CHECK_MODULES([EIGEN3],[eigen3 >= 0.1]) + +PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.4.0], [ + AC_PATH_PROGS(MOC, [moc-qt4 moc], moc,`eval pkg-config --variable=exec_prefix QtCore`/bin) + AC_PATH_PROG(RCC, rcc, rcc,`eval pkg-config --variable=exec_prefix QtCore`/bin) + AC_PATH_PROGS(UIC, [uic-qt4 uic], uic,`eval pkg-config --variable=exec_prefix QtCore`/bin) +],[HAVE_QT=0]) + + +########## CONDITIONALS ################################## + + +# Configure script arguments +dnl declare --enable-* args and collect ac_help strings +AC_ARG_ENABLE(debug, + AS_HELP_STRING([--enable-debug=no/yes],[turn on debugging, default: no]), +[case "${enableval}" in + yes) debug=true ;; + no) debug=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;; +esac], + [debug=false]) + +AC_ARG_ENABLE(parallel, + AS_HELP_STRING([--enable-parallel=no/yes],[turn on openMP parallel processing, default: yes]), +[case "${enableval}" in + yes) parallel=true ;; + no) parallel=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-parallel]) ;; +esac], + [parallel=true]) + +AC_ARG_ENABLE(autovector, + AS_HELP_STRING([--enable-autovector=no/yes],[turn on gcc auto vectorize loops with simd instructions, default: no]), +[case "${enableval}" in + yes) autovector=true ;; + no) autovector=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-autovector]) ;; +esac], + [autovector=false]) + +AC_ARG_ENABLE(vtk, + AS_HELP_STRING([--enable-vtk=no/yes],[turn on vtk visualization wrappers, default: no]), +[case "${enableval}" in + yes) vtk=true ;; + no) vtk=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-vtk]) ;; +esac], + [vtk=false]) + + +AC_ARG_WITH([readline], +[AS_HELP_STRING([--with-readline], +[support fancy command line editing @<:@default=check@:>@])], +[], +[with_readline=check]) + +LIBREADLINE= +AS_IF([test "x$with_readline" != xno], +[AC_CHECK_LIB([readline], [main], +[AC_SUBST([LIBREADLINE], ["-lreadline -lncurses"]) +AC_DEFINE([HAVE_LIBREADLINE], [1], +[Define if you have libreadline]) +], +[if test "x$with_readline" != xcheck; then +AC_MSG_FAILURE( +[--with-readline was given, but test for readline failed]) +fi +], -lncurses)]) + +AM_CONDITIONAL(DEBUG, test x"$debug" = x"true") +AM_CONDITIONAL(PARAL_MP, test x"$parallel" = x"true") +AM_CONDITIONAL(SIMD_AUTOVECTOR, test x"$autovector" = x"true") +AM_CONDITIONAL(ENABLE_VTK, [test x"$vtk" = x"true"]) + + +SVN_REVISION=`svnversion .` +AC_SUBST(SVN_REVISION) +AC_DEFINE_UNQUOTED(SVN_REVISION,"$SVN_REVISION",[SVN revision number]) + +# Forcing variadic macro compiler feature (for gcc without cxx11 flag) +AC_DEFINE_UNQUOTED(BOOST_PP_VARIADICS,1,[Compiler must have variadic macros]) + + + +######### MAKEFILES ######################################### + + +AC_CONFIG_FILES([ + Makefile + src/Makefile + src/ltk/Makefile + src/ltk/testing/Makefile + src/Core/Makefile + src/Core/testing/Makefile + src/Core/testing/ObjectMock/Makefile + src/Core/testing/SignalMock/Makefile + src/Core/testing/SerializeMock/Makefile + src/Root/Makefile + src/Root/testing/Makefile + src/Math/Makefile + src/Math/testing/Makefile + src/Detectors/Makefile + src/Detectors/testing/Makefile + src/ParticlePhysics/MuonTomography/Makefile + src/ParticlePhysics/Geant/Makefile + src/Vtk/Makefile + src/Vtk/testing/Makefile + src/Gui/Qt/QVTKViewport2/Makefile + tmp/BuildTruck/Makefile + libmutom-0.2.pc + ]) +AC_OUTPUT + +# src/Vtk/Math/Makefile +# src/Vtk/Math/testing/Makefile +# src/Vtk/Detectors/Makefile +# src/Vtk/Detectors/testing/Makefile +# src/Vtk/ParticlePhysics/MuonTomography/Makefile +# src/Vtk/ParticlePhysics/Geant/Makefile + diff --git a/libmutom-0.2.pc.in b/libmutom-0.2.pc.in new file mode 100644 index 0000000..179a4f3 --- /dev/null +++ b/libmutom-0.2.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Mutom Library (INFN) +Description: Library for Muon Tomography experiments. +Requires: eigen3 +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lmutom-0.2 -lboost_program_options +Cflags: -I${includedir}/libmutom-@PACKAGE_VERSION@ -I${libdir}/libmutom-@PACKAGE_VERSION@/include diff --git a/m4/boost.m4 b/m4/boost.m4 new file mode 100644 index 0000000..35df3f7 --- /dev/null +++ b/m4/boost.m4 @@ -0,0 +1,1186 @@ +# boost.m4: Locate Boost headers and libraries for autoconf-based projects. +# Copyright (C) 2007, 2008, 2009, 2010, 2011 Benoit Sigoure +# +# 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 3 of the License, or +# (at your option) any later version. +# +# Additional permission under section 7 of the GNU General Public +# License, version 3 ("GPLv3"): +# +# If you convey this file as part of a work that contains a +# configuration script generated by Autoconf, you may do so under +# terms of your choice. +# +# 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, see . + +m4_define([_BOOST_SERIAL], [m4_translit([ +# serial 16 +], [# +], [])]) + +# Original sources can be found at http://github.com/tsuna/boost.m4 +# You can fetch the latest version of the script by doing: +# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4 + +# ------ # +# README # +# ------ # + +# This file provides several macros to use the various Boost libraries. +# The first macro is BOOST_REQUIRE. It will simply check if it's possible to +# find the Boost headers of a given (optional) minimum version and it will +# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to +# your configure so that users can specify non standard locations. +# If the user's environment contains BOOST_ROOT and --with-boost was not +# specified, --with-boost=$BOOST_ROOT is implicitly used. +# For more README and documentation, go to http://github.com/tsuna/boost.m4 +# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry, +# simply read the README, it will show you what to do step by step. + +m4_pattern_forbid([^_?(BOOST|Boost)_]) + + +# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# -------------------------------------------------------- +# Same as AC_EGREP_CPP, but leave the result in conftest.i. +# +# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded +# in double-quotes, so escape your double quotes. +# +# It could be useful to turn this into a macro which extracts the +# value of any macro. +m4_define([_BOOST_SED_CPP], +[AC_LANG_PREPROC_REQUIRE()dnl +AC_REQUIRE([AC_PROG_SED])dnl +AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) +AS_IF([dnl eval is necessary to expand ac_cpp. +dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. +dnl Beware of Windows end-of-lines, for instance if we are running +dnl some Windows programs under Wine. In that case, boost/version.hpp +dnl is certainly using "\r\n", but the regular Unix shell will only +dnl strip `\n' with backquotes, not the `\r'. This results in +dnl boost_cv_lib_version='1_37\r' for instance, which breaks +dnl everything else. +dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK +(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | + tr -d '\r' | + $SED -n -e "$1" >conftest.i 2>&1], + [$3], + [$4]) +rm -rf conftest* +])# AC_EGREP_CPP + + + +# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND]) +# ----------------------------------------------- +# Look for Boost. If version is given, it must either be a literal of the form +# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a +# variable "$var". +# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with +# the required version, it does not check for any of the Boost libraries. +# On # success, defines HAVE_BOOST. On failure, calls the optional +# ACTION-IF-NOT-FOUND action if one was supplied. +# Otherwise aborts with an error message. +AC_DEFUN([BOOST_REQUIRE], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_PROG_GREP])dnl +echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD +boost_save_IFS=$IFS +boost_version_req=$1 +IFS=. +set x $boost_version_req 0 0 0 +IFS=$boost_save_IFS +shift +boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"` +boost_version_req_string=$[1].$[2].$[3] +AC_ARG_WITH([boost], + [AS_HELP_STRING([--with-boost=DIR], + [prefix of Boost $1 @<:@guess@:>@])])dnl +AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl +# If BOOST_ROOT is set and the user has not provided a value to +# --with-boost, then treat BOOST_ROOT as if it the user supplied it. +if test x"$BOOST_ROOT" != x; then + if test x"$with_boost" = x; then + AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT]) + with_boost=$BOOST_ROOT + else + AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost]) + fi +fi +AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], + ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl +boost_save_CPPFLAGS=$CPPFLAGS + AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string], + [boost_cv_inc_path], + [boost_cv_inc_path=no +AC_LANG_PUSH([C++])dnl +m4_pattern_allow([^BOOST_VERSION$])dnl + AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include +#if !defined BOOST_VERSION +# error BOOST_VERSION is not defined +#elif BOOST_VERSION < $boost_version_req +# error Boost headers version < $boost_version_req +#endif +]])]) + # If the user provided a value to --with-boost, use it and only it. + case $with_boost in #( + ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \ + /usr/include C:/Boost/include;; #( + *) set x "$with_boost/include" "$with_boost";; + esac + shift + for boost_dir + do + # Without --layout=system, Boost (or at least some versions) installs + # itself in /include/boost-. This inner loop helps to + # find headers in such directories. + # + # Any ${boost_dir}/boost-x_xx directories are searched in reverse version + # order followed by ${boost_dir}. The final '.' is a sentinel for + # searching $boost_dir" itself. Entries are whitespace separated. + # + # I didn't indent this loop on purpose (to avoid over-indented code) + boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \ + && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \ + && echo .` + for boost_inc in $boost_layout_system_search_list + do + if test x"$boost_inc" != x.; then + boost_inc="$boost_dir/$boost_inc" + else + boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list + fi + if test x"$boost_inc" != x; then + # We are going to check whether the version of Boost installed + # in $boost_inc is usable by running a compilation that + # #includes it. But if we pass a -I/some/path in which Boost + # is not installed, the compiler will just skip this -I and + # use other locations (either from CPPFLAGS, or from its list + # of system include directories). As a result we would use + # header installed on the machine instead of the /some/path + # specified by the user. So in that precise case (trying + # $boost_inc), make sure the version.hpp exists. + # + # Use test -e as there can be symlinks. + test -e "$boost_inc/boost/version.hpp" || continue + CPPFLAGS="$CPPFLAGS -I$boost_inc" + fi + AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no]) + if test x"$boost_cv_inc_path" = xyes; then + if test x"$boost_inc" != x; then + boost_cv_inc_path=$boost_inc + fi + break 2 + fi + done + done +AC_LANG_POP([C++])dnl + ]) + case $boost_cv_inc_path in #( + no) + boost_errmsg="cannot find Boost headers version >= $boost_version_req_string" + m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])], + [AC_MSG_NOTICE([$boost_errmsg])]) + $2 + ;;#( + yes) + BOOST_CPPFLAGS= + ;;#( + *) + AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl + ;; + esac + if test x"$boost_cv_inc_path" != xno; then + AC_DEFINE([HAVE_BOOST], [1], + [Defined if the requested minimum BOOST version is satisfied]) + AC_CACHE_CHECK([for Boost's header version], + [boost_cv_lib_version], + [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl + _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;q;}], + [#include +boost-lib-version = BOOST_LIB_VERSION], + [boost_cv_lib_version=`cat conftest.i`])]) + # e.g. "134" for 1_34_1 or "135" for 1_35 + boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` + case $boost_major_version in #( + '' | *[[!0-9]]*) + AC_MSG_ERROR([invalid value: boost_major_version=$boost_major_version]) + ;; + esac +fi +CPPFLAGS=$boost_save_CPPFLAGS +])# BOOST_REQUIRE + +# BOOST_STATIC() +# -------------- +# Add the "--enable-static-boost" configure argument. If this argument is given +# on the command line, static versions of the libraries will be looked up. +AC_DEFUN([BOOST_STATIC], + [AC_ARG_ENABLE([static-boost], + [AS_HELP_STRING([--enable-static-boost], + [Prefer the static boost libraries over the shared ones [no]])], + [enable_static_boost=yes], + [enable_static_boost=no])])# BOOST_STATIC + +# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND]) +# -------------------------------------------------------------------------- +# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for +# some parts of the Boost library which are only made of headers and don't +# require linking (such as Boost.Foreach). +# +# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be +# found in the first place, in which case by default a notice is issued to the +# user. Presumably if we haven't died already it's because it's OK to not have +# Boost, which is why only a notice is issued instead of a hard error. +# +# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_ in +# case of success # (where HEADER-NAME is written LIKE_THIS, e.g., +# HAVE_BOOST_FOREACH_HPP). +AC_DEFUN([BOOST_FIND_HEADER], +[AC_REQUIRE([BOOST_REQUIRE])dnl +if test x"$boost_cv_inc_path" = xno; then + m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])]) +else +AC_LANG_PUSH([C++])dnl +boost_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +AC_CHECK_HEADER([$1], + [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1], + [Define to 1 if you have <$1>])])], + [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])]) +CPPFLAGS=$boost_save_CPPFLAGS +AC_LANG_POP([C++])dnl +fi +])# BOOST_FIND_HEADER + + +# BOOST_FIND_LIB([LIB-NAME], [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], +# [CXX-PROLOGUE]) +# ------------------------------------------------------------------------- +# Look for the Boost library LIB-NAME (e.g., LIB-NAME = `thread', for +# libboost_thread). Check that HEADER-NAME works and check that +# libboost_LIB-NAME can link with the code CXX-TEST. The optional argument +# CXX-PROLOGUE can be used to include some C++ code before the `main' +# function. +# +# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above). +# +# Boost libraries typically come compiled with several flavors (with different +# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one +# or more of the following letters: sgdpn (in that order). s = static +# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build, +# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n' +# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can +# start with `mt-' to indicate that there is a preference for multi-thread +# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp +# ... If you want to make sure you have a specific version of Boost +# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro. +AC_DEFUN([BOOST_FIND_LIB], +[AC_REQUIRE([BOOST_REQUIRE])dnl +AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl +AC_REQUIRE([BOOST_STATIC])dnl +AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl +if test x"$boost_cv_inc_path" = xno; then + AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library]) +else +dnl The else branch is huge and wasn't intended on purpose. +AC_LANG_PUSH([C++])dnl +AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl +AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl +AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl +AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl +BOOST_FIND_HEADER([$3]) +boost_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +# Now let's try to find the library. The algorithm is as follows: first look +# for a given library name according to the user's PREFERRED-RT-OPT. For each +# library name, we prefer to use the ones that carry the tag (toolset name). +# Each library is searched through the various standard paths were Boost is +# usually installed. If we can't find the standard variants, we try to +# enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist +# but there's -obviously- libboost_threads-mt.dylib). +AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib], + [Boost_lib=no + case "$2" in #( + mt | mt-) boost_mt=-mt; boost_rtopt=;; #( + mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$2" : 'Xmt-*\(.*\)'`;; #( + *) boost_mt=; boost_rtopt=$2;; + esac + if test $enable_static_boost = yes; then + boost_rtopt="s$boost_rtopt" + fi + # Find the proper debug variant depending on what we've been asked to find. + case $boost_rtopt in #( + *d*) boost_rt_d=$boost_rtopt;; #( + *[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn') + boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( + *) boost_rt_d='-d';; + esac + # If the PREFERRED-RT-OPT are not empty, prepend a `-'. + test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" + $boost_guess_use_mt && boost_mt=-mt + # Look for the abs path the static archive. + # $libext is computed by Libtool but let's make sure it's non empty. + test -z "$libext" && + AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?]) + boost_save_ac_objext=$ac_objext + # Generate the test file. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$3> +$5], [$4])]) +dnl Optimization hacks: compiling C++ is slow, especially with Boost. What +dnl we're trying to do here is guess the right combination of link flags +dnl (LIBS / LDFLAGS) to use a given library. This can take several +dnl iterations before it succeeds and is thus *very* slow. So what we do +dnl instead is that we compile the code first (and thus get an object file, +dnl typically conftest.o). Then we try various combinations of link flags +dnl until we succeed to link conftest.o in an executable. The problem is +dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always +dnl remove all the temporary files including conftest.o. So the trick here +dnl is to temporarily change the value of ac_objext so that conftest.o is +dnl preserved accross tests. This is obviously fragile and I will burn in +dnl hell for not respecting Autoconf's documented interfaces, but in the +dnl mean time, it optimizes the macro by a factor of 5 to 30. +dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left +dnl empty because the test file is generated only once above (before we +dnl start the for loops). + AC_COMPILE_IFELSE([], + [ac_objext=do_not_rm_me_plz], + [AC_MSG_ERROR([cannot compile a test that uses Boost $1])]) + ac_objext=$boost_save_ac_objext + boost_failed_libs= +# Don't bother to ident the 6 nested for loops, only the 2 innermost ones +# matter. +for boost_tag_ in -$boost_cv_lib_tag ''; do +for boost_ver_ in -$boost_cv_lib_version ''; do +for boost_mt_ in $boost_mt -mt ''; do +for boost_rtopt_ in $boost_rtopt '' -d; do + for boost_lib in \ + boost_$1$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ + boost_$1$boost_tag_$boost_rtopt_$boost_ver_ \ + boost_$1$boost_tag_$boost_mt_$boost_ver_ \ + boost_$1$boost_tag_$boost_ver_ + do + # Avoid testing twice the same lib + case $boost_failed_libs in #( + *@$boost_lib@*) continue;; + esac + # If with_boost is empty, we'll search in /lib first, which is not quite + # right so instead we'll try to a location based on where the headers are. + boost_tmp_lib=$with_boost + test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} + for boost_ldpath in "$boost_tmp_lib/lib" '' \ + /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ + "$with_boost" C:/Boost/lib /lib* + do + test -e "$boost_ldpath" || continue + boost_save_LDFLAGS=$LDFLAGS + # Are we looking for a static library? + case $boost_ldpath:$boost_rtopt_ in #( + *?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) + Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext" + test -e "$Boost_lib_LIBS" || continue;; #( + *) # No: use -lboost_foo to find the shared library. + Boost_lib_LIBS="-l$boost_lib";; + esac + boost_save_LIBS=$LIBS + LIBS="$Boost_lib_LIBS $LIBS" + test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" +dnl First argument of AC_LINK_IFELSE left empty because the test file is +dnl generated only once above (before we start the for loops). + _BOOST_AC_LINK_IFELSE([], + [Boost_lib=yes], [Boost_lib=no]) + ac_objext=$boost_save_ac_objext + LDFLAGS=$boost_save_LDFLAGS + LIBS=$boost_save_LIBS + if test x"$Boost_lib" = xyes; then + Boost_lib_LDFLAGS="-L$boost_ldpath -Wl,-R$boost_ldpath" + Boost_lib_LDPATH="$boost_ldpath" + break 6 + else + boost_failed_libs="$boost_failed_libs@$boost_lib@" + fi + done + done +done +done +done +done +rm -f conftest.$ac_objext +]) +case $Boost_lib in #( + no) _AC_MSG_LOG_CONFTEST + AC_MSG_ERROR([cannot find the flags to link with Boost $1]) + ;; +esac +AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl +AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl +AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl +AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl +CPPFLAGS=$boost_save_CPPFLAGS +AS_VAR_POPDEF([Boost_lib])dnl +AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl +AS_VAR_POPDEF([Boost_lib_LDPATH])dnl +AS_VAR_POPDEF([Boost_lib_LIBS])dnl +AC_LANG_POP([C++])dnl +fi +])# BOOST_FIND_LIB + + +# --------------------------------------- # +# Checks for the various Boost libraries. # +# --------------------------------------- # + +# List of boost libraries: http://www.boost.org/libs/libraries.htm +# The page http://beta.boost.org/doc/libs is useful: it gives the first release +# version of each library (among other things). + +# BOOST_DEFUN(LIBRARY, CODE) +# -------------------------- +# Define BOOST_ as a macro that runs CODE. +# +# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN. +m4_define([BOOST_DEFUN], +[m4_indir([AC_DEFUN], + m4_toupper([BOOST_$1]), +[m4_pushdef([BOOST_Library], [$1])dnl +$2 +m4_popdef([BOOST_Library])dnl +]) +]) + +# BOOST_ARRAY() +# ------------- +# Look for Boost.Array +BOOST_DEFUN([Array], +[BOOST_FIND_HEADER([boost/array.hpp])]) + + +# BOOST_ASIO() +# ------------ +# Look for Boost.Asio (new in Boost 1.35). +BOOST_DEFUN([Asio], +[AC_REQUIRE([BOOST_SYSTEM])dnl +BOOST_FIND_HEADER([boost/asio.hpp])]) + + +# BOOST_BIND() +# ------------ +# Look for Boost.Bind +BOOST_DEFUN([Bind], +[BOOST_FIND_HEADER([boost/bind.hpp])]) + + +# BOOST_CHRONO() +# ------------------ +# Look for Boost.Chrono +BOOST_DEFUN([Chrono], +[# Do we have to check for Boost.System? This link-time dependency was +# added as of 1.35.0. If we have a version <1.35, we must not attempt to +# find Boost.System as it didn't exist by then. +if test $boost_major_version -ge 135; then +BOOST_SYSTEM([$1]) +fi # end of the Boost.System check. +boost_filesystem_save_LIBS=$LIBS +boost_filesystem_save_LDFLAGS=$LDFLAGS +m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl +LIBS="$LIBS $BOOST_SYSTEM_LIBS" +LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" +BOOST_FIND_LIB([chrono], [$1], + [boost/chrono.hpp], + [boost::chrono::thread_clock d;]) +if test $enable_static_boost = yes && test $boost_major_version -ge 135; then + AC_SUBST([BOOST_FILESYSTEM_LIBS], ["$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"]) +fi +LIBS=$boost_filesystem_save_LIBS +LDFLAGS=$boost_filesystem_save_LDFLAGS + +])# BOOST_CHRONO + + +# BOOST_CONVERSION() +# ------------------ +# Look for Boost.Conversion (cast / lexical_cast) +BOOST_DEFUN([Conversion], +[BOOST_FIND_HEADER([boost/cast.hpp]) +BOOST_FIND_HEADER([boost/lexical_cast.hpp]) +])# BOOST_CONVERSION + + +# BOOST_DATE_TIME([PREFERRED-RT-OPT]) +# ----------------------------------- +# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Date_Time], +[BOOST_FIND_LIB([date_time], [$1], + [boost/date_time/posix_time/posix_time.hpp], + [boost::posix_time::ptime t;]) +])# BOOST_DATE_TIME + + +# BOOST_FILESYSTEM([PREFERRED-RT-OPT]) +# ------------------------------------ +# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see +# the documentation of BOOST_FIND_LIB above. +# Do not check for boost/filesystem.hpp because this file was introduced in +# 1.34. +BOOST_DEFUN([Filesystem], +[# Do we have to check for Boost.System? This link-time dependency was +# added as of 1.35.0. If we have a version <1.35, we must not attempt to +# find Boost.System as it didn't exist by then. +if test $boost_major_version -ge 135; then +BOOST_SYSTEM([$1]) +fi # end of the Boost.System check. +boost_filesystem_save_LIBS=$LIBS +boost_filesystem_save_LDFLAGS=$LDFLAGS +m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl +LIBS="$LIBS $BOOST_SYSTEM_LIBS" +LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" +BOOST_FIND_LIB([filesystem], [$1], + [boost/filesystem/path.hpp], [boost::filesystem::path p;]) +if test $enable_static_boost = yes && test $boost_major_version -ge 135; then + AC_SUBST([BOOST_FILESYSTEM_LIBS], ["$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"]) +fi +LIBS=$boost_filesystem_save_LIBS +LDFLAGS=$boost_filesystem_save_LDFLAGS +])# BOOST_FILESYSTEM + + +# BOOST_FOREACH() +# --------------- +# Look for Boost.Foreach +BOOST_DEFUN([Foreach], +[BOOST_FIND_HEADER([boost/foreach.hpp])]) + + +# BOOST_FORMAT() +# -------------- +# Look for Boost.Format +# Note: we can't check for boost/format/format_fwd.hpp because the header isn't +# standalone. It can't be compiled because it triggers the following error: +# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std' +# does not name a type +BOOST_DEFUN([Format], +[BOOST_FIND_HEADER([boost/format.hpp])]) + + +# BOOST_FUNCTION() +# ---------------- +# Look for Boost.Function +BOOST_DEFUN([Function], +[BOOST_FIND_HEADER([boost/function.hpp])]) + + +# BOOST_GRAPH([PREFERRED-RT-OPT]) +# ------------------------------- +# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Graph], +[BOOST_FIND_LIB([graph], [$1], + [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;]) +])# BOOST_GRAPH + + +# BOOST_IOSTREAMS([PREFERRED-RT-OPT]) +# ----------------------------------- +# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([IOStreams], +[BOOST_FIND_LIB([iostreams], [$1], + [boost/iostreams/device/file_descriptor.hpp], + [boost::iostreams::file_descriptor fd; fd.close();]) +])# BOOST_IOSTREAMS + + +# BOOST_HASH() +# ------------ +# Look for Boost.Functional/Hash +BOOST_DEFUN([Hash], +[BOOST_FIND_HEADER([boost/functional/hash.hpp])]) + + +# BOOST_LAMBDA() +# -------------- +# Look for Boost.Lambda +BOOST_DEFUN([Lambda], +[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])]) + + +# BOOST_LOG([PREFERRED-RT-OPT]) +# ----------------------------- +# Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Log], +[BOOST_FIND_LIB([log], [$1], + [boost/log/core/core.hpp], + [boost::log::attribute a; a.get_value();]) +])# BOOST_LOG + + +# BOOST_LOG_SETUP([PREFERRED-RT-OPT]) +# ----------------------------------- +# Look for Boost.Log For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Log_Setup], +[AC_REQUIRE([BOOST_LOG])dnl +BOOST_FIND_LIB([log_setup], [$1], + [boost/log/utility/init/from_settings.hpp], + [boost::log::basic_settings bs; bs.empty();]) +])# BOOST_LOG_SETUP + + +# BOOST_MATH() +# ------------ +# Look for Boost.Math +# TODO: This library isn't header-only but it comes in multiple different +# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99, +# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1, +# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the +# right thing anyway. +BOOST_DEFUN([Math], +[BOOST_FIND_HEADER([boost/math/special_functions.hpp])]) + + +# BOOST_MULTIARRAY() +# ------------------ +# Look for Boost.MultiArray +BOOST_DEFUN([MultiArray], +[BOOST_FIND_HEADER([boost/multi_array.hpp])]) + + +# BOOST_NUMERIC_CONVERSION() +# -------------------------- +# Look for Boost.NumericConversion (policy-based numeric conversion) +BOOST_DEFUN([Numeric_Conversion], +[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp]) +])# BOOST_NUMERIC_CONVERSION + + +# BOOST_OPTIONAL() +# ---------------- +# Look for Boost.Optional +BOOST_DEFUN([Optional], +[BOOST_FIND_HEADER([boost/optional.hpp])]) + + +# BOOST_PREPROCESSOR() +# -------------------- +# Look for Boost.Preprocessor +BOOST_DEFUN([Preprocessor], +[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])]) + + +# BOOST_UNORDERED() +# ----------------- +# Look for Boost.Unordered +BOOST_DEFUN([Unordered], +[BOOST_FIND_HEADER([boost/unordered_map.hpp])]) + + +# BOOST_UUID() +# ------------ +# Look for Boost.Uuid +BOOST_DEFUN([Uuid], +[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])]) + + +# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT]) +# ----------------------------------------- +# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, +# see the documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Program_Options], +[BOOST_FIND_LIB([program_options], [$1], + [boost/program_options.hpp], + [boost::program_options::options_description d("test");]) +])# BOOST_PROGRAM_OPTIONS + + + +# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG) +# ------------------------------------ +# Save VARIABLE, and define it via `python-config --FLAG`. +# Substitute BOOST_PYTHON_VARIABLE. +m4_define([_BOOST_PYTHON_CONFIG], +[AC_SUBST([BOOST_PYTHON_$1], + [`python-config --$2 2>/dev/null`])dnl +boost_python_save_$1=$$1 +$1="$$1 $BOOST_PYTHON_$1"]) + + +# BOOST_PYTHON([PREFERRED-RT-OPT]) +# -------------------------------- +# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT, +# see the documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Python], +[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes]) +_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags]) +_BOOST_PYTHON_CONFIG([LIBS], [libs]) +m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl +BOOST_FIND_LIB([python], [$1], + [boost/python.hpp], + [], [BOOST_PYTHON_MODULE(empty) {}]) +CPPFLAGS=$boost_python_save_CPPFLAGS +LDFLAGS=$boost_python_save_LDFLAGS +LIBS=$boost_python_save_LIBS +])# BOOST_PYTHON + + +# BOOST_REF() +# ----------- +# Look for Boost.Ref +BOOST_DEFUN([Ref], +[BOOST_FIND_HEADER([boost/ref.hpp])]) + + +# BOOST_REGEX([PREFERRED-RT-OPT]) +# ------------------------------- +# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Regex], +[BOOST_FIND_LIB([regex], [$1], + [boost/regex.hpp], + [boost::regex exp("*"); boost::regex_match("foo", exp);]) +])# BOOST_REGEX + + +# BOOST_SERIALIZATION([PREFERRED-RT-OPT]) +# --------------------------------------- +# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see +# the documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Serialization], +[BOOST_FIND_LIB([serialization], [$1], + [boost/archive/text_oarchive.hpp], + [std::ostream* o = 0; // Cheap way to get an ostream... + boost::archive::text_oarchive t(*o);]) +])# BOOST_SERIALIZATION + + +# BOOST_SIGNALS([PREFERRED-RT-OPT]) +# --------------------------------- +# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Signals], +[BOOST_FIND_LIB([signals], [$1], + [boost/signal.hpp], + [boost::signal s;]) +])# BOOST_SIGNALS + + +# BOOST_SMART_PTR() +# ----------------- +# Look for Boost.SmartPtr +BOOST_DEFUN([Smart_Ptr], +[BOOST_FIND_HEADER([boost/scoped_ptr.hpp]) +BOOST_FIND_HEADER([boost/shared_ptr.hpp]) +]) + + +# BOOST_STATICASSERT() +# -------------------- +# Look for Boost.StaticAssert +BOOST_DEFUN([StaticAssert], +[BOOST_FIND_HEADER([boost/static_assert.hpp])]) + + +# BOOST_STRING_ALGO() +# ------------------- +# Look for Boost.StringAlgo +BOOST_DEFUN([String_Algo], +[BOOST_FIND_HEADER([boost/algorithm/string.hpp]) +]) + + +# BOOST_SYSTEM([PREFERRED-RT-OPT]) +# -------------------------------- +# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. This library was introduced in Boost +# 1.35.0. +BOOST_DEFUN([System], +[BOOST_FIND_LIB([system], [$1], + [boost/system/error_code.hpp], + [boost::system::error_code e; e.clear();]) +])# BOOST_SYSTEM + + +# BOOST_TEST([PREFERRED-RT-OPT]) +# ------------------------------ +# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Test], +[m4_pattern_allow([^BOOST_CHECK$])dnl +BOOST_FIND_LIB([unit_test_framework], [$1], + [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);], + [using boost::unit_test::test_suite; + test_suite* init_unit_test_suite(int argc, char ** argv) + { return NULL; }]) +])# BOOST_TEST + + +# BOOST_THREADS([PREFERRED-RT-OPT]) +# --------------------------------- +# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +# FIXME: Provide an alias "BOOST_THREAD". +BOOST_DEFUN([Threads], +[dnl Having the pthread flag is required at least on GCC3 where +dnl boost/thread.hpp would complain if we try to compile without +dnl -pthread on GNU/Linux. +AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl +boost_threads_save_LIBS=$LIBS +boost_threads_save_LDFLAGS=$LDFLAGS +boost_threads_save_CPPFLAGS=$CPPFLAGS +# Link-time dependency from thread to system was added as of 1.49.0. +if test $boost_major_version -ge 149; then +BOOST_SYSTEM([$1]) +fi # end of the Boost.System check. +m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl +LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" +LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" +# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3, +# boost/thread.hpp will trigger a #error if -pthread isn't used: +# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support +# is not turned on. Please set the correct command line options for +# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" +CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag" + +# When compiling for the Windows platform, the threads library is named +# differently. +case $host_os in + (*mingw*) + BOOST_FIND_LIB([thread_win32], [$1], + [boost/thread.hpp], [boost::thread t; boost::mutex m;]) + BOOST_THREAD_LDFLAGS=$BOOST_THREAD_WIN32_LDFLAGS + BOOST_THREAD_LDPATH=$BOOST_THREAD_WIN32_LDPATH + BOOST_THREAD_LIBS=$BOOST_THREAD_WIN32_LIBS + ;; + (*) + BOOST_FIND_LIB([thread], [$1], + [boost/thread.hpp], [boost::thread t; boost::mutex m;]) + ;; +esac + +BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" +BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS" +BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag" +LIBS=$boost_threads_save_LIBS +LDFLAGS=$boost_threads_save_LDFLAGS +CPPFLAGS=$boost_threads_save_CPPFLAGS +])# BOOST_THREADS + + +# BOOST_TOKENIZER() +# ----------------- +# Look for Boost.Tokenizer +BOOST_DEFUN([Tokenizer], +[BOOST_FIND_HEADER([boost/tokenizer.hpp])]) + + +# BOOST_TRIBOOL() +# --------------- +# Look for Boost.Tribool +BOOST_DEFUN([Tribool], +[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp]) +BOOST_FIND_HEADER([boost/logic/tribool.hpp]) +]) + + +# BOOST_TUPLE() +# ------------- +# Look for Boost.Tuple +BOOST_DEFUN([Tuple], +[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])]) + + +# BOOST_TYPETRAITS() +# -------------------- +# Look for Boost.TypeTraits +BOOST_DEFUN([TypeTraits], +[BOOST_FIND_HEADER([boost/type_traits.hpp])]) + + +# BOOST_UTILITY() +# --------------- +# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom, +# etc.) +BOOST_DEFUN([Utility], +[BOOST_FIND_HEADER([boost/utility.hpp])]) + + +# BOOST_VARIANT() +# --------------- +# Look for Boost.Variant. +BOOST_DEFUN([Variant], +[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp]) +BOOST_FIND_HEADER([boost/variant.hpp])]) + + +# BOOST_WAVE([PREFERRED-RT-OPT]) +# ------------------------------ +# NOTE: If you intend to use Wave/Spirit with thread support, make sure you +# call BOOST_THREADS first. +# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the +# documentation of BOOST_FIND_LIB above. +BOOST_DEFUN([Wave], +[AC_REQUIRE([BOOST_FILESYSTEM])dnl +AC_REQUIRE([BOOST_DATE_TIME])dnl +boost_wave_save_LIBS=$LIBS +boost_wave_save_LDFLAGS=$LDFLAGS +m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl +LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \ +$BOOST_THREAD_LIBS" +LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \ +$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS" +BOOST_FIND_LIB([wave], [$1], + [boost/wave.hpp], + [boost::wave::token_id id; get_token_name(id);]) +LIBS=$boost_wave_save_LIBS +LDFLAGS=$boost_wave_save_LDFLAGS +])# BOOST_WAVE + + +# BOOST_XPRESSIVE() +# ----------------- +# Look for Boost.Xpressive (new since 1.36.0). +BOOST_DEFUN([Xpressive], +[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])]) + + +# ----------------- # +# Internal helpers. # +# ----------------- # + + +# _BOOST_PTHREAD_FLAG() +# --------------------- +# Internal helper for BOOST_THREADS. Based on ACX_PTHREAD: +# http://autoconf-archive.cryp.to/acx_pthread.html +AC_DEFUN([_BOOST_PTHREAD_FLAG], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_LANG_PUSH([C++])dnl +AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag], +[ boost_cv_pthread_flag= + # The ordering *is* (sometimes) important. Some notes on the + # individual items follow: + # (none): in case threads are in libc; should be tried before -Kthread and + # other compiler flags to prevent continual compiler warnings + # -lpthreads: AIX (must check this before -lpthread) + # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads) + # -pthreads: Solaris/GCC + # -mthreads: MinGW32/GCC, Lynx/GCC + # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it + # doesn't hurt to check since this sometimes defines pthreads too; + # also defines -D_REENTRANT) + # ... -mt is also the pthreads flag for HP/aCC + # -lpthread: GNU Linux, etc. + # --thread-safe: KAI C++ + case $host_os in #( + *solaris*) + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #( + *) + boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \ + -pthreads -mthreads -lpthread --thread-safe -mt";; + esac + # Generate the test file. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include ], + [pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0);])]) + for boost_pthread_flag in '' $boost_pthread_flags; do + boost_pthread_ok=false +dnl Re-use the test file already generated. + boost_pthreads__save_LIBS=$LIBS + LIBS="$LIBS $boost_pthread_flag" + AC_LINK_IFELSE([], + [if grep ".*$boost_pthread_flag" conftest.err; then + echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD + else + boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag + fi]) + LIBS=$boost_pthreads__save_LIBS + $boost_pthread_ok && break + done +]) +AC_LANG_POP([C++])dnl +])# _BOOST_PTHREAD_FLAG + + +# _BOOST_gcc_test(MAJOR, MINOR) +# ----------------------------- +# Internal helper for _BOOST_FIND_COMPILER_TAG. +m4_define([_BOOST_gcc_test], +["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl + + +# _BOOST_FIND_COMPILER_TAG() +# -------------------------- +# Internal. When Boost is installed without --layout=system, each library +# filename will hold a suffix that encodes the compiler used during the +# build. The Boost build system seems to call this a `tag'. +AC_DEFUN([_BOOST_FIND_COMPILER_TAG], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], [boost_cv_lib_tag], +[boost_cv_lib_tag=unknown +if test x$boost_cv_inc_path != xno; then + AC_LANG_PUSH([C++])dnl + # The following tests are mostly inspired by boost/config/auto_link.hpp + # The list is sorted to most recent/common to oldest compiler (in order + # to increase the likelihood of finding the right compiler with the + # least number of compilation attempt). + # Beware that some tests are sensible to the order (for instance, we must + # look for MinGW before looking for GCC3). + # I used one compilation test per compiler with a #error to recognize + # each compiler so that it works even when cross-compiling (let me know + # if you know a better approach). + # Known missing tags (known from Boost's tools/build/v2/tools/common.jam): + # como, edg, kcc, bck, mp, sw, tru, xlc + # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines + # the same defines as GCC's). + for i in \ + _BOOST_gcc_test(4, 8) \ + _BOOST_gcc_test(4, 7) \ + _BOOST_gcc_test(4, 6) \ + _BOOST_gcc_test(4, 5) \ + _BOOST_gcc_test(4, 4) \ + _BOOST_gcc_test(4, 3) \ + _BOOST_gcc_test(4, 2) \ + _BOOST_gcc_test(4, 1) \ + _BOOST_gcc_test(4, 0) \ + "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ + && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ + || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \ + _BOOST_gcc_test(3, 4) \ + _BOOST_gcc_test(3, 3) \ + "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \ + "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \ + _BOOST_gcc_test(3, 2) \ + "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \ + _BOOST_gcc_test(3, 1) \ + _BOOST_gcc_test(3, 0) \ + "defined __BORLANDC__ @ bcb" \ + "defined __ICC && (defined __unix || defined __unix__) @ il" \ + "defined __ICL @ iw" \ + "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ + _BOOST_gcc_test(2, 95) \ + "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ + "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ + "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \ + "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8" + do + boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '` + boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'` + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if $boost_tag_test +/* OK */ +#else +# error $boost_tag_test +#endif +]])], [boost_cv_lib_tag=$boost_tag; break], []) + done +AC_LANG_POP([C++])dnl + case $boost_cv_lib_tag in #( + # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed + # to "gcc41" for instance. + *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there. + gcc*) + boost_tag_x= + case $host_os in #( + darwin*) + if test $boost_major_version -ge 136; then + # The `x' added in r46793 of Boost. + boost_tag_x=x + fi;; + esac + # We can specify multiple tags in this variable because it's used by + # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ... + boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc" + ;; #( + unknown) + AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]]) + boost_cv_lib_tag= + ;; + esac +fi])dnl end of AC_CACHE_CHECK +])# _BOOST_FIND_COMPILER_TAG + + +# _BOOST_GUESS_WHETHER_TO_USE_MT() +# -------------------------------- +# Compile a small test to try to guess whether we should favor MT (Multi +# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly. +AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT], +[# Check whether we do better use `mt' even though we weren't ask to. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if defined _REENTRANT || defined _MT || defined __MT__ +/* use -mt */ +#else +# error MT not needed +#endif +]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false]) +]) + +# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# ------------------------------------------------------------------- +# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile, +# will break when Autoconf changes its internals. Requires that you manually +# rm -f conftest.$ac_objext in between to really different tests, otherwise +# you will try to link a conftest.o left behind by a previous test. +# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this +# macro). +# +# Don't use "break" in the actions, as it would short-circuit some code +# this macro runs after the actions. +m4_define([_BOOST_AC_LINK_IFELSE], +[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl +rm -f conftest$ac_exeext +boost_save_ac_ext=$ac_ext +boost_use_source=: +# If we already have a .o, re-use it. We change $ac_ext so that $ac_link +# tries to link the existing object file instead of compiling from source. +test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && + _AS_ECHO_LOG([re-using the existing conftest.$ac_objext]) +AS_IF([_AC_DO_STDERR($ac_link) && { + test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_executable_p conftest$ac_exeext +dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough. + }], + [$2], + [if $boost_use_source; then + _AC_MSG_LOG_CONFTEST + fi + $3]) +ac_objext=$boost_save_ac_objext +ac_ext=$boost_save_ac_ext +dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization) +dnl information created by the PGI compiler (conftest_ipa8_conftest.oo), +dnl as it would interfere with the next link command. +rm -f core conftest.err conftest_ipa8_conftest.oo \ + conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl +])# _BOOST_AC_LINK_IFELSE + +# Local Variables: +# mode: autoconf +# End: diff --git a/m4/geant4.bkp b/m4/geant4.bkp new file mode 100644 index 0000000..b911c74 --- /dev/null +++ b/m4/geant4.bkp @@ -0,0 +1,361 @@ +dnl +dnl m4 macros for setting up Geant4 +dnl + +# call all the Geant4 macros +AC_DEFUN( [GDML_SETUP_GEANT4], [ + +GDML_WITH_GEANT4 +AC_GEANT4_VERSION +GDML_WITH_G4SYSTEM +GDML_WITH_GEANT4_INCLUDE +GDML_WITH_GEANT4_LIBDIR +GDML_ENABLE_GEANT4_GRANULAR_LIBS +GDML_SUBST_GEANT4 + +GDML_CHECK_NIST +GDML_ENABLE_NIST + +AC_HAVE_G4TESSELLATED +AC_HAVE_G4TET +AC_HAVE_G4TWISTEDBOX +AC_HAVE_G4TWISTEDTRD +AC_HAVE_G4TWISTEDTRAP +AC_HAVE_G4TWISTEDTUBS +AC_HAVE_G4ELLIPSOID +AC_HAVE_G4EXTRUDEDSOLID + +]) + +# macro to set GEANT4 base dir (G4INSTALL) +AC_DEFUN( GDML_WITH_GEANT4, [ + +AC_MSG_CHECKING(for GEANT4 installation setting) + +AC_ARG_WITH(geant4, + AC_HELP_STRING([--with-geant4=],[Geant4 installation base [[G4INSTALL]] ]), + [GEANT4_PREFIX=$with_geant4], + [GEANT4_PREFIX=$G4INSTALL]) + +AC_MSG_RESULT([$GEANT4_PREFIX]) + +GDML_CHECK_PKG_DIR( [$GEANT4_PREFIX], [Geant4]) + +]) + +# macro to set G4SYSTEM +AC_DEFUN( GDML_WITH_G4SYSTEM, [ + +AC_MSG_CHECKING(for G4SYSTEM setting) + +AC_ARG_WITH(geant4-system, + AC_HELP_STRING([--with-geant4-system=],[Value of G4SYSTEM variable]), + [G4SYSTEM=$with_geant4_g4system]) + +if test -z "${G4SYSTEM}"; then + G4SYSTEM=`uname`-${CXX} +fi + +AC_MSG_RESULT([$G4SYSTEM]) + +AC_SUBST(G4SYSTEM) + +]) + +# macro to set GEANT4 include dir +AC_DEFUN( GDML_WITH_GEANT4_INCLUDE, [ + +AC_MSG_CHECKING([for Geant4 include dir setting]) + +AC_ARG_WITH([geant4-include], + AC_HELP_STRING([--with-geant4-include=],[Geant4 alternate headers dir]), + [GEANT4_INCLUDE=$with_geant4_include], + [GEANT4_INCLUDE=$GEANT4_PREFIX/include]) + +AC_MSG_RESULT([$GEANT4_INCLUDE]) + +GDML_CHECK_PKG_DIR( [$GEANT4_INCLUDE], + [GEANT4], + [G4RunManager.hh]) +]) + +AC_MSG_RESULT(yes) + +# macro to set GEANT4 lib dir +AC_DEFUN( GDML_WITH_GEANT4_LIBDIR, [ + +AC_MSG_CHECKING([for Geant4 lib dir]) + +AC_ARG_WITH([geant4-libdir], + AC_HELP_STRING([--with-geant4-libdir=], [Geant4 alternate library dir]), + [GEANT4_LIBDIR=$with_geant4_libdir], + [GEANT4_LIBDIR=$GEANT4_PREFIX/lib/$G4SYSTEM]) + +AC_MSG_RESULT([$GEANT4_LIBDIR]) + +GDML_CHECK_PKG_DIR( [$GEANT4_LIBDIR], + [GEANT4]) +]) + +# macro to substitute GEANT4 vars to output +AC_DEFUN( GDML_SUBST_GEANT4, [ + +AC_SUBST(GEANT4_PREFIX) +AC_SUBST(GEANT4_INCLUDE) +AC_SUBST(GEANT4_LIBDIR) + +]) + +# macro to select granular libs +AC_DEFUN( GDML_ENABLE_GEANT4_GRANULAR_LIBS, [ + +AC_MSG_CHECKING(whether to use Geant4 granular libs) + +AC_ARG_ENABLE([geant4-granular-libs], + AC_HELP_STRING( [--enable-geant4-granular-libs], [Enable linking against granular rather than global Geant4 libs] ), + [ac_g4_use_granular=$enable_geant4_granular_libs], + [ac_g4_use_granular=no]) + +# no option? +if test -z "${with_geant4_granular_libs}"; then + # set in env? + if test -n "${G4LIB_USE_GRANULAR}"; then + ac_g4_use_granular=yes + fi +fi + +AC_MSG_RESULT([$ac_g4_use_granular]) + +if test "${ac_g4_use_granular}" = "yes"; then + GEANT4_USE_GRANULAR=1 + AC_SUBST(GEANT4_USE_GRANULAR) +else + GEANT4_USE_GLOBAL=1 + AC_SUBST(GEANT4_USE_GLOBAL) +fi + +]) + +# macro to check whether NIST is supported by the current Geant4 version +AC_DEFUN(GDML_CHECK_NIST, [ + +HAVE_NIST=no + +AC_CHECK_FILE([$GEANT4_PREFIX/source/materials/include/G4NistManager.hh],HAVE_NIST=yes) + +if test "$HAVE_NIST" = "yes" +then + AC_DEFINE(HAVE_NIST) +fi + +]) + +# macro to enable/disable NIST support +AC_DEFUN(GDML_ENABLE_NIST, [ + +dnl Removed because this is somehow getting put in front of GEANT4_PREFIX setting, which breaks NIST config. +dnl AC_REQUIRE([GDML_CHECK_NIST]) + +AC_MSG_CHECKING(whether to enable Geant4 NIST support for material lookup) + +AC_ARG_ENABLE([nist], + AC_HELP_STRING([--enable-nist=]., [Turn NIST support on or off.])) + +# default to using NIST if not set from the enable-nist option +if test "X$enable_nist" = "X" +then + enable_nist=yes +fi + +if test "X$enable_nist" = "Xyes" +then + if test "X$HAVE_NIST" = "Xyes" + then + AC_MSG_RESULT(yes) + AC_DEFINE(GDML_USE_NIST) + else + AC_MSG_RESULT(no) + AC_MSG_WARN(NIST was selected but your version of Geant4 does not support it) + fi +else + AC_MSG_RESULT(no) +fi + +]) + +dnl Macro to extract the Geant4 version from G4Version.hh or G4RunManagerKernel.hh, if the former file does not exist. +AC_DEFUN(AC_GEANT4_VERSION, [ + +AC_MSG_CHECKING(for Geant4 full version) + +if test -n "$GEANT4_PREFIX" +then + + if ! test -d $GEANT4_PREFIX; then + AC_MSG_ERROR(G4INSTALL does not point to a directory) + fi + + if ! test -e $GEANT4_PREFIX/source/run/include/G4RunManager.hh; then + AC_MSG_ERROR(G4INSTALL does not appear to contain the Geant4 source code) + fi + + if test -e "$GEANT4_PREFIX/source/global/management/include/G4Version.hh" + then + GEANT4_FULL_VERSION=$(sed -n -e '/#define G4VERSION_NUMBER/s/#define G4VERSION_NUMBER //p' $GEANT4_PREFIX/source/global/management/include/G4Version.hh | \ + awk 'BEGIN { FS="" } ; { print [$]1"."[$]2"."[$]3 }') + elif test -e "$GEANT4_PREFIX/source/run/src/G4RunManagerKernel.cc" + then + GEANT4_FULL_VERSION=$(sed -n -e '/\/\/ GEANT4 tag /s/.*\(geant4-[[0-9]]*-[[0-9]]*[[0-9a-z-]]*\).*/\1/p' \ + $GEANT4_PREFIX/source/run/src/G4RunManagerKernel.cc | sed -e 's/geant4-//g' -e 's/patch-//g' -e 's/-/./g') + else + AC_MSG_ERROR(could not determine Geant4 version because G4Version.hh or G4RunManagerKernel.hh was not found in $GEANT4_PREFIX) + fi +else + AC_MSG_ERROR(G4INSTALL is not set in the environment) +fi + +GEANT4_MAJOR_VERSION=$(echo "$GEANT4_FULL_VERSION" | awk 'BEGIN{ FS="." } { print [$]1 }' | sed 's/0*//') +GEANT4_MINOR_VERSION=$(echo "$GEANT4_FULL_VERSION" | awk 'BEGIN{ FS="." } { print [$]2 }' | sed 's/0*//') +GEANT4_PATCH_VERSION=$(echo "$GEANT4_FULL_VERSION" | awk 'BEGIN{ FS="." } { print [$]3 }' | sed 's/0*//') + +if test -z "$GEANT4_MINOR_VERSION"; +then + GEANT4_MINOR_VERSION=0 +fi + +if test -z "$GEANT4_PATCH_VERSION"; +then + GEANT4_PATCH_VERSION=0 +fi + +GEANT4_FULL_VERSION=$GEANT4_MAJOR_VERSION"."$GEANT4_MINOR_VERSION"."$GEANT4_PATCH_VERSION + +AC_MSG_RESULT($GEANT4_FULL_VERSION) + +AC_MSG_CHECKING(for Geant4 major version level) +AC_MSG_RESULT($GEANT4_MAJOR_VERSION) + +AC_MSG_CHECKING(for Geant4 minor version level) +AC_MSG_RESULT($GEANT4_MINOR_VERSION) + +AC_MSG_CHECKING(for Geant4 patch level) +AC_MSG_RESULT($GEANT4_PATCH_VERSION) + +AC_SUBST(GEANT4_FULL_VERSION) +AC_SUBST(GEANT4_MAJOR_VERSION) +AC_SUBST(GEANT4_MINOR_VERSION) +AC_SUBST(GEANT4_PATCH_VERSION) + +]) + +# Macro to set HAVE_G4TESSELLATED if G4TessellatedSolid.hh exists. +AC_DEFUN(AC_HAVE_G4TESSELLATED, [ + +AC_MSG_CHECKING(whether to enable G4TessellatedSolid) + +if test -e $GEANT4_PREFIX/source/geometry/solids/specific/include/G4TessellatedSolid.hh; then + AC_DEFINE(HAVE_G4TESSELLATEDSOLID) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +]) + +# Macro to set HAVE_G4TET if G4Tet.hh exists. +AC_DEFUN(AC_HAVE_G4TET, [ + +AC_MSG_CHECKING(whether to enable G4Tet) + +if test -e $GEANT4_PREFIX/source/geometry/solids/specific/include/G4Tet.hh; then + AC_DEFINE(HAVE_G4TET) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +]) + +# Macro to set HAVE_G4TWISTEDBOX if G4TwistedBox.hh exists. +AC_DEFUN(AC_HAVE_G4TWISTEDBOX, [ + +AC_MSG_CHECKING(whether to enable G4TwistedBox) + +if test -e $GEANT4_PREFIX/source/geometry/solids/specific/include/G4TwistedBox.hh; then + AC_DEFINE(HAVE_G4TWISTEDBOX) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +]) + +# Macro to set HAVE_G4TWISTEDTRD if G4TwistedTrd.hh exists. +AC_DEFUN(AC_HAVE_G4TWISTEDTRD, [ + +AC_MSG_CHECKING(whether to enable G4TwistedTrd) + +if test -e $GEANT4_PREFIX/source/geometry/solids/specific/include/G4TwistedTrd.hh; then + AC_DEFINE(HAVE_G4TWISTEDTRD) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +]) + +# Macro to set HAVE_G4TWISTEDTRAP if G4TwistedTrap.hh exists. +AC_DEFUN(AC_HAVE_G4TWISTEDTRAP, [ + +AC_MSG_CHECKING(whether to enable G4TwistedTrap) + +if test -e $GEANT4_PREFIX/source/geometry/solids/specific/include/G4TwistedTrap.hh; then + AC_DEFINE(HAVE_G4TWISTEDTRAP) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +]) + +# Macro to set HAVE_G4TWISTEDTUBS if G4TwistedTubs.hh exists. +AC_DEFUN(AC_HAVE_G4TWISTEDTUBS, [ + +AC_MSG_CHECKING(whether to enable G4TwistedTubs) + +if test -e $GEANT4_PREFIX/source/geometry/solids/specific/include/G4TwistedTubs.hh; then + AC_DEFINE(HAVE_G4TWISTEDTUBS) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +]) + +# Macro to set HAVE_G4ELLIPSOID if G4Ellipsoid.hh exists. +AC_DEFUN(AC_HAVE_G4ELLIPSOID, [ + +AC_MSG_CHECKING(whether to enable G4Ellipsoid) + +if test -e $GEANT4_PREFIX/source/geometry/solids/specific/include/G4Ellipsoid.hh; then + AC_DEFINE(HAVE_G4ELLIPSOID) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +]) + +# Macro to set HAVE_G4EXTRUDEDSOLID if G4ExtrudedSolid.hh exists. +AC_DEFUN(AC_HAVE_G4EXTRUDEDSOLID, [ + +AC_MSG_CHECKING(whether to enable G4ExtrudedSolid) + +if test -e $GEANT4_PREFIX/source/geometry/solids/specific/include/G4ExtrudedSolid.hh; then + AC_DEFINE(HAVE_G4EXTRUDEDSOLID) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +]) diff --git a/m4/geant4.m4 b/m4/geant4.m4 new file mode 100644 index 0000000..7f73e39 --- /dev/null +++ b/m4/geant4.m4 @@ -0,0 +1,64 @@ +dnl +dnl m4 macros for setting up Geant4 +dnl + + +## +## Geant4 Config +## + +AC_DEFUN([GEANT4_PATH], +[ + AC_ARG_WITH(gean4sys, + [ --with-geant4sys top of the GEANT4 installation directory], + user_genat4sys=$withval, + user_geant4sys="none") + if test ! x"$user_geant4sys" = xnone; then + geant4bin="$user_geant4sys/bin" + elif test ! x"$GEANT4SYS" = x ; then + geant4bin="$GEANT4SYS/bin" + else + geant4bin=$PATH + fi + AC_PATH_PROG(GEANT4CONF, geant4-config , no, $geant4bin) + + if test ! x"$GEANT4CONF" = "xno"; then + + # define some variables + GEANT4CFLAGS=`$GEANT4CONF --cflags` + GEANT4LIBS=`$GEANT4CONF --libs` + GEANT4VERSION=`$GEANT4CONF --version` + + if test $1 ; then + AC_MSG_CHECKING(wether GEANT4 version >= [$1]) + vers=`$GEANT4CONF --version | tr './' ' ' | awk 'BEGIN { FS = " "; } { printf "%d", ($''1 * 1000 + $''2) * 1000 + $''3;}'` + requ=`echo $1 | tr './' ' ' | awk 'BEGIN { FS = " "; } { printf "%d", ($''1 * 1000 + $''2) * 1000 + $''3;}'` + if test $vers -lt $requ ; then + AC_MSG_RESULT(no) + no_geant4="yes" + else + AC_MSG_RESULT(yes) + no_genat4="no" + fi + fi + else + # otherwise, we say no_GEANT4 + no_geant4="yes" + fi + + AC_SUBST(GEANT4CFLAGS) + AC_SUBST(GEANT4LIBS) + AC_SUBST(GEANT4VERSION) + + if test "x$no_geant4" = "x" ; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , :, [$3]) + fi +]) + + + + + + diff --git a/m4/openmp.m4 b/m4/openmp.m4 new file mode 100644 index 0000000..78f2b75 --- /dev/null +++ b/m4/openmp.m4 @@ -0,0 +1,98 @@ +# openmp.m4 serial 7 +dnl Copyright (C) 2006-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This file can be removed once we assume autoconf >= 2.62. + +dnl Expand to nothing in autoconf >= 2.62. m4_copy has a different +dnl semantic in autoconf > 2.63. +m4_ifdef([AC_OPENMP], [], [ + +# _AC_LANG_OPENMP +# --------------- +# Expands to some language dependent source code for testing the presence of +# OpenMP. +AC_DEFUN([_AC_LANG_OPENMP], +[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)]) + +# _AC_LANG_OPENMP(C) +# ------------------ +m4_define([_AC_LANG_OPENMP(C)], +[ +#ifndef _OPENMP + choke me +#endif +#include +int main () { return omp_get_num_threads (); } +]) + +# _AC_LANG_OPENMP(C++) +# -------------------- +m4_copy([_AC_LANG_OPENMP(C)], [_AC_LANG_OPENMP(C++)]) + +# _AC_LANG_OPENMP(Fortran 77) +# --------------------------- +m4_define([_AC_LANG_OPENMP(Fortran 77)], +[AC_LANG_FUNC_LINK_TRY([omp_get_num_threads])]) + +# _AC_LANG_OPENMP(Fortran) +# --------------------------- +m4_copy([_AC_LANG_OPENMP(Fortran 77)], [_AC_LANG_OPENMP(Fortran)]) + +# AC_OPENMP +# --------- +# Check which options need to be passed to the C compiler to support OpenMP. +# Set the OPENMP_CFLAGS / OPENMP_CXXFLAGS / OPENMP_FFLAGS variable to these +# options. +# The options are necessary at compile time (so the #pragmas are understood) +# and at link time (so the appropriate library is linked with). +# This macro takes care to not produce redundant options if $CC $CFLAGS already +# supports OpenMP. It also is careful to not pass options to compilers that +# misinterpret them; for example, most compilers accept "-openmp" and create +# an output file called 'penmp' rather than activating OpenMP support. +AC_DEFUN([AC_OPENMP], +[ + OPENMP_[]_AC_LANG_PREFIX[]FLAGS= + AC_ARG_ENABLE([openmp], + [AS_HELP_STRING([--disable-openmp], [do not use OpenMP])]) + if test "$enable_openmp" != no; then + AC_CACHE_CHECK([for $CC option to support OpenMP], + [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp], + [AC_LINK_IFELSE([_AC_LANG_OPENMP], + [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='none needed'], + [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='unsupported' + dnl Try these flags: + dnl GCC >= 4.2 -fopenmp + dnl SunPRO C -xopenmp + dnl Intel C -openmp + dnl SGI C, PGI C -mp + dnl Tru64 Compaq C -omp + dnl IBM C (AIX, Linux) -qsmp=omp + dnl If in this loop a compiler is passed an option that it doesn't + dnl understand or that it misinterprets, the AC_LINK_IFELSE test + dnl will fail (since we know that it failed without the option), + dnl therefore the loop will continue searching for an option, and + dnl no output file called 'penmp' or 'mp' is created. + for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do + ac_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $ac_option" + AC_LINK_IFELSE([_AC_LANG_OPENMP], + [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp=$ac_option]) + _AC_LANG_PREFIX[]FLAGS=$ac_save_[]_AC_LANG_PREFIX[]FLAGS + if test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" != unsupported; then + break + fi + done])]) + case $ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp in #( + "none needed" | unsupported) + ;; #( + *) + OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp ;; + esac + fi + AC_SUBST([OPENMP_]_AC_LANG_PREFIX[FLAGS]) +]) + +]) diff --git a/m4/root.m4 b/m4/root.m4 new file mode 100644 index 0000000..a671713 --- /dev/null +++ b/m4/root.m4 @@ -0,0 +1,125 @@ +dnl -*- mode: autoconf -*- +dnl +dnl $Id: root.m4,v 1.3 2005/03/21 21:42:21 rdm Exp $ +dnl $Author: rdm $ +dnl $Date: 2005/03/21 21:42:21 $ +dnl +dnl Autoconf macro to check for existence or ROOT on the system +dnl Synopsis: +dnl +dnl ROOT_PATH([MINIMUM-VERSION, [ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]]]) +dnl +dnl Some examples: +dnl +dnl ROOT_PATH(3.03/05, , AC_MSG_ERROR(Your ROOT version is too old)) +dnl ROOT_PATH(, AC_DEFINE([HAVE_ROOT])) +dnl +dnl The macro defines the following substitution variables +dnl +dnl ROOTCONF full path to root-config +dnl ROOTEXEC full path to root +dnl ROOTCINT full path to rootcint +dnl ROOTLIBDIR Where the ROOT libraries are +dnl ROOTINCDIR Where the ROOT headers are +dnl ROOTCFLAGS Extra compiler flags +dnl ROOTLIBS ROOT basic libraries +dnl ROOTGLIBS ROOT basic + GUI libraries +dnl ROOTAUXLIBS Auxilary libraries and linker flags for ROOT +dnl ROOTAUXCFLAGS Auxilary compiler flags +dnl ROOTRPATH Same as ROOTLIBDIR +dnl +dnl The macro will fail if root-config and rootcint isn't found. +dnl +dnl Christian Holm Christensen +dnl +AC_DEFUN([ROOT_PATH], +[ + AC_ARG_WITH(rootsys, + [ --with-rootsys top of the ROOT installation directory], + user_rootsys=$withval, + user_rootsys="none") + if test ! x"$user_rootsys" = xnone; then + rootbin="$user_rootsys/bin" + elif test ! x"$ROOTSYS" = x ; then + rootbin="$ROOTSYS/bin" + else + rootbin=$PATH + fi + AC_PATH_PROG(ROOTCONF, root-config , no, $rootbin) + AC_PATH_PROG(ROOTEXEC, root , no, $rootbin) + AC_PATH_PROG(ROOTCINT, rootcint , no, $rootbin) + + if test ! x"$ROOTCONF" = "xno" && \ + test ! x"$ROOTCINT" = "xno" ; then + + # define some variables + ROOTLIBDIR=`$ROOTCONF --libdir` + ROOTINCDIR=`$ROOTCONF --incdir` + ROOTCFLAGS=`$ROOTCONF --noauxcflags --cflags` + ROOTLIBS=`$ROOTCONF --noauxlibs --noldflags --libs` + ROOTGLIBS=`$ROOTCONF --noauxlibs --noldflags --glibs` + ROOTAUXCFLAGS=`$ROOTCONF --auxcflags` + ROOTAUXLIBS=`$ROOTCONF --auxlibs` + ROOTRPATH=$ROOTLIBDIR + ROOTVERSION=`$ROOTCONF --version` + ROOTSOVERSION=`dirname $ROOTVERSION` + + if test $1 ; then + AC_MSG_CHECKING(wether ROOT version >= [$1]) + vers=`$ROOTCONF --version | tr './' ' ' | awk 'BEGIN { FS = " "; } { printf "%d", ($''1 * 1000 + $''2) * 1000 + $''3;}'` + requ=`echo $1 | tr './' ' ' | awk 'BEGIN { FS = " "; } { printf "%d", ($''1 * 1000 + $''2) * 1000 + $''3;}'` + if test $vers -lt $requ ; then + AC_MSG_RESULT(no) + no_root="yes" + else + AC_MSG_RESULT(yes) + no_root="no" + fi + fi + else + # otherwise, we say no_root + no_root="yes" + fi + + AC_SUBST(ROOTLIBDIR) + AC_SUBST(ROOTINCDIR) + AC_SUBST(ROOTCFLAGS) + AC_SUBST(ROOTLIBS) + AC_SUBST(ROOTGLIBS) + AC_SUBST(ROOTAUXLIBS) + AC_SUBST(ROOTAUXCFLAGS) + AC_SUBST(ROOTRPATH) + AC_SUBST(ROOTVERSION) + AC_SUBST(ROOTSOVERSION) + + if test "x$no_root" = "x" ; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , :, [$3]) + fi +]) + +# +# Macro to check if ROOT has a specific feature: +# +# ROOT_FEATURE(FEATURE,[ACTION_IF_HAVE,[ACTION_IF_NOT]]) +# +# For example +# +# ROOT_FEATURE([ldap],[AC_DEFINE([HAVE_ROOT_LDAP])]) +# +AC_DEFUN([ROOT_FEATURE], +[ + AC_REQUIRE([ROOT_PATH]) + feat=$1 + res=`$ROOTCONF --has-$feat` + if test "x$res" = "xyes" ; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , :, [$3]) + fi +]) + +# +# EOF +# diff --git a/m4/vtk.m4 b/m4/vtk.m4 new file mode 100644 index 0000000..b58e5c7 --- /dev/null +++ b/m4/vtk.m4 @@ -0,0 +1,166 @@ +dnl ====================================================================================== +dnl Author: Francesco Montorsi +dnl RCS-ID: $Id: vtk.m4,v 1.1 2005/11/20 14:47:40 frm Exp $ +dnl +dnl Implements the AM_OPTIONS_VTK, to add the --with-vtk=path option, and the +dnl AM_PATH_VTK macro used to detect VTK presence, location and version. +dnl ====================================================================================== + + + +dnl +dnl AM_OPTIONS_VTK +dnl ------------------------------------------------------------------------ +dnl Adds the --with-vtk=path option to the configure options +dnl +AC_DEFUN([AM_OPTIONS_VTK], +[ + AC_ARG_WITH([vtk-path], + [AC_HELP_STRING([--with-vtk-path], + [The prefix where VTK is installed (default is /usr/local)])], + [with_vtk=$withval], + [with_vtk="/usr/local"]) + + AC_ARG_WITH([vtk-version], + [AC_HELP_STRING([--with-vtk-version], + [VTK's include directory name is vtk-suffix, e.g. vtk-5.0/. What's the suffix? (Default -5.10)])], + [vtk_suffix=$withval], + [vtk_suffix="-5.10"]) + +])# AM_OPTIONS_VTK + + + +dnl +dnl AM_PATH_VTK([minimum-version], [action-if-found], [action-if-not-found]) +dnl ------------------------------------------------------------------------ +dnl +dnl NOTE: [minimum-version] must be in the form [X.Y.Z] +dnl +AC_DEFUN([AM_PATH_VTK], +[ + dnl do we want to check for VTK ? + if test "$with_vtk" = yes; then + dnl in case user wrote --with-vtk=yes + with_vtk="/usr/local" + fi + + if test "$with_vtk" != no; then + dnl + dnl A path was provided in $with_vtk...try hard to find the VTK library {{{ + VTK_PREFIX="$with_vtk" + + AC_CHECK_FILE([$VTK_PREFIX/include/vtk$vtk_suffix/vtkObject.h], [vtkFound="OK"]) + AC_MSG_CHECKING([if VTK is installed in $VTK_PREFIX]) + + if test -z "$vtkFound"; then + dnl + dnl VTK was not found! ...execute $3 unconditionally {{{ + AC_MSG_RESULT([no]) + $3 + dnl }}} + dnl + else + dnl + dnl VTK was found! ...execute $2 if version matches {{{ + AC_MSG_RESULT([yes]) + + dnl these are the VTK libraries of a default build + VTK_LIBS="" + + dnl set VTK c,cpp,ld flags + VTK_CFLAGS="-I$VTK_PREFIX/include/vtk$vtk_suffix" + VTK_CXXFLAGS="$VTK_CFLAGS" + VTK_LDFLAGS="-L$VTK_PREFIX/lib/vtk$vtk_suffix $VTK_LIBS" + + + AC_SUBST(VTK_LIBS) + AC_SUBST(VTK_CFLAGS) + AC_SUBST(VTK_CXXFLAGS) + AC_SUBST(VTK_LDFLAGS) + + dnl now, eventually check version {{{ + if test -n "$1"; then + dnl + dnl A version was specified... parse the version string in $1 {{{ + + dnl The version of VTK that we need: {{{ + maj=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + min=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + rel=`echo $1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + AC_MSG_CHECKING([if VTK version is at least $maj.$min.$rel]) + dnl }}} + + dnl Compare required version of VTK against installed version: {{{ + dnl + dnl Note that in order to be able to compile the following test program, + dnl we need to add to the current flags, the VTK settings... + OLD_CFLAGS=$CFLAGS + OLD_CXXFLAGS=$CXXFLAGS + OLD_LDFLAGS=$LDFLAGS + CFLAGS="$VTK_CFLAGS $CFLAGS" + CXXFLAGS="$VTK_CXXFLAGS $CXXFLAGS" + LDFLAGS="$VTK_LDFLAGS $LDFLAGS" + dnl + dnl check if the installed VTK is greater or not + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [ + #include + #include + ], + [ + printf("VTK version is: %d.%d.%d", VTK_MAJOR_VERSION, VTK_MINOR_VERSION, VTK_BUILD_VERSION); + if VTK_MAJOR_VERSION < $maj + error Installed VTK is too old ! + endif + if VTK_MINOR_VERSION < $min + error Installed VTK is too old ! + endif + if VTK_BUILD_VERSION < $rel + error Installed VTK is too old ! + endif + ]) + ], [vtkVersion="OK"]) + dnl + dnl restore all flags without VTK values + CFLAGS=$OLD_CFLAGS + CXXFLAGS=$OLD_CXXFLAGS + LDFLAGS=$OLD_LDFLAGS + dnl }}} + + dnl Execute $2 if version is ok, otherwise execute $3 {{{ + if test "$vtkVersion" = "OK"; then + AC_MSG_RESULT([yes]) + $2 + else + AC_MSG_RESULT([no]) + $3 + fi + dnl }}} + + dnl }}} + dnl + else + dnl + dnl A target version number was not provided... execute $2 unconditionally {{{ + + dnl if we don't have to check for minimum version (because the user did not set that option), + dnl then we can execute here the block action-if-found + CFLAGS="$VTK_CFLAGS $CFLAGS" + CXXFLAGS="$VTK_CXXFLAGS $CXXFLAGS" + LDFLAGS="$VTK_LDFLAGS $LDFLAGS" + $2 + dnl }}} + dnl + fi + dnl }}} + + dnl }}} + dnl + fi + dnl }}} + dnl + fi +])# AM_PATH_VTK +dnl +dnl vim: foldmethod=marker foldlevel=1 ts=2 sw=2 diff --git a/m4/zeromq.m4 b/m4/zeromq.m4 new file mode 100644 index 0000000..381abc1 --- /dev/null +++ b/m4/zeromq.m4 @@ -0,0 +1,90 @@ +# +# Configure paths and flags for the ZeroMQ library. +# Denis Arnaud , May 2011 +# +# Variables set by this macro: +# * AM_PATH_ZEROMQ +# * ZEROMQ_VERSION +# * ZEROMQ_CFLAGS +# * ZEROMQ_LIBS +# + +AC_DEFUN([AM_PATH_ZEROMQ], +[ +AC_LANG_SAVE +AC_LANG([C++]) + +## +AC_ARG_WITH(zeromq, + [[ --with-zeromq[=PFX] Prefix where ZeroMQ is installed (optional) ]], + zeromq_dir="$withval", + zeromq_dir="") + + ac_zeromq_path="" + if test "x${zeromq_dir}" = "xno" + then + without_zeromq=yes + elif test "x${zeromq_dir}" != "xyes" + then + with_arg="${zeromq_dir}/include:-L${zeromq_dir}/lib ${zeromq_dir}/include/zeromq:-L${zeromq_dir}/lib" + fi + + ## + AC_MSG_CHECKING(for zmq.hpp) + + if test "x$without_zeromq" != "xyes" + then + for i in $with_arg /usr/include: /usr/local/include:-L/usr/local/lib \ + /usr/pkg/include:-L/usr/pkg/lib + do + ac_zeromq_path=`echo "$i" | sed 's/:.*//'` + lib=`echo "$i" | sed 's/.*://'` + + if test -f ${ac_zeromq_path}/zmq.hpp + then + AC_MSG_RESULT(${ac_zeromq_path}/zmq.hpp) + ZEROMQ_LIBS="$lib -lzmq" + + AC_DEFINE(HAVE_ZEROMQ, 1, [define if you have ZeroMQ]) + have_zeromq=yes + break + fi + done + fi + + if test "x$have_zeromq" != "xyes"; then + AC_MSG_ERROR([The ZeroMQ library cannot be found. You may want to install zeromq-devel (RPM-based)/zeromq-dev (Debian-based) package.]) + fi + + ## ZeroMQ version + zeromq_lib_version_req=ifelse([$1], ,2.0,$1) + AC_MSG_CHECKING(for zeromq lib version >= $zeromq_lib_version_req) + succeeded=no + zeromq_lib_version_req_shorten=`expr $zeromq_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` + zeromq_lib_version_req_major=`expr $zeromq_lib_version_req : '\([[0-9]]*\)'` + zeromq_lib_version_req_minor=`expr $zeromq_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` + WANT_ZEROMQ_VERSION=`expr $zeromq_lib_version_req_major \* 100 \+ $zeromq_lib_version_req_minor` + + # The lines specifying the ZeroMQ version are like the following: + #define ZMQ_VERSION_MAJOR 2 + #define ZMQ_VERSION_MINOR 1 + #define ZMQ_VERSION_PATCH 4 + zeromq_version_major=`grep "define ZMQ_VERSION_MAJOR" ${ac_zeromq_path}/zmq.h | cut -d' ' -f3` + zeromq_version_minor=`grep "define ZMQ_VERSION_MINOR" ${ac_zeromq_path}/zmq.h | cut -d' ' -f3` + zeromq_version_computed=`expr $zeromq_version_major \* 100 \+ $zeromq_version_minor` + ZEROMQ_VERSION="${zeromq_version_major}.${zeromq_version_minor}" + + if test ${zeromq_version_computed} -ge ${WANT_ZEROMQ_VERSION} + then + AC_MSG_RESULT([yes (${ZEROMQ_VERSION}.)]) + else + AC_MSG_ERROR([The version (${ZEROMQ_VERSION}) of the ZeroMQ library is too old. You may want to upgrade your zeromq package.]) + fi + + ## + AC_SUBST([ZEROMQ_VERSION]) + AC_SUBST([ZEROMQ_CFLAGS]) + AC_SUBST([ZEROMQ_LIBS]) + +AC_LANG_RESTORE +]) diff --git a/src/Core/Archives.cpp b/src/Core/Archives.cpp new file mode 100644 index 0000000..017868d --- /dev/null +++ b/src/Core/Archives.cpp @@ -0,0 +1,92 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + + + +#include "Core/Archives.h" + +//#define BOOST_ARCHIVE_SOURCE +#include + +// explicitly instantiate for this type of xml stream +#include + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include +#include + + +namespace boost { +namespace archive { + + + +template class detail::archive_serializer_map ; +template class basic_xml_oarchive ; +template class xml_oarchive_impl ; + +template class detail::archive_serializer_map ; +template class basic_xml_iarchive ; +template class xml_iarchive_impl ; + +template class detail::archive_serializer_map ; +template class basic_text_oarchive ; +template class text_oarchive_impl ; + +template class detail::archive_serializer_map ; +template class basic_text_iarchive ; +template class text_iarchive_impl ; + +template class detail::archive_serializer_map ; +template class basic_text_oarchive ; +template class text_oarchive_impl ; + +template class detail::archive_serializer_map ; +template class basic_text_iarchive ; +template class text_iarchive_impl ; + +template class detail::archive_serializer_map ; +template class basic_xml_oarchive ; +template class xml_oarchive_impl ; + + + + +} // namespace archive +} // namespace boost diff --git a/src/Core/Archives.h b/src/Core/Archives.h new file mode 100644 index 0000000..9e9e635 --- /dev/null +++ b/src/Core/Archives.h @@ -0,0 +1,784 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_ARCHIVES_H +#define U_CORE_ARCHIVES_H + + +#include +#include + +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#include "StringReader.h" + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// FWD DECLARATIONS OF ARCHIVES // + + + + +namespace uLib { +namespace Archive { + +class xml_iarchive; +class xml_oarchive; +class text_iarchive; +class text_oarchive; +class log_archive; + + +} +} + + +namespace boost { +namespace archive { +namespace detail { +template class polymorphic_oarchive_route; +template class polymorphic_iarchive_route; +} +} +} + +namespace boost { +namespace serialization { + template struct hrp; +} +} + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// ARCHIVES REGISTRATION // + + +namespace uLib { +namespace Archive { +namespace detail { +struct adl_tag {}; +} +} +} + +namespace boost { +namespace archive { +namespace detail { +// This function gets called, but its only purpose is to participate +// in overload resolution with the functions declared by +// BOOST_SERIALIZATION_REGISTER_ARCHIVE, below. +template +void instantiate_ptr_serialization(Serializable*, int, uLib::Archive::detail::adl_tag ) {} +} +} +} + +// The function declaration generated by this macro never actually +// gets called, but its return type gets instantiated, and that's +// enough to cause registration of serialization functions between +// Archive and any exported Serializable type. See also: +// boost/serialization/export.hpp +# define ULIB_SERIALIZATION_REGISTER_ARCHIVE(_Archive) \ +namespace boost { namespace archive { namespace detail { \ + \ +template \ +BOOST_DEDUCED_TYPENAME _ptr_serialization_support<_Archive, Serializable>::type \ +instantiate_ptr_serialization( Serializable*, _Archive*, uLib::Archive::detail::adl_tag ); }}} + + + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// ARCHIVES IO INTERFACES // + + +namespace boost { +namespace archive { +namespace detail { + +/** + * Custom implementation of boost interface_iarchive to add new operators + */ +template +class uLib_interface_iarchive +{ +protected: + uLib_interface_iarchive(){}; +public: + ///////////////////////////////////////////////////////// + // archive public interface + typedef mpl::bool_ is_loading; + typedef mpl::bool_ is_saving; + + // return a pointer to the most derived class + Archive * This(){ + return static_cast(this); + } + + template + const basic_pointer_iserializer * + register_type(T * = NULL){ + const basic_pointer_iserializer & bpis = + boost::serialization::singleton< + pointer_iserializer + >::get_const_instance(); + this->This()->register_basic_serializer(bpis.get_basic_serializer()); + return & bpis; + } + template + Archive & operator>>(T & t){ + this->This()->load_override(t, 0); + return * this->This(); + } + + // the & operator + template + Archive & operator&(T & t){ + return *(this->This()) >> t; + } + + // the == operator + template + Archive & operator == (T & t) { + return this->operator &(t); + } + + // the != operator for human readable access + template + Archive & operator != (T & t) { + std::cerr << std::flush << "cauch string: " << t << "\n"; // REMOVE THIS ! + return * this->This(); + } +}; + + +/** + * Custom implementation of boost interface_oarchive to add new operators + */ +template +class uLib_interface_oarchive { +protected: + uLib_interface_oarchive(){}; +public: + ///////////////////////////////////////////////////////// + // archive public interface + typedef mpl::bool_ is_loading; + typedef mpl::bool_ is_saving; + + // return a pointer to the most derived class + Archive * This(){ + return static_cast(this); + } + + template + const basic_pointer_oserializer * + register_type(const T * = NULL){ + const basic_pointer_oserializer & bpos = + boost::serialization::singleton< + pointer_oserializer + >::get_const_instance(); + this->This()->register_basic_serializer(bpos.get_basic_serializer()); + return & bpos; + } + + template + Archive & operator<<(T & t){ + // to get access you must redefine save_override by typing + // "using save_override" in archive impl + this->This()->save_override(t, 0); + return * this->This(); + } + + // the & operator + template + Archive & operator&(T & t){ + #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + return * this->This() << const_cast(t); + #else + return * this->This() << t; + #endif + } + + // the == operator + template + Archive & operator == (T & t) { + return this->operator &(t); + } + + // the != operator for human readable access + template + Archive & operator != (T & t) { + std::cerr << std::flush << "cauch string: " << t << "\n"; // REMOVE THIS ! + return * this->This(); + } +}; + + + +// DECLARE INTERFACE SPECIALIZATIONS /////////////////////////////////////////// +// With this declarations all uLib archive Implementation will use their own +// extended interface // + +template <> +class interface_iarchive : public + uLib_interface_iarchive {}; + +template <> +class interface_oarchive : public + uLib_interface_oarchive {}; + +template <> +class interface_iarchive : public + uLib_interface_iarchive {}; + +template <> +class interface_oarchive : public + uLib_interface_oarchive {}; + +template <> +class interface_oarchive : public + uLib_interface_oarchive {}; + + +//// Veritical repetition macro // FINIRE !!!!!!!!!!!!!!!!!!!!!!!!! +//#define _DECL_INTERFACE_ARCHIVE_V(vz,vn,vdata) \ +// template \ +// struct inherit_nofold : \ +// BOOST_PP_REPEAT(BOOST_PP_INC(vn),_INERIT_NOFOLD_H,~) \ +// {}; + +//// Multiple size declaration // +//BOOST_PP_REPEAT(ULIB_CFG_MPL_INERIT_NOFOLD_MAXSIZE,_INERIT_NOFOLD_V,~) + +//#undef _INERIT_NOFOLD_H +//#undef _INERIT_NOFOLD_V + + +} // detail +} // archive +} // boost + + + + + + + + + + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// ARCHIVES DEFINITIONS // + +namespace boost { +namespace archive { + +//template +//inline void load_const_override(Archive & ar, const char *t ){ +// typedef typename mpl::identity >::type typex; +// typex::invoke(ar, t); +//} + +//template +//inline void load(Archive & ar, T &t){ +// // if this assertion trips. It means we're trying to load a +// // const object with a compiler that doesn't have correct +// // funtion template ordering. On other compilers, this is +// // handled below. +// // detail::check_const_loading< T >(); +// typedef +// BOOST_DEDUCED_TYPENAME mpl::eval_if, +// mpl::identity > +// ,//else +// BOOST_DEDUCED_TYPENAME mpl::eval_if, +// mpl::identity > +// ,//else +// BOOST_DEDUCED_TYPENAME mpl::eval_if, +// mpl::identity > +// ,//else +// mpl::identity > +// > +// > +// >::type typex; +// typex::invoke(ar, t); +//} + + + +} +} + + + + +namespace uLib { + +namespace Archive { + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// POLYMORPHIC // + + +//class polymorphic_iarchive : +// public boost::archive::polymorphic_iarchive { + +//public: +// void load_override(const char *t, BOOST_PFTO int) +// { +// boost::archive::load_const_override(* this->This(), const_cast(t)); +// } + +//}; + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// XML // + +class xml_iarchive : + public boost::archive::xml_iarchive_impl, + public boost::archive::detail::shared_ptr_helper +{ + typedef xml_iarchive Archive; + typedef boost::archive::xml_iarchive_impl base; + + // give serialization implementation access to this class + friend class boost::archive::detail::interface_iarchive; + friend class boost::archive::basic_xml_iarchive; + friend class boost::archive::load_access; +public: + xml_iarchive(std::istream & is, unsigned int flags = 0) : + xml_iarchive_impl(is, flags) + {} + + using basic_xml_iarchive::load_override; + + // Anything not an attribute should be a name value pair as nvp or hrp + typedef boost::archive::detail::common_iarchive detail_common_iarchive; + template + void load_override( + #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + const + #endif + boost::serialization::hrp< T > & t, + int v + ){ + this->This()->load_start(t.name()); + this->detail_common_iarchive::load_override(t.value(), 0); +// t.stov(); + this->This()->load_end(t.name()); + } + + + // class_name_type can't be handled here as it depends upon the + // char type used by the stream. So require the derived implementation. + // derived in this case is xml_iarchive_impl or base .. + using base::load_override; + + void load_override(const char *str, int v) { + // StringReader sr(basic_text_iprimitive::is); + // sr >> str; + } + + ~xml_iarchive(){}; +}; + +//typedef boost::archive::detail::polymorphic_iarchive_route< +//boost::archive::xml_iarchive_impl +//> polymorphic_xml_iarchive; + +template +struct polymorphic_iarchive_route : + boost::archive::detail::polymorphic_iarchive_route +{ + virtual void load(const char * t){ + ArchiveImpl::load(t); + } +}; + + +class polymorphic_xml_iarchive : + public polymorphic_iarchive_route< boost::archive::xml_iarchive_impl > +{ + // give serialization implementation access to this class +// friend class boost::archive::detail::interface_iarchive; +// friend class boost::archive::basic_xml_iarchive; +// friend class boost::archive::load_access; +public: + virtual void load_override(const char *str, int v) { + ; + } +}; + + + +class xml_oarchive : + public boost::archive::xml_oarchive_impl +{ + typedef xml_oarchive Archive; + typedef boost::archive::xml_oarchive_impl base; + + // give serialization implementation access to this class + friend class boost::archive::detail::interface_oarchive; + friend class boost::archive::basic_xml_oarchive; + friend class boost::archive::save_access; +public: + xml_oarchive(std::ostream & os, unsigned int flags = 0) : + boost::archive::xml_oarchive_impl(os, flags) + {} + + // example of implementing save_override for const char* // + // void save_override(const char *t, int) { + // std::cout << "found char: " << t << "\n"; + // } + + using basic_xml_oarchive::save_override; + + // special treatment for name-value pairs. + typedef boost::archive::detail::common_oarchive detail_common_oarchive; + template + void save_override( + #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + const + #endif + ::boost::serialization::hrp< T > & t, + int v + ){ + this->This()->save_start(t.name()); +// t.vtos(); +// this->detail_common_oarchive::save_override(t.const_value(), 0); + this->This()->save_end(t.name()); + } + + void save_override(const char *str, int v) { + // Do not save any human decoration string // + // basic_text_oprimitive::save(str); + } + + ~xml_oarchive(){} +}; + +//typedef boost::archive::detail::polymorphic_oarchive_route< +//boost::archive::xml_oarchive_impl +//> polymorphic_xml_oarchive; + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// TEXT // + +class text_iarchive : + public boost::archive::text_iarchive_impl, + public boost::archive::detail::shared_ptr_helper +{ + typedef text_iarchive Archive; + typedef boost::archive::text_iarchive_impl base; + + // give serialization implementation access to this class + friend class boost::archive::detail::interface_iarchive; + friend class boost::archive::basic_text_iarchive; + friend class boost::archive::load_access; +public: + text_iarchive(std::istream & is, unsigned int flags = 0) : + text_iarchive_impl(is, flags) + {} + + using basic_text_iarchive::load_override; + + void load_override(boost::archive::object_id_type & t, int) {} + + // class_name_type can't be handled here as it depends upon the + // char type used by the stream. So require the derived implementation. + // derived in this case is xml_iarchive_impl or base .. + using base::load_override; + + void load_override(const char *str, int v) { + StringReader sr(basic_text_iprimitive::is); + sr >> str; + } + + ~text_iarchive() {}; +}; + +typedef text_iarchive naked_text_iarchive; + +//typedef boost::archive::detail::polymorphic_iarchive_route< +//naked_text_iarchive +//> polymorphic_text_iarchive; + + + +class text_oarchive : + public boost::archive::text_oarchive_impl +{ + typedef text_oarchive Archive; + typedef boost::archive::text_oarchive_impl base; + + // give serialization implementation access to this class + friend class boost::archive::detail::interface_oarchive; + friend class boost::archive::basic_text_oarchive; + friend class boost::archive::save_access; +public: + text_oarchive(std::ostream & os, unsigned int flags = 0) : + boost::archive::text_oarchive_impl(os, flags) + {} + + using basic_text_oarchive::save_override; + + void save_override(const char *str, int v) { + basic_text_oprimitive::save(str); + } + + ~text_oarchive(){} +}; + +//typedef boost::archive::detail::polymorphic_oarchive_route< +//boost::archive::text_oarchive_impl +//> polymorphic_text_oarchive; + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// SIMPLE HUMAN READABLE TEXT // + +class hrt_iarchive : + public boost::archive::text_iarchive_impl, + public boost::archive::detail::shared_ptr_helper +{ + typedef hrt_iarchive Archive; + typedef boost::archive::text_iarchive_impl base; + + // give serialization implementation access to this class + friend class boost::archive::detail::interface_iarchive; + friend class boost::archive::basic_text_iarchive; + friend class boost::archive::load_access; +public: + hrt_iarchive(std::istream & is, unsigned int flags = 0) : + base(is, flags | boost::archive::no_header ) + {} + + using basic_text_iarchive::load_override; + + // hide all archive props // + void load_override( boost::archive::object_id_type & t, int) {} + void load_override( boost::archive::object_reference_type & t, int) {} + void load_override( boost::archive::version_type & t, int) {} + void load_override( boost::archive::class_id_type & t, int) {} + void load_override( boost::archive::class_id_optional_type & t, int) {} + void load_override( boost::archive::class_id_reference_type & t, int){} + void load_override( boost::archive::class_name_type & t, int) {} + void load_override( boost::archive::tracking_type & t, int) {} + + // class_name_type can't be handled here as it depends upon the + // char type used by the stream. So require the derived implementation. + // derived in this case is xml_iarchive_impl or base .. + using base::load_override; + + void load_override(const char *str, int v) { + StringReader sr(basic_text_iprimitive::is); + sr >> str; + } + + ~hrt_iarchive() {}; +}; + + +class hrt_oarchive : + public boost::archive::text_oarchive_impl + { + typedef hrt_oarchive Archive; + typedef boost::archive::text_oarchive_impl base; + + // give serialization implementation access to this class + friend class boost::archive::detail::interface_oarchive; + friend class boost::archive::basic_text_oarchive; + friend class boost::archive::save_access; + public: + hrt_oarchive(std::ostream & os, unsigned int flags = 0) : + base(os, flags | boost::archive::no_header ) + {} + + using basic_text_oarchive::save_override; + + void save_override(const boost::archive::object_id_type & t, int) {} + void save_override(const boost::archive::object_reference_type & t, int) {} + void save_override(const boost::archive::version_type & t, int) {} + void save_override(const boost::archive::class_id_type & t, int) {} + void save_override(const boost::archive::class_id_optional_type & t, int) {} + void save_override(const boost::archive::class_id_reference_type & t, int){} + void save_override(const boost::archive::class_name_type & t, int) {} + void save_override(const boost::archive::tracking_type & t, int) {} + + + void save_override(const char *str, int v) { + basic_text_oprimitive::save(str); + } + + ~hrt_oarchive(){} + }; + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// XML FOR LOG OUTPUT PURPOUSE // + +///////////////////////////////////////////////////////////////////////// +// log data to an output stream. This illustrates a simpler implemenation +// of text output which is useful for getting a formatted display of +// any serializable class. Intended to be useful as a debugging aid. +class log_archive : + /* protected ? */ + public boost::archive::xml_oarchive_impl +{ + typedef boost::archive::xml_oarchive_impl base; + typedef log_archive Archive; + // give serialization implementation access to this clas + friend class boost::archive::detail::interface_oarchive; + friend class boost::archive::basic_xml_oarchive; + friend class boost::archive::save_access; + +public: + + void save_override(const char *str, int v) { + // Do not save any human decoration string // + // basic_text_oprimitive::save(str); + } + + template + void save_override(T & t, BOOST_PFTO int){ + base::save_override(boost::serialization::make_nvp(NULL, t), 0); + } + + // activate this if you want to trap non nvp objects // + // template + // void save_override(T & t, BOOST_PFTO int) + // { + // BOOST_MPL_ASSERT((boost::serialization::is_wrapper< T >)); + // // this->detail_common_oarchive::save_override(t, 0); + // } + + template + void save_override(const boost::serialization::nvp & t, int){ + base::save_override(t, 0); + } + + + // specific overrides for attributes - not name value pairs so we + // want to trap them before the above "fall through" + // since we don't want to see these in the output - make them no-ops. + void save_override(const boost::archive::object_id_type & t, int) {} + void save_override(const boost::archive::object_reference_type & t, int) {} + void save_override(const boost::archive::version_type & t, int) {} + void save_override(const boost::archive::class_id_type & t, int) {} + void save_override(const boost::archive::class_id_optional_type & t, int) {} + void save_override(const boost::archive::class_id_reference_type & t, int){} + void save_override(const boost::archive::class_name_type & t, int) {} + void save_override(const boost::archive::tracking_type & t, int) {} + + +public: + log_archive(std::ostream & os, unsigned int flags = 0) : + boost::archive::xml_oarchive_impl( + os, + flags | boost::archive::no_header + ) + {} +}; + +//typedef boost::archive::detail::polymorphic_oarchive_route< +//boost::archive::xml_oarchive_impl +//> polymorphic_log_archive; + + + + +} // Archive + + + +} // uLib + + +ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::xml_iarchive) +ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::xml_oarchive) +ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::text_iarchive) +ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::text_oarchive) +ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::hrt_iarchive) +ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::hrt_oarchive) +ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::log_archive) + +//ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::polymorphic_xml_iarchive) +//ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::polymorphic_xml_oarchive) +//ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::polymorphic_text_iarchive) +//ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::polymorphic_text_oarchive) +//ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::polymorphic_log_archive) + + + + +#endif // U_CORE_ARCHIVES_H diff --git a/src/Core/Array.h b/src/Core/Array.h new file mode 100644 index 0000000..0e42f07 --- /dev/null +++ b/src/Core/Array.h @@ -0,0 +1,72 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_ARRAY_H +#define U_CORE_ARRAY_H + +#include // std::array + +#include "Types.h" + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//// ERROR NOT WORKING CLASS, USE VECTOR INSTEAD ////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +namespace uLib { + +template< typename T, Size_t size > +class Array : public std::array { + +}; + + +template< typename T, Size_t size > +class SmartArray : public SmartPointer< Array > { + typedef SmartPointer< Array > ptr; +public: + SmartArray() : ptr(new Array()) { } + SmartArray( const SmartArray ©) : ptr(copy) { } + virtual ~SmartArray() {} + + T& operator[](unsigned int p) { + return ptr::get()->at(p); + } + + + +}; + + + +} + +#endif // ARRAY_H diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt new file mode 100644 index 0000000..862ee5b --- /dev/null +++ b/src/Core/CMakeLists.txt @@ -0,0 +1,46 @@ + +set(HEADERS + Archives.h + Array.h + Collection.h + Debug.h + Export.h + Function.h + Macros.h + Mpl.h + Object.h + ObjectProps.h + Options.h + Serializable.h + Signal.h + Singleton.h + SmartPointer.h + StaticInterface.h + StringReader.h + Types.h + Uuid.h + Vector.h + CommaInitializer.h + ProgrammableAccessor.h +) + +SET(SOURCES + Archives.cpp + Object.cpp + Options.cpp + Serializable.cpp + Signal.cpp + Uuid.cpp +) + +set(LIBRARIES + ${Boost_SERIALIZATION_LIBRARY} + ${Boost_SIGNALS_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${ROOT_LIBRARIES} + ${PACKAGE_LIBPREFIX}Core + ${PACKAGE_LIBPREFIX}Math +) + +uLib_add_shared_library(${uLib-module}) +add_subdirectory(testing) diff --git a/src/Core/Collection.h b/src/Core/Collection.h new file mode 100644 index 0000000..b4be65f --- /dev/null +++ b/src/Core/Collection.h @@ -0,0 +1,101 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_COLLECTION_H +#define U_CORE_COLLECTION_H + +#include +#include + +#include "SmartPointer.h" +#include "Vector.h" + +//////////////////////////////////////////////////////////////////////////////// +/////// COLLECTION TEMPLATE ////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +// TODO: REWRITE THIS CLASS ... // + +namespace uLib { + +namespace Abstract { + +template +class Collection { +public: + virtual ~Collection() {} + + virtual void AddItem(T obj) =0; + virtual void RemoveItem(int i) =0; + virtual int GetNumberOfItems() =0; + virtual T& At(unsigned int i) =0; + + virtual void PrintSelf(std::ostream &o) =0; +}; + +} + + +template +class Collection : public Abstract::Collection { + +public: + Collection() : data() {} + Collection(int size) : data(size) {} + ~Collection() {} + + inline void AddItem(T obj) { data->push_back(obj); } + inline void RemoveItem(int i) { data.remove_element(i); } + inline int GetNumberOfItems() { return data->size(); } + + inline T& At(unsigned int i) { return data->at(i); } + inline T& operator[] (unsigned int i) { return data->at(i); } + + inline void PrintSelf(std::ostream &o); + +private: + SmartVector data; +}; + + +template +void Collection::PrintSelf(std::ostream &o) +{ + o << " *** uLib Collection *** \n"; + o << " n. of items = " << this->GetNumberOfItems() << "\n"; +} + + +} + + + + + + + +#endif // COLLECTION_H diff --git a/src/Core/CommaInitializer.h b/src/Core/CommaInitializer.h new file mode 100644 index 0000000..262b918 --- /dev/null +++ b/src/Core/CommaInitializer.h @@ -0,0 +1,89 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + +#ifndef U_CORE_COMMAINITIALIZER_H +#define U_CORE_COMMAINITIALIZER_H + +namespace uLib { + +// Comma Initializer template ... +// ContentT should provide operator[] and resize() methods. +// Waiting for Static interface check + +template < typename ContainerT, typename ContentT > +struct CommaInitializer +{ + inline explicit CommaInitializer(ContainerT *container, ContentT s) + : container(container) + { + this->index = 0; + container->resize(1); + this->container->operator[](0) = s; + } + inline CommaInitializer & operator, (ContentT s) { + this->index++; + container->resize(index + 1); + this->container->operator[](this->index) = s; + return *this; + } + + ContainerT *container; + unsigned int index; +}; + + +// Comma Initializer template for fixed array... +// ContentT should provide operator[] and size() methods. +// Waiting for Static interface check + +template < typename ContainerT, typename ContentT > +struct CommaInitializerFixed +{ + inline explicit CommaInitializerFixed(ContainerT *container, ContentT s) + : container(container) + { + this->index = 0; + this->container->operator[](0) = s; + } + inline CommaInitializerFixed & operator, (ContentT s) { + this->index++; + this->container->operator[](this->index) = s; + return *this; + } + + ContainerT *container; + unsigned int index; +}; + + + + + + +} // uLib + + + +#endif // COMMAINITIALIZER_H diff --git a/src/Core/Debug.cpp b/src/Core/Debug.cpp new file mode 100644 index 0000000..09603cb --- /dev/null +++ b/src/Core/Debug.cpp @@ -0,0 +1,31 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Debug.h" + + diff --git a/src/Core/Debug.h b/src/Core/Debug.h new file mode 100644 index 0000000..cd70930 --- /dev/null +++ b/src/Core/Debug.h @@ -0,0 +1,148 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_DEBUG_H +#define U_CORE_DEBUG_H + + + +#include "ltk/ltkdebug.h" +#include "Macros.h" +#include "Types.h" +#include "Mpl.h" +#include "Vector.h" + +#include +#include + +namespace uLib { + + +namespace detail { + +struct DebugAdapterInterface { + virtual ~DebugAdapterInterface() {} + + virtual void operator()(char val) {} + virtual void operator()(unsigned char val) {} + virtual void operator()(short val) {} + virtual void operator()(unsigned short val) {} + virtual void operator()(int val) {} + virtual void operator()(unsigned int val) {} + virtual void operator()(long val) {} + virtual void operator()(unsigned long val) {} + + virtual void operator()(float val) {} + virtual void operator()(double val) {} + + virtual void operator()(std::string val) {} +}; + + +struct DebugAdapter { + struct AnyCastAdapterBase { + virtual ~AnyCastAdapterBase(){} + virtual void operator()(SmartPointer &ad, boost::any &val) {} + }; + + template < typename T > + struct AnyCastAdapter : AnyCastAdapterBase { + void operator()(SmartPointer &ad, boost::any &val) { ad->operator()(boost::any_cast(val)); } + }; + + struct DItem { + DItem(){} + template DItem(std::string str, T &t) : + m_adapter(new AnyCastAdapter()), + m_name(str), + m_value(t) { } + + SmartPointer m_adapter; + std::string m_name; + boost::any m_value; + }; + +}; + + +} // detail + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// text ADAPTER + +class DebugAdapterText : public detail::DebugAdapterInterface { + std::ostream &m_out; +public: + DebugAdapterText(std::ostream &o) : m_out(o) {} + void operator()(int val) { m_out << "debug: " << val << "\n"; } + void operator()(std::string val) { m_out << "debug: " << val << "\n"; } +}; + + + + + +class Debug { + typedef detail::DebugAdapterInterface AdapterInterface; + typedef SmartPointer Adapter; + typedef detail::DebugAdapter::DItem DItem; +public: + + template void operator() (std::string str, T &t) { m_v.push_back(DItem(str,t)); } + + void AddAdapter(AdapterInterface &ad) { m_a.push_back(Adapter(ad)); } + + void Update() { + foreach(Adapter &ad, m_a) { + foreach(DItem &item, m_v) { + item.m_adapter->operator()(ad, item.m_value); + } + } + } + +private: + Vector m_v; + Vector m_a; +}; + + + + + + +} // uLib + + + + + + + +#endif // DEBUG_H diff --git a/src/Core/DebugArchives.cpp b/src/Core/DebugArchives.cpp new file mode 100644 index 0000000..3620d7a --- /dev/null +++ b/src/Core/DebugArchives.cpp @@ -0,0 +1,52 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + + +#include +#include "DebugArchives.h" + +namespace uLib { +namespace Archive { +namespace detail { + +basic_Root_Ttree_oprimitive::basic_Root_Ttree_oprimitive(const char *tree_name) +{ + m_tree = new TTree(tree_name,tree_name); +} + +basic_Root_Ttree_oprimitive::~basic_Root_Ttree_oprimitive() +{ + m_tree->Write(); + m_tree->ResetBranchAddresses(); + m_tree->Delete(); +} + +} // detail +} // Archive +} // uLib + diff --git a/src/Core/DebugArchives.h b/src/Core/DebugArchives.h new file mode 100644 index 0000000..1109635 --- /dev/null +++ b/src/Core/DebugArchives.h @@ -0,0 +1,289 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_DEBUGARCHIVES_H +#define U_CORE_DEBUGARCHIVES_H + +#include +#include + +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#include "Archives.h" +#include "StringReader.h" + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// FWD DECLARATIONS OF ARCHIVES // + + +namespace uLib { +namespace Archive { + +class Root_debug_archive; + +} +} + + +namespace boost { +namespace archive { +namespace detail { +template class polymorphic_oarchive_route; +template class polymorphic_iarchive_route; +} +} +} + +namespace boost { +namespace serialization { + template struct hrp; +} +} + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// ARCHIVES REGISTRATION // + +// in Archives.h + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// ARCHIVES IO INTERFACES // + + +namespace boost { +namespace archive { +namespace detail { + + +// DECLARE INTERFACE SPECIALIZATIONS /////////////////////////////////////////// +// With this declarations all uLib archive Implementation will use their own +// extended interface // + +template <> +class interface_iarchive : public + uLib_interface_iarchive {}; + + +} // detail +} // archive +} // boost + + + + + + + + + + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// ARCHIVES DEFINITIONS // + +namespace boost { +namespace archive { + +//template +//inline void load_const_override(Archive & ar, const char *t ){ +// typedef typename mpl::identity >::type typex; +// typex::invoke(ar, t); +//} + +//template +//inline void load(Archive & ar, T &t){ +// // if this assertion trips. It means we're trying to load a +// // const object with a compiler that doesn't have correct +// // funtion template ordering. On other compilers, this is +// // handled below. +// // detail::check_const_loading< T >(); +// typedef +// BOOST_DEDUCED_TYPENAME mpl::eval_if, +// mpl::identity > +// ,//else +// BOOST_DEDUCED_TYPENAME mpl::eval_if, +// mpl::identity > +// ,//else +// BOOST_DEDUCED_TYPENAME mpl::eval_if, +// mpl::identity > +// ,//else +// mpl::identity > +// > +// > +// >::type typex; +// typex::invoke(ar, t); +//} + + + +} +} + +// ROOT FWD +class TTree; +/////////// + + +namespace uLib { +namespace Archive { + +namespace detail { + +class basic_Root_Ttree_oprimitive +{ + TTree *m_tree; + + + +public: + basic_Root_Ttree_oprimitive(const char *tree_name); + ~basic_Root_Ttree_oprimitive(); + +}; + +} // detail + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// XML FOR LOG OUTPUT PURPOUSE // + +/////////////////////////////////////////////////////////////////////////// +//// log data to an output stream. This illustrates a simpler implemenation +//// of text output which is useful for getting a formatted display of +//// any serializable class. Intended to be useful as a debugging aid. +class Root_debug_archive : + /* protected ? */ + public boost::archive::detail::common_oarchive +{ + typedef boost::archive::detail::common_oarchive base; + typedef Root_debug_archive Archive; + + // give serialization implementation access to this clas + friend class boost::archive::detail::interface_oarchive; + friend class boost::archive::save_access; + +public: + +// void save_override(const char *str, int v) { +// // Do not save any human decoration string // +// // basic_text_oprimitive::save(str); +// } + +// template +// void save_override(T & t, BOOST_PFTO int){ +// base::save_override(boost::serialization::make_nvp(NULL, t), 0); +// } + +// // activate this if you want to trap non nvp objects // +// // template +// // void save_override(T & t, BOOST_PFTO int) +// // { +// // BOOST_MPL_ASSERT((boost::serialization::is_wrapper< T >)); +// // // this->detail_common_oarchive::save_override(t, 0); +// // } + +// template +// void save_override(const boost::serialization::nvp & t, int){ +// base::save_override(t, 0); +// } + + +// // specific overrides for attributes - not name value pairs so we +// // want to trap them before the above "fall through" +// // since we don't want to see these in the output - make them no-ops. +// void save_override(const boost::archive::object_id_type & t, int) {} +// void save_override(const boost::archive::object_reference_type & t, int) {} +// void save_override(const boost::archive::version_type & t, int) {} +// void save_override(const boost::archive::class_id_type & t, int) {} +// void save_override(const boost::archive::class_id_optional_type & t, int) {} +// void save_override(const boost::archive::class_id_reference_type & t, int){} +// void save_override(const boost::archive::class_name_type & t, int) {} +// void save_override(const boost::archive::tracking_type & t, int) {} + + +//public: +// Root_debug_archive(std::ostream & os, unsigned int flags = 0) : +// boost::archive::xml_oarchive_impl( +// os, +// flags | boost::archive::no_header +// ) +// {} +}; + + + + + +} // Archive +} // uLib + + + +ULIB_SERIALIZATION_REGISTER_ARCHIVE(uLib::Archive::Root_debug_archive) + + + + + + +#endif // U_CORE_DEBUGARCHIVES_H diff --git a/src/Core/Export.h b/src/Core/Export.h new file mode 100644 index 0000000..1b43cd0 --- /dev/null +++ b/src/Core/Export.h @@ -0,0 +1,117 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_EXPORT_H +#define U_CORE_EXPORT_H + +#include +#include // NULL +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include // for guid_defined only +#include +#include +#include +#include + +#include + + +#include "Core/Archives.h" + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + + +namespace uLib { +namespace Archive { +namespace detail { +namespace extra_detail { + +template +struct guid_initializer +{ + void export_guid(mpl::false_) const { + // generates the statically-initialized objects whose constructors + // register the information allowing serialization of T objects + // through pointers to their base classes. + boost::archive::detail:: + instantiate_ptr_serialization((T*)0, 0, + uLib::Archive::detail::adl_tag()); + } + void export_guid(mpl::true_) const { + } + guid_initializer const & export_guid() const { + BOOST_STATIC_WARNING(boost::is_polymorphic< T >::value); + // note: exporting an abstract base class will have no effect + // and cannot be used to instantitiate serialization code + // (one might be using this in a DLL to instantiate code) + //BOOST_STATIC_WARNING(! boost::serialization::is_abstract< T >::value); + export_guid(boost::serialization::is_abstract< T >()); + return *this; + } +}; + +template +struct init_guid; + +} // anonymous +} // namespace detail +} // namespace Archive +} // namespace uLib + + + +#define ULIB_CLASS_EXPORT_IMPLEMENT(T) \ + namespace uLib { \ + namespace Archive { \ + namespace detail { \ + namespace extra_detail { \ + template<> \ + struct init_guid< T > { \ + static guid_initializer< T > const & g; \ + }; \ + guid_initializer< T > const & init_guid< T >::g = \ + ::boost::serialization::singleton< \ + guid_initializer< T > \ + >::get_mutable_instance().export_guid(); \ + }}}} \ +/**/ + +#endif // EXPORT_H diff --git a/src/Core/Flags.h b/src/Core/Flags.h new file mode 100644 index 0000000..1ce1a2d --- /dev/null +++ b/src/Core/Flags.h @@ -0,0 +1,54 @@ +#ifndef FLAGS_H +#define FLAGS_H + +#include + +namespace uLib { + +template +class Flags +{ + int i; +public: + typedef Enum enum_type; + CONSTEXPR inline Flags(const Flags &f) : i(f.i) {} + CONSTEXPR inline Flags(Enum f) : i(f) {} + CONSTEXPR inline Flags() : i(0) {} + + inline Flags &operator=(const Flags &f) { i = f.i; return *this; } + inline Flags &operator&=(int mask) { i &= mask; return *this; } + inline Flags &operator&=(uint mask) { i &= mask; return *this; } + inline Flags &operator|=(Flags f) { i |= f.i; return *this; } + inline Flags &operator|=(Enum f) { i |= f; return *this; } + inline Flags &operator^=(Flags f) { i ^= f.i; return *this; } + inline Flags &operator^=(Enum f) { i ^= f; return *this; } + + CONSTEXPR inline operator int() const { return i; } + + CONSTEXPR inline Flags operator|(Flags f) const { return Flags(Enum(i | f.i)); } + CONSTEXPR inline Flags operator|(Enum f) const { return Flags(Enum(i | f)); } + CONSTEXPR inline Flags operator^(Flags f) const { return Flags(Enum(i ^ f.i)); } + CONSTEXPR inline Flags operator^(Enum f) const { return Flags(Enum(i ^ f)); } + CONSTEXPR inline Flags operator&(int mask) const { return Flags(Enum(i & mask)); } + CONSTEXPR inline Flags operator&(uint mask) const { return Flags(Enum(i & mask)); } + CONSTEXPR inline Flags operator&(Enum f) const { return Flags(Enum(i & f)); } + CONSTEXPR inline Flags operator~() const { return Flags(Enum(~i)); } + + CONSTEXPR inline bool operator!() const { return !i; } + + inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == int(f) ); } +}; + +#define ULIB_OPERATORS_FOR_FLAGS(Flags) \ +CONSTEXPR inline QFlags operator|(Flags::enum_type f1, Flags::enum_type f2) \ +{ return QFlags(f1) | f2; } \ +CONSTEXPR inline QFlags operator|(Flags::enum_type f1, QFlags f2) \ +{ return f2 | f1; } + + +} // uLib + + + + +#endif // FLAGS_H diff --git a/src/Core/Function.h b/src/Core/Function.h new file mode 100644 index 0000000..632dbb4 --- /dev/null +++ b/src/Core/Function.h @@ -0,0 +1,160 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_FUNCTION_H +#define U_CORE_FUNCTION_H + +#include + +#include +#include +#include + +#include +#include +#include + + +//#include + + +namespace uLib { + + + + + + + +namespace detail { + +//////////////////////////////////////////////////////////////////////////////// +// type synthesize ( please read: boost implementation synthesize.hpp ) // +//////////////////////////////////////////////////////////////////////////////// +// TODO: change this to boost implementation // +// return a reference to function ... as the boost signal signature wants + +template +struct FunctionTypes {}; + +template +struct FunctionTypes< R(O::*)() > { + typedef R ref(); + typedef R (ptr)(); + typedef O obj; +}; + +template +struct FunctionTypes< R(O::*)(T0) > { + typedef R ref(T0); + typedef R (ptr)(T0); + typedef O obj; +}; + +template +struct FunctionTypes< R(O::*)(T0,T1) > { + typedef R ref(T0,T1); + typedef R (ptr)(T0,T1); + typedef O obj; +}; + +template +struct FunctionTypes< R(O::*)(T0,T1,T2) > { + typedef R ref(T0,T1,T2); + typedef R (ptr)(T0,T1,T2); + typedef O obj; +}; + +} // detail + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// Function Types // + +template +struct FunctionTypes { + typedef typename boost::function_types::function_type::type Signature; + typedef typename detail::FunctionTypes::ref SignalSignature; + enum { + arity = boost::function_types::function_arity::value, + ismfp = boost::is_member_function_pointer::value + }; + + typedef boost::mpl::bool_< ismfp > HasObjectType; + typedef typename detail::FunctionTypes::obj Object; + typedef boost::function_traits< Signature > Traits; + + virtual void PrintSelf( std::ostream &o ) { + o << "[fp: " << typeid(Signature).name() + << " arity: " << arity << "]\n"; } +}; + + + + + + + +//////// generic mfp container object ///////////////////////////////////////// + +class GenericMFPtr { + typedef void (GenericMFPtr::*VoidMFPtr)(); +public: + typedef VoidMFPtr type; + + GenericMFPtr() {} + + template + GenericMFPtr(T in) { + m_ptr = reinterpret_cast(in); + } + + template + inline bool operator == (T in) { + return m_ptr == reinterpret_cast(in); + } + + inline bool operator == (const GenericMFPtr &in) { + return m_ptr == in.m_ptr; + } + + VoidMFPtr operator()() { return m_ptr; } + + VoidMFPtr m_ptr; +private: +}; + +} // uLib + + + + +#endif // FUNCTION_H diff --git a/src/Core/Macros.h b/src/Core/Macros.h new file mode 100644 index 0000000..6218dba --- /dev/null +++ b/src/Core/Macros.h @@ -0,0 +1,173 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_MACROS_H +#define U_CORE_MACROS_H + +//#ifndef HAVE_CONFIG_H +#include "config.h" +//#endif + +#include + +#define uLibAssert(condition) assert(condition) + + +// Symbols visibility attribute, see: http://gcc.gnu.org/wiki/Visibility // +// http://stackoverflow.com/questions/5116333/dynamic-cast-failed-when-hidding-symbol // +#if defined _WIN32 || defined __CYGWIN__ + #ifdef BUILDING_DLL + #ifdef __GNUC__ + #define DLL_PUBLIC __attribute__ ((dllexport)) + #else + #define DLL_PUBLIC __declspec(dllexport) // Note: actually gcc seems to also supports this syntax. + #endif + #else + #ifdef __GNUC__ + #define DLL_PUBLIC __attribute__ ((dllimport)) + #else + #define DLL_PUBLIC __declspec(dllimport) // Note: actually gcc seems to also supports this syntax. + #endif + #endif + #define DLL_LOCAL +#else + #if __GNUC__ >= 4 + #define DLL_PUBLIC __attribute__ ((visibility ("default"))) + #define DLL_LOCAL __attribute__ ((visibility ("hidden"))) + #else + #define DLL_PUBLIC + #define DLL_LOCAL + #endif +#endif + + + +// foreach Qt style +#ifndef foreach +#include "boost/foreach.hpp" +#define foreach(ref, list) BOOST_FOREACH(ref,list) +#endif + + + + + + + + +// TODO: verificare necessita' di typecast //////////////////////////////// + +#define uLibVGetMacro(name,type) \ + virtual inline const type Get##name() const = 0; + +#define uLibVSetMacro(name,type) \ + virtual inline void Set##name(const type name) = 0; + +#define uLibVGetSetMacro(name,type) \ + uLibVGet(name,type); \ + uLibVSet(name,type); + +#define uLibVRefMacro(name,type) \ + virtual inline type & name() = 0; + +#define uLibPtrMacro(name,type) \ + inline type name() const { return this->m_##name; } + +#define uLibArrayMacro(name,type) \ + inline type name() { return this->m_##name; } + +#define uLibGetMacro(name,type) \ + inline type Get##name() const { return this->m_##name; } + +#define uLibSetMacro(name,type) \ + inline void Set##name(type name) { this->m_##name = name; } + +#define uLibGetSetMacro(name,type) \ + inline type Get##name() const { return this->m_##name; } \ + uLibSetMacro(name,type); + +#define uLibRefMacro(name,type) \ + inline type & name() { return this->m_##name; } + +#define uLibConstRefMacro(name,type) \ + inline const type & name() const { return this->m_##name; } + +#define uLibAccessMacro(name,type) \ + inline void name(type name) { this->m_##name = name; } \ + uLibConstRefMacro(name,type) + + +#define uLib_CRTP_ACCESS(_Derive,_name) \ + inline _Derive * _name() { return reinterpret_cast<_Derive *>(this); } \ + inline const _Derive * _name() const { return reinterpret_cast(this); } \ + // + +#define uLib_CRTP_ACCESS_CASTED(_Derive,_Target,_name) \ + inline _Target _name() { return (_Target)(static_cast<_Derive &>(*this)); } \ + inline const _Target _name() const { return (const _Target)(static_cast(*this)); } \ + // + + + + + + + + + + +/* Following macros override usual branch prediction of compiler + * These are to be used in conditional statement whose result might + * be Bayesian biased: + * + * // previous_line + * if (likely(a>1)) { // block_1 } + * else { block_2 } + * + * will write the block_1 code right after previous line, without using + * compiler branch prediction for results. Otherwise + * + * // previous_line + * if (unlikely(a>1)) { // block_1 } + * else { block_2 } + * + * will write block_2 after previous_line, leaving block_1 after + * (usually after the end of the whole function! Use with care!) + */ + +#define unlikely(expr) __builtin_expect(!!(expr), 0) + +#define likely(expr) __builtin_expect(!!(expr), 1) + +/* Fastsign + */ +// #define sign(x) (( x > 0 ) - ( x < 0 )) +template +inline T sign(const T x) { return x>0 - x<0; } + + +#endif // MACROS_H diff --git a/src/Core/Makefile.am b/src/Core/Makefile.am new file mode 100644 index 0000000..2bb1092 --- /dev/null +++ b/src/Core/Makefile.am @@ -0,0 +1,41 @@ +SUBDIRS = . + +include $(top_srcdir)/Common.am + +library_includedir = $(includedir)/libmutom-${PACKAGE_VERSION}/Core + +library_include_HEADERS = \ + Archives.h \ + Array.h \ + Collection.h \ + Debug.h \ + Export.h \ + Function.h \ + Macros.h \ + Mpl.h \ + Object.h \ + ObjectProps.h \ + Options.h \ + Serializable.h \ + Signal.h \ + Singleton.h \ + SmartPointer.h \ + StaticInterface.h \ + StringReader.h \ + Types.h \ + Uuid.h \ + Vector.h + + +_CORE_SOURCES = \ + Archives.cpp \ + Debug.cpp \ + Object.cpp \ + Options.cpp \ + Serializable.cpp \ + Signal.cpp \ + Uuid.cpp + + +noinst_LTLIBRARIES = libmutomcore.la +libmutomcore_la_SOURCES = ${_CORE_SOURCES} diff --git a/src/Core/Mpl.h b/src/Core/Mpl.h new file mode 100644 index 0000000..d7f0130 --- /dev/null +++ b/src/Core/Mpl.h @@ -0,0 +1,139 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_MPL_H +#define U_MPL_H + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include + +/** + * Max size of nofold inerited capability + */ +#ifndef ULIB_CFG_MPL_INERIT_NOFOLD_MAXSIZE +# define ULIB_CFG_MPL_INERIT_NOFOLD_MAXSIZE 10 +#endif + +namespace uLib { + +namespace mpl { + +using namespace boost::mpl; +using namespace boost::mpl::placeholders; + +//using boost::enable_if; + +namespace detail { + +/** + * Inerit nofold implementation, set ULIB_CFG_MPL_INERIT_NOFOLD_MAXSIZE to + * desired max derivation size keeping in mind that total size accounts all + * mutiple inherited classes. + */ +template +struct inherit_nofold {}; + +// Horizontal repetition macro // +#define _INERIT_NOFOLD_H(hz,hn,hdata) \ + BOOST_PP_COMMA_IF(hn) \ + mpl::at >::type + +// Veritical repetition macro // +#define _INERIT_NOFOLD_V(vz,vn,vdata) \ + template \ + struct inherit_nofold : \ + BOOST_PP_REPEAT(BOOST_PP_INC(vn),_INERIT_NOFOLD_H,~) \ + {}; + +// Multiple size declaration // +BOOST_PP_REPEAT(ULIB_CFG_MPL_INERIT_NOFOLD_MAXSIZE,_INERIT_NOFOLD_V,~) + +#undef _INERIT_NOFOLD_H +#undef _INERIT_NOFOLD_V + + +} // detail + +/** + * Build a derivation tuple from mpl type sequence. + * The same behavior can be obtained by inherit_linearly but folding derivation + * results in a hard to read debugging + */ +template +struct inherit_nofold { + typedef detail::inherit_nofold< TypeSeq, mpl::size::type::value > type; +}; + +/** INHERIT LINEARLY standard utility macro */ +#define ULIB_MPL_INHERIT_SEQ(_TypeList) \ + uLib::mpl::inherit_linearly< _TypeList, mpl::inherit< mpl::_1, mpl::_2 > >::type + +/** INHERIT NOFOLD utility macro (see struct inherit_nofold template) */ +#define ULIB_MPL_INHERIT_NOFOLD_SEQ(_TypeList) \ + uLib::mpl::inherit_nofold< _TypeList >::type + + + + +template< class T> +struct type { + +}; + +template +struct nvp { + nvp() : name(N) {} + const char *name; + typedef T type; +}; + + +} // mpl + +} // uLib + +#endif // MPL_H diff --git a/src/Core/Object.cpp b/src/Core/Object.cpp new file mode 100644 index 0000000..bbaef39 --- /dev/null +++ b/src/Core/Object.cpp @@ -0,0 +1,227 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + + +#include "config.h" + +#include "Object.h" +#include "Vector.h" + +#include "boost/archive/polymorphic_xml_oarchive.hpp" +#include "boost/archive/polymorphic_xml_iarchive.hpp" +#include "boost/archive/polymorphic_text_oarchive.hpp" +#include "boost/archive/polymorphic_text_iarchive.hpp" +#include "boost/archive/polymorphic_binary_oarchive.hpp" +#include "boost/archive/polymorphic_binary_iarchive.hpp" + + + +namespace uLib { + + +const char *Version::PackageName = PACKAGE_NAME; +const char *Version::VersionNumber = PACKAGE_VERSION; +const char *Version::Release = SVN_REVISION; + + +//////////////////////////////////////////////////////////////////////////////// +// Object Private // + +class ObjectPrivate { +public: + + struct Signal { + GenericMFPtr sigptr; + std::string sigstr; + SignalBase *signal; + }; + + struct Slot { + GenericMFPtr sloptr; + std::string slostr; + }; + + + Vector sigv; + Vector slov; +}; + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// OBJECT IMPLEMENTATION + + + +Object::Object() : + d(new ObjectPrivate) +{} + +Object::Object(const Object ©) : + ObjectPropable(copy), + d(new ObjectPrivate(*copy.d)) +{} + +Object::~Object() { + delete d; +} + +void Object::DeepCopy(const Object ©) +{ + // should lock to be tread safe // + memcpy(d,copy.d,sizeof(ObjectPrivate)); + // ERROR! does not copy parameters ... <<<< FIXXXXX +} + + + + + +void Object::SaveXml(std::ostream &os, Object &ob) +{ + Archive::xml_oarchive ar(os); + ar << boost::serialization::make_nvp("Object",ob); +} + +void Object::LoadXml(std::istream &is, Object &ob) +{ + Archive::xml_iarchive ar(is); + ar >> boost::serialization::make_nvp("Object",ob); +} + + +// FINIRE +void Object::SaveConfig(std::ostream &os, int version) +{ + Archive::xml_oarchive ar(os); + ObjectPropable::serialize(ar,0); +} + +void Object::LoadConfig(std::istream &is, int version) +{ + if(!props()) this->init_properties(); + Archive::xml_iarchive ar(is); + ObjectPropable::serialize(ar,0); +} + + + + + +void Object::PrintSelf(std::ostream &o) const +{ + o << "OBJECT signals: ------------------\n"; + Vector::Iterator itr; + for(itr = d->sigv.begin(); itrsigv.end(); itr++) + { + o << " signal:[ " << itr->sigstr << " ]\n"; + } + o << "--------------------------------------\n\n"; +} + + +bool Object::addSignalImpl(SignalBase *sig, GenericMFPtr fptr, const char *name) +{ + ObjectPrivate::Signal s = {fptr,std::string(name),sig}; + d->sigv.push_back(s); +} + +bool Object::addSlotImpl(GenericMFPtr fptr, const char *name) +{ + ObjectPrivate::Slot s = {fptr,std::string(name)}; + d->slov.push_back(s); +} + +SignalBase *Object::findSignalImpl(const GenericMFPtr &fptr) const +{ + for(int i=0; isigv.size(); ++i) + { + if(d->sigv[i].sigptr == fptr) + return d->sigv[i].signal; + } + return NULL; +} + +SignalBase *Object::findSignalImpl(const char *name) const +{ + std::string in(name); + for(int i=0; isigv.size(); ++i) + { + if(d->sigv[i].sigstr == in) + return d->sigv[i].signal; + } + return NULL; +} + +GenericMFPtr *Object::findSlotImpl(const char *name) const +{ + std::string in(name); + for(int i=0; islov.size(); ++i) + { + if(d->slov[i].slostr == in) + return &d->slov[i].sloptr; + } + return NULL; +} + + + + +std::ostream & +operator << (std::ostream &os, uLib::Object &ob) +{ + uLib::Object *op = &ob; + uLib::Archive::hrt_oarchive (os) << op; + return os; +} + +std::ostream & +operator << (std::ostream &os, uLib::Object *ob) +{ + uLib::Archive::hrt_oarchive(os) << ob; + return os; +} + +std::istream & +operator >> (std::istream &is, uLib::Object &ob) +{ +// uLib::Object *op = &ob; + uLib::Archive::hrt_iarchive(is) >> ob; + return is; +} + + + + +} // uLib + + + diff --git a/src/Core/Object.h b/src/Core/Object.h new file mode 100644 index 0000000..0f1f417 --- /dev/null +++ b/src/Core/Object.h @@ -0,0 +1,222 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_OBJECT_H +#define U_CORE_OBJECT_H + +#include + +// WARNING: COPILE ERROR if this goes after mpl/vector // +//#include "Core/Vector.h" + +#include "Core/Types.h" +#include "Core/Debug.h" + +#include "Core/Function.h" +#include "Core/Signal.h" + +#include "Core/Mpl.h" +#include "Core/Serializable.h" +#include "Core/ObjectProps.h" +#include "Core/Uuid.h" + +namespace boost { +namespace archive { +class polymorphic_iarchive; +class polymorphic_oarchive; +} // archive +} // boost + + +namespace uLib { + + +class Version { +public: + static const char *PackageName; + static const char *VersionNumber; + static const char *Release; +}; + + + + + + +//////////////////////////////////////////////////////////////////////////////// +//// OBJECT //////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + + +/** + * @brief Object class is the object base implementation for uLib Framework. + */ +class Object : public ObjectPropable +{ + + +public: + // std::string name; + // void PrintName() { std::cout << "Ob name: " << name << "\n"; } + + Object(); + Object(const Object ©); + ~Object(); + + //////////////////////////////////////////////////////////////////////////// + // PARAMETERS // + + // FIXX !!! + virtual void DeepCopy(const Object ©); + + + //////////////////////////////////////////////////////////////////////////// + // SERIALIZATION // + + template void serialize(ArchiveT &ar, const unsigned int version) { + ObjectPropable::serialize(ar,version); + } + template void save_override(ArchiveT &ar,const unsigned int version) {} + + void SaveConfig(std::ostream &os, int version = 0); + void LoadConfig(std::istream &is, int version = 0); + + static void SaveXml(std::ostream &os, Object &ob); + static void LoadXml(std::istream &is, Object &ob); + + + + //////////////////////////////////////////////////////////////////////////// + // SIGNALS // + + // Qt4 style connector // + static bool connect(const Object *ob1, const char *signal_name, const Object *receiver, const char *slot_name) { + // // NOT WORKING YET // + // 1) find slot pointer from name + // SignalBase *sig = ob1->findSignal(signal_name); + // GenericMFPtr *slo = receiver->findSlot(slot_name); + // if(sig && slo) + // return Object::connect(sig,slo->operator ()(),receiver); + // else return false; + } + + // Qt5 style connector // + template + static bool connect( typename FunctionTypes::Object *sender, Func1 sigf, + typename FunctionTypes::Object *receiver, Func2 slof) + { + SignalBase *sigb = sender->findOrAddSignal(sigf); + typedef boost::signals2::signal::SignalSignature> SigT; + ConnectSignal(sigb,slof,receiver); + } + + template + static inline bool connect(SignalBase *sigb, FuncT slof, Object *receiver) { + ConnectSignal(sigb,slof,receiver); + } + + + template< typename FuncT > + inline typename Signal::SignalSignature>::type * + addSignal(FuncT fun, const char *name) { + typedef typename Signal::SignalSignature>::type SigT; + SignalBase *sig = NewSignal(fun); + addSignalImpl(sig,fun,name); + return (SigT *)sig; + } + + template< typename FuncT> + inline bool addSlot(FuncT fun, const char *name) { + this->addSlotImpl(GenericMFPtr(fun),name); + } + + template < typename FuncT > + inline typename Signal::SignalSignature>::type * + findSignal(FuncT fptr) + { + typedef typename Signal::SignalSignature>::type SigT; + return (SigT *)findSignalImpl(GenericMFPtr(fptr)); + } + + template < typename FuncT > + inline typename Signal::SignalSignature>::type * + findOrAddSignal(FuncT fptr) + { + typedef typename Signal::SignalSignature>::type SigT; + SignalBase *sig = findSignalImpl(GenericMFPtr(fptr)); + if(!sig) { + sig = NewSignal(fptr); + addSignalImpl(sig,fptr,"signal_name_to_be_implemented"); + } + return (SigT *)sig; + } + + + inline SignalBase * + findSignal(const char *name) const + { + return findSignalImpl(name); + } + + inline GenericMFPtr * + findSlot(const char *name) const + { + return findSlotImpl(name); + } + + + void PrintSelf(std::ostream &o) const; + + inline const Object& operator = (const Object ©) + { this->DeepCopy(copy); return *this; } + + +private: + bool addSignalImpl(SignalBase *sig, GenericMFPtr fptr, const char *name); + bool addSlotImpl(GenericMFPtr fptr, const char *name); + SignalBase *findSignalImpl(const GenericMFPtr &fptr) const; + SignalBase *findSignalImpl(const char *name) const; + GenericMFPtr *findSlotImpl(const char *name) const; + + friend class boost::serialization::access; + friend class ObjectPrivate; + class ObjectPrivate *d; +}; + + + +} // uLib + +//////////////////////////////////////////////////////////////////////////////// + +std::ostream & operator << (std::ostream &os, uLib::Object &ob); +std::ostream & operator << (std::ostream &os, uLib::Object *ob); +std::istream & operator >> (std::istream &is, uLib::Object &ob); + + +#endif // U_OBJECT_H diff --git a/src/Core/ObjectProps.h b/src/Core/ObjectProps.h new file mode 100644 index 0000000..b789d84 --- /dev/null +++ b/src/Core/ObjectProps.h @@ -0,0 +1,278 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_OBJECTPROPS_H +#define U_OBJECTPROPS_H + + + +#include + +#include +#include + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// MACROS // + + +#define ULIB_props() \ + public: struct ObjectProps; \ + virtual void init_properties(); \ + inline struct ObjectProps &p() { /* static const unsigned int offset = props_offset(this); */ \ + /* NON FUNZIA! return * (struct ObjectProps *)(reinterpret_cast(props())+offset); */ \ + return *props()->ptr(); } \ + typedef uLib::mpl::bool_::type propable_trait; \ + public: struct DLL_PUBLIC ObjectProps + +#define properties() ULIB_props() + +#define default(vlaue) + +#define $$ p() + +#define $(_name) props_ref<_name>() + +#define $_init() \ + if(props(this)) return; \ + props_new(this); \ + uLib::detail::ObjectProps::initializer::init_object_baselist(this); + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +namespace boost { +namespace serialization { +class access; +} +} + + +namespace uLib { + +namespace detail { + +struct ObjectProps { + + /** Define a trait has_member to find if an Object is Propable*/ + BOOST_MPL_HAS_XXX_TRAIT_DEF(propable_trait) + + /** IsA ProbapleObject Implementation Template */ + template + struct IsA : has_propable_trait {}; + + /** Lambda to get Props member type */ + template + struct props_type { + typedef typename T::ObjectProps type; + }; + + template + struct get_props { + + /** CFList has result but this method check for has BaseList */ + typedef typename detail::TypeIntrospection::child_first::type CFTypeList; + + /** Filter List items that have not Propable feature */ + typedef typename mpl::filter_view< CFTypeList, IsA >::type FilteredCFTypeList; + + /** Get Props from each Parent in Seq */ + typedef typename mpl::transform_view< FilteredCFTypeList, props_type >::type type; + + + // qui sotto ho un problema che ho temporaneamente tamponato // + // ovvero ho usato child_first_impl per ottenere la lista delle basi // + // vorrei farlo facendo un pop_back ma non va forse perche il tipo // + // non e' corretto. // + + /** Get Parent list from CFTypeList */ + typedef typename detail::TypeIntrospection::child_first_impl::Childs CFBaseList; + + /** Filter Parents that have not Propable feature */ + typedef typename mpl::filter_view< CFBaseList, IsA >::type FilteredCFBaseList; + }; + + + + // TODO: convert to pp const value, + // (non so se sia possibile con il dinamic casting intanto funziona cosi' ) + template + static unsigned int measure_offset(T1 base, T2 derived) { + return reinterpret_cast(derived) - reinterpret_cast(base); + } + + struct initializer { + + template + struct lambda_init_object { + _ObjectT *o; + lambda_init_object(_ObjectT *o) : o(o) {} + template void operator()(T) { + o->T::init_properties(); + } + }; + + + /** + * This calls the internal init_properties() virtual function for each + * object parent defined in BaseList only if it is propable + */ + template + static void init_object_baselist(T *o) { + typedef typename uLib::detail::ObjectProps::get_props::FilteredCFBaseList CFBaseList; + mpl::for_each(lambda_init_object(o)); + } + + /** + * This calls the internal init_properties() virtual function only if + * object is propable ( implementation if not propable ) + */ + template + static + typename boost::enable_if >,void>::type + init_object(T *o) { + ; // do nothing // + } + + /** + * This calls the internal init_properties() virtual function only if + * object is propable ( implementation if propable ) + */ + template + static + typename boost::enable_if,void>::type + init_object(T *o) { + o->init_properties(); + } + + }; + + template + struct serialize_baselist { + ThisClass & m_object; + Archive & m_ar; + serialize_baselist(ThisClass &o, Archive &ar) : m_object(o), m_ar(ar) {} + template void operator()(T &o) { + // T is taken fron get_props::FilteredPList types to get + // type_info_name that is the type name defined by Type macro + typedef typename props_type::type PType; + std::string name(TypeIntrospection::access::type_info::name); + boost::algorithm::replace_all(name,"::","_"); + m_ar & boost::serialization::make_nvp( + name.c_str() , + boost::serialization::base_object(m_object)); + } + }; + +}; + +} // detail + + + + + +struct ObjectPropsBase { + virtual ~ObjectPropsBase() {} + virtual ObjectPropsBase *copy() = 0; + + template inline T *ptr() { return dynamic_cast(this); } + + template void serialize(ArchiveT &ar, const unsigned int version) {} +}; + + + +template +struct ObjectPropsImpl : + ObjectPropsBase, + ULIB_MPL_INHERIT_NOFOLD_SEQ(typename uLib::detail::ObjectProps::get_props::type) +{ + typedef ObjectPropsImpl ThisClass; + typedef typename uLib::detail::ObjectProps::get_props::type CFList; + typedef typename uLib::detail::ObjectProps::get_props::FilteredCFTypeList FilteredCFTypeList; + ObjectPropsBase *copy() { return new ThisClass(*this); } + + template void serialize(ArchiveT &ar, const unsigned int version) { + boost::serialization::void_cast_register(); + mpl::for_each(detail::ObjectProps::serialize_baselist(*this,ar)); + } +}; + + +class ObjectPropable { + + ObjectPropsBase *m_props; + friend class uLib::detail::ObjectProps; + friend class boost::serialization::access; +public: + ObjectPropable() : m_props(NULL) {} + ObjectPropable(const ObjectPropable &c) { if(c.m_props) m_props = c.m_props->copy(); else m_props = NULL; } + ~ObjectPropable() { if(m_props) delete m_props; } + + + template inline typename T::ObjectProps& props_ref() const { if(m_props) return *m_props->ptr(); else exit(1); } + template inline typename T::ObjectProps* props(T *ptr = NULL) const { if(m_props) return m_props->ptr(); else return NULL; } +protected: + ObjectPropsBase *props() const { return m_props; } + template inline void props_new(T* ptr = NULL) { if(!m_props) m_props = new ObjectPropsImpl; } + + /** NOT working dynamic cache casting */ + template inline unsigned int props_offset(T *ptr) const + { if(m_props) return detail::ObjectProps::measure_offset(m_props,m_props->ptr()); else return -1; } + + + template void serialize(ArchiveT &ar, const unsigned int version) { + if(m_props) ar & boost::serialization::make_nvp("properties",m_props); + } + +public: + /** + * ObjectPropable is not directly propable itself to prevent Basclass + * duplication in inherit_nofold. And for the same reason ANY VIRTUAL BASE + * SHOULD NOT BE PROPABLE + */ + virtual void init_properties() {} + +}; + +} // uLib + + + + + + + +#endif // U_OBJECTPROPS_H diff --git a/src/Core/Options.cpp b/src/Core/Options.cpp new file mode 100644 index 0000000..bcd8bff --- /dev/null +++ b/src/Core/Options.cpp @@ -0,0 +1,87 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include +#include +#include "Core/Options.h" + +#include + + +//class boost::program_options::error_with_option_name; +//template<> boost::program_options::typed_value boost::program_options::value(); +//template<> boost::program_options::typed_value boost::program_options::value(int *); + + +namespace uLib { + +Options::Options(const char *str) : + m_global(str), + m_configuration("Configuration") +{} + +void Options::parse_command_line(int argc, char *argv[]) { + boost::program_options::store(boost::program_options::parse_command_line(argc,argv,m_global),m_vm); + boost::program_options::notify(m_vm); + + if(m_vm.count("help")) { + std::cout << "\n" << m_global << "\n"; + if(m_configuration.options().size()) { + std::cout << "\n" << m_configuration << "\n\n"; + } + exit(1); + } +} + +void Options::parse_config_file(std::string &str) +{ + this->parse_config_file(str.c_str()); +} + +void Options::parse_config_file(const char *fname) +{ + std::ifstream is; + is.open(fname); + boost::program_options::options_description fileopt; + fileopt.add(m_global).add(m_configuration); + if(is.is_open()) { + boost::program_options::store(boost::program_options::parse_config_file(is,fileopt,true),m_vm); + boost::program_options::notify(m_vm); + } +} + +bool Options::count(const char *str) const +{ + return (m_vm.count(str)); +} + + +} // uLib + + + + diff --git a/src/Core/Options.h b/src/Core/Options.h new file mode 100644 index 0000000..edd1899 --- /dev/null +++ b/src/Core/Options.h @@ -0,0 +1,179 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_OPTIONS_H +#define U_CORE_OPTIONS_H + +#include + +namespace uLib { + +namespace detail { + +struct Options { + + /** + * Wrapper for boost program_options easy init syntax + */ + class options_description_easy_init { + typedef boost::program_options::options_description_easy_init InitClass; + InitClass m_init; + public: + options_description_easy_init(InitClass init) : + m_init(init) {} + + + options_description_easy_init& + operator()(const char* name, + const char* description) + { + m_init(name,description); + return *this; + } + + options_description_easy_init& + operator()(const char* name, + const boost::program_options::value_semantic* s) + { + m_init(name,s); + return *this; + } + + + options_description_easy_init& + operator()(const char* name, + const boost::program_options::value_semantic* s, + const char* description) + { + m_init(name,s,description); + return *this; + } + + + template + options_description_easy_init& + operator()(const char* name, + T * value, + const T default_value, + const char* description) + { + m_init(name, + boost::program_options::value(value)->default_value(default_value), + description); + return *this; + } + + template + options_description_easy_init& + operator()(const char* name, + T * value, + const char* description) + { + assert(value); + m_init(name, + boost::program_options::value(value)->default_value(*value), + description); + return *this; + } + + template + options_description_easy_init& + operator()(const char* name, + T * value, + const T default_value) + { + m_init(name, + boost::program_options::value(value)->default_value(default_value)); + return *this; + } + + template + options_description_easy_init& + operator()(const char* name, + T * value) + { + assert(value); + m_init(name, + boost::program_options::value(value)->default_value(*value)); + return *this; + } + + }; + +}; // Options + +} // detail + + + +class Options { + boost::program_options::options_description m_global; + boost::program_options::options_description m_configuration; + boost::program_options::positional_options_description m_posdesc; + boost::program_options::variables_map m_vm; + +public: + typedef detail::Options::options_description_easy_init initType; + + Options(const char *str = "Program options"); + + initType add_options() { + return initType(m_global.add_options()); + } + + initType add_config_options() { + return initType(m_configuration.add_options()); + } + + void add_positional_option(const char *name, int max_count) { + // TODO: + // m_posdesc(name,max_count); + } + + void parse_command_line(int argc, char *argv[]); + + void parse_config_file(std::string &str); + + void parse_config_file(const char *fname); + + template + static inline boost::program_options::typed_value* value(T *v, T dvalue) { + boost::program_options::typed_value *r = boost::program_options::value(v); + r->default_value(dvalue); + return r; + } + + bool count(const char *str) const; + +}; + + +} // uLib + + + +#endif // U_CORE_OPTIONS_H diff --git a/src/Core/ProgrammableAccessor.h b/src/Core/ProgrammableAccessor.h new file mode 100644 index 0000000..62f1713 --- /dev/null +++ b/src/Core/ProgrammableAccessor.h @@ -0,0 +1,140 @@ +#ifndef U_CORE_PROGRAMMABLEACCESSOR_H +#define U_CORE_PROGRAMMABLEACCESSOR_H + +#include +#include +#include + +namespace uLib { + + + +namespace detail { + +template +class ProgrammableAccessor_Base { +public: + virtual R Get(void *) const = 0; + virtual void Set(void *,const R) const = 0; + + template + T Get(void *ob) const { + return static_cast(this->Get(ob)); + } + + template + void Set(void *ob, const T data) const { + this->Set(ob,static_cast(data)); + } + + virtual ~ProgrammableAccessor_Base() {} +}; + + +template +class functor_by_ref : public ProgrammableAccessor_Base +{ +public: + explicit functor_by_ref(R&(T::*__pf)()) : MFRef(__pf) {} + R Get(void * ptr) const + { return static_cast((reinterpret_cast(ptr)->*MFRef)()); } + void Set(void * ptr, const R data) const + { ((reinterpret_cast(ptr)->*MFRef)()) = data; } +private: + R&(T::*MFRef)(); +}; + +template +class functor_by_mfptr_cc : public ProgrammableAccessor_Base +{ + typedef R(T::*GetterType)() const; + typedef void(T::*SetterType)(const R); +public: + explicit functor_by_mfptr_cc( GetterType _get, SetterType _set ) : + GetPtr(_get), SetPtr(_set) {} + R Get(void * ptr) const + { return static_cast((reinterpret_cast(ptr)->*GetPtr)()); } + void Set(void * ptr, const R data) const + { if (SetPtr) (reinterpret_cast(ptr)->*SetPtr)(data); } + +private: + GetterType GetPtr; + SetterType SetPtr; +}; + +template +class functor_by_mfptr_vv : public ProgrammableAccessor_Base +{ + typedef R(T::*GetterType)(); + typedef void(T::*SetterType)(R); +public: + explicit functor_by_mfptr_vv( GetterType _get, SetterType _set ) : + GetPtr(_get), SetPtr(_set) {} + R Get(void * ptr) const + { return static_cast((reinterpret_cast(ptr)->*GetPtr)()); } + void Set(void * ptr, const R data) const + { if (SetPtr) (reinterpret_cast(ptr)->*SetPtr)(data); } + +private: + GetterType GetPtr; + SetterType SetPtr; +}; + + +template +class functor_by_member : public ProgrammableAccessor_Base +{ +public: + explicit functor_by_member(R T::*__pf) : MDPtr(__pf) {} + R Get(void * ptr) const + { return static_cast(reinterpret_cast(ptr)->*MDPtr); } + void Set(void * ptr, const R data) const + { (reinterpret_cast(ptr)->*MDPtr) = data; } +private: + R T::*MDPtr; +}; + +} // detail + + + +//////////////////////////////////////////////////////////////////////////////// +// Programmable Accessor Factory ///////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +template +class ProgrammableAccessor { +public: + template + ProgrammableAccessor(R(T::*_pg)()const, void(T::*_ps)(const R) = NULL) : + m_base(new detail::functor_by_mfptr_cc(_pg,_ps)) {} + + template + ProgrammableAccessor(R(T::*_pg)(), void(T::*_ps)(R) = NULL) : + m_base(new detail::functor_by_mfptr_vv(_pg,_ps)) {} + + template + ProgrammableAccessor(R&(T::*_pf)()) : + m_base(new detail::functor_by_ref(_pf)) {} + + template + ProgrammableAccessor(R T::*_pf) : + m_base(new detail::functor_by_member(_pf)) {} + + template + inline OtherR Get(void *ob) const { return m_base->Get(ob); } + + template + inline void Set(void *ob, const OtherR data) const { return m_base->Set(ob,data); } + +private: + SmartPointer< detail::ProgrammableAccessor_Base > m_base; +}; + + +} // uLib + + + +#endif // PROGRAMMABLEACCESSOR_H diff --git a/src/Core/Serializable.cpp b/src/Core/Serializable.cpp new file mode 100644 index 0000000..5efc2ea --- /dev/null +++ b/src/Core/Serializable.cpp @@ -0,0 +1,95 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "boost/archive/polymorphic_xml_oarchive.hpp" +#include "boost/archive/polymorphic_xml_iarchive.hpp" +#include "boost/archive/polymorphic_text_oarchive.hpp" +#include "boost/archive/polymorphic_text_iarchive.hpp" +#include "boost/archive/polymorphic_binary_oarchive.hpp" +#include "boost/archive/polymorphic_binary_iarchive.hpp" + +#include "Serializable.h" + + +using namespace uLib; + + + +//void Serializable::SaveXml(std::ostream &os, const char *name) +//{ +// boost::archive::polymorphic_oarchive *xoa = new boost::archive::polymorphic_xml_oarchive(os); +// this->Save(*xoa); +// delete xoa; +//} + +//void Serializable::LoadXml(std::istream &is, const char *name) +//{ +// boost::archive::polymorphic_iarchive *xia = new boost::archive::polymorphic_xml_iarchive(is); +// this->Load(*xia,this); +// delete xia; +//} + +//void Serializable::SaveText(std::ostream &os, const char *name) +//{ +// boost::archive::polymorphic_oarchive *xoa = new boost::archive::polymorphic_text_oarchive(os); +// this->Save(*xoa); +// delete xoa; +//} + +//void Serializable::LoadText(std::istream &is, const char *name) +//{ +// boost::archive::polymorphic_iarchive *xia = new boost::archive::polymorphic_text_iarchive(is); +// this->Load(*xia,this); +// delete xia; +//} + +//void Serializable::SaveBin(std::ostream &os, const char *name) +//{ +// boost::archive::polymorphic_oarchive *xoa = new boost::archive::polymorphic_binary_oarchive(os); +// this->Save(*xoa); +// delete xoa; +//} + +//void Serializable::LoadBin(std::istream &is, const char *name) +//{ +// boost::archive::polymorphic_iarchive *xia = new boost::archive::polymorphic_binary_iarchive(is); +// Serializable::Load(*xia,this); +// delete xia; +//} + + +//void Serializable::Save(boost::archive::polymorphic_oarchive &ar, Serializable *ob) +//{ +// ar << boost::serialization::make_nvp("Object",ob); +//} + +//void Serializable::Load(boost::archive::polymorphic_iarchive &ar, Serializable *ob) +//{ +// ar >> boost::serialization::make_nvp("Object",ob); +//} + + diff --git a/src/Core/Serializable.h b/src/Core/Serializable.h new file mode 100644 index 0000000..85221ce --- /dev/null +++ b/src/Core/Serializable.h @@ -0,0 +1,412 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_SERIALIZABLE_H +#define U_SERIALIZABLE_H + +/* Serialization: + + + +TODO: +* Problema nella serializzazione delle properties in test_archive +* implementare human readable make_hrp ... non riesco.. + +*/ + + + + +#include +#include + +#include +#include +#include + +//#include +//#include +//#include +//#include +//#include "boost/archive/polymorphic_iarchive.hpp" +//#include "boost/archive/polymorphic_oarchive.hpp" + +#include +#include +#include +#include +#include + + +#include "Core/Mpl.h" +#include "Core/ObjectProps.h" +#include "Core/Archives.h" +#include "Core/Export.h" + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// BOOST SERIALIZATION ADD-ON + +namespace boost { +namespace serialization { + +// ACCESS 2 // +template struct access2 {}; + + +// NON FUNZIONA ... SISTEMARE !!!! // ------------------------------------------ +template +class hrp : + public wrapper_traits > +{ + const char *m_name; + T *m_value; + std::string *m_str; + +public: + explicit hrp(const char * name_, T &t) : + m_str(new std::string), + m_name(name_), m_value(&t) {} + + const char * name() const { + return this->m_name; + } + + + template + void save( Archivex & ar, const unsigned int /* file_version */) const { + //// ar.operator<<(const_value()); + // std::stringstream ss; + // uLib::Archive::hrt_oarchive har(ss); + // har << make_nvp(m_name,*m_value); + // // (*m_str) = ss.str(); + //// ar.operator << (make_nvp(m_name, ss.str()); + } + template + void load( Archivex & ar, const unsigned int /* file_version */) { +// ar.operator>>(value()); + } + BOOST_SERIALIZATION_SPLIT_MEMBER() +}; + + +template +inline +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING +const +#endif +hrp< T > make_hrp(const char * name, T & t){ + return hrp< T >(name, t); +} + +#define HRP(name) \ + boost::serialization::make_hrp(BOOST_PP_STRINGIZE(name), name) + + +} // serialization +} // boost + + + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// ULIB SERIALIZATION + +namespace uLib { + + + +#define _AR_OP(r,data,elem) data&BOOST_SERIALIZATION_BASE_OBJECT_NVP(elem); + +#define NVP(data) BOOST_SERIALIZATION_NVP(data) + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// SERIALIZTION MACROS // + +// !!! WARNING !!! INTRUSIVE SERIALIZATION IS ACTUALLY NOT WORKING FEATURE +// SO LEAVE ULIB_CFG_INTRUSIVE_SERIALIZATION NOT DEFINED + +#ifdef ULIB_CFG_INTRUSIVE_SERIALIZATION_OBJECT +# define ULIB_SERIALIZABLE_OBJECT _ULIB_DETAIL_INTRUSIVE_SERIALIZABLE_OBJECT +# define ULIB_SERIALIZE_OBJECT(_Ob,...) _ULIB_DETAIL_INTRUSIVE_SERIALIZE_OBJECT(_Ob,__VA_ARGS__) +# define _AR_(_name) _ULIB_DETAIL_INTRUSIVE_AR_(_name) +#else +# define ULIB_SERIALIZABLE(_Ob) _ULIB_DETAIL_UNINTRUSIVE_SERIALIZABLE(_Ob) \ + ULIB_CLASS_EXPORT_KEY(_Ob) +# define ULIB_SERIALIZE(_Ob,...) _ULIB_DETAIL_UNINTRUSIVE_SERIALIZE(_Ob) +# define ULIB_SERIALIZE_DERIVED(_Ob,...) _ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_DERIVED(_Ob,__VA_ARGS__) +# define ULIB_SERIALIZABLE_OBJECT(_Ob) _ULIB_DETAIL_UNINTRUSIVE_SERIALIZABLE_OBJECT(_Ob) \ + ULIB_CLASS_EXPORT_OBJECT_KEY(_Ob) +# define ULIB_SERIALIZE_OBJECT(_Ob,...) _ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_OBJECT(_Ob,__VA_ARGS__) +# define ULIB_SERIALIZE_OBJECT_PROPS(_Ob) _ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_PROPS(_Ob) +# define AR(_name) _ULIB_DETAIL_UNINTRUSIVE_AR_(_name) +# define HR(_name) _ULIB_DETAIL_UNINTRUSIVE_AR_(_name) +#endif + + +#define ULIB_SERIALIZE_ACCESS \ + friend class boost::serialization::access; \ + template friend class boost::serialization::access2; + +#define ULIB_CLASS_EXPORT_KEY(_FullNamespaceClass) \ + BOOST_CLASS_EXPORT_KEY(_FullNamespaceClass) + +#define ULIB_CLASS_EXPORT_OBJECT_KEY(_FullNamespaceClass) \ + BOOST_CLASS_EXPORT_KEY(_FullNamespaceClass) \ + BOOST_CLASS_EXPORT_KEY(_FullNamespaceClass::ObjectProps) \ + BOOST_CLASS_EXPORT_KEY(uLib::ObjectPropsImpl<_FullNamespaceClass>) + + +#define _SERIALIZE_IMPL_SEQ \ + (uLib::Archive::text_iarchive) \ + (uLib::Archive::text_oarchive) \ + (uLib::Archive::hrt_iarchive) \ + (uLib::Archive::hrt_oarchive) \ + (uLib::Archive::xml_iarchive) \ + (uLib::Archive::xml_oarchive) \ + (uLib::Archive::log_archive) + + +/** Solving virtual class check problem */ +#define _ULIB_DETAIL_SPECIALIZE_IS_VIRTUAL_BASE(_Base,_Derived) namespace boost{ template<> struct is_virtual_base_of<_Base,_Derived>: public boost::mpl::true_ {}; } +#define _ULIB_DETAIL_SPECIALIZE_IS_VIRTUAL_BASE_OP(r,data,elem) _ULIB_DETAIL_SPECIALIZE_IS_VIRTUAL_BASE(elem,data) + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// INTRUSIVE SERIALIZATION ( NOT WORKING YET !! ) // + +#define _ULIB_DETAIL_INTRUSIVE_AR_(name) ar & BOOST_SERIALIZATION_NVP(name); + +#define _ULIB_DETAIL_INTRUSIVE_SERIALIZE_FUNC(Class,Archive) \ + template void Class::serialize(Archive &ar,const unsigned int); + +#define _ULIB_DETAIL_INTRUSIVE_SERIALIZE_FUNC_OP(r,data,elem) _ULIB_DETAIL_INTRUSIVE_SERIALIZE_FUNC(data,elem); + +#define _ULIB_DETAIL_INTRUSIVE_SERIALIZABLE_OBJECT \ + typedef boost::mpl::bool_ serializable; \ + typedef boost::mpl::remove_if< TypeList, IsUnSerializable >::type SerilizableTypeList; \ + void PrintSerializableListId() { boost::mpl::for_each(PrintTypeId()); } \ + template void serialize(ArchiveT &ar,const unsigned int version); \ + template void serialize_parents(ArchiveT &ar,const unsigned int version); \ + template void save_override(ArchiveT &ar,const unsigned int version); + +#define _ULIB_DETAIL_INTRUSIVE_SERIALIZE_OBJECT(_Ob,...) \ + template void _Ob::serialize(ArchiveT &ar, const unsigned int version) { \ + boost::serialization::void_cast_register<_Ob,_Ob::BaseClass>(static_cast<_Ob *>(NULL),static_cast<_Ob::BaseClass *>(NULL)); \ + _Ob::serialize_parents(ar,version); \ + _Ob::save_override(ar,version); }\ + template void _Ob::serialize_parents(ArchiveT &ar, const unsigned int v) { \ + BOOST_PP_SEQ_FOR_EACH(_AR_OP,ar,BOOST_PP_TUPLE_TO_SEQ((__VA_ARGS__))); } \ + BOOST_PP_SEQ_FOR_EACH(_ULIB_DETAIL_INTRUSIVE_SERIALIZE_FUNC_OP,_Ob,_SERIALIZE_IMPL_SEQ)\ + BOOST_PP_SEQ_FOR_EACH(_ULIB_DETAIL_SPECIALIZE_IS_VIRTUAL_BASE_OP,_Ob,BOOST_PP_TUPLE_TO_SEQ((__VA_ARGS__))) \ + ULIB_CLASS_EXPORT_IMPLEMENT(_Ob) \ + namespace boost { \ + namespace serialization { \ + template inline void load_construct_data(ArchiveT & ar, _Ob *o, const unsigned int file_version) \ + { ::new(o)_Ob(); o->init_parameters(); } }}\ + template void _Ob::save_override(ArchiveT &ar, const unsigned int version) + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// UNINTRUSIVE SERIALIZATION + +#define _UNAR_OP(r,data,elem) ar&boost::serialization::make_nvp(BOOST_PP_STRINGIZE(elem),boost::serialization::base_object(ob)); + +#define _ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_FUNC(Class,Archive) \ + template void boost::serialization::serialize(Archive &ar, Class &ob, const unsigned int i); + +#define _ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_FUNC_OP(r,data,elem) _ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_FUNC(data,elem) + + +// NOTE: becouse of BOOST_PP_VARIADIC_SIZE issue of some boost macro has two +// different implementation + +#define _ULIB_DETAIL_UNINTRUSIVE_SERIALIZABLE(_Ob) \ + namespace boost { namespace serialization { \ + template void serialize (ArchiveT &ar, _Ob &ob, const unsigned int version); \ + template void serialize_parents (ArchiveT &ar, _Ob &ob, const unsigned int version); \ + template <> struct access2< _Ob > { template static void save_override (ArchiveT &ar, _Ob &ob, const unsigned int version); }; }} + +#define _ULIB_DETAIL_UNINTRUSIVE_SERIALIZE(_Ob) \ + namespace boost { namespace serialization { \ + template void serialize_parents(ArchiveT &ar, _Ob &ob, const unsigned int v) {} \ + template void serialize (ArchiveT &ar, _Ob &ob, const unsigned int version) { \ + serialize_parents(ar,ob,version); \ + access2< _Ob >::save_override(ar,ob,version); } }}\ + ULIB_CLASS_EXPORT_IMPLEMENT(_Ob) \ + BOOST_PP_SEQ_FOR_EACH(_ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_FUNC_OP,_Ob,_SERIALIZE_IMPL_SEQ)\ + template void boost::serialization::access2< _Ob >::save_override(ArchiveT &ar, _Ob &ob, const unsigned int version) + +#define _ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_DERIVED(_Ob,...) \ + namespace boost { namespace serialization { \ + template void serialize_parents(ArchiveT &ar, _Ob &ob, const unsigned int v) { \ + BOOST_PP_IF(BOOST_PP_VARIADIC_SIZE((__VA_ARGS__)),BOOST_PP_SEQ_FOR_EACH(_UNAR_OP,ob,BOOST_PP_TUPLE_TO_SEQ((__VA_ARGS__)));,) } \ + template void serialize (ArchiveT &ar, _Ob &ob, const unsigned int version) { \ + serialize_parents(ar,ob,version); \ + access2< _Ob >::save_override (ar,ob,version); } }}\ + ULIB_CLASS_EXPORT_IMPLEMENT(_Ob) \ + BOOST_PP_SEQ_FOR_EACH(_ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_FUNC_OP,_Ob,_SERIALIZE_IMPL_SEQ) \ + BOOST_PP_SEQ_FOR_EACH(_ULIB_DETAIL_SPECIALIZE_IS_VIRTUAL_BASE_OP,_Ob,BOOST_PP_TUPLE_TO_SEQ((__VA_ARGS__))) \ + template void boost::serialization::access2< _Ob >::save_override(ArchiveT &ar, _Ob &ob, const unsigned int version) + + +#define _ULIB_DETAIL_UNINTRUSIVE_SERIALIZABLE_OBJECT(_Ob) \ + namespace boost { namespace serialization { \ + template void serialize (ArchiveT &ar, _Ob &ob, const unsigned int version); \ + template void serialize_parents (ArchiveT &ar, _Ob &ob, const unsigned int version); \ + template <> struct access2< _Ob > { template static void save_override (ArchiveT &ar, _Ob &ob, const unsigned int version); }; \ + template void serialize (ArchiveT &ar, class _Ob::ObjectProps &ob, const unsigned int version); \ + template void save_override (ArchiveT &ar, class _Ob::ObjectProps &ob, const unsigned int version); }} + +#define _ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_OBJECT(_Ob,...) \ + namespace boost { namespace serialization { \ + template void serialize_parents(ArchiveT &ar, _Ob &ob, const unsigned int v) { \ + /* PP serialize */ BOOST_PP_SEQ_FOR_EACH(_UNAR_OP,ob,BOOST_PP_TUPLE_TO_SEQ((__VA_ARGS__))); \ + /* MPL serialize */ /*uLib::mpl::for_each<_Ob::BaseList>(uLib::detail::Serializable::serialize_baseobject<_Ob,ArchiveT>(ob,ar) );*/ } \ + template inline void load_construct_data(ArchiveT & ar, _Ob *ob, const unsigned int file_version) { \ + ::new(ob)_Ob(); uLib::detail::ObjectProps::initializer::init_object(ob); } \ + template void serialize (ArchiveT &ar, _Ob &ob, const unsigned int version) { \ + void_cast_register<_Ob,_Ob::BaseClass>(static_cast<_Ob *>(NULL),static_cast<_Ob::BaseClass *>(NULL)); /*fix*/ \ + serialize_parents(ar,ob,version); \ + access2< _Ob >::save_override (ar,ob,version); } }}\ + ULIB_CLASS_EXPORT_IMPLEMENT(_Ob) \ + BOOST_PP_SEQ_FOR_EACH(_ULIB_DETAIL_SPECIALIZE_IS_VIRTUAL_BASE_OP,_Ob,BOOST_PP_TUPLE_TO_SEQ((__VA_ARGS__))) \ + BOOST_PP_SEQ_FOR_EACH(_ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_FUNC_OP,_Ob,_SERIALIZE_IMPL_SEQ)\ + template void boost::serialization::access2< _Ob >::save_override(ArchiveT &ar, _Ob &ob, const unsigned int version) + +#define _ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_PROPS(_Ob) \ + namespace boost { namespace serialization { \ + template void serialize (ArchiveT &ar, _Ob::ObjectProps &ob, const unsigned int version) { \ + save_override (ar,ob,version); } }}\ + BOOST_PP_SEQ_FOR_EACH(_ULIB_DETAIL_UNINTRUSIVE_SERIALIZE_FUNC_OP,_Ob::ObjectProps,_SERIALIZE_IMPL_SEQ)\ + ULIB_CLASS_EXPORT_IMPLEMENT(_Ob::ObjectProps) \ + ULIB_CLASS_EXPORT_IMPLEMENT(uLib::ObjectPropsImpl<_Ob>) \ + template void boost::serialization::save_override(ArchiveT &ar, _Ob::ObjectProps &ob, const unsigned int version) + + +#define _ULIB_DETAIL_UNINTRUSIVE_AR_(name) boost::serialization::make_nvp(BOOST_PP_STRINGIZE(name),ob.name) + + + + + + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + + +namespace detail { + +struct Serializable { + + /** + * Serializable trait to check if an object type is serializable. + * This only works if UNINTRUSIVE SERIALIZATION is applyed; in intrusive + * cases a has_serialize trait should be implemented + */ + template + struct serializable_trait : mpl::bool_ {}; + + /** + * IsA Serializable Implementation Template + */ + template + struct IsA : serializable_trait {}; + + template + struct serialize_baseobject { + ThisClass & m_object; + Archive & m_ar; + serialize_baseobject(ThisClass &o, Archive &ar) : m_object(o), m_ar(ar) {} + template void operator()(T &o) { + m_ar & boost::serialization::make_nvp( + typeid(T).name() , + boost::serialization::base_object(m_object)); + } + }; + + +}; + + +} // detail + + + + + +struct Serializable { + friend class boost::serialization::access; + template friend class boost::serialization::access2; + virtual ~Serializable() {} +protected: +}; + + + + + +} // uLib + + + + + + +#endif // U_SERIALIZABLE_H diff --git a/src/Core/Signal.cpp b/src/Core/Signal.cpp new file mode 100644 index 0000000..f99873b --- /dev/null +++ b/src/Core/Signal.cpp @@ -0,0 +1,28 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + diff --git a/src/Core/Signal.h b/src/Core/Signal.h new file mode 100644 index 0000000..f27bc7a --- /dev/null +++ b/src/Core/Signal.h @@ -0,0 +1,168 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_SIGNAL_H +#define U_CORE_SIGNAL_H + +#include + +#include +#include +#include + +#include "Function.h" + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// Signals macro // + +#define default(vlaue) +#define slots +#define signals /*virtual void init_signals();*/ public +#define emit +#define SLOT(a) BOOST_STRINGIZE(a) +#define SIGNAL(a) BOOST_STRINGIZE(a) + +#define _ULIB_DETAIL_SIGNAL_EMIT(_name,...) \ + static BOOST_AUTO(sig,this->findOrAddSignal(&_name)); \ + sig->operator()(__VA_ARGS__); + +/** + * Utility macro to implement signal emission implementa una delle seguenti: + * + * // metodo standard con cast // + * SignalBase * sig = this->findSignal((void (Ob1::*)(void))&Ob1::V0); + * typedef Signal::type SigT; + * if(sig) reinterpret_cast(sig)->operator()(); + * + * // cast automatico // + * static BOOST_AUTO(sig,this->findOrAddSignal(&Ob1::V0)); + * sig->operator()(); +*/ +#define ULIB_SIGNAL_EMIT(_name,...) _ULIB_DETAIL_SIGNAL_EMIT(_name,__VA_ARGS__) + + +namespace uLib { + + +// A boost::signal wrapper structure /////////////////////////////////////////// + +// TODO ... + +typedef boost::signals2::signal_base SignalBase; + +template +struct Signal { + typedef boost::signals2::signal type; +}; + + + +//////////////////////////////////////////////////////////////////////////////// + + +namespace detail { + + +template +struct ConnectSignal {}; + +template +struct ConnectSignal< FuncT, 0 > { + static void connect(SignalBase *sigb, FuncT slof, typename FunctionTypes::Object *receiver) { + typedef typename Signal::SignalSignature>::type SigT; + reinterpret_cast(sigb)->connect(slof); + } +}; + +template +struct ConnectSignal< FuncT, 1 > { + static void connect(SignalBase *sigb, FuncT slof, typename FunctionTypes::Object *receiver) { + typedef typename Signal::SignalSignature>::type SigT; + reinterpret_cast(sigb)->connect(boost::bind(slof,receiver)); + } +}; + +template +struct ConnectSignal< FuncT, 2 > { + static void connect(SignalBase *sigb, FuncT slof, typename FunctionTypes::Object *receiver) { + typedef typename Signal::SignalSignature>::type SigT; + reinterpret_cast(sigb)->connect(boost::bind(slof,receiver,_1)); + } +}; + +template +struct ConnectSignal< FuncT, 3 > { + static void connect(SignalBase *sigb, FuncT slof, typename FunctionTypes::Object *receiver) { + typedef typename Signal::SignalSignature>::type SigT; + reinterpret_cast(sigb)->connect(boost::bind(slof,receiver,_1,_2)); + } +}; + +template +struct ConnectSignal< FuncT, 4 > { + static void connect(SignalBase *sigb, FuncT slof, typename FunctionTypes::Object *receiver) { + typedef typename Signal::SignalSignature>::type SigT; + reinterpret_cast(sigb)->connect(boost::bind(slof,receiver,_1,_2,_3)); + } +}; + +template +struct ConnectSignal< FuncT, 5 > { + static void connect(SignalBase *sigb, FuncT slof, typename FunctionTypes::Object *receiver) { + typedef typename Signal::SignalSignature>::type SigT; + reinterpret_cast(sigb)->connect(boost::bind(slof,receiver,_1,_2,_3,_4)); + } +}; + + +} // detail + + + +template +SignalBase *NewSignal(FuncT f) { + // seems to work wow ! + return new Signal::type; +} + +template +void ConnectSignal(SignalBase *sigb, FuncT slof, typename FunctionTypes::Object *receiver) +{ + detail::ConnectSignal< FuncT, FunctionTypes::arity >::connect(sigb,slof,receiver); +} + + + + +} // uLib + +#endif // SIGNAL_H diff --git a/src/Core/Singleton.h b/src/Core/Singleton.h new file mode 100644 index 0000000..be50548 --- /dev/null +++ b/src/Core/Singleton.h @@ -0,0 +1,46 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_SINGLETON_H +#define U_CORE_SINGLETON_H + +#include + + +namespace uLib { + +template +struct Singleton : boost::serialization::singleton { + +}; + + +} + + + +#endif // SINGLETON_H diff --git a/src/Core/SmartPointer.h b/src/Core/SmartPointer.h new file mode 100644 index 0000000..0627487 --- /dev/null +++ b/src/Core/SmartPointer.h @@ -0,0 +1,114 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_SMARTPOINTER_H +#define U_CORE_SMARTPOINTER_H + + +namespace uLib { + +class SmartPointerBase {}; + + +template +class SmartPointer : SmartPointerBase { + typedef T element_type; +public: + + explicit + SmartPointer(T* ptr = NULL) : m_counter(0) { + // if(!ptr) ptr = new T; + if (ptr) m_counter = new ReferenceCounter(ptr); // ??? + } + + // TakeReference // + SmartPointer(T &ref) : m_counter(new ReferenceCounter(&ref,0)) { } + + SmartPointer(const SmartPointer& copy) throw () { + acquire(copy.m_counter); + } + + SmartPointer(SmartPointer * copy) throw () { + acquire(copy->m_counter); + } + + virtual ~SmartPointer() { release(); } + + SmartPointer & operator=(const SmartPointer& copy) { + if (this != ©) + { + release(); + acquire(copy.m_counter); + } + return *this; + } + + T & operator*() const throw () { return *m_counter->ptr; } + T * operator->() const throw () { return m_counter->ptr; } + + T * get() const throw () { + return m_counter ? m_counter->ptr : 0; } + bool unique() const throw () { + return (m_counter ? m_counter->count == 1 : true); } + + + private: + + struct ReferenceCounter + { + ReferenceCounter(T* ptr = 0, unsigned c = 1) : ptr(ptr), count(c) { } + T* ptr; + unsigned count; + } * m_counter; + + // increment the count + void acquire(ReferenceCounter* c) throw () + { + m_counter = c; + if (c && c->count>0) ++c->count; + } + + // decrement the count, delete if it is 0 + void release() { + if (m_counter) { + if (--m_counter->count == 0) { + delete m_counter->ptr; + } + if (m_counter->count <= 0) { + delete m_counter; + m_counter = NULL; + } + } + } + +}; + + + +} + +#endif // SMARTPOINTER_H diff --git a/src/Core/StaticInterface.h b/src/Core/StaticInterface.h new file mode 100644 index 0000000..cb26039 --- /dev/null +++ b/src/Core/StaticInterface.h @@ -0,0 +1,77 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_STATICINTERFACE_H +#define U_CORE_STATICINTERFACE_H + +namespace uLib { + +#define MAKE_TRAITS ; // TODO + +#define uLibCheckFunction(class_name,name,out, ... ) \ +{ out (class_name::*x)(__VA_ARGS__) = &class_name::name; (void) x; } + +#define uLibCheckConstFunction(class_name,name,out,...) \ +{ out (class_name::*x)(__VA_ARGS__) const = &class_name::name; (void) x; } + +#define uLibCheckMember(class_name,name,type) \ +{ class_name x; type *y = &x.name; (void) y; } + + +namespace Interface { + +// EXAMPLE : +//template struct Voxel { +// MAKE_TRAITS; +// template void check_structural() { +// { float & (Self::*x)() = &Self::Density; (void) x; } +// { int & (Self::*x)() = &Self::TrackCount; (void) x; } +// } +//protected: +// ~Voxel() {} +//}; + +template +static inline void IsA() { + (void) ((void (SI::*)()) &SI::template check_structural); +} + +// not working +//template +//struct StaticIsA { +// void test() { +// static const void (SI::*x)() = SI::template check_structural; +// } +//}; + +} + + + +} + +#endif // STATICINTERFACE_H diff --git a/src/Core/String.h b/src/Core/String.h new file mode 100644 index 0000000..c65c007 --- /dev/null +++ b/src/Core/String.h @@ -0,0 +1,21 @@ +#ifndef U_CORE_STRING_H +#define U_CORE_STRING_H + +#include +#include + +namespace uLib { + +typedef std::string String; +typedef std::wstring Stringw; + +} + +template < typename C > +std::basic_string & operator << (std::basic_string &str, const C *c_str) { + std::basic_stringstream ss(c_str); + str += ss.str(); + return str; +} + +#endif // STRING_H diff --git a/src/Core/StringReader.h b/src/Core/StringReader.h new file mode 100644 index 0000000..3b7aa6c --- /dev/null +++ b/src/Core/StringReader.h @@ -0,0 +1,94 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_STRINGREADER_H +#define U_CORE_STRINGREADER_H + +#include +#include + +#include "Core/Vector.h" +#include +#include + + +// RIPENSARE COMPLETAMENTE !!! + +namespace uLib { + +struct StringReader { + + std::istream & m_is; + + StringReader(std::istream &is) : m_is(is) {} + + void ReadString(const char *str) { + // // clean compared string // + // char chars[] = " \t\n"; + // for (unsigned int i = 0; i < strlen(chars); ++i) + // { cmps.erase (std::remove(str.begin(), str.end(), chars[i]), str.end()); } + + // SISTEMARE !!! + + int pos = 0; + char c; + while( pos < strlen(str) ) { + while( IsEscape(str[pos])) pos++; + if ( pos >= strlen(str) ) break; + while( IsEscape(c = m_is.get()) ); + if (c == str[pos] ) pos++; + else pos = 0; + } + } + + static inline bool IsEscape(char c){ + const char *escapes = " \r\n\t"; + for ( int i = 0 ; i < 4 ; ++i) { + if(c == escapes[i]) return true; + } + return false; + } + +}; + +template +inline StringReader & operator >> (StringReader &isr, T &t) { + isr.m_is >> t; + return isr; +} + +inline StringReader & operator >> (StringReader &isr, const char *str) { + isr.ReadString(str); + return isr; +} + + + +} // uLib + + +#endif // STRINGREADER_H diff --git a/src/Core/Types.h b/src/Core/Types.h new file mode 100644 index 0000000..a3dfa1c --- /dev/null +++ b/src/Core/Types.h @@ -0,0 +1,278 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_TYPES_H +#define U_CORE_TYPES_H + +#include +#include + +#include + +#include + +#include "Core/Macros.h" +#include "Core/Mpl.h" + + + + + + + +namespace uLib { + + +//////////////////////////////////////////////////////////////////////////////// + +namespace detail { + +struct TypeIntrospection { + + // BOOST IMPL // + BOOST_MPL_HAS_XXX_TRAIT_DEF(type_info) + + // SFINAE IMPL // + /* + template + struct has_type_info { + typedef char yes[1]; + typedef char no[2]; + template static yes& test(typename U::type_info::BaseList*); + template static no& test(...); + // struct apply { + static const bool value = sizeof(test(0)) == sizeof(yes); + typedef boost::mpl::bool_ type; + // }; + }; + */ + + /** IsA Introspectable Object Implementation Template */ + template + struct IsIntrospectable : has_type_info {}; + + template struct access { + typedef typename T::type_info type_info; + }; + + template + struct child_first_impl { + + template + struct lambda_CFList_f { + typedef mpl::vector type; + }; + + template + struct lambda_CFList_f { + // typedef typename T1::type_info::CFList type; + typedef typename access::type_info::CFList type; + }; + + template + struct lambda_CFList : lambda_CFList_f::value> {}; + + /** Transforms all Base Type into proper CFList */ + typedef typename mpl::transform_view < typename access::type_info::BaseList + , lambda_CFList + >::type CFListSeq; + + /** Folds each CFList into a new sequence */ + typedef typename mpl::fold< CFListSeq + , mpl::vector<> + , mpl::copy< mpl::_1 + , mpl::back_inserter + > + >::type Childs; + + /** Add This Class to final CFList sequence */ + typedef typename mpl::copy< Childs + , mpl::back_inserter< mpl::vector > + >::type type; + }; + + + /** + * Tests if T has a member called type_info then compile type CFList + */ + template + struct child_first : mpl::if_< has_type_info + , child_first_impl + , mpl::vector<> + >::type {}; + + +}; + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// TYPE ADAPTERS // FINIRE !!! + +//#define _REPETITION_V(vz,vn,vdata) + + +//template < class TypeList > +//class TypeAdapterInputInterface { +// virtual ~TypeAdapterInputInterface() {} +//public: + + + +// virtual void operator()(int val) {} +// virtual void operator()(std::string val) {} +//}; + + + + + + + +} // detail //////////////////////////////////////////////////////////////////// + + +#define CONSTEXPR BOOST_CONSTEXPR + + +typedef ltk::Real_t Real_t; +typedef ltk::Id_t Id_t; +typedef ltk::Size_t Size_t; +typedef ltk::Pointer_t Pointer_t; +typedef bool Bool_t; //Boolean (0=false, 1=true) (bool) + +//--- bit manipulation --------------------------------------------------------- +#ifndef BIT +#define BIT(n) (1ULL << (n)) +#endif + +#ifndef SETBIT +#define SETBIT(n,i) ((n) |= BIT(i)) +#endif + +#ifndef CLRBIT +#define CLRBIT(n,i) ((n) &= ~BIT(i)) +#endif + +#ifndef TESTBIT +#define TESTBIT(n,i) ((Bool_t)(((n) & BIT(i)) != 0)) +#endif + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// TYPE INTROSPECTION FOR OBJECTS // + + + +#define uLibTypeMacro(thisClass,...) \ + \ + /* Friendship detail for accessing introspection */ \ + template friend class uLib::detail::TypeIntrospection::access; \ + \ + /* type info structure*/ public: \ + /* in GCC 4.8 must be public or dynamic_cast wont work */ \ + struct type_info { \ + /*WARNING: -std=c++0x required for this! */ \ + constexpr static const char *name = BOOST_PP_STRINGIZE(thisClass); \ + typedef BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__) BaseClass; \ + typedef thisClass ThisClass; \ + typedef uLib::mpl::vector<__VA_ARGS__,thisClass> TypeList; \ + typedef uLib::mpl::vector<__VA_ARGS__> BaseList; \ + typedef uLib::detail::TypeIntrospection::child_first::type CFList; \ + }; \ + \ + public: \ + typedef type_info::BaseClass BaseClass; \ + virtual const char *type_name() const { return type_info::name; } \ + /* Object Props fwd declaration*/ \ + struct ObjectProps; \ + /**/ + + +/** + * TypeList inheritance introspection + */ +struct TypeIntrospection { + template + struct child_first : detail::TypeIntrospection::child_first {}; +}; + + + + + + +// SISTEMARE // +struct PrintTypeId { + template + void operator()(T) const + { std::cout << typeid(T).name() << std::endl; } + + template + static void PrintMplSeq(SeqT *p = NULL) { boost::mpl::for_each(PrintTypeId()); } + + template + static void PrintType(Class *p = NULL) { std::cout << typeid(Class).name() << std::endl; } +}; + + + +// ACCESS // +struct Access {}; +template struct Access2 {}; + + + + +} // uLib + +#endif // U_CORE_TYPES_H + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Core/Uuid.cpp b/src/Core/Uuid.cpp new file mode 100644 index 0000000..0270de8 --- /dev/null +++ b/src/Core/Uuid.cpp @@ -0,0 +1,45 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "Uuid.h" +#include "Singleton.h" + +using namespace uLib; + +uLib::uuid_t uLib::uLib_dns_uuid; +TypeRegister* TypeRegister::s_Instance = new TypeRegister(); + +TypeRegister::TypeRegister() : + BaseClass(uLib_dns_uuid) +{} + +TypeRegister * TypeRegister::Controller() { + return TypeRegister::s_Instance; +} + + + diff --git a/src/Core/Uuid.h b/src/Core/Uuid.h new file mode 100644 index 0000000..4787655 --- /dev/null +++ b/src/Core/Uuid.h @@ -0,0 +1,163 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_UUID_H +#define U_CORE_UUID_H + +#include + +#include +#include +#include +#include + +#include "Core/Mpl.h" +#include "Core/Vector.h" +#include "Core/Object.h" + + +namespace uLib { + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// Object Registration // + + +typedef boost::uuids::uuid uuid_t; + +extern uuid_t uLib_dns_uuid; + +template < typename T > +class type_id : public boost::uuids::uuid { +public: + type_id() : + m_size(sizeof(T)), + uuid(boost::uuids::name_generator(uLib_dns_uuid)(typeid(T).name())) + { + std::cout << "Request for register new type\n" << + "name: " << typeid(T).name() << "\n" << + "uuid: " << to_string(*this) << "\n"; + } + + explicit type_id(boost::uuids::uuid const& u) + : boost::uuids::uuid(u) {} + + operator boost::uuids::uuid() { + return static_cast(*this); + } + + operator boost::uuids::uuid() const { + return static_cast(*this); + } + + unsigned int size() const { return m_size; } + +private: + unsigned int m_size; +}; + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// TYPE REGISTER // + +namespace detail { + +class TypeRegister { + typedef boost::uuids::name_generator IDGen_t; +public: + struct RegisterEntry { + uuid_t id; + int size; + }; + + TypeRegister(uuid_t const &dns) : + gen(dns) {} + + + template< typename T > + RegisterEntry * AddType(T *t = NULL) { + RegisterEntry en = { gen(typeid(T).name()), sizeof(T) }; + for(int i=0; i < m_registry.size(); ++i) + if(en.id == m_registry[i].id) return &(m_registry[i]); + m_registry.push_back(en); + return &m_registry.back(); + } + + void PrintSelf(std::ostream &o) { + std::cout << "RegisterController: \n"; + for (int i=0; i m_registry; + +}; + +} // detail + + + + +class TypeRegister : public detail::TypeRegister { +public: + typedef detail::TypeRegister BaseClass; + typedef detail::TypeRegister::RegisterEntry Entry; + + static TypeRegister* Controller(); + +private: + TypeRegister(); // Blocks constructor + static TypeRegister *s_Instance; // Singleton instance +}; + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// OBJECT REGISTER // + + + +} // uLib + +#endif // UUID_H diff --git a/src/Core/Vector.h b/src/Core/Vector.h new file mode 100644 index 0000000..ace265b --- /dev/null +++ b/src/Core/Vector.h @@ -0,0 +1,195 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_VECTOR_H +#define U_CORE_VECTOR_H + +#include +#include + +#include +#include +#include + + +namespace uLib { + +// Vector Implemetation ... wraps std::vector +template +class Vector : public std::vector > +{ + typedef std::vector< T,std::allocator > BaseClass; + typedef std::allocator Allocator; +public: + typedef T TypeData; + typedef __gnu_cxx::__normal_iterator Iterator; + typedef __gnu_cxx::__normal_iterator ConstIterator; + + typedef CommaInitializer< Vector , T > VectorCommaInit; + + Vector(unsigned int size) : BaseClass(size) {} + Vector(unsigned int size, T &value) : BaseClass(size,value) {} + Vector() : BaseClass(0) {} + + inline VectorCommaInit operator <<(T scalar) { + return VectorCommaInit(this, scalar); + } + + inline void PrintSelf(std::ostream &o); + + void remove_element(unsigned int index) { + std::swap(this->at(index),this->back()); + this->pop_back(); + } + + void remove_element(T &t) { + std::swap(t, this->back()); + this->pop_back(); + } + +}; + +template +void Vector::PrintSelf(std::ostream &o) +{ + o << " *** uLib Vector *** \n"; + o << " n. of items = " << this->size() << "\n"; + for(int i=0; i< this->size(); ++i) + o << (T)this->at(i) << " "; + o << "\n"; +} + +template +std::ostream &operator << (std::ostream &o, const Vector &v) { + for(int i=0; i< v.size(); ++i) + o << (T)v.at(i) << " "; + o << "\n"; + return o; +} + +template +std::ofstream &operator << (std::ofstream &o, const Vector &v) { + for(int i=0; i< v.size(); ++i) + o << (T)v.at(i) << " "; + return o; +} + + +// MATH OPERATIONS // + +#define ULIB_CONTAINER_MATHOP(container,op) \ +template < typename T1, typename T2 > \ +inline container & operator op##= (container &src, const T2 data) { \ + foreach (T1 &el, src) { \ + el op##= static_cast(data); \ + } \ +} \ +\ +template < typename T1, typename T2 > \ +inline container operator op (const container &src, const T2 data) { \ + container out(src); \ + out op##= data; \ + return out; \ +} \ +// +ULIB_CONTAINER_MATHOP(Vector,+) +ULIB_CONTAINER_MATHOP(Vector,-) +ULIB_CONTAINER_MATHOP(Vector,*) +ULIB_CONTAINER_MATHOP(Vector,/) + + + + + + + +// Smart pointer Vector Implementation // + + +template +class SmartVector : public SmartPointer< Vector > { + typedef SmartPointer< Vector > Base; +public: + + SmartVector() : Base(NULL) { } +// SmartVector() : Base(new Vector()) { } + SmartVector( const SmartVector ©) : Base(copy) { } + SmartVector(unsigned int size) : Base(new Vector((int)size)) { } + + virtual ~SmartVector() {} + + T& operator[](int p) { + return Base::get()->at(p); + } + + void swap_elements(unsigned int first, unsigned int second) { + std::swap(Base::get()->at(first),Base::get()->at(second)); + } + + void remove_element(unsigned int index) { + std::swap(Base::get()->at(index),Base::get()->back()); + Base::get()->pop_back(); + } + + void remove_element(T &t) { + std::swap(t, Base::get()->back()); + Base::get()->pop_back(); + } +}; + + + + +// ------ Utils ------------------------------------------------------------- // + + + +// RIFARE con iteratore ! +template +inline const unsigned long +VectorSplice(const _Tp &_it, const _Tp &_end, const float value, _CmpT _comp) +{ + _Tp it = _it; + _Tp end = _end-1; + for(it; it != end;) + { + if (_comp(*it,value)) ++it; + else if(_comp(*end,value)) std::swap(*it,*end--); + else --end; + } + return it - _it; +} + + + +} // uLib + + + + + +#endif // VECTOR_H diff --git a/src/Core/testing/BoostAccumulatorTest.cpp b/src/Core/testing/BoostAccumulatorTest.cpp new file mode 100644 index 0000000..fabf75a --- /dev/null +++ b/src/Core/testing/BoostAccumulatorTest.cpp @@ -0,0 +1,88 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include + +#include +#include +#include +#include +#include +#include + + +#include "testing-prototype.h" + +using namespace boost::accumulators; + +using namespace boost; +using namespace boost::accumulators; + +typedef accumulator_set > acc; +typedef iterator_range >::iterator > histogram_type; + +template +class data_filler +{ +public: + data_filler(){} + T operator()() { return rand()/(T)RAND_MAX; } +}; + + +int main(int argc, char** argv) +{ + + //create some random data + std::vector data(100); + std::generate(data.begin(), data.end(), data_filler()); + int c = data.size();//cache size for histogramm. + + //create an accumulator + acc myAccumulator( tag::density::num_bins = 20, tag::density::cache_size = 10); + + //fill accumulator + for (int j = 0; j < c; ++j) + { + myAccumulator(data[j]); + } + + histogram_type hist = density(myAccumulator); + + double total = 0.0; + + for( int i = 0; i < hist.size(); i++ ) + { + std::cout << "Bin lower bound: " << hist[i].first << ", Value: " << hist[i].second << std::endl; + total += hist[i].second; + } + + std::cout << "Total: " << total << std::endl; //should be 1 (and it is) + + return 0; +} diff --git a/src/Core/testing/BoostTest.cpp b/src/Core/testing/BoostTest.cpp new file mode 100644 index 0000000..d22aa12 --- /dev/null +++ b/src/Core/testing/BoostTest.cpp @@ -0,0 +1,64 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include + +#include "Core/Object.h" +#include "Core/Options.h" + +#include "Core/Singleton.h" + +#include "testing-prototype.h" + +using namespace uLib; + + +struct A : Object { + A() : a(0) {} + int a; +}; + + +int main(int argc, char **argv) +{ + BEGIN_TESTING(Boost Mock); + + A &a = Singleton::get_mutable_instance(); + a.a = 5552368; + + const A &aa = Singleton::get_const_instance(); + + std::cout << a.a << "\n"; + std::cout << aa.a << "\n"; + + TEST1( a.a == 5552368 ); + TEST1( aa.a == 5552368 ); + + END_TESTING; +} diff --git a/src/Core/testing/CMakeLists.txt b/src/Core/testing/CMakeLists.txt new file mode 100644 index 0000000..ca9d68c --- /dev/null +++ b/src/Core/testing/CMakeLists.txt @@ -0,0 +1,34 @@ + +# TESTS +set( TESTS + SmartVectorTest + VectorTest + ObjectFlagsTest + ObjectParametersTest + ObjectCopyTest + StaticInterfaceTest + CommaInitTest + DebugTTreeDumpTest + BoostTest + BoostAccumulatorTest + PropertiesTest + FunctionTest + SignalTest + SerializeTest + SerializeDreadDiamondTest + DreadDiamondParameters + ObjectPropableTest + UuidTest + TypeIntrospectionTraversal + OptionsTest +) + +set(LIBRARIES + ${PACKAGE_LIBPREFIX}Core + ${PACKAGE_LIBPREFIX}Math + ${Boost_SERIALIZATION_LIBRARY} + ${Boost_SIGNALS_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${ROOT_LIBRARIES} +) +uLib_add_tests(${uLib-module}) diff --git a/src/Core/testing/CommaInitTest.cpp b/src/Core/testing/CommaInitTest.cpp new file mode 100755 index 0000000..a23f265 --- /dev/null +++ b/src/Core/testing/CommaInitTest.cpp @@ -0,0 +1,57 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include + +#include "testing-prototype.h" +#include "Core/Vector.h" + +#include + +#define test_print(file,str,...) \ + printf(str,__VA_ARGS__) + +using namespace uLib; + +int main() +{ + BEGIN_TESTING( Comma Init ); + + Vector test; + + test << 1,2,3,4,5; + + test.PrintSelf(std::cout); + + + test_print(stdout,"ciao %d \n",5); + + printf("ciao\n"); + + END_TESTING; +} diff --git a/src/Core/testing/DebugTTreeDumpTest.cpp b/src/Core/testing/DebugTTreeDumpTest.cpp new file mode 100644 index 0000000..c40b75d --- /dev/null +++ b/src/Core/testing/DebugTTreeDumpTest.cpp @@ -0,0 +1,118 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include + +#include "testing-prototype.h" +#include "Core/Debug.h" + +#include +#include +#include + +#include +#include +#include + + +#include +#include +#include +#include +#include +#include + +using namespace uLib; + + + +class DebugAdapterTTree : public detail::DebugAdapterInterface { + TTree *m_tree; +public: + + DebugAdapterTTree(const char *name) : m_tree(new TTree(name,name)) {} + ~DebugAdapterTTree() { delete m_tree; } + + void operator()(int val) { + std::cout << "debugger 2 prints: " << val << "\n"; + } +}; + + + + +int main(int argc, char **argv) +{ + + { + Debug debug; + DebugAdapterText adapter(std::cout); + DebugAdapterTTree treead("test"); + + debug.AddAdapter(adapter); + debug.AddAdapter(treead); + + int a = 5552368; + debug("a",a); + + std::string str = "ciao"; + debug("str",str); + + debug.Update(); + } + + + // TestTObject *test = new TestTObject; + + + TFile *file = new TFile("test_file.root","RECREATE"); + file->cd(); + TTree *tree = new TTree; +// tree->Branch("test",&test); + +// for(int i=0;i<10;++i) { +// test->a = i; +// test->b = -i; +// tree->Fill(); +// } + tree->Write(); + + gApplication = new TApplication("My ROOT Application", &argc, argv); + TBrowser *tbr = new TBrowser("test"); + tbr->Show(); + + + gApplication->Run(); + + return 0; +} + + + + + diff --git a/src/Core/testing/DreadDiamondParameters.cpp b/src/Core/testing/DreadDiamondParameters.cpp new file mode 100644 index 0000000..fa1b3fe --- /dev/null +++ b/src/Core/testing/DreadDiamondParameters.cpp @@ -0,0 +1,80 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include +#include +#include + + + +#include "boost/archive/xml_oarchive.hpp" +#include "boost/archive/xml_iarchive.hpp" + +#include "testing-prototype.h" + +#include "Core/Object.h" +#include "Math/Dense.h" +#include "Core/Mpl.h" + + +using namespace uLib; + + +////////////////////////////////////////////////////////////////////////////// + + +int main() { + + + + +} + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Core/testing/Flags.h b/src/Core/testing/Flags.h new file mode 100644 index 0000000..f6a8d1b --- /dev/null +++ b/src/Core/testing/Flags.h @@ -0,0 +1,76 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CORE_FLAGS_H +#define U_CORE_FLAGS_H + +namespace uLib { + +template class Flags +{ + T i; +public: + typedef T EnumT; + + inline Flags(const Flags &f) : i(f.i) {} + inline Flags() : i((T)0) {} + inline Flags(T f) : i(f) {} + + inline Flags &operator=(const Flags &f) { i = f.i; return *this; } + inline Flags &operator&=(T mask) { i &= mask; return *this; } + + inline Flags &operator|=(const Flags f) { i |= f.i; return *this; } + inline Flags &operator|=(const T f) { i |= f; return *this; } + inline Flags &operator^=(const Flags f) { i ^= f.i; return *this; } + inline Flags &operator^=(const T f) { i ^= f; return *this; } + + inline Flags operator|(const Flags f) const { return Flags(i | f.i); } + inline Flags operator|(const T f) const { return Flags(i | f); } + inline Flags operator^(const Flags f) const { return Flags(i ^ f.i); } + inline Flags operator^(const T f) const { return Flags(i ^ f); } + inline Flags operator&(const Flags f) const { return Flags(i & f.i); } + inline Flags operator&(const T f) const { return Flags(i & f); } + inline Flags operator~() const { return Flags(~i); } + + inline bool operator !() const { return !i; } + inline bool testFlag(const T f) const + { return (i & f) == f && (f != 0 || i == f ); } + // inline bool operator==(const T f) const { return i==f; } + + inline T operator()() { return i; } + inline operator T() const { return i; } +}; + + +typedef Flags Flags2B; +typedef Flags Flags4B; +typedef Flags Flags8B; + +} // uLib + + +#endif // FLAGS_H diff --git a/src/Core/testing/FunctionTest.cpp b/src/Core/testing/FunctionTest.cpp new file mode 100644 index 0000000..9a3b3ca --- /dev/null +++ b/src/Core/testing/FunctionTest.cpp @@ -0,0 +1,57 @@ + +#include +#include +#include + +#include "testing-prototype.h" +#include "Core/Types.h" + +#include +#include + +namespace uLib { + +class TestVoxel { +public: + float m_data; + float Get() { return m_data; } + float ConstGet() const { return m_data; } + float & GetRef() { return m_data; } + const float & ConstGetRef() const { return m_data; } +}; + + + +} // uLib + +using namespace uLib; + +int main() { + BEGIN_TESTING(Function Test); + + + Vector v; + v.push_back(TestVoxel()); + v.push_back(TestVoxel()); + v.push_back(TestVoxel()); + v.push_back(TestVoxel()); + v.push_back(TestVoxel()); + v.push_back(TestVoxel()); + v.push_back(TestVoxel()); + + + v[5].m_data = 5552368.0; + + ProgrammableAccessor f1(&TestVoxel::m_data); + ProgrammableAccessor f2(&TestVoxel::GetRef); + + int i=0; + foreach (TestVoxel &el,v) { + f1.Set(&el,i++); + std::cout << " -> " << f2.Get(&el) << "\n"; + } + + + END_TESTING; +} + diff --git a/src/Core/testing/Makefile.am b/src/Core/testing/Makefile.am new file mode 100644 index 0000000..882b9fd --- /dev/null +++ b/src/Core/testing/Makefile.am @@ -0,0 +1,38 @@ +include $(top_srcdir)/Common.am + +#AM_DEFAULT_SOURCE_EXT = .cpp + +# if HAVE_CHECK +TESTS = SmartPointerTest \ + SmartVectorTest \ + VectorTest \ + ObjectFlagsTest \ + ObjectParametersTest \ + ObjectCopyTest \ + StaticInterfaceTest \ + CommaInitTest \ + DebugTTreeDumpTest \ + BoostTest \ + BoostAccumulatorTest \ + PropertiesTest \ + SignalTest \ + SerializeTest \ + SerializeDreadDiamondTest \ + DreadDiamondParameters \ + ObjectPropableTest \ + TypeIntrospectionTraversal \ + OptionsTest + +# UuidTest + +# else +# TEST = +# endif + +LDADD = $(top_srcdir)/libmutom-${PACKAGE_VERSION}.la $(AM_LIBS_BOOST) $(AM_LIBS_ROOT) + +check_PROGRAMS = $(TESTS) + + +all: $(TESTS) + diff --git a/src/Core/testing/ObjectCopyTest.cpp b/src/Core/testing/ObjectCopyTest.cpp new file mode 100644 index 0000000..5e1ddc9 --- /dev/null +++ b/src/Core/testing/ObjectCopyTest.cpp @@ -0,0 +1,50 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include + +#include "testing-prototype.h" +#include "Core/Types.h" +#include "Core/Object.h" + + +using namespace uLib; + + + + +int main() +{ + BEGIN_TESTING(ObjectParameters); + + + + + END_TESTING; +} diff --git a/src/Core/testing/ObjectFlagsTest.cpp b/src/Core/testing/ObjectFlagsTest.cpp new file mode 100644 index 0000000..58c1b3c --- /dev/null +++ b/src/Core/testing/ObjectFlagsTest.cpp @@ -0,0 +1,69 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "testing-prototype.h" +#include "Core/Object.h" + + +using namespace uLib; + + +//class Derived : public uLib::Object { +//public: +// Derived(int flags) : uLib::Object(flags) {} +// enum Flags { +// a = 1<<0, // 1 +// b = 1<<1, // 2 +// c = 1<<2 // 4 +// }; +//}; + + + + + +int main() { + BEGIN_TESTING(ObjectFlags); + +// Object o(2); +// o.flags() = 4; +// o.flags() |= 1; +// TEST1( o.flags() == 5); +// o.flags() &= 1; +// TEST1( o.flags() == 1); +// TEST1( o.flags().testFlag(1) ); + +// Derived d( Derived::a | Derived::b); +// d.flags() = Derived::c; +// d.flags() |= Derived::a; +// TEST1( d.flags() == Derived::a | Derived::c); +// d.flags() &= 1; +// TEST1( d.flags() == Derived::a); +// TEST1( d.flags().testFlag(Derived::a) ); + + END_TESTING +} diff --git a/src/Core/testing/ObjectMock/Makefile.am b/src/Core/testing/ObjectMock/Makefile.am new file mode 100644 index 0000000..d191897 --- /dev/null +++ b/src/Core/testing/ObjectMock/Makefile.am @@ -0,0 +1,11 @@ + +include $(top_srcdir)/Common.am + +#AM_DEFAULT_SOURCE_EXT = .cpp + + +LDADD = $(top_srcdir)/libmutom-0.1.la $(AM_LIBS_BOOST) + +bin_PROGRAMS = ObjectMock +ObjectMock_SOURCES = main.cpp Ob.cpp Ob1.cpp Ob2.cpp + diff --git a/src/Core/testing/ObjectMock/Ob.cpp b/src/Core/testing/ObjectMock/Ob.cpp new file mode 100644 index 0000000..ccf9bc8 --- /dev/null +++ b/src/Core/testing/ObjectMock/Ob.cpp @@ -0,0 +1,59 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Ob.h" + + + +BOOST_CLASS_EXPORT_IMPLEMENT(uLib::Ob) // use this in cpp file + +namespace uLib { + +class ObPrivate { +public: + + + +}; + + + +Ob::Ob() : + m_p(NULL), + m_s(NULL), + m_type_id(0), + d(new ObPrivate) +{ + +} + + + + +} + diff --git a/src/Core/testing/ObjectMock/Ob.h b/src/Core/testing/ObjectMock/Ob.h new file mode 100644 index 0000000..5ef3917 --- /dev/null +++ b/src/Core/testing/ObjectMock/Ob.h @@ -0,0 +1,181 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + + +#ifndef OB_H +#define OB_H + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "testing-prototype.h" + + + + + + +#include "Core/Vector.h" +#include "Core/Uuid.h" + +#include "boost/typeof/typeof.hpp" +#include + +#include +#include +#include +#include + + +#include +#include +#include + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// Mock of serializable object system // + +#define default(vlaue) +#define slots +#define signals public +#define emit +# define SLOT(a) a +# define SIGNAL(a) a + + + + + +namespace uLib { + + + + + + + + + +//////////////////////////////////////////////////////////////////////////////// +//// OB /////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +class Ob { + +public: + + Ob(); + ~Ob() { + if(m_p) delete m_p; + } + + //// init ////////////////////////////////////////////////////////////////// + template + void init(){ + if(!m_type_id) { + m_p = (Parameters *) new typename T::Parameters; + m_type_id = TypeRegister::Controller()->AddType< T >(); + } + } + + virtual void PrintSelf(std::ostream &o) const { o << "Base Object PrintSelf\n"; } + +protected: + // parameters ////////////////////////////////////////////////////////////// + struct Parameters { friend class boost::serialization::access; }; + inline Parameters &p() { assert(m_p); return *m_p; } + inline const Parameters &p() const { assert(m_p); return *m_p; } + virtual void init() {} + + + // serialization access //////////////////////////////////////////////////// + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int version) { + // ar & boost::serialization::make_nvp("instance_size", m_type_id->size); + // ar & boost::serialization::make_nvp("instance_data",boost::serialization::make_binary_object(this,m_type_id->size)); + } + + template + static void serialize(Archive &ar, Ob &ob, const unsigned int version) {} + + template + static void serialize(Archive &ar, Ob::Parameters &p, const unsigned int version) {} + + +public: + + TypeRegister::Entry * type_id() const { return m_type_id; } + +private: + + // members ///////////////////////////////////////////////////////////////// + struct Parameters *m_p; + struct Signals *m_s; + + friend class ObPrivate; + class ObPrivate *d; + + TypeRegister::Entry * m_type_id; +}; + + + + + + + + + +} + +//////////////////////////////////////////////////////////////////////////////// + + + + + +BOOST_CLASS_EXPORT_KEY(uLib::Ob) + + + + + + + +#endif diff --git a/src/Core/testing/ObjectMock/Ob1.cpp b/src/Core/testing/ObjectMock/Ob1.cpp new file mode 100644 index 0000000..e7a36ba --- /dev/null +++ b/src/Core/testing/ObjectMock/Ob1.cpp @@ -0,0 +1,80 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Ob1.h" + +namespace uLib { + + + + + +// created by moc // -------------------------------------------------------- // + + +void Ob1::init() +{ + Ob::init(); + boost::serialization::void_cast_register(); + BaseClass::init(); + // default parameters value // + p().a = 1; + p().b = 2; +} + + + + +//// serialization accessor that can be made by moc // + +//template +//void Ob1::serialize(Archive &ar, Ob1::Parameters &p, const unsigned int version) +//{ +// Ob1::BaseClass::serialize( ar,p,version ); +// ar & boost::serialization::make_nvp("a",p.a); +// ar & boost::serialization::make_nvp("b",p.b); +//} + +//template +//void Ob1::serialize(Archive &ar, Ob1 &ob, const unsigned int version ) +//{ +// Ob1::BaseClass::serialize(ar,ob,version); +// // other members to be serialized // +//} + + + +// -------------------------------------------------------------------------- // + + + +} + + +BOOST_CLASS_EXPORT_IMPLEMENT(uLib::Ob1) // use this in cpp file + diff --git a/src/Core/testing/ObjectMock/Ob1.h b/src/Core/testing/ObjectMock/Ob1.h new file mode 100644 index 0000000..5796c4f --- /dev/null +++ b/src/Core/testing/ObjectMock/Ob1.h @@ -0,0 +1,122 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef OB1_H +#define OB1_H + +#include +#include "Ob.h" + + +//////////////////////////////////////////////////////////////////////////////// +// OB1 /////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace uLib { + +class Ob1 : public Ob { +public: + + typedef Ob BaseClass; + struct Parameters : public BaseClass::Parameters { + int a default(1); + int b default(2); + }; + virtual ~Ob1() {} + + // created by macro //////////////////////////////////////////////////////// + void init(); + inline Parameters &p() { return (Parameters &)Ob::p(); } + inline const Parameters &p() const { return (Parameters &)Ob::p(); } + static Ob1 *New() { Ob1 *o = new Ob1; o->init(); return o; } + + + friend class boost::serialization::access; + + template + void serialize(Archive &ar, const unsigned int version); + + template + static void serialize(Archive & ar, + Ob1::Parameters & p, + const unsigned int version ); + + template + static void serialize(Archive &ar, + Ob1 &ob, + const unsigned int version ); + //////////////////////////////////////////////////////////////////////////// + + virtual void PrintSelf(std::ostream &o) const { o << "Object Ob1 PrintSelf\n"; } + + +}; + +// serialize accessors in macro // ------------------------------------------ // +template +void serialize(Archive &ar, Ob1::Parameters &p, const unsigned int version ) +{ + Ob1::serialize(ar,p,version); +} + + +template +void Ob1::serialize(Archive & ar, const unsigned int version) +{ + ar & boost::serialization::make_nvp("parameters",p()); + this->serialize(ar,*this,version); + Ob::serialize(ar,version); +} +// -------------------------------------------------------------------------- // + + +// serialization accessor that can be made by moc // + +template +void Ob1::serialize(Archive &ar, Ob1::Parameters &p, const unsigned int version) +{ + Ob1::BaseClass::serialize( ar,p,version ); + ar & boost::serialization::make_nvp("a",p.a); + ar & boost::serialization::make_nvp("b",p.b); +} + +template +void Ob1::serialize(Archive &ar, Ob1 &ob, const unsigned int version ) +{ + Ob1::BaseClass::serialize(ar,ob,version); + // other members to be serialized // +} + + + + +} // namespace + +BOOST_CLASS_EXPORT_KEY(uLib::Ob1) // use this in header + + +#endif diff --git a/src/Core/testing/ObjectMock/Ob2.cpp b/src/Core/testing/ObjectMock/Ob2.cpp new file mode 100644 index 0000000..c526faf --- /dev/null +++ b/src/Core/testing/ObjectMock/Ob2.cpp @@ -0,0 +1,73 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + + +#include "Ob2.h" + +namespace uLib { + + +// created by moc // -------------------------------------------------------- // + + + + +void Ob2::init() +{ + Ob::init(); + boost::serialization::void_cast_register(); + BaseClass::init(); + p().c = 3; + p().d = 4; +} + +//template +//void Ob2::serialize(Archive &ar, Parameters &p, const unsigned int version) +//{ +// Ob2::BaseClass::serialize( ar,p,version ); +// ar & boost::serialization::make_nvp("c",p.c); +// ar & boost::serialization::make_nvp("d",p.d); +//} + +//template +//void Ob2::serialize(Archive &ar, Ob2 &o, const unsigned int version ) +//{ +// Ob2::BaseClass::serialize(ar,o,version); +// ar & boost::serialization::make_nvp("serializzable_member",o.serializzable_member); +// // other members // +//} + + + +// -------------------------------------------------------------------------- // + +} + + + +BOOST_CLASS_EXPORT_IMPLEMENT(uLib::Ob2) // use this in cpp file diff --git a/src/Core/testing/ObjectMock/Ob2.h b/src/Core/testing/ObjectMock/Ob2.h new file mode 100644 index 0000000..8735ecb --- /dev/null +++ b/src/Core/testing/ObjectMock/Ob2.h @@ -0,0 +1,135 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#ifndef OB2_H +#define OB2_H + + +#include "Ob.h" +#include "Ob1.h" + +//////////////////////////////////////////////////////////////////////////////// +// OB2 /////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace uLib { + +class Ob2 : public Ob1 { +public: + typedef Ob1 BaseClass; + + struct Parameters : public BaseClass::Parameters { + int c default(3),d default(4); + }; + + Ob2() { + serializzable_member = 0; + memset(non_serializable_member,0,sizeof(char[250])); + } + + virtual ~Ob2() {} + + // created by macro //////////////////////////////////////////// + void init(); + inline Parameters &p() { return (Parameters &)Ob::p(); } + inline const Parameters &p() const { return (Parameters &)Ob::p(); } + static Ob2 *New() { Ob2 *o = new Ob2; o->init(); return o; } + + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int version); + template + static void serialize(Archive & ar, Parameters & p, const unsigned int version ); + template + static void serialize(Archive &ar, Ob2 &o, const unsigned int version ); + + //////////////////////////////////////////////////////////////// + + virtual void PrintSelf(std::ostream &o) const { o << "Object Ob2 PrintSelf\n"; } + + int serializzable_member; + char non_serializable_member[250]; +private: + +}; + + + +template +void serialize(Archive &ar, Ob2::Parameters &p, const unsigned int version ) +{ + Ob2::serialize(ar,p,version); +} + + + +template +void Ob2::serialize(Archive & ar, const unsigned int version) +{ +// boost::serialization::split_member(ar, *this, version); + ar & boost::serialization::make_nvp("parameters",p()); + this->serialize(ar,*this,version); + Ob::serialize(ar,version); +} + + + + + + +template +void Ob2::serialize(Archive &ar, Parameters &p, const unsigned int version) +{ + Ob2::BaseClass::serialize( ar,p,version ); + ar & boost::serialization::make_nvp("c",p.c); + ar & boost::serialization::make_nvp("d",p.d); +} + +template +void Ob2::serialize(Archive &ar, Ob2 &o, const unsigned int version ) +{ + Ob2::BaseClass::serialize(ar,o,version); + ar & boost::serialization::make_nvp("serializzable_member",o.serializzable_member); + // other members // +} + + + + + +} + + +BOOST_CLASS_EXPORT_KEY(uLib::Ob2) // use this in header +//BOOST_SERIALIZATION_FACTORY_0(uLib::Ob2) // use this for plugin construction + + + + + +#endif diff --git a/src/Core/testing/ObjectMock/main.cpp b/src/Core/testing/ObjectMock/main.cpp new file mode 100644 index 0000000..97c0a8b --- /dev/null +++ b/src/Core/testing/ObjectMock/main.cpp @@ -0,0 +1,174 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include + +#include +#include +#include +#include + +#include + + + +#include "Ob.h" +#include "Ob1.h" +#include "Ob2.h" + + +using namespace uLib; + + +////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////// +//// test boost ETI system // + +// used in external plugin construction mechanism // +int test_boost_eti () { + + boost::serialization::extended_type_info_typeid i_eti; + + std::cout << "int eti guid key: " << i_eti.get_key() << "\n"; + + Ob2 *test = (Ob2*)i_eti.construct(0); + test->init(); + + std::cout << "int eti typeid name: " << i_eti.get_typeid().name() << "\n"; + +} + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// main // + + + + + + +int main() +{ + +// //////////////////////////////////////////////////// +// // serialization tests +{ + Ob1 ob1; + ob1.init(); + std::cout << "ob1 param: " << + ob1.p().a << " " << + ob1.p().b << "\n"; + + + + Ob2 *ob2 = Ob2::New(); + std::cout << "ob2 param: " << + ob2->p().a << " " << + ob2->p().b << " " << + ob2->p().c << " " << + ob2->p().d << "\n"; + std::cout << "ob2 uuid: " << + to_string(ob2->type_id()->id) << "\n"; + + +// // serialize ob2 to file // +// { +// std::ofstream ofs("_BoostTest.xml"); +// boost::archive::xml_oarchive oa(ofs); +// oa << BOOST_SERIALIZATION_NVP(ob2); +// } + + // serialize ob2 to file via objact base cast // + { + Ob *ob = Ob2::New(); + sprintf(static_cast(ob)->non_serializable_member, + "deserializzati dati interni attraverso dump binario"); + std::ofstream ofs("_BoostTest.xml"); + boost::archive::xml_oarchive oa(ofs); + oa << BOOST_SERIALIZATION_NVP(ob); + } + + +// delete ob2; + + // deserialize ob2 from file // + { + Ob2 *newob2 = Ob2::New(); + newob2->p().c = 0; + std::ifstream ifs("_BoostTest.xml"); + boost::archive::xml_iarchive ia(ifs); + ia >> BOOST_SERIALIZATION_NVP(*newob2); + printf("%s\n",newob2->non_serializable_member); + std::cout << "deserialized ob2: > " << + newob2->p().a << " " << + newob2->p().b << " " << + newob2->p().c << " " << + newob2->p().d << "\n"; + std::cout << "deserialized ob2 member: " << + "serializable_member = " << newob2->serializzable_member << "\n"; + std::cout << "deserialized ob2 uuid: " << + to_string(newob2->type_id()->id) << "\n"; + } + +} + + + + + + + +} + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Core/testing/ObjectMock/testing-prototype.h b/src/Core/testing/ObjectMock/testing-prototype.h new file mode 100644 index 0000000..39f4e6c --- /dev/null +++ b/src/Core/testing/ObjectMock/testing-prototype.h @@ -0,0 +1,37 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include + +#define BEGIN_TESTING(name) \ +static int _fail = 0; \ +printf("..:: Testing " #name " ::..\n"); + +#define TEST1(val) _fail += (val)==0 +#define TEST0(val) _fail += (val)!=0 +#define END_TESTING return _fail; + diff --git a/src/Core/testing/ObjectParametersTest.cpp b/src/Core/testing/ObjectParametersTest.cpp new file mode 100644 index 0000000..5a5cc4d --- /dev/null +++ b/src/Core/testing/ObjectParametersTest.cpp @@ -0,0 +1,61 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include +#include +#include + +#include "boost/archive/xml_oarchive.hpp" +#include "boost/archive/xml_iarchive.hpp" + +#include "Core/Object.h" +#include "Math/Dense.h" + +#include "testing-prototype.h" + + + + +using namespace uLib; + + + + +int main() { + +} + + + + + + + + + diff --git a/src/Core/testing/ObjectPropableTest.cpp b/src/Core/testing/ObjectPropableTest.cpp new file mode 100644 index 0000000..9e319db --- /dev/null +++ b/src/Core/testing/ObjectPropableTest.cpp @@ -0,0 +1,237 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include +#include +#include +#include + + +#include "Core/Types.h" +#include "Core/Object.h" +#include "Core/ObjectProps.h" +#include "Core/StringReader.h" +#include "Math/Dense.h" + +#include "boost/archive/text_oarchive.hpp" +#include "boost/archive/text_iarchive.hpp" + + +#include "testing-prototype.h" + + + + +using namespace uLib; + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// STRUCTURES // + + +struct A : virtual Object { + + uLibTypeMacro(A, Object) + + properties() { + int p_a; + Vector3f p_3f; + }; + + int m_a; +}; + +void A::init_properties() { + $_init(); + $$.p_a = 0; + $$.p_3f << 1,2,3; +} + +ULIB_SERIALIZABLE_OBJECT(A) +ULIB_SERIALIZE_OBJECT(A, Object) { ar & AR(m_a); } +ULIB_SERIALIZE_OBJECT_PROPS(A) { ar & AR(p_a) & AR(p_3f); } + + + + +struct B : A { + uLibTypeMacro(B,A) + + properties() { + std::string p; + }; + + B() : m_b(324) {} + + int m_b; +}; + + +void B::init_properties() { + $_init(); + $$.p = "ciao"; +} + +ULIB_SERIALIZABLE_OBJECT(B) +ULIB_SERIALIZE_OBJECT(B,A) { ar & AR(m_b); } +ULIB_SERIALIZE_OBJECT_PROPS(B) { ar & AR(p); } + + + +struct C { + int m_c; + std::string m_str; +}; + +ULIB_SERIALIZABLE(C) +ULIB_SERIALIZE(C) { ar & AR(m_c) & AR(m_str); } + + + +struct D : virtual Object, B { + uLibTypeMacro(D,Object,B) + + properties() { + C p_c; + }; +}; + +void D::init_properties() { + $_init(); + $$.p_c.m_c = 1234; +} + +ULIB_SERIALIZABLE_OBJECT(D) +ULIB_SERIALIZE_OBJECT(D,Object) {} +ULIB_SERIALIZE_OBJECT_PROPS(D) { + ar & AR(p_c); +} + + + +class E : public C, public D { + uLibTypeMacro(E,D,C) +public: + E() : m_Ea(5552368) {} + int m_Ea; +}; + +ULIB_SERIALIZABLE_OBJECT(E) +ULIB_SERIALIZE_OBJECT(E,C,D) { + ar & AR(m_Ea); +} + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// TESTS // + + +int test_xml_direct() { + // TEST ARCHIVE SAVE AND LOAD direct // + E o; o.init_properties(); + o.$$.p_c.m_str = "works"; + { + std::ofstream file("test.xml"); + Archive::xml_oarchive ar(file); + ar << NVP(o); + } + o.$$.p_c.m_str = "hola"; + { + std::ifstream file("test.xml"); + Archive::xml_iarchive ar(file); + ar >> NVP(o); + } + std::cout << o.$$.p_c.m_str << "\n"; + return ( o.$$.p_c.m_str == "works" ); +} + + +int test_xml_pointer() { + // TEST ARCHIVE SAVE AND LOAD from pointer // + E *o = new E; o->init_properties(); + o->$$.p_c.m_str = "works"; + { + std::ofstream file("test.xml"); + Archive::xml_oarchive ar(file); + ar << NVP(o); + } + o->$$.p_c.m_str = "hola"; + { + std::ifstream file("test.xml"); + Archive::xml_iarchive ar(file); + ar >> NVP(o); + } + std::cout << o->$$.p_c.m_str << "\n"; + return ( o->$$.p_c.m_str == "works" ); +} + + +int test_xml_objsave() { + // TEST SELF SAVE + E o; o.init_properties(); + o.$(B).p = "works"; + { + std::ofstream file("test.xml"); + Object::SaveXml(file,o); + } + o.$(B).p = "hola"; + { + std::ifstream file("test.xml"); + Object::LoadXml(file,o); + } + + std::cout << o.$(B).p << "\n"; + return ( o.$(B).p == "works" ); +} + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// MAIN // + +int main() +{ + BEGIN_TESTING(PropableTest); + + TEST1( test_xml_direct() ); + TEST1( test_xml_pointer() ); + TEST1( test_xml_objsave() ); + + END_TESTING; +} + + diff --git a/src/Core/testing/OptionsTest.cpp b/src/Core/testing/OptionsTest.cpp new file mode 100644 index 0000000..5463ae7 --- /dev/null +++ b/src/Core/testing/OptionsTest.cpp @@ -0,0 +1,72 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include + + + +#include "Core/Object.h" +#include "Core/Options.h" +#include "testing-prototype.h" + + +using namespace uLib; + + + + +int main(int argc, char **argv) +{ + BEGIN_TESTING(Boost ProgramOptions); + + + std::string optfile("configuration.ini"); + int a = 0; + int b = 0; + Options opt; + + opt.add_options() + ("help", "printout help") + ("value",&a,"value") + ("config",&optfile,"config_file"); + + opt.add_config_options() + ("B.value",&b,"b vlaue"); + + opt.parse_command_line(argc,argv); + opt.parse_config_file(optfile.c_str()); + + std::cout << "a = " << a << "\n"; + std::cout << "b = " << b << "\n"; + + + END_TESTING; +} + + diff --git a/src/Core/testing/PropertiesTest.cpp b/src/Core/testing/PropertiesTest.cpp new file mode 100644 index 0000000..23e4c4e --- /dev/null +++ b/src/Core/testing/PropertiesTest.cpp @@ -0,0 +1,96 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include + +#include + + +#include "Core/Object.h" +#include "testing-prototype.h" + +#define emit + + + + +template +class property +{ + typedef boost::signals2::signal& )> signal_t; + +public: + property() : m_changed(new signal_t) {} + property(const T in) : value(in) , m_changed(new signal_t) {} + + inline operator T const & () const { return value; } + inline operator T & () { return value; } + inline T & operator = (const T &i) { value = i; return value; } + template T2 & operator = (const T2 &i) { T2 &guard = value; } // Assign exact identical types only. + inline signal_t & valueChanged() { return *m_changed; } + +private: + T value; + boost::shared_ptr m_changed; +}; + + +//template +//class property { +// typedef boost::signals2::signal signal_t; + +//public: +// property() : m_changed() {} +// property(const T in) : value(in) , m_changed() {} + +// inline operator T const & () const { return value; } +// inline operator T & () { valueChanged()(value); return value; } +// inline T & operator = (const T &i) { value = i; valueChanged()(value); return value; } +// template T2 & operator = (const T2 &i) { T2 &guard = value; } // Assign exact identical types only. +// inline signal_t &valueChanged() { return m_changed; } + +//private: +// property(const property &); +// property &operator = (const property&); + +// T value; +// signal_t m_changed; +//}; + +// test generic void function slot // +void PrintSlot(const property &i) { std::cout << "slot called, new value = " << i << "!\n"; } + + + + + +int main() +{ + + +} diff --git a/src/Core/testing/SerializeDreadDiamondTest.cpp b/src/Core/testing/SerializeDreadDiamondTest.cpp new file mode 100644 index 0000000..5bd3a57 --- /dev/null +++ b/src/Core/testing/SerializeDreadDiamondTest.cpp @@ -0,0 +1,114 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include +#include +#include + +#include "Core/Object.h" + +#include "testing-prototype.h" + +using namespace uLib; + + + + + + + +struct A : Object { + uLibTypeMacro(A,Object) + A() : numa(5552368) {} + int numa; +}; + + +ULIB_SERIALIZABLE_OBJECT(A) +ULIB_SERIALIZE_OBJECT(A,Object) { + ar & AR(numa); +} + +struct B : virtual Object { + uLibTypeMacro(B,Object) + B() : numb(5552369) {} + int numb; +}; + +ULIB_SERIALIZABLE_OBJECT(B) +ULIB_SERIALIZE_OBJECT(B,Object) { ar & AR(numb); } + + +struct C : B { + uLibTypeMacro(C,B) + C() : numc(5552370) {} + int numc; +}; + +ULIB_SERIALIZABLE_OBJECT(C) +ULIB_SERIALIZE_OBJECT(C,B) { ar & AR(numc); } + +struct D : A,B { + uLibTypeMacro(D,A,B) + + D() : numd(5552371) {} + int numd; +}; + +ULIB_SERIALIZABLE_OBJECT(D) +ULIB_SERIALIZE_OBJECT(D,A,B) { ar & AR(numd); } + + + +main() { + A o; o.init_properties(); + + Archive::xml_oarchive(std::cout) << NVP(o); + +} + + + + + + + + + + + + + + + + + + + + diff --git a/src/Core/testing/SerializeMock/Makefile.am b/src/Core/testing/SerializeMock/Makefile.am new file mode 100644 index 0000000..2151e88 --- /dev/null +++ b/src/Core/testing/SerializeMock/Makefile.am @@ -0,0 +1,13 @@ + +include $(top_srcdir)/Common.am +#AM_DEFAULT_SOURCE_EXT = .cpp + + +LDADD = $(top_srcdir)/libmutom-0.1.la $(AM_LIBS_BOOST) + + + +bin_PROGRAMS = SerializeMock +SerializeMock_SOURCES = main.cpp Ob.cpp Ob1.cpp +#log_archive.cpp + diff --git a/src/Core/testing/SerializeMock/Ob.cpp b/src/Core/testing/SerializeMock/Ob.cpp new file mode 100644 index 0000000..5cf243d --- /dev/null +++ b/src/Core/testing/SerializeMock/Ob.cpp @@ -0,0 +1,103 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + + + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// polymorphic_base.cpp + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for updates, documentation, and revision history. + +//#include +//#include +//#include +//#include + +#include "Ob.h" + + +//// A ///////////////////////////////////////////////////////////////////////// + +template +void A::serialize(Archive &ar, unsigned int v) { + ar & BOOST_SERIALIZATION_NVP(i); +} + +//_SERIALIZE_IMPL(A,boost::archive::polymorphic_oarchive) +SERILIZE_IMPL(A) + +void A::Save(boost::archive::polymorphic_oarchive &ar) +{ ar << boost::serialization::make_nvp(boost::serialization::guid(),this); } + +// note: only the most derived classes need be exported +// BOOST_CLASS_EXPORT(A) + + + + +//// B ///////////////////////////////////////////////////////////////////////// + +template +void B::serialize(Ar &ar, unsigned int v) { + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); +} + +SERILIZE_IMPL(B) + +void B::Save(boost::archive::polymorphic_oarchive &ar) +{ ar << boost::serialization::make_nvp(boost::serialization::guid(),this); } + +_SPECIALIZE_IS_VIRTUAL_BASE(A,B) +BOOST_CLASS_EXPORT_IMPLEMENT(B) + + + + +//// C ///////////////////////////////////////////////////////////////////////// + +template +void C::serialize(Ar &ar, unsigned int v) { + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); +} + +SERILIZE_IMPL(C) + +void C::Save(boost::archive::polymorphic_oarchive &ar) +{ ar << boost::serialization::make_nvp(boost::serialization::guid(),this); } + +_SPECIALIZE_IS_VIRTUAL_BASE(A,C) +BOOST_CLASS_EXPORT_IMPLEMENT(C) + + + + diff --git a/src/Core/testing/SerializeMock/Ob.h b/src/Core/testing/SerializeMock/Ob.h new file mode 100644 index 0000000..8710400 --- /dev/null +++ b/src/Core/testing/SerializeMock/Ob.h @@ -0,0 +1,112 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + + +#ifndef OB_H +#define OB_H + + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_polymorphic2.hpp + +// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +#include + +#include +#include +#include +#include + + + +#define _SERIALIZE_IMPL_SEQ \ + (boost::archive::polymorphic_iarchive) \ + (boost::archive::polymorphic_oarchive) \ + (boost::archive::xml_iarchive) \ + (boost::archive::xml_oarchive) + +#define _SERIALIZE_IMPL(Class,Archive) \ + template void Class::serialize(Archive &ar,const unsigned int); + +#define _SERIALIZE_IMPL_OP(r,data,elem) _SERIALIZE_IMPL(data,elem) + +#define SERILIZE_IMPL(Class) BOOST_PP_SEQ_FOR_EACH(_SERIALIZE_IMPL_OP,Class,_SERIALIZE_IMPL_SEQ) + +#define _SPECIALIZE_IS_VIRTUAL_BASE(Base,Derived) namespace boost{ template<> struct is_virtual_base_of: public boost::mpl::true_ {}; } +#define _SPECIALIZE_IS_VIRTUAL_BASE_OP(r,data,elem) _SPECIALIZE_IS_VIRTUAL_BASE(data,elem) + + + + +// should pass compilation and execution +namespace boost { +namespace archive { + class polymorphic_oarchive; + class polymorphic_iarchive; +} +} + + +struct A { + virtual ~A() {} + + template void serialize(Archive &ar, unsigned int v); + virtual void Save(boost::archive::polymorphic_oarchive &ar); + + int i; +}; + + +struct B : virtual A { + + template void serialize(Ar &ar, unsigned int v); + virtual void Save(boost::archive::polymorphic_oarchive &ar); + +}; + +BOOST_CLASS_EXPORT_KEY(B) + +struct C : virtual A { + + template void serialize(Ar &ar, unsigned int v); + virtual void Save(boost::archive::polymorphic_oarchive &ar); +}; + +BOOST_CLASS_EXPORT_KEY(C) + + + +#endif diff --git a/src/Core/testing/SerializeMock/Ob1.cpp b/src/Core/testing/SerializeMock/Ob1.cpp new file mode 100644 index 0000000..4e2f411 --- /dev/null +++ b/src/Core/testing/SerializeMock/Ob1.cpp @@ -0,0 +1,52 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include +#include +#include +#include + +#include "Ob.h" +#include "Ob1.h" + + +template +void D::serialize(Ar &ar, unsigned int v) { + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(B); + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(C); +} + +SERILIZE_IMPL(D) + +void D::Save(boost::archive::polymorphic_oarchive &ar) +{ ar << boost::serialization::make_nvp(boost::serialization::guid(),this); } + +_SPECIALIZE_IS_VIRTUAL_BASE(B,D) +_SPECIALIZE_IS_VIRTUAL_BASE(C,D) +BOOST_CLASS_EXPORT_IMPLEMENT(D) diff --git a/src/Core/testing/SerializeMock/Ob1.h b/src/Core/testing/SerializeMock/Ob1.h new file mode 100644 index 0000000..c062906 --- /dev/null +++ b/src/Core/testing/SerializeMock/Ob1.h @@ -0,0 +1,45 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef OB1_H +#define OB1_H + + +#include "Ob.h" + + +struct D : B,C { + + template void serialize(Ar &ar, unsigned int v); + virtual void Save(boost::archive::polymorphic_oarchive &ar); + +}; + +BOOST_CLASS_EXPORT_KEY(D) + + +#endif // OB1_H diff --git a/src/Core/testing/SerializeMock/main.cpp b/src/Core/testing/SerializeMock/main.cpp new file mode 100644 index 0000000..fc8f0e1 --- /dev/null +++ b/src/Core/testing/SerializeMock/main.cpp @@ -0,0 +1,111 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include + +#include "boost/archive/xml_oarchive.hpp" +#include "boost/archive/polymorphic_xml_oarchive.hpp" +#include "boost/archive/polymorphic_xml_iarchive.hpp" +#include "boost/archive/polymorphic_text_oarchive.hpp" +#include "boost/archive/polymorphic_text_iarchive.hpp" + +#include "boost/serialization/export.hpp" + +#include "Ob.h" +#include "Ob1.h" + +#include "boost/archive/detail/basic_pointer_oserializer.hpp" + + + + + +//template class boost::archive::detail::archive_serializer_map; + +int main(int /*argc*/, char* /*argv*/[]) +{ + D d; + A *a = &d; + a->i = 5552368; + + A *la = NULL; + + D *dla = NULL; + + { + std::ofstream file; + file.open("test.xml"); + boost::archive::polymorphic_xml_oarchive oa_implementation(file,0); + boost::archive::polymorphic_oarchive & opa = oa_implementation; + opa << BOOST_SERIALIZATION_NVP(a); + a->Save(opa); + file.close(); + } + + { + std::ifstream file; + file.open("test.xml"); + boost::archive::polymorphic_xml_iarchive ia_implementation(file,0); + boost::archive::polymorphic_iarchive & ipa = ia_implementation; + ipa >> BOOST_SERIALIZATION_NVP(la); + ipa >> BOOST_SERIALIZATION_NVP(dla); + file.close(); + } + + boost::archive::polymorphic_xml_oarchive xoa(std::cout); + dla->Save(xoa); + + + +} + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Core/testing/SerializeTest.cpp b/src/Core/testing/SerializeTest.cpp new file mode 100644 index 0000000..f15660a --- /dev/null +++ b/src/Core/testing/SerializeTest.cpp @@ -0,0 +1,249 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include + +#include "Core/Object.h" +#include "Core/Archives.h" +#include "ParticlePhysics/MuonTomography/MuonScatter.h" + +#include "testing-prototype.h" + +using namespace uLib; + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// MANUAL SERIALIZATION // + +struct V3f { + + float x,y,z; + V3f() + { x = y = z =0; } + + V3f(float x, float y, float z) : + x(x), y(y), z(z) {} + + template + void serialize (Archive &ar,unsigned int v) { + ar + & "<" & NVP(x) & NVP(y) & NVP(z) & ">"; + } +}; + +ULIB_CLASS_EXPORT_KEY(V3f); +ULIB_CLASS_EXPORT_IMPLEMENT(V3f); + + +inline std::ostream & +operator <<(std::ostream &o, const V3f &v) { + Archive::hrt_oarchive(o) << v; + return o; +} + +inline std::istream & +operator >>(std::istream &is, V3f &v) { + Archive::hrt_iarchive(is) >> v; + return is; +} + + + + +int test_V3f() { + // testing human readble archive with simple serializable structure // + + V3f v1(1,2,3),v2,v3,v4; + std::cout << "v --> " << v1 << "\n"; + + std::stringstream ss; ss << v1; + std::cout << "ss.v --> " << ss.str() << "\n"; + + Archive::hrt_iarchive ar(ss); ar >> v2; + std::cout << "v2 --> " << v2 << "\n"; + + std::stringstream("<2 3 4>") >> v3; + std::cout << "v3 --> " << v3 << "\n"; + + // std::cout << "insert V3f string to parse: "; std::cin >> v4; + // std::cout << "v4 --> " << v4 << "\n"; + return (1); +} + + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// OBJECT SERIALIZATION // + +class A : public virtual Object { + uLibTypeMacro(A,Object) + ULIB_SERIALIZE_ACCESS +public: + A() : m_a(5552368) {} + + properties() { + std::string p_a; + }; + + uLibRefMacro (a,int); +private: + int m_a; +}; + +void A::init_properties() { + $_init(); + $$.p_a = "A property string"; +} + +ULIB_SERIALIZABLE_OBJECT(A) +ULIB_SERIALIZE_OBJECT(A,Object) { + ar + & "Object A : " + & "--> m_a = " & AR(m_a) + & "\n"; +} + +ULIB_SERIALIZE_OBJECT_PROPS(A) { + ar + & "Object A properties: " + & "---> p_a = " & AR(p_a) & "\n"; +} + + + +int testing_xml_class() { + + A a; a.init_properties(); + + { + std::ofstream file("test.xml"); + Archive::xml_oarchive(file) << NVP(a); + } + a.a() = 0; + a.$$.p_a = "zero string"; + { + std::ifstream file("test.xml"); + Archive::xml_iarchive(file) >> NVP(a); + } + + Archive::xml_oarchive(std::cout) << NVP(a); + return ( a.a() == 5552368 && a.$$.p_a == "A property string" ); +} + +int testing_hrt_class() { + + A a; a.init_properties(); + + { + std::ofstream file("test.xml"); + Archive::hrt_oarchive(file) << NVP(a); + } + a.a() = 0; + a.$$.p_a = "zero string"; + { + // ERRORE FIX ! + // std::ifstream file("test.xml"); + // Archive::hrt_iarchive(file) >> NVP(a); + } + + Archive::hrt_oarchive(std::cout) << NVP(a); + return ( a.a() == 5552368 && a.$$.p_a == "A property string" ); +} + + + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// MUON SCATTER EXAMPLE // + +int testing_mu() +{ + std::stringstream ss; + + MuonScatter mu; + mu.SetMomentumIn(555); + mu.SetMomentumOut(2368); + { + std::ofstream file("test.txt"); + file << mu; + } + + mu.SetMomentumIn(0); + mu.SetMomentumOut(0); + { + std::ifstream file("test.txt"); + file >> mu; + } + + std::cout << mu << "\n"; + + +} + + + + + + +int main() { + BEGIN_TESTING(Serialize Test); + + TEST1( test_V3f() ); + TEST1( testing_xml_class() ); + // testing_hrt_class(); ///// << ERRORE in HRT with properties + TEST1( testing_mu() ); + + END_TESTING; +} + + + + + + + + + + + + + diff --git a/src/Core/testing/SignalMock/Makefile.am b/src/Core/testing/SignalMock/Makefile.am new file mode 100644 index 0000000..dfb0c93 --- /dev/null +++ b/src/Core/testing/SignalMock/Makefile.am @@ -0,0 +1,11 @@ + +include $(top_srcdir)/Common.am + +#AM_DEFAULT_SOURCE_EXT = .cpp + + +LDADD = $(top_srcdir)/libmutom-0.1.la $(AM_LIBS_BOOST) + +bin_PROGRAMS = SignalMock +SignalMock_SOURCES = main.cpp Ob.cpp Ob1.cpp Ob2.cpp + diff --git a/src/Core/testing/SignalMock/Ob.cpp b/src/Core/testing/SignalMock/Ob.cpp new file mode 100644 index 0000000..6a19a13 --- /dev/null +++ b/src/Core/testing/SignalMock/Ob.cpp @@ -0,0 +1,104 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Ob.h" + + + + + +namespace uLib { + + + + + + + +namespace SignalMock { + +class ObPrivate { +public: + + struct Signal { + GenericMFPtr sigptr; + std::string sigstr; + SignalBase *signal; + }; + + Vector sigv; + + +}; + + + + + + +Ob::Ob() : + d(new ObPrivate) +{} + + +void Ob::PrintSelf(std::ostream &o) const +{ + o << "OBJECT signal Mock: ------------------\n"; + Vector::Iterator itr; + for(itr = d->sigv.begin(); itrsigv.end(); itr++) + { + o << " signal:[ " << itr->sigstr << " ]\n"; + } + o << "--------------------------------------\n\n"; +} + + + +bool Ob::addSignalImpl(SignalBase *sig, GenericMFPtr fptr, const char *name) +{ + ObPrivate::Signal s = {fptr,std::string(name),sig}; + d->sigv.push_back(s); +} + +SignalBase *Ob::findSignalImpl(const GenericMFPtr &fptr) +{ + for(int i=0; isigv.size(); ++i) + { + if(d->sigv[i].sigptr == fptr) + return d->sigv[i].signal; + } + return NULL; +} + + + + +} + +} + diff --git a/src/Core/testing/SignalMock/Ob.h b/src/Core/testing/SignalMock/Ob.h new file mode 100644 index 0000000..a9fb376 --- /dev/null +++ b/src/Core/testing/SignalMock/Ob.h @@ -0,0 +1,348 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + + +#ifndef OB_H +#define OB_H + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + + +#include + +#include "testing-prototype.h" + + + + + + +#include "Core/Vector.h" + +#include "boost/typeof/typeof.hpp" +#include + +#include +#include +#include +#include + + +#include +#include +#include + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// Mock of serializable object system // + +#define default(vlaue) +#define slots +#define signals public +#define emit +# define SLOT(a) a +# define SIGNAL(a) a + + + + + +namespace uLib { + +namespace SignalMock { + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// Function pointers // + + + +//////////////////////////////////////////////////////////////////////////////// +// type synthesize ( please read: boost implementation synthesize.hpp ) // +//////////////////////////////////////////////////////////////////////////////// +// TODO: change this to boost implementation // +// return a reference to function ... as the boost signal signature wants + +template +struct FunctionTypes {}; + +template +struct FunctionTypes< R(O::*)() > { + typedef R ref(); + typedef R (ptr)(); + typedef O obj; +}; + +template +struct FunctionTypes< R(O::*)(T0) > { + typedef R ref(T0); + typedef R (ptr)(T0); + typedef O obj; +}; + +template +struct FunctionTypes< R(O::*)(T0,T1) > { + typedef R ref(T0,T1); + typedef R (ptr)(T0,T1); + typedef O obj; +}; + +template +struct FunctionTypes< R(O::*)(T0,T1,T2) > { + typedef R ref(T0,T1,T2); + typedef R (ptr)(T0,T1,T2); + typedef O obj; +}; + + + + + + + +template +struct FunctionPointer { + typedef typename boost::function_types::function_type::type Signature; + typedef typename FunctionTypes::ref SignalSignature; + enum { + arity = boost::function_types::function_arity::value, + ismfp = boost::is_member_function_pointer::value + }; + + typedef boost::mpl::bool_< ismfp > HasObjectType; + typedef typename FunctionTypes::obj Object; + typedef boost::function_traits< Signature > Traits; + + virtual void PrintSelf( std::ostream &o ) { + o << "[fp: " << typeid(Signature).name() + << " arity: " << arity << "]\n"; } +}; + + + + +//////// generic function holder /////////////////////////////////////////////// + +class GenericMFPtr { + typedef void (GenericMFPtr::*_MFPtrStub_t)(); +public: + + typedef _MFPtrStub_t Type; + + GenericMFPtr() {} + + template + GenericMFPtr(T in) { + m_ptr = reinterpret_cast<_MFPtrStub_t>(in); + } + + template + inline bool operator == (T in) { + return m_ptr == reinterpret_cast<_MFPtrStub_t>(in); + } + + inline bool operator == (const GenericMFPtr &in) { + return m_ptr == in.m_ptr; + } + + Type operator()() { return m_ptr; } + + _MFPtrStub_t m_ptr; +private: +}; + + + + + + + +// A boost::signal wrapper structure /////////////////////////////////////////// + +// TODO ... + +typedef boost::signals2::signal_base SignalBase; + +template +struct Signal { + typedef boost::signals2::signal type; +}; + +template +SignalBase *NewSignal(FuncT f) { + // seems to work ! + return new Signal::type; +} + + +//////////////////////////////////////////////////////////////////////////////// + + +template +struct ConnectSignal {}; + +template +struct ConnectSignal< FuncT, 0 > { + static void connect(SignalBase *sigb, FuncT slof, typename FunctionPointer::Object *receiver) { + typedef typename Signal::SignalSignature>::type SigT; + reinterpret_cast(sigb)->connect(slof); + } +}; + +template +struct ConnectSignal< FuncT, 1 > { + static void connect(SignalBase *sigb, FuncT slof, typename FunctionPointer::Object *receiver) { + typedef typename Signal::SignalSignature>::type SigT; + reinterpret_cast(sigb)->connect(boost::bind(slof,receiver)); + } +}; + +template +struct ConnectSignal< FuncT, 2 > { + static void connect(SignalBase *sigb, FuncT slof, typename FunctionPointer::Object *receiver) { + typedef typename Signal::SignalSignature>::type SigT; + reinterpret_cast(sigb)->connect(boost::bind(slof,receiver,_1)); + } +}; + +template +struct ConnectSignal< FuncT, 3 > { + static void connect(SignalBase *sigb, FuncT slof, typename FunctionPointer::Object *receiver) { + typedef typename Signal::SignalSignature>::type SigT; + reinterpret_cast(sigb)->connect(boost::bind(slof,receiver,_1,_2)); + } +}; + + + + + +//////////////////////////////////////////////////////////////////////////////// +//// OB /////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +class Ob { + +public: + + Ob(); + + // Qt4 style connector // + static bool connect(const Ob *ob1, const char *signal, const Ob *receiver, const char *slot) { + // 1) find slot pointer from name + // 2) find a way to do connection with no type + // TODO: finire + } + + // Qt5 style connector // + template + static bool connect( typename FunctionPointer::Object *sender, Func1 sigf, + typename FunctionPointer::Object *receiver, Func2 slof) + { + SignalBase *sigb = sender->findSignal(sigf); + typedef boost::signals2::signal::SignalSignature> SigT; + ConnectSignal::arity>::connect(sigb,slof,receiver); + } + + template + static inline bool connect(SignalBase *sigb, FuncT slof, Ob *receiver) { + ConnectSignal::arity>::connect(sigb,slof,receiver); + } + + + template< typename FuncT > + inline bool addSignal(FuncT fun, const char *name) { + SignalBase *sig = NewSignal(fun); + addSignalImpl(sig,fun,name); + } + + + template < typename FuncT > + inline SignalBase *findSignal(FuncT fptr) + { + return findSignalImpl(GenericMFPtr(fptr)); + } + + template < typename FuncT > + inline boost::signals2::signal< typename FunctionPointer::SignalSignature> *findSignal2(FuncT fptr) + { + return (boost::signals2::signal::SignalSignature> *)findSignalImpl(GenericMFPtr(fptr)); + } + + void PrintSelf(std::ostream &o) const; + +private: + + bool addSignalImpl(SignalBase *sig, GenericMFPtr fptr, const char *name); + + SignalBase *findSignalImpl(const GenericMFPtr &fptr); + + + friend class ObPrivate; + class ObPrivate *d; +}; + + + + + + + +} // SignalMock + +} + +//////////////////////////////////////////////////////////////////////////////// + + + + + + +#endif diff --git a/src/Core/testing/SignalMock/Ob1.cpp b/src/Core/testing/SignalMock/Ob1.cpp new file mode 100644 index 0000000..7a89c5f --- /dev/null +++ b/src/Core/testing/SignalMock/Ob1.cpp @@ -0,0 +1,55 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Ob1.h" + +namespace uLib { + +void SignalMock::Ob1::PrintHelloOb1() { + std::cout << "Hello Ob1!\n"; +} + + + + + + +// created by moc // -------------------------------------------------------- // + + + + + + +// -------------------------------------------------------------------------- // + + + +} + + diff --git a/src/Core/testing/SignalMock/Ob1.h b/src/Core/testing/SignalMock/Ob1.h new file mode 100644 index 0000000..5f50bad --- /dev/null +++ b/src/Core/testing/SignalMock/Ob1.h @@ -0,0 +1,68 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef SOB1_H +#define SOB1_H + +#include +#include "Ob.h" + + +//////////////////////////////////////////////////////////////////////////////// +// OB1 /////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace uLib { + +namespace SignalMock { + +class Ob1 : public Ob { +public: + + +signals: + void TestSignal(); + +public slots: + void PrintHelloOb1(); + + +}; + +// serialize accessors in macro // ------------------------------------------ // + + +// -------------------------------------------------------------------------- // + + +} + +} // namespace + + + +#endif diff --git a/src/Core/testing/SignalMock/Ob2.cpp b/src/Core/testing/SignalMock/Ob2.cpp new file mode 100644 index 0000000..b48bbb9 --- /dev/null +++ b/src/Core/testing/SignalMock/Ob2.cpp @@ -0,0 +1,44 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + + +#include "Ob2.h" + +namespace uLib { + + +// created by moc // -------------------------------------------------------- // + + + +// -------------------------------------------------------------------------- // + +} + + + diff --git a/src/Core/testing/SignalMock/Ob2.h b/src/Core/testing/SignalMock/Ob2.h new file mode 100644 index 0000000..7cc7b30 --- /dev/null +++ b/src/Core/testing/SignalMock/Ob2.h @@ -0,0 +1,57 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#ifndef SOB2_H +#define SOB2_H + + +#include "Ob.h" +#include "Ob1.h" + +//////////////////////////////////////////////////////////////////////////////// +// OB2 /////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace uLib { + +namespace SignalMock { + +class Ob2 : public Ob1 { +public: + typedef Ob1 BaseClass; + + +private: + +}; + +} + +} + +#endif diff --git a/src/Core/testing/SignalMock/main.cpp b/src/Core/testing/SignalMock/main.cpp new file mode 100644 index 0000000..c8133c2 --- /dev/null +++ b/src/Core/testing/SignalMock/main.cpp @@ -0,0 +1,180 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include + +#include + + +#include +#include +#include +#include + + +#include +#include +#include +#include + + +#include "Ob.h" +#include "Ob1.h" +#include "Ob2.h" + + + + +using namespace uLib; + +using namespace SignalMock;; + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// main // + + + + +class OBT1 : public Ob { +public: + +signals: + void Sig_v(); + + void Sig_v(int i); + + void Sig_v(int i, int j); + + int Sig_i(int i, int j); + + int SignalTest(int i,int j); + +public slots: + void Slot() { + std::cout << "slot v0 called\n"; + } + + void Slot(int i) { + std::cout << "slot v1i called with i=" << i << "\n"; + } + + void Slot(int i,int j) { + std::cout << "slot v2i called with i=" << i << " j=" << j << "\n"; + } + + int SlotAdd(int i,int j) { + std::cout << "slot i2i called with i=" << i << " j=" << j << "\n"; + return i+j; + } +}; + + + + +// Wrote by moc // +void OBT1::Sig_v() { + // SignalBase * sig = this->findSignal((void(OBT1::*)())&OBT1::Sig_v); + // typedef SignalMock::Signal::type SigT; + // if(sig) reinterpret_cast(sig)->operator()(); + BOOST_AUTO(sig, this->findSignal2((void(OBT1::*)())&OBT1::Sig_v)); + sig->operator()(); +} + +void OBT1::Sig_v(int i) { + SignalBase * sig = this->findSignal((void(OBT1::*)(int))&OBT1::Sig_v); + typedef SignalMock::Signal::type SigT; + if(sig) reinterpret_cast(sig)->operator()(i); +} + +void OBT1::Sig_v(int i, int j) { + SignalBase * sig = this->findSignal((void(OBT1::*)(int,int))&OBT1::Sig_v); + typedef SignalMock::Signal::type SigT; + if(sig) reinterpret_cast(sig)->operator()(i,j); +} + +int OBT1::Sig_i(int i, int j) +{ + SignalBase * sig = this->findSignal(&OBT1::Sig_i); + typedef SignalMock::Signal::type SigT; + if(sig) return *reinterpret_cast(sig)->operator()(i,j); + else return 0; +} + +int OBT1::SignalTest(int i, int j) +{ + SignalBase * sig = this->findSignal(&OBT1::SignalTest); + typedef SignalMock::Signal::type SigT; + if(sig) return *reinterpret_cast(sig)->operator()(i,j); + else return 0; +} + + + + + + + + + + + +int main() +{ + OBT1 o1,o2; + + o1.addSignal(&OBT1::SignalTest, "OBT1::SignalTest"); + o1.addSignal((void(OBT1::*)())&OBT1::Sig_v, "OBT1::Sig_v0"); + o1.addSignal((void(OBT1::*)(int))&OBT1::Sig_v, "OBT1::Sig_v1i"); + + Ob::connect(&o1,(void(OBT1::*)())&OBT1::Sig_v, + &o2,(void(OBT1::*)())&OBT1::Slot); + Ob::connect(&o1,(void(OBT1::*)(int))&OBT1::Sig_v, + &o2,(void(OBT1::*)(int))&OBT1::Slot); + Ob::connect(&o1,&OBT1::SignalTest,&o2,&OBT1::SlotAdd); + + + + o1.PrintSelf(std::cout); + + + // Qt style emit // + emit o1.Sig_v(); + emit o1.Sig_v(1); + emit o1.Sig_v(1,2); + std::cout << "return val2 = " << o1.SignalTest(3,4) << "\n"; + + + + return 0; +} + + + diff --git a/src/Core/testing/SignalMock/main2.cpp b/src/Core/testing/SignalMock/main2.cpp new file mode 100644 index 0000000..f75d0ab --- /dev/null +++ b/src/Core/testing/SignalMock/main2.cpp @@ -0,0 +1,169 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + + +#include "Ob.h" +#include "Ob1.h" +#include "Ob2.h" + + +using namespace uLib; + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// main // + + + + +class Test : public Ob{ +public: + +signals: + void PrintSng() { } + void PrintSng2(int i); + void PrintSng3(int i, char c); +}; + +// written by moc // +void Test::PrintSng2(int i) +{ + std::cout << "[Emit signal: PrintSgn2(" << i <<")]\n"; + typedef void(Test::* FPtr)(int); + FPtr fptr = &Test::PrintSng2; + typedef Signal::arity, typename FunctionTypes::Signature > SType; + SignalBase *s = this->findSignal(fptr); + static_cast(s)->m_signal(*this,i); +} + +// written by moc // +void Test::PrintSng3(int i,char c) +{ +} + + + + +class TestSlot: public Ob { +public: + TestSlot(const char *name) : m_name(name) {} + +public slots: + void PrintInt(int i) { + std::cout << "SLOT [" << m_name << "]>> TestSlot::PrintInt(" << i << ")\n"; + } + +private: + std::string m_name; +}; + + +void freeFunction0() {} + +void freeFunction1(int i) {} + +template +void printSignature(FuncT f){ + + typedef typename boost::function_types::function_type::type Signature; + typedef boost::mpl::if_< boost::mpl::bool_::value > , typename boost::function_traits< Signature >::arg1_type, void > Object; + + std::cout << "***Function Signature ***\n" + << " type_name : " << typeid(typename boost::function_types::function_type::type).name() << "\n" + // << " object type : " << typeid(typename boost::function_traits< typename boost::function_types::function_type::type >::arg1_type).name() << "\n" + << " object type : " << typeid(Object).name() << "\n" + << " is memfn : " << (boost::is_member_function_pointer::value == true) << "\n" + << " n aguments : " << boost::function_types::function_arity::value << "\n\n"; +} + + + + + + +int main() +{ + + Test t1; + TestSlot t2("slotOb1"),t3("slotOb2"); + + // in moc we add signals + t1.addSignal(&Test::PrintSng2,"Test::PrintSng2(int)"); + t1.addSignal(&Test::PrintSng3,"Test::PrintSng3(int,char)"); + + + SignalBase * signal = t1.findSignal(&Test::PrintSng2); + if(signal) + std::cout << "signal found" << "\n"; + + + + Ob::connect(&t1, &Test::PrintSng2, + &t2, &TestSlot::PrintInt); + Ob::connect(&t1, &Test::PrintSng2, + &t3, &TestSlot::PrintInt); + + emit t1.PrintSng2(5552368); + + // SignalBase *s = NewSignal(&Test::PrintSng2); + + +// printSignature(&freeFunction0); + printSignature(&freeFunction1); + printSignature(&Test::PrintSng2); + + + + + + + + + return 0; + +} + + + diff --git a/src/Core/testing/SignalMock/test1.cpp b/src/Core/testing/SignalMock/test1.cpp new file mode 100644 index 0000000..b49f560 --- /dev/null +++ b/src/Core/testing/SignalMock/test1.cpp @@ -0,0 +1,216 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include + +#include +#include +#include +#include + +#include + + + +#include "Ob.h" +#include "Ob1.h" +#include "Ob2.h" + + +using namespace uLib; + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// main // + +class SignalBase { +public: + virtual void call() = 0; +}; + +template +struct Signal : public boost::noncopyable, SignalBase +{ + typedef T PtrSignature; + virtual void call() {} +}; + +template +struct Signal : public boost::noncopyable, SignalBase +{ + typedef boost::function_traits< Ret() > SignatureTraits; + + typedef boost::signals2::signal SignalType; + typedef typename SignalType::slot_function_type SlotFunctionType; + typedef typename SignalType::result_type ResultType; + typedef boost::signals2::connection ConnectionType; + + Signal() : m_signal() {}; + virtual ~Signal() {}; + + void call() { m_signal(); } + + SignalType & signal() { return m_signal; } + +protected: + SignalType m_signal; +}; + + +template +struct Signal : public boost::noncopyable, SignalBase +{ + typedef boost::function_traits< Ret(Arg) > SignatureTraits; + + typedef boost::signals2::signal SignalType; + typedef typename SignalType::slot_function_type SlotFunctionType; + typedef typename SignalType::result_type ResultType; + typedef boost::signals2::connection ConnectionType; + + Signal() : m_signal() {}; + virtual ~Signal() {}; + + void call() { m_signal(0); } + + SignalType & signal() { return m_signal; } + +protected: + SignalType m_signal; +}; + + + +template < typename T > +static SignalBase * BuildSig(typename FunctionTypes::Object *obj, T f) { + Signal *s = new Signal; + typename FunctionTypes::Object::TS ts = { + static_cast(s), + reinterpret_cast(f) + }; + obj->v.push_back(ts); + return static_cast(s); +} + +template < typename T > +static SignalBase * FindSignal(typename FunctionTypes::Object *obj, T f) { + void *ptr = reinterpret_cast(f); + for (int i=0; iv.size(); ++i) + if(obj->v[i].ptr == ptr) return obj->v[i].sig; + return NULL; +} + +template < typename T1, typename T2 > +static bool Connect(typename FunctionTypes::Object *sender, T1 signal, + typename FunctionTypes::Object *receiver, T2 slot) +{ + SignalBase *s = FindSignal(sender,signal); + if(!s) return false; + static_cast< Signal * >(s)->signal().connect(boost::bind(slot,receiver)); + return true; +} + + + + +class Test : public Ob { +public: + + struct TS{ + SignalBase *sig; + void *ptr; + }; + + Vector v; + + + Test() { + BuildSig(this, &Test::TestSignal); + BuildSig(this, &Test::TestSignal1); +// BuildSig(this, &Test::TestSignal2); + } + +signals: + + void TestSignal(); + void TestSignal1(int); + void TestSignal2(int,int); + +public slots: + + void PrintHello() { std::cout << "Hello!\n"; } + +}; + + + +// moc it // +void Test::TestSignal(){ +// static SignalBase *signal = BuildSig(this, &Test::TestSignal); + static SignalBase *signal = FindSignal(this,&Test::TestSignal); + signal->call(); + // signal->call(); +} + +void Test::TestSignal1(int) +{ + static SignalBase *signal = FindSignal(this,&Test::TestSignal1); + signal->call(); +} + +void Test::TestSignal2(int,int) +{ +// static SignalBase *signal = FindSignal(this,&Test::TestSignal2); +// signal->call(); +} + + +int main() +{ + + //////////////////////////////////////////////////// + // signalling tests + + + Test test; + +// test.addSignal(&Test::TestSignal,"TestSignal()"); + +// Test::connect(&test,&Test::TestSignal,&test,&Test::PrintHello); + + + Connect(&test,&Test::TestSignal,&test,&Test::PrintHello); + + emit test.TestSignal(); + + return 0; +} + + diff --git a/src/Core/testing/SignalMock/testing-prototype.h b/src/Core/testing/SignalMock/testing-prototype.h new file mode 100644 index 0000000..39f4e6c --- /dev/null +++ b/src/Core/testing/SignalMock/testing-prototype.h @@ -0,0 +1,37 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include + +#define BEGIN_TESTING(name) \ +static int _fail = 0; \ +printf("..:: Testing " #name " ::..\n"); + +#define TEST1(val) _fail += (val)==0 +#define TEST0(val) _fail += (val)!=0 +#define END_TESTING return _fail; + diff --git a/src/Core/testing/SignalTest.cpp b/src/Core/testing/SignalTest.cpp new file mode 100644 index 0000000..491af54 --- /dev/null +++ b/src/Core/testing/SignalTest.cpp @@ -0,0 +1,115 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include +#include + + +#include "testing-prototype.h" +#include "Core/Types.h" +#include "Core/Object.h" +#include "Core/Signal.h" + + +using namespace uLib; + + + + +class Ob1 : public Object { +public: + + +signals: + void V0(); + + int V1(int a); + +}; + + + + +// should be done by moc // +void Ob1::V0() { + ULIB_SIGNAL_EMIT(Ob1::V0); +} + +int Ob1::V1(int a) { + ULIB_SIGNAL_EMIT(Ob1::V1,a); +} + + + + + +class Ob2 : public Object { + +public slots: + void PrintV0() { + std::cout << "Ob2 prints V0\n" << std::flush; + } +}; + +class Ob3 : public Object { + +public slots: + void PrintV0() { + std::cout << "Ob3 prints V0\n" << std::flush; + } + + void PrintNumber(int n) { + std::cout << "Ob3 is printing number: " << n << "\n"; + } +}; + + + + +int main() { + BEGIN_TESTING(Signals); + + Ob1 ob1; + Ob2 ob2; + Ob3 ob3; + + Object::connect(&ob1,&Ob1::V0,&ob2,&Ob2::PrintV0); + Object::connect(&ob1,&Ob1::V0,&ob3,&Ob3::PrintV0); + Object::connect(&ob1,&Ob1::V1,&ob3,&Ob3::PrintNumber); + + // not working yet + // Object::connect(&ob1,SIGNAL(V0(),&ob2,SLOT(PrintV0()) + + ob1.PrintSelf(std::cout); + + emit ob1.V0(); + emit ob1.V1(5552368); + + END_TESTING; +} + + diff --git a/src/Core/testing/SmartPointerTest.cpp b/src/Core/testing/SmartPointerTest.cpp new file mode 100644 index 0000000..5a2e129 --- /dev/null +++ b/src/Core/testing/SmartPointerTest.cpp @@ -0,0 +1,94 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include "Core/SmartPointer.h" +#include "testing-prototype.h" + +using namespace uLib; + +namespace Test { + +struct ObjectMockInterface { + virtual void PrintValue()=0; + virtual int& Value()=0; +}; + +class ObjectMock : ObjectMockInterface { + int value; +public: + int& Value() { return value; } + void PrintValue() { std::cout << "Value: " << value << "\n"; } + +}; +} // Test + + +bool test_smpt(SmartPointer &p) { + + SmartPointer spt = p; + spt->Value() = 5552368; + { + SmartPointer copy = spt; + copy->Value() = 123; + } + return (spt->Value() == 123); +} + + + + + +int main () { + BEGIN_TESTING(SmartPointer); + + // HOLD REFERENCE // + { + SmartPointer spt(new Test::ObjectMock); + TEST1(test_smpt(spt)); + } + { + SmartPointer spt; + TEST1(test_smpt(spt)); + } + { + SmartPointer spt = new SmartPointer; + TEST1(test_smpt(spt)); + } + + // TAKE REFERENCE // + { + Test::ObjectMock obj; + SmartPointer spt(obj); + TEST1(test_smpt(spt)); + } + + + + END_TESTING; +} diff --git a/src/Core/testing/SmartVectorTest.cpp b/src/Core/testing/SmartVectorTest.cpp new file mode 100644 index 0000000..13b6232 --- /dev/null +++ b/src/Core/testing/SmartVectorTest.cpp @@ -0,0 +1,120 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include + +#include "testing-prototype.h" +#include "Core/Vector.h" +#include "Core/Object.h" + +using namespace uLib; + +static int instanziated_objects_number; + +class ObjectTest : public Object { +public: + ObjectTest() { + data[0] = 0; + data[1] = 1; + data[2] = 2; + instanziated_objects_number++; + } + ObjectTest(const ObjectTest ©) { + data[0] = copy.data[0]; + data[1] = copy.data[1]; + data[2] = copy.data[2]; + instanziated_objects_number++; + } + + ~ObjectTest() + { + instanziated_objects_number--; + } + float data[3]; +}; + +int main() { + BEGIN_TESTING(SmartVector); + + instanziated_objects_number =0; + + + ///////////////////////// SMART POINTER FUNCIONALITY /////////////////////// + + // int smart vector // + SmartVector sv(10); + for (int i=0;i<10;++i) + sv[i] = i; + // new shallow copy inside a code block // + { + SmartVector newsv = sv; + newsv[5] = 5552368; + TEST1(sv[5] == newsv[5]); + } + // verify that newsv destruction does not delete instance // + TEST1( sv[5] == 5552368 ); + + SmartVector svo(10); + for (int i=0;i<10;++i) + svo[i] = ObjectTest(); + + TEST1(instanziated_objects_number == 10); + { + SmartVector newsvo = svo; + newsvo[5].data[1] = 5552368.0; + TEST1(svo[5].data[1] == newsvo[5].data[1]); + TEST1(instanziated_objects_number == 10); + } + TEST1(instanziated_objects_number == 10); + + + + /////////////////////////// ITERATOR FUNCIONALITY ////////////////////////// + + + Vector v(10); + Vector::Iterator it; + + int i=1; + for(it=v.begin() ; it==v.end(); it++, i++) + *it = i; + + for(i = 0; i::ConstIterator cit; + i=1; + for(cit=v.begin(); cit==v.end(); cit++, i++) + TEST1( *cit == i+1 ); + + + END_TESTING +} + + + + diff --git a/src/Core/testing/StaticInterfaceTest.cpp b/src/Core/testing/StaticInterfaceTest.cpp new file mode 100644 index 0000000..a618c44 --- /dev/null +++ b/src/Core/testing/StaticInterfaceTest.cpp @@ -0,0 +1,112 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include + +#include "testing-prototype.h" +#include + + + +namespace uLib { + +//// INTERFACE TO COMPLEX CLASS ///// + +namespace Interface { +struct Test { + MAKE_TRAITS + template void check_structural() { + uLibCheckFunction(Self,test,bool,int,float); + uLibCheckMember(Self,testmemb,int); + } +}; +} + +struct Test { + bool test(int i, float f){} + int testmemb; +}; + + + +//// INTERFAC TO SIMPLE CLASS /////////// + +namespace Interface { +struct Simple { + MAKE_TRAITS + template void check_structural() { + uLibCheckMember(Self,memb1,int); + uLibCheckMember(Self,memb2,float); + } +}; +} + +struct Simple { + int memb1; + float memb2; +}; + + +///////////////////////// + +template +class UseTest { +public: + UseTest() { + Interface::IsA(); + T t; + int i; float f; + t.test(i,f); + } +}; + +template +class UseSimple { +public: + UseSimple() { + Interface::IsA(); + } +}; + + + +} + +int main() +{ + BEGIN_TESTING(Static Interface); + + + + uLib::UseTest u; + + uLib::UseSimple s; + + END_TESTING; +} + diff --git a/src/Core/testing/TypeIntrospectionTraversal.cpp b/src/Core/testing/TypeIntrospectionTraversal.cpp new file mode 100644 index 0000000..c163939 --- /dev/null +++ b/src/Core/testing/TypeIntrospectionTraversal.cpp @@ -0,0 +1,52 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include +#include +#include +#include + + +#include "Core/Types.h" +#include "Core/Object.h" + + +#include "testing-prototype.h" + +using namespace uLib; + + + + + + + +int main() { + + + +} diff --git a/src/Core/testing/UuidTest.cpp b/src/Core/testing/UuidTest.cpp new file mode 100644 index 0000000..1445df3 --- /dev/null +++ b/src/Core/testing/UuidTest.cpp @@ -0,0 +1,45 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include + +#include "Core/Object.h" +#include "Core/Uuid.h" + +#include "testing-prototype.h" + + +using namespace uLib; + +int main() +{ + BEGIN_TESTING(uuid); + + + + END_TESTING; +} diff --git a/src/Core/testing/VectorTest.cpp b/src/Core/testing/VectorTest.cpp new file mode 100644 index 0000000..6fee192 --- /dev/null +++ b/src/Core/testing/VectorTest.cpp @@ -0,0 +1,84 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include +#include "testing-prototype.h" + +#include + +template < typename T > +struct __Cmp { + bool operator()(const T &data, const float value) { + return data <= value; + } +}; + + + + +template +inline const unsigned long +VectorSplice(const _Tp &_it, const _Tp &_end, const float value, _CmpT _comp) + { + + _Tp it = _it; + _Tp end = _end-1; + for(it; it != end; ) + { + if ( _comp(*it, value) ) it++; + else if( _comp(*end, value) ) + { + std::swap(*it,*end--); + } + else --end; + } + return it - _it; +} + + +int main() +{ + BEGIN_TESTING(Vector); + + uLib::Vector v; + v << 5,4,3,2,6,1,2,3,65,7,32,23,4,3,45,4,34,3,4,4,3,3,4,2,2,3; + + + + int id = VectorSplice(v.begin(),v.end(),3,__Cmp()); + + std::cout << "id: " << id << "\n"; + std::cout << "vector: "; + for(uLib::Vector::Iterator it = v.begin(); it!=v.end(); it++) + std::cout << *it <<" "; + std::cout << std::endl; +// std::sort(v.begin(),v.end(),LT()); + + + END_TESTING; +} + diff --git a/src/Core/testing/testing-prototype.h b/src/Core/testing/testing-prototype.h new file mode 100644 index 0000000..39f4e6c --- /dev/null +++ b/src/Core/testing/testing-prototype.h @@ -0,0 +1,37 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include + +#define BEGIN_TESTING(name) \ +static int _fail = 0; \ +printf("..:: Testing " #name " ::..\n"); + +#define TEST1(val) _fail += (val)==0 +#define TEST0(val) _fail += (val)!=0 +#define END_TESTING return _fail; + diff --git a/src/Detectors/CMakeLists.txt b/src/Detectors/CMakeLists.txt new file mode 100644 index 0000000..3820ba9 --- /dev/null +++ b/src/Detectors/CMakeLists.txt @@ -0,0 +1,38 @@ +# HEADERS +set(HEADERS + DetectorChamber.h + ExperimentFitEvent.h + GeantEvent.h + HitMC.h + MuonScatter.h + MuonEvent.h + MuonError.h + ChamberHitEvent.h + Hit.h + LinearFit.h + Solid.h + Matter.h + Scene.h +) + + +# SOURCES +set(SOURCES + Solid.cpp + Scene.cpp +) + +set(LIBRARIES + ${Boost_SERIALIZATION_LIBRARY} + ${Boost_SIGNALS_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${Eigen_LIBRARY} + ${Geant4_LIBRARIES} + ${ROOT_LIBRARIES} + ${PACKAGE_LIBPREFIX}Core + ${PACKAGE_LIBPREFIX}Math + ${PACKAGE_LIBPREFIX}Detectors +) + +uLib_add_shared_library(${uLib-module}) +add_subdirectory(testing) diff --git a/src/Detectors/ChamberHitEvent.h b/src/Detectors/ChamberHitEvent.h new file mode 100644 index 0000000..7fbe98e --- /dev/null +++ b/src/Detectors/ChamberHitEvent.h @@ -0,0 +1,56 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CHAMBERHITEVENT_H +#define U_CHAMBERHITEVENT_H + +#include "Core/Vector.h" +#include "Hit.h" +#include "ChamberDetector.h" + +namespace uLib { + +class ChamberHitEventData +{ +public: + uLibConstRefMacro (Hits, Vector ) + uLibGetMacro (Idv, ChamberDetector::ID) +private: + friend class ChamberHitEvent; + Vector m_Hits; + DetectorChamber::ID m_Idv; // -> chamber/view +}; + +class ChamberHitEvent : public ChamberHitEventData { +public: + uLibRefMacro (Hits, Vector ) + uLibSetMacro (Idv, ChamberDetector::ID) +}; + +} + +#endif // CHAMBERHITEVENT_H diff --git a/src/Detectors/DetectorChamber.h b/src/Detectors/DetectorChamber.h new file mode 100644 index 0000000..a5ed09f --- /dev/null +++ b/src/Detectors/DetectorChamber.h @@ -0,0 +1,48 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CHAMBERDETECTOR_H +#define U_CHAMBERDETECTOR_H + +#include "Core/Types.h" +#include "Math/ContainerBox.h" + +namespace uLib { + + +class DetectorChamber : public ContainerBox { + +public: + +private: +}; + + +} + + +#endif // CHAMBERDETECTOR_H diff --git a/src/Detectors/ExperimentFitEvent.h b/src/Detectors/ExperimentFitEvent.h new file mode 100644 index 0000000..8a08427 --- /dev/null +++ b/src/Detectors/ExperimentFitEvent.h @@ -0,0 +1,48 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_EXPERIMENTFITEVENT_H +#define U_EXPERIMENTFITEVENT_H + +namespace uLib { + + +class ExperimentFitEventData { +public: + +private: + +}; + + + + + +} + + +#endif // EXPERIMENTFITEVENT_H diff --git a/src/Detectors/GeantEvent.h b/src/Detectors/GeantEvent.h new file mode 100644 index 0000000..33d26aa --- /dev/null +++ b/src/Detectors/GeantEvent.h @@ -0,0 +1,69 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_GEANTEVENT_H +#define U_GEANTEVENT_H + +#include "Core/Types.h" +#include "Core/Vector.h" +#include "Math/Dense.h" + +#include "ChamberHitEvent.h" + +namespace uLib { + +class GeantEventData { +public: + uLibGetMacro (EventID, Id_t ) + uLibGetMacro (Momentum,Scalarf ) + uLibConstRefMacro (GenPos, Vector3f) + uLibConstRefMacro (GenDir, Vector3f) + uLibConstRefMacro (ChEvents,Vector) + +private: + friend class GeantEvent; + Id_t m_EventID; + Scalarf m_Momentum; + Vector3f m_GenPos; + Vector3f m_GenDir; + Vector m_ChEvents; +}; + +class GeantEvent { +public: + uLibSetMacro (EventID, Id_t ) + uLibSetMacro (Momentum,Scalarf ) + uLibRefMacro (GenPos, Vector3f) + uLibRefMacro (GenDir, Vector3f) + uLibRefMacro (ChEvents,Vector) +}; + + +} + + +#endif // GEANTEVENT_H diff --git a/src/Detectors/HierarchicalEncoding.h b/src/Detectors/HierarchicalEncoding.h new file mode 100644 index 0000000..16abffb --- /dev/null +++ b/src/Detectors/HierarchicalEncoding.h @@ -0,0 +1,41 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + +#ifndef U_DETECTORS_HIERARCHICALENCODING_H +#define U_DETECTORS_HIERARCHICALENCODING_H + +#include + +namespace uLib { + + + +} // uLib + + + + + +#endif // HIERARCHICALENCODING_H diff --git a/src/Detectors/Hit.h b/src/Detectors/Hit.h new file mode 100644 index 0000000..1261417 --- /dev/null +++ b/src/Detectors/Hit.h @@ -0,0 +1,70 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef HIT_H +#define HIT_H + +#include "Math/BitCode.h" + +namespace uLib { + + + + + +class HitRawCode_CMSDrift : + public BitCode4 +{ + typedef unsigned short T; +public: + HitRawCode_CMSDrift() : BitCode4(0) {} + HitRawCode_CMSDrift(const Vector4i &v) : BitCode4(v) {} + HitRawCode_CMSDrift(T Chamber, T ROB, T TDC, T Channel ) { + (*this) << Chamber, ROB, TDC, Channel; + } + + inline T Chamber() const { return m_data.bitf.field1; } + inline void SetChamber(const T data) { m_data.bitf.field1 = data; } + inline T ROB() const { return m_data.bitf.field2; } + inline void SetROB(const T data) { m_data.bitf.field2 = data; } + inline T TDC() const { return m_data.bitf.field3; } + inline void SetTDC(const T data) { m_data.bitf.field3 = data; } + inline T Channel() const { return m_data.bitf.field4; } + inline void SetChannel(const T data) { m_data.bitf.field4 = data; } + +}; + + + + + + + + + +} +#endif // HIT_H diff --git a/src/Detectors/HitMC.h b/src/Detectors/HitMC.h new file mode 100644 index 0000000..95404b2 --- /dev/null +++ b/src/Detectors/HitMC.h @@ -0,0 +1,67 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_HITMC_H +#define U_HITMC_H + +#include "Core/Macros.h" +#include "Math/Dense.h" +#include "Hit.h" + +namespace uLib { + + +class HitMCData : public HitData{ +public: + enum Type { + PrimaryMu, + SecondaryMu, + DeltaRay + }; + + uLibConstRefMacro(Position,HPoint3f) + uLibGetMacro(Type, enum Type) + +private: + HPoint3f m_Position; + enum Type m_Type; +}; + + +class HitMC : public HitMCData { +public: + uLibRefMacro(Position,HPoint3f) + uLibSetMacro(Type, enum Type) +}; + + + +} + + + +#endif // HITMC_H diff --git a/src/Detectors/LinearFit.h b/src/Detectors/LinearFit.h new file mode 100644 index 0000000..9419e69 --- /dev/null +++ b/src/Detectors/LinearFit.h @@ -0,0 +1,73 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_LINEARFIT_H +#define U_LINEARFIT_H + +#include "Core/Macros.h" +#include "Math/Dense.h" +#include "ChamberDetector.h" + + +namespace uLib { + +class LinearFitData { +public: + uLibConstRefMacro(Position,Vector2f) + uLibConstRefMacro(Slope,Vector2f) + uLibConstRefMacro(PositionError,Vector2f) + uLibConstRefMacro(SlopeError,Vector2f) + uLibGetMacro(HitsNumber,int) + uLibGetMacro(Idv,ChamberDetector::ID) + +private: + friend class LinearFit; + Vector2f m_Position; + Vector2f m_Slope; + Vector2f m_PositionError; + Vector2f m_SlopeError; + int m_HitsNumber; + DetectorChamber::ID m_Idv; +}; + + +class LinearFit : public LinearFitData { +public: + uLibRefMacro(Position,Vector2f) + uLibRefMacro(Slope,Vector2f) + uLibRefMacro(PositionError,Vector2f) + uLibRefMacro(SlopeError,Vector2f) + uLibSetMacro(HitsNumber,int) + uLibSetMacro(Idv,ChamberDetector::ID) +}; + + + +} + + +#endif // LINEARFIT_H diff --git a/src/Detectors/Makefile.am b/src/Detectors/Makefile.am new file mode 100644 index 0000000..b420a03 --- /dev/null +++ b/src/Detectors/Makefile.am @@ -0,0 +1,25 @@ +include $(top_srcdir)/Common.am + +library_includedir = $(includedir)/libmutom-${PACKAGE_VERSION}/Detectors +library_include_HEADERS = DetectorChamber.h \ + ExperimentFitEvent.h \ + GeantEvent.h \ + HitMC.h \ + MuonScatter.h \ + MuonEvent.h \ + MuonError.h \ + ChamberHitEvent.h \ + Hit.h \ + LinearFit.h \ + Solid.h \ + Matter.h \ + Scene.h + +_DETECTORS_SOURCES = \ + Solid.cpp \ + Scene.cpp + +noinst_LTLIBRARIES = libmutomdetectors.la +libmutomdetectors_la_SOURCES = ${_DETECTORS_SOURCES} + + diff --git a/src/Detectors/Matter.h b/src/Detectors/Matter.h new file mode 100644 index 0000000..04815c0 --- /dev/null +++ b/src/Detectors/Matter.h @@ -0,0 +1,71 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef MATTER_H +#define MATTER_H + +#include "Core/Object.h" + +class G4Element; +class G4Material; + +namespace uLib { + + +//////////////////////////////////////////////////////////////////////////////// +//// ELEMENT /////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +class Element { +public: + + uLibRefMacro(G4Data,G4Element *) +private: + G4Element *m_G4Data; +}; + + + +//////////////////////////////////////////////////////////////////////////////// +//// MATERIAL ////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +class Material : public Object { +public: + + uLibRefMacro(G4Data,G4Material *) +private: + G4Material *m_G4Data; +}; + + + +} + + +#endif // MATTER_H diff --git a/src/Detectors/MuonError.h b/src/Detectors/MuonError.h new file mode 100644 index 0000000..47aa570 --- /dev/null +++ b/src/Detectors/MuonError.h @@ -0,0 +1,58 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_MUONERROR_H +#define U_MUONERROR_H + +#include "Core/Macros.h" +#include "Math/Dense.h" + +namespace uLib { + + +class MuonErrorData { + friend class MuonError; +public: + uLibConstRefMacro(Theta,Scalarf) + uLibConstRefMacro(Phi,Scalarf) +private: + Scalarf m_Theta; + Scalarf m_Phi; +}; + + +class MuonError : public MuonErrorData { +public: + uLibRefMacro(Theta,Scalarf) + uLibRefMacro(Phi,Scalarf) +}; + + +} // end ulib space + + +#endif // U_MUONERROR_H diff --git a/src/Detectors/MuonEvent.h b/src/Detectors/MuonEvent.h new file mode 100644 index 0000000..72e5c9b --- /dev/null +++ b/src/Detectors/MuonEvent.h @@ -0,0 +1,75 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_MUONEVENT_H +#define U_MUONEVENT_H + +#include "Core/Macros.h" +#include "Math/Dense.h" + +namespace uLib { + + +class MuonEventData { + friend class MuonEvent; +public: + uLibConstRefMacro(LineIn,HLine3f) + uLibConstRefMacro(LineOut,HLine3f) + uLibGetMacro(Momentum,Scalarf) + +private: + HLine3f m_LineIn; + HLine3f m_LineOut; + Scalarf m_Momentum; +}; + + +class MuonEvent : public MuonEventData { +public: + uLibRefMacro(LineIn,HLine3f) + uLibRefMacro(LineOut,HLine3f) + uLibRefMacro(Momentum,Scalarf) + +}; + +inline std::ostream& +operator<< (std::ostream& stream, const MuonEventData &mu) { + stream << " MuonEventData: --------------- \n" + << " P: " << mu.GetMomentum() << "\n" + << " IN: " << mu.LineIn() << "\n" + << " OUT: " << mu.LineOut() << "\n" + << " ------------------------------ \n"; + return stream; +} + + + +} // end ulib space + + + +#endif // U_MUONEVENT_H diff --git a/src/Detectors/MuonScatter.h b/src/Detectors/MuonScatter.h new file mode 100644 index 0000000..a370f17 --- /dev/null +++ b/src/Detectors/MuonScatter.h @@ -0,0 +1,81 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#ifndef U_MUONSCATTER_H +#define U_MUONSCATTER_H + +#include "Core/Macros.h" +#include "Math/Dense.h" +#include "Math/Line.h" + +namespace uLib { + + +class MuonScatter { +public: + uLibConstRefMacro(LineIn,Line4f) + uLibConstRefMacro(ErrorIn,Line4f) + uLibConstRefMacro(LineOut,Line4f) + uLibConstRefMacro(ErrorOut,Line4f) + + uLibRefMacro(LineIn,Line4f) + uLibRefMacro(ErrorIn,Line4f) + uLibRefMacro(LineOut,Line4f) + uLibRefMacro(ErrorOut,Line4f) + uLibSetMacro(Momentum,Scalarf) + uLibSetMacro(MomentumPrime,Scalarf) + + uLibGetMacro(Momentum,Scalarf) + uLibGetMacro(MomentumPrime,Scalarf) + +protected: + Line4f m_LineIn; + Line4f m_LineOut; + Line4f m_ErrorIn; + Line4f m_ErrorOut; + Scalarf m_Momentum; + Scalarf m_MomentumPrime; +}; + +typedef MuonScatter MuonScatterData; + +inline std::ostream& +operator<< (std::ostream& stream, const MuonScatterData &mu) { + stream << " MuonScatterData: ------------- \n" +// << " P: " << mu.GetMomentum() << " Pprim: " << mu.GetMomentumPrime() << "\n" +// << " IN: " << mu.LineIn() << "\n" +// << " " << mu.ErrorIn() << "\n" +// << " OUT: " << mu.LineOut() << "\n" +// << " " << mu.ErrorOut() <<"\n" + << " ------------------------------ \n"; + return stream; +} + +} + +#endif // U_MUONSCATTER_H diff --git a/src/Detectors/Scene.cpp b/src/Detectors/Scene.cpp new file mode 100644 index 0000000..2439b50 --- /dev/null +++ b/src/Detectors/Scene.cpp @@ -0,0 +1,75 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + + +#include +#include +#include +#include + +#include "Core/Vector.h" +#include "Matter.h" +#include "Solid.h" + +#include "Scene.h" + + +namespace uLib { + + +class DetectorsScenePimpl { + +public: + + + // members // + //Vector m_Solids; +}; + + + + +DetectorsScene::DetectorsScene() : + d(new DetectorsScenePimpl()) +{} + +DetectorsScene::~DetectorsScene() +{ + delete d; +} + +void DetectorsScene::AddSolid(const Solid &solid) +{ +// d->m_Solids.push_back(solid); +} + + + + + +} diff --git a/src/Detectors/Scene.h b/src/Detectors/Scene.h new file mode 100644 index 0000000..e7c7edb --- /dev/null +++ b/src/Detectors/Scene.h @@ -0,0 +1,52 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef SCENE_H +#define SCENE_H + +#include "Core/Object.h" +#include "Core/Vector.h" +#include "Solid.h" + +namespace uLib { + + +class DetectorsScene : public Object { +public: + DetectorsScene(); + ~DetectorsScene(); + + + void AddSolid(const Solid &solid); + +private: + class DetectorsScenePimpl *d; +}; + + +} +#endif // SCENE_H diff --git a/src/Detectors/Solid.cpp b/src/Detectors/Solid.cpp new file mode 100644 index 0000000..46597b2 --- /dev/null +++ b/src/Detectors/Solid.cpp @@ -0,0 +1,114 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +// G4 Solid // +#include +#include +#include + +// Tessellated solid // +#include +#include +#include + + +#include "Math/Dense.h" + +#include "Solid.h" + +namespace uLib { + +class DetectorsSolidPimpl { +public: + static G4ThreeVector getG4Vector3f(const Vector3f &vector) { + return G4ThreeVector( vector(0), vector(1), vector(2) ); + } +}; + + + +Solid::Solid() : + m_Logical (new G4LogicalVolume(NULL,NULL,"unnamed_solid")), + m_Material(NULL) +{} + +Solid::Solid(const char *name) : + m_Logical(new G4LogicalVolume(NULL,NULL,name)), + m_Material(NULL) +{} + + + +void Solid::SetNistMaterial(const char *name) +{ + G4NistManager *nist = G4NistManager::Instance(); + if (m_Material) delete m_Material; + m_Material = nist->FindOrBuildMaterial(name); + m_Logical->SetMaterial(m_Material); +} + +void Solid::SetMaterial(G4Material *material) +{ + if(material) + { + m_Material = material; + m_Logical->SetMaterial(material); + } +} + + + + + + + + + + +TessellatedSolid::TessellatedSolid(const char *name) : + BaseClass(name), + m_Solid(new G4TessellatedSolid(name)) +{} + + +void TessellatedSolid::SetMesh(TriangleMesh &mesh) +{ + G4TessellatedSolid *ts = this->m_Solid; + for (int i=0; iAddFacet((G4VFacet *)facet); + } + this->m_Logical->SetSolid(ts); +} + + +} diff --git a/src/Detectors/Solid.h b/src/Detectors/Solid.h new file mode 100644 index 0000000..7babd27 --- /dev/null +++ b/src/Detectors/Solid.h @@ -0,0 +1,86 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef SOLID_H +#define SOLID_H + +#include "Core/Object.h" +#include "Math/Dense.h" +#include "Math/TriangleMesh.h" +#include "Detectors/Matter.h" + +class G4Material; +class G4LogicalVolume; +class G4TessellatedSolid; + + +namespace uLib { + +class Solid : public Object { +public: + + Solid(); + Solid(const char *name); + + void SetNistMaterial(const char *name); + + void SetMaterial(G4Material *material); + + uLibGetMacro(Material,G4Material *) + uLibGetMacro(Logical,G4LogicalVolume *) + +protected: + G4Material *m_Material; + G4LogicalVolume *m_Logical; +}; + + + + + +class TessellatedSolid : public Solid { + typedef Solid BaseClass; + +public: + TessellatedSolid(const char *name); + + void SetMesh(TriangleMesh &mesh); + + uLibGetMacro(Solid,G4TessellatedSolid *) +private: + G4TessellatedSolid *m_Solid; +}; + + + + +} + + + + +#endif // SOLID_H diff --git a/src/Detectors/testing/CMakeLists.txt b/src/Detectors/testing/CMakeLists.txt new file mode 100644 index 0000000..d3bff8f --- /dev/null +++ b/src/Detectors/testing/CMakeLists.txt @@ -0,0 +1,18 @@ +# TESTS +set( TESTS + GDMLSolidTest + HierarchicalEncodingTest +) + +#set(LIBRARIES +# ${PACKAGE_LIBPREFIX}Core +# ${PACKAGE_LIBPREFIX}Math +# ${PACKAGE_LIBPREFIX}Detectors +# ${Boost_SERIALIZATION_LIBRARY} +# ${Boost_SIGNALS_LIBRARY} +# ${Boost_PROGRAM_OPTIONS_LIBRARY} +# ${Eigen_LIBRARY} +# ${Geant4_LIBRARIES} +# ${ROOT_LIBRARIES} +#) +uLib_add_tests(${uLib-module}) diff --git a/src/Detectors/testing/GDMLSolidTest.cpp b/src/Detectors/testing/GDMLSolidTest.cpp new file mode 100644 index 0000000..3c8843f --- /dev/null +++ b/src/Detectors/testing/GDMLSolidTest.cpp @@ -0,0 +1,72 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include + +#include +#include + +#include +#include +#include +#include + +#include +//#include +//#include + + +#include "Detectors/Solid.h" +#include "testing-prototype.h" + + + + +int main() +{ + +// G4RunManager* runManager = new G4RunManager; + + G4NistManager *nist = G4NistManager::Instance(); + G4Material *air = nist->FindOrBuildMaterial("G4_AIR"); + + + + G4Box *box = new G4Box("box",5,5,5); + + G4LogicalVolume box_lv(NULL,NULL,"box test"); + box_lv.SetSolid(box); + box_lv.SetMaterial(air); + G4PVPlacement box_pl(0,G4ThreeVector(),&box_lv,"box test",0,0,0); + + G4GDMLParser parser; + + parser.Write("test_out.gdml",&box_lv); + + +} diff --git a/src/Detectors/testing/HierarchicalEncodingTest.cpp b/src/Detectors/testing/HierarchicalEncodingTest.cpp new file mode 100644 index 0000000..b02d6da --- /dev/null +++ b/src/Detectors/testing/HierarchicalEncodingTest.cpp @@ -0,0 +1,50 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + +#include +#include + +#include "testing-prototype.h" + +using namespace uLib; + +int main() { + BEGIN_TESTING(Hierarchical Encoding); + + + HitRawCode_CMSDrift code; + code = Vector4i(5,6,2,8); + + + + Vector4i v = code; + + + std::cout << code << "\n"; + std::cout << v << "\n"; + + END_TESTING; +} + diff --git a/src/Detectors/testing/Makefile.am b/src/Detectors/testing/Makefile.am new file mode 100644 index 0000000..cd956fc --- /dev/null +++ b/src/Detectors/testing/Makefile.am @@ -0,0 +1,16 @@ + +include $(top_srcdir)/Common.am + +#AM_DEFAULT_SOURCE_EXT = .cpp + +# if HAVE_CHECK +TESTS = GDMLSolidTest + +# else +# TEST = +# endif + +LDADD = $(top_srcdir)/libmutom-${PACKAGE_VERSION}.la + +check_PROGRAMS = $(TESTS) + diff --git a/src/Detectors/testing/testing-prototype.h b/src/Detectors/testing/testing-prototype.h new file mode 100644 index 0000000..39f4e6c --- /dev/null +++ b/src/Detectors/testing/testing-prototype.h @@ -0,0 +1,37 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include + +#define BEGIN_TESTING(name) \ +static int _fail = 0; \ +printf("..:: Testing " #name " ::..\n"); + +#define TEST1(val) _fail += (val)==0 +#define TEST0(val) _fail += (val)!=0 +#define END_TESTING return _fail; + diff --git a/src/Gui/Qt/QVTKViewport2/Makefile.am b/src/Gui/Qt/QVTKViewport2/Makefile.am new file mode 100644 index 0000000..c6e1b8c --- /dev/null +++ b/src/Gui/Qt/QVTKViewport2/Makefile.am @@ -0,0 +1,35 @@ +# SUBDIRS = . + +include $(top_srcdir)/Common.am + +DISTSOURCES = vtkviewport.cpp main.cpp +DISTHEADERS_MOC = +DISTHEADERS_NO_MOC = +FORMS = vtkviewport.ui + +FORMHEADERS = $(FORMS:.ui=.h) +MOC_CC = $(FORMS:.ui=.moc.cpp) $(DISTHEADERS_MOC:.h=.moc.cpp) + +bin_PROGRAMS = QTVtkViewport + +BUILT_SOURCES = $(FORMHEADERS) $(MOC_CC) +CLEANFILES = $(BUILT_SOURCES) + +EXTRA_DIST = $(FORMS) +QTVtkViewport_SOURCES = $(DISTSOURCES) $(DISTHEADERS_MOC) $(DISTHEADERS_NO_MOC) +nodist_QTVtkViewport_SOURCES = $(MOC_CC) + +QTVtkViewport_LDADD = $(top_srcdir)/libmutom.la + + +.ui.h: $(FORMS) + $(UIC) -o ui_$@ $< + +.ui.hpp: $(FORMS_HPP) + $(UIC) -o $@ $< + +.h.moc.cpp: + $(MOC) -o $@ $< + + +SUFFIXES = .h .ui .moc.cpp diff --git a/src/Gui/Qt/QVTKViewport2/QVTKViewport2.pro b/src/Gui/Qt/QVTKViewport2/QVTKViewport2.pro new file mode 100644 index 0000000..6a3a510 --- /dev/null +++ b/src/Gui/Qt/QVTKViewport2/QVTKViewport2.pro @@ -0,0 +1,18 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2012-08-30T18:59:53 +# +#------------------------------------------------- + +QT += core gui + +TARGET = QVTKViewport2 +TEMPLATE = app + + +SOURCES += main.cpp\ + vtkviewport.cpp + +HEADERS += vtkviewport.h + +FORMS += vtkviewport.ui diff --git a/src/Gui/Qt/QVTKViewport2/QVTKViewport2.pro.user b/src/Gui/Qt/QVTKViewport2/QVTKViewport2.pro.user new file mode 100644 index 0000000..419ba5a --- /dev/null +++ b/src/Gui/Qt/QVTKViewport2/QVTKViewport2.pro.user @@ -0,0 +1,453 @@ + + + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + System + false + 4 + true + 1 + true + 0 + true + 1 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + Qt4ProjectManager.Target.DesktopTarget + 0 + 0 + 0 + + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb + + + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Desktop Qt 4.7.4 for GCC (Qt SDK) Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /home/andrea/devel/MuonTomography/mutom/uLib/trunk/src/Gui/Qt/QVTKViewport2 + 3 + false + + + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb + + + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Desktop Qt 4.7.4 for GCC (Qt SDK) Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/andrea/devel/MuonTomography/mutom/uLib/trunk/src/Gui/Qt/QVTKViewport2 + 3 + false + + + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb + + + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Qt 4.7.0 in PATH (System) Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /home/andrea/devel/MuonTomography/mutom/uLib/trunk/src/Gui/Qt/QVTKViewport2 + 4 + false + + + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb + + + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Qt 4.7.0 in PATH (System) Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/andrea/devel/MuonTomography/mutom/uLib/trunk/src/Gui/Qt/QVTKViewport2 + 4 + false + + + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb + + + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Qt 4.7.0 (System) Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /home/andrea/devel/MuonTomography/mutom/uLib/trunk/src/Gui/Qt/QVTKViewport2 + 5 + false + + + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb + + + qmake + + QtProjectManager.QMakeBuildStep + false + true + + false + + + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Qt 4.7.0 (System) Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/andrea/devel/MuonTomography/mutom/uLib/trunk/src/Gui/Qt/QVTKViewport2 + 5 + false + + 6 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + No deployment + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + + + false + false + false + false + false + false + false + false + true + true + 0.01 + 0.01 + 10 + 10 + false + false + 25 + 25 + + + true + true + valgrind + valgrind + + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + + + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + + QVTKViewport2 + + Qt4ProjectManager.Qt4RunConfiguration + 2 + + QVTKViewport2.pro + false + false + + + 3768 + true + false + false + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {f8bb0047-7f6e-45df-9cc8-e746abebf883} + + + ProjectExplorer.Project.Updater.FileVersion + 10 + + diff --git a/src/Gui/Qt/QVTKViewport2/main.cpp b/src/Gui/Qt/QVTKViewport2/main.cpp new file mode 100644 index 0000000..aabcdd9 --- /dev/null +++ b/src/Gui/Qt/QVTKViewport2/main.cpp @@ -0,0 +1,38 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include +#include "vtkviewport.h" + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + VtkViewport w; + w.show(); + + return a.exec(); +} diff --git a/src/Gui/Qt/QVTKViewport2/vtkviewport.cpp b/src/Gui/Qt/QVTKViewport2/vtkviewport.cpp new file mode 100644 index 0000000..77629da --- /dev/null +++ b/src/Gui/Qt/QVTKViewport2/vtkviewport.cpp @@ -0,0 +1,41 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "vtkviewport.h" +#include "ui_vtkviewport.h" + +VtkViewport::VtkViewport(QWidget *parent) : + QWidget(parent), + ui(new Ui::VtkViewport) +{ + ui->setupUi(this); +} + +VtkViewport::~VtkViewport() +{ + delete ui; +} diff --git a/src/Gui/Qt/QVTKViewport2/vtkviewport.h b/src/Gui/Qt/QVTKViewport2/vtkviewport.h new file mode 100644 index 0000000..09c2d7d --- /dev/null +++ b/src/Gui/Qt/QVTKViewport2/vtkviewport.h @@ -0,0 +1,49 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VTKVIEWPORT_H +#define VTKVIEWPORT_H + +#include + +namespace Ui { +class VtkViewport; +} + +class VtkViewport : public QWidget +{ + Q_OBJECT + +public: + explicit VtkViewport(QWidget *parent = 0); + ~VtkViewport(); + +private: + Ui::VtkViewport *ui; +}; + +#endif // VTKVIEWPORT_H diff --git a/src/Gui/Qt/QVTKViewport2/vtkviewport.ui b/src/Gui/Qt/QVTKViewport2/vtkviewport.ui new file mode 100644 index 0000000..095019b --- /dev/null +++ b/src/Gui/Qt/QVTKViewport2/vtkviewport.ui @@ -0,0 +1,32 @@ + + + VtkViewport + + + + 0 + 0 + 580 + 536 + + + + Form + + + + + 140 + 170 + 161 + 41 + + + + Hello World ! + + + + + + diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..4709f04 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = ltk Core Math Detectors Root + + diff --git a/src/Math/Accumulator.h b/src/Math/Accumulator.h new file mode 100644 index 0000000..ca711ba --- /dev/null +++ b/src/Math/Accumulator.h @@ -0,0 +1,334 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_DATABINNING_H +#define U_DATABINNING_H + +#include "Core/Vector.h" +#include "Dense.h" + + +namespace uLib { + + + +// TODO: USE BOOST ACCUMULATORS // + + +template +class Accumulator_Mean { + typedef std::pair Tmean; +public: + Accumulator_Mean() { + m_Means.push_back( Tmean(0,0) ); + } + + void operator()(const T data) { + T tmp = 0; + // for(typename std::vector::iterator it = m_Means.begin(); it < m_Means.back(); ++it) + // tmp += it->first/it->second; + for(int i=0; i::iterator it = m_Means.begin(); it < m_Means.end(); ++it) { + // mean += it->first/it->second; } + for(int i=0; i m_Means; +}; + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// accumulator Trim // + +template < typename T, int subsample_size=200 > +class Accumulator_ABTrim { + +public: + Accumulator_ABTrim() : + m_Avg(0), + m_InternalCount(0), + m_SizeA(0), + m_SizeB(0), + m_IdA(0), + m_IdB(0) + {} + + Accumulator_ABTrim(const Accumulator_ABTrim &c) { +# pragma omp critical + { + m_Avg = c.m_Avg; + m_InternalCount = c.m_InternalCount; + m_SizeA = c.m_SizeA; + m_SizeB = c.m_SizeB; + m_IdA = c.m_IdA; + m_IdB = c.m_IdB; + memcpy (m_Av, c.m_Av, sizeof (m_Av)); + } + } + + void operator += (T value) { + if(m_InternalCount > subsample_size) { + // array complete and counter over subsample // + if( m_SizeA > 0 && value < m_ValA ) { + ;// m_Avg += m_ValA; + } + else if (m_SizeB > 0 && value > m_ValB) + { + ;// m_Avg += m_ValB; + } + else + { + m_Avg += value; + m_InternalCount++; + } + } + else if(m_InternalCount >=0) { + // array complete + if(m_SizeA > 0 && value < m_ValA) + { + m_Avg += m_ValA; + m_Av[m_IdA] = value; + for (unsigned int i=0; i < m_SizeA; i++) + if(m_Av[i] > m_Av[m_IdA]) + { m_IdA = i; m_ValA = m_Av[i]; } + } + else if(m_SizeB > 0 && value > m_ValB) + { + m_Avg += m_ValB; + m_Av[m_IdB] = value; + for (unsigned int i=m_SizeA; i < m_SizeA+m_SizeB; i++) + if(m_Av[i] < m_Av[m_IdB]) + { m_IdB = i; m_ValB = m_Av[i]; } + } + else { + m_Avg += value; + } + m_InternalCount++; + } + else { // m_InternalCount < 0 + // array is not fullfilled + m_Av[m_SizeA+m_SizeB+m_InternalCount] = value; + m_InternalCount++; + if(m_InternalCount == 0) { + std::sort(m_Av,m_Av+m_SizeA+m_SizeB); + if(m_SizeA > 0) { + m_IdA = m_SizeA-1; + m_ValA = m_Av[m_IdA]; + } + if(m_SizeB > 0) { + m_IdB = m_SizeA; + m_ValB = m_Av[m_SizeA]; + } + } + } + } + + T operator()() { + if(m_InternalCount <= 0) { + std::sort(m_Av, m_Av+m_SizeA+m_SizeB+m_InternalCount); + return m_Av[ (m_SizeA+m_SizeB+m_InternalCount) / 2]; // median value // + } + else { +// return (m_Avg + m_ValA * m_SizeA + m_ValB * m_SizeB) / +// (m_InternalCount + m_SizeA + m_SizeB); + return (m_Avg) / m_InternalCount; + } + } + + void SetABTrim(int a, int b) { + if(a+b > subsample_size/2) { + m_SizeA = a/(a+b) * subsample_size/2; + m_SizeB = b/(a+b) * subsample_size/2; + } + else { + m_SizeA = a; + m_SizeB = b; + } + m_Avg = 0; + m_InternalCount = -m_SizeA-m_SizeB; + } + + +private: + T m_Av[subsample_size/2]; + T m_Avg, m_ValA, m_ValB; + int m_IdA, m_IdB, m_InternalCount; + int m_SizeA, m_SizeB; +}; + + + + + + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// Clip Accumulator // + +template < typename T, int subsample_size=200 > +class Accumulator_ABClip { + +public: + Accumulator_ABClip() : + m_Avg(0), + m_InternalCount(0), + m_SizeA(0), + m_SizeB(0), + m_IdA(0), + m_IdB(0) + {} + + Accumulator_ABClip(const Accumulator_ABClip &c) { +# pragma omp critical + { + m_Avg = c.m_Avg; + m_InternalCount = c.m_InternalCount; + m_SizeA = c.m_SizeA; + m_SizeB = c.m_SizeB; + m_IdA = c.m_IdA; + m_IdB = c.m_IdB; + memcpy (m_Av, c.m_Av, sizeof (m_Av)); + } + } + + void operator += (T value) { + if(m_InternalCount > subsample_size) { + // array complete and counter over subsample // + if( m_SizeA > 0 && value < m_ValA ) { + m_Avg += m_ValA; + } + else if (m_SizeB > 0 && value > m_ValB) { + m_Avg += m_ValB; + } + else { + m_Avg += value; + } + m_InternalCount++; + } + else if(m_InternalCount >=0) { + // array complete + if(m_SizeA > 0 && value < m_ValA) + { + m_Avg += m_ValA; + m_Av[m_IdA] = value; + for (unsigned int i=0; i < m_SizeA; i++) + if(m_Av[i] > m_Av[m_IdA]) + { m_IdA = i; m_ValA = m_Av[i]; } + } + else if(m_SizeB > 0 && value > m_ValB) + { + m_Avg += m_ValB; + m_Av[m_IdB] = value; + for (unsigned int i=m_SizeA; i < m_SizeA+m_SizeB; i++) + if(m_Av[i] < m_Av[m_IdB]) + { m_IdB = i; m_ValB = m_Av[i]; } + } + else { + m_Avg += value; + } + m_InternalCount++; + } + else { // m_InternalCount < 0 + // array is not fullfilled + m_Av[m_SizeA+m_SizeB+m_InternalCount] = value; + m_InternalCount++; + if(m_InternalCount == 0) { + std::sort(m_Av,m_Av+m_SizeA+m_SizeB); + if(m_SizeA > 0) { + m_IdA = m_SizeA-1; + m_ValA = m_Av[m_IdA]; + } + if(m_SizeB > 0) { + m_IdB = m_SizeA; + m_ValB = m_Av[m_SizeA]; + } + } + } + } + + T operator()() { + if(m_InternalCount <= 0) { + std::sort(m_Av, m_Av+m_SizeA+m_SizeB+m_InternalCount); + return m_Av[ (m_SizeA+m_SizeB+m_InternalCount) / 2]; // median value // + } + else { + return (m_Avg + m_ValA * m_SizeA + m_ValB * m_SizeB) / + (m_InternalCount + m_SizeA + m_SizeB); + } + } + + void SetABTrim(int a, int b) { + if(a+b > subsample_size/2) { + m_SizeA = a/(a+b) * subsample_size/2; + m_SizeB = b/(a+b) * subsample_size/2; + } + else { + m_SizeA = a; + m_SizeB = b; + } + m_Avg = 0; + m_InternalCount = -m_SizeA-m_SizeB; + } + + +private: + T m_Av[subsample_size/2]; + T m_Avg, m_ValA, m_ValB; + int m_IdA, m_IdB, m_InternalCount; + int m_SizeA, m_SizeB; +}; + + + + + +} // uLib + + + + +#endif // U_DATABINNING_H diff --git a/src/Math/BitCode.h b/src/Math/BitCode.h new file mode 100644 index 0000000..40e6714 --- /dev/null +++ b/src/Math/BitCode.h @@ -0,0 +1,259 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + +#ifndef U_MATH_BITCODE_H +#define U_MATH_BITCODE_H + +#include +#include +//#include +#include + +#include +#include +#include +#include + +namespace uLib { + + +template < typename ContainerT, typename ContentT > +struct CommaInitializerBitCode +{ + inline explicit CommaInitializerBitCode(ContainerT *container, ContentT s) + : container(container) + { + this->index = 0; + this->container->operator()().field1 = s; + } + inline CommaInitializerBitCode & operator, (ContentT s) { + this->index++; + if(index < container->size()) { + if(index == 1) container->operator()().field2 = s; + if(index == 2) container->operator()().field3 = s; + if(index == 3) container->operator()().field4 = s; + } + return *this; + } + + ContainerT *container; + unsigned int index; +}; + + + + +template +class BitCode2 +{ +protected: + typedef T Type; + typedef BitCode2 ThisClass; + typedef CommaInitializerBitCode< ThisClass, T > CommaInit; + BOOST_STATIC_ASSERT_MSG( boost::is_unsigned::value == 1, "CODE TYPE MUST BE UNSIGNED" ); + BOOST_STATIC_ASSERT( L1+L2 == sizeof(T)*8 ); + +public: + struct BitField { + T field1 : L1; + T field2 : L2; + }; + union CodeSet { + BitField bitf; + T value; + } m_data; + + BitCode2() {} + BitCode2(const T& data) { m_data.value = data; } + BitCode2(const Vector2i & data) { + (*this) << data(0),data(1); + } + inline CommaInit operator <<(T scalar) { return CommaInit(this, scalar); } + static const int size() { return 2; } + + BitField & operator()() { return m_data.bitf; } + const BitField & operator()() const { return m_data.bitf; } + operator Vector2i () { return Vector2i(m_data.bitf.field1, + m_data.bitf.field2); } + + void set(const T data) { m_data.value = data; } + T get() const { return m_data.value; } +}; + +template +std::ostream & +operator << (std::ostream &o, const BitCode2 &code) { + o << code().field1 << "," << code().field2; + return o; +} + + + + + + + +template +class BitCode3 +{ +protected: + typedef T Type; + typedef BitCode3 ThisClass; + typedef CommaInitializerBitCode< ThisClass, T > CommaInit; + BOOST_STATIC_ASSERT_MSG( boost::is_unsigned::value == 1, "CODE TYPE MUST BE UNSIGNED" ); + BOOST_STATIC_ASSERT( L1+L2+L3 == sizeof(T)*8 ); + +public: + struct BitField { + T field1 : L1; + T field2 : L2; + T field3 : L3; + }; + union CodeSet { + BitField bitf; + T value; + } m_data; + + + BitCode3() {} + BitCode3(const T& data) { m_data.value = data; } + BitCode3(const Vector3i & data) { + (*this) << data(0),data(1),data(2); + } + inline CommaInit operator <<(T scalar) { return CommaInit(this, scalar); } + static const int size() { return 3; } + + BitField & operator()() { return m_data.bitf; } + const BitField & operator()() const { return m_data.bitf; } + operator Vector3i () { return Vector3i(m_data.bitf.field1, + m_data.bitf.field2, + m_data.bitf.field3); } + + void set(const T data) { m_data.value = data; } + T get() const { return m_data.value; } +}; + +template +std::ostream & +operator << (std::ostream &o, const BitCode3 &code) { + o << code().field1 << "," << code().field2 << "," << code().field3; + return o; +} + + + + + + + +template +class BitCode4 +{ +protected: + typedef T Type; + typedef BitCode4 ThisClass; + typedef CommaInitializerBitCode< ThisClass, T > CommaInit; + BOOST_STATIC_ASSERT_MSG( boost::is_unsigned::value == 1, "CODE TYPE MUST BE UNSIGNED" ); + BOOST_STATIC_ASSERT( L1+L2+L3+L4 == sizeof(T)*8 ); +public: + struct BitField { + T field1 : L1; + T field2 : L2; + T field3 : L3; + T field4 : L4; + }; + union CodeSet { + BitField bitf; + T value; + } m_data; + + BitCode4() {} + BitCode4(const T& data) { m_data.value = data; } + BitCode4(const Vector4i & data) { + (*this) << data(0),data(1),data(2),data(3); + } + inline CommaInit operator << (T scalar) { return CommaInit(this, scalar); } + static const int size() { return 4; } + + BitField & operator()() { return m_data.bitf; } + const BitField & operator()() const { return m_data.bitf; } + operator Vector4i () { return Vector4i(m_data.bitf.field1, + m_data.bitf.field2, + m_data.bitf.field3, + m_data.bitf.field4); } + + void set(const T data) { m_data.value = data; } + T get() const { return m_data.value; } + + + +}; + +template +std::ostream & +operator << (std::ostream &o, const BitCode4 &code) { + o << code().field1 << "," << code().field2 << "," << code().field3 << "," << code().field4; + return o; +} + + + +template +class BitCode { + typedef boost::mpl::vector_c BitSet; + typedef boost::mpl::vector_c BitSft; + +// static constexpr uint bset[3] = {L1,L2,L3}; +// static constexpr uint bsft[3] = {0,L1,L1+L2}; + + BOOST_STATIC_ASSERT_MSG( boost::is_unsigned::value == 1, "CODE TYPE MUST BE UNSIGNED" ); + //BOOST_STATIC_ASSERT( L1+L2+L3 == sizeof(T)*8 ); + T m_data; +public: + void PrintSelf( ) { +// for(int i=0; i< boost::mpl::size() ;++i) +// std::cout << "BitSet " << i << " [" << bset[i] << "] -> " << Get(i) << "\n"; + } + + T Get(unsigned short field) const { + // return (m_data >> bsft[field]) & (1< + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CONTAINERBOX_H +#define U_CONTAINERBOX_H + +#include "Geometry.h" + + +namespace uLib { + + + +class ContainerBox : public AffineTransform { +public: + ContainerBox() : m_LocalT(this) {} + + ContainerBox(const ContainerBox ©) : + m_LocalT(this), + AffineTransform(copy) + { + // FIX for performance // + this->SetOrigin(copy.GetOrigin()); + this->SetSize(copy.GetSize()); + } + + inline void SetOrigin(const Vector3f &v) { m_LocalT.SetPosition(v); } + + inline Vector3f GetOrigin() const { return m_LocalT.GetPosition(); } + + void SetSize(const Vector3f &v) { + Vector3f pos = this->GetOrigin(); + m_LocalT = AffineTransform(this); + m_LocalT.Scale(v); + m_LocalT.SetPosition(pos); + } + + inline Vector3f GetSize() const { return m_LocalT.GetScale(); } + + // WARNING: FIX... // + inline void FlipLocalAxes(int first, int second) + { m_LocalT.FlipAxes(first,second); } + + Matrix4f GetWorldMatrix() const { return m_LocalT.GetWorldMatrix(); } + + inline Vector4f GetWorldPoint(const Vector4f &v) const { + return m_LocalT.GetWorldMatrix() * v; + } + + inline Vector4f GetWorldPoint(const float x, const float y, const float z) { + return this->GetWorldPoint(Vector4f(x,y,z,1)); + } + + inline Vector4f GetLocalPoint(const Vector4f &v) const { + return m_LocalT.GetWorldMatrix().inverse() * v; + } + + inline Vector4f GetLocalPoint(const float x, const float y, const float z) { + return this->GetLocalPoint(Vector4f(x,y,z,1)); + } + +private: + AffineTransform m_LocalT; +}; + + +} + + + +#endif // CONTAINERBOX_H diff --git a/src/Math/DataSet.h b/src/Math/DataSet.h new file mode 100644 index 0000000..5c7202e --- /dev/null +++ b/src/Math/DataSet.h @@ -0,0 +1,77 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + +#ifndef U_MATH_DATASET_H +#define U_MATH_DATASET_H + +#include +#include + +#include + +#include "Math/Dense.h" +#include "Math/StructuredData.h" +#include + +namespace uLib { + +class DataSet_Base { +public: + DataSet_Base() {} + + virtual ~DataSet_Base() {} + virtual const void * GetPtr(Id_t id) const = 0; + virtual void * GetPtr(Id_t id) = 0; + virtual size_t Size() const = 0; + +private: + + +}; + +template +class VectorData : public DataSet_Base, public Vector { +public: + + +protected: + const void *GetPtr(Id_t id) const { return &this->at(id); } + void * GetPtr(Id_t id) { return &this->at(id); } +}; + + + + + + + + + + +} // uLib + + + +#endif // DATASET_H diff --git a/src/Math/Dense.cpp b/src/Math/Dense.cpp new file mode 100644 index 0000000..eb3e473 --- /dev/null +++ b/src/Math/Dense.cpp @@ -0,0 +1,64 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Dense.h" +#include "Core/Archives.h" + +//ULIB_SERIALIZE(uLib::HPoint3f) { +// ar & boost::serialization::make_nvp(NULL,boost::serialization::base_object(ob)); +//} + + +//ULIB_SERIALIZE(uLib::Vector4f) { +// ar & boost::serialization::make_nvp(NULL,boost::serialization::base_object(ob)); +//} + + +//ULIB_SERIALIZE(uLib::HLine3f) { +// ar +// & "HLine -> ( origin: " & AR(origin) & "; direction: " & AR(direction) & ") "; +//} + +//ULIB_SERIALIZE(uLib::HError3f) { +// ar +// & "HLine -> ( poserr: " & AR(position_error) & "; direrr: " & AR(direction_error) & ") "; +//} + + +// NEW // +ULIB_SERIALIZE(uLib::Vector2i) { ar & boost::serialization::make_nvp(NULL,ob); } +ULIB_SERIALIZE(uLib::Vector3i) { ar & boost::serialization::make_nvp(NULL,ob); } +ULIB_SERIALIZE(uLib::Vector4i) { ar & boost::serialization::make_nvp(NULL,ob); } +ULIB_SERIALIZE(uLib::Vector2f) { ar & boost::serialization::make_nvp(NULL,ob); } +ULIB_SERIALIZE(uLib::Vector3f) { ar & boost::serialization::make_nvp(NULL,ob); } +ULIB_SERIALIZE(uLib::Vector4f) { ar & boost::serialization::make_nvp(NULL,ob); } +ULIB_SERIALIZE(uLib::Vector2d) { ar & boost::serialization::make_nvp(NULL,ob); } +ULIB_SERIALIZE(uLib::Vector3d) { ar & boost::serialization::make_nvp(NULL,ob); } +ULIB_SERIALIZE(uLib::Vector4d) { ar & boost::serialization::make_nvp(NULL,ob); } + + diff --git a/src/Math/Dense.h b/src/Math/Dense.h new file mode 100644 index 0000000..add140a --- /dev/null +++ b/src/Math/Dense.h @@ -0,0 +1,364 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +/* + * + * Copyright (C) 2012 Andrea Rigoni Garola + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of the + * License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + * + */ + + +#ifndef ULIB_DENSEMATRIX_H +#define ULIB_DENSEMATRIX_H + +#include + +#include +#include "Core/Types.h" +#include "Core/Serializable.h" + + + + +/////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// NEW PART // + + + +namespace uLib { + +//////////////////////////////////////////////////////////////////////////////// +// DENSE MATRIX DEFINITION ///////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +using Eigen::Matrix; + + +//////////////////////////////////////////////////////////////////////////////// +// DENSE TYPES DEFINITIONS ///////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +#define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ + typedef Eigen::Matrix Matrix##SizeSuffix##TypeSuffix; \ + typedef Eigen::Matrix Vector##SizeSuffix##TypeSuffix; \ + typedef Eigen::Matrix RowVector##SizeSuffix##TypeSuffix; \ +// /* IMPORT INTERFACES */ \ +// typedef Interface::DenseMatrix, mpl::int_ > IMatrix##SizeSuffix##TypeSuffix; \ +// typedef Interface::DenseArray > IVector##SizeSuffix##TypeSuffix; \ +// typedef Interface::DenseArray > IRowVector##SizeSuffix##TypeSuffix; + + +#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \ + EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \ + EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \ + EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) + +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(int, i) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(float, f) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(double, d) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex, cf) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex, cd) + +#undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES +#undef EIGEN_MAKE_TYPEDEFS + +} // uLib + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// OLD PART // + +//// BOOST SERIALIZATION /////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +namespace boost { +namespace serialization { + +template +void serialize(Archive & ar, ::Eigen::Matrix & m, const unsigned int /*version*/) { + ar & boost::serialization::make_array(m.data(), RowsAtCompileTime * ColsAtCompileTime); +} + +} // serialization +} // boost + +//////////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////////// +// EIGEN VECTOR STREAM INTERACTIONS //////////////////////////////////////////// +// this is needed by boost::lexical_cast to cope with Eigens Vectors /////////// +namespace Eigen { + +template +std::istream & operator >> (std::basic_istream &is, Eigen::Matrix &vec) { + std::basic_string str; + for( unsigned int i=0; i> std::skipws >> str; + if(is.fail()) vec(i) = 0; + else vec(i) = boost::lexical_cast(str); + } + return is; +} + +template +Eigen::Matrix & operator >> (const std::basic_string &str, Eigen::Matrix &vec) { + std::stringstream ss(str); + ss >> vec; + return vec; +} + +template +std::basic_ostream & operator << (std::basic_ostream &os, const Eigen::Matrix &vec) { + // os << "[" << vec.transpose() << "]T"; // TODO: read and write Transposition with a proper symbol + os << vec.transpose(); + return os; +} + +template +std::basic_string & operator << (std::basic_string &str, const Eigen::Matrix &vec) { + std::basic_stringstream ss; + ss << vec; + str += ss.str(); + return str; +} + + +} // Eigen +//////////////////////////////////////////////////////////////////////////////// + + + +namespace uLib { + + +typedef int Scalari; +typedef unsigned int Scalarui; +typedef long Scalarl; +typedef unsigned long Scalarul; +typedef float Scalarf; +typedef double Scalard; + +} // uLib + +//typedef Eigen::Matrix Matrix1i; +//typedef Eigen::Matrix2i Matrix2i; +//typedef Eigen::Matrix3i Matrix3i; +//typedef Eigen::Matrix4i Matrix4i; + +//typedef Eigen::Matrix Matrix1f; +//typedef Eigen::Matrix2f Matrix2f; +//typedef Eigen::Matrix3f Matrix3f; +//typedef Eigen::Matrix4f Matrix4f; + +//typedef Eigen::Matrix Vector1i; +//typedef Eigen::Vector2i Vector2i; +//typedef Eigen::Vector3i Vector3i; +//typedef Eigen::Vector4i Vector4i; + +//typedef Eigen::Matrix Vector1f; +//typedef Eigen::Vector2f Vector2f; +//typedef Eigen::Vector3f Vector3f; +//typedef Eigen::Vector4f Vector4f; + + + + +//////////////////////////////////////////////////////////////////////////////// +// Vector String interaction /////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +///*! Given a string consisting of a series of doubles with some +//* delimiter, return an Eigen::Vector populated with those +//* values, in the same order as they are given in the string. +//* +//* \param vec A double vector to be populated with the results +//* \param str A string to be parsed as a series of doubles. +//* \param delim Delimiters of the text (a typical default is " ," for comma and space-delimited text +//* +//*/ +//template +//void VectorxT_StringTo(Eigen::Matrix &vec, std::string str, const char *delim = " ,;\t\n") { +// std::vector strvec; + +// boost::algorithm::trim_if( str, boost::algorithm::is_any_of(delim)); +// boost::algorithm::split(strvec,str,boost::algorithm::is_any_of(delim), boost::algorithm::token_compress_on); + +// for( unsigned int i=0; i(strvec[i]); +// } +//} + +//template +//std::string VectorxT_ToString(const Eigen::Matrix &vec) { +// std::stringstream sst; +// sst << vec.transpose(); +// return sst.str(); +//} + + +////template +////Eigen::Matrix & operator >> (std::istream &is, Eigen::Matrix &vec) { +////} + +//template +//void operator>> (std::string& str, Eigen::Matrix &vec){ +// VectorxT_StringTo(vec,str); +//} + + +//////////////////////////////////////////////////////////////////////////////// +////// HOMOGENEOUS VECTORS ////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +//template +//class _HPoint3f : public Eigen::Matrix< Scalarf,4,1 > { +//public: +// typedef Eigen::Matrix< Scalarf,4,1 > BaseClass; + +// _HPoint3f

() : BaseClass(0,0,0,p) {} +// _HPoint3f

(float x,float y,float z) : BaseClass(x,y,z,p) {} +// _HPoint3f

(Vector3f &in) : BaseClass(in.homogeneous()) { this->w = p; } + +// // This constructor allows to construct MyVectorType from Eigen expressions +// template +// inline _HPoint3f

(const Eigen::MatrixBase& other) +// : BaseClass(other) +// { } + +// // This method allows to assign Eigen expressions to Vector3H +// template +// inline _HPoint3f

& operator= (const Eigen::MatrixBase & other) +// { +// this->BaseClass::operator=(other); +// return *this; +// } + +//}; +//typedef _HPoint3f Vector4f; +//typedef _HPoint3f HPoint3f; + + + + +//////////////////////////////////////////////////////////////////////////////// +////// HOMOGENEOUS LINE ////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +//struct _HLine3f +//{ +// HPoint3f origin; +// Vector4f direction; +//}; +//typedef struct _HLine3f HLine3f; + +//inline std::ostream& +//operator<< (std::ostream& stream, const HLine3f &line) { +// stream << "HLine3f(" << "pt[" << line.origin.transpose() <<"] , dr[" << line.direction.transpose() << "]) "; +// return stream; +//} + + + + +//struct _HError3f +//{ +// Vector4f position_error; +// Vector4f direction_error; +//}; +//typedef struct _HError3f HError3f; + +//inline std::ostream& +//operator<< (std::ostream& stream, const HError3f &err) { +// stream << "HError3f(" << "ept[" << err.position_error.transpose() <<"] , edr[" << err.direction_error.transpose() << "]) "; +// return stream; +//} + + +//} + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// SERIALIZTION // + +// NEW // +ULIB_SERIALIZABLE(uLib::Vector2i) +ULIB_SERIALIZABLE(uLib::Vector3i) +ULIB_SERIALIZABLE(uLib::Vector4i) +ULIB_SERIALIZABLE(uLib::Vector2f) +ULIB_SERIALIZABLE(uLib::Vector3f) +ULIB_SERIALIZABLE(uLib::Vector4f) +ULIB_SERIALIZABLE(uLib::Vector2d) +ULIB_SERIALIZABLE(uLib::Vector3d) +ULIB_SERIALIZABLE(uLib::Vector4d) + + + +//ULIB_SERIALIZABLE(uLib::HPoint3f) +//ULIB_SERIALIZABLE(uLib::Vector4f) +//ULIB_SERIALIZABLE(uLib::HLine3f) +//ULIB_SERIALIZABLE(uLib::HError3f) + + + + + +#endif // U_DENSEMATRIX_H diff --git a/src/Math/Geometry.h b/src/Math/Geometry.h new file mode 100644 index 0000000..c2c9912 --- /dev/null +++ b/src/Math/Geometry.h @@ -0,0 +1,60 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_GEOMETRY_H +#define U_GEOMETRY_H + +#include "Core/Object.h" +#include "Math/Dense.h" +#include "Math/Transform.h" + +namespace uLib { + +class Geometry : public AffineTransform { +public: + + inline Vector4f GetWorldPoint(const Vector4f &v) const { + return this->GetWorldMatrix() * v; + } + + inline Vector4f GetWorldPoint(const float x, const float y, const float z) { + return this->GetWorldPoint(Vector4f(x,y,z,1)); + } + + inline Vector4f GetLocalPoint(const Vector4f &v) const { + return this->GetWorldMatrix().inverse() * v; + } + + inline Vector4f GetLocalPoint(const float x, const float y, const float z) { + return this->GetLocalPoint(Vector4f(x,y,z,1)); + } +}; + + +} + +#endif // GEOMETRY_H diff --git a/src/Math/ImageData.cpp b/src/Math/ImageData.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/Math/ImageData.h b/src/Math/ImageData.h new file mode 100644 index 0000000..69feac6 --- /dev/null +++ b/src/Math/ImageData.h @@ -0,0 +1,54 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + +#ifndef U_MATH_IMAGEDATA_H +#define U_MATH_IMAGEDATA_H + + +#include +#include + +#include +#include + +namespace uLib { + +class ImageData : public ImageSpace, public ImageMap { + + ImageData() {} + + +public: + + +}; + + + + + +} // uLib + +#endif // IMAGEDATA_H diff --git a/src/Math/ImageMap.cpp b/src/Math/ImageMap.cpp new file mode 100644 index 0000000..29045d6 --- /dev/null +++ b/src/Math/ImageMap.cpp @@ -0,0 +1,80 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + +#include "ImageMap.h" + +using namespace uLib; + +ImageMap::ImageMap(const Vector3i &size) : + m_Dims(size) +{ + SetDataOrder(); +} + +void ImageMap::SetDims(const Vector3i &size) +{ + this->m_Dims = size; + SetDataOrder(); +} + +void ImageMap::SetDataOrder(ImageMap::Order order) +{ + int i = order & 0x3; + int j = (order >> 2) & 0x3; + int k = (order >> 4) & 0x3; + this->m_Increments[i] = 1; + this->m_Increments[j] = m_Dims[i]; + this->m_Increments[k] = m_Dims[i] * m_Dims[j]; + this->m_DataOrder = order; +} + +bool ImageMap::IsInsideGrid(const Vector3i &v) const +{ + int vok = 1; + vok *= (v(0) >= 0 && v(0) < m_Dims[0]); + vok *= (v(1) >= 0 && v(1) < m_Dims[1]); + vok *= (v(2) >= 0 && v(2) < m_Dims[2]); + return vok; +} + + + +Vector3i ImageMap::UnMap(int index) const +{ + Vector3i v( 0,0,0 ); + Vector3i iv = m_Increments; + int id = 0; + for(int k=0; k<3; ++k) { + int inc = iv.maxCoeff(&id); + v(id) = index / inc; + index -= v(id) * inc; + iv(id) = 0; + } + return v; +} + + + + diff --git a/src/Math/ImageMap.h b/src/Math/ImageMap.h new file mode 100644 index 0000000..e27cd8d --- /dev/null +++ b/src/Math/ImageMap.h @@ -0,0 +1,95 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + +#ifndef U_MATH_IMAGEMAP_H +#define U_MATH_IMAGEMAP_H + +#include "Core/Macros.h" +#include "Core/Object.h" +#include "Math/Dense.h" +#include "Math/DataSet.h" + +namespace uLib { + +class ImageMap { +public: + typedef enum { + CustomOrder = 0, + XYZ = 0 | 1 << 2 | 2 << 4, + XZY = 0 | 2 << 2 | 1 << 4, + YXZ = 1 | 0 << 2 | 2 << 4, + YZX = 2 | 0 << 2 | 1 << 4, + ZXY = 1 | 2 << 2 | 0 << 4, + ZYX = 2 | 1 << 2 | 0 << 4 + } Order; + + ImageMap(const Vector3i &size); + + ImageMap(const ImageMap ©) : + m_DataOrder(copy.m_DataOrder), + m_Dims(copy.m_Dims), + m_Increments(copy.m_Increments) + {} + + uLibGetMacro(Dims,Vector3i) + + void SetDims(const Vector3i &size); + + uLibGetSetMacro(Increments,Vector3i) + + void SetDataOrder(Order order = YXZ); + + uLibGetMacro(DataOrder,Order) + + bool IsInsideGrid(const Vector3i &v) const; + + inline int Map(Vector3i index) const; + + Vector3i UnMap(int index) const; + +private: + Order m_DataOrder; + Vector3i m_Dims; + Vector3i m_Increments; //TODO: make this line matrix // +}; + + +// --- INLINES -------------------------------------------------------------- // + + +inline int ImageMap::Map(Vector3i index) const +{ + return (m_Increments.transpose() * index); +} + + + + + +} // uLib + + + +#endif // IMAGEMAP_H diff --git a/src/Math/ImageSpace.cpp b/src/Math/ImageSpace.cpp new file mode 100644 index 0000000..0cb5112 --- /dev/null +++ b/src/Math/ImageSpace.cpp @@ -0,0 +1,87 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + +#include "ImageSpace.h" + +namespace uLib { + +ImageSpace::ImageSpace(const Vector3i size) : + StructuredData(size) +{} + +//void ImageSpace::SetSize(const Vector3f v) +//{ +// ContainerBox::SetSize( v.array() / this->GetDims().array().cast() ); +//} + +//Vector3f ImageSpace::GetSize() const +//{ +// return ContainerBox::GetSize().array() * this->GetDims().array().cast(); +//} + +void ImageSpace::SetSpacing(const Vector3f spacing) +{ + ContainerBox::SetSize(spacing); +} + +Vector3f ImageSpace::GetSpacing() const +{ + return ContainerBox::GetSize(); +} + + +//bool ImageSpace::IsInsideBounds(const Vector4f pt) const +//{ +// Vector4f ptl = this->GetLocalPoint(pt); +// int result = 0; +// for ( int i=0; i<3 ;++i) { +// result += ptl(i) > (float)this->GetDims()(i); +// result += ptl(i) < 0; +// } +// return result == 0; +//} + +Vector3i ImageSpace::Find(const Vector4f pt) const +{ + Vector3i out; + Vector4f p = GetLocalPoint(pt); + out << (int)floor(p(0)), + (int)floor(p(1)), + (int)floor(p(2)); + return out; +} + +void ImageSpace::PrintSelf(std::ostream &o) +{ + o << "uLib Structured Grid: \n" +// << "dim = " << this->GetDims().transpose() << "\n" + << "spacing = " << this->GetSpacing().transpose() << "\n"; +} + + +} // uLib + + diff --git a/src/Math/ImageSpace.h b/src/Math/ImageSpace.h new file mode 100644 index 0000000..2991318 --- /dev/null +++ b/src/Math/ImageSpace.h @@ -0,0 +1,67 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + +#ifndef U_MATH_IMAGESPACE_H +#define U_MATH_IMAGESPACE_H + +#include "Core/Object.h" +#include "Math/ContainerBox.h" + + +namespace uLib { + +class ImageSpace : public ContainerBox { + typedef ContainerBox BaseClass; +public: + ImageSpace(const Vector3i size); + + using ContainerBox::SetOrigin; + +// void SetSize(const Vector3f v); + +// Vector3f GetSize() const; + + void SetSpacing(const Vector3f spacing); + + Vector3f GetSpacing() const; + +// bool IsInsideBounds(const Vector4f pt) const; + + Vector3i Find(const Vector4f pt) const; + + void PrintSelf(std::ostream &o); + +private: + using ContainerBox::GetSize; + using ContainerBox::SetSize; +}; + + +} // uLib + + + + +#endif // IMAGESPACE_H diff --git a/src/Math/Line.h b/src/Math/Line.h new file mode 100644 index 0000000..a192efd --- /dev/null +++ b/src/Math/Line.h @@ -0,0 +1,69 @@ +#ifndef U_GEO_LINE_H +#define U_GEO_LINE_H + +#include "Core/Macros.h" +#include "Core/Mpl.h" +#include "Core/Serializable.h" + + +#include "Math/Dense.h" + + + +namespace uLib { + +//////////////////////////////////////////////////////////////////////////////// +// VECTOR PAIR ///////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +template +class VectorPair { +public: + typedef Matrix<_Scalar,_Dim,1> Vector; + VectorPair() {} + VectorPair(const Vector &first, + const Vector &second) { + this->m_data[0] = first; + this->m_data[1] = second; + } + uLibArrayMacro(Data,Vector *) +protected: + EIGEN_ALIGN16 Vector m_Data[2]; +}; + + +//////////////////////////////////////////////////////////////////////////////// +// LINE //////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +template +class Line : public VectorPair<_Scalar, _Dim> { +public: + ULIB_SERIALIZE_ACCESS + typedef VectorPair<_Scalar, _Dim> BaseClass; + typedef typename BaseClass::Vector Vector; + + Line() {} + Line(const Vector &origin, const Vector &direction) : BaseClass(origin,direction) {} + + Vector & origin() { return this->m_Data[0]; } + Vector & direction() { return this->m_Data[1]; } + const Vector & origin() const { return this->m_Data[0]; } + const Vector & direction() const { return this->m_Data[1]; } +}; + +typedef Line Line2f; +typedef Line Line3f; +typedef Line Line4f; +typedef Line4f HLine3f; + +} // uLib + + + +//ULIB_SERIALIZABLE(uLib::Line2f) +//ULIB_SERIALIZABLE(uLib::Line3f) +//ULIB_SERIALIZABLE(uLib::Line4f) + + +#endif // LINE_H diff --git a/src/Math/Makefile.am b/src/Math/Makefile.am new file mode 100644 index 0000000..e8add8c --- /dev/null +++ b/src/Math/Makefile.am @@ -0,0 +1,42 @@ +SUBDIRS = . + +include $(top_srcdir)/Common.am + +library_includedir = $(includedir)/libmutom-${PACKAGE_VERSION}/Math +library_include_HEADERS = ContainerBox.h \ + Dense.h \ + Geometry.h \ + Transform.h \ + StructuredData.h\ + StructuredGrid.h\ + VoxImage.h \ + VoxRaytracer.h \ + Utils.h \ + VoxImageFilter.h\ + VoxImageFilter.hpp \ + VoxImageFilterLinear.hpp \ + VoxImageFilterMedian.hpp \ + VoxImageFilterABTrim.hpp \ + VoxImageFilterBilateral.hpp \ + VoxImageFilterThreshold.hpp \ + VoxImageFilter2ndStat.hpp \ + VoxImageFilterCustom.hpp \ + Accumulator.h \ + TriangleMesh.h + + +_MATH_SOURCES = \ + VoxRaytracer.cpp \ + StructuredData.cpp \ + StructuredGrid.cpp \ + VoxImage.cpp \ + TriangleMesh.cpp \ + Dense.cpp + + + + +noinst_LTLIBRARIES = libmutommath.la +libmutommath_la_SOURCES = ${_MATH_SOURCES} + + diff --git a/src/Math/Polydata.h b/src/Math/Polydata.h new file mode 100644 index 0000000..4cd462f --- /dev/null +++ b/src/Math/Polydata.h @@ -0,0 +1,48 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef POLYDATA_H +#define POLYDATA_H + +#include "Core/Object.h" + +namespace uLib { + +class Polydata : public Object { + +public: + + + +}; + + +} + + + +#endif // POLYDATA_H diff --git a/src/Math/Quote.h b/src/Math/Quote.h new file mode 100644 index 0000000..f10f042 --- /dev/null +++ b/src/Math/Quote.h @@ -0,0 +1,49 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_MATH_QUOTE_H +#define U_MATH_QUOTE_H + +#include "Math/Dense.h" + +namespace uLib { + +class Quote : public Vector2f { +public: + + + uLibRefMacro(Offset,Scalarf); + +private: + Scalarf m_Offset; +}; + + +} // uLib + + +#endif // QUOTE_H diff --git a/src/Math/StructuredData.cpp b/src/Math/StructuredData.cpp new file mode 100644 index 0000000..456747a --- /dev/null +++ b/src/Math/StructuredData.cpp @@ -0,0 +1,80 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "StructuredData.h" + +using namespace uLib; + +StructuredData::StructuredData(const Vector3i &size) : + m_Dims(size) +{ + SetDataOrder(); +} + +void StructuredData::SetDims(const Vector3i &size) +{ + this->m_Dims = size; + SetDataOrder(); +} + +void StructuredData::SetDataOrder(StructuredData::Order order) +{ + int i = order & 0x3; + int j = (order >> 2) & 0x3; + int k = (order >> 4) & 0x3; + this->m_Increments[i] = 1; + this->m_Increments[j] = m_Dims[i]; + this->m_Increments[k] = m_Dims[i] * m_Dims[j]; + this->m_DataOrder = order; +} + +bool StructuredData::IsInsideGrid(const Vector3i &v) const +{ + int vok = 1; + vok *= (v(0) >= 0 && v(0) < m_Dims[0]); + vok *= (v(1) >= 0 && v(1) < m_Dims[1]); + vok *= (v(2) >= 0 && v(2) < m_Dims[2]); + return vok; +} + + + +Vector3i StructuredData::UnMap(int index) const +{ + Vector3i v( 0,0,0 ); + Vector3i iv = m_Increments; + int id = 0; + for(int k=0; k<3; ++k) { + int inc = iv.maxCoeff(&id); + v(id) = index / inc; + index -= v(id) * inc; + iv(id) = 0; + } + return v; +} + + diff --git a/src/Math/StructuredData.h b/src/Math/StructuredData.h new file mode 100644 index 0000000..9ccb868 --- /dev/null +++ b/src/Math/StructuredData.h @@ -0,0 +1,101 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef STRUCTUREDDATA_H +#define STRUCTUREDDATA_H + +#include "Core/Macros.h" +#include "Core/Object.h" +#include "Math/Dense.h" +#include "Math/DataSet.h" + + +namespace uLib { + +class StructuredData { +public: + enum _Order + { + CustomOrder = 0, + XYZ = 0 | 1 << 2 | 2 << 4, + XZY = 0 | 2 << 2 | 1 << 4, + YXZ = 1 | 0 << 2 | 2 << 4, + YZX = 2 | 0 << 2 | 1 << 4, + ZXY = 1 | 2 << 2 | 0 << 4, + ZYX = 2 | 1 << 2 | 0 << 4 + }; + + typedef enum _Order Order; + + StructuredData(const Vector3i &size); + + StructuredData(const StructuredData ©) : + m_DataOrder(copy.m_DataOrder), + m_Dims(copy.m_Dims), + m_Increments(copy.m_Increments) + {} + + + uLibGetMacro(Dims,Vector3i) + + void SetDims(const Vector3i &size); + + uLibGetSetMacro(Increments,Vector3i) + + void SetDataOrder(Order order = YXZ); + + uLibGetMacro(DataOrder,Order) + + bool IsInsideGrid(const Vector3i &v) const; + + inline int Map(Vector3i index) const; + + Vector3i UnMap(int index) const; + +private: + Order m_DataOrder; + Vector3i m_Dims; + Vector3i m_Increments; //TODO: make this line matrix // +}; + + + +// --- INLINES -------------------------------------------------------------- // + + +inline int StructuredData::Map(Vector3i index) const +{ + return (m_Increments.transpose() * index); +} + + + + + +} + +#endif // STRUCTUREDDATA_H diff --git a/src/Math/StructuredGrid.cpp b/src/Math/StructuredGrid.cpp new file mode 100644 index 0000000..fe81d2e --- /dev/null +++ b/src/Math/StructuredGrid.cpp @@ -0,0 +1,87 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "StructuredGrid.h" + +//namespace uLib { + +//ImageData::ImageData(const Vector3i size) : +// StructuredData(size) +//{} + +//void ImageData::SetSize(const Vector3f v) +//{ +// ContainerBox::SetSize( v.array() / this->GetDims().array().cast() ); +//} + +//Vector3f ImageData::GetSize() const +//{ +// return ContainerBox::GetSize().array() * this->GetDims().array().cast(); +//} + +//void ImageData::SetSpacing(const Vector3f spacing) +//{ +// ContainerBox::SetSize(spacing); +//} + +//Vector3f ImageData::GetSpacing() const +//{ +// return ContainerBox::GetSize(); +//} + + +//bool ImageData::IsInsideBounds(const Vector4f pt) const +//{ +// Vector4f ptl = this->GetLocalPoint(pt); +// int result = 0; +// for ( int i=0; i<3 ;++i) { +// result += ptl(i) > (float)this->GetDims()(i); +// result += ptl(i) < 0; +// } +// return result == 0; +//} + +//Vector3i ImageData::Find(const Vector4f pt) const +//{ +// Vector3i out; +// Vector4f p = GetLocalPoint(pt); +// out << (int)floor(p(0)), +// (int)floor(p(1)), +// (int)floor(p(2)); +// return out; +//} + +//void ImageData::PrintSelf(std::ostream &o) +//{ +// o << "uLib Structured Grid: \n" +// << "dim = " << this->GetDims().transpose() << "\n" +// << "spacing = " << this->GetSpacing().transpose() << "\n"; +//} + + +//} diff --git a/src/Math/StructuredGrid.h b/src/Math/StructuredGrid.h new file mode 100644 index 0000000..4e17a74 --- /dev/null +++ b/src/Math/StructuredGrid.h @@ -0,0 +1,65 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_MATH_STRUCTUREDGRID_H +#define U_MATH_STRUCTUREDGRID_H + +//#include "Core/Object.h" +//#include "Math/ContainerBox.h" +//#include "Math/StructuredData.h" + +//namespace uLib { + + +//class ImageData : public ContainerBox, public StructuredData { +// typedef ContainerBox BaseClass; +//public: +// ImageData(const Vector3i size); + +// using ContainerBox::SetOrigin; + +// void SetSize(const Vector3f v); + +// Vector3f GetSize() const; + +// void SetSpacing(const Vector3f spacing); + +// Vector3f GetSpacing() const; + +// bool IsInsideBounds(const Vector4f pt) const; + +// Vector3i Find(const Vector4f pt) const; + +// void PrintSelf(std::ostream &o); +//}; + + + + +//} + +#endif // STRUCTUREDGRID_H diff --git a/src/Math/Transform.h b/src/Math/Transform.h new file mode 100644 index 0000000..634f3a2 --- /dev/null +++ b/src/Math/Transform.h @@ -0,0 +1,141 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +/* + * Copyright (C) 2012 Andrea Rigoni Garola + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of the + * License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + * + */ + + +#ifndef U_TRANSFORM_H +#define U_TRANSFORM_H + +#include +#include + + +namespace uLib { + +//////////////////////////////////////////////////////////////////////////////// +///////// AFFINE TRANSFORM WRAPPER ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +class AffineTransform { +protected: + Eigen::Affine3f m_T; + AffineTransform *m_Parent; +public: + AffineTransform() : + m_T(Matrix4f::Identity()), + m_Parent(NULL) + {} + + AffineTransform(AffineTransform *parent) : + m_T(Matrix4f::Identity()), + m_Parent(parent) + {} + + AffineTransform(const AffineTransform ©) : + m_T(copy.m_T), + m_Parent(copy.m_Parent) + {} + + Eigen::Affine3f& GetTransform() { return m_T; } + uLibGetSetMacro(Parent,AffineTransform *) + + inline void SetMatrix (Matrix4f &mat) { m_T.matrix() = mat; } + inline Matrix4f& GetMatrix () { return m_T.matrix(); } + + Matrix4f GetWorldMatrix() const + { + if(!m_Parent) return m_T.matrix(); + else return m_Parent->GetWorldMatrix() * m_T.matrix(); // T = B * A // + } + + inline void SetPosition(const Vector3f &v) { this->m_T.translation() = v; } + + inline Vector3f GetPosition() const { return this->m_T.translation(); } + + inline void SetRotation(const Matrix3f &m) { this->m_T.linear() = m; } + + inline Matrix3f GetRotation() const { return this->m_T.rotation(); } + + inline Vector3f GetOrientation(uint i0 = 0, uint i1 = 1, uint i2 = 2) const { return this->m_T.linear().eulerAngles(i0,i1,i2); } + + inline void Translate(const Vector3f &v) { this->m_T.translate(v); } + + inline void Scale(const Vector3f &v) { this->m_T.scale(v); } + + inline Vector3f GetScale() const { return this->m_T.linear() * Vector3f(1,1,1); } // FIXXXXXXX + + + inline void Rotate(const Matrix3f &m) { this->m_T.rotate(m); } + + + inline void PreRotate(const Matrix3f &m) { this->m_T.prerotate(m); } + + inline void QuaternionRotate(const Vector4f &q) + { this->m_T.rotate(Eigen::Quaternion(q)); } + + inline void EulerYZYRotate(const Vector3f &e) { + Matrix3f mat; + mat = Eigen::AngleAxisf(e.x(), Vector3f::UnitY()) + * Eigen::AngleAxisf(e.y(), Vector3f::UnitZ()) + * Eigen::AngleAxisf(e.z(), Vector3f::UnitY()); + m_T.rotate(mat); + } + + inline void FlipAxes(int first, int second) + { + Matrix3f mat = Matrix3f::Identity(); + mat.col(first).swap(mat.col(second)); + m_T.rotate(mat); + } +}; + + + +} + + + +#endif//U_TRANSFORM_H diff --git a/src/Math/TriangleMesh.cpp b/src/Math/TriangleMesh.cpp new file mode 100644 index 0000000..d8828ef --- /dev/null +++ b/src/Math/TriangleMesh.cpp @@ -0,0 +1,69 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "TriangleMesh.h" + + +namespace uLib { + +void TriangleMesh::PrintSelf(std::ostream &o) +{ + o << " // ------- TRIANGLE MESH ------- // \n" ; + o << " #Points : " << m_Points.size() << "\n"; + o << " #Triang : " << m_Triangles.size() << "\n"; + for(int i=0; i < m_Triangles.size(); ++i ) { + o << " - triangle[" << i << "]" << + " " << m_Triangles[i](0) << + "->(" << m_Points[m_Triangles[i](0)].transpose() << ") " << + " " << m_Triangles[i](1) << + "->(" << m_Points[m_Triangles[i](1)].transpose() << ") " << + " " << m_Triangles[i](2) << + "->(" << m_Points[m_Triangles[i](2)].transpose() << ") " << + " \n"; + } + o << " // ----------------------------- // \n"; +} + +void TriangleMesh::AddPoint(const Vector3f &pt) +{ + this->m_Points.push_back(pt); +} + +void TriangleMesh::AddTriangle(const Id_t *id) +{ + Vector3i triangle(id[0],id[1],id[2]); + this->m_Triangles.push_back(triangle); +} + +void TriangleMesh::AddTriangle(const Vector3i &id) +{ + this->m_Triangles.push_back(id); +} + + +} diff --git a/src/Math/TriangleMesh.h b/src/Math/TriangleMesh.h new file mode 100644 index 0000000..0fdebac --- /dev/null +++ b/src/Math/TriangleMesh.h @@ -0,0 +1,59 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef TRIANGLEMESH_H +#define TRIANGLEMESH_H + +#include "Core/Object.h" +#include "Core/Vector.h" +#include "Math/Dense.h" + +namespace uLib { + +class TriangleMesh : public Object { + +public: + void PrintSelf(std::ostream &o); + + void AddPoint(const Vector3f &pt); + + void AddTriangle(const Id_t *id); + void AddTriangle(const Vector3i &id); + + uLibRefMacro(Points,Vector) + uLibRefMacro(Triangles,Vector) + +private: + Vector m_Points; + Vector m_Triangles; + +}; + +} + + +#endif // TRIANGLEMESH_H diff --git a/src/Math/Utils.h b/src/Math/Utils.h new file mode 100644 index 0000000..99334b2 --- /dev/null +++ b/src/Math/Utils.h @@ -0,0 +1,50 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_UTILS_H +#define U_UTILS_H + +#include +#include +#include + +#define fastSign(x) ((x>0)-(x<0)) + +namespace uLib { + +inline bool isFinite(float x) { + return (x<=FLT_MAX && x>= -FLT_MAX); +} + +inline bool isFinite(double x) { + return (x<=DBL_MAX && x>= -DBL_MAX); +} + + +} + +#endif // UTILS_H diff --git a/src/Math/VectorSpace.h b/src/Math/VectorSpace.h new file mode 100644 index 0000000..f45146f --- /dev/null +++ b/src/Math/VectorSpace.h @@ -0,0 +1,70 @@ +#ifndef U_GEO_VECTORSPACE_H +#define U_GEO_VECTORSPACE_H + +#include "Core/Macros.h" +#include "Core/Mpl.h" + +#include "Math/Dense.h" +#include "Math/Line.h" + + + +//#include "boost/geometry.hpp" +//#include "boost/geometry/geometries/adapted/c_array.hpp" +//#include "boost/geometry/geometries/adapted/boost_array.hpp" +//#include "boost/geometry/geometries/adapted/std_pair_as_segment.hpp" + +//#include "boost/geometry/geometries/register/point.hpp" +//#include "boost/geometry/geometries/register/linestring.hpp" + + +namespace uLib { + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// VECTOR SPACE //////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////////////////// +// VECTOR UTILS //////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +inline Vector4f HVector3f(float x, float y, float z) { return Vector4f(x,y,z,0); } +inline Vector4f HVector3f(const Vector4f &v) { return Vector4f(v(0),v(1),v(2),0); } + +inline Vector4f HPoint3f(float x, float y, float z) { return Vector4f(x,y,z,1); } +inline Vector4f HPoint3f(const Vector4f &v) { return Vector4f(v(0),v(1),v(2),1); } + + +// this is an example of function imported from eigen // +//using boost::geometry::distance; + +} // uLib + + + +// BOOST GEOMETRY REGISTRATION // + +//BOOST_GEOMETRY_REGISTER_POINT_2D(uLib::Vector2i, int, boost::geometry::cs::cartesian, operator()(0), operator()(1)) +//BOOST_GEOMETRY_REGISTER_POINT_3D(uLib::Vector3i, int, boost::geometry::cs::cartesian, operator()(0), operator()(1), operator()(2)) +//BOOST_GEOMETRY_REGISTER_POINT_3D(uLib::Vector4i, int, boost::geometry::cs::cartesian, operator()(0), operator()(1), operator()(2)) + +//BOOST_GEOMETRY_REGISTER_POINT_2D(uLib::Vector2f, float, boost::geometry::cs::cartesian, operator()(0), operator()(1)) +//BOOST_GEOMETRY_REGISTER_POINT_3D(uLib::Vector3f, float, boost::geometry::cs::cartesian, operator()(0), operator()(1), operator()(2)) +//BOOST_GEOMETRY_REGISTER_POINT_3D(uLib::Vector4f, float, boost::geometry::cs::cartesian, operator()(0), operator()(1), operator()(2)) + +//BOOST_GEOMETRY_REGISTER_POINT_2D(uLib::Vector2d, double, boost::geometry::cs::cartesian, operator()(0), operator()(1)) +//BOOST_GEOMETRY_REGISTER_POINT_3D(uLib::Vector3d, double, boost::geometry::cs::cartesian, operator()(0), operator()(1), operator()(2)) +//BOOST_GEOMETRY_REGISTER_POINT_3D(uLib::Vector4d, double, boost::geometry::cs::cartesian, operator()(0), operator()(1), operator()(2)) + + + + + +#endif // VECTORSPACE_H diff --git a/src/Math/VoxImage.cpp b/src/Math/VoxImage.cpp new file mode 100644 index 0000000..a73f94e --- /dev/null +++ b/src/Math/VoxImage.cpp @@ -0,0 +1,192 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include +#include + +#include "VoxImage.h" + + +namespace uLib { + +void Abstract::VoxImage::ExportToVtk (const char *file, bool density_type) +{ + FILE * vtk_file = fopen(file,"wb"); + assert(vtk_file); + Abstract::VoxImage *voxels = this; + float norm; + if (density_type) { + norm = 40000; + } else norm = 1.E6; + int nx = voxels->GetDims()(0); + int ny = voxels->GetDims()(1); + int nz = voxels->GetDims()(2); + + fprintf(vtk_file, + "# vtk DataFile Version 2.0\n" + "Image Builder vtk output\n" + "ASCII\n" + "DATASET STRUCTURED_POINTS\n" + "DIMENSIONS %d %d %d\n" + "SPACING %f %f %f\n" + "ORIGIN %f %f %f\n" + "POINT_DATA %d\n" + "SCALARS volume_scalars float 1\n" + "LOOKUP_TABLE default\n", + nx , ny , nz , + voxels->GetSpacing()(0), + voxels->GetSpacing()(1), + voxels->GetSpacing()(2), + voxels->GetPosition()(0), // FIX FOR ORIGIN // + voxels->GetPosition()(1), + voxels->GetPosition()(2), + nx * ny * nz + ); + + Vector3i index(0,0,0); + for (int zv = 0; zv < nz; ++zv) { + for (int yv = 0; yv < ny; ++yv) { + for (int xv = 0; xv < nx; ++xv) { + index << xv,yv,zv; + // write voxel density in mrad^2/cm // + float density = fabs(voxels->GetValue(index)) * norm; + fprintf(vtk_file, "%f ", density); + } + } + } + + fclose(vtk_file); + printf("%s vtk file saved\n",file); +} + +int Abstract::VoxImage::ImportFromVtk(const char *file) +{ + FILE * vtk_file = fopen(file, "r"); + if (!vtk_file) return false; + + char word[20]; + int dx, dy, dz, n_tot; + float sx, sy, sz, ox, oy, oz; + do { + fscanf(vtk_file, "%s", word); + } while (strcmp(word, "DIMENSIONS")); + fscanf(vtk_file, "%d %d %d", &dx, &dy, &dz); + do { + fscanf(vtk_file, "%s", word); + } while (strcmp(word, "SPACING")); + fscanf(vtk_file, "%f %f %f", &sx, &sy, &sz); + do { + fscanf(vtk_file, "%s", word); + } while (strcmp(word, "ORIGIN")); + fscanf(vtk_file, "%f %f %f", &ox, &oy, &oz); + do { + fscanf(vtk_file, "%s", word); + } while (strcmp(word, "POINT_DATA")); + fscanf(vtk_file, "%d", &n_tot); + do { + fscanf(vtk_file, "%s", word); + } while (strcmp(word, "default")); + + this->SetDims(Vector3i(dx,dy,dz)); + this->SetSpacing(Vector3f(sx,sy,sz)); + this->SetPosition(Vector3f(ox,oy,oz)); + + for (int k = 0; k < dz; ++k) { + for (int j = 0; j < dy; ++j) { + for (int i = 0; i < dx; ++i) { + Vector3i idx(i, j, k); + float tmp_val; + fscanf(vtk_file, "%f", &tmp_val); + this->SetValue(idx,fabs(tmp_val)*1E-6); + } + } + } + fclose(vtk_file); + return true; +} + +void Abstract::VoxImage::ExportToVtkXml(const char *file, bool density_type) +{ + // Not implemented yet // + FILE * vtk_file = fopen(file,"wb"); + assert(vtk_file); + Abstract::VoxImage *voxels = this; + float norm; + if (density_type) { + norm = 40000; + } else norm = 1.E6; + int nx = voxels->GetDims()(0); + int ny = voxels->GetDims()(1); + int nz = voxels->GetDims()(2); + + fprintf(vtk_file, + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + "\n", + nx, ny, nz, + voxels->GetPosition()(0), // FIX FOR ORIGIN // + voxels->GetPosition()(1), + voxels->GetPosition()(2), + voxels->GetSpacing()(0), + voxels->GetSpacing()(1), + voxels->GetSpacing()(2), + nx, ny, nz + ); + Vector3i index(0,0,0); + for (int zv = 0; zv < nz; ++zv) { + for (int yv = 0; yv < ny; ++yv) { + for (int xv = 0; xv < nx; ++xv) { + index << xv,yv,zv; + // write voxel density in mrad^2/cm // + float density = fabs(voxels->GetValue(index)) * norm; + fprintf(vtk_file, "%f ", density); + } + } + } + fprintf(vtk_file, + "\n \n \n"); + + fprintf(vtk_file, + "\n \n \n"); + fclose(vtk_file); + printf("%s vtk file saved\n",file); +} + + + + +} + diff --git a/src/Math/VoxImage.h b/src/Math/VoxImage.h new file mode 100644 index 0000000..d845949 --- /dev/null +++ b/src/Math/VoxImage.h @@ -0,0 +1,286 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_MATH_VOXIMAGE_H +#define U_MATH_VOXIMAGE_H + +#include "Core/Vector.h" +#include "Core/StaticInterface.h" +#include "Math/Dense.h" +#include "Math/ImageData.h" + +#include +#include + +namespace uLib { + + + + +//////////////////////////////////////////////////////////////////////////////// +// ABSTRACT VOX IMAGE ////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace Abstract { +class VoxImage : public uLib::ImageData { +public: + typedef uLib::ImageData BaseClass; + + virtual float GetValue(const Vector3i id) const = 0; + virtual float GetValue(const int id) const = 0; + virtual void SetValue(const Vector3i id, float value) = 0; + virtual void SetValue(const int id, float value) = 0; + + virtual void SetDims(const Vector3i &size) = 0; + + void ExportToVtk(const char *file, bool density_type = 0); + void ExportToVtkXml(const char *file, bool density_type = 0); + int ImportFromVtk(const char *file); + +protected: + + virtual ~VoxImage() {} + VoxImage(const Vector3i &size) : BaseClass(size) {} +}; +} + +//////////////////////////////////////////////////////////////////////////////// +// VOXEL //////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +struct Voxel { + Scalarf Value; + float & operator()() { return Value; } + const float & operator()() const { return Value; } +}; + +template +std::basic_ostream & operator << (std::basic_ostream &o, const Voxel &v) { + o << v.Value; + return o; +} + + +//////////////////////////////////////////////////////////////////////////////// +// VOX IMAGE ///////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +template< typename T > +class VoxImage : public Abstract::VoxImage { +public: + typedef Abstract::VoxImage BaseClass; + + VoxImage(); + + VoxImage(const Vector3i &size); + + VoxImage(const VoxImage ©) : + BaseClass(copy) + { + this->m_Data = copy.m_Data; + } + + uLibRefMacro(Data,Vector) + inline const Vector& ConstData() const { return m_Data; } + + inline const T& At(int i) const { return m_Data.at(i); } + inline const T& At(const Vector3i &id) const { return m_Data.at(Map(id)); } + inline T& At(int i) { return m_Data.at(i); } + inline T& At(const Vector3i &id) { return m_Data.at(Map(id)); } + + inline const T& operator[](unsigned int i) const { return m_Data[i]; } + inline const T& operator[](const Vector3i &id) const { return m_Data[Map(id)]; } + inline T& operator[](unsigned int i) { return m_Data[i]; } + inline T& operator[](const Vector3i &id) { return m_Data[Map(id)]; } + + // this implements Abstract interface // + inline Scalarf GetValue(const Vector3i id) const { return this->At(id)(); } + inline Scalarf GetValue(const int id) const { return this->At(id)(); } + inline void SetValue(const Vector3i id, Scalarf value) { this->operator [](id)() = value; } + inline void SetValue(const int id, float value) { this->operator [](id)() = value; } + + inline void SetDims(const Vector3i &size) { + this->m_Data.resize(size.prod()); + StructuredData::SetDims(size); + } + + inline VoxImage clipImage(const Vector3i begin, const Vector3i end) const; + + inline VoxImage clipImage(const Vector4f begin, const Vector4f end) const; + + inline VoxImage clipImage(const float density) const; + + inline void SelectScalarfComponent(T &element, Scalarf *scalar); + + inline void InitVoxels(T t); + + + // MATH OPERATORS // + inline void operator *=(Scalarf scalar) { + for(unsigned int i = 0; i < m_Data.size(); ++i) + m_Data[i].Value *= scalar; + } + inline void operator +=(Scalarf scalar) { + for(unsigned int i = 0; i < m_Data.size(); ++i) + m_Data[i].Value += scalar; + } + inline void operator /=(Scalarf scalar) { + for(unsigned int i = 0; i < m_Data.size(); ++i) + m_Data[i].Value /= scalar; + } + inline void operator -=(Scalarf scalar) { + for(unsigned int i = 0; i < m_Data.size(); ++i) + m_Data[i].Value -= scalar; + } + + // MATH VoxImage Operators // + template + void operator +=(VoxImage &sibling) { + if (this->GetDims() != sibling.GetDims()) { + //printf("Warning when adding VoxImages: I'm NOT doing it!\n"); + return; + }// WARNING! You must Warn the user! + for(unsigned int i = 0; i < m_Data.size(); ++i) { + m_Data[i].Value += sibling.At(i).Value; + } + } + + template + void operator -=(VoxImage &sibling) { + if (this->GetDims() != sibling.GetDims()) { + //printf("Warning when subtracting VoxImages: I'm NOT doing it!\n"); + return; + }// WARNING! You must Warn the user! + for(unsigned int i = 0; i < m_Data.size(); ++i) { + m_Data[i].Value -= sibling.At(i).Value; + } + } + + template + void operator *=(VoxImage &sibling) { + if (this->GetDims() != sibling.GetDims()) { + //printf("Warning when multiplying VoxImages: I'm NOT doing it!\n"); + return; + }// WARNING! You must Warn the user! + for(unsigned int i = 0; i < m_Data.size(); ++i) { + m_Data[i].Value *= sibling.At(i).Value; + } + } + + template + void operator /=(VoxImage &sibling) { + if (this->GetDims() != sibling.GetDims()) { + //printf("Warning when dividing VoxImages: I'm NOT doing it!\n"); + return; + }// WARNING! You must Warn the user! + for(unsigned int i = 0; i < m_Data.size(); ++i) { + m_Data[i].Value /= sibling.At(i).Value; + } + } + +private: + Vector m_Data; +}; + + +template +VoxImage::VoxImage() : + m_Data(0), + BaseClass(Vector3i(0,0,0)) {} +//{ Interface::IsA (); /* structural check for T */ } + +template +VoxImage::VoxImage(const Vector3i &size) : + m_Data(size.prod()), + BaseClass(size) {} +//{ Interface::IsA (); /* structural check for T */ } + + +template +VoxImage VoxImage::clipImage(const Vector3i begin, const Vector3i end) const +{ + Vector3i dim = (end-begin)+Vector3i(1,1,1); + VoxImage out(*this); + out.SetDims(dim); + // WARNING Origin or Position??? + out.SetPosition(this->GetPosition() + this->GetSpacing().cwiseProduct(begin.cast()) ); + + for(uint x = 0; xAt(begin + id); + } + return out; +} + +template +VoxImage VoxImage::clipImage(const Vector4f begin, const Vector4f end) const +{ + Vector3i v1 = this->Find(begin); + Vector3i v2 = this->Find(end); + return this->clipImage(v1,v2); +} + +template +VoxImage VoxImage::clipImage(const float density) const +{ + Vector3i v1 = this->GetDims(); + Vector3i v2 = Vector3i(0,0,0); + for(uint i=0; i< this->m_Data.size(); ++i) { + if( this->GetValue(i) >= density ) { + Vector3i id = this->UnMap(i); + v1 = v1.array().min(id.array()); + v2 = v2.array().max(id.array()); + } + } + return this->clipImage(v1,v2); +} + + +template +void VoxImage::InitVoxels(T t) +{ + std::fill( m_Data.begin(), m_Data.end(), t ); // warning... stl function // +} + + + + + +} // uLib + + + + + + + +#endif // VOXIMAGE_H diff --git a/src/Math/VoxImageFilter.h b/src/Math/VoxImageFilter.h new file mode 100644 index 0000000..c9fcf9d --- /dev/null +++ b/src/Math/VoxImageFilter.h @@ -0,0 +1,129 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VOXIMAGEFILTER_H +#define VOXIMAGEFILTER_H + +#include "Core/StaticInterface.h" +#include "Core/Object.h" +#include "Math/Dense.h" + +#include "Math/VoxImage.h" + + +namespace uLib { + + +namespace Interface { +struct VoxImageFilterShape { + template void check_structural() { + uLibCheckFunction(Self,operator(),float,float); + uLibCheckFunction(Self,operator(),float,const Vector3f&); + } +}; +} + +template < typename VoxelT > class Kernel; + + +namespace Abstract { +class VoxImageFilter { +public: + virtual void Run() = 0; + + virtual void SetImage(Abstract::VoxImage *image) = 0; + +protected: + virtual ~VoxImageFilter() {} +}; +} + + +template < typename VoxelT, typename AlgorithmT > +class VoxImageFilter : public Abstract::VoxImageFilter, public Object +{ + +public: + VoxImageFilter(const Vector3i &size); + + void Run(); + + void SetKernelNumericXZY(const Vector &numeric); + + void SetKernelSpherical(float (*shape)(float)); + + template < class ShapeT > + void SetKernelSpherical( ShapeT shape ); + + void SetKernelWeightFunction(float (*shape)(const Vector3f &)); + + template < class ShapeT > + void SetKernelWeightFunction( ShapeT shape ); + + uLibGetMacro(KernelData,Kernel) + + uLibGetMacro(Image,VoxImage *) + + void SetImage(Abstract::VoxImage *image); + +protected: + + float Convolve(const VoxImage &buffer, int index); // remove // + + void SetKernelOffset(); + + float Distance2(const Vector3i &v); + + // protected members for algorithm access // + Kernel m_KernelData; + VoxImage *m_Image; + +private: + AlgorithmT *t_Algoritm; + +}; + + + + + + +} + + +#endif // VOXIMAGEFILTER_H + +#include "VoxImageFilter.hpp" + +#include "VoxImageFilterLinear.hpp" +#include "VoxImageFilterThreshold.hpp" +#include "VoxImageFilterMedian.hpp" +#include "VoxImageFilterABTrim.hpp" +#include "VoxImageFilterBilateral.hpp" +#include "VoxImageFilter2ndStat.hpp" +#include "VoxImageFilterCustom.hpp" + diff --git a/src/Math/VoxImageFilter.hpp b/src/Math/VoxImageFilter.hpp new file mode 100644 index 0000000..621c208 --- /dev/null +++ b/src/Math/VoxImageFilter.hpp @@ -0,0 +1,302 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VOXIMAGEFILTER_HPP +#define VOXIMAGEFILTER_HPP + +#include +#include "Math/StructuredData.h" +#include "Math/VoxImage.h" +#include "VoxImageFilter.h" + +namespace uLib { + + +// KERNEL ////////////////////////////////////////////////////////////////////// + +template < typename T > +class Kernel : public StructuredData { + typedef StructuredData BaseClass; +public: + Kernel(const Vector3i &size); + + inline T& operator[](const Vector3i &id) { return m_Data[Map(id)]; } + inline T& operator[](const int &id) { return m_Data[id]; } + inline int GetCenterData() const; + + uLibRefMacro(Data,Vector) + + inline const Vector& ConstData() const { return this->m_Data; } + + void PrintSelf(std::ostream &o) const; + +private: + Vector m_Data; +}; + +template < typename T > +Kernel::Kernel(const Vector3i &size) : + BaseClass(size), + m_Data(size.prod()) +{ + Interface::IsA(); +} + +template < typename T > +inline int Kernel::GetCenterData() const +{ + static int center = Map(this->GetDims() / 2); + return center; +} + +template < typename T > +void Kernel::PrintSelf(std::ostream &o) const +{ + o << " Filter Kernel Dump [XZ_Y]: \n"; + Vector3i index; + o << "\n Value: \n\n" + << "------------------------------------------------- \n"; + for (int y = 0 ; y < this->GetDims()(1); ++y ) { + o << "[y=" << y << "]\n"; + for (int z = 0 ; z < this->GetDims()(2); ++z ) { + for (int x = 0 ; x < this->GetDims()(0); ++x ) { + index << x,y,z; + o << m_Data[Map(index)].Value << " "; + } o << "\n"; + } o << " --------------------------------------------------- \n"; + } + o << "\n Offset: \n" + << "------------------------------------------------- \n"; + for (int y = 0 ; y < this->GetDims()(1); ++y ) { + o << "[y=" << y << "]\n"; + for (int z = 0 ; z < this->GetDims()(2); ++z ) { + for (int x = 0 ; x < this->GetDims()(0); ++x ) { + index << x,y,z; + o << m_Data[Map(index)].Count << " "; + } o << "\n"; + } o << " --------------------------------------------------- \n"; + } +} + +//////////////////////////////////////////////////////////////////////////////// + + + + + + + + +#define _TPL_ template < typename VoxelT , typename AlgorithmT > +#define _TPLT_ VoxelT,AlgorithmT + + + +_TPL_ +VoxImageFilter<_TPLT_>::VoxImageFilter(const Vector3i &size) : + m_KernelData(size), + t_Algoritm(static_cast(this)) +{ + +} + +_TPL_ +void VoxImageFilter<_TPLT_>::Run() +{ + VoxImage buffer = *m_Image; + #pragma omp parallel for + for(int i=0 ; i < m_Image->Data().size() ; ++i) + m_Image->operator [](i).Value = this->t_Algoritm->Evaluate(buffer,i); + #pragma omp barrier +} + +_TPL_ +void VoxImageFilter<_TPLT_>::SetKernelOffset() +{ + Vector3i id(0,0,0); + for( int z=0 ; z < m_KernelData.GetDims()(2); ++z ) { + for( int x=0 ; x < m_KernelData.GetDims()(0); ++x ) { + for( int y=0 ; y < m_KernelData.GetDims()(1); ++y ) { + id << x,y,z; + m_KernelData[id].Count = id.transpose() * m_Image->GetIncrements(); + } + } + } +} + +_TPL_ +float VoxImageFilter<_TPLT_>::Distance2(const Vector3i &v) +{ + Vector3i tmp = v; + const Vector3i &dim = this->m_KernelData.GetDims(); + Vector3i center = dim / 2; + tmp = tmp - center; + center = center.cwiseProduct(center); + tmp = tmp.cwiseProduct(tmp); + return (float)(tmp.sum()) / (float)( center.sum() + 0.25 * + (3 - (dim(0) % 2) - (dim(1) % 2) - (dim(2) % 2))); +} + + +_TPL_ +void VoxImageFilter<_TPLT_>::SetKernelNumericXZY(const Vector &numeric) +{ + // set data order // + StructuredData::Order order = m_KernelData.GetDataOrder(); + //m_KernelData.SetDataOrder(StructuredData::XZY); + Vector3i id; + int index = 0; + for( int y=0 ; y < m_KernelData.GetDims()(1); ++y ) { + for( int z=0 ; z < m_KernelData.GetDims()(2); ++z ) { + for( int x=0 ; x < m_KernelData.GetDims()(0); ++x ) { + id << x,y,z; + m_KernelData[id].Value = numeric[index++]; + } + } + } + //m_KernelData.SetDataOrder(order); +} + +_TPL_ +void VoxImageFilter<_TPLT_>::SetKernelSpherical(float(* shape)(float)) +{ + Vector3i id; + for( int y=0 ; y < m_KernelData.GetDims()(1); ++y ) { + for( int z=0 ; z < m_KernelData.GetDims()(2); ++z ) { + for( int x=0 ; x < m_KernelData.GetDims()(0); ++x ) { + id << x,y,z; + m_KernelData[id].Value = shape(this->Distance2(id)); + } + } + } +} + + +_TPL_ template +void VoxImageFilter<_TPLT_>::SetKernelSpherical(ShapeT shape) +{ + Interface::IsA(); + Vector3i id; + for( int y=0 ; y < m_KernelData.GetDims()(1); ++y ) { + for( int z=0 ; z < m_KernelData.GetDims()(2); ++z ) { + for( int x=0 ; x < m_KernelData.GetDims()(0); ++x ) { + id << x,y,z; + m_KernelData[id].Value = shape(this->Distance2(id)); + } + } + } +} + +_TPL_ +void VoxImageFilter<_TPLT_>::SetKernelWeightFunction(float (*shape)(const Vector3f &)) +{ + const Vector3i &dim = m_KernelData.GetDims(); + Vector3i id; + Vector3f pt; + for( int y=0 ; y < dim(1); ++y ) { + for( int z=0 ; z < dim(2); ++z ) { + for( int x=0 ; x < dim(0); ++x ) { + // get voxels centroid coords from kernel center // + id << x,y,z; + pt << id(0) - dim(0)/2 + 0.5 * !(dim(0) % 2), + id(1) - dim(1)/2 + 0.5 * !(dim(1) % 2), + id(2) - dim(2)/2 + 0.5 * !(dim(2) % 2); + // compute function using given shape // + m_KernelData[id].Value = shape(pt); + } + } + } +} + +_TPL_ template < class ShapeT > +void VoxImageFilter<_TPLT_>::SetKernelWeightFunction(ShapeT shape) +{ + Interface::IsA(); + const Vector3i &dim = m_KernelData.GetDims(); + Vector3i id; + Vector3f pt; + for( int y=0 ; y < dim(1); ++y ) { + for( int z=0 ; z < dim(2); ++z ) { + for( int x=0 ; x < dim(0); ++x ) { + // get voxels centroid coords from kernel center // + id << x,y,z; + pt << id(0) - dim(0)/2 + 0.5 * !(dim(0) % 2), + id(1) - dim(1)/2 + 0.5 * !(dim(1) % 2), + id(2) - dim(2)/2 + 0.5 * !(dim(2) % 2); + // compute function using given shape // + m_KernelData[id].Value = shape(pt); + } + } + } +} + + + + +_TPL_ +void VoxImageFilter<_TPLT_>::SetImage(Abstract::VoxImage *image) +{ + this->m_Image = reinterpret_cast *> (image); + this->SetKernelOffset(); +} + + +_TPL_ +float VoxImageFilter<_TPLT_>::Convolve(const VoxImage &buffer, int index) +{ + const Vector &vbuf = buffer.ConstData(); + const Vector &vker = m_KernelData.ConstData(); + int vox_size = vbuf.size(); + int ker_size = vker.size(); + int pos; + float conv = 0, ksum = 0; + for (int ik = 0; ik < ker_size; ++ik) { + pos = index + vker[ik].Count - vker[m_KernelData.GetCenterData()].Count; + pos = (pos + vox_size) % vox_size; + conv += vbuf[pos].Value * vker[ik].Value; + ksum += vker[ik].Value; + } + return conv / ksum; +} + + + +#undef _TPLT_ +#undef _TPL_ + + + + + + + +} + + + + +#endif // VOXIMAGEFILTER_HPP diff --git a/src/Math/VoxImageFilter2ndStat.hpp b/src/Math/VoxImageFilter2ndStat.hpp new file mode 100644 index 0000000..d85acc7 --- /dev/null +++ b/src/Math/VoxImageFilter2ndStat.hpp @@ -0,0 +1,83 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VOXIMAGEFILTER2NDSTAT_HPP +#define VOXIMAGEFILTER2NDSTAT_HPP + +#include +#include "Math/VoxImage.h" +#include "VoxImageFilter.h" + +//////////////////////////////////////////////////////////////////////////////// +///// VOXIMAGE FILTER ABTRIM ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace uLib { + +template +class VoxFilterAlgorithm2ndStat : + public VoxImageFilter > { + +public: + typedef VoxImageFilter > BaseClass; + VoxFilterAlgorithm2ndStat(const Vector3i &size) : + BaseClass(size) + { } + + float Evaluate(const VoxImage &buffer, int index) + { + const Vector &vbuf = buffer.ConstData(); + const Vector &vker = this->m_KernelData.ConstData(); + int vox_size = vbuf.size(); + int ker_size = vker.size(); + int pos; + + // mean // + float conv = 0, ksum = 0; + for (int ik = 0; ik < ker_size; ++ik) { + pos = index + vker[ik].Count - vker[this->m_KernelData.GetCenterData()].Count; + pos = (pos + vox_size) % vox_size; + conv += vbuf[pos].Value * vker[ik].Value; + ksum += vker[ik].Value; + } + float mean = conv / ksum; + + // rms // + conv = 0; + for (int ik = 0; ik < ker_size; ++ik) { + pos = index + vker[ik].Count - vker[this->m_KernelData.GetCenterData()].Count; + pos = (pos + vox_size) % vox_size; + conv += pow((vbuf[pos].Value * vker[ik].Value) - mean , 2); + } + return conv / (vker.size() - 1) ; + } + + +}; + +} +#endif // VOXIMAGEFILTER2NDSTAT_HPP diff --git a/src/Math/VoxImageFilterABTrim.hpp b/src/Math/VoxImageFilterABTrim.hpp new file mode 100644 index 0000000..0b1799c --- /dev/null +++ b/src/Math/VoxImageFilterABTrim.hpp @@ -0,0 +1,179 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VOXIMAGEFILTERABTRIM_HPP +#define VOXIMAGEFILTERABTRIM_HPP + +#include +#include "Math/VoxImage.h" +#include "VoxImageFilter.h" + +//////////////////////////////////////////////////////////////////////////////// +///// VOXIMAGE FILTER ABTRIM ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace uLib { + +template +class VoxFilterAlgorithmAbtrim : + public VoxImageFilter > { + + struct KernelSortAscending + { + bool operator()(const VoxelT& e1, const VoxelT& e2) + { return e1.Value < e2.Value; } + }; + +public: + typedef VoxImageFilter > BaseClass; + VoxFilterAlgorithmAbtrim(const Vector3i &size) : + BaseClass(size) + { + mAtrim = 0; + mBtrim = 0; + } + + float Evaluate(const VoxImage &buffer, int index) + { + const Vector &vbuf = buffer.ConstData(); + const Vector &vker = this->m_KernelData.ConstData(); + int vox_size = vbuf.size(); + int ker_size = vker.size(); + int pos; + + Vector mfh(ker_size); + for (int i = 0; i < ker_size; ++i) + mfh[i].Count = i; //index key for ordering function + for (int ik = 0; ik < ker_size; ik++) { + pos = index + vker[ik].Count - vker[this->m_KernelData.GetCenterData()].Count; + pos = (pos + vox_size) % vox_size; + mfh[ik].Value = vbuf[pos].Value; + } + + std::sort(mfh.begin(), mfh.end(), KernelSortAscending()); + float ker_sum = 0; + float fconv = 0; + for (int ik = 0; ik < mAtrim; ik++) + ker_sum += vker[ mfh[ik].Count ].Value; + for (int ik = mAtrim; ik < ker_size - mBtrim; ik++) { + fconv += mfh[ik].Value * vker[ mfh[ik].Count ].Value; // convloution // + ker_sum += vker[ mfh[ik].Count ].Value; + } + for (int ik = ker_size - mBtrim; ik < ker_size; ik++) + ker_sum += vker[ mfh[ik].Count ].Value; + + return fconv / ker_sum; + } + + inline void SetABTrim(int a, int b) { mAtrim = a; mBtrim = b; } + +private: + int mAtrim; + int mBtrim; +}; + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// Roberspierre Filter // + + + +template +class VoxFilterAlgorithmSPR : + public VoxImageFilter > { + + struct KernelSortAscending + { + bool operator()(const VoxelT& e1, const VoxelT& e2) + { return e1.Value < e2.Value; } + }; + +public: + typedef VoxImageFilter > BaseClass; + VoxFilterAlgorithmSPR(const Vector3i &size) : + BaseClass(size) + { + mAtrim = 0; + mBtrim = 0; + } + + float Evaluate(const VoxImage &buffer, int index) + { + const Vector &vbuf = buffer.ConstData(); + const Vector &vker = this->m_KernelData.ConstData(); + int vox_size = vbuf.size(); + int ker_size = vker.size(); + int pos; + + Vector mfh(ker_size); + for (int i = 0; i < ker_size; ++i) + mfh[i].Count = i; //index key for ordering function + for (int ik = 0; ik < ker_size; ik++) { + pos = index + vker[ik].Count - + vker[this->m_KernelData.GetCenterData()].Count; + pos = (pos + vox_size) % vox_size; + mfh[ik].Value = vbuf[pos].Value; + } + + std::sort(mfh.begin(), mfh.end(), KernelSortAscending()); + float spr = vbuf[index].Value; + if( (mAtrim > 0 && spr <= mfh[mAtrim-1].Value) || + (mBtrim > 0 && spr >= mfh[ker_size - mBtrim].Value) ) + { + float ker_sum = 0; + float fconv = 0; + for (int ik = 0; ik < mAtrim; ik++) + ker_sum += vker[ mfh[ik].Count ].Value; + for (int ik = mAtrim; ik < ker_size - mBtrim; ik++) { + fconv += mfh[ik].Value * vker[ mfh[ik].Count ].Value; + ker_sum += vker[ mfh[ik].Count ].Value; + } + for (int ik = ker_size - mBtrim; ik < ker_size; ik++) + ker_sum += vker[ mfh[ik].Count ].Value; + + return fconv / ker_sum; + } + else + return spr; + } + + inline void SetABTrim(int a, int b) { mAtrim = a; mBtrim = b; } + +private: + int mAtrim; + int mBtrim; +}; + + + + +} + +#endif // VOXIMAGEFILTERABTRIM_HPP diff --git a/src/Math/VoxImageFilterBilateral.hpp b/src/Math/VoxImageFilterBilateral.hpp new file mode 100644 index 0000000..ade0f6e --- /dev/null +++ b/src/Math/VoxImageFilterBilateral.hpp @@ -0,0 +1,152 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VOXIMAGEFILTERBILATERAL_HPP +#define VOXIMAGEFILTERBILATERAL_HPP + +#include +#include "Math/VoxImage.h" +#include "VoxImageFilter.h" + +//////////////////////////////////////////////////////////////////////////////// +///// VOXIMAGE FILTER LINEAR ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace uLib { + + +template +class VoxFilterAlgorithmBilateral : + public VoxImageFilter > { +public: + typedef VoxImageFilter > BaseClass; + VoxFilterAlgorithmBilateral(const Vector3i &size) : BaseClass(size) { + m_sigma = 1; + } + + float Evaluate(const VoxImage &buffer, int index) + { + const Vector &vbuf = buffer.ConstData(); + const Vector &vker = this->m_KernelData.ConstData(); + int vox_size = vbuf.size(); + int ker_size = vker.size(); + int pos; + float conv = 0, ksum = 0; + float gamma_smooth; + for (int ik = 0; ik < ker_size; ++ik) { + // if (ik==this->m_KernelData.GetCenterData()) continue; + pos = index + vker[ik].Count - vker[this->m_KernelData.GetCenterData()].Count; + pos = (pos + vox_size) % vox_size; + gamma_smooth = compute_gauss( fabs(vbuf[index].Value - vbuf[pos].Value) * 1.E6 ); + conv += vbuf[pos].Value * vker[ik].Value * gamma_smooth; + ksum += vker[ik].Value * gamma_smooth; + } + return conv / ksum; + } + + inline void SetIntensitySigma(const float s) { m_sigma = s; } + +private: + inline float compute_gauss(const float x) { + return 1/(sqrt(2*M_PI)* m_sigma) * exp(-0.5*(x*x)/(m_sigma*m_sigma)); + } + + Scalarf m_sigma; +}; + + +template +class VoxFilterAlgorithmBilateralTrim : + public VoxImageFilter > { + + typedef std::pair FPair; + + struct KernelSortAscending + { + bool operator()(const FPair& e1, const FPair& e2) + { return e1.second < e2.second; } + }; + +public: + typedef VoxImageFilter > BaseClass; + VoxFilterAlgorithmBilateralTrim(const Vector3i &size) : BaseClass(size) { + m_sigma = 1; + mAtrim = 0; + mBtrim = 0; + } + + float Evaluate(const VoxImage &buffer, int index) + { + const Vector &vbuf = buffer.ConstData(); + const Vector &vker = this->m_KernelData.ConstData(); + int img_size = vbuf.size(); + int ker_size = vker.size(); + int pos; + + + + Vector mfh(ker_size); + for (int i = 0; i < ker_size; ++i) + mfh[i].first = vker[i].Value; // kernel value in first + for (int ik = 0; ik < ker_size; ik++) { + pos = index + vker[ik].Count - vker[this->m_KernelData.GetCenterData()].Count; + pos = (pos + img_size) % img_size; + mfh[ik].second = vbuf[pos].Value; // image value in second + } + std::sort(mfh.begin(), mfh.end(), KernelSortAscending()); + + float conv = 0, ksum = 0; + float gamma_smooth; + // for (int ik = 0; ik < mAtrim; ik++) + // ksum += mfh[ik].first; + for (int ik = mAtrim; ik < ker_size - mBtrim; ik++) { + gamma_smooth = compute_gauss( fabs(vbuf[index].Value - mfh[ik].second) * 1.E6 ); + conv += mfh[ik].first * mfh[ik].second * gamma_smooth; + ksum += mfh[ik].first * gamma_smooth; + } + // for (int ik = ker_size - mBtrim; ik < ker_size; ik++) + // ksum += mfh[ik].first; + + return conv / ksum; + } + + inline void SetIntensitySigma(const float s) { m_sigma = s; } + inline void SetABTrim(int a, int b) { mAtrim = a; mBtrim = b; } + +private: + inline float compute_gauss(const float x) { + return 1/(sqrt(2*M_PI)* m_sigma) * exp(-0.5*(x*x)/(m_sigma*m_sigma)); + } + + Scalarf m_sigma; + int mAtrim; + int mBtrim; +}; + +} + +#endif // VOXIMAGEFILTERBILATERAL_HPP diff --git a/src/Math/VoxImageFilterCustom.hpp b/src/Math/VoxImageFilterCustom.hpp new file mode 100644 index 0000000..831dbec --- /dev/null +++ b/src/Math/VoxImageFilterCustom.hpp @@ -0,0 +1,88 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VOXIMAGEFILTERCUSTOM_HPP +#define VOXIMAGEFILTERCUSTOM_HPP + +#include +#include "Math/VoxImage.h" +#include "VoxImageFilter.h" + +//////////////////////////////////////////////////////////////////////////////// +///// VOXIMAGE FILTER CUSTOM ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace uLib { + +template +class VoxFilterAlgorithmCustom : + public VoxImageFilter > { + + + typedef float (* FunctionPt)(const Vector &); +public: + typedef VoxImageFilter > BaseClass; + VoxFilterAlgorithmCustom(const Vector3i &size) : + BaseClass(size), m_CustomEvaluate(NULL) + {} + + float Evaluate(const VoxImage &buffer, int index) + { + if(likely(m_CustomEvaluate)) { + const Vector &vbuf = buffer.ConstData(); + const Vector &vker = this->m_KernelData.ConstData(); + int vox_size = vbuf.size(); + int ker_size = vker.size(); + int pos; + + float ker_sum = 0; + Vector mfh(ker_size); + for (int ik = 0; ik < ker_size; ik++) { + pos = index + vker[ik].Count - vker[this->m_KernelData.GetCenterData()].Count; + pos = (pos + vox_size) % vox_size; + mfh[ik] = vbuf[pos].Value * vker[ik].Value; + ker_sum += vker[ik].Value; + } + + return this->m_CustomEvaluate(mfh); + } + else + std::cerr << "Custom evaluate function is NULL \n" << + "No operation performed by filter.\n"; + + } + + uLibSetMacro(CustomEvaluate,FunctionPt) + +private: + FunctionPt m_CustomEvaluate; +}; + +} + + +#endif // VOXIMAGEFILTERCUSTOM_HPP diff --git a/src/Math/VoxImageFilterLinear.hpp b/src/Math/VoxImageFilterLinear.hpp new file mode 100644 index 0000000..14b9112 --- /dev/null +++ b/src/Math/VoxImageFilterLinear.hpp @@ -0,0 +1,69 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VOXIMAGEFILTERLINEAR_HPP +#define VOXIMAGEFILTERLINEAR_HPP + +#include +#include "Math/VoxImage.h" +#include "VoxImageFilter.h" + +//////////////////////////////////////////////////////////////////////////////// +///// VOXIMAGE FILTER LINEAR ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace uLib { + + +template +class VoxFilterAlgorithmLinear : + public VoxImageFilter > { +public: + typedef VoxImageFilter > BaseClass; + VoxFilterAlgorithmLinear(const Vector3i &size) : BaseClass(size) {} + + float Evaluate(const VoxImage &buffer, int index) + { + const Vector &vbuf = buffer.ConstData(); + const Vector &vker = this->m_KernelData.ConstData(); + int vox_size = vbuf.size(); + int ker_size = vker.size(); + int pos; + float conv = 0, ksum = 0; + for (int ik = 0; ik < ker_size; ++ik) { + pos = index + vker[ik].Count - vker[this->m_KernelData.GetCenterData()].Count; + pos = (pos + vox_size) % vox_size; + conv += vbuf[pos].Value * vker[ik].Value; + ksum += vker[ik].Value; + } + return conv / ksum; + } +}; + +} + +#endif // VOXIMAGEFILTERLINEAR_HPP diff --git a/src/Math/VoxImageFilterMedian.hpp b/src/Math/VoxImageFilterMedian.hpp new file mode 100644 index 0000000..e4f88c4 --- /dev/null +++ b/src/Math/VoxImageFilterMedian.hpp @@ -0,0 +1,75 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VOXIMAGEFILTERMEDIAN_HPP +#define VOXIMAGEFILTERMEDIAN_HPP + +#include +#include "Math/VoxImage.h" +#include "VoxImageFilter.h" + +//////////////////////////////////////////////////////////////////////////////// +///// VOXIMAGE FILTER MEDIAN ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace uLib { + +template +class VoxFilterAlgorithmMedian : + public VoxImageFilter > { +public: + typedef VoxImageFilter > BaseClass; + VoxFilterAlgorithmMedian(const Vector3i &size) : BaseClass(size) {} + + float Evaluate(const VoxImage &buffer, int index) + { + const Vector &vbuf = buffer.ConstData(); + const Vector &vker = this->m_KernelData.ConstData(); + int vox_size = vbuf.size(); + int ker_size = vker.size(); + int pos; + + Vector mfh(ker_size); + for (int ik = 0; ik < ker_size; ik++) { + pos = index + vker[ik].Count - vker[this->m_KernelData.GetCenterData()].Count; + pos = (pos + vox_size) % vox_size; + mfh[ik] = vbuf[pos].Value * vker[ik].Value; + } + std::sort(mfh.begin(), mfh.end()); + pos = 0; + // count zeroes in filter kernel to move it out of median // + for (int i = 0; i < ker_size; ++i) + if (vker[i].Value == 0.0) pos++; + // median // + pos += (ker_size - pos) / 2; + return mfh[pos]; + } +}; + +} + +#endif // VOXIMAGEFILTERMEDIAN_HPP diff --git a/src/Math/VoxImageFilterThreshold.hpp b/src/Math/VoxImageFilterThreshold.hpp new file mode 100644 index 0000000..e125763 --- /dev/null +++ b/src/Math/VoxImageFilterThreshold.hpp @@ -0,0 +1,78 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VOXIMAGEFILTERTHRESHOLD_HPP +#define VOXIMAGEFILTERTHRESHOLD_HPP + +#include +#include "Math/VoxImage.h" +#include "VoxImageFilter.h" + +//////////////////////////////////////////////////////////////////////////////// +///// VOXIMAGE FILTER THRESHOLD ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +namespace uLib { + +template +class VoxFilterAlgorithmThreshold : + public VoxImageFilter > { + + typedef VoxImageFilter > BaseClass; + // ULIB_OBJECT_PARAMETERS(BaseClass) { + // float threshold; + // }; + + float m_threshold; + +public: + VoxFilterAlgorithmThreshold(const Vector3i &size) : BaseClass(size) + { + // init_parameters(); + m_threshold = 0; + } + + inline void SetThreshold(float th) { m_threshold = th; } + + float Evaluate(const VoxImage &buffer, int index) + { + return static_cast(buffer.ConstData().at(index).Value >= + // parameters().threshold); + m_threshold ); + } + +}; + +//template +//inline void VoxFilterAlgorithmThreshold::init_parameters() +//{ +// parameters().threshold = 0; +//} + +} + +#endif // VOXIMAGEFILTERTHRESHOLD_HPP diff --git a/src/Math/VoxImageFilterUser.cpp b/src/Math/VoxImageFilterUser.cpp new file mode 100644 index 0000000..d82fe21 --- /dev/null +++ b/src/Math/VoxImageFilterUser.cpp @@ -0,0 +1,35 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Core/Vector.h" +#include "Dense.h" +#include "VoxImage.h" +#include "VoxImageFilterUser.h" + +using namespace uLib; + diff --git a/src/Math/VoxRaytracer.cpp b/src/Math/VoxRaytracer.cpp new file mode 100644 index 0000000..01094b3 --- /dev/null +++ b/src/Math/VoxRaytracer.cpp @@ -0,0 +1,202 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "VoxRaytracer.h" +#include "Utils.h" + +inline float fast_sign(float f) { return 1 - 2 * (f < 0); } + +namespace uLib { + +//////////////////////////////////////////////////////////////////////////////// +///// RAY DATA ///////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +void VoxRaytracer::RayData::AddElement(Id_t id, float L) +{ + Element el = {id, L}; + m_Data.push_back(el); + m_TotalLength += L; +} + + +void VoxRaytracer::RayData::AppendRay(const VoxRaytracer::RayData &in) +{ + if (unlikely(!in.m_Data.size())) { + std::cout << "Warinig: PoCA on exit border!\n"; + return; + } + else if (unlikely(!m_Data.size())) { + m_Data = in.m_Data; + std::cout << "Warinig: PoCA on entrance border!\n"; + return; + } + else { + // Opzione 1) un voxel in piu' // + m_Data.reserve(m_Data.size() + in.m_Data.size()); + m_Data.insert(m_Data.end(), in.m_Data.begin(), in.m_Data.end()); + // Opzione 2) merge dei voxel nel poca. + // RayData::Element &e1 = m_Data.back(); + // const RayData::Element &e2 = in.m_Data.front(); + // if(e1.vox_id == e2.vox_id) + // { + // m_Data.reserve(m_Data.size() + in.m_Data.size() - 1); + // e1.L += e2.L; //fix// + // m_Data.insert(m_Data.end(), in.m_Data.begin()+1, in.m_Data.end()); + // } + // else { + // m_Data.reserve(m_Data.size() + in.m_Data.size()); + // m_Data.insert(m_Data.end(), in.m_Data.begin(), in.m_Data.end()); + // } + m_TotalLength += in.m_TotalLength; + } +} + +void VoxRaytracer::RayData::PrintSelf(std::ostream &o) +{ + o << "Ray: \n"; + Vector::Iterator it; + for(it = m_Data.begin(); it < m_Data.end(); ++it) + o << "[ " << (*it).vox_id << ", " << (*it).L << "] \n"; +} + + +//////////////////////////////////////////////////////////////////////////////// +//// RAY TRACER //////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +bool VoxRaytracer::GetEntryPoint(const HLine3f line, Vector4f &pt) +{ + Vector4f s = m_Image->GetLocalPoint(line.direction()); + pt = m_Image->GetLocalPoint(line.origin()); + + // Considers Structured grid dimensions // + Vector4f dims = m_Image->GetDims().homogeneous().cast(); + pt = pt.cwiseQuotient(dims); + s = s.cwiseQuotient(dims); + + float l = s.head(3).norm(); + Vector3f L(l/s(0), l/s(1), l/s(2)); + + Vector3f offset; + for(int i=0;i<3;++i) + offset(i) = (s(i)>0) - (pt(i)-floor(pt(i))) ; + offset = offset.cwiseProduct(L).cwiseAbs(); + + int id; float d; + for(int loop=0; loop<8; loop++) + { + int check_border = 0; + for ( int i=0; i<3 ;++i) { + check_border += pt(i) > 1; + check_border += pt(i) < 0; + } + if(check_border == 0) { + for(int i=0;i<3;++i) + pt(i) *= (float)dims(i); + pt = m_Image->GetWorldPoint(pt); + return true; + } + + d = offset.minCoeff(&id); + for(int i=0; i<3; ++i) + pt(i) += d / L(i); + + pt(id) = rintf(pt(id)); + + + offset.array() -= d; + offset(id) = fabs(L(id)); + } + for(int i=0;i<3;++i) + pt(i) *= (float)dims(i); + pt = m_Image->GetWorldPoint(pt); + return false; +} + +bool VoxRaytracer::GetExitPoint(const HLine3f line, Vector4f &pt) +{ + HLine3f out = line; + out.direction() *= -1; + return GetEntryPoint(out,pt); +} + + +VoxRaytracer::RayData VoxRaytracer::TraceBetweenPoints(const Vector4f &in, + const Vector4f &out) +const +{ + RayData ray; + Vector4f pt1 = m_Image->GetLocalPoint(in); + Vector4f pt2 = m_Image->GetLocalPoint(out); + Vector4f s = pt2 - pt1; + + + + Vector3f scale; // FIXXX + scale << (m_Image->GetWorldMatrix() * Vector4f(1,0,0,0)).norm(), + (m_Image->GetWorldMatrix() * Vector4f(0,1,0,0)).norm(), + (m_Image->GetWorldMatrix() * Vector4f(0,0,1,0)).norm(); + + float l = s.head(3).norm(); + Vector3f L(l/s(0), l/s(1), l/s(2)); + + Vector3f offset; + for(int i=0;i<3;++i) + offset(i) = (s(i)>=0) - (pt1(i)-floor(pt1(i))) ; + + offset = offset.cwiseProduct(L).cwiseAbs(); + L = L.cwiseAbs(); + + int id; float d; + Vector3i vid = m_Image->Find(in); + while(l>0) + { + d = offset.minCoeff(&id); + + if(m_Image->IsInsideGrid(vid)) + ray.AddElement(m_Image->Map(vid), d * scale(id) ); + + // nan check // + // if(unlikely(!isFinite(d * scale(id)))) { + // std:: cout << "NAN in raytracer\n"; + // exit(1); + // } + + vid(id) += (int)fast_sign(s(id)); + + l -= d; + offset.array() -= d; + offset(id) = fmin(L(id),l); + } + return ray; +} + + +} diff --git a/src/Math/VoxRaytracer.h b/src/Math/VoxRaytracer.h new file mode 100644 index 0000000..02b69a1 --- /dev/null +++ b/src/Math/VoxRaytracer.h @@ -0,0 +1,86 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VOXRAYTRACER_H +#define VOXRAYTRACER_H + +#include + +#include "Core/Vector.h" +#include "Math/ImageData.h" +#include "Math/Line.h" +#include "Math/VectorSpace.h" + +namespace uLib { + +class VoxRaytracer { + +public: + class RayData { + public: + RayData() : m_TotalLength(0) {} + + typedef struct { + Id_t vox_id; + Scalarf L; + } Element; + + inline void AddElement(Id_t id, float L); + + void AppendRay ( const RayData &in); + + uLibConstRefMacro(Data,Vector) + uLibConstRefMacro(TotalLength,Scalarf) + + void PrintSelf(std::ostream &o); + + private: + Vector m_Data; + Scalarf m_TotalLength; + }; + + +public: + VoxRaytracer(ImageData &image) : m_Image(&image) {} + + bool GetEntryPoint(const HLine3f line, Vector4f &pt); + + bool GetExitPoint(const HLine3f line, Vector4f &pt); + + RayData TraceBetweenPoints(const Vector4f &in, const Vector4f &out) const; + + uLibGetMacro(Image,ImageData *) + +private: + ImageData *m_Image; +}; + +} + + + +#endif // VOXRAYTRACER_H diff --git a/src/Math/testing/AccumulatorTest.cpp b/src/Math/testing/AccumulatorTest.cpp new file mode 100644 index 0000000..211f334 --- /dev/null +++ b/src/Math/testing/AccumulatorTest.cpp @@ -0,0 +1,108 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Math/Accumulator.h" +#include "testing-prototype.h" + +#include + + +//#include +//#include +//#include + +using namespace uLib; + +int test_ABTrim() { + + Accumulator_ABTrim acc; + + acc.SetABTrim(1,1); + + Vector v; + v << 1,5,5,5,300; + + for(Vector::Iterator itr=v.begin(); itr mean; + TRandom rnd; + const int c = 10000000; + Vector v; + v.reserve(c); + for(int i=0;i +#include + +using namespace uLib; + +int main() { + BEGIN_TESTING(BitCode Test); + + BitCode bc; + + bc.PrintSelf(); + + END_TESTING; +} diff --git a/src/Math/testing/CMakeLists.txt b/src/Math/testing/CMakeLists.txt new file mode 100644 index 0000000..278c133 --- /dev/null +++ b/src/Math/testing/CMakeLists.txt @@ -0,0 +1,19 @@ + +set(TESTS + MathVectorTest + GeometryTest + ContainerBoxTest + VoxImageTest + VoxRaytracerTest + StructuredDataTest + StructuredGridTest + VoxImageFilterTest + PolicyTest + AccumulatorTest + VoxImageCopyTest + TriangleMeshTest + BitCodeTest +) + + +uLib_add_tests(${uLib-module}) diff --git a/src/Math/testing/ContainerBoxTest.cpp b/src/Math/testing/ContainerBoxTest.cpp new file mode 100644 index 0000000..c85be26 --- /dev/null +++ b/src/Math/testing/ContainerBoxTest.cpp @@ -0,0 +1,95 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "testing-prototype.h" + +#include "Math/Dense.h" +#include "Math/VectorSpace.h" +#include "Math/ContainerBox.h" + +#include +#include + + +using namespace uLib; + +int Vector4f0(Vector4f c) +{ + c(3) = 0; + if ( fabs(c(0)) < 0.001 && fabs(c(1)) < 0.001 && fabs(c(2)) < 0.001 ) + return 0; + else + return 1; +} + + +int main() +{ + + BEGIN_TESTING(Math ContainerBox); + + ContainerBox Cnt; + +// // Local transform: + Cnt.SetOrigin(Vector3f(-1,-1,-1)); + Cnt.SetSize(Vector3f(2,2,2)); // scaling // + std::cout << "Container scale is: " << Cnt.GetSize().transpose() << "\n"; + std::cout << "Container scale is: " << Cnt.GetSize().transpose() << "\n"; + TEST0( Vector4f0(Cnt.GetSize().homogeneous() - HVector3f(2,2,2)) ); + + + ContainerBox Box; + + Box.SetPosition(Vector3f(1,1,1)); + Box.SetSize(Vector3f(2,2,2)); + Box.EulerYZYRotate(Vector3f(0,0,0)); + Vector4f pt = Box.GetLocalPoint(HPoint3f(2,3,2)); + Vector4f wp = Box.GetWorldPoint(pt); + TEST0( Vector4f0(wp - HPoint3f(2,3,2)) ); + + +//// // Global +// Cnt.SetPosition(Vector3f(1,1,1)); +// Cnt.EulerYZYRotate(Vector3f(M_PI_2,M_PI_2,0)); +// HPoint3f p = Cnt.GetWorldPoint(1,1,1); +// //std::cout << p.transpose() << "\n"; +// TEST0( Vector4f0(p - HVector3f(2,1,2)) ); +// p = Cnt.GetWorldPoint(1,2,3); +// //std::cout << p.transpose() << "\n"; +// TEST0( Vector4f0(p - HVector3f(4,1,3)) ); + + +// // scaling // + + + + _fail > 0 ? std::cout << "FAIL\n" : std::cout << "OK!\n"; + END_TESTING; +} + + diff --git a/src/Math/testing/GeometryTest.cpp b/src/Math/testing/GeometryTest.cpp new file mode 100644 index 0000000..3930f08 --- /dev/null +++ b/src/Math/testing/GeometryTest.cpp @@ -0,0 +1,99 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "testing-prototype.h" +#include "Math/Dense.h" +#include "Math/VectorSpace.h" +#include "Math/Geometry.h" +#include "Math/ContainerBox.h" + +#include +#include + +using namespace uLib; + +int Vector4f0(Vector4f c) +{ + c(3) = 0; + if ( fabs(c(0)) < 0.001 && fabs(c(1)) < 0.001 && fabs(c(2)) < 0.001 ) + return 0; + else + return 1; +} + + +int main() +{ + BEGIN_TESTING(Math Geometry); + + ////////////////////////////////////////////////////////////////////////////// + ///////////////// GEOMETRY TESTING /////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + Geometry Geo; + + Geo.SetPosition(Vector3f(1,1,1)); + Geo.EulerYZYRotate(Vector3f(0,0,0)); + Vector4f pt = Geo.GetLocalPoint(HPoint3f(2,3,2)); + Vector4f wp = Geo.GetWorldPoint(pt); + TEST0( Vector4f0(wp - HPoint3f(2,3,2)) ); + + Geo.Scale(Vector3f(2,2,2)); + wp = Geo.GetWorldPoint(HPoint3f(1,1,1)); + TEST0( Vector4f0(wp - HPoint3f(3,3,3)) ); + Geo.Scale(Vector3f( .5 , .5 , .5 )); + + + Geo.EulerYZYRotate(Vector3f(M_PI_2,0,0)); + wp = Geo.GetWorldPoint(HPoint3f(1,1,1)); + TEST0( Vector4f0(wp - HPoint3f(2,2,0)) ); + + Geo.EulerYZYRotate(Vector3f(0,M_PI_2,0)); + wp = Geo.GetWorldPoint(HPoint3f(1,1,1)); + TEST0( Vector4f0(wp - HPoint3f(2,2,2)) ); + + Geo.EulerYZYRotate(Vector3f(0,0,M_PI_2)); + wp = Geo.GetWorldPoint(HPoint3f(1,1,1)); + // std::cout << "Geometry matrix\n" << Geo.GetTransform() << "\n"; + // std::cout << "World 1,1,1 coords\n" << wp << "\n"; + TEST0( Vector4f0(wp - HPoint3f(0,2,2)) ); + + // TESTING FLIP AXES // + + Geo.SetPosition(Vector3f(0,0,0)); + Geo.EulerYZYRotate(Vector3f(-M_PI_2,-M_PI_2,-M_PI_2)); // reset previous + Geo.EulerYZYRotate(Vector3f(M_PI_2,0,0)); // PI_2 along X + Geo.FlipAxes(0,2); // flip X-Z + Vector4f p = Geo.GetWorldPoint(Vector3f(1,0,0).homogeneous()); + TEST0( Vector4f0(p - HVector3f(1,0,0)) ); // after flip and rotation X->X + + + _fail > 0 ? std::cout << "FAIL\n" : std::cout << "OK!\n"; + END_TESTING; +} + + diff --git a/src/Math/testing/Makefile.am b/src/Math/testing/Makefile.am new file mode 100644 index 0000000..22ea4f1 --- /dev/null +++ b/src/Math/testing/Makefile.am @@ -0,0 +1,28 @@ + +include $(top_srcdir)/Common.am + +#AM_DEFAULT_SOURCE_EXT = .cpp + +# if HAVE_CHECK +TESTS = MathVectorTest \ + GeometryTest \ + ContainerBoxTest \ + VoxImageTest \ + VoxRaytracerTest \ + StructuredDataTest \ + VoxImageFilterTest \ + PolicyTest \ + AccumulatorTest \ + VoxImageCopyTest \ + TriangleMeshTest + +# else +# TEST = +# endif + +LDADD = $(top_srcdir)/libmutom-${PACKAGE_VERSION}.la $(AM_LIBS_ALL) + +all: ${TESTS} + +check_PROGRAMS = $(TESTS) + diff --git a/src/Math/testing/MathVectorTest.cpp b/src/Math/testing/MathVectorTest.cpp new file mode 100644 index 0000000..be74913 --- /dev/null +++ b/src/Math/testing/MathVectorTest.cpp @@ -0,0 +1,120 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "testing-prototype.h" +#include "Math/Dense.h" +#include "Math/VectorSpace.h" + +#include "Core/Archives.h" +#include "Core/String.h" + +#include +#include + + + +using namespace uLib; + +int Vector4f0(Vector4f c) +{ + c(3) = 0; + if ( fabs(c(0)) < 0.001 && fabs(c(1)) < 0.001 && fabs(c(2)) < 0.001 ) + return 0; + else + return 1; +} + + + + +int main() +{ + BEGIN_TESTING(uLib Math); + + ////////////////////////////////////////////////////////////////////////////// + ///////////////// VECTOR TESTING ///////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + std::cout << "Testing Vectors\n"; + + { // ROW COLUMN ACCESSOR ORDER TEST // + Matrix2i test; + test << 1,2,3,4; + std::cout << "print row column test "; + std::cout << test(0,0) << " " << + test(0,1) << " " << + test(1,0) << " " << + test(1,1) << " " << "\n"; + + TEST1( test(0,1) == 2 && test(1,0) == 3 ); + } + + + { + Vector3i test(0,0,0); + ++test(1); + std::cout << "increment of single dim inside vector: " << test.transpose() << "\n"; + TEST1( test == Vector3i(0,1,0) ); + } + + { + Matrix4f mat; + mat << 1,0,0,0, + 0,1,0,0, + 0,0,1,0, + 0,0,0,1; + + std::cout << "determinant" << mat.determinant() << "\n"; + } + + + { + // Vector3f v(1,2,3); + // std::string str("2 3 5"); + // std::istringstream istr(str); + // uLib::Archive::hrt_iarchive hi(istr); + // hi >> v; + // uLib::Archive::hrt_oarchive ho(std::cout); + // ho << v; + } + + { + // VECTOR STRING INTERACTION // + Vector3f v; + std::string str("2 3 5"); + str >> v; + std::string sstr; + sstr << v << "\n"; + std::cout << sstr; + } + + + END_TESTING; +} + + diff --git a/src/Math/testing/PolicyTest.cpp b/src/Math/testing/PolicyTest.cpp new file mode 100644 index 0000000..dbe2685 --- /dev/null +++ b/src/Math/testing/PolicyTest.cpp @@ -0,0 +1,78 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include +#include "testing-prototype.h" + + + +// Curiously Recurring Template Pattern // + + +template < typename V, typename T > +class Base { +public: + Base(int a) : value(a) { + Algorithm = static_cast(this); + } + + void Print() + { + std::cout << Algorithm->Value() << "\n"; + } + + int value; + V voxel; + T* Algorithm; +}; + + +template < typename V > +class Derived : public Base< V ,Derived > { + typedef Base< V ,Derived > BaseClass; +public: + Derived(int a) : BaseClass(a) {} + int Value() { return this->value+1; } +}; + + + + + +int main() +{ + BEGIN_TESTING(Policy); + + + Derived my(5); + my.Print(); + + Base > my2(5); + my2.Print(); + + END_TESTING; +} diff --git a/src/Math/testing/StructuredDataTest.cpp b/src/Math/testing/StructuredDataTest.cpp new file mode 100644 index 0000000..f186405 --- /dev/null +++ b/src/Math/testing/StructuredDataTest.cpp @@ -0,0 +1,129 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + +#include + +#include "testing-prototype.h" + +#include "Math/Dense.h" +#include "Math/ContainerBox.h" +#include "Math/StructuredData.h" +#include "Math/DataSet.h" + +#include + +using namespace uLib; + + +struct Data { + Data() : d1(123), d2(234), i3(345) {} + float d1,d2; + int i3; + float D2() { return d2; } + float operator()() { return d2; } +}; + + + +int main() { + BEGIN_TESTING(Structured Data); + + Data data; + + VectorData vd; + vd.push_back(data); + vd.push_back(Data()); + vd.push_back(Data()); + + vd.SetScalar(sizeof(float)); + std::cout << vd.Value(2) << "\n"; + + vd.SetScalar(offsetof(Data,i3)); + std::cout << vd.Value(2) << "\n"; + +// vd.SetBindScalar(&data,&Data::D2); +// std::cout << vd.BindValue(2) << "\n"; + + + END_TESTING; +} + + + +int main2() { + BEGIN_TESTING(Structured Data); + + { // testing unmap function //////////////////////////////////////////////// + StructuredData sdata(Vector3i(2,3,4)); + for(int i=0; i < sdata.GetDims().prod() ; ++i) { + Vector3i d = sdata.UnMap(i); + std::cout << "TEST1( sdata.UnMap(" << i << ") == Vector3i(" + << d(0) << "," << d(1) << "," << d(2) << ")); \n"; + } + TEST1( sdata.UnMap(0) == Vector3i(0,0,0)); + TEST1( sdata.UnMap(1) == Vector3i(0,1,0)); + TEST1( sdata.UnMap(2) == Vector3i(0,2,0)); + TEST1( sdata.UnMap(3) == Vector3i(1,0,0)); + TEST1( sdata.UnMap(4) == Vector3i(1,1,0)); + TEST1( sdata.UnMap(5) == Vector3i(1,2,0)); + TEST1( sdata.UnMap(6) == Vector3i(0,0,1)); + TEST1( sdata.UnMap(7) == Vector3i(0,1,1)); + TEST1( sdata.UnMap(8) == Vector3i(0,2,1)); + TEST1( sdata.UnMap(9) == Vector3i(1,0,1)); + TEST1( sdata.UnMap(10) == Vector3i(1,1,1)); + TEST1( sdata.UnMap(11) == Vector3i(1,2,1)); + TEST1( sdata.UnMap(12) == Vector3i(0,0,2)); + TEST1( sdata.UnMap(13) == Vector3i(0,1,2)); + TEST1( sdata.UnMap(14) == Vector3i(0,2,2)); + TEST1( sdata.UnMap(15) == Vector3i(1,0,2)); + TEST1( sdata.UnMap(16) == Vector3i(1,1,2)); + TEST1( sdata.UnMap(17) == Vector3i(1,2,2)); + TEST1( sdata.UnMap(18) == Vector3i(0,0,3)); + TEST1( sdata.UnMap(19) == Vector3i(0,1,3)); + TEST1( sdata.UnMap(20) == Vector3i(0,2,3)); + TEST1( sdata.UnMap(21) == Vector3i(1,0,3)); + TEST1( sdata.UnMap(22) == Vector3i(1,1,3)); + TEST1( sdata.UnMap(23) == Vector3i(1,2,3)); + + + // testing map ///////////////////////////////////////////////////////// + int i=0; + // PREDEFINED ORDER IS YXZ // + for(int z=0; z + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include "testing-prototype.h" + +using namespace uLib; + +int main() +{ + BEGIN_TESTING(Math Structured Grid); + + VoxImage f_grid(Vector3i(100,100,100)); + + f_grid[Vector3i(1,2,3)]() = 5552368; + TEST1( f_grid.At(30102)() == 5552368 ); + + + // TESTING MAP // + VoxImage test_order(Vector3i(2,2,2)); + int index =0; + for(int z=0;z<2;++z) + for(int y=0;y<2;++y) + for(int x=0;x<2;x++) + { + test_order[Vector3i(x,y,z)]() = index; + std::cout << x << " " << y << " " << z << " -> " << + test_order.At(Vector3i(x,y,z))() << "\n"; + index++; + } + test_order.Data().PrintSelf(std::cout); + + int result[8] = {0,2,1,3,4,6,5,7}; + for(int i=0;i<8;++i) + TEST1( test_order.At(i)() == result[i] ); + + // TESTING UNMAP // + std::cout << "unmap = " << test_order.UnMap(7).transpose() << "\n"; + TEST1( test_order.UnMap(7) == Vector3i(1,1,1) ); + TEST1( test_order.UnMap(6) == Vector3i(1,0,1) ); + TEST1( test_order.UnMap(5) == Vector3i(0,1,1) ); + // ... + + + _fail > 0 ? std::cout << "FaIL\n" : std::cout << "OK!\n"; + END_TESTING +} diff --git a/src/Math/testing/TriangleMeshTest.cpp b/src/Math/testing/TriangleMeshTest.cpp new file mode 100644 index 0000000..bd89a03 --- /dev/null +++ b/src/Math/testing/TriangleMeshTest.cpp @@ -0,0 +1,52 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "testing-prototype.h" + +#include "Math/TriangleMesh.h" + + +using namespace uLib; + +int main() +{ + BEGIN_TESTING(Triangle Mesh); + + TriangleMesh mesh; + + mesh.AddPoint(Vector3f(0,0,0)); + mesh.AddPoint(Vector3f(0,1,0)); + mesh.AddPoint(Vector3f(1,0,0)); + + mesh.AddTriangle(Vector3i(0,1,2)); + + + mesh.PrintSelf(std::cout); + + END_TESTING; +} diff --git a/src/Math/testing/VoxImageCopyTest.cpp b/src/Math/testing/VoxImageCopyTest.cpp new file mode 100644 index 0000000..b4de751 --- /dev/null +++ b/src/Math/testing/VoxImageCopyTest.cpp @@ -0,0 +1,77 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "testing-prototype.h" + +#include "Math/VoxImage.h" + +using namespace uLib; + + +struct TestVoxel { + Scalarf Value; + unsigned int Count; +}; + +int main() { + BEGIN_TESTING(Math VoxImage Copy); + + { + VoxImage img(Vector3i(10,10,10)); + TestVoxel zero = {0,0}; + img.InitVoxels(zero); + TestVoxel nonzero = {5.552368, 0}; + img[Vector3i(5,1,7)] = nonzero; + img[img.Find(HPoint3f(3,3,3))].Value = 5.552369; + TEST1( img.GetValue(Vector3i(5,1,7)) == 5.552368f ); + + + img.SetOrigin(Vector3f(4,5,6)); + + std::cout << "\n"; + + img.PrintSelf(std::cout); + + VoxImage img2 = img; + img2.PrintSelf(std::cout); + + TEST1( img.GetOrigin() == img2.GetOrigin() ); + TEST1( img.GetSpacing() == img2.GetSpacing() ); + + img2 = img; + + } + + + + + + + + std::cout << "returns " << _fail << "\n"; + END_TESTING; +} diff --git a/src/Math/testing/VoxImageFilterTest.cpp b/src/Math/testing/VoxImageFilterTest.cpp new file mode 100644 index 0000000..2e4f312 --- /dev/null +++ b/src/Math/testing/VoxImageFilterTest.cpp @@ -0,0 +1,150 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "testing-prototype.h" +#include "Math/ImageData.h" + +#include "Math/VoxImage.h" +#include "Math/VoxImageFilter.h" + + + +using namespace uLib; + +struct TestVoxel { + Scalarf Value; + unsigned int Count; +}; + +float GaussianShape(float d) +{ + // normalized manually .. fix // + return 4.5 * exp(-d * 4.5); +} + + +class GaussianShapeClass : public Interface::VoxImageFilterShape { +public: + GaussianShapeClass(float sigma) : + m_sigma(sigma) + {} + + float operator ()(float d) { + return (1/m_sigma) * exp(-d/m_sigma); + } + +private: + float m_sigma; +}; + + +static float MaxInVector(const Vector &v) +{ + float max = 0; + for(int i=0; i max) max = v.at(i); + return max; +} + + +int main() +{ + BEGIN_TESTING(VoxImageFilters); + + VoxImage image(Vector3i(20,30,40)); + image[Vector3i(10,10,10)].Value = 1; + //image[Vector3i(10,10,8)].Value = 1; + image.ExportToVtk("test_filter_original.vtk",0); + + + + //////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////// + // RPS // + + { + VoxFilterAlgorithmSPR filter(Vector3i(2,3,4)); + + VoxImage filtered = image; + + Vector values; + for(int i=0; i < filter.GetKernelData().GetDims().prod(); ++i) { + values.push_back(1.); + std::cout << values[i] << " "; + } + std::cout << "\n"; + + filter.SetImage(&filtered); + + filter.SetKernelNumericXZY(values); + + filter.SetABTrim(0,2); + + filter.GetKernelData().PrintSelf(std::cout); + + filter.Run(); + + filtered.ExportToVtk("filter_RPS_out.vtk",0); + } + + + + + + { + + VoxImage image(Vector3i(20,30,40)); + image[Vector3i(10,10,10)].Value = 1; + image[Vector3i(9,10,8)].Value = 2; + image.ExportToVtk("test_filter_max_original.vtk",0); + + + + VoxFilterAlgorithmCustom filter(Vector3i(3,3,4)); + + Vector values; + for(int i=0; i < filter.GetKernelData().GetDims().prod(); ++i) { + values.push_back(static_cast(1)); + } + + filter.SetImage(&image); + + filter.SetKernelNumericXZY(values); + + filter.SetCustomEvaluate(MaxInVector); + + filter.Run(); + + image.ExportToVtk("test_filter_max.vtk",0); + } + + + + END_TESTING; +} diff --git a/src/Math/testing/VoxImageTest.cpp b/src/Math/testing/VoxImageTest.cpp new file mode 100644 index 0000000..368fc9b --- /dev/null +++ b/src/Math/testing/VoxImageTest.cpp @@ -0,0 +1,107 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "testing-prototype.h" +#include "Math/ImageData.h" +#include "Math/VoxImage.h" + +using namespace uLib; + + +struct TestVoxel { + Scalarf Value; + unsigned int Count; +}; + +int main() { + BEGIN_TESTING(Math ImageData); + + { // SIMPLE TESTS // + ImageData img(Vector3i(10,10,10)); + img.SetSpacing(Vector3f(3,3,3)); + TEST1( img.GetWorldPoint(2,0,0) == HPoint3f(6,0,0) ); + TEST1( img.GetWorldPoint(1,1,1) == HPoint3f(3,3,3) ); + + img.SetPosition(Vector3f(1,1,1)); + TEST1( img.GetWorldPoint(1,1,1) == HPoint3f(4,4,4) ); + TEST1( img.GetLocalPoint(4,4,4) == HPoint3f(1,1,1) ); + + TEST0( img.IsInsideBounds(HPoint3f(5,33,-5))); + TEST0( img.IsInsideBounds(HPoint3f(0,0,0))); + TEST1( img.IsInsideBounds(HPoint3f(1,1,1))); + } + + { // TEST WITH ORIGIN // + ImageData img(Vector3i(10,10,10)); + img.SetSpacing(Vector3f(3,3,3)); + img.SetOrigin(Vector3f(-1,1,-1)); + img.SetPosition(Vector3f(1,1,1)); + TEST1( img.GetWorldPoint(1,1,1) == HPoint3f(3,5,3) ); + } + + + { + VoxImage img(Vector3i(10,10,10)); + TestVoxel zero = {0,0}; + img.InitVoxels(zero); + TestVoxel nonzero = {5.552368, 0}; + img[Vector3i(5,1,7)] = nonzero; + img[img.Find(HPoint3f(3,3,3))].Value = 5.552369; + img.ExportToVtk("./test_vox_image.vtk",0); + img.ExportToVtkXml("./test_vox_image.vti",0); + TEST1( img.GetValue(Vector3i(5,1,7)) == 5.552368f ); + } + + { + VoxImage img(Vector3i(4,4,4)); + TestVoxel zero = {0,0}; + img.InitVoxels(zero); + img.SetSpacing(Vector3f(2,2,2)); + img.SetPosition(Vector3f(-4,-4,-4)); + TEST1( img.GetWorldPoint(img.GetLocalPoint(HPoint3f(5,5,5))) == HPoint3f(5,5,5)); + } + + { + VoxImage imgR(Vector3i(0,0,0)); + imgR.ImportFromVtk("./test_vox_image.vtk"); + imgR.ExportToVtk("./read_and_saved.vtk"); + } + + + { + VoxImage img1(Vector3i(5,5,5)); + VoxImage img2; + img2 = img1; + TEST1( img1.GetDims() == img2.GetDims() ); + } + + + + + END_TESTING +} diff --git a/src/Math/testing/VoxRaytracerTest.cpp b/src/Math/testing/VoxRaytracerTest.cpp new file mode 100644 index 0000000..73f045d --- /dev/null +++ b/src/Math/testing/VoxRaytracerTest.cpp @@ -0,0 +1,151 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Math/ImageData.h" +#include "Math/VoxRaytracer.h" +#include "testing-prototype.h" + +using namespace uLib; + + +int Vector4f0(Vector4f c) +{ + c(3) = 0; + if ( fabs(c(0)) < 0.001 && fabs(c(1)) < 0.001 && fabs(c(2)) < 0.001 ) + return 0; + else + return 1; +} + +//bool Comapare(const &t1, const T2 &t2) +//{ +// int out = 0; +// out += t1.vox_id != t2.vox_id; +// out += (fabs(t1.L) - fabs(t2.L)) > 0.001; +// return out == 0; +//} + + +typedef VoxRaytracer Raytracer; + +int main() +{ + BEGIN_TESTING(Math VoxRaytracer); + + ImageData img(Vector3i(2,2,2)); + img.SetSpacing(Vector3f(2,2,2)); + img.SetPosition(Vector3f(-2,0,-2)); + + { + HLine3f line; + line.origin << 0.1, 4.1, 0.1, 1; + line.direction << 0.1, -0.1, 0.1,0; + Raytracer rt(img); + HPoint3f pt; + TEST1( rt.GetEntryPoint(line,pt) ); + TEST0( Vector4f0( pt - HPoint3f(0.2,4,0.2) ) ); + } + + { + HLine3f line; + line.origin << 4,0,4, 1; + line.direction << -0.1, 0.1, -0.1, 0; + Raytracer rt(img); + HPoint3f pt; + TEST1( rt.GetEntryPoint(line,pt) ); + TEST0( Vector4f0( pt - HPoint3f(2,2,2) ) ); + } + + { // Test a point inside image // + ImageData img(Vector3i(4,4,4)); + img.SetSpacing(Vector3f(2,2,2)); + img.SetPosition(Vector3f(-4,-4,-4)); + Raytracer ray(img); + HPoint3f pt; + HLine3f line; + line.origin = HPoint3f(-3,-3,-3); + // line.direction = HVector3f(1,1,1); // + TEST1( ray.GetEntryPoint(line,pt) ); + TEST1( pt == HPoint3f(-3,-3,-3) ); + + Raytracer::RayData rdata = ray.TraceBetweenPoints(HPoint3f(-3,-3,-3), HPoint3f(3,3,3)); + foreach (const Raytracer::RayData::Element &el, rdata.Data()) + { + std::cout << " " << el.vox_id << " , " << el.L << "\n"; + } + } + + + { + Vector4f pt1(1,-0.5,1); + Vector4f pt2(1,4.5,1); + Raytracer rt(img); + + Raytracer::RayData ray = rt.TraceBetweenPoints(pt1,pt2); + TEST1( ray.Data().size() == 2 ); + TEST1( ray.Data().at(0).vox_id == 6 ); + TEST1( ray.Data().at(1).vox_id == 7 ); + ray.PrintSelf(std::cout); + } + + { + Vector4f pt1(5,1,1); + Vector4f pt2(-3,1,1); + Raytracer rt(img); + + Raytracer::RayData ray = rt.TraceBetweenPoints(pt1,pt2); + TEST1( ray.Data().size() == 2 ); + TEST1( ray.Data().at(0).vox_id == 6 ); + TEST1( ray.Data().at(1).vox_id == 4 ); + ray.PrintSelf(std::cout); + } + + { + Vector4f pt1(1,1,1); + Vector4f pt2(-1,3,-1); + Raytracer rt(img); + + Raytracer::RayData ray = rt.TraceBetweenPoints(pt1,pt2); + TEST1( ray.Data().size() == 4 ); + TEST1( ray.Data().at(0).vox_id == 6 ); + TEST1( ray.Data().at(1).vox_id == 4 ); + TEST1( ray.Data().at(2).vox_id == 5 ); + TEST1( ray.Data().at(3).vox_id == 1 ); + ray.PrintSelf(std::cout); + } + + END_TESTING +} + + + + + + + + diff --git a/src/Math/testing/testing-prototype.h b/src/Math/testing/testing-prototype.h new file mode 100644 index 0000000..39f4e6c --- /dev/null +++ b/src/Math/testing/testing-prototype.h @@ -0,0 +1,37 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include + +#define BEGIN_TESTING(name) \ +static int _fail = 0; \ +printf("..:: Testing " #name " ::..\n"); + +#define TEST1(val) _fail += (val)==0 +#define TEST0(val) _fail += (val)!=0 +#define END_TESTING return _fail; + diff --git a/src/ParticlePhysics/Geant/Makefile.am b/src/ParticlePhysics/Geant/Makefile.am new file mode 100644 index 0000000..70c690d --- /dev/null +++ b/src/ParticlePhysics/Geant/Makefile.am @@ -0,0 +1,14 @@ +include $(top_srcdir)/Common.am + +library_includedir = $(includedir)/libmutom-${PACKAGE_VERSION}/ParticlePhysics/Geant + +library_include_HEADERS = + +_PPGEANT_SOURCES = + + + +noinst_LTLIBRARIES = libmutomppgeant.la +libmutomppgeant_la_SOURCES = ${_PPGEANT_SOURCES} + + diff --git a/src/ParticlePhysics/MuonTomography/DetectorChamber.h b/src/ParticlePhysics/MuonTomography/DetectorChamber.h new file mode 100644 index 0000000..22aa495 --- /dev/null +++ b/src/ParticlePhysics/MuonTomography/DetectorChamber.h @@ -0,0 +1,47 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + +#ifndef U_PP_MUTOM_DETECTORCHAMBER_H +#define U_PP_MUTOM_DETECTORCHAMBER_H + +#include + +namespace uLib { + +class ContainerBox; + +class DetectorChamber : public Object { +public: + + virtual ContainerBox & Geometry() {} +protected: + virtual ~DetectorChamber() {} +}; + +} // uLib + + + +#endif // DETECTORCHAMBER_H diff --git a/src/ParticlePhysics/MuonTomography/DriftDetector.h b/src/ParticlePhysics/MuonTomography/DriftDetector.h new file mode 100644 index 0000000..e655929 --- /dev/null +++ b/src/ParticlePhysics/MuonTomography/DriftDetector.h @@ -0,0 +1,53 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_PPHY_DRIFTDETECTOR_H +#define U_PPHY_DRIFTDETECTOR_H + + +#include +#include + +#include "ParticlePhysics/MuonTomography/DetectorChamber.h" + +namespace uLib { + +class DriftDetectorChamber : public DetectorChamber { + + uLibRefMacro(Geometry,ContainerBox) +private: + ContainerBox m_Geometry; +}; + + + + +} // uLib + + + +#endif // U_PPHY_DRIFTDETECTOR_H diff --git a/src/ParticlePhysics/MuonTomography/Hit.h b/src/ParticlePhysics/MuonTomography/Hit.h new file mode 100644 index 0000000..a5b071a --- /dev/null +++ b/src/ParticlePhysics/MuonTomography/Hit.h @@ -0,0 +1,65 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + +#ifndef U_PPMUTOM_HIT_H +#define U_PPMUTOM_HIT_H + +#include +#include + + +namespace uLib { + +template +class Hit { + Code m_Code; + Type m_DriftTime; +}; + + + + + + + +class HitMC { +public: + virtual Id_t GetChamber() = 0; + virtual Vector3f GetPosition() = 0; + virtual Scalarf GetDritfTime() = 0; +protected: + virtual ~HitMC() {} +}; + + + +} // uLib + + + + + +#endif // HIT_H diff --git a/src/ParticlePhysics/MuonTomography/Makefile.am b/src/ParticlePhysics/MuonTomography/Makefile.am new file mode 100644 index 0000000..d169be8 --- /dev/null +++ b/src/ParticlePhysics/MuonTomography/Makefile.am @@ -0,0 +1,11 @@ +include $(top_srcdir)/Common.am + +library_includedir = $(includedir)/libmutom-${PACKAGE_VERSION}/ParticlePhysics/MuonTomography +library_include_HEADERS = + +_PPMUTOM_SOURCES = + +noinst_LTLIBRARIES = libmutomppmutom.la +libmutomppmutom_la_SOURCES = ${_PPMUTOM_SOURCES} + + diff --git a/src/ParticlePhysics/MuonTomography/MuonScatter.h b/src/ParticlePhysics/MuonTomography/MuonScatter.h new file mode 100644 index 0000000..67b195f --- /dev/null +++ b/src/ParticlePhysics/MuonTomography/MuonScatter.h @@ -0,0 +1,89 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_PPMUTOM_MUONSCATTER_H +#define U_PPMUTOM_MUONSCATTER_H + +#include "Core/Macros.h" +#include "Core/Serializable.h" + +#include "Math/Dense.h" + +namespace uLib { + + + +class MuonTrack { + ULIB_SERIALIZE_ACCESS +public: + HLine3f track; + Scalarf momentum; +}; + +class MuonScatter { + ULIB_SERIALIZE_ACCESS +public: + MuonTrack in, out; + MuonTrack error_in, error_out; +}; + + +} // uLib + +ULIB_SERIALIZABLE(uLib::MuonTrack) +ULIB_SERIALIZE(uLib::MuonTrack) { + ar & AR(line); +} + + + +ULIB_SERIALIZABLE(uLib::MuonScatter) +ULIB_SERIALIZE(uLib::MuonScatter) { + ar + & " MuonScatter: ----------------- \n" + & "IN : " & AR(in) & "\n" + & "OUT: " & AR(out) & "\n" + & " ------------------------------ \n"; +} + + +std::ostream & +operator << (std::ostream &o, const uLib::MuonScatter &d) { + uLib::Archive::hrt_oarchive(o) << d; + return o; +} + +inline std::istream & +operator >> (std::istream &is, uLib::MuonScatter &d) +{ + uLib::Archive::hrt_iarchive(is) >> d; + return is; +} + + + +#endif // MUONSCATTER_H diff --git a/src/Root/CMakeLists.txt b/src/Root/CMakeLists.txt new file mode 100644 index 0000000..06086b3 --- /dev/null +++ b/src/Root/CMakeLists.txt @@ -0,0 +1,39 @@ +set(HEADERS + TestTObject.h + RootMathDense.h + RootMuonScatter.h + RootHitRaw.h +) + +set(DICTIONARY_HEADERS + TestTObject.h + RootMathDense.h + RootMuonScatter.h + RootHitRaw.h +) + +SET(SOURCES + TestTObject.cpp + RootMuonScatter.cpp +) + + + +set(LIBRARIES +# ${Boost_SERIALIZATION_LIBRARY} +# ${Boost_SIGNALS_LIBRARY} +# ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${ROOT_LIBRARIES} + ${PACKAGE_LIBPREFIX}Core + ${PACKAGE_LIBPREFIX}Math +) + +include(FindROOTv6) +root_generate_dictionary(uLibRootDict ${DICTIONARY_HEADERS} LINKDEF Linkdef.h) +set_source_files_properties(uLibRootDict.cxx PROPERTIES GENERATED TRUE) +set_source_files_properties(uLibRootDict.h PROPERTIES GENERATED TRUE) +list(APPEND SOURCES uLibRootDict.cxx) + + +uLib_add_shared_library(${uLib-module}) +add_subdirectory(testing) diff --git a/src/Root/Linkdef.h b/src/Root/Linkdef.h new file mode 100644 index 0000000..8a7b5e7 --- /dev/null +++ b/src/Root/Linkdef.h @@ -0,0 +1,79 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_ROOT_LINKDEF_H +#define U_ROOT_LINKDEF_H + +#ifdef __CINT__ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; +#pragma link C++ nestedclasses; + +#pragma link C++ class TestTObject+; + +using namespace ROOT::Mutom; + +#pragma link C++ class ROOT::Math::Cartesian2D+; +#pragma link C++ class ROOT::Math::Cartesian2D+; +#pragma link C++ class ROOT::Math::Cartesian2D+; + +#pragma link C++ class ROOT::Math::Cartesian3D+; +#pragma link C++ class ROOT::Math::Cartesian3D+; +#pragma link C++ class ROOT::Math::Cartesian3D+; + +#pragma link C++ class Vector2i+; +#pragma link C++ class Vector2f+; +#pragma link C++ class Vector2d+; + +#pragma link C++ class Vector3i+; +#pragma link C++ class Vector3f+; +#pragma link C++ class Vector3d+; + +#pragma link C++ typedef Matrix3i; +#pragma link C++ typedef Matrix3f; +#pragma link C++ typedef Matrix3d; + +#pragma link C++ class Line3f+; +#pragma link C++ class Line3d+; + +#pragma link C++ class MuonScatter+; +#pragma link C++ function MuonScatter::p_mean() const; + +// #pragma link C++ class DetectorChamber+; + +#pragma link C++ class HitRaw+; +#pragma link C++ function HitRaw::Chm() const; +#pragma link C++ function HitRaw::Rob() const; +#pragma link C++ function HitRaw::Tdc() const; +#pragma link C++ function HitRaw::Ch() const; + + +#endif // __CINT__ + +#endif // LINKDEF_H diff --git a/src/Root/Makefile.am b/src/Root/Makefile.am new file mode 100644 index 0000000..868c022 --- /dev/null +++ b/src/Root/Makefile.am @@ -0,0 +1,20 @@ +SUBDIRS = . + +ROOTCINT = `which rootcint` + +include $(top_srcdir)/Common.am + +library_includedir = $(includedir)/libmutom-${PACKAGE_VERSION}/Root + +library_include_HEADERS = TestTObject.h + + +_CORE_SOURCES = TestTObject.cpp + + +MutomDict.cxx: $(library_include_HEADERS) Linkdef.h + $(ROOTCINT) -f $@ -c $(AM_CXXFLAGS) -p $^ + + +noinst_LTLIBRARIES = libmutomroot.la +libmutomroot_la_SOURCES = MutomDict.cxx ${_CORE_SOURCES} diff --git a/src/Root/RootHitMC.h b/src/Root/RootHitMC.h new file mode 100644 index 0000000..eef8541 --- /dev/null +++ b/src/Root/RootHitMC.h @@ -0,0 +1,50 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + +#ifndef ROOTHITMC_H +#define ROOTHITMC_H + +#include +#include + +namespace ROOT { +namespace Mutom { + +class HitMC { +public: + int chm; // chamber id + Vector3f pos; // hit position in local coords + float_t drift; // drift time + enum TMCParticleType ptype; +}; + + + +} // Mutom +} // ROOT + + +#endif // ROOTHITMC_H diff --git a/src/Root/RootHitRaw.h b/src/Root/RootHitRaw.h new file mode 100644 index 0000000..756c959 --- /dev/null +++ b/src/Root/RootHitRaw.h @@ -0,0 +1,71 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + +#ifndef ROOTHITRAW_H +#define ROOTHITRAW_H + +#include + +namespace ROOT { +namespace Mutom { + + + +class Hit32 { +public: + Int_t code; + Float_t drift; +}; + +class Hit64 { +public: + Long_t code; + Double_t drift; +}; + + + +class HitRaw +{ +public: + virtual Int_t Flags() {} + virtual Int_t Chm() const {} + virtual Int_t Rob() const {} + virtual Int_t Tdc() const {} + virtual Int_t Ch() const {} + virtual void SetFlags (Int_t flags) = 0; + virtual void SetChamber(Int_t cmb) = 0; + virtual void SetChannel(Int_t Rob, Int_t Tdc, Int_t Ch) = 0; + virtual float operator() ( ) {} +protected: + virtual ~HitRaw() {} +}; + + + +} // Mutom +} // ROOT + +#endif // ROOTHITRAW_H diff --git a/src/Root/RootMathDense.h b/src/Root/RootMathDense.h new file mode 100644 index 0000000..1435d77 --- /dev/null +++ b/src/Root/RootMathDense.h @@ -0,0 +1,68 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef ROOTMATHDENSE_H +#define ROOTMATHDENSE_H + + +#include +#include + +#include + +namespace ROOT { +namespace Mutom { + +typedef ROOT::Math::Cartesian2D Vector2i; +typedef ROOT::Math::Cartesian2D Vector2f; +typedef ROOT::Math::Cartesian2D Vector2d; + +typedef ROOT::Math::Cartesian3D Vector3i; +typedef ROOT::Math::Cartesian3D Vector3f; +typedef ROOT::Math::Cartesian3D Vector3d; + +typedef ROOT::Math::MatRepStd Matrix3i; +typedef ROOT::Math::MatRepStd Matrix3f; +typedef ROOT::Math::MatRepStd Matrix3d; + + +template +struct Line3D +{ + ROOT::Math::Cartesian3D origin,direction; +}; + + +typedef Line3D Line3f; +typedef Line3D Line3d; + + + +} // Mutom +} // ROOT + +#endif // ROOTMATHDENSE_H diff --git a/src/Root/RootMuonScatter.cpp b/src/Root/RootMuonScatter.cpp new file mode 100644 index 0000000..ce0e854 --- /dev/null +++ b/src/Root/RootMuonScatter.cpp @@ -0,0 +1,75 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "RootMuonScatter.h" +#include "Detectors/MuonScatter.h" + + +namespace ROOT { +namespace Mutom { + +MuonScatter &operator <<(MuonScatter &rmu, const uLib::MuonScatter &mu) +{ + + rmu.in.origin.SetX(mu.LineIn().origin()(0)); + rmu.in.origin.SetY(mu.LineIn().origin()(1)); + rmu.in.origin.SetZ(mu.LineIn().origin()(2)); + rmu.in.direction.SetX(mu.LineIn().direction()(0)); + rmu.in.direction.SetY(mu.LineIn().direction()(1)); + rmu.in.direction.SetZ(mu.LineIn().direction()(2)); + + rmu.out.origin.SetX(mu.LineOut().origin()(0)); + rmu.out.origin.SetY(mu.LineOut().origin()(1)); + rmu.out.origin.SetZ(mu.LineOut().origin()(2)); + rmu.out.direction.SetX(mu.LineOut().direction()(0)); + rmu.out.direction.SetY(mu.LineOut().direction()(1)); + rmu.out.direction.SetZ(mu.LineOut().direction()(2)); + + rmu.in.p = mu.GetMomentum(); + rmu.out.p = mu.GetMomentumPrime(); + + return rmu; +} + +uLib::MuonScatter &operator >>(const MuonScatter &rmu, uLib::MuonScatter &mu) { + + mu.LineIn().origin() << rmu.in.origin.x(), rmu.in.origin.z(), rmu.in.origin.z(); + mu.LineIn().direction() << rmu.in.direction.x(), rmu.in.direction.z(), rmu.in.direction.z(); + mu.LineOut().origin() << rmu.out.origin.x(), rmu.out.origin.z(), rmu.out.origin.z(); + mu.LineOut().direction() << rmu.out.direction.x(), rmu.out.direction.z(), rmu.out.direction.z(); + + mu.SetMomentum(rmu.in.p); + mu.SetMomentumPrime(rmu.out.p); + + return mu; +} + + + +} +} + diff --git a/src/Root/RootMuonScatter.h b/src/Root/RootMuonScatter.h new file mode 100644 index 0000000..2d82284 --- /dev/null +++ b/src/Root/RootMuonScatter.h @@ -0,0 +1,66 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef ROOTMUONSCATTER_H +#define ROOTMUONSCATTER_H + +#include + +namespace uLib { +class MuonScatter; +} + + +namespace ROOT { +namespace Mutom { + +struct MuonTrack { + Vector3f origin; + Vector3f direction; + float p; +}; + +struct MuonScatter { +public: + MuonTrack in,out; + MuonTrack in_err, out_err; + inline Vector2f p_mean() const; +}; + +// this is only for testing function link in dictionary ... // +Vector2f MuonScatter::p_mean() const { + return Vector2f( (in.p + out.p)/2, (in_err.p + out_err.p)/2 ); +} + +MuonScatter &operator <<(MuonScatter &rmu, const uLib::MuonScatter &mu); +uLib::MuonScatter &operator >>(const MuonScatter &rmu, uLib::MuonScatter &mu); + + +} // Mutom +} // ROOT + +#endif // ROOTMUONSCATTER_H diff --git a/src/Root/TestTObject.cpp b/src/Root/TestTObject.cpp new file mode 100644 index 0000000..213c9ea --- /dev/null +++ b/src/Root/TestTObject.cpp @@ -0,0 +1,31 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "TestTObject.h" + + +ClassImp(TestTObject) diff --git a/src/Root/TestTObject.h b/src/Root/TestTObject.h new file mode 100644 index 0000000..d7041e7 --- /dev/null +++ b/src/Root/TestTObject.h @@ -0,0 +1,47 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_ROOT_TESTTOBJECT_H +#define U_ROOT_TESTTOBJECT_H + +#include +#include +#include +#include + +class TestTObject : public TObject { +public: + int a,b,c; + TestTObject() : a(1),b(2),c(3) {} + virtual ~TestTObject() {} + ClassDef(TestTObject,1) +}; + + + + +#endif // TESTTOBJECT_H diff --git a/src/Root/testing/CMakeLists.txt b/src/Root/testing/CMakeLists.txt new file mode 100644 index 0000000..28f190a --- /dev/null +++ b/src/Root/testing/CMakeLists.txt @@ -0,0 +1,15 @@ +# TESTS +set( TESTS + RootDebugTest +) + +set(LIBRARIES + ${PACKAGE_LIBPREFIX}Core + ${PACKAGE_LIBPREFIX}Math + ${PACKAGE_LIBPREFIX}Root + ${Boost_SERIALIZATION_LIBRARY} + ${Boost_SIGNALS_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${ROOT_LIBRARIES} +) +uLib_add_tests(${uLib-module}) diff --git a/src/Root/testing/Makefile.am b/src/Root/testing/Makefile.am new file mode 100644 index 0000000..730b659 --- /dev/null +++ b/src/Root/testing/Makefile.am @@ -0,0 +1,20 @@ +include $(top_srcdir)/Common.am + +#AM_DEFAULT_SOURCE_EXT = .cpp + +# if HAVE_CHECK +TESTS = RootDebugTest + +# UuidTest + +# else +# TEST = +# endif + +LDADD = $(top_srcdir)/libmutom-${PACKAGE_VERSION}.la $(AM_LIBS_BOOST) $(AM_LIBS_ROOT) + +check_PROGRAMS = $(TESTS) + + +all: $(TESTS) + diff --git a/src/Root/testing/RootDebugTest.cpp b/src/Root/testing/RootDebugTest.cpp new file mode 100644 index 0000000..7a44b53 --- /dev/null +++ b/src/Root/testing/RootDebugTest.cpp @@ -0,0 +1,122 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include +#include +#include +#include +#include +#include + +#include "Root/TestTObject.h" +#include "Root/RootMuonScatter.h" + +#include "Detectors/MuonScatter.h" + +TTree * getTree(TFile *m_File, const char *path, const char *name) { + std::string p = std::string("/") + std::string(path); + TDirectory *dir = m_File->GetDirectory(p.c_str()); + if(!dir) { + m_File->mkdir(path); + } + m_File->cd(path); + std::string n = p + std::string("/") + std::string(name); + TObject *obj = m_File->Get(n.c_str()); + if(!obj) { + TTree *tree = new TTree(); + tree->SetName(name); + return tree; + } + else { + return (TTree *)obj; + } +} + + +int main(int argc,char **argv) { + + uLib::MuonScatter u_mu; + ROOT::Mutom::MuonScatter mu; + ROOT::Mutom::Vector3f v3f(0,1,0); + + TFile *file = new TFile("test_file.root","RECREATE"); + TTree *tree = getTree(file,"testing/dump","testing_tree"); + TTree *tree2 = getTree(file,"new_dump","testing_tree"); + + tree->Branch("mu",&mu); + tree->AddFriend(tree2); + + + mu.in.origin = ROOT::Mutom::Vector3f(1,2,3); + mu.in.direction = ROOT::Mutom::Vector3f(4,5,6); + mu.p_in = 555; + mu.p_out = 2368; + + tree->Fill(); + + u_mu.LineIn().origin << 3,3,3; + u_mu.LineIn().direction << 5,5,5; + u_mu.LineOut().origin << 1,2,3; + u_mu.LineOut().direction << 4,5,6; + u_mu.SetMomentum(555); + u_mu.SetMomentumPrime(2368); + + mu << u_mu; + + tree->Fill(); + + tree2->Branch("vec",&v3f); + tree2->Branch("p_in",&mu.p_in); + tree2->Branch("p_out",&mu.p_out); + mu.p_in = 1; + mu.p_out = 2; + tree2->Fill(); + + file->cd("/testing/dump"); + tree->Write(); + file->cd("/new_dump"); + tree2->Write(); + + TText text(0,0,"this file contain a muon scatter event"); + file->cd("/"); + text.Write("content"); + + + + gApplication = new TApplication("Application", &argc, argv); + TBrowser *tbr = new TBrowser("test"); + tbr->Show(); + + + gApplication->Run(); + + + + return 0; +} diff --git a/src/Vtk/CMakeLists.txt b/src/Vtk/CMakeLists.txt new file mode 100644 index 0000000..c26cf09 --- /dev/null +++ b/src/Vtk/CMakeLists.txt @@ -0,0 +1,39 @@ +set(HEADERS + uLibVtkInterface.h + uLibVtkViewer.h + vtkContainerBox.h + vtkMuonScatter.h + vtkStructuredGrid.h + vtkVoxRaytracerRepresentation.h + vtkVoxImage.h +# vtkHLineRepresentation.h +# vtkTriangleMesh.h +) + +SET(SOURCES + uLibVtkInterface.cxx + uLibVtkViewer.cpp + vtkContainerBox.cpp + vtkMuonScatter.cxx + vtkStructuredGrid.cpp + vtkVoxRaytracerRepresentation.cpp + vtkVoxImage.cpp +) + +set(LIBRARIES + ${Boost_SERIALIZATION_LIBRARY} + ${Boost_SIGNALS_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${Eigen_LIBRARY} + ${ROOT_LIBRARIES} + ${Geant4_LIBRARIES} + ${VTK_LIBRARIES} + ${PACKAGE_LIBPREFIX}Core + ${PACKAGE_LIBPREFIX}Math + ${PACKAGE_LIBPREFIX}Detectors + ${PACKAGE_LIBPREFIX}Vtk +) + +uLib_add_shared_library(${uLib-module}) + +add_subdirectory(testing) diff --git a/src/Vtk/Makefile.am b/src/Vtk/Makefile.am new file mode 100644 index 0000000..9d175a5 --- /dev/null +++ b/src/Vtk/Makefile.am @@ -0,0 +1,34 @@ +SUBDIRS = . + +include $(top_srcdir)/Common.am +include Vtk.am + + +library_includedir = $(includedir)/libmutom-${PACKAGE_VERSION}/Vtk +library_include_HEADERS = uLibVtkInterface.h \ + uLibVtkViewer.h \ + vtkContainerBox.h \ + vtkMuonScatter.h \ + vtkStructuredGrid.h \ + vtkVoxRaytracerRepresentation.h \ + vtkVoxImage.h +# vtkHLineRepresentation.h \ +# vtkTriangleMesh.h + + +_VTK_SOURCES = uLibVtkInterface.cxx \ + uLibVtkViewer.cpp \ + vtkContainerBox.cpp \ + vtkMuonScatter.cxx \ + vtkStructuredGrid.cpp \ + vtkVoxRaytracerRepresentation.cpp \ + vtkVoxImage.cpp +#vtkTriangleMesh.cpp + + + +noinst_LTLIBRARIES = libconvtk.la +libconvtk_la_SOURCES = ${_VTK_SOURCES} +libconvtk_la_LIBADD = $(AM_LIBS_ALL) + + diff --git a/src/Vtk/Vtk.am b/src/Vtk/Vtk.am new file mode 100644 index 0000000..27e030a --- /dev/null +++ b/src/Vtk/Vtk.am @@ -0,0 +1,93 @@ + + +#if VTK_5_x +_VTK_LIBS = -lQVTK \ + -lLSDyna \ + -lMapReduceMPI \ + -lmpistubs \ + -lvtkalglib \ + -lvtkCharts \ + -lvtkCommon \ + -lvtkDICOMParser \ + -lvtkexoIIc \ + -lvtkFiltering \ + -lvtkftgl \ + -lvtkGenericFiltering \ + -lvtkGraphics \ + -lvtkHybrid \ + -lvtkImaging \ + -lvtkInfovis \ + -lvtkmetaio \ + -lvtkNetCDF_cxx \ + -lvtkNetCDF \ + -lvtkproj4 \ + -lvtkRendering \ + -lvtksqlite \ + -lvtksys \ + -lvtkverdict \ + -lvtkViews \ + -lvtkVolumeRendering \ + -lvtkWidgets + +AM_CFLAGS += $(VTK_CFLAGS) +AM_CXXFLAGS += $(VTK_CXXFLAGS) +AM_LDFLAGS += $(VTK_LDFLAGS) $(_VTK_LIBS) + +#else +#_VTK_LIBS = \ +# -lvtkRenderingOpenGL-6.0 \ +# -lvtkImagingHybrid-6.0 \ +# -lvtkIOImage-6.0 \ +# -lvtkCommonDataModel-6.0 \ +# -lvtkCommonMath-6.0 \ +# -lvtkCommonCore-6.0 \ +# -lvtksys-6.0 \ +# -lvtkCommonMisc-6.0 \ +# -lvtkCommonSystem-6.0 \ +# -lvtkCommonTransforms-6.0 \ +# -lvtkCommonExecutionModel-6.0 \ +# -lvtkDICOMParser-6.0 \ +# -lvtkIOCore-6.0 \ +# -lvtkzlib-6.0 \ +# -lvtkmetaio-6.0 \ +# -lvtkjpeg-6.0 \ +# -lvtkpng-6.0 \ +# -lvtktiff-6.0 \ +# -lvtkImagingCore-6.0 \ +# -lvtkRenderingCore-6.0 \ +# -lvtkFiltersExtraction-6.0 \ +# -lvtkFiltersCore-6.0 \ +# -lvtkFiltersGeneral-6.0 \ +# -lvtkCommonComputationalGeometry-6.0 \ +# -lvtkFiltersStatistics-6.0 \ +# -lvtkImagingFourier-6.0 \ +# -lvtkalglib-6.0 \ +# -lvtkFiltersGeometry-6.0 \ +# -lvtkFiltersSources-6.0 \ +# -lvtkIOXMLParser-6.0 \ +# -lvtkexpat-6.0 \ +# -lvtkRenderingAnnotation-6.0 \ +# -lvtkImagingColor-6.0 \ +# -lvtkRenderingFreeType-6.0 \ +# -lvtkfreetype-6.0 \ +# -lvtkftgl-6.0 \ +# -lvtkInteractionStyle-6.0 \ +# -lvtkRenderingVolumeOpenGL-6.0 \ +# -lvtkRenderingVolume-6.0 \ +# -lvtkIOXML-6.0 \ +# -lvtkIOGeometry-6.0 \ +# -lvtkjsoncpp-6.0 \ +# -lvtkInteractionWidgets-6.0 \ +# -lvtkFiltersHybrid-6.0 \ +# -lvtkImagingSources-6.0 \ +# -lvtkFiltersModeling-6.0 \ +# -lvtkImagingGeneral-6.0 \ +# -lvtkIOLegacy-6.0 \ +# -lvtkRenderingFreeTypeOpenGL-6.0 + + + +#AM_CFLAGS += $(VTK_CFLAGS) +#AM_CXXFLAGS += $(VTK_CXXFLAGS) -rdynamic +#AM_LDFLAGS += $(VTK_LDFLAGS) $(_VTK_LIBS) -lGLU -lSM -lICE -lX11 -lXext -lSM -lICE -lX11 -lXext -lXt -lm -ldl -lGL +#endif diff --git a/src/Vtk/testing/CMakeLists.txt b/src/Vtk/testing/CMakeLists.txt new file mode 100644 index 0000000..33a3847 --- /dev/null +++ b/src/Vtk/testing/CMakeLists.txt @@ -0,0 +1,13 @@ +# TESTS +set( TESTS + vtkViewerTest + vtkContainerBoxTest + vtkMuonScatter + vtkStructuredGridTest + vtkVoxRaytracerTest + vtkVoxImageTest +# vtkTriangleMeshTest +) + +include(${VTK_USE_FILE}) +uLib_add_tests(${uLib-module}) diff --git a/src/Vtk/testing/Makefile.am b/src/Vtk/testing/Makefile.am new file mode 100644 index 0000000..4cc3180 --- /dev/null +++ b/src/Vtk/testing/Makefile.am @@ -0,0 +1,21 @@ + +include $(top_srcdir)/Common.am +include ../Vtk.am + +#AM_DEFAULT_SOURCE_EXT = .cpp + +# if HAVE_CHECK +TESTS = \ + vtkViewerTest \ + vtkContainerBoxTest \ + vtkMuonScatter \ + vtkStructuredGridTest \ + vtkVoxRaytracerTest \ + vtkVoxImageTest +# vtkTriangleMeshTest + +all: $(TESTS) + +LDADD = $(top_srcdir)/libmutom-${PACKAGE_VERSION}.la $(AM_LIBS_ALL) +check_PROGRAMS = $(TESTS) + diff --git a/src/Vtk/testing/testVtkWriter.cpp b/src/Vtk/testing/testVtkWriter.cpp new file mode 100644 index 0000000..5f8dc2d --- /dev/null +++ b/src/Vtk/testing/testVtkWriter.cpp @@ -0,0 +1,95 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include +#include +#include +#include +#include + +#include + + +#include +#include + +int main(int, char *[]) +{ + // Create an image data + vtkSmartPointer imageData = + vtkSmartPointer::New(); + + // Specify the size of the image data + imageData->SetDimensions(10,20,15); +#if VTK_MAJOR_VERSION <= 5 + imageData->SetNumberOfScalarComponents(1); + imageData->SetScalarTypeToDouble(); +#else + imageData->AllocateScalars(VTK_DOUBLE,1); +#endif + + int* dims = imageData->GetDimensions(); + // int dims[3]; // can't do this + + std::cout << "Dims: " << " x: " << dims[0] << " y: " << dims[1] << " z: " << dims[2] << std::endl; + + std::cout << "Number of points: " << imageData->GetNumberOfPoints() << std::endl; + std::cout << "Number of cells: " << imageData->GetNumberOfCells() << std::endl; + + // Fill every entry of the image data with "2.0" + for (int z = 0; z < dims[2]; z++) + { + for (int y = 0; y < dims[1]; y++) + { + for (int x = 0; x < dims[0]; x++) + { + double* pixel = static_cast(imageData->GetScalarPointer(x,y,z)); + pixel[0] = (double)x+y+z; + } + } + } + + // imageData->GetCellData()->SetScalars(imageData->GetPointData()->GetScalars()); + + vtkSmartPointer ptoc = + vtkSmartPointer::New(); + + ptoc->SetInputConnection(imageData->GetProducerPort()); + + ptoc->Update(); + + vtkSmartPointer writer = + vtkSmartPointer::New(); + + + writer->SetInput(ptoc->GetImageDataOutput()); + writer->SetFileTypeToASCII(); + writer->SetFileName("output.vtk"); + writer->Update(); + + return EXIT_SUCCESS; +} diff --git a/src/Vtk/testing/testing-prototype.h b/src/Vtk/testing/testing-prototype.h new file mode 100644 index 0000000..c801261 --- /dev/null +++ b/src/Vtk/testing/testing-prototype.h @@ -0,0 +1,41 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include + +#include "Vtk/uLibVtkInterface.h" + + +#define BEGIN_TESTING(name) \ +static int _fail = 0; \ +printf("..:: Testing " #name " ::..\n"); + +#define TEST1(val) _fail += (val)==0 +#define TEST0(val) _fail += (val)!=0 +#define END_TESTING return _fail; + + diff --git a/src/Vtk/testing/vtkContainerBoxTest.cpp b/src/Vtk/testing/vtkContainerBoxTest.cpp new file mode 100644 index 0000000..7c477ef --- /dev/null +++ b/src/Vtk/testing/vtkContainerBoxTest.cpp @@ -0,0 +1,53 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "Vtk/uLibVtkViewer.h" + +#include "Math/ContainerBox.h" +#include "Vtk/vtkContainerBox.h" + +#include "testing-prototype.h" + +using namespace uLib; + +int main() { + BEGIN_TESTING(vtk ContainerBox Test); + + Vtk::Viewer v_viewer; + + ContainerBox box; + box.SetSize(Vector3f(2,3,4)); + box.SetPosition(Vector3f(1,2,3)); + + Vtk::vtkContainerBox v_box(box); + + v_viewer.AddPuppet(v_box); + v_viewer.Start(); + + + END_TESTING; +} diff --git a/src/Vtk/testing/vtkMuonScatter.cpp b/src/Vtk/testing/vtkMuonScatter.cpp new file mode 100644 index 0000000..2c9e7ca --- /dev/null +++ b/src/Vtk/testing/vtkMuonScatter.cpp @@ -0,0 +1,62 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "Detectors/MuonScatter.h" +#include "Vtk/vtkMuonScatter.h" + +#include "Vtk/uLibVtkViewer.h" + +#include "testing-prototype.h" + +using namespace uLib; + +int main() +{ + MuonScatter event; + event.LineIn().direction << 0, -1, 1, 0; + event.LineIn().origin << 0, 1, -1, 1; + + event.LineOut().direction << 0, -1, 0, 0; + event.LineOut().origin << 0, -1, 0, 1; + + Vtk::vtkMuonScatter v_event(event); + v_event.AddPocaPoint(HPoint3f(0,0,0)); + + v_event.SaveToXMLFile("vtk_testing_muonevent.vtp"); + + Vtk::Viewer viewer; + +// Vtk::Tie tms; +// tms.DoAction(); +// Vtk::Tie vms; +// vms.DoAction(); + + viewer.AddPuppet(v_event); + viewer.Start(); + + return 0; +} diff --git a/src/Vtk/testing/vtkStructuredGridTest.cpp b/src/Vtk/testing/vtkStructuredGridTest.cpp new file mode 100644 index 0000000..a2c2d51 --- /dev/null +++ b/src/Vtk/testing/vtkStructuredGridTest.cpp @@ -0,0 +1,51 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Math/ImageData.h" + +#include "Vtk/vtkStructuredGrid.h" +#include "Vtk/uLibVtkViewer.h" + +#include "testing-prototype.h" + +using namespace uLib; + +int main() +{ + + ImageData grid(Vector3i(10,10,100)); + grid.SetSpacing(Vector3f(3,1,1)); + + Vtk::vtkStructuredGrid grid_viewer(grid); + + Vtk::Viewer viewer; + viewer.AddPuppet(grid_viewer); + viewer.Start(); + + return 0; +} diff --git a/src/Vtk/testing/vtkTriangleMeshTest.cpp b/src/Vtk/testing/vtkTriangleMeshTest.cpp new file mode 100644 index 0000000..5d12e6d --- /dev/null +++ b/src/Vtk/testing/vtkTriangleMeshTest.cpp @@ -0,0 +1,75 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Math/TriangleMesh.h" +#include "Vtk/vtkTriangleMesh.h" +#include "testing-prototype.h" + +using namespace uLib; + + +int main() +{ + BEGIN_TESTING(Vtk Triangle Mesh); + +// { // SIMPLE TESTS // + + +// TriangleMesh mesh; + +// mesh.AddPoint(Vector3f(0,0,0)); +// mesh.AddPoint(Vector3f(0,1,0)); +// mesh.AddPoint(Vector3f(1,0,0)); + +// mesh.AddTriangle(Vector3i(0,1,2)); + +// mesh.PrintSelf(std::cout); + + +// vtkTriangleMesh v_mesh(mesh); +// v_mesh.Update(); + +// TestingRenderWidow(&v_mesh); +// } + + { // SIMPLE TESTS // + + TriangleMesh mesh; + + vtkTriangleMesh v_mesh(mesh); + + v_mesh.ReadFromStlFile("prova.stl"); + + mesh.PrintSelf(std::cout); + + TestingRenderWidow(&v_mesh); + } + + + END_TESTING; +} diff --git a/src/Vtk/testing/vtkViewerTest.cpp b/src/Vtk/testing/vtkViewerTest.cpp new file mode 100644 index 0000000..22a42f8 --- /dev/null +++ b/src/Vtk/testing/vtkViewerTest.cpp @@ -0,0 +1,71 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include +#include +#include + +#include "testing-prototype.h" + +using namespace uLib; + +int main() +{ + BEGIN_TESTING(vtk Viewer Test); + + Vtk::Viewer v_viewer; + + + vtkSmartPointer cube = vtkSmartPointer::New(); + cube->SetXLength(10); + cube->SetYLength(10); + cube->SetZLength(10); + cube->Update(); + + vtkSmartPointer mapper = + vtkSmartPointer::New(); + mapper->SetInputConnection(cube->GetOutputPort()); + vtkSmartPointer actor = vtkSmartPointer::New(); + actor->SetMapper(mapper); + + v_viewer.addProp(actor); + v_viewer.GetRenderer()->Render(); + v_viewer.Start(); + + END_TESTING; +} + diff --git a/src/Vtk/testing/vtkVoxImageTest.cpp b/src/Vtk/testing/vtkVoxImageTest.cpp new file mode 100644 index 0000000..579bf62 --- /dev/null +++ b/src/Vtk/testing/vtkVoxImageTest.cpp @@ -0,0 +1,102 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Math/VoxImage.h" +#include "Vtk/vtkVoxImage.h" +#include "Vtk/uLibVtkViewer.h" + +#include "testing-prototype.h" + +using namespace uLib; + +struct TestVoxel { + Scalarf Value; + unsigned int Count; +}; + +int main() +{ + BEGIN_TESTING(Vtk Vox Image); + + TestVoxel zero = {0,0}; + TestVoxel nonzero = {5.5*1E-6,100}; + +// { // SIMPLE TESTS // +// VoxImage img(Vector3i(10,10,10)); +// img.SetSpacing(Vector3f(3,3,3)); + +// img.InitVoxels(zero); +// img[Vector3i(3,3,3)] = nonzero; + +// Vtk::vtkVoxImage vtk_img(img); + +// vtk_img.SaveToXMLFile("test.vti"); +// vtk_img.setShadingPreset(0); + +// // vtk_img.ReadFromVKTFile("error.vtk"); + +// // VoxImage img2 = img; + +// // Vtk::vtkVoxImage vtk_img2(img2); + +// // img2.ExportToVtk("error_saved.vtk",0); + +// // vtk_img2.SaveToXMLFile("error_saved.vti"); + +// Vtk::Viewer viewer; +// viewer.AddPuppet(vtk_img); +// viewer.Start(); +// } + + { // SIMPLE TESTS // + VoxImage img(Vector3i(10,10,1)); + img.SetSpacing(Vector3f(3,3,3)); + + img.InitVoxels(zero); + img[Vector3i(3,3,0)] = nonzero; + + Vtk::vtkVoxImage vtk_img(img); + + vtk_img.ReadFromVKTFile("test.vtk"); + vtk_img.Update(); + + // vtk_img.SaveToXMLFile("test.vti"); + // vtk_img.setShadingPreset(0); + + // Vtk::vtkVoxImage vtk_img2(img2); + // img2.ExportToVtk("error_saved.vtk",0); + // vtk_img2.SaveToXMLFile("error_saved.vti"); + + Vtk::Viewer viewer; + viewer.AddPuppet(vtk_img); + viewer.Start(); + } + + + END_TESTING; +} diff --git a/src/Vtk/testing/vtkVoxRaytracerTest.cpp b/src/Vtk/testing/vtkVoxRaytracerTest.cpp new file mode 100644 index 0000000..7bd8816 --- /dev/null +++ b/src/Vtk/testing/vtkVoxRaytracerTest.cpp @@ -0,0 +1,156 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include +#include +#include + + +#include +#include + +#include "Vtk/vtkMuonScatter.h" +#include "Vtk/vtkStructuredGrid.h" +#include "Vtk/vtkVoxRaytracerRepresentation.h" +#include "Vtk/uLibVtkViewer.h" + +// remove +#include + +#include "testing-prototype.h" + +using namespace uLib; + + + +class vtkWidgetCallback : public vtkCommand +{ +public: + static vtkWidgetCallback *New() { return new vtkWidgetCallback; } + + void SetTracer(Vtk::vtkVoxRaytracerRepresentation *parent) + { + this->vtk_raytr = parent; + } + + void SetMuon (uLib::MuonScatter *muon) { this->muon = muon; } + + void SetAnnotation ( vtkCornerAnnotation *annotation) { + this->annotation = annotation; + } + + virtual void Execute(vtkObject *caller, unsigned long, void*) + { + char str[40]; + vtk_raytr->SetMuon(*muon); + if(annotation) + { + sprintf(str,"total length = %f",vtk_raytr->GetRay().TotalLength()); + annotation->SetText(1,str); + for(int i=0; iGetRay().Data().size(); ++i) + { + std::cout << "L[" << i << "] = " + << vtk_raytr->GetRay().Data().at(i).L << "\n"; + } + std::cout << "\n"; + } + } + +private: + vtkWidgetCallback() : + vtk_raytr(NULL), + muon(NULL), + annotation(NULL) {} + + uLib::VoxRaytracer *raytracer; + Vtk::vtkVoxRaytracerRepresentation *vtk_raytr; + uLib::MuonScatter *muon; + vtkCornerAnnotation *annotation; +}; + + + + +int main() +{ + BEGIN_TESTING(vtk VoxRaytracer); + + + // muon scatter // + MuonScatter muon; + muon.LineIn().origin << -6, 12, -6, 1; + muon.LineIn().direction << 1 , -1 , 1 , 0; + muon.LineOut().origin << 6 , -4 , 6 , 1; + muon.LineOut().direction << 1 , -1 , 1 , 0; + + Vtk::vtkMuonScatter v_muon(muon); + + + // structured grid // + ImageData grid(Vector3i(12,10,12)); + grid.SetSpacing(Vector3f(1,1,1)); + grid.SetPosition(Vector3f(0,0,0)); + + + Vtk::vtkStructuredGrid v_grid(grid); + + + // voxraytracer // + VoxRaytracer rt(grid); + HPoint3f pt; + rt.GetEntryPoint(muon.LineIn(),pt); + std::cout << pt.transpose() << "\n"; + + Vtk::vtkVoxRaytracerRepresentation v_rt(rt); + v_rt.SetMuon(muon); + v_rt.SetRayColor(Vector4f(1,0,0,1)); + + // // renderer // + Vtk::Viewer viewer; + + // widget // + vtkBoxWidget *widget = v_grid.GetWidget(); + + + vtkWidgetCallback *cbk = vtkWidgetCallback::New(); + cbk->SetTracer(&v_rt); + cbk->SetMuon(&muon); + cbk->SetAnnotation(viewer.GetAnnotation()); + widget->AddObserver(vtkCommand::InteractionEvent, cbk); + widget->SetInteractor(viewer.GetInteractor()); + widget->PlaceWidget(); + widget->On(); + + viewer.AddPuppet(v_grid); + viewer.AddPuppet(v_rt); + viewer.AddPuppet(v_muon); + viewer.Start(); + + + END_TESTING; +} diff --git a/src/Vtk/uLibVtkInterface.cxx b/src/Vtk/uLibVtkInterface.cxx new file mode 100644 index 0000000..15a06a6 --- /dev/null +++ b/src/Vtk/uLibVtkInterface.cxx @@ -0,0 +1,238 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#if VTK_MAJOR_VERSION <= 5 +# +#else +# include +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "uLibVtkInterface.h" + + + + + + + +namespace uLib { +namespace Vtk { + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// POLYDATA // + + +void Polydata::SaveToFile(const char *vtk_file) +{ + vtkSmartPointer writer = + vtkSmartPointer::New(); + writer->SetFileName(vtk_file); + vtkPolyData * data = GetPolyData(); + if(data) { +# if VTK_MAJOR_VERSION <= 5 + writer->SetInputConnection(data->GetProducerPort()); +# else + writer->SetInputData(data); +# endif + writer->Update(); + } +} + +void Polydata::SaveToXMLFile(const char *vtp_file) +{ + vtkSmartPointer writer = + vtkSmartPointer::New(); + writer->SetFileName(vtp_file); + vtkPolyData * data = GetPolyData(); + if(data) { +# if VTK_MAJOR_VERSION <= 5 + writer->SetInputConnection(data->GetProducerPort()); +# else + writer->SetInputData(data); +# endif + writer->Update(); + } +} + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// PUPPET // + +// PIMPL -------------------------------------------------------------------- // + +class PuppetData { +public: + PuppetData() : + m_Renderers(vtkRendererCollection::New()), + m_Assembly(vtkPropAssembly::New()) + {} + + ~PuppetData() { + m_Renderers->RemoveAllItems(); + m_Assembly->GetParts()->RemoveAllItems(); + m_Renderers->Delete(); + m_Assembly->Delete(); + } + + // members // + vtkRendererCollection *m_Renderers; + vtkPropAssembly *m_Assembly; +}; + +// -------------------------------------------------------------------------- // + + + + +Puppet::Puppet() : d(new PuppetData) { } + +Puppet::~Puppet() +{ + delete d; +} + +vtkProp *Puppet::GetProp() +{ + if (d->m_Assembly->GetParts()->GetNumberOfItems() == 1) + { + // d->m_Assembly->GetParts()->InitTraversal(); + // return d->m_Assembly->GetParts()->GetNextProp(); + return d->m_Assembly->GetParts()->GetLastProp(); + } + else return d->m_Assembly; +} + +void Puppet::SetProp(vtkProp *prop) +{ + if(prop) d->m_Assembly->AddPart(prop); +} + +void Puppet::RemoveProp(vtkProp *prop) +{ + // TODO +} + + +vtkPropCollection *Puppet::GetProps() +{ + return d->m_Assembly->GetParts(); +} + +void Puppet::ConnectRenderer(vtkRenderer *renderer) +{ + if(renderer) { + this->GetRenderers()->AddItem(renderer); + if(d->m_Assembly->GetParts()->GetNumberOfItems() == 1) + renderer->AddActor(this->GetProp()); + else if(d->m_Assembly->GetParts()->GetNumberOfItems() >0) + { + vtkPropCollection *props = d->m_Assembly->GetParts(); + props->InitTraversal(); + for (int i=0; iGetNumberOfItems(); ++i) + renderer->AddActor(props->GetNextProp()); + } + } +} + +void Puppet::DisconnectRenderer(vtkRenderer *renderer) +{ + if(renderer) { + if(this->GetProp()) + renderer->RemoveViewProp(this->GetProp()); + else if(d->m_Assembly->GetParts()->GetNumberOfItems() >0) + { + vtkPropCollection *props = d->m_Assembly->GetParts(); + props->InitTraversal(); + for (int i=0; iGetNumberOfItems(); ++i) + renderer->RemoveViewProp(props->GetNextProp()); + } + this->GetRenderers()->RemoveItem(renderer); + } +} + +void Puppet::ConnectViewer(Viewer *viewer) +{ + // TODO +} + +void Puppet::DisonnectViewer(Viewer *viewer) +{ + // TODO +} + +vtkRendererCollection *Puppet::GetRenderers() const +{ + return d->m_Renderers; +} + +void Puppet::PrintSelf(std::ostream &o) const +{ + o << "Props Assembly: \n"; + d->m_Assembly->PrintSelf(o,vtkIndent(1)); + + o << "Connected Renderers: \n"; + d->m_Renderers->PrintSelf(o,vtkIndent(1)); +} + + + + + + + + + + +} // Vtk +} // uLib diff --git a/src/Vtk/uLibVtkInterface.h b/src/Vtk/uLibVtkInterface.h new file mode 100644 index 0000000..1e2687a --- /dev/null +++ b/src/Vtk/uLibVtkInterface.h @@ -0,0 +1,124 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef ULIBVTKINTERFACE_H +#define ULIBVTKINTERFACE_H + + + +#include +#include + +#include +#include + + + +// vtk classes forward declaration // +class vtkProp; +class vtkPolyData; +class vtkPropCollection; +class vtkRenderer; +class vtkRendererCollection; + + +namespace uLib { +namespace Vtk { + + + +//template +//class Tie { + +//public: +// typedef T Content; + + +//}; + + + +class Puppet : public Object +{ + uLibTypeMacro(Puppet, Object) +public: + Puppet(); + ~Puppet(); + + virtual vtkProp * GetProp(); + + virtual vtkPropCollection * GetProps(); + + void ConnectRenderer(vtkRenderer *renderer); + + void DisconnectRenderer(vtkRenderer *renderer); + + void ConnectViewer(class Viewer *viewer); + + void DisonnectViewer(class Viewer *viewer); + + vtkRendererCollection * GetRenderers() const; + + + virtual void PrintSelf(std::ostream &o) const; + + virtual void ConnectInteractor(class vtkRenderWindowInteractor *interactor) { (void)interactor; } + +protected: + + void SetProp(vtkProp *prop); + + void RemoveProp(vtkProp *prop); + +private: + friend class PuppetData; + class PuppetData *d; +}; + + + + +class Polydata { +public: + + virtual vtkPolyData * GetPolyData() const { return NULL; } + + virtual void SaveToFile(const char *vtk_file); + + virtual void SaveToXMLFile(const char *vtp_file); + +protected: + virtual ~Polydata() {} +}; + + +} // vtk +} // uLib + + + +#endif // ULIBVTKINTERFACE_H diff --git a/src/Vtk/uLibVtkViewer.cpp b/src/Vtk/uLibVtkViewer.cpp new file mode 100644 index 0000000..0f50e5d --- /dev/null +++ b/src/Vtk/uLibVtkViewer.cpp @@ -0,0 +1,190 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "uLibVtkViewer.h" + +namespace uLib { +namespace Vtk { + +template <> +class Tie { +public: + void DoAction() { + std::cout << " VIEWER TIE !!! \n"; + } +}; + + +//// PIMPL ///////////////////////////////////////////////////////////////////// + +class ViewerPimpl { +public: + ViewerPimpl() : + m_RenderWindow(vtkRenderWindow::New()), + m_Renderer(vtkRenderer::New()), + m_Annotation(vtkCornerAnnotation::New()), + m_Marker(vtkOrientationMarkerWidget::New()) + { + this->InstallPipe(); + } + + ~ViewerPimpl() { + this->UninstallPipe(); + + m_Annotation->Delete(); + m_Marker->Delete(); + m_Renderer->Delete(); + m_RenderWindow->Delete(); + } + + // members // + vtkRenderer *m_Renderer; + vtkRenderWindow *m_RenderWindow; + vtkCornerAnnotation *m_Annotation; + vtkOrientationMarkerWidget *m_Marker; + +private: + void InstallPipe() + { + m_RenderWindow->AddRenderer(m_Renderer); + vtkSmartPointer renderWindowInteractor = + vtkSmartPointer::New(); + renderWindowInteractor->SetRenderWindow(m_RenderWindow); + + // annotation // + m_Annotation->GetTextProperty()->SetColor(1,1,1); + m_Annotation->GetTextProperty()->SetFontFamilyToArial(); + m_Annotation->GetTextProperty()->SetOpacity(0.5); + m_Annotation->SetMaximumFontSize(10); + m_Annotation->SetText(0,"uLib VTK Viewer - OpenCMT all right reserved."); + m_Renderer->AddViewProp(m_Annotation); + + // orientation marker // + vtkSmartPointer axes = + vtkSmartPointer::New(); + m_Marker->SetInteractor(renderWindowInteractor); + m_Marker->SetOrientationMarker(axes); + m_Marker->SetViewport(0.0,0.0,0.2,0.2); + m_Marker->SetEnabled(true); + m_Marker->InteractiveOff(); + + // Must be rendered here in Vtk-6.0 or seg-fault // + m_RenderWindow->Render(); + } + + void UninstallPipe() { + m_Renderer->RemoveAllViewProps(); + m_Renderer->Clear(); + } + +}; + + + + +//////////////////////////////////////////////////////////////////////////////// +///// VTK VIEWER ////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +Viewer::Viewer() : d(new ViewerPimpl) {} + +Viewer::~Viewer() { delete d; } + + +void Viewer::addProp(vtkProp *prop) +{ + d->m_Renderer->AddActor(prop); + d->m_Renderer->Render(); +} + +void Viewer::RemoveProp(vtkProp *prop) +{ + d->m_Renderer->RemoveViewProp(prop); + d->m_Renderer->Render(); +} + +void Viewer::AddPuppet(Puppet &prop) +{ + prop.ConnectRenderer(d->m_Renderer); + d->m_Renderer->Render(); +} + +void Viewer::RemovePuppet(Puppet &prop) +{ + prop.DisconnectRenderer(d->m_Renderer); + d->m_Renderer->Render(); +} + +void Viewer::Start() +{ + d->m_RenderWindow->GetInteractor()->Start(); +} + +vtkCornerAnnotation *Viewer::GetAnnotation() +{ + return d->m_Annotation; +} + +vtkRenderer *Viewer::GetRenderer() +{ + return d->m_Renderer; +} + +vtkRenderWindowInteractor *Viewer::GetInteractor() +{ + return d->m_RenderWindow->GetInteractor(); +} + +void Viewer::Reset() +{ + d->m_Renderer->ResetCameraClippingRange(); + d->m_Renderer->ResetCamera(); + d->m_Renderer->Render(); +} + + +} // vtk +} // uLib + diff --git a/src/Vtk/uLibVtkViewer.h b/src/Vtk/uLibVtkViewer.h new file mode 100644 index 0000000..cc9e8a9 --- /dev/null +++ b/src/Vtk/uLibVtkViewer.h @@ -0,0 +1,90 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef ULIBVTKVIEWER_H +#define ULIBVTKVIEWER_H + +#include "uLibVtkInterface.h" + + +class vtkProp; +class vtk3DWidget; +class vtkCornerAnnotation; +class vtkRenderWindowInteractor; +class vtkRenderer; + +namespace uLib { +namespace Vtk { + + +template +class Tie { +public: + void DoAction() { + std::cout << "Tie::DoAction -> generic Tie does nothing\n"; + } +}; + + +class Viewer { + +public: + Viewer(); + ~Viewer(); + + + void AddPuppet(Puppet &prop); + + void RemovePuppet(Puppet &prop); + + void AddWidget(vtk3DWidget *widget); + + void Reset(); + + void Start(); + + vtkCornerAnnotation *GetAnnotation(); + + vtkRenderer * GetRenderer(); + + vtkRenderWindowInteractor * GetInteractor(); + + void addProp(vtkProp *prop); + + void RemoveProp(vtkProp *prop); + +private: + class ViewerPimpl *d; +}; + +template <> class Tie; + + +} // vtk +} // uLib + +#endif // ULIBVTKVIEWER_H diff --git a/src/Vtk/vtkContainerBox.cpp b/src/Vtk/vtkContainerBox.cpp new file mode 100644 index 0000000..0245946 --- /dev/null +++ b/src/Vtk/vtkContainerBox.cpp @@ -0,0 +1,158 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "vtkContainerBox.h" + +#include "Math/Dense.h" +#include "Math/VectorSpace.h" +#include "Math/ContainerBox.h" + +namespace uLib { +namespace Vtk { + + +// PIMPL -------------------------------------------------------------------- // + +class vtkContainerBoxPimpl { +public: + vtkContainerBoxPimpl() : + m_Cube(vtkActor::New()), + m_Axes(vtkActor::New()), + m_Pivot(vtkActor::New()), + m_Content(NULL) + {} + + ~vtkContainerBoxPimpl() + { + m_Cube->Delete(); + m_Axes->Delete(); + m_Pivot->Delete(); + } + + // MEMBERS // + vtkActor *m_Cube; + vtkActor *m_Axes; + vtkActor *m_Pivot; + vtkContainerBox::Content *m_Content; +}; + +// -------------------------------------------------------------------------- // + + + + +vtkContainerBox::vtkContainerBox(vtkContainerBox::Content &content) : + d( new vtkContainerBoxPimpl) +{ + d->m_Content = &content; + this->InstallPipe(); +} + +vtkContainerBox::~vtkContainerBox() +{ + delete d; +} + +vtkPolyData *vtkContainerBox::GetPolyData() const +{ + // TODO +} + +void vtkContainerBox::InstallPipe() +{ + if(!d->m_Content) return; + Content *c = d->m_Content; + + // CUBE + vtkSmartPointer cube = vtkSmartPointer::New(); + Vector3f p = c->GetPosition(); + cube->SetCenter(p(0),p(1),p(2)); + Vector4f p1 = c->GetWorldPoint(HPoint3f(0,0,0)); + Vector4f p2 = c->GetWorldPoint(HPoint3f(1,1,1)); + vtkSmartPointer line = vtkSmartPointer::New(); + line->SetPoint1(p1(0),p1(1),p1(2)); + line->SetPoint2(p2(0),p2(1),p2(2)); + line->Update(); + cube->SetBounds(line->GetOutput()->GetBounds()); + vtkSmartPointer mapper = + vtkSmartPointer::New(); + mapper->SetInputConnection(cube->GetOutputPort()); + mapper->Update(); + d->m_Cube->SetMapper(mapper); + d->m_Cube->GetProperty()->SetRepresentationToWireframe(); + d->m_Cube->GetProperty()->SetAmbient(0.7); + + // AXES // + vtkSmartPointer axes = vtkSmartPointer::New(); + axes->SetOrigin(p1(0),p1(1),p1(2)); + mapper = vtkSmartPointer::New(); + mapper->SetInputConnection(axes->GetOutputPort()); + mapper->Update(); + d->m_Axes->SetMapper(mapper); + Vector3f s = c->GetSize(); + // d->m_Axes->SetScale(s(0),s(1),s(2)); + d->m_Axes->GetProperty()->SetLineWidth(3); + d->m_Axes->GetProperty()->SetAmbient(0.4); + d->m_Axes->GetProperty()->SetSpecular(0); + + // PIVOT // + axes = vtkSmartPointer::New(); + axes->SetOrigin(p(0),p(1),p(2)); + mapper = vtkSmartPointer::New(); + mapper->SetInputConnection(axes->GetOutputPort()); + mapper->Update(); + d->m_Pivot->SetMapper(mapper); + s = c->GetScale(); + // d->m_Pivot->SetScale(s(0),s(1),s(2)); + d->m_Pivot->GetProperty()->SetLineWidth(3); + d->m_Pivot->GetProperty()->SetAmbient(0.4); + d->m_Pivot->GetProperty()->SetSpecular(0); + + this->SetProp(d->m_Cube); + this->SetProp(d->m_Axes); + this->SetProp(d->m_Pivot); +} + + + +} // vtk +} // uLib diff --git a/src/Vtk/vtkContainerBox.h b/src/Vtk/vtkContainerBox.h new file mode 100644 index 0000000..1cebf48 --- /dev/null +++ b/src/Vtk/vtkContainerBox.h @@ -0,0 +1,57 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_VTKCONTAINERBOX_H +#define U_VTKCONTAINERBOX_H + + +#include "uLibVtkInterface.h" +#include "Math/ContainerBox.h" + + +namespace uLib { +namespace Vtk { + +class vtkContainerBox : public Puppet, public Polydata { + typedef ContainerBox Content; +public: + vtkContainerBox(Content &content); + ~vtkContainerBox(); + + virtual class vtkPolyData *GetPolyData() const; + +private: + void InstallPipe(); + + friend class vtkContainerBoxPimpl; + class vtkContainerBoxPimpl *d; +}; + +} // vtk +} // uLib + +#endif // VTKCONTAINERBOX_H diff --git a/src/Vtk/vtkHLineRepresentation.h b/src/Vtk/vtkHLineRepresentation.h new file mode 100644 index 0000000..c69ea14 --- /dev/null +++ b/src/Vtk/vtkHLineRepresentation.h @@ -0,0 +1,52 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VTKHLINEREPRESENTATION_H +#define VTKHLINEREPRESENTATION_H + + + +class vtkProp; +class vtkPolyData; + + +namespace uLib { + +class vtkHLineRepresentationDefault { + +public: + vtkHLineRepresentationDefault(); + + +}; + + +} + + + +#endif // VTKHLINEREPRESENTATION_H diff --git a/src/Vtk/vtkMuonContainerScattering.cpp b/src/Vtk/vtkMuonContainerScattering.cpp new file mode 100644 index 0000000..b49a65e --- /dev/null +++ b/src/Vtk/vtkMuonContainerScattering.cpp @@ -0,0 +1,35 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + + +// TO BE CONTINUED // diff --git a/src/Vtk/vtkMuonContainerScattering.h b/src/Vtk/vtkMuonContainerScattering.h new file mode 100644 index 0000000..b1ef9be --- /dev/null +++ b/src/Vtk/vtkMuonContainerScattering.h @@ -0,0 +1,77 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VTKMUONCONTAINERSCATTERING_H +#define VTKMUONCONTAINERSCATTERING_H + + + +#include "Core/Macros.h" +#include "Math/Dense.h" + +#include "uLibVtkInterface.h" +#include "Detectors/MuonScatter.h" + +class vtkRenderWindowInteractor; + +namespace uLib { + +class vtkMuonContainerScattering : public Abstract::uLibVtkPolydata { + typedef MuonScatter Content; +public: + vtkMuonContainerScattering(const MuonScatter &content); + ~vtkMuonScatter(); + + Content& GetContent(); + + void PrintSelf(std::ostream &o) const; + + virtual vtkProp *GetProp(); + + virtual vtkPolyData* GetPolyData() const; + + void AddPocaPoint(HPoint3f poca); + + HPoint3f GetPocaPoint(); + + void vtkStartInteractive(); + +protected: + void ConnectInteractor(vtkRenderWindowInteractor *interactor); + +private: + void InstallPipe(); + + friend class vtkMuonContainerScatteringPimpl; + class vtkMuonContainerScatteringPimpl *d; +}; + + +} + + +#endif // VTKMUONCONTAINERSCATTERING_H diff --git a/src/Vtk/vtkMuonEvent.cxx b/src/Vtk/vtkMuonEvent.cxx new file mode 100644 index 0000000..db34b24 --- /dev/null +++ b/src/Vtk/vtkMuonEvent.cxx @@ -0,0 +1,214 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#include "vtkMuonEvent.h" +#include "Math/Dense.h" + +namespace uLib { + +///// CALLBACK ///////////////////////////////////////////////////////////////// + +class vtkWidgetCallback : public vtkCommand +{ +public: + static vtkWidgetCallback *New() + { return new vtkWidgetCallback; } + void SetParent(uLib::vtkMuonEvent *parent) { this->parent = parent; } + virtual void Execute(vtkObject *caller, unsigned long, void*) + { + vtkSmartPointer t = + vtkSmartPointer::New(); + vtkBoxWidget *widget = reinterpret_cast(caller); + widget->GetTransform(t); + //parent->SetTransform(t); + //std::cout << "event\n"; + } +private: + uLib::vtkMuonEvent *parent; +}; + + +//// PIMPL ///////////////////////////////////////////////////////////////////// + +class vtkMuonEventPimpl { + typedef vtkWidgetCallback Callback; +public: + vtkMuonEventPimpl() : + m_Prop(vtkActor::New()), + m_PolyData(NULL), + m_Appender(vtkAppendPolyData::New()), + content(NULL) + {} + + ~vtkMuonEventPimpl() + { + m_Prop->Delete(); + } + + // members // + vtkMuonEvent::Content *content; + vtkPolyData *m_PolyData; + vtkActor *m_Prop; + + vtkAppendPolyData *m_Appender; + vtkBoxWidget *m_WidgetIN, *m_WidgetOUT; + HPoint3f m_Poca; +}; + + + + + + +//////////////////////////////////////////////////////////////////////////////// +///// VTK MUON EVENT ///////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +vtkMuonEvent::vtkMuonEvent(MuonEventData &content) : + d(new vtkMuonEventPimpl) +{ + d->content = &content; + InstallPipe(); +} + +vtkMuonEvent::vtkMuonEvent(const MuonEventData &content) : + d(new vtkMuonEventPimpl) +{ + d->content = const_cast(&content); + InstallPipe(); +} + + +vtkMuonEvent::~vtkMuonEvent() +{ + if (d->m_Prop) d->m_Prop->Delete(); +} + +vtkMuonEvent::Content &vtkMuonEvent::GetContent() +{ + return *d->content; +} + +void vtkMuonEvent::PrintSelf(std::ostream &o) const +{ + o << "..:: MuonEvent ::..\n" \ + "\t[in] Origin > " << d->content->LineIn().origin.transpose() << "\n" << + "\t[in] Direction > " << d->content->LineIn().direction.transpose() << "\n" << + "\t[out] Origin > " << d->content->LineOut().origin.transpose() << "\n" << + "\t[out] Direction > " << d->content->LineOut().direction.transpose()<< "\n" << + "\tMomentum > " << d->content->GetMomentum() << "\n" << + "...................\n"; +} + +vtkProp *vtkMuonEvent::GetProp() +{ + return d->m_Prop; +} + +void vtkMuonEvent::InstallPipe() +{ + + + vtkAppendPolyData *appender = d->m_Appender; + vtkSmartPointer mapper = vtkSmartPointer::New(); + + if(d->content) { + vtkSmartPointer line_in = vtkSmartPointer::New(); + vtkSmartPointer line_out = vtkSmartPointer::New(); + + float distance = (d->content->LineIn().origin - d->content->LineOut().origin).norm() / 10; + + HPoint3f pt; + pt = d->content->LineIn().origin; + line_in->SetPoint1(pt(0),pt(1),pt(2)); + pt= d->content->LineIn().origin + d->content->LineIn().direction * distance; + line_in->SetPoint2(pt(0),pt(1),pt(2)); + pt = d->content->LineOut().origin; + line_out->SetPoint1(pt(0),pt(1),pt(2)); + pt = d->content->LineOut().origin + d->content->LineOut().direction * distance; + line_out->SetPoint2(pt(0),pt(1),pt(2)); + + appender->AddInputConnection(line_in->GetOutputPort()); + appender->AddInputConnection(line_out->GetOutputPort()); + } + + appender->Update(); + mapper->SetInputConnection(appender->GetOutputPort()); + mapper->Update(); + d->m_Prop->SetMapper(mapper); +} + +vtkPolyData *vtkMuonEvent::GetPolyData() const +{ + return d->m_Appender->GetOutput(); +} + +void vtkMuonEvent::AddPocaPoint(HPoint3f poca) +{ + d->m_Poca = poca; + vtkSmartPointer sphere = + vtkSmartPointer::New(); + float size = (d->content->LineIn().origin - d->content->LineOut().origin).head(3).norm(); + size /= 100; + sphere->SetRadius(size); + sphere->SetCenter(poca(0),poca(1),poca(2)); + sphere->Update(); + d->m_Appender->AddInputConnection(sphere->GetOutputPort()); + d->m_Appender->Update(); +} + +HPoint3f vtkMuonEvent::GetPocaPoint() +{ + return d->m_Poca; +} + + + + + +} diff --git a/src/Vtk/vtkMuonEvent.h b/src/Vtk/vtkMuonEvent.h new file mode 100644 index 0000000..310fc08 --- /dev/null +++ b/src/Vtk/vtkMuonEvent.h @@ -0,0 +1,74 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VTKMUONEVENT_H +#define VTKMUONEVENT_H + +#include "Core/Macros.h" +#include "Math/Dense.h" + +#include "uLibVtkInterface.h" +#include "Detectors/MuonEvent.h" + + + + +namespace uLib { + +class vtkMuonEvent : public Abstract::uLibVtkPolydata { + typedef MuonEventData Content; +public: + vtkMuonEvent(const MuonEventData &content); + vtkMuonEvent(MuonEventData &content); + ~vtkMuonEvent(); + + Content& GetContent(); + + void PrintSelf(std::ostream &o) const; + + virtual vtkProp *GetProp(); + + virtual vtkPolyData* GetPolyData() const; + + void AddPocaPoint(HPoint3f poca); + + HPoint3f GetPocaPoint(); + + void vtkStartInteractive(); + + +private: + void InstallPipe(); + + friend class vtkMuonEventPimpl; + class vtkMuonEventPimpl *d; +}; + + +} + +#endif // VTKMUONSCATTER_H diff --git a/src/Vtk/vtkMuonScatter.cxx b/src/Vtk/vtkMuonScatter.cxx new file mode 100644 index 0000000..c4ea984 --- /dev/null +++ b/src/Vtk/vtkMuonScatter.cxx @@ -0,0 +1,238 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#include "vtkMuonScatter.h" +#include "Math/Dense.h" +#include "Math/VectorSpace.h" + + +namespace uLib { +namespace Vtk { + +///// CALLBACK ///////////////////////////////////////////////////////////////// + +//namespace { + +//class vtkWidgetCallback : public vtkCommand +//{ +//public: +// static vtkWidgetCallback *New() +// { return new vtkWidgetCallback; } +// void SetParent(uLib::vtkMuonScatter *parent) { this->parent = parent; } +// virtual void Execute(vtkObject *caller, unsigned long, void*) +// { +// vtkSmartPointer t = +// vtkSmartPointer::New(); +// vtkBoxWidget *widget = reinterpret_cast(caller); +// widget->GetTransform(t); +// //parent->SetTransform(t); +// //std::cout << "Scatter\n"; +// } +//private: +// uLib::vtkMuonScatter *parent; +//}; + +//} + +//// PIMPL ///////////////////////////////////////////////////////////////////// + +class vtkMuonScatterPimpl { +public: + vtkMuonScatterPimpl() : + m_Content(NULL), + m_LineIn(vtkLineSource::New()), + m_LineOut(vtkLineSource::New()), + m_PolyData(vtkPolyData::New()), + m_SpherePoca(NULL) + {} + + ~vtkMuonScatterPimpl() + { + m_LineIn->Delete(); + m_LineOut->Delete(); + if(m_SpherePoca) m_SpherePoca->Delete(); + } + + // members // + vtkMuonScatter::Content *m_Content; + vtkLineSource *m_LineIn, *m_LineOut; + vtkSphereSource *m_SpherePoca; + vtkPolyData *m_PolyData; +}; + + + + + + +//////////////////////////////////////////////////////////////////////////////// +///// VTK MUON Scatter ///////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +vtkMuonScatter::vtkMuonScatter(MuonScatter &content) : + d(new vtkMuonScatterPimpl) +{ + d->m_Content = &content; + InstallPipe(); +} + +vtkMuonScatter::vtkMuonScatter(const MuonScatter &content) : + d(new vtkMuonScatterPimpl) +{ + d->m_Content = const_cast(&content); + InstallPipe(); +} + + +vtkMuonScatter::~vtkMuonScatter() +{ + delete d; +} + +vtkMuonScatter::Content &vtkMuonScatter::GetContent() +{ + return *d->m_Content; +} + +void vtkMuonScatter::PrintSelf(std::ostream &o) const +{ + // o << d->content; +} + + +void vtkMuonScatter::InstallPipe() +{ + if(d->m_Content) { + vtkLineSource *line_in = d->m_LineIn; + vtkLineSource *line_out = d->m_LineOut; + + float distance = (d->m_Content->LineIn().origin() - d->m_Content->LineOut().origin()).norm() / 10; + + Vector4f pt; + pt = d->m_Content->LineIn().origin(); + line_in->SetPoint1(pt(0),pt(1),pt(2)); + pt= d->m_Content->LineIn().origin() + d->m_Content->LineIn().direction() * distance; + line_in->SetPoint2(pt(0),pt(1),pt(2)); + pt = d->m_Content->LineOut().origin(); + line_out->SetPoint1(pt(0),pt(1),pt(2)); + pt = d->m_Content->LineOut().origin() + d->m_Content->LineOut().direction() * distance; + line_out->SetPoint2(pt(0),pt(1),pt(2)); + } + + vtkSmartPointer mapper = vtkSmartPointer::New(); + mapper->SetInputConnection(d->m_LineIn->GetOutputPort()); + vtkSmartPointer actor = vtkSmartPointer::New(); + actor->SetMapper(mapper); + this->SetProp(actor); + + mapper = vtkSmartPointer::New(); + mapper->SetInputConnection(d->m_LineOut->GetOutputPort()); + actor = vtkSmartPointer::New(); + actor->SetMapper(mapper); + this->SetProp(actor); +} + +vtkPolyData *vtkMuonScatter::GetPolyData() const +{ + vtkSmartPointer append = vtkSmartPointer::New(); +//# if VTK_MAJOR_VERSION <= 5 + append->AddInputConnection(d->m_LineIn->GetOutputPort()); + append->AddInputConnection(d->m_LineOut->GetOutputPort()); + if(d->m_SpherePoca) append->AddInputConnection(d->m_SpherePoca->GetOutputPort()); +//# else +// append->AddInputData(d->m_LineIn->GetOutput()); +// append->AddInputData(d->m_LineOut->GetOutput()); +// if(d->m_SpherePoca) append->AddInputData(d->m_SpherePoca->GetOutput()); +//# endif + append->Update(); + d->m_PolyData->DeepCopy(append->GetOutput()); + return d->m_PolyData; +} + +void vtkMuonScatter::AddPocaPoint(Vector4f poca) +{ + vtkSphereSource *sphere = vtkSphereSource::New(); + float size = (d->m_Content->LineIn().origin() - d->m_Content->LineOut().origin()).head(3).norm(); + size /= 100; + sphere->SetRadius(size); + sphere->SetCenter(poca(0),poca(1),poca(2)); + sphere->Update(); + d->m_SpherePoca = sphere; + + vtkSmartPointer mapper = vtkSmartPointer::New(); + mapper->SetInputConnection(d->m_SpherePoca->GetOutputPort()); + vtkSmartPointer actor = vtkSmartPointer::New(); + actor->SetMapper(mapper); + this->SetProp(actor); +} + +Vector4f vtkMuonScatter::GetPocaPoint() +{ + double center[3]; + if(d->m_SpherePoca) { + d->m_SpherePoca->GetCenter(center); + return HPoint3f(center[0],center[1],center[2]); + } + else { + return HPoint3f(0,0,0); + } +} + + +void vtkMuonScatter::ConnectInteractor(vtkRenderWindowInteractor *interactor) +{ + // TODO +} + + + + +} // vtk +} // uLib diff --git a/src/Vtk/vtkMuonScatter.h b/src/Vtk/vtkMuonScatter.h new file mode 100644 index 0000000..4b2de71 --- /dev/null +++ b/src/Vtk/vtkMuonScatter.h @@ -0,0 +1,76 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VTKMUONSCATTER_H +#define VTKMUONSCATTER_H + +#include "Core/Macros.h" +#include "Math/Dense.h" + +#include "uLibVtkInterface.h" +#include "Detectors/MuonScatter.h" + +class vtkRenderWindowInteractor; + +namespace uLib { +namespace Vtk { + +class vtkMuonScatter : public Puppet, public Polydata { + typedef MuonScatter Content; +public: + + vtkMuonScatter(const MuonScatter &content); + vtkMuonScatter(MuonScatter &content); + + ~vtkMuonScatter(); + + Content &GetContent(); + + void PrintSelf(std::ostream &o) const; + + virtual vtkPolyData* GetPolyData() const; + + void AddPocaPoint(Vector4f poca); + + Vector4f GetPocaPoint(); + + void vtkStartInteractive(); + +protected: + void ConnectInteractor(vtkRenderWindowInteractor *interactor); + +private: + void InstallPipe(); + + friend class vtkMuonScatterPimpl; + class vtkMuonScatterPimpl *d; +}; + +} // vtk +} // uLib + +#endif // VTKMUONSCATTER_H diff --git a/src/Vtk/vtkPolydata.h b/src/Vtk/vtkPolydata.h new file mode 100644 index 0000000..5aa5b27 --- /dev/null +++ b/src/Vtk/vtkPolydata.h @@ -0,0 +1,49 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VTKPOLYDATA_H +#define VTKPOLYDATA_H + +#include "uLibVtkInterface.h" + + +namespace uLib { + +class vtkPolyData : public Abstract::uLibVtkPolydata { + typedef ::vtkPolyData Content; +public: + + + +}; + + + +} + + +#endif // VTKPOLYDATA_H diff --git a/src/Vtk/vtkStructuredGrid.cpp b/src/Vtk/vtkStructuredGrid.cpp new file mode 100644 index 0000000..05f0214 --- /dev/null +++ b/src/Vtk/vtkStructuredGrid.cpp @@ -0,0 +1,195 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "Math/ImageData.h" +#include "Vtk/vtkStructuredGrid.h" + +namespace uLib { +namespace Vtk { + +//////////////////////////////////////////////////////////////////////////////// +////// PIMPL ////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + +class vtkStructuredGridPimpl { + + // ---- WIDGET CBK ------------------------------------------------------ // + class vtkWidgetCallback : public vtkCommand + { + public: + static vtkWidgetCallback *New() { return new vtkWidgetCallback; } + void SetParent(uLib::Vtk::vtkStructuredGrid *parent) { this->parent = parent; } + virtual void Execute(vtkObject *caller, unsigned long, void*) + { + vtkSmartPointer t = + vtkSmartPointer::New(); + vtkBoxWidget *widget = reinterpret_cast(caller); + widget->GetTransform(t); + parent->SetTransform(t); + //std::cout << "event\n"; + } + private: + uLib::Vtk::vtkStructuredGrid *parent; + }; + // ---------------------------------------------------------------------- // + +public: + vtkStructuredGridPimpl(vtkStructuredGrid *parent, ImageData &content) : + p(parent), + m_Content(&content), + m_Actor(vtkActor::New()), + m_Widget(vtkBoxWidget::New()), + m_Transform(vtkTransform::New()) + { + vtkSmartPointer callback = + vtkSmartPointer::New(); + callback->SetParent(p); + m_Widget->AddObserver(vtkCommand::InteractionEvent, callback); + } + + ~vtkStructuredGridPimpl() + { + m_Actor->Delete(); + m_Widget->Delete(); + m_Transform->Delete(); + } + + // members // + vtkActor *m_Actor; + vtkBoxWidget *m_Widget; + ImageData *m_Content; + vtkTransform *m_Transform; +private: + vtkStructuredGrid *p; +}; + + +//////////////////////////////////////////////////////////////////////////////// +////// VTK STRUCTURED GRID ///////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + + +vtkStructuredGrid::vtkStructuredGrid(Content &content) : + d(new vtkStructuredGridPimpl(this,content)) +{ + this->InstallPipe(); +} + +vtkStructuredGrid::~vtkStructuredGrid() +{ + delete d; +} + + +void vtkStructuredGrid::SetTransform(vtkTransform *t) +{ + vtkMatrix4x4 *vmat = t->GetMatrix(); + Matrix4f mat; + for(int i=0; i<4; ++i) + for(int j=0; j<4; ++j) + mat(i,j) = vmat->GetElement(i,j); + d->m_Content->SetMatrix(mat); + + vtkSmartPointer vmat2 = vtkSmartPointer::New(); + mat = d->m_Content->GetWorldMatrix(); + for(int i=0; i<4; ++i) + for(int j=0; j<4; ++j) + vmat2->SetElement(i,j,mat(i,j)); + d->m_Transform->SetMatrix(vmat2); + d->m_Transform->Update(); + this->Update(); +} + +vtkBoxWidget *vtkStructuredGrid::GetWidget() +{ + return d->m_Widget; +} + +void vtkStructuredGrid::Update() +{ + d->m_Actor->GetMapper()->Update(); +} + +void vtkStructuredGrid::InstallPipe() +{ + vtkSmartPointer cube = + vtkSmartPointer::New(); + vtkSmartPointer filter = + vtkSmartPointer::New(); + + vtkSmartPointer vmat = vtkSmartPointer::New(); + Matrix4f mat = d->m_Content->GetWorldMatrix(); + for(int i=0; i<4; ++i) + for(int j=0; j<4; ++j) + vmat->SetElement(i,j,mat(i,j)); + d->m_Transform->SetMatrix(vmat); + filter->SetTransform(d->m_Transform); + filter->SetInputConnection(cube->GetOutputPort()); + + Vector3i dims = d->m_Content->GetDims(); + cube->SetBounds(0,dims(0),0,dims(1),0,dims(2)); + cube->Update(); + filter->Update(); + + vtkSmartPointer mapper = + vtkSmartPointer::New(); + mapper->SetInputConnection(filter->GetOutputPort()); + + d->m_Actor->SetMapper(mapper); + d->m_Actor->GetProperty()->SetRepresentationToSurface(); + d->m_Actor->GetProperty()->SetEdgeVisibility(true); + d->m_Actor->GetProperty()->SetOpacity(0.4); + d->m_Actor->GetProperty()->SetAmbient(0.7); + // set content transform to actor // + this->Update(); + d->m_Widget->SetProp3D(d->m_Actor); + + this->SetProp(d->m_Actor); +} + + +} // vtk +} // uLib diff --git a/src/Vtk/vtkStructuredGrid.h b/src/Vtk/vtkStructuredGrid.h new file mode 100644 index 0000000..f77c88c --- /dev/null +++ b/src/Vtk/vtkStructuredGrid.h @@ -0,0 +1,67 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_VTKSTRUCTUREDGRID_H +#define U_VTKSTRUCTUREDGRID_H + +#include "Core/Macros.h" +#include "Math/Dense.h" + +#include "uLibVtkInterface.h" +#include "Math/ImageData.h" + + +namespace uLib { +namespace Vtk { + +class vtkStructuredGrid : public Puppet { + typedef ImageData Content; +public: + + vtkStructuredGrid(Content &content); + ~vtkStructuredGrid(); + + void SetTransform(class vtkTransform *t); + + class vtkBoxWidget * GetWidget(); + + void Update(); + + +private: + void InstallPipe(); + + friend class vtkStructuredGridPimpl; + class vtkStructuredGridPimpl *d; +}; + + +} // vtk +} // uLib + + +#endif // VTKSTRUCTUREDGRID_H diff --git a/src/Vtk/vtkTriangleMesh.cpp b/src/Vtk/vtkTriangleMesh.cpp new file mode 100644 index 0000000..4144270 --- /dev/null +++ b/src/Vtk/vtkTriangleMesh.cpp @@ -0,0 +1,227 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "Vtk/vtkTriangleMesh.h" + + +namespace uLib { + + +class vtkTriangleMeshPimpl { +public: + vtkTriangleMeshPimpl(vtkTriangleMesh::Content &content) : + m_content(content), + m_Poly(vtkPolyData::New()), + m_Actor(vtkActor::New()) + { + vtkSmartPointer mapper = + vtkSmartPointer::New(); + mapper->SetInputConnection(m_Poly->GetProducerPort()); + m_Actor->SetMapper(mapper); + } + + ~vtkTriangleMeshPimpl() { + m_Poly->Delete(); + m_Actor->Delete(); + } + + + void vtk2uLib_update(); + void uLib2vtk_update(); + + // members // + TriangleMesh &m_content; + vtkPolyData *m_Poly; + vtkActor *m_Actor; +}; + + +void vtkTriangleMeshPimpl::vtk2uLib_update() +{ + // Assumes that Polys are Triangles !!! // + vtkIdType number_of_points = m_Poly->GetNumberOfPoints(); + vtkIdType number_of_triangles = m_Poly->GetNumberOfPolys(); + + std::cout << "//////\n" << + "number of points = " << number_of_points << "\n" << + "muiber of polys = " << number_of_triangles << "\n" << + "//////\n"; + + + + + + m_content.Points().resize(number_of_points); + for (int i=0; iGetPoint(i); + m_content.Points()[i](0) = point[0]; + m_content.Points()[i](1) = point[1]; + m_content.Points()[i](2) = point[2]; +// std::cout << "pt" << i << " = " << m_content.Points()[i].transpose() << "\n"; + } + + m_content.Triangles().resize(number_of_triangles); + m_Poly->GetPolys()->InitTraversal(); + vtkSmartPointer idList = vtkSmartPointer::New(); + for (int i=0; iGetPolys()->GetNextCell(idList); + m_content.Triangles()[i](0) = idList->GetId(0); + m_content.Triangles()[i](1) = idList->GetId(1); + m_content.Triangles()[i](2) = idList->GetId(2); + } + m_Poly->Update(); + m_Actor->GetMapper()->Update(); +} + +void vtkTriangleMeshPimpl::uLib2vtk_update() +{ + vtkIdType number_of_points = m_content.Points().size(); + vtkIdType number_of_triangles = m_content.Triangles().size(); + + vtkSmartPointer points + = vtkSmartPointer::New(); + points->SetNumberOfPoints(number_of_points); + for (vtkIdType i = 0; i < number_of_points; i++) + { + double x, y, z; + x = m_content.Points().at(i)(0); + y = m_content.Points().at(i)(1); + z = m_content.Points().at(i)(2); + points->SetPoint(i, x, y, z); + } + + vtkSmartPointer polys + = vtkSmartPointer::New(); + for (vtkIdType i = 0; i < number_of_triangles; i++) + { + vtkIdType a, b, c; + a = m_content.Triangles().at(i)(0); + b = m_content.Triangles().at(i)(1); + c = m_content.Triangles().at(i)(2); + polys->InsertNextCell(3); + polys->InsertCellPoint(a); + polys->InsertCellPoint(b); + polys->InsertCellPoint(c); + } + + m_Poly->SetPoints(points); + m_Poly->SetPolys(polys); + m_Poly->Update(); + m_Actor->GetMapper()->Update(); +} + + +// -------------------------------------------------------------------------- // + + + + + +vtkTriangleMesh::vtkTriangleMesh(vtkTriangleMesh::Content &content) : + d(new vtkTriangleMeshPimpl(content)) +{} + +vtkTriangleMesh::~vtkTriangleMesh() +{ + delete d; +} + +void vtkTriangleMesh::ReadFromFile(const char *filename) +{ + vtkSmartPointer reader = + vtkSmartPointer::New(); + reader->SetFileName(filename); + reader->Update(); + d->m_Poly->DeepCopy(reader->GetOutput()); + d->vtk2uLib_update(); +} + +void vtkTriangleMesh::ReadFromXMLFile(const char *filename) +{ + vtkSmartPointer reader = + vtkSmartPointer::New(); + reader->SetFileName(filename); + reader->Update(); + d->m_Poly->DeepCopy(reader->GetOutput()); + d->vtk2uLib_update(); +} + +void vtkTriangleMesh::ReadFromObjFile(const char *filename) +{ + vtkSmartPointer reader = + vtkSmartPointer::New(); + reader->SetFileName(filename); + reader->Update(); + d->m_Poly->DeepCopy(reader->GetOutput()); + d->vtk2uLib_update(); +} + +void vtkTriangleMesh::ReadFromStlFile(const char *filename) +{ + vtkSmartPointer reader = + vtkSmartPointer::New(); + reader->SetFileName(filename); + reader->Update(); + d->m_Poly->DeepCopy(reader->GetOutput()); + d->vtk2uLib_update(); +} + +vtkProp *vtkTriangleMesh::GetProp() +{ + return d->m_Actor; +} + +vtkPolyData *vtkTriangleMesh::GetPolyData() const +{ + return d->m_Poly; +} + +void vtkTriangleMesh::Update() +{ + d->uLib2vtk_update(); +} + +} diff --git a/src/Vtk/vtkTriangleMesh.h b/src/Vtk/vtkTriangleMesh.h new file mode 100644 index 0000000..d0a1038 --- /dev/null +++ b/src/Vtk/vtkTriangleMesh.h @@ -0,0 +1,69 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef VTKTRIANGLEMESH_H +#define VTKTRIANGLEMESH_H + + +#include "uLibVtkInterface.h" +#include "Math/TriangleMesh.h" + +class vtkPolyData; + +namespace uLib { + + +class vtkTriangleMesh : public Abstract::uLibVtkPolydata { + typedef TriangleMesh Content; +public: + vtkTriangleMesh(Content &content); + ~vtkTriangleMesh(); + + void ReadFromFile(const char *filename); + + void ReadFromXMLFile(const char *filename); + + void ReadFromObjFile(const char *filename); + + void ReadFromStlFile(const char *filename); + + virtual class vtkProp *GetProp(); + + virtual class vtkPolyData *GetPolyData() const; + + void Update(); + +private: + friend class vtkTriangleMeshPimpl; + class vtkTriangleMeshPimpl *d; +}; + + + +} + +#endif // VTKTRIANGLEMESH_H diff --git a/src/Vtk/vtkVoxImage.cpp b/src/Vtk/vtkVoxImage.cpp new file mode 100644 index 0000000..2ef73d4 --- /dev/null +++ b/src/Vtk/vtkVoxImage.cpp @@ -0,0 +1,391 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + + +#include + +#include "vtkVoxImage.h" + + +namespace uLib { +namespace Vtk { + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// PIMPL + +class vtkVoxImagePimpl { +public: + vtkVoxImagePimpl(vtkVoxImage::Content &content) : + m_Content(content), + m_Actor(vtkVolume::New()), + m_Image(vtkImageData::New()), + m_Outline(vtkCubeSource::New()), + m_Reader(NULL), + m_Writer(NULL) + {} + + ~vtkVoxImagePimpl() + { + m_Image->Delete(); + m_Actor->Delete(); + m_Outline->Delete(); + } + + void GetContent(); + + void SetContent(); + + // members // + vtkVolume *m_Actor; + vtkImageData *m_Image; + vtkCubeSource *m_Outline; + + // io // + vtkXMLImageDataReader *m_Reader; + vtkXMLImageDataWriter *m_Writer; + + // content // + vtkVoxImage::Content &m_Content; + + // visual // + float m_Window; + float m_Level; +}; + + + +void vtkVoxImagePimpl::GetContent() +{ + // ULIB -> VTK // + // const int *dims = static_cast(m_Content.GetDims().data()); + Vector3i dims = m_Content.GetDims(); + m_Image->SetDimensions(dims(0),dims(1),dims(2)); + + Vector3f spacing = m_Content.GetSpacing(); + m_Image->SetSpacing(spacing(0),spacing(1),spacing(2)); + + // Warning .. TODO: Read complete Transform matrix // + float *pos = m_Content.GetPosition().data(); + m_Image->SetOrigin(pos[0],pos[1],pos[2]); + + + vtkFloatArray *array = vtkFloatArray::SafeDownCast(m_Image->GetPointData()->GetScalars()); + if(!array) { + array = vtkFloatArray::New(); + array->SetNumberOfComponents(1); + array->SetName("volume_scalars"); + int n_tup = dims.prod(); + array->SetNumberOfTuples(n_tup); //m_Content.GetDims().prod()); + } + + Vector3i index(0,0,0); + int i=0; + for (int zv = 0; zv < dims[2]; ++zv) { + for (int yv = 0; yv < dims[1]; ++yv) { + for (int xv = 0; xv < dims[0]; ++xv) { + index << xv,yv,zv; + array->SetValue(i++,m_Content.GetValue(index)); + } + } + } + m_Image->GetPointData()->SetScalars(array); +// m_Image->Update(); +} + +void vtkVoxImagePimpl::SetContent() +{ + // VTK -> ULIB // + int *ext = m_Image->GetExtent(); + int dims[3] = { ext[1]-ext[0] + 1, ext[3]-ext[2] + 1, ext[5]-ext[4] + 1 }; + m_Content.SetDims(Vector3i(dims[0],dims[1],dims[2])); + + double *spacing = m_Image->GetSpacing(); + m_Content.SetSpacing(Vector3f(spacing[0],spacing[1],spacing[2])); + + // Warning .. TODO: Read complete Transform matrix // + double *pos = m_Image->GetOrigin(); + m_Content.SetPosition(Vector3f(pos[0],pos[1],pos[2])); + + vtkFloatArray *array = vtkFloatArray::SafeDownCast + (m_Image->GetPointData()->GetScalars()); + if(array) { + Vector3i index(0,0,0); + int i=0; + for (int zv = 0; zv < dims[2]; ++zv) { + for (int yv = 0; yv < dims[1]; ++yv) { + for (int xv = 0; xv < dims[0]; ++xv) { + index << xv,yv,zv; + m_Content.SetValue(index,array->GetValue(i++)); + } + } + } + } + else { + std::cerr << "Error reading array Value Data\n"; + } +} + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// VTK VOXIMAGE + +vtkVoxImage::vtkVoxImage(Content &content) : + d(new vtkVoxImagePimpl(content)) +{ + init_properties(); + d->GetContent(); + InstallPipe(); +} + +vtkVoxImage::~vtkVoxImage() +{ + delete d; +} + +vtkImageData *vtkVoxImage::GetImageData() +{ + d->GetContent(); + return d->m_Image; +} + +void vtkVoxImage::SaveToXMLFile(const char *fname) +{ + vtkSmartPointer writer = + vtkSmartPointer::New(); + writer->SetFileName(fname); + d->GetContent(); + vtkSmartPointer vtkscale = + vtkSmartPointer::New(); + +# if VTK_MAJOR_VERSION <= 5 + vtkscale->SetInputConnection(d->m_Image->GetProducerPort()); +# else + vtkscale->SetInputData(d->m_Image); +# endif + vtkscale->SetScale(p().writer_factor); + vtkscale->Update(); + writer->SetInputConnection(vtkscale->GetOutputPort()); + writer->Update(); + writer->Write(); +} + +void vtkVoxImage::ReadFromVKTFile(const char *fname) +{ + vtkSmartPointer reader = + vtkSmartPointer::New(); + reader->SetFileName(fname); + reader->Update(); + if(reader->IsFileStructuredPoints()) + { + vtkSmartPointer vtkscale = + vtkSmartPointer::New(); + vtkscale->SetInputConnection(reader->GetOutputPort()); + vtkscale->SetScale(1/p().writer_factor); + vtkscale->Update(); + + d->m_Image->DeepCopy(vtkscale->GetOutput()); // FIX! (pipe connection) + d->SetContent(); + } + else { + std::cerr << "Error: file does not contain structured points\n"; + } + d->m_Actor->Update(); +} + +void vtkVoxImage::ReadFromXMLFile(const char *fname) +{ + vtkSmartPointer reader = + vtkSmartPointer::New(); + reader->SetFileName(fname); + reader->Update(); + vtkSmartPointer vtkscale = + vtkSmartPointer::New(); + vtkscale->SetInputConnection(reader->GetOutputPort()); + vtkscale->SetScale(1/p().writer_factor); + vtkscale->Update(); + + d->m_Image->DeepCopy(vtkscale->GetOutput()); + d->SetContent(); +} + + +void vtkVoxImage::setShadingPreset(int blendType) +{ + vtkSmartVolumeMapper *mapper = + (vtkSmartVolumeMapper *)d->m_Actor->GetMapper(); + vtkVolumeProperty *property = d->m_Actor->GetProperty(); + + static vtkColorTransferFunction *colorFun = vtkColorTransferFunction::New(); + static vtkPiecewiseFunction *opacityFun = vtkPiecewiseFunction::New(); + + float window = 40 / $$.writer_factor; + float level = 20 / $$.writer_factor; + + property->SetColor(colorFun); + property->SetScalarOpacity(opacityFun); + property->SetInterpolationTypeToLinear(); + + if(blendType != 6) { + colorFun->RemoveAllPoints(); + opacityFun->RemoveAllPoints(); + } + + switch (blendType) { + // MIP + // Create an opacity ramp from the window and level values. + // Color is white. Blending is MIP. + case 0: + colorFun->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0); + opacityFun->AddSegment(level - 0.5 * window, 0.0, + level + 0.5 * window, 1.0); + mapper->SetBlendModeToMaximumIntensity(); + break; + + // CompositeRamp + // Create a ramp from the window and level values. Use compositing + // without shading. Color is a ramp from black to white. + case 1: + colorFun->AddRGBSegment(level - 0.5 * window, 0.0, 0.0, 0.0, + level + 0.5 * window, 1.0, 1.0, 1.0); + opacityFun->AddSegment(level - 0.5 * window, 0.0, + level + 0.5 * window, 1.0); + mapper->SetBlendModeToComposite(); + property->ShadeOff(); + break; + + // CompositeShadeRamp + // Create a ramp from the window and level values. Use compositing + // with shading. Color is white. + case 2: + colorFun->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0); + opacityFun->AddSegment(level - 0.5 * window, 0.0, + level + 0.5 * window, 1.0); + mapper->SetBlendModeToComposite(); + property->ShadeOn(); + break; + + // CT_Skin + // Use compositing and functions set to highlight skin in CT data + // Not for use on RGB data + case 3: + colorFun->AddRGBPoint(-3024, 0, 0, 0, 0.5, 0.0); + colorFun->AddRGBPoint(-1000, .62, .36, .18, 0.5, 0.0); + colorFun->AddRGBPoint(-500, .88, .60, .29, 0.33, 0.45); + colorFun->AddRGBPoint(3071, .83, .66, 1, 0.5, 0.0); + + opacityFun->AddPoint(-3024, 0, 0.5, 0.0); + opacityFun->AddPoint(-1000, 0, 0.5, 0.0); + opacityFun->AddPoint(-500, 1.0, 0.33, 0.45); + opacityFun->AddPoint(3071, 1.0, 0.5, 0.0); + + mapper->SetBlendModeToComposite(); + property->ShadeOn(); + property->SetAmbient(0.1); + property->SetDiffuse(0.9); + property->SetSpecular(0.2); + property->SetSpecularPower(10.0); + property->SetScalarOpacityUnitDistance(0.8919); + break; + + + default: + vtkGenericWarningMacro("Unknown blend type."); + break; + } +} + +void vtkVoxImage::Update() { + d->m_Actor->Update(); + d->m_Outline->SetBounds(d->m_Image->GetBounds()); + d->m_Outline->Update(); +} + +void vtkVoxImage::InstallPipe() +{ + vtkSmartPointer mapper = + vtkSmartPointer::New(); +# if VTK_MAJOR_VERSION <= 5 + mapper->SetInputConnection(d->m_Image->GetProducerPort()); +# else + mapper->SetInputData(d->m_Image); +# endif + mapper->Update(); + + d->m_Actor->SetMapper(mapper); + this->setShadingPreset(0); + mapper->Update(); + + d->m_Outline->SetBounds(d->m_Image->GetBounds()); + vtkSmartPointer mmapper = vtkSmartPointer::New(); + mmapper->SetInputConnection(d->m_Outline->GetOutputPort()); + vtkSmartPointer actor = vtkSmartPointer::New(); + actor->SetMapper(mmapper); + actor->GetProperty()->SetRepresentationToWireframe(); + actor->GetProperty()->SetAmbient(0.7); + + // this->SetProp(actor); + this->SetProp(d->m_Actor); +} + + +} // vtk +} // uLib diff --git a/src/Vtk/vtkVoxImage.h b/src/Vtk/vtkVoxImage.h new file mode 100644 index 0000000..6497f0a --- /dev/null +++ b/src/Vtk/vtkVoxImage.h @@ -0,0 +1,88 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_VTKVOXIMAGE_H +#define U_VTKVOXIMAGE_H + +#include +#include + +#include "uLibVtkInterface.h" + + +class vtkImageData; + +namespace uLib { +namespace Vtk { + +class vtkVoxImage : public Puppet { + uLibTypeMacro(vtkVoxImage,Puppet) +public: + properties() + { + float writer_factor; + }; + +public: + typedef Abstract::VoxImage Content; + + vtkVoxImage(Content &content); + + ~vtkVoxImage(); + + vtkImageData * GetImageData(); + + void SaveToXMLFile(const char *fname); + + void ReadFromVKTFile(const char *fname); + + void ReadFromXMLFile(const char *fname); + + void setShadingPreset(int blendType = 2); + + void Update(); + +protected: + void InstallPipe(); + +private: + class vtkVoxImagePimpl *d; +}; + + +inline void vtkVoxImage::init_properties() +{ + $_init(); + $$.writer_factor = 1.E6; +} + + +} // vtk +} // uLib + + +#endif // VTKVOXIMAGE_H diff --git a/src/Vtk/vtkVoxRaytracerRepresentation.cpp b/src/Vtk/vtkVoxRaytracerRepresentation.cpp new file mode 100644 index 0000000..7d019a7 --- /dev/null +++ b/src/Vtk/vtkVoxRaytracerRepresentation.cpp @@ -0,0 +1,459 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include "vtkVoxRaytracerRepresentation.h" + +#include "Math/VoxRaytracer.h" + +//#include "vtkMuonEvent.h" +#include "vtkMuonScatter.h" + + +namespace uLib { +namespace Vtk { + +///// PIMPL //////////////////////////////////////////////////////////////////// + +class vtkVoxRaytracerRepresentationPimpl { + +public: + vtkVoxRaytracerRepresentationPimpl(VoxRaytracer &content) : + m_Content(&content), + m_Assembly(vtkAssembly::New()), + m_Sphere1(vtkSphereSource::New()), + m_Sphere2(vtkSphereSource::New()), + m_Line1(vtkLineSource::New()), + m_Line2(vtkLineSource::New()), + m_Line3(vtkLineSource::New()), + m_RayLine(vtkAppendPolyData::New()), + m_RayLineActor(vtkActor::New()), + m_RayRepresentation(vtkAppendPolyData::New()), + m_RayRepresentationActor(vtkActor::New()), + m_Transform(vtkTransform::New()) + { + default_radius = content.GetImage()->GetSpacing()(0)/4; + m_Sphere1->SetRadius(default_radius); + m_Sphere2->SetRadius(default_radius); + m_SelectedElement = m_RayLine; + } + ~vtkVoxRaytracerRepresentationPimpl() + { + m_Assembly->Delete(); + m_RayLine->Delete(); + m_RayLineActor->Delete(); + m_RayRepresentationActor->Delete(); + m_Transform->Delete(); + } + + // members // + VoxRaytracer *m_Content; + + Scalarf default_radius; + vtkAssembly *m_Assembly; + vtkAppendPolyData *m_RayLine; + vtkActor *m_RayLineActor; + vtkActor *m_RayRepresentationActor; + vtkSmartPointer m_Transform; + VoxRaytracer::RayData m_Ray; + vtkSmartPointer m_Sphere1,m_Sphere2; + vtkSmartPointer m_Line1, m_Line2, m_Line3; + vtkSmartPointer m_RayRepresentation; + + vtkAppendPolyData *m_SelectedElement; +}; + + + + +//////////////////////////////////////////////////////////////////////////////// +////// VOX RAYTRACER REPRESENTATION /////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + + +vtkVoxRaytracerRepresentation::vtkVoxRaytracerRepresentation(Content &content) : + d(new vtkVoxRaytracerRepresentationPimpl(content)) +{ + InstallPipe(); +} + +vtkVoxRaytracerRepresentation::~vtkVoxRaytracerRepresentation() +{ + delete d; +} + +VoxRaytracer *vtkVoxRaytracerRepresentation::GetRaytracerAlgorithm() +{ + return d->m_Content; +} + +vtkProp *vtkVoxRaytracerRepresentation::GetProp() +{ + return d->m_Assembly; +} + +vtkPolyData *vtkVoxRaytracerRepresentation::GetPolyData() const +{ + std::cout << "get Raytracer polydata\n"; + d->m_SelectedElement->Update(); + return d->m_SelectedElement->GetOutput(); +} + +void vtkVoxRaytracerRepresentation::SetRepresentationElements(vtkVoxRaytracerRepresentation::RepresentationElements el) +{ + switch(el) { + case Vtk::vtkVoxRaytracerRepresentation::RayElements: + d->m_SelectedElement = d->m_RayLine; + break; + case Vtk::vtkVoxRaytracerRepresentation::VoxelsElements: + d->m_SelectedElement = d->m_RayRepresentation; + break; + default: + d->m_SelectedElement = d->m_RayLine; + break; + } +} + + +void vtkVoxRaytracerRepresentation::SetMuon(MuonScatter &muon) +{ + Vector4f pt1,pt2,src; + src = muon.LineIn().origin(); + d->m_Content->GetEntryPoint(muon.LineIn(),pt1); + d->m_Sphere1->SetCenter(pt1(0),pt1(1),pt1(2)); + d->m_Line1->SetPoint1(src(0),src(1),src(2)); + d->m_Line1->SetPoint2(pt1(0),pt1(1),pt1(2)); + + HLine3f line_out = muon.LineOut(); + src = line_out.origin(); + float *direction = line_out.direction().data(); + for(int i=0;i<3;++i) direction[i] *= -1; + d->m_Content->GetEntryPoint(line_out,pt2); + d->m_Sphere2->SetCenter(pt2(0),pt2(1),pt2(2)); + d->m_Line2->SetPoint1(src(0),src(1),src(2)); + d->m_Line2->SetPoint2(pt2(0),pt2(1),pt2(2)); + + d->m_Line3->SetPoint1(pt1(0),pt1(1),pt1(2)); + d->m_Line3->SetPoint2(pt2(0),pt2(1),pt2(2)); + + // Create a vtkPoints object and store the points in it + vtkSmartPointer points = + vtkSmartPointer::New(); + points->InsertNextPoint(pt1(0),pt1(1),pt1(2)); + points->InsertNextPoint(pt2(0),pt2(1),pt2(2)); + + // Create a cell array to store the lines in and add the lines to it + vtkSmartPointer lines = + vtkSmartPointer::New(); + + vtkSmartPointer line = + vtkSmartPointer::New(); + line->GetPointIds()->SetId(0,0); + line->GetPointIds()->SetId(1,1); + lines->InsertNextCell(line); + + // Create a polydata to store everything in + vtkSmartPointer linesPolyData = + vtkSmartPointer::New(); + + // Add the points to the dataset + linesPolyData->SetPoints(points); + + // Add the lines to the dataset + linesPolyData->SetLines(lines); + + d->m_RayLine->RemoveAllInputs(); +# if VTK_MAJOR_VERSION <= 5 + d->m_RayLine->AddInputConnection(linesPolyData->GetProducerPort()); +# else + d->m_RayLine->AddInputData(linesPolyData); +# endif + d->m_RayLine->AddInputConnection(d->m_Line1->GetOutputPort()); + d->m_RayLine->AddInputConnection(d->m_Sphere1->GetOutputPort()); + d->m_RayLine->AddInputConnection(d->m_Line2->GetOutputPort()); + d->m_RayLine->AddInputConnection(d->m_Sphere2->GetOutputPort()); +// d->m_RayLine->AddInputConnection(d->m_Line3->GetOutputPort()); + + + vtkSmartPointer vmat = vtkSmartPointer::New(); + Matrix4f mat = d->m_Content->GetImage()->GetWorldMatrix(); + for(int i=0; i<4; ++i) + for(int j=0; j<4; ++j) + vmat->SetElement(i,j,mat(i,j)); + d->m_Transform->SetMatrix(vmat); + + this->SetRay(pt1,pt2); +} + +void vtkVoxRaytracerRepresentation::SetMuon(MuonScatter &muon, Vector4f poca) +{ + Vector4f pt1,pt2,src; + src = muon.LineIn().origin(); + d->m_Content->GetEntryPoint(muon.LineIn(),pt1); + d->m_Sphere1->SetCenter(pt1(0),pt1(1),pt1(2)); + d->m_Line1->SetPoint1(src(0),src(1),src(2)); + d->m_Line1->SetPoint2(pt1(0),pt1(1),pt1(2)); + + HLine3f line_out = muon.LineOut(); + src = line_out.origin(); + float *direction = line_out.direction().data(); + for(int i=0;i<3;++i) direction[i] *= -1; + d->m_Content->GetEntryPoint(line_out,pt2); + d->m_Sphere2->SetCenter(pt2(0),pt2(1),pt2(2)); + d->m_Line2->SetPoint1(src(0),src(1),src(2)); + d->m_Line2->SetPoint2(pt2(0),pt2(1),pt2(2)); + + d->m_Line3->SetPoint1(pt1(0),pt1(1),pt1(2)); + d->m_Line3->SetPoint2(pt2(0),pt2(1),pt2(2)); + + // Create a vtkPoints object and store the points in it + vtkSmartPointer points = + vtkSmartPointer::New(); + points->InsertNextPoint(pt1(0),pt1(1),pt1(2)); + points->InsertNextPoint(poca(0),poca(1),poca(2)); + points->InsertNextPoint(pt2(0),pt2(1),pt2(2)); + + // Create a cell array to store the lines in and add the lines to it + vtkSmartPointer lines = + vtkSmartPointer::New(); + + for(unsigned int i = 0; i < 2; i++) + { + vtkSmartPointer line = + vtkSmartPointer::New(); + line->GetPointIds()->SetId(0,i); + line->GetPointIds()->SetId(1,i+1); + lines->InsertNextCell(line); + } + + // Create a polydata to store everything in + vtkSmartPointer linesPolyData = + vtkSmartPointer::New(); + + // Add the points to the dataset + linesPolyData->SetPoints(points); + + // Add the lines to the dataset + linesPolyData->SetLines(lines); + + d->m_RayLine->RemoveAllInputs(); +# if VTK_MAJOR_VERSION <= 5 + d->m_RayLine->AddInputConnection(linesPolyData->GetProducerPort()); +# else + d->m_RayLine->AddInputData(linesPolyData); +# endif + d->m_RayLine->AddInputConnection(d->m_Line1->GetOutputPort()); + d->m_RayLine->AddInputConnection(d->m_Sphere1->GetOutputPort()); + d->m_RayLine->AddInputConnection(d->m_Line2->GetOutputPort()); + d->m_RayLine->AddInputConnection(d->m_Sphere2->GetOutputPort()); +// d->m_RayLine->AddInputConnection(d->m_Line3->GetOutputPort()); + + + vtkSmartPointer poca_sphere = + vtkSmartPointer::New(); + poca_sphere->SetRadius(d->default_radius); + poca_sphere->SetCenter(poca(0),poca(1),poca(2)); + d->m_RayLine->AddInputConnection(poca_sphere->GetOutputPort()); + + + vtkSmartPointer vmat = vtkSmartPointer::New(); + Matrix4f mat = d->m_Content->GetImage()->GetWorldMatrix(); + for(int i=0; i<4; ++i) + for(int j=0; j<4; ++j) + vmat->SetElement(i,j,mat(i,j)); + d->m_Transform->SetMatrix(vmat); + + if(d->m_Content->GetImage()->IsInsideBounds(poca)) + this->SetRay(pt1,poca,pt2); + else + this->SetRay(pt1,pt2); +} + + +void vtkVoxRaytracerRepresentation::SetMuon(vtkMuonScatter &muon) +{ + Vector4f poca = muon.GetPocaPoint(); + MuonScatter &mu = muon.GetContent(); + this->SetMuon(mu,poca); +} + + +VoxRaytracer::RayData vtkVoxRaytracerRepresentation::GetRay() +{ + return d->m_Ray; +} + +void vtkVoxRaytracerRepresentation::SetRay(Vector4f in, Vector4f out) +{ + d->m_Ray = d->m_Content->TraceBetweenPoints(in,out); + this->SetRay(&d->m_Ray); +} + +void vtkVoxRaytracerRepresentation::SetRay(Vector4f in, Vector4f mid, Vector4f out) +{ + d->m_Ray = d->m_Content->TraceBetweenPoints(in,mid); + d->m_Ray.AppendRay( d->m_Content->TraceBetweenPoints(mid,out) ); + this->SetRay(&d->m_Ray); +} + +void vtkVoxRaytracerRepresentation::SetRay(VoxRaytracer::RayData *ray) +{ + vtkAppendPolyData *appender = d->m_RayRepresentation; + appender->RemoveAllInputs(); + + for(int i=0; iData().size(); ++i) { + int id = ray->Data().at(i).vox_id; + Vector3i idv = d->m_Content->GetImage()->UnMap(id); + vtkSmartPointer cube = + vtkSmartPointer::New(); + cube->SetBounds(idv(0),idv(0)+1,idv(1),idv(1)+1,idv(2),idv(2)+1); + cube->Update(); +# if VTK_MAJOR_VERSION <= 5 + appender->AddInput(cube->GetOutput()); +# else + appender->AddInputData(cube->GetOutput()); +# endif + appender->Update(); + } + +} + +void vtkVoxRaytracerRepresentation::SetVoxelsColor(Vector4f rgba) +{ + this->SetColor(d->m_RayRepresentationActor,rgba); +} + +void vtkVoxRaytracerRepresentation::SetRayColor(Vector4f rgba) +{ + this->SetColor(d->m_RayLineActor,rgba); +} + +void vtkVoxRaytracerRepresentation::SetColor(vtkActor *actor, Vector4f rgba) +{ + if(!actor) return; + vtkProperty *pr = actor->GetProperty(); + pr->SetDiffuseColor( rgba(0), + rgba(1), + rgba(2) ); + pr->SetOpacity( rgba(3) ); + pr->SetDiffuse(1); +} + + + + +void vtkVoxRaytracerRepresentation::InstallPipe() +{ + + vtkSmartPointer append = + vtkSmartPointer::New(); + append->AddInputConnection(d->m_Sphere1->GetOutputPort()); + append->AddInputConnection(d->m_Sphere2->GetOutputPort()); + append->AddInputConnection(d->m_Line1->GetOutputPort()); + append->AddInputConnection(d->m_Line2->GetOutputPort()); + + append->Update(); + vtkSmartPointer mapper = + vtkSmartPointer::New(); + + mapper->SetInputConnection(append->GetOutputPort()); + mapper->Update(); + + vtkSmartPointer actor = vtkSmartPointer::New(); + actor->SetMapper(mapper); + actor->GetProperty()->SetColor(0.6,0.6,1); + this->SetProp(actor); + + mapper = vtkSmartPointer::New(); + mapper->SetInputConnection(d->m_RayLine->GetOutputPort()); + mapper->Update(); + + d->m_RayLineActor->SetMapper(mapper); + d->m_RayLineActor->GetProperty()->SetColor(1,0,0); + this->SetProp(d->m_RayLineActor); + +// mapper = vtkSmartPointer::New(); +// mapper->SetInputConnection(d->m_Line3->GetOutputPort()); +// mapper->Update(); + +// actor = vtkSmartPointer::New(); +// actor->SetMapper(mapper); +// actor->GetProperty()->SetColor(1,0,0); +// d->m_Assembly->AddPart(actor); + + + vtkSmartPointer polyfilter = + vtkSmartPointer::New(); + + polyfilter->SetInputConnection(d->m_RayRepresentation->GetOutputPort()); + polyfilter->SetTransform(d->m_Transform); + + mapper = vtkSmartPointer::New(); + mapper->SetInputConnection(polyfilter->GetOutputPort()); + mapper->Update(); + + vtkActor *vra = d->m_RayRepresentationActor; + vra->SetMapper(mapper); + vra->GetProperty()->SetOpacity(0.2); + vra->GetProperty()->SetEdgeVisibility(true); + vra->GetProperty()->SetColor(0.5,0.5,0.5); + + this->SetProp(vra); +} + + + + + + + +} // vtk +} // uLib diff --git a/src/Vtk/vtkVoxRaytracerRepresentation.h b/src/Vtk/vtkVoxRaytracerRepresentation.h new file mode 100644 index 0000000..4955e53 --- /dev/null +++ b/src/Vtk/vtkVoxRaytracerRepresentation.h @@ -0,0 +1,101 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_VTKVOXRAYTRACERREPRESENTATION_H +#define U_VTKVOXRAYTRACERREPRESENTATION_H + + +#include "Core/Macros.h" +#include "Math/Dense.h" + +#include "uLibVtkInterface.h" + +#include "Detectors/MuonScatter.h" + +#include "Math/ImageData.h" +#include "Math/VoxRaytracer.h" + + +class vtkActor; + +namespace uLib { +namespace Vtk { + +class vtkVoxRaytracerRepresentation : public Puppet { + typedef VoxRaytracer Content; +public: + vtkVoxRaytracerRepresentation(Content &content); + ~vtkVoxRaytracerRepresentation(); + + uLib::VoxRaytracer *GetRaytracerAlgorithm(); + + vtkProp *GetProp(); + + vtkPolyData *GetPolyData() const; + + enum RepresentationElements { + RayElements, + VoxelsElements + }; + void SetRepresentationElements(enum RepresentationElements el); + + void SetMuon(MuonScatter &muon); + + void SetMuon(MuonScatter &muon, Vector4f poca); + + void SetMuon(class vtkMuonEvent &muon); + + void SetMuon(class vtkMuonScatter &muon); + + VoxRaytracer::RayData GetRay(); + + void SetRay(Vector4f in, Vector4f out); + + void SetRay(Vector4f in, Vector4f mid, Vector4f out); + + void SetRay(VoxRaytracer::RayData *ray); + + void SetVoxelsColor(Vector4f rgba); + void SetRayColor(Vector4f rgba); + + + +private: + void InstallPipe(); + + void SetColor(vtkActor *actor, Vector4f rgba); + + friend class vtkVoxRaytracerRepresentationPimpl; + class vtkVoxRaytracerRepresentationPimpl *d; +}; + + +} // vtk +} // uLib + + +#endif // VTKVOXRAYTRACERREPRESENTATION_H diff --git a/src/Vtk/vtkuLibProp.h b/src/Vtk/vtkuLibProp.h new file mode 100644 index 0000000..fd6be35 --- /dev/null +++ b/src/Vtk/vtkuLibProp.h @@ -0,0 +1,51 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_VTKULIBPROP_H +#define U_VTKULIBPROP_H + +class vtkProp; + +namespace uLib { +namespace Abstract { + +class uLibVtkProp { +public: + virtual vtkProp *GetProp() = 0; + +protected: + ~uLibVtkProp() {} +}; + + + + +} + +} + +#endif // VTKULIBPROP_H diff --git a/src/cwchar.h b/src/cwchar.h new file mode 100644 index 0000000..c6f851e --- /dev/null +++ b/src/cwchar.h @@ -0,0 +1,37 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef U_CWCHAR_H +#define U_CWCHAR_H + +// cwchar.h does not exist, should be called "wchar.h" in C or in C++ +// this file serves as a patch to fix a error inclusion done by Root in cint. +// it must be placed in a included project directory + +#include + +#endif // CWCHAR_H diff --git a/src/ltk/CMakeLists.txt b/src/ltk/CMakeLists.txt new file mode 100644 index 0000000..8921da0 --- /dev/null +++ b/src/ltk/CMakeLists.txt @@ -0,0 +1,12 @@ + +set(HEADERS + ltktypes.h + ltkmacros.h + ltkdebug.h +) + +SET(SOURCES) + +set(LIBRARIES) + +uLib_add_shared_library(${uLib-module}) diff --git a/src/ltk/DenseMatrix.h b/src/ltk/DenseMatrix.h new file mode 100644 index 0000000..1214526 --- /dev/null +++ b/src/ltk/DenseMatrix.h @@ -0,0 +1,111 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#ifndef DENSEMATRIX_H +#define DENSEMATRIX_H + +#include "templates.h" +#include "Vector.h" + +BEGIN_NAMESPACE(ltk) + +/* ////////////////////////////////////////////////////////////////////////// */ +/* //////////////////////////// MATRIX ////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +C_BEGIN_DECLS + +#define LTK_MATRIX_DECLARE_FUNC(Type,ltkType,Class_name,csize,rsize) \ + inline Type ltkType##_##Class_name##_get(ltkType m, \ + unsigned int c, \ + unsigned int r) \ + { \ + assert(c + r * csize < csize * rsize); \ + return *((ltkType)m + c + r * csize); \ + } \ + inline void ltkType##_##Class_name##_set(ltkType m, \ + unsigned int c, \ + unsigned int r, \ + Type t) \ + { \ + assert (c + r * csize < csize * rsize); \ + *((ltkType)m + c + r * csize) = t; \ + } + + +#define LTK_MATRIX_DECLARE(Type,Type_name,csize,rsize) \ + typedef Type * Type_name; \ + LTK_SIMPLE_ALLOC_FUNC(Type, Type_name,ltk_matrix,csize * rsize) \ + LTK_MATRIX_DECLARE_FUNC(Type,Type_name,ltk_matrix,csize,rsize) + +C_END_DECLS + +#ifdef __cplusplus + +template class ltkDenseMatrix +: public ltkAbstractBuffer< T, csize * rsize > +{ +protected: + typedef ltkDenseMatrix ThisClass; + typedef ltkAbstractBuffer BaseClass; +public: + ltkDenseMatrix() {} + ~ltkDenseMatrix() { } + + inline T* getBuffer() { + return (T*)m_buffer; + } + inline const T* getBuffer() const { + return (const T*)m_buffer; + } + + ThisClass & operator =(const ThisClass &src) { + if (this != &src) { + CType_ltk_matrix_copy(m_buffer, (const CType) src.getBuffer()); + } + } + + typedef struct BaseClass::CommaInit CommaInit; + inline CommaInit operator = (T scalar) { + return this->operator <<(scalar); + } + + +private: + LTK_MATRIX_DECLARE(T,CType, csize, rsize); + T m_buffer [csize * rsize]; +}; + + + + +#endif // __cplusplus + +END_NAMESPACE + +#endif // DENSEMATRIX_H diff --git a/src/ltk/Makefile.am b/src/ltk/Makefile.am new file mode 100644 index 0000000..5f0e5d0 --- /dev/null +++ b/src/ltk/Makefile.am @@ -0,0 +1,6 @@ +include $(top_srcdir)/Common.am + +library_includedir = $(includedir)/libmutom-${PACKAGE_VERSION}/ltk +library_include_HEADERS = ltktypes.h \ + ltkmacros.h \ + ltkdebug.h diff --git a/src/ltk/Object.c b/src/ltk/Object.c new file mode 100644 index 0000000..6269c9a --- /dev/null +++ b/src/ltk/Object.c @@ -0,0 +1,18 @@ +#include "Object.h" + + +static const struct _ltkObjectClass { + size_t class_size; + void (* constructor)(struct _Object *); + void (* destructor) (struct _Object *); + int (* GetElement) (struct _Object *); +} _ObjectClassInstance; + +const struct _ltkObjectClass *ltkObjectClass = &_ObjectClassInstance; + +ltkPointer Object_new(struct _ObjectClass klass) +{ + struct _Object *ob = (struct _Object)malloc(klass->class_size); + klass->constructor(ob); + return ob; +} diff --git a/src/ltk/Object.h b/src/ltk/Object.h new file mode 100644 index 0000000..a39a87a --- /dev/null +++ b/src/ltk/Object.h @@ -0,0 +1,78 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef OBJECT_H +#define OBJECT_H + +#include // for std allocator // +#include // for memcpy // +#include + +#include "templates.h" + +BEGIN_NAMESPACE(ltk) + + +C_BEGIN_DECLS + +struct _ltkObject +{ + int element; +}; + +struct _ltkObjectClass { + size_t class_size; + void (* constructor)(struct _ltkObject *); + void (* destructor) (struct _ltkObject *); + int (* GetElement) (struct _ltkObject *); +}; + +struct _ltkObject *ltk_object_new() +{ + return NULL; +} + + +C_END_DECLS + +#ifdef __cplusplus + +class Object +{ + struct _ltkObject *d; + typedef struct _ltkObject ObjectType; + public: + Object() : d(new ObjectType()) { d->element = 5552368; } + int GetElement() { return d->element; } +}; + +#endif + + +END_NAMESPACE + +#endif //OBJECT_H diff --git a/src/ltk/Vector.h b/src/ltk/Vector.h new file mode 100644 index 0000000..229295b --- /dev/null +++ b/src/ltk/Vector.h @@ -0,0 +1,195 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +/* + * File: denseVector.h + * Author: andrea + * + * Created on July 6, 2012, 3:41 PM + */ + +#ifndef VECTOR_H +#define VECTOR_H + +#include // for std allocator // +#include // for memcpy // +#include + +#include "templates.h" + +BEGIN_NAMESPACE(ltk) + +/* ////////////////////////////////////////////////////////////////////////// */ +/* //////////////////////////// VECTOR ///////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +C_BEGIN_DECLS + +#define LTK_VECTOR_DECLARE(Type,Type_name,size) \ + typedef Type *Type_name; \ + LTK_SIMPLE_ALLOC_FUNC(Type,Type_name,ltk_vector,size) \ + inline unsigned int Type_name##_ltk_vector_size() { return size; } \ + inline Type Type_name##_ltk_vector_get(Type_name vector, unsigned int i) \ + { return *(vector+i); } \ + inline void Type_name##_ltk_vector_set(Type_name vector, unsigned int i, \ + Type data) { *(vector+i) = data; } + +C_END_DECLS + +#ifdef __cplusplus + +template class ltkVector +: public ltkAbstractBuffer< T, size > +{ + T m_vector [size]; +protected: + typedef ltkVector ThisClass; + typedef ltkAbstractBuffer BaseClass; +public: + ltkVector() {} + ltkVector(const ltkVector ©) { + CType_ltk_vector_copy(m_vector, (const CType) copy.getBuffer()); + } + + virtual ~ltkVector() { } + + inline unsigned int getSize() const { + return size; + } + inline T* getBuffer() { + return (T*)m_vector; + } + inline const T* getBuffer() const { + return (const T*)m_vector; + } + + + + ThisClass & operator =(const ThisClass &src) { + if (this != &src) { + CType_ltk_vector_copy(m_vector, (const CType) src.getBuffer()); + } + } + + typedef struct BaseClass::CommaInit CommaInit; + inline CommaInit operator = (T scalar) { + return this->operator <<(scalar); + } + + // MATH // + inline bool operator ==(const ThisClass &in) { + int test = 0; + for (int i = 0; i < size; ++i) test += this->at(i) != in(i); + return test == 0; + } + + inline bool operator !=(const ThisClass &in) { + return !this->operator ==(in); + } + + inline void operator +=(const ThisClass &in) { + for (int i = 0; i < size; ++i) this->at(i) += in(i); + } + inline void operator -=(const ThisClass &in) { + for (int i = 0; i < size; ++i) this->at(i) -= in(i); + } + inline void operator *=(const ThisClass &in) { + for (int i = 0; i < size; ++i) this->at(i) *= in(i); + } + inline void operator /=(const ThisClass &in) { + for (int i = 0; i < size; ++i) this->at(i) /= in(i); + } + + inline void operator +=(const T t) { + for (int i = 0; i < size; ++i) this->at(i) += t; + } + inline void operator -=(const T t) { + for (int i = 0; i < size; ++i) this->at(i) -= t; + } + inline void operator *=(const T t) { + for (int i = 0; i < size; ++i) this->at(i) *= t; + } + inline void operator /=(const T t) { + for (int i = 0; i < size; ++i) this->at(i) /= t; + } + + inline ThisClass & operator + (const ThisClass &in) { + ThisClass *out = new ThisClass(); + for (int i = 0; i < size; ++i) out->at(i) = this->at(i) + in(i); + return *out; + } + inline ThisClass & operator - (const ThisClass &in) { + ThisClass *out = new ThisClass(); + for (int i = 0; i < size; ++i) out->at(i) = this->at(i) - in(i); + return *out; + } + + // fix with constructor and product null element ------------- // + inline T operator * (const ThisClass &in) { + T out = 0; + for (int i = 0; i < size; ++i) out += this->at(i) * in(i); + return out; + } + inline T operator / (const ThisClass &in) { + T out = 0; + for (int i = 0; i < size; ++i) out += this->at(i) / in(i); + return out; + } + // ------------------------------------------------------------- // + + inline ThisClass & operator +(const T t) { + ThisClass *out = new ThisClass(); + for (int i = 0; i < size; ++i) out->at(i) = this->at(i) + t; + return *out; + } + inline ThisClass & operator -(const T t) { + ThisClass *out = new ThisClass(); + for (int i = 0; i < size; ++i) out->at(i) = this->at(i) - t; + return *out; + } + inline ThisClass & operator *(const T t) { + ThisClass *out = new ThisClass(); + for (int i = 0; i < size; ++i) out->at(i) = this->at(i) * t; + return *out; + } + inline ThisClass & operator /(const T t) { + ThisClass *out = new ThisClass(); + for (int i = 0; i < size; ++i) out->at(i) = this->at(i) / t; + return *out; + } +private: + LTK_VECTOR_DECLARE(T,CType, size) +}; + +#endif // __cplusplus + + + + +END_NAMESPACE // ltk +#endif /* DENSEVECTOR_H */ + diff --git a/src/ltk/container.h b/src/ltk/container.h new file mode 100644 index 0000000..58dbdc7 --- /dev/null +++ b/src/ltk/container.h @@ -0,0 +1,43 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +/* + * File: comma_init.h + * Author: andrea + * + * Created on May 24, 2012, 3:12 PM + */ + +#ifndef CONTAINER_H +#define CONTAINER_H + +#include + + + +#endif /* CONTAINER_H */ + diff --git a/src/ltk/ltk.h b/src/ltk/ltk.h new file mode 100644 index 0000000..38a16f2 --- /dev/null +++ b/src/ltk/ltk.h @@ -0,0 +1,32 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + + +#include "templates.h" +#include "Vector.h" +#include "DenseMatrix.h" diff --git a/src/ltk/ltk_bridge/ltkb.c b/src/ltk/ltk_bridge/ltkb.c new file mode 100644 index 0000000..f1b3d91 --- /dev/null +++ b/src/ltk/ltk_bridge/ltkb.c @@ -0,0 +1,339 @@ +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef MODVERSIONS +# include +#endif +#include +#include +#include + + + +/* methods of the character device */ +static int ltkb_open(struct inode *inode, struct file *filp); +static int ltkb_release(struct inode *inode, struct file *filp); +static int ltkb_mmap(struct file *filp, struct vm_area_struct *vma); +static ssize_t ltkb_read(struct file *filp, + char __user *buffer, + size_t count, + loff_t *offp); +static ssize_t ltkb_write(struct file *filp, + const char __user *buffer, + size_t count, + loff_t *offp); + + +// internal data +// length of the two memory areas +#define NPAGES 16 +// pointer to the vmalloc'd area - alway page aligned +static int *vmalloc_area; +// pointer to the kmalloc'd area, rounded up to a page boundary +static int *kmalloc_area; +// original pointer for kmalloc'd area as returned by kmalloc +static void *kmalloc_ptr; + + +#define BUF_LEN 80 +static int Device_Open = 0; + +static char Message[BUF_LEN]; +/* + * How far did the process reading the message get? + * Useful if the message is larger than the size of the + * buffer we get to fill in device_read. + */ +static char *Message_Ptr; + + +struct ltkb_dev { + struct cdev cdev; // device structure + struct semaphore semaphore; // lock semaphore for race control + char *message; // message passing from/to user + unsigned int size; // size of data stored + unsigned int acl_key; // user access control +}; + +struct ltkb_dev *_ltkb_devices; // devices array // + + + + + +/////// OPEN AND RELEASE /////////////////////////////////////////////////////// +static int ltkb_open(struct inode *inode, struct file *filp) +{ + // insert cdev data in dev structure and file->private_data // + struct ltkb_dev *dev; + dev = container_of (inode->i_cdev, struct ltkb_dev, cdev); + + // this shares dev for all methods // + filp->private_data = dev; + + pr_debug("ltk bridge opened"); + return 0; +} +/* character device last close method */ +static int ltkb_release(struct inode *inode, struct file *filp) +{ + pr_debug("ltk bridge released"); + return 0; +} +// -------------------------------------------------------------------------- // + + + +// kmalloc instancer // +int ltkb_kmem(struct file *filp, struct vm_area_struct *vma) +{ + int ret; + long length = vma->vm_end - vma->vm_start; + + /* check length - do not allow larger mappings than the number of + pages allocated */ + if (length > NPAGES * PAGE_SIZE) + return -EIO; + + /* map the whole physically contiguous area in one piece */ + if ((ret = remap_pfn_range(vma, + vma->vm_start, + virt_to_phys((void *)kmalloc_area) >> PAGE_SHIFT, + length, + vma->vm_page_prot)) < 0) { + return ret; + } + return 0; +} +// vmalloc instancer // +int ltkb_vmem(struct file *filp, struct vm_area_struct *vma) +{ + int ret; + long length = vma->vm_end - vma->vm_start; + unsigned long start = vma->vm_start; + char *vmalloc_area_ptr = (char *)vmalloc_area; + unsigned long pfn; + + /* check length - do not allow larger mappings than the number of + pages allocated */ + if (length > NPAGES * PAGE_SIZE) + return -EIO; + + /* loop over all pages, map it page individually */ + while (length > 0) { + pfn = vmalloc_to_pfn(vmalloc_area_ptr); + if ((ret = remap_pfn_range(vma, start, pfn, PAGE_SIZE, + PAGE_SHARED)) < 0) { + return ret; + } + start += PAGE_SIZE; + vmalloc_area_ptr += PAGE_SIZE; + length -= PAGE_SIZE; + } + return 0; +} + + + +// mmap function // +static int ltkb_mmap(struct file *filp, struct vm_area_struct *vma) +{ + /* at offset 0 we map the vmalloc'd area */ + if (vma->vm_pgoff == 0) { + return ltkb_vmem(filp, vma); + } + /* at offset NPAGES we map the kmalloc'd area */ + if (vma->vm_pgoff == NPAGES) { + return ltkb_kmem(filp, vma); + } + /* at any other offset we return an error */ + return -EIO; +} + + + + +////////////// CHAR DEVICE READ/WRITE ///////////////////////////////////////// +static ssize_t ltkb_read(struct file *filp, /* see include/linux/fs.h */ + char __user *buffer, /* buffer to fill with data */ + size_t length, /* length of the buffer */ + loff_t * offset) +{ + +#ifdef _DEBUG + printk(KERN_INFO "device_read(%p,%s,%d)", filp, buffer, (int)length); +#endif + + return 0; +} + +static ssize_t ltkb_write(struct file *filp, + const char __user *buffer, + size_t length, + loff_t * offset) +{ +#ifdef _DEBUG + printk(KERN_INFO "device_write(%p,%s,%d)", filp, buffer, (int)length); +#endif + return 0; +} +// ------------------------------------------------------------------------- // + + +#define LTKB_IOC_HEADER 'b' + +#define LTKB_IOC_RESET _IO(LTKB_IOC_HEADER, 0) +#define LTKB_IOC_PING _IOWR(LTKB_IOC_HEADER, 1, char) + +#define LTKB_IOC_MAXNR 1 + +////////////// IOCTL /////////////////////////////////////////////////////////// +int ltkb_ioctl(struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg) +{ + char c = 0; + int retval = 0; + + /* + * extract the type and number bitfields, and don't decode + * wrong cmds: return ENOTTY (inappropriate ioctl) before access_ok() + */ + if (_IOC_TYPE(cmd) != LTKB_IOC_HEADER) return -ENOTTY; + if (_IOC_NR(cmd) > LTKB_IOC_MAXNR) return -ENOTTY; + + // TODO user access control // + + + switch(cmd) { + case LTKB_IOC_RESET: + if(!capable(CAP_SYS_ADMIN)) + return -EPERM; + // TODO free all memory mapping// + break; + case LTKB_IOC_PING: + retval = __get_user(c,(char __user *)arg); + c++; + retval = __put_user(c,(char __user *)arg); + break; + default: + return -ENOTTY; + } + return retval; + +} +// ------------------------------------------------------------------------- // + + + + + +#ifndef LTKB_MAJOR +#define LTKB_MAJOR 0 +#endif + +#ifndef LTKB_NR_DEVS +#define LTKB_NR_DEVS 4 +#endif + +#ifndef LTKB_DEVICE_NAME +#define LTKB_DEVICE_NAME "ltkb" +#endif + + + +/* the file operations, i.e. all character device methods */ +static struct file_operations ltkb_fops = { + .open = ltkb_open, + .release = ltkb_release, + .read = ltkb_read, + .write = ltkb_write, + .ioctl = ltkb_ioctl, + .mmap = ltkb_mmap, + .owner = THIS_MODULE, +}; + +static int _ltkb_major_number = LTKB_MAJOR; + +// Module init function //////////////////////////////////////////////////////// +static int __init ltkb_init(void) +{ + int i,ret = 0; + dev_t dev = 0; + + // REGISTER DEVICE // + if(_ltkb_major_number) + { + dev = MKDEV(_ltkb_major_number,0); + ret = register_chrdev_region(dev, LTKB_NR_DEVS, LTKB_DEVICE_NAME); + } + else { + ret = alloc_chrdev_region(&dev, 0, LTKB_NR_DEVS, LTKB_DEVICE_NAME ); + _ltkb_major_number = MAJOR(dev); + } + if (ret < 0) { + printk(KERN_WARNING "could not allocate major number %d for ltkb\n", + _ltkb_major_number); + return ret; + } + + // ALLOCATE DEVICES // + _ltkb_devices = kmalloc( LTKB_NR_DEVS * sizeof(struct ltkb_dev), GFP_KERNEL ); + if(!_ltkb_devices) { + printk(KERN_ERR "error allocating device structure in memory"); + return -ENOMEM; + } + memset(_ltkb_devices, 0, LTKB_NR_DEVS * sizeof(struct ltkb_dev)); + + // SETUP DEVICES // + for (i = 0 ; i < LTKB_NR_DEVS ; i++ ) + { + struct ltkb_dev *dev = &_ltkb_devices[i]; + int devno = MKDEV(_ltkb_major_number, i); + cdev_init (&dev->cdev, <kb_fops); + dev->cdev.owner = THIS_MODULE; + dev->cdev.ops = <kb_fops; + ret = cdev_add(&dev->cdev,devno,1); + if(ret) printk(KERN_NOTICE "Error %d adding ltkb%d device", ret, i); + init_MUTEX(&dev->semaphore); + } + printk( KERN_NOTICE "ltk bridge module loaded"); + return ret; +} + +// module release // +static void __exit ltkb_exit(void) +{ + // remove the character deivce // + int i; + dev_t devno = MKDEV(_ltkb_major_number,0); + if(_ltkb_devices) + { + for(i=0;i +#include +#include +#include +#include +#include +#include +#include + +#define LTKB_IOC_HEADER 'b' + +#define LTKB_IOC_RESET _IO(LTKB_IOC_HEADER, 0) +#define LTKB_IOC_PING _IOWR(LTKB_IOC_HEADER, 1, char) + +#define LTKB_IOC_MAXNR 1 + + +int main(void) +{ + int fd; + + if ((fd=open("ltkb0", O_RDWR|O_SYNC))<0) + { + perror("open"); + exit(-1); + } + + char buffer[200] = "hello"; + write(fd, (void *)&buffer, 6); + + char c = 'a'; + printf("%c ",c); + ioctl(fd, LTKB_IOC_PING, &c); + printf("%c ",c); + ioctl(fd, LTKB_IOC_PING, &c); + printf("%c\n",c); + close(fd); + return(0); +} + diff --git a/src/ltk/ltk_bridge/setup.sh b/src/ltk/ltk_bridge/setup.sh new file mode 100755 index 0000000..1886632 --- /dev/null +++ b/src/ltk/ltk_bridge/setup.sh @@ -0,0 +1,21 @@ +#!/bin/sh +module="ltkb" +device="ltkb" +mode="664" + +/sbin/insmod ./$module.ko $* || exit 1 + +rm -f ./${device}[0-3] + +major=$(awk "\$2==\"$module\" {print \$1}" /proc/devices) + +mknod ./${device}0 c $major 0 +mknod ./${device}1 c $major 1 +mknod ./${device}2 c $major 2 +mknod ./${device}3 c $major 3 + +group="mutom" +grep -q '^mutom:' /etc/group || group="adm" + +chgrp $group ./${device}[0-3] +chmod $mode ./${device}[0-3] \ No newline at end of file diff --git a/src/ltk/ltkdebug.c b/src/ltk/ltkdebug.c new file mode 100644 index 0000000..03b5024 --- /dev/null +++ b/src/ltk/ltkdebug.c @@ -0,0 +1,4 @@ + +#include "ltkdebug.h" + + diff --git a/src/ltk/ltkdebug.h b/src/ltk/ltkdebug.h new file mode 100755 index 0000000..fe55a04 --- /dev/null +++ b/src/ltk/ltkdebug.h @@ -0,0 +1,105 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef LTKDEBUG_H +#define LTKDEBUG_H + + +#include "ltkmacros.h" +#include "ltktypes.h" + +//! Provide a string for current function, non-concatenatable +#if defined (__GNUC__) || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 19901L) +# define __func_to_string__ ((const char*) (__func__)) +#else +# define __func_to_string__ ((const char*) ("???")) +#endif + +//! Provide a string for current function in pretty format, non-concatenatable +#if defined (__GNUC__) +# define __pfunc_to_string__ ((const char*) (__PRETTY_FUNCTION__)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 19901L +# define __pfunc_to_string__ ((const char*) (__func__)) +#else +# define __pfunc_to_string__ ((const char*) ("???")) +#endif + + + +//////////////////////////////////////////////////////////////////////////////// +//// Pragma Messages for debug allerts during compilation ///////////////////// +//////////////////////////////////////////////////////////////////////////////// + +#ifdef PRAGMA_MESSAGES +#define DEBUG_DO_PRAGMA(x) _Pragma (#x) +#else +#define DEBUG_DO_PRAGMA(x) ; +#endif + +#define TODO(x) DEBUG_DO_PRAGMA(message ("\n\n [TODO] >> " #x " <<\n")) +#define OPTIMIZE(x) DEBUG_DO_PRAGMA(message ("\n\n [OPTIMIZE] > " #x " <\n")) +#define DUMP(x) DEBUG_DO_PRAGMA(message ("\n\n [DUMP] > " #x " <\n")) + +// ------------------------------------------------------------------------ // + + + +C_BEGIN_DECLS + + +typedef enum +{ + LOG_FLAG_ACTIVE = 1 << 0, + LOG_FLAG_FATAL = 1 << 1, + LOG_LEVEL_ERROR = 1 << 2, + LOG_LEVEL_CRITICAL = 1 << 3, + LOG_LEVEL_WARNING = 1 << 4, + LOG_LEVEL_MESSAGE = 1 << 5, + LOG_LEVEL_INFO = 1 << 6, + LOG_LEVEL_DEBUG = 1 << 7, + LOG_LEVEL_ANNOING = 1 << 8, + LOG_LEVEL_PARANOID = 1 << 9 +} LogLevelFlags; + + + + +void debug_log( + void *handler, + LogLevelFlags flags, + const char *function_name, + const char *message, + ...); + + + +C_END_DECLS + + + + +#endif // LTKDEBUG_H diff --git a/src/ltk/ltkmacros.h b/src/ltk/ltkmacros.h new file mode 100644 index 0000000..c5e921d --- /dev/null +++ b/src/ltk/ltkmacros.h @@ -0,0 +1,61 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +/* + * File: macros.h + * Author: andrea + * + * Created on May 23, 2012, 9:01 AM + */ + +#ifndef LTK_MACROS_H +#define LTK_MACROS_H + +// C code in headers, while including them from C++ +#ifdef __cplusplus + +# define C_BEGIN_DECLS extern "C" { +# define C_END_DECLS } + +#define BEGIN_NAMESPACE(name) namespace name { +#define END_NAMESPACE } + +#else + +# define C_BEGIN_DECLS +# define C_END_DECLS + +#define BEGIN_NAMESPACE(name) +#define END_NAMESPACE + +#endif + + + + +#endif /* MACROS_H */ + diff --git a/src/ltk/ltktypes.h b/src/ltk/ltktypes.h new file mode 100644 index 0000000..c243841 --- /dev/null +++ b/src/ltk/ltktypes.h @@ -0,0 +1,127 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef LTK_TYPE_H +#define LTK_TYPE_H + +#include +#include + +//#include "templates.h" +#include "ltkmacros.h" + +#ifdef __cplusplus +# define LTK_TYPECAST(T, Type) static_cast< T >(Type) +#else +# define LTK_TYPECAST(T, Type) ((T)(Type)) +#endif + + +BEGIN_NAMESPACE(ltk) + +C_BEGIN_DECLS + +/* ////////////////////////////////////////////////////////////////////////// */ +/* //////////////////////////// TYPE DEFINITIONS ////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + + +typedef void * Pointer_t; +typedef id_t Id_t; +typedef size_t Size_t; + +#ifndef LTK_DOUBLE_PRECISION +typedef float Real_t; +#else +typedef double Real_t; +#endif + +#define LTK_SIGNED_CHAR_MIN LTK_TYPECAST(signed char, 0x80) +#define LTK_SIGNED_CHAR_MAX LTK_TYPECAST(signed char, 0x7f) + +#define LTK_UNSIGNED_CHAR_MIN LTK_TYPECAST(unsigned char, 0u) +#define LTK_UNSIGNED_CHAR_MAX LTK_TYPECAST(unsigned char, 0xffu) + +#define LTK_SHORT_MIN LTK_TYPECAST(short, 0x8000) +#define LTK_SHORT_MAX LTK_TYPECAST(short, 0x7fff) + +#define LTK_UNSIGNED_SHORT_MIN LTK_TYPECAST(unsigned short, 0u) +#define LTK_UNSIGNED_SHORT_MAX LTK_TYPECAST(unsigned short, 0xffffu) + +#define LTK_INT_MIN LTK_TYPECAST(int, ~(~0u >> 1)) +#define LTK_INT_MAX LTK_TYPECAST(int, ~0u >> 1) + +#define LTK_INT8_MIN LTK_TYPECAST(int8_t, 0x80) +#define LTK_INT8_MAX LTK_TYPECAST(int8_t, 0x7f) + +#define LTK_INT16_MIN LTK_TYPECAST(int16_t, 0x8000u) +#define LTK_INT16_MAX LTK_TYPECAST(int16_t, 0x7fffu) + +#define LTK_UNSIGNED_INT16_MIN LTK_TYPECAST(int16_t, 0u) +#define LTK_UNSIGNED_INT16_MAX LTK_TYPECAST(unsigned int16_t, 0xffffu) + +#define LTK_INT32_MIN LTK_TYPECAST(int32_t, 0x80000000u) +#define LTK_INT32_MAX LTK_TYPECAST(int32_t, 0x7fffffffu) + +#define LTK_UNSIGNED_INT32_MIN LTK_TYPECAST(unsigned int32_t, 0u) +#define LTK_UNSIGNED_INT32_MAX LTK_TYPECAST(unsigned int32_t, 0xffffffffu) + +#define LTK_INT64_MIN LTK_TYPECAST(int64_t, 0x8000000000000000u) +#define LTK_INT64_MAX LTK_TYPECAST(int64_t, 0x7fffffffffffffffu) + +#define LTK_UNSIGNED_INT8_MIN LTK_TYPECAST(int8_t, 0u) +#define LTK_UNSIGNED_INT8_MAX LTK_TYPECAST(int8_t, 0xffu) + +#define LTK_UNSIGNED_INT64_MIN LTK_TYPECAST(unsigned int64_t, 0u) +#define LTK_UNSIGNED_INT64_MAX LTK_TYPECAST(unsigned int64_t, \ + 0xffffffffffffffffu) + +#define LTK_UNSIGNED_INT_MIN LTK_TYPECAST(unsigned int, 0) +#define LTK_UNSIGNED_INT_MAX LTK_TYPECAST(unsigned int, ~0u) + +#define LTK_LONG_MIN LTK_TYPECAST(long, ~(~0ul >> 1)) +#define LTK_LONG_MAX LTK_TYPECAST(long, ~0ul >> 1) + +#define LTK_UNSIGNED_LONG_MIN LTK_TYPECAST(unsigned long, 0ul) +#define LTK_UNSIGNED_LONG_MAX LTK_TYPECAST(unsigned long, ~0ul) + +#define LTK_FLOAT_MIN LTK_TYPECAST(float, -1.0e+38f) +#define LTK_FLOAT_MAX LTK_TYPECAST(float, 1.0e+38f) + +#define LTK_DOUBLE_MIN LTK_TYPECAST(double, -1.0e+299) +#define LTK_DOUBLE_MAX LTK_TYPECAST(double, 1.0e+299) + + + + + +C_END_DECLS + +END_NAMESPACE + + +#endif //TYPE_H diff --git a/src/ltk/main.C b/src/ltk/main.C new file mode 100644 index 0000000..fb90774 --- /dev/null +++ b/src/ltk/main.C @@ -0,0 +1,35 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +#include "Object.h" + + +int main() +{ + return 0; +} diff --git a/src/ltk/main.c b/src/ltk/main.c new file mode 100644 index 0000000..12c29cd --- /dev/null +++ b/src/ltk/main.c @@ -0,0 +1,72 @@ + +#include "DenseMatrix.h" +#include "Vector.h" +#include "Object.h" + +#include "vectormath/simd/instrset.h" + +/* LTK_VECTOR_DECLARE(int,LtkInt4,4) */ + +/* LTK_MATRIX_DECLARE(int,LtkInt2x2,2,2) */ +/* LTK_MATRIX_DECLARE(int,LtkInt4x1,4,1) */ +/* LTK_MATRIX_DECLARE(int,LtkInt4x4,4,4) */ + +int test(int a) { return 0; } + + +int main(void) +{ + + // testing dense matrix // + /****************************************************/ + /* LtkInt2x2 a; */ + /* LtkInt4x1 b; */ + /* LtkInt4x4 c; */ + /* LtkInt4 v, w; */ + /* */ + /* v = LtkInt4_ltk_vector_new (); */ + /* w = LtkInt4_ltk_vector_new (); */ + /* */ + /* int i; */ + /* for (i = 0; i < LtkInt4_ltk_vector_size (); ++i) */ + /* { */ + /* LtkInt4_ltk_vector_set (v, i, 0); */ + /* LtkInt4_ltk_vector_set (w, i, 3); */ + /* } */ + /* */ + /* printf ("v = "); */ + /* for (i = 0; i < 4; ++i) */ + /* printf ("%d ", LtkInt4_ltk_vector_get (v, i)); */ + /* printf ("\n"); */ + /* */ + /* printf ("w = "); */ + /* for (i = 0; i < 4; ++i) */ + /* printf ("%d ", LtkInt4_ltk_vector_get (w, i)); */ + /* printf ("\n"); */ + /****************************************************/ + + // testing intrinsics // + printf("INSTRUCTION SET -> %d\n",INSTRSET); + __m128 aligned_float = _mm_setzero_ps(); + float *p = &aligned_float; + printf("%f,%f,%f,%f\n",p[0],p[1],p[2],p[3]); + + // adder // + __m128 a_1,a_2; + a_1 = _mm_set_ps(3,3,3,3); + a_2 = _mm_set_ps(1,2,3,4); + + + aligned_float = _mm_add_ps(a_1,a_2); + p = &aligned_float; printf("%f,%f,%f,%f\n",p[0],p[1],p[2],p[3]); + + + + // testing Objects // + //LTK_MATRIX_DECLARE(TypeName, type, r, c); + // Object *ob = New(ObjectClass); + // int el = ObjectClass->GetElement(ob); + + + return 0; +} diff --git a/src/ltk/templates.c b/src/ltk/templates.c new file mode 100644 index 0000000..a154d1a --- /dev/null +++ b/src/ltk/templates.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include "templates.h" + + +LtkList ltk_list_new() +{ + LtkList list = malloc(sizeof(struct _template_list)); + list->size = 0; + list->start = NULL; + list->end = NULL; + return list; +} + +void ltk_list_nodepush(LtkList list,LtkListNode node) +{ + if(list == NULL) return; + node->next = list->start; + list->start = node; + if(list->end == NULL) list->end = node; + list->size++; +} + +LtkListNode ltk_list_get_start(LtkList list) +{ + if (list==NULL || list->start==NULL) return NULL; + return list->start; +} + +LtkListNode ltk_list_get_end(LtkList list) +{ + if (list==NULL || list->end==NULL) return NULL; + return list->end; +} + +void ltk_list_remove(LtkList list,LtkListNode node) +{ + if (list == NULL || list->start==NULL) return; + struct _template_list_node *node_tofree,*prev; + node_tofree=list->start; + while (node_tofree != node) { + if(node_tofree->next == NULL) return; + prev = node_tofree; + node_tofree = node_tofree->next; + } + if(node_tofree == list->start) list->start = node_tofree->next; + else prev->next = node_tofree->next; + free(node_tofree); +} + +void ltk_list_pop_start(LtkList list) +{ + if (list==NULL || list->start==NULL) return; + struct _template_list_node *nodetofree; + nodetofree=list->start; + list->start = list->start->next; + free(nodetofree); +} + +void ltk_list_pop_end(LtkList list) +{ + if (list==NULL || list->end==NULL) return; + struct _template_list_node *iter; + iter=list->start; + if(iter==list->end) { + free(iter); + list->start = list->end = NULL; + } + else { + while(iter->next!=list->end) iter=iter->next; + free(iter->next); + iter->next = NULL; + list->end = iter; + } + list->size--; +} + +int ltk_list_get_size(LtkList list) +{ + if(list==NULL) return 0; + return list->size; +} + + +LtkListIterator ltk_list_iterator_new(LtkList list) +{ + if(list==NULL || list->start == NULL) return NULL; + return (LtkListIterator)list->start; +} + + diff --git a/src/ltk/templates.h b/src/ltk/templates.h new file mode 100644 index 0000000..00abd01 --- /dev/null +++ b/src/ltk/templates.h @@ -0,0 +1,303 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +/* + * + * Copyright (C) 2012 Andrea Rigoni Garola + * + * 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, see . + * + */ + + +#ifndef TEMPLATES_H +#define TEMPLATES_H + +#include // for std allocator // +#include // for memcpy // +#include + +#include "ltkmacros.h" // default environment // +#include "container.h" // TODO !!! // + +#include + + + + + +/* ////////////////////////////////////////////////////////////////////////// */ +/* //////////////////////////// ALLOC FUNCTIONS ///////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +C_BEGIN_DECLS + +//inline ltkPointer ltk_malloc(unsigned int size) { return malloc(size); } +//inline void ltk_free (ltkPointer ptr) { free(ptr); } + +#define LTK_SIMPLE_ALLOC_FUNC(Type, ltkType, Class_name, size) \ + inline ltkType ltkType##_##Class_name##_new() \ + { \ + return LTK_TYPECAST(ltkType, malloc(sizeof(Type) * size)); \ + } \ + inline void ltkType##_##Class_name##_delete(ltkType t) \ + { free(t); } \ + inline void ltkType##_##Class_name##_copy(ltkType dst, const ltkType src) \ + { memcpy((ltkPointer)dst, (ltkPointer)src, sizeof(Type) * size ); } + +C_END_DECLS + + + + + +/* ////////////////////////////////////////////////////////////////////////// */ +/* //////////////////////////// ABSTRACT C BUFFER /////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +C_BEGIN_DECLS + +#define LTK_ABSTRACT_BUFFER_DECLARE_FUNC(Type,ltkType,Class_name,size) \ + inline int ltkType##_##Class_name##_size() { return size; } \ + inline Type ltkType##_##Class_name##_get(ltkType v, unsigned int c) \ + { assert(c < size); return *((ltkType)m + c); } \ + inline void ltkType##_##Class_name##_set(ltkType v, Type t, unsigned int c) \ + { assert(c < size); *((ltkType)m + c) = t; } + +// FINIRE !!! // + +C_END_DECLS + +#ifdef __cplusplus + +template class ltkAbstractBuffer +{ + typedef ltkAbstractBuffer ThisClass; +protected: + typedef T ContentType; + virtual T* getBuffer() = 0; + virtual const T* getBuffer() const = 0; + + struct CommaInit + { + inline explicit CommaInit(ltkAbstractBuffer *container,float s) + : container(container) { + this->index = 0; + this->container->getBuffer()[0] = s; + } + inline CommaInit & operator, (float s) { + this->index++; + assert(index < size); + this->container->getBuffer()[this->index] = s; + return *this; + } + ltkAbstractBuffer *container; + unsigned int index; + }; + +public: + inline CommaInit operator =(T scalar) { + return CommaInit(this, scalar); + } + inline CommaInit operator <<(T scalar) { + return CommaInit(this, scalar); + } + + inline T& at(const unsigned int i) { + return *(this->getBuffer() + i); + } + + inline T & operator[](unsigned int i) { + return *(this->getBuffer() + i); + } + inline const T & operator[](unsigned int i) const { + return *(this->getBuffer() + i); + } + inline T & operator()(unsigned int i) { + return *(this->getBuffer() + i); + } + inline const T & operator()(unsigned int i) const { + return *(this->getBuffer() + i); + } + + +}; + +#endif // __cplusplus + + +/* ////////////////////////////////////////////////////////////////////////// */ +/* //////////////////////////// ARRAY /////////////////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ + +// COMING SOON // + + + + + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +/// DO NOT USE ANYTHING AFTER THIS LINE ... EXPERIMENTAL ////////////////// + + + + + + + + + +/* ////////////////////////////////////////////////////////////////////////// */ +/* //////////////////////////// CIRCULAR BUFFER ///////////////////////////// */ +/* ////////////////////////////////////////////////////////////////////////// */ +/* CIRCULAR BUFFER */ + +struct _ltk_template_buffer { + void *pos; + void *head; +}; + +#define LTK_BUFFER_DECLARE(Type, Type_name, size, overlap) \ +typedef struct _ltk_template_buffer *Type_name; \ +inline Type_name Type_name##_ltk_buffer_new() \ +{ Type_name out = (Type_name)ltk_malloc \ + (sizeof(Type) * (size + overlap) + 2); \ + out->head = (void *)out + 2 + overlap * sizeof(Type); \ + out->pos = out->head; \ +return out; } \ +inline void Type_name##_ltk_buffer_free(Type_name buffer) { ltk_free(buffer); }\ + + + +// TO BE CONTINUED.... // + + + + + + + + +///// LtkPTree //////// + +struct _LtkPTreeNode +{ + struct _LtkPTreeNode *parent; +}; +typedef struct _LtkPTreeNode *LtkPtree; + + + + + + + + + + + + +/* + one way list template usable as FIFO or LIFO by macros + Element must be a pointer to a real allocated object. +*/ +// this acts as dummy node, never really instanciated // +struct _template_list_node { + struct _template_list_node *next; +}; +typedef struct _template_list_node *LtkListNode; +#define LTK_LIST_HEADER LtkListNode ltk_list_node_next; + +struct _template_list { + int size; + struct _template_list_node *start; + struct _template_list_node *end; +}; + +typedef struct _template_list *LtkList; +typedef struct _template_list_node *LtkListIterator; + +LtkList ltk_list_new(); +void ltk_list_nodepush(LtkList list,LtkListNode node); +LtkListNode ltk_list_get_start(LtkList list); +LtkListNode ltk_list_get_end(LtkList list); +void ltk_list_remove(LtkList list,LtkListNode node); +void ltk_list_pop_start(LtkList list); +void ltk_list_pop_end(LtkList list); + + +#define LTK_LIST_DECLARE(Type,Type_name) \ + static LtkList (* Type_name##_list_new)(void) = ltk_list_new;\ + void (* Type_name##_list_nodepush)(LtkList list, Type *node) = (void (*)(LtkList, Type *))ltk_list_nodepush; \ + Type * (* Type_name##_list_get_start)(LtkList list) = (Type *(*)(LtkList))ltk_list_get_start; \ + Type * (* Type_name##_list_get_end)(LtkList list) = (Type *(*)(LtkList))ltk_list_get_end; \ + void (* Type_name##_list_remove)(LtkList list, Type *node) = (void (*)(LtkList, Type *))ltk_list_remove; \ + void (* Type_name##_list_pop_start)(LtkList list) = (void (*)(LtkList))ltk_list_pop_start; \ + void (* Type_name##_list_pop_end)(LtkList list) = (void (*)(LtkList))ltk_list_pop_end; + +#define LTK_LIST_DECLARE_KEYACCESS(Type,Type_name,KeyType,key_member_name,key_function) \ + Type * Type_name##_list_key_lookup(LtkList list, KeyType key) { \ + LtkListIterator iter = ltk_list_iterator_new(list); \ + while(iter) { \ + if (key_function( ((Type *)iter)->key_member_name, key )) \ + return (Type *)iter; \ + iter = iter->next; } \ + return NULL; } \ + \ + void Type_name##_list_key_remove(LtkList list, KeyType key) { \ + LtkListNode node = (LtkListNode)Type_name##_list_key_lookup(list,key); \ + if(node) ltk_list_remove(list,node); } \ + + +LtkListIterator ltk_list_iterator_new(LtkList list); + +#endif // TEMPLATES_H diff --git a/src/ltk/test_comma.h b/src/ltk/test_comma.h new file mode 100644 index 0000000..2d69036 --- /dev/null +++ b/src/ltk/test_comma.h @@ -0,0 +1,117 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +/* + * File: test_comma.h + * Author: andrea + * + * Created on May 24, 2012, 4:47 PM + */ + +#ifndef TEST_COMMA_H +#define TEST_COMMA_H + +#include + +struct Vector3 +{ + union + { + struct { float x, y, z; }; + float data[3]; + }; + + struct CommaAssign; + + CommaAssign operator=(float _x) + { + x = _x; + return CommaAssign(this,1); + } + + struct CommaAssign + { + Vector3 *vec3; + int index; + + explicit CommaAssign(Vector3 *vec3, int index) : vec3(vec3) { + this->index = index; + } + CommaAssign operator, (float f) { + vec3->data[index] = f; + return CommaAssign(vec3, index + 1); + } + + }; + +}; + + + +struct Container +{ + union + { + struct { float x, y, z; }; + float data[3]; + }; + + inline float *getBuffer() { + return this->data; + } + + template class CommaAssign + { + private: + T *container; + int index; + + public: + inline explicit CommaAssign(T *container, float s) : container(container) { + this->index = 0; + this->container->getBuffer()[0] = s; + } + + inline CommaAssign& operator, (float s) { + this->index++; + assert(index < size); + this->container->getBuffer()[this->index] = s; + return *this; + } + }; + + CommaAssign operator=(float s) { + return CommaAssign (this, s); + } + +}; + + + + +#endif /* TEST_COMMA_H */ + diff --git a/src/ltk/testing/Makefile.am b/src/ltk/testing/Makefile.am new file mode 100644 index 0000000..1964340 --- /dev/null +++ b/src/ltk/testing/Makefile.am @@ -0,0 +1,37 @@ + +include $(top_srcdir)/Common.am + +#AM_DEFAULT_SOURCE_EXT = .cpp + + + +TESTS = LtkDebugTest \ + LtkFunctionToStringTest + +LDADD = ../../../libmutom-0.1.la +check_PROGRAMS = $(TESTS) + + +#################################################### +# Hybrid c/c++ Ltk Specific tests # +#################################################### + +check_PROGRAMS += Vector-test +Vector_test_SOURCES = Vector.c +TESTS += Vector-test + +check_PROGRAMS += Vector-test-cc +Vector_test_cc_SOURCES = Vector-cc.cpp +TESTS += Vector-test-cc + +check_PROGRAMS += Object-test +Object_test_SOURCES = Object.c +TESTS += Object-test + +check_PROGRAMS += Object-test-cc +Object_test_cc_SOURCES = Object-cc.cpp +TESTS += Object-test-cc + +#################################################### + +AM_COLOR_TESTS = always diff --git a/src/ltk/testing/Object-cc.cpp b/src/ltk/testing/Object-cc.cpp new file mode 100644 index 0000000..011af7f --- /dev/null +++ b/src/ltk/testing/Object-cc.cpp @@ -0,0 +1,40 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "testing-prototype.h" +#include "../Object.h" + +using namespace ltk; + +int main() { + BEGIN_TESTING(Object - cc); + + Object ob; + TEST1( ob.GetElement() == 5552368 ); + + END_TESTING; +} diff --git a/src/ltk/testing/Object.c b/src/ltk/testing/Object.c new file mode 100644 index 0000000..9627bb9 --- /dev/null +++ b/src/ltk/testing/Object.c @@ -0,0 +1,11 @@ +#include "testing-prototype.h" +#include "../Object.h" + + +int main() { + BEGIN_TESTING(Object); + + struct _Object *ob = Object_new(ObjectClass); + + END_TESTING; +} diff --git a/src/ltk/testing/Vector-cc.cpp b/src/ltk/testing/Vector-cc.cpp new file mode 100644 index 0000000..d0d75fc --- /dev/null +++ b/src/ltk/testing/Vector-cc.cpp @@ -0,0 +1,79 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include "testing-prototype.h" +#include "../Vector.h" + +using namespace ltk; + +int main() { + BEGIN_TESTING(Vector - cc); + + typedef ltkVector ltkInt4; + + ltkInt4 v, w; + v = 1, 2, 3, 4; + w = v; + + printf("v -> %d,%d,%d,%d\n", v[0], *(v.getBuffer() + 1), v.at(2), v(3)); + + + // test assign operator + TEST1(v == w); + TEST0(v != w); + + // test accessors + TEST1(v[0] == 1); + TEST1(*(v.getBuffer() + 1) == 2); + TEST1(v.at(2) == 3); + TEST1(v(3) == 4); + + // setter + w << 1, 4, 9, 16; + TEST1(w[0] == 1); + TEST1(w[1] == 4); + TEST1(w[2] == 9); + TEST1(w[3] == 16); + + // math operators + v *= v; + w = 1, 4, 9, 16; + TEST1(v == w); + v /= v; + w = 1, 1, 1, 1; + TEST1(v == w); + v += v; + w = 2, 2, 2, 2; + TEST1(v == w); + + v << 1, 1, -1, 1; + w << -1, 1, 1, 1; + TEST0(v * w); + TEST0(v / w); + + END_TESTING; +} diff --git a/src/ltk/testing/Vector.c b/src/ltk/testing/Vector.c new file mode 100644 index 0000000..f7d1ab7 --- /dev/null +++ b/src/ltk/testing/Vector.c @@ -0,0 +1,14 @@ +#include +#include "testing-prototype.h" +#include "../Vector.h" + + +LTK_VECTOR_DECLARE (float, uFloat4, 4) + +int main() +{ + BEGIN_TESTING (Vector); + uFloat4 f = uFloat4_ltk_vector_new (); + + END_TESTING; +} diff --git a/src/ltk/testing/testing-prototype.h b/src/ltk/testing/testing-prototype.h new file mode 100644 index 0000000..39f4e6c --- /dev/null +++ b/src/ltk/testing/testing-prototype.h @@ -0,0 +1,37 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include + +#define BEGIN_TESTING(name) \ +static int _fail = 0; \ +printf("..:: Testing " #name " ::..\n"); + +#define TEST1(val) _fail += (val)==0 +#define TEST0(val) _fail += (val)!=0 +#define END_TESTING return _fail; + diff --git a/src/utils/copyrights/cr_update.py b/src/utils/copyrights/cr_update.py new file mode 100644 index 0000000..8fe6342 --- /dev/null +++ b/src/utils/copyrights/cr_update.py @@ -0,0 +1,45 @@ +# updates the copyright information for all .cs files +# usage: call recursive_traversal, with the following parameters +# parent directory, old copyright text content, new copyright text content + +import os + +excludedir = ["..\\Lib"] + +def update_source(filename, oldcopyright, copyright): + utfstr = chr(0xef)+chr(0xbb)+chr(0xbf) + fdata = file(filename,"r+").read() + isUTF = False + if (fdata.startswith(utfstr)): + isUTF = True + fdata = fdata[3:] + if (oldcopyright != None): + if (fdata.startswith(oldcopyright)): + fdata = fdata[len(oldcopyright):] + if not (fdata.startswith(copyright)): + print "updating "+filename + fdata = copyright + fdata + if (isUTF): + file(filename,"w").write(utfstr+fdata) + else: + file(filename,"w").write(fdata) + +def recursive_traversal(dir, oldcopyright, copyright): + global excludedir + fns = os.listdir(dir) + print "listing "+dir + for fn in fns: + fullfn = os.path.join(dir,fn) + if (fullfn in excludedir): + continue + if (os.path.isdir(fullfn)): + recursive_traversal(fullfn, oldcopyright, copyright) + else: + if ( fullfn.endswith(".cpp") or fullfn.endswith(".h") or fullfn.endswith(".hpp") or fullfn.endswith(".C") or fullfn.endswith(".cxx") ): + update_source(fullfn, oldcopyright, copyright) + + +oldcright = file("oldcr.txt","r+").read() +cright = file("newcr.txt","r+").read() +recursive_traversal("../../", oldcright, cright) +exit() diff --git a/src/utils/copyrights/newcr.txt b/src/utils/copyrights/newcr.txt new file mode 100644 index 0000000..3ed7526 --- /dev/null +++ b/src/utils/copyrights/newcr.txt @@ -0,0 +1,27 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + diff --git a/src/utils/copyrights/oldcr.txt b/src/utils/copyrights/oldcr.txt new file mode 100644 index 0000000..f781efb --- /dev/null +++ b/src/utils/copyrights/oldcr.txt @@ -0,0 +1,24 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ diff --git a/src/utils/make_recipe/CMakeLists.txt b/src/utils/make_recipe/CMakeLists.txt new file mode 100644 index 0000000..66cc8d9 --- /dev/null +++ b/src/utils/make_recipe/CMakeLists.txt @@ -0,0 +1,37 @@ +set(HEADERS +) + +SET(SOURCES +) + + +## Build target tar file ## +set(CMAKE_TAR_FILE "recipe.tar.gz") +add_custom_command(OUTPUT recipe_tar_data.o + COMMAND tar -zcvf ${CMAKE_TAR_FILE} -C "${CMAKE_CURRENT_SOURCE_DIR}/src" CMakeLists.txt main.cpp -C ${PROJECT_SOURCE_DIR} CMakeConfig.in.h + ## -C ${PROJECT_SOURCE_DIR} CMake + COMMAND objcopy --input binary --output elf64-x86-64 --binary-architecture i386 ${CMAKE_TAR_FILE} ${CMAKE_CURRENT_BINARY_DIR}/recipe_tar_data.o +) + +add_library(recipe_tar_data STATIC recipe_tar_data.o) +set_source_files_properties(recipe_tar_data.o PROPERTIES EXTERNAL_OBJECT true GENERATED true) +set_target_properties(recipe_tar_data PROPERTIES LINKER_LANGUAGE C) + + +set(CMAKE_TAR_FILE "cmake.tar.gz") +add_custom_command(OUTPUT cmake_tar_data.o + COMMAND tar -zcvf ${CMAKE_TAR_FILE} -C ${PROJECT_SOURCE_DIR} CMake "--exclude=CMake/.svn" + COMMAND objcopy --input binary --output elf64-x86-64 --binary-architecture i386 ${CMAKE_TAR_FILE} ${CMAKE_CURRENT_BINARY_DIR}/cmake_tar_data.o +) + +add_library(cmake_tar_data STATIC cmake_tar_data.o) +set_source_files_properties(cmake_tar_data.o PROPERTIES EXTERNAL_OBJECT true GENERATED true) +set_target_properties(cmake_tar_data PROPERTIES LINKER_LANGUAGE C) + + + +uLib_add_target(uLib_config main.cpp) +target_link_libraries(uLib_config cmake_tar_data) +target_link_libraries(uLib_config recipe_tar_data) +target_link_libraries(uLib_config ${PACKAGE_LIBPREFIX}Core) + diff --git a/src/utils/make_recipe/main.cpp b/src/utils/make_recipe/main.cpp new file mode 100644 index 0000000..d4734ff --- /dev/null +++ b/src/utils/make_recipe/main.cpp @@ -0,0 +1,137 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include +#include +#include +#include +#include + +#include "Core/Options.h" + + +using namespace uLib; + +extern "C" { +extern char _binary_recipe_tar_gz_start; +extern char _binary_recipe_tar_gz_end; +extern char _binary_cmake_tar_gz_start; +extern char _binary_cmake_tar_gz_end; +} + + +namespace { +static struct Parameters : Options +{ + std::string project; + Parameters(const char *hello = "Program options") : Options(hello) { + add_options() + ("help,h", "printout help") + // GENERAL // + ("project,p", &project, std::string(), "name of project") + ("cmake,k", "cmake recipe project") + ("cmake-modules,K", "only builds cmake modules directory") + ("libs", "get mutom linker flags") + ("cflags", "get compiler flags") + ; + } +} p; +} // namespace + + +static std::string system_pipe(std::string cmd) { + FILE *pipe = popen(cmd.c_str(),"r"); + if(pipe) { + std::stringstream ss; + int c = fgetc (pipe); + while (c != EOF) { + if(c != '\n') ss << (char)c; + c = fgetc (pipe); + } + return ss.str(); + } + else return std::string(""); +} + + + + + +int main(int argc, char *argv[]) +{ + p.parse_command_line(argc,argv); + + if(p.project != "") { + char dir[300]; + sprintf(dir,"mkdir %s",p.project.c_str()); + system(dir); + chdir(p.project.c_str()); + } + + if(p.count("cmake") || p.count("cmake-modules")) { + std::ofstream file; + file.open("_cmake.tar.gz", std::ios::out | std::ios::binary ); + char* ptr = &_binary_cmake_tar_gz_start; + while ( ptr != &_binary_cmake_tar_gz_end ) + file << *ptr++; + file.close(); + + std::cout << "Deploing CMake files .... \n"; + system("tar -zxvf _cmake.tar.gz"); + system("rm _cmake.tar.gz"); + std::cout << "done ... \n"; + } + + if(p.count("cmake")) { + std::ofstream file; + file.open("_recipe.tar.gz", std::ios::out | std::ios::binary ); + char* ptr = &_binary_recipe_tar_gz_start; + while ( ptr != &_binary_recipe_tar_gz_end ) + file << *ptr++; + file.close(); + + std::cout << "Deploing recipe files .... \n"; + system("tar -zxvf _recipe.tar.gz"); + system("rm _recipe.tar.gz"); + std::cout << "done ... \n"; + } + + if(p.count("cflags")) { + std::cout + << system_pipe("cmake --find-package -DCMAKE_PREFIX_PATH=/usr/local/lib/cmake/mutom-0.2 -DNAME=uLib -DLANGUAGE=C -DCOMPILER_ID=GNU -DMODE=COMPILE") + << system_pipe("cmake --find-package -DCMAKE_PREFIX_PATH=/usr/local/lib/cmake/mutom-0.2 -DNAME=IB -DLANGUAGE=C -DCOMPILER_ID=GNU -DMODE=COMPILE"); + } + + if(p.count("libs")) { + std::cout + << system_pipe("cmake --find-package -DCMAKE_PREFIX_PATH=/usr/local/lib/cmake/mutom-0.2 -DNAME=uLib -DLANGUAGE=C -DCOMPILER_ID=GNU -DMODE=LINK") + << system_pipe("cmake --find-package -DCMAKE_PREFIX_PATH=/usr/local/lib/cmake/mutom-0.2 -DNAME=IB -DLANGUAGE=C -DCOMPILER_ID=GNU -DMODE=LINK"); + } + + return 0; +} + diff --git a/src/utils/make_recipe/src/CMake b/src/utils/make_recipe/src/CMake new file mode 120000 index 0000000..5b0f7e9 --- /dev/null +++ b/src/utils/make_recipe/src/CMake @@ -0,0 +1 @@ +../../../../CMake \ No newline at end of file diff --git a/src/utils/make_recipe/src/CMakeLists.txt b/src/utils/make_recipe/src/CMakeLists.txt new file mode 100644 index 0000000..05e35c0 --- /dev/null +++ b/src/utils/make_recipe/src/CMakeLists.txt @@ -0,0 +1,104 @@ +################################################################################ +################################################################################ +################################################################################ + +cmake_minimum_required(VERSION 2.6) +project(hello_world) +set(SOURCES + # put your sources here + main.cpp +) + +set(DICTIONARY_HEADERS + # put dictionary headers here +) + +################################################################################ +################################################################################ +################################################################################ +################################################################################ +################################################################################ + + +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake") +include(uLibDebugMacro) +include(uLibCommon) +include(uLibFindDependencies) +include(uLibConfigHeader) +include(uLibGenerateRMake) + + +## MUDULE FIND PACKAGE ------------------------------------------------------ ## +#find_package(uLib REQUIRED) # not working at the moment + +## CONFIG FIND PACKAGE ------------------------------------------------------ ## +#set(CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}/lib/cmake") +unset(ULIB_CONFIG) +find_package(ULIB 0.2 CONFIG + NAMES uLib + PATH_SUFFIXES mutom-0.2 +) +if(ULIB_CONFIG) + set(ULIB_FOUND true) +endif() + +unset(IB_CONFIG) +find_package(IB 0.2 CONFIG + PATH_SUFFIXES mutom-0.2 +) +if(IB_CONFIG) + set(IB_FOUND true) +endif() + + +## PROJECT EXECUTABLE ------------------------------------------------------- ## +add_executable(${PROJECT_NAME} ${SOURCES}) + +if(ULIB_FOUND) + include_directories(${ULIB_INCLUDE_DIRS}) + target_link_libraries(${PROJECT_NAME} + ############################################################################ + ## ULIB MODULES ## + mutomCore + mutomMath + mutomDetectors + # mutomVtk + ############################################################################ + + ############################################################################ + # MANUAL INLCLUDE EXTERNAL DEPENDENCIES + # ${Boost_SERIALIZATION_LIBRARY} + # ${Boost_SIGNALS_LIBRARY} + # ${Boost_PROGRAM_OPTIONS_LIBRARY} + # ${Geant4_LIBRARIES} + # ${ROOT_LIBRARIES} + # ${VTK_LIBRARIES} # all VTK libs + ############################################################################ +) +endif(ULIB_FOUND) + +if(IB_FOUND) + include_directories(${IB_INCLUDE_DIRS}) + target_link_libraries(${PROJECT_NAME} mutomIB ) +endif() + + +## ROOT DICTIONARY COMPILE -------------------------------------------------- ## +if(ROOT_FOUND AND DICTIONARY_HEADERS) +include(FindROOTv6) +message("----------- Building Root Dictionary ----------") +debug(DICTIONARY_HEADERS) +debug(ROOT_CINT_EXECUTABLE) +add_library(dictionary STATIC RootDict.cxx) +add_custom_command(OUTPUT RootDict.cxx RootDict.h + COMMAND ${ROOT_CINT_EXECUTABLE} -f RootDict.cxx -c -p ${DICTIONARY_HEADERS} Linkdef.h +) +#root_generate_dictionary(RootDict ${DICTIONARY_HEADERS} LINKDEF Linkdef.h) +set_source_files_properties(RootDict.cxx PROPERTIES GENERATED TRUE) +set_source_files_properties(RootDict.h PROPERTIES GENERATED TRUE) +target_link_libraries(${PROJECT_NAME} dictionary) +endif(ROOT_FOUND AND DICTIONARY_HEADERS) + + + + diff --git a/src/utils/make_recipe/src/main.cpp b/src/utils/make_recipe/src/main.cpp new file mode 100644 index 0000000..40c09ba --- /dev/null +++ b/src/utils/make_recipe/src/main.cpp @@ -0,0 +1,36 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#include +#include + + +int main(int argc, char **argv) +{ + std::cout << "hello uLib user\n"; + return 0; +} diff --git a/src/utils/moc/Makefile b/src/utils/moc/Makefile new file mode 100644 index 0000000..d42bd6d --- /dev/null +++ b/src/utils/moc/Makefile @@ -0,0 +1,24 @@ + + +# Makefile example -- scanner and parser. +# +CXX = g++ -D_DEBUG +LEX = flex +YACC = bison -y -t +YFLAGS = -d +objects = parse.o scan.o + +moc: $(objects) + $(CXX) -o $@ $(objects) -lfl + +parse.o: parse.y + +# parse.h: parse.c +# mv -f y.tab.h parse.h + +scan.o: scan.l + + +clean: + rm -f *.o parse.tab.c parse.tab.h + diff --git a/src/utils/moc/moc_actions.h b/src/utils/moc/moc_actions.h new file mode 100644 index 0000000..db6e97e --- /dev/null +++ b/src/utils/moc/moc_actions.h @@ -0,0 +1,92 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + +#ifndef MOC_ACTION_H +#define MOC_ACTION_H + +#include +#include +#include +#include + +#ifndef NDEBUG +#define DEBUG( ... ) { printf(" /*["); printf( __VA_ARGS__ ); printf("]*/ "); } +#else +#define DEBUG( ... ) ; +#endif + +#define CONCAT( dest , ... ) string_append(dest, __VA_ARGS__, NULL) + +char * string_append(char *first, ... ) { + va_list ap; + va_start (ap, first); /* Initialize the argument list. */ + + char *str_in = first; + char *str = malloc(sizeof(char) * strlen(str_in)); + strcat(str,str_in); + + str_in = va_arg (ap,char *); + while (str_in) { + char *tmp = malloc(sizeof(char) * (strlen(str)+strlen(str_in)) ); + memcpy(tmp,str,strlen(str)); + memcpy(tmp+strlen(str),str_in,strlen(str_in)); + free(str); + str = tmp; + str_in = va_arg (ap,char *); + } + return str; +} + + + + + + +// ACTIONS // + + + +#define SIMPLE_DECLARATION simple_declaration_action + +static int simple_declaration_action(const char *type, const char *ids); + + + + + + +// move to implementation .. // +static int simple_declaration_action(const char *type, const char *ids) { + DEBUG("simple_declaration -> type:\"%s\" decl:\"%s\" ",type,ids); + return 0; +} + + + + + +#endif // MOC_ACTION_H diff --git a/src/utils/moc/parse.y b/src/utils/moc/parse.y new file mode 100644 index 0000000..ba06996 --- /dev/null +++ b/src/utils/moc/parse.y @@ -0,0 +1,1257 @@ +%{ + +#include +#include +#include "moc_actions.h" + +#define EMPTY strdup(""); +#define YYDEBUG 1 +#define YYPRINT(file, type, value) yyprint (file, type, value) + +%} + +// Symbols. // +%union +{ + char *sval; +}; + +%token MOC_PROPERTY MOC_OBJECT_PARAMETERS +%type MOC_monk_seq_opt MOC_monk + + + +%token IDENTIFIER +%token INTEGER FLOATING CHARACTER STRING +%token TYPEDEF_NAME NAMESPACE_NAME CLASS_NAME ENUM_NAME TEMPLATE_NAME + +%token COLONCOLON +%token ELLIPSIS DOTSTAR ADDEQ SUBEQ MULEQ DIVEQ MODEQ +%token XOREQ ANDEQ OREQ SL SR SREQ SLEQ EQ NOTEQ LTEQ GTEQ ANDAND OROR +%token PLUSPLUS MINUSMINUS ARROWSTAR ARROW + + +%token ASM AUTO BOOL BREAK CASE CATCH CHAR CLASS CONST CONST_CAST CONTINUE +%token DEFAULT DELETE DO DOUBLE DYNAMIC_CAST ELSE ENUM EXPLICIT EXPORT EXTERN +%token FALSE FLOAT FOR FRIEND GOTO IF INLINE INT LONG MUTABLE NAMESPACE NEW +%token OPERATOR PRIVATE PROTECTED PUBLIC REGISTER REINTERPRET_CAST RETURN +%token SHORT SIGNED SIZEOF STATIC STATIC_CAST STRUCT SWITCH TEMPLATE THIS +%token THROW TRUE TRY TYPEDEF TYPEID TYPENAME UNION UNSIGNED USING VIRTUAL +%token VOID VOLATILE WCHAR_T WHILE + + + + +%type type_name class_name enum_name typedef_name + +%type simple_type_specifier +%type decl_specifier_seq decl_specifier +%type simple_declaration block_declaration + +%type init_declarator_list init_declarator +%type initializer initializer_clause +%type declarator direct_declarator ptr_operator declarator_id +%type type_specifier type_specifier_seq elaborated_type_specifier class_key nested_name_specifier template_argument_list +%type enum_specifier enumerator_list enumerator_definition enumerator +%type class_or_namespace_name +%type identifier +%type id_expression +%type constant_expression + + +%type declaration_seq_opt +%type TEMPLATE_opt +%type nested_name_specifier_opt +%type expression_list_opt +%type COLONCOLON_opt +%type new_placement_opt +%type new_initializer_opt +%type new_declarator_opt +%type expression_opt +%type statement_seq_opt +%type condition_opt +%type decl_specifier_seq_opt +%type init_declarator_list_opt +%type identifier_opt +%type enumerator_list_opt +%type TYPENAME_opt +%type initializer_opt +%type cv_qualifier_seq_opt +%type exception_specification_opt +%type constant_expression_opt +%type abstract_declarator_opt +%type type_specifier_seq_opt +%type direct_abstract_declarator_opt +%type parameter_declaration_list_opt +%type ELLIPSIS_opt +%type ctor_initializer_opt +%type COMMA_opt +%type member_specification_opt +%type base_clause_opt +%type member_declarator_list_opt +%type SEMICOLON_opt +%type pure_specifier_opt +%type constant_initializer_opt +%type access_specifier_opt +%type VIRTUAL_opt +%type conversion_declarator_opt +%type EXPORT_opt +%type handler_seq_opt +%type assignment_expression_opt +%type type_id_list_opt + + +%error-verbose +//%debug +%% + +MOC_block_seq_opt + : /* empty */ + | MOC_block_seq_opt MOC_uLib_Parameters + | MOC_block_seq_opt MOC_Property + ; + +MOC_Property: + MOC_PROPERTY '(' IDENTIFIER ')' '{' { DEBUG("found property: %s",$3); } + MOC_prop_content_opt + '}' { DEBUG("property ends"); } + ; + +MOC_uLib_Parameters: + MOC_OBJECT_PARAMETERS '(' IDENTIFIER ')' '{' { DEBUG("found parameters: %s",$3); } + MOC_prop_content_opt + '}' { DEBUG("parameters ends"); } + ; + +MOC_prop_content_opt + : + | translation_unit + ; + + +MOC_monk_seq_opt + : { $$ = EMPTY; } + | MOC_monk_seq_opt MOC_monk { $$ = CONCAT($1,$2); } + ; + +MOC_monk + : INT IDENTIFIER ';' { $$ = CONCAT("type:",$1," ","id:",$2," "); } + | CHAR IDENTIFIER ';' { $$ = CONCAT("type:",$1," ","id:",$2," "); } + | decl_specifier_seq_opt decl_specifier_seq_opt ';' { $$ = CONCAT("type:",$1," ","id:",$2," "); } + ; + +/*---------------------------------------------------------------------- + * Lexical elements. + *----------------------------------------------------------------------*/ + +identifier: + IDENTIFIER + ; + +literal: + integer_literal + | character_literal + | floating_literal + | string_literal + | boolean_literal + ; + +integer_literal: + INTEGER + ; + +character_literal: + CHARACTER + ; + +floating_literal: + FLOATING + ; + +string_literal: + STRING + ; + +boolean_literal: + TRUE + | FALSE + ; + +/*---------------------------------------------------------------------- + * Translation unit. + *----------------------------------------------------------------------*/ + +translation_unit: + declaration_seq_opt { DEBUG("t unit"); } + ; + +/*---------------------------------------------------------------------- + * Expressions. + *----------------------------------------------------------------------*/ + +primary_expression: + literal + | THIS + | COLONCOLON identifier + | COLONCOLON operator_function_id + | COLONCOLON qualified_id + | '(' expression ')' + | id_expression + ; + +id_expression: + unqualified_id + | qualified_id + ; + +unqualified_id: + identifier + | operator_function_id + | conversion_function_id + | '~' class_name + | template_id + ; + +qualified_id: + nested_name_specifier TEMPLATE_opt unqualified_id + ; + +nested_name_specifier: + class_or_namespace_name COLONCOLON nested_name_specifier_opt + ; + +class_or_namespace_name: + class_name + | namespace_name + ; + +postfix_expression: + primary_expression + | postfix_expression '[' expression ']' + | postfix_expression '(' expression_list_opt ')' + | simple_type_specifier '(' expression_list_opt ')' + | postfix_expression '.' TEMPLATE_opt COLONCOLON_opt id_expression + | postfix_expression ARROW TEMPLATE_opt COLONCOLON_opt id_expression + | postfix_expression '.' pseudo_destructor_name + | postfix_expression ARROW pseudo_destructor_name + | postfix_expression PLUSPLUS + | postfix_expression MINUSMINUS + | DYNAMIC_CAST '<' type_id '>' '(' expression ')' + | STATIC_CAST '<' type_id '>' '(' expression ')' + | REINTERPRET_CAST '<' type_id '>' '(' expression ')' + | CONST_CAST '<' type_id '>' '(' expression ')' + | TYPEID '(' expression ')' + | TYPEID '(' type_id ')' + ; + +expression_list: + assignment_expression + | expression_list ',' assignment_expression + ; + +pseudo_destructor_name: + COLONCOLON_opt nested_name_specifier_opt type_name COLONCOLON '~' type_name + | COLONCOLON_opt nested_name_specifier_opt '~' type_name + ; + +unary_expression: + postfix_expression + | PLUSPLUS cast_expression + | MINUSMINUS cast_expression + | unary_operator cast_expression + | SIZEOF unary_expression + | SIZEOF '(' type_id ')' + | new_expression + | delete_expression + ; + +unary_operator: + '*' + | '&' + | '+' + | '-' + | '!' + | '~' + ; + +new_expression: + COLONCOLON_opt NEW new_placement_opt new_type_id new_initializer_opt + | COLONCOLON_opt NEW new_placement_opt '(' type_id ')' new_initializer_opt + ; + +new_placement: + '(' expression_list ')' + ; + +new_type_id: + type_specifier_seq new_declarator_opt + ; + +new_declarator: + ptr_operator new_declarator_opt + | direct_new_declarator + ; + +direct_new_declarator: + '[' expression ']' + | direct_new_declarator '[' constant_expression ']' + ; + +new_initializer: + '(' expression_list_opt ')' + ; + +delete_expression: + COLONCOLON_opt DELETE cast_expression + | COLONCOLON_opt DELETE '[' ']' cast_expression + ; + +cast_expression: + unary_expression + | '(' type_id ')' cast_expression + ; + +pm_expression: + cast_expression + | pm_expression DOTSTAR cast_expression + | pm_expression ARROWSTAR cast_expression + ; + +multiplicative_expression: + pm_expression + | multiplicative_expression '*' pm_expression + | multiplicative_expression '/' pm_expression + | multiplicative_expression '%' pm_expression + ; + +additive_expression: + multiplicative_expression + | additive_expression '+' multiplicative_expression + | additive_expression '-' multiplicative_expression + ; + +shift_expression: + additive_expression + | shift_expression SL additive_expression + | shift_expression SR additive_expression + ; + +relational_expression: + shift_expression + | relational_expression '<' shift_expression + | relational_expression '>' shift_expression + | relational_expression LTEQ shift_expression + | relational_expression GTEQ shift_expression + ; + +equality_expression: + relational_expression + | equality_expression EQ relational_expression + | equality_expression NOTEQ relational_expression + ; + +and_expression: + equality_expression + | and_expression '&' equality_expression + ; + +exclusive_or_expression: + and_expression + | exclusive_or_expression '^' and_expression + ; + +inclusive_or_expression: + exclusive_or_expression + | inclusive_or_expression '|' exclusive_or_expression + ; + +logical_and_expression: + inclusive_or_expression + | logical_and_expression ANDAND inclusive_or_expression + ; + +logical_or_expression: + logical_and_expression + | logical_or_expression OROR logical_and_expression + ; + +conditional_expression: + logical_or_expression + | logical_or_expression '?' expression ':' assignment_expression + ; + +assignment_expression: + conditional_expression + | logical_or_expression assignment_operator assignment_expression + | throw_expression + ; + +assignment_operator: + '=' + | MULEQ + | DIVEQ + | MODEQ + | ADDEQ + | SUBEQ + | SREQ + | SLEQ + | ANDEQ + | XOREQ + | OREQ + ; + +expression: + assignment_expression + | expression ',' assignment_expression + ; + +constant_expression: + conditional_expression + ; + +/*---------------------------------------------------------------------- + * Statements. + *----------------------------------------------------------------------*/ + +statement: + labeled_statement + | expression_statement + | compound_statement + | selection_statement + | iteration_statement + | jump_statement + | declaration_statement + | try_block + ; + +labeled_statement: + identifier ':' statement + | CASE constant_expression ':' statement + | DEFAULT ':' statement + ; + +expression_statement: + expression_opt ';' + ; + +compound_statement: + '{' statement_seq_opt '}' + ; + +statement_seq: + statement + | statement_seq statement + ; + +selection_statement: + IF '(' condition ')' statement + | IF '(' condition ')' statement ELSE statement + | SWITCH '(' condition ')' statement + ; + +condition: + expression + | type_specifier_seq declarator '=' assignment_expression + ; + +iteration_statement: + WHILE '(' condition ')' statement + | DO statement WHILE '(' expression ')' ';' + | FOR '(' for_init_statement condition_opt ';' expression_opt ')' statement + ; + +for_init_statement: + expression_statement + | simple_declaration + ; + +jump_statement: + BREAK ';' + | CONTINUE ';' + | RETURN expression_opt ';' + | GOTO identifier ';' + ; + +declaration_statement: + block_declaration + ; + +/*---------------------------------------------------------------------- + * Declarations. + *----------------------------------------------------------------------*/ + +declaration_seq: + declaration + | declaration_seq declaration + ; + +declaration: + block_declaration + | function_definition + | template_declaration + | explicit_instantiation + | explicit_specialization + | linkage_specification + | namespace_definition + ; + +block_declaration: + simple_declaration + | asm_definition + | namespace_alias_definition + | using_declaration + | using_directive + ; + +simple_declaration: + decl_specifier_seq_opt init_declarator_list_opt ';' { SIMPLE_DECLARATION($1,$2); } + ; + +decl_specifier: + storage_class_specifier + | type_specifier + | function_specifier + | FRIEND + | TYPEDEF + ; + +decl_specifier_seq: + decl_specifier_seq_opt decl_specifier { $$ = CONCAT($1,$2); } + ; + +storage_class_specifier: + AUTO + | REGISTER + | STATIC + | EXTERN + | MUTABLE + ; + +function_specifier: + INLINE + | VIRTUAL + | EXPLICIT + ; + +typedef_name: + identifier + ; + +type_specifier: + simple_type_specifier + | class_specifier + | enum_specifier + | elaborated_type_specifier + | cv_qualifier + ; + +simple_type_specifier: + COLONCOLON_opt /*nested_name_specifier_opt*/ type_name { $$ = CONCAT($1,$2); } /*<<<<< FIX DISAMBIGUATION <<<<<<*/ + | CHAR + | WCHAR_T + | BOOL + | SHORT + | INT + | LONG + | SIGNED + | UNSIGNED + | FLOAT + | DOUBLE + | VOID + ; + +type_name: + class_name + | enum_name + | typedef_name + ; + +elaborated_type_specifier: + class_key COLONCOLON_opt nested_name_specifier_opt identifier { $$ = CONCAT($1,$2,$3,$4); } + | ENUM COLONCOLON_opt nested_name_specifier_opt identifier { $$ = CONCAT($1,$2,$3,$4); } + | TYPENAME COLONCOLON_opt nested_name_specifier identifier { $$ = CONCAT($1,$2,$3,$4); } + | TYPENAME COLONCOLON_opt nested_name_specifier identifier '<' template_argument_list '>' { $$ = CONCAT($1,$2,$3,$4,"<",$6,">"); } + ; + +enum_name: + identifier + ; + +enum_specifier: + ENUM identifier_opt '{' enumerator_list_opt '}' { $$ = CONCAT($1,$2,"{",$4,"}"); } + ; + +enumerator_list: + enumerator_definition + | enumerator_list ',' enumerator_definition { $$ = CONCAT($1,",",$3); } + ; + +enumerator_definition: + enumerator + | enumerator '=' constant_expression { $$ = CONCAT($1,"=",$3); } + ; + +enumerator: + identifier + ; + +namespace_name: + original_namespace_name + | namespace_alias + ; + +original_namespace_name: + identifier + ; + +namespace_definition: + named_namespace_definition + | unnamed_namespace_definition + ; + +named_namespace_definition: + original_namespace_definition + | extension_namespace_definition + ; + +original_namespace_definition: + NAMESPACE identifier '{' namespace_body '}' + ; + +extension_namespace_definition: + NAMESPACE original_namespace_name '{' namespace_body '}' + ; + +unnamed_namespace_definition: + NAMESPACE '{' namespace_body '}' + ; + +namespace_body: + declaration_seq_opt + ; + +namespace_alias: + identifier + ; + +namespace_alias_definition: + NAMESPACE identifier '=' qualified_namespace_specifier ';' + ; + +qualified_namespace_specifier: + COLONCOLON_opt nested_name_specifier_opt namespace_name + ; + +using_declaration: + USING TYPENAME_opt COLONCOLON_opt nested_name_specifier unqualified_id ';' + | USING COLONCOLON unqualified_id ';' + ; + +using_directive: + USING NAMESPACE COLONCOLON_opt nested_name_specifier_opt namespace_name ';' + ; + +asm_definition: + ASM '(' string_literal ')' ';' + ; + +linkage_specification: + EXTERN string_literal '{' declaration_seq_opt '}' + | EXTERN string_literal declaration + ; + +/*---------------------------------------------------------------------- + * Declarators. + *----------------------------------------------------------------------*/ + +init_declarator_list: + init_declarator + | init_declarator_list ',' init_declarator { $$ = CONCAT($1,",",$3); } + ; + +init_declarator: + declarator initializer_opt { $$ = CONCAT($1,$2); } + ; + +declarator: + direct_declarator + | ptr_operator declarator { $$ = CONCAT($1,$2); } + ; + +direct_declarator: + declarator_id + | direct_declarator '('parameter_declaration_clause ')' cv_qualifier_seq_opt exception_specification_opt + | direct_declarator '[' constant_expression_opt ']' { $$ = CONCAT($1,"[",$3,"]"); } + | '(' declarator ')' { $$ = CONCAT("(",$2,")"); } + ; + +ptr_operator: + '*' cv_qualifier_seq_opt { $$ = CONCAT("*",$2); } + | '&' { $$ = strdup("&"); } + | COLONCOLON_opt nested_name_specifier '*' cv_qualifier_seq_opt { $$ = CONCAT($1,$2,"*",$4); } + ; + +cv_qualifier_seq: + cv_qualifier cv_qualifier_seq_opt + ; + +cv_qualifier: + CONST + | VOLATILE + ; + +declarator_id: + COLONCOLON_opt id_expression { $$ = CONCAT($1,$2); } + | COLONCOLON_opt nested_name_specifier_opt type_name { $$ = CONCAT($1,$2,$3); } + ; + +type_id: + type_specifier_seq abstract_declarator_opt /*{ $$ = CONCAT($1,$2); }*/ + ; + +type_specifier_seq: + type_specifier type_specifier_seq_opt { $$ = CONCAT($1,$2); } + ; + +abstract_declarator: + ptr_operator abstract_declarator_opt /*{ $$ = CONCAT($1,$2); }*/ + | direct_abstract_declarator + ; + +direct_abstract_declarator: + direct_abstract_declarator_opt '(' parameter_declaration_clause ')' cv_qualifier_seq_opt exception_specification_opt + | direct_abstract_declarator_opt '[' constant_expression_opt ']' + | '(' abstract_declarator ')' + ; + +parameter_declaration_clause: + parameter_declaration_list_opt ELLIPSIS_opt + | parameter_declaration_list ',' ELLIPSIS + ; + +parameter_declaration_list: + parameter_declaration + | parameter_declaration_list ',' parameter_declaration + ; + +parameter_declaration: + decl_specifier_seq declarator + | decl_specifier_seq declarator '=' assignment_expression + | decl_specifier_seq abstract_declarator_opt + | decl_specifier_seq abstract_declarator_opt '=' assignment_expression + ; + +function_definition: + decl_specifier_seq_opt declarator ctor_initializer_opt function_body + | decl_specifier_seq_opt declarator function_try_block + ; + +function_body: + compound_statement + ; + +initializer: + '=' initializer_clause { $$ = strdup($2); } + | '(' expression_list ')' + ; + +initializer_clause: + assignment_expression + | '{' initializer_list COMMA_opt '}' + | '{' '}' + ; + +initializer_list: + initializer_clause + | initializer_list ',' initializer_clause + ; + +/*---------------------------------------------------------------------- + * Classes. + *----------------------------------------------------------------------*/ + +class_name: + identifier + | template_id + ; + +class_specifier: + class_head '{' member_specification_opt '}' + ; + +class_head: + class_key identifier_opt base_clause_opt + | class_key nested_name_specifier identifier base_clause_opt + ; + +class_key: + CLASS + | STRUCT + | UNION + ; + +member_specification: + member_declaration member_specification_opt + | access_specifier ':' member_specification_opt + ; + +member_declaration: + decl_specifier_seq_opt member_declarator_list_opt ';' + | function_definition SEMICOLON_opt + | qualified_id ';' + | using_declaration + | template_declaration + ; + +member_declarator_list: + member_declarator + | member_declarator_list ',' member_declarator + ; + +member_declarator: + declarator pure_specifier_opt + | declarator constant_initializer_opt + | identifier_opt ':' constant_expression + ; + +pure_specifier: + '=' '0' + ; + +constant_initializer: + '=' constant_expression + ; + +/*---------------------------------------------------------------------- + * Derived classes. + *----------------------------------------------------------------------*/ + +base_clause: + ':' base_specifier_list + ; + +base_specifier_list: + base_specifier + | base_specifier_list ',' base_specifier + ; + +base_specifier: + COLONCOLON_opt nested_name_specifier_opt class_name + | VIRTUAL access_specifier_opt COLONCOLON_opt nested_name_specifier_opt class_name + | access_specifier VIRTUAL_opt COLONCOLON_opt nested_name_specifier_opt class_name + ; + +access_specifier: + PRIVATE + | PROTECTED + | PUBLIC + ; + +/*---------------------------------------------------------------------- + * Special member functions. + *----------------------------------------------------------------------*/ + +conversion_function_id: + OPERATOR conversion_type_id + ; + +conversion_type_id: + type_specifier_seq conversion_declarator_opt + ; + +conversion_declarator: + ptr_operator conversion_declarator_opt + ; + +ctor_initializer: + ':' mem_initializer_list + ; + +mem_initializer_list: + mem_initializer + | mem_initializer ',' mem_initializer_list + ; + +mem_initializer: + mem_initializer_id '(' expression_list_opt ')' + ; + +mem_initializer_id: + COLONCOLON_opt nested_name_specifier_opt class_name + | identifier + ; + +/*---------------------------------------------------------------------- + * Overloading. + *----------------------------------------------------------------------*/ + +operator_function_id: + OPERATOR operator + ; + +operator: + NEW + | DELETE + | NEW '[' ']' + | DELETE '[' ']' + | '+' + | '_' + | '*' + | '/' + | '%' + | '^' + | '&' + | '|' + | '~' + | '!' + | '=' + | '<' + | '>' + | ADDEQ + | SUBEQ + | MULEQ + | DIVEQ + | MODEQ + | XOREQ + | ANDEQ + | OREQ + | SL + | SR + | SREQ + | SLEQ + | EQ + | NOTEQ + | LTEQ + | GTEQ + | ANDAND + | OROR + | PLUSPLUS + | MINUSMINUS + | ',' + | ARROWSTAR + | ARROW + | '(' ')' + | '[' ']' + ; + +/*---------------------------------------------------------------------- + * Templates. + *----------------------------------------------------------------------*/ + +template_declaration: + EXPORT_opt TEMPLATE '<' template_parameter_list '>' declaration + ; + +template_parameter_list: + template_parameter + | template_parameter_list ',' template_parameter + ; + +template_parameter: + type_parameter + | parameter_declaration + ; + +type_parameter: + CLASS identifier_opt + | CLASS identifier_opt '=' type_id + | TYPENAME identifier_opt + | TYPENAME identifier_opt '=' type_id + | TEMPLATE '<' template_parameter_list '>' CLASS identifier_opt + | TEMPLATE '<' template_parameter_list '>' CLASS identifier_opt '=' template_name + ; + +template_id: + template_name '<' template_argument_list '>' + ; + +template_name: + identifier + ; + +template_argument_list: + template_argument + | template_argument_list ',' template_argument + ; + +template_argument: + assignment_expression + | type_id + | template_name + ; + +explicit_instantiation: + TEMPLATE declaration + ; + +explicit_specialization: + TEMPLATE '<' '>' declaration + ; + +/*---------------------------------------------------------------------- + * Exception handling. + *----------------------------------------------------------------------*/ + +try_block: + TRY compound_statement handler_seq + ; + +function_try_block: + TRY ctor_initializer_opt function_body handler_seq + ; + +handler_seq: + handler handler_seq_opt + ; + +handler: + CATCH '(' exception_declaration ')' compound_statement + ; + +exception_declaration: + type_specifier_seq declarator + | type_specifier_seq abstract_declarator + | type_specifier_seq + | ELLIPSIS + ; + +throw_expression: + THROW assignment_expression_opt + ; + +exception_specification: + THROW '(' type_id_list_opt ')' + ; + +type_id_list: + type_id + | type_id_list ',' type_id + ; + +/*---------------------------------------------------------------------- + * Epsilon (optional) definitions. + *----------------------------------------------------------------------*/ + +declaration_seq_opt: + { $$ = EMPTY; } + | declaration_seq + ; + +TEMPLATE_opt: + { $$ = EMPTY; } + | TEMPLATE + ; + +nested_name_specifier_opt: + { $$ = EMPTY; } + | nested_name_specifier + ; + +expression_list_opt: + { $$ = EMPTY; } + | expression_list + ; + +COLONCOLON_opt: + { $$ = EMPTY; } + | COLONCOLON { $$ = strdup("::"); } + ; + +new_placement_opt: + { $$ = EMPTY; } + | new_placement + ; + +new_initializer_opt: + { $$ = EMPTY; } + | new_initializer + ; + +new_declarator_opt: + { $$ = EMPTY; } + | new_declarator + ; + +expression_opt: + { $$ = EMPTY; } + | expression + ; + +statement_seq_opt: + { $$ = EMPTY; } + | statement_seq + ; + +condition_opt: + { $$ = EMPTY; } + | condition + ; + +decl_specifier_seq_opt: + { $$ = EMPTY; } + | decl_specifier_seq + ; + +init_declarator_list_opt: + { $$ = EMPTY; } + | init_declarator_list + ; + +identifier_opt: + { $$ = EMPTY; } + | identifier + ; + +enumerator_list_opt: + { $$ = EMPTY; } + | enumerator_list + ; + +TYPENAME_opt: + { $$ = EMPTY; } + | TYPENAME + ; + +initializer_opt: + { $$ = EMPTY; } + | initializer + ; + +cv_qualifier_seq_opt: + { $$ = EMPTY; } + | cv_qualifier_seq + ; + +exception_specification_opt: + { $$ = EMPTY; } + | exception_specification + ; + +constant_expression_opt: + { $$ = EMPTY; } + | constant_expression + ; + +abstract_declarator_opt: + { $$ = EMPTY; } + | abstract_declarator + ; + +type_specifier_seq_opt: + { $$ = EMPTY; } + | type_specifier_seq + ; + +direct_abstract_declarator_opt: + { $$ = EMPTY; } + | direct_abstract_declarator + ; + +parameter_declaration_list_opt: + { $$ = EMPTY; } + | parameter_declaration_list + ; + +ELLIPSIS_opt: + { $$ = EMPTY; } + | ELLIPSIS + ; + +ctor_initializer_opt: + { $$ = EMPTY; } + | ctor_initializer + ; + +COMMA_opt: + { $$ = EMPTY; } + | ',' + ; + +member_specification_opt: + { $$ = EMPTY; } + | member_specification + ; + +base_clause_opt: + { $$ = EMPTY; } + | base_clause + ; + +member_declarator_list_opt: + { $$ = EMPTY; } + | member_declarator_list + ; + +SEMICOLON_opt: + { $$ = EMPTY; } + | ';' + ; + +pure_specifier_opt: + { $$ = EMPTY; } + | pure_specifier + ; + +constant_initializer_opt: + { $$ = EMPTY; } + | constant_initializer + ; + +access_specifier_opt: + { $$ = EMPTY; } + | access_specifier + ; + +VIRTUAL_opt: + { $$ = EMPTY; } + | VIRTUAL + ; + +conversion_declarator_opt: + { $$ = EMPTY; } + | conversion_declarator + ; + +EXPORT_opt: + { $$ = EMPTY; } + | EXPORT + ; + +handler_seq_opt: + { $$ = EMPTY; } + | handler_seq + ; + +assignment_expression_opt: + { $$ = EMPTY; } + | assignment_expression + ; + +type_id_list_opt: + { $$ = EMPTY; } + | type_id_list + ; + + +%% + +int yyerror(char *s) { + printf("error, %s\n", s); + return 1; +} + +void yyprint (FILE *file, + int type, + YYSTYPE value) +{ + if (type == IDENTIFIER) + fprintf (file, "%s", value.sval); + if (type == COLONCOLON) + fprintf (file, "%s", value.sval); + +} + +int main(void) { +/* yydebug = 1;*/ + yyparse(); +} diff --git a/src/utils/moc/sample.cpp b/src/utils/moc/sample.cpp new file mode 100644 index 0000000..8f8f2ff --- /dev/null +++ b/src/utils/moc/sample.cpp @@ -0,0 +1,51 @@ +/*////////////////////////////////////////////////////////////////////////////// +// CMT Cosmic Muon Tomography project ////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + + Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova + All rights reserved + + Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > + + ------------------------------------------------------------------ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + +//////////////////////////////////////////////////////////////////////////////*/ + + + + +typedef int TestInt; + +class DerivedObject { + + +public: + + ULIB_OBJECT_PARAMETERS(test) + { + Bubu *a; + }; + +}; + +int main() { + + ULIB_OBJECT_PARAMETERS(prova) { + int a,b; + char *c; + }; + + return 0; +} diff --git a/src/utils/moc/scan.l b/src/utils/moc/scan.l new file mode 100644 index 0000000..b5ff2d7 --- /dev/null +++ b/src/utils/moc/scan.l @@ -0,0 +1,252 @@ +%option stack +%{ +/* preamble */ +#include +#include +#include "y.tab.h" + +#define PRINT(str) { printf("%s",str); } +#define ENSTATE(st) { yy_push_state(YY_START); BEGIN(st); /*printf("ST[%i]",YY_START);*/ } +#define EXSTATE { BEGIN(yy_top_state()); yy_pop_state(); /*printf("ST[%i]",YY_START);*/ } + +#define SCANTEXT { fill_sval(); } +#define MATCH(name) { ECHO; SCANTEXT; return name; } + +int lineno; +int moc_level = 0; + +static int yywrap(void); +static void skip_until_eol(void); +static void skip_comment(void); +static int check_identifier(const char *); +static int fill_sval(); +%} + +blank [\t\f\v\r ]+ +anyunch <*>. + +intsuffix ([uU][lL]?)|([lL][uU]?) +fracconst ([0-9]*\.[0-9]+)|([0-9]+\.) +exppart [eE][-+]?[0-9]+ +floatsuffix [fFlL] +chartext ([^'])|(\\.) +stringtext ([^"])|(\\.) + +digit [0-9] +hex [0-9A-Fa-f] +letter [A-Z_a-z] +simple_escape_sequence (\\\'|\\\"|\\\?|\\\\|\\a|\\b|\\f|\\n|\\r|\\t|\\v) +octal_escape_sequence (\\[0-7]|\\[0-7][0-7]|\\[0-7][0-7][0-7]) +hexadecimal_escape_sequence (\\x{hex}+) +escape_sequence ({simple_escape_sequence}|{octal_escape_sequence}|{hexadecimal_escape_sequence}) +universal_character_name (\\u{hex}{hex}{hex}{hex}|\\U{hex}{hex}{hex}{hex}{hex}{hex}{hex}{hex}) +non_digit ({letter}|{universal_character_name}) +identifier ({non_digit}({non_digit}|{digit})*) + +begin_comment "/*" +end_comment "*/" +begin_inline_comment "//" +end_inline_comment "\n" + + +%s moc +%x cmt +%x inlcmt + +%% + +"\n" { ++lineno; ECHO; } +{blank} ECHO; + +{begin_comment} { ENSTATE(cmt); ECHO; } +{end_comment} { EXSTATE; ECHO; } + +{begin_inline_comment} { ENSTATE(inlcmt); ECHO; } +{end_inline_comment} { EXSTATE; ECHO; } + + +property { ECHO; ENSTATE(moc); return MOC_PROPERTY; } +ULIB_OBJECT_PARAMETERS { ECHO; ENSTATE(moc); return MOC_OBJECT_PARAMETERS; } +{ + "{" { moc_level++; MATCH('{'); } + "}" { if(!--moc_level)EXSTATE; MATCH('}'); } + + "<%" { MATCH('{'); } + "%>" { MATCH('}'); } + "[" { MATCH('['); } + "<:" { MATCH('['); } + "]" { MATCH(']'); } + ":>" { MATCH(']'); } + "(" { MATCH('('); } + ")" { MATCH(')'); } + ";" { MATCH(';'); } + "::" { MATCH(COLONCOLON); } + ":" { MATCH(':'); } + "..." { MATCH(ELLIPSIS); } + "?" { MATCH('?'); } + "." { MATCH('.'); } + ".*" { MATCH(DOTSTAR); } + "+" { MATCH('+'); } + "-" { MATCH('-'); } + "*" { MATCH('*'); } + "/" { MATCH('/'); } + "%" { MATCH('%'); } + "^" { MATCH('^'); } + "xor" { MATCH('^'); } + "&" { MATCH('&'); } + "bitand" { MATCH('&'); } + "|" { MATCH('|'); } + "bitor" { MATCH('|'); } + "~" { MATCH('~'); } + "compl" { MATCH('~'); } + "!" { MATCH('!'); } + "not" { MATCH('!'); } + "=" { MATCH('='); } + "<" { MATCH('<'); } + ">" { MATCH('>'); } + "+=" { MATCH(ADDEQ); } + "-=" { MATCH(SUBEQ); } + "*=" { MATCH(MULEQ); } + "/=" { MATCH(DIVEQ); } + "%=" { MATCH(MODEQ); } + "^=" { MATCH(XOREQ); } + "xor_eq" { MATCH(XOREQ); } + "&=" { MATCH(ANDEQ); } + "and_eq" { MATCH(ANDEQ); } + "|=" { MATCH(OREQ); } + "or_eq" { MATCH(OREQ); } + "<<" { MATCH(SL); } + ">>" { MATCH(SR); } + "<<=" { MATCH(SLEQ); } + ">>=" { MATCH(SREQ); } + "==" { MATCH(EQ); } + "!=" { MATCH(NOTEQ); } + "not_eq" { MATCH(NOTEQ); } + "<=" { MATCH(LTEQ); } + ">=" { MATCH(GTEQ); } + "&&" { MATCH(ANDAND); } + "and" { MATCH(ANDAND); } + "||" { MATCH(OROR); } + "or" { MATCH(OROR); } + "++" { MATCH(PLUSPLUS); } + "--" { MATCH(MINUSMINUS); } + "," { MATCH(','); } + "->*" { MATCH(ARROWSTAR); } + "->" { MATCH(ARROW); } + + "asm" { MATCH(ASM); } + "auto" { MATCH(AUTO); } + "bool" { MATCH(BOOL); } + "break" { MATCH(BREAK); } + "case" { MATCH(CASE); } + "catch" { MATCH(CATCH); } + "char" { MATCH(CHAR); } + "class" { MATCH(CLASS); } + "const" { MATCH(CONST); } + "const_cast" { MATCH(CONST_CAST); } + "continue" { MATCH(CONTINUE); } + "default" { MATCH(DEFAULT); } + "delete" { MATCH(DELETE); } + "do" { MATCH(DO); } + "double" { MATCH(DOUBLE); } + "dynamic_cast" { MATCH(DYNAMIC_CAST); } + "else" { MATCH(ELSE); } + "enum" { MATCH(ENUM); } + "explicit" { MATCH(EXPLICIT); } + "export" { MATCH(EXPORT); } + "extern" { MATCH(EXTERN); } + "false" { MATCH(FALSE); } + "float" { MATCH(FLOAT); } + "for" { MATCH(FOR); } + "friend" { MATCH(FRIEND); } + "goto" { MATCH(GOTO); } + "if" { MATCH(IF); } + "inline" { MATCH(INLINE); } + "int" { MATCH(INT); } + "long" { MATCH(LONG); } + "mutable" { MATCH(MUTABLE); } + "namespace" { MATCH(NAMESPACE); } + "new" { MATCH(NEW); } + "operator" { MATCH(OPERATOR); } + "private" { MATCH(PRIVATE); } + "protected" { MATCH(PROTECTED); } + "public" { MATCH(PUBLIC); } + "register" { MATCH(REGISTER); } + "reinterpret_cast" { MATCH(REINTERPRET_CAST); } + "return" { MATCH(RETURN); } + "short" { MATCH(SHORT); } + "signed" { MATCH(SIGNED); } + "sizeof" { MATCH(SIZEOF); } + "static" { MATCH(STATIC); } + "static_cast" { MATCH(STATIC_CAST); } + "struct" { MATCH(STRUCT); } + "switch" { MATCH(SWITCH); } + "template" { MATCH(TEMPLATE); } + "this" { MATCH(THIS); } + "throw" { MATCH(THROW); } + "true" { MATCH(TRUE); } + "try" { MATCH(TRY); } + "typedef" { MATCH(TYPEDEF); } + "typeid" { MATCH(TYPEID); } + "typename" { MATCH(TYPENAME); } + "union" { MATCH(UNION); } + "unsigned" { MATCH(UNSIGNED); } + "using" { MATCH(USING); } + "virtual" { MATCH(VIRTUAL); } + "void" { MATCH(VOID); } + "volatile" { MATCH(VOLATILE); } + "wchar_t" { MATCH(WCHAR_T); } + "while" { MATCH(WHILE); } + [a-zA-Z_][a-zA-Z_0-9]* { ECHO; return check_identifier(yytext); } + + "0"[xX][0-9a-fA-F]+{intsuffix}? { ECHO; return INTEGER; } + "0"[0-7]+{intsuffix}? { ECHO; return INTEGER; } + [0-9]+{intsuffix}? { ECHO; return INTEGER; } + + {fracconst}{exppart}?{floatsuffix}? { ECHO; return FLOATING; } + [0-9]+{exppart}{floatsuffix}? { ECHO; return FLOATING; } + + "'"{chartext}*"'" { ECHO; return CHARACTER; } + "L'"{chartext}*"'" { ECHO; return CHARACTER; } + "\""{stringtext}*"\"" { ECHO; return STRING; } + "L\""{stringtext}*"\"" { ECHO; return STRING; } + +} + +%% + +static int yywrap(void) +{ + return 1; +} + + +static int fill_sval() { + int len = strlen(yytext); + if(len) { + yylval.sval = malloc(len); + strncpy(yylval.sval, yytext, len); + } + else { + yylval.sval = strdup(""); + } + return len; +} + +static int check_identifier(const char *s) +{ +/* + switch (s[0]) { + case 'D': return TYPEDEF_NAME; + case 'N': return NAMESPACE_NAME; + case 'C': return CLASS_NAME; + case 'E': return ENUM_NAME; + case 'T': return TEMPLATE_NAME; + } +*/ + + yylval.sval = malloc(strlen(yytext)); + strncpy(yylval.sval, yytext, strlen(yytext)); + return IDENTIFIER; +} + diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..9969c96 --- /dev/null +++ b/test.cpp @@ -0,0 +1,10 @@ + +#include "Core/Object.h" + + + +int main() +{ + uLib::Object obj; + return 0; +} diff --git a/tmp/BuildTruck/BuildTruck.cpp b/tmp/BuildTruck/BuildTruck.cpp new file mode 100644 index 0000000..a952034 --- /dev/null +++ b/tmp/BuildTruck/BuildTruck.cpp @@ -0,0 +1,154 @@ + +#include + +#include +#include + +#include +#include +#include + +#include +//#include +//#include + + + +#include "Math/TriangleMesh.h" +#include "Vtk/vtkTriangleMesh.h" + +#include "Detectors/Solid.h" + +using namespace uLib; + + + +namespace Material { + +G4Material *StainlessSteel(float dens = 8.06) { // <- g/cm3 + G4NistManager* man = G4NistManager::Instance(); + man->SetVerbose(1); + + // Define elements from NIST + G4Element* C = man->FindOrBuildElement("C"); + G4Element* Si = man->FindOrBuildElement("Si"); + G4Element* Cr = man->FindOrBuildElement("Cr"); + G4Element* Mn = man->FindOrBuildElement("Mn"); + G4Element* Fe = man->FindOrBuildElement("Fe"); + G4Element* Ni = man->FindOrBuildElement("Ni"); + + + // Define materials not in NIST + G4double density = dens*g/cm3; + G4int ncomponents; + G4double fractionmass; + G4Material* StainlessSteel = new G4Material("StainlessSteel", density, ncomponents=6); + StainlessSteel->AddElement(C, fractionmass=0.001); + StainlessSteel->AddElement(Si, fractionmass=0.007); + StainlessSteel->AddElement(Cr, fractionmass=0.18); + StainlessSteel->AddElement(Mn, fractionmass=0.01); + StainlessSteel->AddElement(Fe, fractionmass=0.712); + StainlessSteel->AddElement(Ni, fractionmass=0.09); + return StainlessSteel; +} + +//G4Material *ASTM_A710(float dens = 7.85) { // <- g/cm3 +// G4NistManager* man = G4NistManager::Instance(); +// man->SetVerbose(1); + +// // Define elements from NIST +// G4Element* C = man->FindOrBuildElement("C"); +// G4Element* Cr = man->FindOrBuildElement("Cr"); +// G4Element* Cu = man->FindOrBuildElement("Cu"); +// G4Element* Fe = man->FindOrBuildElement("Fe"); +// G4Element* Mn = man->FindOrBuildElement("Mn"); +// G4Element* Mo = man->FindOrBuildElement("Mo"); +// G4Element* Ni = man->FindOrBuildElement("Ni"); +// G4Element* Nb = man->FindOrBuildElement("Nb"); +// G4Element* P = man->FindOrBuildElement("P"); +// G4Element* Si = man->FindOrBuildElement("Si"); +// G4Element* S = man->FindOrBuildElement("S"); + + +// // Define materials not in NIST +// G4double density = dens*g/cm3; +// G4int ncomponents; +// G4double fractionmass; +// G4Material* StainlessSteel = new G4Material("StainlessSteel", density, ncomponents=6); +// StainlessSteel->AddElement(C, fractionmass=0.0007); +// StainlessSteel->AddElement(Cr, fractionmass=0.18); +// StainlessSteel->AddElement(Cr, fractionmass=0.18); +// StainlessSteel->AddElement(Cr, fractionmass=0.18); +// StainlessSteel->AddElement(Si, fractionmass=0.007); +// StainlessSteel->AddElement(Mn, fractionmass=0.01); +// StainlessSteel->AddElement(Fe, fractionmass=0.712); +// StainlessSteel->AddElement(Ni, fractionmass=0.09); +// return StainlessSteel; +//} + + +G4Material *Tungsten(float dens = 19.25) { // <- g/cm3 + G4NistManager* man = G4NistManager::Instance(); + man->SetVerbose(1); + + G4Element* Wf = man->FindOrBuildElement("W"); + + G4double density = dens*g/cm3; + G4int ncomponents; + G4double fractionmass; + G4Material* Tungsten = new G4Material("Tungsten", density, ncomponents=1); + Tungsten->AddElement(Wf, fractionmass=1); + return Tungsten; +} + + +} + + + +#include + +int main() +{ + + G4GDMLParser parser; + G4Material *steel = Material::StainlessSteel(); + + // Acciaio1 // + { + TriangleMesh mesh; + vtkTriangleMesh v_mesh(mesh); + v_mesh.ReadFromObjFile("objects/ByMaterial/Acciaio1.obj"); + mesh.PrintSelf(std::cout); + TessellatedSolid solid("telaio1"); + solid.SetMaterial(steel); + solid.SetMesh(mesh); + parser.Write("telaio1.gdml",solid.GetLogical()); + } + + // Acciaio2 // + { + TriangleMesh mesh; + vtkTriangleMesh v_mesh(mesh); + v_mesh.ReadFromObjFile("objects/ByMaterial/Acciaio2.obj"); + mesh.PrintSelf(std::cout); + TessellatedSolid solid("telaio2"); + solid.SetMaterial(steel); + solid.SetMesh(mesh); + parser.Write("telaio2.gdml",solid.GetLogical()); + } + + // Assali // + { + TriangleMesh mesh; + vtkTriangleMesh v_mesh(mesh); + v_mesh.ReadFromObjFile("objects/ByMaterial/Assali.obj"); + mesh.PrintSelf(std::cout); + TessellatedSolid solid("assali"); + solid.SetMaterial(steel); + solid.SetMesh(mesh); + parser.Write("assali.gdml",solid.GetLogical()); + } + + +} diff --git a/tmp/BuildTruck/Makefile.am b/tmp/BuildTruck/Makefile.am new file mode 100644 index 0000000..459d8c0 --- /dev/null +++ b/tmp/BuildTruck/Makefile.am @@ -0,0 +1,11 @@ + +include $(top_srcdir)/Common.am +include $(top_srcdir)/src/Vtk/Vtk.am + +#AM_DEFAULT_SOURCE_EXT = .cpp + + +LDADD = $(top_srcdir)/libmutom-0.1.la $(AM_LIBS_ALL) + +bin_PROGRAMS = BuildTruck + diff --git a/tmp/BuildTruck/objects/acciaio1.stl b/tmp/BuildTruck/objects/acciaio1.stl new file mode 100644 index 0000000..ee1624c Binary files /dev/null and b/tmp/BuildTruck/objects/acciaio1.stl differ diff --git a/tmp/BuildTruck/objects/acciaio2.stl b/tmp/BuildTruck/objects/acciaio2.stl new file mode 100644 index 0000000..3347120 Binary files /dev/null and b/tmp/BuildTruck/objects/acciaio2.stl differ diff --git a/tmp/BuildTruck/objects/carrozzeria.stl b/tmp/BuildTruck/objects/carrozzeria.stl new file mode 100644 index 0000000..adac38c Binary files /dev/null and b/tmp/BuildTruck/objects/carrozzeria.stl differ diff --git a/tmp/BuildTruck/objects/container.stl b/tmp/BuildTruck/objects/container.stl new file mode 100644 index 0000000..5039107 Binary files /dev/null and b/tmp/BuildTruck/objects/container.stl differ diff --git a/tmp/BuildTruck/objects/fusto.stl b/tmp/BuildTruck/objects/fusto.stl new file mode 100644 index 0000000..5ae853c Binary files /dev/null and b/tmp/BuildTruck/objects/fusto.stl differ diff --git a/tmp/BuildTruck/objects/gomma.stl b/tmp/BuildTruck/objects/gomma.stl new file mode 100644 index 0000000..19c12fb Binary files /dev/null and b/tmp/BuildTruck/objects/gomma.stl differ diff --git a/tmp/BuildTruck/objects/maniglieria.stl b/tmp/BuildTruck/objects/maniglieria.stl new file mode 100644 index 0000000..3c8306c Binary files /dev/null and b/tmp/BuildTruck/objects/maniglieria.stl differ diff --git a/tmp/BuildTruck/objects/telaio.stl b/tmp/BuildTruck/objects/telaio.stl new file mode 100644 index 0000000..f7ff50f Binary files /dev/null and b/tmp/BuildTruck/objects/telaio.stl differ diff --git a/tmp/BuildTruck/objects/truck.blend b/tmp/BuildTruck/objects/truck.blend new file mode 100644 index 0000000..c495759 Binary files /dev/null and b/tmp/BuildTruck/objects/truck.blend differ diff --git a/tmp/BuildTruck/objects/truck.blend1 b/tmp/BuildTruck/objects/truck.blend1 new file mode 100644 index 0000000..f91889c Binary files /dev/null and b/tmp/BuildTruck/objects/truck.blend1 differ diff --git a/tmp/BuildTruck/objects/truck.blend2 b/tmp/BuildTruck/objects/truck.blend2 new file mode 100644 index 0000000..26486d1 Binary files /dev/null and b/tmp/BuildTruck/objects/truck.blend2 differ diff --git a/tmp/BuildTruck/objects/truck1.blend b/tmp/BuildTruck/objects/truck1.blend new file mode 100644 index 0000000..56227b6 Binary files /dev/null and b/tmp/BuildTruck/objects/truck1.blend differ diff --git a/tmp/BuildTruck/objects/truck1.blend1 b/tmp/BuildTruck/objects/truck1.blend1 new file mode 100644 index 0000000..ce63076 Binary files /dev/null and b/tmp/BuildTruck/objects/truck1.blend1 differ diff --git a/tmp/BuildTruck/objects/truck1r.blend b/tmp/BuildTruck/objects/truck1r.blend new file mode 100644 index 0000000..36fde98 Binary files /dev/null and b/tmp/BuildTruck/objects/truck1r.blend differ diff --git a/tmp/BuildTruck/objects/vetro.stl b/tmp/BuildTruck/objects/vetro.stl new file mode 100644 index 0000000..b83dfc8 Binary files /dev/null and b/tmp/BuildTruck/objects/vetro.stl differ diff --git a/tmp/CodeLoop/.deps/main.Po b/tmp/CodeLoop/.deps/main.Po new file mode 100644 index 0000000..16e6837 --- /dev/null +++ b/tmp/CodeLoop/.deps/main.Po @@ -0,0 +1,253 @@ +main.o: main.cpp /usr/include/c++/4.7/iostream \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h \ + /usr/include/c++/4.7/ostream /usr/include/c++/4.7/ios \ + /usr/include/c++/4.7/iosfwd /usr/include/c++/4.7/bits/stringfwd.h \ + /usr/include/c++/4.7/bits/postypes.h /usr/include/c++/4.7/cwchar \ + /usr/include/wchar.h /usr/include/stdio.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ + /usr/include/xlocale.h /usr/include/c++/4.7/exception \ + /usr/include/c++/4.7/bits/atomic_lockfree_defines.h \ + /usr/include/c++/4.7/bits/char_traits.h \ + /usr/include/c++/4.7/bits/stl_algobase.h \ + /usr/include/c++/4.7/bits/functexcept.h \ + /usr/include/c++/4.7/bits/exception_defines.h \ + /usr/include/c++/4.7/bits/cpp_type_traits.h \ + /usr/include/c++/4.7/ext/type_traits.h \ + /usr/include/c++/4.7/ext/numeric_traits.h \ + /usr/include/c++/4.7/bits/stl_pair.h /usr/include/c++/4.7/bits/move.h \ + /usr/include/c++/4.7/bits/concept_check.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_types.h \ + /usr/include/c++/4.7/bits/stl_iterator_base_funcs.h \ + /usr/include/c++/4.7/bits/stl_iterator.h \ + /usr/include/c++/4.7/debug/debug.h /usr/include/c++/4.7/bits/localefwd.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h \ + /usr/include/c++/4.7/clocale /usr/include/locale.h \ + /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/4.7/cctype \ + /usr/include/ctype.h /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/c++/4.7/bits/ios_base.h \ + /usr/include/c++/4.7/ext/atomicity.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h \ + /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/sched.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/setjmp.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h \ + /usr/include/c++/4.7/bits/locale_classes.h /usr/include/c++/4.7/string \ + /usr/include/c++/4.7/bits/allocator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h \ + /usr/include/c++/4.7/ext/new_allocator.h /usr/include/c++/4.7/new \ + /usr/include/c++/4.7/bits/ostream_insert.h \ + /usr/include/c++/4.7/bits/cxxabi_forced.h \ + /usr/include/c++/4.7/bits/stl_function.h \ + /usr/include/c++/4.7/backward/binders.h \ + /usr/include/c++/4.7/bits/range_access.h \ + /usr/include/c++/4.7/bits/basic_string.h \ + /usr/include/c++/4.7/bits/basic_string.tcc \ + /usr/include/c++/4.7/bits/locale_classes.tcc \ + /usr/include/c++/4.7/streambuf /usr/include/c++/4.7/bits/streambuf.tcc \ + /usr/include/c++/4.7/bits/basic_ios.h \ + /usr/include/c++/4.7/bits/locale_facets.h /usr/include/c++/4.7/cwctype \ + /usr/include/wctype.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h \ + /usr/include/c++/4.7/bits/streambuf_iterator.h \ + /usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h \ + /usr/include/c++/4.7/bits/locale_facets.tcc \ + /usr/include/c++/4.7/bits/basic_ios.tcc \ + /usr/include/c++/4.7/bits/ostream.tcc /usr/include/c++/4.7/istream \ + /usr/include/c++/4.7/bits/istream.tcc ManageFilename.h + +/usr/include/c++/4.7/iostream: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/os_defines.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/bits/predefs.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/cpu_defines.h: + +/usr/include/c++/4.7/ostream: + +/usr/include/c++/4.7/ios: + +/usr/include/c++/4.7/iosfwd: + +/usr/include/c++/4.7/bits/stringfwd.h: + +/usr/include/c++/4.7/bits/postypes.h: + +/usr/include/c++/4.7/cwchar: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/c++/4.7/exception: + +/usr/include/c++/4.7/bits/atomic_lockfree_defines.h: + +/usr/include/c++/4.7/bits/char_traits.h: + +/usr/include/c++/4.7/bits/stl_algobase.h: + +/usr/include/c++/4.7/bits/functexcept.h: + +/usr/include/c++/4.7/bits/exception_defines.h: + +/usr/include/c++/4.7/bits/cpp_type_traits.h: + +/usr/include/c++/4.7/ext/type_traits.h: + +/usr/include/c++/4.7/ext/numeric_traits.h: + +/usr/include/c++/4.7/bits/stl_pair.h: + +/usr/include/c++/4.7/bits/move.h: + +/usr/include/c++/4.7/bits/concept_check.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_types.h: + +/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h: + +/usr/include/c++/4.7/bits/stl_iterator.h: + +/usr/include/c++/4.7/debug/debug.h: + +/usr/include/c++/4.7/bits/localefwd.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++locale.h: + +/usr/include/c++/4.7/clocale: + +/usr/include/locale.h: + +/usr/include/x86_64-linux-gnu/bits/locale.h: + +/usr/include/c++/4.7/cctype: + +/usr/include/ctype.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/c++/4.7/bits/ios_base.h: + +/usr/include/c++/4.7/ext/atomicity.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h: + +/usr/include/pthread.h: + +/usr/include/sched.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/bits/sched.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/x86_64-linux-gnu/bits/setjmp.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/atomic_word.h: + +/usr/include/c++/4.7/bits/locale_classes.h: + +/usr/include/c++/4.7/string: + +/usr/include/c++/4.7/bits/allocator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++allocator.h: + +/usr/include/c++/4.7/ext/new_allocator.h: + +/usr/include/c++/4.7/new: + +/usr/include/c++/4.7/bits/ostream_insert.h: + +/usr/include/c++/4.7/bits/cxxabi_forced.h: + +/usr/include/c++/4.7/bits/stl_function.h: + +/usr/include/c++/4.7/backward/binders.h: + +/usr/include/c++/4.7/bits/range_access.h: + +/usr/include/c++/4.7/bits/basic_string.h: + +/usr/include/c++/4.7/bits/basic_string.tcc: + +/usr/include/c++/4.7/bits/locale_classes.tcc: + +/usr/include/c++/4.7/streambuf: + +/usr/include/c++/4.7/bits/streambuf.tcc: + +/usr/include/c++/4.7/bits/basic_ios.h: + +/usr/include/c++/4.7/bits/locale_facets.h: + +/usr/include/c++/4.7/cwctype: + +/usr/include/wctype.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_base.h: + +/usr/include/c++/4.7/bits/streambuf_iterator.h: + +/usr/include/c++/4.7/x86_64-linux-gnu/bits/ctype_inline.h: + +/usr/include/c++/4.7/bits/locale_facets.tcc: + +/usr/include/c++/4.7/bits/basic_ios.tcc: + +/usr/include/c++/4.7/bits/ostream.tcc: + +/usr/include/c++/4.7/istream: + +/usr/include/c++/4.7/bits/istream.tcc: + +ManageFilename.h: diff --git a/tmp/CodeLoop/AUTHORS b/tmp/CodeLoop/AUTHORS new file mode 100644 index 0000000..eb0b739 --- /dev/null +++ b/tmp/CodeLoop/AUTHORS @@ -0,0 +1 @@ +Andrea Rigoni \ No newline at end of file diff --git a/tmp/CodeLoop/CMake/FindEigen3.cmake b/tmp/CodeLoop/CMake/FindEigen3.cmake new file mode 100644 index 0000000..9c546a0 --- /dev/null +++ b/tmp/CodeLoop/CMake/FindEigen3.cmake @@ -0,0 +1,81 @@ +# - Try to find Eigen3 lib +# +# This module supports requiring a minimum version, e.g. you can do +# find_package(Eigen3 3.1.2) +# to require version 3.1.2 or newer of Eigen3. +# +# Once done this will define +# +# EIGEN3_FOUND - system has eigen lib with correct version +# EIGEN3_INCLUDE_DIR - the eigen include directory +# EIGEN3_VERSION - eigen version + +# Copyright (c) 2006, 2007 Montel Laurent, +# Copyright (c) 2008, 2009 Gael Guennebaud, +# Copyright (c) 2009 Benoit Jacob +# Redistribution and use is allowed according to the terms of the 2-clause BSD license. + +if(NOT Eigen3_FIND_VERSION) + if(NOT Eigen3_FIND_VERSION_MAJOR) + set(Eigen3_FIND_VERSION_MAJOR 2) + endif(NOT Eigen3_FIND_VERSION_MAJOR) + if(NOT Eigen3_FIND_VERSION_MINOR) + set(Eigen3_FIND_VERSION_MINOR 91) + endif(NOT Eigen3_FIND_VERSION_MINOR) + if(NOT Eigen3_FIND_VERSION_PATCH) + set(Eigen3_FIND_VERSION_PATCH 0) + endif(NOT Eigen3_FIND_VERSION_PATCH) + + set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") +endif(NOT Eigen3_FIND_VERSION) + +macro(_eigen3_check_version) + file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) + + string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}") + set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}") + set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}") + set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}") + + set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}) + if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + set(EIGEN3_VERSION_OK FALSE) + else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + set(EIGEN3_VERSION_OK TRUE) + endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + + if(NOT EIGEN3_VERSION_OK) + + message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, " + "but at least version ${Eigen3_FIND_VERSION} is required") + endif(NOT EIGEN3_VERSION_OK) +endmacro(_eigen3_check_version) + +if (EIGEN3_INCLUDE_DIR) + + # in cache already + _eigen3_check_version() + set(EIGEN3_FOUND ${EIGEN3_VERSION_OK}) + +else (EIGEN3_INCLUDE_DIR) + + find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library + PATHS + ${CMAKE_INSTALL_PREFIX}/include + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen3 eigen + ) + + if(EIGEN3_INCLUDE_DIR) + _eigen3_check_version() + endif(EIGEN3_INCLUDE_DIR) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) + + mark_as_advanced(EIGEN3_INCLUDE_DIR) + +endif(EIGEN3_INCLUDE_DIR) + diff --git a/tmp/CodeLoop/CMake/FindGEANT4.cmake b/tmp/CodeLoop/CMake/FindGEANT4.cmake new file mode 100644 index 0000000..b351c08 --- /dev/null +++ b/tmp/CodeLoop/CMake/FindGEANT4.cmake @@ -0,0 +1,63 @@ +# - Try to find GEANT4 +# Once done this will define +# +# GEANT4_FOUND - system has GEANT4 +# GEANT4_INCLUDE_DIR - the GEANT4 include directory +# GEANT4_LIBRARIES - The libraries needed to use GEANT4 +# GEANT4_DEFINITIONS - Compiler switches required for using GEANT4 +# + +if (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR) + SET (GEANT4_INCLUDE_DIR GEANT4_INCLUDE_DIR-NOTFOUND) + SET (GEANT4_LIB_DIR GEANT4_LIB_DIR-NOTFOUND) + SET (GEANT4_PLISTS_LIB_DIR GEANT4_PLISTS_LIB_DIR-NOTFOUND) + SET (GEANT4_DIR GEANT4_DIR-NOTFOUND) +endif (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR) + +MESSAGE(STATUS "Looking for GEANT4...") + +FIND_PATH(GEANT4_DIR NAMES env.sh PATHS + ${SIMPATH}/transport/geant4 + ${SIMPATH}/transport/geant4/source + NO_DEFAULT_PATH +) + +FIND_PATH(GEANT4_INCLUDE_DIR NAMES G4Event.hh PATHS + ${SIMPATH}/transport/geant4/include + NO_DEFAULT_PATH +) + +SET(GEANT4_INCLUDE_DIR +${SIMPATH}/transport/geant4/include +${SIMPATH}/transport/geant4/source/interfaces/common/include +${SIMPATH}/transport/geant4/physics_lists/hadronic/Packaging/include +${SIMPATH}/transport/geant4/physics_lists/hadronic/QGSP/include +) + +FIND_PATH(GEANT4_LIB_DIR NAMES libG4baryons.so libG4baryons.dylib PATHS + ${SIMPATH}/transport/geant4/lib/Linux-g++ + ${SIMPATH}/transport/geant4/lib/Linux-icc + ${SIMPATH}/transport/geant4/lib + NO_DEFAULT_PATH +) + +IF (GEANT4_LIB_DIR) + SET(GEANT4_LIBRARY_DIR ${GEANT4_LIB_DIR}) +ENDIF (GEANT4_LIB_DIR) + +if (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR) + set(GEANT4_FOUND TRUE) +endif (GEANT4_INCLUDE_DIR AND GEANT4_LIBRARY_DIR) + +if (GEANT4_FOUND) + if (NOT GEANT4_FIND_QUIETLY) + MESSAGE(STATUS "Looking for GEANT4... - found ${GEANT4_LIBRARY_DIR}") +# message(STATUS "Found ${GEANT4_LIBRARY_DIR}") + endif (NOT GEANT4_FIND_QUIETLY) + SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${GEANT4_LIBRARY_DIR}) +else (GEANT4_FOUND) + if (GEANT4_FIND_REQUIRED) + message(FATAL_ERROR "Looking for GEANT4... - Not found") + endif (GEANT4_FIND_REQUIRED) +endif (GEANT4_FOUND) + diff --git a/tmp/CodeLoop/CMake/FindGEANT4VMC.cmake b/tmp/CodeLoop/CMake/FindGEANT4VMC.cmake new file mode 100644 index 0000000..5dec1b5 --- /dev/null +++ b/tmp/CodeLoop/CMake/FindGEANT4VMC.cmake @@ -0,0 +1,97 @@ +# - Try to find GEANT4VMC +# Once done this will define +# +# GEANT4VMC_FOUND - system has GEANT3 +# GEANT4VMC_INCLUDE_DIR - the GEANT3 include directory +# GEANT4VMC_LIBRARIES - The libraries needed to use GEANT3 +# GEANT4VMC_DEFINITIONS - Compiler switches required for using GEANT3 +# + +if (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR) + SET (GEANT4VMC_INCLUDE_DIR GEANT4VMC_INCLUDE_DIR-NOTFOUND) + SET (GEANT4VMC_LIB_DIR GEANT4VMC_LIB_DIR-NOTFOUND) + SET (GEANT4VMC_PLISTS_LIB_DIR GEANT4VMC_PLISTS_LIB_DIR-NOTFOUND) +endif (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR) + +MESSAGE(STATUS "Looking for GEANT4VMC...") + +FIND_PATH(GEANT4VMC_INCLUDE_DIR NAMES TG4G3Units.h PATHS + ${SIMPATH}/transport/geant4_vmc/include + NO_DEFAULT_PATH +) + +set(GEANT4VMC_INCLUDE_DIR +${SIMPATH}/transport/geant4_vmc/source/global/include +${SIMPATH}/transport/geant4_vmc/source/geometry/include +${SIMPATH}/transport/geant4_vmc/source/digits+hits/include +${SIMPATH}/transport/geant4_vmc/source/physics/include +${SIMPATH}/transport/geant4_vmc/source/event/include +${SIMPATH}/transport/geant4_vmc/source/run/include +${SIMPATH}/transport/geant4_vmc/source/interfaces/include +${SIMPATH}/transport/geant4_vmc/source/visualization/include +${SIMPATH}/transport/geant4_vmc/include +${SIMPATH}/transport/vgm/packages/BaseVGM/include +${SIMPATH}/transport/vgm/packages/ClhepVGM/include +${SIMPATH}/transport/vgm/packages/Geant4GM/include +${SIMPATH}/transport/vgm/packages/RootGM/include +${SIMPATH}/transport/vgm/packages/VGM/include +${SIMPATH}/transport/vgm/packages/XmlVGM/include +) + + +FIND_PATH(GEANT4VMC_LIBRARY_DIR NAMES libgeant4vmc.so libgeant4vmc.dylib PATHS + ${SIMPATH}/transport/geant4_vmc/lib/tgt_linux + ${SIMPATH}/transport/geant4_vmc/lib/tgt_linuxicc + ${SIMPATH}/transport/geant4_vmc/lib/tgt_linuxx8664gcc + ${SIMPATH}/transport/geant4_vmc/lib + NO_DEFAULT_PATH +) + +# check for existence of header file, which is needed in CbmRunConfiguration +# The file is only present in old versions of VMC +FIND_FILE(GEANT4_MODULAR_PHYSICS_LIST TG4ModularPhysicsList.h PATHS + ${GEANT4VMC_INCLUDE_DIR} + NO_DEFAULT_PATH +) + +if (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR) + if (NOT GEANT4VMC_FIND_QUIETLY) + MESSAGE(STATUS "Looking for GEANT4VMC... - found ${GEANT4VMC_LIBRARY_DIR}") + endif (NOT GEANT4VMC_FIND_QUIETLY) +else (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR) + if (GEANT4VMC_FIND_REQUIRED) + message(FATAL_ERROR "Looking for GEANT4VMC... - Not found ") + endif (GEANT4VMC_FIND_REQUIRED) +endif (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR) + + +MESSAGE(STATUS "Looking for VGM...") + +FIND_PATH(VGM_LIBRARY_DIR NAMES libBaseVGM.so libBaseVGM.dylib PATHS + ${SIMPATH}/transport/vgm/lib/Linux-g++ + ${SIMPATH}/transport/vgm.2.08.04/lib/Linux-g++ + ${SIMPATH}/transport/vgm/lib/Linux-icc + ${SIMPATH}/transport/vgm/lib + NO_DEFAULT_PATH +) + +if (VGM_LIBRARY_DIR) + if (NOT GEANT4VMC_FIND_QUIETLY) + MESSAGE(STATUS "Looking for VGM... - found ${VGM_LIBRARY_DIR}") + endif (NOT GEANT4VMC_FIND_QUIETLY) +else (VGM_LIBRARY_DIR) + if (GEANT4VMC_FIND_REQUIRED) + message(FATAL_ERROR "Looking for VGM... - Not found ") + endif (GEANT4VMC_FIND_REQUIRED) +endif (VGM_LIBRARY_DIR) + + +if (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR AND VGM_LIBRARY_DIR) + set(GEANT4VMC_FOUND TRUE) +endif (GEANT4VMC_INCLUDE_DIR AND GEANT4VMC_LIBRARY_DIR AND VGM_LIBRARY_DIR) + +if (GEANT4VMC_FOUND) + SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${GEANT4VMC_LIBRARY_DIR} + ${VGM_LIBRARY_DIR}) +endif (GEANT4VMC_FOUND) + diff --git a/tmp/CodeLoop/CMake/FindROOT.cmake b/tmp/CodeLoop/CMake/FindROOT.cmake new file mode 100644 index 0000000..b560f9b --- /dev/null +++ b/tmp/CodeLoop/CMake/FindROOT.cmake @@ -0,0 +1,270 @@ +# - Find ROOT instalation +# This module tries to find the ROOT installation on your system. +# It tries to find the root-config script which gives you all the needed information. +# If the system variable ROOTSYS is set this is straight forward. +# If not the module uses the pathes given in ROOT_CONFIG_SEARCHPATH. +# If you need an other path you should add this path to this varaible. +# The root-config script is then used to detect basically everything else. +# This module defines a number of key variables and macros. + +# F.Uhlig@gsi.de (fairroot.gsi.de) + + +MESSAGE(STATUS "Looking for Root...") + +SET(ROOT_CONFIG_SEARCHPATH + /usr/local/bin + ${SIMPATH}/tools/root/bin + $ENV{ROOTSYS}/bin +) + +SET(ROOT_DEFINITIONS "") + +SET(ROOT_INSTALLED_VERSION_TOO_OLD FALSE) + +SET(ROOT_CONFIG_EXECUTABLE ROOT_CONFIG_EXECUTABLE-NOTFOUND) + +FIND_PROGRAM(ROOT_CONFIG_EXECUTABLE NAMES root-config PATHS + ${ROOT_CONFIG_SEARCHPATH} + NO_DEFAULT_PATH) + +IF (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND") + MESSAGE( FATAL_ERROR "ROOT not installed in the searchpath and ROOTSYS is not set. Please + set ROOTSYS or add the path to your ROOT installation in the Macro FindROOT.cmake in the + subdirectory cmake/modules.") +ELSE (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND") + STRING(REGEX REPLACE "(^.*)/bin/root-config" "\\1" test ${ROOT_CONFIG_EXECUTABLE}) + SET( ENV{ROOTSYS} ${test}) + set( ROOTSYS ${test}) +ENDIF (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND") + + +IF (ROOT_CONFIG_EXECUTABLE) + + SET(ROOT_FOUND FALSE) + + EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE} ARGS "--version" OUTPUT_VARIABLE ROOTVERSION) + + MESSAGE(STATUS "Looking for Root... - found $ENV{ROOTSYS}/bin/root") + MESSAGE(STATUS "Looking for Root... - version ${ROOTVERSION} ") + + # we need at least version 5.00/00 + IF (NOT ROOT_MIN_VERSION) + SET(ROOT_MIN_VERSION "5.00/00") + ENDIF (NOT ROOT_MIN_VERSION) + + # now parse the parts of the user given version string into variables + STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+" "\\1" req_root_major_vers "${ROOT_MIN_VERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" req_root_minor_vers "${ROOT_MIN_VERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+)" "\\1" req_root_patch_vers "${ROOT_MIN_VERSION}") + + # and now the version string given by qmake + STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1" found_root_major_vers "${ROOTVERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" found_root_minor_vers "${ROOTVERSION}") + STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+).*" "\\1" found_root_patch_vers "${ROOTVERSION}") + + IF (found_root_major_vers LESS 5) + MESSAGE( FATAL_ERROR "Invalid ROOT version \"${ROOTERSION}\", at least major version 4 is required, e.g. \"5.00/00\"") + ENDIF (found_root_major_vers LESS 5) + + # compute an overall version number which can be compared at once + MATH(EXPR req_vers "${req_root_major_vers}*10000 + ${req_root_minor_vers}*100 + ${req_root_patch_vers}") + MATH(EXPR found_vers "${found_root_major_vers}*10000 + ${found_root_minor_vers}*100 + ${found_root_patch_vers}") + + IF (found_vers LESS req_vers) + SET(ROOT_FOUND FALSE) + SET(ROOT_INSTALLED_VERSION_TOO_OLD TRUE) + ELSE (found_vers LESS req_vers) + SET(ROOT_FOUND TRUE) + ENDIF (found_vers LESS req_vers) + +ENDIF (ROOT_CONFIG_EXECUTABLE) + + +IF (ROOT_FOUND) + + # ask root-config for the library dir + # Set ROOT_LIBRARY_DIR + + EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} + ARGS "--libdir" + OUTPUT_VARIABLE ROOT_LIBRARY_DIR_TMP ) + + IF(EXISTS "${ROOT_LIBRARY_DIR_TMP}") + SET(ROOT_LIBRARY_DIR ${ROOT_LIBRARY_DIR_TMP} ) + ELSE(EXISTS "${ROOT_LIBRARY_DIR_TMP}") + MESSAGE("Warning: ROOT_CONFIG_EXECUTABLE reported ${ROOT_LIBRARY_DIR_TMP} as library path,") + MESSAGE("Warning: but ${ROOT_LIBRARY_DIR_TMP} does NOT exist, ROOT must NOT be installed correctly.") + ENDIF(EXISTS "${ROOT_LIBRARY_DIR_TMP}") + + # ask root-config for the binary dir + EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE} + ARGS "--bindir" + OUTPUT_VARIABLE root_bins ) + SET(ROOT_BINARY_DIR ${root_bins}) + + # ask root-config for the include dir + EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} + ARGS "--incdir" + OUTPUT_VARIABLE root_headers ) + SET(ROOT_INCLUDE_DIR ${root_headers}) + # CACHE INTERNAL "") + + # ask root-config for the library varaibles + EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} +# ARGS "--noldflags --noauxlibs --libs" + ARGS "--glibs" + OUTPUT_VARIABLE root_flags ) + +# STRING(REGEX MATCHALL "([^ ])+" root_libs_all ${root_flags}) +# STRING(REGEX MATCHALL "-L([^ ])+" root_library ${root_flags}) +# REMOVE_FROM_LIST(root_flags "${root_libs_all}" "${root_library}") + + SET(ROOT_LIBRARIES ${root_flags}) + + # Make variables changeble to the advanced user + MARK_AS_ADVANCED( ROOT_LIBRARY_DIR ROOT_INCLUDE_DIR ROOT_DEFINITIONS) + + # Set ROOT_INCLUDES + SET( ROOT_INCLUDES ${ROOT_INCLUDE_DIR}) + + SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${ROOT_LIBRARY_DIR}) + + ####################################### + # + # Check the executables of ROOT + # ( rootcint ) + # + ####################################### + + FIND_PROGRAM(ROOT_CINT_EXECUTABLE + NAMES rootcint + PATHS ${ROOT_BINARY_DIR} + NO_DEFAULT_PATH + ) + +ENDIF (ROOT_FOUND) + + + + ########################################### + # + # Macros for building ROOT dictionary + # + ########################################### + +MACRO (ROOT_GENERATE_DICTIONARY_OLD ) + + set(INFILES "") + + foreach (_current_FILE ${ARGN}) + + IF (${_current_FILE} MATCHES "^.*\\.h$") + IF (${_current_FILE} MATCHES "^.*Link.*$") + set(LINKDEF_FILE ${_current_FILE}) + ELSE (${_current_FILE} MATCHES "^.*Link.*$") + set(INFILES ${INFILES} ${_current_FILE}) + ENDIF (${_current_FILE} MATCHES "^.*Link.*$") + ELSE (${_current_FILE} MATCHES "^.*\\.h$") + IF (${_current_FILE} MATCHES "^.*\\.cxx$") + set(OUTFILE ${_current_FILE}) + ELSE (${_current_FILE} MATCHES "^.*\\.cxx$") + set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE}) + ENDIF (${_current_FILE} MATCHES "^.*\\.cxx$") + ENDIF (${_current_FILE} MATCHES "^.*\\.h$") + + endforeach (_current_FILE ${ARGN}) + +# MESSAGE("INFILES: ${INFILES}") +# MESSAGE("OutFILE: ${OUTFILE}") +# MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}") +# MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}") + + STRING(REGEX REPLACE "(^.*).cxx" "\\1.h" bla "${OUTFILE}") +# MESSAGE("BLA: ${bla}") + SET (OUTFILES ${OUTFILE} ${bla}) + + ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} + COMMAND ${ROOT_CINT_EXECUTABLE} + ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES}) + +# MESSAGE("ROOT_CINT_EXECUTABLE has created the dictionary ${OUTFILE}") + +ENDMACRO (ROOT_GENERATE_DICTIONARY_OLD) + + ########################################### + # + # Macros for building ROOT dictionary + # + ########################################### + +MACRO (ROOT_GENERATE_DICTIONARY INFILES LINKDEF_FILE OUTFILE INCLUDE_DIRS_IN) + + set(INCLUDE_DIRS) + + foreach (_current_FILE ${INCLUDE_DIRS_IN}) + set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE}) + endforeach (_current_FILE ${INCLUDE_DIRS_IN}) + + +# MESSAGE("INFILES: ${INFILES}") +# MESSAGE("OutFILE: ${OUTFILE}") +# MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}") +# MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}") + + STRING(REGEX REPLACE "^(.*)\\.(.*)$" "\\1.h" bla "${OUTFILE}") +# MESSAGE("BLA: ${bla}") + SET (OUTFILES ${OUTFILE} ${bla}) + + + if (CMAKE_SYSTEM_NAME MATCHES Linux) + ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} + COMMAND LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR} ROOTSYS=${ROOTSYS} ${ROOT_CINT_EXECUTABLE} + ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES} ${LINKDEF_FILE}) + else (CMAKE_SYSTEM_NAME MATCHES Linux) + if (CMAKE_SYSTEM_NAME MATCHES Darwin) + ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} + COMMAND DYLD_LIBRARY_PATH=${ROOT_LIBRARY_DIR} ROOTSYS=${ROOTSYS} ${ROOT_CINT_EXECUTABLE} + ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES} ${LINKDEF_FILE}) + endif (CMAKE_SYSTEM_NAME MATCHES Darwin) + endif (CMAKE_SYSTEM_NAME MATCHES Linux) + +ENDMACRO (ROOT_GENERATE_DICTIONARY) + +MACRO (GENERATE_ROOT_TEST_SCRIPT SCRIPT_FULL_NAME) + + get_filename_component(path_name ${SCRIPT_FULL_NAME} PATH) + get_filename_component(file_extension ${SCRIPT_FULL_NAME} EXT) + get_filename_component(file_name ${SCRIPT_FULL_NAME} NAME_WE) + set(shell_script_name "${file_name}.sh") + + #MESSAGE("PATH: ${path_name}") + #MESSAGE("Ext: ${file_extension}") + #MESSAGE("Name: ${file_name}") + #MESSAGE("Shell Name: ${shell_script_name}") + + string(REPLACE ${PROJECT_SOURCE_DIR} + ${PROJECT_BINARY_DIR} new_path ${path_name} + ) + + #MESSAGE("New PATH: ${new_path}") + + file(MAKE_DIRECTORY ${new_path}/data) + + CONVERT_LIST_TO_STRING(${LD_LIBRARY_PATH}) + set(MY_LD_LIBRARY_PATH ${output}) + set(my_script_name ${SCRIPT_FULL_NAME}) + + if(CMAKE_SYSTEM MATCHES Darwin) + configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/root_macro_macos.sh.in + ${new_path}/${shell_script_name} + ) + else(CMAKE_SYSTEM MATCHES Darwin) + configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/root_macro.sh.in + ${new_path}/${shell_script_name} + ) + endif(CMAKE_SYSTEM MATCHES Darwin) + + EXEC_PROGRAM(/bin/chmod ARGS "u+x ${new_path}/${shell_script_name}") + +ENDMACRO (GENERATE_ROOT_TEST_SCRIPT) diff --git a/tmp/CodeLoop/CMake/FindVTK.cmake b/tmp/CodeLoop/CMake/FindVTK.cmake new file mode 100644 index 0000000..6b1772f --- /dev/null +++ b/tmp/CodeLoop/CMake/FindVTK.cmake @@ -0,0 +1,141 @@ +# - Find a VTK installation or build tree. +# The following variables are set if VTK is found. If VTK is not +# found, VTK_FOUND is set to false. +# VTK_FOUND - Set to true when VTK is found. +# VTK_USE_FILE - CMake file to use VTK. +# VTK_MAJOR_VERSION - The VTK major version number. +# VTK_MINOR_VERSION - The VTK minor version number +# (odd non-release). +# VTK_BUILD_VERSION - The VTK patch level +# (meaningless for odd minor). +# VTK_INCLUDE_DIRS - Include directories for VTK +# VTK_LIBRARY_DIRS - Link directories for VTK libraries +# VTK_KITS - List of VTK kits, in CAPS +# (COMMON,IO,) etc. +# VTK_LANGUAGES - List of wrapped languages, in CAPS +# (TCL, PYHTON,) etc. +# The following cache entries must be set by the user to locate VTK: +# VTK_DIR - The directory containing VTKConfig.cmake. +# This is either the root of the build tree, +# or the lib/vtk directory. This is the +# only cache entry. +# The following variables are set for backward compatibility and +# should not be used in new code: +# USE_VTK_FILE - The full path to the UseVTK.cmake file. +# This is provided for backward +# compatibility. Use VTK_USE_FILE +# instead. +# + +#============================================================================= +# Copyright 2001-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# Assume not found. +SET(VTK_FOUND 0) + +# VTK 4.0 did not provide VTKConfig.cmake. +IF("${VTK_FIND_VERSION}" VERSION_LESS 4.1) + SET(_VTK_40_ALLOW 1) + IF(VTK_FIND_VERSION) + SET(_VTK_40_ONLY 1) + ENDIF() +ENDIF() + +# Construct consitent error messages for use below. +SET(VTK_DIR_DESCRIPTION "directory containing VTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/vtk for an installation.") +IF(_VTK_40_ALLOW) + SET(VTK_DIR_DESCRIPTION "${VTK_DIR_DESCRIPTION} For VTK 4.0, this is the location of UseVTK.cmake. This is either the root of the build tree or PREFIX/include/vtk for an installation.") +ENDIF() +SET(VTK_DIR_MESSAGE "VTK not found. Set the VTK_DIR cmake cache entry to the ${VTK_DIR_DESCRIPTION}") + +# Check whether VTK 4.0 has already been found. +IF(_VTK_40_ALLOW AND VTK_DIR) + IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake) + SET(VTK_FOUND 1) + INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings. + ENDIF() +ENDIF() + +# Use the Config mode of the find_package() command to find VTKConfig. +# If this succeeds (possibly because VTK_DIR is already set), the +# command will have already loaded VTKConfig.cmake and set VTK_FOUND. +IF(NOT _VTK_40_ONLY AND NOT VTK_FOUND) + FIND_PACKAGE(VTK QUIET NO_MODULE) +ENDIF() + +# Special search for VTK 4.0. +IF(_VTK_40_ALLOW AND NOT VTK_DIR) + # Old scripts may set these directories in the CMakeCache.txt file. + # They can tell us where to find VTKConfig.cmake. + SET(VTK_DIR_SEARCH_LEGACY "") + IF(VTK_BINARY_PATH AND USE_BUILT_VTK) + SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_BINARY_PATH}) + ENDIF(VTK_BINARY_PATH AND USE_BUILT_VTK) + IF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK) + SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} + ${VTK_INSTALL_PATH}/lib/vtk) + ENDIF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK) + + # Look for UseVTK.cmake in build trees or under /include/vtk. + FIND_PATH(VTK_DIR + NAMES UseVTK.cmake + PATH_SUFFIXES vtk-4.0 vtk + HINTS $ENV{VTK_DIR} + + PATHS + + # Support legacy cache files. + ${VTK_DIR_SEARCH_LEGACY} + + # Read from the CMakeSetup registry entries. It is likely that + # VTK will have been recently built. + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9] + [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10] + + # Help the user find it if we cannot. + DOC "The ${VTK_DIR_DESCRIPTION}" + ) + + IF(VTK_DIR) + IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake) + SET(VTK_FOUND 1) + INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings. + ELSE() + # We found the wrong version. Pretend we did not find it. + SET(VTK_DIR "VTK_DIR-NOTFOUND" CACHE PATH "The ${VTK_DIR_DESCRIPTION}" FORCE) + ENDIF() + ENDIF() +ENDIF() + +#----------------------------------------------------------------------------- +IF(VTK_FOUND) + # Set USE_VTK_FILE for backward-compatability. + SET(USE_VTK_FILE ${VTK_USE_FILE}) +ELSE(VTK_FOUND) + # VTK not found, explain to the user how to specify its location. + IF(VTK_FIND_REQUIRED) + MESSAGE(FATAL_ERROR ${VTK_DIR_MESSAGE}) + ELSE(VTK_FIND_REQUIRED) + IF(NOT VTK_FIND_QUIETLY) + MESSAGE(STATUS ${VTK_DIR_MESSAGE}) + ENDIF(NOT VTK_FIND_QUIETLY) + ENDIF(VTK_FIND_REQUIRED) +ENDIF(VTK_FOUND) diff --git a/tmp/CodeLoop/CMakeCache.txt b/tmp/CodeLoop/CMakeCache.txt new file mode 100644 index 0000000..7c431d3 --- /dev/null +++ b/tmp/CodeLoop/CMakeCache.txt @@ -0,0 +1,325 @@ +# This is the CMakeCache file. +# For build in directory: /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop +# It was generated by CMake: /usr/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a program. +CMAKE_AR:FILEPATH=/usr/bin/ar + +//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or +// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler. +CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ + +//Flags used by the compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release minsize builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds (/MD /Ob1 /Oi +// /Ot /Oy /Gs will produce slightly less optimized but smaller +// files). +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during Release with Debug Info builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g + +//C compiler. +CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release minsize builds. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds (/MD /Ob1 /Oi +// /Ot /Oy /Gs will produce slightly less optimized but smaller +// files). +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during Release with Debug Info builds. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING=' ' + +//Flags used by the linker during debug builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING=' ' + +//Flags used by the linker during debug builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=Tutorial + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING=' ' + +//Flags used by the linker during debug builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Path to a program. +CMAKE_STRIP:FILEPATH=/usr/bin/strip + +//If true, cmake will use relative paths in makefiles and projects. +CMAKE_USE_RELATIVE_PATHS:BOOL=OFF + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Path to a file. +EIGEN3_INCLUDE_DIR:PATH=/usr/include/eigen3 + +//Dependencies for target +ManageFilename_LIB_DEPENDS:STATIC= + +//Path to a program. +ROOT_CINT_EXECUTABLE:FILEPATH=/opt/root-system/bin/rootcint + +//Path to a program. +ROOT_CONFIG_EXECUTABLE:FILEPATH=/opt/root-system/bin/root-config + +//Value Computed by CMake +Tutorial_BINARY_DIR:STATIC=/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop + +//Value Computed by CMake +Tutorial_SOURCE_DIR:STATIC=/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop + +//Activate use of Root Cint integration +ULIB_USE_ROOT:BOOL=OFF + +//Activate use of Vtk Visual Pipelines +ULIB_USE_VTK:BOOL=OFF + +//Use tutorial provided math implementation +USE_MYMATH:BOOL=ON + +//The directory containing a CMake configuration file for VTK. +VTK_DIR:PATH=/usr/local/lib/vtk-5.10 + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_BUILD_TOOL +CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1 +//What is the target build tool cmake is generating for. +CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/make +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=9 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +CMAKE_CXX_COMPILER_WORKS:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +CMAKE_C_COMPILER_WORKS:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Result of TRY_COMPILE +CMAKE_DETERMINE_CXX_ABI_COMPILED:INTERNAL=TRUE +//Result of TRY_COMPILE +CMAKE_DETERMINE_C_ABI_COMPILED:INTERNAL=TRUE +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/cmake-gui +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Start directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=2 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/share/cmake-2.8 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//Suppress Warnings that are meant for the author of the CMakeLists.txt +// files. +CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=FALSE +//uname command +CMAKE_UNAME:INTERNAL=/bin/uname +//ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS +CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: EIGEN3_INCLUDE_DIR +EIGEN3_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//Details about finding Eigen3 +FIND_PACKAGE_MESSAGE_DETAILS_Eigen3:INTERNAL=[/usr/include/eigen3][TRUE][v(2.91.0)] +//ADVANCED property for variable: VTK_DIR +VTK_DIR-ADVANCED:INTERNAL=1 + diff --git a/tmp/CodeLoop/CMakeLists.txt b/tmp/CodeLoop/CMakeLists.txt new file mode 100644 index 0000000..dd83136 --- /dev/null +++ b/tmp/CodeLoop/CMakeLists.txt @@ -0,0 +1,87 @@ + + + +cmake_minimum_required (VERSION 2.6) +project (Tutorial) + +set (Tutorial_VERSION_MAJOR 1) +set (Tutorial_VERSION_MINOR 0) + +# configure a header file to pass some of the CMake settings +# to the source code +configure_file ( + "${PROJECT_SOURCE_DIR}/config.h.in" + "${PROJECT_BINARY_DIR}/config.h" + ) + +# add the binary tree to the search path for include files +# so that we will find TutorialConfig.h +include_directories("${PROJECT_BINARY_DIR}") + +set(PARENT_PATH ${PROJECT_SOURCE_DIR}) +set(CMAKE_DIR "${PARENT_PATH}/CMake") +set(CMAKE_MODULE_PATH "${PARENT_PATH}/CMake" ${CMAKE_MODULE_PATH}) + + + + +macro(add_sources) + file(RELATIVE_PATH _relPath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") + foreach(_src ${ARGN}) + if(_relPath) + list (APPEND SRCS "${_relPath}/${_src}") + else() + list (APPEND SRCS "${_src}") + endif() + endforeach() + if(_relPath) + # propagate SRCS to parent directory + set (SRCS ${SRCS} PARENT_SCOPE) + endif() +endmacro() + + +################################################################################ +## PKG FIND ## + +## EIGEN ## +# option(USE_EIGEN ON) ## REQUIRED +FIND_PACKAGE(Eigen3) + +## ROOT ## +option(ULIB_USE_ROOT "Activate use of Root Cint integration" ON) +include(FindROOT) +find_package(ROOT) + + +## VTK ## +option(ULIB_USE_VTK "Activate use of Vtk Visual Pipelines" ON) +set(VTK_DIR "PATH/TO/VTK/BUILD/DIRECTORY") +mark_as_advanced(VTK_DIR) +find_package(VTK REQUIRED) +include(${VTK_USE_FILE}) +message(STATUS "VTK included libraries: ${VTK_LIBRARIES}") + + +################################################################################ + +include_directories("${PROJECT_SOURCE_DIR}/src") +add_subdirectory(src) + +#include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") +#add_subdirectory (MathFunctions) + +################################################################################ + + +# add the executable +add_executable(Tutorial main.cpp) +target_link_libraries (Tutorial ManageFilename ${VTK_LIBRARIES}) + +install(TARGETS Tutorial + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static) + +install(DIRECTORY src/ DESTINATION include/CodeLoop + FILES_MATCHING PATTERN "*.h") diff --git a/tmp/CodeLoop/COPYING b/tmp/CodeLoop/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/tmp/CodeLoop/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 3 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, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/tmp/CodeLoop/ChangeLog b/tmp/CodeLoop/ChangeLog new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tmp/CodeLoop/ChangeLog @@ -0,0 +1 @@ + diff --git a/tmp/CodeLoop/INSTALL b/tmp/CodeLoop/INSTALL new file mode 100644 index 0000000..a1e89e1 --- /dev/null +++ b/tmp/CodeLoop/INSTALL @@ -0,0 +1,370 @@ +Installation Instructions +************************* + +Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, +Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/tmp/CodeLoop/Makefile b/tmp/CodeLoop/Makefile new file mode 100644 index 0000000..c355e35 --- /dev/null +++ b/tmp/CodeLoop/Makefile @@ -0,0 +1,225 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The program to use to edit the cache. +CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/cmake-gui -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: install/local +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: install/strip +.PHONY : install/strip/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components +.PHONY : list_install_components/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/CMakeFiles /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named Tutorial + +# Build rule for target. +Tutorial: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 Tutorial +.PHONY : Tutorial + +# fast build rule for target. +Tutorial/fast: + $(MAKE) -f CMakeFiles/Tutorial.dir/build.make CMakeFiles/Tutorial.dir/build +.PHONY : Tutorial/fast + +#============================================================================= +# Target rules for targets named ManageFilename + +# Build rule for target. +ManageFilename: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 ManageFilename +.PHONY : ManageFilename + +# fast build rule for target. +ManageFilename/fast: + $(MAKE) -f src/CMakeFiles/ManageFilename.dir/build.make src/CMakeFiles/ManageFilename.dir/build +.PHONY : ManageFilename/fast + +main.o: main.cpp.o +.PHONY : main.o + +# target to build an object file +main.cpp.o: + $(MAKE) -f CMakeFiles/Tutorial.dir/build.make CMakeFiles/Tutorial.dir/main.cpp.o +.PHONY : main.cpp.o + +main.i: main.cpp.i +.PHONY : main.i + +# target to preprocess a source file +main.cpp.i: + $(MAKE) -f CMakeFiles/Tutorial.dir/build.make CMakeFiles/Tutorial.dir/main.cpp.i +.PHONY : main.cpp.i + +main.s: main.cpp.s +.PHONY : main.s + +# target to generate assembly for a file +main.cpp.s: + $(MAKE) -f CMakeFiles/Tutorial.dir/build.make CMakeFiles/Tutorial.dir/main.cpp.s +.PHONY : main.cpp.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... Tutorial" + @echo "... edit_cache" + @echo "... install" + @echo "... install/local" + @echo "... install/strip" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... ManageFilename" + @echo "... main.o" + @echo "... main.i" + @echo "... main.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/tmp/CodeLoop/Makefile.am b/tmp/CodeLoop/Makefile.am new file mode 100644 index 0000000..7acbbdd --- /dev/null +++ b/tmp/CodeLoop/Makefile.am @@ -0,0 +1,23 @@ +# Automatically Generated Makefile by EDE. +# For use with: automake +# +# DO NOT MODIFY THIS FILE OR YOUR CHANGES MAY BE LOST. +# EDE is the Emacs Development Environment. +# http://cedet.sourceforge.net/ede.shtml +# + +top="$(CURDIR)"/ +ede_FILES=Project.ede Makefile.am + + +EIGEN = $(EIGEN3_CFLAGS) +AM_CXXFLAGS = -D_DEBUG -g3 -O0 $(EIGEN) + +SUBDIRS= +EXTRA_DIST=Project.ede +bin_PROGRAMS=loop +loop_SOURCES=main.cpp +loop_LDADD= + + +# End of Makefile.am diff --git a/tmp/CodeLoop/Makefile.in b/tmp/CodeLoop/Makefile.in new file mode 100644 index 0000000..b545c04 --- /dev/null +++ b/tmp/CodeLoop/Makefile.in @@ -0,0 +1,825 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Automatically Generated Makefile by EDE. +# For use with: automake +# +# DO NOT MODIFY THIS FILE OR YOUR CHANGES MAY BE LOST. +# EDE is the Emacs Development Environment. +# http://cedet.sourceforge.net/ede.shtml +# + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = loop$(EXEEXT) +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + depcomp install-sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_loop_OBJECTS = main.$(OBJEXT) +loop_OBJECTS = $(am_loop_OBJECTS) +loop_DEPENDENCIES = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(loop_SOURCES) +DIST_SOURCES = $(loop_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EIGEN3_CFLAGS = @EIGEN3_CFLAGS@ +EIGEN3_LIBS = @EIGEN3_LIBS@ +EXEEXT = @EXEEXT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +top = "$(CURDIR)"/ +ede_FILES = Project.ede Makefile.am +EIGEN = $(EIGEN3_CFLAGS) +AM_CXXFLAGS = -D_DEBUG -g3 -O0 $(EIGEN) +SUBDIRS = +EXTRA_DIST = Project.ede +loop_SOURCES = main.cpp +loop_LDADD = +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +loop$(EXEEXT): $(loop_OBJECTS) $(loop_DEPENDENCIES) $(EXTRA_loop_DEPENDENCIES) + @rm -f loop$(EXEEXT) + $(CXXLINK) $(loop_OBJECTS) $(loop_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod u+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(PROGRAMS) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-binPROGRAMS \ + clean-generic ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-binPROGRAMS + + +# End of Makefile.am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tmp/CodeLoop/ManageFilename.cpp b/tmp/CodeLoop/ManageFilename.cpp new file mode 100644 index 0000000..836ad43 --- /dev/null +++ b/tmp/CodeLoop/ManageFilename.cpp @@ -0,0 +1,19 @@ + +#include "ManageFilename.h" + + + +std::string ManageFilename::GetFileExtension(const std::string& FileName) +{ + if(FileName.find_last_of(".") != std::string::npos) + return FileName.substr(FileName.find_last_of(".")+1); + return ""; +} + +std::string ManageFilename::GetFileName(const std::string& FileName) +{ + if(FileName.find_last_of(".") != std::string::npos) + return FileName.substr(0,FileName.find_last_of(".")); + return ""; +} + diff --git a/tmp/CodeLoop/ManageFilename.h b/tmp/CodeLoop/ManageFilename.h new file mode 100644 index 0000000..990aae4 --- /dev/null +++ b/tmp/CodeLoop/ManageFilename.h @@ -0,0 +1,24 @@ +#ifndef MANAGEFILENAME_H +#define MANAGEFILENAME_H + +#include +#include + + + +class ManageFilename { + +public: + static std::string GetFileExtension(const std::string& FileName); + + static std::string GetFileName(const std::string& FileName); + + +}; + + + + + + +#endif // MANAGEFILENAME_H diff --git a/tmp/CodeLoop/NEWS b/tmp/CodeLoop/NEWS new file mode 100644 index 0000000..4aa2d3e --- /dev/null +++ b/tmp/CodeLoop/NEWS @@ -0,0 +1 @@ +NEWS file for TMP \ No newline at end of file diff --git a/tmp/CodeLoop/Project.ede b/tmp/CodeLoop/Project.ede new file mode 100644 index 0000000..b091698 --- /dev/null +++ b/tmp/CodeLoop/Project.ede @@ -0,0 +1,14 @@ +;; Object TMP +;; EDE Project Files are auto generated: Do Not Edit +(ede-proj-project "TMP" + :file "Project.ede" + :name "TMP" + :targets (list + (ede-proj-target-makefile-program "loop" + :name "loop" + :path "" + :source '("main.cpp") + ) + ) + :makefile-type 'Makefile.am + ) diff --git a/tmp/CodeLoop/README b/tmp/CodeLoop/README new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tmp/CodeLoop/README @@ -0,0 +1 @@ + diff --git a/tmp/CodeLoop/TMP_loop.config b/tmp/CodeLoop/TMP_loop.config new file mode 100644 index 0000000..8cec188 --- /dev/null +++ b/tmp/CodeLoop/TMP_loop.config @@ -0,0 +1 @@ +// ADD PREDEFINED MACROS HERE! diff --git a/tmp/CodeLoop/TMP_loop.creator b/tmp/CodeLoop/TMP_loop.creator new file mode 100644 index 0000000..e94cbbd --- /dev/null +++ b/tmp/CodeLoop/TMP_loop.creator @@ -0,0 +1 @@ +[General] diff --git a/tmp/CodeLoop/TMP_loop.creator.user b/tmp/CodeLoop/TMP_loop.creator.user new file mode 100644 index 0000000..af104fd --- /dev/null +++ b/tmp/CodeLoop/TMP_loop.creator.user @@ -0,0 +1,200 @@ + + + + + + GenericProjectManager.GenericProject.Toolchain + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + System + false + 4 + true + 1 + true + 0 + true + 1 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop + + GenericProjectManager.GenericTarget + 0 + 0 + 0 + + /home/etjazz/devel/test/TMPMetaprogramming/CodeLoop + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb + + + + all + + + + Make + + GenericProjectManager.GenericMakeStep + + 1 + Build + + ProjectExplorer.BuildSteps.Build + + + 0 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + all + GenericProjectManager.GenericBuildConfiguration + + 1 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + No deployment + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + + + false + false + false + false + false + false + false + false + true + true + 0.01 + 0.01 + 10 + 10 + true + true + 25 + 25 + + + true + true + valgrind + valgrind + + 11 + 14 + 12 + 13 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 0 + 1 + + + 11 + 14 + 12 + 13 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 0 + 1 + + + 2 + /home/etjazz/devel/test/TMPMetaprogramming/CodeLoop/loop + false + + %{buildDir} + Run /home/etjazz/devel/test/TMPMetaprogramming/CodeLoop/loop + + ProjectExplorer.CustomExecutableRunConfiguration + 3768 + true + false + false + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {b2d901b7-7973-4dfe-bd07-87db6af1d3e2} + + + ProjectExplorer.Project.Updater.FileVersion + 10 + + diff --git a/tmp/CodeLoop/TMP_loop.files b/tmp/CodeLoop/TMP_loop.files new file mode 100644 index 0000000..be71680 --- /dev/null +++ b/tmp/CodeLoop/TMP_loop.files @@ -0,0 +1,5 @@ +/home/etjazz/devel/test/TMPMetaprogramming/CodeLoop/config.h +/home/etjazz/devel/test/TMPMetaprogramming/CodeLoop/main.cpp +CMakeLists.txt +ManageFilename.h +ManageFilename.cpp diff --git a/tmp/CodeLoop/TMP_loop.includes b/tmp/CodeLoop/TMP_loop.includes new file mode 100644 index 0000000..8f6ff71 --- /dev/null +++ b/tmp/CodeLoop/TMP_loop.includes @@ -0,0 +1,2 @@ +/home/etjazz/devel/test/TMPMetaprogramming/CodeLoop +/usr/include/eigen3 diff --git a/tmp/CodeLoop/aclocal.m4 b/tmp/CodeLoop/aclocal.m4 new file mode 100644 index 0000000..c1649f5 --- /dev/null +++ b/tmp/CodeLoop/aclocal.m4 @@ -0,0 +1,1143 @@ +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.6], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.6])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/tmp/CodeLoop/autom4te.cache/output.0 b/tmp/CodeLoop/autom4te.cache/output.0 new file mode 100644 index 0000000..ccd5434 --- /dev/null +++ b/tmp/CodeLoop/autom4te.cache/output.0 @@ -0,0 +1,4436 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.69. +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="Project.ede" +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CXX +CPPFLAGS +LDFLAGS +CXXFLAGS +CXX +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +' + ac_precious_vars='build_alias +host_alias +target_alias +CXX +CXXFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCC' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_cxx_try_compile LINENO +@%:@ ---------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_cxx_try_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in @%:@(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=TMP + VERSION=1.0 + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + +ac_config_headers="$ac_config_headers config.h" + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 +$as_echo_n "checking whether the C++ compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C++ compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 +$as_echo_n "checking for C++ compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +# End the configure script. +ac_config_files="$ac_config_files Makefile" + +ac_config_commands="$ac_config_commands default" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "default":C) date > stamp-h ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/tmp/CodeLoop/autom4te.cache/output.1 b/tmp/CodeLoop/autom4te.cache/output.1 new file mode 100644 index 0000000..1899f6d --- /dev/null +++ b/tmp/CodeLoop/autom4te.cache/output.1 @@ -0,0 +1,4667 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.69. +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="Project.ede" +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +EIGEN3_LIBS +EIGEN3_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CXX +CPPFLAGS +LDFLAGS +CXXFLAGS +CXX +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +' + ac_precious_vars='build_alias +host_alias +target_alias +CXX +CXXFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCC +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +EIGEN3_CFLAGS +EIGEN3_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + EIGEN3_CFLAGS + C compiler flags for EIGEN3, overriding pkg-config + EIGEN3_LIBS linker flags for EIGEN3, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_cxx_try_compile LINENO +@%:@ ---------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_cxx_try_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in @%:@(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=TMP + VERSION=1.0 + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + +ac_config_headers="$ac_config_headers config.h" + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 +$as_echo_n "checking whether the C++ compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C++ compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 +$as_echo_n "checking for C++ compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EIGEN3" >&5 +$as_echo_n "checking for EIGEN3... " >&6; } + +if test -n "$EIGEN3_CFLAGS"; then + pkg_cv_EIGEN3_CFLAGS="$EIGEN3_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"eigen3 >= 0.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "eigen3 >= 0.1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_EIGEN3_CFLAGS=`$PKG_CONFIG --cflags "eigen3 >= 0.1" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$EIGEN3_LIBS"; then + pkg_cv_EIGEN3_LIBS="$EIGEN3_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"eigen3 >= 0.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "eigen3 >= 0.1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_EIGEN3_LIBS=`$PKG_CONFIG --libs "eigen3 >= 0.1" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + EIGEN3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "eigen3 >= 0.1" 2>&1` + else + EIGEN3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "eigen3 >= 0.1" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$EIGEN3_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (eigen3 >= 0.1) were not met: + +$EIGEN3_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables EIGEN3_CFLAGS +and EIGEN3_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables EIGEN3_CFLAGS +and EIGEN3_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + EIGEN3_CFLAGS=$pkg_cv_EIGEN3_CFLAGS + EIGEN3_LIBS=$pkg_cv_EIGEN3_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + +# End the configure script. +ac_config_files="$ac_config_files Makefile" + +ac_config_commands="$ac_config_commands default" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "default":C) date > stamp-h ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/tmp/CodeLoop/autom4te.cache/output.2 b/tmp/CodeLoop/autom4te.cache/output.2 new file mode 100644 index 0000000..1899f6d --- /dev/null +++ b/tmp/CodeLoop/autom4te.cache/output.2 @@ -0,0 +1,4667 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.69. +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="Project.ede" +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +EIGEN3_LIBS +EIGEN3_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CXX +CPPFLAGS +LDFLAGS +CXXFLAGS +CXX +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +' + ac_precious_vars='build_alias +host_alias +target_alias +CXX +CXXFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCC +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +EIGEN3_CFLAGS +EIGEN3_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + EIGEN3_CFLAGS + C compiler flags for EIGEN3, overriding pkg-config + EIGEN3_LIBS linker flags for EIGEN3, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_cxx_try_compile LINENO +@%:@ ---------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_cxx_try_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in @%:@(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=TMP + VERSION=1.0 + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + +ac_config_headers="$ac_config_headers config.h" + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 +$as_echo_n "checking whether the C++ compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C++ compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 +$as_echo_n "checking for C++ compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EIGEN3" >&5 +$as_echo_n "checking for EIGEN3... " >&6; } + +if test -n "$EIGEN3_CFLAGS"; then + pkg_cv_EIGEN3_CFLAGS="$EIGEN3_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"eigen3 >= 0.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "eigen3 >= 0.1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_EIGEN3_CFLAGS=`$PKG_CONFIG --cflags "eigen3 >= 0.1" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$EIGEN3_LIBS"; then + pkg_cv_EIGEN3_LIBS="$EIGEN3_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"eigen3 >= 0.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "eigen3 >= 0.1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_EIGEN3_LIBS=`$PKG_CONFIG --libs "eigen3 >= 0.1" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + EIGEN3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "eigen3 >= 0.1" 2>&1` + else + EIGEN3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "eigen3 >= 0.1" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$EIGEN3_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (eigen3 >= 0.1) were not met: + +$EIGEN3_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables EIGEN3_CFLAGS +and EIGEN3_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables EIGEN3_CFLAGS +and EIGEN3_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + EIGEN3_CFLAGS=$pkg_cv_EIGEN3_CFLAGS + EIGEN3_LIBS=$pkg_cv_EIGEN3_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + +# End the configure script. +ac_config_files="$ac_config_files Makefile" + +ac_config_commands="$ac_config_commands default" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "default":C) date > stamp-h ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/tmp/CodeLoop/autom4te.cache/requests b/tmp/CodeLoop/autom4te.cache/requests new file mode 100644 index 0000000..350dc78 --- /dev/null +++ b/tmp/CodeLoop/autom4te.cache/requests @@ -0,0 +1,223 @@ +# This file was generated by Autom4te Sun Apr 29 21:48:16 UTC 2012. +# It contains the lists of macros which have been traced. +# It can be safely removed. + +@request = ( + bless( [ + '0', + 1, + [ + '/usr/share/autoconf' + ], + [ + '/usr/share/autoconf/autoconf/autoconf.m4f', + '/usr/share/aclocal-1.11/amversion.m4', + '/usr/share/aclocal-1.11/auxdir.m4', + '/usr/share/aclocal-1.11/cond.m4', + '/usr/share/aclocal-1.11/depend.m4', + '/usr/share/aclocal-1.11/depout.m4', + '/usr/share/aclocal-1.11/header.m4', + '/usr/share/aclocal-1.11/init.m4', + '/usr/share/aclocal-1.11/install-sh.m4', + '/usr/share/aclocal-1.11/lead-dot.m4', + '/usr/share/aclocal-1.11/make.m4', + '/usr/share/aclocal-1.11/missing.m4', + '/usr/share/aclocal-1.11/mkdirp.m4', + '/usr/share/aclocal-1.11/options.m4', + '/usr/share/aclocal-1.11/runlog.m4', + '/usr/share/aclocal-1.11/sanity.m4', + '/usr/share/aclocal-1.11/silent.m4', + '/usr/share/aclocal-1.11/strip.m4', + '/usr/share/aclocal-1.11/substnot.m4', + '/usr/share/aclocal-1.11/tar.m4', + 'configure.ac' + ], + { + 'm4_pattern_forbid' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + '_AM_SET_OPTION' => 1, + 'AC_DEFUN' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_MISSING_HAS_RUN' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AM_MISSING_PROG' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AC_DEFUN_ONCE' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, + '_m4_warn' => 1, + 'AM_SANITY_CHECK' => 1, + 'AM_SILENT_RULES' => 1, + 'include' => 1, + '_AM_PROG_TAR' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'AM_DEP_TRACK' => 1, + 'AM_CONFIG_HEADER' => 1, + '_AM_SET_OPTIONS' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AM_RUN_LOG' => 1, + '_AM_IF_OPTION' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'm4_pattern_allow' => 1, + '_AM_AUTOCONF_VERSION' => 1, + '_AM_MANGLE_OPTION' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_SET_LEADING_DOT' => 1, + 'AM_SET_DEPDIR' => 1, + '_AM_DEPENDENCIES' => 1, + 'm4_include' => 1, + 'AM_PROG_INSTALL_SH' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + 'AU_DEFUN' => 1, + 'AM_MAKE_INCLUDE' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '1', + 1, + [ + '/usr/share/autoconf' + ], + [ + '/usr/share/autoconf/autoconf/autoconf.m4f', + 'aclocal.m4', + 'configure.ac' + ], + { + 'AM_PROG_F77_C_O' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'AC_INIT' => 1, + 'm4_pattern_forbid' => 1, + 'AC_CANONICAL_TARGET' => 1, + '_AM_COND_IF' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AC_SUBST' => 1, + 'AC_CANONICAL_HOST' => 1, + 'AC_FC_SRCEXT' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AM_PATH_GUILE' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AC_CONFIG_LINKS' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'm4_sinclude' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_NLS' => 1, + 'AC_FC_PP_DEFINE' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + '_m4_warn' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + 'AM_PROG_CXX_C_O' => 1, + '_AM_MAKEFILE_INCLUDE' => 1, + '_AM_COND_ENDIF' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AM_SILENT_RULES' => 1, + 'AM_PROG_MOC' => 1, + 'AC_CONFIG_FILES' => 1, + 'include' => 1, + 'LT_INIT' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AM_PROG_AR' => 1, + 'AC_LIBSOURCE' => 1, + 'AC_CANONICAL_BUILD' => 1, + 'AM_PROG_FC_C_O' => 1, + 'AC_FC_FREEFORM' => 1, + 'AC_FC_PP_SRCEXT' => 1, + 'AH_OUTPUT' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'm4_pattern_allow' => 1, + 'AM_PROG_CC_C_O' => 1, + 'sinclude' => 1, + 'AM_CONDITIONAL' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AM_POT_TOOLS' => 1, + 'm4_include' => 1, + '_AM_COND_ELSE' => 1, + 'AC_SUBST_TRACE' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '2', + 1, + [ + '/usr/share/autoconf' + ], + [ + '/usr/share/autoconf/autoconf/autoconf.m4f', + '/usr/share/aclocal/pkg.m4', + '/usr/share/aclocal-1.11/amversion.m4', + '/usr/share/aclocal-1.11/auxdir.m4', + '/usr/share/aclocal-1.11/cond.m4', + '/usr/share/aclocal-1.11/depend.m4', + '/usr/share/aclocal-1.11/depout.m4', + '/usr/share/aclocal-1.11/header.m4', + '/usr/share/aclocal-1.11/init.m4', + '/usr/share/aclocal-1.11/install-sh.m4', + '/usr/share/aclocal-1.11/lead-dot.m4', + '/usr/share/aclocal-1.11/make.m4', + '/usr/share/aclocal-1.11/missing.m4', + '/usr/share/aclocal-1.11/mkdirp.m4', + '/usr/share/aclocal-1.11/options.m4', + '/usr/share/aclocal-1.11/runlog.m4', + '/usr/share/aclocal-1.11/sanity.m4', + '/usr/share/aclocal-1.11/silent.m4', + '/usr/share/aclocal-1.11/strip.m4', + '/usr/share/aclocal-1.11/substnot.m4', + '/usr/share/aclocal-1.11/tar.m4', + 'configure.ac' + ], + { + 'm4_pattern_forbid' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + '_AM_SET_OPTION' => 1, + 'AC_DEFUN' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_MISSING_HAS_RUN' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AM_MISSING_PROG' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AC_DEFUN_ONCE' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, + '_PKG_SHORT_ERRORS_SUPPORTED' => 1, + '_m4_warn' => 1, + 'AM_SANITY_CHECK' => 1, + 'PKG_CHECK_EXISTS' => 1, + 'AM_SILENT_RULES' => 1, + 'include' => 1, + '_AM_PROG_TAR' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'AM_DEP_TRACK' => 1, + 'AM_CONFIG_HEADER' => 1, + '_AM_SET_OPTIONS' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AM_RUN_LOG' => 1, + '_AM_IF_OPTION' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'm4_pattern_allow' => 1, + '_AM_AUTOCONF_VERSION' => 1, + '_AM_MANGLE_OPTION' => 1, + 'AM_SET_LEADING_DOT' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_SET_DEPDIR' => 1, + '_AM_DEPENDENCIES' => 1, + 'AM_PROG_INSTALL_SH' => 1, + 'PKG_PROG_PKG_CONFIG' => 1, + 'm4_include' => 1, + 'PKG_CHECK_MODULES' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + 'AU_DEFUN' => 1, + 'AM_MAKE_INCLUDE' => 1 + } + ], 'Autom4te::Request' ) + ); + diff --git a/tmp/CodeLoop/autom4te.cache/traces.0 b/tmp/CodeLoop/autom4te.cache/traces.0 new file mode 100644 index 0000000..d5b0a12 --- /dev/null +++ b/tmp/CodeLoop/autom4te.cache/traces.0 @@ -0,0 +1,783 @@ +m4trace:/usr/share/aclocal-1.11/amversion.m4:17: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.6], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) +m4trace:/usr/share/aclocal-1.11/amversion.m4:36: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +m4trace:/usr/share/aclocal-1.11/auxdir.m4:49: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) +m4trace:/usr/share/aclocal-1.11/cond.m4:15: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) +m4trace:/usr/share/aclocal-1.11/depend.m4:28: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) +m4trace:/usr/share/aclocal-1.11/depend.m4:164: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) +m4trace:/usr/share/aclocal-1.11/depend.m4:172: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) +m4trace:/usr/share/aclocal-1.11/depout.m4:14: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +]) +m4trace:/usr/share/aclocal-1.11/depout.m4:75: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) +m4trace:/usr/share/aclocal-1.11/header.m4:12: -1- AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) +m4trace:/usr/share/aclocal-1.11/header.m4:12: -1- AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete. +You should run autoupdate.])dnl +AC_CONFIG_HEADERS($@)]) +m4trace:/usr/share/aclocal-1.11/init.m4:26: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) +m4trace:/usr/share/aclocal-1.11/init.m4:126: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +m4trace:/usr/share/aclocal-1.11/install-sh.m4:14: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) +m4trace:/usr/share/aclocal-1.11/lead-dot.m4:12: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) +m4trace:/usr/share/aclocal-1.11/make.m4:14: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) +m4trace:/usr/share/aclocal-1.11/missing.m4:14: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) +m4trace:/usr/share/aclocal-1.11/missing.m4:24: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) +m4trace:/usr/share/aclocal-1.11/mkdirp.m4:14: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) +m4trace:/usr/share/aclocal-1.11/options.m4:14: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +m4trace:/usr/share/aclocal-1.11/options.m4:20: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +m4trace:/usr/share/aclocal-1.11/options.m4:26: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +m4trace:/usr/share/aclocal-1.11/options.m4:32: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +m4trace:/usr/share/aclocal-1.11/runlog.m4:14: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) +m4trace:/usr/share/aclocal-1.11/sanity.m4:14: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) +m4trace:/usr/share/aclocal-1.11/silent.m4:14: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few `make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using `$V' instead of `$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) +m4trace:/usr/share/aclocal-1.11/strip.m4:19: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +m4trace:/usr/share/aclocal-1.11/substnot.m4:14: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) +m4trace:/usr/share/aclocal-1.11/substnot.m4:19: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) +m4trace:/usr/share/aclocal-1.11/tar.m4:24: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:12: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:13: -1- AM_INIT_AUTOMAKE([TMP], [1.0]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:13: -1- AM_SET_CURRENT_AUTOMAKE_VERSION +m4trace:configure.ac:13: -1- AM_AUTOMAKE_VERSION([1.11.6]) +m4trace:configure.ac:13: -1- _AM_AUTOCONF_VERSION([2.69]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:13: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) +m4trace:configure.ac:13: -2- _AM_MANGLE_OPTION([no-define]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:13: -1- AM_SANITY_CHECK +m4trace:configure.ac:13: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.ac:13: -1- AM_MISSING_HAS_RUN +m4trace:configure.ac:13: -1- AM_AUX_DIR_EXPAND +m4trace:configure.ac:13: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:13: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:13: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:13: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:13: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:13: -1- AM_PROG_INSTALL_SH +m4trace:configure.ac:13: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:13: -1- AM_PROG_INSTALL_STRIP +m4trace:configure.ac:13: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:13: -1- AM_PROG_MKDIR_P +m4trace:configure.ac:13: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:13: -1- AM_SET_LEADING_DOT +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:13: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +m4trace:configure.ac:13: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.ac:13: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) +m4trace:configure.ac:13: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.ac:13: -1- _AM_PROG_TAR([v7]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:13: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +m4trace:configure.ac:13: -2- _AM_MANGLE_OPTION([no-dependencies]) +m4trace:configure.ac:13: -1- _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])]) +m4trace:configure.ac:13: -2- _AM_MANGLE_OPTION([silent-rules]) +m4trace:configure.ac:14: -1- AM_CONFIG_HEADER([config.h]) +m4trace:configure.ac:14: -1- _m4_warn([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete. +You should run autoupdate.], [/usr/share/aclocal-1.11/header.m4:12: AM_CONFIG_HEADER is expanded from... +configure.ac:14: the top level]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXXFLAGS$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^ac_ct_CXX$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:15: -1- _AM_DEPENDENCIES([CXX]) +m4trace:configure.ac:15: -1- AM_SET_DEPDIR +m4trace:configure.ac:15: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:15: -1- AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:15: -1- AM_MAKE_INCLUDE +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.ac:15: -1- AM_DEP_TRACK +m4trace:configure.ac:15: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__nodep$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([am__nodep]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXXDEPMODE$]) +m4trace:configure.ac:15: -1- AM_CONDITIONAL([am__fastdepCXX], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:18: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.ac:18: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:18: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:18: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:18: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:18: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:18: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:18: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:18: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) +m4trace:configure.ac:18: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS diff --git a/tmp/CodeLoop/autom4te.cache/traces.1 b/tmp/CodeLoop/autom4te.cache/traces.1 new file mode 100644 index 0000000..b08ead5 --- /dev/null +++ b/tmp/CodeLoop/autom4te.cache/traces.1 @@ -0,0 +1,353 @@ +m4trace:configure.ac:12: -1- AC_INIT([Project.ede]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:12: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:12: -1- AC_SUBST([SHELL]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:12: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:12: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:12: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:12: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:12: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:12: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:12: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PACKAGE_URL]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:12: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:12: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:12: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:12: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:12: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:12: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:12: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:12: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:12: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:12: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:12: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:12: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:12: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:12: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:12: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:12: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:12: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:12: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:12: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:12: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:12: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:12: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:12: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +@%:@undef PACKAGE_NAME]) +m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:12: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +@%:@undef PACKAGE_TARNAME]) +m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:12: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +@%:@undef PACKAGE_VERSION]) +m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:12: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +@%:@undef PACKAGE_STRING]) +m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:12: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +@%:@undef PACKAGE_BUGREPORT]) +m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:12: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ +@%:@undef PACKAGE_URL]) +m4trace:configure.ac:12: -1- AC_SUBST([DEFS]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:12: -1- AC_SUBST([ECHO_C]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:12: -1- AC_SUBST([ECHO_N]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:12: -1- AC_SUBST([ECHO_T]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:12: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:12: -1- AC_SUBST([build_alias]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:12: -1- AC_SUBST([host_alias]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:12: -1- AC_SUBST([target_alias]) +m4trace:configure.ac:12: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:13: -1- AM_INIT_AUTOMAKE([TMP], [1.0]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:13: -1- AM_AUTOMAKE_VERSION([1.11.6]) +m4trace:configure.ac:13: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:13: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:13: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:13: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:13: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([am__isrc]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:13: -1- AC_SUBST([CYGPATH_W]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([CYGPATH_W]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:13: -1- AC_SUBST([PACKAGE], [TMP]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:13: -1- AC_SUBST([VERSION], [1.0]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([VERSION]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:13: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:13: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ +@%:@undef PACKAGE]) +m4trace:configure.ac:13: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:13: -1- AH_OUTPUT([VERSION], [/* Version number of package */ +@%:@undef VERSION]) +m4trace:configure.ac:13: -1- AC_REQUIRE_AUX_FILE([missing]) +m4trace:configure.ac:13: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:13: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:13: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:13: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:13: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:13: -1- AC_SUBST([install_sh]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:13: -1- AC_SUBST([STRIP]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:13: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:13: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:13: -1- AC_SUBST([MKDIR_P]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:13: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([mkdir_p]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:13: -1- AC_SUBST([AWK]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:13: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:13: -1- AC_SUBST([am__leading_dot]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:13: -1- AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:13: -1- AC_SUBST([am__tar]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([am__tar]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:13: -1- AC_SUBST([am__untar]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([am__untar]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:14: -1- _m4_warn([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete. +You should run autoupdate.], [aclocal.m4:589: AM_CONFIG_HEADER is expanded from... +configure.ac:14: the top level]) +m4trace:configure.ac:14: -1- AC_CONFIG_HEADERS([config.h]) +m4trace:configure.ac:15: -1- AC_SUBST([CXX]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([CXX]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:15: -1- AC_SUBST([CXXFLAGS]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([CXXFLAGS]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXXFLAGS$]) +m4trace:configure.ac:15: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:15: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:15: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:15: -1- AC_SUBST([CXX]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([CXX]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:15: -1- AC_SUBST([ac_ct_CXX]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([ac_ct_CXX]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^ac_ct_CXX$]) +m4trace:configure.ac:15: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:15: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:15: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:15: -1- AC_SUBST([am__include]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:15: -1- AC_SUBST([am__quote]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([am__quote]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.ac:15: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:15: -1- AC_SUBST([AMDEP_TRUE]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([AMDEP_TRUE]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:15: -1- AC_SUBST([AMDEP_FALSE]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([AMDEP_FALSE]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:15: -1- AC_SUBST([AMDEPBACKSLASH]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:15: -1- AC_SUBST([am__nodep]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([am__nodep]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__nodep$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([am__nodep]) +m4trace:configure.ac:15: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([CXXDEPMODE]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXXDEPMODE$]) +m4trace:configure.ac:15: -1- AM_CONDITIONAL([am__fastdepCXX], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:15: -1- AC_SUBST([am__fastdepCXX_TRUE]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) +m4trace:configure.ac:15: -1- AC_SUBST([am__fastdepCXX_FALSE]) +m4trace:configure.ac:15: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:17: -1- m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +m4trace:configure.ac:17: -1- AC_SUBST([PKG_CONFIG]) +m4trace:configure.ac:17: -1- AC_SUBST_TRACE([PKG_CONFIG]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG$]) +m4trace:configure.ac:17: -1- AC_SUBST([PKG_CONFIG_PATH]) +m4trace:configure.ac:17: -1- AC_SUBST_TRACE([PKG_CONFIG_PATH]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG_PATH$]) +m4trace:configure.ac:17: -1- AC_SUBST([PKG_CONFIG_LIBDIR]) +m4trace:configure.ac:17: -1- AC_SUBST_TRACE([PKG_CONFIG_LIBDIR]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG_LIBDIR$]) +m4trace:configure.ac:17: -1- AC_SUBST([PKG_CONFIG]) +m4trace:configure.ac:17: -1- AC_SUBST_TRACE([PKG_CONFIG]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG$]) +m4trace:configure.ac:17: -1- AC_SUBST([EIGEN3_CFLAGS]) +m4trace:configure.ac:17: -1- AC_SUBST_TRACE([EIGEN3_CFLAGS]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^EIGEN3_CFLAGS$]) +m4trace:configure.ac:17: -1- AC_SUBST([EIGEN3_LIBS]) +m4trace:configure.ac:17: -1- AC_SUBST_TRACE([EIGEN3_LIBS]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^EIGEN3_LIBS$]) +m4trace:configure.ac:21: -1- AC_CONFIG_FILES([Makefile]) +m4trace:configure.ac:21: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.ac:21: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:21: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:21: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:21: -1- AC_SUBST([am__EXEEXT_TRUE]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:21: -1- AC_SUBST([am__EXEEXT_FALSE]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:21: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:21: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.ac:21: -1- AC_SUBST_TRACE([MKDIR_P]) diff --git a/tmp/CodeLoop/autom4te.cache/traces.2 b/tmp/CodeLoop/autom4te.cache/traces.2 new file mode 100644 index 0000000..5d23140 --- /dev/null +++ b/tmp/CodeLoop/autom4te.cache/traces.2 @@ -0,0 +1,887 @@ +m4trace:/usr/share/aclocal/pkg.m4:27: -1- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +]) +m4trace:/usr/share/aclocal/pkg.m4:60: -1- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) +m4trace:/usr/share/aclocal/pkg.m4:86: -1- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +]) +m4trace:/usr/share/aclocal/pkg.m4:106: -1- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +]) +m4trace:/usr/share/aclocal-1.11/amversion.m4:17: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.6], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) +m4trace:/usr/share/aclocal-1.11/amversion.m4:36: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +m4trace:/usr/share/aclocal-1.11/auxdir.m4:49: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) +m4trace:/usr/share/aclocal-1.11/cond.m4:15: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) +m4trace:/usr/share/aclocal-1.11/depend.m4:28: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) +m4trace:/usr/share/aclocal-1.11/depend.m4:164: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) +m4trace:/usr/share/aclocal-1.11/depend.m4:172: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) +m4trace:/usr/share/aclocal-1.11/depout.m4:14: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +]) +m4trace:/usr/share/aclocal-1.11/depout.m4:75: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) +m4trace:/usr/share/aclocal-1.11/header.m4:12: -1- AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) +m4trace:/usr/share/aclocal-1.11/header.m4:12: -1- AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete. +You should run autoupdate.])dnl +AC_CONFIG_HEADERS($@)]) +m4trace:/usr/share/aclocal-1.11/init.m4:26: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) +m4trace:/usr/share/aclocal-1.11/init.m4:126: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +m4trace:/usr/share/aclocal-1.11/install-sh.m4:14: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) +m4trace:/usr/share/aclocal-1.11/lead-dot.m4:12: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) +m4trace:/usr/share/aclocal-1.11/make.m4:14: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) +m4trace:/usr/share/aclocal-1.11/missing.m4:14: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) +m4trace:/usr/share/aclocal-1.11/missing.m4:24: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) +m4trace:/usr/share/aclocal-1.11/mkdirp.m4:14: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) +m4trace:/usr/share/aclocal-1.11/options.m4:14: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +m4trace:/usr/share/aclocal-1.11/options.m4:20: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +m4trace:/usr/share/aclocal-1.11/options.m4:26: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +m4trace:/usr/share/aclocal-1.11/options.m4:32: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +m4trace:/usr/share/aclocal-1.11/runlog.m4:14: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) +m4trace:/usr/share/aclocal-1.11/sanity.m4:14: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) +m4trace:/usr/share/aclocal-1.11/silent.m4:14: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few `make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using `$V' instead of `$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) +m4trace:/usr/share/aclocal-1.11/strip.m4:19: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +m4trace:/usr/share/aclocal-1.11/substnot.m4:14: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) +m4trace:/usr/share/aclocal-1.11/substnot.m4:19: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) +m4trace:/usr/share/aclocal-1.11/tar.m4:24: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:12: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:12: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:12: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:13: -1- AM_INIT_AUTOMAKE([TMP], [1.0]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:13: -1- AM_SET_CURRENT_AUTOMAKE_VERSION +m4trace:configure.ac:13: -1- AM_AUTOMAKE_VERSION([1.11.6]) +m4trace:configure.ac:13: -1- _AM_AUTOCONF_VERSION([2.69]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:13: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) +m4trace:configure.ac:13: -2- _AM_MANGLE_OPTION([no-define]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:13: -1- AM_SANITY_CHECK +m4trace:configure.ac:13: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.ac:13: -1- AM_MISSING_HAS_RUN +m4trace:configure.ac:13: -1- AM_AUX_DIR_EXPAND +m4trace:configure.ac:13: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:13: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:13: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:13: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:13: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:13: -1- AM_PROG_INSTALL_SH +m4trace:configure.ac:13: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:13: -1- AM_PROG_INSTALL_STRIP +m4trace:configure.ac:13: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:13: -1- AM_PROG_MKDIR_P +m4trace:configure.ac:13: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:13: -1- AM_SET_LEADING_DOT +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:13: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +m4trace:configure.ac:13: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.ac:13: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) +m4trace:configure.ac:13: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.ac:13: -1- _AM_PROG_TAR([v7]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:13: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +m4trace:configure.ac:13: -2- _AM_MANGLE_OPTION([no-dependencies]) +m4trace:configure.ac:13: -1- _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])]) +m4trace:configure.ac:13: -2- _AM_MANGLE_OPTION([silent-rules]) +m4trace:configure.ac:14: -1- AM_CONFIG_HEADER([config.h]) +m4trace:configure.ac:14: -1- _m4_warn([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete. +You should run autoupdate.], [/usr/share/aclocal-1.11/header.m4:12: AM_CONFIG_HEADER is expanded from... +configure.ac:14: the top level]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXXFLAGS$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^ac_ct_CXX$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:15: -1- _AM_DEPENDENCIES([CXX]) +m4trace:configure.ac:15: -1- AM_SET_DEPDIR +m4trace:configure.ac:15: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:15: -1- AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:15: -1- AM_MAKE_INCLUDE +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.ac:15: -1- AM_DEP_TRACK +m4trace:configure.ac:15: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__nodep$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([am__nodep]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^CXXDEPMODE$]) +m4trace:configure.ac:15: -1- AM_CONDITIONAL([am__fastdepCXX], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) +m4trace:configure.ac:15: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:15: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:17: -1- PKG_CHECK_MODULES([EIGEN3], [eigen3 >= 0.1]) +m4trace:configure.ac:17: -1- PKG_PROG_PKG_CONFIG +m4trace:configure.ac:17: -1- m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG$]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG_PATH$]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG_LIBDIR$]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^PKG_CONFIG$]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^EIGEN3_CFLAGS$]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^EIGEN3_LIBS$]) +m4trace:configure.ac:17: -1- PKG_CHECK_EXISTS([eigen3 >= 0.1], [pkg_cv_[]EIGEN3_CFLAGS=`$PKG_CONFIG --[]cflags "eigen3 >= 0.1" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) +m4trace:configure.ac:17: -1- PKG_CHECK_EXISTS([eigen3 >= 0.1], [pkg_cv_[]EIGEN3_LIBS=`$PKG_CONFIG --[]libs "eigen3 >= 0.1" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) +m4trace:configure.ac:17: -1- _PKG_SHORT_ERRORS_SUPPORTED +m4trace:configure.ac:21: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.ac:21: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:21: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:21: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:21: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:21: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:21: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) +m4trace:configure.ac:21: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS diff --git a/tmp/CodeLoop/cmake_install.cmake b/tmp/CodeLoop/cmake_install.cmake new file mode 100644 index 0000000..29fd0b4 --- /dev/null +++ b/tmp/CodeLoop/cmake_install.cmake @@ -0,0 +1,72 @@ +# Install script for directory: /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop + +# Set the install prefix +IF(NOT DEFINED CMAKE_INSTALL_PREFIX) + SET(CMAKE_INSTALL_PREFIX "/usr/local") +ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) +STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + IF(BUILD_TYPE) + STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + ELSE(BUILD_TYPE) + SET(CMAKE_INSTALL_CONFIG_NAME "") + ENDIF(BUILD_TYPE) + MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + +# Set the component getting installed. +IF(NOT CMAKE_INSTALL_COMPONENT) + IF(COMPONENT) + MESSAGE(STATUS "Install component: \"${COMPONENT}\"") + SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + ELSE(COMPONENT) + SET(CMAKE_INSTALL_COMPONENT) + ENDIF(COMPONENT) +ENDIF(NOT CMAKE_INSTALL_COMPONENT) + +# Install shared libraries without execute permission? +IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + SET(CMAKE_INSTALL_SO_NO_EXE "1") +ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + +IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") + IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/Tutorial" AND + NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/Tutorial") + FILE(RPATH_CHECK + FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/Tutorial" + RPATH "") + ENDIF() + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/Tutorial") + IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/Tutorial" AND + NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/Tutorial") + FILE(RPATH_REMOVE + FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/Tutorial") + IF(CMAKE_INSTALL_DO_STRIP) + EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/Tutorial") + ENDIF(CMAKE_INSTALL_DO_STRIP) + ENDIF() +ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") + +IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include/CodeLoop" TYPE DIRECTORY FILES "/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/" REGEX "/[^/]*\\.h$") +ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") + +IF(NOT CMAKE_INSTALL_LOCAL_ONLY) + # Include the install script for each subdirectory. + INCLUDE("/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/cmake_install.cmake") + +ENDIF(NOT CMAKE_INSTALL_LOCAL_ONLY) + +IF(CMAKE_INSTALL_COMPONENT) + SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +ELSE(CMAKE_INSTALL_COMPONENT) + SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +ENDIF(CMAKE_INSTALL_COMPONENT) + +FILE(WRITE "/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/${CMAKE_INSTALL_MANIFEST}" "") +FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES}) + FILE(APPEND "/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/${CMAKE_INSTALL_MANIFEST}" "${file}\n") +ENDFOREACH(file) diff --git a/tmp/CodeLoop/config.h b/tmp/CodeLoop/config.h new file mode 100644 index 0000000..dd3b02c --- /dev/null +++ b/tmp/CodeLoop/config.h @@ -0,0 +1,25 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Version number of package */ +#undef VERSION diff --git a/tmp/CodeLoop/config.h.in b/tmp/CodeLoop/config.h.in new file mode 100644 index 0000000..dd3b02c --- /dev/null +++ b/tmp/CodeLoop/config.h.in @@ -0,0 +1,25 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Version number of package */ +#undef VERSION diff --git a/tmp/CodeLoop/config.log b/tmp/CodeLoop/config.log new file mode 100644 index 0000000..026c478 --- /dev/null +++ b/tmp/CodeLoop/config.log @@ -0,0 +1,334 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by configure, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ ./configure + +## --------- ## +## Platform. ## +## --------- ## + +hostname = musteel +uname -m = x86_64 +uname -r = 3.2.0-1-amd64 +uname -s = Linux +uname -v = #1 SMP Fri Feb 17 05:17:36 UTC 2012 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +/usr/bin/hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: /usr/local/bin +PATH: /usr/bin +PATH: /bin +PATH: /usr/local/games +PATH: /usr/games + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:1837: checking for a BSD-compatible install +configure:1905: result: /usr/bin/install -c +configure:1916: checking whether build environment is sane +configure:1966: result: yes +configure:2107: checking for a thread-safe mkdir -p +configure:2146: result: /bin/mkdir -p +configure:2159: checking for gawk +configure:2175: found /usr/bin/gawk +configure:2186: result: gawk +configure:2197: checking whether make sets $(MAKE) +configure:2219: result: yes +configure:2359: checking for g++ +configure:2375: found /usr/bin/g++ +configure:2386: result: g++ +configure:2413: checking for C++ compiler version +configure:2422: g++ --version >&5 +g++ (Debian 4.7.2-4) 4.7.2 +Copyright (C) 2012 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:2433: $? = 0 +configure:2422: g++ -v >&5 +Using built-in specs. +COLLECT_GCC=g++ +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-4' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 4.7.2 (Debian 4.7.2-4) +configure:2433: $? = 0 +configure:2422: g++ -V >&5 +g++: error: unrecognized command line option '-V' +g++: fatal error: no input files +compilation terminated. +configure:2433: $? = 4 +configure:2422: g++ -qversion >&5 +g++: error: unrecognized command line option '-qversion' +g++: fatal error: no input files +compilation terminated. +configure:2433: $? = 4 +configure:2453: checking whether the C++ compiler works +configure:2475: g++ conftest.cpp >&5 +configure:2479: $? = 0 +configure:2527: result: yes +configure:2530: checking for C++ compiler default output file name +configure:2532: result: a.out +configure:2538: checking for suffix of executables +configure:2545: g++ -o conftest conftest.cpp >&5 +configure:2549: $? = 0 +configure:2571: result: +configure:2593: checking whether we are cross compiling +configure:2601: g++ -o conftest conftest.cpp >&5 +configure:2605: $? = 0 +configure:2612: ./conftest +configure:2616: $? = 0 +configure:2631: result: no +configure:2636: checking for suffix of object files +configure:2658: g++ -c conftest.cpp >&5 +configure:2662: $? = 0 +configure:2683: result: o +configure:2687: checking whether we are using the GNU C++ compiler +configure:2706: g++ -c conftest.cpp >&5 +configure:2706: $? = 0 +configure:2715: result: yes +configure:2724: checking whether g++ accepts -g +configure:2744: g++ -c -g conftest.cpp >&5 +configure:2744: $? = 0 +configure:2785: result: yes +configure:2819: checking for style of include used by make +configure:2847: result: GNU +configure:2873: checking dependency style of g++ +configure:2984: result: gcc3 +configure:3054: checking for pkg-config +configure:3072: found /usr/bin/pkg-config +configure:3084: result: /usr/bin/pkg-config +configure:3109: checking pkg-config is at least version 0.9.0 +configure:3112: result: yes +configure:3122: checking for EIGEN3 +configure:3129: $PKG_CONFIG --exists --print-errors "eigen3 >= 0.1" +configure:3132: $? = 0 +configure:3146: $PKG_CONFIG --exists --print-errors "eigen3 >= 0.1" +configure:3149: $? = 0 +configure:3207: result: yes +configure:3348: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by config.status, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on musteel + +config.status:841: creating Makefile +config.status:841: creating config.h +config.status:1070: executing depfiles commands +config.status:1070: executing default commands + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_cxx_compiler_gnu=yes +ac_cv_env_CCC_set= +ac_cv_env_CCC_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CXXFLAGS_set= +ac_cv_env_CXXFLAGS_value= +ac_cv_env_CXX_set= +ac_cv_env_CXX_value= +ac_cv_env_EIGEN3_CFLAGS_set= +ac_cv_env_EIGEN3_CFLAGS_value= +ac_cv_env_EIGEN3_LIBS_set= +ac_cv_env_EIGEN3_LIBS_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_PKG_CONFIG_LIBDIR_set= +ac_cv_env_PKG_CONFIG_LIBDIR_value= +ac_cv_env_PKG_CONFIG_PATH_set= +ac_cv_env_PKG_CONFIG_PATH_value= +ac_cv_env_PKG_CONFIG_set= +ac_cv_env_PKG_CONFIG_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_objext=o +ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config +ac_cv_path_install='/usr/bin/install -c' +ac_cv_path_mkdir=/bin/mkdir +ac_cv_prog_AWK=gawk +ac_cv_prog_ac_ct_CXX=g++ +ac_cv_prog_cxx_g=yes +ac_cv_prog_make_make_set=yes +am_cv_CXX_dependencies_compiler_type=gcc3 +pkg_cv_EIGEN3_CFLAGS='-I/usr/local/include/eigen3 ' +pkg_cv_EIGEN3_LIBS=' ' + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +ACLOCAL='${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/missing --run aclocal-1.11' +AMDEPBACKSLASH='\' +AMDEP_FALSE='#' +AMDEP_TRUE='' +AMTAR='$${TAR-tar}' +AUTOCONF='${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/missing --run autoconf' +AUTOHEADER='${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/missing --run autoheader' +AUTOMAKE='${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/missing --run automake-1.11' +AWK='gawk' +CPPFLAGS='' +CXX='g++' +CXXDEPMODE='depmode=gcc3' +CXXFLAGS='-g -O2' +CYGPATH_W='echo' +DEFS='-DHAVE_CONFIG_H' +DEPDIR='.deps' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EIGEN3_CFLAGS='-I/usr/local/include/eigen3 ' +EIGEN3_LIBS=' ' +EXEEXT='' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' +LDFLAGS='' +LIBOBJS='' +LIBS='' +LTLIBOBJS='' +MAKEINFO='${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/missing --run makeinfo' +MKDIR_P='/bin/mkdir -p' +OBJEXT='o' +PACKAGE='TMP' +PACKAGE_BUGREPORT='' +PACKAGE_NAME='' +PACKAGE_STRING='' +PACKAGE_TARNAME='' +PACKAGE_URL='' +PACKAGE_VERSION='' +PATH_SEPARATOR=':' +PKG_CONFIG='/usr/bin/pkg-config' +PKG_CONFIG_LIBDIR='' +PKG_CONFIG_PATH='' +SET_MAKE='' +SHELL='/bin/bash' +STRIP='' +VERSION='1.0' +ac_ct_CXX='g++' +am__EXEEXT_FALSE='' +am__EXEEXT_TRUE='#' +am__fastdepCXX_FALSE='#' +am__fastdepCXX_TRUE='' +am__include='include' +am__isrc='' +am__leading_dot='.' +am__nodep='_no' +am__quote='' +am__tar='$${TAR-tar} chof - "$$tardir"' +am__untar='$${TAR-tar} xf -' +bindir='${exec_prefix}/bin' +build_alias='' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +docdir='${datarootdir}/doc/${PACKAGE}' +dvidir='${docdir}' +exec_prefix='${prefix}' +host_alias='' +htmldir='${docdir}' +includedir='${prefix}/include' +infodir='${datarootdir}/info' +install_sh='${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/install-sh' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +mandir='${datarootdir}/man' +mkdir_p='/bin/mkdir -p' +oldincludedir='/usr/include' +pdfdir='${docdir}' +prefix='/usr/local' +program_transform_name='s,x,x,' +psdir='${docdir}' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target_alias='' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +/* confdefs.h */ +#define PACKAGE_NAME "" +#define PACKAGE_TARNAME "" +#define PACKAGE_VERSION "" +#define PACKAGE_STRING "" +#define PACKAGE_BUGREPORT "" +#define PACKAGE_URL "" +#define PACKAGE "TMP" +#define VERSION "1.0" + +configure: exit 0 + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by config.status, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status Makefile depfiles + +on musteel + +config.status:841: creating Makefile +config.status:1070: executing depfiles commands + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by config.status, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status config.h + +on musteel + +config.status:841: creating config.h +config.status:1022: config.h is unchanged diff --git a/tmp/CodeLoop/config.status b/tmp/CodeLoop/config.status new file mode 100755 index 0000000..ca1c793 --- /dev/null +++ b/tmp/CodeLoop/config.status @@ -0,0 +1,1178 @@ +#! /bin/bash +# Generated by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=${CONFIG_SHELL-/bin/bash} +export SHELL +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +# Files that config.status was made for. +config_files=" Makefile" +config_headers=" config.h" +config_commands=" depfiles default" + +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +ac_cs_config="" +ac_cs_version="\ +config.status +configured by ./configure, generated by GNU Autoconf 2.69, + with options \"$ac_cs_config\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='/home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop' +srcdir='.' +INSTALL='/usr/bin/install -c' +MKDIR_P='/bin/mkdir -p' +AWK='gawk' +test -n "$AWK" || AWK=awk +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +if $ac_cs_recheck; then + set X /bin/bash './configure' $ac_configure_extra_args --no-create --no-recursion + shift + $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 + CONFIG_SHELL='/bin/bash' + export CONFIG_SHELL + exec "$@" +fi + +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +# +# INIT-COMMANDS +# +AMDEP_TRUE="" ac_aux_dir="." + + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +cat >>"$ac_tmp/subs1.awk" <<\_ACAWK && +S["am__EXEEXT_FALSE"]="" +S["am__EXEEXT_TRUE"]="#" +S["LTLIBOBJS"]="" +S["LIBOBJS"]="" +S["EIGEN3_LIBS"]=" " +S["EIGEN3_CFLAGS"]="-I/usr/local/include/eigen3 " +S["PKG_CONFIG_LIBDIR"]="" +S["PKG_CONFIG_PATH"]="" +S["PKG_CONFIG"]="/usr/bin/pkg-config" +S["am__fastdepCXX_FALSE"]="#" +S["am__fastdepCXX_TRUE"]="" +S["CXXDEPMODE"]="depmode=gcc3" +S["am__nodep"]="_no" +S["AMDEPBACKSLASH"]="\\" +S["AMDEP_FALSE"]="#" +S["AMDEP_TRUE"]="" +S["am__quote"]="" +S["am__include"]="include" +S["DEPDIR"]=".deps" +S["OBJEXT"]="o" +S["EXEEXT"]="" +S["ac_ct_CXX"]="g++" +S["CPPFLAGS"]="" +S["LDFLAGS"]="" +S["CXXFLAGS"]="-g -O2" +S["CXX"]="g++" +S["am__untar"]="$${TAR-tar} xf -" +S["am__tar"]="$${TAR-tar} chof - \"$$tardir\"" +S["AMTAR"]="$${TAR-tar}" +S["am__leading_dot"]="." +S["SET_MAKE"]="" +S["AWK"]="gawk" +S["mkdir_p"]="/bin/mkdir -p" +S["MKDIR_P"]="/bin/mkdir -p" +S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" +S["STRIP"]="" +S["install_sh"]="${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/install-sh" +S["MAKEINFO"]="${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/missing --run makeinfo" +S["AUTOHEADER"]="${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/missing --run autoheader" +S["AUTOMAKE"]="${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/missing --run automake-1.11" +S["AUTOCONF"]="${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/missing --run autoconf" +S["ACLOCAL"]="${SHELL} /home/rigoni/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/missing --run aclocal-1.11" +S["VERSION"]="1.0" +S["PACKAGE"]="TMP" +S["CYGPATH_W"]="echo" +S["am__isrc"]="" +S["INSTALL_DATA"]="${INSTALL} -m 644" +S["INSTALL_SCRIPT"]="${INSTALL}" +S["INSTALL_PROGRAM"]="${INSTALL}" +S["target_alias"]="" +S["host_alias"]="" +S["build_alias"]="" +S["LIBS"]="" +S["ECHO_T"]="" +S["ECHO_N"]="-n" +S["ECHO_C"]="" +S["DEFS"]="-DHAVE_CONFIG_H" +S["mandir"]="${datarootdir}/man" +S["localedir"]="${datarootdir}/locale" +S["libdir"]="${exec_prefix}/lib" +S["psdir"]="${docdir}" +S["pdfdir"]="${docdir}" +S["dvidir"]="${docdir}" +S["htmldir"]="${docdir}" +S["infodir"]="${datarootdir}/info" +S["docdir"]="${datarootdir}/doc/${PACKAGE}" +S["oldincludedir"]="/usr/include" +S["includedir"]="${prefix}/include" +S["localstatedir"]="${prefix}/var" +S["sharedstatedir"]="${prefix}/com" +S["sysconfdir"]="${prefix}/etc" +S["datadir"]="${datarootdir}" +S["datarootdir"]="${prefix}/share" +S["libexecdir"]="${exec_prefix}/libexec" +S["sbindir"]="${exec_prefix}/sbin" +S["bindir"]="${exec_prefix}/bin" +S["program_transform_name"]="s,x,x," +S["prefix"]="/usr/local" +S["exec_prefix"]="${prefix}" +S["PACKAGE_URL"]="" +S["PACKAGE_BUGREPORT"]="" +S["PACKAGE_STRING"]="" +S["PACKAGE_VERSION"]="" +S["PACKAGE_TARNAME"]="" +S["PACKAGE_NAME"]="" +S["PATH_SEPARATOR"]=":" +S["SHELL"]="/bin/bash" +_ACAWK +cat >>"$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +D["PACKAGE_NAME"]=" \"\"" +D["PACKAGE_TARNAME"]=" \"\"" +D["PACKAGE_VERSION"]=" \"\"" +D["PACKAGE_STRING"]=" \"\"" +D["PACKAGE_BUGREPORT"]=" \"\"" +D["PACKAGE_URL"]=" \"\"" +D["PACKAGE"]=" \"TMP\"" +D["VERSION"]=" \"1.0\"" + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ { + line = $ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + ac_datarootdir_hack=' + s&@datadir@&${datarootdir}&g + s&@docdir@&${datarootdir}/doc/${PACKAGE}&g + s&@infodir@&${datarootdir}/info&g + s&@localedir@&${datarootdir}/locale&g + s&@mandir@&${datarootdir}/man&g + s&\${datarootdir}&${prefix}/share&g' ;; +esac +ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +} + +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "default":C) date > stamp-h ;; + + esac +done # for ac_tag + + +as_fn_exit 0 diff --git a/tmp/CodeLoop/configure b/tmp/CodeLoop/configure new file mode 100755 index 0000000..ee77073 --- /dev/null +++ b/tmp/CodeLoop/configure @@ -0,0 +1,4667 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="Project.ede" +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +EIGEN3_LIBS +EIGEN3_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CXX +CPPFLAGS +LDFLAGS +CXXFLAGS +CXX +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +' + ac_precious_vars='build_alias +host_alias +target_alias +CXX +CXXFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCC +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +EIGEN3_CFLAGS +EIGEN3_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + EIGEN3_CFLAGS + C compiler flags for EIGEN3, overriding pkg-config + EIGEN3_LIBS linker flags for EIGEN3, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=TMP + VERSION=1.0 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + +ac_config_headers="$ac_config_headers config.h" + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 +$as_echo_n "checking whether the C++ compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C++ compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 +$as_echo_n "checking for C++ compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EIGEN3" >&5 +$as_echo_n "checking for EIGEN3... " >&6; } + +if test -n "$EIGEN3_CFLAGS"; then + pkg_cv_EIGEN3_CFLAGS="$EIGEN3_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"eigen3 >= 0.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "eigen3 >= 0.1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_EIGEN3_CFLAGS=`$PKG_CONFIG --cflags "eigen3 >= 0.1" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$EIGEN3_LIBS"; then + pkg_cv_EIGEN3_LIBS="$EIGEN3_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"eigen3 >= 0.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "eigen3 >= 0.1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_EIGEN3_LIBS=`$PKG_CONFIG --libs "eigen3 >= 0.1" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + EIGEN3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "eigen3 >= 0.1" 2>&1` + else + EIGEN3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "eigen3 >= 0.1" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$EIGEN3_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (eigen3 >= 0.1) were not met: + +$EIGEN3_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables EIGEN3_CFLAGS +and EIGEN3_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables EIGEN3_CFLAGS +and EIGEN3_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + EIGEN3_CFLAGS=$pkg_cv_EIGEN3_CFLAGS + EIGEN3_LIBS=$pkg_cv_EIGEN3_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + +# End the configure script. +ac_config_files="$ac_config_files Makefile" + +ac_config_commands="$ac_config_commands default" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "default":C) date > stamp-h ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/tmp/CodeLoop/configure.ac b/tmp/CodeLoop/configure.ac new file mode 100644 index 0000000..9113d82 --- /dev/null +++ b/tmp/CodeLoop/configure.ac @@ -0,0 +1,21 @@ +# Automatically Generated/Maintained by EDE. +# +# YOU MAY MODIFY THIS FILE +# Hand made changes in some sections will be preserved +# by EDE when this file is updated. +# +# EDE is the Emacs Development Environment. +# http://cedet.sourceforge.net/ede.shtml +# +# Process this file with autoconf to produce a configure script + +AC_INIT(Project.ede) +AM_INIT_AUTOMAKE([TMP], [1.0]) +AM_CONFIG_HEADER(config.h) +AC_PROG_CXX + +PKG_CHECK_MODULES([EIGEN3],[eigen3 >= 0.1]) + + +# End the configure script. +AC_OUTPUT(Makefile, [date > stamp-h] ) diff --git a/tmp/CodeLoop/depcomp b/tmp/CodeLoop/depcomp new file mode 100644 index 0000000..25a39e6 --- /dev/null +++ b/tmp/CodeLoop/depcomp @@ -0,0 +1,708 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2012-03-27.16; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 2011, 2012 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) +# 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, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependent.h'. + # Do two passes, one to just change these to + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\': + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. + # Do two passes, one to just change these to + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' "$nl" < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/tmp/CodeLoop/install-sh b/tmp/CodeLoop/install-sh new file mode 100644 index 0000000..a9244eb --- /dev/null +++ b/tmp/CodeLoop/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-01-19.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for `test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/tmp/CodeLoop/loop b/tmp/CodeLoop/loop new file mode 100755 index 0000000..055bfe0 Binary files /dev/null and b/tmp/CodeLoop/loop differ diff --git a/tmp/CodeLoop/main.cpp b/tmp/CodeLoop/main.cpp new file mode 100644 index 0000000..a0fbca9 --- /dev/null +++ b/tmp/CodeLoop/main.cpp @@ -0,0 +1,39 @@ +#include + + +#include +#include +#include +#include + +#include + +#include "src/ManageFilename.h" +#include "src/Test.h" + +int main() +{ + + Eigen::Vector2f v2(0,2); + + vtkRenderWindow *window = vtkRenderWindow::New(); + vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); + vtkRenderer *renderer = vtkRenderer::New(); + + + window->AddRenderer(renderer); + iren->SetRenderWindow(window); + + std::string filname = "test.vtk"; + + // std::cout << ManageFilename::GetFileName(filname) << "\n"; + TestFilename test("test.vtk"); + test.PrintName(); + test.PrintExtension(); + + //iren->Start(); + renderer->Delete(); + window->Delete(); + iren->Delete(); + return 0; +} diff --git a/tmp/CodeLoop/missing b/tmp/CodeLoop/missing new file mode 100644 index 0000000..86a8fc3 --- /dev/null +++ b/tmp/CodeLoop/missing @@ -0,0 +1,331 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2012-01-06.13; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# 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) +# 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, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/tmp/CodeLoop/src/CMakeFiles/CMakeDirectoryInformation.cmake b/tmp/CodeLoop/src/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..35fda3e --- /dev/null +++ b/tmp/CodeLoop/src/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +# Relative path conversion top directories. +SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop") +SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop") + +# Force unix paths in dependencies. +SET(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +SET(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +SET(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +SET(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +SET(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/CXX.includecache b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/CXX.includecache new file mode 100644 index 0000000..312ad35 --- /dev/null +++ b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/CXX.includecache @@ -0,0 +1,30 @@ +#IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/ManageFilename.cpp +ManageFilename.h +/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/ManageFilename.h + +/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/ManageFilename.h +string +- +iostream +- + +/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/Test.cpp +iostream +- +Test.h +/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/Test.h + +/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/Test.h +string +- +ManageFilename.h +/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/ManageFilename.h + diff --git a/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/DependInfo.cmake b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/DependInfo.cmake new file mode 100644 index 0000000..c9d75ca --- /dev/null +++ b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/DependInfo.cmake @@ -0,0 +1,24 @@ +# The set of languages for which implicit dependencies are needed: +SET(CMAKE_DEPENDS_LANGUAGES + "CXX" + ) +# The set of files for implicit dependencies of each language: +SET(CMAKE_DEPENDS_CHECK_CXX + "/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/ManageFilename.cpp" "/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o" + "/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/Test.cpp" "/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/Test.cpp.o" + ) +SET(CMAKE_CXX_COMPILER_ID "GNU") + +# Targets to which this target links. +SET(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# The include file search paths: +SET(CMAKE_C_TARGET_INCLUDE_PATH + "." + "/usr/local/include/vtk-5.10" + "src" + ) +SET(CMAKE_CXX_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) +SET(CMAKE_Fortran_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) +SET(CMAKE_ASM_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) diff --git a/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/build.make b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/build.make new file mode 100644 index 0000000..c525a2c --- /dev/null +++ b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/build.make @@ -0,0 +1,131 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The program to use to edit the cache. +CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop + +# Include any dependencies generated for this target. +include src/CMakeFiles/ManageFilename.dir/depend.make + +# Include the progress variables for this target. +include src/CMakeFiles/ManageFilename.dir/progress.make + +# Include the compile flags for this target's objects. +include src/CMakeFiles/ManageFilename.dir/flags.make + +src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o: src/CMakeFiles/ManageFilename.dir/flags.make +src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o: src/ManageFilename.cpp + $(CMAKE_COMMAND) -E cmake_progress_report /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/CMakeFiles $(CMAKE_PROGRESS_1) + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o" + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o -c /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/ManageFilename.cpp + +src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/ManageFilename.dir/ManageFilename.cpp.i" + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -E /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/ManageFilename.cpp > CMakeFiles/ManageFilename.dir/ManageFilename.cpp.i + +src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/ManageFilename.dir/ManageFilename.cpp.s" + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -S /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/ManageFilename.cpp -o CMakeFiles/ManageFilename.dir/ManageFilename.cpp.s + +src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o.requires: +.PHONY : src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o.requires + +src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o.provides: src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o.requires + $(MAKE) -f src/CMakeFiles/ManageFilename.dir/build.make src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o.provides.build +.PHONY : src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o.provides + +src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o.provides.build: src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o + +src/CMakeFiles/ManageFilename.dir/Test.cpp.o: src/CMakeFiles/ManageFilename.dir/flags.make +src/CMakeFiles/ManageFilename.dir/Test.cpp.o: src/Test.cpp + $(CMAKE_COMMAND) -E cmake_progress_report /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/CMakeFiles $(CMAKE_PROGRESS_2) + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object src/CMakeFiles/ManageFilename.dir/Test.cpp.o" + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/ManageFilename.dir/Test.cpp.o -c /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/Test.cpp + +src/CMakeFiles/ManageFilename.dir/Test.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/ManageFilename.dir/Test.cpp.i" + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -E /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/Test.cpp > CMakeFiles/ManageFilename.dir/Test.cpp.i + +src/CMakeFiles/ManageFilename.dir/Test.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/ManageFilename.dir/Test.cpp.s" + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -S /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/Test.cpp -o CMakeFiles/ManageFilename.dir/Test.cpp.s + +src/CMakeFiles/ManageFilename.dir/Test.cpp.o.requires: +.PHONY : src/CMakeFiles/ManageFilename.dir/Test.cpp.o.requires + +src/CMakeFiles/ManageFilename.dir/Test.cpp.o.provides: src/CMakeFiles/ManageFilename.dir/Test.cpp.o.requires + $(MAKE) -f src/CMakeFiles/ManageFilename.dir/build.make src/CMakeFiles/ManageFilename.dir/Test.cpp.o.provides.build +.PHONY : src/CMakeFiles/ManageFilename.dir/Test.cpp.o.provides + +src/CMakeFiles/ManageFilename.dir/Test.cpp.o.provides.build: src/CMakeFiles/ManageFilename.dir/Test.cpp.o + +# Object files for target ManageFilename +ManageFilename_OBJECTS = \ +"CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o" \ +"CMakeFiles/ManageFilename.dir/Test.cpp.o" + +# External object files for target ManageFilename +ManageFilename_EXTERNAL_OBJECTS = + +src/libManageFilename.so: src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o +src/libManageFilename.so: src/CMakeFiles/ManageFilename.dir/Test.cpp.o +src/libManageFilename.so: src/CMakeFiles/ManageFilename.dir/build.make +src/libManageFilename.so: src/CMakeFiles/ManageFilename.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold "Linking CXX shared library libManageFilename.so" + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/ManageFilename.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +src/CMakeFiles/ManageFilename.dir/build: src/libManageFilename.so +.PHONY : src/CMakeFiles/ManageFilename.dir/build + +src/CMakeFiles/ManageFilename.dir/requires: src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o.requires +src/CMakeFiles/ManageFilename.dir/requires: src/CMakeFiles/ManageFilename.dir/Test.cpp.o.requires +.PHONY : src/CMakeFiles/ManageFilename.dir/requires + +src/CMakeFiles/ManageFilename.dir/clean: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src && $(CMAKE_COMMAND) -P CMakeFiles/ManageFilename.dir/cmake_clean.cmake +.PHONY : src/CMakeFiles/ManageFilename.dir/clean + +src/CMakeFiles/ManageFilename.dir/depend: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : src/CMakeFiles/ManageFilename.dir/depend + diff --git a/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/cmake_clean.cmake b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/cmake_clean.cmake new file mode 100644 index 0000000..1856af2 --- /dev/null +++ b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/cmake_clean.cmake @@ -0,0 +1,11 @@ +FILE(REMOVE_RECURSE + "CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o" + "CMakeFiles/ManageFilename.dir/Test.cpp.o" + "libManageFilename.pdb" + "libManageFilename.so" +) + +# Per-language clean rules from dependency scanning. +FOREACH(lang CXX) + INCLUDE(CMakeFiles/ManageFilename.dir/cmake_clean_${lang}.cmake OPTIONAL) +ENDFOREACH(lang) diff --git a/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/depend.internal b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/depend.internal new file mode 100644 index 0000000..64b17e1 --- /dev/null +++ b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/depend.internal @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o + /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/ManageFilename.cpp + /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/ManageFilename.h +src/CMakeFiles/ManageFilename.dir/Test.cpp.o + /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/ManageFilename.h + /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/Test.cpp + /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/Test.h diff --git a/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/depend.make b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/depend.make new file mode 100644 index 0000000..2fe2110 --- /dev/null +++ b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/depend.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o: src/ManageFilename.cpp +src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o: src/ManageFilename.h + +src/CMakeFiles/ManageFilename.dir/Test.cpp.o: src/ManageFilename.h +src/CMakeFiles/ManageFilename.dir/Test.cpp.o: src/Test.cpp +src/CMakeFiles/ManageFilename.dir/Test.cpp.o: src/Test.h + diff --git a/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/flags.make b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/flags.make new file mode 100644 index 0000000..bac94d2 --- /dev/null +++ b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/flags.make @@ -0,0 +1,8 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +# compile CXX with /usr/bin/c++ +CXX_FLAGS = -Wno-deprecated -fPIC -I/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop -I/usr/local/include/vtk-5.10 -I/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src + +CXX_DEFINES = -DManageFilename_EXPORTS + diff --git a/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/link.txt b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/link.txt new file mode 100644 index 0000000..3739da2 --- /dev/null +++ b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/link.txt @@ -0,0 +1 @@ +/usr/bin/c++ -fPIC -Wno-deprecated -shared -Wl,-soname,libManageFilename.so -o libManageFilename.so CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o CMakeFiles/ManageFilename.dir/Test.cpp.o diff --git a/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/progress.make b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/progress.make new file mode 100644 index 0000000..abadeb0 --- /dev/null +++ b/tmp/CodeLoop/src/CMakeFiles/ManageFilename.dir/progress.make @@ -0,0 +1,3 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 + diff --git a/tmp/CodeLoop/src/CMakeFiles/progress.marks b/tmp/CodeLoop/src/CMakeFiles/progress.marks new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tmp/CodeLoop/src/CMakeFiles/progress.marks @@ -0,0 +1 @@ +2 diff --git a/tmp/CodeLoop/src/CMakeLists.txt b/tmp/CodeLoop/src/CMakeLists.txt new file mode 100644 index 0000000..d259315 --- /dev/null +++ b/tmp/CodeLoop/src/CMakeLists.txt @@ -0,0 +1,14 @@ + +set( Kit_SRCS +ManageFilename.cpp +Test.cpp +) + + +add_library(ManageFilename SHARED ${Kit_SRCS}) + +install(TARGETS ManageFilename + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static) + diff --git a/tmp/CodeLoop/src/Makefile b/tmp/CodeLoop/src/Makefile new file mode 100644 index 0000000..a0fc185 --- /dev/null +++ b/tmp/CodeLoop/src/Makefile @@ -0,0 +1,239 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The program to use to edit the cache. +CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/cmake-gui -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: install/local +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: install/strip +.PHONY : install/strip/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components +.PHONY : list_install_components/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(CMAKE_COMMAND) -E cmake_progress_start /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/CMakeFiles /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/CMakeFiles/progress.marks + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f CMakeFiles/Makefile2 src/all + $(CMAKE_COMMAND) -E cmake_progress_start /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f CMakeFiles/Makefile2 src/clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Convenience name for target. +src/CMakeFiles/ManageFilename.dir/rule: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/ManageFilename.dir/rule +.PHONY : src/CMakeFiles/ManageFilename.dir/rule + +# Convenience name for target. +ManageFilename: src/CMakeFiles/ManageFilename.dir/rule +.PHONY : ManageFilename + +# fast build rule for target. +ManageFilename/fast: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f src/CMakeFiles/ManageFilename.dir/build.make src/CMakeFiles/ManageFilename.dir/build +.PHONY : ManageFilename/fast + +ManageFilename.o: ManageFilename.cpp.o +.PHONY : ManageFilename.o + +# target to build an object file +ManageFilename.cpp.o: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f src/CMakeFiles/ManageFilename.dir/build.make src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.o +.PHONY : ManageFilename.cpp.o + +ManageFilename.i: ManageFilename.cpp.i +.PHONY : ManageFilename.i + +# target to preprocess a source file +ManageFilename.cpp.i: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f src/CMakeFiles/ManageFilename.dir/build.make src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.i +.PHONY : ManageFilename.cpp.i + +ManageFilename.s: ManageFilename.cpp.s +.PHONY : ManageFilename.s + +# target to generate assembly for a file +ManageFilename.cpp.s: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f src/CMakeFiles/ManageFilename.dir/build.make src/CMakeFiles/ManageFilename.dir/ManageFilename.cpp.s +.PHONY : ManageFilename.cpp.s + +Test.o: Test.cpp.o +.PHONY : Test.o + +# target to build an object file +Test.cpp.o: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f src/CMakeFiles/ManageFilename.dir/build.make src/CMakeFiles/ManageFilename.dir/Test.cpp.o +.PHONY : Test.cpp.o + +Test.i: Test.cpp.i +.PHONY : Test.i + +# target to preprocess a source file +Test.cpp.i: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f src/CMakeFiles/ManageFilename.dir/build.make src/CMakeFiles/ManageFilename.dir/Test.cpp.i +.PHONY : Test.cpp.i + +Test.s: Test.cpp.s +.PHONY : Test.s + +# target to generate assembly for a file +Test.cpp.s: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(MAKE) -f src/CMakeFiles/ManageFilename.dir/build.make src/CMakeFiles/ManageFilename.dir/Test.cpp.s +.PHONY : Test.cpp.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... ManageFilename" + @echo "... edit_cache" + @echo "... install" + @echo "... install/local" + @echo "... install/strip" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... ManageFilename.o" + @echo "... ManageFilename.i" + @echo "... ManageFilename.s" + @echo "... Test.o" + @echo "... Test.i" + @echo "... Test.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/tmp/CodeLoop/src/ManageFilename.cpp b/tmp/CodeLoop/src/ManageFilename.cpp new file mode 100644 index 0000000..836ad43 --- /dev/null +++ b/tmp/CodeLoop/src/ManageFilename.cpp @@ -0,0 +1,19 @@ + +#include "ManageFilename.h" + + + +std::string ManageFilename::GetFileExtension(const std::string& FileName) +{ + if(FileName.find_last_of(".") != std::string::npos) + return FileName.substr(FileName.find_last_of(".")+1); + return ""; +} + +std::string ManageFilename::GetFileName(const std::string& FileName) +{ + if(FileName.find_last_of(".") != std::string::npos) + return FileName.substr(0,FileName.find_last_of(".")); + return ""; +} + diff --git a/tmp/CodeLoop/src/ManageFilename.h b/tmp/CodeLoop/src/ManageFilename.h new file mode 100644 index 0000000..990aae4 --- /dev/null +++ b/tmp/CodeLoop/src/ManageFilename.h @@ -0,0 +1,24 @@ +#ifndef MANAGEFILENAME_H +#define MANAGEFILENAME_H + +#include +#include + + + +class ManageFilename { + +public: + static std::string GetFileExtension(const std::string& FileName); + + static std::string GetFileName(const std::string& FileName); + + +}; + + + + + + +#endif // MANAGEFILENAME_H diff --git a/tmp/CodeLoop/src/SourceLists.txt b/tmp/CodeLoop/src/SourceLists.txt new file mode 100644 index 0000000..221c85d --- /dev/null +++ b/tmp/CodeLoop/src/SourceLists.txt @@ -0,0 +1,8 @@ + + +HEADERS = ManageFilename.h \ + Test.h + + +SOURCES = ManageFilename.cpp \ + Test.cpp diff --git a/tmp/CodeLoop/src/Test.cpp b/tmp/CodeLoop/src/Test.cpp new file mode 100644 index 0000000..225fa92 --- /dev/null +++ b/tmp/CodeLoop/src/Test.cpp @@ -0,0 +1,17 @@ +#include +#include "Test.h" + + +using namespace std; + +void TestFilename::PrintName() +{ + cout << "Filename is: "; + cout << ManageFilename::GetFileName(this->m_string) << "\n"; +} + +void TestFilename::PrintExtension() +{ + cout << "Fileexten is: "; + cout << ManageFilename::GetFileExtension(this->m_string) << "\n"; +} diff --git a/tmp/CodeLoop/src/Test.h b/tmp/CodeLoop/src/Test.h new file mode 100644 index 0000000..a945ae7 --- /dev/null +++ b/tmp/CodeLoop/src/Test.h @@ -0,0 +1,24 @@ +#ifndef TEST_H +#define TEST_H + +#include + +#include "ManageFilename.h" + +class TestFilename { + +public: + TestFilename( const char *str) + : m_string(str) + {} + + void PrintName(); + + void PrintExtension(); + + + std::string m_string; +}; + + +#endif // TEST_H diff --git a/tmp/CodeLoop/src/cmake_install.cmake b/tmp/CodeLoop/src/cmake_install.cmake new file mode 100644 index 0000000..cf6abcd --- /dev/null +++ b/tmp/CodeLoop/src/cmake_install.cmake @@ -0,0 +1,50 @@ +# Install script for directory: /home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src + +# Set the install prefix +IF(NOT DEFINED CMAKE_INSTALL_PREFIX) + SET(CMAKE_INSTALL_PREFIX "/usr/local") +ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) +STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + IF(BUILD_TYPE) + STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + ELSE(BUILD_TYPE) + SET(CMAKE_INSTALL_CONFIG_NAME "") + ENDIF(BUILD_TYPE) + MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + +# Set the component getting installed. +IF(NOT CMAKE_INSTALL_COMPONENT) + IF(COMPONENT) + MESSAGE(STATUS "Install component: \"${COMPONENT}\"") + SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + ELSE(COMPONENT) + SET(CMAKE_INSTALL_COMPONENT) + ENDIF(COMPONENT) +ENDIF(NOT CMAKE_INSTALL_COMPONENT) + +# Install shared libraries without execute permission? +IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + SET(CMAKE_INSTALL_SO_NO_EXE "1") +ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + +IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") + IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libManageFilename.so" AND + NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libManageFilename.so") + FILE(RPATH_CHECK + FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libManageFilename.so" + RPATH "") + ENDIF() + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY FILES "/home/etjazz/devel/mutom/uLib/branches/paraview/tmp/CodeLoop/src/libManageFilename.so") + IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libManageFilename.so" AND + NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libManageFilename.so") + IF(CMAKE_INSTALL_DO_STRIP) + EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libManageFilename.so") + ENDIF(CMAKE_INSTALL_DO_STRIP) + ENDIF() +ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") + diff --git a/tmp/CodeLoop/src/test.m4 b/tmp/CodeLoop/src/test.m4 new file mode 100644 index 0000000..c9cb310 --- /dev/null +++ b/tmp/CodeLoop/src/test.m4 @@ -0,0 +1,3 @@ + +define(`SOURCES',`set (') + diff --git a/tmp/CodeLoop/src/test.sh b/tmp/CodeLoop/src/test.sh new file mode 100644 index 0000000..3918b90 --- /dev/null +++ b/tmp/CodeLoop/src/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +source SourceLists.txt + +echo ${SOURCES} diff --git a/tmp/CodeLoop/stamp-h b/tmp/CodeLoop/stamp-h new file mode 100644 index 0000000..181ed77 --- /dev/null +++ b/tmp/CodeLoop/stamp-h @@ -0,0 +1 @@ +Fri Jan 25 14:24:31 CET 2013 diff --git a/tmp/CodeLoop/stamp-h1 b/tmp/CodeLoop/stamp-h1 new file mode 100644 index 0000000..4547fe1 --- /dev/null +++ b/tmp/CodeLoop/stamp-h1 @@ -0,0 +1 @@ +timestamp for config.h diff --git a/tmp/c_vtable/Object.c b/tmp/c_vtable/Object.c new file mode 100644 index 0000000..ac4a348 --- /dev/null +++ b/tmp/c_vtable/Object.c @@ -0,0 +1,5 @@ +#define OBJECT_C + +#include "Object.h" + + diff --git a/tmp/c_vtable/Object.h b/tmp/c_vtable/Object.h new file mode 100644 index 0000000..a6df031 --- /dev/null +++ b/tmp/c_vtable/Object.h @@ -0,0 +1,138 @@ + + +#ifdef __cplusplus +# define C_BEGIN_DECLS extern "C" { +# define C_END_DECLS } +#define BEGIN_NAMESPACE(name) namespace name { +#define END_NAMESPACE } +#else +# define C_BEGIN_DECLS +# define C_END_DECLS +#define BEGIN_NAMESPACE(name) +#define END_NAMESPACE +#endif + +#ifndef INLINE +# if __GNUC__ && !__GNUC_STDC_INLINE__ +# define INLINE extern inline +# else +# define INLINE inline +# endif +#endif + + +#ifndef OBJECT_H +#define OBJECT_H + + +#ifdef OBJECT_C +#undef INLINE +#define INLINE +#endif + + +#include + + +BEGIN_NAMESPACE(ltk) + +typedef void *ltkPointer; + +C_BEGIN_DECLS + + +struct _Object { + int element; +}; +#define OBJECT(ob) ((struct _Object *)ob) +#define OBJECT_CLASS (ltk_object_get_class()) + + +INLINE void ltk_object_ctr (ltkPointer self) { OBJECT(self)->element = 5552368; } +INLINE void ltk_object_dtr (ltkPointer self) { OBJECT(self)->element = 555; } +INLINE int ltk_object_get_element(ltkPointer self) { return OBJECT(self)->element; } + + +struct _ObjectClass { + size_t size; + void (* ctr)(ltkPointer); + void (* dtr)(ltkPointer); + int (* get)(ltkPointer); +}; + + + + +INLINE const struct _ObjectClass *ltk_object_get_class() { + // vtable is defined as ... + // static: to be filled up in code segment + // const : to make compiler able to inline function pointers + static const struct _ObjectClass vtable = + { + sizeof(struct _Object), + ltk_object_ctr, + ltk_object_dtr, + ltk_object_get_element + }; + return &vtable; +} + +INLINE ltkPointer ltk_object_allocator(const struct _ObjectClass *klass) +{ + struct _Object *ob = (struct _Object *)malloc(klass->size); + return (ltkPointer)ob; +} + +INLINE struct _Object *ltk_object_new() +{ + struct _Object *ob = (struct _Object *)ltk_object_allocator(OBJECT_CLASS); + ltk_object_ctr(ob); + return ob; +} + + +C_END_DECLS + + +#ifndef __cplusplus + +typedef struct _Object *Object; +typedef struct _ObjectClass *ObjectClass; + +#else // CPP -------------------------------------------> +class Object { + typedef struct _Object ObjectData; + ObjectData *d; + public: + Object() : d(new ObjectData()) { ltk_object_ctr(d); } + int Get() { ltk_object_get_element(d); } +}; + +#endif // <------------------------------------------ CPP + + +// FUNCTIONS SHARED BETWEEN C AND CPP THAT CAN BE INLINED // + + + + + + +END_NAMESPACE + + + + + + + + + + + + + + + + +#endif // OBJEC_H diff --git a/tmp/c_vtable/Project.ede b/tmp/c_vtable/Project.ede new file mode 100644 index 0000000..7cc1a0d --- /dev/null +++ b/tmp/c_vtable/Project.ede @@ -0,0 +1,15 @@ +;; Object vtable +;; EDE Project Files are auto generated: Do Not Edit +(ede-proj-project "vtable" + :file "Project.ede" + :name "vtable" + :targets (list + (ede-proj-target-makefile-program "c" + :name "c" + :path "" + :source '("main.c" "Object.c" "Vector.c") + :auxsource '("Vector.h") + ) + ) + :makefile-type 'Makefile.am + ) diff --git a/tmp/c_vtable/Vector.c b/tmp/c_vtable/Vector.c new file mode 100644 index 0000000..854424d --- /dev/null +++ b/tmp/c_vtable/Vector.c @@ -0,0 +1,3 @@ +#define VECTOR_C +#include "Vector.h" + diff --git a/tmp/c_vtable/Vector.h b/tmp/c_vtable/Vector.h new file mode 100644 index 0000000..3be9b71 --- /dev/null +++ b/tmp/c_vtable/Vector.h @@ -0,0 +1,89 @@ + +#include "Object.h" // before VECTOR_C inline + + +#ifdef VECTOR_C +#undef INLINE +#define INLINE +#endif + +BEGIN_NAMESPACE(ltk) + + +C_BEGIN_DECLS + + +struct _Vector { + struct _Object parent; + int data[3]; +}; +#define VECTOR(ob) ((struct _Vector *)ob) +#define VECTOR_CLASS (ltk_vector_get_class()) + +INLINE void ltk_vector_ctr (ltkPointer self) +{ + ltk_object_ctr(self); // ctr parent // + OBJECT(self)->element = 5552369; +} + +INLINE void ltk_vector_dtr (ltkPointer self) +{ + OBJECT(self)->element = 556; + ltk_object_dtr(self); // dtr parent // +} + +INLINE int ltk_vector_get_element(ltkPointer self) { return OBJECT(self)->element + 1; } + + +struct _VectorClass { + size_t size; + void (* ctr)(ltkPointer); + void (* dtr)(ltkPointer); + int (* get)(ltkPointer); + int *(* get_data)(ltkPointer); +}; + + +INLINE const struct _VectorClass *ltk_vector_get_class() +{ + static const struct _VectorClass vtable = + { + sizeof(struct _Vector), + ltk_object_ctr, + ltk_object_dtr, + ltk_vector_get_element, + NULL + }; + return &vtable; +} + +INLINE struct _Vector *ltk_vector_new() +{ + struct _ObjectClass *klass = (struct _ObjectClass *)ltk_vector_get_class(); + struct _Vector *vec = (struct _Vector *)ltk_object_allocator(klass); + ltk_vector_ctr(vec); + return vec; +} + + + +C_END_DECLS + +#ifndef __cplusplus + +typedef struct _Vector *Vector; +typedef struct _VecotrClass *VectorClass; + + +#else // CPP -------------------------------------------> +class Vector { + typedef struct _Vector VectorData; + VectorData *d; + public: + Vector() : d(new VectorData()) { ltk_vector_ctr(d); } + int Get() { ltk_vector_get_element(d); } +}; + +#endif // <------------------------------------------ CPP + +END_NAMESPACE diff --git a/tmp/c_vtable/main.c b/tmp/c_vtable/main.c new file mode 100644 index 0000000..3757de2 --- /dev/null +++ b/tmp/c_vtable/main.c @@ -0,0 +1,42 @@ + +#include "Object.h" +#include "Vector.h" + +#include + + + +#ifdef __cplusplus + +using namespace ltk; +int main() +{ + Object ob; + printf("%d\n",ob.Get()); + + Vector vec; + printf("%d\n",vec.Get()); + return 0; +} + + +#else + + +static inline do_main() { + Object ob = ltk_object_new(); + printf("%d\n",OBJECT_CLASS->get(ob)); + + + Vector vec = ltk_vector_new(); + printf("%d\n",VECTOR_CLASS->get(vec)); + +} + +int main() +{ + do_main(); + return 0; +} + +#endif diff --git a/uLibConfig.cmake.in b/uLibConfig.cmake.in new file mode 100644 index 0000000..148fc17 --- /dev/null +++ b/uLibConfig.cmake.in @@ -0,0 +1,19 @@ +# - Config file for the FooBar package +# It defines the following variables +# FOOBAR_INCLUDE_DIRS - include directories for FooBar +# FOOBAR_LIBRARIES - libraries to link against +# FOOBAR_EXECUTABLE - the bar executable + +# Compute paths +get_filename_component(ULIB_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +set(ULIB_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") + +# Our library dependencies (contains definitions for IMPORTED targets) +# if(NOT TARGET foo AND NOT FooBar_BINARY_DIR) + include("${ULIB_CMAKE_DIR}/uLibTargets.cmake") +# endif() + +# These are IMPORTED targets created by FooBarTargets.cmake +# set(FOOBAR_LIBRARIES foo) +# set(FOOBAR_EXECUTABLE bar) +set(ULIB_LIBRARIES @ULIB_SHARED_LIBRARIES@) diff --git a/uLibConfigVersion.cmake.in b/uLibConfigVersion.cmake.in new file mode 100644 index 0000000..a5f8651 --- /dev/null +++ b/uLibConfigVersion.cmake.in @@ -0,0 +1,11 @@ +set(PACKAGE_VERSION "@PACKAGE_VERSION@") + +# Check whether the requested PACKAGE_FIND_VERSION is compatible +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/ulib.h b/ulib.h new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ulib.h @@ -0,0 +1 @@ + diff --git a/vtk_test.cpp b/vtk_test.cpp new file mode 100644 index 0000000..f896a3a --- /dev/null +++ b/vtk_test.cpp @@ -0,0 +1,39 @@ + + + +#include +#include +#include +#include + +#include "Math/Dense.h" + +#include "Math/ContainerBox.h" +#include "Detectors/MuonScatter.h" +#include "Vtk/vtkMuonScatter.h" +#include "Vtk/vtkContainerBox.h" + +int main() +{ + + uLib::MuonScatter event; + event.LineIn().origin << 0,0,0,1; + event.LineIn().direction << 1,1,1,0; + event.LineOut().origin << 5,5,5,1; + event.LineOut().direction << -1,-1,-1,0; + + uLib::Vtk::vtkMuonScatter ms(event); + + uLib::ContainerBox box; + box.SetPosition(uLib::Vector3f(0,2,0)); + box.SetOrigin(uLib::Vector3f(-1,-0.5,-1)); + box.SetSize (uLib::Vector3f(2,-1,2)); + + + + uLib::Vtk::vtkContainerBox vtkbox(box); + + + + return 0; +}