Skip to content

Commit

Permalink
addded configure option -with-defaultcharset
Browse files Browse the repository at this point in the history
git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@729 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information
Claes Wikstrom committed Jun 17, 2004
1 parent 704f81e commit 177f03b
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 58 deletions.
85 changes: 47 additions & 38 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
--with-defaultcharset=String specify default charset, i.e UTF-8 "

# Initialize some variables set by options.
# The variables have the same names as the options, with
Expand Down Expand Up @@ -563,7 +565,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi

echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:567: checking host system type" >&5
echo "configure:569: checking host system type" >&5

host_alias=$host
case "$host_alias" in
Expand All @@ -584,7 +586,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6

echo $ac_n "checking target system type""... $ac_c" 1>&6
echo "configure:588: checking target system type" >&5
echo "configure:590: checking target system type" >&5

target_alias=$target
case "$target_alias" in
Expand All @@ -602,7 +604,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6

echo $ac_n "checking build system type""... $ac_c" 1>&6
echo "configure:606: checking build system type" >&5
echo "configure:608: checking build system type" >&5

build_alias=$build
case "$build_alias" in
Expand Down Expand Up @@ -632,7 +634,7 @@ EOF
# Extract the first word of "erl", so it can be a program name with args.
set dummy erl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:636: checking for $ac_word" >&5
echo "configure:638: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
Expand Down Expand Up @@ -667,7 +669,7 @@ fi
# Extract the first word of "erlc", so it can be a program name with args.
set dummy erlc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:671: checking for $ac_word" >&5
echo "configure:673: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ERLC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
Expand Down Expand Up @@ -705,6 +707,22 @@ fi



# Check whether --with-default-charset or --without-default-charset was given.
if test "${with_default_charset+set}" = set; then
withval="$with_default_charset"
:
fi



if test "x$with_defaultcharset" = "x" ; then
DEFAULT_CHARSET=
else
DEFAULT_CHARSET=${with_defaultcharset}
fi






Expand All @@ -730,7 +748,7 @@ fi
# 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:734: checking for $ac_word" >&5
echo "configure:752: 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
Expand Down Expand Up @@ -760,7 +778,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:764: checking for $ac_word" >&5
echo "configure:782: 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
Expand Down Expand Up @@ -811,7 +829,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:815: checking for $ac_word" >&5
echo "configure:833: 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
Expand Down Expand Up @@ -843,7 +861,7 @@ fi
fi

echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:847: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
echo "configure:865: 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.
Expand All @@ -854,12 +872,12 @@ cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext << EOF
#line 858 "configure"
#line 876 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
if { (eval echo configure:863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:881: \"$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
Expand All @@ -885,12 +903,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:889: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "configure:907: 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:894: checking whether we are using GNU C" >&5
echo "configure:912: 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
Expand All @@ -899,7 +917,7 @@ else
yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:903: \"$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:921: \"$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
Expand All @@ -918,7 +936,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:922: checking whether ${CC-cc} accepts -g" >&5
echo "configure:940: 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
Expand Down Expand Up @@ -950,7 +968,7 @@ else
fi

echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:954: checking how to run the C preprocessor" >&5
echo "configure:972: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
Expand All @@ -965,13 +983,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 969 "configure"
#line 987 "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:975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:993: \"$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
:
Expand All @@ -982,13 +1000,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 986 "configure"
#line 1004 "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:992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1010: \"$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
:
Expand All @@ -999,13 +1017,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
#line 1003 "configure"
#line 1021 "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:1009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1027: \"$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
:
Expand All @@ -1031,13 +1049,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:1035: checking whether ${CC-cc} needs -traditional" >&5
echo "configure:1053: 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 1041 "configure"
#line 1059 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
Expand All @@ -1055,7 +1073,7 @@ rm -f conftest*

if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
#line 1059 "configure"
#line 1077 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
Expand Down Expand Up @@ -1135,7 +1153,7 @@ esac


echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:1139: checking whether ${MAKE-make} sets \${MAKE}" >&5
echo "configure:1157: 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
Expand Down Expand Up @@ -1173,7 +1191,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:1177: checking for a BSD compatible install" >&5
echo "configure:1195: 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
Expand Down Expand Up @@ -1237,16 +1255,6 @@ EOF

;;

*qnx*)
cat >> condefs.h <<\EOF
#define QNX 1
EOF
LD_SHARED="qcc -shared"

LIBS="$LIBS -lsocket"

;;

*solaris*)
cat >> confdefs.h <<\EOF
#define SOLARIS 1
Expand Down Expand Up @@ -1284,7 +1292,7 @@ EOF
# Extract the first word of "werl", so it can be a program name with args.
set dummy werl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1278: checking for $ac_word" >&5
echo "configure:1296: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_WERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
Expand Down Expand Up @@ -1493,6 +1501,7 @@ s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@ERL@%$ERL%g
s%@ERLC@%$ERLC%g
s%@DEFAULT_CHARSET@%$DEFAULT_CHARSET%g
s%@ERL_DLL_LIB@%$ERL_DLL_LIB%g
s%@ERLDIR@%$ERLDIR%g
s%@CC@%$CC%g
Expand Down
12 changes: 12 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ AC_SUBST(ERL)
AC_SUBST(ERLC)


AC_ARG_WITH(default-charset,
[ --with-defaultcharset=String specify default charset, i.e UTF-8 ])


if test "x$with_defaultcharset" = "x" ; then
DEFAULT_CHARSET=
else
DEFAULT_CHARSET=${with_defaultcharset}
fi

AC_SUBST(DEFAULT_CHARSET)

dnl ----------------------------------------------------------------------
dnl
dnl BT_ERL_LIB_VSN figures out version of an erlang application
Expand Down
1 change: 1 addition & 0 deletions include.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ERL=@ERL@
WERL=@WERL@
ERLC=@ERLC@
EMULATOR=beam
DEFAULT_CHARSET=@DEFAULT_CHARSET@

ifdef debug
ERLC_FLAGS+=-Ddebug
Expand Down
1 change: 0 additions & 1 deletion include/yaws.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
max_size_cached_file = 8000,
large_file_chunk_size = 10240,
cache_refresh_secs = 30, % seconds (auto zero when debug)
default_type = "text/html",
include_dir = [],
phpexe = "php",
yaws, %% server string
Expand Down
8 changes: 6 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,18 @@ yaws_vsn.erl: yaws_vsn.template ../vsn.mk
. ../vsn.mk; \
sed "s/%VSN%/${YAWS_VSN}/" < yaws_vsn.template > yaws_vsn.erl

mime_types.erl: mime.types mime_type_c.erl

charset.def:
echo -n $(DEFAULT_CHARSET) > charset.def

mime_types.erl: mime.types mime_type_c.erl charset.def
erl -noshell -pa ../ebin -s mime_type_c compile

debug:
$(MAKE) TYPE=debug

clean:
rm -f $(EBIN_FILES) yaws_vsn.erl
rm -f $(EBIN_FILES) yaws_vsn.erl charset.def mime_types.erl

install: all docsinstall
install -d $(INSTALLPREFIX)/lib/yaws/examples/ebin
Expand Down
Loading

0 comments on commit 177f03b

Please sign in to comment.