head 1.32; access; symbols MM_1_4_2:1.31 MM_1_4_1:1.31 MM_1_4_0:1.30 MM_1_3_1:1.29 MM_1_3_0:1.28 MM_1_2_2:1.28 MM_1_2_1:1.25 MM_1_2_0:1.25 MM_1_1_3:1.19 MM_1_1_2:1.19 MM_1_1_1:1.18 MM_1_1_0:1.17 MM_1_0_12:1.11 MM_1_0_11:1.11 MM_1_0_10:1.10 MM_1_0_9:1.9 MM_1_0_8:1.9 MM_1_0_7:1.8 MM_1_0_6:1.6 MM_1_0_5:1.6 MM_1_0_4:1.5 MM_1_0_3:1.4 MM_1_0_1:1.4 MM_1_0_0:1.4 MM_1_0b6:1.4 MM_1_0b5:1.4 MM_1_0b4:1.2 MM_1_0b3:1.2 MM_1_0b2plus:1.1.1.1 RSE:1.1.1; locks; strict; comment @# @; 1.32 date 2007.01.01.18.26.34; author rse; state Exp; branches; next 1.31; commitid xbmVq17WhC8zJP0s; 1.31 date 2006.08.10.19.00.33; author rse; state Exp; branches; next 1.30; commitid zS8gipIRuG1bykIr; 1.30 date 2005.09.02.20.00.46; author rse; state Exp; branches; next 1.29; 1.29 date 2004.09.12.18.35.01; author rse; state Exp; branches; next 1.28; 1.28 date 2002.12.19.09.25.23; author rse; state Exp; branches; next 1.27; 1.27 date 2002.12.19.09.16.20; author rse; state Exp; branches; next 1.26; 1.26 date 2002.12.19.09.14.58; author rse; state Exp; branches; next 1.25; 1.25 date 2002.07.26.13.04.39; author rse; state Exp; branches; next 1.24; 1.24 date 2002.07.26.09.59.34; author rse; state Exp; branches; next 1.23; 1.23 date 2002.07.26.09.56.41; author rse; state Exp; branches; next 1.22; 1.22 date 2001.01.29.20.27.22; author rse; state Exp; branches; next 1.21; 1.21 date 2001.01.29.20.23.47; author rse; state Exp; branches; next 1.20; 1.20 date 2000.10.31.07.06.54; author rse; state Exp; branches; next 1.19; 1.19 date 2000.05.20.11.15.37; author rse; state Exp; branches; next 1.18; 1.18 date 2000.04.30.18.33.07; author rse; state Exp; branches; next 1.17; 1.17 date 2000.04.30.09.19.25; author rse; state Exp; branches; next 1.16; 1.16 date 2000.04.26.19.08.27; author rse; state Exp; branches; next 1.15; 1.15 date 2000.04.11.06.00.30; author rse; state Exp; branches; next 1.14; 1.14 date 2000.03.17.16.54.08; author rse; state Exp; branches; next 1.13; 1.13 date 2000.01.09.20.14.37; author rse; state Exp; branches; next 1.12; 1.12 date 99.12.01.15.53.01; author rse; state Exp; branches; next 1.11; 1.11 date 99.09.06.12.06.21; author rse; state Exp; branches; next 1.10; 1.10 date 99.07.06.09.48.44; author rse; state Exp; branches; next 1.9; 1.9 date 99.06.24.09.53.10; author rse; state Exp; branches; next 1.8; 1.8 date 99.06.15.06.29.33; author rse; state Exp; branches; next 1.7; 1.7 date 99.06.12.15.10.56; author rse; state Exp; branches; next 1.6; 1.6 date 99.05.26.06.16.34; author rse; state Exp; branches; next 1.5; 1.5 date 99.05.21.21.20.09; author rse; state Exp; branches; next 1.4; 1.4 date 99.03.18.14.23.35; author rse; state Exp; branches; next 1.3; 1.3 date 99.03.18.08.46.08; author rse; state Exp; branches; next 1.2; 1.2 date 99.03.15.11.13.56; author rse; state Exp; branches; next 1.1; 1.1 date 99.03.15.11.12.50; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.03.15.11.12.50; author rse; state Exp; branches; next ; desc @@ 1.32 log @Updated all copyright messages for year 2007 @ text @## ==================================================================== ## Copyright (c) 1999-2007 Ralf S. Engelschall ## Copyright (c) 1999-2007 The OSSP Project ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## ## 1. Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## ## 2. Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in ## the documentation and/or other materials provided with the ## distribution. ## ## 3. All advertising materials mentioning features or use of this ## software must display the following acknowledgment: ## "This product includes software developed by ## Ralf S. Engelschall ." ## ## 4. Redistributions of any form whatsoever must retain the following ## acknowledgment: ## "This product includes software developed by ## Ralf S. Engelschall ." ## ## THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY ## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR ## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, ## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED ## OF THE POSSIBILITY OF SUCH DAMAGE. ## ==================================================================== define(AC_CHECK_DEBUGGING,[dnl AC_MSG_CHECKING(for compilation debug mode) AC_ARG_ENABLE(debug,dnl [ --enable-debug build for debugging (default=no)], [dnl if test ".$ac_cv_prog_gcc" = ".yes"; then case "$CFLAGS" in *-O2* ) ;; * ) CFLAGS="$CFLAGS -O2" ;; esac case "$CFLAGS" in *-g* ) ;; * ) CFLAGS="$CFLAGS -g" ;; esac CFLAGS="$CFLAGS -Wall -Wshadow -Wpointer-arith -Wcast-align" CFLAGS="$CFLAGS -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline" else case "$CFLAGS" in *-g* ) ;; * ) CFLAGS="$CFLAGS -g" ;; esac fi msg="enabled" AC_DEFINE(MM_DEBUG, 1, [define to enable debugging]) ],[ case "$CFLAGS" in *-g* ) CFLAGS=`echo "$CFLAGS" |\ sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;; esac msg=disabled ])dnl AC_MSG_RESULT([$msg]) ]) define(AC_CONFIGURE_PART,[dnl AC_MSG_RESULT() AC_MSG_RESULT(${T_MD}$1:${T_ME}) ])dnl define(AC_CHECK_DEFINE,[dnl AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1, AC_EGREP_CPP([YES_IS_DEFINED], [ #include <$2> #ifdef $1 YES_IS_DEFINED #endif ], ac_cv_define_$1=yes, ac_cv_define_$1=no) ) if test "$ac_cv_define_$1" = "yes" ; then AC_DEFINE(HAVE_$1, 1, [define to 1 if you have the $1 define]) fi ])dnl AC_DEFINE(HAVE_$1) define(AC_IFALLYES,[dnl ac_rc=yes for ac_spec in $1; do ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'` ac_item=`echo "$ac_spec" | sed -e 's/^.*://'` case $ac_type in header ) ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` ac_var="ac_cv_header_$ac_item" ;; file ) ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` ac_var="ac_cv_file_$ac_item" ;; func ) ac_var="ac_cv_func_$ac_item" ;; define ) ac_var="ac_cv_define_$ac_item" ;; custom ) ac_var="$ac_item" ;; esac eval "ac_val=\$$ac_var" if test ".$ac_val" != .yes; then ac_rc=no break fi done if test ".$ac_rc" = .yes; then : $2 else : $3 fi ])dnl define(AC_BEGIN_DECISION,[dnl ac_decision_item='$1' ac_decision_msg='FAILED' ac_decision='' ])dnl define(AC_DECIDE,[dnl ac_decision='$1' ac_decision_msg='$2' ac_decision_$1=yes ac_decision_$1_msg='$2' ])dnl define(AC_DECISION_OVERRIDE,[dnl ac_decision='' for ac_item in $1; do eval "ac_decision_this=\$ac_decision_${ac_item}" if test ".$ac_decision_this" = .yes; then ac_decision=$ac_item eval "ac_decision_msg=\$ac_decision_${ac_item}_msg" fi done ])dnl define(AC_DECISION_FORCE,[dnl ac_decision="$1" eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\"" ])dnl define(AC_END_DECISION,[dnl if test ".$ac_decision" = .; then echo "[$]0:Error: decision on $ac_decision_item failed" 1>&2 exit 1 else if test ".$ac_decision_msg" = .; then ac_decision_msg="$ac_decision" fi AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg]) fi ])dnl AC_DEFUN(AC_TEST_FILE, [AC_REQUIRE([AC_PROG_CC]) ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(ac_cv_file_$ac_safe, [ if test -r $1; then eval "ac_cv_file_$ac_safe=yes" else eval "ac_cv_file_$ac_safe=no" fi ])dnl if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) ifelse([$3], , , [$3]) fi ]) AC_DEFUN(AC_PROG_NM, [AC_MSG_CHECKING([for BSD-compatible nm]) AC_CACHE_VAL(ac_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. ac_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -B" elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -p" else ac_cv_path_NM="$ac_dir/nm" fi break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm fi]) NM="$ac_cv_path_NM" AC_MSG_RESULT([$NM]) AC_SUBST(NM) ]) define(AC_CHECK_MAXSEGSIZE,[dnl AC_MSG_CHECKING(for shared memory maximum segment size) AC_CACHE_VAL(ac_cv_maxsegsize,[ OCFLAGS="$CFLAGS" case "$1" in MM_SHMT_MM* ) CFLAGS="-DTEST_MMAP $CFLAGS" ;; MM_SHMT_IPCSHM ) CFLAGS="-DTEST_SHMGET $CFLAGS" ;; esac cross_compile=no AC_TRY_RUN( changequote(<<, >>)dnl << #include #include #include #include #include #include #include #ifdef TEST_MMAP #include #endif #ifdef TEST_SHMGET #ifdef MM_OS_SUNOS #define KERNEL 1 #endif #ifdef MM_OS_BS2000 #define _KMEMUSER #endif #include #include #ifdef MM_OS_SUNOS #undef KERNEL #endif #ifdef MM_OS_BS2000 #undef _KMEMUSER #endif #if !defined(SHM_R) #define SHM_R 0400 #endif #if !defined(SHM_W) #define SHM_W 0200 #endif #endif #if !defined(MAP_FAILED) #define MAP_FAILED ((void *)(-1)) #endif #ifdef MM_OS_BEOS #include #endif int testit(int size) { int fd; void *segment; #ifdef TEST_MMAP char file[] = "./ac_test.tmp"; unlink(file); if ((fd = open(file, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) == -1) return 0; if (ftruncate(fd, size) == -1) return 0; if ((segment = (void *)mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0)) == (void *)MAP_FAILED) { close(fd); return 0; } munmap((caddr_t)segment, size); close(fd); unlink(file); #endif #ifdef TEST_SHMGET if ((fd = shmget(IPC_PRIVATE, size, SHM_R|SHM_W|IPC_CREAT)) == -1) return 0; if ((segment = (void *)shmat(fd, NULL, 0)) == ((void *)-1)) { shmctl(fd, IPC_RMID, NULL); return 0; } shmdt(segment); shmctl(fd, IPC_RMID, NULL); #endif #ifdef TEST_BEOS area_id id; id = create_area("mm_test", (void*)&segment, B_ANY_ADDRESS, size, B_LAZY_LOCK, B_READ_AREA|B_WRITE_AREA); if (id < 0) return 0; delete_area(id); #endif return 1; } #define ABS(n) ((n) >= 0 ? (n) : (-(n))) int main(int argc, char *argv[]) { int t, m, b; int d; int rc; FILE *f; /* * Find maximum possible allocation size by performing a * binary search starting with a search space between 0 and * 64MB of memory. */ t = 1024*1024*64 /* = 67108864 */; if (testit(t)) m = t; else { m = 1024*1024*32; b = 0; for (;;) { /* fprintf(stderr, "t=%d, m=%d, b=%d\n", t, m, b); */ rc = testit(m); if (rc) { d = ((t-m)/2); b = m; } else { d = -((m-b)/2); t = m; } if (ABS(d) < 1024*1) { if (!rc) m = b; break; } if (m < 1024*8) break; m += d; } if (m < 1024*8) m = 0; } if ((f = fopen("conftestval", "w")) == NULL) exit(1); fprintf(f, "%d\n", m); fclose(f); exit(0); } >> changequote([, ])dnl ,[ac_cv_maxsegsize="`cat conftestval`" ], ac_cv_maxsegsize=0 , ac_cv_maxsegsize=0 ) CFLAGS="$OCFLAGS" ]) msg="$ac_cv_maxsegsize" if test $msg -eq 67108864; then msg="64MB (soft limit)" elif test $msg -gt 1048576; then msg="`expr $msg / 1024`" msg="`expr $msg / 1024`" msg="${msg}MB" elif test $msg -gt 1024; then msg="`expr $msg / 1024`" msg="${msg}KB" else ac_cv_maxsegsize=0 msg=unknown fi MM_SHM_MAXSEGSIZE=$ac_cv_maxsegsize test ".$msg" = .unknown && AC_MSG_ERROR([Unable to determine maximum shared memory segment size]) AC_MSG_RESULT([$msg]) AC_DEFINE_UNQUOTED(MM_SHM_MAXSEGSIZE, $MM_SHM_MAXSEGSIZE, [maximum segment size]) ]) @ 1.31 log @bump copyright for year 2006 @ text @d2 2 a3 2 ## Copyright (c) 1999-2006 Ralf S. Engelschall ## Copyright (c) 1999-2006 The OSSP Project @ 1.30 log @adjust copyright year @ text @d2 2 a3 2 ## Copyright (c) 1999-2005 Ralf S. Engelschall ## Copyright (c) 1999-2005 The OSSP Project @ 1.29 log @adjust year in copyright messages @ text @d2 2 a3 2 ## Copyright (c) 1999-2004 Ralf S. Engelschall ## Copyright (c) 1999-2004 The OSSP Project @ 1.28 log @Updated all copyright messages with forthcoming year 2003, added OSSP project as secondary copyright holder, added standard OSSP ASCII-art logo to documents, etc. @ text @d2 2 a3 2 ## Copyright (c) 1999-2003 Ralf S. Engelschall ## Copyright (c) 1999-2003 The OSSP Project @ 1.27 log @get rid of old and problematic -ggdb3 stuff @ text @d2 2 a3 1 ## Copyright (c) 1999-2002 Ralf S. Engelschall. All rights reserved. @ 1.26 log @Stripped trailing whitespaces from all files in source tree. @ text @a53 1 CFLAGS="$CFLAGS -ggdb3" @ 1.25 log @major source tree overhauling @ text @d9 1 a9 1 ## notice, this list of conditions and the following disclaimer. d244 1 a244 1 #define _KMEMUSER d279 1 a279 1 if ((segment = (void *)mmap(NULL, size, PROT_READ|PROT_WRITE, d300 1 a300 1 id = create_area("mm_test", (void*)&segment, B_ANY_ADDRESS, size, d311 1 a311 1 int main(int argc, char *argv[]) @ 1.24 log @bump copyright year @ text @a38 26 divert(-1) define(AC_PROG_LIBTOOL,[dnl AC_ARG_ENABLE(static,dnl [ --enable-static build static libraries (default=yes)], enable_static="$enableval", enable_static=yes )dnl AC_ARG_ENABLE(shared,dnl [ --enable-shared build shared libraries (default=yes)], enable_shared="$enableval", enable_shared=yes )dnl libtool_flags='' test ".$silent" = .yes && libtool_flags="$libtool_flags --silent" test ".$enable_static" = .no && libtool_flags="$libtool_flags --disable-static" test ".$enable_shared" = .no && libtool_flags="$libtool_flags --disable-shared" test ".$ac_cv_prog_gcc" = .yes && libtool_flags="$libtool_flags --with-gcc" test ".$ac_cv_prog_gnu_ld" = .yes && libtool_flags="$libtool_flags --with-gnu-ld" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LD="$LD" \ ${CONFIG_SHELL-/bin/sh} ltconfig --no-reexec \ $libtool_flags --no-verify ltmain.sh $PLATFORM ||\ AC_MSG_ERROR([libtool configuration failed]) LIBTOOL="\$(TOP)/libtool" AC_SUBST(LIBTOOL) ])dnl d64 1 a64 1 AC_DEFINE(MM_DEBUG) d90 1 a90 1 AC_DEFINE(HAVE_$1) d385 1 a385 1 AC_DEFINE_UNQUOTED(MM_SHM_MAXSEGSIZE, $MM_SHM_MAXSEGSIZE) a387 1 divert @ 1.23 log @flush pending changes @ text @d2 1 a2 1 ## Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. @ 1.22 log @*** empty log message *** @ text @d288 1 a288 1 #define MAP_FAILED ((void *)-1) @ 1.21 log @*** empty log message *** @ text @d2 1 a2 1 ## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. @ 1.20 log @*** empty log message *** @ text @d245 1 d290 3 d324 8 d386 9 a394 3 ,[ MM_SHM_MAXSEGSIZE="`cat conftestval`" msg="$MM_SHM_MAXSEGSIZE" d405 1 a405 1 MM_SHM_MAXSEGSIZE=0 d408 1 a408 8 ], MM_SHM_MAXSEGSIZE=0 msg=unknown , MM_SHM_MAXSEGSIZE=0 msg=unknown )dnl CFLAGS="$OCFLAGS" @ 1.19 log @*** empty log message *** @ text @d302 1 a302 1 MAP_SHARED, fd, 0)) == MAP_FAILED) { @ 1.18 log @*** empty log message *** @ text @d94 1 a94 1 sed -e 's/ -g //g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;; @ 1.17 log @*** empty log message *** @ text @d265 6 a270 2 #define KERNEL 1 /* For SunOS4 */ #define _KMEMUSER /* For BS2000 to enable SHM_[RW] */ d273 1 d275 2 d278 1 @ 1.16 log @*** empty log message *** @ text @d1 40 a40 3 dnl ## dnl ## dnl ## d65 1 a65 3 dnl ## dnl ## dnl ## d100 1 a100 3 dnl ## dnl ## dnl ## d105 1 a105 3 dnl ## dnl ## dnl ## d120 1 a120 3 dnl ## dnl ## dnl ## d153 1 a153 3 dnl ## dnl ## dnl ## d190 1 a190 3 dnl ## dnl ## dnl ## d210 1 a210 3 dnl ## dnl ## AC_PROG_NM - find the path to a BSD-compatible name lister dnl ## d242 1 a242 3 dnl # dnl # dnl # d394 2 @ 1.15 log @*** empty log message *** @ text @d244 2 a245 1 #define KERNEL 1 /* For SunOS */ d248 2 @ 1.14 log @*** empty log message *** @ text @d236 1 @ 1.13 log @*** empty log message *** @ text @d246 6 @ 1.12 log @*** empty log message *** @ text @d243 1 @ 1.11 log @*** empty log message *** @ text @d76 2 a77 2 AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1, AC_EGREP_CPP([YES_IS_DEFINED], [ d82 7 a88 2 ], ac_cv_define_$1=yes; AC_DEFINE(HAVE_$1), ac_cv_define_$1=no) )])dnl @ 1.10 log @*** empty log message *** @ text @d16 5 a20 4 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" @ 1.9 log @*** empty log message *** @ text @d33 1 a33 1 [ --enable-debug build for debugging], @ 1.8 log @*** empty log message *** @ text @d240 3 @ 1.7 log @*** empty log message *** @ text @d326 2 a327 2 MM_SHM_MAXSEGSIZE=`cat conftestval` msg=$MM_SHM_MAXSEGSIZE d349 1 @ 1.6 log @*** empty log message *** @ text @d56 4 @ 1.5 log @*** empty log message *** @ text @d11 1 a11 1 [ --enable-shared build shared libraries (default=no)], @ 1.4 log @*** empty log message *** @ text @d301 6 a306 1 if (ABS(d) < 1024*1 || m < 1024*8) @ 1.3 log @*** empty log message *** @ text @d13 1 a13 1 enable_shared=no @ 1.2 log @*** empty log message *** @ text @d5 5 d11 4 a14 3 [ --enable-shared build shared libraries (default=yes)])dnl AC_ARG_ENABLE(static,dnl [ --enable-static build static libraries (default=yes)])dnl d16 1 a17 1 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" @ 1.1 log @Initial revision @ text @d314 1 a314 1 msg="64MB (MM soft limit)" @ 1.1.1.1 log @Import into CVS @ text @@