Permalink
Browse files

win32 work

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1383 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent 0b01501 commit 78713383fae8fbe1c1cf7efed5c0325670cf0336 @klacke committed Feb 11, 2009
Showing with 619 additions and 13 deletions.
  1. +10 −0 man/Makefile
  2. +13 −6 src/yaws.erl
  3. +15 −7 src/yaws_ctl.erl
  4. +49 −0 win32/Makefile
  5. +2 −0 win32/README.txt
  6. +192 −0 win32/build.xml.in
  7. BIN win32/img/yaws_head.gif
  8. +12 −0 win32/license.xml
  9. +80 −0 win32/mkinstaller.sh
  10. +129 −0 win32/yaws.c
  11. +117 −0 win32/yaws.conf
View
@@ -8,4 +8,14 @@ install:
cp yaws.conf.5 $(DESTDIR)$(PREFIX)/share/man/man5
cp yaws_api.5 $(DESTDIR)$(PREFIX)/share/man/man5
+
+
+## for the win32 build, the rest of us know how to run man
+pdf:
+ man -t ./yaws.1 | ps2pdf yaws.1.pdf
+ man -t ./yaws.conf.5 | ps2pdf yaws.conf.5.pdf
+ man -t ./yaws_api.5 | ps2pdf yaws_api.5.pdf
+
+
+
all debug clean:
View
@@ -1599,7 +1599,7 @@ erase_header(location) ->
getuid() ->
case os:type() of
{win32, _} ->
- {ok, "XXX"};
+ {ok, "0"};
_ ->
load_setuid_drv(),
P = open_port({spawn, "setuid_drv g"},[]),
@@ -1608,14 +1608,21 @@ getuid() ->
{ok, IntList}
end
end.
+
user_to_home(User) ->
- load_setuid_drv(),
- P = open_port({spawn, "setuid_drv " ++ [$h|User]}, []),
- receive
- {P, {data, "ok " ++ Home}} ->
- Home
+ case os:type() of
+ {win32, _} ->
+ ".";
+ _ ->
+ load_setuid_drv(),
+ P = open_port({spawn, "setuid_drv " ++ [$h|User]}, []),
+ receive
+ {P, {data, "ok " ++ Home}} ->
+ Home
+ end
end.
+
uid_to_name(Uid) ->
load_setuid_drv(),
P = open_port({spawn, "setuid_drv " ++ [$n|integer_to_list(Uid)]}, []),
View
@@ -53,17 +53,25 @@ run(GC) ->
end.
rand() ->
- try
- crypto:start(),
- crypto:rand_uniform(0, 1 bsl 64)
- catch
- _ ->
- {A1, A2, A3}=now(),
+ case os:type() of
+ {win32, _} ->
+ {A1, A2, A3}=now(),
random:seed(A1, A2, A3),
- random:uniform(1 bsl 64)
+ random:uniform(1 bsl 64);
+ _ ->
+ try
+ crypto:start(),
+ crypto:rand_uniform(0, 1 bsl 64)
+ catch
+ _ ->
+ {A1, A2, A3}=now(),
+ random:seed(A1, A2, A3),
+ random:uniform(1 bsl 64)
+ end
end.
+
ctl_args() ->
[{packet, 2},
{active, false},
View
@@ -0,0 +1,49 @@
+##
+## Debian Linux mingw cross-compiler version:
+## To install
+# sudo apt-get install mingw32
+
+
+CC = i586-mingw32msvc-gcc
+AR = i586-mingw32msvc-ar
+LD = i586-mingw32msvc-gcc
+
+
+CP = cp
+RM = rm -f
+#AR = i586-mingw32msvc-ar
+MKDIR = -mkdir
+
+##
+## Definitions:
+##
+CFLAGS = -O2 -Wall
+INCLUDES = -I.
+
+
+##
+## Global Makefile settings
+##
+OBJS = \
+ yaws.o
+
+.c.o:
+ $(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
+
+##
+## Targets
+##
+all: yaws.exe
+ ./mkinstaller.sh
+
+
+yaws.exe: $(OBJS)
+ $(CC) $(CFLAGS) $(OBJS) -o yaws.exe
+
+
+clean:
+ $(RM) *.o
+ $(RM) *.a
+ $(RM) *.exe
+ $(RM) -rf ebin examples applications ssl src www include doc priv bin logs scripts vsn.mk LICENSE.txt
+
View
@@ -0,0 +1,2 @@
+
+win32 version of yaws
View
@@ -0,0 +1,192 @@
+<project>
+ <shortName>Yaws</shortName>
+ <fullName>Yaws webserver @vsn@</fullName>
+ <version>@vsn@</version>
+ <installerFilename></installerFilename>
+ <readmeFile></readmeFile>
+ <licenseFile>LICENSE.txt</licenseFile>
+ <splashImage>img/yaws_head.gif</splashImage>
+ <enableRollback>1</enableRollback>
+ <saveRelativePaths>1</saveRelativePaths>
+ <componentList>
+ <component>
+ <name>default</name>
+ <description>Default Component</description>
+ <canBeEdited>1</canBeEdited>
+ <selected>1</selected>
+ <show>1</show>
+ <folderList>
+ <folder>
+ <description>Program Files</description>
+ <destination>${installdir}</destination>
+ <name>programfiles</name>
+ <platforms>all</platforms>
+ <shortcutList>
+ <shortcut>
+ <comment>Uninstall</comment>
+ <exec>${installdir}/${uninstallerName}</exec>
+ <icon></icon>
+ <name>Uninstall ${product_fullname}</name>
+ <path>${installdir}</path>
+ <platforms>all</platforms>
+ <runInTerminal>0</runInTerminal>
+ <windowsExec>${installdir}/${uninstallerName}.exe</windowsExec>
+ <windowsExecArgs></windowsExecArgs>
+ <windowsIcon></windowsIcon>
+ <windowsPath>${installdir}</windowsPath>
+ </shortcut>
+ </shortcutList>
+ </folder>
+ <folder>
+ <description>Program Files</description>
+ <destination>${installdir}</destination>
+ <name>programfileslinux</name>
+ <platforms>linux</platforms>
+ </folder>
+ <folder>
+ <description>Program Files</description>
+ <destination>${installdir}</destination>
+ <name>programfileswindows</name>
+ <platforms>windows</platforms>
+ <actionList>
+ <logMessage>
+ <text>hello there logging</text>
+ </logMessage>
+ <registrySet>
+ <key>HKEY_LOCAL_MACHINE\SOFTWARE\Hyber\Yaws</key>
+ <name>DIR</name>
+ <type>REG_SZ</type>
+ <value>${installdir}</value>
+ </registrySet>
+
+ <addDirectoryToPath>
+ <scope>system</scope>
+ <path>${installdir}/bin</path>
+ </addDirectoryToPath>
+ <substitute>
+ <files>${installdir}/README.txt</files>
+ <substitutionList>
+ <substitution>
+ <pattern>%yawsdir%</pattern>
+ <value>${installdir}</value>
+ </substitution>
+ </substitutionList>
+ </substitute>
+
+ <substitute>
+ <files>${installdir}/yaws.conf</files>
+ <substitutionList>
+ <substitution>
+ <pattern>%yawsdir%</pattern>
+ <value>${installdir}</value>
+ </substitution>
+ </substitutionList>
+ </substitute>
+
+ </actionList>
+
+
+ <distributionFileList>
+ <distributionDirectory>
+ <origin>bin</origin>
+ </distributionDirectory>
+ <distributionDirectory>
+ <origin>scripts</origin>
+ </distributionDirectory>
+ <distributionDirectory>
+ <origin>logs</origin>
+ </distributionDirectory>
+ <distributionDirectory>
+ <origin>include</origin>
+ </distributionDirectory>
+ <distributionDirectory>
+ <origin>ssl</origin>
+ </distributionDirectory>
+ <distributionDirectory>
+ <origin>doc</origin>
+ </distributionDirectory>
+ <distributionDirectory>
+ <origin>ebin</origin>
+ </distributionDirectory>
+ <distributionDirectory>
+ <origin>www</origin>
+ </distributionDirectory>
+ <distributionDirectory>
+ <origin>applications</origin>
+ </distributionDirectory>
+ <distributionDirectory>
+ <origin>priv</origin>
+ </distributionDirectory>
+ <distributionFile>
+ <origin>LICENSE.txt</origin>
+ </distributionFile>
+ <distributionFile>
+ <origin>yaws.conf</origin>
+ </distributionFile>
+ <distributionFile>
+ <origin>README.txt</origin>
+ </distributionFile>
+ <distributionFile>
+ <origin>include.mk</origin>
+ </distributionFile>
+ <distributionFile>
+ <origin>vsn.mk</origin>
+ </distributionFile>
+ <distributionDirectory>
+ <origin>src</origin>
+ </distributionDirectory>
+ <distributionDirectory>
+ <origin>examples</origin>
+ </distributionDirectory>
+
+
+ </distributionFileList>
+ </folder>
+ </folderList>
+ <startMenuShortcutList>
+ <startMenuShortcut>
+ <comment>Docs</comment>
+ <name>Docs</name>
+ <runInTerminal>0</runInTerminal>
+ <windowsExec>${installdir}/doc</windowsExec>
+ <windowsExecArgs></windowsExecArgs>
+ <windowsIcon></windowsIcon>
+ <windowsPath>${installdir}/doc</windowsPath>
+ </startMenuShortcut>
+ <startMenuShortcut>
+ <comment>README</comment>
+ <name>README</name>
+ <runInTerminal>0</runInTerminal>
+ <windowsExec>${installdir}/README.txt</windowsExec>
+ <windowsExecArgs></windowsExecArgs>
+ <windowsIcon></windowsIcon>
+ <windowsPath>${installdir}/</windowsPath>
+ </startMenuShortcut>
+ </startMenuShortcutList>
+ </component>
+ </componentList>
+ <parameterList>
+ <directoryParameter>
+ <name>installdir</name>
+ <description>Installer.Parameter.installdir.description</description>
+ <explanation>Installer.Parameter.installdir.explanation</explanation>
+ <value>${platform_install_prefix}/${product_shortname}-${product_version}</value>
+ <default>${platform_install_prefix}/${product_shortname}-${product_version}</default>
+ <allowEmptyValue>0</allowEmptyValue>
+ <ask>yes</ask>
+ <cliOptionName>prefix</cliOptionName>
+ <mustBeWritable>yes</mustBeWritable>
+ <mustExist>0</mustExist>
+ <width>30</width>
+ </directoryParameter>
+ </parameterList>
+ <finalPageActionList>
+ <actionGroup progressText="${msg(Installer.ReadmeFile.View)}">
+ <actionList>
+ <readFile path="${installdir}/README.txt" name="languageFileText" encoding="iso8859-1"/>
+ <showText text="${languageFileText}" title="${msg(Installer.ReadmeFile.Title)}"/>
+ </actionList>
+ </actionGroup>
+ </finalPageActionList>
+</project>
+
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,12 @@
+<license>
+ <issueDate>2008-06-09</issueDate>
+ <licenseSchemaVersion>1.2</licenseSchemaVersion>
+ <licenseType>standard</licenseType>
+ <majorVersion>5</majorVersion>
+ <minorVersion>4</minorVersion>
+ <organization>Tail-f Systems - Single Developer License - 19803661</organization>
+ <patchVersion>8</patchVersion>
+ <product>BitRock InstallBuilder Multiplatform Professional</product>
+ <project></project>
+ <signature>0ec4dd77e3c05dbd992cee4ec49cafc0</signature>
+</license>
Oops, something went wrong.

0 comments on commit 7871338

Please sign in to comment.