File: configure.ac

package info (click to toggle)
fsplib 0.9-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 156 kB
  • ctags: 175
  • sloc: ansic: 1,556; makefile: 60
file content (102 lines) | stat: -rw-r--r-- 3,720 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT(fsplib,0.9,hsn@sendmail.cz)
AM_INIT_AUTOMAKE()
AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([fsplib.c])
AC_ARG_WITH(lockprefix,AS_HELP_STRING([--with-lockprefix=path],[Set lock prefix path to (default /tmp/.FSPL)]))
AC_ARG_WITH([locking],AS_HELP_STRING([--with-locking=none/semop/lockf],[Set client locking type (default autodetected)]))
# Checks for programs.
AC_PROG_CC
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
AC_CACHE_CHECK(for additional compiler options, ac_cv_prog_gcc_flags, [
ac_cv_prog_gcc_flags=""
if test "$GCC" = yes
then
  echo "void dummy(void);" >configure-dummy.c
  echo "void dummy(void) {}" >>configure-dummy.c
  addopts=
  case `$CC --version` in
      *2.7*) ;;
      *) addopts="$addopts -Wpointer-arith" ;;
  esac
  for i in -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wshadow \
      -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings \
      -Waggregate-return -Wmissing-declarations \
      -Wmissing-format-attribute -Wnested-externs \
      -ggdb -fno-common -Wchar-subscripts -Wcomment \
      -Wimplicit -Wsequence-point -Wreturn-type \
      -Wfloat-equal $addopts \
      -Wno-system-headers -Wredundant-decls \
      -Wmissing-noreturn -pedantic \
      -Wlong-long -Wundef -Winline \
      -Wno-unused-parameter \
      -Wunreachable-code
#       -Wconversion 
  do
       if $CC $i $ac_cv_prog_gcc_flags -c configure-dummy.c >/dev/null 2>&1 
       then ac_cv_prog_gcc_flags="$ac_cv_prog_gcc_flags $i"
       else echo "ignoring $i"
       fi
  done
fi])
rm -f configure-dummy.c configure-dummy.o
CFLAGS="$CFLAGS $ac_cv_prog_gcc_flags"
if test "${enable_maintainer_mode+set}" = set; then
   CFLAGS="-g3 -O0 -DMAINTAINER_MODE $ac_cv_prog_gcc_flags"
   AC_CHECK_LIB(efence,EF_Abort)
fi

# Checks for libraries.

# Checks for header files.
AC_CHECK_HEADERS(stdint.h)

# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_MEMBER(struct dirent.d_namlen,AC_DEFINE(HAVE_DIRENT_NAMLEN,1,[Define if struct dirent has member d_namlen]),,[#include <sys/types.h>
#include <dirent.h>
])
AC_CHECK_MEMBER(struct dirent.d_fileno,AC_DEFINE(HAVE_DIRENT_FILENO,1,[Define if struct dirent has member d_fileno]),,[#include <sys/types.h>
#include <dirent.h>
])
AC_CHECK_MEMBER(struct dirent.d_type,AC_DEFINE(HAVE_DIRENT_TYPE,1,[Define if struct dirent has member d_type]),,[#include <sys/types.h>
#include <dirent.h>
])
AC_CHECK_TYPE(union semun, ,AC_DEFINE(_SEM_SEMUN_UNDEFINED,1,[Define if you do not have semun in sys/sem.h]),
[#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
])

# Checks for library functions.
AC_CHECK_FUNCS(lockf semop shmget)

#Parse user locking choice
if test "x$with_locking" = "xno" -o "x$with_locking" = "xnone" ; then
AC_DEFINE(FSP_NOLOCKING,1)
AC_MSG_NOTICE(locking disabled by user)
elif test "x$with_locking" = "xlockf" -a "x$ac_cv_func_lockf" = "xyes"; then
    AC_DEFINE(FSP_USE_LOCKF,1)
elif test "x$with_locking" = "xsemop" -a "x$ac_cv_func_semop" = "xyes" -a "x$ac_cv_func_shmget" = "xyes";then
     AC_DEFINE(FSP_USE_SHAREMEM_AND_SEMOP,1)
#Autodetect locking 
elif test "x$ac_cv_func_semop" = "xyes" -a "x$ac_cv_func_shmget" = "xyes"; then
    AC_DEFINE(FSP_USE_SHAREMEM_AND_SEMOP,1)
elif test "x$ac_cv_func_lockf" = "xyes"; then AC_DEFINE(FSP_USE_LOCKF,1)
else
AC_DEFINE(FSP_NOLOCKING,1)
AC_MSG_NOTICE([no suitable locking method detected])
fi

#locking prefix
if test "x$with_lockprefix" != "xno" -a "x$with_lockprefix" != "xyes" -a "x$with_lockprefix" != "x" ; then
    AC_DEFINE_UNQUOTED(FSP_KEY_PREFIX,"$with_lockprefix")
fi
# Output work
AC_SUBST(CPPFLAGS)
AC_SUBST(CFLAGS)
AC_CONFIG_FILES(Makefile)
AC_OUTPUT