Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cvs fixes + install scripts gentoo/suse/redhat

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@428 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
commit fdfd9e3a782ff61cf8b040bc653f3b144173e367 1 parent 3d58cb8
Claes Wikstrom authored
76 configure
View
@@ -711,10 +711,16 @@ fi
+
+
+
+
+
+
case "$target_os" in
*cygwin*)
ERLDIR=`echo ${ERL} | sed 's/\/erts.*//'`
- ERL_DLL_LIB=`ntpath.sh ${ERLDIR}/usr/lib/erl_dll.lib`
+ ERL_DLL_LIB=`./scripts/ntpath.sh ${ERLDIR}/usr/lib/erl_dll.lib`
;;
*)
@@ -728,10 +734,31 @@ fi
+ echo $ac_n "checking erl_interface version""... $ac_c" 1>&6
+echo "configure:739: checking erl_interface version" >&5
+ if eval "test \"`echo '$''{'bt_cv_erl_interface_vsn'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ bt_cv_erl_interface_vsn="`ls ${ERLDIR} ${ERLDIR}/lib | \
+ awk -F- '/^erl_interface-/ { if ($2 > v) v=$2; }
+ END { print v; }'`"
+ case "$bt_cv_erl_interface_vsn" in
+ "")
+ { echo "configure: error: "Could not figure out version Erlang library: erl_interface"" 1>&2; exit 1; }
+ ;;
+ *)
+ ;;
+ esac
+fi
+
+ ERL_INTERFACE_VSN=$bt_cv_erl_interface_vsn
+ echo "$ac_t""$bt_cv_erl_interface_vsn" 1>&6
+
+
ERL_INTERFACE_LIB=${ERLDIR}/lib/erl_interface-${ERL_INTERFACE_VSN}/lib
case $target_os in
*cygwin*)
- ERL_INTERFACE_LIBS=`./ntpath.sh "$ERL_INTERFACE_LIB/erl_interface.lib $ERL_INTERFACE_LIB/ei.lib"`;;
+ ERL_INTERFACE_LIBS=`./scripts/ntpath.sh "$ERL_INTERFACE_LIB/erl_interface.lib $ERL_INTERFACE_LIB/ei.lib"`;;
*)
ERL_INTERFACE_LIBS="-lerl_interface -lei ";;
esac
@@ -774,7 +801,7 @@ EOF
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:778: checking for $ac_word" >&5
+echo "configure:805: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -804,7 +831,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:808: checking for $ac_word" >&5
+echo "configure:835: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -855,7 +882,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:859: checking for $ac_word" >&5
+echo "configure:886: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -887,7 +914,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:891: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:918: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -898,12 +925,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 902 "configure"
+#line 929 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -929,12 +956,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:933: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:960: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:938: checking whether we are using GNU C" >&5
+echo "configure:965: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -943,7 +970,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -962,7 +989,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:966: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:993: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -994,7 +1021,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:998: checking how to run the C preprocessor" >&5
+echo "configure:1025: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1009,13 +1036,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1013 "configure"
+#line 1040 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1026,13 +1053,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1030 "configure"
+#line 1057 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1043,13 +1070,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1047 "configure"
+#line 1074 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1075,13 +1102,13 @@ echo "$ac_t""$CPP" 1>&6
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1079: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1106: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 1085 "configure"
+#line 1112 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -1099,7 +1126,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 1103 "configure"
+#line 1130 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -1148,7 +1175,7 @@ fi
esac
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1152: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1179: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1186,7 +1213,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1190: checking for a BSD compatible install" >&5
+echo "configure:1217: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1453,6 +1480,7 @@ s%@ERL@%$ERL%g
s%@ERLC@%$ERLC%g
s%@ERL_DLL_LIB@%$ERL_DLL_LIB%g
s%@ERLDIR@%$ERLDIR%g
+s%@ERL_INTERFACE_VSN@%$ERL_INTERFACE_VSN%g
s%@ERL_INTERFACE_LIB@%$ERL_INTERFACE_LIB%g
s%@ERL_INTERFACE_LIBS@%$ERL_INTERFACE_LIBS%g
s%@ERL_INTERFACE_INCLUDE@%$ERL_INTERFACE_INCLUDE%g
36 configure.in
View
@@ -1,4 +1,4 @@
-dnl define([AC_CACHE_LOAD], )dnl
+DNA define([AC_CACHE_LOAD], )dnl
dnl define([AC_CACHE_SAVE], )dnl
AC_INIT(Makefile)
@@ -14,11 +14,40 @@ AC_SUBST(ERL)
AC_SUBST(ERLC)
+dnl ----------------------------------------------------------------------
+dnl
+dnl BT_ERL_LIB_VSN figures out version of an erlang application
+dnl and substitutes it as "APPNAME"_VSN
+dnl
+
+AC_DEFUN(BT_ERL_LIB_VSN,
+[
+ AC_MSG_CHECKING([$1 version])
+ AC_CACHE_VAL(bt_cv_$1_vsn,
+ [bt_cv_$1_vsn="`ls ${ERLDIR} ${ERLDIR}/lib | \
+ awk -F- '/^$1-/ { if ([$]2 > v) v=[$]2; }
+ END { print v; }'`"
+ case "$bt_cv_$1_vsn" in
+ "")
+ AC_MSG_ERROR("Could not figure out version Erlang library: $1")
+ ;;
+ *)
+ ;;
+ esac])
+ translit($1, [a-z], [A-Z])_VSN=$bt_cv_$1_vsn
+ AC_SUBST(translit($1, [a-z], [A-Z])_VSN)dnl
+ AC_MSG_RESULT($bt_cv_$1_vsn)
+])dnl
+
+
+
+
+
case "$target_os" in
*cygwin*)
ERLDIR=`echo ${ERL} | sed 's/\/erts.*//'`
- ERL_DLL_LIB=`ntpath.sh ${ERLDIR}/usr/lib/erl_dll.lib`
+ ERL_DLL_LIB=`./scripts/ntpath.sh ${ERLDIR}/usr/lib/erl_dll.lib`
AC_SUBST(ERL_DLL_LIB)
;;
*)
@@ -31,11 +60,12 @@ fi
AC_SUBST(ERLDIR)
+BT_ERL_LIB_VSN(erl_interface)
ERL_INTERFACE_LIB=${ERLDIR}/lib/erl_interface-${ERL_INTERFACE_VSN}/lib
case $target_os in
*cygwin*)
- ERL_INTERFACE_LIBS=`./ntpath.sh "$ERL_INTERFACE_LIB/erl_interface.lib $ERL_INTERFACE_LIB/ei.lib"`;;
+ ERL_INTERFACE_LIBS=`./scripts/ntpath.sh "$ERL_INTERFACE_LIB/erl_interface.lib $ERL_INTERFACE_LIB/ei.lib"`;;
*)
ERL_INTERFACE_LIBS="-lerl_interface -lei ";;
esac
27 scripts/Install
View
@@ -10,7 +10,22 @@ etcdir=$4
y=yaws-${YAWS_VSN}
p=${prefix}
-sh ./mangle ${prefix}/lib/yaws ${erl} yaws.ss ${installprefix}/bin/yaws
+
+# sed mangler
+mangle ()
+{
+ d=$1
+ e=$2
+ from=$3
+ to=$4
+
+ install -d `dirname $to`
+ sed -e "s;%yawsdir%;$d;g" -e "s;%erl%;$e;" $from > $to
+}
+
+
+
+mangle ${prefix}/lib/yaws ${erl} yaws.ss ${installprefix}/bin/yaws
install -d ${installprefix}/lib/yaws/examples/ebin
install -d ${installprefix}/lib/yaws/examples/include
chmod +x ${installprefix}/bin/yaws
@@ -20,7 +35,7 @@ else
t=${etcdir}/yaws.conf
fi
-sh ./mangle ${prefix}/lib/yaws ${erl} yaws.conf.template ${t}
+mangle ${prefix}/lib/yaws ${erl} yaws.conf.template ${t}
if [ -f /etc/gentoo-release ]; then
@@ -29,13 +44,17 @@ if [ -f /etc/gentoo-release ]; then
cp gentoo/init.d.yaws ${etcdir}/init.d/yaws
chmod +x ${etcdir}/init.d/yaws
sed -e "s;%prefix%;$p;g" gentoo/conf.d.yaws > ${etcdir}/conf.d/yaws
-
elif [ -f /etc/redhat-release ]; then
install -d ${etcdir}/init.d
- sed -e "s;%prefix%;$p;g" yaws.init.d > ${etcdir}/init.d/yaws
+ sed -e "s;%prefix%;$p;g" redhat/yaws.init.d > ${etcdir}/init.d/yaws
+ chmod +x ${etcdir}/init.d/yaws
+elif [ -f /etc/suseservers ]; then
+ install -d ${etcdir}/init.d
+ sed -e "s;%prefix%;$p;g" suse/yaws.init.d > ${etcdir}/init.d/yaws
chmod +x ${etcdir}/init.d/yaws
else
echo "Don't know how to make /etc/init scrips for this system"
+ echo "possibly add $1/bin/yaws -D -heart to your /etc/rc.local manually"
fi
6 scripts/Makefile
View
@@ -19,8 +19,10 @@ local_install: ../bin/yaws
clean:
rm -f ../bin/yaws
-install: all
- sh ./Install $(PREFIX) $(INSTALLPREFIX) $(ERL) $(ETCDIR)
+install: all .foo
+
+.foo:
+ sh -x ./Install $(PREFIX) $(INSTALLPREFIX) $(ERL) $(ETCDIR)
11 scripts/ntpath.sh
View
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+
+for i in $*
+ do
+ xxx=`echo $i | sed 's/\//\\\\/g'`
+ echo -n " "
+ echo -n \'
+ echo -n $xxx
+ echo -n \' " "
+ done
0  scripts/yaws.init.d → scripts/redhat/yaws.init.d
View
File renamed without changes
67 scripts/suse/yaws.init.d
View
@@ -1,44 +1,11 @@
#! /bin/sh
-# Copyright (c) 1995-2002 SuSE Linux AG, Nuernberg, Germany.
-# All rights reserved.
-#
-# Author: Kurt Garloff <feedback@suse.de>
-#
-# /etc/init.d/FOO
-#
-# and symbolic its link
-#
-# /(usr/)sbin/rcFOO
-#
-# LSB compliant service control script; see http://www.linuxbase.org/spec/
-#
-# System startup script for some example service or daemon FOO (template)
-#
-### BEGIN INIT INFO
-# Provides: FOO
-# Required-Start: $remote_fs $syslog
-# Required-Stop: $remote_fs $syslog
-# Default-Start: 3 5
-# Default-Stop: 0 1 2 6
-# Description: Start FOO to allow XY and provide YZ
-# continued on second line by '#<TAB>'
-### END INIT INFO
-#
-# Note on Required-Start: It does specify the init script ordering,
-# not real dependencies. Depencies have to be handled by admin
-# resp. the configuration tools (s)he uses.
-# Source SuSE config (if still necessary, most info has been moved)
-test -r /etc/rc.config && . /etc/rc.config
-# Check for missing binaries (stale symlinks should not happen)
-FOO_BIN=/usr/sbin/FOO
-test -x $FOO_BIN || exit 5
+YAWS_BIN=%prefix%bin/yaws
+
+test -x $YAWS_BIN || exit 5
+
-# Check for existence of needed config file and read it
-FOO_CONFIG=/etc/sysconfig/FOO
-test -r $FOO_CONFIG || exit 6
-. $FOO_CONFIG
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
@@ -72,23 +39,23 @@ rc_reset
case "$1" in
start)
- echo -n "Starting FOO"
+ echo -n "Starting YAWS"
## Start daemon with startproc(8). If this fails
## the echo return value is set appropriate.
# NOTE: startproc returns 0, even if service is
# already running to match LSB spec.
- startproc $FOO_BIN
+ startproc $YAWS_BIN -D -heart
# Remember status and be verbose
rc_status -v
;;
stop)
- echo -n "Shutting down FOO"
+ echo -n "Shutting down YAWS"
## Stop daemon with killproc(8) and if this fails
## set echo the echo return value.
- killproc -TERM $FOO_BIN
+ startproc $YAWS_BIN -s
# Remember status and be verbose
rc_status -v
@@ -116,29 +83,21 @@ case "$1" in
## do this on signal 1 (SIGHUP).
## If it does not support it, restart.
- echo -n "Reload service FOO"
+ echo -n "Force Reload service YAWS"
## if it supports it:
- killproc -HUP $FOO_BIN
- #touch /var/run/FOO.pid
+ $0 restart
rc_status -v
- ## Otherwise:
- #$0 stop && $0 start
- #rc_status
;;
reload)
## Like force-reload, but if daemon does not support
## signalling, do nothing (!)
# If it supports signalling:
- echo -n "Reload service FOO"
- killproc -HUP $FOO_BIN
- #touch /var/run/FOO.pid
+
+ startproc $YAWS_BIN -h
rc_status -v
- ## Otherwise if it does not support reload:
- #rc_failed 3
- #rc_status -v
;;
status)
echo -n "Checking for service FOO: "
@@ -152,7 +111,7 @@ case "$1" in
# 3 - service not running
# NOTE: checkproc returns LSB compliant status values.
- checkproc $FOO_BIN
+ checkproc $YAWS_BIN -S
rc_status -v
;;
probe)
1  scripts/yaws.ss
View
@@ -54,7 +54,6 @@ do
-D)
daemon=" -detached ";;
-d)
- set -x
debug=" -boot start_sasl -yaws debug ";;
-t)
trace=" -yaws trace traffic ";;
2  src/yaws_config.erl
View
@@ -423,7 +423,7 @@ fload(FD, server, GC, C, Cs, Lno, Chars) ->
[ '<', "ssl", '>'] ->
ssl:start(),
- fload(FD, ssl, GC, C, Cs, Lno+1, Next);
+ fload(FD, ssl, GC, C#sconf{ssl = #ssl{}}, Cs, Lno+1, Next);
["appmods", '=' | Modules] ->
C2 = C#sconf{appmods = Modules},
3  src/yaws_server.erl
View
@@ -601,6 +601,7 @@ acceptor(GS) ->
acceptor0(GS, Top) ->
?TC([{record, GS, gs}]),
X = do_accept(GS),
+ ?Debug("do_accept ret: ~p~n", [X]),
Top ! {self(), next},
case X of
{ok, Client} ->
@@ -704,7 +705,7 @@ aloop(CliSock, GS, Num) when GS#gs.ssl == ssl ->
SC = hd(GS#gs.group),
IP = case SC#sconf.access_log of
true ->
- {ok, {Ip, _Port}} = ssl:peername(CliSock, SC),
+ {ok, {Ip, _Port}} = ssl:peername(CliSock),
Ip;
_ ->
undefined
2  vsn.mk
View
@@ -1 +1 @@
-YAWS_VSN=1.21
+YAWS_VSN=1.22
Please sign in to comment.
Something went wrong with that request. Please try again.