File: configure.ac

package info (click to toggle)
affix 2.1.1-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,908 kB
  • ctags: 1,247
  • sloc: ansic: 13,807; sh: 7,119; yacc: 232; makefile: 152; lex: 126; python: 56
file content (143 lines) | stat: -rw-r--r-- 4,021 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#
#  $Id: configure.ac,v 1.62 2004/01/09 09:30:49 litos Exp $
#
#  process this file with autoconf to produce a configure script.
#

AC_INIT(Affix, 2.1.1, affix-devel@lists.sourceforge.net, affix)
AM_INIT_AUTOMAKE(affix, 2.1.1)
#AC_CONFIG_HEADERS(include/config.h)
AM_CONFIG_HEADER(include/config.h)
#prefix
AC_PREFIX_DEFAULT(/usr/local)

# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_YACC
#AC_PROG_LEX
AM_PROG_LEX

# check for headers
AC_CHECK_HEADERS(affix/bluetooth.h,, 
	[AC_MSG_ERROR([Affix header files not found. Please, install affix-kernel for that.])])

AFFIX_SUBDIRS=lib
AFFIX_EXTRA_SUBDIRS=
LDFLAGS_AFFIX_LIBS="\$(top_builddir)/lib/libaffix.la"
# current[:revision[:age]]
# result: [current-age].age.revision
VERSION_AFFIX_LIBS="-version-info 3:1:1"
VERSION_AFFIX_SDP="-version-info 3:1:1"
VERSION_AFFIX_OBEX="-version-info 3:1:1"


AFFIX_ARG_ENABLE(audio, "yes")
AFFIX_ARG_ENABLE(rfcomm, "yes")
AFFIX_ARG_ENABLE(pan, "yes")
AFFIX_ARG_ENABLE(uart, "yes")
AFFIX_ARG_ENABLE(sdp, "yes")
AFFIX_ARG_ENABLE(obex, "yes")
AFFIX_ARG_ENABLE(debug, "no")

# check audio
if test $affix_cv_use_audio = yes; then
	AC_DEFINE([CONFIG_AFFIX_AUDIO],, [Enable Audio support in Affix])
fi
AM_CONDITIONAL(CONFIG_AFFIX_AUDIO, test $affix_cv_use_audio = yes)

# check rfcomm
if test $affix_cv_use_rfcomm = yes; then
	AC_DEFINE([CONFIG_AFFIX_RFCOMM],, [Enable RFCOMM support in Affix (required)])
fi
AM_CONDITIONAL(CONFIG_AFFIX_RFCOMM, test $affix_cv_use_rfcomm = yes)

# check PAN
if test $affix_cv_use_pan = yes; then
	AC_DEFINE([CONFIG_AFFIX_PAN],, [Enable PAN support in Affix])
fi
AM_CONDITIONAL(CONFIG_AFFIX_PAN, test $affix_cv_use_pan = yes)

# check UART
if test $affix_cv_use_uart = yes; then
	AC_DEFINE([CONFIG_AFFIX_UART],, [Enable UART support in Affix])
fi
AM_CONDITIONAL(CONFIG_AFFIX_UART, test $affix_cv_use_uart = yes)

# check SDP
if test $affix_cv_use_sdp = yes; then
	AC_DEFINE([CONFIG_AFFIX_SDP],, [Enable SDP support in Affix])
	AFFIX_SUBDIRS="$AFFIX_SUBDIRS sdp"
	LDFLAGS_AFFIX_SDP="\$(top_builddir)/sdp/libaffix_sdp.la \$(top_builddir)/sdp/libaffix_sdpsvc.la"
fi
AM_CONDITIONAL(CONFIG_AFFIX_SDP, test $affix_cv_use_sdp = yes)

# check OBEX
if test $affix_cv_use_obex = yes; then
	# check for libopenobex
	AFFIX_PATH_OPENOBEX(1.0.0)
	if test "$OPENOBEX_CONFIG" != "no" ; then
		CPPFLAGS_OPENOBEX="$OPENOBEX_CFLAGS"
		LDFLAGS_OPENOBEX="$OPENOBEX_LIBS"
	else
		AC_MSG_ERROR([OPENOBEX not found])
	fi
	AC_DEFINE([CONFIG_AFFIX_OBEX],, [Enable OBEX support in Affix])
	AFFIX_SUBDIRS="$AFFIX_SUBDIRS obex"
	LDFLAGS_AFFIX_OBEX="\$(top_builddir)/obex/libaffix_obex.la"
	AC_DEFINE_UNQUOTED([OPENOBEX_VERSION_CODE],$openobex_version_code, [openobex version])
fi
AM_CONDITIONAL(CONFIG_AFFIX_OBEX, test $affix_cv_use_obex = yes)

if test $affix_cv_use_debug = yes; then
	AC_DEFINE([CONFIG_AFFIX_DEBUG],, [Enable Debug support in Affix])
	CFLAGS="-g -O1 -Wall -Wstrict-prototypes -pipe"
else
	CFLAGS="-O2 -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe"
fi
AM_CONDITIONAL(CONFIG_AFFIX_DEBUG, test $affix_cv_use_debug = yes)

AFFIX_SUBDIRS="$AFFIX_SUBDIRS tools daemon control etc include"

CPPFLAGS="-D_GNU_SOURCE -I\$(top_srcdir)/include -include \$(top_srcdir)/include/config.h"
LIBS=""

includedir=/usr/include
sysconfdir=/etc
# check affix_sysconfdir
if test "$affix_sysconfdir" != "" ; then
	sysconfdir=$affix_sysconfdir
fi

LIBTOOL="$LIBTOOL $affix_libtool"

# substitute it
#AC_SUBST(affix_sysconfdir)
AC_SUBST(cross_compiling)
AC_SUBST(AFFIX_SUBDIRS)
AC_SUBST(AFFIX_EXTRA_SUBDIRS)
AC_SUBST(CPPFLAGS_OPENOBEX)
AC_SUBST(LDFLAGS_OPENOBEX)
AC_SUBST(LDFLAGS_AFFIX_LIBS)
AC_SUBST(LDFLAGS_AFFIX_SDP)
AC_SUBST(LDFLAGS_AFFIX_OBEX)
AC_SUBST(VERSION_AFFIX_LIBS)
AC_SUBST(VERSION_AFFIX_SDP)
AC_SUBST(VERSION_AFFIX_OBEX)

AC_CONFIG_LINKS(include/affix:include)

AC_CONFIG_FILES([Makefile
                 lib/Makefile
		 sdp/Makefile
		 obex/Makefile
		 tools/Makefile
		 daemon/Makefile
		 control/Makefile
		 etc/Makefile
		 etc/btsrv.conf
		 etc/affix.conf
		 include/Makefile
		 ])
AC_OUTPUT