Permalink
Browse files

cygwin support

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1253 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent 6f82638 commit 46079901051086425aea6530fd0348ff89377a48 @klacke committed May 25, 2008
Showing with 46 additions and 42 deletions.
  1. +21 −21 scripts/Makefile
  2. +6 −1 scripts/Subst
  3. +2 −2 scripts/yaws.template
  4. +10 −12 src/Makefile
  5. +7 −6 src/yaws_config.erl
View
@@ -6,11 +6,11 @@ all debug: ../bin/yaws yaws.conf
../bin/yaws: yaws.template
cat yaws.template | \
./Subst %yawsdir% `pwd`/.. | \
- ./Subst %vardir% $(VARDIR) | \
- ./Subst %run_erl% "$(ERLBINDIR)/run_erl" | \
- ./Subst %to_erl% "$(ERLBINDIR)/to_erl" | \
- ./Subst %erl% "$(ERL)" | \
- ./Subst %werl% "$(WERL)" > ../bin/yaws
+ ./Subst %vardir% $(VARDIR) | \
+ ./Subst %run_erl% "$(ERLBINDIR)/run_erl" | \
+ ./Subst %to_erl% "$(ERLBINDIR)/to_erl" | \
+ ./Subst %erl% $(ERL) | \
+ ./Subst %werl% $(WERL) > ../bin/yaws
chmod +x ../bin/yaws
@@ -23,14 +23,14 @@ local_install: ../bin/yaws
fi; \
echo "--- Installing local config file at $${target} "; \
cat yaws.conf.template | \
- ./Subst %yawsdir% `pwd`/.. | \
- ./Subst %logdir% $$HOME/yaws_logs | \
- ./Subst %host% `hostname` | \
- ./Subst %port% 8000 | \
- ./Subst %vardir% $(VARDIR) | \
- ./Subst %docroot% `pwd`/../www | \
- ./Subst %certdir% `pwd`/../ssl | \
- ./Subst %sslport% 4443 > $${target}; \
+ ./Subst %yawsdir% `pwd`/.. | \
+ ./Subst %logdir% $$HOME/yaws_logs | \
+ ./Subst %host% `hostname` | \
+ ./Subst %port% 8000 | \
+ ./Subst %vardir% $(VARDIR) | \
+ ./Subst %docroot% `pwd`/../www | \
+ ./Subst %certdir% `pwd`/../ssl | \
+ ./Subst %sslport% 4443 > $${target}; \
$(INSTALL) -d $$HOME/bin; \
rm $$HOME/bin/yaws 2> /dev/null; \
cp -f ../bin/yaws $$HOME/bin/yaws; \
@@ -40,14 +40,14 @@ local_install: ../bin/yaws
yaws.conf:
@echo PREFIX is $(PREFIX)
cat yaws.conf.template | \
- ./Subst %yawsdir% $(PREFIX)/lib/yaws | \
- ./Subst %logdir% $(VARDIR)/log/yaws | \
- ./Subst %vardir% $(VARDIR) | \
- ./Subst %host% `hostname` | \
- ./Subst %port% 80 | \
- ./Subst %docroot% $(VARDIR)/yaws/www | \
- ./Subst %certdir% $(ETCDIR) | \
- ./Subst %sslport% 443 > yaws.conf
+ ./Subst %yawsdir% $(PREFIX)/lib/yaws | \
+ ./Subst %logdir% $(VARDIR)/log/yaws | \
+ ./Subst %vardir% $(VARDIR) | \
+ ./Subst %host% `hostname` | \
+ ./Subst %port% 80 | \
+ ./Subst %docroot% $(VARDIR)/yaws/www | \
+ ./Subst %certdir% $(ETCDIR) | \
+ ./Subst %sslport% 443 > yaws.conf
clean:
rm -f ../bin/yaws yaws.conf
View
@@ -2,7 +2,12 @@
p=$1
-d=$2
+
+if [ "$(uname -a | fgrep Cygwin)" != "" ]; then
+ d=`cygpath -m $2`
+else
+ d=$2
+fi
sed -e "s;$p;$d;g"
View
@@ -8,9 +8,9 @@ to_erl="%to_erl%"
case `uname` in
CYGWIN*)
- yawsdir=`cygpath --windows $yawsdir`
+ yawsdir=`cygpath -m $yawsdir`
werl="%werl%"
- delim=\\;;
+ delim=/;;
*)
delim=/
esac
View
@@ -57,22 +57,20 @@ $(EBIN_FILES) : ../include/yaws.hrl ../include/yaws_api.hrl
yaws_generated.erl: yaws_generated.template ../vsn.mk
. ../vsn.mk; \
- sed -e "s/%VSN%/${YAWS_VSN}/" -e \
- "s;%VARDIR%;${VARDIR};g" -e \
- "s;%localinstall%;true;g" -e \
- "s;%ETCDIR%;${ETCDIR};g" \
- < yaws_generated.template > yaws_generated.erl
-
+ cat yaws_generated.template | \
+ ../scripts/Subst %VSN% ${YAWS_VSN} | \
+ ../scripts/Subst %VARDIR% ${VARDIR} | \
+ ../scripts/Subst %localinstall% true | \
+ ../scripts/Subst %ETCDIR% ${ETCDIR} > yaws_generated.erl
## need to differentiate between local install and not
regen:
. ../vsn.mk; \
- sed -e "s/%VSN%/${YAWS_VSN}/" -e \
- "s;%VARDIR%;${VARDIR};g" -e \
- "s;%localinstall%;false;g" -e \
- "s;%ETCDIR%;${ETCDIR};g" \
- < yaws_generated.template > yaws_generated.erl
-
+ cat yaws_generated.template | \
+ ../scripts/Subst %VSN% ${YAWS_VSN} | \
+ ../scripts/Subst %VARDIR% ${VARDIR} | \
+ ../scripts/Subst %localinstall% false | \
+ ../scripts/Subst %ETCDIR% ${ETCDIR} > yaws_generated.erl
charset.def:
if [ ! -z "$(DEFAULT_CHARSET)" ]; then \
View
@@ -379,10 +379,10 @@ fload(FD, globals, GC, C, Cs, Lno, Chars) ->
Err
end;
{error, Error} ->
- {error, ?F("Direcory ~s is not readable: ~s", [Name, Error])}
+ {error, ?F("Directory ~s is not readable: ~s", [Name, Error])}
end;
false ->
- {error, ?F("Expect directory at line ~w", [Lno])}
+ {error, ?F("Expect directory at line ~w (subconfdir: ~s)", [Lno, Dir])}
end;
["trace", '=', Bstr] when GC#gconf.trace == false ->
@@ -412,7 +412,7 @@ fload(FD, globals, GC, C, Cs, Lno, Chars) ->
fload(FD, globals, GC#gconf{logdir = Dir},
C, Cs, Lno+1, Next);
false ->
- {error, ?F("Expect directory at line ~w", [Lno])}
+ {error, ?F("Expect directory at line ~w (logdir ~s)", [Lno, Dir])}
end;
["ebin_dir", '=', Ebindir] ->
@@ -423,7 +423,7 @@ fload(FD, globals, GC, C, Cs, Lno, Chars) ->
[Dir|GC#gconf.ebin_dir]},
C, Cs, Lno+1, Next);
false ->
- {error, ?F("Expect directory at line ~w", [Lno])}
+ {error, ?F("Expect directory at line ~w (ebin_dir: ~s)", [Lno, Dir])}
end;
["runmod", '=', Mod0] ->
@@ -476,7 +476,7 @@ fload(FD, globals, GC, C, Cs, Lno, Chars) ->
[Dir|GC#gconf.include_dir]},
C, Cs, Lno+1, Next);
false ->
- {error, ?F("Expect directory at line ~w", [Lno])}
+ {error, ?F("Expect directory at line ~w (include_dir: ~s)", [Lno, Dir])}
end;
["mnesia_dir", '=', Mnesiadir] ->
@@ -728,7 +728,8 @@ fload(FD, server, GC, C, Cs, Lno, Chars) ->
xtra_docroots = tl(RootDirs)},
fload(FD, server, GC, C2, Cs, Lno+1, Next);
_ ->
- {error, ?F("Expect directory at line ~w", [Lno])}
+ {error, ?F("Expect directory at line ~w (docroot: ~s)",
+ [Lno, hd(RootDirs)])}
end;
["partial_post_size",'=',Size] ->

0 comments on commit 4607990

Please sign in to comment.