Skip to content
Browse files

conditional compile of websockets

  • Loading branch information...
1 parent 9d929ca commit f5eb9d5151f87cd57af5f38a69ea172e651964a2 @klacke committed Jan 5, 2010
Showing with 22 additions and 1 deletion.
  1. +7 −0 configure.in
  2. +2 −0 include.mk.in
  3. +13 −1 src/Makefile
View
7 configure.in
@@ -99,12 +99,19 @@ fi
AC_SUBST(ERLDIR)
AC_SUBST(ERL_DLL_LIB)
+
+ERTS_MINOR=`ls "${ERLDIR}" | grep erts | sed 's/erts-.\.//' | sed 's/\..*//'`
+ERTS_MAJOR=`ls "${ERLDIR}" |grep erts | sed 's/erts-//' | sed 's/\..*//'`
+AC_SUBST(ERTS_MINOR)
+AC_SUBST(ERTS_MAJOR)
+
BT_ERL_LIB_VSN(erts)
BT_ERL_LIB_VSN(kernel)
BT_ERL_LIB_VSN(stdlib)
BT_ERL_LIB_VSN(sasl)
BT_ERL_LIB_VSN(mnesia)
+
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
View
2 include.mk.in
@@ -59,6 +59,8 @@ STDLIB_VSN=@STDLIB_VSN@
SASL_VSN=@SASL_VSN@
MNESIA_VSN=@MNESIA_VSN@
+ERTS_MAJOR=@ERTS_MAJOR@
+ERTS_MINOR=@ERTS_MINOR@
ERLDIR=@ERLDIR@
View
14 src/Makefile
@@ -8,6 +8,18 @@ endif
include ../vsn.mk
VSN=$(YAWS_VSN)
+
+
+## the websocket code uses new modern bits stuff
+ifeq ($(shell test $(ERTS_MAJOR) -gt 4 && test $(ERTS_MINOR) -gt 6 && echo YES), YES)
+ HASBITS=true
+endif
+
+ifeq ($(HASBITS),true)
+ BITSMODS=yaws_websockets
+endif
+
+
MODULES=yaws \
yaws_app \
yaws_ticker \
@@ -43,7 +55,7 @@ MODULES=yaws \
yaws_sup_restarts \
yaws_stats \
yaws_multipart \
- yaws_websockets
+ $(BITSMODS)

0 comments on commit f5eb9d5

Please sign in to comment.
Something went wrong with that request. Please try again.