help-libidn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: win32 Visual Studio 2005 project for libidn 1.x


From: Simon Josefsson
Subject: Re: win32 Visual Studio 2005 project for libidn 1.x
Date: Wed, 06 Feb 2008 11:53:53 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

Adam Strzelecki <address@hidden> writes:

> Hi Simon,
>
> I'm sending you updated changes for GIT HEAD for both gsasl & libidn,
> this time I've made proper patches, no extra zip files or anything.

Thanks.  I'm forwarding this, with the patch, to the libidn list, so
that others don't waste their time developing similar patches.  I know
others have been looking at this before.

For the record, I think this is ready to install in git when we receive
the copyright assignment.  So others should feel comfortable testing it.

/Simon

PS. I forgot to cc the list in my last post, sorry...

diff --git a/README.win32 b/README.win32
new file mode 100644
index 0000000..2518cf2
--- /dev/null
+++ b/README.win32
@@ -0,0 +1,10 @@
+libidn 1.x for win32
+====================
+
+Requirements:
+* Visual Studio 2005 (C++)
+* ActiveState Perl (perl command) present in PATH (optional for generation of
+  win32/config.h, lib/rfc3454.c, lib/tlds.c, lib/stringprep.h)
+
+Please open win32/libidn.sln and build. Output libraries will be written into
+win32/lib (win32/lib/debug for Debug versions) folder.
diff --git a/win32/include/Wild.pm b/win32/include/Wild.pm
new file mode 100644
index 0000000..2f9f124
--- /dev/null
+++ b/win32/include/Wild.pm
@@ -0,0 +1,7 @@
+# Wild.pm - emulate shell @ARGV expansion on shells that don't
+use File::DosGlob;
address@hidden = map {
+              my @g = File::DosGlob::glob($_) if /[*?]/;
+              @g ? @g : $_;
+            } @ARGV;
+1;
diff --git a/win32/include/ac-stdint.h b/win32/include/ac-stdint.h
new file mode 100644
index 0000000..635f201
--- /dev/null
+++ b/win32/include/ac-stdint.h
@@ -0,0 +1,22 @@
+#ifndef _AC_STDINT_H
+#define _AC_STDINT_H 1
+#ifndef _GENERATED_STDINT_H
+#define _GENERATED_STDINT_H
+
+#define uint8_t                unsigned char
+#define uint16_t       unsigned short
+#define uint32_t       unsigned int
+#define int8_t         signed char
+#define int16_t                signed short
+#define int32_t                signed int
+
+#define gint16         int16_t
+
+#ifdef  _WIN64
+typedef __int64                ssize_t;
+#else
+typedef _W64 int       ssize_t;
+#endif
+
+#endif
+#endif
diff --git a/win32/include/gen-win32-headers.pl 
b/win32/include/gen-win32-headers.pl
new file mode 100644
index 0000000..c19b48a
--- /dev/null
+++ b/win32/include/gen-win32-headers.pl
@@ -0,0 +1,87 @@
+#!/usr/bin/perl -w
+# This script generates win32 (Visual Studio) include files for libidn
+# using configure.ac.
+# Usage:
+#  gen-win32-headers.pl configure.ac > config.h
+#  gen-win32-headers.pl configure.ac stringprep.h.in > stringprep.h
+
+use strict;
+
+my $version = "";
+my $package = "";
+my $upackage = "";
+
+if(@ARGV < 1) {
+       print "#error \"gen-win32-headers.pl requires at least one 
parameter.\"\n";
+       exit;
+}
+
+if(!(open CONFIG, "<$ARGV[0]")) {
+       print "#error \"Cannot open $ARGV[0] for version information.\"\n";
+       exit;
+};
+while(<CONFIG>) {
+       
if(m/AC_INIT\s*\(\s*\[([^\]]+)\]\s*,\s*\[([^\]]+)\]\s*,\s*\[([^\]]+)\]\s*\)/gi) 
{
+               $package = $1;
+               $version = $2;
+               $package =~ s/^GNU\s//;
+               $upackage = uc($package);
+               last;
+       }
+}
+close CONFIG;
+
+if($version eq "") {
+       print "#error \"Cannot find version information in $ARGV[0]\"\n";
+       exit;
+}
+
+shift @ARGV;
+
+if(@ARGV == 0) {
+       print <<CONFIG;
+#ifndef _CONFIG_H
+#define _CONFIG_H
+
+#define PACKAGE "$package"
+#define PACKAGE_VERSION "$version"
+
+#define strcasecmp stricmp
+#define strncasecmp strnicmp
+
+#define LOCALEDIR "."
+
+#if _MSC_VER && !__cplusplus
+# define inline __inline
+#endif
+
+#endif /* _CONFIG_H */
+CONFIG
+       exit;
+}
+
+while(<>) {
+       if(! m/^extern "C"/gi) {
+               if(s/address@hidden@/$version/gi) {
+                       print;
+                       print <<EXPORTS;
+
+/* ${package} Windows DLL */
+#ifndef ${upackage}_API
+# if defined(_WIN32) && !defined(${upackage}_STATIC)
+#  ifdef ${upackage}_EXPORTS
+#   define ${upackage}_API  __declspec(dllexport)
+#  else /* ${upackage}_EXPORTS */
+#   define ${upackage}_API  __declspec(dllimport)
+#  endif /* ${upackage}_EXPORTS */
+# else /* _WIN32 && !${upackage}_STATIC */
+#  define ${upackage}_API extern
+# endif /* _WIN32 && !${upackage}_STATIC */
+#endif /* ${upackage}_API */
+EXPORTS
+                       next;
+               }
+               s/^(\s*)extern(\s*IDN_DLL_VAR)?/$1${upackage}_API/i;
+       }
+       print;
+}
diff --git a/win32/include/idn-int.h b/win32/include/idn-int.h
new file mode 100644
index 0000000..16750fb
--- /dev/null
+++ b/win32/include/idn-int.h
@@ -0,0 +1 @@
+#include "ac-stdint.h"
diff --git a/win32/include/stdbool.h b/win32/include/stdbool.h
new file mode 100644
index 0000000..029602e
--- /dev/null
+++ b/win32/include/stdbool.h
@@ -0,0 +1,11 @@
+#ifndef _STDBOOL_H
+#define _STDBOOL_H
+
+#define _Bool signed char
+enum { false = 0, true = 1 };
+#define bool _Bool
+#define false 0
+#define true 1
+#define __bool_true_false_are_defined 1
+
+#endif /* _STDBOOL_H */
diff --git a/win32/include/unistd.h b/win32/include/unistd.h
new file mode 100644
index 0000000..e69de29
diff --git a/win32/libidn.sln b/win32/libidn.sln
new file mode 100644
index 0000000..936dc1c
--- /dev/null
+++ b/win32/libidn.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libidn", "libidn.vcproj", 
"{0B883079-812A-405E-AC8F-59F47CE9A3FF}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Release|Win32 = Release|Win32
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {0B883079-812A-405E-AC8F-59F47CE9A3FF}.Debug|Win32.ActiveCfg = 
Debug|Win32
+               {0B883079-812A-405E-AC8F-59F47CE9A3FF}.Debug|Win32.Build.0 = 
Debug|Win32
+               {0B883079-812A-405E-AC8F-59F47CE9A3FF}.Release|Win32.ActiveCfg 
= Release|Win32
+               {0B883079-812A-405E-AC8F-59F47CE9A3FF}.Release|Win32.Build.0 = 
Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/win32/libidn.vcproj b/win32/libidn.vcproj
new file mode 100644
index 0000000..b1e66b3
--- /dev/null
+++ b/win32/libidn.vcproj
@@ -0,0 +1,306 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="8,00"
+       Name="libidn"
+       ProjectGUID="{0B883079-812A-405E-AC8F-59F47CE9A3FF}"
+       RootNamespace="libidn"
+       Keyword="Win32Proj"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+                       IntermediateDirectory="$(ConfigurationName)"
+                       ConfigurationType="2"
+                       CharacterSet="2"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                               Description="Generating tables &amp; 
includes..."
+                               CommandLine="if not exist include\config.h call 
perl include\gen-win32-headers.pl ..\configure.ac ..\lib\stringprep.h.in &gt; 
..\lib\stringprep.h&#x0D;&#x0A;if not exist include\config.h call perl 
include\gen-win32-headers.pl ..\configure.ac &gt; 
include\config.h&#x0D;&#x0A;cd ..\lib&#x0D;&#x0A;if not exist stringprep.h call 
perl ..\win32\include\gen-win32-headers.pl ..\configure.ac stringprep.h.in &gt; 
stringprep.h&#x0D;&#x0A;if not exist rfc3454.c call perl 
gen-stringprep-tables.pl ..\doc\specifications\rfc3454.txt&#x0D;&#x0A;if not 
exist tlds.c call perl -MWild -I..\win32\include gen-tld-tables.pl 
..\doc\tld\*.tld &gt; tlds.c&#x0D;&#x0A;if not exist gunidecomp.h call perl 
gen-unicode-tables.pl -decomp 3.2 ..\doc\specifications"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               
AdditionalIncludeDirectories="include;../lib;../lib/gl"
+                               
PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;LIBIDN_EXPORTS;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               Detect64BitPortabilityProblems="true"
+                               DebugInformationFormat="4"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               OutputFile="lib/debug/$(ProjectName).dll"
+                               GenerateDebugInformation="true"
+                               ImportLibrary="lib/debug/$(TargetName).lib"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCWebDeploymentTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|Win32"
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+                       IntermediateDirectory="$(ConfigurationName)"
+                       ConfigurationType="2"
+                       CharacterSet="2"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                               Description="Generating tables &amp; 
includes..."
+                               CommandLine="if not exist include\config.h call 
perl include\gen-win32-headers.pl ..\configure.ac ..\lib\stringprep.h.in &gt; 
..\lib\stringprep.h&#x0D;&#x0A;if not exist include\config.h call perl 
include\gen-win32-headers.pl ..\configure.ac &gt; 
include\config.h&#x0D;&#x0A;cd ..\lib&#x0D;&#x0A;if not exist stringprep.h call 
perl ..\win32\include\gen-win32-headers.pl ..\configure.ac stringprep.h.in &gt; 
stringprep.h&#x0D;&#x0A;if not exist rfc3454.c call perl 
gen-stringprep-tables.pl ..\doc\specifications\rfc3454.txt&#x0D;&#x0A;if not 
exist tlds.c call perl -MWild -I..\win32\include gen-tld-tables.pl 
..\doc\tld\*.tld &gt; tlds.c&#x0D;&#x0A;if not exist gunidecomp.h call perl 
gen-unicode-tables.pl -decomp 3.2 ..\doc\specifications"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               
AdditionalIncludeDirectories="include;../lib;../lib/gl"
+                               
PreprocessorDefinitions="WIN32;NDEBUG;_USRDLL;LIBIDN_EXPORTS;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
+                               RuntimeLibrary="2"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               Detect64BitPortabilityProblems="true"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               OutputFile="lib/$(ProjectName).dll"
+                               ImportLibrary="lib/$(TargetName).lib"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCWebDeploymentTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+       </Configurations>
+       <References>
+       </References>
+       <Files>
+               <Filter
+                       Name="Source Files"
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath="..\lib\gl\c-ctype.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\gl\c-strcasecmp.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\gl\c-strncasecmp.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\idn-free.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\idna.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\nfkc.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\pr29.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\profiles.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\punycode.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\rfc3454.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\strerror-idna.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\strerror-pr29.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\strerror-punycode.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\strerror-stringprep.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\strerror-tld.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\gl\striconv.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\stringprep.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\gl\strverscmp.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\tld.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\tlds.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\toutf8.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\version.c"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Header Files"
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
+                       
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+                       >
+                       <File
+                               RelativePath=".\include\ac-stdint.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\include\config.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\include\idn-int.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\include\stdbool.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\lib\stringprep.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\include\unistd.h"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Resource Files"
+                       
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+                       
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+                       >
+               </Filter>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]