Permalink
Browse files

To hell and back. No plugins yet, researching a clean method.

  • Loading branch information...
kev009 committed Apr 6, 2011
1 parent d05b3fa commit 865d52a08f04c73e5ed689a59213260cebd27bff
Showing with 1,373 additions and 24 deletions.
  1. +6 −6 .gitignore
  2. +37 −0 Makefile.am
  3. +1 −0 autogen.sh
  4. 0 build/auto/aux/keep
  5. +83 −0 build/auto/m4/ax_c_float_words_bigendian.m4
  6. +195 −0 build/auto/m4/ax_cflags_warn_all.m4
  7. +128 −0 build/auto/m4/ax_check_zlib.m4
  8. +40 −0 build/auto/m4/ax_lib_socket_nsl.m4
  9. +90 −0 build/auto/m4/ax_path_lib_pcre.m4
  10. +283 −0 build/auto/m4/ax_pthread.m4
  11. +102 −0 configure.ac
  12. +17 −0 htdocs/Makefile.am
  13. +58 −0 include/Makefile.am
  14. +0 −1 include/bstring/bsafe.h
  15. +0 −1 include/bstring/bstraux.h
  16. +0 −1 include/bstring/bstrlib.h
  17. +0 −1 include/bstring/bstrwrap.h
  18. +0 −1 include/craftd
  19. 0 include/{ → craftd}/Arithmetic.h
  20. 0 include/{ → craftd}/Buffer.h
  21. 0 include/{ → craftd}/Buffers.h
  22. 0 include/{ → craftd}/Client.h
  23. 0 include/{ → craftd}/Config.h
  24. 0 include/{ → craftd}/Console.h
  25. 0 include/{ → craftd}/Dynamic.h
  26. 0 include/{ → craftd}/Error.h
  27. 0 include/{ → craftd}/Event.h
  28. 0 include/{ → craftd}/HTTPd.h
  29. 0 include/{ → craftd}/Hash.h
  30. 0 include/{ → craftd}/Job.h
  31. 0 include/{ → craftd}/List.h
  32. 0 include/{ → craftd}/Logger.h
  33. 0 include/{ → craftd}/Map.h
  34. 0 include/{ → craftd}/Plugin.h
  35. 0 include/{ → craftd}/Plugins.h
  36. 0 include/{ → craftd}/Regexp.h
  37. 0 include/{ → craftd}/ScriptingEngine.h
  38. 0 include/{ → craftd}/ScriptingEngines.h
  39. 0 include/{ → craftd}/Server.h
  40. 0 include/{ → craftd}/Set.h
  41. 0 include/{ → craftd}/String.h
  42. 0 include/{ → craftd}/TimeLoop.h
  43. 0 include/{ → craftd}/Worker.h
  44. 0 include/{ → craftd}/Workers.h
  45. +1 −0 include/craftd/bstring/bsafe.h
  46. +1 −0 include/craftd/bstring/bstraux.h
  47. +1 −0 include/craftd/bstring/bstrlib.h
  48. +1 −0 include/craftd/bstring/bstrwrap.h
  49. 0 include/{ → craftd}/common.h
  50. +261 −0 include/craftd/config.h.in
  51. 0 include/{ → craftd}/javaendian.h
  52. +1 −0 include/craftd/klib/kbtree.h
  53. +1 −0 include/craftd/klib/khash.h
  54. +1 −0 include/craftd/klib/khmm.h
  55. +1 −0 include/craftd/klib/klist.h
  56. +1 −0 include/craftd/klib/kmin.h
  57. +1 −0 include/craftd/klib/knetfile.h
  58. +1 −0 include/craftd/klib/knhx.h
  59. +1 −0 include/craftd/klib/kseq.h
  60. +1 −0 include/craftd/klib/ksort.h
  61. +1 −0 include/craftd/klib/kstring.h
  62. +1 −0 include/craftd/klib/kvec.h
  63. +1 −1 include/{ → craftd}/memory.h
  64. 0 include/{ → craftd}/utils.h
  65. +1 −1 include/{ → craftd}/version.h
  66. +0 −1 include/klib/kbtree.h
  67. +0 −1 include/klib/khash.h
  68. +0 −1 include/klib/khmm.h
  69. +0 −1 include/klib/klist.h
  70. +0 −1 include/klib/kmin.h
  71. +0 −1 include/klib/knetfile.h
  72. +0 −1 include/klib/knhx.h
  73. +0 −1 include/klib/kseq.h
  74. +0 −1 include/klib/ksort.h
  75. +0 −1 include/klib/kstring.h
  76. +0 −1 include/klib/kvec.h
  77. +55 −0 src/Makefile.am
View
@@ -6,8 +6,8 @@
###
## Binaries and generated
-craftd
-craftd-proxy
+/craftd
+/src/craftd
third-party/jansson/src/jansson_config.h
craftd.conf.dist
@@ -39,15 +39,15 @@ Makefile.in
# Check build-aux/.gitignore for the commented stuff
/autom4te.cache
/aclocal.m4
-#/compile
-#/depcomp
-#/install-sh
-#/missing
+/build/auto/aux/
+/configure
/config.guess
/config.log
/config.status
/config.sub
*/include/config.h
+stamp-h1
+Makefile
# libtool
build-aux/ltmain.sh
View
@@ -0,0 +1,37 @@
+ACLOCAL_AMFLAGS = -I build/auto/m4
+
+SUBDIRS = include src htdocs
+
+EXTRA_DIST = craftd.conf.dist.in motd.conf.dist
+
+# Make a correct default config file
+edit = sed \
+ -e 's|@localstatedir[@]|$(localstatedir)|g' \
+ -e 's|@datadir[@]|$(datadir)|g' \
+ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
+ -e 's|@libdir[@]|$(libdir)|g'
+craftd.conf.dist: Makefile
+ rm -f $@ $@.tmp
+ srcdir='' \
+ test -f ./$@.in || srcdir=$(srcdir)/; \
+ $(edit) $${srcdir}$@.in >$@.tmp
+ mv $@.tmp $@
+
+craftd.conf.dist: $(srcdir)/craftd.conf.dist.in
+
+DISTCLEANFILES = craftd.conf.dist
+
+craftdconfdir = ${sysconfdir}/craftd/
+craftdconf_DATA = craftd.conf.dist motd.conf.dist
+
+# bstring extas
+bstrdir = third-party/bstring
+EXTRA_DIST += $(bstrdir)/license.txt $(bstrdir)/security.txt \
+ $(bstrdir)/bstrlib.txt $(bstrdir)/porting.txt
+
+# klib extras
+klibdir = third-party/klib
+EXTRA_DIST += $(klibdir)
+
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)$(localstatedir)/craftd/world
View
1 autogen.sh 100644 → 100755
@@ -1,2 +1,3 @@
git submodule init
git submodule update
+autoreconf -iv
View
No changes.
@@ -0,0 +1,83 @@
+# ==============================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html
+# ==============================================================================
+#
+# SYNOPSIS
+#
+# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN])
+#
+# DESCRIPTION
+#
+# Checks the ordering of words within a multi-word float. This check is
+# necessary because on some systems (e.g. certain ARM systems), the float
+# word ordering can be different from the byte ordering. In a multi-word
+# float context, "big-endian" implies that the word containing the sign
+# bit is found in the memory location with the lowest address. This
+# implemenation was inspired by the AC_C_BIGENDIAN macro in autoconf.
+#
+# The endianess is detected by first compiling C code that contains a
+# special double float value, then grepping the resulting object file for
+# certain strings of ASCII values. The double is specially crafted to have
+# a binary representation that corresponds with a simple string. In this
+# implementation, the string "noonsees" was selected because the
+# individual word values ("noon" and "sees") are palindromes, thus making
+# this test byte-order agnostic. If grep finds the string "noonsees" in
+# the object file, the target platform stores float words in big-endian
+# order. If grep finds "seesnoon", float words are in little-endian order.
+# If neither value is found, the user is instructed to specify the
+# ordering.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Daniel Amelang <dan@amelang.net>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 7
+
+AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN],
+ [AC_CACHE_CHECK(whether float word ordering is bigendian,
+ ax_cv_c_float_words_bigendian, [
+
+ax_cv_c_float_words_bigendian=unknown
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+
+double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0;
+
+]])], [
+
+if grep noonsees conftest.$ac_objext >/dev/null ; then
+ ax_cv_c_float_words_bigendian=yes
+fi
+if grep seesnoon conftest.$ac_objext >/dev/null ; then
+ if test "$ax_cv_c_float_words_bigendian" = unknown; then
+ ax_cv_c_float_words_bigendian=no
+ else
+ ax_cv_c_float_words_bigendian=unknown
+ fi
+fi
+
+])])
+
+case $ax_cv_c_float_words_bigendian in
+ yes)
+ m4_default([$1],
+ [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1,
+ [Define to 1 if your system stores words within floats
+ with the most significant word first])]) ;;
+ no)
+ $2 ;;
+ *)
+ m4_default([$3],
+ [AC_MSG_ERROR([
+
+Unknown float word ordering. You need to manually preset
+ax_cv_c_float_words_bigendian=no (or yes) according to your system.
+
+ ])]) ;;
+esac
+
+])# AX_C_FLOAT_WORDS_BIGENDIAN
@@ -0,0 +1,195 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
+# AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
+# AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
+#
+# DESCRIPTION
+#
+# Try to find a compiler option that enables most reasonable warnings.
+#
+# For the GNU compiler it will be -Wall (and -ansi -pedantic) The result
+# is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default.
+#
+# Currently this macro knows about the GCC, Solaris, Digital Unix, AIX,
+# HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and
+# Intel compilers. For a given compiler, the Fortran flags are much more
+# experimental than their C equivalents.
+#
+# - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS
+# - $2 add-value-if-not-found : nothing
+# - $3 action-if-found : add value to shellvariable
+# - $4 action-if-not-found : nothing
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2010 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 10
+
+AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_PUSH([C])
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic % -Wall" dnl GCC
+ "-xstrconst % -v" dnl Solaris C
+ "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
+ "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+ "-ansi -ansiE % -fullwarn" dnl IRIX
+ "+ESlit % +w1" dnl HP-UX C
+ "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
+ "-h conform % -h msglevel 2" dnl Cray C (Unicos)
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_POP([C])
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
+AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_warn_all])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_PUSH([C++])
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-pedantic % -Wall" dnl GCC
+ "-xstrconst % -v" dnl Solaris C
+ "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
+ "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+ "-ansi -ansiE % -fullwarn" dnl IRIX
+ "+ESlit % +w1" dnl HP-UX C
+ "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
+ "-h conform % -h msglevel 2" dnl Cray C (Unicos)
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_POP([C++])
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl the only difference - the LANG selection... and the default FLAGS
+
+AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
+AS_VAR_PUSHDEF([FLAGS],[FCFLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ax_cv_fcflags_warn_all])dnl
+AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
+VAR,[VAR="no, unknown"
+ AC_LANG_PUSH([Fortran])
+ ac_save_[]FLAGS="$[]FLAGS"
+for ac_arg dnl
+in "-warn all % -warn all" dnl Intel
+ "-pedantic % -Wall" dnl GCC
+ "-xstrconst % -v" dnl Solaris C
+ "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
+ "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
+ "-ansi -ansiE % -fullwarn" dnl IRIX
+ "+ESlit % +w1" dnl HP-UX C
+ "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
+ "-h conform % -h msglevel 2" dnl Cray C (Unicos)
+ #
+do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+done
+ FLAGS="$ac_save_[]FLAGS"
+ AC_LANG_POP([Fortran])
+])
+case ".$VAR" in
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
+ *) m4_ifvaln($3,$3,[
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
+ fi ]) ;;
+esac
+AS_VAR_POPDEF([VAR])dnl
+AS_VAR_POPDEF([FLAGS])dnl
+])
+
+dnl implementation tactics:
+dnl the for-argument contains a list of options. The first part of
+dnl these does only exist to detect the compiler - usually it is
+dnl a global option to enable -ansi or -extrawarnings. All other
+dnl compilers will fail about it. That was needed since a lot of
+dnl compilers will give false positives for some option-syntax
+dnl like -Woption or -Xoption as they think of it is a pass-through
+dnl to later compile stages or something. The "%" is used as a
+dnl delimiter. A non-option comment can be given after "%%" marks
+dnl which will be shown but not added to the respective C/CXXFLAGS.
Oops, something went wrong.

0 comments on commit 865d52a

Please sign in to comment.