* use AC_CHECK_FUNCS to check for flock()
authorWilfried Göesgens <willi@citadel.org>
Sat, 8 Sep 2007 22:17:13 +0000 (22:17 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 8 Sep 2007 22:17:13 +0000 (22:17 +0000)
* if we find a Sun CC rather check dependencies with -xM instead of -M

citadel/Makefile.in
citadel/configure.ac
citadel/control.c
citadel/mk_module_init.sh

index 77390db2a11d0d2fe2acaa04a3f9829ef01a5cff..dc864add20a57f42174d1edefa1657f33c6e0c75 100644 (file)
@@ -20,6 +20,7 @@ DATA_DIR=@MAKE_DATA_DIR@
 STATICDATA_DIR=@MAKE_STATICDATA_DIR@
 DOC_DIR=@MAKE_DOC_DIR@
 UTILBIN_DIR=@MAKE_UTILBIN_DIR@
+DEPEND_FLAG=@DEPEND_FLAG@
 all: $(TARGETS)
 
 .SUFFIXES: .o .d .c
@@ -87,7 +88,7 @@ CFLAGS=@CFLAGS@ -I ./include/
 CPPFLAGS=@CPPFLAGS@ -I. -I ./include/
 DATABASE=@DATABASE@
 DEFS=@DEFS@
-LDFLAGS=@LDFLAGS@ -rdynamic
+LDFLAGS=@LDFLAGS@
 LIBS=@LIBS@
 LIBOBJS=@LIBOBJS@
 INSTALL=@INSTALL@
@@ -396,7 +397,7 @@ distclean: cleaner
 
 .c.d:
        @echo Checking dependencies for $<
-       @$(CC) -M $(CPPFLAGS) $< | sed -e 's!$*.o!$*.o $*/.o $@!' > $@
+       @$(CC) $(DEPEND_FLAG) $(CPPFLAGS) $< | sed -e 's!$*.o!$*.o $*/.o $@!' > $@
        @test -s $@ || rm -f $@
 
 Makefile: $(srcdir)/Makefile.in config.status
index fb370e35dbacb96dcf99177403242366f99a12f5..3dd88c4d9b4e4ae735e0d99e89bd9c9de4aec9dc 100644 (file)
@@ -244,6 +244,8 @@ dnl DEFS="$DEFS $PTHREAD_DEFS"
 dnl Checks for programs.
 AC_PROG_CC
 
+
+
 dnl Set up system-dependent compiler flags.
 if test "$GCC" = yes; then
        if test "$CC" = icc; then
@@ -274,6 +276,15 @@ if test "x$enable_pie" = xyes; then
        fi
 fi
 
+echo $CC snaothus---------------------
+AC_MSG_CHECKING([how to compile with POSIX threads])
+                if test -n "`$CC -V 2>&1 |grep Sun`"; then 
+                       DEPEND_FLAG=-xM;
+                else 
+                       DEPEND_FLAG=-M
+                fi
+AC_SUBST(DEPEND_FLAG)
+
 AC_PROG_INSTALL
 AC_PROG_YACC
 missing_dir=`cd $ac_aux_dir && pwd`
@@ -294,7 +305,7 @@ dnl Checks for libraries.
 dnl We want to test for the following in libc before checking for their
 dnl respective libraries, because some systems (like Irix) have both, and the
 dnl non-libc versions may be broken.
-AC_CHECK_FUNCS(crypt gethostbyname connect )
+AC_CHECK_FUNCS(crypt gethostbyname connect flock)
 
 
 dnl disable backtrace if we don't want it.
@@ -783,6 +794,7 @@ AC_CACHE_CHECK([the weather], ac_cv_weather, [
 
 
 
+
 AC_CACHE_CHECK([under the bed], ac_cv_under_the_bed, [
        number=`date | cut -c 19`
        case $number in
index 77205b10ce8bdcb3d2303abe62f5ab033ea0765d..7dc74798b5b8664c710a293576f1b31020db7f0f 100644 (file)
@@ -56,11 +56,12 @@ FILE *control_fp = NULL;
  */
 void lock_control(void)
 {
-#ifndef BSD_GETPWUID
+#ifdef HAVE_FLOCK
 /*
  * TODO: solaris manpages describe this function, but the headers
  * don't show it! 
  */
+
        if (flock(fileno(control_fp), (LOCK_EX | LOCK_NB))) {
                lprintf(CTDL_EMERG, "citserver: unable to lock %s.\n", file_citadel_control);
                lprintf(CTDL_EMERG, "Is another citserver already running?\n");
index 8ffd366327ef2134f6ab64cd2ba17e79c25524d3..71d37c4add543b9f398f65e1b45cf87201e52ffd 100755 (executable)
@@ -28,10 +28,9 @@ H_FILE="$CUR_DIR/modules_init.h"
 /usr/bin/printf "This version of echo $ECHO supports $MINUS_e $MINUS_E.\n"
 
 
-cat <<EOF  >$C_FILE
-
-#start ofs the files which inturn removes any existing file
+#start of the files which inturn removes any existing file
 #
+cat <<EOF  >$C_FILE
 /*
  * $C_FILE
  * Auto generated by mk_modules_init.sh DO NOT EDIT THIS FILE