File: configure.in

package info (click to toggle)
btscanner 2.1-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 2,156 kB
  • sloc: ansic: 4,954; sh: 836; xml: 136; makefile: 36; perl: 28
file content (80 lines) | stat: -rw-r--r-- 2,533 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
# Process this file with autoconf to produce a configure script.

AC_INIT(main.c)
AM_INIT_AUTOMAKE(btscanner, 2.0)
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC
AC_PATH_PROGS(PERL, perl perl5.004 perl5.003 perl5.002 perl5.001 perl5)
AC_ISC_POSIX

# Checks for libraries.
AC_HAVE_LIBRARY(ncurses,,[AC_MSG_ERROR([ncurses not found])])
AC_HAVE_LIBRARY(menu,,[AC_MSG_ERROR([ncurses menu library not found])])
AC_HAVE_LIBRARY(form,,[AC_MSG_ERROR([ncurses form library not found])])
AC_HAVE_LIBRARY(bluetooth,,[AC_MSG_ERROR([Bluetooth not found])])
AC_HAVE_LIBRARY(pthread,,[AC_MSG_ERROR([pthreads not found])])

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([netinet/in.h stdlib.h string.h sys/ioctl.h \
  sys/socket.h unistd.h fcntl.h stdarg.h syslog.h])
AC_CHECK_HEADERS([bluetooth/bluetooth.h],,
  [AC_MSG_ERROR([Bluetooth headers MIA])])
AC_CHECK_HEADERS([bluetooth/sdp.h],,
  [AC_MSG_ERROR([SDP headers MIA])])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T

# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([memset strerror])

# set the optimisation/debug levels in CFLAGS
#CFLAGS="-g -ggdb"

# config for libxml2 check
PKG_CHECK_MODULES([XML2],[libxml-2.0])
CFLAGS="$CFLAGS $XML2_CFLAGS"
CPPFLAGS="$CPPFLAGS"
LDFLAGS="$LDFLAGS $XML2_LIBS"

# check for libxml2 heads/libs
AC_CHECK_HEADERS([libxml/parser.h libxml/tree.h],,
  [AC_MSG_ERROR([libxml2 headers MIA])])
AC_HAVE_LIBRARY(xml2,,[AC_MSG_ERROR([libxml2 not found])])

# CFLAGS
CFLAGS="$CFLAGS -Wall -pthread -Wshadow -Wbad-function-cast \
  -Wformat -Wparentheses -Wsign-compare \
  -Wstrict-prototypes -Wtrigraphs -Wundef -Wuninitialized \
  -W -Wunused -Wformat-security -Wmissing-braces -Wbad-function-cast \
  -Wcast-qual -falign-functions -falign-labels -falign-loops\
  -pedantic -fstrict-aliasing -D_GNU_SOURCE -std=gnu99"
#  -fstack-check -fbounds-check"

# cfg
AC_MSG_CHECKING(the location of the config file)
AC_ARG_WITH(cfgfile,
  [  --with-cfg=file        location of the config file],
  [ cfgfile="${withval}" ],
  [ cfgfile="$sysconfdir/btscanner.xml" ])
AC_MSG_RESULT($cfgfile)
# cfg DTD
AC_MSG_CHECKING(the location of the config DTD)
AC_ARG_WITH(cfgdtd,
  [  --with-dtd=file        location of the config dtd],
  [ cfgdtd="${withval}" ],
  [ cfgdtd="file://$sysconfdir/btscanner.dtd" ])
AC_MSG_RESULT($cfgdtd)

CFLAGS="$CFLAGS -DCFG_FILE=\\\"$cfgfile\\\" -DCFG_DTD=\\\"$cfgdtd\\\""

# output
AC_CONFIG_FILES([Makefile])
AC_OUTPUT