File: configure.ac

package info (click to toggle)
ocaml-flac 0.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 656 kB
  • ctags: 305
  • sloc: sh: 3,180; ansic: 1,056; ml: 797; makefile: 79
file content (69 lines) | stat: -rw-r--r-- 1,959 bytes parent folder | download | duplicates (3)
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

# check for one particular file of the sources 
AC_INIT([ocaml-flac],[0.1.1],[savonet-users@lists.sourceforge.net])

VERSION=$PACKAGE_VERSION
AC_MSG_RESULT([configuring $PACKAGE_STRING])

AC_BASE_CHECKS()

PKG_PROG_PKG_CONFIG()
PKG_CONFIG_CHECK_MODULE([flac])
#PKG_CHECK_MODULES(flac, flac, , [AC_MSG_ERROR(flac not found.)])

# Include a config.h
AC_CONFIG_HEADERS([config.h:config.h.in])
# Include it
CFLAGS="$CFLAGS -I .."
# Check endianess
AC_C_BIGENDIAN(AC_DEFINE([BIGENDIAN], [1], [The target is big endian]),[])

# Ogg variables
OCAMLOGG_REQUIRES="ogg"
OCAMLOGG_META="package \"ogg\" (
  requires = \"flac ogg\"
  version = \"$VERSION\"
  description = \"Ogg/flac OCaml encoding/decoding module\"
  archive(byte)= \"flac.cma\"
  archive(native)= \"flac.cmxa\"
)"
OCAMLOGG_FILES="ogg_flac_stubs.c ogg_flac.ml ogg_flac.mli ogg_demuxer_flac_decoder.mli ogg_demuxer_flac_decoder.ml"
OCAMLOGG_LIBS="ogg"
OCAMLOGG_INC=

AC_ARG_WITH([ogg-dir],AS_HELP_STRING([--with-ogg-dir=path],[use "path" as the location of ocaml-ogg (autodetected by default)]))
if test -z "$with_ogg_dir"; then
  AC_MSG_CHECKING(for ocaml-ogg)
  if ($OCAMLFIND query ogg > /dev/null 2>&1); then
        OCAMLOGG_INC=`$OCAMLFIND query ogg`
        AC_MSG_RESULT(ok)
  else
        OCAMLOGG_REQUIRES=
        OCAMLOGG_META=
        OCAMLOGG_FILES=
        OCAMLOGG_LIBS=
        AC_MSG_ERROR(not found.)
  fi
else
  echo $with_ogg_dir | grep ^/ > /dev/null 2>&1 \
  || with_ogg_dir=$PWD/$with_ogg_dir
  OCAMLOGG_INC="$with_ogg_dir"
fi
AC_SUBST(OCAMLOGG_INC)
AC_SUBST(OCAMLOGG_FILES)
AC_SUBST(OCAMLOGG_LIBS)
AC_SUBST(OCAMLOGG_META)
AC_SUBST(OCAMLOGG_REQUIRES)

# substitutions to perform
AC_SUBST(VERSION)
AC_SUBST(INC)
AC_SUBST(requires)

# Finally create the Makefile and samples
AC_CONFIG_FILES([Makefile],[chmod a-w Makefile])
AC_CONFIG_FILES([src/META])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([examples/Makefile.decode])
AC_CONFIG_FILES([examples/Makefile.encode])
AC_OUTPUT