Index: TODO =================================================================== diff -u -rde25b8ac2f22701d21fead84ccc5793f8f809705 -r7c0fa49f01d0a37ccb4e36778e72ac1c1e3f6b30 --- TODO (.../TODO) (revision de25b8ac2f22701d21fead84ccc5793f8f809705) +++ TODO (.../TODO) (revision 7c0fa49f01d0a37ccb4e36778e72ac1c1e3f6b30) @@ -3497,7 +3497,20 @@ - library/lib/nx-zip.tcl: refactored implementqtion, improved utf-8 file-name handling (which is a mess in pkzip) +- configure options: + * improved and extended configure options to reduce + necessity to switch features on and off in the nsf.h. + Optional Features: + --enable-profile build nsf with profile support (default disabled) + --enable-memcount=yes|trace + build nsf with memcount debug support (default + disabled) + --enable-development build nsf with development support (assertion + checking, etc.; default disabled) + Optional Packages: + --with-dtrace build nsf with dtrace (default: without) + TODO: - private: * document private in tutorial Index: configure =================================================================== diff -u -rb03af92ee24792b6ea79e8d7ff39a3571997f975 -r7c0fa49f01d0a37ccb4e36778e72ac1c1e3f6b30 --- configure (.../configure) (revision b03af92ee24792b6ea79e8d7ff39a3571997f975) +++ configure (.../configure) (revision 7c0fa49f01d0a37ccb4e36778e72ac1c1e3f6b30) @@ -742,8 +742,10 @@ with_aolserver3 with_actiweb with_expat -with_profile -enable_dtrace +with_dtrace +enable_profile +enable_memcount +enable_development with_tcl with_tclinclude enable_threads @@ -1375,7 +1377,12 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-dtrace build with dtrace (default: off) + --enable-profile build nsf with profile support (default disabled) + --enable-memcount=yes|trace + build nsf with memcount debug support (default + disabled) + --enable-development build nsf with development support (assertion + checking, etc.; default disabled) --enable-threads build with threads --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (default: off) @@ -1399,8 +1406,7 @@ --with-expat= point to a custom expat installation, --without-expat falls back to the bundled expat installation - --with-profile=yes|no --without-profile disables builds with profile - support + --with-dtrace build nsf with dtrace (default: without) --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tclinclude directory containing the public Tcl header files @@ -2337,8 +2343,11 @@ #-------------------------------------------------------------------- # specify some extra flags #-------------------------------------------------------------------- +# According to http://www.gnu.org/software/autoconf/manual/autoconf.html +# - "with" is for external software (optional packages) +# - "enable" is for optional features +# - # Check whether --with-gdbm was given. if test "${with_gdbm+set}" = set; then : withval=$with_gdbm; with_gdbm=$withval @@ -2371,21 +2380,35 @@ fi -# Check whether --with-profile was given. -if test "${with_profile+set}" = set; then : - withval=$with_profile; with_profile=$withval +# Check whether --with-dtrace was given. +if test "${with_dtrace+set}" = set; then : + withval=$with_dtrace; with_dtrace=$enableval else - with_profile=no + with_dtrace=no fi -# Check whether --enable-dtrace was given. -if test "${enable_dtrace+set}" = set; then : - enableval=$enable_dtrace; enable_dtrace=$enableval +# Check whether --enable-profile was given. +if test "${enable_profile+set}" = set; then : + enableval=$enable_profile; enable_profile=$enableval else - enable_dtrace=no + enable_profile=no fi +# Check whether --enable-memcount was given. +if test "${enable_memcount+set}" = set; then : + enableval=$enable_memcount; enable_memcount=$enableval +else + enable_memcount=no +fi +# Check whether --enable-development was given. +if test "${enable_development+set}" = set; then : + enableval=$enable_development; enable_development=$enableval +else + enable_development=no +fi + + subdirs="" if test "$with_actiweb" = yes; then @@ -2426,7 +2449,6 @@ NSF_MINOR_VERSION=0 NSF_PATCH_LEVEL=$PACKAGE_VERSION -#NSF_PATCH_LEVEL=${NSF_MAJOR_VERSION}.${NSF_MINOR_VERSION}.${NSF_RELEASE_SERIAL} NSF_VERSION=${NSF_MAJOR_VERSION}.${NSF_MINOR_VERSION} NODOT_VERSION=${NSF_MAJOR_VERSION}${NSF_MINOR_VERSION} @@ -5512,14 +5534,31 @@ fi -if test "$with_profile" = yes; then +if test "$enable_profile" = yes; then $as_echo "#define NSF_PROFILE 1" >>confdefs.h fi +if test "$enable_development" = yes; then + +$as_echo "#define NSF_DEVLOPMENT 1" >>confdefs.h + +fi + +if test "$enable_memcount" = yes; then + +$as_echo "#define NSF_MEM_COUNT 1" >>confdefs.h + +fi +if test "$enable_memcount" = trace; then + +$as_echo "#define NSF_MEM_TRACE 1" >>confdefs.h + +fi + DTRACE_OBJ= -if test "$enable_dtrace" = yes; then +if test "$with_dtrace" = yes; then $as_echo "#define NSF_DTRACE 1" >>confdefs.h Index: configure.in =================================================================== diff -u -rb03af92ee24792b6ea79e8d7ff39a3571997f975 -r7c0fa49f01d0a37ccb4e36778e72ac1c1e3f6b30 --- configure.in (.../configure.in) (revision b03af92ee24792b6ea79e8d7ff39a3571997f975) +++ configure.in (.../configure.in) (revision 7c0fa49f01d0a37ccb4e36778e72ac1c1e3f6b30) @@ -25,7 +25,10 @@ #-------------------------------------------------------------------- # specify some extra flags #-------------------------------------------------------------------- - +# According to http://www.gnu.org/software/autoconf/manual/autoconf.html +# - "with" is for external software (optional packages) +# - "enable" is for optional features +# AC_ARG_WITH(gdbm, AC_HELP_STRING([--with-gdbm=GDBM_INCLUDE_DIR,GDBM_LIB_DIR], [build with gdbm support; provide path to gdbm.h and optionally @@ -45,12 +48,20 @@ --with-expat= point to a custom expat installation, --without-expat falls back to the bundled expat installation]), [with_expat=$withval],[with_expat=bundle]) -AC_ARG_WITH(profile, - AC_HELP_STRING([--with-profile=yes|no], [--without-profile disables builds with profile support]), - [with_profile=$withval], [with_profile=no]) -AC_ARG_ENABLE(dtrace, - AC_HELP_STRING([--enable-dtrace], [build with dtrace (default: off)]), - [enable_dtrace=$enableval], [enable_dtrace=no]) +AC_ARG_WITH(dtrace, + AC_HELP_STRING([--with-dtrace], [build nsf with dtrace (default: without)]), + [with_dtrace=$enableval], [with_dtrace=no]) +AC_ARG_ENABLE(profile, + AC_HELP_STRING([--enable-profile], [build nsf with profile support (default disabled)]), + [enable_profile=$enableval], [enable_profile=no]) +AC_ARG_ENABLE(memcount, + AC_HELP_STRING([--enable-memcount=yes|trace], + [build nsf with memcount debug support (default disabled)]), + [enable_memcount=$enableval], [enable_memcount=no]) +AC_ARG_ENABLE(development, + AC_HELP_STRING([--enable-development], + [build nsf with development support (assertion checking, etc.; default disabled)]), + [enable_development=$enableval], [enable_development=no]) subdirs="" @@ -166,12 +177,23 @@ AC_DEFINE(HAVE_TCL_COMPILE_H, 1, [Do we have tclCompile.h installed?]) fi -if test "$with_profile" = yes; then +if test "$enable_profile" = yes; then AC_DEFINE(NSF_PROFILE, 1, [Are we building with profile support?]) fi +if test "$enable_development" = yes; then + AC_DEFINE(NSF_DEVLOPMENT, 1, [Are we building with development support?]) +fi + +if test "$enable_memcount" = yes; then + AC_DEFINE(NSF_MEM_COUNT, 1, [Are we building with memcount support?]) +fi +if test "$enable_memcount" = trace; then + AC_DEFINE(NSF_MEM_TRACE, 1, [Are we building with memcount tracing support?]) +fi + DTRACE_OBJ= -if test "$enable_dtrace" = yes; then +if test "$with_dtrace" = yes; then AC_DEFINE(NSF_DTRACE, 1, [Are we building with DTrace support?]) # Under Mac OS X, we need no nsfDTrace.o if test "`uname -s`" != "Darwin" ; then Index: generic/nsf.h =================================================================== diff -u -r95c4d29515cfda9283b406ba7a7ac1dd029de8c9 -r7c0fa49f01d0a37ccb4e36778e72ac1c1e3f6b30 --- generic/nsf.h (.../nsf.h) (revision 95c4d29515cfda9283b406ba7a7ac1dd029de8c9) +++ generic/nsf.h (.../nsf.h) (revision 7c0fa49f01d0a37ccb4e36778e72ac1c1e3f6b30) @@ -78,7 +78,6 @@ /* are we developing? #define NSF_DEVELOPMENT 1 */ -#define NSF_DEVELOPMENT 1 /* activate/deacticate assert #define NDEBUG 1 @@ -96,8 +95,6 @@ #define NSF_MEM_TRACE 1 #define NSF_MEM_COUNT 1 */ -//#define NSF_MEM_COUNT 1 -//#define NSF_MEM_TRACE 1 //#define PARSE_TRACE 1 /* turn tracing output on/off @@ -176,6 +173,10 @@ CscFinish_(interp, cscPtr) #endif +#if defined(NSF_MEM_TRACE) && !defined(NSF_MEM_COUNT) +# define NSF_MEM_COUNT 1 +#endif + #if defined(NSF_PROFILE) || defined(NSF_DTRACE) # define CscInit(cscPtr, object, cl, cmd, frametype, flags, method) \ CscInit_(cscPtr, object, cl, cmd, frametype, flags); cscPtr->methodName = (method);