aboutsummaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-04-02 01:07:35 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-04-02 01:07:57 +0200
commita772248e1a2f0886d8479b2f14392f020ea8c6e0 (patch)
tree2890d5a6ae9c5ff120ae6c42bb044baf9e8f226c /lib/common
parent5de40ee8216c7a3ddb2bf88570f798c8ac4f40f8 (diff)
Import the remaining utility files into VisualStudio project
- The libcommon print verion function requires the PACKAGE_NAME and PACKAGE_VERSION defines. Those are added manually to the msvc stub of config.h. - Also, libcommon cannot directly include getopt.h - libfstree needs to change the return type for getline Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/common')
-rw-r--r--lib/common/Makemodule.am2
-rw-r--r--lib/common/comp_opt.c7
-rw-r--r--lib/common/libcommon.vcxproj182
-rw-r--r--lib/common/libcommon.vcxproj.filters74
4 files changed, 264 insertions, 1 deletions
diff --git a/lib/common/Makemodule.am b/lib/common/Makemodule.am
index c59ab4c..5f659dd 100644
--- a/lib/common/Makemodule.am
+++ b/lib/common/Makemodule.am
@@ -14,3 +14,5 @@ libcommon_a_SOURCES += lib/common/comp_lzo.c
endif
noinst_LIBRARIES += libcommon.a
+
+EXTRA_DIST += lib/common/libcommon.vcxproj lib/common/libcommon.vcxproj.filters
diff --git a/lib/common/comp_opt.c b/lib/common/comp_opt.c
index 58a7a21..93ad1cc 100644
--- a/lib/common/comp_opt.c
+++ b/lib/common/comp_opt.c
@@ -8,9 +8,14 @@
#include <string.h>
#include <stdlib.h>
-#include <getopt.h>
#include <ctype.h>
+#ifdef HAVE_GETSUBOPT
+#include <getopt.h>
+#else
+#include "compat.h"
+#endif
+
typedef struct {
const char *name;
sqfs_u16 flag;
diff --git a/lib/common/libcommon.vcxproj b/lib/common/libcommon.vcxproj
new file mode 100644
index 0000000..5f2eaf2
--- /dev/null
+++ b/lib/common/libcommon.vcxproj
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" 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>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <VCProjectVersion>16.0</VCProjectVersion>
+ <ProjectGuid>{4AF21B3A-E7A0-48E6-951C-CA442410231F}</ProjectGuid>
+ <RootNamespace>libcommon</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ <IntDir>$(Platform)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <SDLCheck>true</SDLCheck>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ConformanceMode>true</ConformanceMode>
+ <AdditionalIncludeDirectories>$(SolutionDir)\include\win32;$(SolutionDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsC</CompileAs>
+ <ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <SDLCheck>true</SDLCheck>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ConformanceMode>true</ConformanceMode>
+ <AdditionalIncludeDirectories>$(SolutionDir)\include\win32;$(SolutionDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsC</CompileAs>
+ <ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ConformanceMode>true</ConformanceMode>
+ <AdditionalIncludeDirectories>$(SolutionDir)\include\win32;$(SolutionDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsC</CompileAs>
+ <ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ConformanceMode>true</ConformanceMode>
+ <AdditionalIncludeDirectories>$(SolutionDir)\include\win32;$(SolutionDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <CompileAs>CompileAsC</CompileAs>
+ <ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="compress.c" />
+ <ClCompile Include="comp_opt.c" />
+ <ClCompile Include="data_reader_dump.c" />
+ <ClCompile Include="data_writer.c" />
+ <ClCompile Include="get_path.c" />
+ <ClCompile Include="hardlink.c" />
+ <ClCompile Include="inode_stat.c" />
+ <ClCompile Include="io_stdin.c" />
+ <ClCompile Include="mkdir_p.c" />
+ <ClCompile Include="parse_size.c" />
+ <ClCompile Include="perror.c" />
+ <ClCompile Include="print_size.c" />
+ <ClCompile Include="print_version.c" />
+ <ClCompile Include="serialize_fstree.c" />
+ <ClCompile Include="statistics.c" />
+ <ClCompile Include="writer.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\include\common.h" />
+ <ClInclude Include="..\..\include\compat.h" />
+ <ClInclude Include="..\..\include\win32\config.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/lib/common/libcommon.vcxproj.filters b/lib/common/libcommon.vcxproj.filters
new file mode 100644
index 0000000..1f91163
--- /dev/null
+++ b/lib/common/libcommon.vcxproj.filters
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Headers">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
+ </Filter>
+ <Filter Include="Source">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="get_path.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="hardlink.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="inode_stat.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="io_stdin.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="comp_opt.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="compress.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="data_reader_dump.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="data_writer.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="print_size.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="print_version.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="serialize_fstree.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="statistics.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="writer.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="mkdir_p.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="parse_size.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ <ClCompile Include="perror.c">
+ <Filter>Source</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\include\common.h">
+ <Filter>Headers</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\win32\config.h">
+ <Filter>Headers</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\compat.h">
+ <Filter>Headers</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file