From 728dd55274f5bb350d33d2b419f397ed91c86751 Mon Sep 17 00:00:00 2001 From: Eamonn Saunders <esaunders@basistech.com> Date: Wed, 3 Apr 2013 17:31:47 -0400 Subject: [PATCH] Merged in Linux support. --- .gitignore | 5 +- .gitmodules | 60 +- Makefile.am | 60 +- bindings/java/jni/Makefile.am | 2 +- bindings/java/jni/dataModel_SleuthkitJNI.cpp | 4 +- config/config.guess | 2 +- config/config.sub | 2 +- config/depcomp | 2 +- config/ltmain.sh | 2 +- config/missing | 2 +- configure.ac | 48 +- framework/Extraction/TskImageFile.h | 133 - framework/INSTALL.txt | 89 + framework/Makefile.am | 90 +- .../framework_config_linuxdev.xml | 9 + .../SampleConfig/framework_config_macdev.xml | 8 + .../framework_config_template.xml | 9 + .../framework_config_win32dev.xml | 5 +- framework/SampleConfig/pipeline_config.xml | 20 +- framework/Services/Log.cpp | 163 - framework/TskModules/c_EntropyModule | 1 - framework/TskModules/c_InterestingFilesModule | 1 - framework/TskModules/c_LibExifModule | 1 - .../TskModules/c_SaveInterestingFilesModule | 1 - framework/TskModules/c_TskHashLookupModule | 1 - framework/TskModules/c_ZIPExtractionModule | 1 - framework/aclocal.m4 | 382 +- framework/bootstrap | 10 + framework/configure.ac | 152 +- framework/docs/Doxyfile | 12 +- .../docs/sample_pipeline_config_file.dox | 22 +- framework/framework.h | 47 - framework/modules/Makefile.am | 12 + framework/{TskModules => modules}/README.txt | 0 framework/modules/c_EntropyModule | 1 + framework/modules/c_FileTypeSigModule | 1 + framework/modules/c_HashCalcModule | 1 + framework/modules/c_InterestingFilesModule | 1 + framework/modules/c_LibExifModule | 1 + framework/modules/c_RegRipperModule | 1 + .../modules/c_SaveInterestingFilesModule | 1 + framework/modules/c_SummaryReportModule | 1 + framework/modules/c_TskHashLookupModule | 1 + framework/modules/c_ZIPExtractionModule | 1 + framework/{ => msvcpp}/BUILDING.txt | 6 +- framework/{win32 => msvcpp}/Makefile | 0 framework/{win32 => msvcpp}/build-deps.pl | 0 .../{win32 => msvcpp}/framework/framework.sln | 20 +- .../framework/framework.vcproj | 142 +- framework/msvcpp/framework/framework.vcxproj | 195 + .../framework/framework.vcxproj.filters | 248 + .../tsk_analyzeimg/tsk_analyzeimg.vcproj | 0 .../tsk_analyzeimg/tsk_analyzeimg.vcxproj | 8 +- .../tsk_analyzeimg.vcxproj.filters | 2 +- .../tsk_validatepipeline.vcproj | 0 .../tsk_validatepipeline.vcxproj | 12 +- .../tsk_validatepipeline.vcxproj.filters | 2 +- framework/tools/Makefile.am | 1 + framework/tools/tsk_analyzeimg/Makefile.am | 5 + .../tsk_analyzeimg/tsk_analyzeimg.cpp | 188 +- .../tools/tsk_validatepipeline/Makefile.am | 5 + .../tsk_validatepipeline.cpp | 66 +- framework/tsk/framework/Makefile.am | 13 + .../{ => tsk/framework}/TskVersionInfo.h | 2 +- .../framework/extraction}/CarveExtract.h | 2 +- .../framework/extraction}/CarvePrep.h | 4 +- .../tsk/framework/extraction/Makefile.am | 8 + .../framework/extraction}/TskAutoImpl.cpp | 9 +- .../framework/extraction}/TskAutoImpl.h | 12 +- .../extraction}/TskCarveExtractScalpel.cpp | 22 +- .../extraction}/TskCarveExtractScalpel.h | 4 +- .../extraction}/TskCarvePrepSectorConcat.cpp | 47 +- .../extraction}/TskCarvePrepSectorConcat.h | 2 +- .../tsk/framework/extraction/TskExtract.cpp | 95 + .../tsk/framework/extraction/TskExtract.h | 46 + .../framework/extraction}/TskImageFile.cpp | 0 .../tsk/framework/extraction/TskImageFile.h | 203 + .../framework/extraction}/TskImageFileTsk.cpp | 157 +- .../framework/extraction}/TskImageFileTsk.h | 45 +- .../framework/extraction/TskL01Extract.cpp | 771 ++ .../tsk/framework/extraction/TskL01Extract.h | 87 + framework/tsk/framework/file/Makefile.am | 11 + .../{File => tsk/framework/file}/TskFile.cpp | 74 +- .../{File => tsk/framework/file}/TskFile.h | 8 +- .../framework/file}/TskFileManager.h | 9 +- .../framework/file}/TskFileManagerImpl.cpp | 16 +- .../framework/file}/TskFileManagerImpl.h | 0 .../framework/file}/TskFileTsk.cpp | 10 +- .../{File => tsk/framework/file}/TskFileTsk.h | 4 +- framework/tsk/framework/framework.h | 47 + framework/{ => tsk/framework}/framework_i.h | 2 +- framework/tsk/framework/pipeline/Makefile.am | 22 + .../pipeline}/TskExecutableModule.cpp | 8 +- .../framework/pipeline}/TskExecutableModule.h | 0 .../pipeline}/TskFileAnalysisPipeline.cpp | 7 +- .../pipeline}/TskFileAnalysisPipeline.h | 0 .../pipeline}/TskFileAnalysisPluginModule.cpp | 4 +- .../pipeline}/TskFileAnalysisPluginModule.h | 0 .../framework/pipeline}/TskModule.cpp | 4 +- .../framework/pipeline}/TskModule.h | 2 +- .../framework/pipeline}/TskPipeline.cpp | 19 +- .../framework/pipeline}/TskPipeline.h | 2 +- .../pipeline}/TskPipelineManager.cpp | 6 +- .../framework/pipeline}/TskPipelineManager.h | 0 .../framework/pipeline}/TskPluginModule.cpp | 124 +- .../framework/pipeline}/TskPluginModule.h | 0 .../framework/pipeline}/TskReportPipeline.cpp | 4 +- .../framework/pipeline}/TskReportPipeline.h | 2 +- .../pipeline}/TskReportPluginModule.cpp | 4 +- .../pipeline}/TskReportPluginModule.h | 0 framework/tsk/framework/services/Log.cpp | 160 + .../framework/services}/Log.h | 12 +- framework/tsk/framework/services/Makefile.am | 28 + .../framework/services}/Scheduler.cpp | 0 .../framework/services}/Scheduler.h | 2 +- .../framework/services}/TskBlackboard.cpp | 8 +- .../framework/services}/TskBlackboard.h | 98 +- .../services}/TskBlackboardArtifact.cpp | 6 +- .../services}/TskBlackboardArtifact.h | 4 +- .../services}/TskBlackboardAttribute.cpp | 104 +- .../services/TskBlackboardAttribute.h} | 4 +- .../framework/services}/TskDBBlackboard.cpp | 12 +- .../framework/services}/TskDBBlackboard.h | 8 +- .../framework/services}/TskImgDB.cpp | 12 + .../framework/services}/TskImgDB.h | 19 +- .../framework/services}/TskImgDBSqlite.cpp | 862 +- .../framework/services}/TskImgDBSqlite.h | 31 +- .../framework/services}/TskSchedulerQueue.cpp | 0 .../framework/services}/TskSchedulerQueue.h | 0 .../framework/services}/TskServices.cpp | 4 +- .../framework/services}/TskServices.h | 8 +- .../services}/TskSystemProperties.cpp | 14 +- .../framework/services}/TskSystemProperties.h | 9 +- .../services}/TskSystemPropertiesImpl.cpp | 8 +- .../services}/TskSystemPropertiesImpl.h | 2 +- .../framework/utilities}/Makefile.am | 2 +- .../framework/utilities}/SectorRuns.cpp | 10 +- .../framework/utilities}/SectorRuns.h | 2 +- .../framework/utilities}/TskException.cpp | 0 .../framework/utilities}/TskException.h | 2 +- .../framework/utilities}/TskModuleDev.h | 15 +- .../framework/utilities}/TskUtilities.cpp | 96 +- .../framework/utilities}/TskUtilities.h | 2 +- .../framework/utilities}/UnallocRun.cpp | 0 .../framework/utilities}/UnallocRun.h | 2 +- framework/win32/framework/framework.vcxproj | 188 - .../win32/framework/framework.vcxproj.filters | 233 - m4/libtool.m4 | 7310 +---------------- m4/ltoptions.m4 | 369 +- m4/ltsugar.m4 | 124 +- m4/ltversion.m4 | 24 +- m4/lt~obsolete.m4 | 93 +- packages/sleuthkit.spec | 34 +- release/release-unix.pl | 16 +- samples/Makefile.am | 2 +- samples/callback-cpp-style.cpp | 2 +- samples/callback-style.cpp | 2 +- samples/posix-cpp-style.cpp | 2 +- samples/posix-style.cpp | 2 +- tests/Makefile.am | 2 +- tests/fs_attrlist_apis.cpp | 2 +- tests/fs_fname_apis.cpp | 2 +- tests/fs_thread_test.cpp | 4 +- tests/read_apis.cpp | 2 +- tools/autotools/Makefile.am | 2 +- tools/autotools/tsk_comparedir.cpp | 2 +- tools/autotools/tsk_gettimes.cpp | 2 +- tools/autotools/tsk_loaddb.cpp | 4 +- tools/autotools/tsk_recover.cpp | 2 +- tools/fiwalk/src/Makefile.am | 2 +- tools/fiwalk/src/arff.cpp | 2 +- tools/fiwalk/src/base64.cpp | 2 +- tools/fiwalk/src/content.cpp | 2 +- tools/fiwalk/src/dfxml.cpp | 4 +- tools/fiwalk/src/dfxml.h | 2 +- tools/fiwalk/src/fiwalk.cpp | 2 +- tools/fiwalk/src/fiwalk_tsk.cpp | 8 +- tools/fiwalk/src/hexbuf.c | 2 +- tools/fiwalk/src/plugin.cpp | 4 +- tools/fiwalk/src/unicode_escape.cpp | 2 +- tools/fiwalk/src/utils.c | 2 +- tools/fstools/Makefile.am | 2 +- tools/fstools/blkcalc.cpp | 2 +- tools/fstools/blkcat.cpp | 2 +- tools/fstools/blkls.cpp | 2 +- tools/fstools/blkstat.cpp | 2 +- tools/fstools/fcat.cpp | 2 +- tools/fstools/ffind.cpp | 2 +- tools/fstools/fls.cpp | 2 +- tools/fstools/fscheck.cpp | 2 +- tools/fstools/fsstat.cpp | 2 +- tools/fstools/icat.cpp | 2 +- tools/fstools/ifind.cpp | 2 +- tools/fstools/ils.cpp | 2 +- tools/fstools/istat.cpp | 2 +- tools/fstools/jcat.cpp | 2 +- tools/fstools/jls.cpp | 2 +- tools/hashtools/Makefile.am | 2 +- tools/hashtools/hfind.cpp | 2 +- tools/hashtools/md5.c | 2 +- tools/hashtools/sha1.c | 2 +- tools/imgtools/Makefile.am | 2 +- tools/imgtools/img_cat.cpp | 2 +- tools/imgtools/img_stat.cpp | 2 +- tools/sorter/sorter.base | 2 +- tools/srchtools/Makefile.am | 2 +- tools/srchtools/sigfind.cpp | 2 +- tools/vstools/Makefile.am | 2 +- tools/vstools/mmcat.cpp | 2 +- tools/vstools/mmls.cpp | 2 +- tools/vstools/mmstat.cpp | 2 +- {tsk3 => tsk}/Makefile.am | 8 +- {tsk3 => tsk}/auto/.indent.pro | 0 {tsk3 => tsk}/auto/Makefile.am | 0 {tsk3 => tsk}/auto/auto.cpp | 2 +- {tsk3 => tsk}/auto/auto_db.cpp | 0 {tsk3 => tsk}/auto/case_db.cpp | 0 {tsk3 => tsk}/auto/db_sqlite.cpp | 0 {tsk3 => tsk}/auto/sqlite3.c | 0 {tsk3 => tsk}/auto/sqlite3.h | 0 {tsk3 => tsk}/auto/tsk_auto.h | 8 +- {tsk3 => tsk}/auto/tsk_auto_i.h | 8 +- {tsk3 => tsk}/auto/tsk_case_db.h | 2 +- {tsk3 => tsk}/auto/tsk_db_sqlite.h | 0 {tsk3 => tsk}/base/.indent.pro | 0 {tsk3 => tsk}/base/Makefile.am | 0 {tsk3 => tsk}/base/XGetopt.c | 0 {tsk3 => tsk}/base/crc.c | 0 {tsk3 => tsk}/base/crc.h | 0 {tsk3 => tsk}/base/md5c.c | 0 {tsk3 => tsk}/base/mymalloc.c | 0 {tsk3 => tsk}/base/sha1c.c | 0 tsk/base/sha2.c | 949 +++ tsk/base/sha2.h | 108 + {tsk3 => tsk}/base/tsk_base.h | 2 +- {tsk3 => tsk}/base/tsk_base_i.h | 12 +- {tsk3 => tsk}/base/tsk_endian.c | 0 {tsk3 => tsk}/base/tsk_error.c | 0 {tsk3 => tsk}/base/tsk_error_win32.cpp | 0 {tsk3 => tsk}/base/tsk_list.c | 0 {tsk3 => tsk}/base/tsk_lock.c | 0 {tsk3 => tsk}/base/tsk_os.h | 0 {tsk3 => tsk}/base/tsk_parse.c | 0 {tsk3 => tsk}/base/tsk_printf.c | 0 {tsk3 => tsk}/base/tsk_stack.c | 0 {tsk3 => tsk}/base/tsk_unicode.c | 192 + {tsk3 => tsk}/base/tsk_version.c | 0 {tsk3 => tsk}/docs/Doxyfile | 32 +- {tsk3 => tsk}/docs/auto.dox | 0 {tsk3 => tsk}/docs/base.dox | 0 {tsk3 => tsk}/docs/basics.dox | 8 +- {tsk3 => tsk}/docs/cpp.dox | 0 {tsk3 => tsk}/docs/footer.html | 0 {tsk3 => tsk}/docs/fs.dox | 0 {tsk3 => tsk}/docs/hashdb.dox | 0 {tsk3 => tsk}/docs/img.dox | 0 {tsk3 => tsk}/docs/main.dox | 0 {tsk3 => tsk}/docs/vs.dox | 0 {tsk3 => tsk}/fs/.indent.pro | 0 {tsk3 => tsk}/fs/Makefile.am | 0 {tsk3 => tsk}/fs/dcalc_lib.c | 0 {tsk3 => tsk}/fs/dcat_lib.c | 0 {tsk3 => tsk}/fs/dls_lib.c | 0 {tsk3 => tsk}/fs/dstat_lib.c | 0 {tsk3 => tsk}/fs/ext2fs.c | 0 {tsk3 => tsk}/fs/ext2fs_dent.c | 0 {tsk3 => tsk}/fs/ext2fs_journal.c | 0 {tsk3 => tsk}/fs/fatfs.c | 0 {tsk3 => tsk}/fs/fatfs_dent.cpp | 0 {tsk3 => tsk}/fs/fatfs_meta.c | 0 {tsk3 => tsk}/fs/ffind_lib.c | 0 {tsk3 => tsk}/fs/ffs.c | 0 {tsk3 => tsk}/fs/ffs_dent.c | 0 {tsk3 => tsk}/fs/fls_lib.c | 0 {tsk3 => tsk}/fs/fs_attr.c | 0 {tsk3 => tsk}/fs/fs_attrlist.c | 0 {tsk3 => tsk}/fs/fs_block.c | 0 {tsk3 => tsk}/fs/fs_dir.c | 0 {tsk3 => tsk}/fs/fs_file.c | 0 {tsk3 => tsk}/fs/fs_inode.c | 0 {tsk3 => tsk}/fs/fs_io.c | 0 {tsk3 => tsk}/fs/fs_load.c | 0 {tsk3 => tsk}/fs/fs_name.c | 0 {tsk3 => tsk}/fs/fs_open.c | 0 {tsk3 => tsk}/fs/fs_parse.c | 0 {tsk3 => tsk}/fs/fs_types.c | 0 {tsk3 => tsk}/fs/hfs.c | 0 {tsk3 => tsk}/fs/hfs_dent.c | 0 {tsk3 => tsk}/fs/hfs_journal.c | 0 {tsk3 => tsk}/fs/hfs_unicompare.c | 0 {tsk3 => tsk}/fs/icat_lib.c | 0 {tsk3 => tsk}/fs/ifind_lib.c | 0 {tsk3 => tsk}/fs/ils_lib.c | 0 {tsk3 => tsk}/fs/iso9660.c | 0 {tsk3 => tsk}/fs/iso9660_dent.c | 0 {tsk3 => tsk}/fs/nofs_misc.c | 0 {tsk3 => tsk}/fs/ntfs.c | 0 {tsk3 => tsk}/fs/ntfs_dent.cpp | 0 {tsk3 => tsk}/fs/rawfs.c | 0 {tsk3 => tsk}/fs/swapfs.c | 0 {tsk3 => tsk}/fs/tsk_ext2fs.h | 0 {tsk3 => tsk}/fs/tsk_fatfs.h | 0 {tsk3 => tsk}/fs/tsk_ffs.h | 0 {tsk3 => tsk}/fs/tsk_fs.h | 0 {tsk3 => tsk}/fs/tsk_fs_i.h | 6 +- {tsk3 => tsk}/fs/tsk_hfs.h | 0 {tsk3 => tsk}/fs/tsk_iso9660.h | 0 {tsk3 => tsk}/fs/tsk_ntfs.h | 0 {tsk3 => tsk}/fs/tsk_yaffs.h | 0 {tsk3 => tsk}/fs/unix_misc.c | 0 {tsk3 => tsk}/fs/walk_cpp.cpp | 2 +- {tsk3 => tsk}/fs/yaffs.cpp | 0 {tsk3 => tsk}/hashdb/.indent.pro | 0 {tsk3 => tsk}/hashdb/Makefile.am | 0 {tsk3 => tsk}/hashdb/encase_index.c | 0 {tsk3 => tsk}/hashdb/hk_index.c | 0 {tsk3 => tsk}/hashdb/idxonly_index.c | 0 {tsk3 => tsk}/hashdb/md5sum_index.c | 0 {tsk3 => tsk}/hashdb/nsrl_index.c | 0 {tsk3 => tsk}/hashdb/tm_lookup.c | 0 {tsk3 => tsk}/hashdb/tsk_hashdb.h | 0 {tsk3 => tsk}/hashdb/tsk_hashdb_i.h | 2 +- {tsk3 => tsk}/img/.indent.pro | 0 {tsk3 => tsk}/img/Makefile.am | 0 {tsk3 => tsk}/img/aff.c | 0 {tsk3 => tsk}/img/aff.h | 0 {tsk3 => tsk}/img/ewf.c | 0 {tsk3 => tsk}/img/ewf.h | 0 {tsk3 => tsk}/img/img_io.c | 0 {tsk3 => tsk}/img/img_open.c | 0 {tsk3 => tsk}/img/img_types.c | 0 {tsk3 => tsk}/img/mult_files.c | 0 {tsk3 => tsk}/img/raw.c | 0 {tsk3 => tsk}/img/raw.h | 0 {tsk3 => tsk}/img/tsk_img.h | 0 {tsk3 => tsk}/img/tsk_img_i.h | 11 +- tsk/libtsk.h | 11 + {tsk3 => tsk}/sorter/default.sort | 0 {tsk3 => tsk}/sorter/freebsd.sort | 0 {tsk3 => tsk}/sorter/images.sort | 0 {tsk3 => tsk}/sorter/linux.sort | 0 {tsk3 => tsk}/sorter/openbsd.sort | 0 {tsk3 => tsk}/sorter/solaris.sort | 0 {tsk3 => tsk}/sorter/windows.sort | 0 {tsk3 => tsk}/tsk_config.h.in | 2 +- {tsk3 => tsk}/tsk_tools_i.h | 12 +- {tsk3 => tsk}/vs/.indent.pro | 0 {tsk3 => tsk}/vs/Makefile.am | 0 {tsk3 => tsk}/vs/bsd.c | 0 {tsk3 => tsk}/vs/dos.c | 0 {tsk3 => tsk}/vs/gpt.c | 0 {tsk3 => tsk}/vs/mac.c | 0 {tsk3 => tsk}/vs/mm_io.c | 0 {tsk3 => tsk}/vs/mm_open.c | 0 {tsk3 => tsk}/vs/mm_part.c | 0 {tsk3 => tsk}/vs/mm_types.c | 0 {tsk3 => tsk}/vs/sun.c | 0 {tsk3 => tsk}/vs/tsk_bsd.h | 0 {tsk3 => tsk}/vs/tsk_dos.h | 0 {tsk3 => tsk}/vs/tsk_gpt.h | 0 {tsk3 => tsk}/vs/tsk_mac.h | 0 {tsk3 => tsk}/vs/tsk_sun.h | 0 {tsk3 => tsk}/vs/tsk_vs.h | 0 {tsk3 => tsk}/vs/tsk_vs_i.h | 4 +- tsk3/libtsk.h | 11 - unit_tests/base/Makefile.am | 4 +- win32/libtsk/libtsk.vcproj | 226 +- win32/libtsk/libtsk.vcxproj | 231 +- win32/libtsk/libtsk.vcxproj.filters | 228 +- 369 files changed, 5779 insertions(+), 10553 deletions(-) delete mode 100755 framework/Extraction/TskImageFile.h create mode 100644 framework/INSTALL.txt create mode 100644 framework/SampleConfig/framework_config_linuxdev.xml create mode 100644 framework/SampleConfig/framework_config_macdev.xml create mode 100644 framework/SampleConfig/framework_config_template.xml delete mode 100755 framework/Services/Log.cpp delete mode 160000 framework/TskModules/c_EntropyModule delete mode 160000 framework/TskModules/c_InterestingFilesModule delete mode 160000 framework/TskModules/c_LibExifModule delete mode 160000 framework/TskModules/c_SaveInterestingFilesModule delete mode 160000 framework/TskModules/c_TskHashLookupModule delete mode 160000 framework/TskModules/c_ZIPExtractionModule delete mode 100755 framework/framework.h create mode 100644 framework/modules/Makefile.am rename framework/{TskModules => modules}/README.txt (100%) create mode 160000 framework/modules/c_EntropyModule create mode 160000 framework/modules/c_FileTypeSigModule create mode 160000 framework/modules/c_HashCalcModule create mode 160000 framework/modules/c_InterestingFilesModule create mode 160000 framework/modules/c_LibExifModule create mode 160000 framework/modules/c_RegRipperModule create mode 160000 framework/modules/c_SaveInterestingFilesModule create mode 160000 framework/modules/c_SummaryReportModule create mode 160000 framework/modules/c_TskHashLookupModule create mode 160000 framework/modules/c_ZIPExtractionModule rename framework/{ => msvcpp}/BUILDING.txt (95%) rename framework/{win32 => msvcpp}/Makefile (100%) rename framework/{win32 => msvcpp}/build-deps.pl (100%) rename framework/{win32 => msvcpp}/framework/framework.sln (83%) rename framework/{win32 => msvcpp}/framework/framework.vcproj (60%) create mode 100755 framework/msvcpp/framework/framework.vcxproj create mode 100755 framework/msvcpp/framework/framework.vcxproj.filters rename framework/{win32 => msvcpp}/tsk_analyzeimg/tsk_analyzeimg.vcproj (100%) rename framework/{win32 => msvcpp}/tsk_analyzeimg/tsk_analyzeimg.vcxproj (92%) rename framework/{win32 => msvcpp}/tsk_analyzeimg/tsk_analyzeimg.vcxproj.filters (84%) rename framework/{win32 => msvcpp}/tsk_validatepipeline/tsk_validatepipeline.vcproj (100%) rename framework/{win32 => msvcpp}/tsk_validatepipeline/tsk_validatepipeline.vcxproj (86%) rename framework/{win32 => msvcpp}/tsk_validatepipeline/tsk_validatepipeline.vcxproj.filters (82%) create mode 100644 framework/tools/Makefile.am create mode 100644 framework/tools/tsk_analyzeimg/Makefile.am rename framework/{ => tools}/tsk_analyzeimg/tsk_analyzeimg.cpp (60%) create mode 100644 framework/tools/tsk_validatepipeline/Makefile.am rename framework/{ => tools}/tsk_validatepipeline/tsk_validatepipeline.cpp (75%) create mode 100644 framework/tsk/framework/Makefile.am rename framework/{ => tsk/framework}/TskVersionInfo.h (92%) rename framework/{Extraction => tsk/framework/extraction}/CarveExtract.h (92%) rename framework/{Extraction => tsk/framework/extraction}/CarvePrep.h (93%) create mode 100644 framework/tsk/framework/extraction/Makefile.am rename framework/{Extraction => tsk/framework/extraction}/TskAutoImpl.cpp (94%) rename framework/{Extraction => tsk/framework/extraction}/TskAutoImpl.h (81%) rename framework/{Extraction => tsk/framework/extraction}/TskCarveExtractScalpel.cpp (94%) rename framework/{Extraction => tsk/framework/extraction}/TskCarveExtractScalpel.h (91%) rename framework/{Extraction => tsk/framework/extraction}/TskCarvePrepSectorConcat.cpp (89%) rename framework/{Extraction => tsk/framework/extraction}/TskCarvePrepSectorConcat.h (95%) create mode 100644 framework/tsk/framework/extraction/TskExtract.cpp create mode 100644 framework/tsk/framework/extraction/TskExtract.h rename framework/{Extraction => tsk/framework/extraction}/TskImageFile.cpp (100%) create mode 100755 framework/tsk/framework/extraction/TskImageFile.h rename framework/{Extraction => tsk/framework/extraction}/TskImageFileTsk.cpp (72%) rename framework/{Extraction => tsk/framework/extraction}/TskImageFileTsk.h (51%) create mode 100644 framework/tsk/framework/extraction/TskL01Extract.cpp create mode 100644 framework/tsk/framework/extraction/TskL01Extract.h create mode 100644 framework/tsk/framework/file/Makefile.am rename framework/{File => tsk/framework/file}/TskFile.cpp (77%) rename framework/{File => tsk/framework/file}/TskFile.h (91%) rename framework/{File => tsk/framework/file}/TskFileManager.h (92%) rename framework/{File => tsk/framework/file}/TskFileManagerImpl.cpp (92%) rename framework/{File => tsk/framework/file}/TskFileManagerImpl.h (100%) rename framework/{File => tsk/framework/file}/TskFileTsk.cpp (94%) rename framework/{File => tsk/framework/file}/TskFileTsk.h (92%) create mode 100755 framework/tsk/framework/framework.h rename framework/{ => tsk/framework}/framework_i.h (92%) create mode 100644 framework/tsk/framework/pipeline/Makefile.am rename framework/{Pipeline => tsk/framework/pipeline}/TskExecutableModule.cpp (93%) rename framework/{Pipeline => tsk/framework/pipeline}/TskExecutableModule.h (100%) rename framework/{Pipeline => tsk/framework/pipeline}/TskFileAnalysisPipeline.cpp (93%) rename framework/{Pipeline => tsk/framework/pipeline}/TskFileAnalysisPipeline.h (100%) rename framework/{Pipeline => tsk/framework/pipeline}/TskFileAnalysisPluginModule.cpp (93%) rename framework/{Pipeline => tsk/framework/pipeline}/TskFileAnalysisPluginModule.h (100%) rename framework/{Pipeline => tsk/framework/pipeline}/TskModule.cpp (93%) rename framework/{Pipeline => tsk/framework/pipeline}/TskModule.h (95%) rename framework/{Pipeline => tsk/framework/pipeline}/TskPipeline.cpp (93%) rename framework/{Pipeline => tsk/framework/pipeline}/TskPipeline.h (96%) rename framework/{Pipeline => tsk/framework/pipeline}/TskPipelineManager.cpp (95%) rename framework/{Pipeline => tsk/framework/pipeline}/TskPipelineManager.h (100%) rename framework/{Pipeline => tsk/framework/pipeline}/TskPluginModule.cpp (71%) rename framework/{Pipeline => tsk/framework/pipeline}/TskPluginModule.h (100%) rename framework/{Pipeline => tsk/framework/pipeline}/TskReportPipeline.cpp (89%) rename framework/{Pipeline => tsk/framework/pipeline}/TskReportPipeline.h (92%) rename framework/{Pipeline => tsk/framework/pipeline}/TskReportPluginModule.cpp (93%) rename framework/{Pipeline => tsk/framework/pipeline}/TskReportPluginModule.h (100%) create mode 100755 framework/tsk/framework/services/Log.cpp rename framework/{Services => tsk/framework/services}/Log.h (89%) create mode 100644 framework/tsk/framework/services/Makefile.am rename framework/{Services => tsk/framework/services}/Scheduler.cpp (100%) rename framework/{Services => tsk/framework/services}/Scheduler.h (95%) rename framework/{Services => tsk/framework/services}/TskBlackboard.cpp (96%) rename framework/{Services => tsk/framework/services}/TskBlackboard.h (88%) rename framework/{Services => tsk/framework/services}/TskBlackboardArtifact.cpp (90%) rename framework/{Services => tsk/framework/services}/TskBlackboardArtifact.h (93%) rename framework/{Services => tsk/framework/services}/TskBlackboardAttribute.cpp (76%) rename framework/{Services/TskBlackBoardAttribute.h => tsk/framework/services/TskBlackboardAttribute.h} (95%) rename framework/{Services => tsk/framework/services}/TskDBBlackboard.cpp (94%) rename framework/{Services => tsk/framework/services}/TskDBBlackboard.h (92%) rename framework/{Services => tsk/framework/services}/TskImgDB.cpp (77%) rename framework/{Services => tsk/framework/services}/TskImgDB.h (93%) rename framework/{Services => tsk/framework/services}/TskImgDBSqlite.cpp (78%) rename framework/{Services => tsk/framework/services}/TskImgDBSqlite.h (88%) rename framework/{Services => tsk/framework/services}/TskSchedulerQueue.cpp (100%) rename framework/{Services => tsk/framework/services}/TskSchedulerQueue.h (100%) rename framework/{Services => tsk/framework/services}/TskServices.cpp (94%) rename framework/{Services => tsk/framework/services}/TskServices.h (93%) rename framework/{Services => tsk/framework/services}/TskSystemProperties.cpp (92%) rename framework/{Services => tsk/framework/services}/TskSystemProperties.h (95%) rename framework/{Services => tsk/framework/services}/TskSystemPropertiesImpl.cpp (87%) rename framework/{Services => tsk/framework/services}/TskSystemPropertiesImpl.h (95%) rename framework/{Utilities => tsk/framework/utilities}/Makefile.am (84%) rename framework/{Utilities => tsk/framework/utilities}/SectorRuns.cpp (92%) rename framework/{Utilities => tsk/framework/utilities}/SectorRuns.h (93%) rename framework/{Utilities => tsk/framework/utilities}/TskException.cpp (100%) rename framework/{Utilities => tsk/framework/utilities}/TskException.h (95%) rename framework/{ => tsk/framework/utilities}/TskModuleDev.h (79%) rename framework/{Utilities => tsk/framework/utilities}/TskUtilities.cpp (54%) rename framework/{Utilities => tsk/framework/utilities}/TskUtilities.h (92%) rename framework/{Utilities => tsk/framework/utilities}/UnallocRun.cpp (100%) rename framework/{Utilities => tsk/framework/utilities}/UnallocRun.h (92%) delete mode 100755 framework/win32/framework/framework.vcxproj delete mode 100755 framework/win32/framework/framework.vcxproj.filters mode change 100644 => 120000 m4/libtool.m4 mode change 100644 => 120000 m4/ltoptions.m4 mode change 100644 => 120000 m4/ltsugar.m4 mode change 100644 => 120000 m4/ltversion.m4 mode change 100644 => 120000 m4/lt~obsolete.m4 rename {tsk3 => tsk}/Makefile.am (64%) rename {tsk3 => tsk}/auto/.indent.pro (100%) rename {tsk3 => tsk}/auto/Makefile.am (100%) rename {tsk3 => tsk}/auto/auto.cpp (99%) rename {tsk3 => tsk}/auto/auto_db.cpp (100%) rename {tsk3 => tsk}/auto/case_db.cpp (100%) rename {tsk3 => tsk}/auto/db_sqlite.cpp (100%) rename {tsk3 => tsk}/auto/sqlite3.c (100%) rename {tsk3 => tsk}/auto/sqlite3.h (100%) rename {tsk3 => tsk}/auto/tsk_auto.h (98%) rename {tsk3 => tsk}/auto/tsk_auto_i.h (81%) rename {tsk3 => tsk}/auto/tsk_case_db.h (99%) rename {tsk3 => tsk}/auto/tsk_db_sqlite.h (100%) rename {tsk3 => tsk}/base/.indent.pro (100%) rename {tsk3 => tsk}/base/Makefile.am (100%) rename {tsk3 => tsk}/base/XGetopt.c (100%) rename {tsk3 => tsk}/base/crc.c (100%) rename {tsk3 => tsk}/base/crc.h (100%) rename {tsk3 => tsk}/base/md5c.c (100%) rename {tsk3 => tsk}/base/mymalloc.c (100%) rename {tsk3 => tsk}/base/sha1c.c (100%) create mode 100644 tsk/base/sha2.c create mode 100644 tsk/base/sha2.h rename {tsk3 => tsk}/base/tsk_base.h (99%) rename {tsk3 => tsk}/base/tsk_base_i.h (95%) rename {tsk3 => tsk}/base/tsk_endian.c (100%) rename {tsk3 => tsk}/base/tsk_error.c (100%) rename {tsk3 => tsk}/base/tsk_error_win32.cpp (100%) rename {tsk3 => tsk}/base/tsk_list.c (100%) rename {tsk3 => tsk}/base/tsk_lock.c (100%) rename {tsk3 => tsk}/base/tsk_os.h (100%) rename {tsk3 => tsk}/base/tsk_parse.c (100%) rename {tsk3 => tsk}/base/tsk_printf.c (100%) rename {tsk3 => tsk}/base/tsk_stack.c (100%) rename {tsk3 => tsk}/base/tsk_unicode.c (75%) rename {tsk3 => tsk}/base/tsk_version.c (100%) rename {tsk3 => tsk}/docs/Doxyfile (99%) rename {tsk3 => tsk}/docs/auto.dox (100%) rename {tsk3 => tsk}/docs/base.dox (100%) rename {tsk3 => tsk}/docs/basics.dox (91%) rename {tsk3 => tsk}/docs/cpp.dox (100%) rename {tsk3 => tsk}/docs/footer.html (100%) rename {tsk3 => tsk}/docs/fs.dox (100%) rename {tsk3 => tsk}/docs/hashdb.dox (100%) rename {tsk3 => tsk}/docs/img.dox (100%) rename {tsk3 => tsk}/docs/main.dox (100%) rename {tsk3 => tsk}/docs/vs.dox (100%) rename {tsk3 => tsk}/fs/.indent.pro (100%) rename {tsk3 => tsk}/fs/Makefile.am (100%) rename {tsk3 => tsk}/fs/dcalc_lib.c (100%) rename {tsk3 => tsk}/fs/dcat_lib.c (100%) rename {tsk3 => tsk}/fs/dls_lib.c (100%) rename {tsk3 => tsk}/fs/dstat_lib.c (100%) rename {tsk3 => tsk}/fs/ext2fs.c (100%) rename {tsk3 => tsk}/fs/ext2fs_dent.c (100%) rename {tsk3 => tsk}/fs/ext2fs_journal.c (100%) rename {tsk3 => tsk}/fs/fatfs.c (100%) rename {tsk3 => tsk}/fs/fatfs_dent.cpp (100%) rename {tsk3 => tsk}/fs/fatfs_meta.c (100%) rename {tsk3 => tsk}/fs/ffind_lib.c (100%) rename {tsk3 => tsk}/fs/ffs.c (100%) rename {tsk3 => tsk}/fs/ffs_dent.c (100%) rename {tsk3 => tsk}/fs/fls_lib.c (100%) rename {tsk3 => tsk}/fs/fs_attr.c (100%) rename {tsk3 => tsk}/fs/fs_attrlist.c (100%) rename {tsk3 => tsk}/fs/fs_block.c (100%) rename {tsk3 => tsk}/fs/fs_dir.c (100%) rename {tsk3 => tsk}/fs/fs_file.c (100%) rename {tsk3 => tsk}/fs/fs_inode.c (100%) rename {tsk3 => tsk}/fs/fs_io.c (100%) rename {tsk3 => tsk}/fs/fs_load.c (100%) rename {tsk3 => tsk}/fs/fs_name.c (100%) rename {tsk3 => tsk}/fs/fs_open.c (100%) rename {tsk3 => tsk}/fs/fs_parse.c (100%) rename {tsk3 => tsk}/fs/fs_types.c (100%) rename {tsk3 => tsk}/fs/hfs.c (100%) rename {tsk3 => tsk}/fs/hfs_dent.c (100%) rename {tsk3 => tsk}/fs/hfs_journal.c (100%) rename {tsk3 => tsk}/fs/hfs_unicompare.c (100%) rename {tsk3 => tsk}/fs/icat_lib.c (100%) rename {tsk3 => tsk}/fs/ifind_lib.c (100%) rename {tsk3 => tsk}/fs/ils_lib.c (100%) rename {tsk3 => tsk}/fs/iso9660.c (100%) rename {tsk3 => tsk}/fs/iso9660_dent.c (100%) rename {tsk3 => tsk}/fs/nofs_misc.c (100%) rename {tsk3 => tsk}/fs/ntfs.c (100%) rename {tsk3 => tsk}/fs/ntfs_dent.cpp (100%) rename {tsk3 => tsk}/fs/rawfs.c (100%) rename {tsk3 => tsk}/fs/swapfs.c (100%) rename {tsk3 => tsk}/fs/tsk_ext2fs.h (100%) rename {tsk3 => tsk}/fs/tsk_fatfs.h (100%) rename {tsk3 => tsk}/fs/tsk_ffs.h (100%) rename {tsk3 => tsk}/fs/tsk_fs.h (100%) rename {tsk3 => tsk}/fs/tsk_fs_i.h (98%) rename {tsk3 => tsk}/fs/tsk_hfs.h (100%) rename {tsk3 => tsk}/fs/tsk_iso9660.h (100%) rename {tsk3 => tsk}/fs/tsk_ntfs.h (100%) rename {tsk3 => tsk}/fs/tsk_yaffs.h (100%) rename {tsk3 => tsk}/fs/unix_misc.c (100%) rename {tsk3 => tsk}/fs/walk_cpp.cpp (98%) rename {tsk3 => tsk}/fs/yaffs.cpp (100%) rename {tsk3 => tsk}/hashdb/.indent.pro (100%) rename {tsk3 => tsk}/hashdb/Makefile.am (100%) rename {tsk3 => tsk}/hashdb/encase_index.c (100%) rename {tsk3 => tsk}/hashdb/hk_index.c (100%) rename {tsk3 => tsk}/hashdb/idxonly_index.c (100%) rename {tsk3 => tsk}/hashdb/md5sum_index.c (100%) rename {tsk3 => tsk}/hashdb/nsrl_index.c (100%) rename {tsk3 => tsk}/hashdb/tm_lookup.c (100%) rename {tsk3 => tsk}/hashdb/tsk_hashdb.h (100%) rename {tsk3 => tsk}/hashdb/tsk_hashdb_i.h (99%) rename {tsk3 => tsk}/img/.indent.pro (100%) rename {tsk3 => tsk}/img/Makefile.am (100%) rename {tsk3 => tsk}/img/aff.c (100%) rename {tsk3 => tsk}/img/aff.h (100%) rename {tsk3 => tsk}/img/ewf.c (100%) rename {tsk3 => tsk}/img/ewf.h (100%) rename {tsk3 => tsk}/img/img_io.c (100%) rename {tsk3 => tsk}/img/img_open.c (100%) rename {tsk3 => tsk}/img/img_types.c (100%) rename {tsk3 => tsk}/img/mult_files.c (100%) rename {tsk3 => tsk}/img/raw.c (100%) rename {tsk3 => tsk}/img/raw.h (100%) rename {tsk3 => tsk}/img/tsk_img.h (100%) rename {tsk3 => tsk}/img/tsk_img_i.h (89%) create mode 100644 tsk/libtsk.h rename {tsk3 => tsk}/sorter/default.sort (100%) rename {tsk3 => tsk}/sorter/freebsd.sort (100%) rename {tsk3 => tsk}/sorter/images.sort (100%) rename {tsk3 => tsk}/sorter/linux.sort (100%) rename {tsk3 => tsk}/sorter/openbsd.sort (100%) rename {tsk3 => tsk}/sorter/solaris.sort (100%) rename {tsk3 => tsk}/sorter/windows.sort (100%) rename {tsk3 => tsk}/tsk_config.h.in (98%) rename {tsk3 => tsk}/tsk_tools_i.h (57%) rename {tsk3 => tsk}/vs/.indent.pro (100%) rename {tsk3 => tsk}/vs/Makefile.am (100%) rename {tsk3 => tsk}/vs/bsd.c (100%) rename {tsk3 => tsk}/vs/dos.c (100%) rename {tsk3 => tsk}/vs/gpt.c (100%) rename {tsk3 => tsk}/vs/mac.c (100%) rename {tsk3 => tsk}/vs/mm_io.c (100%) rename {tsk3 => tsk}/vs/mm_open.c (100%) rename {tsk3 => tsk}/vs/mm_part.c (100%) rename {tsk3 => tsk}/vs/mm_types.c (100%) rename {tsk3 => tsk}/vs/sun.c (100%) rename {tsk3 => tsk}/vs/tsk_bsd.h (100%) rename {tsk3 => tsk}/vs/tsk_dos.h (100%) rename {tsk3 => tsk}/vs/tsk_gpt.h (100%) rename {tsk3 => tsk}/vs/tsk_mac.h (100%) rename {tsk3 => tsk}/vs/tsk_sun.h (100%) rename {tsk3 => tsk}/vs/tsk_vs.h (100%) rename {tsk3 => tsk}/vs/tsk_vs_i.h (95%) delete mode 100644 tsk3/libtsk.h diff --git a/.gitignore b/.gitignore index df5cb58aa..e76c21b34 100755 --- a/.gitignore +++ b/.gitignore @@ -63,10 +63,9 @@ Makefile # Files generated by running configure *.in -*.am stamp-h1 -tsk3/tsk_config.h -tsk3/tsk_incs.h +tsk/tsk_config.h +tsk/tsk_incs.h tools/fstools/blkcalc aclocal.m4 autom4te.cache diff --git a/.gitmodules b/.gitmodules index 2a72d392d..b01e5211a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,30 +1,30 @@ -[submodule "framework/TskModules/c_HashCalcModule"] - path = framework/TskModules/c_HashCalcModule - url = git://github.com/sleuthkit/c_HashCalcModule.git -[submodule "framework/TskModules/c_ZIPExtractionModule"] - path = framework/TskModules/c_ZIPExtractionModule - url = git://github.com/sleuthkit/c_ZIPExtractionModule.git -[submodule "framework/TskModules/c_EntropyModule"] - path = framework/TskModules/c_EntropyModule - url = git://github.com/sleuthkit/c_EntropyModule.git -[submodule "framework/TskModules/c_SaveInterestingFilesModule"] - path = framework/TskModules/c_SaveInterestingFilesModule - url = git://github.com/sleuthkit/c_SaveInterestingFilesModule.git -[submodule "framework/TskModules/c_RegRipperModule"] - path = framework/TskModules/c_RegRipperModule - url = git://github.com/sleuthkit/c_RegRipperModule.git -[submodule "framework/TskModules/c_InterestingFilesModule"] - path = framework/TskModules/c_InterestingFilesModule - url = git://github.com/sleuthkit/c_InterestingFilesModule.git -[submodule "framework/TskModules/c_TskHashLookupModule"] - path = framework/TskModules/c_TskHashLookupModule - url = git://github.com/sleuthkit/c_TskHashLookupModule.git -[submodule "framework/TskModules/c_SummaryReportModule"] - path = framework/TskModules/c_SummaryReportModule - url = git://github.com/sleuthkit/c_SummaryReportModule.git -[submodule "framework/TskModules/c_FileTypeSigModule"] - path = framework/TskModules/c_FileTypeSigModule - url = git://github.com/sleuthkit/c_FileTypeSigModule.git -[submodule "framework/TskModules/c_LibExifModule"] - path = framework/TskModules/c_LibExifModule - url = git://github.com/sleuthkit/c_LibExifModule.git +[submodule "framework/modules/c_HashCalcModule"] + path = framework/modules/c_HashCalcModule + url = git@github.com:sleuthkit/c_HashCalcModule.git +[submodule "framework/modules/c_ZIPExtractionModule"] + path = framework/modules/c_ZIPExtractionModule + url = git@github.com:sleuthkit/c_ZIPExtractionModule.git +[submodule "framework/modules/c_EntropyModule"] + path = framework/modules/c_EntropyModule + url = git@github.com:sleuthkit/c_EntropyModule.git +[submodule "framework/modules/c_SaveInterestingFilesModule"] + path = framework/modules/c_SaveInterestingFilesModule + url = git@github.com:sleuthkit/c_SaveInterestingFilesModule.git +[submodule "framework/modules/c_RegRipperModule"] + path = framework/modules/c_RegRipperModule + url = git@github.com:sleuthkit/c_RegRipperModule.git +[submodule "framework/modules/c_InterestingFilesModule"] + path = framework/modules/c_InterestingFilesModule + url = git@github.com:sleuthkit/c_InterestingFilesModule.git +[submodule "framework/modules/c_TskHashLookupModule"] + path = framework/modules/c_TskHashLookupModule + url = git@github.com:sleuthkit/c_TskHashLookupModule.git +[submodule "framework/modules/c_SummaryReportModule"] + path = framework/modules/c_SummaryReportModule + url = git@github.com:sleuthkit/c_SummaryReportModule.git +[submodule "framework/modules/c_FileTypeSigModule"] + path = framework/modules/c_FileTypeSigModule + url = git@github.com:sleuthkit/c_FileTypeSigModule.git +[submodule "framework/modules/c_LibExifModule"] + path = framework/modules/c_LibExifModule + url = git@github.com:sleuthkit/c_LibExifModule.git diff --git a/Makefile.am b/Makefile.am index 969cd1edd..34363a9a9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,27 +20,27 @@ EXTRA_DIST = README_win32.txt README.txt INSTALL.txt ChangeLog.txt NEWS.txt \ bindings/java/teststandards \ framework/*.txt \ framework/*.h \ - framework/Extraction/*.cpp \ - framework/Extraction/*.h \ - framework/File/*.cpp \ - framework/File/*.h \ - framework/Pipeline/*.cpp \ - framework/Pipeline/*.h \ + framework/tsk/framework/extraction/*.cpp \ + framework/tsk/framework/extraction/*.h \ + framework/tsk/framework/file/*.cpp \ + framework/tsk/framework/file/*.h \ + framework/tsk/framework/pipeline/*.cpp \ + framework/tsk/framework/pipeline/*.h \ + framework/tsk/framework/services/*.cpp \ + framework/tsk/framework/services/*.h \ + framework/modules/* \ + framework/tsk/framework/utilities/*.cpp \ + framework/tsk/framework/utilities/*.h \ framework/SampleConfig/*.xml \ - framework/Services/*.cpp \ - framework/Services/*.h \ - framework/TskModules/* \ - framework/Utilities/*.cpp \ - framework/Utilities/*.h \ framework/docs/* \ framework/man/* \ - framework/tsk_analyzeimg/*.cpp \ - framework/tsk_validatepipeline/*.cpp \ - framework/win32/*/*.vcproj \ - framework/win32/*/*.sln \ - framework/win32/Makefile + framework/tools/etsk_analyzeimg/*.cpp \ + framework/tools/tsk_validatepipeline/*.cpp \ + framework/msvcpp/*/*.vcproj \ + framework/msvcpp/*/*.sln \ + framework/msvcpp/Makefile -CLEANFILES = tsk3/tsk_incs.h +CLEANFILES = tsk/tsk_incs.h ACLOCAL_AMFLAGS = -I m4 @@ -51,23 +51,23 @@ endif if X_JNI JNI=bindings/java/jni endif -SUBDIRS = tsk3 tools tests samples man $(UNIT_TESTS) $(JNI) +SUBDIRS = tsk tools tests samples man $(UNIT_TESTS) $(JNI) -nobase_include_HEADERS = tsk3/libtsk.h tsk3/tsk_incs.h \ - tsk3/base/tsk_base.h tsk3/base/tsk_os.h \ - tsk3/img/tsk_img.h tsk3/vs/tsk_vs.h \ - tsk3/vs/tsk_bsd.h tsk3/vs/tsk_dos.h tsk3/vs/tsk_gpt.h \ - tsk3/vs/tsk_mac.h tsk3/vs/tsk_sun.h \ - tsk3/fs/tsk_fs.h tsk3/fs/tsk_ffs.h tsk3/fs/tsk_ext2fs.h tsk3/fs/tsk_fatfs.h \ - tsk3/fs/tsk_ntfs.h tsk3/fs/tsk_iso9660.h tsk3/fs/tsk_hfs.h tsk_yaffs.h \ - tsk3/hashdb/tsk_hashdb.h tsk3/auto/tsk_auto.h +nobase_include_HEADERS = tsk/libtsk.h tsk/tsk_incs.h \ + tsk/base/tsk_base.h tsk/base/tsk_os.h \ + tsk/img/tsk_img.h tsk/vs/tsk_vs.h \ + tsk/vs/tsk_bsd.h tsk/vs/tsk_dos.h tsk/vs/tsk_gpt.h \ + tsk/vs/tsk_mac.h tsk/vs/tsk_sun.h \ + tsk/fs/tsk_fs.h tsk/fs/tsk_ffs.h tsk/fs/tsk_ext2fs.h tsk/fs/tsk_fatfs.h \ + tsk/fs/tsk_ntfs.h tsk/fs/tsk_iso9660.h tsk/fs/tsk_hfs.h \ + tsk/hashdb/tsk_hashdb.h tsk/auto/tsk_auto.h -nobase_dist_data_DATA = tsk3/sorter/default.sort tsk3/sorter/freebsd.sort \ - tsk3/sorter/images.sort tsk3/sorter/linux.sort tsk3/sorter/openbsd.sort \ - tsk3/sorter/solaris.sort tsk3/sorter/windows.sort +nobase_dist_data_DATA = tsk/sorter/default.sort tsk/sorter/freebsd.sort \ + tsk/sorter/images.sort tsk/sorter/linux.sort tsk/sorter/openbsd.sort \ + tsk/sorter/solaris.sort tsk/sorter/windows.sort api-docs: - doxygen tsk3/docs/Doxyfile + doxygen tsk/docs/Doxyfile doxygen framework/docs/Doxyfile doxygen bindings/java/doxygen/Doxyfile diff --git a/bindings/java/jni/Makefile.am b/bindings/java/jni/Makefile.am index 581cd6235..55071b916 100644 --- a/bindings/java/jni/Makefile.am +++ b/bindings/java/jni/Makefile.am @@ -3,7 +3,7 @@ EXTRA_DIST = .indent.pro lib_LTLIBRARIES = libtsk_jni.la libtsk_jni_la_SOURCES = dataModel_SleuthkitJNI.cpp dataModel_SleuthkitJNI.h -libtsk_jni_la_LIBADD = ../../../tsk3/libtsk3.la +libtsk_jni_la_LIBADD = ../../../tsk/libtsk.la indent: indent *.cpp *.h diff --git a/bindings/java/jni/dataModel_SleuthkitJNI.cpp b/bindings/java/jni/dataModel_SleuthkitJNI.cpp index d9c852ed0..7059c5aae 100644 --- a/bindings/java/jni/dataModel_SleuthkitJNI.cpp +++ b/bindings/java/jni/dataModel_SleuthkitJNI.cpp @@ -8,8 +8,8 @@ ** This software is distributed under the Common Public License 1.0 ** */ -#include "tsk3/tsk_tools_i.h" -#include "tsk3/auto/tsk_case_db.h" +#include "tsk/tsk_tools_i.h" +#include "tsk/auto/tsk_case_db.h" #include "jni.h" #include "dataModel_SleuthkitJNI.h" #include <locale.h> diff --git a/config/config.guess b/config/config.guess index e970e83b0..405bc3235 120000 --- a/config/config.guess +++ b/config/config.guess @@ -1 +1 @@ -/usr/bin/../share/automake-1.10/config.guess \ No newline at end of file +/usr/share/automake-1.11/config.guess \ No newline at end of file diff --git a/config/config.sub b/config/config.sub index 4e81bb928..4d47fbcbc 120000 --- a/config/config.sub +++ b/config/config.sub @@ -1 +1 @@ -/usr/bin/../share/automake-1.10/config.sub \ No newline at end of file +/usr/share/automake-1.11/config.sub \ No newline at end of file diff --git a/config/depcomp b/config/depcomp index 482b85237..b0ad20c05 120000 --- a/config/depcomp +++ b/config/depcomp @@ -1 +1 @@ -/usr/bin/../share/automake-1.10/depcomp \ No newline at end of file +/usr/share/automake-1.11/depcomp \ No newline at end of file diff --git a/config/ltmain.sh b/config/ltmain.sh index 64b52189d..41599586b 120000 --- a/config/ltmain.sh +++ b/config/ltmain.sh @@ -1 +1 @@ -/usr/bin/../share/libtool/config/ltmain.sh \ No newline at end of file +/usr/share/libtool/config/ltmain.sh \ No newline at end of file diff --git a/config/missing b/config/missing index ce84ec4e8..20bc5b0ed 120000 --- a/config/missing +++ b/config/missing @@ -1 +1 @@ -/usr/bin/../share/automake-1.10/missing \ No newline at end of file +/usr/share/automake-1.11/missing \ No newline at end of file diff --git a/configure.ac b/configure.ac index 4a1bd802a..b3268112b 100644 --- a/configure.ac +++ b/configure.ac @@ -13,8 +13,8 @@ m4_include([m4/ac_prog_javac_works.m4]) m4_include([m4/ac_prog_javac.m4]) -AC_CONFIG_SRCDIR([tsk3/base/tsk_base.h]) -AC_CONFIG_HEADERS([tsk3/tsk_config.h]) +AC_CONFIG_SRCDIR([tsk/base/tsk_base.h]) +AM_CONFIG_HEADERS([tsk/tsk_config.h]) AC_CONFIG_AUX_DIR(config) AM_INIT_AUTOMAKE([foreign]) AM_PATH_CPPUNIT(1.12.1) @@ -202,32 +202,32 @@ if test "x$JAVAC" != x; then fi AM_CONDITIONAL([X_JNI],[test "x$JNI_CPPFLAGS" != x]) -AC_CONFIG_COMMANDS([tsk3/tsk_incs.h], +AC_CONFIG_COMMANDS([tsk/tsk_incs.h], [ - echo "#ifndef _TSK_INCS_H" > tsk3/tsk_incs.h - echo "#define _TSK_INCS_H" >> tsk3/tsk_incs.h - echo "// automatically by ./configure" >> tsk3/tsk_incs.h - echo "// Contains the config.h data needed by programs that use libtsk" >> tsk3/tsk_incs.h - echo "" >> tsk3/tsk_incs.h + echo "#ifndef _TSK_INCS_H" > tsk/tsk_incs.h + echo "#define _TSK_INCS_H" >> tsk/tsk_incs.h + echo "// automatically by ./configure" >> tsk/tsk_incs.h + echo "// Contains the config.h data needed by programs that use libtsk" >> tsk/tsk_incs.h + echo "" >> tsk/tsk_incs.h if test x$ac_cv_header_unistd_h = xyes; then - echo "#include <unistd.h>" >> tsk3/tsk_incs.h + echo "#include <unistd.h>" >> tsk/tsk_incs.h fi if test x$ac_cv_header_inttypes_h = xyes; then - echo "#ifndef __STDC_FORMAT_MACROS" >> tsk3/tsk_incs.h - echo "#define __STDC_FORMAT_MACROS" >> tsk3/tsk_incs.h - echo "#endif" >> tsk3/tsk_incs.h - echo "#include <inttypes.h>" >> tsk3/tsk_incs.h + echo "#ifndef __STDC_FORMAT_MACROS" >> tsk/tsk_incs.h + echo "#define __STDC_FORMAT_MACROS" >> tsk/tsk_incs.h + echo "#endif" >> tsk/tsk_incs.h + echo "#include <inttypes.h>" >> tsk/tsk_incs.h fi if test x$ac_cv_header_sys_param_h = xyes; then - echo "#include <sys/param.h>" >> tsk3/tsk_incs.h + echo "#include <sys/param.h>" >> tsk/tsk_incs.h fi if test x$ax_pthread_ok = xyes; then - echo "#define TSK_MULTITHREAD_LIB // set because we have pthreads" >> tsk3/tsk_incs.h + echo "#define TSK_MULTITHREAD_LIB // set because we have pthreads" >> tsk/tsk_incs.h fi - echo "" >> tsk3/tsk_incs.h - echo "#endif" >> tsk3/tsk_incs.h + echo "" >> tsk/tsk_incs.h + echo "#endif" >> tsk/tsk_incs.h ], [ ac_cv_header_unistd_h=$ac_cv_header_unistd_h @@ -237,13 +237,13 @@ AC_CONFIG_COMMANDS([tsk3/tsk_incs.h], ]) AC_CONFIG_FILES([Makefile - tsk3/Makefile - tsk3/base/Makefile - tsk3/img/Makefile - tsk3/vs/Makefile - tsk3/fs/Makefile - tsk3/hashdb/Makefile - tsk3/auto/Makefile + tsk/Makefile + tsk/base/Makefile + tsk/img/Makefile + tsk/vs/Makefile + tsk/fs/Makefile + tsk/hashdb/Makefile + tsk/auto/Makefile tools/Makefile tools/imgtools/Makefile tools/vstools/Makefile diff --git a/framework/Extraction/TskImageFile.h b/framework/Extraction/TskImageFile.h deleted file mode 100755 index 94db88e57..000000000 --- a/framework/Extraction/TskImageFile.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * - * The Sleuth Kit - * - * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] - * Copyright (c) 2010-2012 Basis Technology Corporation. All Rights - * reserved. - * - * This software is distributed under the Common Public License 1.0 - */ - -/** - * \file TskImageFile.h - * Contains the interface for the TskImageFile class. - */ - -#ifndef _TSK_IMAGEFILE_H -#define _TSK_IMAGEFILE_H - -#include "framework_i.h" -#include <vector> -#include <string> - -/** - * An interface to a class that allows file system and low-level - * access to a disk image. - * It supports opening split image files, extracting file system - * information from the image and extracting data for a specific file - * or for a range of sectors. You must call one of the open() methods - * before using any of the other methods in the interface. - */ -class TSK_FRAMEWORK_API TskImageFile -{ -public: - /** - * You must call one of the open() methods after creating the object. - */ - TskImageFile(); - - virtual ~TskImageFile(); - - /** - * Open the disk image represented by one or more actual files. - * @param imageFiles One or more files that make up the disk image - * @return 0 on success and -1 on error - */ - virtual int open(const std::vector<std::wstring> &imageFiles) = 0; - - /** - * Open the disk image at the following path using TSK_TCHAR type. - * @param imageFile Path to image (or first in a set of images). - * @return 0 on success and -1 on error - */ - virtual int open(const TSK_TCHAR *imageFile) = 0; - - /** - * open the images at the paths saved in ImgDB - * @returns 0 on success and -1 on error - */ - virtual int open() = 0; - - /// Close the disk image. - virtual void close() = 0; - - /// Return the file name(s) that make up the image. - virtual std::vector<std::wstring> filenames() const = 0; - - /** - * Analyze the volume and file systems in the opened images and - * populate the TskImgDB instance registered with TskServices. This - * will not perform file carving. - * @returns 1 if there was a major error that prevented any extraction. 0 will - * be returned if there were minor errors during extraction or if there were - * no errors. - */ - virtual int extractFiles() = 0; - - /** - * Return the data located at the given sector offset in the disk image. - * @param sect_start Sector offset into image from which to return data - * @param sect_len Number of sectors to read - * @param buffer A buffer into which data will be placed. Must be at - * least len * 512 large - * @return Number of sectors read or -1 on error - */ - virtual int getSectorData(const uint64_t sect_start, - const uint64_t sect_len, - char *buffer) = 0; - - /** - * Return the data located at the given byte offset in the disk image. - * @param byte_start Byte offset into image from which to return data - * @param byte_len Number of bytes to read - * @param buffer A buffer into which data will be placed. Must be at - * least byte_len large - * @return Number of bytes read or -1 on error - */ - virtual int getByteData(const uint64_t byte_start, - const uint64_t byte_len, - char *buffer) = 0; - - /** - * Provides access to the content of a specific file that was extracted from the disk image. - * - * @param fileId ID of the file (can be found in database) - * @returns A handle to the file or -1 on error. - */ - virtual int openFile(const uint64_t fileId) = 0; - - /** - * Reads content of a file that was opened with openFile(). - * @param handle File handle that was returned by an earlier call to openFile() - * @param byte_offset Starting byte offset from which to read data - * @param byte_len The number of bytes to read - * @param buffer A buffer into which data will be placed. Must be at least - * byte_len bytes. - * @return Number of bytes read or -1 on error - */ - virtual int readFile(const int handle, - const uint64_t byte_offset, - const size_t byte_len, - char * buffer) = 0; - /** - * Closes an opened file. - * @param handle File handle that was returned by an earlier call to openFile() - */ - virtual int closeFile(const int handle) = 0; - -private: - -}; - -#endif diff --git a/framework/INSTALL.txt b/framework/INSTALL.txt new file mode 100644 index 000000000..28edf3815 --- /dev/null +++ b/framework/INSTALL.txt @@ -0,0 +1,89 @@ + The Sleuth Kit Framework + http://www.sleuthkit.org/sleuthkit + + Installation Instructions + + Last Modified: Feb 25, 2013 + + +REQUIREMENTS +============================================================================= +Tested Platform: +- Linux 2.* +- Mac OS X +- Windows + +Build System: +- C/C++ compiler +- GNU Make +- GNU autoconf, automake, and libtool + + +Required Libraries: +The following libraries must be installed before building and install the framework. + +- POCO: POCO is a set of open source C++ classes for building portable applications. +The Sleuth Kit framework uses POCO to handle some basic internal tasks. +Testing has been performed with version 1.4.4 of the POCO libraries. + Available at http://www.pocoproject.org + +INSTALLATION +============================================================================= + +Refer to the BUILDING.txt file in the msvcpp directory for details on building using +Microsoft Visual Studio 2010. + +Before you compile the framework, ensure that you have downloaded +all of the modules. The modules are loaded as git Submodules. Use the +following commands to download all of the modules before compiling: + +% git submodule init +% git submodule update + +The Sleuth Kit framework uses the GNU autotools for building and installation. +There are a few steps to this process. First, run the 'configure' +script in the framework directory. + + $ ./configure + +If there were no errors, then run 'make'. + + $ make + +The 'make' process will take a while and will build the framework and submodules. +When this process is complete, the executables will be located in the "tools" directory +and the module libraries will be located in the "runtime" directory. +To install them, type 'make install'. + + $ make install + +By default, this will copy everything in to the /usr/local/ structure. +So, the executables will be in '/usr/local/bin'. This directory will +need to be in your PATH if you want to run the TSK framework commands without +specifying '/usr/local/bin' everytime. + + +If you get an error like: + + libtool: Version mismatch error. This is libtool 2.2.10, but the + libtool: definition of this LT_INIT comes from libtool 2.2.4. + libtool: You should recreate aclocal.m4 with macros from libtool 2.2.10 + libtool: and run autoconf again. + +Run: + ./bootstrap + +and then go back to running configure and make. To run 'bootstrap', +you'll need to have the autotools installed (see the list at the +top of this page). + + +CONFIGURE OPTIONS +----------------------------------------------------------------------------- +The framework doesn't support extra arguments to 'configure' + + +----------------------------------------------------------------------------- + +Brian Carrier +carrier <at> sleuthkit <dot> org diff --git a/framework/Makefile.am b/framework/Makefile.am index a0e62cedc..92f057138 100644 --- a/framework/Makefile.am +++ b/framework/Makefile.am @@ -1,10 +1,86 @@ -SUBDIRS = Utilities +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = tsk/framework tools modules +nobase_include_HEADERS = \ + tsk/framework/framework.h \ + tsk/framework/framework_i.h \ + tsk/framework/TskVersionInfo.h \ + tsk/framework/extraction/CarveExtract.h \ + tsk/framework/extraction/CarvePrep.h \ + tsk/framework/extraction/TskAutoImpl.h \ + tsk/framework/extraction/TskCarveExtractScalpel.h \ + tsk/framework/extraction/TskCarvePrepSectorConcat.h \ + tsk/framework/extraction/TskImageFile.h \ + tsk/framework/extraction/TskImageFileTsk.h \ + tsk/framework/file/TskFile.h \ + tsk/framework/file/TskFileManager.h \ + tsk/framework/file/TskFileManagerImpl.h \ + tsk/framework/file/TskFileTsk.h \ + tsk/framework/pipeline/TskExecutableModule.h \ + tsk/framework/pipeline/TskFileAnalysisPipeline.h \ + tsk/framework/pipeline/TskFileAnalysisPluginModule.h \ + tsk/framework/pipeline/TskModule.h \ + tsk/framework/pipeline/TskPipeline.h \ + tsk/framework/pipeline/TskPipelineManager.h \ + tsk/framework/pipeline/TskPluginModule.h \ + tsk/framework/pipeline/TskReportPipeline.h \ + tsk/framework/pipeline/TskReportPluginModule.h \ + tsk/framework/services/Log.h \ + tsk/framework/services/Scheduler.h \ + tsk/framework/services/TskBlackboardArtifact.h \ + tsk/framework/services/TskBlackboardAttribute.h \ + tsk/framework/services/TskBlackboard.h \ + tsk/framework/services/TskDBBlackboard.h \ + tsk/framework/services/TskImgDB.h \ + tsk/framework/services/TskImgDBSqlite.h \ + tsk/framework/services/TskSchedulerQueue.h \ + tsk/framework/services/TskServices.h \ + tsk/framework/services/TskSystemProperties.h \ + tsk/framework/services/TskSystemPropertiesImpl.h \ + tsk/framework/utilities/SectorRuns.h \ + tsk/framework/utilities/TskException.h \ + tsk/framework/utilities/TskModuleDev.h \ + tsk/framework/utilities/TskUtilities.h \ + tsk/framework/utilities/UnallocRun.h -# Merge the libraries into one -lib_LTLIBRARIES = libtskframework.la -libtskframework_la_SOURCES = -libtskframework_la_LIBADD = Utilities/libfwutil.la -# current:revision:age -libtskframework_la_LDFLAGS = -version-info 0:0:0 +if DARWIN + PLATFORM=mac + LIBEXT=dylib +else + PLATFORM=linux + LIBEXT=so +endif + +# Copy the modules libraries into the Modules directory +bin_PROGRAMS = copy_libs copy_configs + +runtime/modules: + -mkdir -p $@ + +copy_libs: runtime/modules + (cd $<; ln -sf ../../modules/c_*/.libs/libtsk*Module.* .) + (cd $<; ln -sf ../../tsk/framework/.libs/libtskframework.* .) + (cd $<; ln -sf ../../../tsk/.libs/libtsk.* .) + +copy_configs: + -mkdir -p runtime + cp SampleConfig/framework_config_$(PLATFORM)dev.xml runtime/framework_config.xml + if ! test -d SampleConfig/tmp; then \ + mkdir SampleConfig/tmp; \ + else \ + if test -f SampleConfig/tmp/framework_config.xml; then \ + rm -f SampleConfig/tmp/framework_config.xml; \ + fi \ + fi + +installdir = ${datadir}/tsk +dist_install_DATA = SampleConfig/tmp/framework_config.xml SampleConfig/pipeline_config.xml + +SampleConfig/tmp/framework_config.xml: + sed \ + -e 's?#CONFIGDIRPATH#?$(DESTDIR)/usr/local/share/tsk?' \ + -e 's?#MODULEDIRPATH#?$(DESTDIR)/usr/local/lib?' \ + -e 's?#MODULECONFIGDIRPATH#?$(DESTDIR)/usr/local/share/tsk?' \ + SampleConfig/framework_config_template.xml \ + > $@ diff --git a/framework/SampleConfig/framework_config_linuxdev.xml b/framework/SampleConfig/framework_config_linuxdev.xml new file mode 100644 index 000000000..0bd5e86f2 --- /dev/null +++ b/framework/SampleConfig/framework_config_linuxdev.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- General version of the framework config. Contains all possible settings --> +<!-- For more information please consult the TskSystemProperties::PredefinedProperty member enumeration documentation at http://www.sleuthkit.org/sleuthkit/docs/framework-docs/classTskSystemProperties.html --> +<TSK_FRAMEWORK_CONFIG> + <CONFIG_DIR>#PROG_DIR#/../../../SampleConfig</CONFIG_DIR> + <MODULE_DIR>#PROG_DIR#/../../../runtime/modules</MODULE_DIR> + <MODULE_CONFIG_DIR>#PROG_DIR#/../../../runtime/modules_config</MODULE_CONFIG_DIR> + <PIPELINE_CONFIG_FILE>#CONFIG_DIR#/pipeline_config.xml</PIPELINE_CONFIG_FILE> +</TSK_FRAMEWORK_CONFIG> diff --git a/framework/SampleConfig/framework_config_macdev.xml b/framework/SampleConfig/framework_config_macdev.xml new file mode 100644 index 000000000..e50c5f6ab --- /dev/null +++ b/framework/SampleConfig/framework_config_macdev.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- General version of the framework config. Contains all possible settings --> +<!-- For more information please consult the TskSystemProperties::PredefinedProperty member enumeration documentation at http://www.sleuthkit.org/sleuthkit/docs/framework-docs/classTskSystemProperties.html --> +<TSK_FRAMEWORK_CONFIG> + <CONFIG_DIR>#PROG_DIR#/../SampleConfig</CONFIG_DIR> + <MODULE_DIR>#PROG_DIR#/Modules</MODULE_DIR> + <PIPELINE_CONFIG_FILE>#CONFIG_DIR#/pipeline_config_mac.xml</PIPELINE_CONFIG_FILE> +</TSK_FRAMEWORK_CONFIG> diff --git a/framework/SampleConfig/framework_config_template.xml b/framework/SampleConfig/framework_config_template.xml new file mode 100644 index 000000000..6355eeb78 --- /dev/null +++ b/framework/SampleConfig/framework_config_template.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Template of framework config. Contains enough settings for installation. --> +<!-- For more information please consult the TskSystemProperties::PredefinedProperty member enumeration documentation at http://www.sleuthkit.org/sleuthkit/docs/framework-docs/classTskSystemProperties.html --> +<TSK_FRAMEWORK_CONFIG> + <CONFIG_DIR>#CONFIGDIRPATH#</CONFIG_DIR> + <MODULE_DIR>#MODULEDIRPATH#</MODULE_DIR> + <MODULE_CONFIG_DIR>#MODULECONFIGDIRPATH#</MODULE_CONFIG_DIR> + <PIPELINE_CONFIG_FILE>#CONFIG_DIR#/pipeline_config.xml</PIPELINE_CONFIG_FILE> +</TSK_FRAMEWORK_CONFIG> diff --git a/framework/SampleConfig/framework_config_win32dev.xml b/framework/SampleConfig/framework_config_win32dev.xml index 7fe65548f..2530836bd 100755 --- a/framework/SampleConfig/framework_config_win32dev.xml +++ b/framework/SampleConfig/framework_config_win32dev.xml @@ -2,6 +2,7 @@ <!-- Framework config that is used when running from the VS dev environment - gets copied into debug/release folder. - contains only relevant settings --> <!-- For more information please consult the TskSystemProperties::PredefinedProperty member enumeration documentation at http://www.sleuthkit.org/sleuthkit/docs/framework-docs/classTskSystemProperties.html --> <TSK_FRAMEWORK_CONFIG> - <CONFIG_DIR>#PROG_DIR#\..\..\..\SampleConfig</CONFIG_DIR> - <MODULE_DIR>#PROG_DIR#</MODULE_DIR> + <CONFIG_DIR>#PROG_DIR#\..\SampleConfig</CONFIG_DIR> + <MODULE_DIR>#PROG_DIR#</MODULE_DIR> + <MODULE_CONFIG_DIR>#PROG_DIR#</MODULE_CONFIG_DIR> </TSK_FRAMEWORK_CONFIG> diff --git a/framework/SampleConfig/pipeline_config.xml b/framework/SampleConfig/pipeline_config.xml index f82fa2209..247ef6759 100755 --- a/framework/SampleConfig/pipeline_config.xml +++ b/framework/SampleConfig/pipeline_config.xml @@ -2,24 +2,24 @@ <!-- Contains only the modules that ship with TSK --> <PIPELINE_CONFIG> <PIPELINE type="FileAnalysis"> - <MODULE order="1" type="plugin" location="HashCalcModule"/> -<!--<MODULE order="2" type="plugin" location="TskHashLookupModule" arguments="TODO: See README for how to create NSRL index file"/>--> + <MODULE order="1" type="plugin" location="tskHashCalcModule"/> +<!--<MODULE order="2" type="plugin" location="tskHashLookupModule" arguments="TODO: See README for how to create NSRL index file"/>--> - <MODULE order="3" type="plugin" location="FileTypeSigModule"/> - <MODULE order="4" type="plugin" location="EntropyModule"/> - <MODULE order="5" type="plugin" location="ZipExtractionModule"/> - <MODULE order="6" type="plugin" location="LibExifModule"/> + <MODULE order="3" type="plugin" location="tskFileTypeSigModule"/> + <MODULE order="4" type="plugin" location="tskEntropyModule"/> + <MODULE order="5" type="plugin" location="tskZipExtractionModule"/> + <MODULE order="6" type="plugin" location="tskLibExifModule"/> </PIPELINE> <PIPELINE type="PostProcessing"> <!--This pipeline configuration assumes that the RegRipper executable is named rip.exe and is present in the program directory--> - <!--<MODULE order="1" type="plugin" location="RegRipperModule" arguments="-e #PROG_DIR#\\RegRipper\\rip.exe; -o #MODULE_OUT_DIR#\\RegRipper\\"/>--> + <!--<MODULE order="1" type="plugin" location="tskRegRipperModule" arguments="-e #PROG_DIR#/RegRipper/rip.exe; -o #MODULE_OUT_DIR#/RegRipper/"/>--> - <MODULE order="2" type="plugin" location="InterestingFilesModule" arguments="#MODULE_DIR#\\InterestingFilesModule\\interesting_files.xml"/> + <MODULE order="2" type="plugin" location="tskInterestingFilesModule"/> - <MODULE order="3" type="plugin" location="SaveInterestingFilesModule"/> + <MODULE order="3" type="plugin" location="tskSaveInterestingFilesModule"/> - <MODULE order="4" type="plugin" location="SummaryReportModule"/> + <MODULE order="4" type="plugin" location="tskSummaryReportModule"/> </PIPELINE> </PIPELINE_CONFIG> diff --git a/framework/Services/Log.cpp b/framework/Services/Log.cpp deleted file mode 100755 index 9a82cddd9..000000000 --- a/framework/Services/Log.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * The Sleuth Kit - * - * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] - * Copyright (c) 2010-2012 Basis Technology Corporation. All Rights - * reserved. - * - * This software is distributed under the Common Public License 1.0 - */ - -#include <string.h> -#include <errno.h> -#include <share.h> -#include "string.h" -#include "Log.h" -#include "Utilities/TskUtilities.h" -#include "sys/stat.h" - -// @@@ imports for directory creation and deletion -#include "windows.h" - - -Log::Log() -: m_logFile(NULL) -{ - m_filePath[0] = '\0'; -} - - -/** - * Opens a single log file with a default name, based on the time - * that the log was opened. - * @returns 1 on error and 0 on success. - */ -int Log::open() -{ - struct tm newtime; - time_t aclock; - - time(&aclock); // Get time in seconds - localtime_s(&newtime, &aclock); // Convert time to struct tm form - wchar_t filename[MAX_BUFF_LENGTH]; - _snwprintf_s(filename, MAX_BUFF_LENGTH, MAX_BUFF_LENGTH, L"log_%.4d-%.2d-%.2d-%.2d-%.2d-%.2d.txt", - newtime.tm_year + 1900, newtime.tm_mon+1, newtime.tm_mday, - newtime.tm_hour, newtime.tm_min, newtime.tm_sec); - - return open(filename); -} -/** - * Open the single log file at the path specified. All messages - * will be printed to the log. - * @param a_logFileFullPath Path to logfile to open. - * @returns 1 on error and 0 on success. - */ -int Log::open(const wchar_t * a_logFileFullPath) -{ - close(); // if needed - - // open the log file for writing - if ((m_logFile = _wfsopen(a_logFileFullPath, L"a", _SH_DENYWR)) == NULL) { - wprintf(L"The file '%s' cannot be opened.\n", a_logFileFullPath); - return 1; - } - - wcsncpy_s(m_filePath, a_logFileFullPath,MAX_BUFF_LENGTH); - - return 0; -} - -/** - * Close the opened log file. - * @returns 0 on success - */ -int Log::close() -{ - errno_t err = 0; - if (m_logFile) - { - if (err = fclose(m_logFile)) - wprintf(L"The file '%s' was not closed.", m_logFile); - - m_logFile = NULL; - } - - return err; -} - -Log::~Log() -{ - close(); -} - - -void Log::logf(Channel a_channel, char const *format, ...) -{ - va_list args; - va_start(args, format); - - char buf[2048]; -#ifdef TSK_WIN32 - vsnprintf_s(buf, 2048, _TRUNCATE, format, args); -#else - buf[2047] = '\0'; - vsnprintf(buf, 2047, format, args); -#endif - std::string msg(buf); - log(a_channel, buf); - va_end(args); -} - -void Log::log(Channel a_channel, const std::string &a_msg) -{ - std::wstring msg_w = TskUtilities::toUTF16(a_msg); - log(a_channel, msg_w); -} - -void Log::log(Channel a_channel, const std::wstring &a_msg) -{ - wchar_t level[10]; - switch (a_channel) - { - case Error: - wcsncpy_s(level, 10, L"[ERROR]", 7); - break; - case Warn: - wcsncpy_s(level, 10, L"[WARN]", 6); - break; - case Info: - wcsncpy_s(level, 10, L"[INFO]", 6); - break; - } - - struct tm newtime; - time_t aclock; - - time(&aclock); // Get time in seconds - localtime_s(&newtime, &aclock); // Convert time to struct tm form - char timeStr[64]; - _snprintf_s(timeStr, 64, "%.2d/%.2d/%.2d %.2d:%.2d:%.2d", - newtime.tm_mon+1,newtime.tm_mday,newtime.tm_year % 100, - newtime.tm_hour, newtime.tm_min, newtime.tm_sec); - - if (m_logFile) { - fwprintf(m_logFile, L"%S %s %s\n", timeStr, level, a_msg.data()); - fflush(m_logFile); - } - else { - fwprintf(stderr, L"%S %s %s\n", timeStr, level, a_msg.data()); - } -} - -/** - * Return the path to the log file. - * @returns path to log or NULL if log is going to STDERR - */ -const wchar_t * Log::getLogPath() -{ - if (m_logFile) - return (const wchar_t * )&m_filePath; - else - return NULL; -} - diff --git a/framework/TskModules/c_EntropyModule b/framework/TskModules/c_EntropyModule deleted file mode 160000 index 19e24c51f..000000000 --- a/framework/TskModules/c_EntropyModule +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 19e24c51ffa57c528d407cee8e4dac621dda6f34 diff --git a/framework/TskModules/c_InterestingFilesModule b/framework/TskModules/c_InterestingFilesModule deleted file mode 160000 index 7ee01ebcb..000000000 --- a/framework/TskModules/c_InterestingFilesModule +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7ee01ebcbae76c52733931ef0821030268d9a964 diff --git a/framework/TskModules/c_LibExifModule b/framework/TskModules/c_LibExifModule deleted file mode 160000 index 11cef8bb1..000000000 --- a/framework/TskModules/c_LibExifModule +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 11cef8bb1374b9402033754583813f8ba27994b7 diff --git a/framework/TskModules/c_SaveInterestingFilesModule b/framework/TskModules/c_SaveInterestingFilesModule deleted file mode 160000 index 9f06bee79..000000000 --- a/framework/TskModules/c_SaveInterestingFilesModule +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9f06bee797b6c5341ab02c3b81acf3cebb542048 diff --git a/framework/TskModules/c_TskHashLookupModule b/framework/TskModules/c_TskHashLookupModule deleted file mode 160000 index 4dad89172..000000000 --- a/framework/TskModules/c_TskHashLookupModule +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4dad8917296582eaf6b9daf93a3b77ccb0173ffe diff --git a/framework/TskModules/c_ZIPExtractionModule b/framework/TskModules/c_ZIPExtractionModule deleted file mode 160000 index ca05d686a..000000000 --- a/framework/TskModules/c_ZIPExtractionModule +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ca05d686a1a9861bb7d110647bafe46829276e14 diff --git a/framework/aclocal.m4 b/framework/aclocal.m4 index 05af93434..65d0bbc50 100644 --- a/framework/aclocal.m4 +++ b/framework/aclocal.m4 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.12.3 -*- Autoconf -*- - -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# generated automatically by aclocal 1.11.3 -*- 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. @@ -17,7 +18,7 @@ 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'.])]) +To do so, use the procedure documented by the package, typically `autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # @@ -2697,6 +2698,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -3302,7 +3315,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -4114,7 +4127,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4591,6 +4604,9 @@ m4_if([$1], [CXX], [ ;; esac ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -4653,6 +4669,9 @@ dnl Note also adjust exclude_expsyms for C++ above. openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -4874,7 +4893,7 @@ _LT_EOF fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5051,6 +5070,7 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then @@ -5355,7 +5375,7 @@ _LT_EOF _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -8606,22 +8626,25 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) -# Copyright (C) 2002-2012 Free Software Foundation, Inc. +# 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.12' +[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.12.3], [], +m4_if([$1], [1.11.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -8637,22 +8660,24 @@ m4_define([_AM_AUTOCONF_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.12.3])dnl +[AM_AUTOMAKE_VERSION([1.11.3])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-2012 Free Software Foundation, Inc. +# 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/../..'. +# $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 @@ -8671,7 +8696,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # # 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 +# 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, @@ -8697,19 +8722,22 @@ am_aux_dir=`cd $ac_aux_dir && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2012 Free Software Foundation, Inc. +# 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 - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[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 @@ -8728,14 +8756,16 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# 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 +# 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 @@ -8745,7 +8775,7 @@ fi])]) # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# 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 @@ -8758,13 +8788,12 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" 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=]) +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], @@ -8772,8 +8801,8 @@ AC_CACHE_CHECK([dependency style of $depcc], # 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". + # 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 @@ -8813,16 +8842,16 @@ AC_CACHE_CHECK([dependency style of $depcc], : > 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 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h + # 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" + # 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. + # 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 @@ -8831,8 +8860,8 @@ AC_CACHE_CHECK([dependency style of $depcc], test "$am__universal" = false || continue ;; nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. + # 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 @@ -8840,7 +8869,7 @@ AC_CACHE_CHECK([dependency style of $depcc], fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has + # 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} @@ -8888,7 +8917,7 @@ AM_CONDITIONAL([am__fastdep$1], [ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +# 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 @@ -8898,13 +8927,9 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) +[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='\' @@ -8919,12 +8944,14 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# 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 # ------------------------------ @@ -8943,7 +8970,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # 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 + # 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. @@ -8955,19 +8982,21 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. + # 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'`; do + 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"])` @@ -8985,7 +9014,7 @@ AC_DEFUN([_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 +# 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], @@ -8995,12 +9024,15 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# 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. @@ -9045,41 +9077,31 @@ AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[AC_DIAGNOSE([obsolete], -[$0: two- and three-arguments forms are deprecated. For more info, see: -http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[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], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, +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 +[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]) +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([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +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 @@ -9090,35 +9112,28 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -dnl Support for Objective C++ was only introduced in Autoconf 2.65, -dnl but we still cater to Autoconf 2.62. -m4_ifdef([AC_PROG_OBJCXX], -[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl + [_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 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 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], @@ -9146,12 +9161,15 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# 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. @@ -9165,14 +9183,16 @@ if test x"${install_sh}" != xset; then install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST([install_sh])]) +AC_SUBST(install_sh)]) -# Copyright (C) 2003-2012 Free Software Foundation, Inc. +# 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], @@ -9189,17 +9209,20 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 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 5 + # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. -# Default is to disable them, unless 'enable' is passed literally. -# For symmetry, 'disable' may be passed as well. Anyway, the user +# Default is to disable them, unless `enable' is passed literally. +# For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), @@ -9210,11 +9233,10 @@ AC_DEFUN([AM_MAINTAINER_MODE], AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], - [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], - am_maintainer_other[ make rules and dependencies not useful - (and sometimes confusing) to the casual installer])], - [USE_MAINTAINER_MODE=$enableval], - [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) +[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE @@ -9226,12 +9248,14 @@ AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# 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. @@ -9249,7 +9273,7 @@ am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. +# 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 @@ -9276,12 +9300,15 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2012 Free Software Foundation, Inc. +# 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], @@ -9289,6 +9316,7 @@ AC_DEFUN([AM_MISSING_PROG], $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. @@ -9309,18 +9337,50 @@ 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]) + 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-2012 Free Software Foundation, Inc. +# 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], @@ -9330,7 +9390,7 @@ AC_DEFUN([_AM_MANGLE_OPTION], # -------------------- # 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])]) +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ @@ -9346,16 +9406,22 @@ AC_DEFUN([_AM_IF_OPTION], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# 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=' @@ -9366,40 +9432,32 @@ case `pwd` in esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac -# Do 'set' in a subshell so we don't clobber the current shell's +# 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 ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - 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 - 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 - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done + 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 @@ -9409,58 +9467,46 @@ else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) +AC_MSG_RESULT(yes)]) -# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# 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 +# 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 +# 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 +# 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'. +# 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-2012 Free Software Foundation, Inc. +# 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. @@ -9474,16 +9520,18 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2012 Free Software Foundation, Inc. +# 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'. +# 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 @@ -9506,7 +9554,7 @@ AC_MSG_CHECKING([how to create a $1 tar archive]) _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 '-'. +# Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in diff --git a/framework/bootstrap b/framework/bootstrap index db001054c..524881723 100755 --- a/framework/bootstrap +++ b/framework/bootstrap @@ -3,3 +3,13 @@ aclocal \ && (libtoolize || glibtoolize) \ && automake --foreign --add-missing \ && autoconf + +for m in `ls modules` +do + (cd modules; + if test -d $m; then + echo $m + (cd $m; sh ./bootstrap) + fi; + ) +done diff --git a/framework/configure.ac b/framework/configure.ac index d6659f9eb..6d0366b62 100644 --- a/framework/configure.ac +++ b/framework/configure.ac @@ -1,10 +1,10 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_PREREQ([2.69]) +AC_PREREQ([2.59]) AC_INIT(sleuthkitframework, 4.0.0) -AC_CONFIG_SRCDIR([framework.h]) +AC_CONFIG_SRCDIR([tsk/framework/framework.h]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR(config) AM_INIT_AUTOMAKE([foreign]) @@ -13,8 +13,34 @@ AM_MAINTAINER_MODE AC_CONFIG_MACRO_DIR([m4]) # Checks for programs. +AC_LANG([C++]) AC_PROG_CXX AC_PROG_CC +AC_PROG_CPP + +# Check for OS +AC_CANONICAL_HOST +AM_CONDITIONAL([DARWIN],false) +case $host_os in + darwin*) + # Mac + AM_CONDITIONAL([DARWIN],true) + ;; + linux*) + # Linux + # nothing special to do for now + ;; + *) + # Default Case + AC_MSG_ERROR([Your platform is not currently supported]) + ;; +esac + +# Not all compilers include /usr/local in the include and link path +if test -e /usr/local/include; then + CFLAGS="$CFLAGS -I/usr/local/include" + LDFLAGS="$LDFLAGS -L/usr/local/lib" +fi # Checks for libraries. @@ -22,7 +48,7 @@ AC_PROG_CC AC_CHECK_HEADERS([stdlib.h string.h]) # Checks for typedefs, structures, and compiler characteristics. -AC_CHECK_HEADER_STDBOOL +# AC_CHECK_HEADER_STDBOOL AC_C_INLINE AC_TYPE_INT32_T AC_TYPE_INT64_T @@ -37,6 +63,124 @@ AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS([memset strtoul strtoull]) -AC_CONFIG_FILES([Makefile Utilities/Makefile]) +# Check for methods in library and check for header files +AC_CHECK_HEADERS([Poco/Foundation.h Poco/Net/HTTPCookie.h Poco/DOM/Entity.h Poco/Util/Timer.h],[],AC_MSG_ERROR([Poco include files not found.])) + +AC_CHECK_LIB([PocoFoundation],[main],[HAVE_POCOFOUNDATION=1],AC_MSG_ERROR([PocoFoundation library not found.])) +if test "$HAVE_POCOFOUNDATION"; then + save_libs="${LIBS}" + LIBS="-lPocoFoundation" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include "Poco/UnicodeConverter.h"], + [std::wstring wstr; Poco::UnicodeConverter::toUTF16("hello", wstr);] + )], + [LIBS="$LIBS $save_libs"], + [AC_MSG_ERROR([linking with PocoFoundation failed.])] + ) +fi + +AC_CHECK_LIB([PocoUtil],[main],[HAVE_POCOUTIL=1],AC_MSG_ERROR([PocoUtil library not found.])) +if test "$HAVE_POCOUTIL"; then + save_libs="${LIBS}" + LIBS="-lPocoUtil" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include "Poco/Util/Option.h"], + [Poco::Util::Option();] + )], + [LIBS="$LIBS $save_libs"], + [AC_MSG_ERROR([linking with PocoUtil failed.])] + ) +fi + +AC_CHECK_LIB([PocoXML],[main],[HAVE_POCOXML=1],AC_MSG_ERROR([PocoXML library not found.])) +if test "$HAVE_POCOXML"; then + save_libs="${LIBS}" + LIBS="-lPocoXML" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include "Poco/DOM/DOMParser.h"], + [Poco::XML::DOMParser().parse("http://www.google.com");] + )], + [LIBS="$LIBS $save_libs"], + [AC_MSG_ERROR([linking with PocoXML failed.])] + ) +fi + +AC_CHECK_LIB([PocoNet],[main],[HAVE_POCONET=1],AC_MSG_ERROR([PocoNet library not found.])) +if test "$HAVE_POCONET"; then + save_libs="${LIBS}" + LIBS="-lPocoNet" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include "Poco/Net/HTTPClientSession.h"], + [Poco::Net::HTTPClientSession();] + )], + [LIBS="$LIBS $save_libs"], + [AC_MSG_ERROR([linking with PocoNET failed.])] + ) +fi + +AC_CHECK_LIB([PocoZip],[main],[HAVE_POCOZIP=1],AC_MSG_ERROR([PocoZip library not found.])) +if test "$HAVE_POCOZIP"; then + save_libs="${LIBS}" + LIBS="-lPocoZip" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include "Poco/Zip/ZipArchive.h"], + [Poco::Zip::ZipArchive::FileHeaders::const_iterator fh;] + )], + [LIBS="$LIBS $save_libs"], + [AC_MSG_ERROR([linking with PocoZip failed.])] + ) +fi + +AC_SUBST(TSK_INCLUDE, "-I../../..") +AC_SUBST(FW_INCLUDE, "-I../..") +AC_SUBST(FW_LIBS, "../../tsk/framework/libtskframework.la ../../../tsk/libtsk.la") + +# RUNTIME_MODULES_CONFIG_DIR +AC_SUBST(RUNTIME_MODULES_CONFIG_DIR, "../../runtime/modules_config") + +# MODULES_ROOT_DIR is the tsk/framework/modules directory +# MODULES_ROOT_DIR is relative to RUNTIME_MODULES_CONFIG_DIR/<module_name> +# so that each module can do the following to populate config files to the runtime directory. +# mkdir -p $(RUNTIME_MODULES_CONFIG_DIR)/<module_name> +# (cd $(RUNTIME_MODULES_CONFIG_DIR)/<module_name>; ln -s $(MODULES_ROOT_DIR)/c_foobarModule/foobar_config.xml .) +AC_SUBST(MODULES_ROOT_DIR, "../../../modules") + +for i in `ls modules/` +do + if test -d "modules/${i}"; then + case ${i} in + c_EntropyModule) AC_CONFIG_SUBDIRS([modules/c_EntropyModule]) ;; + c_FileTypeSigModule) AC_CONFIG_SUBDIRS([modules/c_FileTypeSigModule]) ;; + c_HashCalcModule) AC_CONFIG_SUBDIRS([modules/c_HashCalcModule]) ;; + c_InterestingFilesModule) AC_CONFIG_SUBDIRS([modules/c_InterestingFilesModule]) ;; + c_LibExifModule) AC_CONFIG_SUBDIRS([modules/c_LibExifModule]) ;; + c_RegRipperModule) AC_CONFIG_SUBDIRS([modules/c_RegRipperModule]) ;; + c_SaveInterestingFilesModule) AC_CONFIG_SUBDIRS([modules/c_SaveInterestingFilesModule]) ;; + c_SummaryReportModule) AC_CONFIG_SUBDIRS([modules/c_SummaryReportModule]) ;; + c_TskHashLookupModule) AC_CONFIG_SUBDIRS([modules/c_TskHashLookupModule]) ;; + c_ZIPExtractionModule) AC_CONFIG_SUBDIRS([modules/c_ZIPExtractionModule]) ;; + *) + AC_MSG_WARN([Unknown project (${i}) won't be configured automatically.]) ;; + esac + fi +done + +AC_CONFIG_FILES([Makefile + tsk/framework/Makefile + tsk/framework/extraction/Makefile + tsk/framework/file/Makefile + tsk/framework/pipeline/Makefile + tsk/framework/services/Makefile + tsk/framework/utilities/Makefile + tools/Makefile + tools/tsk_analyzeimg/Makefile + tools/tsk_validatepipeline/Makefile + modules/Makefile +]) AC_OUTPUT diff --git a/framework/docs/Doxyfile b/framework/docs/Doxyfile index b7302442c..d11c89538 100644 --- a/framework/docs/Doxyfile +++ b/framework/docs/Doxyfile @@ -32,7 +32,7 @@ PROJECT_NAME = "The Sleuth Kit Framework" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 4.0 +PROJECT_NUMBER = 4.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer @@ -673,11 +673,11 @@ INPUT = framework/docs/main.dox \ framework/docs/fw_extract.dox \ framework/docs/fw_pipelines.dox \ framework/docs/fw_examples.dox \ - framework/Extraction \ - framework/File \ - framework/Pipeline \ - framework/Services \ - framework/Utilities + framework/tsk/framework/extraction \ + framework/tsk/framework/file \ + framework/tsk/framework/pipeline \ + framework/tsk/framework/services \ + framework/tsk/framework/utilities # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is diff --git a/framework/docs/sample_pipeline_config_file.dox b/framework/docs/sample_pipeline_config_file.dox index fbb0d5345..2bcc9d4a4 100755 --- a/framework/docs/sample_pipeline_config_file.dox +++ b/framework/docs/sample_pipeline_config_file.dox @@ -6,24 +6,24 @@ <!-- Contains only the modules that ship with TSK --> <PIPELINE_CONFIG> <PIPELINE type="FileAnalysis"> - <MODULE order="1" type="plugin" location="HashCalcModule"/> -<!--<MODULE order="2" type="plugin" location="TskHashLookupModule" arguments="TODO: See README for how to create NSRL index file"/>--> + <MODULE order="1" type="plugin" location="tskHashCalcModule"/> +<!--<MODULE order="2" type="plugin" location="tskHashLookupModule" arguments="TODO: See README for how to create NSRL index file"/>--> - <MODULE order="3" type="plugin" location="FileTypeSigModule"/> - <MODULE order="4" type="plugin" location="EntropyModule"/> - <MODULE order="5" type="plugin" location="ZipExtractionModule"/> - <MODULE order="6" type="plugin" location="LibExifModule"/> + <MODULE order="3" type="plugin" location="tskFileTypeSigModule"/> + <MODULE order="4" type="plugin" location="tskEntropyModule"/> + <MODULE order="5" type="plugin" location="tskZipExtractionModule"/> + <MODULE order="6" type="plugin" location="tskLibExifModule"/> </PIPELINE> <PIPELINE type="PostProcessing"> <!--This pipeline configuration assumes that the RegRipper executable is named rip.exe and is present in the program directory--> - <!--<MODULE order="1" type="plugin" location="RegRipperModule" arguments="-e #PROG_DIR#\\RegRipper\\rip.exe; -o #MODULE_OUT_DIR#\\RegRipper\\"/>--> + <!--<MODULE order="1" type="plugin" location="tskRegRipperModule" arguments="-e #PROG_DIR#/RegRipper/rip.exe; -o #MODULE_OUT_DIR#/RegRipper/"/>--> - <MODULE order="2" type="plugin" location="InterestingFilesModule" arguments="#MODULE_DIR#\\InterestingFilesModule\\interesting_files.xml"/> + <MODULE order="2" type="plugin" location="tskInterestingFilesModule" arguments="#MODULE_CONFIG_DIR#/InterestingFilesModule/interesting_files.xml"/> - <MODULE order="3" type="plugin" location="SaveInterestingFilesModule"/> + <MODULE order="3" type="plugin" location="tskSaveInterestingFilesModule"/> - <MODULE order="4" type="plugin" location="SummaryReportModule"/> + <MODULE order="4" type="plugin" location="tskSummaryReportModule"/> </PIPELINE> </PIPELINE_CONFIG> @@ -31,4 +31,4 @@ \endcode -*/ \ No newline at end of file +*/ diff --git a/framework/framework.h b/framework/framework.h deleted file mode 100755 index 34d06219f..000000000 --- a/framework/framework.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * The Sleuth Kit - * - * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] - * Copyright (c) 2010-2012 Basis Technology Corporation. All Rights - * reserved. - * - * This software is distributed under the Common Public License 1.0 - */ - -#ifndef _TSK_OSSLIBTSK_H -#define _TSK_OSSLIBTSK_H - -/** - * Include this file when incorporating the framework into an - * application. - */ - -#include "framework_i.h" - -#include "Services/TskServices.h" -#include "Services/Log.h" -#include "Services/TskImgDB.h" -#include "Services/Scheduler.h" -#include "Services/TskSystemProperties.h" -#include "Services/TskBlackboard.h" -#include "Services/TskDBBlackboard.h" -#include "Utilities/SectorRuns.h" -#include "Utilities/TskException.h" -#include "Utilities/TskUtilities.h" -#include "Extraction/TskImageFileTsk.h" -#include "Extraction/CarveExtract.h" -#include "Extraction/CarvePrep.h" -#include "File/TskFileManager.h" -#include "File/TskFile.h" -#include "Pipeline/TskPipelineManager.h" -#include "Pipeline/TskPipeline.h" -#include "Pipeline/TskFileAnalysisPipeline.h" -#include "Pipeline/TskReportPipeline.h" -#include "Pipeline/TskModule.h" -#include "Pipeline/TskExecutableModule.h" -#include "Pipeline/TskPluginModule.h" -#include "Pipeline/TskFileAnalysisPluginModule.h" -#include "Pipeline/TskReportPluginModule.h" - -#endif diff --git a/framework/modules/Makefile.am b/framework/modules/Makefile.am new file mode 100644 index 000000000..6f643bab7 --- /dev/null +++ b/framework/modules/Makefile.am @@ -0,0 +1,12 @@ +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS= c_EntropyModule \ + c_FileTypeSigModule \ + c_HashCalcModule \ + c_LibExifModule \ + c_InterestingFilesModule \ + c_ZIPExtractionModule \ + c_SaveInterestingFilesModule \ + c_SummaryReportModule \ + c_TskHashLookupModule \ + c_RegRipperModule + diff --git a/framework/TskModules/README.txt b/framework/modules/README.txt similarity index 100% rename from framework/TskModules/README.txt rename to framework/modules/README.txt diff --git a/framework/modules/c_EntropyModule b/framework/modules/c_EntropyModule new file mode 160000 index 000000000..080230f6e --- /dev/null +++ b/framework/modules/c_EntropyModule @@ -0,0 +1 @@ +Subproject commit 080230f6e3e9becbbca907bdefb437f5249b8556 diff --git a/framework/modules/c_FileTypeSigModule b/framework/modules/c_FileTypeSigModule new file mode 160000 index 000000000..8880aa2dc --- /dev/null +++ b/framework/modules/c_FileTypeSigModule @@ -0,0 +1 @@ +Subproject commit 8880aa2dc98c66eb1c0bed98cb0166556669c160 diff --git a/framework/modules/c_HashCalcModule b/framework/modules/c_HashCalcModule new file mode 160000 index 000000000..e37dcfb13 --- /dev/null +++ b/framework/modules/c_HashCalcModule @@ -0,0 +1 @@ +Subproject commit e37dcfb13a885b34643a01b30fcb9f2751dfa06d diff --git a/framework/modules/c_InterestingFilesModule b/framework/modules/c_InterestingFilesModule new file mode 160000 index 000000000..5b5df7f7d --- /dev/null +++ b/framework/modules/c_InterestingFilesModule @@ -0,0 +1 @@ +Subproject commit 5b5df7f7d6593caa396ef7bb0a315a9c99e9ea7b diff --git a/framework/modules/c_LibExifModule b/framework/modules/c_LibExifModule new file mode 160000 index 000000000..b70f2f49d --- /dev/null +++ b/framework/modules/c_LibExifModule @@ -0,0 +1 @@ +Subproject commit b70f2f49d31ecde436613512d2fe59ba3ae3001b diff --git a/framework/modules/c_RegRipperModule b/framework/modules/c_RegRipperModule new file mode 160000 index 000000000..3aa07f9f8 --- /dev/null +++ b/framework/modules/c_RegRipperModule @@ -0,0 +1 @@ +Subproject commit 3aa07f9f8f746650061bdd5847770f2bd38b5430 diff --git a/framework/modules/c_SaveInterestingFilesModule b/framework/modules/c_SaveInterestingFilesModule new file mode 160000 index 000000000..b0edea1e4 --- /dev/null +++ b/framework/modules/c_SaveInterestingFilesModule @@ -0,0 +1 @@ +Subproject commit b0edea1e4e25a2fdfd453bd49d2310b2477c4413 diff --git a/framework/modules/c_SummaryReportModule b/framework/modules/c_SummaryReportModule new file mode 160000 index 000000000..27c22b8b8 --- /dev/null +++ b/framework/modules/c_SummaryReportModule @@ -0,0 +1 @@ +Subproject commit 27c22b8b82c5439df26763cc86f067d5f825f4e1 diff --git a/framework/modules/c_TskHashLookupModule b/framework/modules/c_TskHashLookupModule new file mode 160000 index 000000000..281294f5c --- /dev/null +++ b/framework/modules/c_TskHashLookupModule @@ -0,0 +1 @@ +Subproject commit 281294f5c0224284ba1548667511c443dba1bd52 diff --git a/framework/modules/c_ZIPExtractionModule b/framework/modules/c_ZIPExtractionModule new file mode 160000 index 000000000..f58e558d5 --- /dev/null +++ b/framework/modules/c_ZIPExtractionModule @@ -0,0 +1 @@ +Subproject commit f58e558d5c4c3753db5dfc6d4a803c7e92871270 diff --git a/framework/BUILDING.txt b/framework/msvcpp/BUILDING.txt similarity index 95% rename from framework/BUILDING.txt rename to framework/msvcpp/BUILDING.txt index c0ca5de27..9bce2a171 100644 --- a/framework/BUILDING.txt +++ b/framework/msvcpp/BUILDING.txt @@ -1,7 +1,7 @@ Sleuth Kit Framework Building Instructions - July 11, 2012 + January 22, 2013 @@ -25,7 +25,7 @@ Development environment setup consists of the following steps: Sleuth Kit BUILDING.txt file for details on setting LIBEWF_HOME. 4) Ensure that the TSK_HOME environment variable is set and refers to the directory to which you extracted the Sleuth Kit. -5) Run 'nmake' in the framework\win32 directory. +5) Run 'nmake' in the framework\msvcpp directory. If the above simple build process does not work the following sections @@ -82,7 +82,7 @@ following commands to download all of the modules before compiling: To compile the framework, open the solution file in -"framework/win32/framework". Compile the framework project to get +"framework/msvcpp/framework". Compile the framework project to get the release or debug version. This will create a dll file that includes the libtsk static library. There are other projects in the solution for other modules and command line tools. diff --git a/framework/win32/Makefile b/framework/msvcpp/Makefile similarity index 100% rename from framework/win32/Makefile rename to framework/msvcpp/Makefile diff --git a/framework/win32/build-deps.pl b/framework/msvcpp/build-deps.pl similarity index 100% rename from framework/win32/build-deps.pl rename to framework/msvcpp/build-deps.pl diff --git a/framework/win32/framework/framework.sln b/framework/msvcpp/framework/framework.sln similarity index 83% rename from framework/win32/framework/framework.sln rename to framework/msvcpp/framework/framework.sln index 821c1ca63..3ba0bf016 100755 --- a/framework/win32/framework/framework.sln +++ b/framework/msvcpp/framework/framework.sln @@ -3,53 +3,53 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual C++ Express 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtskframework", "framework.vcxproj", "{F791B16A-1489-4526-9FFF-CB481CEC5414}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EntropyModule", "..\..\TskModules\c_EntropyModule\win32\EntropyModule.vcxproj", "{00E3B0EE-B612-433A-A43E-1CE0B3DE1015}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EntropyModule", "..\..\modules\c_EntropyModule\win32\EntropyModule.vcxproj", "{00E3B0EE-B612-433A-A43E-1CE0B3DE1015}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HashCalcModule", "..\..\TskModules\c_HashCalcModule\win32\HashCalcModule.vcxproj", "{46CD18AC-3A1C-405D-B39F-F86BA0FD1820}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HashCalcModule", "..\..\modules\c_HashCalcModule\win32\HashCalcModule.vcxproj", "{46CD18AC-3A1C-405D-B39F-F86BA0FD1820}" ProjectSection(ProjectDependencies) = postProject {F791B16A-1489-4526-9FFF-CB481CEC5414} = {F791B16A-1489-4526-9FFF-CB481CEC5414} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InterestingFilesModule", "..\..\TskModules\c_InterestingFilesModule\win32\InterestingFilesModule.vcxproj", "{8F956113-11D2-4288-985D-53CBF84648E0}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InterestingFilesModule", "..\..\modules\c_InterestingFilesModule\win32\InterestingFilesModule.vcxproj", "{8F956113-11D2-4288-985D-53CBF84648E0}" ProjectSection(ProjectDependencies) = postProject {F791B16A-1489-4526-9FFF-CB481CEC5414} = {F791B16A-1489-4526-9FFF-CB481CEC5414} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RegRipperModule", "..\..\TskModules\c_RegRipperModule\win32\RegRipperModule.vcxproj", "{4DD49717-8C15-4E07-8C18-D47A093184AA}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RegRipperModule", "..\..\modules\c_RegRipperModule\win32\RegRipperModule.vcxproj", "{4DD49717-8C15-4E07-8C18-D47A093184AA}" ProjectSection(ProjectDependencies) = postProject {F791B16A-1489-4526-9FFF-CB481CEC5414} = {F791B16A-1489-4526-9FFF-CB481CEC5414} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SaveInterestingFilesModule", "..\..\TskModules\c_SaveInterestingFilesModule\win32\SaveInterestingFilesModule.vcxproj", "{39CDF492-FCD0-42E8-B2E2-42D2E0F6D2CC}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SaveInterestingFilesModule", "..\..\modules\c_SaveInterestingFilesModule\win32\SaveInterestingFilesModule.vcxproj", "{39CDF492-FCD0-42E8-B2E2-42D2E0F6D2CC}" ProjectSection(ProjectDependencies) = postProject {F791B16A-1489-4526-9FFF-CB481CEC5414} = {F791B16A-1489-4526-9FFF-CB481CEC5414} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TskHashLookupModule", "..\..\TskModules\c_TskHashLookupModule\win32\TskHashLookupModule.vcxproj", "{430B8E55-C5F4-4936-A0C7-DABD8B34788A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TskHashLookupModule", "..\..\modules\c_TskHashLookupModule\win32\TskHashLookupModule.vcxproj", "{430B8E55-C5F4-4936-A0C7-DABD8B34788A}" ProjectSection(ProjectDependencies) = postProject {F791B16A-1489-4526-9FFF-CB481CEC5414} = {F791B16A-1489-4526-9FFF-CB481CEC5414} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZipExtractionModule", "..\..\TskModules\c_ZIPExtractionModule\win32\ZipExtractionModule.vcxproj", "{506823BC-AE48-4827-B72A-BA4C9E1E4670}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZipExtractionModule", "..\..\modules\c_ZIPExtractionModule\win32\ZipExtractionModule.vcxproj", "{506823BC-AE48-4827-B72A-BA4C9E1E4670}" ProjectSection(ProjectDependencies) = postProject {F791B16A-1489-4526-9FFF-CB481CEC5414} = {F791B16A-1489-4526-9FFF-CB481CEC5414} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tsk_analyzeimg", "..\tsk_analyzeimg\tsk_analyzeimg.vcxproj", "{13BD0806-028E-42F1-A91D-5128565A9717}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SummaryReportModule", "..\..\TskModules\c_SummaryReportModule\win32\SummaryReportModule.vcxproj", "{1CA42FA6-A110-4BB1-B7D6-C0AB6C4FA1AD}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SummaryReportModule", "..\..\modules\c_SummaryReportModule\win32\SummaryReportModule.vcxproj", "{1CA42FA6-A110-4BB1-B7D6-C0AB6C4FA1AD}" ProjectSection(ProjectDependencies) = postProject {F791B16A-1489-4526-9FFF-CB481CEC5414} = {F791B16A-1489-4526-9FFF-CB481CEC5414} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tsk_validatepipeline", "..\tsk_validatepipeline\tsk_validatepipeline.vcxproj", "{352C3C04-1F31-4138-97A6-1DC6EC5FD379}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileTypeSigModule", "..\..\TskModules\c_FileTypeSigModule\win32\FileTypeSigModule.vcxproj", "{18EC105E-A0F9-43D2-B66E-287828E61E7D}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileTypeSigModule", "..\..\modules\c_FileTypeSigModule\win32\FileTypeSigModule.vcxproj", "{18EC105E-A0F9-43D2-B66E-287828E61E7D}" ProjectSection(ProjectDependencies) = postProject {F791B16A-1489-4526-9FFF-CB481CEC5414} = {F791B16A-1489-4526-9FFF-CB481CEC5414} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibExifModule", "..\..\TskModules\c_LibExifModule\win32\LibExifModule.vcxproj", "{A4B7B046-EA19-4179-9712-8A7B085443D8}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibExifModule", "..\..\modules\c_LibExifModule\win32\LibExifModule.vcxproj", "{A4B7B046-EA19-4179-9712-8A7B085443D8}" ProjectSection(ProjectDependencies) = postProject {F791B16A-1489-4526-9FFF-CB481CEC5414} = {F791B16A-1489-4526-9FFF-CB481CEC5414} EndProjectSection diff --git a/framework/win32/framework/framework.vcproj b/framework/msvcpp/framework/framework.vcproj similarity index 60% rename from framework/win32/framework/framework.vcproj rename to framework/msvcpp/framework/framework.vcproj index b3ccdf6e1..173a3b1f4 100755 --- a/framework/win32/framework/framework.vcproj +++ b/framework/msvcpp/framework/framework.vcproj @@ -172,135 +172,135 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File - RelativePath="..\..\Services\Log.cpp" + RelativePath="..\..\tsk\framework\services\Log.cpp" > </File> <File - RelativePath="..\..\Services\Scheduler.cpp" + RelativePath="..\..\tsk\framework\services\Scheduler.cpp" > </File> <File - RelativePath="..\..\Utilities\SectorRuns.cpp" + RelativePath="..\..\tsk\framework\utilities\SectorRuns.cpp" > </File> <File - RelativePath="..\..\Extraction\TskAutoImpl.cpp" + RelativePath="..\..\tsk\framework\extraction\TskAutoImpl.cpp" > </File> <File - RelativePath="..\..\Services\TskBlackboard.cpp" + RelativePath="..\..\tsk\framework\services\TskBlackboard.cpp" > </File> <File - RelativePath="..\..\Services\TskBlackboardArtifact.cpp" + RelativePath="..\..\tsk\framework\services\TskBlackboardArtifact.cpp" > </File> <File - RelativePath="..\..\Services\TskBlackboardAttribute.cpp" + RelativePath="..\..\tsk\framework\services\TskBlackboardAttribute.cpp" > </File> <File - RelativePath="..\..\Extraction\TskCarveExtractScalpel.cpp" + RelativePath="..\..\tsk\framework\extraction\TskCarveExtractScalpel.cpp" > </File> <File - RelativePath="..\..\Extraction\TskCarvePrepSectorConcat.cpp" + RelativePath="..\..\tsk\framework\extraction\TskCarvePrepSectorConcat.cpp" > </File> <File - RelativePath="..\..\Services\TskDBBlackboard.cpp" + RelativePath="..\..\tsk\framework\services\TskDBBlackboard.cpp" > </File> <File - RelativePath="..\..\Utilities\TskException.cpp" + RelativePath="..\..\tsk\framework\utilities\TskException.cpp" > </File> <File - RelativePath="..\..\Pipeline\TskExecutableModule.cpp" + RelativePath="..\..\tsk\framework\pipeline\TskExecutableModule.cpp" > </File> <File - RelativePath="..\..\File\TskFile.cpp" + RelativePath="..\..\tsk\framework\file\TskFile.cpp" > </File> <File - RelativePath="..\..\Pipeline\TskFileAnalysisPipeline.cpp" + RelativePath="..\..\tsk\framework\pipeline\TskFileAnalysisPipeline.cpp" > </File> <File - RelativePath="..\..\Pipeline\TskFileAnalysisPluginModule.cpp" + RelativePath="..\..\tsk\framework\pipeline\TskFileAnalysisPluginModule.cpp" > </File> <File - RelativePath="..\..\File\TskFileManagerImpl.cpp" + RelativePath="..\..\tsk\framework\file\TskFileManagerImpl.cpp" > </File> <File - RelativePath="..\..\File\TskFileTsk.cpp" + RelativePath="..\..\tsk\framework\file\TskFileTsk.cpp" > </File> <File - RelativePath="..\..\Extraction\TskImageFile.cpp" + RelativePath="..\..\tsk\framework\extraction\TskImageFile.cpp" > </File> <File - RelativePath="..\..\Extraction\TskImageFileTsk.cpp" + RelativePath="..\..\tsk\framework\extraction\TskImageFileTsk.cpp" > </File> <File - RelativePath="..\..\Services\TskImgDB.cpp" + RelativePath="..\..\tsk\framework\services\TskImgDB.cpp" > </File> <File - RelativePath="..\..\Services\TskImgDBSqlite.cpp" + RelativePath="..\..\tsk\framework\services\TskImgDBSqlite.cpp" > </File> <File - RelativePath="..\..\Pipeline\TskModule.cpp" + RelativePath="..\..\tsk\framework\pipeline\TskModule.cpp" > </File> <File - RelativePath="..\..\Pipeline\TskPipeline.cpp" + RelativePath="..\..\tsk\framework\pipeline\TskPipeline.cpp" > </File> <File - RelativePath="..\..\Pipeline\TskPipelineManager.cpp" + RelativePath="..\..\tsk\framework\pipeline\TskPipelineManager.cpp" > </File> <File - RelativePath="..\..\Pipeline\TskPluginModule.cpp" + RelativePath="..\..\tsk\framework\pipeline\TskPluginModule.cpp" > </File> <File - RelativePath="..\..\Pipeline\TskReportPipeline.cpp" + RelativePath="..\..\tsk\framework\pipeline\TskReportPipeline.cpp" > </File> <File - RelativePath="..\..\Pipeline\TskReportPluginModule.cpp" + RelativePath="..\..\tsk\framework\pipeline\TskReportPluginModule.cpp" > </File> <File - RelativePath="..\..\Services\TskSchedulerQueue.cpp" + RelativePath="..\..\tsk\framework\services\TskSchedulerQueue.cpp" > </File> <File - RelativePath="..\..\Services\TskServices.cpp" + RelativePath="..\..\tsk\framework\services\TskServices.cpp" > </File> <File - RelativePath="..\..\Services\TskSystemProperties.cpp" + RelativePath="..\..\tsk\framework\services\TskSystemProperties.cpp" > </File> <File - RelativePath="..\..\Services\TskSystemPropertiesImpl.cpp" + RelativePath="..\..\tsk\framework\services\TskSystemPropertiesImpl.cpp" > </File> <File - RelativePath="..\..\Utilities\TskUtilities.cpp" + RelativePath="..\..\tsk\framework\utilities\TskUtilities.cpp" > </File> <File - RelativePath="..\..\Utilities\UnallocRun.cpp" + RelativePath="..\..\tsk\framework\utilities\UnallocRun.cpp" > </File> </Filter> @@ -310,155 +310,155 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > <File - RelativePath="..\..\Extraction\CarveExtract.h" + RelativePath="..\..\tsk\framework\extraction\CarveExtract.h" > </File> <File - RelativePath="..\..\Extraction\CarvePrep.h" + RelativePath="..\..\tsk\framework\extraction\CarvePrep.h" > </File> <File - RelativePath="..\..\framework.h" + RelativePath="..\..\tsk\framework\framework.h" > </File> <File - RelativePath="..\..\framework_i.h" + RelativePath="..\..\tsk\framework\framework_i.h" > </File> <File - RelativePath="..\..\Services\Log.h" + RelativePath="..\..\tsk\framework\services\Log.h" > </File> <File - RelativePath="..\..\Services\Scheduler.h" + RelativePath="..\..\tsk\framework\services\Scheduler.h" > </File> <File - RelativePath="..\..\Utilities\SectorRuns.h" + RelativePath="..\..\tsk\framework\utilities\SectorRuns.h" > </File> <File - RelativePath="..\..\Extraction\TskAutoImpl.h" + RelativePath="..\..\tsk\framework\extraction\TskAutoImpl.h" > </File> <File - RelativePath="..\..\Services\TskBlackboard.h" + RelativePath="..\..\tsk\framework\services\TskBlackboard.h" > </File> <File - RelativePath="..\..\Services\TskBlackboardArtifact.h" + RelativePath="..\..\tsk\framework\services\TskBlackboardArtifact.h" > </File> <File - RelativePath="..\..\Services\TskBlackBoardAttribute.h" + RelativePath="..\..\tsk\framework\services\TskBlackBoardAttribute.h" > </File> <File - RelativePath="..\..\Extraction\TskCarveExtractScalpel.h" + RelativePath="..\..\tsk\framework\extraction\TskCarveExtractScalpel.h" > </File> <File - RelativePath="..\..\Extraction\TskCarvePrepSectorConcat.h" + RelativePath="..\..\tsk\framework\extraction\TskCarvePrepSectorConcat.h" > </File> <File - RelativePath="..\..\Services\TskDBBlackboard.h" + RelativePath="..\..\tsk\framework\services\TskDBBlackboard.h" > </File> <File - RelativePath="..\..\Utilities\TskException.h" + RelativePath="..\..\tsk\framework\utilities\TskException.h" > </File> <File - RelativePath="..\..\Pipeline\TskExecutableModule.h" + RelativePath="..\..\tsk\framework\pipeline\TskExecutableModule.h" > </File> <File - RelativePath="..\..\File\TskFile.h" + RelativePath="..\..\tsk\framework\file\TskFile.h" > </File> <File - RelativePath="..\..\Pipeline\TskFileAnalysisPipeline.h" + RelativePath="..\..\tsk\framework\pipeline\TskFileAnalysisPipeline.h" > </File> <File - RelativePath="..\..\Pipeline\TskFileAnalysisPluginModule.h" + RelativePath="..\..\tsk\framework\pipeline\TskFileAnalysisPluginModule.h" > </File> <File - RelativePath="..\..\File\TskFileManager.h" + RelativePath="..\..\tsk\framework\file\TskFileManager.h" > </File> <File - RelativePath="..\..\File\TskFileManagerImpl.h" + RelativePath="..\..\tsk\framework\file\TskFileManagerImpl.h" > </File> <File - RelativePath="..\..\File\TskFileTsk.h" + RelativePath="..\..\tsk\framework\file\TskFileTsk.h" > </File> <File - RelativePath="..\..\Extraction\TskImageFile.h" + RelativePath="..\..\tsk\framework\extraction\TskImageFile.h" > </File> <File - RelativePath="..\..\Extraction\TskImageFileTsk.h" + RelativePath="..\..\tsk\framework\extraction\TskImageFileTsk.h" > </File> <File - RelativePath="..\..\Services\TskImgDB.h" + RelativePath="..\..\tsk\framework\services\TskImgDB.h" > </File> <File - RelativePath="..\..\Services\TskImgDBSqlite.h" + RelativePath="..\..\tsk\framework\services\TskImgDBSqlite.h" > </File> <File - RelativePath="..\..\Pipeline\TskModule.h" + RelativePath="..\..\tsk\framework\pipeline\TskModule.h" > </File> <File - RelativePath="..\..\Pipeline\TskPipeline.h" + RelativePath="..\..\tsk\framework\pipeline\TskPipeline.h" > </File> <File - RelativePath="..\..\Pipeline\TskPipelineManager.h" + RelativePath="..\..\tsk\framework\pipeline\TskPipelineManager.h" > </File> <File - RelativePath="..\..\Pipeline\TskPluginModule.h" + RelativePath="..\..\tsk\framework\pipeline\TskPluginModule.h" > </File> <File - RelativePath="..\..\Pipeline\TskReportPipeline.h" + RelativePath="..\..\tsk\framework\pipeline\TskReportPipeline.h" > </File> <File - RelativePath="..\..\Pipeline\TskReportPluginModule.h" + RelativePath="..\..\tsk\framework\pipeline\TskReportPluginModule.h" > </File> <File - RelativePath="..\..\Services\TskSchedulerQueue.h" + RelativePath="..\..\tsk\framework\services\TskSchedulerQueue.h" > </File> <File - RelativePath="..\..\Services\TskServices.h" + RelativePath="..\..\tsk\framework\services\TskServices.h" > </File> <File - RelativePath="..\..\Services\TskSystemProperties.h" + RelativePath="..\..\tsk\framework\services\TskSystemProperties.h" > </File> <File - RelativePath="..\..\Services\TskSystemPropertiesImpl.h" + RelativePath="..\..\tsk\framework\services\TskSystemPropertiesImpl.h" > </File> <File - RelativePath="..\..\Utilities\TskUtilities.h" + RelativePath="..\..\tsk\framework\utilities\TskUtilities.h" > </File> <File - RelativePath="..\..\Utilities\UnallocRun.h" + RelativePath="..\..\tsk\framework\utilities\UnallocRun.h" > </File> </Filter> diff --git a/framework/msvcpp/framework/framework.vcxproj b/framework/msvcpp/framework/framework.vcxproj new file mode 100755 index 000000000..4240360f5 --- /dev/null +++ b/framework/msvcpp/framework/framework.vcxproj @@ -0,0 +1,195 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectName>libtskframework</ProjectName> + <ProjectGuid>{F791B16A-1489-4526-9FFF-CB481CEC5414}</ProjectGuid> + <RootNamespace>framework</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>$(ProjectDir)\..\..;$(ProjectDir)\..\..\..;$(POCO_HOME)\Foundation\include;$(POCO_HOME)\Util\include;$(POCO_HOME)\XML\include;$(POCO_HOME)\Net\include;$(LIBEWF_HOME)\common;$(LIBEWF_HOME)\include;$(ProjectDir)\..\..\..\tsk\img;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;TSK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + </ClCompile> + <Link> + <AdditionalDependencies>libewf.lib;libtsk.lib;ws2_32.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalLibraryDirectories>$(POCO_HOME)\lib;$(ProjectDir)\..\..\..\win32\Debug;$(LIBEWF_HOME)\msvscpp\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary> + </Link> + <PostBuildEvent> + <Command>mkdir "$(ProjectDir)..\..\runtime" +move /Y "$(OutDir)$(TargetName)$(TargetExt)" "$(ProjectDir)..\..\runtime" +xcopy "$(POCO_HOME)\bin\PocoFoundationd.dll" "$(ProjectDir)..\..\runtime" /R /Y +xcopy "$(POCO_HOME)\bin\PocoNetd.dll" "$(ProjectDir)..\..\runtime" /R /Y +xcopy "$(POCO_HOME)\bin\PocoUtild.dll" "$(ProjectDir)..\..\runtime" /R /Y +xcopy "$(POCO_HOME)\bin\PocoXMLd.dll" "$(ProjectDir)..\..\runtime" /R /Y +xcopy "$(LIBEWF_HOME)\msvscpp\Release\libewf.dll" "$(ProjectDir)..\..\runtime" /R /Y +xcopy "$(LIBEWF_HOME)\msvscpp\Release\zlib.dll" "$(ProjectDir)..\..\runtime" /R /Y +del "$(ProjectDir)..\..\runtime\framework_config.xml" +xcopy "$(ProjectDir)..\..\SampleConfig\framework_config_win32dev.xml" "$(ProjectDir)..\..\runtime" /R /Y +ren "$(ProjectDir)..\..\runtime\framework_config_win32dev.xml" framework_config.xml</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <AdditionalIncludeDirectories>$(ProjectDir)\..\..;$(ProjectDir)\..\..\..;$(POCO_HOME)\Foundation\include;$(POCO_HOME)\Util\include;$(POCO_HOME)\XML\include;$(POCO_HOME)\Net\include;$(LIBEWF_HOME)\common;$(LIBEWF_HOME)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;TSK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + </ClCompile> + <Link> + <AdditionalDependencies>libewf.lib;libtsk.lib;ws2_32.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalLibraryDirectories>$(POCO_HOME)\lib;$(ProjectDir)\..\..\..\win32\Release;$(LIBEWF_HOME)\msvscpp\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary> + </Link> + <PostBuildEvent> + <Command>mkdir "$(ProjectDir)..\..\runtime" +move /Y "$(OutDir)$(TargetName)$(TargetExt)" "$(ProjectDir)..\..\runtime" +xcopy "$(POCO_HOME)\bin\PocoFoundation.dll" "$(ProjectDir)..\..\runtime" /R /Y +xcopy "$(POCO_HOME)\bin\PocoNet.dll" "$(ProjectDir)..\..\runtime" /R /Y +xcopy "$(POCO_HOME)\bin\PocoUtil.dll" "$(ProjectDir)..\..\runtime" /R /Y +xcopy "$(POCO_HOME)\bin\PocoXML.dll" "$(ProjectDir)..\..\runtime" /R /Y +xcopy "$(LIBEWF_HOME)\msvscpp\Release\libewf.dll" "$(ProjectDir)..\..\runtime" /R /Y +xcopy "$(LIBEWF_HOME)\msvscpp\Release\zlib.dll" "$(ProjectDir)..\..\runtime" /R /Y +del "$(ProjectDir)..\..\runtime\framework_config.xml" +xcopy "$(ProjectDir)..\..\SampleConfig\framework_config_win32dev.xml" "$(ProjectDir)..\..\runtime" /R /Y +ren "$(ProjectDir)..\..\runtime\framework_config_win32dev.xml" framework_config.xml</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\tsk\framework\extraction\TskExtract.cpp" /> + <ClCompile Include="..\..\tsk\framework\extraction\TskL01Extract.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\Log.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\Scheduler.cpp" /> + <ClCompile Include="..\..\tsk\framework\utilities\SectorRuns.cpp" /> + <ClCompile Include="..\..\tsk\framework\extraction\TskAutoImpl.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\TskBlackboard.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\TskBlackboardArtifact.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\TskBlackboardAttribute.cpp" /> + <ClCompile Include="..\..\tsk\framework\extraction\TskCarveExtractScalpel.cpp" /> + <ClCompile Include="..\..\tsk\framework\extraction\TskCarvePrepSectorConcat.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\TskDBBlackboard.cpp" /> + <ClCompile Include="..\..\tsk\framework\utilities\TskException.cpp" /> + <ClCompile Include="..\..\tsk\framework\pipeline\TskExecutableModule.cpp" /> + <ClCompile Include="..\..\tsk\framework\file\TskFile.cpp" /> + <ClCompile Include="..\..\tsk\framework\pipeline\TskFileAnalysisPipeline.cpp" /> + <ClCompile Include="..\..\tsk\framework\pipeline\TskFileAnalysisPluginModule.cpp" /> + <ClCompile Include="..\..\tsk\framework\file\TskFileManagerImpl.cpp" /> + <ClCompile Include="..\..\tsk\framework\file\TskFileTsk.cpp" /> + <ClCompile Include="..\..\tsk\framework\extraction\TskImageFile.cpp" /> + <ClCompile Include="..\..\tsk\framework\extraction\TskImageFileTsk.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\TskImgDB.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\TskImgDBSqlite.cpp" /> + <ClCompile Include="..\..\tsk\framework\pipeline\TskModule.cpp" /> + <ClCompile Include="..\..\tsk\framework\pipeline\TskPipeline.cpp" /> + <ClCompile Include="..\..\tsk\framework\pipeline\TskPipelineManager.cpp" /> + <ClCompile Include="..\..\tsk\framework\pipeline\TskPluginModule.cpp" /> + <ClCompile Include="..\..\tsk\framework\pipeline\TskReportPipeline.cpp" /> + <ClCompile Include="..\..\tsk\framework\pipeline\TskReportPluginModule.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\TskSchedulerQueue.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\TskServices.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\TskSystemProperties.cpp" /> + <ClCompile Include="..\..\tsk\framework\services\TskSystemPropertiesImpl.cpp" /> + <ClCompile Include="..\..\tsk\framework\utilities\TskUtilities.cpp" /> + <ClCompile Include="..\..\tsk\framework\utilities\UnallocRun.cpp" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\tsk\framework\extraction\CarveExtract.h" /> + <ClInclude Include="..\..\tsk\framework\extraction\CarvePrep.h" /> + <ClInclude Include="..\..\tsk\framework\extraction\TskExtract.h" /> + <ClInclude Include="..\..\tsk\framework\extraction\TskL01Extract.h" /> + <ClInclude Include="..\..\tsk\framework\framework.h" /> + <ClInclude Include="..\..\tsk\framework\framework_i.h" /> + <ClInclude Include="..\..\tsk\framework\services\Log.h" /> + <ClInclude Include="..\..\tsk\framework\services\Scheduler.h" /> + <ClInclude Include="..\..\tsk\framework\TskVersionInfo.h" /> + <ClInclude Include="..\..\tsk\framework\utilities\SectorRuns.h" /> + <ClInclude Include="..\..\tsk\framework\extraction\TskAutoImpl.h" /> + <ClInclude Include="..\..\tsk\framework\services\TskBlackboard.h" /> + <ClInclude Include="..\..\tsk\framework\services\TskBlackboardArtifact.h" /> + <ClInclude Include="..\..\tsk\framework\services\TskBlackBoardAttribute.h" /> + <ClInclude Include="..\..\tsk\framework\extraction\TskCarveExtractScalpel.h" /> + <ClInclude Include="..\..\tsk\framework\extraction\TskCarvePrepSectorConcat.h" /> + <ClInclude Include="..\..\tsk\framework\services\TskDBBlackboard.h" /> + <ClInclude Include="..\..\tsk\framework\utilities\TskException.h" /> + <ClInclude Include="..\..\tsk\framework\pipeline\TskExecutableModule.h" /> + <ClInclude Include="..\..\tsk\framework\file\TskFile.h" /> + <ClInclude Include="..\..\tsk\framework\pipeline\TskFileAnalysisPipeline.h" /> + <ClInclude Include="..\..\tsk\framework\pipeline\TskFileAnalysisPluginModule.h" /> + <ClInclude Include="..\..\tsk\framework\file\TskFileManager.h" /> + <ClInclude Include="..\..\tsk\framework\file\TskFileManagerImpl.h" /> + <ClInclude Include="..\..\tsk\framework\file\TskFileTsk.h" /> + <ClInclude Include="..\..\tsk\framework\extraction\TskImageFile.h" /> + <ClInclude Include="..\..\tsk\framework\extraction\TskImageFileTsk.h" /> + <ClInclude Include="..\..\tsk\framework\services\TskImgDB.h" /> + <ClInclude Include="..\..\tsk\framework\services\TskImgDBSqlite.h" /> + <ClInclude Include="..\..\tsk\framework\pipeline\TskModule.h" /> + <ClInclude Include="..\..\tsk\framework\pipeline\TskPipeline.h" /> + <ClInclude Include="..\..\tsk\framework\pipeline\TskPipelineManager.h" /> + <ClInclude Include="..\..\tsk\framework\pipeline\TskPluginModule.h" /> + <ClInclude Include="..\..\tsk\framework\pipeline\TskReportPipeline.h" /> + <ClInclude Include="..\..\tsk\framework\pipeline\TskReportPluginModule.h" /> + <ClInclude Include="..\..\tsk\framework\services\TskSchedulerQueue.h" /> + <ClInclude Include="..\..\tsk\framework\services\TskServices.h" /> + <ClInclude Include="..\..\tsk\framework\services\TskSystemProperties.h" /> + <ClInclude Include="..\..\tsk\framework\services\TskSystemPropertiesImpl.h" /> + <ClInclude Include="..\..\tsk\framework\utilities\TskUtilities.h" /> + <ClInclude Include="..\..\tsk\framework\utilities\UnallocRun.h" /> + <ClInclude Include="..\..\tsk\framework\utilities\TskModuleDev.h" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file diff --git a/framework/msvcpp/framework/framework.vcxproj.filters b/framework/msvcpp/framework/framework.vcxproj.filters new file mode 100755 index 000000000..4d38be4d4 --- /dev/null +++ b/framework/msvcpp/framework/framework.vcxproj.filters @@ -0,0 +1,248 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\tsk\framework\services\Log.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\services\Scheduler.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\utilities\SectorRuns.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\extraction\TskAutoImpl.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\services\TskBlackboard.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\services\TskBlackboardArtifact.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\services\TskBlackboardAttribute.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\extraction\TskCarveExtractScalpel.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\extraction\TskCarvePrepSectorConcat.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\services\TskDBBlackboard.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\utilities\TskException.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\pipeline\TskExecutableModule.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\file\TskFile.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\pipeline\TskFileAnalysisPipeline.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\pipeline\TskFileAnalysisPluginModule.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\file\TskFileManagerImpl.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\file\TskFileTsk.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\extraction\TskImageFile.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\extraction\TskImageFileTsk.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\services\TskImgDB.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\services\TskImgDBSqlite.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\pipeline\TskModule.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\pipeline\TskPipeline.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\pipeline\TskPipelineManager.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\pipeline\TskPluginModule.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\pipeline\TskReportPipeline.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\pipeline\TskReportPluginModule.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\services\TskSchedulerQueue.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\services\TskServices.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\services\TskSystemProperties.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\services\TskSystemPropertiesImpl.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\utilities\TskUtilities.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\utilities\UnallocRun.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\extraction\TskExtract.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\tsk\framework\extraction\TskL01Extract.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\tsk\framework\extraction\CarveExtract.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\extraction\CarvePrep.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\framework.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\framework_i.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\Log.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\Scheduler.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\utilities\SectorRuns.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\extraction\TskAutoImpl.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\TskBlackboard.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\TskBlackboardArtifact.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\TskBlackBoardAttribute.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\extraction\TskCarveExtractScalpel.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\extraction\TskCarvePrepSectorConcat.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\TskDBBlackboard.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\utilities\TskException.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\pipeline\TskExecutableModule.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\file\TskFile.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\pipeline\TskFileAnalysisPipeline.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\pipeline\TskFileAnalysisPluginModule.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\file\TskFileManager.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\file\TskFileManagerImpl.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\file\TskFileTsk.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\extraction\TskImageFile.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\extraction\TskImageFileTsk.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\TskImgDB.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\TskImgDBSqlite.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\pipeline\TskModule.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\pipeline\TskPipeline.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\pipeline\TskPipelineManager.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\pipeline\TskPluginModule.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\pipeline\TskReportPipeline.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\pipeline\TskReportPluginModule.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\TskSchedulerQueue.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\TskServices.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\TskSystemProperties.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\services\TskSystemPropertiesImpl.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\utilities\TskUtilities.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\utilities\UnallocRun.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\utilities\TskModuleDev.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\TskVersionInfo.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\extraction\TskExtract.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\tsk\framework\extraction\TskL01Extract.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> +</Project> \ No newline at end of file diff --git a/framework/win32/tsk_analyzeimg/tsk_analyzeimg.vcproj b/framework/msvcpp/tsk_analyzeimg/tsk_analyzeimg.vcproj similarity index 100% rename from framework/win32/tsk_analyzeimg/tsk_analyzeimg.vcproj rename to framework/msvcpp/tsk_analyzeimg/tsk_analyzeimg.vcproj diff --git a/framework/win32/tsk_analyzeimg/tsk_analyzeimg.vcxproj b/framework/msvcpp/tsk_analyzeimg/tsk_analyzeimg.vcxproj similarity index 92% rename from framework/win32/tsk_analyzeimg/tsk_analyzeimg.vcxproj rename to framework/msvcpp/tsk_analyzeimg/tsk_analyzeimg.vcxproj index 9c93cc867..fc639ac2e 100755 --- a/framework/win32/tsk_analyzeimg/tsk_analyzeimg.vcxproj +++ b/framework/msvcpp/tsk_analyzeimg/tsk_analyzeimg.vcxproj @@ -64,6 +64,9 @@ <SubSystem>Console</SubSystem> <TargetMachine>MachineX86</TargetMachine> </Link> + <PostBuildEvent> + <Command>move /Y "$(SolutionDir)$(Configuration)\$(ProjectName).exe" "$(ProjectDir)..\..\runtime"</Command> + </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> @@ -87,9 +90,12 @@ <EnableCOMDATFolding>true</EnableCOMDATFolding> <TargetMachine>MachineX86</TargetMachine> </Link> + <PostBuildEvent> + <Command>move /Y "$(SolutionDir)$(Configuration)\$(ProjectName).exe" "$(ProjectDir)..\..\runtime"</Command> + </PostBuildEvent> </ItemDefinitionGroup> <ItemGroup> - <ClCompile Include="..\..\tsk_analyzeimg\tsk_analyzeimg.cpp" /> + <ClCompile Include="..\..\tools\tsk_analyzeimg\tsk_analyzeimg.cpp" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\framework\framework.vcxproj"> diff --git a/framework/win32/tsk_analyzeimg/tsk_analyzeimg.vcxproj.filters b/framework/msvcpp/tsk_analyzeimg/tsk_analyzeimg.vcxproj.filters similarity index 84% rename from framework/win32/tsk_analyzeimg/tsk_analyzeimg.vcxproj.filters rename to framework/msvcpp/tsk_analyzeimg/tsk_analyzeimg.vcxproj.filters index e1ed32a25..94e3f41cb 100755 --- a/framework/win32/tsk_analyzeimg/tsk_analyzeimg.vcxproj.filters +++ b/framework/msvcpp/tsk_analyzeimg/tsk_analyzeimg.vcxproj.filters @@ -7,7 +7,7 @@ </Filter> </ItemGroup> <ItemGroup> - <ClCompile Include="..\..\tsk_analyzeimg\tsk_analyzeimg.cpp"> + <ClCompile Include="..\..\tools\tsk_analyzeimg\tsk_analyzeimg.cpp"> <Filter>Source Files</Filter> </ClCompile> </ItemGroup> diff --git a/framework/win32/tsk_validatepipeline/tsk_validatepipeline.vcproj b/framework/msvcpp/tsk_validatepipeline/tsk_validatepipeline.vcproj similarity index 100% rename from framework/win32/tsk_validatepipeline/tsk_validatepipeline.vcproj rename to framework/msvcpp/tsk_validatepipeline/tsk_validatepipeline.vcproj diff --git a/framework/win32/tsk_validatepipeline/tsk_validatepipeline.vcxproj b/framework/msvcpp/tsk_validatepipeline/tsk_validatepipeline.vcxproj similarity index 86% rename from framework/win32/tsk_validatepipeline/tsk_validatepipeline.vcxproj rename to framework/msvcpp/tsk_validatepipeline/tsk_validatepipeline.vcxproj index 6a0cdaf92..4953dcb77 100755 --- a/framework/win32/tsk_validatepipeline/tsk_validatepipeline.vcxproj +++ b/framework/msvcpp/tsk_validatepipeline/tsk_validatepipeline.vcxproj @@ -59,11 +59,14 @@ </ClCompile> <Link> <AdditionalDependencies>libtskframework.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>$(TSK_HOME)\framework\win32\framework\$(Configuration);$(POCO_HOME)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <AdditionalLibraryDirectories>$(TSK_HOME)\framework\msvcpp\framework\$(Configuration);$(POCO_HOME)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Console</SubSystem> <TargetMachine>MachineX86</TargetMachine> </Link> + <PostBuildEvent> + <Command>move /Y "$(SolutionDir)$(Configuration)\$(ProjectName).exe" "$(ProjectDir)..\..\runtime"</Command> + </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> @@ -80,16 +83,19 @@ </ClCompile> <Link> <AdditionalDependencies>libtskframework.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>$(TSK_HOME)\framework\win32\framework\$(Configuration);$(POCO_HOME)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <AdditionalLibraryDirectories>$(TSK_HOME)\framework\msvcpp\framework\$(Configuration);$(POCO_HOME)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Console</SubSystem> <OptimizeReferences>true</OptimizeReferences> <EnableCOMDATFolding>true</EnableCOMDATFolding> <TargetMachine>MachineX86</TargetMachine> </Link> + <PostBuildEvent> + <Command>move /Y "$(SolutionDir)$(Configuration)\$(ProjectName).exe" "$(ProjectDir)..\..\runtime"</Command> + </PostBuildEvent> </ItemDefinitionGroup> <ItemGroup> - <ClCompile Include="..\..\tsk_validatePipeline\tsk_validatePipeline.cpp" /> + <ClCompile Include="..\..\tools\tsk_validatePipeline\tsk_validatePipeline.cpp" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\framework\framework.vcxproj"> diff --git a/framework/win32/tsk_validatepipeline/tsk_validatepipeline.vcxproj.filters b/framework/msvcpp/tsk_validatepipeline/tsk_validatepipeline.vcxproj.filters similarity index 82% rename from framework/win32/tsk_validatepipeline/tsk_validatepipeline.vcxproj.filters rename to framework/msvcpp/tsk_validatepipeline/tsk_validatepipeline.vcxproj.filters index 2cfe6ed87..7e5abb7f1 100755 --- a/framework/win32/tsk_validatepipeline/tsk_validatepipeline.vcxproj.filters +++ b/framework/msvcpp/tsk_validatepipeline/tsk_validatepipeline.vcxproj.filters @@ -7,7 +7,7 @@ </Filter> </ItemGroup> <ItemGroup> - <ClCompile Include="..\..\tsk_validatePipeline\tsk_validatePipeline.cpp"> + <ClCompile Include="..\..\tools\tsk_validatePipeline\tsk_validatePipeline.cpp"> <Filter>Source Files</Filter> </ClCompile> </ItemGroup> diff --git a/framework/tools/Makefile.am b/framework/tools/Makefile.am new file mode 100644 index 000000000..21246cf8e --- /dev/null +++ b/framework/tools/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = tsk_analyzeimg tsk_validatepipeline diff --git a/framework/tools/tsk_analyzeimg/Makefile.am b/framework/tools/tsk_analyzeimg/Makefile.am new file mode 100644 index 000000000..c22d391bc --- /dev/null +++ b/framework/tools/tsk_analyzeimg/Makefile.am @@ -0,0 +1,5 @@ +tsk_analyzeimg_CXXFLAGS = -I.. -I../.. -I../../.. -Wall +LDADD = ../../tsk/framework/libtskframework.la ../../../tsk/libtsk.la + +bin_PROGRAMS = tsk_analyzeimg +tsk_analyzeimg_SOURCES = tsk_analyzeimg.cpp diff --git a/framework/tsk_analyzeimg/tsk_analyzeimg.cpp b/framework/tools/tsk_analyzeimg/tsk_analyzeimg.cpp similarity index 60% rename from framework/tsk_analyzeimg/tsk_analyzeimg.cpp rename to framework/tools/tsk_analyzeimg/tsk_analyzeimg.cpp index 1513a49b8..d785e57c9 100755 --- a/framework/tsk_analyzeimg/tsk_analyzeimg.cpp +++ b/framework/tools/tsk_analyzeimg/tsk_analyzeimg.cpp @@ -13,15 +13,17 @@ #include <cstdlib> #include <string> #include <sstream> - -#include "tsk3/tsk_tools_i.h" // Needed for tsk_getopt -#include "framework.h" -#include "Services/TskSchedulerQueue.h" -#include "Services/TskSystemPropertiesImpl.h" -#include "Services/TskImgDBSqlite.h" -#include "File/TskFileManagerImpl.h" -#include "Extraction/TskCarvePrepSectorConcat.h" -#include "Extraction/TskCarveExtractScalpel.h" +#include <time.h> +#include <memory> + +#include "tsk/tsk_tools_i.h" // Needed for tsk_getopt +#include "tsk/framework/framework.h" +#include "tsk/framework/services/TskSchedulerQueue.h" +#include "tsk/framework/services/TskSystemPropertiesImpl.h" +#include "tsk/framework/services/TskImgDBSqlite.h" +#include "tsk/framework/file/TskFileManagerImpl.h" +#include "tsk/framework/extraction/TskCarvePrepSectorConcat.h" +#include "tsk/framework/extraction/TskCarveExtractScalpel.h" #include "Poco/Path.h" #include "Poco/File.h" @@ -29,23 +31,27 @@ #ifdef TSK_WIN32 #include <Windows.h> #else -#error "Only Windows is currently supported" +#include <sys/stat.h> #endif #include "Poco/File.h" #include "Poco/UnicodeConverter.h" static uint8_t -makeDir(const TSK_TCHAR *dir) +makeDir(const char *dir) { -#ifdef TSK_WIN32 - if (CreateDirectoryW(dir, NULL) == 0) { - fprintf(stderr, "Error creating directory: %d\n", GetLastError()); + Poco::File path(dir); + try { + if (!path.createDirectory()) { + fprintf(stderr, "Error creating directory: %s\n", dir); + return 1; + } + } catch (const Poco::Exception &ex) { + std::stringstream msg; + msg << "Error creating directory: " << dir << " Poco exception: " << ex.displayText(); + fprintf(stderr, "%s\n", msg.str().c_str()); return 1; } -#else -#error Unsupported OS -#endif return 0; } @@ -60,7 +66,6 @@ class StderrLog : public Log } ~StderrLog() { - Log::~Log(); } void log(Channel a_channel, const std::wstring &a_msg) @@ -92,10 +97,9 @@ int main(int argc, char **argv1) TSK_TCHAR **argv; extern int OPTIND; int ch; - struct STAT_STR stat_buf; - TSK_TCHAR *pipeline_config = NULL; - TSK_TCHAR *framework_config = NULL; - std::wstring outDirPath; + std::string pipeline_config; + std::string framework_config; + std::string outDirPath; bool suppressSTDERR = false; bool doCarving = true; @@ -119,10 +123,18 @@ int main(int argc, char **argv1) argv[OPTIND]); usage(argv1[0]); case _TSK_T('c'): - framework_config = OPTARG; +#ifdef TSK_WIN32 + framework_config.assign(TskUtilities::toUTF8(std::wstring(OPTARG))); +#else + framework_config.assign(OPTARG); +#endif break; case _TSK_T('p'): - pipeline_config = OPTARG; +#ifdef TSK_WIN32 + pipeline_config.assign(TskUtilities::toUTF8(std::wstring(OPTARG))); +#else + pipeline_config.assign(OPTARG); +#endif break; case _TSK_T('v'): tsk_verbose++; @@ -132,7 +144,11 @@ int main(int argc, char **argv1) exit(0); break; case _TSK_T('d'): +#ifdef TSK_WIN32 + outDirPath.assign(TskUtilities::toUTF8(std::wstring(OPTARG))); +#else outDirPath.assign(OPTARG); +#endif break; case _TSK_T('C'): doCarving = false; @@ -149,10 +165,16 @@ int main(int argc, char **argv1) usage(argv1[0]); } - TSK_TCHAR *imagePath = argv[OPTIND]; - if (TSTAT(imagePath, &stat_buf) != 0) { - std::wstringstream msg; - msg << L"Image file not found: " << imagePath; + std::string imagePath; +#ifdef TSK_WIN32 + imagePath = TskUtilities::toUTF8(std::wstring(argv[OPTIND])); +#else + imagePath = argv1[OPTIND]; +#endif + + if (!Poco::File(imagePath).exists()) { + std::stringstream msg; + msg << "Image file not found: " << imagePath; LOGERROR(msg.str()); return 1; } @@ -160,20 +182,26 @@ int main(int argc, char **argv1) // Load the framework config if they specified it try { - if (framework_config) { + if (framework_config.size()) { // Initialize properties based on the config file. TskSystemPropertiesImpl *systemProperties = new TskSystemPropertiesImpl(); systemProperties->initialize(framework_config); TskServices::Instance().setSystemProperties(*systemProperties); } + else if (Poco::File("framework_config.xml").exists()) { + TskSystemPropertiesImpl *systemProperties = new TskSystemPropertiesImpl(); + systemProperties->initialize("framework_config.xml"); + TskServices::Instance().setSystemProperties(*systemProperties); + } else { - Poco::File config("framework_config.xml"); - if (config.exists()) { - TskSystemPropertiesImpl *systemProperties = new TskSystemPropertiesImpl(); - systemProperties->initialize("framework_config.xml"); + TskSystemPropertiesImpl *systemProperties = new TskSystemPropertiesImpl(); + systemProperties->initialize(); + std::string progdir = systemProperties->get(TskSystemProperties::PROG_DIR); + std::string configPath = progdir + "../../../runtime/framework_config.xml"; + if (Poco::File(configPath).exists()) { + systemProperties->initialize(configPath); TskServices::Instance().setSystemProperties(*systemProperties); - } - else { + } else { fprintf(stderr, "No framework config file found\n"); } } @@ -184,58 +212,57 @@ int main(int argc, char **argv1) return 1; } - if (outDirPath == _TSK_T("")) { + if (outDirPath == "") { outDirPath.assign(imagePath); - outDirPath.append(_TSK_T("_tsk_out")); + outDirPath.append("_tsk_out"); } - if (TSTAT(outDirPath.c_str(), &stat_buf) == 0) { - std::wstringstream msg; - msg << L"Output directory already exists " << outDirPath.c_str(); + if (Poco::File(outDirPath).exists()) { + std::stringstream msg; + msg << "Output directory already exists " << outDirPath; LOGERROR(msg.str()); return 1; } - // @@@ Not UNIX-friendly - SetSystemPropertyW(TskSystemProperties::OUT_DIR, outDirPath); + SetSystemProperty(TskSystemProperties::OUT_DIR, outDirPath); if (makeDir(outDirPath.c_str())) { return 1; } - if (makeDir(GetSystemPropertyW(TskSystemProperties::SYSTEM_OUT_DIR).c_str())) + if (makeDir(GetSystemProperty(TskSystemProperties::SYSTEM_OUT_DIR).c_str())) { return 1; } - if (makeDir(GetSystemPropertyW(TskSystemProperties::MODULE_OUT_DIR).c_str())) + if (makeDir(GetSystemProperty(TskSystemProperties::MODULE_OUT_DIR).c_str())) { return 1; } - std::wstring logDir = GetSystemPropertyW(TskSystemProperties::LOG_DIR); + std::string logDir = GetSystemProperty(TskSystemProperties::LOG_DIR); if (makeDir(logDir.c_str())) { return 1; } - struct tm newtime; + struct tm * newtime; time_t aclock; time(&aclock); // Get time in seconds - localtime_s(&newtime, &aclock); // Convert time to struct tm form - wchar_t filename[MAX_BUFF_LENGTH]; - _snwprintf_s(filename, MAX_BUFF_LENGTH, MAX_BUFF_LENGTH, L"\\log_%.4d-%.2d-%.2d-%.2d-%.2d-%.2d.txt", - newtime.tm_year + 1900, newtime.tm_mon+1, newtime.tm_mday, - newtime.tm_hour, newtime.tm_min, newtime.tm_sec); + newtime = localtime(&aclock); + char filename[MAX_BUFF_LENGTH]; + snprintf(filename, MAX_BUFF_LENGTH, "/log_%.4d-%.2d-%.2d-%.2d-%.2d-%.2d.txt", + newtime->tm_year + 1900, newtime->tm_mon+1, newtime->tm_mday, + newtime->tm_hour, newtime->tm_min, newtime->tm_sec); logDir.append(filename); - Log *log = NULL; + std::auto_ptr<Log> log(NULL); if(suppressSTDERR) - log = new Log(); + log = std::auto_ptr<Log>(new Log()); else - log = new StderrLog(); + log = std::auto_ptr<Log>(new StderrLog()); log->open(logDir.c_str()); TskServices::Instance().setLog(*log); @@ -244,8 +271,8 @@ int main(int argc, char **argv1) std::auto_ptr<TskImgDB> pImgDB(NULL); pImgDB = std::auto_ptr<TskImgDB>(new TskImgDBSqlite(outDirPath.c_str())); if (pImgDB->initialize() != 0) { - std::wstringstream msg; - msg << L"Error initializing SQLite database: " << outDirPath.c_str(); + std::stringstream msg; + msg << "Error initializing SQLite database: " << outDirPath; LOGERROR(msg.str()); return 1; } @@ -257,9 +284,8 @@ int main(int argc, char **argv1) // Create a Blackboard and register it with the framework. TskServices::Instance().setBlackboard((TskBlackboard &) TskDBBlackboard::instance()); - // @@@ Not UNIX-friendly - if (pipeline_config != NULL) - SetSystemPropertyW(TskSystemProperties::PIPELINE_CONFIG_FILE, pipeline_config); + if (pipeline_config.size()) + SetSystemProperty(TskSystemProperties::PIPELINE_CONFIG_FILE, pipeline_config); // Create a Scheduler and register it TskSchedulerQueue scheduler; @@ -268,8 +294,8 @@ int main(int argc, char **argv1) // Create an ImageFile and register it with the framework. TskImageFileTsk imageFileTsk; if (imageFileTsk.open(imagePath) != 0) { - std::wstringstream msg; - msg << L"Error opening image: " << imagePath; + std::stringstream msg; + msg << "Error opening image: " << imagePath; LOGERROR(msg.str()); return 1; } @@ -284,11 +310,9 @@ int main(int argc, char **argv1) try { filePipeline = pipelineMgr.createPipeline(TskPipelineManager::FILE_ANALYSIS_PIPELINE); } - catch (TskException &e ) { - std::wstringstream msg; - std::wstring exceptionMsg; - Poco::UnicodeConverter::toUTF16(e.message(), exceptionMsg); - msg << L"Error creating file analysis pipeline: " << exceptionMsg; + catch (const TskException &e ) { + std::stringstream msg; + msg << "Error creating file analysis pipeline: " << e.message(); LOGERROR(msg.str()); filePipeline = NULL; } @@ -297,18 +321,16 @@ int main(int argc, char **argv1) try { reportPipeline = pipelineMgr.createPipeline(TskPipelineManager::POST_PROCESSING_PIPELINE); } - catch (TskException &e ) { - std::wstringstream msg; - std::wstring exceptionMsg; - Poco::UnicodeConverter::toUTF16(e.message(), exceptionMsg); - msg << L"Error creating reporting pipeline: " << exceptionMsg; + catch (const TskException &e ) { + std::stringstream msg; + msg << "Error creating reporting pipeline: " << e.message(); LOGERROR(msg.str()); reportPipeline = NULL; } if ((filePipeline == NULL) && (reportPipeline == NULL)) { - std::wstringstream msg; - msg << L"No pipelines configured. Stopping"; + std::stringstream msg; + msg << "No pipelines configured. Stopping"; LOGERROR(msg.str()); exit(1); } @@ -316,8 +338,8 @@ int main(int argc, char **argv1) // now we analyze the data. // Extract if (imageFileTsk.extractFiles() != 0) { - std::wstringstream msg; - msg << L"Error adding file system info to database"; + std::stringstream msg; + msg << "Error adding file system info to database"; LOGERROR(msg.str()); return 1; } @@ -345,11 +367,11 @@ int main(int argc, char **argv1) } else { - std::wstringstream msg; - msg << L"WARNING: Skipping task: " << task->task; + std::stringstream msg; + msg << "WARNING: Skipping task: " << task->task; LOGWARN(msg.str()); - continue; } + delete task; } catch (...) { @@ -371,8 +393,8 @@ int main(int argc, char **argv1) } catch (...) { - std::wstringstream msg; - msg << L"Error running reporting pipeline"; + std::stringstream msg; + msg << "Error running reporting pipeline"; LOGERROR(msg.str()); return 1; } @@ -383,10 +405,10 @@ int main(int argc, char **argv1) } } - std::wstringstream msg; - msg << L"image analysis complete"; + std::stringstream msg; + msg << "image analysis complete"; LOGINFO(msg.str()); - wcout << L"Results saved to " << outDirPath; + cout << "Results saved to " << outDirPath << std::endl; return 0; } diff --git a/framework/tools/tsk_validatepipeline/Makefile.am b/framework/tools/tsk_validatepipeline/Makefile.am new file mode 100644 index 000000000..6cd84335e --- /dev/null +++ b/framework/tools/tsk_validatepipeline/Makefile.am @@ -0,0 +1,5 @@ +tsk_validatepipeline_CXXFLAGS = -I.. -I../.. -I../../.. -Wall +LDADD = ../../tsk/framework/libtskframework.la ../../../tsk/libtsk.la + +bin_PROGRAMS = tsk_validatepipeline +tsk_validatepipeline_SOURCES = tsk_validatepipeline.cpp diff --git a/framework/tsk_validatepipeline/tsk_validatepipeline.cpp b/framework/tools/tsk_validatepipeline/tsk_validatepipeline.cpp similarity index 75% rename from framework/tsk_validatepipeline/tsk_validatepipeline.cpp rename to framework/tools/tsk_validatepipeline/tsk_validatepipeline.cpp index e127c9042..f25c50060 100755 --- a/framework/tsk_validatepipeline/tsk_validatepipeline.cpp +++ b/framework/tools/tsk_validatepipeline/tsk_validatepipeline.cpp @@ -12,10 +12,12 @@ #include <stdlib.h> #include <fstream> #include <sstream> +#ifdef TSK_WIN32 #include <Windows.h> +#endif -#include "framework.h" -#include "Services/TskSystemPropertiesImpl.h" +#include "tsk/framework/framework.h" +#include "tsk/framework/services/TskSystemPropertiesImpl.h" #include "Poco/AutoPtr.h" #include "Poco/Path.h" @@ -29,7 +31,7 @@ #include "Poco/SAX/SAXException.h" #include "Poco/Util/XMLConfiguration.h" #include "Poco/Util/AbstractConfiguration.h" - +#include "Poco/TemporaryFile.h" #define VALIDATE_PIPELINE_VERSION "1.0.0.0" @@ -98,21 +100,25 @@ bool ValidatePipeline::isValid(const char *a_configPath) const std::string pipelineType = pElem->getAttribute(TskPipelineManager::PIPELINE_TYPE); - TskPipeline * pipeline; + TskPipeline * pipeline = 0; if (pipelineType == TskPipelineManager::FILE_ANALYSIS_PIPELINE) pipeline = new TskFileAnalysisPipeline(); - else if (pipelineType == TskPipelineManager::REPORTING_PIPELINE) + else if (pipelineType == TskPipelineManager::REPORTING_PIPELINE || +pipelineType == TskPipelineManager::POST_PROCESSING_PIPELINE +) pipeline = new TskReportPipeline(); else fprintf(stdout, "Unsupported pipeline type: %s\n", pipelineType.c_str()); - - try { - pipeline->validate(pipelineXml.str()); - } catch (...) { - fprintf(stdout, "Error parsing pipeline: %s\n", pElem->getAttribute(TskPipelineManager::PIPELINE_TYPE).c_str()); - failed = true; + if (pipeline) { + + try { + pipeline->validate(pipelineXml.str()); + } catch (...) { + fprintf(stdout, "Error parsing pipeline: %s\n", pElem->getAttribute(TskPipelineManager::PIPELINE_TYPE).c_str()); + failed = true; + } + delete pipeline; } - delete pipeline; } if (!failed) result = true; @@ -125,26 +131,6 @@ bool ValidatePipeline::isValid(const char *a_configPath) const return result; } -static std::wstring getProgDir() -{ - wchar_t progPath[256]; - wchar_t fullPath[256]; - HINSTANCE hInstance = GetModuleHandle(NULL); - - GetModuleFileName(hInstance, fullPath, 256); - for (int i = wcslen(fullPath)-1; i > 0; i--) { - if (i > 256) - break; - - if (fullPath[i] == '\\') { - wcsncpy_s(progPath, fullPath, i+1); - progPath[i+1] = '\0'; - break; - } - } - return std::wstring(progPath); -} - int main(int argc, char **argv) { progname = argv[0]; @@ -159,23 +145,19 @@ int main(int argc, char **argv) // open the log temp file Log log; - wchar_t filename[MAX_PATH]; + Poco::TemporaryFile filename; - if (!GetTempFileName(L".", L"", 0, filename)) { - fprintf(stderr, "Failed to create temporary file.\n"); - return 1; - } - log.open(filename); + log.open(filename.path().c_str()); TskServices::Instance().setLog(log); - std::wstring progDirPath = getProgDir(); + std::string progDirPath = TskUtilities::getProgDir(); // Initialize properties based on the config file. Do this to shutdown noise in validation. TskSystemPropertiesImpl systemProperties; systemProperties.initialize(frameworkConfigPath); TskServices::Instance().setSystemProperties(systemProperties); - SetSystemPropertyW(TskSystemProperties::PROG_DIR, progDirPath); + SetSystemProperty(TskSystemProperties::PROG_DIR, progDirPath); ValidatePipeline vp; bool valid = vp.isValid(pipelineConfigPath); @@ -186,7 +168,7 @@ int main(int argc, char **argv) #define MAX_BUF 1024 char buf[MAX_BUF]; - std::ifstream fin(filename); + std::ifstream fin(filename.path().c_str()); fprintf(stdout, "\nLog messages created during validation: \n"); while (fin.getline(buf, MAX_BUF)) { @@ -194,8 +176,6 @@ int main(int argc, char **argv) } fin.close(); - (void)DeleteFile(filename); - if (valid) return 0; else diff --git a/framework/tsk/framework/Makefile.am b/framework/tsk/framework/Makefile.am new file mode 100644 index 000000000..98f240995 --- /dev/null +++ b/framework/tsk/framework/Makefile.am @@ -0,0 +1,13 @@ +SUBDIRS = extraction file pipeline services utilities + +# Merge the libraries into one +lib_LTLIBRARIES = libtskframework.la +libtskframework_la_SOURCES = +libtskframework_la_LIBADD = extraction/libfwextract.la \ + file/libfwfile.la \ + pipeline/libfwpipe.la \ + services/libfwserv.la \ + utilities/libfwutil.la + +# current:revision:age +libtskframework_la_LDFLAGS = -version-info 0:0:0 diff --git a/framework/TskVersionInfo.h b/framework/tsk/framework/TskVersionInfo.h similarity index 92% rename from framework/TskVersionInfo.h rename to framework/tsk/framework/TskVersionInfo.h index d6226ece5..64e28c908 100755 --- a/framework/TskVersionInfo.h +++ b/framework/tsk/framework/TskVersionInfo.h @@ -11,7 +11,7 @@ #ifndef _TSK_VERSIONINFO_H #define _TSK_VERSIONINFO_H -#include "tsk3/base/tsk_base_i.h" +#include "tsk/base/tsk_base.h" /** * Class that allows us to determine framework version, diff --git a/framework/Extraction/CarveExtract.h b/framework/tsk/framework/extraction/CarveExtract.h similarity index 92% rename from framework/Extraction/CarveExtract.h rename to framework/tsk/framework/extraction/CarveExtract.h index af638915d..cc117c6c4 100755 --- a/framework/Extraction/CarveExtract.h +++ b/framework/tsk/framework/extraction/CarveExtract.h @@ -15,7 +15,7 @@ #ifndef _TSK_CARVEEXTRACT_H #define _TSK_CARVEEXTRACT_H -#include "Services/TskImgDB.h" +#include "tsk/framework/services/TskImgDB.h" /** * Interface for class that will carve an unallocated sectors image file. The diff --git a/framework/Extraction/CarvePrep.h b/framework/tsk/framework/extraction/CarvePrep.h similarity index 93% rename from framework/Extraction/CarvePrep.h rename to framework/tsk/framework/extraction/CarvePrep.h index 114fd3d67..95609a2a2 100755 --- a/framework/Extraction/CarvePrep.h +++ b/framework/tsk/framework/extraction/CarvePrep.h @@ -15,7 +15,7 @@ #ifndef _TSK_CARVE_PREP_H #define _TSK_CARVE_PREP_H -#include "Services/TskImgDB.h" +#include "tsk/framework/services/TskImgDB.h" /** * Interface for class that prepares for later carving. @@ -45,4 +45,4 @@ class TSK_FRAMEWORK_API CarvePrep virtual int processSectors(bool a_toSchedule) = 0; }; -#endif \ No newline at end of file +#endif diff --git a/framework/tsk/framework/extraction/Makefile.am b/framework/tsk/framework/extraction/Makefile.am new file mode 100644 index 000000000..8796a8370 --- /dev/null +++ b/framework/tsk/framework/extraction/Makefile.am @@ -0,0 +1,8 @@ +AM_CXXFLAGS = -I.. -I../.. -I../../../.. -Wall + +noinst_LTLIBRARIES = libfwextract.la +libfwextract_la_SOURCES = TskAutoImpl.cpp TskAutoImpl.h \ + TskCarveExtractScalpel.cpp TskCarveExtractScalpel.h \ + TskCarvePrepSectorConcat.cpp TskCarvePrepSectorConcat.h \ + TskImageFile.cpp TskImageFile.h \ + TskImageFileTsk.cpp TskImageFileTsk.h diff --git a/framework/Extraction/TskAutoImpl.cpp b/framework/tsk/framework/extraction/TskAutoImpl.cpp similarity index 94% rename from framework/Extraction/TskAutoImpl.cpp rename to framework/tsk/framework/extraction/TskAutoImpl.cpp index 13b597eea..49987e0c0 100755 --- a/framework/Extraction/TskAutoImpl.cpp +++ b/framework/tsk/framework/extraction/TskAutoImpl.cpp @@ -10,9 +10,10 @@ #include <string> #include <sstream> +#include <string.h> -#include "TSKAutoImpl.h" -#include "Services/TskServices.h" +#include "TskAutoImpl.h" +#include "tsk/framework/services/TskServices.h" #define TSK_SCHEMA_VER 1 @@ -419,7 +420,7 @@ TSK_RETVAL_ENUM TSKAutoImpl::processAttribute(TSK_FS_FILE * a_fsFile, } void TSKAutoImpl::createDummyVolume(const TSK_DADDR_T sect_start, const TSK_DADDR_T sect_len, - char *desc, TSK_VS_PART_FLAG_ENUM flags) + const char * desc, TSK_VS_PART_FLAG_ENUM flags) { m_curVsId++; @@ -428,7 +429,7 @@ void TSKAutoImpl::createDummyVolume(const TSK_DADDR_T sect_start, const TSK_DADD part.len = sect_len; part.start = sect_start; part.flags = flags; - part.desc = desc; + part.desc = (char *)desc; // remove the cast when TSK_VS_PART_INFO.desc is const char * if (m_db.addVolumeInfo(&part)) { diff --git a/framework/Extraction/TskAutoImpl.h b/framework/tsk/framework/extraction/TskAutoImpl.h similarity index 81% rename from framework/Extraction/TskAutoImpl.h rename to framework/tsk/framework/extraction/TskAutoImpl.h index dc397a021..042674306 100755 --- a/framework/Extraction/TskAutoImpl.h +++ b/framework/tsk/framework/extraction/TskAutoImpl.h @@ -8,7 +8,7 @@ * This software is distributed under the Common Public License 1.0 */ -#include "framework_i.h" +#include "tsk/framework/framework_i.h" #ifndef _TSK_AUTO_IMPL_H #define _TSK_AUTO_IMPL_H @@ -16,9 +16,9 @@ #ifdef __cplusplus // Include the other TSK header files -#include "tsk3/libtsk.h" -#include "Services/TskImgDB.h" -#include "Services/Scheduler.h" +#include "tsk/libtsk.h" +#include "tsk/framework/services/TskImgDB.h" +#include "tsk/framework/services/Scheduler.h" #include <map> #include <string> #include <queue> @@ -53,7 +53,7 @@ class TSK_FRAMEWORK_API TSKAutoImpl:public TskAuto { uint64_t m_numFilesSeen; time_t m_lastUpdateMsg; std::queue<Scheduler::task_struct> m_filesToSchedule; ///< Scheduler tasks to submit once transaction is commited - static const int m_numOfFilesToQueue = 1000; ///< max number of files to queue up in a transaction before commiting + static const unsigned int m_numOfFilesToQueue = 1000; ///< max number of files to queue up in a transaction before commiting TSK_RETVAL_ENUM insertFileData(TSK_FS_FILE * fs_file, const TSK_FS_ATTR *, const char *path, uint64_t & fileId); @@ -61,7 +61,7 @@ class TSK_FRAMEWORK_API TSKAutoImpl:public TskAuto { virtual TSK_RETVAL_ENUM processAttribute(TSK_FS_FILE *, const TSK_FS_ATTR * fs_attr, const char *path); void createDummyVolume(const TSK_DADDR_T sect_start, const TSK_DADDR_T sect_len, - char * desc, TSK_VS_PART_FLAG_ENUM flags); + const char * desc, TSK_VS_PART_FLAG_ENUM flags); void commitAndSchedule(); }; diff --git a/framework/Extraction/TskCarveExtractScalpel.cpp b/framework/tsk/framework/extraction/TskCarveExtractScalpel.cpp similarity index 94% rename from framework/Extraction/TskCarveExtractScalpel.cpp rename to framework/tsk/framework/extraction/TskCarveExtractScalpel.cpp index a9adc164c..bd878f78f 100644 --- a/framework/Extraction/TskCarveExtractScalpel.cpp +++ b/framework/tsk/framework/extraction/TskCarveExtractScalpel.cpp @@ -18,11 +18,11 @@ #include "TskCarveExtractScalpel.h" // TSK Framework includes -#include "Services/TskServices.h" -#include "Services/TskImgDB.h" -#include "Utilities/TskUtilities.h" -#include "Utilities/UnallocRun.h" -#include "Utilities/TskException.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/services/TskImgDB.h" +#include "tsk/framework/utilities/TskUtilities.h" +#include "tsk/framework/utilities/UnallocRun.h" +#include "tsk/framework/utilities/TskException.h" // Poco includes #include "Poco/Path.h" @@ -41,10 +41,15 @@ #include <cstdlib> #include <vector> #include <algorithm> +#include <memory> namespace { +#ifdef TSK_WIN32 const std::string SCALPEL_EXE_FILE_NAME = "scalpel.exe"; +#else + const std::string SCALPEL_EXE_FILE_NAME = "scalpel"; +#endif const std::string CARVED_FILES_FOLDER = "CarvedFiles"; const std::string SCALPEL_RESULTS_FILE_NAME = "audit.txt"; const std::string STD_OUT_DUMP_FILE_NAME = "stdout.txt"; @@ -337,14 +342,15 @@ void TskCarveExtractScalpel::processCarvedFiles(const std::string &outputFolderP // Add the mapping to the image database. uint64_t fileId; - if (imgDB.addCarvedFileInfo(run->getVolId(), const_cast<wchar_t*>(TskUtilities::toUTF16((*file).name).c_str()), (*file).length, §orRunStart[0], §orRunLength[0], numberOfRuns, fileId) == -1) + if (imgDB.addCarvedFileInfo(run->getVolId(), (*file).name.c_str(), (*file).length, §orRunStart[0], §orRunLength[0], numberOfRuns, fileId) == -1) { std::stringstream msg; msg << "TskCarveExtractScalpel::processCarvedFiles : unable to save carved file info for '" << filePath.str() << "'"; throw TskException(msg.str()); } - TskServices::Instance().getFileManager().addFile(fileId, TskUtilities::toUTF16(filePath.str())); + std::wstring f(TskUtilities::toUTF16(filePath.str())); + TskServices::Instance().getFileManager().addFile(fileId, f); // Delete output (carved) files by default. std::string option = GetSystemProperty("CARVE_EXTRACT_KEEP_OUTPUT_FILES"); @@ -377,4 +383,4 @@ void TskCarveExtractScalpel::processCarvedFiles(const std::string &outputFolderP TskCarveExtractScalpel::CarvedFile::CarvedFile(int unallocImgId, const std::string &fileName, const std::string &offsetInBytes, const std::string &lengthInBytes) : id(unallocImgId), name(fileName), offset(strtoul(offsetInBytes.c_str(), 0, 10)), length(strtoul(lengthInBytes.c_str(), 0, 10)) { -} \ No newline at end of file +} diff --git a/framework/Extraction/TskCarveExtractScalpel.h b/framework/tsk/framework/extraction/TskCarveExtractScalpel.h similarity index 91% rename from framework/Extraction/TskCarveExtractScalpel.h rename to framework/tsk/framework/extraction/TskCarveExtractScalpel.h index 6ccf6206e..179bc65a9 100644 --- a/framework/Extraction/TskCarveExtractScalpel.h +++ b/framework/tsk/framework/extraction/TskCarveExtractScalpel.h @@ -17,7 +17,7 @@ #define _TSK_CARVEEXTRACTSCALPEL_H // TSK Framework includes -#include "Extraction/CarveExtract.h" +#include "tsk/framework/extraction/CarveExtract.h" // Poco includes #include "Poco/Pipe.h" @@ -74,7 +74,7 @@ class TSK_FRAMEWORK_API TskCarveExtractScalpel : public CarveExtract * @return A possibly empty vector of CarvedFile objects representing * carved files. Throws TskException on error. */ - std::vector<CarvedFile> TskCarveExtractScalpel::parseCarvingResultsFile(int unallocImgId, const std::string &resultsFilePath) const; + std::vector<CarvedFile> parseCarvingResultsFile(int unallocImgId, const std::string &resultsFilePath) const; /** * Writes the unallocated sectors mapping of a set of carved files to the diff --git a/framework/Extraction/TskCarvePrepSectorConcat.cpp b/framework/tsk/framework/extraction/TskCarvePrepSectorConcat.cpp similarity index 89% rename from framework/Extraction/TskCarvePrepSectorConcat.cpp rename to framework/tsk/framework/extraction/TskCarvePrepSectorConcat.cpp index ff0b7a970..5838cd7f1 100644 --- a/framework/Extraction/TskCarvePrepSectorConcat.cpp +++ b/framework/tsk/framework/extraction/TskCarvePrepSectorConcat.cpp @@ -17,10 +17,10 @@ #include "TskCarvePrepSectorConcat.h" // TSK Framework includes -#include "Services/TskImgDB.h" -#include "Services/TskServices.h" -#include "Services/Log.h" -#include "Utilities/TskUtilities.h" +#include "tsk/framework/services/TskImgDB.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/services/Log.h" +#include "tsk/framework/utilities/TskUtilities.h" // Poco includes #include "Poco/File.h" @@ -33,6 +33,9 @@ #include <string> #include <sstream> #include <cstdlib> +#include <iostream> +#include <fstream> +#include <memory> namespace { @@ -52,7 +55,7 @@ int TskCarvePrepSectorConcat::processSectors(bool scheduleCarving) std::string outputFileName; size_t maxOutputFileSize; setUpForCarvePrep(outputFolderPath, outputFileName, maxOutputFileSize); - + std::auto_ptr<SectorRuns> sectorRuns(TskServices::Instance().getImgDB().getFreeSectors()); if (sectorRuns.get()) { @@ -158,7 +161,7 @@ void TskCarvePrepSectorConcat::createUnallocSectorsImgFiles(const std::string &o TskImgDB &imgDB = TskServices::Instance().getImgDB(); int volumeID = -1; int unallocSectorsImgId = 0; - HANDLE outputFileHandle; + std::ofstream outfile; uint64_t currentFileOffset = 0; // In bytes do { @@ -187,7 +190,7 @@ void TskCarvePrepSectorConcat::createUnallocSectorsImgFiles(const std::string &o // Store the mapping of the sectors written to the output file to the corresponding sectors in the image. if (currentFileOffset != startingFileOffset) { - mapFileToImage(unallocSectorsImgId, outputFileHandle, startingFileOffset, currentFileOffset, sectorRuns.getVolID(), startingImageOffset); + mapFileToImage(unallocSectorsImgId, outfile, startingFileOffset, currentFileOffset, sectorRuns.getVolID(), startingImageOffset); // Advance the starting image offset to accurately reflect the starting image offset for the next output file. startingImageOffset += (currentFileOffset - startingFileOffset) / 512; @@ -196,7 +199,7 @@ void TskCarvePrepSectorConcat::createUnallocSectorsImgFiles(const std::string &o // Close the current output file. if (unallocSectorsImgId) { - CloseHandle(outputFileHandle); + outfile.close(); } // Schedule the current output file for carving. Note that derived classes can change this behavior by overriding onUnallocSectorsImgFileCreated. @@ -218,8 +221,8 @@ void TskCarvePrepSectorConcat::createUnallocSectorsImgFiles(const std::string &o // Create an output file in the subdirectory. path << Poco::Path::separator() << outputFileName.c_str(); - outputFileHandle = CreateFileW(TskUtilities::toUTF16(path.str()).c_str(), GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (outputFileHandle == INVALID_HANDLE_VALUE) + outfile.open(path.str().c_str(), std::ios_base::out|std::ios_base::binary); + if (outfile.fail()) { TskServices::Instance().getImgDB().setUnallocImgStatus(unallocSectorsImgId, TskImgDB::IMGDB_UNALLOC_IMG_STATUS_CARVED_ERR); @@ -227,7 +230,6 @@ void TskCarvePrepSectorConcat::createUnallocSectorsImgFiles(const std::string &o msg << "TskCarvePrepSectorConcat::createUnallocSectorsImgFiles : failed to create output file " << unallocSectorsImgId; throw TskException(msg.str()); } - // Reset the output file offsets and volume ID. currentFileOffset = 0; startingFileOffset = 0; @@ -243,8 +245,8 @@ void TskCarvePrepSectorConcat::createUnallocSectorsImgFiles(const std::string &o } // Write the chunk of sectors to the output file. - DWORD nBytesWritten; - if (WriteFile(outputFileHandle, sectorBuffer, sectorsRead * 512, &nBytesWritten, NULL) == FALSE) + outfile.write(sectorBuffer, sectorsRead * 512); + if (outfile.bad()) { imgDB.setUnallocImgStatus(unallocSectorsImgId, TskImgDB::IMGDB_UNALLOC_IMG_STATUS_CARVED_ERR); std::stringstream msg; @@ -253,7 +255,7 @@ void TskCarvePrepSectorConcat::createUnallocSectorsImgFiles(const std::string &o } // Update the output file and sector run offsets to reflect the sucessful read. - currentFileOffset += nBytesWritten; + currentFileOffset += sectorsRead * 512; sectorRunOffset += sectorsRead; if (sectorsRead == 0) @@ -265,15 +267,15 @@ void TskCarvePrepSectorConcat::createUnallocSectorsImgFiles(const std::string &o // Store the mapping of the sectors written to the output file to the corresponding sectors in the image. if (currentFileOffset != startingFileOffset) { - mapFileToImage(unallocSectorsImgId, outputFileHandle, startingFileOffset, currentFileOffset, sectorRuns.getVolID(), startingImageOffset); + mapFileToImage(unallocSectorsImgId, outfile, startingFileOffset, currentFileOffset, sectorRuns.getVolID(), startingImageOffset); } - } + } while(sectorRuns.next() != -1); // Close the final output file. if (unallocSectorsImgId) { - CloseHandle(outputFileHandle); + outfile.close(); } // Schedule the final output file. @@ -281,6 +283,11 @@ void TskCarvePrepSectorConcat::createUnallocSectorsImgFiles(const std::string &o { onUnallocSectorsImgFileCreated(unallocSectorsImgId, scheduleCarving); } + + if (sectorBuffer != NULL) + { + delete [] sectorBuffer; + } } catch(...) { @@ -313,7 +320,7 @@ void TskCarvePrepSectorConcat::createFolder(const std::string &path) const } } -void TskCarvePrepSectorConcat::mapFileToImage(int unallocSectorsImgId, HANDLE outputFileHandle, uint64_t startingFileOffset, uint64_t endingFileOffset, int volumeID, uint64_t startingImageOffset) const +void TskCarvePrepSectorConcat::mapFileToImage(int unallocSectorsImgId, std::ofstream & outfile, uint64_t startingFileOffset, uint64_t endingFileOffset, int volumeID, uint64_t startingImageOffset) const { // Convert the starting offset in the output file from a byte offset to a sector offset and calculate the number of sectors written to the file. uint64_t startingFileOffsetInSectors = startingFileOffset / 512; @@ -322,9 +329,9 @@ void TskCarvePrepSectorConcat::mapFileToImage(int unallocSectorsImgId, HANDLE ou // Store the mapping of the output file sectors to image sectors. if (TskServices::Instance().getImgDB().addAllocUnallocMapInfo(volumeID, unallocSectorsImgId, startingFileOffsetInSectors, sectorsWritten, startingImageOffset) != 0) { - CloseHandle(outputFileHandle); + outfile.close(); std::stringstream msg; msg << "TskCarvePrepSectorConcat::mapFileToImage : failed to add mapping to image for output file " << unallocSectorsImgId; throw TskException(msg.str()); } -} \ No newline at end of file +} diff --git a/framework/Extraction/TskCarvePrepSectorConcat.h b/framework/tsk/framework/extraction/TskCarvePrepSectorConcat.h similarity index 95% rename from framework/Extraction/TskCarvePrepSectorConcat.h rename to framework/tsk/framework/extraction/TskCarvePrepSectorConcat.h index 654280eee..3fed53271 100644 --- a/framework/Extraction/TskCarvePrepSectorConcat.h +++ b/framework/tsk/framework/extraction/TskCarvePrepSectorConcat.h @@ -136,7 +136,7 @@ class TSK_FRAMEWORK_API TskCarvePrepSectorConcat : public CarvePrep * the unallocated sectors image file. * @return Throws TskException on error. */ - void mapFileToImage(int unallocSectorsImgId, HANDLE outputFileHandle, uint64_t startingFileOffset, uint64_t endingFileOffset, int volumeID, uint64_t startingImageOffset) const; + void mapFileToImage(int unallocSectorsImgId, std::ofstream & outfile, uint64_t startingFileOffset, uint64_t endingFileOffset, int volumeID, uint64_t startingImageOffset) const; }; #endif diff --git a/framework/tsk/framework/extraction/TskExtract.cpp b/framework/tsk/framework/extraction/TskExtract.cpp new file mode 100644 index 000000000..5cef2eaf5 --- /dev/null +++ b/framework/tsk/framework/extraction/TskExtract.cpp @@ -0,0 +1,95 @@ +/* + * The Sleuth Kit + * + * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2013 Basis Technology Corporation. All Rights + * reserved. + * + * This software is distributed under the Common Public License 1.0 + */ + +/** + * \file + * + */ + +#include <string> + +#include "Poco/SharedPtr.h" + +#include "tsk/framework/framework_i.h" // to get TSK_FRAMEWORK_API +#include "tsk/framework/utilities/TskUtilities.h" +#include "TskExtract.h" +#include "TskL01Extract.h" + +namespace TskArchiveExtraction +{ + TskExtract::TskExtract() + {} + + TskExtract::~TskExtract() + {} + + namespace + { + // Support functions (not for clients) + + /** + * Determines if a file is in Encase L01 format, regardless of filename. + * File signature: First three bytes of an L01 file will be "LVF". + */ + bool isL01File(const char *path) + { + bool result = false; + FILE *f; + + if (!fopen_s(&f, path, "rb")) { + unsigned char buf[4]; + size_t bytesRead = fread(&buf, sizeof(unsigned char), 3, f); + if (bytesRead == 3) { + buf[3] = 0; + if (strcmp((const char*)buf, "LVF") == 0) + result = true; + } + fclose(f); + } + return result; + } + } + + /** + * Factory Function + * @param archivePath Local path of the container file. + * @param extFilter Optional filter string specifying a particular type of archive. + * @returns Smart pointer to a new extractor object appropriate to the container + * Pointer will be NULL if an extractor is not found for this container. + */ + ExtractorPtr createExtractor(const std::wstring &archivePath, const std::string filter /*= ""*/) + { + //Check based on file signature + if (filter.empty()) + { + std::string narrowPath = TskUtilities::toUTF8(archivePath); + if (isL01File(narrowPath.c_str())) + { + return new TskL01Extract(archivePath); + } + } + else + { + if (filter == "L01") + { + return new TskL01Extract(archivePath); + } + //else if (filter == "RAR") + //{ + // return new RarExtract(archivePath); + //} + //else if (filter == "ZIP") + //{ + // return new TskZipExtract(archivePath); + //} + } + return NULL; + } +} diff --git a/framework/tsk/framework/extraction/TskExtract.h b/framework/tsk/framework/extraction/TskExtract.h new file mode 100644 index 000000000..019a48cc6 --- /dev/null +++ b/framework/tsk/framework/extraction/TskExtract.h @@ -0,0 +1,46 @@ +/* + * The Sleuth Kit + * + * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2013 Basis Technology Corporation. All Rights + * reserved. + * + * This software is distributed under the Common Public License 1.0 + */ + +/** + * \file + * + */ +#ifndef _TSK_EXTRACT_H +#define _TSK_EXTRACT_H + +#include <string> +#include "Poco/SharedPtr.h" + +// Forward dec +class TskFile; + +namespace TskArchiveExtraction +{ + /** + * Abstract base interface class for container extractor classes + * + */ + class TSK_FRAMEWORK_API TskExtract + { + public: + TskExtract(); + virtual ~TskExtract(); + + virtual int extractFiles(TskFile * containerFile = NULL) = 0; + }; + + + TSK_FRAMEWORK_API typedef Poco::SharedPtr<TskExtract> ExtractorPtr; + + // Non-member Factory Function + TSK_FRAMEWORK_API ExtractorPtr createExtractor(const std::wstring &archivePath, const std::string filter = ""); +} + +#endif diff --git a/framework/Extraction/TskImageFile.cpp b/framework/tsk/framework/extraction/TskImageFile.cpp similarity index 100% rename from framework/Extraction/TskImageFile.cpp rename to framework/tsk/framework/extraction/TskImageFile.cpp diff --git a/framework/tsk/framework/extraction/TskImageFile.h b/framework/tsk/framework/extraction/TskImageFile.h new file mode 100755 index 000000000..db7ed535a --- /dev/null +++ b/framework/tsk/framework/extraction/TskImageFile.h @@ -0,0 +1,203 @@ +/* + * + * The Sleuth Kit + * + * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2010-2012 Basis Technology Corporation. All Rights + * reserved. + * + * This software is distributed under the Common Public License 1.0 + */ + +/** + * \file TskImageFile.h + * Contains the interface for the TskImageFile class. + */ + +#ifndef _TSK_IMAGEFILE_H +#define _TSK_IMAGEFILE_H + +#include "tsk/framework/framework_i.h" +#include <vector> +#include <string> + +/** + * An interface to a class that allows file system and low-level + * access to a disk image. + * It supports opening split image files, extracting file system + * information from the image and extracting data for a specific file + * or for a range of sectors. You must call one of the open() methods + * before using any of the other methods in the interface. + */ +class TSK_FRAMEWORK_API TskImageFile +{ +public: + /** + * You must call one of the open() methods after creating the object. + */ + TskImageFile(); + + virtual ~TskImageFile(); + + /** + * open the images at the paths saved in ImgDB + * @returns 0 on success and -1 on error + */ + virtual int open() = 0; + + /// Close the disk image. + virtual void close() = 0; + + /// Return the file name(s) that make up the image. + virtual std::vector<std::string> getFileNames() const = 0; + virtual std::vector<std::wstring> getFileNamesW() const = 0; + + /** + * Analyze the volume and file systems in the opened images and + * populate the TskImgDB instance registered with TskServices. This + * will not perform file carving. + * @returns 1 if there was a major error that prevented any extraction. 0 will + * be returned if there were minor errors during extraction or if there were + * no errors. + */ + virtual int extractFiles() = 0; + + /** + * Return the data located at the given sector offset in the disk image. + * @param sect_start Sector offset into image from which to return data + * @param sect_len Number of sectors to read + * @param buffer A buffer into which data will be placed. Must be at + * least len * 512 large + * @return Number of sectors read or -1 on error + */ + virtual int getSectorData(const uint64_t sect_start, + const uint64_t sect_len, + char *buffer) = 0; + + /** + * Return the data located at the given byte offset in the disk image. + * @param byte_start Byte offset into image from which to return data + * @param byte_len Number of bytes to read + * @param buffer A buffer into which data will be placed. Must be at + * least byte_len large + * @return Number of bytes read or -1 on error + */ + virtual int getByteData(const uint64_t byte_start, + const uint64_t byte_len, + char *buffer) = 0; + + /** + * Provides access to the content of a specific file that was extracted from the disk image. + * + * @param fileId ID of the file (can be found in database) + * @returns A handle to the file or -1 on error. + */ + virtual int openFile(const uint64_t fileId) = 0; + + /** + * Reads content of a file that was opened with openFile(). + * @param handle File handle that was returned by an earlier call to openFile() + * @param byte_offset Starting byte offset from which to read data + * @param byte_len The number of bytes to read + * @param buffer A buffer into which data will be placed. Must be at least + * byte_len bytes. + * @return Number of bytes read or -1 on error + */ + virtual int readFile(const int handle, + const TSK_OFF_T byte_offset, + const size_t byte_len, + char * buffer) = 0; + /** + * Closes an opened file. + * @param handle File handle that was returned by an earlier call to openFile() + */ + virtual int closeFile(const int handle) = 0; + + /** + * Opens a single (non-split) disk image file so that it can be read. + * + * @param imageFile The path to the image file + * @param imageType The disk image type (can be autodetection) + * @param sectorSize Size of device sector in bytes (or 0 for default) + * + * @return -1 on error and 0 on success + */ + virtual int open(const TSK_TCHAR *imageFile, + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0) = 0; + + /** + * Opens one or more disk image files so that they can be read. e UTF8, then consider + * + * @param numberOfImages The number of images to open (will be > 1 for split images). + * @param imageFile The path to the image files (the number of files must + * be equal to num_img and they must be in a sorted order) + * @param imageType The disk image type (can be autodetection) + * @param sectorSize Size of device sector in bytes (or 0 for default) + * + * @return -1 on error and 0 on success + */ + virtual int open(const int numberOfImages, + const TSK_TCHAR * const imageFile[], + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0) = 0; + + /** + * Opens a single (non-split) disk image file so that it can be read. This version + * always takes a UTF-8 encoding of the disk image. + * + * @param imageFile The UTF-8 path to the image file + * @param imageType The disk image type (can be autodetection) + * @param sectionSize Size of device sector in bytes (or 0 for default) + * + * @return -1 on error and 0 on success + */ + virtual int open(const std::string &imageFile, + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0) = 0; + + /** + * Opens a single (non-split) disk image file so that it can be read. + * + * @param imageFile The path to the image file + * @param imageType The disk image type (can be autodetection) + * @param sectionSize Size of device sector in bytes (or 0 for default) + * + * @return -1 on error and 0 on success + */ + virtual int open(const std::wstring &imageFile, + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0) = 0; + + /** + * Opens one or more disk image files so that they can be read. This + * version always takes a UTF-8 encoding of the image files. + * + * @param imageFile A vector of UTF-8 encoded image files + * @param imageType The disk image type (can be autodetection) + * @param sectorSize Size of device sector in bytes (or 0 for default) + * + * @return -1 on error and 0 on success + */ + virtual int open(const std::vector<std::string> &imageFile, + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0) = 0; + + /** + * Opens one or more disk image files so that they can be read. + * + * @param imageFile A vector of image files + * @param imageType The disk image type (can be autodetection) + * @param sectorSize Size of device sector in bytes (or 0 for default) + * + * @return -1 on error and 0 on success + */ + virtual int open(const std::vector<std::wstring> &imageFile, + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0) = 0; + +private: + +}; + +#endif diff --git a/framework/Extraction/TskImageFileTsk.cpp b/framework/tsk/framework/extraction/TskImageFileTsk.cpp similarity index 72% rename from framework/Extraction/TskImageFileTsk.cpp rename to framework/tsk/framework/extraction/TskImageFileTsk.cpp index a28dc6e8e..009eafa84 100755 --- a/framework/Extraction/TskImageFileTsk.cpp +++ b/framework/tsk/framework/extraction/TskImageFileTsk.cpp @@ -20,8 +20,9 @@ #include "TskImageFileTsk.h" #include "TskAutoImpl.h" -#include "Services/TskServices.h" -#include "tsk3/base/tsk_base_i.h" +#include "tsk/framework/utilities/TskUtilities.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/base/tsk_base_i.h" /** @@ -44,24 +45,6 @@ TskImageFileTsk::~TskImageFileTsk() close(); } -int TskImageFileTsk::open(const TSK_TCHAR *imageFile) -{ - if (!m_images.empty()) { - close(); - } - m_images.push_back(imageFile); - return openImages(); -} - -int TskImageFileTsk::open(const std::vector<std::wstring> &images) -{ - if (!m_images.empty()) { - close(); - } - m_images = images; - return openImages(); -} - /* * Opens the image files listed in ImgDB for later analysis and extraction. * @returns -1 on error and 0 on success @@ -71,11 +54,14 @@ int TskImageFileTsk::open() if (!m_images.empty()) { close(); } - m_images = m_db.getImageNames(); - if (m_images.empty()) { + std::vector<std::string> images = m_db.getImageNames(); + if (images.empty()) { LOGERROR(L"TskImageFileTsk::open: Error getting image names from ImgDB"); return -1; } + for (size_t i = 0; i < images.size(); i++) { + m_images.push_back(images[i]); + } return openImages(); } @@ -84,19 +70,20 @@ int TskImageFileTsk::open() * m_images. Used internally by both open() methods. * @returns -1 on error. */ -int TskImageFileTsk::openImages() +int TskImageFileTsk::openImages(const TSK_IMG_TYPE_ENUM imageType, + const unsigned int sectorSize) { - m_images_ptrs = (const wchar_t **)malloc(m_images.size() * sizeof(wchar_t *)); + m_images_ptrs = (const char **)malloc(m_images.size() * sizeof(char *)); if (m_images_ptrs == NULL) return -1; int i = 0; - for(std::vector<std::wstring>::iterator list_iter = m_images.begin(); + for(std::vector<std::string>::iterator list_iter = m_images.begin(); list_iter != m_images.end(); list_iter++) { m_images_ptrs[i++] = (*list_iter).c_str(); } - m_img_info = tsk_img_open(i, m_images_ptrs, TSK_IMG_TYPE_DETECT, 512); + m_img_info = tsk_img_open_utf8(i, m_images_ptrs, imageType, sectorSize); if (m_img_info == NULL) { std::wstringstream logMessage; @@ -187,32 +174,8 @@ int TskImageFileTsk::extractFiles() m_db.addImageInfo((int)m_img_info->itype, m_img_info->sector_size); for (uint32_t i = 0; i < m_images.size(); i++) { - char *img_ptr = NULL; -#ifdef TSK_WIN32 - char img2[1024]; - UTF8 *ptr8; - UTF16 *ptr16; - - ptr8 = (UTF8 *) img2; - ptr16 = (UTF16 *) m_images_ptrs[i]; - - TSKConversionResult retval = - tsk_UTF16toUTF8_lclorder((const UTF16 **) &ptr16, (UTF16 *) - & ptr16[wcslen(m_images_ptrs[i]) + 1], &ptr8, - (UTF8 *) ((uintptr_t) ptr8 + 1024), TSKlenientConversion); - if (retval != TSKconversionOK) - { - std::wstringstream msg; - msg << L"TskImageFileTsk::extractFiles: Error converting image to UTF-8" << std::endl; - LOGERROR(msg.str()); - - return 1; - } - img_ptr = img2; -#else - img_ptr = (char *) a_images[i]; -#endif - + const char *img_ptr = NULL; + img_ptr = m_images[i].c_str(); m_db.addImageName(img_ptr); } @@ -315,7 +278,7 @@ int TskImageFileTsk::openFile(const uint64_t fileId) } int TskImageFileTsk::readFile(const int handle, - const uint64_t byte_offset, + const TSK_OFF_T byte_offset, const size_t byte_len, char * buffer) { @@ -377,3 +340,91 @@ int TskImageFileTsk::closeFile(const int handle) return 0; } + +std::vector<std::wstring> TskImageFileTsk::getFileNamesW() const +{ + std::vector<std::wstring>imagesWide; + for (size_t i = 0; i < imagesWide.size(); i++) { + imagesWide.push_back(TskUtilities::toUTF16(m_images[i])); + } + return imagesWide; +} + +int TskImageFileTsk::open(const TSK_TCHAR *imageFile, + const TSK_IMG_TYPE_ENUM imageType, + const unsigned int sectorSize) +{ + if (!m_images.empty()) { + close(); + } +#ifdef TSK_WIN32 + m_images.push_back(TskUtilities::toUTF8(imageFile)); +#else + m_images.push_back(std::string(imageFile)); +#endif + return openImages(imageType, sectorSize); +} + +int TskImageFileTsk::open(const int numberOfImages, + const TSK_TCHAR * const imageFile[], + const TSK_IMG_TYPE_ENUM imageType, + const unsigned int sectorSize) +{ + if (!m_images.empty()) { + close(); + } + for (int i = 0; i < numberOfImages; i++) { +#ifdef WIN32 + m_images.push_back(TskUtilities::toUTF8(imageFile[i])); +#else + m_images.push_back(std::string(imageFile[i])); +#endif + } + return openImages(imageType, sectorSize); +} + +int TskImageFileTsk::open(const std::string &imageFile, + const TSK_IMG_TYPE_ENUM imageType, + const unsigned int sectorSize) +{ + if (!m_images.empty()) { + close(); + } + m_images.push_back(imageFile); + return openImages(imageType, sectorSize); +} + +int TskImageFileTsk::open(const std::wstring &imageFile, + const TSK_IMG_TYPE_ENUM imageType, + const unsigned int sectorSize) +{ + return open(TskUtilities::toUTF8(imageFile), imageType, sectorSize); +} + +int TskImageFileTsk::open(const std::vector<std::string> &imageFile, + const TSK_IMG_TYPE_ENUM imageType, + const unsigned int sectorSize) +{ + if (!m_images.empty()) { + close(); + } + for (size_t i = 0; i < imageFile.size(); i++) { + m_images.push_back(imageFile[i]); + } + return openImages(imageType, sectorSize); +} + +int TskImageFileTsk::open(const std::vector<std::wstring> &imageFile, + const TSK_IMG_TYPE_ENUM imageType, + const unsigned int sectorSize) +{ + if (!m_images.empty()) { + close(); + } + for (size_t i = 0; i < imageFile.size(); i++) { + m_images.push_back(TskUtilities::toUTF8(imageFile[i])); + } + return openImages(imageType, sectorSize); +} + + diff --git a/framework/Extraction/TskImageFileTsk.h b/framework/tsk/framework/extraction/TskImageFileTsk.h similarity index 51% rename from framework/Extraction/TskImageFileTsk.h rename to framework/tsk/framework/extraction/TskImageFileTsk.h index 0a0af911a..a4e73c331 100755 --- a/framework/Extraction/TskImageFileTsk.h +++ b/framework/tsk/framework/extraction/TskImageFileTsk.h @@ -17,9 +17,9 @@ #define _TSK_IMAGEFILETSK_H #include "TskImageFile.h" -#include "Services/TskImgDB.h" -#include "Services/Log.h" -#include "tsk3/libtsk.h" +#include "tsk/framework/services/TskImgDB.h" +#include "tsk/framework/services/Log.h" +#include "tsk/libtsk.h" #include <vector> #include <map> @@ -36,12 +36,11 @@ class TSK_FRAMEWORK_API TskImageFileTsk : public TskImageFile virtual ~TskImageFileTsk(); - virtual int open(const std::vector<std::wstring> &images); - virtual int open(const TSK_TCHAR *imageFile); virtual int open(); virtual void close(); - virtual std::vector<std::wstring> filenames() const { return m_images; } + virtual std::vector<std::string> getFileNames() const { return m_images; } + virtual std::vector<std::wstring> getFileNamesW() const; virtual int getSectorData(const uint64_t sect_start, const uint64_t sect_len, @@ -56,17 +55,42 @@ class TSK_FRAMEWORK_API TskImageFileTsk : public TskImageFile virtual int openFile(const uint64_t fileId); virtual int readFile(const int handle, - const uint64_t byte_offset, + const TSK_OFF_T byte_offset, const size_t byte_len, char * buffer); virtual int closeFile(const int handle); + virtual int open(const TSK_TCHAR *imageFile, + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0); + + virtual int open(const int numberOfImages, + const TSK_TCHAR * const imageFile[], + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0); + + virtual int open(const std::string &imageFile, + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0); + + virtual int open(const std::wstring &imageFile, + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0); + + virtual int open(const std::vector<std::string> &imageFile, + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0); + + virtual int open(const std::vector<std::wstring> &imageFile, + const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0); + private: TskImgDB &m_db; TSK_IMG_INFO *m_img_info; - std::vector<std::wstring> m_images; - const wchar_t **m_images_ptrs; + std::vector<std::string> m_images; + const char **m_images_ptrs; struct TSK_FRAMEWORK_API OPEN_FILE { @@ -77,7 +101,8 @@ class TSK_FRAMEWORK_API TskImageFileTsk : public TskImageFile std::vector<OPEN_FILE *> m_openFiles; // maps handle returned from openFile() to the open TSK_FS_FILE object std::map<uint64_t, TSK_FS_INFO *> m_openFs; // maps the byte offset of a file system to its open object. - int openImages(); + int openImages(const TSK_IMG_TYPE_ENUM imageType = TSK_IMG_TYPE_DETECT, + const unsigned int sectorSize = 0); static void closeFs(std::pair<uint64_t, TSK_FS_INFO *> pair); }; diff --git a/framework/tsk/framework/extraction/TskL01Extract.cpp b/framework/tsk/framework/extraction/TskL01Extract.cpp new file mode 100644 index 000000000..b7fe950c2 --- /dev/null +++ b/framework/tsk/framework/extraction/TskL01Extract.cpp @@ -0,0 +1,771 @@ +/* + * + * The Sleuth Kit + * + * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2013 Basis Technology Corporation. All Rights + * reserved. + * + * This software is distributed under the Common Public License 1.0 + */ + +/** + * \file + * + */ + +#include <iostream> +#include <istream> +#include <sstream> +#include <algorithm> + +#include "Poco/SharedPtr.h" +#include "Poco/Path.h" +#include "Poco/File.h" +#include "Poco/FileStream.h" +#include "Poco/MemoryStream.h" + +// Framework includes +#include "tsk/framework/framework_i.h" // to get TSK_FRAMEWORK_API +#include "TskL01Extract.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/utilities/TskUtilities.h" +#include "tsk/base/tsk_base_i.h" +#include "tsk/img/tsk_img_i.h" + +#ifndef HAVE_LIBEWF +#define HAVE_LIBEWF 1 +#endif + +namespace ewf +{ + #include "tsk/img/ewf.h" +} + +namespace +{ + static const unsigned int ExtractChunkSize = 65536; + + // This is needed in order to use Poco::SharedPtr on arrays + // and have them properly delete. + template <class C> + class ArrayReleasePolicy + { + public: + static void release(C* pObj) + /// Delete the object. + /// Note that pObj can be 0. + { + delete [] pObj; + } + }; + + // Copied from tsk3/img/ewf.c + void ewf_image_close(TSK_IMG_INFO * img_info) + { + int i; + ewf::IMG_EWF_INFO *ewf_info = (ewf::IMG_EWF_INFO *) img_info; + + ewf::libewf_handle_close(ewf_info->handle, NULL); + ewf::libewf_handle_free(&(ewf_info->handle), NULL); + + // this stuff crashes if we used glob. v2 of the API has a free method. + // not clear from the docs what we should do in v1... + // @@@ Probably a memory leak in v1 unless libewf_close deals with it + if (ewf_info->used_ewf_glob == 0) { + for (i = 0; i < ewf_info->num_imgs; i++) { + free(ewf_info->images[i]); + } + free(ewf_info->images); + } + + tsk_deinit_lock(&(ewf_info->read_lock)); + free(img_info); + } + + // Function to plug in as func ptr to TSK_IMG_INFO structure. + ssize_t null_read(TSK_IMG_INFO * img_info, TSK_OFF_T offset, char *buf, size_t len) + { + // Do nothing. + return 0; + } + + // Function to plug in as func ptr to TSK_IMG_INFO structure. + void null_imgstat(TSK_IMG_INFO * img_info, FILE * hFile) + { + // Do nothing. + } + +} + +TskL01Extract::TskL01Extract(const std::wstring &archivePath) : + m_archivePath(archivePath), + m_db(TskServices::Instance().getImgDB()), + m_imgInfo(NULL) +{ +} + +TskL01Extract::~TskL01Extract() +{ + close(); +} + + +void TskL01Extract::close() +{ + if (m_imgInfo) + { + tsk_img_close(m_imgInfo); + m_imgInfo = NULL; + } + + m_archivePath.clear(); +} + +/* + * If containerFile is NULL, then we don't use that as a source for paths and we set the parent ID to 0. + */ +int TskL01Extract::extractFiles(TskFile * containerFile /*= NULL*/) +{ + static const std::string MSG_PREFIX = "TskL01Extract::extractFiles : "; + + try + { + m_containerFile = containerFile; + + if (m_archivePath.empty()) + { + throw TskException(MSG_PREFIX + "No path to archive provided."); + } + + std::string L01Path = TskUtilities::toUTF8(m_archivePath); + if (m_containerFile != NULL) + { + L01Path = m_containerFile->getPath(); + } + + //m_db.addImageInfo((int)m_img_info->itype, m_img_info->sector_size); + m_db.addImageName(L01Path.c_str()); + + if (openContainer() != 0) + { + return -1; + } + + if (m_imgInfo == NULL) + { + throw TskException(MSG_PREFIX +"Images not open yet"); + } + + // Create a map of directory names to file ids to use to + // associate files/directories with the correct parent. + std::map<std::string, uint64_t> directoryMap; + + std::vector<ArchivedFile>::iterator it = m_archivedFiles.begin(); + for (; it != m_archivedFiles.end(); ++it) + { + Poco::Path path(it->path); + Poco::Path parent = it->path.parent(); + std::string name; + + if (path.isDirectory()) + { + name = path[path.depth() - 1]; + } + else + { + name = path[path.depth()]; + } + + // Determine the parent id of the file. + uint64_t parentId = 0; + if (path.depth() == 0 || path.isDirectory() && path.depth() == 1) + { + // This file or directory lives at the root so our parent id + // is the containing file id (if a containing file was provided). + if (m_containerFile != NULL) + { + parentId = m_containerFile->getId(); + } + } + else + { + // We are not at the root so we need to lookup the id of our + // parent directory. + std::map<std::string, uint64_t>::const_iterator pos; + pos = directoryMap.find(parent.toString()); + + if (pos == directoryMap.end()) + { + //error! + std::stringstream msg; + msg << "extractFiles: parent ID not mapped for " << it->path.toString(); + LOGERROR(msg.str()); + } + else + { + parentId = pos->second; + } + } + + // Store some extra details about the derived (i.e, extracted) file. + std::stringstream details; ///@todo anything here? + + std::string fullpath = ""; + if (m_containerFile != NULL) + { + fullpath.append(m_containerFile->getFullPath()); + } + fullpath.append("\\"); + fullpath.append(path.toString()); + + uint64_t fileId; + if (m_db.addDerivedFileInfo(name, + parentId, + path.isDirectory(), + it->size, + details.str(), + static_cast<int>(it->ctime), + static_cast<int>(it->crtime), + static_cast<int>(it->atime), + static_cast<int>(it->mtime), + fileId, fullpath) == -1) + { + std::wstringstream msg; + msg << L"addDerivedFileInfo failed for name=" + << name.c_str(); + LOGERROR(msg.str()); + } + + if (path.isDirectory()) + { + directoryMap[path.toString()] = fileId; + } + else + { + // For file nodes, recreate file locally + // Will save zero-length files + if (saveFile(fileId, *it) == 0) + { + // Schedule + m_db.updateFileStatus(fileId, TskImgDB::IMGDB_FILES_STATUS_READY_FOR_ANALYSIS); + TskServices::Instance().getScheduler().schedule(Scheduler::FileAnalysis, fileId, fileId); + } + } + } + + } + catch (TskException &ex) + { + std::ostringstream msg; + msg << MSG_PREFIX << "TskException: " << ex.message(); + LOGERROR(msg.str()); + return -1; + } + catch (std::exception &ex) + { + std::ostringstream msg; + msg << MSG_PREFIX << "std::exception: " << ex.what(); + LOGERROR(msg.str()); + return -1; + } + catch (...) + { + LOGERROR(MSG_PREFIX + "unrecognized exception"); + return -1; + } + + return 0; //success +} + + +int TskL01Extract::openContainer() +{ + static const std::string MSG_PREFIX = "TskL01Extract::openContainer : "; + ewf::libewf_error_t *ewfError = NULL; + try + { + if (m_archivePath.empty()) + { + throw TskException("Error: archive path is empty."); + } + + //m_imgInfo = tsk_img_open_sing(m_archivePath.c_str(), TSK_IMG_TYPE_EWF_EWF, 512); + m_imgInfo = openEwfSimple(); + if (m_imgInfo == NULL) + { + std::stringstream logMessage; + logMessage << "Error with tsk_img_open_sing: " << tsk_error_get() << std::endl; + throw TskException(logMessage.str()); + } + + /// TSK stores different struct objs to the same pointer + ewf::IMG_EWF_INFO *ewfInfo = (ewf::IMG_EWF_INFO*)m_imgInfo; + m_imgInfo = &(ewfInfo->img_info); + + ewf::libewf_file_entry_t *root = NULL; + int ret = ewf::libewf_handle_get_root_file_entry(ewfInfo->handle, &root, &ewfError); + if (ret == -1) + { + std::stringstream logMessage; + logMessage << "Error with libewf_handle_get_root_file_entry: "; + throw TskException(logMessage.str()); + } + + if (ret > 0) + { + uint8_t nameString[512]; + nameString[0] = '\0'; + ewfError = NULL; + if (ewf::libewf_file_entry_get_utf8_name(root, nameString, 512, &ewfError) == -1) + { + std::stringstream logMessage; + logMessage << "Error with libewf_file_entry_get_utf8_name: "; + throw TskException(logMessage.str()); + } + + traverse(root); + } + } + catch (TskException &ex) + { + std::ostringstream msg; + msg << MSG_PREFIX << "TskException: " << ex.message(); + if (ewfError) + { + char errorString[512]; + errorString[0] = '\0'; + ewf::libewf_error_backtrace_sprint(ewfError, errorString, 512); + msg << "libewf error: " << errorString << std::endl; + } + LOGERROR(msg.str()); + return -1; + } + catch (std::exception &ex) + { + std::ostringstream msg; + msg << MSG_PREFIX << "std::exception: " << ex.what(); + LOGERROR(msg.str()); + return -1; + } + catch (...) + { + LOGERROR(MSG_PREFIX + "unrecognized exception"); + return -1; + } + + return 0; //success +} + + +/** + Originally we used tsk_img_open_sing(), but that leads to calling ewf_open(), + which in turn will fail if the L01 file has an incorrect filename extension. + This function is a simpler version of ewf_open() which will not fail if the + filename extension is wrong. +*/ +TSK_IMG_INFO * TskL01Extract::openEwfSimple() +{ + const int a_num_img = 1; + unsigned int a_ssize = 512; + int result = 0; + TSK_IMG_INFO *img_info = NULL; + ewf::libewf_error_t *ewfError = NULL; + ewf::IMG_EWF_INFO *ewf_info = NULL; + + try + { + // Make an absolute path (if it's relative) so that libewf doesn't cause + // an error when it tries to make it absolute. + Poco::Path tempPath(TskUtilities::toUTF8(m_archivePath)); + tempPath.makeAbsolute(); + // We convert to unicode here because that is what the TSK_IMG_INFO structure requires. + std::wstring ewfArchivePath = TskUtilities::toUTF16(tempPath.toString()); + + if ((ewf_info = (ewf::IMG_EWF_INFO *) tsk_img_malloc(sizeof(ewf::IMG_EWF_INFO))) == NULL) + { + throw TskException("tsk_img_malloc"); + } + img_info = (TSK_IMG_INFO *) ewf_info; + + if (ewf::libewf_handle_initialize(&(ewf_info->handle), &ewfError) != 1) + { + throw TskException("libewf_handle_initialize"); + } + + //int i; + ewf_info->num_imgs = a_num_img; + if ((ewf_info->images = (TSK_TCHAR **) tsk_malloc(a_num_img * sizeof(TSK_TCHAR *))) == NULL) + { + throw TskException("tsk_malloc"); + } + + if ((ewf_info->images[0] = + (TSK_TCHAR *) tsk_malloc((TSTRLEN(ewfArchivePath.c_str()) + 1) * sizeof(TSK_TCHAR))) == NULL) + { + throw TskException("tsk_malloc 2"); + } + TSTRNCPY(ewf_info->images[0], ewfArchivePath.c_str(), TSTRLEN(ewfArchivePath.c_str()) + 1); + + ///NOTE: libewf_handle_open_wide() will not open the file if the filename length is < 4 chars long. + ewfError = NULL; + #if defined( TSK_WIN32 ) + if (ewf::libewf_handle_open_wide(ewf_info->handle, (TSK_TCHAR * const *) ewf_info->images, + ewf_info->num_imgs, ewf::LIBEWF_ACCESS_FLAG_READ, &ewfError) != 1) + #else + if (ewf::libewf_handle_open(ewf_info->handle, + (char *const *) ewf_info->images, + ewf_info->num_imgs, ewf::LIBEWF_OPEN_READ, &ewfError) != 1) + #endif + { + throw TskException("libewf_handle_open_wide"); + } + + ewfError = NULL; + if (ewf::libewf_handle_get_media_size(ewf_info->handle, + (ewf::size64_t *) & (img_info->size), &ewfError) != 1) + { + throw TskException("libewf_handle_get_media_size"); + } + + ewfError = NULL; + result = ewf::libewf_handle_get_utf8_hash_value_md5(ewf_info->handle, + (uint8_t *) ewf_info->md5hash, 33, &ewfError); + + if (result == -1) + { + throw TskException("libewf_handle_get_utf8_hash_value_md5"); + } + ewf_info->md5hash_isset = result; + + if (a_ssize != 0) + { + img_info->sector_size = a_ssize; + } + else + { + img_info->sector_size = 512; + } + + img_info->itype = TSK_IMG_TYPE_EWF_EWF; + img_info->close = ewf_image_close; + img_info->read = null_read; + img_info->imgstat = null_imgstat; + + // initialize the read lock + tsk_init_lock(&(ewf_info->read_lock)); + + return img_info; + } + catch (TskException &ex) + { + std::ostringstream msg; + msg << "openEwfSimple: TskException: " << ex.message(); + if (ewfError) + { + char errorString[512]; + errorString[0] = '\0'; + ewf::libewf_error_backtrace_sprint(ewfError, errorString, 512); + msg << " - libewf error: " << errorString << std::endl; + } + LOGERROR(msg.str()); + free(ewf_info); + return NULL; + } +} + + +/* + Traverse the hierarchy inside the container + */ +void TskL01Extract::traverse(ewf::libewf_file_entry_t *parent) +{ + static Poco::Path currPath; + + TskL01Extract::ArchivedFile fileInfo; + fileInfo.entry = parent; + fileInfo.type = getFileType(parent); + fileInfo.size = getFileSize(parent); + fileInfo.ctime = getEntryChangeTime(parent); + fileInfo.crtime = getCreationTime(parent); + fileInfo.atime = getAccessTime(parent); + fileInfo.mtime = getModifiedTime(parent); + std::string name = getName(parent); + + bool saveDirectory = false; + if ((fileInfo.type == 'd') && !name.empty()) + { + saveDirectory = true; + } + + if (saveDirectory) + { + currPath.pushDirectory(name); + fileInfo.path = currPath; + m_archivedFiles.push_back(fileInfo); + } + else if (fileInfo.type == 'f') + { + Poco::Path tempPath = currPath; + tempPath.setFileName(name); + fileInfo.path = tempPath; + m_archivedFiles.push_back(fileInfo); + } + + int num = 0; + ewf::libewf_error_t *ewfError = NULL; + ewf::libewf_file_entry_get_number_of_sub_file_entries(parent, &num, &ewfError); + + if (num > 0) + { + //recurse + for (int i=0; i < num; ++i) + { + ewf::libewf_file_entry_t *child = NULL; + ewfError = NULL; + if (ewf::libewf_file_entry_get_sub_file_entry(parent, i, &child, &ewfError) == -1) + { + throw TskException("TskL01Extract::traverse - Error with libewf_file_entry_get_sub_file_entry: "); + } + + traverse(child); + } + } + + if (saveDirectory) + { + currPath.popDirectory(); + } +} + + +const std::string TskL01Extract::getName(ewf::libewf_file_entry_t *node) +{ + ///@todo use libewf_file_entry_get_utf8_name_size + + uint8_t nameString[512]; + nameString[0] = '\0'; + ewf::libewf_error_t *ewfError = NULL; + if (ewf::libewf_file_entry_get_utf8_name(node, nameString, 512, &ewfError) == -1) + { + std::stringstream logMessage; + char errorString[512]; + errorString[0] = '\0'; + ewf::libewf_error_backtrace_sprint(ewfError, errorString, 512); + logMessage << "TskL01Extract::getName - Error with libewf_file_entry_get_utf8_name: " << errorString << std::endl; + throw TskException(logMessage.str()); + } + + std::string s; + s.assign((char*)&nameString[0]); + return s; +} + + +const uint8_t TskL01Extract::getFileType(ewf::libewf_file_entry_t *node) +{ + uint8_t type = 0; + ewf::libewf_error_t *ewfError = NULL; + if (ewf::libewf_file_entry_get_type(node, &type, &ewfError) == -1) + { + throw TskException("TskL01Extract::getFileType - Error with libewf_file_entry_get_utf8_name: "); + } + + uint32_t flags = 0; + ewfError = NULL; + if (ewf::libewf_file_entry_get_flags(node, &flags, &ewfError) == -1) + { + throw TskException("TskL01Extract::getFileType - Error with libewf_file_entry_get_flags: "); + } + + return type; +} + + +const uint64_t TskL01Extract::getFileSize(ewf::libewf_file_entry_t *node) +{ + ewf::size64_t fileSize = 0; + ewf::libewf_error_t *ewfError = NULL; + if (ewf::libewf_file_entry_get_size(node, &fileSize, &ewfError) == -1) + { + std::stringstream logMessage; + char errorString[512]; + errorString[0] = '\0'; + ewf::libewf_error_backtrace_sprint(ewfError, errorString, 512); + logMessage << "TskL01Extract::getFileSize - Error with libewf_file_entry_get_utf8_name: " << errorString << std::endl; + throw TskException(logMessage.str()); + } + + return fileSize; +} + + +const uint32_t TskL01Extract::getEntryChangeTime(ewf::libewf_file_entry_t *node) +{ + uint32_t timeValue = 0; + ewf::libewf_error_t *ewfError = NULL; + if (ewf::libewf_file_entry_get_entry_modification_time(node, &timeValue, &ewfError) == -1) + { + std::stringstream logMessage; + char errorString[512]; + errorString[0] = '\0'; + ewf::libewf_error_backtrace_sprint(ewfError, errorString, 512); + logMessage << "TskL01Extract::getEntryChangeTime - Error: " << errorString << std::endl; + LOGERROR(logMessage.str()); + return 0; + } + + return timeValue; +} + +const uint32_t TskL01Extract::getCreationTime(ewf::libewf_file_entry_t *node) +{ + uint32_t timeValue = 0; + ewf::libewf_error_t *ewfError = NULL; + if (ewf::libewf_file_entry_get_creation_time(node, &timeValue, &ewfError) == -1) + { + std::stringstream logMessage; + char errorString[512]; + errorString[0] = '\0'; + ewf::libewf_error_backtrace_sprint(ewfError, errorString, 512); + logMessage << "TskL01Extract::getCreationTime - Error: " << errorString << std::endl; + LOGERROR(logMessage.str()); + return 0; + } + + return timeValue; +} + + +const uint32_t TskL01Extract::getAccessTime(ewf::libewf_file_entry_t *node) +{ + uint32_t timeValue = 0; + ewf::libewf_error_t *ewfError = NULL; + if (ewf::libewf_file_entry_get_access_time(node, &timeValue, &ewfError) == -1) + { + std::stringstream logMessage; + char errorString[512]; + errorString[0] = '\0'; + ewf::libewf_error_backtrace_sprint(ewfError, errorString, 512); + logMessage << "TskL01Extract::getAccessTime - Error: " << errorString << std::endl; + LOGERROR(logMessage.str()); + return 0; + } + + return timeValue; +} + + +const uint32_t TskL01Extract::getModifiedTime(ewf::libewf_file_entry_t *node) +{ + uint32_t timeValue = 0; + ewf::libewf_error_t *ewfError = NULL; + if (ewf::libewf_file_entry_get_modification_time(node, &timeValue, &ewfError) == -1) + { + std::stringstream logMessage; + char errorString[512]; + errorString[0] = '\0'; + ewf::libewf_error_backtrace_sprint(ewfError, errorString, 512); + logMessage << "TskL01Extract::getModifiedTime - Error: " << errorString << std::endl; + LOGERROR(logMessage.str()); + return 0; + } + + return timeValue; +} + +/// Deprecated +char * TskL01Extract::getFileData(ewf::libewf_file_entry_t *node, const size_t dataSize) +{ + if (dataSize > 0) + { + //Poco::SharedPtr<unsigned char, Poco::ReferenceCounter, ArrayReleasePolicy> buffer(new unsigned char[dataSize]); + char *buffer = new char[dataSize]; + ewf::libewf_error_t *ewfError = NULL; + ssize_t bytesRead = ewf::libewf_file_entry_read_buffer(node, buffer, dataSize, &ewfError); + if (bytesRead == -1) + { + std::stringstream logMessage; + char errorString[512]; + errorString[0] = '\0'; + ewf::libewf_error_backtrace_sprint(ewfError, errorString, 512); + logMessage << "TskL01Extract::getFileData - Error : " << errorString << std::endl; + LOGERROR(logMessage.str()); + return NULL; + } + + return buffer; + } + return NULL; +} + + + +/* Create an uncompressed version of the file on the local file system. + * Note this will save zero-length files. + */ +int TskL01Extract::saveFile(const uint64_t fileId, const ArchivedFile &archivedFile) +{ + try + { + // If a file with this id already exists we raise an error + TskFile * pFile = TskServices::Instance().getFileManager().getFile(fileId); + if (pFile != NULL && pFile->exists()) + { + std::stringstream msg; + msg << "File id " << fileId << " already exists."; + throw TskFileException(msg.str()); + } + + // Create a blank file + Poco::Path destPath(TskUtilities::toUTF8(TskServices::Instance().getFileManager().getPath(fileId))); + Poco::File destFile(destPath); + destFile.createFile(); + + // Get data from archive + if (archivedFile.size > 0) + { + Poco::FileOutputStream fos(destFile.path(), std::ios::binary); + + uint64_t chunkSize = ExtractChunkSize; + if (archivedFile.size < ExtractChunkSize) + { + chunkSize = archivedFile.size; + } + + Poco::SharedPtr<char, Poco::ReferenceCounter, ArrayReleasePolicy<char> > dataBuf(new char[chunkSize]); + + uint64_t accum = 0; + ewf::libewf_error_t *ewfError = NULL; + + // Read and save data in chunks so that we only put <= ExtractChunkSize bytes on the heap at a time + while (accum < archivedFile.size) + { + ssize_t bytesRead = ewf::libewf_file_entry_read_buffer(archivedFile.entry, dataBuf, chunkSize, &ewfError); + if (bytesRead == -1) + { + std::stringstream logMessage; + char errorString[512]; + errorString[0] = '\0'; + ewf::libewf_error_backtrace_sprint(ewfError, errorString, 512); + logMessage << "TskL01Extract::saveFile - Error : " << errorString << std::endl; + LOGERROR(logMessage.str()); + return -1; + } + + fos.write(dataBuf, bytesRead); + accum += bytesRead; + } + fos.close(); + } + return 0; + } + catch (Poco::Exception& ex) + { + std::wstringstream msg; + msg << L"TskL01Extract::saveFile - Error saving file from stream : " << ex.displayText().c_str(); + LOGERROR(msg.str()); + return -2; + } +} + diff --git a/framework/tsk/framework/extraction/TskL01Extract.h b/framework/tsk/framework/extraction/TskL01Extract.h new file mode 100644 index 000000000..1cbdb323b --- /dev/null +++ b/framework/tsk/framework/extraction/TskL01Extract.h @@ -0,0 +1,87 @@ +/* + * The Sleuth Kit + * + * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2013 Basis Technology Corporation. All Rights + * reserved. + * + * This software is distributed under the Common Public License 1.0 + */ + +/** + * \file + * + */ +#ifndef _TSK_L01EXTRACT_H +#define _TSK_L01EXTRACT_H + +#include <vector> +#include <map> + +#include "Poco/Path.h" + +#include "TskExtract.h" +#include "tsk/framework/services/TskImgDB.h" +#include "tsk/framework/services/Log.h" +#include "tsk/libtsk.h" + + +namespace ewf +{ +#include <libewf.h> +} + + +/** + * + * + */ +class TskL01Extract : public TskArchiveExtraction::TskExtract +{ +public: + explicit TskL01Extract(const std::wstring &archivePath); + virtual ~TskL01Extract(); + + // Interface + virtual int extractFiles(TskFile * containerFile = NULL); + +private: + struct ArchivedFile + { + ewf::libewf_file_entry_t *entry; + Poco::Path path; + uint64_t size; + uint8_t type; + uint32_t ctime; // Time file system file entry was changed. + uint32_t crtime; // Time the file was created. + uint32_t atime; // Last access time. + uint32_t mtime; // Last modified time. + }; + + TskL01Extract(); + // No copying + TskL01Extract(const TskL01Extract&); + TskL01Extract& operator=(const TskL01Extract&); + + void close(); + int openContainer(); + TSK_IMG_INFO * openEwfSimple(); + void traverse(ewf::libewf_file_entry_t *parent); + const std::string getName(ewf::libewf_file_entry_t *node); + const uint8_t getFileType(ewf::libewf_file_entry_t *node); + const uint64_t getFileSize(ewf::libewf_file_entry_t *node); + char * getFileData(ewf::libewf_file_entry_t *node, const size_t dataSize); + const uint32_t getEntryChangeTime(ewf::libewf_file_entry_t *node); + const uint32_t getCreationTime(ewf::libewf_file_entry_t *node); + const uint32_t getAccessTime(ewf::libewf_file_entry_t *node); + const uint32_t getModifiedTime(ewf::libewf_file_entry_t *node); + int saveFile(const uint64_t fileId, const ArchivedFile &archivedFile); + + std::wstring m_archivePath; + TskFile *m_containerFile; + TskImgDB &m_db; + TSK_IMG_INFO *m_imgInfo; + std::vector<ArchivedFile> m_archivedFiles; +}; + +#endif diff --git a/framework/tsk/framework/file/Makefile.am b/framework/tsk/framework/file/Makefile.am new file mode 100644 index 000000000..59970a1dc --- /dev/null +++ b/framework/tsk/framework/file/Makefile.am @@ -0,0 +1,11 @@ +AM_CXXFLAGS = -I.. -I../.. -I../../../.. -Wall + +noinst_LTLIBRARIES = libfwfile.la +libfwfile_la_SOURCES = \ + TskFile.cpp \ + TskFile.h \ + TskFileManager.h \ + TskFileManagerImpl.cpp \ + TskFileManagerImpl.h \ + TskFileTsk.cpp \ + TskFileTsk.h diff --git a/framework/File/TskFile.cpp b/framework/tsk/framework/file/TskFile.cpp similarity index 77% rename from framework/File/TskFile.cpp rename to framework/tsk/framework/file/TskFile.cpp index ffa9c3010..411d7bb3d 100755 --- a/framework/File/TskFile.cpp +++ b/framework/tsk/framework/file/TskFile.cpp @@ -18,7 +18,7 @@ // Framework includes #include "TskFile.h" -#include "Services/TskServices.h" +#include "tsk/framework/services/TskServices.h" /** * Delete the TskFile object. @@ -295,7 +295,8 @@ void TskFile::setStatus(TskImgDB::FILE_STATUS status) * @returns the new artifact * @throws error if the artifact type does not exist */ -TskBlackboardArtifact TskFile::createArtifact(int artifactTypeID){ +TskBlackboardArtifact TskFile::createArtifact(int artifactTypeID) +{ return TskServices::Instance().getBlackboard().createArtifact(m_id, artifactTypeID); } @@ -305,7 +306,8 @@ TskBlackboardArtifact TskFile::createArtifact(int artifactTypeID){ * @returns the new artifact * @throws error if the artifact type does not exist */ -TskBlackboardArtifact TskFile::createArtifact(TSK_ARTIFACT_TYPE type){ +TskBlackboardArtifact TskFile::createArtifact(TSK_ARTIFACT_TYPE type) +{ return TskServices::Instance().getBlackboard().createArtifact(m_id, type); } @@ -315,7 +317,8 @@ TskBlackboardArtifact TskFile::createArtifact(TSK_ARTIFACT_TYPE type){ * @returns the new artifact * @throws error if the artifact type does not exist */ -TskBlackboardArtifact TskFile::createArtifact(string artifactTypeName){ +TskBlackboardArtifact TskFile::createArtifact(string artifactTypeName) +{ return TskServices::Instance().getBlackboard().createArtifact(m_id, artifactTypeName); } @@ -324,7 +327,8 @@ TskBlackboardArtifact TskFile::createArtifact(string artifactTypeName){ * @param artifactTypeName type name * @returns all matching artifacts will return an empty vector if there are no matches */ -vector<TskBlackboardArtifact> TskFile::getArtifacts(string artifactTypeName){ +vector<TskBlackboardArtifact> TskFile::getArtifacts(string artifactTypeName) +{ return TskServices::Instance().getBlackboard().getArtifacts(m_id, artifactTypeName); } @@ -333,7 +337,8 @@ vector<TskBlackboardArtifact> TskFile::getArtifacts(string artifactTypeName){ * @param artifactTypeID type id * @returns all matching artifacts will return an empty vector if there are no matches */ -vector<TskBlackboardArtifact> TskFile::getArtifacts(int artifactTypeID){ +vector<TskBlackboardArtifact> TskFile::getArtifacts(int artifactTypeID) +{ return TskServices::Instance().getBlackboard().getArtifacts(m_id, artifactTypeID); } @@ -342,7 +347,8 @@ vector<TskBlackboardArtifact> TskFile::getArtifacts(int artifactTypeID){ * @param type artifact type * @returns all matching artifacts will return an empty vector if there are no matches */ -vector<TskBlackboardArtifact> TskFile::getArtifacts(TSK_ARTIFACT_TYPE type){ +vector<TskBlackboardArtifact> TskFile::getArtifacts(TSK_ARTIFACT_TYPE type) +{ return TskServices::Instance().getBlackboard().getArtifacts(m_id, type); } @@ -350,62 +356,19 @@ vector<TskBlackboardArtifact> TskFile::getArtifacts(TSK_ARTIFACT_TYPE type){ * Get all artifacts associated with this file * @returns all artifacts */ -vector<TskBlackboardArtifact> TskFile::getAllArtifacts(){ +vector<TskBlackboardArtifact> TskFile::getAllArtifacts() +{ stringstream str; str << "WHERE obj_id = " << m_id; return TskServices::Instance().getBlackboard().getMatchingArtifacts(str.str()); } -/** - * Get all artifacts associated with this file with the given type name - * @param attributeTypeName type name - * @returns all matching attributes will return an empty vector if there are no matches - */ -vector<TskBlackboardAttribute> TskFile::getAttributes(string attributeTypeName){ - stringstream str; - str << "WHERE obj_id = " << m_id << " AND attribute_type_id = " << TskServices::Instance().getBlackboard().attrTypeNameToTypeID(attributeTypeName); - return TskServices::Instance().getBlackboard().getMatchingAttributes(str.str()); -} - -/** - * Get all artifacts associated with this file with the given type id - * @param attributeTypeID type id - * @returns all matching attributes will return an empty vector if there are no matches - */ -vector<TskBlackboardAttribute> TskFile::getAttributes(int attributeTypeID){ - stringstream str; - str << "WHERE obj_id = " << m_id << " AND attribute_type_id = " << attributeTypeID; - return TskServices::Instance().getBlackboard().getMatchingAttributes(str.str()); -} - -/** - * Get all artifacts associated with this file with the given type - * @param type artifact type - * @returns all matching attributes will return an empty vector if there are no matches - */ -vector<TskBlackboardAttribute> TskFile::getAttributes(TSK_ATTRIBUTE_TYPE type){ - stringstream str; - str << "WHERE obj_id = " << m_id << " AND attribute_type_id = " << type; - return TskServices::Instance().getBlackboard().getMatchingAttributes(str.str()); -} - -/** - * Get all artifacts associated with this file - * @returns all artifacts - */ -vector<TskBlackboardAttribute> TskFile::getAllAttributes(){ - stringstream str; - str << "WHERE obj_id = " << m_id; - return TskServices::Instance().getBlackboard().getMatchingAttributes(str.str()); -} - /** * Get the general info artifact for this file * @returns the general info artifact or creates it if it has not already been made */ -TskBlackboardArtifact TskFile::getGenInfo(){ - TskBlackboard& blackboard = TskServices::Instance().getBlackboard(); - +TskBlackboardArtifact TskFile::getGenInfo() +{ vector<TskBlackboardArtifact> artifacts; artifacts = getArtifacts(TSK_GEN_INFO); @@ -419,6 +382,7 @@ TskBlackboardArtifact TskFile::getGenInfo(){ * Add an attribute to the general info artifact for this file * @param attr attribute to be added */ -void TskFile::addGenInfoAttribute(TskBlackboardAttribute attr){ +void TskFile::addGenInfoAttribute(TskBlackboardAttribute attr) +{ getGenInfo().addAttribute(attr); } diff --git a/framework/File/TskFile.h b/framework/tsk/framework/file/TskFile.h similarity index 91% rename from framework/File/TskFile.h rename to framework/tsk/framework/file/TskFile.h index ae0732829..ed32f00a5 100755 --- a/framework/File/TskFile.h +++ b/framework/tsk/framework/file/TskFile.h @@ -21,8 +21,8 @@ #include <ios> // Framework includes -#include "Services/TskImgDB.h" -#include "Services/TskBlackboardArtifact.h" +#include "tsk/framework/services/TskImgDB.h" +#include "tsk/framework/services/TskBlackboardArtifact.h" /** * An interface that is used to represent a file. This interface @@ -238,10 +238,6 @@ class TSK_FRAMEWORK_API TskFile virtual vector<TskBlackboardArtifact> getArtifacts(int artifactTypeID); virtual vector<TskBlackboardArtifact> getArtifacts(TSK_ARTIFACT_TYPE type); virtual vector<TskBlackboardArtifact> getAllArtifacts(); - virtual vector<TskBlackboardAttribute> getAttributes(string attributeTypeName); - virtual vector<TskBlackboardAttribute> getAttributes(int attributeTypeID); - virtual vector<TskBlackboardAttribute> getAttributes(TSK_ATTRIBUTE_TYPE type); - virtual vector<TskBlackboardAttribute> getAllAttributes(); virtual TskBlackboardArtifact getGenInfo(); virtual void addGenInfoAttribute(TskBlackboardAttribute attr); diff --git a/framework/File/TskFileManager.h b/framework/tsk/framework/file/TskFileManager.h similarity index 92% rename from framework/File/TskFileManager.h rename to framework/tsk/framework/file/TskFileManager.h index f0cfe7f24..1d164702b 100755 --- a/framework/File/TskFileManager.h +++ b/framework/tsk/framework/file/TskFileManager.h @@ -16,7 +16,8 @@ #ifndef _TSK_FILEMANAGER_H #define _TSK_FILEMANAGER_H -#include "framework_i.h" +#include <memory> +#include "tsk/framework/framework_i.h" #include "TskFile.h" /** @@ -79,7 +80,7 @@ class TSK_FRAMEWORK_API TskFileManager */ virtual void copyFile(const uint64_t fileId, const std::wstring& filePath) { - copyFile(getFile(fileId), filePath); + copyFile(std::auto_ptr<TskFile>(getFile(fileId)).get(), filePath); } /** @@ -106,7 +107,7 @@ class TSK_FRAMEWORK_API TskFileManager */ virtual void copyDirectory(uint64_t directoryIdToCopy, const std::wstring& destinationPath, const bool bRecurse = false) { - copyDirectory(getFile(directoryIdToCopy), destinationPath, bRecurse); + copyDirectory(std::auto_ptr<TskFile>(getFile(directoryIdToCopy)).get(), destinationPath, bRecurse); } /** @@ -144,7 +145,7 @@ class TSK_FRAMEWORK_API TskFileManager */ virtual void deleteFile(const uint64_t fileId) { - deleteFile(getFile(fileId)); + deleteFile(std::auto_ptr<TskFile>(getFile(fileId)).get()); } protected: diff --git a/framework/File/TskFileManagerImpl.cpp b/framework/tsk/framework/file/TskFileManagerImpl.cpp similarity index 92% rename from framework/File/TskFileManagerImpl.cpp rename to framework/tsk/framework/file/TskFileManagerImpl.cpp index bf794681b..daf7ec485 100755 --- a/framework/File/TskFileManagerImpl.cpp +++ b/framework/tsk/framework/file/TskFileManagerImpl.cpp @@ -14,14 +14,15 @@ */ #include <sstream> +#include <cstring> // Framework includes #include "TskFileManagerImpl.h" #include "TskFileTsk.h" -#include "Services/TskSystemProperties.h" -#include "Services/TskServices.h" -#include "Utilities/TskException.h" -#include "Utilities/TskUtilities.h" +#include "tsk/framework/services/TskSystemProperties.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/utilities/TskException.h" +#include "tsk/framework/utilities/TskUtilities.h" // Poco includes #include "Poco/Exception.h" @@ -247,7 +248,9 @@ void TskFileManagerImpl::copyDirectory(TskFile* directoryToCopy, const std::wstr if (pFile == NULL) { - throw TskException("Failed to create file object for file id " + Poco::NumberFormatter::format(*it)); + std::stringstream msg; + msg << "Failed to create file object for file id " << *it; + throw TskException(msg.str()); } if (pFile->isDirectory() && bRecurse) @@ -263,6 +266,7 @@ void TskFileManagerImpl::copyDirectory(TskFile* directoryToCopy, const std::wstr filePath.append(pFile->getName()); copyFile(pFile, TskUtilities::toUTF16(filePath.toString())); } + delete pFile; } } } @@ -305,10 +309,12 @@ void TskFileManagerImpl::addFile(const uint64_t fileId, std::istream& istr) if (pFile != NULL && pFile->exists()) { + delete pFile; std::stringstream msg; msg << "File id " << fileId << " already exists."; throw TskFileException(msg.str()); } + delete pFile; try { diff --git a/framework/File/TskFileManagerImpl.h b/framework/tsk/framework/file/TskFileManagerImpl.h similarity index 100% rename from framework/File/TskFileManagerImpl.h rename to framework/tsk/framework/file/TskFileManagerImpl.h diff --git a/framework/File/TskFileTsk.cpp b/framework/tsk/framework/file/TskFileTsk.cpp similarity index 94% rename from framework/File/TskFileTsk.cpp rename to framework/tsk/framework/file/TskFileTsk.cpp index 54c549eda..df0f0fff3 100755 --- a/framework/File/TskFileTsk.cpp +++ b/framework/tsk/framework/file/TskFileTsk.cpp @@ -18,9 +18,9 @@ // Framework includes #include "TskFileTsk.h" -#include "Services/TskServices.h" -#include "Utilities/TskException.h" -#include "Utilities/TskUtilities.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/utilities/TskException.h" +#include "tsk/framework/utilities/TskUtilities.h" #include "TskFileManagerImpl.h" /** @@ -203,7 +203,7 @@ ssize_t TskFileTsk::read(char *buf, const size_t count) int bytesRead = 0; uint64_t bytesToRead = 0; uint64_t fileSize = m_unusedSectorsRecord.sectLen * 512; - if (m_offset + count > fileSize) { + if ((uint64_t)m_offset + count > fileSize) { if (fileSize - m_offset > 0) bytesToRead = fileSize - m_offset; else @@ -305,4 +305,4 @@ TSK_OFF_T TskFileTsk::seek(const TSK_OFF_T off, std::ios::seekdir origin) } return m_offset; } -} \ No newline at end of file +} diff --git a/framework/File/TskFileTsk.h b/framework/tsk/framework/file/TskFileTsk.h similarity index 92% rename from framework/File/TskFileTsk.h rename to framework/tsk/framework/file/TskFileTsk.h index 62074ab8b..ac50bd571 100755 --- a/framework/File/TskFileTsk.h +++ b/framework/tsk/framework/file/TskFileTsk.h @@ -21,8 +21,8 @@ // Framework includes #include "TskFile.h" -#include "Services/TskImgDB.h" -#include "tsk3/base/tsk_os.h" +#include "tsk/framework/services/TskImgDB.h" +#include "tsk/base/tsk_os.h" // Poco includes #include "Poco/File.h" diff --git a/framework/tsk/framework/framework.h b/framework/tsk/framework/framework.h new file mode 100755 index 000000000..df15c3c32 --- /dev/null +++ b/framework/tsk/framework/framework.h @@ -0,0 +1,47 @@ +/* + * + * The Sleuth Kit + * + * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2010-2012 Basis Technology Corporation. All Rights + * reserved. + * + * This software is distributed under the Common Public License 1.0 + */ + +#ifndef _TSK_OSSLIBTSK_H +#define _TSK_OSSLIBTSK_H + +/** + * Include this file when incorporating the framework into an + * application. + */ + +#include "tsk/framework/framework_i.h" + +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/services/Log.h" +#include "tsk/framework/services/TskImgDB.h" +#include "tsk/framework/services/Scheduler.h" +#include "tsk/framework/services/TskSystemProperties.h" +#include "tsk/framework/services/TskBlackboard.h" +#include "tsk/framework/services/TskDBBlackboard.h" +#include "tsk/framework/utilities/SectorRuns.h" +#include "tsk/framework/utilities/TskException.h" +#include "tsk/framework/utilities/TskUtilities.h" +#include "tsk/framework/extraction/TskImageFileTsk.h" +#include "tsk/framework/extraction/CarveExtract.h" +#include "tsk/framework/extraction/CarvePrep.h" +#include "tsk/framework/file/TskFileManager.h" +#include "tsk/framework/file/TskFile.h" +#include "tsk/framework/pipeline/TskPipelineManager.h" +#include "tsk/framework/pipeline/TskPipeline.h" +#include "tsk/framework/pipeline/TskFileAnalysisPipeline.h" +#include "tsk/framework/pipeline/TskReportPipeline.h" +#include "tsk/framework/pipeline/TskModule.h" +#include "tsk/framework/pipeline/TskExecutableModule.h" +#include "tsk/framework/pipeline/TskPluginModule.h" +#include "tsk/framework/pipeline/TskFileAnalysisPluginModule.h" +#include "tsk/framework/pipeline/TskReportPluginModule.h" + +#endif diff --git a/framework/framework_i.h b/framework/tsk/framework/framework_i.h similarity index 92% rename from framework/framework_i.h rename to framework/tsk/framework/framework_i.h index 22e93fedd..285382a50 100755 --- a/framework/framework_i.h +++ b/framework/tsk/framework/framework_i.h @@ -13,7 +13,7 @@ #include <stdlib.h> #include <stdio.h> -#include <tsk3/libtsk.h> +#include <tsk/libtsk.h> #define MAX_BUFF_LENGTH 1024 diff --git a/framework/tsk/framework/pipeline/Makefile.am b/framework/tsk/framework/pipeline/Makefile.am new file mode 100644 index 000000000..fe91d9bf0 --- /dev/null +++ b/framework/tsk/framework/pipeline/Makefile.am @@ -0,0 +1,22 @@ +AM_CXXFLAGS = -I.. -I../.. -I../../../.. -Wall + +noinst_LTLIBRARIES = libfwpipe.la +libfwpipe_la_SOURCES = \ + TskExecutableModule.cpp \ + TskExecutableModule.h \ + TskFileAnalysisPipeline.cpp \ + TskFileAnalysisPipeline.h \ + TskFileAnalysisPluginModule.cpp \ + TskFileAnalysisPluginModule.h \ + TskModule.cpp \ + TskModule.h \ + TskPipeline.cpp \ + TskPipeline.h \ + TskPipelineManager.cpp \ + TskPipelineManager.h \ + TskPluginModule.cpp \ + TskPluginModule.h \ + TskReportPipeline.cpp \ + TskReportPipeline.h \ + TskReportPluginModule.cpp \ + TskReportPluginModule.h diff --git a/framework/Pipeline/TskExecutableModule.cpp b/framework/tsk/framework/pipeline/TskExecutableModule.cpp similarity index 93% rename from framework/Pipeline/TskExecutableModule.cpp rename to framework/tsk/framework/pipeline/TskExecutableModule.cpp index 7bdefb817..9e66199d7 100755 --- a/framework/Pipeline/TskExecutableModule.cpp +++ b/framework/tsk/framework/pipeline/TskExecutableModule.cpp @@ -19,10 +19,10 @@ // Framework includes #include "TskExecutableModule.h" -#include "Services/TskServices.h" -#include "Utilities/TskException.h" -#include "File/TskFileManagerImpl.h" -#include "Utilities/TskUtilities.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/utilities/TskException.h" +#include "tsk/framework/file/TskFileManagerImpl.h" +#include "tsk/framework/utilities/TskUtilities.h" // Poco includes #include "Poco/String.h" diff --git a/framework/Pipeline/TskExecutableModule.h b/framework/tsk/framework/pipeline/TskExecutableModule.h similarity index 100% rename from framework/Pipeline/TskExecutableModule.h rename to framework/tsk/framework/pipeline/TskExecutableModule.h diff --git a/framework/Pipeline/TskFileAnalysisPipeline.cpp b/framework/tsk/framework/pipeline/TskFileAnalysisPipeline.cpp similarity index 93% rename from framework/Pipeline/TskFileAnalysisPipeline.cpp rename to framework/tsk/framework/pipeline/TskFileAnalysisPipeline.cpp index fce2381c5..e9ca1eb96 100755 --- a/framework/Pipeline/TskFileAnalysisPipeline.cpp +++ b/framework/tsk/framework/pipeline/TskFileAnalysisPipeline.cpp @@ -17,8 +17,8 @@ #include "TskFileAnalysisPipeline.h" // TSK Framework includes -#include "File/TskFileManagerImpl.h" -#include "Services/TskServices.h" +#include "tsk/framework/file/TskFileManagerImpl.h" +#include "tsk/framework/services/TskServices.h" // Poco includes #include "Poco/AutoPtr.h" @@ -26,6 +26,7 @@ // C/C++ library includes #include <sstream> +#include <memory> void TskFileAnalysisPipeline::run(const uint64_t fileId) { @@ -95,7 +96,7 @@ void TskFileAnalysisPipeline::run(TskFile* file) bool bModuleFailed = false; Poco::Stopwatch stopWatch; - for (int i = 0; i < m_modules.size(); i++) + for (size_t i = 0; i < m_modules.size(); i++) { // we have no way of knowing if the file was closed by a module, // so always make sure it is open diff --git a/framework/Pipeline/TskFileAnalysisPipeline.h b/framework/tsk/framework/pipeline/TskFileAnalysisPipeline.h similarity index 100% rename from framework/Pipeline/TskFileAnalysisPipeline.h rename to framework/tsk/framework/pipeline/TskFileAnalysisPipeline.h diff --git a/framework/Pipeline/TskFileAnalysisPluginModule.cpp b/framework/tsk/framework/pipeline/TskFileAnalysisPluginModule.cpp similarity index 93% rename from framework/Pipeline/TskFileAnalysisPluginModule.cpp rename to framework/tsk/framework/pipeline/TskFileAnalysisPluginModule.cpp index edb83ec92..6d417435b 100755 --- a/framework/Pipeline/TskFileAnalysisPluginModule.cpp +++ b/framework/tsk/framework/pipeline/TskFileAnalysisPluginModule.cpp @@ -17,8 +17,8 @@ #include "TskFileAnalysisPluginModule.h" // Framework includes -#include "Services/TskServices.h" -#include "Utilities/TskException.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/utilities/TskException.h" // C/C++ library includes #include <sstream> diff --git a/framework/Pipeline/TskFileAnalysisPluginModule.h b/framework/tsk/framework/pipeline/TskFileAnalysisPluginModule.h similarity index 100% rename from framework/Pipeline/TskFileAnalysisPluginModule.h rename to framework/tsk/framework/pipeline/TskFileAnalysisPluginModule.h diff --git a/framework/Pipeline/TskModule.cpp b/framework/tsk/framework/pipeline/TskModule.cpp similarity index 93% rename from framework/Pipeline/TskModule.cpp rename to framework/tsk/framework/pipeline/TskModule.cpp index f8f28a89b..643a6840e 100755 --- a/framework/Pipeline/TskModule.cpp +++ b/framework/tsk/framework/pipeline/TskModule.cpp @@ -17,8 +17,8 @@ #include <sstream> #include "TskModule.h" -#include "Services/TskServices.h" -#include "Services/TskSystemProperties.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/services/TskSystemProperties.h" #include "Poco/String.h" #include "Poco/Environment.h" diff --git a/framework/Pipeline/TskModule.h b/framework/tsk/framework/pipeline/TskModule.h similarity index 95% rename from framework/Pipeline/TskModule.h rename to framework/tsk/framework/pipeline/TskModule.h index 20b5672ec..dde738d47 100755 --- a/framework/Pipeline/TskModule.h +++ b/framework/tsk/framework/pipeline/TskModule.h @@ -16,7 +16,7 @@ #ifndef _TSK_MODULE_H #define _TSK_MODULE_H -#include "File/TskFile.h" +#include "tsk/framework/file/TskFile.h" /** * Interface for classes that represent different types of modules diff --git a/framework/Pipeline/TskPipeline.cpp b/framework/tsk/framework/pipeline/TskPipeline.cpp similarity index 93% rename from framework/Pipeline/TskPipeline.cpp rename to framework/tsk/framework/pipeline/TskPipeline.cpp index e6643cff6..c6a9ca894 100755 --- a/framework/Pipeline/TskPipeline.cpp +++ b/framework/tsk/framework/pipeline/TskPipeline.cpp @@ -19,22 +19,23 @@ // TSK Framework includes #include "TskExecutableModule.h" #include "TskPluginModule.h" -#include "File/TskFileManagerImpl.h" -#include "Services/TskServices.h" -#include "Utilities/TskException.h" -#include "Utilities/TskUtilities.h" +#include "tsk/framework/file/TskFileManagerImpl.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/utilities/TskException.h" +#include "tsk/framework/utilities/TskUtilities.h" // Poco includes #include "Poco/AutoPtr.h" #include "Poco/NumberParser.h" #include "Poco/DOM/DOMParser.h" -#include "Poco/DOM/Nodelist.h" +#include "Poco/DOM/NodeList.h" #include "Poco/DOM/Document.h" #include "Poco/UnicodeConverter.h" // C/C++ library includes #include <sstream> #include <assert.h> +#include <memory> const std::string TskPipeline::MODULE_ELEMENT = "MODULE"; const std::string TskPipeline::MODULE_TYPE_ATTR = "type"; @@ -135,10 +136,6 @@ void TskPipeline::initialize(const std::string & pipelineConfig) throw TskException("TskPipeline::initialize - Module creation failed."); } - // Put the new module into the list if the slot isn't already taken. - int order = Poco::NumberParser::parse(pElem->getAttribute(TskPipeline::MODULE_ORDER_ATTR)); - - if (m_loadDll) { TskImgDB& imgDB = TskServices::Instance().getImgDB(); @@ -200,7 +197,9 @@ TskModule * TskPipeline::createModule(Poco::XML::Element *pElem) // Use auto_ptr to ensure that module will be deleted if there // are exceptions. std::auto_ptr<TskExecutableModule> pModule(new TskExecutableModule()); - pModule->setPath(pElem->getAttribute(TskPipeline::MODULE_LOCATION_ATTR)); + std::string location(pElem->getAttribute(TskPipeline::MODULE_LOCATION_ATTR)); + pModule->setPath(location); + //pModule->setPath(pElem->getAttribute(TskPipeline::MODULE_LOCATION_ATTR)); pModule->setArguments(pElem->getAttribute(TskPipeline::MODULE_ARGS_ATTR)); pModule->setOutput(pElem->getAttribute(TskPipeline::MODULE_OUTPUT_ATTR)); diff --git a/framework/Pipeline/TskPipeline.h b/framework/tsk/framework/pipeline/TskPipeline.h similarity index 96% rename from framework/Pipeline/TskPipeline.h rename to framework/tsk/framework/pipeline/TskPipeline.h index 673575fe3..4764634a3 100755 --- a/framework/Pipeline/TskPipeline.h +++ b/framework/tsk/framework/pipeline/TskPipeline.h @@ -18,7 +18,7 @@ #define _TSK_PIPELINE_H // TSK includes -#include "tsk3/base/tsk_os.h" // for uint64_t +#include "tsk/base/tsk_os.h" // for uint64_t // TSK Framework includes #include "TskModule.h" diff --git a/framework/Pipeline/TskPipelineManager.cpp b/framework/tsk/framework/pipeline/TskPipelineManager.cpp similarity index 95% rename from framework/Pipeline/TskPipelineManager.cpp rename to framework/tsk/framework/pipeline/TskPipelineManager.cpp index bb6ba08f3..894d556fd 100755 --- a/framework/Pipeline/TskPipelineManager.cpp +++ b/framework/tsk/framework/pipeline/TskPipelineManager.cpp @@ -19,9 +19,9 @@ // Framework includes #include "TskPipelineManager.h" -#include "Services/TskSystemProperties.h" -#include "Utilities/TskException.h" -#include "Services/TskServices.h" +#include "tsk/framework/services/TskSystemProperties.h" +#include "tsk/framework/utilities/TskException.h" +#include "tsk/framework/services/TskServices.h" #include "TskFileAnalysisPipeline.h" #include "TskReportPipeline.h" diff --git a/framework/Pipeline/TskPipelineManager.h b/framework/tsk/framework/pipeline/TskPipelineManager.h similarity index 100% rename from framework/Pipeline/TskPipelineManager.h rename to framework/tsk/framework/pipeline/TskPipelineManager.h diff --git a/framework/Pipeline/TskPluginModule.cpp b/framework/tsk/framework/pipeline/TskPluginModule.cpp similarity index 71% rename from framework/Pipeline/TskPluginModule.cpp rename to framework/tsk/framework/pipeline/TskPluginModule.cpp index 1aa0d2ecc..7c07563e1 100755 --- a/framework/Pipeline/TskPluginModule.cpp +++ b/framework/tsk/framework/pipeline/TskPluginModule.cpp @@ -17,10 +17,10 @@ #include "TskPluginModule.h" // Framework includes -#include "Services/TskServices.h" -#include "Utilities/TskException.h" -#include "File/TskFileManagerImpl.h" -#include "TskVersionInfo.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/utilities/TskException.h" +#include "tsk/framework/file/TskFileManagerImpl.h" +#include "tsk/framework/TskVersionInfo.h" // Poco includes #include "Poco/String.h" @@ -63,34 +63,78 @@ void TskPluginModule::setPath(const std::string& location) { try { - // Autogenerate filename extension if needed - Poco::Path tempPath = location; - if (tempPath.getExtension().empty()) - { - std::string os = Poco::Environment::osName(); - if (os.find("Linux") != std::string::npos) - { - tempPath.setExtension("so"); - } - else if (os.find("Darwin") != std::string::npos) - { - tempPath.setExtension("dylib"); - } - else if (os.find("Windows") != std::string::npos || - os.find("CYGWIN") != std::string::npos || - os.find("MINGW") != std::string::npos ) - { - tempPath.setExtension("dll"); - } - else - { - throw TskException("TskPluginModule::setPath: OS unknown. Cannot resolve plugin extension."); - } - } - - // Call parent to search for location - TskModule::setPath(tempPath.toString()); + if (location.empty()) + { + throw TskException("TskPluginModule::setPath: location is empty or missing."); + } + std::string os = Poco::Environment::osName(); + Poco::Path tempPath = location; + + // If on Linux or Mac, then prefix with "lib" + if ((os.find("Linux") != std::string::npos) || (os.find("Darwin") != std::string::npos)) + { + tempPath.setFileName("lib" + tempPath.getFileName()); + } + + // Autogenerate filename extension if needed + if (tempPath.getExtension().empty()) + { + if (os.find("Linux") != std::string::npos) + { + tempPath.setExtension("so"); + } + else if (os.find("Darwin") != std::string::npos) + { + tempPath.setExtension("dylib"); + } + else if (os.find("Windows") != std::string::npos || + os.find("CYGWIN") != std::string::npos || + os.find("MINGW") != std::string::npos ) + { + tempPath.setExtension("dll"); + } + else + { + throw TskException("TskPluginModule::setPath: OS unknown. Cannot resolve plugin extension."); + } + } + + // Search for location + // Absolute (fully qualified) paths are not allowed. + if (!tempPath.isAbsolute()) + { + // See if we can find the executable in MODULE_DIR. + std::string pathsToSearch = GetSystemProperty(TskSystemProperties::MODULE_DIR); + + bool found = Poco::Path::find(pathsToSearch, tempPath.toString(), tempPath); + + // Confirm existence of file at found location. + Poco::File moduleFile(tempPath); + if (found && moduleFile.exists()) + { + std::wstringstream msg; + msg << L"TskPluginModule::setPath - Module found at: " + << tempPath.toString().c_str(); + LOGINFO(msg.str()); + } + else + { + std::stringstream msg; + msg << "TskPluginModule::setPath - Module not found: " + << tempPath.toString().c_str(); + throw TskException(msg.str()); + } + } + else + { + std::stringstream msg; + msg << "TskPluginModule::setPath: location (" << tempPath.toString() << ") is not relative to MODULE_DIR."; + throw TskException(msg.str()); + } + + m_modulePath = tempPath.toString(); + // Load the library. m_sharedLibrary.load(m_modulePath); @@ -224,24 +268,32 @@ void TskPluginModule::validateLibraryVersionInfo() } int frameworkVersion = TskVersionInfo::getFrameworkVersion(); - int moduleFrameworkVersion = static_cast<int(*)()>(m_sharedLibrary.getSymbol(TskPluginModule::GET_FRAMEWORK_VERSION_SYMBOL))(); + typedef int (*GetFrameworkVersion)(); + GetFrameworkVersion getFrameworkVersion = (GetFrameworkVersion) m_sharedLibrary.getSymbol(TskPluginModule::GET_FRAMEWORK_VERSION_SYMBOL); + int moduleFrameworkVersion = getFrameworkVersion(); if (((frameworkVersion >> 16) & 0xFFFF) != (( moduleFrameworkVersion >> 16) & 0xFFFF)) { throw TskException("TskPluginModule::validateLibraryVersionInfo : framework version mismatch"); } - if (TskVersionInfo::getCompiler() != static_cast<TskVersionInfo::Compiler(*)()>(m_sharedLibrary.getSymbol(TskPluginModule::GET_COMPILER_SYMBOL))()) + typedef TskVersionInfo::Compiler (*GetCompiler)(); + GetCompiler getCompiler = (GetCompiler) m_sharedLibrary.getSymbol(TskPluginModule::GET_COMPILER_SYMBOL); + if (TskVersionInfo::getCompiler() != getCompiler()) { throw TskException("TskPluginModule::validateLibraryVersionInfo : compiler mismatch"); } - if (TskVersionInfo::getCompilerVersion() != static_cast<int(*)()>(m_sharedLibrary.getSymbol(TskPluginModule::GET_COMPILER_VERSION_SYMBOL))()) + typedef int (*GetCompilerVersion)(); + GetCompilerVersion getCompilerVersion = (GetCompilerVersion) m_sharedLibrary.getSymbol(TskPluginModule::GET_COMPILER_VERSION_SYMBOL); + if (TskVersionInfo::getCompilerVersion() != getCompilerVersion()) { throw TskException("TskPluginModule::validateLibraryVersionInfo : compiler version mismatch"); } - if (TskVersionInfo::getBuildType() != static_cast<int(*)()>(m_sharedLibrary.getSymbol(TskPluginModule::GET_BUILD_TYPE_SYMBOL))()) + typedef TskVersionInfo::BuildType (*GetBuildType)(); + GetBuildType getBuildType = (GetBuildType) m_sharedLibrary.getSymbol(TskPluginModule::GET_COMPILER_SYMBOL); + if (TskVersionInfo::getBuildType() != getBuildType()) { throw TskException("TskPluginModule::validateLibraryVersionInfo : build target mismatch"); } -} \ No newline at end of file +} diff --git a/framework/Pipeline/TskPluginModule.h b/framework/tsk/framework/pipeline/TskPluginModule.h similarity index 100% rename from framework/Pipeline/TskPluginModule.h rename to framework/tsk/framework/pipeline/TskPluginModule.h diff --git a/framework/Pipeline/TskReportPipeline.cpp b/framework/tsk/framework/pipeline/TskReportPipeline.cpp similarity index 89% rename from framework/Pipeline/TskReportPipeline.cpp rename to framework/tsk/framework/pipeline/TskReportPipeline.cpp index 20e3261f0..ea27ffba3 100755 --- a/framework/Pipeline/TskReportPipeline.cpp +++ b/framework/tsk/framework/pipeline/TskReportPipeline.cpp @@ -17,7 +17,7 @@ #include "TskReportPipeline.h" // TSK Framework includes -#include "Services/TskServices.h" +#include "tsk/framework/services/TskServices.h" // Poco includes #include "Poco/Stopwatch.h" @@ -28,7 +28,7 @@ void TskReportPipeline::run() { Poco::Stopwatch stopWatch; - for (int i = 0; i < m_modules.size(); i++) + for (size_t i = 0; i < m_modules.size(); i++) { stopWatch.restart(); TskModule::Status status = m_modules[i]->report(); diff --git a/framework/Pipeline/TskReportPipeline.h b/framework/tsk/framework/pipeline/TskReportPipeline.h similarity index 92% rename from framework/Pipeline/TskReportPipeline.h rename to framework/tsk/framework/pipeline/TskReportPipeline.h index fe0c0f2b2..ebf414f70 100755 --- a/framework/Pipeline/TskReportPipeline.h +++ b/framework/tsk/framework/pipeline/TskReportPipeline.h @@ -19,7 +19,7 @@ // TSK Framework includes #include "TskPipeline.h" #include "TskReportPluginModule.h" -#include "Utilities/TskException.h" +#include "tsk/framework/utilities/TskException.h" // C/C++ library includes #include <string> diff --git a/framework/Pipeline/TskReportPluginModule.cpp b/framework/tsk/framework/pipeline/TskReportPluginModule.cpp similarity index 93% rename from framework/Pipeline/TskReportPluginModule.cpp rename to framework/tsk/framework/pipeline/TskReportPluginModule.cpp index 18eb5d106..0a92d24de 100755 --- a/framework/Pipeline/TskReportPluginModule.cpp +++ b/framework/tsk/framework/pipeline/TskReportPluginModule.cpp @@ -17,8 +17,8 @@ #include "TskReportPluginModule.h" // TSK Framework includes -#include "Services/TskServices.h" -#include "Utilities/TskException.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/utilities/TskException.h" // C/C++ includes #include <sstream> diff --git a/framework/Pipeline/TskReportPluginModule.h b/framework/tsk/framework/pipeline/TskReportPluginModule.h similarity index 100% rename from framework/Pipeline/TskReportPluginModule.h rename to framework/tsk/framework/pipeline/TskReportPluginModule.h diff --git a/framework/tsk/framework/services/Log.cpp b/framework/tsk/framework/services/Log.cpp new file mode 100755 index 000000000..950d9af3b --- /dev/null +++ b/framework/tsk/framework/services/Log.cpp @@ -0,0 +1,160 @@ +/* + * The Sleuth Kit + * + * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2010-2012 Basis Technology Corporation. All Rights + * reserved. + * + * This software is distributed under the Common Public License 1.0 + */ + +#include <string.h> +#include <errno.h> +#include "string.h" +#include "Log.h" +#include "tsk/framework/utilities/TskUtilities.h" +#include "sys/stat.h" +#include <time.h> +#include "Poco/FileStream.h" +#include "Poco/Exception.h" +#include "Poco/LineEndingConverter.h" + +// @@@ imports for directory creation and deletion +//#include "windows.h" + + +Log::Log() +: m_filePath(""), m_outStream() +{ +} + + +/** + * Opens a single log file with a default name, based on the time + * that the log was opened. + * @returns 1 on error and 0 on success. + */ +int Log::open() +{ + struct tm *newtime; + time_t aclock; + + time(&aclock); // Get time in seconds + newtime = localtime(&aclock); // Convert time to struct tm form + wchar_t filename[MAX_BUFF_LENGTH]; + swprintf(filename, MAX_BUFF_LENGTH, L"log_%.4d-%.2d-%.2d-%.2d-%.2d-%.2d.txt", + newtime->tm_year + 1900, newtime->tm_mon+1, newtime->tm_mday, + newtime->tm_hour, newtime->tm_min, newtime->tm_sec); + + return open(filename); +} +/** + * Open the single log file at the path specified. All messages + * will be printed to the log. + * @param a_logFileFullPath Path to logfile to open. + * @returns 1 on error and 0 on success. + */ +int Log::open(const wchar_t * a_logFileFullPath) +{ + return open(TskUtilities::toUTF8(a_logFileFullPath).c_str()); +} + +int Log::open(const char * a_logFileFullPath) +{ + close(); // if needed + + try { + m_outStream.open(a_logFileFullPath, std::ios::app); + } catch (const std::exception ex) { + printf("The file '%s' cannot be opened. Exception: %s\n", a_logFileFullPath, ex.what()); + return 1; + } + + m_filePath.assign(a_logFileFullPath); + + return 0; +} + +/** + * Close the opened log file. + * @returns 0 on success + */ +int Log::close() +{ + m_outStream.close(); + if (m_outStream.bad()) { + printf("The file '%s' was not closed.", m_filePath.c_str()); + return 1; + } + return 0; +} + +Log::~Log() +{ + close(); +} + + +void Log::logf(Channel a_channel, char const *format, ...) +{ + va_list args; + va_start(args, format); + + char buf[2048]; +#ifdef TSK_WIN32 + vsnprintf_s(buf, 2048, _TRUNCATE, format, args); +#else + buf[2047] = '\0'; + vsnprintf(buf, 2047, format, args); +#endif + std::string msg(buf); + log(a_channel, buf); + va_end(args); +} + +void Log::log(Channel a_channel, const std::string &a_msg) +{ + std::string level; + switch (a_channel) { + case Error: + level.assign("[ERROR]"); + break; + case Warn: + level.assign("[WARN]"); + break; + case Info: + level.assign("[INFO]"); + break; + } + + struct tm *newtime; + time_t aclock; + + time(&aclock); // Get time in seconds + newtime = localtime(&aclock); // Convert time to struct tm form + char timeStr[64]; + snprintf(timeStr, 64, "%.2d/%.2d/%.2d %.2d:%.2d:%.2d", + newtime->tm_mon+1,newtime->tm_mday,newtime->tm_year % 100, + newtime->tm_hour, newtime->tm_min, newtime->tm_sec); + + if (m_outStream.good()) { + m_outStream << timeStr << " " << level << " " << a_msg << Poco::LineEnding::NEWLINE_DEFAULT; + m_outStream.flush(); + } + else { + fprintf(stderr, "%s %s %s\n", timeStr, level.data(), a_msg.data()); + } +} + +void Log::log(Channel a_channel, const std::wstring &a_msg) +{ + log(a_channel, TskUtilities::toUTF8(a_msg).c_str()); +} +/** + * Return the path to the log file. + * @returns path to log or NULL if log is going to STDERR + */ +const wchar_t * Log::getLogPathW() +{ + return (const wchar_t *)TskUtilities::toUTF16(m_filePath).c_str(); +} diff --git a/framework/Services/Log.h b/framework/tsk/framework/services/Log.h similarity index 89% rename from framework/Services/Log.h rename to framework/tsk/framework/services/Log.h index 392738a9d..9173e8e4c 100755 --- a/framework/Services/Log.h +++ b/framework/tsk/framework/services/Log.h @@ -11,9 +11,11 @@ #ifndef _OSS_LOG_H #define _OSS_LOG_H -#include "framework_i.h" +#include "tsk/framework/framework_i.h" #include <time.h> #include <string> +#include <iostream> +#include <fstream> // @@@ TODO: Resolve circular references between TskServices.h and this header by replacing macros with inline functions in TskServices.h @@ -117,12 +119,14 @@ class TSK_FRAMEWORK_API Log void logInfo(const std::wstring &msg) { log(Log::Info, msg); }; int open(const wchar_t * a_outDir); + int open(const char * a_outDir); int open(); int close(); - const wchar_t * getLogPath(); + const wchar_t * getLogPathW(); + const char * getLogPath() { return m_filePath.c_str(); } protected: - wchar_t m_filePath[MAX_BUFF_LENGTH]; - FILE * m_logFile; + std::string m_filePath; + std::ofstream m_outStream; }; #endif diff --git a/framework/tsk/framework/services/Makefile.am b/framework/tsk/framework/services/Makefile.am new file mode 100644 index 000000000..3f5aadfb0 --- /dev/null +++ b/framework/tsk/framework/services/Makefile.am @@ -0,0 +1,28 @@ +AM_CXXFLAGS = -I.. -I../.. -I../../../.. -Wall + +noinst_LTLIBRARIES = libfwserv.la +libfwserv_la_SOURCES = \ + Log.cpp \ + Log.h \ + Scheduler.cpp \ + Scheduler.h \ + TskBlackboardArtifact.cpp \ + TskBlackboardArtifact.h \ + TskBlackboardAttribute.cpp \ + TskBlackboardAttribute.h \ + TskBlackboard.cpp \ + TskBlackboard.h \ + TskDBBlackboard.cpp \ + TskDBBlackboard.h \ + TskImgDB.cpp \ + TskImgDB.h \ + TskImgDBSqlite.cpp \ + TskImgDBSqlite.h \ + TskSchedulerQueue.cpp \ + TskSchedulerQueue.h \ + TskServices.cpp \ + TskServices.h \ + TskSystemProperties.cpp \ + TskSystemProperties.h \ + TskSystemPropertiesImpl.cpp \ + TskSystemPropertiesImpl.h diff --git a/framework/Services/Scheduler.cpp b/framework/tsk/framework/services/Scheduler.cpp similarity index 100% rename from framework/Services/Scheduler.cpp rename to framework/tsk/framework/services/Scheduler.cpp diff --git a/framework/Services/Scheduler.h b/framework/tsk/framework/services/Scheduler.h similarity index 95% rename from framework/Services/Scheduler.h rename to framework/tsk/framework/services/Scheduler.h index 5c14ae106..97805ba7e 100755 --- a/framework/Services/Scheduler.h +++ b/framework/tsk/framework/services/Scheduler.h @@ -11,7 +11,7 @@ #ifndef _OSS_SCHEDULER_H #define _OSS_SCHEDULER_H -#include "framework_i.h" +#include "tsk/framework/framework_i.h" /** diff --git a/framework/Services/TskBlackboard.cpp b/framework/tsk/framework/services/TskBlackboard.cpp similarity index 96% rename from framework/Services/TskBlackboard.cpp rename to framework/tsk/framework/services/TskBlackboard.cpp index d64b5e7bd..e056a0fd9 100755 --- a/framework/Services/TskBlackboard.cpp +++ b/framework/tsk/framework/services/TskBlackboard.cpp @@ -116,8 +116,8 @@ map<int, TskAttributeNames> initializeAttributeTypeMap(){ * The table used to store names and display names for built in artifacts */ -map<int, TskArtifactNames> artifact_type_table= initializeArtifactTypeMap(); -map<int, TskAttributeNames> attribute_type_table= initializeAttributeTypeMap(); +static map<int, TskArtifactNames> artifact_type_table= initializeArtifactTypeMap(); +static map<int, TskAttributeNames> attribute_type_table= initializeAttributeTypeMap(); int m_artifactIDcounter = 1000; int m_attributeIDcounter = 1000; @@ -130,8 +130,8 @@ string TskBlackboard::attrTypeIDToTypeDisplayName(const int attributeTypeID){ return it->second.displayName; } int TskBlackboard::attrTypeNameToTypeID(const string& attributeTypeString){ - map<int, TskAttributeNames>::iterator it = attribute_type_table.begin(); - for(it; it != attribute_type_table.end(); it++){ + map<int, TskAttributeNames>::iterator it; + for(it = attribute_type_table.begin(); it != attribute_type_table.end(); it++){ if(attributeTypeString.compare(it->second.typeName) == 0) return it->first; } diff --git a/framework/Services/TskBlackboard.h b/framework/tsk/framework/services/TskBlackboard.h similarity index 88% rename from framework/Services/TskBlackboard.h rename to framework/tsk/framework/services/TskBlackboard.h index bd832d6e4..fe30305a3 100755 --- a/framework/Services/TskBlackboard.h +++ b/framework/tsk/framework/services/TskBlackboard.h @@ -1,51 +1,51 @@ /* -* The Sleuth Kit -* -* Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] -* Copyright (c) 2010-2012 Basis Technology Corporation. All Rights -* reserved. -* -* This software is distributed under the Common Public License 1.0 -*/ + * The Sleuth Kit + * + * Contact: Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2010-2012 Basis Technology Corporation. All Rights + * reserved. + * + * This software is distributed under the Common Public License 1.0 + */ /** -* \file TskBlackboard.h -* Interface for class that will implement the black board. The black board -* is used to store data from analysis modules. The data is available to -* later modules in the pipeline and in the final reporting phase. -*/ + * \file TskBlackboard.h + * Interface for class that will implement the black board. The black board + * is used to store data from analysis modules. The data is available to + * later modules in the pipeline and in the final reporting phase. + */ #ifndef _TSK_BLACKBOARD_H #define _TSK_BLACKBOARD_H #include <string> #include <vector> -#include "Utilities/TskException.h" -#include "framework_i.h" -#include "Services/TskImgDB.h" +#include "tsk/framework/utilities/TskException.h" +#include "tsk/framework/framework_i.h" +#include "tsk/framework/services/TskImgDB.h" #include "TskBlackboardArtifact.h" #include "TskBlackboardAttribute.h" using namespace std; /** -* Built in artifact types. -* Refer to http://wiki.sleuthkit.org/index.php?title=Artifact_Examples -* for details on which attributes should be used for each artifact. -*/ + * Built in artifact types. + * Refer to http://wiki.sleuthkit.org/index.php?title=Artifact_Examples + * for details on which attributes should be used for each artifact. + */ /* Note that the below comments are the only documentation -* for the standard types. Please ensure that all types are -* documented. -* -* The numbers are explicitly added to make it easier to verify -* that the Java and C++ code is in sync. -* -* It is very important that this list be kept up to date and -* in sync with the Java code. Do not add anything here unless -* you also add it there. -* See bindings/java/src/org/sleuthkit/datamodel/BlackboardArtifact.java */ -typedef enum TSK_ARTIFACT_TYPE { + * for the standard types. Please ensure that all types are + * documented. + * + * The numbers are explicitly added to make it easier to verify + * that the Java and C++ code is in sync. + * + * It is very important that this list be kept up to date and + * in sync with the Java code. Do not add anything here unless + * you also add it there. + * See bindings/java/src/org/sleuthkit/datamodel/BlackboardArtifact.java */ +enum TSK_ARTIFACT_TYPE { TSK_GEN_INFO = 1,///< The general info artifact, if information doesn't need its own artifact it should go here TSK_WEB_BOOKMARK = 2,///< A web bookmark. TSK_WEB_COOKIE = 3,///< A web cookie. @@ -75,17 +75,17 @@ typedef enum TSK_ARTIFACT_TYPE { }; /** -* Built in attribute types -*/ + * Built in attribute types + */ /* The numbers are explicitly added to make it easier to verify -* that the Java and C++ code is in sync. -* -* It is very important that this list be kept up to date and -* in sync with the Java code. Do not add anything here unless -* you also add it there. -* See bindings/java/src/org/sleuthkit/datamodel/BlackboardAttribute.java -*/ -typedef enum TSK_ATTRIBUTE_TYPE { + * that the Java and C++ code is in sync. + * + * It is very important that this list be kept up to date and + * in sync with the Java code. Do not add anything here unless + * you also add it there. + * See bindings/java/src/org/sleuthkit/datamodel/BlackboardAttribute.java + */ +enum TSK_ATTRIBUTE_TYPE { TSK_URL = 1,///< String of a URL, should start with http:// or ftp:// etc. You should also make a TskBlackoard::TSK_DOMAIN entry for the base domain name. TSK_DATETIME = 2,///< INT32: GMT based Unix time, defines number of secords elapsed since UTC Jan 1, 1970. TSK_NAME = 3,///< STRING: The name associated with an artifact @@ -163,8 +163,8 @@ typedef enum TSK_ATTRIBUTE_TYPE { }; /** -* Class used to store the pair of type and display names of attributes. -*/ + * Class used to store the pair of type and display names of attributes. + */ class TskAttributeNames{ public: string typeName; @@ -175,8 +175,8 @@ class TskAttributeNames{ }; /** -* Class used to store the pair of type and display names of artifacts. -*/ + * Class used to store the pair of type and display names of artifacts. + */ class TskArtifactNames{ public: string typeName; @@ -187,10 +187,10 @@ class TskArtifactNames{ }; /** -* An interface for setting and retrieving name/value pairs to the blackboard. -* The blackboard is used to store data for use by later modules in the pipeline. -* Can be registered with and retrieved from TskServices. -*/ + * An interface for setting and retrieving name/value pairs to the blackboard. + * The blackboard is used to store data for use by later modules in the pipeline. + * Can be registered with and retrieved from TskServices. + */ class TSK_FRAMEWORK_API TskBlackboard { public: diff --git a/framework/Services/TskBlackboardArtifact.cpp b/framework/tsk/framework/services/TskBlackboardArtifact.cpp similarity index 90% rename from framework/Services/TskBlackboardArtifact.cpp rename to framework/tsk/framework/services/TskBlackboardArtifact.cpp index a8077684b..3ecd7fb11 100644 --- a/framework/Services/TskBlackboardArtifact.cpp +++ b/framework/tsk/framework/services/TskBlackboardArtifact.cpp @@ -12,11 +12,11 @@ #include <vector> #include <iostream> #include <sstream> -#include "framework_i.h" +#include "tsk/framework/framework_i.h" #include "TskBlackboard.h" #include "TskBlackboardAttribute.h" -#include "Utilities/TskException.h" -#include "Services/TskServices.h" +#include "tsk/framework/utilities/TskException.h" +#include "tsk/framework/services/TskServices.h" #define BLACKBOARD() (TskServices::Instance().getBlackboard()) diff --git a/framework/Services/TskBlackboardArtifact.h b/framework/tsk/framework/services/TskBlackboardArtifact.h similarity index 93% rename from framework/Services/TskBlackboardArtifact.h rename to framework/tsk/framework/services/TskBlackboardArtifact.h index 52b54778b..92e55ffd6 100644 --- a/framework/Services/TskBlackboardArtifact.h +++ b/framework/tsk/framework/services/TskBlackboardArtifact.h @@ -17,7 +17,7 @@ #include <string> #include <vector> -#include "framework_i.h" +#include "tsk/framework/framework_i.h" using namespace std; @@ -83,4 +83,4 @@ class TSK_FRAMEWORK_API TskBlackboardArtifact int m_artifactTypeID; }; -#endif \ No newline at end of file +#endif diff --git a/framework/Services/TskBlackboardAttribute.cpp b/framework/tsk/framework/services/TskBlackboardAttribute.cpp similarity index 76% rename from framework/Services/TskBlackboardAttribute.cpp rename to framework/tsk/framework/services/TskBlackboardAttribute.cpp index c8128733a..1e08c9d6d 100644 --- a/framework/Services/TskBlackboardAttribute.cpp +++ b/framework/tsk/framework/services/TskBlackboardAttribute.cpp @@ -10,11 +10,11 @@ #include <string> #include <vector> -#include "framework_i.h" +#include "tsk/framework/framework_i.h" #include "TskBlackboardAttribute.h" #include "TskBlackboardArtifact.h" #include "TskBlackboard.h" -#include "Utilities/TskException.h" +#include "tsk/framework/utilities/TskException.h" #include "TskServices.h" /** @@ -31,15 +31,17 @@ TskBlackboardAttribute::~TskBlackboardAttribute(){ * @param valueInt integer value */ TskBlackboardAttribute::TskBlackboardAttribute(const int attributeTypeID, const string& moduleName, const string& context, const int valueInt): -m_attributeTypeID(attributeTypeID), -m_moduleName(moduleName), -m_context(context), -m_valueInt(valueInt), -m_valueType(TSK_INTEGER), -m_valueLong(), -m_valueDouble(), -m_valueString(), -m_valueBytes(){} + m_artifactID(), + m_attributeTypeID(attributeTypeID), + m_moduleName(moduleName), + m_context(context), + m_valueType(TSK_INTEGER), + m_valueInt(valueInt), + m_valueLong(), + m_valueDouble(), + m_valueString(), + m_valueBytes(), + m_objectID(){} /** * Constructor @@ -49,15 +51,17 @@ m_valueBytes(){} * @param valueLong 64 bit integer value */ TskBlackboardAttribute::TskBlackboardAttribute(const int attributeTypeID, const string& moduleName, const string& context, const uint64_t valueLong): -m_attributeTypeID(attributeTypeID), -m_moduleName(moduleName), -m_context(context), -m_valueLong(valueLong), -m_valueType(TSK_LONG), -m_valueInt(), -m_valueDouble(), -m_valueString(), -m_valueBytes(){} + m_artifactID(), + m_attributeTypeID(attributeTypeID), + m_moduleName(moduleName), + m_context(context), + m_valueType(TSK_LONG), + m_valueInt(), + m_valueLong(valueLong), + m_valueDouble(), + m_valueString(), + m_valueBytes(), + m_objectID(){} /** * Constructor @@ -67,15 +71,17 @@ m_valueBytes(){} * @param valueDouble double value */ TskBlackboardAttribute::TskBlackboardAttribute(const int attributeTypeID, const string& moduleName, const string& context, const double valueDouble): -m_attributeTypeID(attributeTypeID), -m_moduleName(moduleName), -m_context(context), -m_valueDouble(valueDouble), -m_valueType(TSK_DOUBLE), -m_valueInt(), -m_valueLong(), -m_valueString(), -m_valueBytes(){} + m_artifactID(), + m_attributeTypeID(attributeTypeID), + m_moduleName(moduleName), + m_context(context), + m_valueType(TSK_DOUBLE), + m_valueInt(), + m_valueLong(), + m_valueDouble(valueDouble), + m_valueString(), + m_valueBytes(), + m_objectID(){} /** * Constructor @@ -85,15 +91,17 @@ m_valueBytes(){} * @param valueString string value */ TskBlackboardAttribute::TskBlackboardAttribute(const int attributeTypeID, const string& moduleName, const string& context, const string& valueString): -m_attributeTypeID(attributeTypeID), -m_moduleName(moduleName), -m_context(context), -m_valueString(valueString), -m_valueType(TSK_STRING), -m_valueInt(), -m_valueLong(), -m_valueDouble(), -m_valueBytes(){} + m_artifactID(), + m_attributeTypeID(attributeTypeID), + m_moduleName(moduleName), + m_context(context), + m_valueType(TSK_STRING), + m_valueInt(), + m_valueLong(), + m_valueDouble(), + m_valueString(valueString), + m_valueBytes(), + m_objectID(){} /** * Constructor @@ -103,15 +111,17 @@ m_valueBytes(){} * @param valueBytes byte array value */ TskBlackboardAttribute::TskBlackboardAttribute(const int attributeTypeID, const string& moduleName, const string& context, const vector<unsigned char>& valueBytes): -m_attributeTypeID(attributeTypeID), -m_moduleName(moduleName), -m_context(context), -m_valueBytes(valueBytes), -m_valueType(TSK_BYTE), -m_valueInt(), -m_valueLong(), -m_valueDouble(), -m_valueString(){} + m_artifactID(), + m_attributeTypeID(attributeTypeID), + m_moduleName(moduleName), + m_context(context), + m_valueType(TSK_BYTE), + m_valueInt(), + m_valueLong(), + m_valueDouble(), + m_valueString(), + m_valueBytes(valueBytes), + m_objectID(){} /** * Constructor diff --git a/framework/Services/TskBlackBoardAttribute.h b/framework/tsk/framework/services/TskBlackboardAttribute.h similarity index 95% rename from framework/Services/TskBlackBoardAttribute.h rename to framework/tsk/framework/services/TskBlackboardAttribute.h index bcea932fc..4184665d4 100644 --- a/framework/Services/TskBlackBoardAttribute.h +++ b/framework/tsk/framework/services/TskBlackboardAttribute.h @@ -19,7 +19,7 @@ #include <string> #include <vector> #include <map> -#include "framework_i.h" +#include "tsk/framework/framework_i.h" using namespace std; @@ -27,7 +27,7 @@ using namespace std; * Value type enum, should always correspond to the stored value in an * attribute */ -typedef enum TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE { +enum TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE { TSK_STRING = 0, ///< string TSK_INTEGER, ///< int TSK_LONG, ///< long diff --git a/framework/Services/TskDBBlackboard.cpp b/framework/tsk/framework/services/TskDBBlackboard.cpp similarity index 94% rename from framework/Services/TskDBBlackboard.cpp rename to framework/tsk/framework/services/TskDBBlackboard.cpp index 7e012b842..9f38cace1 100755 --- a/framework/Services/TskDBBlackboard.cpp +++ b/framework/tsk/framework/services/TskDBBlackboard.cpp @@ -12,11 +12,11 @@ #include <sstream> #include "TskDBBlackboard.h" -#include "Services/TskImgDB.h" -#include "Services/TskServices.h" -#include "File/TskFileTsk.h" -#include "File/TskFile.h" -#include "File/TskFileManagerImpl.h" +#include "tsk/framework/services/TskImgDB.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/file/TskFileTsk.h" +#include "tsk/framework/file/TskFile.h" +#include "tsk/framework/file/TskFileManagerImpl.h" TskDBBlackboard * TskDBBlackboard::m_pInstance = NULL; @@ -209,4 +209,4 @@ void TskDBBlackboard::createGenInfoAttribute(const uint64_t file_id, TskBlackboa vector<int> TskDBBlackboard::findAttributeTypes(int artifactTypeId){ return IMGDB().findAttributeTypes(artifactTypeId); -} \ No newline at end of file +} diff --git a/framework/Services/TskDBBlackboard.h b/framework/tsk/framework/services/TskDBBlackboard.h similarity index 92% rename from framework/Services/TskDBBlackboard.h rename to framework/tsk/framework/services/TskDBBlackboard.h index 96ee9f327..47d3ca7c1 100755 --- a/framework/Services/TskDBBlackboard.h +++ b/framework/tsk/framework/services/TskDBBlackboard.h @@ -17,10 +17,10 @@ #define _TSK_DB_BLACKBOARD_H #include <string> -#include "Utilities/TskException.h" -#include "Services/TskBlackboard.h" -#include "Services/TskImgDB.h" -#include "Services/TskServices.h" +#include "tsk/framework/utilities/TskException.h" +#include "tsk/framework/services/TskBlackboard.h" +#include "tsk/framework/services/TskImgDB.h" +#include "tsk/framework/services/TskServices.h" #include "TskBlackboardArtifact.h" #include "TskBlackboardAttribute.h" diff --git a/framework/Services/TskImgDB.cpp b/framework/tsk/framework/services/TskImgDB.cpp similarity index 77% rename from framework/Services/TskImgDB.cpp rename to framework/tsk/framework/services/TskImgDB.cpp index eadca27bd..bcf5e9cbf 100755 --- a/framework/Services/TskImgDB.cpp +++ b/framework/tsk/framework/services/TskImgDB.cpp @@ -25,6 +25,12 @@ TskImgDB::~TskImgDB() { } +/** + * Store meta_addr to object id mapping of the directory in a local cache map + * @param fsObjId fs id of this directory + * @param meta_addr meta_addr of this directory + * @param objId object id of this directory from the objects table + */ void TskImgDB::storeParObjId(const int64_t & fsObjId, const TSK_INUM_T & meta_addr, const int64_t & objId) { map<TSK_INUM_T,int64_t> &tmpMap = m_parentDirIdCache[fsObjId]; //store only if does not exist @@ -32,6 +38,12 @@ void TskImgDB::storeParObjId(const int64_t & fsObjId, const TSK_INUM_T & meta_ad tmpMap[meta_addr] = objId; } +/** + * Find parent object id of TSK_FS_FILE. Use local cache map, if not found, fall back to SQL + * @param fs_file file to find parent obj id for + * @param fsObjId fs id of this file + * @returns parent obj id ( > 0), -1 on error + */ int64_t TskImgDB::findParObjId(const int64_t & fsObjId, TSK_INUM_T meta_addr) { //get from cache by parent meta addr, if available map<TSK_INUM_T,int64_t> &tmpMap = m_parentDirIdCache[fsObjId]; diff --git a/framework/Services/TskImgDB.h b/framework/tsk/framework/services/TskImgDB.h similarity index 93% rename from framework/Services/TskImgDB.h rename to framework/tsk/framework/services/TskImgDB.h index 3cf151256..85cadf26b 100755 --- a/framework/Services/TskImgDB.h +++ b/framework/tsk/framework/services/TskImgDB.h @@ -18,10 +18,10 @@ #include <string> // to get std::wstring #include <list> #include <vector> -#include "tsk3/libtsk.h" -#include "framework_i.h" -#include "Utilities/SectorRuns.h" -#include "Utilities/UnallocRun.h" +#include "tsk/libtsk.h" +#include "tsk/framework/framework_i.h" +#include "tsk/framework/utilities/SectorRuns.h" +#include "tsk/framework/utilities/UnallocRun.h" #include "TskBlackboardAttribute.h" #include "TskBlackboard.h" #include "TskBlackboardArtifact.h" @@ -244,7 +244,7 @@ class TSK_FRAMEWORK_API TskImgDB */ virtual int addFsFileInfo(int fileSystemID, const TSK_FS_FILE *fileSystemFile, const char *fileName, int fileSystemAttrType, int fileSystemAttrID, uint64_t &fileID, const char *filePath) = 0; - virtual int addCarvedFileInfo(int vol_id, wchar_t * name, uint64_t size, uint64_t *runStarts, uint64_t *runLengths, int numRuns, uint64_t & fileId) = 0; + virtual int addCarvedFileInfo(int vol_id, const char *name, uint64_t size, uint64_t *runStarts, uint64_t *runLengths, int numRuns, uint64_t & fileId) = 0; virtual int addDerivedFileInfo(const std::string& name, const uint64_t parentId, const bool isDirectory, const uint64_t size, const std::string& details, const int ctime, const int crtime, const int atime, const int mtime, uint64_t & fileId, std::string path) = 0; @@ -292,9 +292,10 @@ class TSK_FRAMEWORK_API TskImgDB /** * Gets a list of image paths. * - * @returns A vector of image paths as std::wstrings. There may be multiple paths for a split image or the list may be empty if no image paths have been stored. + * @returns A vector of image paths as std::strings. There may be multiple paths for a split image or the list may be empty if no image paths have been stored. */ - virtual std::vector<std::wstring> getImageNames() const = 0; + virtual std::vector<std::wstring> getImageNamesW() const = 0; + virtual std::vector<std::string> getImageNames() const = 0; virtual int getFileUniqueIdentifiers(uint64_t a_fileId, uint64_t &a_fsOffset, uint64_t &a_fsFileId, int &a_attrType, int &a_attrId) const = 0; virtual int getNumVolumes() const = 0; @@ -346,8 +347,8 @@ class TSK_FRAMEWORK_API TskImgDB virtual bool dbExist() const = 0; // Get set of file ids that match the given condition (i.e. SQL where clause) - virtual std::vector<uint64_t> getFileIds(std::string& condition) const = 0; - virtual std::vector<const TskFileRecord> getFileRecords(std::string& condition) const = 0; + virtual std::vector<uint64_t> getFileIds(const std::string& condition) const = 0; + virtual const std::vector<TskFileRecord> getFileRecords(const std::string& condition) const = 0; // Get the number of files that match the given condition virtual int getFileCount(std::string& condition) const = 0; diff --git a/framework/Services/TskImgDBSqlite.cpp b/framework/tsk/framework/services/TskImgDBSqlite.cpp similarity index 78% rename from framework/Services/TskImgDBSqlite.cpp rename to framework/tsk/framework/services/TskImgDBSqlite.cpp index f87d66ac9..230be4684 100755 --- a/framework/Services/TskImgDBSqlite.cpp +++ b/framework/tsk/framework/services/TskImgDBSqlite.cpp @@ -15,6 +15,7 @@ */ #include <stdio.h> +#include <string.h> #include <cassert> #include <iostream> #include <sstream> @@ -22,9 +23,12 @@ #include <map> #include <assert.h> +#include "Poco/UnicodeConverter.h" +#include "Poco/Thread.h" + #include "TskImgDBSqlite.h" #include "TskServices.h" -#include "Utilities/TskException.h" +#include "tsk/framework/utilities/TskException.h" #include "TskDBBlackboard.h" #include "Poco/UnicodeConverter.h" @@ -41,17 +45,17 @@ * @param a_outpath Directory to store the database in. This * directory must already exist. */ -TskImgDBSqlite::TskImgDBSqlite(const wchar_t * a_outpath) +TskImgDBSqlite::TskImgDBSqlite(const char * a_outpath) { - wcsncpy_s(m_outPath, a_outpath, 256); - // ensure that the path ends with a '\' - if (m_outPath[wcslen(m_outPath)-1] != '\\') { - int len1 = wcslen(m_outPath); - m_outPath[len1] = '\\'; + strncpy(m_outPath, a_outpath, 256); + // ensure that the path ends with a '/' + if (m_outPath[strlen(m_outPath)-1] != '/') { + int len1 = strlen(m_outPath); + m_outPath[len1] = '/'; m_outPath[len1+1] = '\0'; } - wcsncpy_s(m_dbFilePath, m_outPath, 256); - wcsncat_s(m_dbFilePath, L"image.db", 256); + strncpy(m_dbFilePath, m_outPath, 256); + strncat(m_dbFilePath, "image.db", 256); m_db = NULL; } @@ -108,7 +112,7 @@ int TskImgDBSqlite::dropTables() int TskImgDBSqlite::initialize() { - wchar_t infoMessage[MAX_BUFF_LENGTH]; + std::wstringstream infoMessage; char * errmsg; // Open the database. @@ -121,7 +125,7 @@ int TskImgDBSqlite::initialize() // Clean up the whole database. dropTables(); - char * stmt; + std::string stmt; sqlite3_stmt *statement; @@ -135,9 +139,9 @@ int TskImgDBSqlite::initialize() // ----- DB_INFO stmt = "CREATE TABLE db_info (name TEXT PRIMARY KEY, version TEXT)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating db_info table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating db_info table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -145,9 +149,9 @@ int TskImgDBSqlite::initialize() // ----- IMAGE_INFO stmt = "CREATE TABLE image_info (type INTEGER, ssize INTEGER)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating image_info table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating image_info table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -155,9 +159,9 @@ int TskImgDBSqlite::initialize() // ----- IMAGE_NAMES stmt = "CREATE TABLE image_names (seq INTEGER PRIMARY KEY, name TEXT)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating image_names table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating image_names table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -166,9 +170,9 @@ int TskImgDBSqlite::initialize() // ----- VOL_INFO stmt = "CREATE TABLE vol_info (vol_id INTEGER PRIMARY KEY, sect_start INTEGER NOT NULL, " "sect_len INTEGER NOT NULL, description TEXT, flags INTEGER)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating vol_info table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating vol_info table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -178,9 +182,9 @@ int TskImgDBSqlite::initialize() stmt = "CREATE TABLE fs_info (fs_id INTEGER PRIMARY KEY, img_byte_offset INTEGER, " "vol_id INTEGER NOT NULL, fs_type INTEGER, block_size INTEGER, " "block_count INTEGER, root_inum INTEGER, first_inum INTEGER, last_inum INTEGER)"; - if (sqlite3_exec(m_db, stmt , NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating fs_info table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str() , NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating fs_info table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -192,9 +196,9 @@ int TskImgDBSqlite::initialize() "dir_flags INTEGER, meta_flags INTEGER, size INTEGER, ctime INTEGER, " "crtime INTEGER, atime INTEGER, mtime INTEGER, mode INTEGER, uid INTEGER, " "gid INTEGER, status INTEGER, full_path TEXT)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating files table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating files table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -203,10 +207,10 @@ int TskImgDBSqlite::initialize() // ----- FS_FILES stmt = "CREATE TABLE fs_files (file_id INTEGER PRIMARY KEY, fs_id INTEGER, " "fs_file_id INTEGER, attr_type INTEGER, attr_id INTEGER)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating fs_files table: %S", errmsg); - LOGERROR(infoMessage); + infoMessage << L"TskImgDBSqlite::initialize - Error creating fs_files table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -215,10 +219,10 @@ int TskImgDBSqlite::initialize() // ----- FS_BLOCKS stmt = "CREATE TABLE fs_blocks (fs_id INTEGER NOT NULL, file_id INTEGER NOT NULL, seq INTEGER, " "blk_start INTEGER NOT NULL, blk_len INTEGER NOT NULL)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating fs_blocks table: %S", errmsg); - LOGERROR(infoMessage); + infoMessage << L"TskImgDBSqlite::initialize - Error creating fs_blocks table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -226,10 +230,10 @@ int TskImgDBSqlite::initialize() // ----- CARVED_FILES stmt = "CREATE TABLE carved_files (file_id INTEGER PRIMARY KEY, vol_id INTEGER)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating carved_files table: %S", errmsg); - LOGERROR(infoMessage); + infoMessage << L"TskImgDBSqlite::initialize - Error creating carved_files table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -238,10 +242,10 @@ int TskImgDBSqlite::initialize() // ----- SECTOR_LIST stmt = "CREATE TABLE carved_sectors (" "file_id INTEGER, seq INTEGER, sect_start INTEGER, sect_len INTEGER)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating carved_sectors table: %S", errmsg); - LOGERROR(infoMessage); + infoMessage << L"TskImgDBSqlite::initialize - Error creating carved_sectors table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -249,10 +253,10 @@ int TskImgDBSqlite::initialize() // ----- DERIVED_FILES stmt = "CREATE TABLE derived_files (file_id INTEGER PRIMARY KEY, derivation_details TEXT)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating derived_files table: %S", errmsg); - LOGERROR(infoMessage); + infoMessage << L"TskImgDBSqlite::initialize - Error creating derived_files table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -261,10 +265,10 @@ int TskImgDBSqlite::initialize() // ----- ALLOC_UNALLOC_MAP stmt = "CREATE TABLE alloc_unalloc_map (vol_id INTEGER, unalloc_img_id INTEGER, " "unalloc_img_sect_start INTEGER, sect_len INTEGER, orig_img_sect_start INTEGER)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating alloc_unalloc_map table: %S", errmsg); - LOGERROR(infoMessage); + infoMessage << L"TskImgDBSqlite::initialize - Error creating alloc_unalloc_map table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -272,9 +276,9 @@ int TskImgDBSqlite::initialize() // ----- FILE_HASHES stmt = "CREATE TABLE file_hashes (file_id INTEGER PRIMARY KEY, md5 TEXT, sha1 TEXT, sha2_256 TEXT, sha2_512 TEXT, known INTEGER)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating file_hashes table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating file_hashes table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -282,9 +286,9 @@ int TskImgDBSqlite::initialize() // ----- MODULES stmt = "CREATE TABLE modules (module_id INTEGER PRIMARY KEY, name TEXT UNIQUE NOT NULL, description TEXT)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating module table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating module table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -292,9 +296,9 @@ int TskImgDBSqlite::initialize() // ----- MODULE_STATUS stmt = "CREATE TABLE module_status (file_id INTEGER, module_id INTEGER, status INTEGER, PRIMARY KEY (file_id, module_id))"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating module_status table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating module_status table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -302,9 +306,9 @@ int TskImgDBSqlite::initialize() // ----- UNALLOC_IMG_STATUS stmt = "CREATE TABLE unalloc_img_status (unalloc_img_id INTEGER PRIMARY KEY, status INTEGER)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating unalloc_img_status table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating unalloc_img_status table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -312,9 +316,9 @@ int TskImgDBSqlite::initialize() // ----- UNUSED_SECTORS stmt = "CREATE TABLE unused_sectors (file_id INTEGER PRIMARY KEY, sect_start INTEGER, sect_len INTEGER, vol_id INTEGER)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating unused_sectors table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating unused_sectors table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -322,9 +326,9 @@ int TskImgDBSqlite::initialize() // ----- BLACKBOARD_ARTIFACTS stmt = "CREATE TABLE blackboard_artifacts (artifact_id INTEGER PRIMARY KEY, obj_id INTEGER NOT NULL, artifact_type_id INTEGER)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating blackboard_artifacts table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating blackboard_artifacts table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -333,9 +337,9 @@ int TskImgDBSqlite::initialize() // ----- BLACKBOARD_ATTRIBUTES stmt = "CREATE TABLE blackboard_attributes (artifact_id INTEGER NOT NULL, source TEXT, context TEXT, attribute_type_id INTEGER NOT NULL, value_type INTEGER NOT NULL, " "value_byte BLOB, value_text TEXT, value_int32 INTEGER, value_int64 INTEGER, value_double NUMERIC(20, 10), obj_id INTEGER NOT NULL)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating blackboard_attributes table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating blackboard_attributes table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -343,9 +347,9 @@ int TskImgDBSqlite::initialize() // ----- BLACKBOARD_ARTIFACT_TYPES stmt = "CREATE TABLE blackboard_artifact_types (artifact_type_id INTEGER PRIMARY KEY, type_name TEXT, display_name TEXT)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating blackboard_artifact_types table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating blackboard_artifact_types table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -353,9 +357,9 @@ int TskImgDBSqlite::initialize() // ----- BLACKBOARD_ATTRIBUTE_TYPES stmt = "CREATE TABLE blackboard_attribute_types (attribute_type_id INTEGER PRIMARY KEY, type_name TEXT, display_name TEXT)"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating blackboard_attribute_types table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating blackboard_attribute_types table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -363,41 +367,38 @@ int TskImgDBSqlite::initialize() // ----- CREATE INDEXES stmt = "CREATE INDEX attrs_artifact_id ON blackboard_attributes(artifact_id)"; - - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating attrs_artifact_id index: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating attrs_artifact_id index: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; } stmt = "CREATE INDEX attrs_attribute_type ON blackboard_attributes(attribute_type_id)"; - - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating attrs_attribute_type index: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating attrs_attribute_type index: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; } stmt = "CREATE INDEX attrs_obj_id ON blackboard_attributes(obj_id)"; - - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::initialize - Error creating attrs_obj_id index: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + infoMessage << L"TskImgDBSqlite::initialize - Error creating attrs_obj_id index: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; } map<int, TskArtifactNames> artTypes = TskImgDB::getAllArtifactTypes(); - for(map<int, TskArtifactNames>::iterator it = artTypes.begin(); it != artTypes.end(); it++){ + for (map<int, TskArtifactNames>::iterator it = artTypes.begin(); it != artTypes.end(); it++) { addArtifactType(it->first, it->second.typeName, it->second.displayName); } map<int, TskAttributeNames> attrTypes = TskImgDB::getAllAttributeTypes(); - for(map<int, TskAttributeNames>::iterator it = attrTypes.begin(); it != attrTypes.end(); it++){ + for (map<int, TskAttributeNames>::iterator it = attrTypes.begin(); it != attrTypes.end(); it++) { addAttributeType(it->first, it->second.typeName, it->second.displayName); } @@ -415,12 +416,16 @@ int TskImgDBSqlite::initialize() */ int TskImgDBSqlite::open() { - wchar_t infoMessage[MAX_BUFF_LENGTH]; + std::wstringstream infoMessage; +#if 0 if (sqlite3_open16(m_dbFilePath, &m_db)) +#else + if (sqlite3_open(m_dbFilePath, &m_db)) +#endif { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::open - Can't create new database: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + infoMessage << L"TskImgDBSqlite::open - Can't create new database: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); sqlite3_close(m_db); return 1; @@ -440,8 +445,8 @@ int TskImgDBSqlite::open() if (sqlite3_file_control(m_db, NULL, SQLITE_FCNTL_CHUNK_SIZE, &chunkSize) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::open - Failed to set chunk size: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + infoMessage << L"TskImgDBSqlite::open - Failed to set chunk size: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); sqlite3_close(m_db); return 1; @@ -451,8 +456,8 @@ int TskImgDBSqlite::open() // where the database is locked by another process. if (sqlite3_busy_handler(m_db, TskImgDBSqlite::busyHandler, m_db) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::open - Failed to set busy handler: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + infoMessage << L"TskImgDBSqlite::open - Failed to set busy handler: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); sqlite3_close(m_db); return 1; @@ -476,9 +481,9 @@ int TskImgDBSqlite::addToolInfo(const char* name, const char* version) name, version); if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addToolInfo - Error adding data to db_info table: %S", errmsg); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addToolInfo - Error adding data to db_info table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -490,19 +495,17 @@ int TskImgDBSqlite::addToolInfo(const char* name, const char* version) int TskImgDBSqlite::addImageInfo(int type, int size) { char *errmsg; - char stmt[1024]; + std::stringstream stmt; if (!m_db) return 1; - _snprintf_s(stmt, 1024, _TRUNCATE, - "INSERT INTO image_info (type, ssize) VALUES (%d, %u);", - type, size); - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) + stmt << "INSERT INTO image_info (type, ssize) VALUES ("<< type << ", " << size << ");"; + if (sqlite3_exec(m_db, stmt.str().c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addImageInfo - Error adding data to image_info table: %S", errmsg); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addImageInfo - Error adding data to image_info table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -524,10 +527,9 @@ int TskImgDBSqlite::addImageName(char const *imgPath) imgPath); if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addImageName - " - L"Error adding data to image_names table: %S", errmsg); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addImageName - Error adding data to image_names table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -552,10 +554,9 @@ int TskImgDBSqlite::addVolumeInfo(const TSK_VS_PART_INFO * vs_part) vs_part->start, vs_part->len, vs_part->desc, vs_part->flags); if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addVolumeInfo - " - L"Error adding data to vol_info table: %S", errmsg); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addVolumeInfo - Error adding data to vol_info table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -566,25 +567,23 @@ int TskImgDBSqlite::addVolumeInfo(const TSK_VS_PART_INFO * vs_part) int TskImgDBSqlite::addFsInfo(int volId, int fsId, const TSK_FS_INFO * fs_info) { - char stmt[1024]; + std::stringstream stmt; char * errmsg; if (!m_db) return 1; - _snprintf_s(stmt, 1024, _TRUNCATE, + stmt << "INSERT INTO fs_info (fs_id, img_byte_offset, vol_id, fs_type, block_size, " - "block_count, root_inum, first_inum, last_inum) VALUES (%d,%" - PRIuOFF ",%d,'%d',%d,%" PRIuDADDR ",%" PRIuINUM ",%" PRIuINUM ",%" - PRIuINUM ")", fsId, fs_info->offset, volId, - (int)fs_info->ftype, fs_info->block_size, fs_info->block_count, - fs_info->root_inum, fs_info->first_inum, fs_info->last_inum); + "block_count, root_inum, first_inum, last_inum) VALUES (" << + fsId << ", " << fs_info->offset << ", " << volId << ", " << + (int)fs_info->ftype << ", " << fs_info->block_size << ", " << fs_info->block_count << ", " << + fs_info->root_inum << ", " << fs_info->first_inum << ", " << fs_info->last_inum << ")"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addFsInfo - " - L"Error adding data to fs_info table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.str().c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addFsInfo - Error adding data to fs_info table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -603,12 +602,12 @@ uint64_t TskImgDBSqlite::getFileId(int a_fsId, uint64_t a_fsFileId) const return 0; sqlite3_stmt * statement; - char stmt[1024]; + std::stringstream stmt; uint64_t fileId = 0; - _snprintf_s(stmt, 1024, _TRUNCATE, "SELECT file_id FROM fs_files WHERE fs_id=%d and fs_file_id=%llu;", a_fsId, a_fsFileId); + stmt << "SELECT file_id FROM fs_files WHERE fs_id=" << a_fsId << " and fs_file_id=" << a_fsFileId << ";"; /********** FIND the unallocated volumes *************/ - if (sqlite3_prepare_v2(m_db, stmt, -1, &statement, 0) == SQLITE_OK) { + if (sqlite3_prepare_v2(m_db, stmt.str().c_str(), -1, &statement, 0) == SQLITE_OK) { int result = sqlite3_step(statement); if (result == SQLITE_ROW) { fileId = (uint64_t)sqlite3_column_int64(statement, 0); @@ -616,9 +615,9 @@ uint64_t TskImgDBSqlite::getFileId(int a_fsId, uint64_t a_fsFileId) const sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFileId - Error querying fs_files table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getFileId - Error querying fs_files table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return 0; } @@ -803,7 +802,7 @@ int TskImgDBSqlite::addFsFileInfo(int fileSystemID, const TSK_FS_FILE *fileSyste fileID = sqlite3_last_insert_rowid(m_db); // Insert into the fs_files table. - _snprintf_s(stmt, 4096, _TRUNCATE, + sqlite3_snprintf(4096, stmt, "INSERT INTO fs_files (file_id, fs_id, fs_file_id, attr_type, attr_id) VALUES (%llu,%d,%" PRIuINUM ",%d,%d)", fileID, fileSystemID, fileSystemFile->name->meta_addr, fileSystemAttrType, fileSystemAttrID); @@ -837,20 +836,20 @@ int TskImgDBSqlite::addFsFileInfo(int fileSystemID, const TSK_FS_FILE *fileSyste */ int TskImgDBSqlite::addFsBlockInfo(int a_fsId, uint64_t a_fileId, int a_sequence, uint64_t a_blk_addr, uint64_t a_len) { - char stmt[1024]; + std::stringstream stmt; char * errmsg; if (!m_db) return 1; - _snprintf_s(stmt, 1024, _TRUNCATE, - "INSERT INTO fs_blocks (fs_id, file_id, seq, blk_start, blk_len) VALUES (%d,%llu,%d,%" - PRIuOFF ",%"PRIuOFF")", a_fsId, a_fileId, a_sequence, a_blk_addr, a_len); + stmt << + "INSERT INTO fs_blocks (fs_id, file_id, seq, blk_start, blk_len) VALUES (" << + a_fsId << "," << a_fileId << "," << a_sequence << "," << a_blk_addr << "," << a_len << ")"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addFsBlockInfo - Error adding data to fs_blocks table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.str().c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addFsBlockInfo - Error adding data to fs_blocks table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -862,22 +861,22 @@ int TskImgDBSqlite::addFsBlockInfo(int a_fsId, uint64_t a_fileId, int a_sequence int TskImgDBSqlite::addAllocUnallocMapInfo(int a_volID, int unallocImgID, uint64_t unallocImgStart, uint64_t length, uint64_t origImgStart) { - char stmt[1024]; + std::stringstream stmt; char * errmsg; if (!m_db) return 1; - _snprintf_s(stmt, 1024, _TRUNCATE, + stmt << "INSERT INTO alloc_unalloc_map (vol_id, unalloc_img_id, unalloc_img_sect_start, " - "sect_len, orig_img_sect_start) VALUES (%d,%d,%" - PRIuOFF ",%"PRIuOFF",%"PRIuOFF")", a_volID, unallocImgID, - unallocImgStart, length, origImgStart); + "sect_len, orig_img_sect_start) VALUES (" << + a_volID << "," << unallocImgID << "," << + unallocImgStart << "," << length << "," << origImgStart << ")"; - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addAllocUnallocMapInfo - Error adding data to alloc_unalloc_map table: %S", errmsg); - LOGERROR(infoMessage); + if (sqlite3_exec(m_db, stmt.str().c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addAllocUnallocMapInfo - Error adding data to alloc_unalloc_map table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -893,15 +892,15 @@ int TskImgDBSqlite::addAllocUnallocMapInfo(int a_volID, int unallocImgID, */ SectorRuns * TskImgDBSqlite::getFreeSectors() const { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - std::wstringstream msg; + std::stringstream infoMessage; + std::stringstream msg; if (!m_db) return NULL; SectorRuns * sr = new SectorRuns(); - LOGINFO(L"TskImgDBSqlite::getFreeSectors - Identifying Unallocated Sectors"); + LOGINFO("TskImgDBSqlite::getFreeSectors - Identifying Unallocated Sectors"); sqlite3_stmt * statement; @@ -924,10 +923,10 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const } // add the allocated volumes that don't have a known file system else { - char stmt[512]; + std::stringstream stmt; sqlite3_stmt *statement2; - _snprintf_s(stmt, 512, _TRUNCATE, "SELECT fs_id FROM fs_info WHERE vol_id = %d;", vol_id); - if (sqlite3_prepare_v2(m_db, stmt , -1, &statement2, 0) == SQLITE_OK) { + stmt << "SELECT fs_id FROM fs_info WHERE vol_id = " << vol_id << ";"; + if (sqlite3_prepare_v2(m_db, stmt.str().c_str() , -1, &statement2, 0) == SQLITE_OK) { if (sqlite3_step(statement2) != SQLITE_ROW) { sr->addRun(start, len, vol_id); } @@ -942,8 +941,8 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const sqlite3_finalize(statement); } else { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFreeSectors - Error querying vol_info table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + infoMessage << "TskImgDBSqlite::getFreeSectors - Error querying vol_info table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return NULL; } @@ -959,7 +958,7 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const // get basic info on each file system if (sqlite3_prepare_v2(m_db, "SELECT fs_id, vol_id, img_byte_offset, block_size, block_count FROM fs_info;", -1, &statement, 0) == SQLITE_OK) { - LOGINFO(L"TskImgDBSqlite::getFreeSectors - START LOOP: Find the unallocated blocks in each file system."); + LOGINFO("TskImgDBSqlite::getFreeSectors - START LOOP: Find the unallocated blocks in each file system."); while(true) { int result = sqlite3_step(statement); @@ -968,8 +967,9 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const int fs_id = sqlite3_column_int(statement, 0); if (fs_id > 32) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFreeSectors - fs_id in fs_info is bigger than 32: %d", fs_id); - LOGERROR(infoMessage); + infoMessage.str(""); + infoMessage << "TskImgDBSqlite::getFreeSectors - fs_id in fs_info is bigger than 32: " << fs_id; + LOGERROR(infoMessage.str()); break; } vol_id[fs_id] = sqlite3_column_int(statement, 1); @@ -977,8 +977,8 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const blk_size[fs_id] = sqlite3_column_int(statement, 3) / 512; blk_count[fs_id] = sqlite3_column_int64(statement, 4); // Debug Info - msg.str(L""); - msg << L"TskImgDBSqlite::getFreeSectors - fs_id=" << fs_id << " vol_id=" << vol_id[fs_id] << " img_offset=" << img_offset[fs_id] << " blk_size=" << blk_size[fs_id] << + msg.str(""); + msg << "TskImgDBSqlite::getFreeSectors - fs_id=" << fs_id << " vol_id=" << vol_id[fs_id] << " img_offset=" << img_offset[fs_id] << " blk_size=" << blk_size[fs_id] << " blk_count=" << blk_count[fs_id]; LOGINFO(msg.str().c_str()); } @@ -988,12 +988,13 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const } } sqlite3_finalize(statement); - LOGINFO(L"TskImgDBSqlite::getFreeSectors - DONE: Find the unallocated blocks in each file system."); + LOGINFO("TskImgDBSqlite::getFreeSectors - DONE: Find the unallocated blocks in each file system."); } else { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFreeSectors - Error querying fs_info table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + infoMessage.str(""); + infoMessage << "TskImgDBSqlite::getFreeSectors - Error querying fs_info table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return NULL; } @@ -1003,14 +1004,15 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const memset(seen, 0, 32*sizeof(TSK_LIST *)); if (sqlite3_prepare_v2(m_db, "SELECT fs_id, file_id, blk_start, blk_len FROM fs_blocks;", -1, &statement, 0) == SQLITE_OK) { - LOGINFO(L"TskImgDBSqlite::getFreeSectors - START LOOP: see what blocks have been used and add them to a list."); + LOGINFO("TskImgDBSqlite::getFreeSectors - START LOOP: see what blocks have been used and add them to a list."); while(true) { int result = sqlite3_step(statement); if (result == SQLITE_ROW) { int fs_id = sqlite3_column_int(statement, 0); if (fs_id > 32) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFreeSectors - fs_id in fs_info is bigger than 32: %d", fs_id); - LOGERROR(infoMessage); + infoMessage.str(""); + infoMessage << "TskImgDBSqlite::getFreeSectors - fs_id in fs_info is bigger than 32: " << fs_id; + LOGERROR(infoMessage.str()); continue; } uint64_t file_id = (uint64_t)sqlite3_column_int64(statement, 1); @@ -1018,13 +1020,14 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const int64_t len = sqlite3_column_int64(statement, 3); // We only want to consider the runs for files that we allocated. - char stmt[1024]; - _snprintf_s(stmt, 1024, _TRUNCATE, "SELECT meta_flags from files WHERE file_id=%d;", file_id); + std::stringstream stmt; + stmt << "SELECT meta_flags from files WHERE file_id=" << file_id; sqlite3_stmt * statement2; - if (sqlite3_prepare_v2(m_db, stmt, -1, &statement2, 0) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFreeSectors - error finding flags for file %lld", file_id); - LOGERROR(infoMessage); + if (sqlite3_prepare_v2(m_db, stmt.str().c_str(), -1, &statement2, 0) != SQLITE_OK) { + infoMessage.str(""); + infoMessage << "TskImgDBSqlite::getFreeSectors - error finding flags for file " << file_id; + LOGERROR(infoMessage.str()); continue; } sqlite3_step(statement2); @@ -1038,8 +1041,9 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const int error = 0; for (int64_t i = 0; i < len; i++) { if (tsk_list_add(&seen[fs_id], addr+i)) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFreeSectors - Error adding seen block address to list"); - LOGERROR(infoMessage); + infoMessage.str(""); + infoMessage << "TskImgDBSqlite::getFreeSectors - Error adding seen block address to list"; + LOGERROR(infoMessage.str()); error = 1; break; @@ -1053,17 +1057,18 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const } } sqlite3_finalize(statement); - LOGINFO(L"TskImgDBSqlite::getFreeSectors - DONE: see what blocks have been used and add them to a list."); + LOGINFO("TskImgDBSqlite::getFreeSectors - DONE: see what blocks have been used and add them to a list."); } else { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFreeSectors - Error querying fs_block table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + infoMessage.str(""); + infoMessage << "TskImgDBSqlite::getFreeSectors - Error querying fs_block table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return NULL; } // cycle through each file system to find the unused blocks - LOGINFO(L"TskImgDBSqlite::getFreeSectors - START LOOP: cycle through each file system to find the unused blocks."); + LOGINFO("TskImgDBSqlite::getFreeSectors - START LOOP: cycle through each file system to find the unused blocks."); for (int f = 0; f < 32; f++) { if (blk_count[f] == 0) continue; @@ -1072,8 +1077,8 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const int len = 0; // we previously adjusted blk_size and img_offset to be in sectors - msg.str(L""); - msg << L"blk_count[" << f << "]=" << blk_count[f]; + msg.str(""); + msg << "blk_count[" << f << "]=" << blk_count[f]; LOGINFO(msg.str().c_str()); for (uint64_t a = 0; a < blk_count[f]; a++) { @@ -1106,7 +1111,7 @@ SectorRuns * TskImgDBSqlite::getFreeSectors() const tsk_list_free(seen[f]); seen[f] = NULL; } - LOGINFO(L"TskImgDBSqlite::getFreeSectors - DONE: cycle through each file system to find the unused blocks."); + LOGINFO("TskImgDBSqlite::getFreeSectors - DONE: cycle through each file system to find the unused blocks."); return sr; } @@ -1129,7 +1134,7 @@ std::string TskImgDBSqlite::getImageBaseName() const } } -std::vector<std::wstring> TskImgDBSqlite::getImageNames() const +std::vector<std::wstring> TskImgDBSqlite::getImageNamesW() const { std::vector<std::wstring> imgList; @@ -1158,6 +1163,39 @@ std::vector<std::wstring> TskImgDBSqlite::getImageNames() const return imgList; } + +std::vector<std::string> TskImgDBSqlite::getImageNames() const +{ + std::vector<std::string> imgList; + + if (!m_db) + return imgList; + + sqlite3_stmt *statement; + + if (sqlite3_prepare_v2(m_db, "SELECT name FROM image_names ORDER BY seq;", + -1, &statement, 0) == SQLITE_OK) + { + while(true) + { + int result = sqlite3_step(statement); + if (result == SQLITE_ROW) { + imgList.push_back((char *)sqlite3_column_text(statement, 0)); + } + else { + break; + } + } + + sqlite3_finalize(statement); + } + + return imgList; +} + + + + /** * @param a_fileId File id to get information about * @param a_fsOffset Byte offset of start of file system that the file is located in @@ -1172,13 +1210,12 @@ int TskImgDBSqlite::getFileUniqueIdentifiers(uint64_t a_fileId, uint64_t &a_fsOf return -1; sqlite3_stmt * statement; - char stmt[MAX_BUFF_LENGTH]; + std::stringstream stmt; - _snprintf_s(stmt, MAX_BUFF_LENGTH, MAX_BUFF_LENGTH, + stmt << "SELECT fs_file_id, attr_type, attr_id, fs_info.img_byte_offset " - "FROM fs_files, fs_info WHERE file_id=%llu AND fs_info.fs_id = fs_files.fs_id;", - a_fileId); - if (sqlite3_prepare_v2(m_db, stmt, -1, &statement, 0) == SQLITE_OK) { + "FROM fs_files, fs_info WHERE file_id=" << a_fileId << " AND fs_info.fs_id = fs_files.fs_id;"; + if (sqlite3_prepare_v2(m_db, stmt.str().c_str(), -1, &statement, 0) == SQLITE_OK) { int result = sqlite3_step(statement); if (result == SQLITE_ROW) { a_fsFileId = sqlite3_column_int64(statement, 0); @@ -1192,10 +1229,9 @@ int TskImgDBSqlite::getFileUniqueIdentifiers(uint64_t a_fileId, uint64_t &a_fsOf sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFileUniqueIdentifiers - " - L"Error querying fs_files table : ", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getFileUniqueIdentifiers - Error querying fs_files table : " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return -1; } @@ -1257,12 +1293,11 @@ int TskImgDBSqlite::getSessionID() const return 0; sqlite3_stmt * statement; - char stmt[1024]; - int sessionId; - _snprintf_s(stmt, 1024, _TRUNCATE, "SELECT version from db_info WHERE name=%s;", "\"SID\""); + std::string stmt("SELECT version from db_info WHERE name=\"SID\";"); + int sessionId = -1; /********** FIND the unallocated volumes *************/ - if (sqlite3_prepare_v2(m_db, stmt, -1, &statement, 0) == SQLITE_OK) { + if (sqlite3_prepare_v2(m_db, stmt.c_str(), -1, &statement, 0) == SQLITE_OK) { int result = sqlite3_step(statement); if (result == SQLITE_ROW) { sessionId = (int)sqlite3_column_int(statement, 0); @@ -1270,9 +1305,9 @@ int TskImgDBSqlite::getSessionID() const sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getSessionID - Error querying db_info table for Session ID: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getSessionID - Error querying db_info table for Session ID: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return -1; } @@ -1286,9 +1321,9 @@ int TskImgDBSqlite::begin() return 1; if (sqlite3_exec(m_db, "BEGIN", NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::begin - BEGIN Error: %S", errmsg); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::begin - BEGIN Error: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -1303,9 +1338,9 @@ int TskImgDBSqlite::commit() return 1; if (sqlite3_exec(m_db, "COMMIT", NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::commit - COMMIT Error: %S", errmsg); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::commit - COMMIT Error: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; @@ -1315,22 +1350,22 @@ int TskImgDBSqlite::commit() UnallocRun * TskImgDBSqlite::getUnallocRun(int a_unalloc_img_id, int a_file_offset) const { - char stmt[1024]; + std::stringstream stmt; char * errmsg; if (!m_db) return NULL; - _snprintf_s(stmt, 1024, _TRUNCATE, "SELECT vol_id, unalloc_img_sect_start, sect_len, orig_img_sect_start FROM " - "alloc_unalloc_map WHERE unalloc_img_id = %d AND unalloc_img_sect_start <= %d ORDER BY unalloc_img_sect_start DESC", - a_unalloc_img_id, a_file_offset); + stmt << "SELECT vol_id, unalloc_img_sect_start, sect_len, orig_img_sect_start FROM " + "alloc_unalloc_map WHERE unalloc_img_id = " << a_unalloc_img_id << + " AND unalloc_img_sect_start <= " << a_file_offset << " ORDER BY unalloc_img_sect_start DESC"; + char **result; int nrow, ncol; - if (sqlite3_get_table(m_db, stmt, &result, &nrow, &ncol, &errmsg) != SQLITE_OK) + if (sqlite3_get_table(m_db, stmt.str().c_str(), &result, &nrow, &ncol, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getUnallocRun - Error fetching data from alloc_unalloc_map table: %S", errmsg); - - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getUnallocRun - Error fetching data from alloc_unalloc_map table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); @@ -1344,10 +1379,10 @@ UnallocRun * TskImgDBSqlite::getUnallocRun(int a_unalloc_img_id, int a_file_offs int orig_img_sect_start; // skip the headers // @@@ DO SOME ERROR CHECKING HERE to make sure that results has data... - sscanf_s(result[4], "%d", &vol_id); - sscanf_s(result[5], "%d", &unalloc_img_sect_start); - sscanf_s(result[6], "%d", §_len); - sscanf_s(result[7], "%d", &orig_img_sect_start); + sscanf(result[4], "%d", &vol_id); + sscanf(result[5], "%d", &unalloc_img_sect_start); + sscanf(result[6], "%d", §_len); + sscanf(result[7], "%d", &orig_img_sect_start); sqlite3_free_table(result); return new UnallocRun(vol_id, a_unalloc_img_id, unalloc_img_sect_start, sect_len, orig_img_sect_start); } @@ -1366,29 +1401,28 @@ UnallocRun * TskImgDBSqlite::getUnallocRun(int a_unalloc_img_id, int a_file_offs * @param fileId Carved file Id (output) * @returns 0 on success or -1 on error. */ -int TskImgDBSqlite::addCarvedFileInfo(int vol_id, wchar_t * name, uint64_t size, +int TskImgDBSqlite::addCarvedFileInfo(int vol_id, const char *name, uint64_t size, uint64_t *runStarts, uint64_t *runLengths, int numRuns, uint64_t & fileId) { char stmt[1024]; - std::string utf8Name; char * errmsg; - wchar_t infoMessage[MAX_BUFF_LENGTH]; + std::wstringstream infoMessage; + if (!m_db) return -1; - Poco::UnicodeConverter::toUTF8(name, utf8Name); // needed for sqlite3_sprintf // insert into files table sqlite3_snprintf(1024, stmt, "INSERT INTO files (file_id, type_id, name, par_file_id, dir_type, meta_type," "dir_flags, meta_flags, size, ctime, crtime, atime, mtime, mode, uid, gid, status, full_path) " "VALUES (NULL, %d, '%q', NULL, %d, %d, %d, %d, %llu, 0, 0, 0, 0, NULL, NULL, NULL, %d, '%q')", - IMGDB_FILES_TYPE_CARVED, utf8Name.c_str(), (int)TSK_FS_NAME_TYPE_REG, (int)TSK_FS_META_TYPE_REG, - (int)TSK_FS_NAME_FLAG_UNALLOC, (int)TSK_FS_META_FLAG_UNALLOC, size, IMGDB_FILES_STATUS_CREATED, utf8Name.c_str()); + IMGDB_FILES_TYPE_CARVED, name, (int)TSK_FS_NAME_TYPE_REG, (int)TSK_FS_META_TYPE_REG, + (int)TSK_FS_NAME_FLAG_UNALLOC, (int)TSK_FS_META_FLAG_UNALLOC, size, IMGDB_FILES_STATUS_CREATED, name); // MAY-118 NOTE: addCarvedFileInfo insert entry into files table, but actual file on disk has not been created yet. if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addCarvedFileInfo - Error adding data to file table for carved file: %S %S", errmsg, stmt); + infoMessage << L"TskImgDBSqlite::addCarvedFileInfo - Error adding data to file table for carved file: " << errmsg << L" " << stmt; - LOGERROR(infoMessage); + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return -1; @@ -1398,12 +1432,12 @@ int TskImgDBSqlite::addCarvedFileInfo(int vol_id, wchar_t * name, uint64_t size, fileId = (uint64_t)sqlite3_last_insert_rowid(m_db); // insert into the carved_files_table - _snprintf_s(stmt, 1024, _TRUNCATE, "INSERT INTO carved_files (file_id, vol_id)" + sqlite3_snprintf(1024, stmt, "INSERT INTO carved_files (file_id, vol_id)" "VALUES (%llu, %d)", fileId, vol_id); if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addCarvedFileInfo - Error adding data to carved_files table: %S", errmsg); + infoMessage << L"TskImgDBSqlite::addCarvedFileInfo - Error adding data to carved_files table: " << errmsg; - LOGERROR(infoMessage); + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return -1; } @@ -1411,14 +1445,14 @@ int TskImgDBSqlite::addCarvedFileInfo(int vol_id, wchar_t * name, uint64_t size, // insert into carved_sectors table for (int i = 0; i < numRuns; i++) { - _snprintf_s(stmt, 1024, _TRUNCATE, + sqlite3_snprintf(1023, stmt, "INSERT INTO carved_sectors (file_id, seq, sect_start, sect_len) " "VALUES (%llu, %d, %llu, %llu)", fileId, i, runStarts[i], runLengths[i]); if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addCarvedFileInfo - Error adding data to carved_sectors table: %S", errmsg); + infoMessage << L"TskImgDBSqlite::addCarvedFileInfo - Error adding data to carved_sectors table: " << errmsg; - LOGERROR(infoMessage); + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return -1; @@ -1462,12 +1496,13 @@ int TskImgDBSqlite::addDerivedFileInfo(const std::string& name, const uint64_t p char * errmsg; TSK_FS_NAME_TYPE_ENUM dirType = isDirectory ? TSK_FS_NAME_TYPE_DIR : TSK_FS_NAME_TYPE_REG; + TSK_FS_META_TYPE_ENUM metaType = isDirectory ? TSK_FS_META_TYPE_DIR : TSK_FS_META_TYPE_REG; // insert into files table sqlite3_snprintf(1024, stmt, - "INSERT INTO files (file_id, type_id, name, par_file_id, dir_type, size, ctime, crtime, atime, mtime, status, full_path) " - "VALUES (NULL, %d, '%q', %llu, %d, %llu, %d, %d, %d, %d, %d, '%q')", - IMGDB_FILES_TYPE_DERIVED, name.c_str(), parentId, dirType, size, ctime, crtime, atime, mtime, IMGDB_FILES_STATUS_CREATED, path.c_str()); + "INSERT INTO files (file_id, type_id, name, par_file_id, dir_type, meta_type, size, ctime, crtime, atime, mtime, status, full_path) " + "VALUES (NULL, %d, '%q', %llu, %d, %d, %llu, %d, %d, %d, %d, %d, '%q')", + IMGDB_FILES_TYPE_DERIVED, name.c_str(), parentId, dirType, metaType, size, ctime, crtime, atime, mtime, IMGDB_FILES_STATUS_CREATED, path.c_str()); if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { @@ -1514,21 +1549,18 @@ int TskImgDBSqlite::getFileIds(char *a_fileName, uint64_t *a_outBuffer, int a_bu int outIdx = 0; sqlite3_stmt * statement; - char stmt[MAX_BUFF_LENGTH]; - _snprintf_s(stmt, MAX_BUFF_LENGTH, MAX_BUFF_LENGTH, - "SELECT file_id FROM files WHERE name LIKE '%s';", - a_fileName); - if (sqlite3_prepare_v2(m_db, stmt, -1, &statement, 0) == SQLITE_OK) { + std::stringstream stmt; + stmt << "SELECT file_id FROM files WHERE name LIKE '" << a_fileName << "';"; + if (sqlite3_prepare_v2(m_db, stmt.str().c_str(), -1, &statement, 0) == SQLITE_OK) { while(sqlite3_step(statement) == SQLITE_ROW) { a_outBuffer[outIdx++] = (uint64_t)sqlite3_column_int64(statement, 0); } sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFileIds - " - L"Error querying files table : %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getFileIds - Error querying files table : " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return -1; } @@ -1547,10 +1579,10 @@ int TskImgDBSqlite::getMinFileIdReadyForAnalysis(uint64_t & minFileId) const minFileId = 0; sqlite3_stmt * statement; - char stmt[MAX_BUFF_LENGTH]; - _snprintf_s(stmt, MAX_BUFF_LENGTH, MAX_BUFF_LENGTH, - "SELECT min(file_id) FROM files WHERE status = %d;", TskImgDB::IMGDB_FILES_STATUS_READY_FOR_ANALYSIS); - if (sqlite3_prepare_v2(m_db, stmt, -1, &statement, 0) == SQLITE_OK) { + std::stringstream stmt; + stmt << "SELECT min(file_id) FROM files WHERE status = " << + TskImgDB::IMGDB_FILES_STATUS_READY_FOR_ANALYSIS << ";"; + if (sqlite3_prepare_v2(m_db, stmt.str().c_str(), -1, &statement, 0) == SQLITE_OK) { int result = sqlite3_step(statement); if (result == SQLITE_ROW) { minFileId = (uint64_t)sqlite3_column_int64(statement, 0); @@ -1558,10 +1590,9 @@ int TskImgDBSqlite::getMinFileIdReadyForAnalysis(uint64_t & minFileId) const sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getMinFileIdReadyForAnalysis - " - L"Error querying files table : %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getMinFileIdReadyForAnalysis - Error querying files table : " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return -1; } return 0; @@ -1579,10 +1610,11 @@ int TskImgDBSqlite::getMaxFileIdReadyForAnalysis(uint64_t a_lastFileId, uint64_t maxFileId = 0; sqlite3_stmt * statement; - char stmt[MAX_BUFF_LENGTH]; - _snprintf_s(stmt, MAX_BUFF_LENGTH, MAX_BUFF_LENGTH, - "SELECT max(file_id) FROM files WHERE status = %d AND file_id >= %d;", TskImgDB::IMGDB_FILES_STATUS_READY_FOR_ANALYSIS, a_lastFileId); - if (sqlite3_prepare_v2(m_db, stmt, -1, &statement, 0) == SQLITE_OK) { + std::stringstream stmt; + stmt << "SELECT max(file_id) FROM files WHERE status = " << + TskImgDB::IMGDB_FILES_STATUS_READY_FOR_ANALYSIS << + " AND file_id >= " << a_lastFileId << ";"; + if (sqlite3_prepare_v2(m_db, stmt.str().c_str(), -1, &statement, 0) == SQLITE_OK) { int result = sqlite3_step(statement); if (result == SQLITE_ROW) { maxFileId = (uint64_t)sqlite3_column_int64(statement, 0); @@ -1590,10 +1622,9 @@ int TskImgDBSqlite::getMaxFileIdReadyForAnalysis(uint64_t a_lastFileId, uint64_t sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getMaxFileIdReadyForAnalysis - " - L"Error querying files table : %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getMaxFileIdReadyForAnalysis - Error querying files table : " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return -1; } return 0; @@ -1607,19 +1638,18 @@ SectorRuns * TskImgDBSqlite::getFileSectors(uint64_t a_fileId) const SectorRuns * sr = new SectorRuns(); sqlite3_stmt * statement; - char stmt[MAX_BUFF_LENGTH]; + std::stringstream stmt; int srCount = 0; - _snprintf_s(stmt, MAX_BUFF_LENGTH, MAX_BUFF_LENGTH, + stmt << "SELECT fs_blocks.blk_start, fs_blocks.blk_len, " "fs_info.block_size, fs_info.img_byte_offset, fs_info.vol_id " "FROM files " "JOIN fs_files ON files.file_id = fs_files.file_id " "JOIN fs_blocks ON files.file_id = fs_blocks.file_id " "JOIN fs_info ON fs_blocks.fs_id = fs_info.fs_id " - "WHERE files.file_id = %u " - "ORDER BY fs_blocks.seq;", - a_fileId); - if (sqlite3_prepare_v2(m_db, stmt, -1, &statement, 0) == SQLITE_OK) { + "WHERE files.file_id = " << a_fileId << " " + "ORDER BY fs_blocks.seq;"; + if (sqlite3_prepare_v2(m_db, stmt.str().c_str(), -1, &statement, 0) == SQLITE_OK) { while(sqlite3_step(statement) == SQLITE_ROW) { uint64_t blkStart = (uint64_t)sqlite3_column_int64(statement, 0); uint64_t blkLength = (uint64_t)sqlite3_column_int64(statement, 1); @@ -1637,13 +1667,11 @@ SectorRuns * TskImgDBSqlite::getFileSectors(uint64_t a_fileId) const sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getFileSectors - " - L"Error finding block data for file_id=%u: %S", - a_fileId, - sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + L"Error finding block data for file_id=" << a_fileId << ": " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return NULL; } @@ -1671,7 +1699,7 @@ int TskImgDBSqlite::busyHandler(void * pDB, int count) { if (count < IMGDB_MAX_RETRY_COUNT) { - Sleep(IMGDB_RETRY_WAIT * count); + Poco::Thread::sleep(IMGDB_RETRY_WAIT * count); return 1; } @@ -1685,16 +1713,14 @@ int TskImgDBSqlite::updateFileStatus(uint64_t a_file_id, FILE_STATUS a_status) if (!m_db) return 1; - char stmt[MAX_BUFF_LENGTH]; + std::stringstream stmt; char * errmsg; - _snprintf_s(stmt, MAX_BUFF_LENGTH, MAX_BUFF_LENGTH, - "UPDATE files SET status = %d WHERE file_id = %d;", a_status, a_file_id); - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::updateFileStatus - Error UPDATE file status: %S", - sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + stmt << "UPDATE files SET status = " << a_status << " WHERE file_id = " << a_file_id << ";"; + if (sqlite3_exec(m_db, stmt.str().c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::updateFileStatus - Error UPDATE file status: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return 1; } @@ -1707,16 +1733,14 @@ int TskImgDBSqlite::updateKnownStatus(uint64_t a_file_id, KNOWN_STATUS a_status) if (!m_db) return 1; - char stmt[MAX_BUFF_LENGTH]; + std::stringstream stmt; char * errmsg; - _snprintf_s(stmt, MAX_BUFF_LENGTH, MAX_BUFF_LENGTH, - "UPDATE file_hashes SET known = %d WHERE file_id = %d;", a_status, a_file_id); - if (sqlite3_exec(m_db, stmt, NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::updateFileStatus - Error UPDATE file status: %S", - sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + stmt << "UPDATE file_hashes SET known = " << a_status << " WHERE file_id = " << a_file_id << ";"; + if (sqlite3_exec(m_db, stmt.str().c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::updateFileStatus - Error UPDATE file status: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return 1; } @@ -1782,7 +1806,7 @@ std::map<uint64_t, std::string> TskImgDBSqlite::getUniqueCarvedFiles(HASH_TYPE h break; default: std::wstringstream msg; - msg << L"TskImgDBSqlite::getUniqueCarvedFiles - Unsupported hashType : " << hashType << std::endl; + msg << L"TskImgDBSqlite::getUniqueCarvedFiles - Unsupported hashType : " << hashType; LOGERROR(msg.str()); return results; } @@ -1812,9 +1836,9 @@ std::map<uint64_t, std::string> TskImgDBSqlite::getUniqueCarvedFiles(HASH_TYPE h sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getUniqueCarvedFiles - Error getting file_hashes count: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getUniqueCarvedFiles - Error getting file_hashes count: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } stmt.str(""); @@ -2016,9 +2040,9 @@ std::vector<uint64_t> TskImgDBSqlite::getUniqueFileIds(HASH_TYPE hashType) const } sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getUniqueFileIds - Error querying file_hashes table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getUniqueFileIds - Error querying file_hashes table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } return results; } @@ -2050,9 +2074,10 @@ std::vector<uint64_t> TskImgDBSqlite::getFileIdsWorker(std::string tableName, co } sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFileIdsWorker - Error getting file ids from table %s, %S", tableName.c_str(), sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getFileIdsWorker - Error getting file ids from table " << + tableName.c_str() << ", " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } return results; } @@ -2067,7 +2092,7 @@ std::vector<uint64_t> TskImgDBSqlite::getFileIdsWorker(std::string tableName, co * @returns The collection of file ids matching the selection criteria. Throws * TskException if database not initialized. */ -std::vector<uint64_t> TskImgDBSqlite::getFileIds(std::string &condition) const +std::vector<uint64_t> TskImgDBSqlite::getFileIds(const std::string& condition) const { if (!m_db) throw TskException("Database not initialized."); @@ -2103,12 +2128,12 @@ std::vector<uint64_t> TskImgDBSqlite::getFileIds(std::string &condition) const * @returns The collection of file records matching the selection criteria. Throws * TskException if database not initialized. */ -std::vector<const TskFileRecord> TskImgDBSqlite::getFileRecords(std::string &condition) const +const std::vector<TskFileRecord> TskImgDBSqlite::getFileRecords(const std::string& condition) const { if (!m_db) throw TskException("Database not initialized."); - std::vector<const TskFileRecord> results; + std::vector<TskFileRecord> results; std::stringstream stmtstrm; @@ -2200,9 +2225,27 @@ int TskImgDBSqlite::getFileCount(std::string& condition) const return result; } +int tsk_strnicmp(const char *s1, const char *s2, size_t N) +{ + if (N == 0) + return 0; + int diff = 0; + if (s1 && s2) { + while (N-- > 0 && (diff = (toupper(*s1) - toupper(*s2))) == 0 && *s1 && *s2) { + s1++; + s2++; + } + } + else if (s1) + return +1; + else if (s2) + return -1; + return diff; +} + /* Append condition to stmt to make a single SQL query. */ -void TskImgDBSqlite::constructStmt(std::string& stmt, std::string& condition) const +void TskImgDBSqlite::constructStmt(std::string& stmt, std::string condition) const { if (!condition.empty()) { @@ -2219,10 +2262,10 @@ void TskImgDBSqlite::constructStmt(std::string& stmt, std::string& condition) co * it is presumably extending the FROM clause with * one or more table names. In this case we need to add the comma to * the statement. */ - if (strnicmp(condition.c_str(), whereClause.c_str(), whereClause.length()) != 0 && - strnicmp(condition.c_str(), joinClause.c_str(), joinClause.length()) != 0 && - strnicmp(condition.c_str(), leftClause.c_str(), leftClause.length()) != 0 && - strnicmp(condition.c_str(), orderClause.c_str(), orderClause.length()) != 0 && + if (tsk_strnicmp(condition.c_str(), whereClause.c_str(), whereClause.length()) != 0 && + tsk_strnicmp(condition.c_str(), joinClause.c_str(), joinClause.length()) != 0 && + tsk_strnicmp(condition.c_str(), leftClause.c_str(), leftClause.length()) != 0 && + tsk_strnicmp(condition.c_str(), orderClause.c_str(), orderClause.length()) != 0 && condition[0] != ',') { stmt.append(","); @@ -2262,7 +2305,6 @@ int TskImgDBSqlite::setHash(const uint64_t a_file_id, const TskImgDB::HASH_TYPE } stringstream stmt; - bool found = false; std::string md5, sha1, sha2_256, sha2_512; int known = IMGDB_FILES_UNKNOWN; std::stringstream stream; @@ -2325,9 +2367,9 @@ int TskImgDBSqlite::setHash(const uint64_t a_file_id, const TskImgDB::HASH_TYPE char *errmsg; if (sqlite3_exec(m_db, stmt.str().c_str(), NULL, NULL, &errmsg) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::setHash - Error adding hash to file_hashes table: %S", errmsg); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::setHash - Error adding hash to file_hashes table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); return 1; } @@ -2355,9 +2397,9 @@ std::string TskImgDBSqlite::getCfileName(const uint64_t a_file_id) const } sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getCfileName - Error querying tables: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getCfileName - Error querying tables: %S" << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } stmt.str(""); @@ -2372,13 +2414,13 @@ std::string TskImgDBSqlite::getCfileName(const uint64_t a_file_id) const name = (char *)sqlite3_column_text(statement, 0); } sqlite3_finalize(statement); - int pos = name.rfind('.'); + size_t pos = name.rfind('.'); if (pos != string::npos) cfileName += name.substr(pos); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getCfileName - Error querying tables: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getCfileName - Error querying tables: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } return cfileName; @@ -2410,9 +2452,9 @@ int TskImgDBSqlite::getImageInfo(int & type, int & sectorSize) const } sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getImageInfo - Error querying image_info table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getImageInfo - Error querying image_info table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return -1; } return rc; @@ -2446,9 +2488,9 @@ int TskImgDBSqlite::getVolumeInfo(std::list<TskVolumeInfoRecord> & volumeInfoLis } sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getVolumeInfo - Error getting from vol_info table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getVolumeInfo - Error getting from vol_info table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return -1; } return 0; @@ -2486,9 +2528,9 @@ int TskImgDBSqlite::getFsInfo(std::list<TskFsInfoRecord> & fsInfoList) const } sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFsInfo - Error getting from fs_info table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getFsInfo - Error getting from fs_info table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return -1; } return 0; @@ -2499,7 +2541,7 @@ typedef std::map<std::string, int> FileTypeMap_t; static std::string getFileType(const char *name) { std::string filename = name; - int pos = filename.rfind('.'); + size_t pos = filename.rfind('.'); if (pos != std::string::npos) { std::string suffix = filename.substr(pos); std::string result; @@ -2545,7 +2587,7 @@ int TskImgDBSqlite::getFileInfoSummary(FILE_TYPES fileType, std::list<TskFileTyp * @param fileTypeInfoList A list of TskFileTypeRecord (output) * @returns 0 on success of -1 on error. */ -int TskImgDBSqlite::getFileTypeRecords(std::string& stmt, std::list<TskFileTypeRecord>& fileTypeInfoList) const +int TskImgDBSqlite::getFileTypeRecords(const std::string& stmt, std::list<TskFileTypeRecord>& fileTypeInfoList) const { if (!m_db) return -1; @@ -2577,9 +2619,9 @@ int TskImgDBSqlite::getFileTypeRecords(std::string& stmt, std::list<TskFileTypeR } sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getFileTypeRecords - Error querying files table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getFileTypeRecords - Error querying files table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); return -1; } return 0; @@ -2676,9 +2718,9 @@ int TskImgDBSqlite::setModuleStatus(uint64_t file_id, int module_id, int status) if (sqlite3_exec(m_db, stmt.str().c_str(), NULL, NULL, &errmsg) == SQLITE_OK) { rc = 0; } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::setModuleStatus - Error adding data to module_status table: %S", errmsg); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::setModuleStatus - Error adding data to module_status table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); } return rc; @@ -2711,9 +2753,9 @@ int TskImgDBSqlite::getModuleInfo(std::vector<TskModuleInfo> & moduleInfoList) c sqlite3_finalize(statement); rc = 0; } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getModuleInfo - Error querying modules table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getModuleInfo - Error querying modules table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } return rc; } @@ -2747,9 +2789,9 @@ int TskImgDBSqlite::getModuleErrors(std::vector<TskModuleStatus> & moduleStatusL sqlite3_finalize(statement); rc = 0; } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getModuleErrors - Error querying module_status table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getModuleErrors - Error querying module_status table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } // Find report module errors. These have file_id = 0. stmt.str(""); @@ -2767,9 +2809,9 @@ int TskImgDBSqlite::getModuleErrors(std::vector<TskModuleStatus> & moduleStatusL sqlite3_finalize(statement); rc = 0; } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getModuleErrors - Error querying module_status table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getModuleErrors - Error querying module_status table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } return rc; } @@ -2813,9 +2855,9 @@ TskImgDB::KNOWN_STATUS TskImgDBSqlite::getKnownStatus(const uint64_t fileId) con } sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getKnownStatus - Error getting known status %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getKnownStatus - Error getting known status " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } return (KNOWN_STATUS)retval; @@ -2841,9 +2883,9 @@ int TskImgDBSqlite::addUnallocImg(int & unallocImgId) unallocImgId = (int)sqlite3_last_insert_rowid(m_db); rc = 0; } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addUnallocImg - Error adding unalloc_img_status table: %S", errmsg); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addUnallocImg - Error adding unalloc_img_status table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); } return rc; @@ -2868,9 +2910,9 @@ int TskImgDBSqlite::setUnallocImgStatus(int unallocImgId, TskImgDB::UNALLOC_IMG_ if (sqlite3_exec(m_db, stmt.str().c_str(), NULL, NULL, &errmsg) == SQLITE_OK) { rc = 0; } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addUnallocImg - Error adding unalloc_img_status table: %S", errmsg); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addUnallocImg - Error adding unalloc_img_status table: " << errmsg; + LOGERROR(infoMessage.str()); sqlite3_free(errmsg); } return rc; @@ -2887,7 +2929,7 @@ TskImgDB::UNALLOC_IMG_STATUS TskImgDBSqlite::getUnallocImgStatus(int unallocImgI if (!m_db) throw TskException("Database not initialized."); - int status; + int status = 0; stringstream stmt; stmt << "SELECT status FROM unalloc_img_status WHERE unalloc_img_id = " << unallocImgId; @@ -2898,9 +2940,9 @@ TskImgDB::UNALLOC_IMG_STATUS TskImgDBSqlite::getUnallocImgStatus(int unallocImgI } sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getUnallocImgStatus - Error getting unalloc_img_status: %S ", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getUnallocImgStatus - Error getting unalloc_img_status: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } return (TskImgDB::UNALLOC_IMG_STATUS)status; } @@ -2932,9 +2974,9 @@ int TskImgDBSqlite::getAllUnallocImgStatus(std::vector<TskUnallocImgStatusRecord rc = 0; sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::getAllUnallocImgStatus - Error getting unalloc_img_status: %S ", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::getAllUnallocImgStatus - Error getting unalloc_img_status: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } return rc; } @@ -3005,15 +3047,15 @@ int TskImgDBSqlite::addUnusedSectors(int unallocImgId, std::vector<TskUnusedSect sqlite3_finalize(statement); } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addUnusedSectors - Error querying carved_files, carved_sectors table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addUnusedSectors - Error querying carved_files, carved_sectors table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } } } else { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addUnusedSectors - Error querying alloc_unalloc_map table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addUnusedSectors - Error querying alloc_unalloc_map table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); } return 0; } @@ -3034,7 +3076,6 @@ int TskImgDBSqlite::addUnusedSector(uint64_t sectStart, uint64_t sectEnd, int vo if (!m_db) return rc; - char *ufilename = "ufile"; std::stringstream stmt; std::string maxUnused = GetSystemProperty("MAX_UNUSED_FILE_SIZE_BYTES"); @@ -3075,9 +3116,9 @@ int TskImgDBSqlite::addUnusedSector(uint64_t sectStart, uint64_t sectEnd, int vo sqlite3_free(item); if (sqlite3_exec(m_db, stmt.str().c_str(), NULL, NULL, NULL) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addUnusedSector - Error update into files table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addUnusedSector - Error update into files table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); rc = -1; break; } @@ -3087,9 +3128,9 @@ int TskImgDBSqlite::addUnusedSector(uint64_t sectStart, uint64_t sectEnd, int vo << record.fileId << ", " << record.sectStart << ", " << record.sectLen << ", " << volId << ")"; if (sqlite3_exec(m_db, stmt.str().c_str(), NULL, NULL, NULL) != SQLITE_OK) { - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addUnusedSector - Error insert into unused_sectors table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addUnusedSector - Error insert into unused_sectors table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); rc = -1; break; } @@ -3098,10 +3139,9 @@ int TskImgDBSqlite::addUnusedSector(uint64_t sectStart, uint64_t sectEnd, int vo rc = 0; } else { - - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addUnusedSector - Error insert into files table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addUnusedSector - Error insert into files table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); rc = -1; break; } @@ -3152,11 +3192,11 @@ int TskImgDBSqlite::getUnusedSector(uint64_t fileId, TskUnusedSectorsRecord & un * Add the given blackboard attribute to the database * @param attr input attribute. should be fully populated */ -void TskImgDBSqlite::addBlackboardAttribute(TskBlackboardAttribute attr){ +void TskImgDBSqlite::addBlackboardAttribute(TskBlackboardAttribute attr) +{ if (!m_db) throw TskException("No database."); - artifact_t artifactId = 0; std::stringstream str; char *item; sqlite3_stmt * statement; @@ -3454,11 +3494,11 @@ string TskImgDBSqlite::getAttributeTypeName(int attributeTypeID){ * @param condition The SQL select where clause that should be used in the query. * @returns vector of matching artifacts */ -vector<TskBlackboardArtifact> TskImgDBSqlite::getMatchingArtifacts(string condition){ +vector<TskBlackboardArtifact> TskImgDBSqlite::getMatchingArtifacts(string condition) +{ if (!m_db) throw TskException("No database."); - int result = 0; vector<TskBlackboardArtifact> artifacts; std::string stmt("SELECT blackboard_artifacts.artifact_id, blackboard_artifacts.obj_id, blackboard_artifacts.artifact_type_id FROM blackboard_artifacts"); @@ -3489,11 +3529,11 @@ vector<TskBlackboardArtifact> TskImgDBSqlite::getMatchingArtifacts(string condit * @param condition where clause to use for matching * @returns vector of matching attributes */ -vector<TskBlackboardAttribute> TskImgDBSqlite::getMatchingAttributes(string condition){ +vector<TskBlackboardAttribute> TskImgDBSqlite::getMatchingAttributes(string condition) +{ if (!m_db) throw TskException("No database."); - int result = 0; vector<TskBlackboardAttribute> attributes; std::string stmt("SELECT blackboard_attributes.artifact_id, blackboard_attributes.source, blackboard_attributes.context, blackboard_attributes.attribute_type_id, blackboard_attributes.value_type, blackboard_attributes.value_byte, blackboard_attributes.value_text, blackboard_attributes.value_int32, blackboard_attributes.value_int64, blackboard_attributes.value_double, blackboard_attributes.obj_id FROM blackboard_attributes "); @@ -3517,8 +3557,7 @@ vector<TskBlackboardAttribute> TskImgDBSqlite::getMatchingAttributes(string cond sqlite3_column_int64(statement, 8), sqlite3_column_double(statement, 9), std::string((char *)sqlite3_column_text(statement, 6)), bytes)); } sqlite3_finalize(statement); - } else - { + } else { std::wstringstream msg; msg << L"TskImgDBSqlite::getMatchingAttributes - Error getting attributes: " << sqlite3_errmsg(m_db); LOGERROR(msg.str()); @@ -3533,7 +3572,8 @@ vector<TskBlackboardAttribute> TskImgDBSqlite::getMatchingAttributes(string cond * @param file_id associated file id * @returns the new artifact */ -TskBlackboardArtifact TskImgDBSqlite::createBlackboardArtifact(uint64_t file_id, int artifactTypeID){ +TskBlackboardArtifact TskImgDBSqlite::createBlackboardArtifact(uint64_t file_id, int artifactTypeID) +{ if (!m_db) throw TskException("No database."); @@ -3544,7 +3584,7 @@ TskBlackboardArtifact TskImgDBSqlite::createBlackboardArtifact(uint64_t file_id, str << "INSERT INTO blackboard_artifacts (artifact_id, obj_id, artifact_type_id) VALUES (NULL, " << file_id << ", " << artifactTypeID << ")"; if (sqlite3_prepare_v2(m_db, str.str().c_str(), -1, &statement, 0) == SQLITE_OK) { - if(!(sqlite3_step(statement) == SQLITE_DONE)){ + if (!(sqlite3_step(statement) == SQLITE_DONE)) { sqlite3_finalize(statement); throw TskException("TskImgDBSqlite::addBlackboardInfo - Insert failed"); } @@ -3579,7 +3619,8 @@ TskBlackboardArtifact TskImgDBSqlite::createBlackboardArtifact(uint64_t file_id, * @param displayName display name * @param typeID type id */ -void TskImgDBSqlite::addArtifactType(int typeID, string artifactTypeName, string displayName){ +void TskImgDBSqlite::addArtifactType(int typeID, string artifactTypeName, string displayName) +{ if (!m_db) throw TskException("No database."); @@ -3589,12 +3630,12 @@ void TskImgDBSqlite::addArtifactType(int typeID, string artifactTypeName, string str << "SELECT * FROM blackboard_artifact_types WHERE type_name = '" << artifactTypeName << "'"; if (sqlite3_prepare_v2(m_db, str.str().c_str(), -1, &statement, 0) == SQLITE_OK) { - if(!(sqlite3_step(statement) == SQLITE_ROW)){ + if (!(sqlite3_step(statement) == SQLITE_ROW)) { sqlite3_finalize(statement); str.str(""); str << "INSERT INTO blackboard_artifact_types (artifact_type_id, type_name, display_name) VALUES (" << typeID << " , '" << artifactTypeName << "', '" << displayName << "')"; if (sqlite3_prepare_v2(m_db, str.str().c_str(), -1, &statement, 0) == SQLITE_OK) { - if(!(sqlite3_step(statement) == SQLITE_DONE)){ + if (!(sqlite3_step(statement) == SQLITE_DONE)) { sqlite3_finalize(statement); std::wstringstream infoMessage; infoMessage << L"TskImgDBSqlite::addArtifactType - Error adding data to blackboard table: " << sqlite3_errmsg(m_db); @@ -3622,7 +3663,8 @@ void TskImgDBSqlite::addArtifactType(int typeID, string artifactTypeName, string * @param displayName display name * @param typeID type id */ -void TskImgDBSqlite::addAttributeType(int typeID, string attributeTypeName, string displayName){ +void TskImgDBSqlite::addAttributeType(int typeID, string attributeTypeName, string displayName) +{ if (!m_db) throw TskException("No database."); @@ -3632,22 +3674,20 @@ void TskImgDBSqlite::addAttributeType(int typeID, string attributeTypeName, stri str << "SELECT * FROM blackboard_attribute_types WHERE type_name = '" << attributeTypeName << "'"; if (sqlite3_prepare_v2(m_db, str.str().c_str(), -1, &statement, 0) == SQLITE_OK) { - if(!(sqlite3_step(statement) == SQLITE_ROW)){ + if (!(sqlite3_step(statement) == SQLITE_ROW)) { sqlite3_finalize(statement); str.str(""); str << "INSERT INTO blackboard_attribute_types (attribute_type_id, type_name, display_name) VALUES (" << typeID << " , '" << attributeTypeName << "', '" << displayName << "')"; if (sqlite3_prepare_v2(m_db, str.str().c_str(), -1, &statement, 0) == SQLITE_OK) { - if(!(sqlite3_step(statement) == SQLITE_DONE)){ + if (!(sqlite3_step(statement) == SQLITE_DONE)) { sqlite3_finalize(statement); - wchar_t infoMessage[MAX_BUFF_LENGTH]; - _snwprintf_s(infoMessage, MAX_BUFF_LENGTH, L"TskImgDBSqlite::addAttributeType - Error adding data to blackboard table: %S", sqlite3_errmsg(m_db)); - LOGERROR(infoMessage); + std::wstringstream infoMessage; + infoMessage << L"TskImgDBSqlite::addAttributeType - Error adding data to blackboard table: " << sqlite3_errmsg(m_db); + LOGERROR(infoMessage.str()); throw TskException("TskImgDBSqlite::addAttributeType - Attribute type insert failed"); } } - - } - else{ + } else { sqlite3_finalize(statement); throw TskException("TskImgDBSqlite::addAttributeType - Attribute type with that name already exists"); } @@ -3666,11 +3706,11 @@ void TskImgDBSqlite::addAttributeType(int typeID, string attributeTypeName, stri * @param artifactTypeName type name * @param file_id file id */ -vector<TskBlackboardArtifact> TskImgDBSqlite::getArtifactsHelper(uint64_t file_id, int artifactTypeID, string artifactTypeName){ +vector<TskBlackboardArtifact> TskImgDBSqlite::getArtifactsHelper(uint64_t file_id, int artifactTypeID, string artifactTypeName) +{ if (!m_db) throw TskException("No database."); - int result = 0; vector<TskBlackboardArtifact> artifacts; std::stringstream stmt; stmt << "SELECT artifact_id, obj_id, artifact_type_id FROM blackboard_artifacts WHERE obj_id = " << file_id << " AND artifact_type_id = " << artifactTypeID; @@ -3685,8 +3725,7 @@ vector<TskBlackboardArtifact> TskImgDBSqlite::getArtifactsHelper(uint64_t file_i artifacts.push_back(TskImgDB::createArtifact(sqlite3_column_int64(statement, 0), file_id, artifactTypeID)); } sqlite3_finalize(statement); - } else - { + } else { std::wstringstream msg; msg << L"TskImgDBSqlite::getArtifactsHelper - Error getting artifacts: " << sqlite3_errmsg(m_db); LOGERROR(msg.str()); @@ -3695,11 +3734,11 @@ vector<TskBlackboardArtifact> TskImgDBSqlite::getArtifactsHelper(uint64_t file_i return artifacts; } -vector<int> TskImgDBSqlite::findAttributeTypes(int artifactTypeId){ - if(!m_db){ +vector<int> TskImgDBSqlite::findAttributeTypes(int artifactTypeId) +{ + if (!m_db) { throw TskException("No database."); } - int result = 0; vector<int> attrTypes; std::stringstream stmt; stmt << "SELECT DISTINCT(attribute_type_id) FROM blackboard_attributes JOIN blackboard_artifacts ON blackboard_attributes.artifact_id = blackboard_artifacts.artifact_id WHERE artifact_type_id = " << artifactTypeId; @@ -3714,8 +3753,7 @@ vector<int> TskImgDBSqlite::findAttributeTypes(int artifactTypeId){ attrTypes.push_back(artifactTypeID); } sqlite3_finalize(statement); - } else - { + } else { std::wstringstream msg; msg << L"TskImgDBSqlite::findAttributeTypes - Error finding attribute types: " << sqlite3_errmsg(m_db); LOGERROR(msg.str()); @@ -3727,9 +3765,9 @@ vector<int> TskImgDBSqlite::findAttributeTypes(int artifactTypeId){ std::string TskImgDBSqlite::quote(const std::string str) const { char *item = sqlite3_mprintf("%Q", str.c_str()); - std::string returnStr(item); + std::string returnStr(item); sqlite3_free(item); - return returnStr; + return returnStr; } void TskImgDBSqlite::executeStatement(const std::string &stmtToExecute, sqlite3_stmt *&statement, const std::string &caller) const @@ -3742,3 +3780,5 @@ void TskImgDBSqlite::executeStatement(const std::string &stmtToExecute, sqlite3_ throw TskException(msg.str()); } } + + diff --git a/framework/Services/TskImgDBSqlite.h b/framework/tsk/framework/services/TskImgDBSqlite.h similarity index 88% rename from framework/Services/TskImgDBSqlite.h rename to framework/tsk/framework/services/TskImgDBSqlite.h index a0d7acf43..237bc7c97 100755 --- a/framework/Services/TskImgDBSqlite.h +++ b/framework/tsk/framework/services/TskImgDBSqlite.h @@ -19,15 +19,15 @@ using namespace std; // Framework includes -#include "framework_i.h" +#include "tsk/framework/framework_i.h" #include "TskImgDB.h" -#include "Utilities/SectorRuns.h" -#include "Utilities/UnallocRun.h" +#include "tsk/framework/utilities/SectorRuns.h" +#include "tsk/framework/utilities/UnallocRun.h" #include "TskBlackboardArtifact.h" #include "TskBlackboardAttribute.h" -#include "tsk3/libtsk.h" -#include "tsk3/auto/sqlite3.h" +#include "tsk/libtsk.h" +#include "tsk/auto/sqlite3.h" /** * Implementation of TskImgDB that uses SQLite to store the data. @@ -37,7 +37,7 @@ using namespace std; class TSK_FRAMEWORK_API TskImgDBSqlite : public TskImgDB { public: - TskImgDBSqlite(const wchar_t * a_outpath); + TskImgDBSqlite(const char * a_outpath); virtual ~ TskImgDBSqlite(); virtual int initialize(); @@ -54,7 +54,8 @@ class TSK_FRAMEWORK_API TskImgDBSqlite : public TskImgDB virtual int addVolumeInfo(const TSK_VS_PART_INFO * vs_part); virtual int addFsInfo(int volId, int fsId, const TSK_FS_INFO * fs_info); virtual int addFsFileInfo(int fsId, const TSK_FS_FILE *fs_file, const char *name, int type, int idx, uint64_t & fileId, const char * path); - virtual int addCarvedFileInfo(int vol_id, wchar_t * name, uint64_t size, uint64_t *runStarts, uint64_t *runLengths, int numRuns, uint64_t & fileId); + + virtual int addCarvedFileInfo(int vol_id, const char * name, uint64_t size, uint64_t *runStarts, uint64_t *runLengths, int numRuns, uint64_t & fileId); virtual int addDerivedFileInfo(const std::string& name, const uint64_t parentId, const bool isDirectory, const uint64_t size, const std::string& details, const int ctime, const int crtime, const int atime, const int mtime, uint64_t & fileId, std::string path); @@ -68,7 +69,8 @@ class TSK_FRAMEWORK_API TskImgDBSqlite : public TskImgDB virtual int getFileRecord(const uint64_t fileId, TskFileRecord& fileRecord) const; virtual SectorRuns * getFileSectors(uint64_t fileId) const; virtual std::string getImageBaseName() const; - virtual std::vector<std::wstring> getImageNames() const; + virtual std::vector<std::wstring> getImageNamesW() const; + virtual std::vector<std::string> getImageNames() const; virtual int getFileUniqueIdentifiers(uint64_t a_fileId, uint64_t &a_fsOffset, uint64_t &a_fsFileId, int &a_attrType, int &a_attrId) const; virtual int getNumVolumes() const; virtual int getNumFiles() const; @@ -87,8 +89,8 @@ class TSK_FRAMEWORK_API TskImgDBSqlite : public TskImgDB virtual bool dbExist() const; // Get set of file ids that match the given condition (i.e. SQL where clause) - virtual std::vector<uint64_t> getFileIds(std::string& condition) const; - virtual std::vector<const TskFileRecord> getFileRecords(std::string& condition) const; + virtual std::vector<uint64_t> getFileIds(const std::string& condition) const; + virtual const std::vector<TskFileRecord> getFileRecords(const std::string& condition) const; // Get the number of files that match the given condition virtual int getFileCount(std::string& condition) const; @@ -140,18 +142,17 @@ class TSK_FRAMEWORK_API TskImgDBSqlite : public TskImgDB virtual vector<TskBlackboardAttribute> getMatchingAttributes(string condition); virtual vector<int> findAttributeTypes(int artifactTypeId); private: - wchar_t m_outPath[256]; - wchar_t m_progPath[256]; - wchar_t m_dbFilePath[256]; + char m_outPath[256]; + char m_dbFilePath[256]; sqlite3 * m_db; int dropTables(); static int busyHandler(void *, int); std::vector<uint64_t> getFileIdsWorker(std::string tableName, const std::string condition = "") const; - void constructStmt(std::string& stmt, std::string& condition) const; + void constructStmt(std::string& stmt, std::string condition) const; int addUnusedSector(uint64_t sectStart, uint64_t sectEnd, int volId, std::vector<TskUnusedSectorsRecord> & unusedSectorsList); - int getFileTypeRecords(std::string& stmt, std::list<TskFileTypeRecord>& fileTypeInfoList) const; + int getFileTypeRecords(const std::string& stmt, std::list<TskFileTypeRecord>& fileTypeInfoList) const; virtual vector<TskBlackboardArtifact> getArtifactsHelper(uint64_t file_id, int artifactTypeID, string artifactTypeName); void getCarvedFileInfo(const std::string& stmt, std::map<uint64_t, std::string>& results) const; diff --git a/framework/Services/TskSchedulerQueue.cpp b/framework/tsk/framework/services/TskSchedulerQueue.cpp similarity index 100% rename from framework/Services/TskSchedulerQueue.cpp rename to framework/tsk/framework/services/TskSchedulerQueue.cpp diff --git a/framework/Services/TskSchedulerQueue.h b/framework/tsk/framework/services/TskSchedulerQueue.h similarity index 100% rename from framework/Services/TskSchedulerQueue.h rename to framework/tsk/framework/services/TskSchedulerQueue.h diff --git a/framework/Services/TskServices.cpp b/framework/tsk/framework/services/TskServices.cpp similarity index 94% rename from framework/Services/TskServices.cpp rename to framework/tsk/framework/services/TskServices.cpp index b82d6a800..fb997cfea 100755 --- a/framework/Services/TskServices.cpp +++ b/framework/tsk/framework/services/TskServices.cpp @@ -11,8 +11,8 @@ #include <string> #include "TskServices.h" -#include "Utilities/TskException.h" -#include "Services/TskSystemPropertiesImpl.h" +#include "tsk/framework/utilities/TskException.h" +#include "tsk/framework/services/TskSystemPropertiesImpl.h" TskServices *TskServices::m_pInstance = NULL; diff --git a/framework/Services/TskServices.h b/framework/tsk/framework/services/TskServices.h similarity index 93% rename from framework/Services/TskServices.h rename to framework/tsk/framework/services/TskServices.h index ce9f64d4a..00ec69e9b 100755 --- a/framework/Services/TskServices.h +++ b/framework/tsk/framework/services/TskServices.h @@ -14,10 +14,10 @@ #include "Log.h" #include "Scheduler.h" #include "TskImgDB.h" -#include "Extraction/TskImageFile.h" -#include "Services/TskBlackboard.h" -#include "Services/TskSystemProperties.h" -#include "File/TskFileManager.h" +#include "tsk/framework/extraction/TskImageFile.h" +#include "tsk/framework/services/TskBlackboard.h" +#include "tsk/framework/services/TskSystemProperties.h" +#include "tsk/framework/file/TskFileManager.h" /** * Provides singleton access to many framework services. This is used diff --git a/framework/Services/TskSystemProperties.cpp b/framework/tsk/framework/services/TskSystemProperties.cpp similarity index 92% rename from framework/Services/TskSystemProperties.cpp rename to framework/tsk/framework/services/TskSystemProperties.cpp index b5a31f6a4..1804eaa1c 100644 --- a/framework/Services/TskSystemProperties.cpp +++ b/framework/tsk/framework/services/TskSystemProperties.cpp @@ -17,10 +17,10 @@ #include "TskSystemProperties.h" // TSK Framework includes -#include "Services/TskServices.h" // @@@ TODO: Resolve need to include TskServices.h before Log.h (macros in Log.h cause circular references) -#include "Services/Log.h" -#include "Utilities/TskUtilities.h" -#include "Utilities/TskException.h" +#include "tsk/framework/services/TskServices.h" // @@@ TODO: Resolve need to include TskServices.h before Log.h (macros in Log.h cause circular references) +#include "tsk/framework/services/Log.h" +#include "tsk/framework/utilities/TskUtilities.h" +#include "tsk/framework/utilities/TskException.h" // Poco includes #include "Poco/Path.h" @@ -63,6 +63,7 @@ namespace PredefProp(TskSystemProperties::PROG_DIR, "PROG_DIR", false, ""), PredefProp(TskSystemProperties::CONFIG_DIR, "CONFIG_DIR", false, DEFAULT_CONFIG_DIR), PredefProp(TskSystemProperties::MODULE_DIR, "MODULE_DIR", false, DEFAULT_MODULE_DIR), + PredefProp(TskSystemProperties::MODULE_CONFIG_DIR, "MODULE_CONFIG_DIR", false, DEFAULT_MODULE_DIR), // default == MODULE_DIR PredefProp(TskSystemProperties::OUT_DIR, "OUT_DIR", true, ""), PredefProp(TskSystemProperties::SYSTEM_OUT_DIR, "SYSTEM_OUT_DIR", false, DEFAULT_SYSTEM_OUT_DIR), PredefProp(TskSystemProperties::MODULE_OUT_DIR, "MODULE_OUT_DIR", false, DEFAULT_MODULE_OUT_DIR), @@ -201,11 +202,10 @@ std::string TskSystemProperties::get(PredefinedProperty prop) const else if (prop == IMAGE_FILE) { // If IMAGE_FILE has not been set, attempt to retrieve it from the image database. - std::vector<std::wstring> imgNames = TskServices::Instance().getImgDB().getImageNames(); + const std::vector<std::string> imgNames = TskServices::Instance().getImgDB().getImageNames(); if (!imgNames.empty()) { - value = TskUtilities::toUTF8(imgNames[0]); - const_cast<TskSystemProperties*>(this)->set(prop, value); + const_cast<TskSystemProperties*>(this)->set(prop, imgNames[0]); } } else diff --git a/framework/Services/TskSystemProperties.h b/framework/tsk/framework/services/TskSystemProperties.h similarity index 95% rename from framework/Services/TskSystemProperties.h rename to framework/tsk/framework/services/TskSystemProperties.h index 8b870b5d3..cfc422d17 100755 --- a/framework/Services/TskSystemProperties.h +++ b/framework/tsk/framework/services/TskSystemProperties.h @@ -17,7 +17,7 @@ #define _TSK_SYSTEMPROPERTIES_H // TSK Framework includes -#include "framework_i.h" +#include "tsk/framework/framework_i.h" // C/C++ library includes #include <string> @@ -72,6 +72,13 @@ class TSK_FRAMEWORK_API TskSystemProperties */ MODULE_DIR, + /** + * Directory where plug-in modules can find their configuration files, + * if any. + * Defaults to MODULE_DIR. + */ + MODULE_CONFIG_DIR, + /** * Root output directory. It should be a shared location if the TSK * Framework is being used in a distributed environment. It is a diff --git a/framework/Services/TskSystemPropertiesImpl.cpp b/framework/tsk/framework/services/TskSystemPropertiesImpl.cpp similarity index 87% rename from framework/Services/TskSystemPropertiesImpl.cpp rename to framework/tsk/framework/services/TskSystemPropertiesImpl.cpp index 7a1863f8c..11c6ae1dc 100755 --- a/framework/Services/TskSystemPropertiesImpl.cpp +++ b/framework/tsk/framework/services/TskSystemPropertiesImpl.cpp @@ -17,10 +17,10 @@ // Include the class definition first to ensure it does not depend on subsequent includes in this file. #include "TskSystemPropertiesImpl.h" -#include "Services/Log.h" -#include "Services/TskServices.h" -#include "Utilities/TskUtilities.h" -#include "Utilities/TskException.h" +#include "tsk/framework/services/Log.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/utilities/TskUtilities.h" +#include "tsk/framework/utilities/TskException.h" #include "Poco/Util/XMLConfiguration.h" #include "Poco/Util/MapConfiguration.h" #include <sstream> diff --git a/framework/Services/TskSystemPropertiesImpl.h b/framework/tsk/framework/services/TskSystemPropertiesImpl.h similarity index 95% rename from framework/Services/TskSystemPropertiesImpl.h rename to framework/tsk/framework/services/TskSystemPropertiesImpl.h index 0bc7fd5f6..da6b09fd7 100755 --- a/framework/Services/TskSystemPropertiesImpl.h +++ b/framework/tsk/framework/services/TskSystemPropertiesImpl.h @@ -16,7 +16,7 @@ #ifndef _TSK_SYSTEMPROPERTIESIMPL_H #define _TSK_SYSTEMPROPERTIESIMPL_H -#include "framework_i.h" +#include "tsk/framework/framework_i.h" #include "TskSystemProperties.h" #include "Poco/Util/AbstractConfiguration.h" #include <string> diff --git a/framework/Utilities/Makefile.am b/framework/tsk/framework/utilities/Makefile.am similarity index 84% rename from framework/Utilities/Makefile.am rename to framework/tsk/framework/utilities/Makefile.am index 5b744bca7..bb9d644e8 100644 --- a/framework/Utilities/Makefile.am +++ b/framework/tsk/framework/utilities/Makefile.am @@ -1,4 +1,4 @@ -AM_CXXFLAGS = -I.. -I../.. -Wall +AM_CXXFLAGS = -I.. -I../.. -I../../../.. -Wall noinst_LTLIBRARIES = libfwutil.la libfwutil_la_SOURCES = SectorRuns.cpp SectorRuns.h \ diff --git a/framework/Utilities/SectorRuns.cpp b/framework/tsk/framework/utilities/SectorRuns.cpp similarity index 92% rename from framework/Utilities/SectorRuns.cpp rename to framework/tsk/framework/utilities/SectorRuns.cpp index d722b4ac0..5dc498beb 100755 --- a/framework/Utilities/SectorRuns.cpp +++ b/framework/tsk/framework/utilities/SectorRuns.cpp @@ -9,16 +9,16 @@ */ #include "SectorRuns.h" -#include "Services/TskServices.h" +#include "tsk/framework/services/TskServices.h" /* This class is used to store a list of sector runs. It is * used to identify which runs contain unallocated data. */ SectorRuns::SectorRuns() : - m_numRunsUsed(0), - m_numRunsAlloc(0), - m_curRun(0), - m_runs(NULL) + m_runs(NULL), + m_numRunsUsed(0), + m_numRunsAlloc(0), + m_curRun(0) { // @@@ // Constructor should query the DB diff --git a/framework/Utilities/SectorRuns.h b/framework/tsk/framework/utilities/SectorRuns.h similarity index 93% rename from framework/Utilities/SectorRuns.h rename to framework/tsk/framework/utilities/SectorRuns.h index a194cf840..20ffeeb8f 100755 --- a/framework/Utilities/SectorRuns.h +++ b/framework/tsk/framework/utilities/SectorRuns.h @@ -11,7 +11,7 @@ #ifndef _OSS_SECTORRUNS_H #define _OSS_SECTORRUNS_H -#include "framework_i.h" +#include "tsk/framework/framework_i.h" /** * Stores a list of runs (which have a starting sector and length). diff --git a/framework/Utilities/TskException.cpp b/framework/tsk/framework/utilities/TskException.cpp similarity index 100% rename from framework/Utilities/TskException.cpp rename to framework/tsk/framework/utilities/TskException.cpp diff --git a/framework/Utilities/TskException.h b/framework/tsk/framework/utilities/TskException.h similarity index 95% rename from framework/Utilities/TskException.h rename to framework/tsk/framework/utilities/TskException.h index 3090d060a..8fea8f982 100755 --- a/framework/Utilities/TskException.h +++ b/framework/tsk/framework/utilities/TskException.h @@ -19,7 +19,7 @@ #include <stdexcept> -#include "framework_i.h" +#include "tsk/framework/framework_i.h" /** * Framework exception class diff --git a/framework/TskModuleDev.h b/framework/tsk/framework/utilities/TskModuleDev.h similarity index 79% rename from framework/TskModuleDev.h rename to framework/tsk/framework/utilities/TskModuleDev.h index b91bda588..bb4c4d58b 100644 --- a/framework/TskModuleDev.h +++ b/framework/tsk/framework/utilities/TskModuleDev.h @@ -15,17 +15,20 @@ * Include this .h file when writing a dynamic link library */ -#include "TskVersionInfo.h" -#include "Services/TskServices.h" -#include "Utilities/TskUtilities.h" -#include "Pipeline/TskModule.h" +#include "tsk/framework/TskVersionInfo.h" +#include "tsk/framework/services/TskServices.h" +#include "tsk/framework/utilities/TskUtilities.h" +#include "tsk/framework/pipeline/TskModule.h" -#if defined(_WIN32) && !defined(TSK_MODULE_IMPORT) +#if defined(_WIN32) +#if !defined(TSK_MODULE_IMPORT) #define TSK_MODULE_EXPORT __declspec(dllexport) - #else #define TSK_MODULE_EXPORT __declspec(dllimport) #endif +#else + #define TSK_MODULE_EXPORT +#endif #ifdef __cplusplus extern "C" diff --git a/framework/Utilities/TskUtilities.cpp b/framework/tsk/framework/utilities/TskUtilities.cpp similarity index 54% rename from framework/Utilities/TskUtilities.cpp rename to framework/tsk/framework/utilities/TskUtilities.cpp index 284b81b24..4083bca6e 100755 --- a/framework/Utilities/TskUtilities.cpp +++ b/framework/tsk/framework/utilities/TskUtilities.cpp @@ -16,22 +16,25 @@ // TSK and TSK Framework includes #include "TskUtilities.h" -#include "Services/TskServices.h" -#include <tsk3/base/tsk_base_i.h> +#include "tsk/framework/services/TskServices.h" +#include "tsk/base/tsk_base_i.h" // Poco Includes #include "Poco/UnicodeConverter.h" #include "Poco/Net/DNS.h" #include "Poco/Net/HostEntry.h" #include "Poco/Net/NetException.h" +#include "Poco/Path.h" // C/C++ library includes #include <sstream> #if defined _WIN32 || defined _WIN64 #include <Windows.h> -#else -#error "Only Windows is currently supported" +#endif + +#ifdef __APPLE__ +#include <mach-o/dyld.h> #endif /** @@ -42,7 +45,27 @@ std::string TskUtilities::toUTF8(const std::wstring &utf16Str) { std::string utf8Str; - Poco::UnicodeConverter::toUTF8(utf16Str, utf8Str); + char *utf8Buf; + int utf8Size = utf16Str.size() * 5 + 1; + utf8Buf = new char[utf8Size]; + UTF8 *ptr8; + wchar_t *ptr16; + + ptr8 = (UTF8 *) utf8Buf; + ptr16 = (wchar_t *) utf16Str.c_str(); + + TSKConversionResult retval = + tsk_UTF16WtoUTF8_lclorder((const wchar_t **)&ptr16, + (wchar_t *)&ptr16[utf16Str.size()+1], + &ptr8, + (UTF8 *) ((uintptr_t) ptr8 + utf8Size * sizeof(UTF8)), + TSKstrictConversion); + if (retval != TSKconversionOK) + { + return ""; + } + utf8Str.assign(utf8Buf); + delete [] utf8Buf; return utf8Str; } @@ -54,7 +77,27 @@ std::string TskUtilities::toUTF8(const std::wstring &utf16Str) std::wstring TskUtilities::toUTF16(const std::string &utf8Str) { std::wstring utf16Str; - Poco::UnicodeConverter::toUTF16(utf8Str, utf16Str); + wchar_t *utf16Buf; + int utf16Size = utf8Str.size() + 1; + utf16Buf = new wchar_t[utf16Size]; + UTF8 *ptr8; + wchar_t *ptr16; + + ptr16 = (wchar_t *) utf16Buf; + ptr8 = (UTF8 *) utf8Str.data(); + + TSKConversionResult retval = + tsk_UTF8toUTF16W((const UTF8 **) &ptr8, + (UTF8 *) & utf8Str.data()[utf8Str.size()], + &ptr16, + (wchar_t *) ((uintptr_t) ptr16 + utf16Size * sizeof(wchar_t)), + TSKstrictConversion); + if (retval != TSKconversionOK) + { + return L""; + } + utf16Str.assign(utf16Buf, ptr16 - utf16Buf); + delete [] utf16Buf; return utf16Str; } @@ -102,23 +145,58 @@ bool TskUtilities::getHostIP(const std::string& host, std::string & host_ip) */ std::string TskUtilities::getProgDir() { +#ifdef TSK_WIN32 wchar_t progPath[256]; wchar_t fullPath[256]; HINSTANCE hInstance = GetModuleHandleW(NULL); GetModuleFileNameW(hInstance, fullPath, 256); - for (int i = wcslen(fullPath)-1; i > 0; i--) { + int i = wcslen(fullPath)-1; + for (; i > 0; i--) { if (i > 256) break; if (fullPath[i] == '\\') { wcsncpy_s(progPath, fullPath, i+1); - progPath[i+1] = '\0'; break; } } - return TskUtilities::toUTF8(std::wstring(progPath)); + std::wstring progPathNoNull(progPath, i+1); + return TskUtilities::toUTF8(progPathNoNull); + +#elif __APPLE__ + char path[MAXPATHLEN+1]; + uint32_t path_len = MAXPATHLEN; + if (_NSGetExecutablePath(path, &path_len) == 0) { + Poco::Path p(path); + return p.makeParent().toString(); + } + return std::string(""); +#else // NOT TSK_WIN32 + int size = 256; + char* buf = 0; + int ret = 0; + + while (1) { + buf = (char*)realloc(buf, size*sizeof(char)); + if (!buf) + return std::string(""); + ret = readlink("/proc/self/exe", buf, size); + if (ret < 0) { + free(buf); + return std::string(""); + } + if (ret < size) { + std::string s(buf, ret); + free(buf); + Poco::Path path(s); + return path.makeParent().toString(); + } + size *= 2; + } + return std::string(""); +#endif // NOT TSK_WIN32 } /** Strip matching leading and trailing double quotes from the input str. diff --git a/framework/Utilities/TskUtilities.h b/framework/tsk/framework/utilities/TskUtilities.h similarity index 92% rename from framework/Utilities/TskUtilities.h rename to framework/tsk/framework/utilities/TskUtilities.h index 97d965419..d0d7c43f4 100755 --- a/framework/Utilities/TskUtilities.h +++ b/framework/tsk/framework/utilities/TskUtilities.h @@ -19,7 +19,7 @@ #include <string> -#include "framework_i.h" +#include "tsk/framework/framework_i.h" /** * Contains commonly needed utility methods. Refer to the poco library diff --git a/framework/Utilities/UnallocRun.cpp b/framework/tsk/framework/utilities/UnallocRun.cpp similarity index 100% rename from framework/Utilities/UnallocRun.cpp rename to framework/tsk/framework/utilities/UnallocRun.cpp diff --git a/framework/Utilities/UnallocRun.h b/framework/tsk/framework/utilities/UnallocRun.h similarity index 92% rename from framework/Utilities/UnallocRun.h rename to framework/tsk/framework/utilities/UnallocRun.h index bac77b357..95177a008 100755 --- a/framework/Utilities/UnallocRun.h +++ b/framework/tsk/framework/utilities/UnallocRun.h @@ -11,7 +11,7 @@ #ifndef _OSS_UNALLOCRUN_H #define _OSS_UNALLOCRUN_H -#include "framework_i.h" +#include "tsk/framework/framework_i.h" /** * Stores information that can map a region in the original disk image diff --git a/framework/win32/framework/framework.vcxproj b/framework/win32/framework/framework.vcxproj deleted file mode 100755 index b10d18e2a..000000000 --- a/framework/win32/framework/framework.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectName>libtskframework</ProjectName> - <ProjectGuid>{F791B16A-1489-4526-9FFF-CB481CEC5414}</ProjectGuid> - <RootNamespace>framework</RootNamespace> - <Keyword>Win32Proj</Keyword> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>DynamicLibrary</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> - <WholeProgramOptimization>true</WholeProgramOptimization> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>DynamicLibrary</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>$(ProjectDir)\..\..;$(ProjectDir)\..\..\..;$(POCO_HOME)\Foundation\include;$(POCO_HOME)\Util\include;$(POCO_HOME)\XML\include;$(POCO_HOME)\Net\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;TSK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <MinimalRebuild>true</MinimalRebuild> - <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <PrecompiledHeader> - </PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <DebugInformationFormat>EditAndContinue</DebugInformationFormat> - </ClCompile> - <Link> - <AdditionalDependencies>libewf.lib;libtsk.lib;ws2_32.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>$(POCO_HOME)\lib;$(ProjectDir)\..\..\..\win32\Debug;$(LIBEWF_HOME)\msvscpp\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - <GenerateDebugInformation>true</GenerateDebugInformation> - <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary> - </Link> - <PostBuildEvent> - <Command>xcopy "$(POCO_HOME)\bin\PocoFoundationd.dll" "$(OutDir)" /R /Y -xcopy "$(POCO_HOME)\bin\PocoNetd.dll" "$(OutDir)" /R /Y -xcopy "$(POCO_HOME)\bin\PocoUtild.dll" "$(OutDir)" /R /Y -xcopy "$(POCO_HOME)\bin\PocoXMLd.dll" "$(OutDir)" /R /Y -xcopy "$(LIBEWF_HOME)\msvscpp\Release\libewf.dll" "$(OutDir)" /R /Y -xcopy "$(LIBEWF_HOME)\msvscpp\Release\zlib.dll" "$(OutDir)" /R /Y -del "$(OutDir)framework_config.xml" -xcopy "$(ProjectDir)..\..\SampleConfig\framework_config_win32dev.xml" "$(OutDir)" /R /Y -ren "$(OutDir)framework_config_win32dev.xml" framework_config.xml -</Command> - </PostBuildEvent> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>MaxSpeed</Optimization> - <IntrinsicFunctions>true</IntrinsicFunctions> - <AdditionalIncludeDirectories>$(ProjectDir)\..\..;$(ProjectDir)\..\..\..;$(POCO_HOME)\Foundation\include;$(POCO_HOME)\Util\include;$(POCO_HOME)\XML\include;$(POCO_HOME)\Net\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;TSK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <FunctionLevelLinking>true</FunctionLevelLinking> - <PrecompiledHeader> - </PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - </ClCompile> - <Link> - <AdditionalDependencies>libewf.lib;libtsk.lib;ws2_32.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>$(POCO_HOME)\lib;$(ProjectDir)\..\..\..\win32\Release;$(LIBEWF_HOME)\msvscpp\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary> - </Link> - <PostBuildEvent> - <Command>xcopy "$(POCO_HOME)\bin\PocoFoundation.dll" "$(OutDir)" /R /Y -xcopy "$(POCO_HOME)\bin\PocoNet.dll" "$(OutDir)" /R /Y -xcopy "$(POCO_HOME)\bin\PocoUtil.dll" "$(OutDir)" /R /Y -xcopy "$(POCO_HOME)\bin\PocoXML.dll" "$(OutDir)" /R /Y -xcopy "$(LIBEWF_HOME)\msvscpp\Release\libewf.dll" "$(outDir)" /R /Y -xcopy "$(LIBEWF_HOME)\msvscpp\Release\zlib.dll" "$(OutDir)" /R /Y -del "$(OutDir)framework_config.xml" -xcopy "$(ProjectDir)..\..\SampleConfig\framework_config_win32dev.xml" "$(outDir)" /R /Y -ren "$(OutDir)framework_config_win32dev.xml" framework_config.xml -</Command> - </PostBuildEvent> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\..\Services\Log.cpp" /> - <ClCompile Include="..\..\Services\Scheduler.cpp" /> - <ClCompile Include="..\..\Utilities\SectorRuns.cpp" /> - <ClCompile Include="..\..\Extraction\TskAutoImpl.cpp" /> - <ClCompile Include="..\..\Services\TskBlackboard.cpp" /> - <ClCompile Include="..\..\Services\TskBlackboardArtifact.cpp" /> - <ClCompile Include="..\..\Services\TskBlackboardAttribute.cpp" /> - <ClCompile Include="..\..\Extraction\TskCarveExtractScalpel.cpp" /> - <ClCompile Include="..\..\Extraction\TskCarvePrepSectorConcat.cpp" /> - <ClCompile Include="..\..\Services\TskDBBlackboard.cpp" /> - <ClCompile Include="..\..\Utilities\TskException.cpp" /> - <ClCompile Include="..\..\Pipeline\TskExecutableModule.cpp" /> - <ClCompile Include="..\..\File\TskFile.cpp" /> - <ClCompile Include="..\..\Pipeline\TskFileAnalysisPipeline.cpp" /> - <ClCompile Include="..\..\Pipeline\TskFileAnalysisPluginModule.cpp" /> - <ClCompile Include="..\..\File\TskFileManagerImpl.cpp" /> - <ClCompile Include="..\..\File\TskFileTsk.cpp" /> - <ClCompile Include="..\..\Extraction\TskImageFile.cpp" /> - <ClCompile Include="..\..\Extraction\TskImageFileTsk.cpp" /> - <ClCompile Include="..\..\Services\TskImgDB.cpp" /> - <ClCompile Include="..\..\Services\TskImgDBSqlite.cpp" /> - <ClCompile Include="..\..\Pipeline\TskModule.cpp" /> - <ClCompile Include="..\..\Pipeline\TskPipeline.cpp" /> - <ClCompile Include="..\..\Pipeline\TskPipelineManager.cpp" /> - <ClCompile Include="..\..\Pipeline\TskPluginModule.cpp" /> - <ClCompile Include="..\..\Pipeline\TskReportPipeline.cpp" /> - <ClCompile Include="..\..\Pipeline\TskReportPluginModule.cpp" /> - <ClCompile Include="..\..\Services\TskSchedulerQueue.cpp" /> - <ClCompile Include="..\..\Services\TskServices.cpp" /> - <ClCompile Include="..\..\Services\TskSystemProperties.cpp" /> - <ClCompile Include="..\..\Services\TskSystemPropertiesImpl.cpp" /> - <ClCompile Include="..\..\Utilities\TskUtilities.cpp" /> - <ClCompile Include="..\..\Utilities\UnallocRun.cpp" /> - </ItemGroup> - <ItemGroup> - <ClInclude Include="..\..\Extraction\CarveExtract.h" /> - <ClInclude Include="..\..\Extraction\CarvePrep.h" /> - <ClInclude Include="..\..\framework.h" /> - <ClInclude Include="..\..\framework_i.h" /> - <ClInclude Include="..\..\Services\Log.h" /> - <ClInclude Include="..\..\Services\Scheduler.h" /> - <ClInclude Include="..\..\TskVersionInfo.h" /> - <ClInclude Include="..\..\Utilities\SectorRuns.h" /> - <ClInclude Include="..\..\Extraction\TskAutoImpl.h" /> - <ClInclude Include="..\..\Services\TskBlackboard.h" /> - <ClInclude Include="..\..\Services\TskBlackboardArtifact.h" /> - <ClInclude Include="..\..\Services\TskBlackBoardAttribute.h" /> - <ClInclude Include="..\..\Extraction\TskCarveExtractScalpel.h" /> - <ClInclude Include="..\..\Extraction\TskCarvePrepSectorConcat.h" /> - <ClInclude Include="..\..\Services\TskDBBlackboard.h" /> - <ClInclude Include="..\..\Utilities\TskException.h" /> - <ClInclude Include="..\..\Pipeline\TskExecutableModule.h" /> - <ClInclude Include="..\..\File\TskFile.h" /> - <ClInclude Include="..\..\Pipeline\TskFileAnalysisPipeline.h" /> - <ClInclude Include="..\..\Pipeline\TskFileAnalysisPluginModule.h" /> - <ClInclude Include="..\..\File\TskFileManager.h" /> - <ClInclude Include="..\..\File\TskFileManagerImpl.h" /> - <ClInclude Include="..\..\File\TskFileTsk.h" /> - <ClInclude Include="..\..\Extraction\TskImageFile.h" /> - <ClInclude Include="..\..\Extraction\TskImageFileTsk.h" /> - <ClInclude Include="..\..\Services\TskImgDB.h" /> - <ClInclude Include="..\..\Services\TskImgDBSqlite.h" /> - <ClInclude Include="..\..\Pipeline\TskModule.h" /> - <ClInclude Include="..\..\Pipeline\TskPipeline.h" /> - <ClInclude Include="..\..\Pipeline\TskPipelineManager.h" /> - <ClInclude Include="..\..\Pipeline\TskPluginModule.h" /> - <ClInclude Include="..\..\Pipeline\TskReportPipeline.h" /> - <ClInclude Include="..\..\Pipeline\TskReportPluginModule.h" /> - <ClInclude Include="..\..\Services\TskSchedulerQueue.h" /> - <ClInclude Include="..\..\Services\TskServices.h" /> - <ClInclude Include="..\..\Services\TskSystemProperties.h" /> - <ClInclude Include="..\..\Services\TskSystemPropertiesImpl.h" /> - <ClInclude Include="..\..\Utilities\TskUtilities.h" /> - <ClInclude Include="..\..\Utilities\UnallocRun.h" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file diff --git a/framework/win32/framework/framework.vcxproj.filters b/framework/win32/framework/framework.vcxproj.filters deleted file mode 100755 index 93fc048cd..000000000 --- a/framework/win32/framework/framework.vcxproj.filters +++ /dev/null @@ -1,233 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> - </Filter> - <Filter Include="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="..\..\Services\Log.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Services\Scheduler.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Utilities\SectorRuns.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Extraction\TskAutoImpl.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Services\TskBlackboard.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Services\TskBlackboardArtifact.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Services\TskBlackboardAttribute.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Extraction\TskCarveExtractScalpel.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Extraction\TskCarvePrepSectorConcat.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Services\TskDBBlackboard.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Utilities\TskException.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Pipeline\TskExecutableModule.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\File\TskFile.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Pipeline\TskFileAnalysisPipeline.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Pipeline\TskFileAnalysisPluginModule.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\File\TskFileManagerImpl.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\File\TskFileTsk.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Extraction\TskImageFile.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Extraction\TskImageFileTsk.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Services\TskImgDB.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Services\TskImgDBSqlite.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Pipeline\TskModule.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Pipeline\TskPipeline.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Pipeline\TskPipelineManager.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Pipeline\TskPluginModule.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Pipeline\TskReportPipeline.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Pipeline\TskReportPluginModule.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Services\TskSchedulerQueue.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Services\TskServices.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Services\TskSystemProperties.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Services\TskSystemPropertiesImpl.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Utilities\TskUtilities.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\..\Utilities\UnallocRun.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="..\..\Extraction\CarveExtract.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Extraction\CarvePrep.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\framework.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\framework_i.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\Log.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\Scheduler.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Utilities\SectorRuns.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Extraction\TskAutoImpl.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\TskBlackboard.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\TskBlackboardArtifact.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\TskBlackBoardAttribute.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Extraction\TskCarveExtractScalpel.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Extraction\TskCarvePrepSectorConcat.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\TskDBBlackboard.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Utilities\TskException.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Pipeline\TskExecutableModule.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\File\TskFile.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Pipeline\TskFileAnalysisPipeline.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Pipeline\TskFileAnalysisPluginModule.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\File\TskFileManager.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\File\TskFileManagerImpl.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\File\TskFileTsk.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Extraction\TskImageFile.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Extraction\TskImageFileTsk.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\TskImgDB.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\TskImgDBSqlite.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Pipeline\TskModule.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Pipeline\TskPipeline.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Pipeline\TskPipelineManager.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Pipeline\TskPluginModule.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Pipeline\TskReportPipeline.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Pipeline\TskReportPluginModule.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\TskSchedulerQueue.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\TskServices.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\TskSystemProperties.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Services\TskSystemPropertiesImpl.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Utilities\TskUtilities.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\Utilities\UnallocRun.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\TskVersionInfo.h"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> -</Project> \ No newline at end of file diff --git a/m4/libtool.m4 b/m4/libtool.m4 deleted file mode 100644 index 6c4595a07..000000000 --- a/m4/libtool.m4 +++ /dev/null @@ -1,7309 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# 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. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool 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. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -]) - -# serial 56 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_CMD_RELOAD])dnl -m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CMD_OLD_ARCHIVE])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl -_LT_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from `configure', and `config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" -])# _LT_PROG_LTMAIN - - -## ------------------------------------- ## -## Accumulate code for creating libtool. ## -## ------------------------------------- ## - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - -## ------------------------ ## -## FIXME: Eliminate VARNAME ## -## ------------------------ ## - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_quote(m4_if([$2], [], - m4_quote(lt_decl_tag_varnames), - m4_quote(m4_shift($@)))), - m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) -m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\[$]0 --fallback-echo"')dnl " - lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` - ;; -esac - -_LT_OUTPUT_LIBTOOL_INIT -]) - - -# LT_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to <bug-libtool@gnu.org>." - -lt_cl_version="\ -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) -configured by $[0], generated by m4_PACKAGE_STRING. - -Copyright (C) 2008 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test $[#] != 0 -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec AS_MESSAGE_LOG_FD>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec AS_MESSAGE_LOG_FD>>config.log - $lt_cl_success || AS_EXIT(1) -fi -])# LT_OUTPUT - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM -f \"$cfgfile\"; exit 1" 1 2 15 - $RM -f "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -_LT_COPYING -_LT_LIBTOOL_TAGS - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - _LT_PROG_LTMAIN - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - _LT_PROG_XSI_SHELLFNS - - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Fortran], [_LT_LANG(FC)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG - - -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_defun([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_CXX], []) -dnl AC_DEFUN([AC_LIBTOOL_F77], []) -dnl AC_DEFUN([AC_LIBTOOL_FC], []) -dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi]) - AC_CACHE_CHECK([for -exported_symbols_list linker flag], - [lt_cv_ld_exported_symbols_list], - [lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" - ]) - case $host_os in - rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" - if test "$GCC" = "yes"; then - output_verbose_link_cmd=echo - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" - fi -],[]) - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -m4_defun([_LT_SYS_MODULE_PATH_AIX], -[m4_require([_LT_DECL_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_SYS_MODULE_PATH_AIX - - -# _LT_SHELL_INIT(ARG) -# ------------------- -m4_define([_LT_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_SHELL_INIT - - -# _LT_PROG_ECHO_BACKSLASH -# ----------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -m4_defun([_LT_PROG_ECHO_BACKSLASH], -[_LT_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(lt_ECHO) -]) -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], - [An echo program that does not interpret backslashes]) -])# _LT_PROG_ECHO_BACKSLASH - - -# _LT_ENABLE_LOCK -# --------------- -m4_defun([_LT_ENABLE_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" -])# _LT_ENABLE_LOCK - - -# _LT_CMD_OLD_ARCHIVE -# ------------------- -m4_defun([_LT_CMD_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1]) - -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) - -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi -_LT_DECL([], [old_postinstall_cmds], [2]) -_LT_DECL([], [old_postuninstall_cmds], [2]) -_LT_TAGDECL([], [old_archive_cmds], [2], - [Commands used to build an old-style archive]) -])# _LT_CMD_OLD_ARCHIVE - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $RM -r conftest* -]) - -if test x"[$]$2" = xyes; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $RM -r conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM -r conftest* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $RM -r conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[[4-9]]*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[123]]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -interix[[3-9]]*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux - need_lib_prefix=no - need_version=no - library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shlibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [[List of archive names. First name is the real one, the rest are links. - The last name is the one that the linker finds with -lNAME]]) -_LT_DECL([], [soname_spec], [1], - [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program which can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program which can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl - -AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break - ;; - *) - test "$with_gnu_ld" != yes && break - ;; - esac - fi - done - IFS="$lt_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$lt_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -_LT_PATH_LD_GNU -AC_SUBST([LD]) - -_LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) -])# LT_PATH_LD - -# Old names: -AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) -AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_LD], []) -dnl AC_DEFUN([AC_PROG_LD], []) - - -# _LT_PATH_LD_GNU -#- -------------- -m4_defun([_LT_PATH_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - lt_cv_prog_gnu_ld=yes - ;; -*) - lt_cv_prog_gnu_ld=no - ;; -esac]) -with_gnu_ld=$lt_cv_prog_gnu_ld -])# _LT_PATH_LD_GNU - - -# _LT_CMD_RELOAD -# -------------- -# find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. -m4_defun([_LT_CMD_RELOAD], -[AC_CACHE_CHECK([for $LD option to reload object files], - lt_cv_ld_reload_flag, - [lt_cv_ld_reload_flag='-r']) -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac -_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_DECL([], [reload_cmds], [2])dnl -])# _LT_CMD_RELOAD - - -# _LT_CHECK_MAGIC_METHOD -# ---------------------- -# how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_MAGIC_METHOD], -[m4_require([_LT_DECL_EGREP]) -AC_CACHE_CHECK([how to recognize dependent libraries], -lt_cv_deplibs_check_method, -[lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[[4-9]]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[[45]]*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[[3-9]]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -_LT_DECL([], [deplibs_check_method], [1], - [Method to check whether dependent libraries are shared objects]) -_LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method == "file_magic"]) -])# _LT_CHECK_MAGIC_METHOD - - -# LT_PATH_NM -# ---------- -# find the pathname to a BSD- or MS-compatible name lister -AC_DEFUN([LT_PATH_NM], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi]) -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) - AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl - -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], - [lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) - cat conftest.out >&AS_MESSAGE_LOG_FD - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -r -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_NM], []) -dnl AC_DEFUN([AC_PROG_NM], []) - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -m4_defun([_LT_CMD_GLOBAL_SYMBOLS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_NM])dnl -AC_REQUIRE([LT_PATH_LD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK ['"\ -" {last_section=section; section=\$ 3};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx]" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -r -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[[]] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi - -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], - [Take the output of nm and produce a listing of raw symbols and C names]) -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -_LT_DECL([global_symbol_to_c_name_address_lib_prefix], - [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], - [Transform the output of nm in a C name address pair when lib prefix is needed]) -]) # _LT_CMD_GLOBAL_SYMBOLS - - -# _LT_COMPILER_PIC([TAGNAME]) -# --------------------------- -m4_defun([_LT_COMPILER_PIC], -[m4_require([_LT_TAG_COMPILER])dnl -_LT_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) -m4_if([$1], [CXX], [ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix[[4-9]]*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc* ) - # Intel C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" - ;; -esac -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], - [Additional compiler flags for building library objects]) - -# -# Check to make sure the static flag actually works. -# -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# _LT_COMPILER_PIC - - -# _LT_LINKER_SHLIBS([TAGNAME]) -# ---------------------------- -# See if the linker supports building shared libraries. -m4_defun([_LT_LINKER_SHLIBS], -[AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -m4_if([$1], [CXX], [ - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix[[4-9]]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] -], [ - runpath_var= - _LT_TAGVAR(allow_undefined_flag, $1)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_TAGVAR(hardcode_libdir_separator, $1)= - _LT_TAGVAR(hardcode_minus_L, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. -dnl Note also adjust exclude_expsyms for C++ above. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[[3-9]]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag= - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE(int foo(void) {}, - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - ) - LDFLAGS="$save_LDFLAGS" - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld - -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) - -# -# Do we need to explicitly link libc? -# -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $RM -r conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM -r conftest* - AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) -_LT_TAGDECL([], [hardcode_libdir_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting ${shlibpath_var} if the - library is relocated]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [fix_srcfile_path], [1], - [Fix the shell variable $srcfile for the compiler]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_LT_TAGDECL([], [include_expsyms], [1], - [Symbols that must always be exported]) -_LT_TAGDECL([], [prelink_cmds], [2], - [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [file_list_spec], [1], - [Specify filename containing input files]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_CONFIG([TAG]) -# ------------------------ -# Ensure that the configuration variables for a C compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - -_LT_TAG_COMPILER -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report which library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_CONFIG($1) -fi -AC_LANG_POP -CC="$lt_save_CC" -])# _LT_LANG_C_CONFIG - - -# _LT_PROG_CXX -# ------------ -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ -# compiler, we have our own version here. -m4_defun([_LT_PROG_CXX], -[ -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) -AC_PROG_CXX -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_CXX - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_CXX], []) - - -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[AC_REQUIRE([_LT_PROG_CXX])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi - - if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - LT_PATH_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - _LT_SYS_MODULE_PATH_AIX - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - gnu*) - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' - ;; - *) - if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ - $RANLIB $oldlib' - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - *) # Version 6 will use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' - ;; - xl*) - # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd=echo - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - case $host in - osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - ;; - *) - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - case $host in - osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' - fi - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - CC=$lt_save_CC - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes - -AC_LANG_POP -])# _LT_LANG_CXX_CONFIG - - -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) -# --------------------------------- -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -m4_defun([_LT_SYS_HIDDEN_LIBDEPS], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -# Dependencies to place before and after the object being linked: -_LT_TAGVAR(predep_objects, $1)= -_LT_TAGVAR(postdep_objects, $1)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -]) -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case $p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" - else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" - else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" - fi - fi - ;; - - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" - else - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" - else - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$RM -f confest.$objext - -# PORTME: override above test on systems where it is broken -m4_if([$1], [CXX], -[case $host_os in -interix[[3-9]]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - _LT_TAGVAR(predep_objects,$1)= - _LT_TAGVAR(postdep_objects,$1)= - _LT_TAGVAR(postdeps,$1)= - ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _LT_SYS_HIDDEN_LIBDEPS - - -# _LT_PROG_F77 -# ------------ -# Since AC_PROG_F77 is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_F77], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) -AC_PROG_F77 -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_F77 - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_F77], []) - - -# _LT_LANG_F77_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a Fortran 77 compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_F77_CONFIG], -[AC_REQUIRE([_LT_PROG_F77])dnl -AC_LANG_PUSH(Fortran 77) - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - CC=${F77-"f77"} - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - GCC=$G77 - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC="$lt_save_CC" -fi # test "$_lt_disable_F77" != yes - -AC_LANG_POP -])# _LT_LANG_F77_CONFIG - - -# _LT_PROG_FC -# ----------- -# Since AC_PROG_FC is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_FC], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) -AC_PROG_FC -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_FC - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_FC], []) - - -# _LT_LANG_FC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for a Fortran compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_FC_CONFIG], -[AC_REQUIRE([_LT_PROG_FC])dnl -AC_LANG_PUSH(Fortran) - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - CC=${FC-"f95"} - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC="$lt_save_CC" -fi # test "$_lt_disable_FC" != yes - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -lt_save_GCC=$GCC -GCC=yes -CC=${GCJ-"gcj"} -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" -_LT_CC_BASENAME([$compiler]) - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC="$lt_save_CC" -])# _LT_LANG_GCJ_CONFIG - - -# _LT_LANG_RC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -lt_save_GCC=$GCC -GCC= -CC=${RC-"windres"} -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC="$lt_save_CC" -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_GCJ], []) - - -# LT_PROG_RC -# ---------- -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_SED -# ------------ -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -m4_defun([_LT_DECL_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_SED], []) - - -# _LT_CHECK_SHELL_FEATURES -# ------------------------ -# Find out whether the shell is Bourne or XSI compatible, -# or has some other useful features. -m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl -])# _LT_CHECK_SHELL_FEATURES - - -# _LT_PROG_XSI_SHELLFNS -# --------------------- -# Bourne and XSI compatible variants of some useful shell functions. -m4_defun([_LT_PROG_XSI_SHELLFNS], -[case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $[*] )) -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} - -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - -dnl func_dirname_and_basename -dnl A portable version of this function is already defined in general.m4sh -dnl so there is no need for it here. - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} - -# sed scripts: -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[[^=]]*=//' - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` -} - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$[@]"` -} - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` -} - -_LT_EOF -esac - -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]+=\$[2]" -} -_LT_EOF - ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]=\$$[1]\$[2]" -} - -_LT_EOF - ;; - esac -]) diff --git a/m4/libtool.m4 b/m4/libtool.m4 new file mode 120000 index 000000000..f3504e92b --- /dev/null +++ b/m4/libtool.m4 @@ -0,0 +1 @@ +/usr/share/aclocal/libtool.m4 \ No newline at end of file diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 deleted file mode 100644 index e97011948..000000000 --- a/m4/ltoptions.m4 +++ /dev/null @@ -1,368 +0,0 @@ -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# 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 ltoptions.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - ]) -])# _LT_SET_OPTIONS - - -## --------------------------------- ## -## Macros to handle LT_INIT options. ## -## --------------------------------- ## - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' -# LT_INIT options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - -## ----------------- ## -## LTDL_INIT Options ## -## ----------------- ## - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -LT_OPTION_DEFINE([LTDL_INIT], [installable], - [m4_define([_LTDL_TYPE], [installable])]) -LT_OPTION_DEFINE([LTDL_INIT], [convenience], - [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 new file mode 120000 index 000000000..b81279e34 --- /dev/null +++ b/m4/ltoptions.m4 @@ -0,0 +1 @@ +/usr/share/aclocal/ltoptions.m4 \ No newline at end of file diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 deleted file mode 100644 index 0d258e070..000000000 --- a/m4/ltsugar.m4 +++ /dev/null @@ -1,123 +0,0 @@ -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# 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 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -m4_define([lt_combine], -[m4_if([$2], [], [], - [m4_if([$4], [], [], - [lt_join(m4_quote(m4_default([$1], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2], - [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]), - [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl -]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl -]) diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 new file mode 120000 index 000000000..4d76cc709 --- /dev/null +++ b/m4/ltsugar.m4 @@ -0,0 +1 @@ +/usr/share/aclocal/ltsugar.m4 \ No newline at end of file diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 deleted file mode 100644 index 45cb1557c..000000000 --- a/m4/ltversion.m4 +++ /dev/null @@ -1,23 +0,0 @@ -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004 -# -# 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. - -# Generated from ltversion.in. - -# serial 2976 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.2.4]) -m4_define([LT_PACKAGE_REVISION], [1.2976]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.4' -macro_revision='1.2976' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 new file mode 120000 index 000000000..5eb474fd2 --- /dev/null +++ b/m4/ltversion.m4 @@ -0,0 +1 @@ +/usr/share/aclocal/ltversion.m4 \ No newline at end of file diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 deleted file mode 100644 index 637bb2066..000000000 --- a/m4/lt~obsolete.m4 +++ /dev/null @@ -1,92 +0,0 @@ -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004. -# -# 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 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 new file mode 120000 index 000000000..de0b9f949 --- /dev/null +++ b/m4/lt~obsolete.m4 @@ -0,0 +1 @@ +/usr/share/aclocal/lt~obsolete.m4 \ No newline at end of file diff --git a/packages/sleuthkit.spec b/packages/sleuthkit.spec index fb0552b98..7dc5bf7c6 100644 --- a/packages/sleuthkit.spec +++ b/packages/sleuthkit.spec @@ -43,23 +43,23 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/* %dir %{_mandir}/man1 %{_mandir}/man1/* -%dir /usr/include/tsk3 -/usr/include/tsk3/* -%dir /usr/include/tsk3/base -/usr/include/tsk3/base/* -%dir /usr/include/tsk3/fs -/usr/include/tsk3/fs/* -%dir /usr/include/tsk3/hashdb -/usr/include/tsk3/hashdb/* -%dir /usr/include/tsk3/img -/usr/include/tsk3/img/* -%dir /usr/include/tsk3/vs -/usr/include/tsk3/vs/* -%dir /usr/include/tsk3/auto -/usr/include/tsk3/auto/* -%dir /usr/share/tsk3 -%dir /usr/share/tsk3/sorter -/usr/share/tsk3/sorter/* +%dir /usr/include/tsk +/usr/include/tsk/* +%dir /usr/include/tsk/base +/usr/include/tsk/base/* +%dir /usr/include/tsk/fs +/usr/include/tsk/fs/* +%dir /usr/include/tsk/hashdb +/usr/include/tsk/hashdb/* +%dir /usr/include/tsk/img +/usr/include/tsk/img/* +%dir /usr/include/tsk/vs +/usr/include/tsk/vs/* +%dir /usr/include/tsk/auto +/usr/include/tsk/auto/* +%dir /usr/share/tsk +%dir /usr/share/tsk/sorter +/usr/share/tsk/sorter/* %doc ChangeLog.txt NEWS.txt INSTALL.txt README.txt README_win32.txt diff --git a/release/release-unix.pl b/release/release-unix.pl index 8b31691fb..883b6a877 100755 --- a/release/release-unix.pl +++ b/release/release-unix.pl @@ -180,8 +180,8 @@ sub update_hver { print "Updating the version in tsk_base.h\n"; - open (CONF_IN, "<tsk3/base/tsk_base.h") or die "Cannot open tsk3/base/tsk_base.h"; - open (CONF_OUT, ">tsk3/base/tsk_base2.h") or die "Cannot open tsk3/base/tsk_base2.h"; + open (CONF_IN, "<tsk/base/tsk_base.h") or die "Cannot open tsk/base/tsk_base.h"; + open (CONF_OUT, ">tsk/base/tsk_base2.h") or die "Cannot open tsk/base/tsk_base2.h"; my $found = 0; while (<CONF_IN>) { @@ -230,8 +230,8 @@ sub update_hver { die "$found (instead of 2) occurances of VERSION in tsk_base.h"; } - unlink ("tsk3/base/tsk_base.h") or die "Error deleting tsk3/base/tsk_base.h"; - rename ("tsk3/base/tsk_base2.h", "tsk3/base/tsk_base.h") or die "Error renaming tmp tsk3/base/tsk_base.h file"; + unlink ("tsk/base/tsk_base.h") or die "Error deleting tsk/base/tsk_base.h"; + rename ("tsk/base/tsk_base2.h", "tsk/base/tsk_base.h") or die "Error renaming tmp tsk/base/tsk_base.h file"; } # update the version in the package files in current source directory @@ -282,7 +282,7 @@ sub update_libver { } return if ($a eq "n"); - exec_pipe(*OUT, "cat tsk3/Makefile.am | grep version\-info"); + exec_pipe(*OUT, "cat tsk/Makefile.am | grep version\-info"); print "Current Makefile Contents: " . read_pipe_line(*OUT) . "\n"; close (OUT); @@ -290,7 +290,7 @@ sub update_libver { my $rev; my $age; while (1) { - $a = prompt_user("Enter library version used in last release (from tsk3/Makefile.am)"); + $a = prompt_user("Enter library version used in last release (from tsk/Makefile.am)"); if ($a =~ /(\d+):(\d+):(\d+)/) { $cur = $1; $rev = $2; @@ -325,8 +325,8 @@ sub update_libver { } } - my $IFILE = "tsk3/Makefile.am"; - my $OFILE = "tsk3/Makefile.am2"; + my $IFILE = "tsk/Makefile.am"; + my $OFILE = "tsk/Makefile.am2"; open (CONF_IN, "<${IFILE}") or die "Cannot open $IFILE"; diff --git a/samples/Makefile.am b/samples/Makefile.am index aee7a5ce4..c94df6406 100644 --- a/samples/Makefile.am +++ b/samples/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = -I.. -I$(srcdir)/.. -Wall -LDADD = ../tsk3/libtsk3.la +LDADD = ../tsk/libtsk.la AM_LDFLAGS = -static EXTRA_DIST = .indent.pro diff --git a/samples/callback-cpp-style.cpp b/samples/callback-cpp-style.cpp index c2bb21027..d917053d4 100644 --- a/samples/callback-cpp-style.cpp +++ b/samples/callback-cpp-style.cpp @@ -38,7 +38,7 @@ #include <string.h> #include <stdlib.h> -#include <tsk3/libtsk.h> +#include <tsk/libtsk.h> static TskHdbInfo *hdb_info; diff --git a/samples/callback-style.cpp b/samples/callback-style.cpp index e31f51bbf..e0a35f6be 100644 --- a/samples/callback-style.cpp +++ b/samples/callback-style.cpp @@ -38,7 +38,7 @@ #include <string.h> #include <stdlib.h> -#include <tsk3/libtsk.h> +#include <tsk/libtsk.h> static TSK_HDB_INFO *hdb_info; diff --git a/samples/posix-cpp-style.cpp b/samples/posix-cpp-style.cpp index 7c83003ae..23bc9f1ff 100644 --- a/samples/posix-cpp-style.cpp +++ b/samples/posix-cpp-style.cpp @@ -37,7 +37,7 @@ #include <stdio.h> #include <stdlib.h> -#include <tsk3/libtsk.h> +#include <tsk/libtsk.h> /** * Open a directory and cycle through its contents. Read each file and recurse diff --git a/samples/posix-style.cpp b/samples/posix-style.cpp index c4246a7fe..2e53cefe9 100644 --- a/samples/posix-style.cpp +++ b/samples/posix-style.cpp @@ -38,7 +38,7 @@ #include <string.h> #include <stdlib.h> -#include <tsk3/libtsk.h> +#include <tsk/libtsk.h> /** diff --git a/tests/Makefile.am b/tests/Makefile.am index d7051bfc4..a9105e331 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = -I.. -I$(srcdir)/.. -Wall $(PTHREAD_CFLAGS) -LDADD = ../tsk3/libtsk3.la +LDADD = ../tsk/libtsk.la LDFLAGS += -static $(PTHREAD_LIBS) EXTRA_DIST = .indent.pro diff --git a/tests/fs_attrlist_apis.cpp b/tests/fs_attrlist_apis.cpp index 00410bfec..74d67610f 100644 --- a/tests/fs_attrlist_apis.cpp +++ b/tests/fs_attrlist_apis.cpp @@ -11,7 +11,7 @@ /* Test and compare the file attribute list apis */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" static char *s_root; diff --git a/tests/fs_fname_apis.cpp b/tests/fs_fname_apis.cpp index 8f58abdce..9d8d56e1a 100644 --- a/tests/fs_fname_apis.cpp +++ b/tests/fs_fname_apis.cpp @@ -16,7 +16,7 @@ * Need to uncommen parent addr check in open() check when fs_meta is defined */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" static char *s_root; diff --git a/tests/fs_thread_test.cpp b/tests/fs_thread_test.cpp index a32f7054e..117e36e1e 100644 --- a/tests/fs_thread_test.cpp +++ b/tests/fs_thread_test.cpp @@ -19,12 +19,12 @@ // safety, but by running enough threads and enough repetitions of // the test without error, you can be more confident. -#include <tsk3/libtsk.h> +#include <tsk/libtsk.h> #include "tsk_thread.h" // for tsk_getopt() and friends -#include "tsk3/base/tsk_base_i.h" +#include "tsk/base/tsk_base_i.h" #include <stdio.h> #include <stdlib.h> diff --git a/tests/read_apis.cpp b/tests/read_apis.cpp index e4539a737..ad706f661 100644 --- a/tests/read_apis.cpp +++ b/tests/read_apis.cpp @@ -17,7 +17,7 @@ * not all files can be tested with the latter options because the file * could be sparse or compressed. */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" static TSK_FS_FILE *s_file2; static TSK_OFF_T s_off; diff --git a/tools/autotools/Makefile.am b/tools/autotools/Makefile.am index 307f474ec..75a587912 100644 --- a/tools/autotools/Makefile.am +++ b/tools/autotools/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = -I../.. -I$(srcdir)/../.. -Wall -LDADD = ../../tsk3/libtsk3.la +LDADD = ../../tsk/libtsk.la LDFLAGS += -static EXTRA_DIST = .indent.pro diff --git a/tools/autotools/tsk_comparedir.cpp b/tools/autotools/tsk_comparedir.cpp index a7e4ba827..662c36c77 100644 --- a/tools/autotools/tsk_comparedir.cpp +++ b/tools/autotools/tsk_comparedir.cpp @@ -9,7 +9,7 @@ ** */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include "tsk_comparedir.h" #include <locale.h> #include <sys/stat.h> diff --git a/tools/autotools/tsk_gettimes.cpp b/tools/autotools/tsk_gettimes.cpp index 794e4e36e..de388a3c0 100644 --- a/tools/autotools/tsk_gettimes.cpp +++ b/tools/autotools/tsk_gettimes.cpp @@ -9,7 +9,7 @@ ** */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> #include <time.h> diff --git a/tools/autotools/tsk_loaddb.cpp b/tools/autotools/tsk_loaddb.cpp index 6bb496cfe..63c54e9eb 100644 --- a/tools/autotools/tsk_loaddb.cpp +++ b/tools/autotools/tsk_loaddb.cpp @@ -9,8 +9,8 @@ ** */ -#include "tsk3/tsk_tools_i.h" -#include "tsk3/auto/tsk_case_db.h" +#include "tsk/tsk_tools_i.h" +#include "tsk/auto/tsk_case_db.h" #include <locale.h> static TSK_TCHAR *progname; diff --git a/tools/autotools/tsk_recover.cpp b/tools/autotools/tsk_recover.cpp index 7024e9653..fdc03e2f4 100644 --- a/tools/autotools/tsk_recover.cpp +++ b/tools/autotools/tsk_recover.cpp @@ -9,7 +9,7 @@ ** */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> #include <sys/stat.h> #include <errno.h> diff --git a/tools/fiwalk/src/Makefile.am b/tools/fiwalk/src/Makefile.am index fc0d8a900..b3ae44f4a 100644 --- a/tools/fiwalk/src/Makefile.am +++ b/tools/fiwalk/src/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = fiwalk AM_CFLAGS = -Wall AM_CPPFLAGS = -I../../.. -Wall -LDADD = ../../../tsk3/libtsk3.la +LDADD = ../../../tsk/libtsk.la EXTRA_DIST = README_PLUGINS.txt ficonfig.txt \ config-simple.txt word-count-plugin.sh \ diff --git a/tools/fiwalk/src/arff.cpp b/tools/fiwalk/src/arff.cpp index 9182ef353..13fd7e734 100644 --- a/tools/fiwalk/src/arff.cpp +++ b/tools/fiwalk/src/arff.cpp @@ -17,7 +17,7 @@ * not subject to copyright. */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include "fiwalk.h" #include <sys/types.h> diff --git a/tools/fiwalk/src/base64.cpp b/tools/fiwalk/src/base64.cpp index 3acd7f2aa..3c4b38a53 100644 --- a/tools/fiwalk/src/base64.cpp +++ b/tools/fiwalk/src/base64.cpp @@ -40,7 +40,7 @@ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <stdio.h> #include <stdlib.h> diff --git a/tools/fiwalk/src/content.cpp b/tools/fiwalk/src/content.cpp index 012390430..7ca1723c5 100644 --- a/tools/fiwalk/src/content.cpp +++ b/tools/fiwalk/src/content.cpp @@ -1,4 +1,4 @@ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #ifndef __STDC_FORMAT_MACROS diff --git a/tools/fiwalk/src/dfxml.cpp b/tools/fiwalk/src/dfxml.cpp index 1165f441f..ca1efb356 100644 --- a/tools/fiwalk/src/dfxml.cpp +++ b/tools/fiwalk/src/dfxml.cpp @@ -17,7 +17,7 @@ */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include "dfxml.h" #include <errno.h> @@ -486,7 +486,7 @@ void xml::add_DFXML_build_environment() xmlout("compilation_date",buf); } #endif -#ifdef HAVE_LIBTSK3 +#ifdef HAVE_LIBTSK xmlout("library", "", std::string("name=\"tsk\" version=\"") + tsk_version_get_str() + "\"",false); #endif #ifdef HAVE_LIBAFFLIB diff --git a/tools/fiwalk/src/dfxml.h b/tools/fiwalk/src/dfxml.h index c703c0cf7..4bfcb3310 100644 --- a/tools/fiwalk/src/dfxml.h +++ b/tools/fiwalk/src/dfxml.h @@ -70,7 +70,7 @@ #endif #endif -#include "tsk3/libtsk.h" +#include "tsk/libtsk.h" #ifdef __cplusplus class xml { diff --git a/tools/fiwalk/src/fiwalk.cpp b/tools/fiwalk/src/fiwalk.cpp index 263b95862..5f4658522 100644 --- a/tools/fiwalk/src/fiwalk.cpp +++ b/tools/fiwalk/src/fiwalk.cpp @@ -33,7 +33,7 @@ /* config.h must be first */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <stdio.h> #include "fiwalk.h" diff --git a/tools/fiwalk/src/fiwalk_tsk.cpp b/tools/fiwalk/src/fiwalk_tsk.cpp index dd5448d52..ef7879930 100644 --- a/tools/fiwalk/src/fiwalk_tsk.cpp +++ b/tools/fiwalk/src/fiwalk_tsk.cpp @@ -18,12 +18,12 @@ */ /* config.h must be first */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include "fiwalk.h" #include "arff.h" #include "plugin.h" #include "unicode_escape.h" -#include "tsk3/fs/tsk_fatfs.h" +#include "tsk/fs/tsk_fatfs.h" #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS @@ -139,8 +139,8 @@ file_act(TSK_FS_FILE * fs_file, TSK_OFF_T a_off, TSK_DADDR_T addr, char *buf, return TSK_WALK_CONT; } -/* This is modeled on print_dent_act printit in ./tsk3/fs/fls_lib.c - * See also tsk_fs_name_print() in ./tsk3/fs/fs_name.c +/* This is modeled on print_dent_act printit in ./tsk/fs/fls_lib.c + * See also tsk_fs_name_print() in ./tsk/fs/fs_name.c */ static uint8_t diff --git a/tools/fiwalk/src/hexbuf.c b/tools/fiwalk/src/hexbuf.c index 024593907..ee60e48a9 100644 --- a/tools/fiwalk/src/hexbuf.c +++ b/tools/fiwalk/src/hexbuf.c @@ -3,7 +3,7 @@ * Turns a binary buffer into a hexdecimal string. */ -#include "tsk3/tsk_config.h" +#include "tsk/tsk_config.h" #include "hexbuf.h" #include <stdio.h> diff --git a/tools/fiwalk/src/plugin.cpp b/tools/fiwalk/src/plugin.cpp index 5758ddf9e..1be0afd1e 100644 --- a/tools/fiwalk/src/plugin.cpp +++ b/tools/fiwalk/src/plugin.cpp @@ -18,7 +18,7 @@ * */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #define __DARWIN_64_BIT_INO_T 1 @@ -44,7 +44,7 @@ #include <string> #include <vector> -#include <tsk3/libtsk.h> +#include <tsk/libtsk.h> #include "fiwalk.h" #include "plugin.h" diff --git a/tools/fiwalk/src/unicode_escape.cpp b/tools/fiwalk/src/unicode_escape.cpp index 0cf5e394f..ede95f7d3 100644 --- a/tools/fiwalk/src/unicode_escape.cpp +++ b/tools/fiwalk/src/unicode_escape.cpp @@ -24,7 +24,7 @@ * not subject to copyright. */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include "unicode_escape.h" #include <stdio.h> diff --git a/tools/fiwalk/src/utils.c b/tools/fiwalk/src/utils.c index 8afec6924..681ee8c66 100644 --- a/tools/fiwalk/src/utils.c +++ b/tools/fiwalk/src/utils.c @@ -11,7 +11,7 @@ #define __STDC_FORMAT_MACROS #endif -#include "tsk3/tsk_config.h" +#include "tsk/tsk_config.h" #include "utils.h" #ifdef HAVE_UNISTD_H diff --git a/tools/fstools/Makefile.am b/tools/fstools/Makefile.am index 5c9a30dbd..8c04326c3 100644 --- a/tools/fstools/Makefile.am +++ b/tools/fstools/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = -I../.. -I$(srcdir)/../.. -Wall -LDADD = ../../tsk3/libtsk3.la +LDADD = ../../tsk/libtsk.la LDFLAGS += -static EXTRA_DIST = .indent.pro fscheck.cpp diff --git a/tools/fstools/blkcalc.cpp b/tools/fstools/blkcalc.cpp index adbbf1ca3..dddd1efde 100644 --- a/tools/fstools/blkcalc.cpp +++ b/tools/fstools/blkcalc.cpp @@ -21,7 +21,7 @@ ** This software is distributed under the Common Public License 1.0 ** */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> static TSK_TCHAR *progname; diff --git a/tools/fstools/blkcat.cpp b/tools/fstools/blkcat.cpp index ada48cd09..f34fc07e2 100644 --- a/tools/fstools/blkcat.cpp +++ b/tools/fstools/blkcat.cpp @@ -19,7 +19,7 @@ ** This software is distributed under the Common Public License 1.0 ** */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> #define BLKLS_TYPE _TSK_T("blkls") diff --git a/tools/fstools/blkls.cpp b/tools/fstools/blkls.cpp index e306e8421..f9b9ce9d3 100644 --- a/tools/fstools/blkls.cpp +++ b/tools/fstools/blkls.cpp @@ -23,7 +23,7 @@ * P.O. Box 704 * Yorktown Heights, NY 10598, USA */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> static TSK_TCHAR *progname; diff --git a/tools/fstools/blkstat.cpp b/tools/fstools/blkstat.cpp index 4bb053a0e..4f8f8ddf3 100644 --- a/tools/fstools/blkstat.cpp +++ b/tools/fstools/blkstat.cpp @@ -14,7 +14,7 @@ ** This software is distributed under the Common Public License 1.0 ** */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> static TSK_TCHAR *progname; diff --git a/tools/fstools/fcat.cpp b/tools/fstools/fcat.cpp index e21c61eec..d563c1c44 100644 --- a/tools/fstools/fcat.cpp +++ b/tools/fstools/fcat.cpp @@ -8,7 +8,7 @@ ** This software is distributed under the Common Public License 1.0 **/ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> /* usage - explain and terminate */ diff --git a/tools/fstools/ffind.cpp b/tools/fstools/ffind.cpp index 32fefb87d..3c4ff22b6 100644 --- a/tools/fstools/ffind.cpp +++ b/tools/fstools/ffind.cpp @@ -18,7 +18,7 @@ ** This software is distributed under the Common Public License 1.0 ** */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> static TSK_TCHAR *progname; diff --git a/tools/fstools/fls.cpp b/tools/fstools/fls.cpp index a2231fa6e..60e7e80ef 100644 --- a/tools/fstools/fls.cpp +++ b/tools/fstools/fls.cpp @@ -19,7 +19,7 @@ ** This software is distributed under the Common Public License 1.0 ** */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> #include <time.h> diff --git a/tools/fstools/fscheck.cpp b/tools/fstools/fscheck.cpp index 0cee3c786..77d5cf623 100644 --- a/tools/fstools/fscheck.cpp +++ b/tools/fstools/fscheck.cpp @@ -7,7 +7,7 @@ ** ** This software is distributed under the Common Public License 1.0 */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" static void usage() diff --git a/tools/fstools/fsstat.cpp b/tools/fstools/fsstat.cpp index 4c35da7dc..ba9b203e2 100644 --- a/tools/fstools/fsstat.cpp +++ b/tools/fstools/fsstat.cpp @@ -12,7 +12,7 @@ ** This software is distributed under the Common Public License 1.0 */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> static TSK_TCHAR *progname; diff --git a/tools/fstools/icat.cpp b/tools/fstools/icat.cpp index 1d9d36df9..d14999651 100644 --- a/tools/fstools/icat.cpp +++ b/tools/fstools/icat.cpp @@ -21,7 +21,7 @@ * Yorktown Heights, NY 10598, USA --*/ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> /* usage - explain and terminate */ diff --git a/tools/fstools/ifind.cpp b/tools/fstools/ifind.cpp index 237f1433e..f83d7fe4c 100644 --- a/tools/fstools/ifind.cpp +++ b/tools/fstools/ifind.cpp @@ -19,7 +19,7 @@ ** */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> #include <time.h> diff --git a/tools/fstools/ils.cpp b/tools/fstools/ils.cpp index 5eca136ab..8b4522496 100644 --- a/tools/fstools/ils.cpp +++ b/tools/fstools/ils.cpp @@ -23,7 +23,7 @@ * Yorktown Heights, NY 10598, USA --*/ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> static TSK_TCHAR *progname; diff --git a/tools/fstools/istat.cpp b/tools/fstools/istat.cpp index 7076b4df1..9e80b7b60 100644 --- a/tools/fstools/istat.cpp +++ b/tools/fstools/istat.cpp @@ -18,7 +18,7 @@ ** This software is distributed under the Common Public License 1.0 ** */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> #include <time.h> diff --git a/tools/fstools/jcat.cpp b/tools/fstools/jcat.cpp index f21ee3dc0..0aed1b8ac 100644 --- a/tools/fstools/jcat.cpp +++ b/tools/fstools/jcat.cpp @@ -9,7 +9,7 @@ ** ** This software is distributed under the Common Public License 1.0 */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> #ifdef TSK_WIN32 diff --git a/tools/fstools/jls.cpp b/tools/fstools/jls.cpp index 1a993d84a..073cbb66c 100644 --- a/tools/fstools/jls.cpp +++ b/tools/fstools/jls.cpp @@ -9,7 +9,7 @@ ** This software is distributed under the Common Public License 1.0 */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> static TSK_TCHAR *progname; diff --git a/tools/hashtools/Makefile.am b/tools/hashtools/Makefile.am index 73ce5a274..957037717 100644 --- a/tools/hashtools/Makefile.am +++ b/tools/hashtools/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = -I../.. -I$(srcdir)/../.. -Wall -LDADD = ../../tsk3/libtsk3.la +LDADD = ../../tsk/libtsk.la LDFLAGS += -static EXTRA_DIST = .indent.pro md5.c sha1.c diff --git a/tools/hashtools/hfind.cpp b/tools/hashtools/hfind.cpp index 724a9bee0..0486c25b5 100644 --- a/tools/hashtools/hfind.cpp +++ b/tools/hashtools/hfind.cpp @@ -12,7 +12,7 @@ * \file hfind.c * Command line tool to index and lookup values in a hash database */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <locale.h> static TSK_TCHAR *progname; diff --git a/tools/hashtools/md5.c b/tools/hashtools/md5.c index 867ea8254..082290772 100644 --- a/tools/hashtools/md5.c +++ b/tools/hashtools/md5.c @@ -24,7 +24,7 @@ *--*/ #include <stdio.h> -#include "tsk3/libtsk.h" +#include "tsk/libtsk.h" #define MD5_HASH_LENGTH 16 diff --git a/tools/hashtools/sha1.c b/tools/hashtools/sha1.c index b10a4ae1f..4a3456255 100644 --- a/tools/hashtools/sha1.c +++ b/tools/hashtools/sha1.c @@ -31,7 +31,7 @@ effort (for example the reengineering of a great many Capstone chips). #include <stdio.h> #include <string.h> -#include "tsk3/libtsk.h" +#include "tsk/libtsk.h" #define SHA_HASH_LENGTH 20 diff --git a/tools/imgtools/Makefile.am b/tools/imgtools/Makefile.am index 0e0d04f97..4a2c291c9 100644 --- a/tools/imgtools/Makefile.am +++ b/tools/imgtools/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = -I../.. -I$(srcdir)/../.. -Wall -LDADD = ../../tsk3/libtsk3.la +LDADD = ../../tsk/libtsk.la LDFLAGS += -static EXTRA_DIST = .indent.pro diff --git a/tools/imgtools/img_cat.cpp b/tools/imgtools/img_cat.cpp index 8d0579ce2..a052a5f64 100644 --- a/tools/imgtools/img_cat.cpp +++ b/tools/imgtools/img_cat.cpp @@ -7,7 +7,7 @@ * * This software is distributed under the Common Public License 1.0 */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <errno.h> #ifdef TSK_WIN32 diff --git a/tools/imgtools/img_stat.cpp b/tools/imgtools/img_stat.cpp index d9d32b884..483505cb9 100644 --- a/tools/imgtools/img_stat.cpp +++ b/tools/imgtools/img_stat.cpp @@ -8,7 +8,7 @@ * * This software is distributed under the Common Public License 1.0 */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" static TSK_TCHAR *progname; diff --git a/tools/sorter/sorter.base b/tools/sorter/sorter.base index 2c7680e46..cef2b60ee 100644 --- a/tools/sorter/sorter.base +++ b/tools/sorter/sorter.base @@ -12,7 +12,7 @@ use strict; use integer; -my $SHARE_DIR = "$DATA_DIR/tsk3/sorter/"; +my $SHARE_DIR = "$DATA_DIR/tsk/sorter/"; my $SK_FLS = "${BIN_DIR}/fls"; my $SK_ICAT = "${BIN_DIR}/icat"; diff --git a/tools/srchtools/Makefile.am b/tools/srchtools/Makefile.am index 622837404..e7f8a7592 100644 --- a/tools/srchtools/Makefile.am +++ b/tools/srchtools/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS = -I../.. -I$(srcdir)/../.. -Wall srch_strings_SOURCES = srch_strings.c sigfind_SOURCES = sigfind.cpp -sigfind_LDADD = ../../tsk3/libtsk3.la +sigfind_LDADD = ../../tsk/libtsk.la sigfind_LDFLAGS = -static indent: diff --git a/tools/srchtools/sigfind.cpp b/tools/srchtools/sigfind.cpp index a73bac7d7..23c016473 100644 --- a/tools/srchtools/sigfind.cpp +++ b/tools/srchtools/sigfind.cpp @@ -9,7 +9,7 @@ * This software is distributed under the Common Public License 1.0 */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #include <sys/types.h> #include <sys/stat.h> diff --git a/tools/vstools/Makefile.am b/tools/vstools/Makefile.am index e55f74ddc..2ac9c2149 100644 --- a/tools/vstools/Makefile.am +++ b/tools/vstools/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = -I../.. -I$(srcdir)/../.. -Wall -LDADD = ../../tsk3/libtsk3.la +LDADD = ../../tsk/libtsk.la LDFLAGS += -static EXTRA_DIST = .indent.pro diff --git a/tools/vstools/mmcat.cpp b/tools/vstools/mmcat.cpp index 5ae5aa7fd..ce3bca39d 100644 --- a/tools/vstools/mmcat.cpp +++ b/tools/vstools/mmcat.cpp @@ -9,7 +9,7 @@ * This software is distributed under the Covson Public License 1.0 */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" #ifdef TSK_WIN32 #include <fcntl.h> diff --git a/tools/vstools/mmls.cpp b/tools/vstools/mmls.cpp index b95d30537..412f19164 100644 --- a/tools/vstools/mmls.cpp +++ b/tools/vstools/mmls.cpp @@ -9,7 +9,7 @@ * * This software is distributed under the Common Public License 1.0 */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" static TSK_TCHAR *progname; diff --git a/tools/vstools/mmstat.cpp b/tools/vstools/mmstat.cpp index ec7130f1a..60d392bdd 100644 --- a/tools/vstools/mmstat.cpp +++ b/tools/vstools/mmstat.cpp @@ -10,7 +10,7 @@ * This software is distributed under the Common Public License 1.0 */ -#include "tsk3/tsk_tools_i.h" +#include "tsk/tsk_tools_i.h" static TSK_TCHAR *progname; diff --git a/tsk3/Makefile.am b/tsk/Makefile.am similarity index 64% rename from tsk3/Makefile.am rename to tsk/Makefile.am index 04ae47daa..bd8c01466 100644 --- a/tsk3/Makefile.am +++ b/tsk/Makefile.am @@ -2,12 +2,12 @@ SUBDIRS = base img vs fs hashdb auto # Merge the libraries into one -lib_LTLIBRARIES = libtsk3.la -libtsk3_la_SOURCES = -libtsk3_la_LIBADD = base/libtskbase.la img/libtskimg.la \ +lib_LTLIBRARIES = libtsk.la +libtsk_la_SOURCES = +libtsk_la_LIBADD = base/libtskbase.la img/libtskimg.la \ vs/libtskvs.la fs/libtskfs.la hashdb/libtskhashdb.la \ auto/libtskauto.la # current:revision:age -libtsk3_la_LDFLAGS = -version-info 9:1:0 +libtsk_la_LDFLAGS = -version-info 9:1:0 EXTRA_DIST = tsk_tools_i.h docs/Doxyfile docs/*.dox docs/*.html diff --git a/tsk3/auto/.indent.pro b/tsk/auto/.indent.pro similarity index 100% rename from tsk3/auto/.indent.pro rename to tsk/auto/.indent.pro diff --git a/tsk3/auto/Makefile.am b/tsk/auto/Makefile.am similarity index 100% rename from tsk3/auto/Makefile.am rename to tsk/auto/Makefile.am diff --git a/tsk3/auto/auto.cpp b/tsk/auto/auto.cpp similarity index 99% rename from tsk3/auto/auto.cpp rename to tsk/auto/auto.cpp index 0a7034aba..5cbc8b609 100644 --- a/tsk3/auto/auto.cpp +++ b/tsk/auto/auto.cpp @@ -14,7 +14,7 @@ */ #include "tsk_auto_i.h" -#include "tsk3/fs/tsk_fatfs.h" +#include "tsk/fs/tsk_fatfs.h" // @@@ Follow through some error paths for sanity check and update docs somewhere to relfect the new scheme diff --git a/tsk3/auto/auto_db.cpp b/tsk/auto/auto_db.cpp similarity index 100% rename from tsk3/auto/auto_db.cpp rename to tsk/auto/auto_db.cpp diff --git a/tsk3/auto/case_db.cpp b/tsk/auto/case_db.cpp similarity index 100% rename from tsk3/auto/case_db.cpp rename to tsk/auto/case_db.cpp diff --git a/tsk3/auto/db_sqlite.cpp b/tsk/auto/db_sqlite.cpp similarity index 100% rename from tsk3/auto/db_sqlite.cpp rename to tsk/auto/db_sqlite.cpp diff --git a/tsk3/auto/sqlite3.c b/tsk/auto/sqlite3.c similarity index 100% rename from tsk3/auto/sqlite3.c rename to tsk/auto/sqlite3.c diff --git a/tsk3/auto/sqlite3.h b/tsk/auto/sqlite3.h similarity index 100% rename from tsk3/auto/sqlite3.h rename to tsk/auto/sqlite3.h diff --git a/tsk3/auto/tsk_auto.h b/tsk/auto/tsk_auto.h similarity index 98% rename from tsk3/auto/tsk_auto.h rename to tsk/auto/tsk_auto.h index 848a2704b..f7fc95366 100644 --- a/tsk3/auto/tsk_auto.h +++ b/tsk/auto/tsk_auto.h @@ -26,10 +26,10 @@ // Include the other TSK header files -#include "tsk3/base/tsk_base.h" -#include "tsk3/img/tsk_img.h" -#include "tsk3/vs/tsk_vs.h" -#include "tsk3/fs/tsk_fs.h" +#include "tsk/base/tsk_base.h" +#include "tsk/img/tsk_img.h" +#include "tsk/vs/tsk_vs.h" +#include "tsk/fs/tsk_fs.h" #include <string> #include <vector> diff --git a/tsk3/auto/tsk_auto_i.h b/tsk/auto/tsk_auto_i.h similarity index 81% rename from tsk3/auto/tsk_auto_i.h rename to tsk/auto/tsk_auto_i.h index b87a958af..5125b1ad6 100644 --- a/tsk3/auto/tsk_auto_i.h +++ b/tsk/auto/tsk_auto_i.h @@ -20,10 +20,10 @@ #ifdef __cplusplus // Include the other internal TSK header files -#include "tsk3/base/tsk_base_i.h" -#include "tsk3/img/tsk_img_i.h" -#include "tsk3/vs/tsk_vs_i.h" -#include "tsk3/fs/tsk_fs_i.h" +#include "tsk/base/tsk_base_i.h" +#include "tsk/img/tsk_img_i.h" +#include "tsk/vs/tsk_vs_i.h" +#include "tsk/fs/tsk_fs_i.h" // Include the external file #include "tsk_auto.h" diff --git a/tsk3/auto/tsk_case_db.h b/tsk/auto/tsk_case_db.h similarity index 99% rename from tsk3/auto/tsk_case_db.h rename to tsk/auto/tsk_case_db.h index daf450bcc..4467d2fc9 100644 --- a/tsk3/auto/tsk_case_db.h +++ b/tsk/auto/tsk_case_db.h @@ -23,7 +23,7 @@ using std::string; #include "tsk_auto_i.h" #include "tsk_db_sqlite.h" -#include "tsk3/hashdb/tsk_hashdb.h" +#include "tsk/hashdb/tsk_hashdb.h" #define TSK_ADD_IMAGE_SAVEPOINT "ADDIMAGE" diff --git a/tsk3/auto/tsk_db_sqlite.h b/tsk/auto/tsk_db_sqlite.h similarity index 100% rename from tsk3/auto/tsk_db_sqlite.h rename to tsk/auto/tsk_db_sqlite.h diff --git a/tsk3/base/.indent.pro b/tsk/base/.indent.pro similarity index 100% rename from tsk3/base/.indent.pro rename to tsk/base/.indent.pro diff --git a/tsk3/base/Makefile.am b/tsk/base/Makefile.am similarity index 100% rename from tsk3/base/Makefile.am rename to tsk/base/Makefile.am diff --git a/tsk3/base/XGetopt.c b/tsk/base/XGetopt.c similarity index 100% rename from tsk3/base/XGetopt.c rename to tsk/base/XGetopt.c diff --git a/tsk3/base/crc.c b/tsk/base/crc.c similarity index 100% rename from tsk3/base/crc.c rename to tsk/base/crc.c diff --git a/tsk3/base/crc.h b/tsk/base/crc.h similarity index 100% rename from tsk3/base/crc.h rename to tsk/base/crc.h diff --git a/tsk3/base/md5c.c b/tsk/base/md5c.c similarity index 100% rename from tsk3/base/md5c.c rename to tsk/base/md5c.c diff --git a/tsk3/base/mymalloc.c b/tsk/base/mymalloc.c similarity index 100% rename from tsk3/base/mymalloc.c rename to tsk/base/mymalloc.c diff --git a/tsk3/base/sha1c.c b/tsk/base/sha1c.c similarity index 100% rename from tsk3/base/sha1c.c rename to tsk/base/sha1c.c diff --git a/tsk/base/sha2.c b/tsk/base/sha2.c new file mode 100644 index 000000000..c019ac184 --- /dev/null +++ b/tsk/base/sha2.c @@ -0,0 +1,949 @@ +/* + * FIPS 180-2 SHA-224/256/384/512 implementation + * Last update: 02/02/2007 + * Issue date: 04/30/2005 + * + * Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +#define UNROLL_LOOPS /* Enable loops unrolling */ +#endif + +#include <string.h> + +#include "sha2.h" + +#define SHFR(x, n) (x >> n) +#define ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n))) +#define ROTL(x, n) ((x << n) | (x >> ((sizeof(x) << 3) - n))) +#define CH(x, y, z) ((x & y) ^ (~x & z)) +#define MAJ(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) + +#define SHA256_F1(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) +#define SHA256_F2(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) +#define SHA256_F3(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHFR(x, 3)) +#define SHA256_F4(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHFR(x, 10)) + +#define SHA512_F1(x) (ROTR(x, 28) ^ ROTR(x, 34) ^ ROTR(x, 39)) +#define SHA512_F2(x) (ROTR(x, 14) ^ ROTR(x, 18) ^ ROTR(x, 41)) +#define SHA512_F3(x) (ROTR(x, 1) ^ ROTR(x, 8) ^ SHFR(x, 7)) +#define SHA512_F4(x) (ROTR(x, 19) ^ ROTR(x, 61) ^ SHFR(x, 6)) + +#define UNPACK32(x, str) \ +{ \ + *((str) + 3) = (uint8) ((x) ); \ + *((str) + 2) = (uint8) ((x) >> 8); \ + *((str) + 1) = (uint8) ((x) >> 16); \ + *((str) + 0) = (uint8) ((x) >> 24); \ +} + +#define PACK32(str, x) \ +{ \ + *(x) = ((uint32) *((str) + 3) ) \ + | ((uint32) *((str) + 2) << 8) \ + | ((uint32) *((str) + 1) << 16) \ + | ((uint32) *((str) + 0) << 24); \ +} + +#define UNPACK64(x, str) \ +{ \ + *((str) + 7) = (uint8) ((x) ); \ + *((str) + 6) = (uint8) ((x) >> 8); \ + *((str) + 5) = (uint8) ((x) >> 16); \ + *((str) + 4) = (uint8) ((x) >> 24); \ + *((str) + 3) = (uint8) ((x) >> 32); \ + *((str) + 2) = (uint8) ((x) >> 40); \ + *((str) + 1) = (uint8) ((x) >> 48); \ + *((str) + 0) = (uint8) ((x) >> 56); \ +} + +#define PACK64(str, x) \ +{ \ + *(x) = ((uint64) *((str) + 7) ) \ + | ((uint64) *((str) + 6) << 8) \ + | ((uint64) *((str) + 5) << 16) \ + | ((uint64) *((str) + 4) << 24) \ + | ((uint64) *((str) + 3) << 32) \ + | ((uint64) *((str) + 2) << 40) \ + | ((uint64) *((str) + 1) << 48) \ + | ((uint64) *((str) + 0) << 56); \ +} + +/* Macros used for loops unrolling */ + +#define SHA256_SCR(i) \ +{ \ + w[i] = SHA256_F4(w[i - 2]) + w[i - 7] \ + + SHA256_F3(w[i - 15]) + w[i - 16]; \ +} + +#define SHA512_SCR(i) \ +{ \ + w[i] = SHA512_F4(w[i - 2]) + w[i - 7] \ + + SHA512_F3(w[i - 15]) + w[i - 16]; \ +} + +#define SHA256_EXP(a, b, c, d, e, f, g, h, j) \ +{ \ + t1 = wv[h] + SHA256_F2(wv[e]) + CH(wv[e], wv[f], wv[g]) \ + + sha256_k[j] + w[j]; \ + t2 = SHA256_F1(wv[a]) + MAJ(wv[a], wv[b], wv[c]); \ + wv[d] += t1; \ + wv[h] = t1 + t2; \ +} + +#define SHA512_EXP(a, b, c, d, e, f, g ,h, j) \ +{ \ + t1 = wv[h] + SHA512_F2(wv[e]) + CH(wv[e], wv[f], wv[g]) \ + + sha512_k[j] + w[j]; \ + t2 = SHA512_F1(wv[a]) + MAJ(wv[a], wv[b], wv[c]); \ + wv[d] += t1; \ + wv[h] = t1 + t2; \ +} + +uint32 sha224_h0[8] = + {0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4}; + +uint32 sha256_h0[8] = + {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19}; + +uint64 sha384_h0[8] = + {0xcbbb9d5dc1059ed8ULL, 0x629a292a367cd507ULL, + 0x9159015a3070dd17ULL, 0x152fecd8f70e5939ULL, + 0x67332667ffc00b31ULL, 0x8eb44a8768581511ULL, + 0xdb0c2e0d64f98fa7ULL, 0x47b5481dbefa4fa4ULL}; + +uint64 sha512_h0[8] = + {0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, + 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, + 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, + 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL}; + +uint32 sha256_k[64] = + {0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2}; + +uint64 sha512_k[80] = + {0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, + 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, + 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, + 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, + 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, + 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, + 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, + 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, + 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, + 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, + 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, + 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, + 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, + 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, + 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, + 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, + 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, + 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, + 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, + 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, + 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, + 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, + 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, + 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, + 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, + 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, + 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, + 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, + 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, + 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, + 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, + 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, + 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, + 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, + 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, + 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, + 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, + 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, + 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, + 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL}; + +/* SHA-256 functions */ + +void sha256_transf(SHA256_CTX *ctx, const unsigned char *message, + unsigned int block_nb) +{ + uint32 w[64]; + uint32 wv[8]; + uint32 t1, t2; + const unsigned char *sub_block; + int i; + +#ifndef UNROLL_LOOPS + int j; +#endif + + for (i = 0; i < (int) block_nb; i++) { + sub_block = message + (i << 6); + +#ifndef UNROLL_LOOPS + for (j = 0; j < 16; j++) { + PACK32(&sub_block[j << 2], &w[j]); + } + + for (j = 16; j < 64; j++) { + SHA256_SCR(j); + } + + for (j = 0; j < 8; j++) { + wv[j] = ctx->h[j]; + } + + for (j = 0; j < 64; j++) { + t1 = wv[7] + SHA256_F2(wv[4]) + CH(wv[4], wv[5], wv[6]) + + sha256_k[j] + w[j]; + t2 = SHA256_F1(wv[0]) + MAJ(wv[0], wv[1], wv[2]); + wv[7] = wv[6]; + wv[6] = wv[5]; + wv[5] = wv[4]; + wv[4] = wv[3] + t1; + wv[3] = wv[2]; + wv[2] = wv[1]; + wv[1] = wv[0]; + wv[0] = t1 + t2; + } + + for (j = 0; j < 8; j++) { + ctx->h[j] += wv[j]; + } +#else + PACK32(&sub_block[ 0], &w[ 0]); PACK32(&sub_block[ 4], &w[ 1]); + PACK32(&sub_block[ 8], &w[ 2]); PACK32(&sub_block[12], &w[ 3]); + PACK32(&sub_block[16], &w[ 4]); PACK32(&sub_block[20], &w[ 5]); + PACK32(&sub_block[24], &w[ 6]); PACK32(&sub_block[28], &w[ 7]); + PACK32(&sub_block[32], &w[ 8]); PACK32(&sub_block[36], &w[ 9]); + PACK32(&sub_block[40], &w[10]); PACK32(&sub_block[44], &w[11]); + PACK32(&sub_block[48], &w[12]); PACK32(&sub_block[52], &w[13]); + PACK32(&sub_block[56], &w[14]); PACK32(&sub_block[60], &w[15]); + + SHA256_SCR(16); SHA256_SCR(17); SHA256_SCR(18); SHA256_SCR(19); + SHA256_SCR(20); SHA256_SCR(21); SHA256_SCR(22); SHA256_SCR(23); + SHA256_SCR(24); SHA256_SCR(25); SHA256_SCR(26); SHA256_SCR(27); + SHA256_SCR(28); SHA256_SCR(29); SHA256_SCR(30); SHA256_SCR(31); + SHA256_SCR(32); SHA256_SCR(33); SHA256_SCR(34); SHA256_SCR(35); + SHA256_SCR(36); SHA256_SCR(37); SHA256_SCR(38); SHA256_SCR(39); + SHA256_SCR(40); SHA256_SCR(41); SHA256_SCR(42); SHA256_SCR(43); + SHA256_SCR(44); SHA256_SCR(45); SHA256_SCR(46); SHA256_SCR(47); + SHA256_SCR(48); SHA256_SCR(49); SHA256_SCR(50); SHA256_SCR(51); + SHA256_SCR(52); SHA256_SCR(53); SHA256_SCR(54); SHA256_SCR(55); + SHA256_SCR(56); SHA256_SCR(57); SHA256_SCR(58); SHA256_SCR(59); + SHA256_SCR(60); SHA256_SCR(61); SHA256_SCR(62); SHA256_SCR(63); + + wv[0] = ctx->h[0]; wv[1] = ctx->h[1]; + wv[2] = ctx->h[2]; wv[3] = ctx->h[3]; + wv[4] = ctx->h[4]; wv[5] = ctx->h[5]; + wv[6] = ctx->h[6]; wv[7] = ctx->h[7]; + + SHA256_EXP(0,1,2,3,4,5,6,7, 0); SHA256_EXP(7,0,1,2,3,4,5,6, 1); + SHA256_EXP(6,7,0,1,2,3,4,5, 2); SHA256_EXP(5,6,7,0,1,2,3,4, 3); + SHA256_EXP(4,5,6,7,0,1,2,3, 4); SHA256_EXP(3,4,5,6,7,0,1,2, 5); + SHA256_EXP(2,3,4,5,6,7,0,1, 6); SHA256_EXP(1,2,3,4,5,6,7,0, 7); + SHA256_EXP(0,1,2,3,4,5,6,7, 8); SHA256_EXP(7,0,1,2,3,4,5,6, 9); + SHA256_EXP(6,7,0,1,2,3,4,5,10); SHA256_EXP(5,6,7,0,1,2,3,4,11); + SHA256_EXP(4,5,6,7,0,1,2,3,12); SHA256_EXP(3,4,5,6,7,0,1,2,13); + SHA256_EXP(2,3,4,5,6,7,0,1,14); SHA256_EXP(1,2,3,4,5,6,7,0,15); + SHA256_EXP(0,1,2,3,4,5,6,7,16); SHA256_EXP(7,0,1,2,3,4,5,6,17); + SHA256_EXP(6,7,0,1,2,3,4,5,18); SHA256_EXP(5,6,7,0,1,2,3,4,19); + SHA256_EXP(4,5,6,7,0,1,2,3,20); SHA256_EXP(3,4,5,6,7,0,1,2,21); + SHA256_EXP(2,3,4,5,6,7,0,1,22); SHA256_EXP(1,2,3,4,5,6,7,0,23); + SHA256_EXP(0,1,2,3,4,5,6,7,24); SHA256_EXP(7,0,1,2,3,4,5,6,25); + SHA256_EXP(6,7,0,1,2,3,4,5,26); SHA256_EXP(5,6,7,0,1,2,3,4,27); + SHA256_EXP(4,5,6,7,0,1,2,3,28); SHA256_EXP(3,4,5,6,7,0,1,2,29); + SHA256_EXP(2,3,4,5,6,7,0,1,30); SHA256_EXP(1,2,3,4,5,6,7,0,31); + SHA256_EXP(0,1,2,3,4,5,6,7,32); SHA256_EXP(7,0,1,2,3,4,5,6,33); + SHA256_EXP(6,7,0,1,2,3,4,5,34); SHA256_EXP(5,6,7,0,1,2,3,4,35); + SHA256_EXP(4,5,6,7,0,1,2,3,36); SHA256_EXP(3,4,5,6,7,0,1,2,37); + SHA256_EXP(2,3,4,5,6,7,0,1,38); SHA256_EXP(1,2,3,4,5,6,7,0,39); + SHA256_EXP(0,1,2,3,4,5,6,7,40); SHA256_EXP(7,0,1,2,3,4,5,6,41); + SHA256_EXP(6,7,0,1,2,3,4,5,42); SHA256_EXP(5,6,7,0,1,2,3,4,43); + SHA256_EXP(4,5,6,7,0,1,2,3,44); SHA256_EXP(3,4,5,6,7,0,1,2,45); + SHA256_EXP(2,3,4,5,6,7,0,1,46); SHA256_EXP(1,2,3,4,5,6,7,0,47); + SHA256_EXP(0,1,2,3,4,5,6,7,48); SHA256_EXP(7,0,1,2,3,4,5,6,49); + SHA256_EXP(6,7,0,1,2,3,4,5,50); SHA256_EXP(5,6,7,0,1,2,3,4,51); + SHA256_EXP(4,5,6,7,0,1,2,3,52); SHA256_EXP(3,4,5,6,7,0,1,2,53); + SHA256_EXP(2,3,4,5,6,7,0,1,54); SHA256_EXP(1,2,3,4,5,6,7,0,55); + SHA256_EXP(0,1,2,3,4,5,6,7,56); SHA256_EXP(7,0,1,2,3,4,5,6,57); + SHA256_EXP(6,7,0,1,2,3,4,5,58); SHA256_EXP(5,6,7,0,1,2,3,4,59); + SHA256_EXP(4,5,6,7,0,1,2,3,60); SHA256_EXP(3,4,5,6,7,0,1,2,61); + SHA256_EXP(2,3,4,5,6,7,0,1,62); SHA256_EXP(1,2,3,4,5,6,7,0,63); + + ctx->h[0] += wv[0]; ctx->h[1] += wv[1]; + ctx->h[2] += wv[2]; ctx->h[3] += wv[3]; + ctx->h[4] += wv[4]; ctx->h[5] += wv[5]; + ctx->h[6] += wv[6]; ctx->h[7] += wv[7]; +#endif /* !UNROLL_LOOPS */ + } +} + +void SHA256(const unsigned char *message, unsigned int len, unsigned char *digest) +{ + SHA256_CTX ctx; + + SHA256_Init(&ctx); + SHA256_Update(&ctx, message, len); + SHA256_Final(&ctx, digest); +} + +void SHA256_Init(SHA256_CTX *ctx) +{ +#ifndef UNROLL_LOOPS + int i; + for (i = 0; i < 8; i++) { + ctx->h[i] = sha256_h0[i]; + } +#else + ctx->h[0] = sha256_h0[0]; ctx->h[1] = sha256_h0[1]; + ctx->h[2] = sha256_h0[2]; ctx->h[3] = sha256_h0[3]; + ctx->h[4] = sha256_h0[4]; ctx->h[5] = sha256_h0[5]; + ctx->h[6] = sha256_h0[6]; ctx->h[7] = sha256_h0[7]; +#endif /* !UNROLL_LOOPS */ + + ctx->len = 0; + ctx->tot_len = 0; +} + +void SHA256_Update(SHA256_CTX *ctx, const unsigned char *message, + unsigned int len) +{ + unsigned int block_nb; + unsigned int new_len, rem_len, tmp_len; + const unsigned char *shifted_message; + + tmp_len = SHA256_BLOCK_SIZE - ctx->len; + rem_len = len < tmp_len ? len : tmp_len; + + memcpy(&ctx->block[ctx->len], message, rem_len); + + if (ctx->len + len < SHA256_BLOCK_SIZE) { + ctx->len += len; + return; + } + + new_len = len - rem_len; + block_nb = new_len / SHA256_BLOCK_SIZE; + + shifted_message = message + rem_len; + + sha256_transf(ctx, ctx->block, 1); + sha256_transf(ctx, shifted_message, block_nb); + + rem_len = new_len % SHA256_BLOCK_SIZE; + + memcpy(ctx->block, &shifted_message[block_nb << 6], + rem_len); + + ctx->len = rem_len; + ctx->tot_len += (block_nb + 1) << 6; +} + +void SHA256_Final(SHA256_CTX *ctx, unsigned char *digest) +{ + unsigned int block_nb; + unsigned int pm_len; + unsigned int len_b; + +#ifndef UNROLL_LOOPS + int i; +#endif + + block_nb = (1 + ((SHA256_BLOCK_SIZE - 9) + < (ctx->len % SHA256_BLOCK_SIZE))); + + len_b = (ctx->tot_len + ctx->len) << 3; + pm_len = block_nb << 6; + + memset(ctx->block + ctx->len, 0, pm_len - ctx->len); + ctx->block[ctx->len] = 0x80; + UNPACK32(len_b, ctx->block + pm_len - 4); + + sha256_transf(ctx, ctx->block, block_nb); + +#ifndef UNROLL_LOOPS + for (i = 0 ; i < 8; i++) { + UNPACK32(ctx->h[i], &digest[i << 2]); + } +#else + UNPACK32(ctx->h[0], &digest[ 0]); + UNPACK32(ctx->h[1], &digest[ 4]); + UNPACK32(ctx->h[2], &digest[ 8]); + UNPACK32(ctx->h[3], &digest[12]); + UNPACK32(ctx->h[4], &digest[16]); + UNPACK32(ctx->h[5], &digest[20]); + UNPACK32(ctx->h[6], &digest[24]); + UNPACK32(ctx->h[7], &digest[28]); +#endif /* !UNROLL_LOOPS */ +} + +/* SHA-512 functions */ + +void sha512_transf(SHA512_CTX *ctx, const unsigned char *message, + unsigned int block_nb) +{ + uint64 w[80]; + uint64 wv[8]; + uint64 t1, t2; + const unsigned char *sub_block; + int i, j; + + for (i = 0; i < (int) block_nb; i++) { + sub_block = message + (i << 7); + +#ifndef UNROLL_LOOPS + for (j = 0; j < 16; j++) { + PACK64(&sub_block[j << 3], &w[j]); + } + + for (j = 16; j < 80; j++) { + SHA512_SCR(j); + } + + for (j = 0; j < 8; j++) { + wv[j] = ctx->h[j]; + } + + for (j = 0; j < 80; j++) { + t1 = wv[7] + SHA512_F2(wv[4]) + CH(wv[4], wv[5], wv[6]) + + sha512_k[j] + w[j]; + t2 = SHA512_F1(wv[0]) + MAJ(wv[0], wv[1], wv[2]); + wv[7] = wv[6]; + wv[6] = wv[5]; + wv[5] = wv[4]; + wv[4] = wv[3] + t1; + wv[3] = wv[2]; + wv[2] = wv[1]; + wv[1] = wv[0]; + wv[0] = t1 + t2; + } + + for (j = 0; j < 8; j++) { + ctx->h[j] += wv[j]; + } +#else + PACK64(&sub_block[ 0], &w[ 0]); PACK64(&sub_block[ 8], &w[ 1]); + PACK64(&sub_block[ 16], &w[ 2]); PACK64(&sub_block[ 24], &w[ 3]); + PACK64(&sub_block[ 32], &w[ 4]); PACK64(&sub_block[ 40], &w[ 5]); + PACK64(&sub_block[ 48], &w[ 6]); PACK64(&sub_block[ 56], &w[ 7]); + PACK64(&sub_block[ 64], &w[ 8]); PACK64(&sub_block[ 72], &w[ 9]); + PACK64(&sub_block[ 80], &w[10]); PACK64(&sub_block[ 88], &w[11]); + PACK64(&sub_block[ 96], &w[12]); PACK64(&sub_block[104], &w[13]); + PACK64(&sub_block[112], &w[14]); PACK64(&sub_block[120], &w[15]); + + SHA512_SCR(16); SHA512_SCR(17); SHA512_SCR(18); SHA512_SCR(19); + SHA512_SCR(20); SHA512_SCR(21); SHA512_SCR(22); SHA512_SCR(23); + SHA512_SCR(24); SHA512_SCR(25); SHA512_SCR(26); SHA512_SCR(27); + SHA512_SCR(28); SHA512_SCR(29); SHA512_SCR(30); SHA512_SCR(31); + SHA512_SCR(32); SHA512_SCR(33); SHA512_SCR(34); SHA512_SCR(35); + SHA512_SCR(36); SHA512_SCR(37); SHA512_SCR(38); SHA512_SCR(39); + SHA512_SCR(40); SHA512_SCR(41); SHA512_SCR(42); SHA512_SCR(43); + SHA512_SCR(44); SHA512_SCR(45); SHA512_SCR(46); SHA512_SCR(47); + SHA512_SCR(48); SHA512_SCR(49); SHA512_SCR(50); SHA512_SCR(51); + SHA512_SCR(52); SHA512_SCR(53); SHA512_SCR(54); SHA512_SCR(55); + SHA512_SCR(56); SHA512_SCR(57); SHA512_SCR(58); SHA512_SCR(59); + SHA512_SCR(60); SHA512_SCR(61); SHA512_SCR(62); SHA512_SCR(63); + SHA512_SCR(64); SHA512_SCR(65); SHA512_SCR(66); SHA512_SCR(67); + SHA512_SCR(68); SHA512_SCR(69); SHA512_SCR(70); SHA512_SCR(71); + SHA512_SCR(72); SHA512_SCR(73); SHA512_SCR(74); SHA512_SCR(75); + SHA512_SCR(76); SHA512_SCR(77); SHA512_SCR(78); SHA512_SCR(79); + + wv[0] = ctx->h[0]; wv[1] = ctx->h[1]; + wv[2] = ctx->h[2]; wv[3] = ctx->h[3]; + wv[4] = ctx->h[4]; wv[5] = ctx->h[5]; + wv[6] = ctx->h[6]; wv[7] = ctx->h[7]; + + j = 0; + + do { + SHA512_EXP(0,1,2,3,4,5,6,7,j); j++; + SHA512_EXP(7,0,1,2,3,4,5,6,j); j++; + SHA512_EXP(6,7,0,1,2,3,4,5,j); j++; + SHA512_EXP(5,6,7,0,1,2,3,4,j); j++; + SHA512_EXP(4,5,6,7,0,1,2,3,j); j++; + SHA512_EXP(3,4,5,6,7,0,1,2,j); j++; + SHA512_EXP(2,3,4,5,6,7,0,1,j); j++; + SHA512_EXP(1,2,3,4,5,6,7,0,j); j++; + } while (j < 80); + + ctx->h[0] += wv[0]; ctx->h[1] += wv[1]; + ctx->h[2] += wv[2]; ctx->h[3] += wv[3]; + ctx->h[4] += wv[4]; ctx->h[5] += wv[5]; + ctx->h[6] += wv[6]; ctx->h[7] += wv[7]; +#endif /* !UNROLL_LOOPS */ + } +} + +void SHA512(const unsigned char *message, unsigned int len, + unsigned char *digest) +{ + SHA512_CTX ctx; + + SHA512_Init(&ctx); + SHA512_Update(&ctx, message, len); + SHA512_Final(&ctx, digest); +} + +void SHA512_Init(SHA512_CTX *ctx) +{ +#ifndef UNROLL_LOOPS + int i; + for (i = 0; i < 8; i++) { + ctx->h[i] = sha512_h0[i]; + } +#else + ctx->h[0] = sha512_h0[0]; ctx->h[1] = sha512_h0[1]; + ctx->h[2] = sha512_h0[2]; ctx->h[3] = sha512_h0[3]; + ctx->h[4] = sha512_h0[4]; ctx->h[5] = sha512_h0[5]; + ctx->h[6] = sha512_h0[6]; ctx->h[7] = sha512_h0[7]; +#endif /* !UNROLL_LOOPS */ + + ctx->len = 0; + ctx->tot_len = 0; +} + +void SHA512_Update(SHA512_CTX *ctx, const unsigned char *message, + unsigned int len) +{ + unsigned int block_nb; + unsigned int new_len, rem_len, tmp_len; + const unsigned char *shifted_message; + + tmp_len = SHA512_BLOCK_SIZE - ctx->len; + rem_len = len < tmp_len ? len : tmp_len; + + memcpy(&ctx->block[ctx->len], message, rem_len); + + if (ctx->len + len < SHA512_BLOCK_SIZE) { + ctx->len += len; + return; + } + + new_len = len - rem_len; + block_nb = new_len / SHA512_BLOCK_SIZE; + + shifted_message = message + rem_len; + + sha512_transf(ctx, ctx->block, 1); + sha512_transf(ctx, shifted_message, block_nb); + + rem_len = new_len % SHA512_BLOCK_SIZE; + + memcpy(ctx->block, &shifted_message[block_nb << 7], + rem_len); + + ctx->len = rem_len; + ctx->tot_len += (block_nb + 1) << 7; +} + +void SHA512_Final(SHA512_CTX *ctx, unsigned char *digest) +{ + unsigned int block_nb; + unsigned int pm_len; + unsigned int len_b; + +#ifndef UNROLL_LOOPS + int i; +#endif + + block_nb = 1 + ((SHA512_BLOCK_SIZE - 17) + < (ctx->len % SHA512_BLOCK_SIZE)); + + len_b = (ctx->tot_len + ctx->len) << 3; + pm_len = block_nb << 7; + + memset(ctx->block + ctx->len, 0, pm_len - ctx->len); + ctx->block[ctx->len] = 0x80; + UNPACK32(len_b, ctx->block + pm_len - 4); + + sha512_transf(ctx, ctx->block, block_nb); + +#ifndef UNROLL_LOOPS + for (i = 0 ; i < 8; i++) { + UNPACK64(ctx->h[i], &digest[i << 3]); + } +#else + UNPACK64(ctx->h[0], &digest[ 0]); + UNPACK64(ctx->h[1], &digest[ 8]); + UNPACK64(ctx->h[2], &digest[16]); + UNPACK64(ctx->h[3], &digest[24]); + UNPACK64(ctx->h[4], &digest[32]); + UNPACK64(ctx->h[5], &digest[40]); + UNPACK64(ctx->h[6], &digest[48]); + UNPACK64(ctx->h[7], &digest[56]); +#endif /* !UNROLL_LOOPS */ +} + +/* SHA-384 functions */ + +void SHA384(const unsigned char *message, unsigned int len, + unsigned char *digest) +{ + SHA384_CTX ctx; + + SHA384_Init(&ctx); + SHA384_Update(&ctx, message, len); + SHA384_Final(&ctx, digest); +} + +void SHA384_Init(SHA384_CTX *ctx) +{ +#ifndef UNROLL_LOOPS + int i; + for (i = 0; i < 8; i++) { + ctx->h[i] = sha384_h0[i]; + } +#else + ctx->h[0] = sha384_h0[0]; ctx->h[1] = sha384_h0[1]; + ctx->h[2] = sha384_h0[2]; ctx->h[3] = sha384_h0[3]; + ctx->h[4] = sha384_h0[4]; ctx->h[5] = sha384_h0[5]; + ctx->h[6] = sha384_h0[6]; ctx->h[7] = sha384_h0[7]; +#endif /* !UNROLL_LOOPS */ + + ctx->len = 0; + ctx->tot_len = 0; +} + +void SHA384_Update(SHA384_CTX *ctx, const unsigned char *message, + unsigned int len) +{ + unsigned int block_nb; + unsigned int new_len, rem_len, tmp_len; + const unsigned char *shifted_message; + + tmp_len = SHA384_BLOCK_SIZE - ctx->len; + rem_len = len < tmp_len ? len : tmp_len; + + memcpy(&ctx->block[ctx->len], message, rem_len); + + if (ctx->len + len < SHA384_BLOCK_SIZE) { + ctx->len += len; + return; + } + + new_len = len - rem_len; + block_nb = new_len / SHA384_BLOCK_SIZE; + + shifted_message = message + rem_len; + + sha512_transf(ctx, ctx->block, 1); + sha512_transf(ctx, shifted_message, block_nb); + + rem_len = new_len % SHA384_BLOCK_SIZE; + + memcpy(ctx->block, &shifted_message[block_nb << 7], + rem_len); + + ctx->len = rem_len; + ctx->tot_len += (block_nb + 1) << 7; +} + +void SHA384_Final(SHA384_CTX *ctx, unsigned char *digest) +{ + unsigned int block_nb; + unsigned int pm_len; + unsigned int len_b; + +#ifndef UNROLL_LOOPS + int i; +#endif + + block_nb = (1 + ((SHA384_BLOCK_SIZE - 17) + < (ctx->len % SHA384_BLOCK_SIZE))); + + len_b = (ctx->tot_len + ctx->len) << 3; + pm_len = block_nb << 7; + + memset(ctx->block + ctx->len, 0, pm_len - ctx->len); + ctx->block[ctx->len] = 0x80; + UNPACK32(len_b, ctx->block + pm_len - 4); + + sha512_transf(ctx, ctx->block, block_nb); + +#ifndef UNROLL_LOOPS + for (i = 0 ; i < 6; i++) { + UNPACK64(ctx->h[i], &digest[i << 3]); + } +#else + UNPACK64(ctx->h[0], &digest[ 0]); + UNPACK64(ctx->h[1], &digest[ 8]); + UNPACK64(ctx->h[2], &digest[16]); + UNPACK64(ctx->h[3], &digest[24]); + UNPACK64(ctx->h[4], &digest[32]); + UNPACK64(ctx->h[5], &digest[40]); +#endif /* !UNROLL_LOOPS */ +} + +/* SHA-224 functions */ + +void SHA224(const unsigned char *message, unsigned int len, + unsigned char *digest) +{ + SHA224_CTX ctx; + + SHA224_Init(&ctx); + SHA224_Update(&ctx, message, len); + SHA224_Final(&ctx, digest); +} + +void SHA224_Init(SHA224_CTX *ctx) +{ +#ifndef UNROLL_LOOPS + int i; + for (i = 0; i < 8; i++) { + ctx->h[i] = sha224_h0[i]; + } +#else + ctx->h[0] = sha224_h0[0]; ctx->h[1] = sha224_h0[1]; + ctx->h[2] = sha224_h0[2]; ctx->h[3] = sha224_h0[3]; + ctx->h[4] = sha224_h0[4]; ctx->h[5] = sha224_h0[5]; + ctx->h[6] = sha224_h0[6]; ctx->h[7] = sha224_h0[7]; +#endif /* !UNROLL_LOOPS */ + + ctx->len = 0; + ctx->tot_len = 0; +} + +void SHA224_Update(SHA224_CTX *ctx, const unsigned char *message, + unsigned int len) +{ + unsigned int block_nb; + unsigned int new_len, rem_len, tmp_len; + const unsigned char *shifted_message; + + tmp_len = SHA224_BLOCK_SIZE - ctx->len; + rem_len = len < tmp_len ? len : tmp_len; + + memcpy(&ctx->block[ctx->len], message, rem_len); + + if (ctx->len + len < SHA224_BLOCK_SIZE) { + ctx->len += len; + return; + } + + new_len = len - rem_len; + block_nb = new_len / SHA224_BLOCK_SIZE; + + shifted_message = message + rem_len; + + sha256_transf(ctx, ctx->block, 1); + sha256_transf(ctx, shifted_message, block_nb); + + rem_len = new_len % SHA224_BLOCK_SIZE; + + memcpy(ctx->block, &shifted_message[block_nb << 6], + rem_len); + + ctx->len = rem_len; + ctx->tot_len += (block_nb + 1) << 6; +} + +void SHA224_Final(SHA224_CTX *ctx, unsigned char *digest) +{ + unsigned int block_nb; + unsigned int pm_len; + unsigned int len_b; + +#ifndef UNROLL_LOOPS + int i; +#endif + + block_nb = (1 + ((SHA224_BLOCK_SIZE - 9) + < (ctx->len % SHA224_BLOCK_SIZE))); + + len_b = (ctx->tot_len + ctx->len) << 3; + pm_len = block_nb << 6; + + memset(ctx->block + ctx->len, 0, pm_len - ctx->len); + ctx->block[ctx->len] = 0x80; + UNPACK32(len_b, ctx->block + pm_len - 4); + + sha256_transf(ctx, ctx->block, block_nb); + +#ifndef UNROLL_LOOPS + for (i = 0 ; i < 7; i++) { + UNPACK32(ctx->h[i], &digest[i << 2]); + } +#else + UNPACK32(ctx->h[0], &digest[ 0]); + UNPACK32(ctx->h[1], &digest[ 4]); + UNPACK32(ctx->h[2], &digest[ 8]); + UNPACK32(ctx->h[3], &digest[12]); + UNPACK32(ctx->h[4], &digest[16]); + UNPACK32(ctx->h[5], &digest[20]); + UNPACK32(ctx->h[6], &digest[24]); +#endif /* !UNROLL_LOOPS */ +} + +#ifdef TEST_VECTORS + +/* FIPS 180-2 Validation tests */ + +#include <stdio.h> +#include <stdlib.h> + +void test(const char *vector, unsigned char *digest, + unsigned int digest_size) +{ + char output[2 * SHA512_DIGEST_SIZE + 1]; + int i; + + output[2 * digest_size] = '\0'; + + for (i = 0; i < (int) digest_size ; i++) { + sprintf(output + 2 * i, "%02x", digest[i]); + } + + printf("H: %s\n", output); + if (strcmp(vector, output)) { + fprintf(stderr, "Test failed.\n"); + exit(EXIT_FAILURE); + } +} + +int main(void) +{ + static const char *vectors[4][3] = + { /* SHA-224 */ + { + "23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7", + "75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525", + "20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67", + }, + /* SHA-256 */ + { + "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad", + "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1", + "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0", + }, + /* SHA-384 */ + { + "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed" + "8086072ba1e7cc2358baeca134c825a7", + "09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712" + "fcc7c71a557e2db966c3e9fa91746039", + "9d0e1809716474cb086e834e310a4a1ced149e9c00f248527972cec5704c2a5b" + "07b8b3dc38ecc4ebae97ddd87f3d8985", + }, + /* SHA-512 */ + { + "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a" + "2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f", + "8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018" + "501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909", + "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb" + "de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b" + } + }; + + static const char message1[] = "abc"; + static const char message2a[] = "abcdbcdecdefdefgefghfghighijhi" + "jkijkljklmklmnlmnomnopnopq"; + static const char message2b[] = "abcdefghbcdefghicdefghijdefghijkefghij" + "klfghijklmghijklmnhijklmnoijklmnopjklm" + "nopqklmnopqrlmnopqrsmnopqrstnopqrstu"; + unsigned char *message3; + unsigned int message3_len = 1000000; + unsigned char digest[SHA512_DIGEST_SIZE]; + + message3 = malloc(message3_len); + if (message3 == NULL) { + fprintf(stderr, "Can't allocate memory\n"); + return -1; + } + memset(message3, 'a', message3_len); + + printf("SHA-2 FIPS 180-2 Validation tests\n\n"); + printf("SHA-224 Test vectors\n"); + + sha224((const unsigned char *) message1, strlen(message1), digest); + test(vectors[0][0], digest, SHA224_DIGEST_SIZE); + sha224((const unsigned char *) message2a, strlen(message2a), digest); + test(vectors[0][1], digest, SHA224_DIGEST_SIZE); + sha224(message3, message3_len, digest); + test(vectors[0][2], digest, SHA224_DIGEST_SIZE); + printf("\n"); + + printf("SHA-256 Test vectors\n"); + + sha256((const unsigned char *) message1, strlen(message1), digest); + test(vectors[1][0], digest, SHA256_DIGEST_SIZE); + sha256((const unsigned char *) message2a, strlen(message2a), digest); + test(vectors[1][1], digest, SHA256_DIGEST_SIZE); + sha256(message3, message3_len, digest); + test(vectors[1][2], digest, SHA256_DIGEST_SIZE); + printf("\n"); + + printf("SHA-384 Test vectors\n"); + + sha384((const unsigned char *) message1, strlen(message1), digest); + test(vectors[2][0], digest, SHA384_DIGEST_SIZE); + sha384((const unsigned char *)message2b, strlen(message2b), digest); + test(vectors[2][1], digest, SHA384_DIGEST_SIZE); + sha384(message3, message3_len, digest); + test(vectors[2][2], digest, SHA384_DIGEST_SIZE); + printf("\n"); + + printf("SHA-512 Test vectors\n"); + + sha512((const unsigned char *) message1, strlen(message1), digest); + test(vectors[3][0], digest, SHA512_DIGEST_SIZE); + sha512((const unsigned char *) message2b, strlen(message2b), digest); + test(vectors[3][1], digest, SHA512_DIGEST_SIZE); + sha512(message3, message3_len, digest); + test(vectors[3][2], digest, SHA512_DIGEST_SIZE); + printf("\n"); + + printf("All tests passed.\n"); + + return 0; +} + +#endif /* TEST_VECTORS */ + diff --git a/tsk/base/sha2.h b/tsk/base/sha2.h new file mode 100644 index 000000000..186e8183f --- /dev/null +++ b/tsk/base/sha2.h @@ -0,0 +1,108 @@ +/* + * FIPS 180-2 SHA-224/256/384/512 implementation + * Last update: 02/02/2007 + * Issue date: 04/30/2005 + * + * Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef SHA2_H +#define SHA2_H + +#define SHA224_DIGEST_LENGTH ( 224 / 8) +#define SHA256_DIGEST_LENGTH ( 256 / 8) +#define SHA384_DIGEST_LENGTH ( 384 / 8) +#define SHA512_DIGEST_LENGTH ( 512 / 8) + +#define SHA256_BLOCK_SIZE ( 512 / 8) +#define SHA512_BLOCK_SIZE (1024 / 8) +#define SHA384_BLOCK_SIZE SHA512_BLOCK_SIZE +#define SHA224_BLOCK_SIZE SHA256_BLOCK_SIZE + +#ifndef SHA2_TYPES +#define SHA2_TYPES +typedef unsigned char uint8; +typedef unsigned int uint32; +typedef unsigned long long uint64; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + unsigned int tot_len; + unsigned int len; + unsigned char block[2 * SHA256_BLOCK_SIZE]; + uint32 h[8]; +} SHA256_CTX; + +typedef struct { + unsigned int tot_len; + unsigned int len; + unsigned char block[2 * SHA512_BLOCK_SIZE]; + uint64 h[8]; +} SHA512_CTX; + +typedef SHA512_CTX SHA384_CTX; +typedef SHA256_CTX SHA224_CTX; + +void SHA224_Init(SHA224_CTX *ctx); +void SHA224_Update(SHA224_CTX *ctx, const unsigned char *message, + unsigned int len); +void SHA224_Final(SHA224_CTX *ctx, unsigned char *digest); +void SHA224(const unsigned char *message, unsigned int len, + unsigned char *digest); + +void SHA256_Init(SHA256_CTX * ctx); +void SHA256_Update(SHA256_CTX *ctx, const unsigned char *message, + unsigned int len); +void SHA256_Final(SHA256_CTX *ctx, unsigned char *digest); +void SHA256(const unsigned char *message, unsigned int len, + unsigned char *digest); + +void SHA384_Init(SHA384_CTX *ctx); +void SHA384_Update(SHA384_CTX *ctx, const unsigned char *message, + unsigned int len); +void SHA384_Final(SHA384_CTX *ctx, unsigned char *digest); +void SHA384(const unsigned char *message, unsigned int len, + unsigned char *digest); + +void SHA512_Init(SHA512_CTX *ctx); +void SHA512_Update(SHA512_CTX *ctx, const unsigned char *message, + unsigned int len); +void SHA512_Final(SHA512_CTX *ctx, unsigned char *digest); +void SHA512(const unsigned char *message, unsigned int len, + unsigned char *digest); + +#ifdef __cplusplus +} +#endif + +#endif /* !SHA2_H */ + diff --git a/tsk3/base/tsk_base.h b/tsk/base/tsk_base.h similarity index 99% rename from tsk3/base/tsk_base.h rename to tsk/base/tsk_base.h index ec2821dbd..6bb7660c9 100644 --- a/tsk3/base/tsk_base.h +++ b/tsk/base/tsk_base.h @@ -50,7 +50,7 @@ * On Win32 (Visual Studio) though, we will not have this file... */ #if !defined(_MSC_VER) -#include "tsk3/tsk_incs.h" +#include "tsk/tsk_incs.h" #endif // get some other TSK / OS settings diff --git a/tsk3/base/tsk_base_i.h b/tsk/base/tsk_base_i.h similarity index 95% rename from tsk3/base/tsk_base_i.h rename to tsk/base/tsk_base_i.h index 52fd0a99e..4506b93e3 100644 --- a/tsk3/base/tsk_base_i.h +++ b/tsk/base/tsk_base_i.h @@ -12,7 +12,7 @@ // include the autoconf header file #if HAVE_CONFIG_H -#include "tsk3/tsk_config.h" +#include "tsk/tsk_config.h" #endif /* Some Linux systems need LARGEFILE64_SOURCE and autoconf does @@ -313,6 +313,12 @@ extern "C" { const UTF8 * sourceEnd, UTF16 ** targetStart, UTF16 * targetEnd, TSKConversionFlags flags); + extern TSKConversionResult tsk_UTF8toUTF16W(const UTF8 ** sourceStart, + const UTF8 * sourceEnd, + wchar_t ** targetStart, + wchar_t * targetEnd, + TSKConversionFlags flags); + extern TSKConversionResult tsk_UTF16toUTF8(TSK_ENDIAN_ENUM, const UTF16 ** sourceStart, const UTF16 * sourceEnd, UTF8 ** targetStart, UTF8 * targetEnd, TSKConversionFlags flags); @@ -322,6 +328,10 @@ extern "C" { const UTF16 * sourceEnd, UTF8 ** targetStart, UTF8 * targetEnd, TSKConversionFlags flags); + extern TSKConversionResult + tsk_UTF16WtoUTF8_lclorder(const wchar_t ** sourceStart, + const wchar_t * sourceEnd, UTF8 ** targetStart, + UTF8 * targetEnd, TSKConversionFlags flags); extern Boolean tsk_isLegalUTF8Sequence(const UTF8 * source, const UTF8 * sourceEnd); diff --git a/tsk3/base/tsk_endian.c b/tsk/base/tsk_endian.c similarity index 100% rename from tsk3/base/tsk_endian.c rename to tsk/base/tsk_endian.c diff --git a/tsk3/base/tsk_error.c b/tsk/base/tsk_error.c similarity index 100% rename from tsk3/base/tsk_error.c rename to tsk/base/tsk_error.c diff --git a/tsk3/base/tsk_error_win32.cpp b/tsk/base/tsk_error_win32.cpp similarity index 100% rename from tsk3/base/tsk_error_win32.cpp rename to tsk/base/tsk_error_win32.cpp diff --git a/tsk3/base/tsk_list.c b/tsk/base/tsk_list.c similarity index 100% rename from tsk3/base/tsk_list.c rename to tsk/base/tsk_list.c diff --git a/tsk3/base/tsk_lock.c b/tsk/base/tsk_lock.c similarity index 100% rename from tsk3/base/tsk_lock.c rename to tsk/base/tsk_lock.c diff --git a/tsk3/base/tsk_os.h b/tsk/base/tsk_os.h similarity index 100% rename from tsk3/base/tsk_os.h rename to tsk/base/tsk_os.h diff --git a/tsk3/base/tsk_parse.c b/tsk/base/tsk_parse.c similarity index 100% rename from tsk3/base/tsk_parse.c rename to tsk/base/tsk_parse.c diff --git a/tsk3/base/tsk_printf.c b/tsk/base/tsk_printf.c similarity index 100% rename from tsk3/base/tsk_printf.c rename to tsk/base/tsk_printf.c diff --git a/tsk3/base/tsk_stack.c b/tsk/base/tsk_stack.c similarity index 100% rename from tsk3/base/tsk_stack.c rename to tsk/base/tsk_stack.c diff --git a/tsk3/base/tsk_unicode.c b/tsk/base/tsk_unicode.c similarity index 75% rename from tsk3/base/tsk_unicode.c rename to tsk/base/tsk_unicode.c index 944615c39..14c2b4823 100644 --- a/tsk3/base/tsk_unicode.c +++ b/tsk/base/tsk_unicode.c @@ -355,6 +355,106 @@ tsk_UTF16toUTF8_lclorder(const UTF16 ** sourceStart, return result; } +TSKConversionResult +tsk_UTF16WtoUTF8_lclorder(const wchar_t ** sourceStart, + const wchar_t * sourceEnd, UTF8 ** targetStart, + UTF8 * targetEnd, TSKConversionFlags flags) +{ + TSKConversionResult result = TSKconversionOK; + const wchar_t *source = *sourceStart; + UTF8 *target = *targetStart; + while (source < sourceEnd) { + UTF32 ch; + unsigned short bytesToWrite = 0; + const UTF32 byteMask = 0xBF; + const UTF32 byteMark = 0x80; + const wchar_t *oldSource = source; /* In case we have to back up because of target overflow. */ + ch = *source++; + + /* If we have a surrogate pair, convert to UTF32 first. */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { + /* If the 16 bits following the high surrogate are in the source buffer... */ + if (source < sourceEnd) { + UTF32 ch2 = *source; + source++; + /* If it's a low surrogate, convert to UTF32. */ + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { + ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + + (ch2 - UNI_SUR_LOW_START) + halfBase; + } + else if (flags == TSKstrictConversion) { /* it's an unpaired high surrogate */ + result = TSKsourceIllegal; + break; + } + // replace with another character + else { + ch = '^'; + } + } + else { /* We don't have the 16 bits following the high surrogate. */ + --source; /* return to the high surrogate */ + result = TSKsourceExhausted; + break; + } + } + /* UTF-16 surrogate values are illegal in UTF-32 */ + else if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { + if (flags == TSKstrictConversion) { + --source; /* return to the illegal value itself */ + result = TSKsourceIllegal; + break; + } + // replace with another character + else { + ch = '^'; + } + } + + /* Figure out how many bytes the result will require */ + if (ch < (UTF32) 0x80) { + bytesToWrite = 1; + } + else if (ch < (UTF32) 0x800) { + bytesToWrite = 2; + } + else if (ch < (UTF32) 0x10000) { + bytesToWrite = 3; + } + else if (ch < (UTF32) 0x110000) { + bytesToWrite = 4; + } + else { + bytesToWrite = 3; + ch = TSK_UNI_REPLACEMENT_CHAR; + } + + target += bytesToWrite; + if (target > targetEnd) { + source = oldSource; /* Back up source pointer! */ + target -= bytesToWrite; + result = TSKtargetExhausted; + break; + } + switch (bytesToWrite) { /* note: everything falls through. */ + case 4: + *--target = (UTF8) ((ch | byteMark) & byteMask); + ch >>= 6; + case 3: + *--target = (UTF8) ((ch | byteMark) & byteMask); + ch >>= 6; + case 2: + *--target = (UTF8) ((ch | byteMark) & byteMask); + ch >>= 6; + case 1: + *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); + } + target += bytesToWrite; + } + *sourceStart = source; + *targetStart = target; + return result; +} + /* --------------------------------------------------------------------- */ /* @@ -571,3 +671,95 @@ tsk_UTF8toUTF16(const UTF8 ** sourceStart, *targetStart = target; return result; } + +TSKConversionResult +tsk_UTF8toUTF16W(const UTF8 ** sourceStart, + const UTF8 * sourceEnd, wchar_t ** targetStart, + wchar_t * targetEnd, TSKConversionFlags flags) +{ + TSKConversionResult result = TSKconversionOK; + const UTF8 *source = *sourceStart; + wchar_t *target = *targetStart; + while (source < sourceEnd) { + UTF32 ch = 0; + unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; + if (source + extraBytesToRead >= sourceEnd) { + result = TSKsourceExhausted; + break; + } + /* Do this check whether lenient or strict */ + if (!isLegalUTF8(source, extraBytesToRead + 1)) { + result = TSKsourceIllegal; + break; + } + /* + * The cases all fall through. See "Note A" below. + */ + switch (extraBytesToRead) { + case 5: + ch += *source++; + ch <<= 6; /* remember, illegal UTF-8 */ + case 4: + ch += *source++; + ch <<= 6; /* remember, illegal UTF-8 */ + case 3: + ch += *source++; + ch <<= 6; + case 2: + ch += *source++; + ch <<= 6; + case 1: + ch += *source++; + ch <<= 6; + case 0: + ch += *source++; + } + ch -= offsetsFromUTF8[extraBytesToRead]; + + if (target >= targetEnd) { + source -= (extraBytesToRead + 1); /* Back up source pointer! */ + result = TSKtargetExhausted; + break; + } + if (ch <= TSK_UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ + /* UTF-16 surrogate values are illegal in UTF-32 */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { + if (flags == TSKstrictConversion) { + source -= (extraBytesToRead + 1); /* return to the illegal value itself */ + result = TSKsourceIllegal; + break; + } + else { + *target++ = TSK_UNI_REPLACEMENT_CHAR; + } + } + else { + *target++ = (wchar_t) ch; /* normal case */ + } + } + else if (ch > TSK_UNI_MAX_UTF16) { + if (flags == TSKstrictConversion) { + result = TSKsourceIllegal; + source -= (extraBytesToRead + 1); /* return to the start */ + break; /* Bail out; shouldn't continue */ + } + else { + *target++ = TSK_UNI_REPLACEMENT_CHAR; + } + } + else { + /* target is a character in range 0xFFFF - 0x10FFFF. */ + if (target + 1 >= targetEnd) { + source -= (extraBytesToRead + 1); /* Back up source pointer! */ + result = TSKtargetExhausted; + break; + } + ch -= halfBase; + *target++ = (wchar_t) ((ch >> halfShift) + UNI_SUR_HIGH_START); + *target++ = (wchar_t) ((ch & halfMask) + UNI_SUR_LOW_START); + } + } + *sourceStart = source; + *targetStart = target; + return result; +} diff --git a/tsk3/base/tsk_version.c b/tsk/base/tsk_version.c similarity index 100% rename from tsk3/base/tsk_version.c rename to tsk/base/tsk_version.c diff --git a/tsk3/docs/Doxyfile b/tsk/docs/Doxyfile similarity index 99% rename from tsk3/docs/Doxyfile rename to tsk/docs/Doxyfile index 9efc75fe4..d918fe536 100644 --- a/tsk3/docs/Doxyfile +++ b/tsk/docs/Doxyfile @@ -661,21 +661,21 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = tsk3/docs/main.dox \ - tsk3/docs/basics.dox \ - tsk3/docs/base.dox \ - tsk3/docs/img.dox \ - tsk3/docs/vs.dox \ - tsk3/docs/fs.dox \ - tsk3/docs/hashdb.dox \ - tsk3/docs/auto.dox \ - tsk3/docs/cpp.dox \ - tsk3/base \ - tsk3/fs \ - tsk3/hashdb \ - tsk3/img \ - tsk3/vs \ - tsk3/auto +INPUT = tsk/docs/main.dox \ + tsk/docs/basics.dox \ + tsk/docs/base.dox \ + tsk/docs/img.dox \ + tsk/docs/vs.dox \ + tsk/docs/fs.dox \ + tsk/docs/hashdb.dox \ + tsk/docs/auto.dox \ + tsk/docs/cpp.dox \ + tsk/base \ + tsk/fs \ + tsk/hashdb \ + tsk/img \ + tsk/vs \ + tsk/auto # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is @@ -912,7 +912,7 @@ HTML_HEADER = # each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = tsk3/docs/footer.html +HTML_FOOTER = tsk/docs/footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to diff --git a/tsk3/docs/auto.dox b/tsk/docs/auto.dox similarity index 100% rename from tsk3/docs/auto.dox rename to tsk/docs/auto.dox diff --git a/tsk3/docs/base.dox b/tsk/docs/base.dox similarity index 100% rename from tsk3/docs/base.dox rename to tsk/docs/base.dox diff --git a/tsk3/docs/basics.dox b/tsk/docs/basics.dox similarity index 91% rename from tsk3/docs/basics.dox rename to tsk/docs/basics.dox index 9211ef822..326fa2c02 100644 --- a/tsk3/docs/basics.dox +++ b/tsk/docs/basics.dox @@ -56,13 +56,13 @@ This section describes how to incorporate the TSK library into your application. \subsection ov_build_unix Unix This document assumes that you used <tt>'make install'</tt> to install the library and header files and that you used the default location of <tt>/usr/local/</tt>. If you specified a different location, you will need to do the obvious path replacements in this document. -To include the API definitions, you will need to include the <tt>tsk3/libtsk.h</tt> file in your source code. Depending on system configuration, you may need to add <tt>/usr/local/include</tt> to the list of directories that your compiler looks in for header files (using <tt>-I</tt> for example). +To include the API definitions, you will need to include the <tt>tsk/libtsk.h</tt> file in your source code. Depending on system configuration, you may need to add <tt>/usr/local/include</tt> to the list of directories that your compiler looks in for header files (using <tt>-I</tt> for example). <code> -\#include <tsk3/libtsk.h> +\#include <tsk/libtsk.h> </code> -To include the library in your application during the linking phase, you will need to add <tt>-ltsk3</tt> to add the <tt>libtsk3</tt> library. Depending on system configuration, you may need to add <tt>/usr/local/lib/</tt> to the list of directories that your compiler looks in for libraries (using <tt>-L</tt> for example). +To include the library in your application during the linking phase, you will need to add <tt>-ltsk</tt> to add the <tt>libtsk</tt> library. Depending on system configuration, you may need to add <tt>/usr/local/lib/</tt> to the list of directories that your compiler looks in for libraries (using <tt>-L</tt> for example). Note that if you built TSK with support for AFFLIB and libewf then you will also need to include <tt>-lewf</tt> and/or <tt>-lafflib</tt>. You may also need to include other libraries that AFFLIB and libewf require (my current system requires <tt>-lcrypto -lssl -lz -lncurses -lreadlin</tt>). Refer to the libewf and AFFLIB documentation for details. @@ -71,7 +71,7 @@ The Windows setup is similar to the Unix setup, except that you need to include The Visual Studio solution file is located in <tt>win32/tsk-win.sln</tt>. There is a <tt>libtsk</tt> project for the five library layers (as described in \ref basic_layers). Build this to create a static library in the <tt>Debug</tt>, <tt>Release</tt>, or <tt>Debug_NoLibs</tt> folder (depending on which version you built). The <tt>Debug_NoLibs</tt> configuration does not have any dependencies on libewf or afflib. -To include the header files, configure your build environment to search in the root TSK directory (i.e. <tt>sleuthkit-3.0.0</tt>) and include the <tt>tsk3/libtsk.h</tt> file in your source code. The location of the TSK directory will depend on where you unpacked it. +To include the header files, configure your build environment to search in the root TSK directory (i.e. <tt>sleuthkit-3.0.0</tt>) and include the <tt>tsk/libtsk.h</tt> file in your source code. The location of the TSK directory will depend on where you unpacked it. To link with the libraries, you must configure your environment to include the <tt>libtsk</tt> library. You will need to specify the directory where the library is located, which could be the <tt>Debug</tt> or <tt>Release</tt> subdirectories in the <tt>win32</tt> directory. You can also move the library to a different location. diff --git a/tsk3/docs/cpp.dox b/tsk/docs/cpp.dox similarity index 100% rename from tsk3/docs/cpp.dox rename to tsk/docs/cpp.dox diff --git a/tsk3/docs/footer.html b/tsk/docs/footer.html similarity index 100% rename from tsk3/docs/footer.html rename to tsk/docs/footer.html diff --git a/tsk3/docs/fs.dox b/tsk/docs/fs.dox similarity index 100% rename from tsk3/docs/fs.dox rename to tsk/docs/fs.dox diff --git a/tsk3/docs/hashdb.dox b/tsk/docs/hashdb.dox similarity index 100% rename from tsk3/docs/hashdb.dox rename to tsk/docs/hashdb.dox diff --git a/tsk3/docs/img.dox b/tsk/docs/img.dox similarity index 100% rename from tsk3/docs/img.dox rename to tsk/docs/img.dox diff --git a/tsk3/docs/main.dox b/tsk/docs/main.dox similarity index 100% rename from tsk3/docs/main.dox rename to tsk/docs/main.dox diff --git a/tsk3/docs/vs.dox b/tsk/docs/vs.dox similarity index 100% rename from tsk3/docs/vs.dox rename to tsk/docs/vs.dox diff --git a/tsk3/fs/.indent.pro b/tsk/fs/.indent.pro similarity index 100% rename from tsk3/fs/.indent.pro rename to tsk/fs/.indent.pro diff --git a/tsk3/fs/Makefile.am b/tsk/fs/Makefile.am similarity index 100% rename from tsk3/fs/Makefile.am rename to tsk/fs/Makefile.am diff --git a/tsk3/fs/dcalc_lib.c b/tsk/fs/dcalc_lib.c similarity index 100% rename from tsk3/fs/dcalc_lib.c rename to tsk/fs/dcalc_lib.c diff --git a/tsk3/fs/dcat_lib.c b/tsk/fs/dcat_lib.c similarity index 100% rename from tsk3/fs/dcat_lib.c rename to tsk/fs/dcat_lib.c diff --git a/tsk3/fs/dls_lib.c b/tsk/fs/dls_lib.c similarity index 100% rename from tsk3/fs/dls_lib.c rename to tsk/fs/dls_lib.c diff --git a/tsk3/fs/dstat_lib.c b/tsk/fs/dstat_lib.c similarity index 100% rename from tsk3/fs/dstat_lib.c rename to tsk/fs/dstat_lib.c diff --git a/tsk3/fs/ext2fs.c b/tsk/fs/ext2fs.c similarity index 100% rename from tsk3/fs/ext2fs.c rename to tsk/fs/ext2fs.c diff --git a/tsk3/fs/ext2fs_dent.c b/tsk/fs/ext2fs_dent.c similarity index 100% rename from tsk3/fs/ext2fs_dent.c rename to tsk/fs/ext2fs_dent.c diff --git a/tsk3/fs/ext2fs_journal.c b/tsk/fs/ext2fs_journal.c similarity index 100% rename from tsk3/fs/ext2fs_journal.c rename to tsk/fs/ext2fs_journal.c diff --git a/tsk3/fs/fatfs.c b/tsk/fs/fatfs.c similarity index 100% rename from tsk3/fs/fatfs.c rename to tsk/fs/fatfs.c diff --git a/tsk3/fs/fatfs_dent.cpp b/tsk/fs/fatfs_dent.cpp similarity index 100% rename from tsk3/fs/fatfs_dent.cpp rename to tsk/fs/fatfs_dent.cpp diff --git a/tsk3/fs/fatfs_meta.c b/tsk/fs/fatfs_meta.c similarity index 100% rename from tsk3/fs/fatfs_meta.c rename to tsk/fs/fatfs_meta.c diff --git a/tsk3/fs/ffind_lib.c b/tsk/fs/ffind_lib.c similarity index 100% rename from tsk3/fs/ffind_lib.c rename to tsk/fs/ffind_lib.c diff --git a/tsk3/fs/ffs.c b/tsk/fs/ffs.c similarity index 100% rename from tsk3/fs/ffs.c rename to tsk/fs/ffs.c diff --git a/tsk3/fs/ffs_dent.c b/tsk/fs/ffs_dent.c similarity index 100% rename from tsk3/fs/ffs_dent.c rename to tsk/fs/ffs_dent.c diff --git a/tsk3/fs/fls_lib.c b/tsk/fs/fls_lib.c similarity index 100% rename from tsk3/fs/fls_lib.c rename to tsk/fs/fls_lib.c diff --git a/tsk3/fs/fs_attr.c b/tsk/fs/fs_attr.c similarity index 100% rename from tsk3/fs/fs_attr.c rename to tsk/fs/fs_attr.c diff --git a/tsk3/fs/fs_attrlist.c b/tsk/fs/fs_attrlist.c similarity index 100% rename from tsk3/fs/fs_attrlist.c rename to tsk/fs/fs_attrlist.c diff --git a/tsk3/fs/fs_block.c b/tsk/fs/fs_block.c similarity index 100% rename from tsk3/fs/fs_block.c rename to tsk/fs/fs_block.c diff --git a/tsk3/fs/fs_dir.c b/tsk/fs/fs_dir.c similarity index 100% rename from tsk3/fs/fs_dir.c rename to tsk/fs/fs_dir.c diff --git a/tsk3/fs/fs_file.c b/tsk/fs/fs_file.c similarity index 100% rename from tsk3/fs/fs_file.c rename to tsk/fs/fs_file.c diff --git a/tsk3/fs/fs_inode.c b/tsk/fs/fs_inode.c similarity index 100% rename from tsk3/fs/fs_inode.c rename to tsk/fs/fs_inode.c diff --git a/tsk3/fs/fs_io.c b/tsk/fs/fs_io.c similarity index 100% rename from tsk3/fs/fs_io.c rename to tsk/fs/fs_io.c diff --git a/tsk3/fs/fs_load.c b/tsk/fs/fs_load.c similarity index 100% rename from tsk3/fs/fs_load.c rename to tsk/fs/fs_load.c diff --git a/tsk3/fs/fs_name.c b/tsk/fs/fs_name.c similarity index 100% rename from tsk3/fs/fs_name.c rename to tsk/fs/fs_name.c diff --git a/tsk3/fs/fs_open.c b/tsk/fs/fs_open.c similarity index 100% rename from tsk3/fs/fs_open.c rename to tsk/fs/fs_open.c diff --git a/tsk3/fs/fs_parse.c b/tsk/fs/fs_parse.c similarity index 100% rename from tsk3/fs/fs_parse.c rename to tsk/fs/fs_parse.c diff --git a/tsk3/fs/fs_types.c b/tsk/fs/fs_types.c similarity index 100% rename from tsk3/fs/fs_types.c rename to tsk/fs/fs_types.c diff --git a/tsk3/fs/hfs.c b/tsk/fs/hfs.c similarity index 100% rename from tsk3/fs/hfs.c rename to tsk/fs/hfs.c diff --git a/tsk3/fs/hfs_dent.c b/tsk/fs/hfs_dent.c similarity index 100% rename from tsk3/fs/hfs_dent.c rename to tsk/fs/hfs_dent.c diff --git a/tsk3/fs/hfs_journal.c b/tsk/fs/hfs_journal.c similarity index 100% rename from tsk3/fs/hfs_journal.c rename to tsk/fs/hfs_journal.c diff --git a/tsk3/fs/hfs_unicompare.c b/tsk/fs/hfs_unicompare.c similarity index 100% rename from tsk3/fs/hfs_unicompare.c rename to tsk/fs/hfs_unicompare.c diff --git a/tsk3/fs/icat_lib.c b/tsk/fs/icat_lib.c similarity index 100% rename from tsk3/fs/icat_lib.c rename to tsk/fs/icat_lib.c diff --git a/tsk3/fs/ifind_lib.c b/tsk/fs/ifind_lib.c similarity index 100% rename from tsk3/fs/ifind_lib.c rename to tsk/fs/ifind_lib.c diff --git a/tsk3/fs/ils_lib.c b/tsk/fs/ils_lib.c similarity index 100% rename from tsk3/fs/ils_lib.c rename to tsk/fs/ils_lib.c diff --git a/tsk3/fs/iso9660.c b/tsk/fs/iso9660.c similarity index 100% rename from tsk3/fs/iso9660.c rename to tsk/fs/iso9660.c diff --git a/tsk3/fs/iso9660_dent.c b/tsk/fs/iso9660_dent.c similarity index 100% rename from tsk3/fs/iso9660_dent.c rename to tsk/fs/iso9660_dent.c diff --git a/tsk3/fs/nofs_misc.c b/tsk/fs/nofs_misc.c similarity index 100% rename from tsk3/fs/nofs_misc.c rename to tsk/fs/nofs_misc.c diff --git a/tsk3/fs/ntfs.c b/tsk/fs/ntfs.c similarity index 100% rename from tsk3/fs/ntfs.c rename to tsk/fs/ntfs.c diff --git a/tsk3/fs/ntfs_dent.cpp b/tsk/fs/ntfs_dent.cpp similarity index 100% rename from tsk3/fs/ntfs_dent.cpp rename to tsk/fs/ntfs_dent.cpp diff --git a/tsk3/fs/rawfs.c b/tsk/fs/rawfs.c similarity index 100% rename from tsk3/fs/rawfs.c rename to tsk/fs/rawfs.c diff --git a/tsk3/fs/swapfs.c b/tsk/fs/swapfs.c similarity index 100% rename from tsk3/fs/swapfs.c rename to tsk/fs/swapfs.c diff --git a/tsk3/fs/tsk_ext2fs.h b/tsk/fs/tsk_ext2fs.h similarity index 100% rename from tsk3/fs/tsk_ext2fs.h rename to tsk/fs/tsk_ext2fs.h diff --git a/tsk3/fs/tsk_fatfs.h b/tsk/fs/tsk_fatfs.h similarity index 100% rename from tsk3/fs/tsk_fatfs.h rename to tsk/fs/tsk_fatfs.h diff --git a/tsk3/fs/tsk_ffs.h b/tsk/fs/tsk_ffs.h similarity index 100% rename from tsk3/fs/tsk_ffs.h rename to tsk/fs/tsk_ffs.h diff --git a/tsk3/fs/tsk_fs.h b/tsk/fs/tsk_fs.h similarity index 100% rename from tsk3/fs/tsk_fs.h rename to tsk/fs/tsk_fs.h diff --git a/tsk3/fs/tsk_fs_i.h b/tsk/fs/tsk_fs_i.h similarity index 98% rename from tsk3/fs/tsk_fs_i.h rename to tsk/fs/tsk_fs_i.h index 4f0078559..e466969cc 100644 --- a/tsk3/fs/tsk_fs_i.h +++ b/tsk/fs/tsk_fs_i.h @@ -32,9 +32,9 @@ #define _TSK_FS_I_H // Include the other internal TSK header files -#include "tsk3/base/tsk_base_i.h" -#include "tsk3/img/tsk_img_i.h" -#include "tsk3/vs/tsk_vs_i.h" +#include "tsk/base/tsk_base_i.h" +#include "tsk/img/tsk_img_i.h" +#include "tsk/vs/tsk_vs_i.h" // Include the external file #include "tsk_fs.h" diff --git a/tsk3/fs/tsk_hfs.h b/tsk/fs/tsk_hfs.h similarity index 100% rename from tsk3/fs/tsk_hfs.h rename to tsk/fs/tsk_hfs.h diff --git a/tsk3/fs/tsk_iso9660.h b/tsk/fs/tsk_iso9660.h similarity index 100% rename from tsk3/fs/tsk_iso9660.h rename to tsk/fs/tsk_iso9660.h diff --git a/tsk3/fs/tsk_ntfs.h b/tsk/fs/tsk_ntfs.h similarity index 100% rename from tsk3/fs/tsk_ntfs.h rename to tsk/fs/tsk_ntfs.h diff --git a/tsk3/fs/tsk_yaffs.h b/tsk/fs/tsk_yaffs.h similarity index 100% rename from tsk3/fs/tsk_yaffs.h rename to tsk/fs/tsk_yaffs.h diff --git a/tsk3/fs/unix_misc.c b/tsk/fs/unix_misc.c similarity index 100% rename from tsk3/fs/unix_misc.c rename to tsk/fs/unix_misc.c diff --git a/tsk3/fs/walk_cpp.cpp b/tsk/fs/walk_cpp.cpp similarity index 98% rename from tsk3/fs/walk_cpp.cpp rename to tsk/fs/walk_cpp.cpp index e5a5070cd..edd589d63 100644 --- a/tsk3/fs/walk_cpp.cpp +++ b/tsk/fs/walk_cpp.cpp @@ -1,5 +1,5 @@ #include "tsk_fs_i.h" -#include "tsk3/vs/tsk_vs_i.h" +#include "tsk/vs/tsk_vs_i.h" /** * \internal diff --git a/tsk3/fs/yaffs.cpp b/tsk/fs/yaffs.cpp similarity index 100% rename from tsk3/fs/yaffs.cpp rename to tsk/fs/yaffs.cpp diff --git a/tsk3/hashdb/.indent.pro b/tsk/hashdb/.indent.pro similarity index 100% rename from tsk3/hashdb/.indent.pro rename to tsk/hashdb/.indent.pro diff --git a/tsk3/hashdb/Makefile.am b/tsk/hashdb/Makefile.am similarity index 100% rename from tsk3/hashdb/Makefile.am rename to tsk/hashdb/Makefile.am diff --git a/tsk3/hashdb/encase_index.c b/tsk/hashdb/encase_index.c similarity index 100% rename from tsk3/hashdb/encase_index.c rename to tsk/hashdb/encase_index.c diff --git a/tsk3/hashdb/hk_index.c b/tsk/hashdb/hk_index.c similarity index 100% rename from tsk3/hashdb/hk_index.c rename to tsk/hashdb/hk_index.c diff --git a/tsk3/hashdb/idxonly_index.c b/tsk/hashdb/idxonly_index.c similarity index 100% rename from tsk3/hashdb/idxonly_index.c rename to tsk/hashdb/idxonly_index.c diff --git a/tsk3/hashdb/md5sum_index.c b/tsk/hashdb/md5sum_index.c similarity index 100% rename from tsk3/hashdb/md5sum_index.c rename to tsk/hashdb/md5sum_index.c diff --git a/tsk3/hashdb/nsrl_index.c b/tsk/hashdb/nsrl_index.c similarity index 100% rename from tsk3/hashdb/nsrl_index.c rename to tsk/hashdb/nsrl_index.c diff --git a/tsk3/hashdb/tm_lookup.c b/tsk/hashdb/tm_lookup.c similarity index 100% rename from tsk3/hashdb/tm_lookup.c rename to tsk/hashdb/tm_lookup.c diff --git a/tsk3/hashdb/tsk_hashdb.h b/tsk/hashdb/tsk_hashdb.h similarity index 100% rename from tsk3/hashdb/tsk_hashdb.h rename to tsk/hashdb/tsk_hashdb.h diff --git a/tsk3/hashdb/tsk_hashdb_i.h b/tsk/hashdb/tsk_hashdb_i.h similarity index 99% rename from tsk3/hashdb/tsk_hashdb_i.h rename to tsk/hashdb/tsk_hashdb_i.h index fa4c5c347..b6066f03d 100644 --- a/tsk3/hashdb/tsk_hashdb_i.h +++ b/tsk/hashdb/tsk_hashdb_i.h @@ -16,7 +16,7 @@ // Include the other internal TSK header files -#include "tsk3/base/tsk_base_i.h" +#include "tsk/base/tsk_base_i.h" // include the external header file #include "tsk_hashdb.h" diff --git a/tsk3/img/.indent.pro b/tsk/img/.indent.pro similarity index 100% rename from tsk3/img/.indent.pro rename to tsk/img/.indent.pro diff --git a/tsk3/img/Makefile.am b/tsk/img/Makefile.am similarity index 100% rename from tsk3/img/Makefile.am rename to tsk/img/Makefile.am diff --git a/tsk3/img/aff.c b/tsk/img/aff.c similarity index 100% rename from tsk3/img/aff.c rename to tsk/img/aff.c diff --git a/tsk3/img/aff.h b/tsk/img/aff.h similarity index 100% rename from tsk3/img/aff.h rename to tsk/img/aff.h diff --git a/tsk3/img/ewf.c b/tsk/img/ewf.c similarity index 100% rename from tsk3/img/ewf.c rename to tsk/img/ewf.c diff --git a/tsk3/img/ewf.h b/tsk/img/ewf.h similarity index 100% rename from tsk3/img/ewf.h rename to tsk/img/ewf.h diff --git a/tsk3/img/img_io.c b/tsk/img/img_io.c similarity index 100% rename from tsk3/img/img_io.c rename to tsk/img/img_io.c diff --git a/tsk3/img/img_open.c b/tsk/img/img_open.c similarity index 100% rename from tsk3/img/img_open.c rename to tsk/img/img_open.c diff --git a/tsk3/img/img_types.c b/tsk/img/img_types.c similarity index 100% rename from tsk3/img/img_types.c rename to tsk/img/img_types.c diff --git a/tsk3/img/mult_files.c b/tsk/img/mult_files.c similarity index 100% rename from tsk3/img/mult_files.c rename to tsk/img/mult_files.c diff --git a/tsk3/img/raw.c b/tsk/img/raw.c similarity index 100% rename from tsk3/img/raw.c rename to tsk/img/raw.c diff --git a/tsk3/img/raw.h b/tsk/img/raw.h similarity index 100% rename from tsk3/img/raw.h rename to tsk/img/raw.h diff --git a/tsk3/img/tsk_img.h b/tsk/img/tsk_img.h similarity index 100% rename from tsk3/img/tsk_img.h rename to tsk/img/tsk_img.h diff --git a/tsk3/img/tsk_img_i.h b/tsk/img/tsk_img_i.h similarity index 89% rename from tsk3/img/tsk_img_i.h rename to tsk/img/tsk_img_i.h index 03fd64611..ee8586bd5 100644 --- a/tsk3/img/tsk_img_i.h +++ b/tsk/img/tsk_img_i.h @@ -15,7 +15,7 @@ */ // include the base internal header file -#include "tsk3/base/tsk_base_i.h" +#include "tsk/base/tsk_base_i.h" // include the external disk image header file #include "tsk_img.h" @@ -27,6 +27,10 @@ #include <fcntl.h> #include <errno.h> +#ifdef __cplusplus +extern "C" { +#endif + // Cygwin needs this, but not everyone defines it #ifndef O_BINARY #define O_BINARY 0 @@ -35,4 +39,9 @@ extern void *tsk_img_malloc(size_t); extern void tsk_img_free(void *); extern TSK_TCHAR **tsk_img_findFiles(const TSK_TCHAR * a_startingName, int *a_numFound); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/tsk/libtsk.h b/tsk/libtsk.h new file mode 100644 index 000000000..d5089125d --- /dev/null +++ b/tsk/libtsk.h @@ -0,0 +1,11 @@ +#ifndef _TSK_LIBTSK_H +#define _TSK_LIBTSK_H + +#include "tsk/base/tsk_base.h" +#include "tsk/img/tsk_img.h" +#include "tsk/vs/tsk_vs.h" +#include "tsk/fs/tsk_fs.h" +#include "tsk/hashdb/tsk_hashdb.h" +#include "tsk/auto/tsk_auto.h" + +#endif diff --git a/tsk3/sorter/default.sort b/tsk/sorter/default.sort similarity index 100% rename from tsk3/sorter/default.sort rename to tsk/sorter/default.sort diff --git a/tsk3/sorter/freebsd.sort b/tsk/sorter/freebsd.sort similarity index 100% rename from tsk3/sorter/freebsd.sort rename to tsk/sorter/freebsd.sort diff --git a/tsk3/sorter/images.sort b/tsk/sorter/images.sort similarity index 100% rename from tsk3/sorter/images.sort rename to tsk/sorter/images.sort diff --git a/tsk3/sorter/linux.sort b/tsk/sorter/linux.sort similarity index 100% rename from tsk3/sorter/linux.sort rename to tsk/sorter/linux.sort diff --git a/tsk3/sorter/openbsd.sort b/tsk/sorter/openbsd.sort similarity index 100% rename from tsk3/sorter/openbsd.sort rename to tsk/sorter/openbsd.sort diff --git a/tsk3/sorter/solaris.sort b/tsk/sorter/solaris.sort similarity index 100% rename from tsk3/sorter/solaris.sort rename to tsk/sorter/solaris.sort diff --git a/tsk3/sorter/windows.sort b/tsk/sorter/windows.sort similarity index 100% rename from tsk3/sorter/windows.sort rename to tsk/sorter/windows.sort diff --git a/tsk3/tsk_config.h.in b/tsk/tsk_config.h.in similarity index 98% rename from tsk3/tsk_config.h.in rename to tsk/tsk_config.h.in index 9989c346a..5a24f9971 100644 --- a/tsk3/tsk_config.h.in +++ b/tsk/tsk_config.h.in @@ -1,4 +1,4 @@ -/* tsk3/tsk_config.h.in. Generated from configure.ac by autoheader. */ +/* tsk/tsk_config.h.in. Generated from configure.ac by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. diff --git a/tsk3/tsk_tools_i.h b/tsk/tsk_tools_i.h similarity index 57% rename from tsk3/tsk_tools_i.h rename to tsk/tsk_tools_i.h index 8d4deb980..50ae2ddb2 100644 --- a/tsk3/tsk_tools_i.h +++ b/tsk/tsk_tools_i.h @@ -5,11 +5,11 @@ * instead of base.h so that we can get the _config defines. * This is to be used by the tools included with TSK (such as fls). */ -#include "tsk3/base/tsk_base_i.h" -#include "tsk3/img/tsk_img.h" -#include "tsk3/vs/tsk_vs.h" -#include "tsk3/fs/tsk_fs.h" -#include "tsk3/hashdb/tsk_hashdb.h" -#include "tsk3/auto/tsk_auto.h" +#include "tsk/base/tsk_base_i.h" +#include "tsk/img/tsk_img.h" +#include "tsk/vs/tsk_vs.h" +#include "tsk/fs/tsk_fs.h" +#include "tsk/hashdb/tsk_hashdb.h" +#include "tsk/auto/tsk_auto.h" #endif diff --git a/tsk3/vs/.indent.pro b/tsk/vs/.indent.pro similarity index 100% rename from tsk3/vs/.indent.pro rename to tsk/vs/.indent.pro diff --git a/tsk3/vs/Makefile.am b/tsk/vs/Makefile.am similarity index 100% rename from tsk3/vs/Makefile.am rename to tsk/vs/Makefile.am diff --git a/tsk3/vs/bsd.c b/tsk/vs/bsd.c similarity index 100% rename from tsk3/vs/bsd.c rename to tsk/vs/bsd.c diff --git a/tsk3/vs/dos.c b/tsk/vs/dos.c similarity index 100% rename from tsk3/vs/dos.c rename to tsk/vs/dos.c diff --git a/tsk3/vs/gpt.c b/tsk/vs/gpt.c similarity index 100% rename from tsk3/vs/gpt.c rename to tsk/vs/gpt.c diff --git a/tsk3/vs/mac.c b/tsk/vs/mac.c similarity index 100% rename from tsk3/vs/mac.c rename to tsk/vs/mac.c diff --git a/tsk3/vs/mm_io.c b/tsk/vs/mm_io.c similarity index 100% rename from tsk3/vs/mm_io.c rename to tsk/vs/mm_io.c diff --git a/tsk3/vs/mm_open.c b/tsk/vs/mm_open.c similarity index 100% rename from tsk3/vs/mm_open.c rename to tsk/vs/mm_open.c diff --git a/tsk3/vs/mm_part.c b/tsk/vs/mm_part.c similarity index 100% rename from tsk3/vs/mm_part.c rename to tsk/vs/mm_part.c diff --git a/tsk3/vs/mm_types.c b/tsk/vs/mm_types.c similarity index 100% rename from tsk3/vs/mm_types.c rename to tsk/vs/mm_types.c diff --git a/tsk3/vs/sun.c b/tsk/vs/sun.c similarity index 100% rename from tsk3/vs/sun.c rename to tsk/vs/sun.c diff --git a/tsk3/vs/tsk_bsd.h b/tsk/vs/tsk_bsd.h similarity index 100% rename from tsk3/vs/tsk_bsd.h rename to tsk/vs/tsk_bsd.h diff --git a/tsk3/vs/tsk_dos.h b/tsk/vs/tsk_dos.h similarity index 100% rename from tsk3/vs/tsk_dos.h rename to tsk/vs/tsk_dos.h diff --git a/tsk3/vs/tsk_gpt.h b/tsk/vs/tsk_gpt.h similarity index 100% rename from tsk3/vs/tsk_gpt.h rename to tsk/vs/tsk_gpt.h diff --git a/tsk3/vs/tsk_mac.h b/tsk/vs/tsk_mac.h similarity index 100% rename from tsk3/vs/tsk_mac.h rename to tsk/vs/tsk_mac.h diff --git a/tsk3/vs/tsk_sun.h b/tsk/vs/tsk_sun.h similarity index 100% rename from tsk3/vs/tsk_sun.h rename to tsk/vs/tsk_sun.h diff --git a/tsk3/vs/tsk_vs.h b/tsk/vs/tsk_vs.h similarity index 100% rename from tsk3/vs/tsk_vs.h rename to tsk/vs/tsk_vs.h diff --git a/tsk3/vs/tsk_vs_i.h b/tsk/vs/tsk_vs_i.h similarity index 95% rename from tsk3/vs/tsk_vs_i.h rename to tsk/vs/tsk_vs_i.h index 01cdeb6a6..cb2c5aeeb 100644 --- a/tsk3/vs/tsk_vs_i.h +++ b/tsk/vs/tsk_vs_i.h @@ -16,8 +16,8 @@ #define _TSK_VS_I_H // Include the other internal TSK header files -#include "tsk3/base/tsk_base_i.h" -#include "tsk3/img/tsk_img_i.h" +#include "tsk/base/tsk_base_i.h" +#include "tsk/img/tsk_img_i.h" // include the external vs header file #include "tsk_vs.h" diff --git a/tsk3/libtsk.h b/tsk3/libtsk.h deleted file mode 100644 index 7e481924c..000000000 --- a/tsk3/libtsk.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _TSK_LIBTSK_H -#define _TSK_LIBTSK_H - -#include "tsk3/base/tsk_base.h" -#include "tsk3/img/tsk_img.h" -#include "tsk3/vs/tsk_vs.h" -#include "tsk3/fs/tsk_fs.h" -#include "tsk3/hashdb/tsk_hashdb.h" -#include "tsk3/auto/tsk_auto.h" - -#endif diff --git a/unit_tests/base/Makefile.am b/unit_tests/base/Makefile.am index 815527651..627f46af8 100644 --- a/unit_tests/base/Makefile.am +++ b/unit_tests/base/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = -I../.. -Wall $(CPPUNIT_CFLAGS) -LDADD = ../../tsk3/libtsk3.la $(CPPUNIT_LIBS) +LDADD = ../../tsk/libtsk.la $(CPPUNIT_LIBS) LDFLAGS = -static noinst_PROGRAMS = test_base @@ -10,6 +10,6 @@ indent: clean-local: -rm -f *.cpp~ *.h~ - + check: ./test_base diff --git a/win32/libtsk/libtsk.vcproj b/win32/libtsk/libtsk.vcproj index 3a27e95ae..8601ecebd 100755 --- a/win32/libtsk/libtsk.vcproj +++ b/win32/libtsk/libtsk.vcproj @@ -213,67 +213,67 @@ Name="vs" > <File - RelativePath="..\..\tsk3\vs\bsd.c" + RelativePath="..\..\tsk\vs\bsd.c" > </File> <File - RelativePath="..\..\tsk3\vs\dos.c" + RelativePath="..\..\tsk\vs\dos.c" > </File> <File - RelativePath="..\..\tsk3\vs\gpt.c" + RelativePath="..\..\tsk\vs\gpt.c" > </File> <File - RelativePath="..\..\tsk3\vs\mac.c" + RelativePath="..\..\tsk\vs\mac.c" > </File> <File - RelativePath="..\..\tsk3\vs\mm_io.c" + RelativePath="..\..\tsk\vs\mm_io.c" > </File> <File - RelativePath="..\..\tsk3\vs\mm_open.c" + RelativePath="..\..\tsk\vs\mm_open.c" > </File> <File - RelativePath="..\..\tsk3\vs\mm_part.c" + RelativePath="..\..\tsk\vs\mm_part.c" > </File> <File - RelativePath="..\..\tsk3\vs\mm_types.c" + RelativePath="..\..\tsk\vs\mm_types.c" > </File> <File - RelativePath="..\..\tsk3\vs\sun.c" + RelativePath="..\..\tsk\vs\sun.c" > </File> <File - RelativePath="..\..\tsk3\vs\tsk_bsd.h" + RelativePath="..\..\tsk\vs\tsk_bsd.h" > </File> <File - RelativePath="..\..\tsk3\vs\tsk_dos.h" + RelativePath="..\..\tsk\vs\tsk_dos.h" > </File> <File - RelativePath="..\..\tsk3\vs\tsk_gpt.h" + RelativePath="..\..\tsk\vs\tsk_gpt.h" > </File> <File - RelativePath="..\..\tsk3\vs\tsk_mac.h" + RelativePath="..\..\tsk\vs\tsk_mac.h" > </File> <File - RelativePath="..\..\tsk3\vs\tsk_sun.h" + RelativePath="..\..\tsk\vs\tsk_sun.h" > </File> <File - RelativePath="..\..\tsk3\vs\tsk_vs.h" + RelativePath="..\..\tsk\vs\tsk_vs.h" > </File> <File - RelativePath="..\..\tsk3\vs\tsk_vs_i.h" + RelativePath="..\..\tsk\vs\tsk_vs_i.h" > </File> </Filter> @@ -281,203 +281,203 @@ Name="fs" > <File - RelativePath="..\..\tsk3\fs\dcalc_lib.c" + RelativePath="..\..\tsk\fs\dcalc_lib.c" > </File> <File - RelativePath="..\..\tsk3\fs\dcat_lib.c" + RelativePath="..\..\tsk\fs\dcat_lib.c" > </File> <File - RelativePath="..\..\tsk3\fs\dls_lib.c" + RelativePath="..\..\tsk\fs\dls_lib.c" > </File> <File - RelativePath="..\..\tsk3\fs\dstat_lib.c" + RelativePath="..\..\tsk\fs\dstat_lib.c" > </File> <File - RelativePath="..\..\tsk3\fs\ext2fs.c" + RelativePath="..\..\tsk\fs\ext2fs.c" > </File> <File - RelativePath="..\..\tsk3\fs\ext2fs_dent.c" + RelativePath="..\..\tsk\fs\ext2fs_dent.c" > </File> <File - RelativePath="..\..\tsk3\fs\ext2fs_journal.c" + RelativePath="..\..\tsk\fs\ext2fs_journal.c" > </File> <File - RelativePath="..\..\tsk3\fs\fatfs.c" + RelativePath="..\..\tsk\fs\fatfs.c" > </File> <File - RelativePath="..\..\tsk3\fs\fatfs_dent.c" + RelativePath="..\..\tsk\fs\fatfs_dent.c" > </File> <File - RelativePath="..\..\tsk3\fs\fatfs_meta.c" + RelativePath="..\..\tsk\fs\fatfs_meta.c" > </File> <File - RelativePath="..\..\tsk3\fs\ffind_lib.c" + RelativePath="..\..\tsk\fs\ffind_lib.c" > </File> <File - RelativePath="..\..\tsk3\fs\ffs.c" + RelativePath="..\..\tsk\fs\ffs.c" > </File> <File - RelativePath="..\..\tsk3\fs\ffs_dent.c" + RelativePath="..\..\tsk\fs\ffs_dent.c" > </File> <File - RelativePath="..\..\tsk3\fs\fls_lib.c" + RelativePath="..\..\tsk\fs\fls_lib.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_attr.c" + RelativePath="..\..\tsk\fs\fs_attr.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_attrlist.c" + RelativePath="..\..\tsk\fs\fs_attrlist.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_block.c" + RelativePath="..\..\tsk\fs\fs_block.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_dir.c" + RelativePath="..\..\tsk\fs\fs_dir.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_file.c" + RelativePath="..\..\tsk\fs\fs_file.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_inode.c" + RelativePath="..\..\tsk\fs\fs_inode.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_io.c" + RelativePath="..\..\tsk\fs\fs_io.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_load.c" + RelativePath="..\..\tsk\fs\fs_load.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_name.c" + RelativePath="..\..\tsk\fs\fs_name.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_open.c" + RelativePath="..\..\tsk\fs\fs_open.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_parse.c" + RelativePath="..\..\tsk\fs\fs_parse.c" > </File> <File - RelativePath="..\..\tsk3\fs\fs_types.c" + RelativePath="..\..\tsk\fs\fs_types.c" > </File> <File - RelativePath="..\..\tsk3\fs\hfs.c" + RelativePath="..\..\tsk\fs\hfs.c" > </File> <File - RelativePath="..\..\tsk3\fs\hfs_dent.c" + RelativePath="..\..\tsk\fs\hfs_dent.c" > </File> <File - RelativePath="..\..\tsk3\fs\hfs_journal.c" + RelativePath="..\..\tsk\fs\hfs_journal.c" > </File> <File - RelativePath="..\..\tsk3\fs\hfs_unicompare.c" + RelativePath="..\..\tsk\fs\hfs_unicompare.c" > </File> <File - RelativePath="..\..\tsk3\fs\icat_lib.c" + RelativePath="..\..\tsk\fs\icat_lib.c" > </File> <File - RelativePath="..\..\tsk3\fs\ifind_lib.c" + RelativePath="..\..\tsk\fs\ifind_lib.c" > </File> <File - RelativePath="..\..\tsk3\fs\ils_lib.c" + RelativePath="..\..\tsk\fs\ils_lib.c" > </File> <File - RelativePath="..\..\tsk3\fs\iso9660.c" + RelativePath="..\..\tsk\fs\iso9660.c" > </File> <File - RelativePath="..\..\tsk3\fs\iso9660_dent.c" + RelativePath="..\..\tsk\fs\iso9660_dent.c" > </File> <File - RelativePath="..\..\tsk3\fs\nofs_misc.c" + RelativePath="..\..\tsk\fs\nofs_misc.c" > </File> <File - RelativePath="..\..\tsk3\fs\ntfs.c" + RelativePath="..\..\tsk\fs\ntfs.c" > </File> <File - RelativePath="..\..\tsk3\fs\ntfs_dent.c" + RelativePath="..\..\tsk\fs\ntfs_dent.c" > </File> <File - RelativePath="..\..\tsk3\fs\rawfs.c" + RelativePath="..\..\tsk\fs\rawfs.c" > </File> <File - RelativePath="..\..\tsk3\fs\swapfs.c" + RelativePath="..\..\tsk\fs\swapfs.c" > </File> <File - RelativePath="..\..\tsk3\fs\tsk_ext2fs.h" + RelativePath="..\..\tsk\fs\tsk_ext2fs.h" > </File> <File - RelativePath="..\..\tsk3\fs\tsk_fatfs.h" + RelativePath="..\..\tsk\fs\tsk_fatfs.h" > </File> <File - RelativePath="..\..\tsk3\fs\tsk_ffs.h" + RelativePath="..\..\tsk\fs\tsk_ffs.h" > </File> <File - RelativePath="..\..\tsk3\fs\tsk_fs.h" + RelativePath="..\..\tsk\fs\tsk_fs.h" > </File> <File - RelativePath="..\..\tsk3\fs\tsk_fs_i.h" + RelativePath="..\..\tsk\fs\tsk_fs_i.h" > </File> <File - RelativePath="..\..\tsk3\fs\tsk_hfs.h" + RelativePath="..\..\tsk\fs\tsk_hfs.h" > </File> <File - RelativePath="..\..\tsk3\fs\tsk_iso9660.h" + RelativePath="..\..\tsk\fs\tsk_iso9660.h" > </File> <File - RelativePath="..\..\tsk3\fs\tsk_ntfs.h" + RelativePath="..\..\tsk\fs\tsk_ntfs.h" > </File> <File - RelativePath="..\..\tsk3\fs\unix_misc.c" + RelativePath="..\..\tsk\fs\unix_misc.c" > </File> <File - RelativePath="..\..\tsk3\fs\walk_cpp.cpp" + RelativePath="..\..\tsk\fs\walk_cpp.cpp" > </File> </Filter> @@ -485,43 +485,43 @@ Name="auto" > <File - RelativePath="..\..\tsk3\auto\auto.cpp" + RelativePath="..\..\tsk\auto\auto.cpp" > </File> <File - RelativePath="..\..\tsk3\auto\auto_db.cpp" + RelativePath="..\..\tsk\auto\auto_db.cpp" > </File> <File - RelativePath="..\..\tsk3\auto\case_db.cpp" + RelativePath="..\..\tsk\auto\case_db.cpp" > </File> <File - RelativePath="..\..\tsk3\auto\db_sqlite.cpp" + RelativePath="..\..\tsk\auto\db_sqlite.cpp" > </File> <File - RelativePath="..\..\tsk3\auto\sqlite3.c" + RelativePath="..\..\tsk\auto\sqlite3.c" > </File> <File - RelativePath="..\..\tsk3\auto\sqlite3.h" + RelativePath="..\..\tsk\auto\sqlite3.h" > </File> <File - RelativePath="..\..\tsk3\auto\tsk_auto.h" + RelativePath="..\..\tsk\auto\tsk_auto.h" > </File> <File - RelativePath="..\..\tsk3\auto\tsk_auto_i.h" + RelativePath="..\..\tsk\auto\tsk_auto_i.h" > </File> <File - RelativePath="..\..\tsk3\auto\tsk_case_db.h" + RelativePath="..\..\tsk\auto\tsk_case_db.h" > </File> <File - RelativePath="..\..\tsk3\auto\tsk_db_sqlite.h" + RelativePath="..\..\tsk\auto\tsk_db_sqlite.h" > </File> </Filter> @@ -529,71 +529,71 @@ Name="base" > <File - RelativePath="..\..\tsk3\base\md5c.c" + RelativePath="..\..\tsk\base\md5c.c" > </File> <File - RelativePath="..\..\tsk3\base\mymalloc.c" + RelativePath="..\..\tsk\base\mymalloc.c" > </File> <File - RelativePath="..\..\tsk3\base\sha1c.c" + RelativePath="..\..\tsk\base\sha1c.c" > </File> <File - RelativePath="..\..\tsk3\base\tsk_base.h" + RelativePath="..\..\tsk\base\tsk_base.h" > </File> <File - RelativePath="..\..\tsk3\base\tsk_base_i.h" + RelativePath="..\..\tsk\base\tsk_base_i.h" > </File> <File - RelativePath="..\..\tsk3\base\tsk_endian.c" + RelativePath="..\..\tsk\base\tsk_endian.c" > </File> <File - RelativePath="..\..\tsk3\base\tsk_error.c" + RelativePath="..\..\tsk\base\tsk_error.c" > </File> <File - RelativePath="..\..\tsk3\base\tsk_error_win32.cpp" + RelativePath="..\..\tsk\base\tsk_error_win32.cpp" > </File> <File - RelativePath="..\..\tsk3\base\tsk_list.c" + RelativePath="..\..\tsk\base\tsk_list.c" > </File> <File - RelativePath="..\..\tsk3\base\tsk_lock.c" + RelativePath="..\..\tsk\base\tsk_lock.c" > </File> <File - RelativePath="..\..\tsk3\base\tsk_os.h" + RelativePath="..\..\tsk\base\tsk_os.h" > </File> <File - RelativePath="..\..\tsk3\base\tsk_parse.c" + RelativePath="..\..\tsk\base\tsk_parse.c" > </File> <File - RelativePath="..\..\tsk3\base\tsk_printf.c" + RelativePath="..\..\tsk\base\tsk_printf.c" > </File> <File - RelativePath="..\..\tsk3\base\tsk_stack.c" + RelativePath="..\..\tsk\base\tsk_stack.c" > </File> <File - RelativePath="..\..\tsk3\base\tsk_unicode.c" + RelativePath="..\..\tsk\base\tsk_unicode.c" > </File> <File - RelativePath="..\..\tsk3\base\tsk_version.c" + RelativePath="..\..\tsk\base\tsk_version.c" > </File> <File - RelativePath="..\..\tsk3\base\XGetopt.c" + RelativePath="..\..\tsk\base\XGetopt.c" > </File> </Filter> @@ -601,35 +601,35 @@ Name="hash" > <File - RelativePath="..\..\tsk3\hashdb\encase_index.c" + RelativePath="..\..\tsk\hashdb\encase_index.c" > </File> <File - RelativePath="..\..\tsk3\hashdb\hk_index.c" + RelativePath="..\..\tsk\hashdb\hk_index.c" > </File> <File - RelativePath="..\..\tsk3\hashdb\idxonly_index.c" + RelativePath="..\..\tsk\hashdb\idxonly_index.c" > </File> <File - RelativePath="..\..\tsk3\hashdb\md5sum_index.c" + RelativePath="..\..\tsk\hashdb\md5sum_index.c" > </File> <File - RelativePath="..\..\tsk3\hashdb\nsrl_index.c" + RelativePath="..\..\tsk\hashdb\nsrl_index.c" > </File> <File - RelativePath="..\..\tsk3\hashdb\tm_lookup.c" + RelativePath="..\..\tsk\hashdb\tm_lookup.c" > </File> <File - RelativePath="..\..\tsk3\hashdb\tsk_hashdb.h" + RelativePath="..\..\tsk\hashdb\tsk_hashdb.h" > </File> <File - RelativePath="..\..\tsk3\hashdb\tsk_hashdb_i.h" + RelativePath="..\..\tsk\hashdb\tsk_hashdb_i.h" > </File> </Filter> @@ -637,51 +637,51 @@ Name="img" > <File - RelativePath="..\..\tsk3\img\aff.c" + RelativePath="..\..\tsk\img\aff.c" > </File> <File - RelativePath="..\..\tsk3\img\aff.h" + RelativePath="..\..\tsk\img\aff.h" > </File> <File - RelativePath="..\..\tsk3\img\ewf.c" + RelativePath="..\..\tsk\img\ewf.c" > </File> <File - RelativePath="..\..\tsk3\img\ewf.h" + RelativePath="..\..\tsk\img\ewf.h" > </File> <File - RelativePath="..\..\tsk3\img\img_io.c" + RelativePath="..\..\tsk\img\img_io.c" > </File> <File - RelativePath="..\..\tsk3\img\img_open.c" + RelativePath="..\..\tsk\img\img_open.c" > </File> <File - RelativePath="..\..\tsk3\img\img_types.c" + RelativePath="..\..\tsk\img\img_types.c" > </File> <File - RelativePath="..\..\tsk3\img\mult_files.c" + RelativePath="..\..\tsk\img\mult_files.c" > </File> <File - RelativePath="..\..\tsk3\img\raw.c" + RelativePath="..\..\tsk\img\raw.c" > </File> <File - RelativePath="..\..\tsk3\img\raw.h" + RelativePath="..\..\tsk\img\raw.h" > </File> <File - RelativePath="..\..\tsk3\img\tsk_img.h" + RelativePath="..\..\tsk\img\tsk_img.h" > </File> <File - RelativePath="..\..\tsk3\img\tsk_img_i.h" + RelativePath="..\..\tsk\img\tsk_img_i.h" > </File> </Filter> diff --git a/win32/libtsk/libtsk.vcxproj b/win32/libtsk/libtsk.vcxproj index 0285ffab9..e2fdf5481 100755 --- a/win32/libtsk/libtsk.vcxproj +++ b/win32/libtsk/libtsk.vcxproj @@ -108,124 +108,123 @@ copy "$(LIBEWF_HOME)\msvscpp\release\zlib.dll" "$(OutDir)" </ClCompile> </ItemDefinitionGroup> <ItemGroup> - <ClCompile Include="..\..\tsk3\fs\yaffs.cpp" /> - <ClCompile Include="..\..\tsk3\vs\bsd.c" /> - <ClCompile Include="..\..\tsk3\vs\dos.c" /> - <ClCompile Include="..\..\tsk3\vs\gpt.c" /> - <ClCompile Include="..\..\tsk3\vs\mac.c" /> - <ClCompile Include="..\..\tsk3\vs\mm_io.c" /> - <ClCompile Include="..\..\tsk3\vs\mm_open.c" /> - <ClCompile Include="..\..\tsk3\vs\mm_part.c" /> - <ClCompile Include="..\..\tsk3\vs\mm_types.c" /> - <ClCompile Include="..\..\tsk3\vs\sun.c" /> - <ClCompile Include="..\..\tsk3\fs\dcalc_lib.c" /> - <ClCompile Include="..\..\tsk3\fs\dcat_lib.c" /> - <ClCompile Include="..\..\tsk3\fs\dls_lib.c" /> - <ClCompile Include="..\..\tsk3\fs\dstat_lib.c" /> - <ClCompile Include="..\..\tsk3\fs\ext2fs.c" /> - <ClCompile Include="..\..\tsk3\fs\ext2fs_dent.c" /> - <ClCompile Include="..\..\tsk3\fs\ext2fs_journal.c" /> - <ClCompile Include="..\..\tsk3\fs\fatfs.c" /> - <ClCompile Include="..\..\tsk3\fs\fatfs_dent.cpp" /> - <ClCompile Include="..\..\tsk3\fs\fatfs_meta.c" /> - <ClCompile Include="..\..\tsk3\fs\ffind_lib.c" /> - <ClCompile Include="..\..\tsk3\fs\ffs.c" /> - <ClCompile Include="..\..\tsk3\fs\ffs_dent.c" /> - <ClCompile Include="..\..\tsk3\fs\fls_lib.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_attr.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_attrlist.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_block.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_dir.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_file.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_inode.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_io.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_load.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_name.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_open.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_parse.c" /> - <ClCompile Include="..\..\tsk3\fs\fs_types.c" /> - <ClCompile Include="..\..\tsk3\fs\hfs.c" /> - <ClCompile Include="..\..\tsk3\fs\hfs_dent.c" /> - <ClCompile Include="..\..\tsk3\fs\hfs_journal.c" /> - <ClCompile Include="..\..\tsk3\fs\hfs_unicompare.c" /> - <ClCompile Include="..\..\tsk3\fs\icat_lib.c" /> - <ClCompile Include="..\..\tsk3\fs\ifind_lib.c" /> - <ClCompile Include="..\..\tsk3\fs\ils_lib.c" /> - <ClCompile Include="..\..\tsk3\fs\iso9660.c" /> - <ClCompile Include="..\..\tsk3\fs\iso9660_dent.c" /> - <ClCompile Include="..\..\tsk3\fs\nofs_misc.c" /> - <ClCompile Include="..\..\tsk3\fs\ntfs.c" /> - <ClCompile Include="..\..\tsk3\fs\ntfs_dent.cpp" /> - <ClCompile Include="..\..\tsk3\fs\rawfs.c" /> - <ClCompile Include="..\..\tsk3\fs\swapfs.c" /> - <ClCompile Include="..\..\tsk3\fs\unix_misc.c" /> - <ClCompile Include="..\..\tsk3\fs\walk_cpp.cpp" /> - <ClCompile Include="..\..\tsk3\auto\auto.cpp" /> - <ClCompile Include="..\..\tsk3\auto\auto_db.cpp" /> - <ClCompile Include="..\..\tsk3\auto\case_db.cpp" /> - <ClCompile Include="..\..\tsk3\auto\db_sqlite.cpp" /> - <ClCompile Include="..\..\tsk3\auto\sqlite3.c" /> - <ClCompile Include="..\..\tsk3\base\md5c.c" /> - <ClCompile Include="..\..\tsk3\base\crc.c" /> - <ClCompile Include="..\..\tsk3\base\mymalloc.c" /> - <ClCompile Include="..\..\tsk3\base\sha1c.c" /> - <ClCompile Include="..\..\tsk3\base\tsk_endian.c" /> - <ClCompile Include="..\..\tsk3\base\tsk_error.c" /> - <ClCompile Include="..\..\tsk3\base\tsk_error_win32.cpp" /> - <ClCompile Include="..\..\tsk3\base\tsk_list.c" /> - <ClCompile Include="..\..\tsk3\base\tsk_lock.c" /> - <ClCompile Include="..\..\tsk3\base\tsk_parse.c" /> - <ClCompile Include="..\..\tsk3\base\tsk_printf.c" /> - <ClCompile Include="..\..\tsk3\base\tsk_stack.c" /> - <ClCompile Include="..\..\tsk3\base\tsk_unicode.c" /> - <ClCompile Include="..\..\tsk3\base\tsk_version.c" /> - <ClCompile Include="..\..\tsk3\base\XGetopt.c" /> - <ClCompile Include="..\..\tsk3\hashdb\encase_index.c" /> - <ClCompile Include="..\..\tsk3\hashdb\hk_index.c" /> - <ClCompile Include="..\..\tsk3\hashdb\idxonly_index.c" /> - <ClCompile Include="..\..\tsk3\hashdb\md5sum_index.c" /> - <ClCompile Include="..\..\tsk3\hashdb\nsrl_index.c" /> - <ClCompile Include="..\..\tsk3\hashdb\tm_lookup.c" /> - <ClCompile Include="..\..\tsk3\img\aff.c" /> - <ClCompile Include="..\..\tsk3\img\ewf.c" /> - <ClCompile Include="..\..\tsk3\img\img_io.c" /> - <ClCompile Include="..\..\tsk3\img\img_open.c" /> - <ClCompile Include="..\..\tsk3\img\img_types.c" /> - <ClCompile Include="..\..\tsk3\img\mult_files.c" /> - <ClCompile Include="..\..\tsk3\img\raw.c" /> + <ClCompile Include="..\..\tsk\vs\bsd.c" /> + <ClCompile Include="..\..\tsk\vs\dos.c" /> + <ClCompile Include="..\..\tsk\vs\gpt.c" /> + <ClCompile Include="..\..\tsk\vs\mac.c" /> + <ClCompile Include="..\..\tsk\vs\mm_io.c" /> + <ClCompile Include="..\..\tsk\vs\mm_open.c" /> + <ClCompile Include="..\..\tsk\vs\mm_part.c" /> + <ClCompile Include="..\..\tsk\vs\mm_types.c" /> + <ClCompile Include="..\..\tsk\vs\sun.c" /> + <ClCompile Include="..\..\tsk\fs\dcalc_lib.c" /> + <ClCompile Include="..\..\tsk\fs\dcat_lib.c" /> + <ClCompile Include="..\..\tsk\fs\dls_lib.c" /> + <ClCompile Include="..\..\tsk\fs\dstat_lib.c" /> + <ClCompile Include="..\..\tsk\fs\ext2fs.c" /> + <ClCompile Include="..\..\tsk\fs\ext2fs_dent.c" /> + <ClCompile Include="..\..\tsk\fs\ext2fs_journal.c" /> + <ClCompile Include="..\..\tsk\fs\fatfs.c" /> + <ClCompile Include="..\..\tsk\fs\fatfs_dent.cpp" /> + <ClCompile Include="..\..\tsk\fs\fatfs_meta.c" /> + <ClCompile Include="..\..\tsk\fs\ffind_lib.c" /> + <ClCompile Include="..\..\tsk\fs\ffs.c" /> + <ClCompile Include="..\..\tsk\fs\ffs_dent.c" /> + <ClCompile Include="..\..\tsk\fs\fls_lib.c" /> + <ClCompile Include="..\..\tsk\fs\fs_attr.c" /> + <ClCompile Include="..\..\tsk\fs\fs_attrlist.c" /> + <ClCompile Include="..\..\tsk\fs\fs_block.c" /> + <ClCompile Include="..\..\tsk\fs\fs_dir.c" /> + <ClCompile Include="..\..\tsk\fs\fs_file.c" /> + <ClCompile Include="..\..\tsk\fs\fs_inode.c" /> + <ClCompile Include="..\..\tsk\fs\fs_io.c" /> + <ClCompile Include="..\..\tsk\fs\fs_load.c" /> + <ClCompile Include="..\..\tsk\fs\fs_name.c" /> + <ClCompile Include="..\..\tsk\fs\fs_open.c" /> + <ClCompile Include="..\..\tsk\fs\fs_parse.c" /> + <ClCompile Include="..\..\tsk\fs\fs_types.c" /> + <ClCompile Include="..\..\tsk\fs\hfs.c" /> + <ClCompile Include="..\..\tsk\fs\hfs_dent.c" /> + <ClCompile Include="..\..\tsk\fs\hfs_journal.c" /> + <ClCompile Include="..\..\tsk\fs\hfs_unicompare.c" /> + <ClCompile Include="..\..\tsk\fs\icat_lib.c" /> + <ClCompile Include="..\..\tsk\fs\ifind_lib.c" /> + <ClCompile Include="..\..\tsk\fs\ils_lib.c" /> + <ClCompile Include="..\..\tsk\fs\iso9660.c" /> + <ClCompile Include="..\..\tsk\fs\iso9660_dent.c" /> + <ClCompile Include="..\..\tsk\fs\nofs_misc.c" /> + <ClCompile Include="..\..\tsk\fs\ntfs.c" /> + <ClCompile Include="..\..\tsk\fs\ntfs_dent.cpp" /> + <ClCompile Include="..\..\tsk\fs\rawfs.c" /> + <ClCompile Include="..\..\tsk\fs\swapfs.c" /> + <ClCompile Include="..\..\tsk\fs\unix_misc.c" /> + <ClCompile Include="..\..\tsk\fs\walk_cpp.cpp" /> + <ClCompile Include="..\..\tsk\fs\yaffs.cpp" /> + <ClCompile Include="..\..\tsk\auto\auto.cpp" /> + <ClCompile Include="..\..\tsk\auto\auto_db.cpp" /> + <ClCompile Include="..\..\tsk\auto\case_db.cpp" /> + <ClCompile Include="..\..\tsk\auto\db_sqlite.cpp" /> + <ClCompile Include="..\..\tsk\auto\sqlite3.c" /> + <ClCompile Include="..\..\tsk\base\md5c.c" /> + <ClCompile Include="..\..\tsk\base\mymalloc.c" /> + <ClCompile Include="..\..\tsk\base\sha1c.c" /> + <ClCompile Include="..\..\tsk\base\tsk_endian.c" /> + <ClCompile Include="..\..\tsk\base\tsk_error.c" /> + <ClCompile Include="..\..\tsk\base\tsk_error_win32.cpp" /> + <ClCompile Include="..\..\tsk\base\tsk_list.c" /> + <ClCompile Include="..\..\tsk\base\tsk_lock.c" /> + <ClCompile Include="..\..\tsk\base\tsk_parse.c" /> + <ClCompile Include="..\..\tsk\base\tsk_printf.c" /> + <ClCompile Include="..\..\tsk\base\tsk_stack.c" /> + <ClCompile Include="..\..\tsk\base\tsk_unicode.c" /> + <ClCompile Include="..\..\tsk\base\tsk_version.c" /> + <ClCompile Include="..\..\tsk\base\XGetopt.c" /> + <ClCompile Include="..\..\tsk\hashdb\encase_index.c" /> + <ClCompile Include="..\..\tsk\hashdb\hk_index.c" /> + <ClCompile Include="..\..\tsk\hashdb\idxonly_index.c" /> + <ClCompile Include="..\..\tsk\hashdb\md5sum_index.c" /> + <ClCompile Include="..\..\tsk\hashdb\nsrl_index.c" /> + <ClCompile Include="..\..\tsk\hashdb\tm_lookup.c" /> + <ClCompile Include="..\..\tsk\img\aff.c" /> + <ClCompile Include="..\..\tsk\img\ewf.c" /> + <ClCompile Include="..\..\tsk\img\img_io.c" /> + <ClCompile Include="..\..\tsk\img\img_open.c" /> + <ClCompile Include="..\..\tsk\img\img_types.c" /> + <ClCompile Include="..\..\tsk\img\mult_files.c" /> + <ClCompile Include="..\..\tsk\img\raw.c" /> </ItemGroup> <ItemGroup> - <ClInclude Include="..\..\tsk3\fs\tsk_yaffs.h" /> - <ClInclude Include="..\..\tsk3\vs\tsk_bsd.h" /> - <ClInclude Include="..\..\tsk3\vs\tsk_dos.h" /> - <ClInclude Include="..\..\tsk3\vs\tsk_gpt.h" /> - <ClInclude Include="..\..\tsk3\vs\tsk_mac.h" /> - <ClInclude Include="..\..\tsk3\vs\tsk_sun.h" /> - <ClInclude Include="..\..\tsk3\vs\tsk_vs.h" /> - <ClInclude Include="..\..\tsk3\vs\tsk_vs_i.h" /> - <ClInclude Include="..\..\tsk3\fs\tsk_ext2fs.h" /> - <ClInclude Include="..\..\tsk3\fs\tsk_fatfs.h" /> - <ClInclude Include="..\..\tsk3\fs\tsk_ffs.h" /> - <ClInclude Include="..\..\tsk3\fs\tsk_fs.h" /> - <ClInclude Include="..\..\tsk3\fs\tsk_fs_i.h" /> - <ClInclude Include="..\..\tsk3\fs\tsk_hfs.h" /> - <ClInclude Include="..\..\tsk3\fs\tsk_iso9660.h" /> - <ClInclude Include="..\..\tsk3\fs\tsk_ntfs.h" /> - <ClInclude Include="..\..\tsk3\auto\sqlite3.h" /> - <ClInclude Include="..\..\tsk3\auto\tsk_auto.h" /> - <ClInclude Include="..\..\tsk3\auto\tsk_auto_i.h" /> - <ClInclude Include="..\..\tsk3\auto\tsk_case_db.h" /> - <ClInclude Include="..\..\tsk3\auto\tsk_db_sqlite.h" /> - <ClInclude Include="..\..\tsk3\base\tsk_base.h" /> - <ClInclude Include="..\..\tsk3\base\tsk_base_i.h" /> - <ClInclude Include="..\..\tsk3\base\tsk_os.h" /> - <ClInclude Include="..\..\tsk3\hashdb\tsk_hashdb.h" /> - <ClInclude Include="..\..\tsk3\hashdb\tsk_hashdb_i.h" /> - <ClInclude Include="..\..\tsk3\img\aff.h" /> - <ClInclude Include="..\..\tsk3\img\ewf.h" /> - <ClInclude Include="..\..\tsk3\img\raw.h" /> - <ClInclude Include="..\..\tsk3\img\tsk_img.h" /> - <ClInclude Include="..\..\tsk3\img\tsk_img_i.h" /> + <ClInclude Include="..\..\tsk\vs\tsk_bsd.h" /> + <ClInclude Include="..\..\tsk\vs\tsk_dos.h" /> + <ClInclude Include="..\..\tsk\vs\tsk_gpt.h" /> + <ClInclude Include="..\..\tsk\vs\tsk_mac.h" /> + <ClInclude Include="..\..\tsk\vs\tsk_sun.h" /> + <ClInclude Include="..\..\tsk\vs\tsk_vs.h" /> + <ClInclude Include="..\..\tsk\vs\tsk_vs_i.h" /> + <ClInclude Include="..\..\tsk\fs\tsk_ext2fs.h" /> + <ClInclude Include="..\..\tsk\fs\tsk_fatfs.h" /> + <ClInclude Include="..\..\tsk\fs\tsk_ffs.h" /> + <ClInclude Include="..\..\tsk\fs\tsk_fs.h" /> + <ClInclude Include="..\..\tsk\fs\tsk_fs_i.h" /> + <ClInclude Include="..\..\tsk\fs\tsk_hfs.h" /> + <ClInclude Include="..\..\tsk\fs\tsk_iso9660.h" /> + <ClInclude Include="..\..\tsk\fs\tsk_ntfs.h" /> + <ClInclude Include="..\..\tsk\fs\tsk_yaffs.h" /> + <ClInclude Include="..\..\tsk\auto\sqlite3.h" /> + <ClInclude Include="..\..\tsk\auto\tsk_auto.h" /> + <ClInclude Include="..\..\tsk\auto\tsk_auto_i.h" /> + <ClInclude Include="..\..\tsk\auto\tsk_case_db.h" /> + <ClInclude Include="..\..\tsk\auto\tsk_db_sqlite.h" /> + <ClInclude Include="..\..\tsk\base\tsk_base.h" /> + <ClInclude Include="..\..\tsk\base\tsk_base_i.h" /> + <ClInclude Include="..\..\tsk\base\tsk_os.h" /> + <ClInclude Include="..\..\tsk\hashdb\tsk_hashdb.h" /> + <ClInclude Include="..\..\tsk\hashdb\tsk_hashdb_i.h" /> + <ClInclude Include="..\..\tsk\img\aff.h" /> + <ClInclude Include="..\..\tsk\img\ewf.h" /> + <ClInclude Include="..\..\tsk\img\raw.h" /> + <ClInclude Include="..\..\tsk\img\tsk_img.h" /> + <ClInclude Include="..\..\tsk\img\tsk_img_i.h" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/win32/libtsk/libtsk.vcxproj.filters b/win32/libtsk/libtsk.vcxproj.filters index c28f5c6d6..a4eeca709 100755 --- a/win32/libtsk/libtsk.vcxproj.filters +++ b/win32/libtsk/libtsk.vcxproj.filters @@ -21,256 +21,256 @@ </Filter> </ItemGroup> <ItemGroup> - <ClCompile Include="..\..\tsk3\vs\bsd.c"> + <ClCompile Include="..\..\tsk\vs\bsd.c"> <Filter>vs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\vs\dos.c"> + <ClCompile Include="..\..\tsk\vs\dos.c"> <Filter>vs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\vs\gpt.c"> + <ClCompile Include="..\..\tsk\vs\gpt.c"> <Filter>vs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\vs\mac.c"> + <ClCompile Include="..\..\tsk\vs\mac.c"> <Filter>vs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\vs\mm_io.c"> + <ClCompile Include="..\..\tsk\vs\mm_io.c"> <Filter>vs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\vs\mm_open.c"> + <ClCompile Include="..\..\tsk\vs\mm_open.c"> <Filter>vs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\vs\mm_part.c"> + <ClCompile Include="..\..\tsk\vs\mm_part.c"> <Filter>vs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\vs\mm_types.c"> + <ClCompile Include="..\..\tsk\vs\mm_types.c"> <Filter>vs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\vs\sun.c"> + <ClCompile Include="..\..\tsk\vs\sun.c"> <Filter>vs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\dcalc_lib.c"> + <ClCompile Include="..\..\tsk\fs\dcalc_lib.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\dcat_lib.c"> + <ClCompile Include="..\..\tsk\fs\dcat_lib.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\dls_lib.c"> + <ClCompile Include="..\..\tsk\fs\dls_lib.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\dstat_lib.c"> + <ClCompile Include="..\..\tsk\fs\dstat_lib.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\ext2fs.c"> + <ClCompile Include="..\..\tsk\fs\ext2fs.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\ext2fs_dent.c"> + <ClCompile Include="..\..\tsk\fs\ext2fs_dent.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\ext2fs_journal.c"> + <ClCompile Include="..\..\tsk\fs\ext2fs_journal.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fatfs.c"> + <ClCompile Include="..\..\tsk\fs\fatfs.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fatfs_meta.c"> + <ClCompile Include="..\..\tsk\fs\fatfs_meta.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\ffind_lib.c"> + <ClCompile Include="..\..\tsk\fs\ffind_lib.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\ffs.c"> + <ClCompile Include="..\..\tsk\fs\ffs.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\ffs_dent.c"> + <ClCompile Include="..\..\tsk\fs\ffs_dent.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fls_lib.c"> + <ClCompile Include="..\..\tsk\fs\fls_lib.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_attr.c"> + <ClCompile Include="..\..\tsk\fs\fs_attr.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_attrlist.c"> + <ClCompile Include="..\..\tsk\fs\fs_attrlist.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_block.c"> + <ClCompile Include="..\..\tsk\fs\fs_block.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_dir.c"> + <ClCompile Include="..\..\tsk\fs\fs_dir.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_file.c"> + <ClCompile Include="..\..\tsk\fs\fs_file.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_inode.c"> + <ClCompile Include="..\..\tsk\fs\fs_inode.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_io.c"> + <ClCompile Include="..\..\tsk\fs\fs_io.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_load.c"> + <ClCompile Include="..\..\tsk\fs\fs_load.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_name.c"> + <ClCompile Include="..\..\tsk\fs\fs_name.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_open.c"> + <ClCompile Include="..\..\tsk\fs\fs_open.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_parse.c"> + <ClCompile Include="..\..\tsk\fs\fs_parse.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fs_types.c"> + <ClCompile Include="..\..\tsk\fs\fs_types.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\hfs.c"> + <ClCompile Include="..\..\tsk\fs\hfs.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\hfs_dent.c"> + <ClCompile Include="..\..\tsk\fs\hfs_dent.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\hfs_journal.c"> + <ClCompile Include="..\..\tsk\fs\hfs_journal.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\hfs_unicompare.c"> + <ClCompile Include="..\..\tsk\fs\hfs_unicompare.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\icat_lib.c"> + <ClCompile Include="..\..\tsk\fs\icat_lib.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\ifind_lib.c"> + <ClCompile Include="..\..\tsk\fs\ifind_lib.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\ils_lib.c"> + <ClCompile Include="..\..\tsk\fs\ils_lib.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\iso9660.c"> + <ClCompile Include="..\..\tsk\fs\iso9660.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\iso9660_dent.c"> + <ClCompile Include="..\..\tsk\fs\iso9660_dent.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\nofs_misc.c"> + <ClCompile Include="..\..\tsk\fs\nofs_misc.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\rawfs.c"> + <ClCompile Include="..\..\tsk\fs\rawfs.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\swapfs.c"> + <ClCompile Include="..\..\tsk\fs\swapfs.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\unix_misc.c"> + <ClCompile Include="..\..\tsk\fs\unix_misc.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\walk_cpp.cpp"> + <ClCompile Include="..\..\tsk\fs\walk_cpp.cpp"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\auto\auto.cpp"> + <ClCompile Include="..\..\tsk\auto\auto.cpp"> <Filter>auto</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\auto\auto_db.cpp"> + <ClCompile Include="..\..\tsk\auto\auto_db.cpp"> <Filter>auto</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\auto\case_db.cpp"> + <ClCompile Include="..\..\tsk\auto\case_db.cpp"> <Filter>auto</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\auto\db_sqlite.cpp"> + <ClCompile Include="..\..\tsk\auto\db_sqlite.cpp"> <Filter>auto</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\auto\sqlite3.c"> + <ClCompile Include="..\..\tsk\auto\sqlite3.c"> <Filter>auto</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\md5c.c"> + <ClCompile Include="..\..\tsk\base\md5c.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\mymalloc.c"> + <ClCompile Include="..\..\tsk\base\mymalloc.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\sha1c.c"> + <ClCompile Include="..\..\tsk\base\sha1c.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\tsk_endian.c"> + <ClCompile Include="..\..\tsk\base\tsk_endian.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\tsk_error.c"> + <ClCompile Include="..\..\tsk\base\tsk_error.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\tsk_error_win32.cpp"> + <ClCompile Include="..\..\tsk\base\tsk_error_win32.cpp"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\tsk_list.c"> + <ClCompile Include="..\..\tsk\base\tsk_list.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\tsk_lock.c"> + <ClCompile Include="..\..\tsk\base\tsk_lock.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\tsk_parse.c"> + <ClCompile Include="..\..\tsk\base\tsk_parse.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\tsk_printf.c"> + <ClCompile Include="..\..\tsk\base\tsk_printf.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\tsk_stack.c"> + <ClCompile Include="..\..\tsk\base\tsk_stack.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\tsk_unicode.c"> + <ClCompile Include="..\..\tsk\base\tsk_unicode.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\tsk_version.c"> + <ClCompile Include="..\..\tsk\base\tsk_version.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\XGetopt.c"> + <ClCompile Include="..\..\tsk\base\XGetopt.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\base\crc.c"> + <ClCompile Include="..\..\tsk\base\crc.c"> <Filter>base</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\hashdb\encase_index.c"> + <ClCompile Include="..\..\tsk\hashdb\encase_index.c"> <Filter>hash</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\hashdb\hk_index.c"> + <ClCompile Include="..\..\tsk\hashdb\hk_index.c"> <Filter>hash</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\hashdb\idxonly_index.c"> + <ClCompile Include="..\..\tsk\hashdb\idxonly_index.c"> <Filter>hash</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\hashdb\md5sum_index.c"> + <ClCompile Include="..\..\tsk\hashdb\md5sum_index.c"> <Filter>hash</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\hashdb\nsrl_index.c"> + <ClCompile Include="..\..\tsk\hashdb\nsrl_index.c"> <Filter>hash</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\hashdb\tm_lookup.c"> + <ClCompile Include="..\..\tsk\hashdb\tm_lookup.c"> <Filter>hash</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\img\aff.c"> + <ClCompile Include="..\..\tsk\img\aff.c"> <Filter>img</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\img\ewf.c"> + <ClCompile Include="..\..\tsk\img\ewf.c"> <Filter>img</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\img\img_io.c"> + <ClCompile Include="..\..\tsk\img\img_io.c"> <Filter>img</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\img\img_open.c"> + <ClCompile Include="..\..\tsk\img\img_open.c"> <Filter>img</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\img\img_types.c"> + <ClCompile Include="..\..\tsk\img\img_types.c"> <Filter>img</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\img\mult_files.c"> + <ClCompile Include="..\..\tsk\img\mult_files.c"> <Filter>img</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\img\raw.c"> + <ClCompile Include="..\..\tsk\img\raw.c"> <Filter>img</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\fatfs_dent.cpp"> + <ClCompile Include="..\..\tsk\fs\fatfs_dent.cpp"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\ntfs.c"> + <ClCompile Include="..\..\tsk\fs\ntfs.c"> <Filter>fs</Filter> </ClCompile> - <ClCompile Include="..\..\tsk3\fs\ntfs_dent.cpp"> + <ClCompile Include="..\..\tsk\fs\ntfs_dent.cpp"> <Filter>fs</Filter> </ClCompile> <ClCompile Include="..\..\tsk3\fs\yaffs.cpp"> @@ -278,94 +278,94 @@ </ClCompile> </ItemGroup> <ItemGroup> - <ClInclude Include="..\..\tsk3\vs\tsk_bsd.h"> + <ClInclude Include="..\..\tsk\vs\tsk_bsd.h"> <Filter>vs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\vs\tsk_dos.h"> + <ClInclude Include="..\..\tsk\vs\tsk_dos.h"> <Filter>vs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\vs\tsk_gpt.h"> + <ClInclude Include="..\..\tsk\vs\tsk_gpt.h"> <Filter>vs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\vs\tsk_mac.h"> + <ClInclude Include="..\..\tsk\vs\tsk_mac.h"> <Filter>vs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\vs\tsk_sun.h"> + <ClInclude Include="..\..\tsk\vs\tsk_sun.h"> <Filter>vs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\vs\tsk_vs.h"> + <ClInclude Include="..\..\tsk\vs\tsk_vs.h"> <Filter>vs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\vs\tsk_vs_i.h"> + <ClInclude Include="..\..\tsk\vs\tsk_vs_i.h"> <Filter>vs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\fs\tsk_ext2fs.h"> + <ClInclude Include="..\..\tsk\fs\tsk_ext2fs.h"> <Filter>fs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\fs\tsk_fatfs.h"> + <ClInclude Include="..\..\tsk\fs\tsk_fatfs.h"> <Filter>fs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\fs\tsk_ffs.h"> + <ClInclude Include="..\..\tsk\fs\tsk_ffs.h"> <Filter>fs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\fs\tsk_fs.h"> + <ClInclude Include="..\..\tsk\fs\tsk_fs.h"> <Filter>fs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\fs\tsk_fs_i.h"> + <ClInclude Include="..\..\tsk\fs\tsk_fs_i.h"> <Filter>fs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\fs\tsk_hfs.h"> + <ClInclude Include="..\..\tsk\fs\tsk_hfs.h"> <Filter>fs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\fs\tsk_iso9660.h"> + <ClInclude Include="..\..\tsk\fs\tsk_iso9660.h"> <Filter>fs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\fs\tsk_ntfs.h"> + <ClInclude Include="..\..\tsk\fs\tsk_ntfs.h"> <Filter>fs</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\auto\sqlite3.h"> + <ClInclude Include="..\..\tsk\auto\sqlite3.h"> <Filter>auto</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\auto\tsk_auto.h"> + <ClInclude Include="..\..\tsk\auto\tsk_auto.h"> <Filter>auto</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\auto\tsk_auto_i.h"> + <ClInclude Include="..\..\tsk\auto\tsk_auto_i.h"> <Filter>auto</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\auto\tsk_case_db.h"> + <ClInclude Include="..\..\tsk\auto\tsk_case_db.h"> <Filter>auto</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\auto\tsk_db_sqlite.h"> + <ClInclude Include="..\..\tsk\auto\tsk_db_sqlite.h"> <Filter>auto</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\base\tsk_base.h"> + <ClInclude Include="..\..\tsk\base\tsk_base.h"> <Filter>base</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\base\tsk_base_i.h"> + <ClInclude Include="..\..\tsk\base\tsk_base_i.h"> <Filter>base</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\base\tsk_os.h"> + <ClInclude Include="..\..\tsk\base\tsk_os.h"> <Filter>base</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\hashdb\tsk_hashdb.h"> + <ClInclude Include="..\..\tsk\hashdb\tsk_hashdb.h"> <Filter>hash</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\hashdb\tsk_hashdb_i.h"> + <ClInclude Include="..\..\tsk\hashdb\tsk_hashdb_i.h"> <Filter>hash</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\img\aff.h"> + <ClInclude Include="..\..\tsk\img\aff.h"> <Filter>img</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\img\ewf.h"> + <ClInclude Include="..\..\tsk\img\ewf.h"> <Filter>img</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\img\raw.h"> + <ClInclude Include="..\..\tsk\img\raw.h"> <Filter>img</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\img\tsk_img.h"> + <ClInclude Include="..\..\tsk\img\tsk_img.h"> <Filter>img</Filter> </ClInclude> - <ClInclude Include="..\..\tsk3\img\tsk_img_i.h"> + <ClInclude Include="..\..\tsk\img\tsk_img_i.h"> <Filter>img</Filter> </ClInclude> <ClInclude Include="..\..\tsk3\fs\tsk_yaffs.h"> -- GitLab