~hww3/caudium

ref: 93d5a75fba08db71b832716377276978cdd7888d caudium/autodoc/configure.ac -rw-r--r-- 2.5 KiB
93d5a75fWilliam Welliver storage: method "None" was missing stop function. should fix error on shutdown 1 year, 1 month ago
                                                                                
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
#
# $Id$
#
AC_INIT(Makefile.in)

AC_SET_MAKE

AC_PROG_INSTALL
AC_PROG_LN_S

if test "$LN_S" = "ln"; then
  LN_S="cp -p"
fi

PIKE_SRC_DIR="notgiven"
PIKE_REFDOC_DIRS="refdoc/presentation"
PIKE_BIN="pike"

AC_ARG_WITH(pikesrc,
   AC_HELP_STRING([--with-pikesrc], [location of the toplevel directory of the Pike 7.4+ source]),
   [PIKE_SRC_DIR="$withval"], 
   AC_MSG_ERROR([You must specify the Pike 7.4+ source directory], 1))

AC_ARG_WITH(pike,
  AC_HELP_STRING([--with-pike], [use the specified pike binary to extract the documentation]),
  [PIKE_BIN=$withval])

AC_MSG_CHECKING([Pike 7.4 sources])
if test ! -d $PIKE_SRC_DIR; then
  AC_MSG_ERROR([not found])
else
  # check whether all the required dirs exist
  for d in $PIKE_REFDOC_DIRS; do
    if test ! -d $PIKE_SRC_DIR/$d; then
     AC_MSG_ERROR([missing the $d subdir])
    fi
  done

  # check whether the sources really are for 7.4+
  PIKE_MAJOR_VERSION=0
  PIKE_MINOR_VERSION=0
  PIKE_BUILD_VERSION=0

  if test ! -f $PIKE_SRC_DIR/src/version.h; then
   AC_MSG_ERROR([no version.h - cannot check the pike version])
  fi

  PIKE_MAJOR_VERSION=`cat $PIKE_SRC_DIR/src/version.h | grep '^#define PIKE_MAJOR_VERSION' | cut -d ' ' -f 3`
  PIKE_MINOR_VERSION=`cat $PIKE_SRC_DIR/src/version.h | grep '^#define PIKE_MINOR_VERSION' | cut -d ' ' -f 3`
  PIKE_BUILD_VERSION=`cat $PIKE_SRC_DIR/src/version.h | grep '^#define PIKE_BUILD_VERSION' | cut -d ' ' -f 3`

  if test $PIKE_MAJOR_VERSION -lt 7 -a $PIKE_MINOR_VERSION -lt 4; then
    AC_MSG_ERROR([failed - need 7.4+, found $PIKE_MAJOR_VERSION.$PIKE_MINOR_VERSION.$PIKE_BUILD_VERSION])
  fi

  # now symlink all the pike progs from there to our bin/
  rm -f bin/.deleteus >& /dev/null
  for d in $PIKE_REFDOC_DIRS; do
    for f in $PIKE_SRC_DIR/$d/*; do
      if test -f $f; then
         $LN_S $f bin/`basename $f` >& /dev/null
         echo `basename $f` >> bin/.deleteus
      fi
    done
  done

  AC_MSG_RESULT([ok - $PIKE_MAJOR_VERSION.$PIKE_MINOR_VERSION.$PIKE_BUILD_VERSION])
fi

AC_MSG_CHECKING([version of the Pike binary])

PIKE_VERSION="`$PIKE_BIN -e 'string v; int rel;sscanf(version(), \"Pike v%s release %d\", v, rel); write(v+\".\"+rel);'`"
PIKE_MAJOR=`echo $PIKE_VERSION | cut -d '.' -f 1`
PIKE_MINOR=`echo $PIKE_VERSION | cut -d '.' -f 2`
PIKE_BUILD=`echo $PIKE_VERSION | cut -d '.' -f 3`

if test $PIKE_MAJOR -lt 7 -a $PIKE_MINOR -lt 4; then
  AC_MSG_ERROR([you need at least Pike 7.4])
else
  AC_MSG_RESULT([ok - $PIKE_MAJOR.$PIKE_MINOR.$PIKE_BUILD])
fi

AC_SUBST(PIKE_BIN)

AC_OUTPUT(Makefile)