Avahi bindings for TQt
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.ac 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. # This file is part of avahi.
  4. #
  5. # avahi is free software; you can redistribute it and/or modify it
  6. # under the terms of the GNU Lesser General Public License as
  7. # published by the Free Software Foundation; either version 2 of the
  8. # License, or (at your option) any later version.
  9. #
  10. # avahi is distributed in the hope that it will be useful, but WITHOUT
  11. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12. # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  13. # License for more details.
  14. #
  15. # You should have received a copy of the GNU Lesser General Public
  16. # License along with avahi; if not, write to the Free Software
  17. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  18. # USA.
  19. AC_PREREQ(2.63)
  20. AC_INIT([avahi],[0.6.30],[avahi (at) lists (dot) freedesktop (dot) org])
  21. AC_CONFIG_MACRO_DIR([common])
  22. AC_CONFIG_HEADERS([config.h])
  23. AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
  24. AC_SUBST(PACKAGE_URL, [http://avahi.org/])
  25. AC_SUBST(LIBAVAHI_COMMON_VERSION_INFO, [8:3:5])
  26. AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [7:2:0])
  27. AC_SUBST(LIBAVAHI_CLIENT_VERSION_INFO, [5:9:2])
  28. AC_SUBST(LIBAVAHI_GLIB_VERSION_INFO, [1:2:0])
  29. AC_SUBST(LIBAVAHI_GOBJECT_VERSION_INFO, [0:4:0])
  30. AC_SUBST(LIBAVAHI_QT3_VERSION_INFO, [1:2:0])
  31. AC_SUBST(LIBAVAHI_QT4_VERSION_INFO, [1:2:0])
  32. AC_SUBST(LIBAVAHI_UI_VERSION_INFO, [1:4:1])
  33. # Do not touch these, since they we took this version-info from upstream HOWL/Bonjour
  34. AC_SUBST(LIBAVAHI_COMPAT_LIBDNS_SD_VERSION_INFO, [1:0:0])
  35. AC_SUBST(LIBAVAHI_COMPAT_HOWL_VERSION_INFO, [0:0:0])
  36. AC_SUBST(HOWL_COMPAT_VERSION, [0.9.8])
  37. AC_CANONICAL_HOST
  38. AM_SILENT_RULES([yes])
  39. AC_CHECK_PROG([STOW], [stow], [yes], [no])
  40. AS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [
  41. AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
  42. ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
  43. ])
  44. # Checks for programs.
  45. AC_PROG_CC
  46. AC_PROG_CC_C99
  47. AC_PROG_CXX
  48. AM_PROG_CC_C_O
  49. AC_USE_SYSTEM_EXTENSIONS
  50. AC_PROG_CPP
  51. AC_PROG_INSTALL
  52. AC_PROG_LN_S
  53. AC_PROG_MAKE_SET
  54. AC_PROG_GCC_TRADITIONAL
  55. # -fstack-protector
  56. AC_ARG_ENABLE([stack-protector],
  57. [AS_HELP_STRING([--disable-stack-protector],
  58. [Disable GCC's/libc's stack-smashing protection])],
  59. [case "${enableval}" in
  60. yes) enable_ssp=yes ;;
  61. no) enable_ssp=no ;;
  62. *) AC_MSG_ERROR([invalid value ${enableval} for --disable-stack-protector]) ;;
  63. esac],
  64. [enable_ssp=yes])
  65. if test x"$enable_ssp" = x"yes" && test x"$GCC" != x"yes"; then
  66. AC_MSG_NOTICE([Disabling stack-smashing protection because compiler is not GCC])
  67. enable_ssp=no
  68. fi
  69. if test x"$enable_ssp" = x"yes"; then
  70. # Check for broken ssp in libc: http://www.avahi.org/ticket/105
  71. # libc's brokenness will get in the way regardless of whether -lssp is
  72. # provided, but provide it anyway (otherwise non-libc ssp would wrongly
  73. # break here)
  74. # Get -lssp if it exists
  75. GCC_STACK_PROTECT_LIB
  76. AC_MSG_CHECKING([whether stack-smashing protection is available])
  77. ssp_old_cflags="$CFLAGS"
  78. ssp_old_ldflags="$LDFLAGS"
  79. CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC"
  80. LDFLAGS="$LDFLAGS -Wl,-z,defs"
  81. cat confdefs.h > conftest.c
  82. cat >>conftest.c <<_ACEOF
  83. void test_broken_ssp(c)
  84. const char *c;
  85. {
  86. char arr[[123]], *p; /* beware of possible double-braces if copying this */
  87. for (p = arr; *c; ++p) {
  88. *p = *c;
  89. ++c;
  90. }
  91. }
  92. _ACEOF
  93. rm -f conftest.o
  94. if $CC -c $CFLAGS $CPPFLAGS -o conftest.o conftest.c >/dev/null 2>&1; then
  95. AC_MSG_RESULT([yes])
  96. AC_MSG_CHECKING([whether stack-smashing protection is buggy])
  97. if $CC -o conftest.so $LDFLAGS -shared conftest.o $LIBS >/dev/null 2>&1; then
  98. AC_MSG_RESULT([no])
  99. else
  100. AC_MSG_RESULT([yes])
  101. enable_ssp=no
  102. fi
  103. else
  104. AC_MSG_RESULT([no])
  105. fi
  106. rm -f conftest.c conftest.o conftest.so
  107. CFLAGS="$ssp_old_cflags"
  108. LDFLAGS="$ssp_old_ldflags"
  109. fi
  110. if test x"$enable_ssp" = x"yes"; then
  111. # Do this the long way so we don't call GCC_STACK_PROTECT_LIB twice
  112. GCC_STACK_PROTECT_CC
  113. AC_LANG_PUSH([C++])
  114. GCC_STACK_PROTECT_CXX
  115. AC_LANG_POP([C++])
  116. # XXX: Update the enable_ssp value now for output later?
  117. fi
  118. # libtool stuff
  119. AC_PROG_LIBTOOL
  120. AC_CACHE_CHECK([whether the C++ compiler works], [avahi_cv_sys_cxx_works], [
  121. AC_LANG_PUSH([C++])
  122. AC_COMPILE_IFELSE([int main() { return 0; }], [avahi_cv_sys_cxx_works=yes],
  123. [avahi_cv_sys_cxx_works=no])
  124. AC_LANG_POP([C++])
  125. ])
  126. [ if [ "x$avahi_cv_sys_cxx_works" = "xno" ]; then ]
  127. AC_MSG_FAILURE([The C++ compiler does not work])
  128. [ fi ]
  129. ACX_PTHREAD(,AC_MSG_ERROR([Missing POSIX Threads support]))
  130. #
  131. # Check for netlink.h
  132. #
  133. AC_CHECK_HEADER(linux/netlink.h,
  134. HAVE_NETLINK=yes
  135. AC_DEFINE([HAVE_NETLINK],[],[Support for Linux netlink])
  136. , [], [
  137. #include <sys/socket.h>
  138. #include <asm/types.h>
  139. ])
  140. AM_CONDITIONAL(HAVE_NETLINK, [ test x"$HAVE_NETLINK" = xyes ])
  141. #
  142. # Check for net/route.h
  143. #
  144. AC_CHECK_HEADER(net/route.h,
  145. HAVE_PF_ROUTE=yes
  146. AC_DEFINE([HAVE_PF_ROUTE],[],[Support for PF_ROUTE])
  147. , [], [
  148. #include <sys/types.h>
  149. #include <sys/socket.h>
  150. #include <net/if_dl.h>
  151. ])
  152. AM_CONDITIONAL(HAVE_PF_ROUTE, [ test x"$HAVE_PF_ROUTE" = xyes ])
  153. #
  154. # Check for sys/filio.h; needed for FIONREAD on Solaris
  155. #
  156. AC_CHECK_HEADER(sys/filio.h,
  157. HAVE_SYS_FILIO_H=yes
  158. AC_DEFINE([HAVE_SYS_FILIO_H],[],[Support for sys/filio.h])
  159. , [], [
  160. ])
  161. AM_CONDITIONAL(HAVE_SYS_FILIO_H, [ test x"$HAVE_SYS_FILIO_H" = xyes ])
  162. #
  163. # Check for sys/sysctl.h; not present on Solaris
  164. #
  165. AC_CHECK_HEADER(sys/sysctl.h,
  166. HAVE_SYS_SYSCTL=yes
  167. AC_DEFINE([HAVE_SYS_SYSCTL_H],[],[Support for sys/sysctl.h])
  168. , [], [
  169. #include <sys/types.h>
  170. #include <sys/socket.h>
  171. #include <sys/param.h>
  172. ])
  173. AM_CONDITIONAL(HAVE_SYS_SYSCTL_H, [ test x"$HAVE_SYS_SYSCTL_H" = xyes ])
  174. #
  175. # Check for lifconf struct; only present on Solaris
  176. #
  177. AC_MSG_CHECKING(for struct lifconf)
  178. AC_CACHE_VAL(avahi_cv_has_struct_lifconf,
  179. [AC_TRY_COMPILE(
  180. [#include <sys/socket.h>
  181. #include <net/if.h>
  182. ],[sizeof (struct lifconf);],
  183. avahi_cv_has_struct_lifconf=yes,avahi_cv_has_struct_lifconf=no)])
  184. AC_MSG_RESULT($avahi_cv_has_struct_lifconf)
  185. if test $avahi_cv_has_struct_lifconf = yes; then
  186. AC_DEFINE(HAVE_STRUCT_LIFCONF,1,[Define if there is a struct lifconf.])
  187. fi
  188. #
  189. # Check for struct ip_mreqn
  190. #
  191. AC_MSG_CHECKING(for struct ip_mreqn)
  192. AC_TRY_COMPILE([#include <netinet/in.h>], [
  193. struct ip_mreqn mreq;
  194. mreq.imr_address.s_addr = 0;
  195. ], [
  196. # Yes, we have it...
  197. AC_MSG_RESULT(yes)
  198. AC_DEFINE([HAVE_STRUCT_IP_MREQN],[],[Support for struct ip_mreqn])
  199. ], [
  200. # We'll just have to try and use struct ip_mreq
  201. AC_MSG_RESULT(no)
  202. AC_MSG_CHECKING(for struct ip_mreq)
  203. AC_TRY_COMPILE([#include <netinet/in.h>], [
  204. struct ip_mreq mreq;
  205. mreq.imr_interface.s_addr = 0;
  206. ], [
  207. # Yes, we have it...
  208. AC_MSG_RESULT(yes)
  209. AC_DEFINE([HAVE_STRUCT_IP_MREQ],[],[Support for struct ip_mreq])
  210. ], [
  211. # No multicast support
  212. AC_MSG_RESULT(no)
  213. ])
  214. ])
  215. #
  216. # Detecting the linux distribution for specific things like init scripts.
  217. #
  218. AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of lfs, debian, gentoo, archlinux, fedora, mandriva, darwin, netbsd, freebsd, slackware or none]))
  219. if test "z$with_distro" = "z"; then
  220. if test "$cross_compiling" = yes; then
  221. AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)])
  222. else
  223. AC_CHECK_FILE(/etc/lfs-release,with_distro="lfs")
  224. AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse")
  225. AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
  226. AC_CHECK_FILE(/etc/arch-release,with_distro="archlinux")
  227. AC_CHECK_FILE(/etc/debian_version,with_distro="debian")
  228. AC_CHECK_FILE(/etc/redhat-release,with_distro="fedora")
  229. AC_CHECK_FILE(/etc/mandriva-release,with_distro="mandriva")
  230. AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
  231. fi
  232. if test "z$with_distro" = "z"; then
  233. with_distro=`uname -s`
  234. fi
  235. fi
  236. with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
  237. case $with_distro in
  238. lfs|debian|gentoo|archlinux|suse|fedora|mandriva|darwin|freebsd|slackware|none)
  239. ;;
  240. netbsd)
  241. AC_MSG_WARN([Your distribution (${with_distro}) is supported but no init script exist yet! (patches welcome)])
  242. ;;
  243. linux)
  244. AC_MSG_ERROR([Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO, set DISTRO to none if your distribution is not supported.])
  245. ;;
  246. *)
  247. AC_MSG_ERROR([Your distribution (${with_distro}) is not yet supported, init scripts and D-Bus configuration will not be installed! (patches welcome), you can specify --with-distro=none to skip this check])
  248. ;;
  249. esac
  250. AM_CONDITIONAL(TARGET_LFS, test x"$with_distro" = xlfs)
  251. AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
  252. AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
  253. AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
  254. AM_CONDITIONAL(TARGET_ARCHLINUX, test x"$with_distro" = xarchlinux)
  255. AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
  256. AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
  257. AM_CONDITIONAL(TARGET_DARWIN, test x"$with_distro" = xdarwin)
  258. AM_CONDITIONAL(TARGET_NETBSD, test x"$with_distro" = xnetbsd)
  259. AM_CONDITIONAL(TARGET_FREEBSD, test x"$with_distro" = xfreebsd)
  260. AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
  261. test_gcc_flag() {
  262. AC_LANG_CONFTEST([int main() {}])
  263. $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
  264. ret=$?
  265. rm -f conftest.o
  266. return $ret
  267. }
  268. # If using GCC specify some additional parameters
  269. if test "x$GCC" = "xyes" ; then
  270. DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -fdiagnostics-show-option -Wno-cast-qual -fno-strict-aliasing"
  271. if test "x$HAVE_NETLINK" = "xyes" ; then
  272. # Test whether rtnetlink.h can be included when compiled with -std=c99
  273. # some distributions (e.g. archlinux) have broken headers that dont
  274. # define __u64 with -std=c99
  275. AC_MSG_CHECKING([checking whether rtnetlink.h can be included with -std=c99])
  276. OLDCFLAGS="$CFLAGS"
  277. CFLAGS="-std=c99"
  278. AC_TRY_COMPILE([#include <linux/rtnetlink.h>], [],
  279. use_stdc99=yes, use_stdc99=no)
  280. if test x"$use_stdc99" = xyes; then
  281. DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
  282. AC_MSG_RESULT([yes])
  283. else
  284. AC_MSG_RESULT([no])
  285. fi
  286. CFLAGS="$OLDCFLAGS"
  287. else
  288. DESIRED_FLAGS="-std=c99 $DESIRED_FLAGS"
  289. fi
  290. for flag in $DESIRED_FLAGS ; do
  291. AC_MSG_CHECKING([whether $CC accepts $flag])
  292. if test_gcc_flag $flag ; then
  293. CFLAGS="$CFLAGS $flag"
  294. AC_MSG_RESULT([yes])
  295. else
  296. AC_MSG_RESULT([no])
  297. fi
  298. done
  299. fi
  300. # Checks for header files.
  301. AC_HEADER_STDC
  302. AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h netdb.h syslog.h])
  303. AC_HEADER_STDBOOL
  304. # Checks for typedefs, structures, and compiler characteristics.
  305. AC_C_CONST
  306. AC_TYPE_SIZE_T
  307. AC_HEADER_TIME
  308. AC_HEADER_SYS_WAIT
  309. # Solaris stuff
  310. AC_SEARCH_LIBS([inet_ntop],[nsl])
  311. AC_SEARCH_LIBS([recv],[socket])
  312. AC_CHECK_DECL([CMSG_SPACE],,CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__", [[#include <sys/socket.h>]])
  313. # Checks for library functions.
  314. AC_FUNC_MEMCMP
  315. AC_FUNC_SELECT_ARGTYPES
  316. # avahi_malloc actually returns NULL for avahi_malloc(0), so it does not matter
  317. # whether libc's malloc does too. (Same for realloc.)
  318. #AC_FUNC_MALLOC
  319. #AC_FUNC_REALLOC
  320. AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid setresgid setregid strcasecmp gettimeofday putenv strncasecmp strlcpy gethostbyname seteuid setegid setproctitle getprogname])
  321. AC_FUNC_CHOWN
  322. AC_FUNC_STAT
  323. AC_TYPE_MODE_T
  324. AC_TYPE_PID_T
  325. AC_CHECK_DECLS(environ)
  326. # check if gcc's -fvisibility is supported
  327. CHECK_VISIBILITY_HIDDEN
  328. enable_chroot=yes
  329. AC_CHECK_HEADERS([sys/capability.h],,enable_chroot=no)
  330. AC_CHECK_HEADERS([sys/prctl.h],,enable_chroot=no)
  331. AC_CHECK_FUNCS([chroot],,enable_chroot=no)
  332. AM_CONDITIONAL(ENABLE_CHROOT, test "x$enable_chroot" = "xyes")
  333. if test "x$enable_chroot" = "xyes" ; then
  334. AC_DEFINE([ENABLE_CHROOT], 1, [Enable chroot() usage])
  335. fi
  336. AC_CHECK_LIB(dl, dlopen, [ AC_CHECK_HEADERS(dlfcn.h, HAVE_DLOPEN=yes, HAVE_DLOPEN=no) ], HAVE_DLOPEN=no)
  337. if test "x$HAVE_DLOPEN" = "xyes" ; then
  338. AC_DEFINE([HAVE_DLOPEN],1,[Have dlopen()])
  339. fi
  340. AM_CONDITIONAL(HAVE_DLOPEN, test "x$HAVE_DLOPEN" = "xyes")
  341. have_inotify=no
  342. AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes])
  343. AM_CONDITIONAL(HAVE_INOTIFY, test "x$have_inotify" = "xyes")
  344. if test "x$have_inotify" = "xyes" ; then
  345. AC_DEFINE([HAVE_INOTIFY], 1, [Enable Linux inotify() usage])
  346. fi
  347. have_kqueue=yes
  348. AC_CHECK_FUNCS([kqueue],,have_kqueue=no)
  349. AM_CONDITIONAL(HAVE_KQUEUE, test "x$have_kqueue" = "xyes")
  350. if test "x$have_kqueue" = "xyes" ; then
  351. AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
  352. fi
  353. avahilocaledir='${prefix}/${DATADIRNAME}/locale'
  354. AC_SUBST(avahilocaledir)
  355. # Check for pkg-config manually first, as if its not installed the
  356. # PKG_PROG_PKG_CONFIG macro won't be defined.
  357. AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
  358. if test x"$have_pkg_config" = "xno"; then
  359. AC_MSG_ERROR(pkg-config is required to install this program)
  360. fi
  361. PKG_PROG_PKG_CONFIG
  362. #
  363. # Check for GLIB 2.0
  364. #
  365. AC_ARG_ENABLE(glib,
  366. AS_HELP_STRING([--disable-glib],[Disable use of GLib]),
  367. [case "${enableval}" in
  368. yes) HAVE_GLIB=yes ;;
  369. no) HAVE_GLIB=no ;;
  370. *) AC_MSG_ERROR(bad value ${enableval} for --enable-glib) ;;
  371. esac],
  372. [HAVE_GLIB=yes])
  373. if test "x$HAVE_GLIB" = "xyes" ; then
  374. PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
  375. AC_SUBST(GLIB20_CFLAGS)
  376. AC_SUBST(GLIB20_LIBS)
  377. fi
  378. AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
  379. #
  380. # Check for GLIB's gobject 2.0
  381. #
  382. AC_ARG_ENABLE(gobject,
  383. AS_HELP_STRING([--disable-gobject],[Disable use of GLib GObject]),
  384. [case "${enableval}" in
  385. yes) HAVE_GOBJECT=yes ;;
  386. no) HAVE_GOBJECT=no ;;
  387. *) AC_MSG_ERROR(bad value ${enableval} for --enable-gobject) ;;
  388. esac],
  389. [HAVE_GOBJECT=yes])
  390. if test "x$HAVE_GOBJECT" = "xyes" ; then
  391. PKG_CHECK_MODULES(GOBJECT, [ glib-2.0 >= 2.4.0 gobject-2.0 ])
  392. AC_SUBST(GOBJECT_CFLAGS)
  393. AC_SUBST(GOBJECT_LIBS)
  394. fi
  395. AM_CONDITIONAL(HAVE_GOBJECT, test "x$HAVE_GOBJECT" = "xyes")
  396. #
  397. # Introspection support.
  398. #
  399. GOBJECT_INTROSPECTION_CHECK([0.9.5])
  400. #
  401. # Check for Qt 3
  402. #
  403. AC_ARG_ENABLE(tqt,
  404. AS_HELP_STRING([--disable-tqt],[Disable building of TQt mainloop integration]),
  405. [case "${enableval}" in
  406. yes) HAVE_TQT=yes ;;
  407. no) HAVE_TQT=no ;;
  408. *) AC_MSG_ERROR(bad value ${enableval} for --enable-tqt) ;;
  409. esac],
  410. [HAVE_TQT=yes])
  411. if test "x$HAVE_TQT" = "xyes" ; then
  412. PKG_CHECK_MODULES( QT3, [ tqt-mt ],
  413. [AC_SUBST(QT3_CFLAGS)
  414. AC_SUBST(QT3_LIBS)
  415. QT3_PREFIX="`$PKG_CONFIG --variable=prefix tqt-mt`/bin"
  416. ],
  417. [PKG_CHECK_MODULES( QT3, [ qt-mt >= 3.0.0 ] )
  418. AC_SUBST(QT3_CFLAGS)
  419. AC_SUBST(QT3_LIBS)
  420. QT3_PREFIX="`$PKG_CONFIG --variable=prefix qt-mt`/bin"
  421. ])
  422. AC_PATH_PROGS(MOC_QT3, [moc-tqt], no, [$QT3_PREFIX:$PATH])
  423. if test "$MOC_QT3" = no; then
  424. AC_MSG_ERROR([Could not find moc-tqt])
  425. fi
  426. AC_SUBST(MOC_QT3)
  427. fi
  428. AM_CONDITIONAL(HAVE_TQT, test "x$HAVE_TQT" = "xyes")
  429. #
  430. # D-Bus
  431. #
  432. AC_ARG_ENABLE(dbus,
  433. AS_HELP_STRING([--disable-dbus],[Disable use of D-Bus]),
  434. [case "${enableval}" in
  435. yes) HAVE_DBUS=yes ;;
  436. no) HAVE_DBUS=no ;;
  437. *) AC_MSG_ERROR(bad value ${enableval} for --enable-dbus) ;;
  438. esac],
  439. [HAVE_DBUS=yes])
  440. AC_ARG_WITH(dbus-sys, AS_HELP_STRING([--with-dbus-sys=<dir>], [Path to D-Bus system.d directory]))
  441. AC_ARG_WITH(dbus-system-socket, AS_HELP_STRING([--with-dbus-system-address=<address>], [Path to the D-Bus system socket, you probably want to put unix:path= at the start. Only needed for very old D-Bus releases]))
  442. DBUS_VERSION="Disabled"
  443. DBUS_SYS_DIR="Disabled"
  444. DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="Disabled"
  445. if test "x$HAVE_DBUS" = "xyes" ; then
  446. PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.34 ])
  447. AC_DEFINE(HAVE_DBUS, 1, [Whether we have D-Bus or not])
  448. DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
  449. DBUS_VERSION_MAJOR=`echo $DBUS_VERSION | awk -F. '{print $1}'`
  450. DBUS_VERSION_MINOR=`echo $DBUS_VERSION | awk -F. '{print $2}'`
  451. DBUS_VERSION_MICRO=`echo $DBUS_VERSION | awk -F. '{print $3}'`
  452. if test "z$DBUS_VERSION_MAJOR" = "z"; then
  453. DBUS_VERSION_MAJOR="0"
  454. fi
  455. if test "z$DBUS_VERSION_MINOR" = "z"; then
  456. DBUS_VERSION_MINOR="0"
  457. fi
  458. if test "z$DBUS_VERSION_MICRO" = "z"; then
  459. DBUS_VERSION_MICRO="0"
  460. fi
  461. if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then
  462. echo "Error: Couldn't determine the version of your D-Bus package."
  463. echo " This is probably an error in this script, please report it"
  464. echo " along with the following information:"
  465. echo " Base D-Buss version ='$DBUS_VERSION'"
  466. echo " DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
  467. echo " DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
  468. echo " DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
  469. exit 1
  470. else
  471. echo "Your D-Bus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
  472. DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
  473. DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
  474. DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
  475. fi
  476. DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
  477. AC_SUBST(DBUS_CFLAGS)
  478. AC_SUBST(DBUS_LIBS)
  479. if ! test -z "$with_dbus_sys" ; then
  480. DBUS_SYS_DIR="$with_dbus_sys"
  481. else
  482. DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
  483. fi
  484. AC_SUBST(DBUS_SYS_DIR)
  485. if ! test -z "$with_dbus_system_address" ; then
  486. DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="$with_dbus_system_address"
  487. else
  488. # This is ugly, but D-Bus doesn't export this address for us
  489. # so we have to guess, pretty much all setups i've seen have
  490. # it in /var/lib/dbus or /var/run/dbus, and its defaulted to
  491. # /var/run upstream so we will try guess first then default
  492. # to /var/run/dbus.
  493. DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=/var/run/dbus/system_bus_socket"
  494. TRY_SOCKETS="/var/lib/dbus/system_bus_socket /var/run/dbus/system_bus_socket ${localstatedir}/run/dbus/system_bus_socket ${prefix}/var/run/dbus/system_bus_socket"
  495. for sock in $TRY_SOCKETS; do
  496. if test -S $sock; then
  497. DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$sock"
  498. fi
  499. done
  500. fi
  501. AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
  502. SAVED_LIBS="$LIBS"
  503. LIBS="$LIBS $DBUS_LIBS"
  504. AC_CHECK_FUNCS([dbus_connection_close dbus_bus_get_private])
  505. LIBS="$SAVED_LIBS"
  506. fi
  507. AM_CONDITIONAL(HAVE_DBUS, test "x$HAVE_DBUS" = "xyes")
  508. #
  509. # Expat
  510. #
  511. AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[expat/bsdxml/none]],[XML library to use]))
  512. use_expat=false
  513. use_bsdxml=false
  514. # See what we have
  515. AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
  516. AC_CHECK_LIB(bsdxml, XML_ParserCreate, [ AC_CHECK_HEADERS(bsdxml.h, have_bsdxml=true, have_bsdxml=false) ], have_bsdxml=false)
  517. if test "x$with_xml" = "xnone"; then
  518. :
  519. elif test "x$with_xml" = "xexpat"; then
  520. use_expat=true
  521. if ! $have_expat ; then
  522. AC_MSG_ERROR([*** libexpat requested, but not found ***])
  523. fi
  524. elif test "x$with_xml" = "xbsdxml"; then
  525. use_bsdxml=true
  526. if ! $have_bsdxml ; then
  527. AC_MSG_ERROR([*** libbsdxml requested, but not found ***])
  528. fi
  529. elif test "x$with_xml" != "x"; then
  530. AC_MSG_ERROR([*** unknown with-xml option ***])
  531. else
  532. if $have_expat ; then
  533. use_expat=true
  534. elif $have_bsdxml ; then
  535. use_bsdxml=true
  536. else
  537. AC_MSG_ERROR([*** neither libexpat not libbsdxml could be found ***])
  538. fi
  539. fi
  540. if $use_expat; then
  541. with_xml=expat
  542. XML_CFLAGS=-DUSE_EXPAT_H
  543. XML_LIBS=-lexpat
  544. fi
  545. if $use_bsdxml; then
  546. with_xml=bsdxml
  547. XML_CFLAGS=-DUSE_BSDXML_H
  548. XML_LIBS=-lbsdxml
  549. fi
  550. AC_SUBST(XML_LIBS)
  551. AC_SUBST(XML_CFLAGS)
  552. if $use_expat || $use_bsdxml; then
  553. HAVE_XML=yes
  554. fi
  555. AM_CONDITIONAL(HAVE_XML, test "x$HAVE_XML" = "xyes")
  556. #
  557. # Build autoipd?
  558. #
  559. AC_ARG_ENABLE(autoipd,
  560. AS_HELP_STRING([--disable-autoipd],[Disable building of avahi-autoipd]),
  561. [case "${enableval}" in
  562. yes) ENABLE_AUTOIPD=yes ;;
  563. no) ENABLE_AUTOIPD=no ;;
  564. *) AC_MSG_ERROR(bad value ${enableval} for --disable-autoipd) ;;
  565. esac],
  566. [ENABLE_AUTOIPD=yes])
  567. AM_CONDITIONAL(ENABLE_AUTOIPD, test "x$ENABLE_AUTOIPD" = "xyes")
  568. #
  569. # Defining users and groups
  570. #
  571. AC_ARG_WITH(avahi_user, AS_HELP_STRING([--with-avahi-user=<user>],[User for running avahi-daemon (avahi)]))
  572. if test -z "$with_avahi_user" ; then
  573. AVAHI_USER=avahi
  574. else
  575. AVAHI_USER=$with_avahi_user
  576. fi
  577. AC_SUBST(AVAHI_USER)
  578. AC_DEFINE_UNQUOTED(AVAHI_USER,"$AVAHI_USER", [User for running the Avahi daemon])
  579. AC_ARG_WITH(avahi_group,AS_HELP_STRING([--with-avahi-group=<group>],[Group for running avahi-daemon (avahi)]))
  580. if test -z "$with_avahi_group" ; then
  581. AVAHI_GROUP=avahi
  582. else
  583. AVAHI_GROUP=$with_avahi_group
  584. fi
  585. AC_SUBST(AVAHI_GROUP)
  586. AC_DEFINE_UNQUOTED(AVAHI_GROUP,"$AVAHI_GROUP", [Group for Avahi])
  587. AC_ARG_WITH(avahi_priv_access_group,AS_HELP_STRING([--with-avahi-priv-access-group=<group>],[Priviliged access group for Avahi clients (netdev)]))
  588. if test -z "$with_avahi_priv_access_group" ; then
  589. AVAHI_PRIV_ACCESS_GROUP=netdev
  590. else
  591. AVAHI_PRIV_ACCESS_GROUP=$with_avahi_priv_access_group
  592. fi
  593. AC_SUBST(AVAHI_PRIV_ACCESS_GROUP)
  594. AC_DEFINE_UNQUOTED(AVAHI_PRIV_ACCESS_GROUP,"$AVAHI_PRIV_ACCESS_GROUP", [Privileged access group for Avahi clients])
  595. AC_ARG_WITH(autoipd_user, AS_HELP_STRING([--with-autoipd-user=<user>],[User for running the avahi-autoipd daemon (avahi-autoipd)]))
  596. if test -z "$with_autoipd_user" ; then
  597. AVAHI_AUTOIPD_USER=avahi-autoipd
  598. else
  599. AVAHI_AUTOIPD_USER=$with_autoipd_user
  600. fi
  601. AC_SUBST(AVAHI_AUTOIPD_USER)
  602. AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_USER,"$AVAHI_AUTOIPD_USER", [User for running the avahi-autoipd daemon])
  603. AC_ARG_WITH(autoipd_group,AS_HELP_STRING([--with-autoipd-group=<group>],[Group for running the avahi-autoipd daemon (avahi-autoipd)]))
  604. if test -z "$with_autoipd_group" ; then
  605. AVAHI_AUTOIPD_GROUP=avahi-autoipd
  606. else
  607. AVAHI_AUTOIPD_GROUP=$with_autoipd_group
  608. fi
  609. AC_SUBST(AVAHI_AUTOIPD_GROUP)
  610. AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP,"$AVAHI_AUTOIPD_GROUP", [Group for running the avahi-autoipd daemon])
  611. #
  612. # Avahi runtime dir
  613. #
  614. avahi_runtime_dir="${localstatedir}/run"
  615. avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket"
  616. AC_SUBST(avahi_runtime_dir)
  617. AC_SUBST(avahi_socket)
  618. #
  619. # Avahi interfaces dir
  620. #
  621. if test "x$HAVE_PYTHON_DBUS" = "xyes" -o "x$HAVE_GTK" = "xyes"; then
  622. interfacesdir="${datadir}/${PACKAGE}/interfaces/"
  623. AC_SUBST(interfacesdir)
  624. fi
  625. #
  626. # Doxygen
  627. #
  628. DX_HTML_FEATURE(ON)
  629. DX_CHM_FEATURE(OFF)
  630. DX_CHI_FEATURE(OFF)
  631. DX_MAN_FEATURE(OFF)
  632. DX_RTF_FEATURE(OFF)
  633. DX_XML_FEATURE(ON)
  634. DX_PDF_FEATURE(OFF)
  635. DX_PS_FEATURE(OFF)
  636. DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
  637. AC_ARG_ENABLE(core-docs,
  638. AS_HELP_STRING([--enable-core-docs],[Enable building of documentation for avahi-core]),
  639. [case "${enableval}" in
  640. yes) ENABLE_CORE_DOCS=yes ;;
  641. no) ENABLE_CORE_DOCS=no ;;
  642. *) AC_MSG_ERROR([bad value ${enableval} for --enable-core-docs]) ;;
  643. esac],[ENABLE_CORE_DOCS=no])
  644. AM_CONDITIONAL([ENABLE_CORE_DOCS], [test "x$ENABLE_CORE_DOCS" = xyes])
  645. #
  646. # Build and Install man pages
  647. #
  648. AC_ARG_ENABLE(manpages,
  649. AS_HELP_STRING([--disable-manpages],[Disable building and installation of man pages]),
  650. [case "${enableval}" in
  651. yes) manpages=yes ;;
  652. no) manpages=no ;;
  653. *) AC_MSG_ERROR([bad value ${enableval} for --disable-manpages]) ;;
  654. esac],[manpages=yes])
  655. #
  656. # Optionally enable libdns_sd compatibility support
  657. #
  658. AC_ARG_ENABLE(compat-libdns_sd,
  659. AS_HELP_STRING([--enable-compat-libdns_sd],[Enable compatibility layer for libdns_sd]),
  660. [case "${enableval}" in
  661. yes) ENABLE_COMPAT_LIBDNS_SD=yes ;;
  662. no) ENABLE_COMPAT_LIBDNS_SD=no ;;
  663. *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libdns_sd) ;;
  664. esac],
  665. [ENABLE_COMPAT_LIBDNS_SD=no])
  666. AM_CONDITIONAL([ENABLE_COMPAT_LIBDNS_SD], [test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes"])
  667. #
  668. # Optionally enable HOWL compatibility support
  669. #
  670. AC_ARG_ENABLE(compat-howl,
  671. AS_HELP_STRING([--enable-compat-howl],[Enable compatibility layer for HOWL]),
  672. [case "${enableval}" in
  673. yes) ENABLE_COMPAT_HOWL=yes ;;
  674. no) ENABLE_COMPAT_HOWL=no ;;
  675. *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-howl) ;;
  676. esac],
  677. [ENABLE_COMPAT_HOWL=no])
  678. AM_CONDITIONAL([ENABLE_COMPAT_HOWL], [test "x$ENABLE_COMPAT_HOWL" = "xyes"])
  679. #
  680. # systemd
  681. #
  682. AC_ARG_WITH([systemdsystemunitdir],
  683. AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
  684. [],
  685. [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
  686. if test "x$with_systemdsystemunitdir" != xno; then
  687. AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
  688. fi
  689. AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
  690. # ==========================================================================
  691. AC_CONFIG_FILES([
  692. Makefile
  693. avahi-tqt/Makefile
  694. ])
  695. AC_OUTPUT
  696. # ==========================================================================
  697. echo "
  698. ---{ $PACKAGE_NAME $VERSION }---
  699. prefix: ${prefix}
  700. sysconfdir: ${sysconfdir}
  701. localstatedir: ${localstatedir}
  702. avahi socket: ${avahi_socket}
  703. dbus-1 system.d dir: ${DBUS_SYS_DIR}
  704. dbus-1 version: ${DBUS_VERSION}
  705. dbus-1 system socket: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
  706. C Compiler: ${CC}
  707. CFLAGS: ${CFLAGS}
  708. Enable GLIB: ${HAVE_GLIB}
  709. Enable GLIB GObject: ${HAVE_GOBJECT}
  710. Enable GObject Introspection: ${found_introspection}
  711. Enable GTK 2.0: ${HAVE_GTK}
  712. Enable GTK 3.0: ${HAVE_GTK3}
  713. Enable D-Bus: ${HAVE_DBUS}
  714. With XML: ${with_xml}
  715. Enable GDBM: ${HAVE_GDBM}
  716. Enable DBM: ${HAVE_DBM}
  717. Enable Python: ${HAVE_PYTHON}
  718. Enable pygtk: ${HAVE_PYGTK}
  719. Enable python-dbus: ${HAVE_PYTHON_DBUS}
  720. Enable QT3: ${HAVE_TQT}
  721. Enable QT4: ${HAVE_QT4}
  722. Enable Mono: ${HAVE_MONO}
  723. Enable Monodoc: ${HAVE_MONODOC}
  724. Distribution/OS: ${with_distro}
  725. User for avahi-daemon: ${AVAHI_USER}
  726. Group for avahi-daemon: ${AVAHI_GROUP}
  727. Priviliged access group for Avahi clients: ${AVAHI_PRIV_ACCESS_GROUP}
  728. User for avahi-autoipd: ${AVAHI_AUTOIPD_USER}
  729. Group for avahi-autoipd: ${AVAHI_AUTOIPD_GROUP}
  730. Enable chroot(): ${enable_chroot}
  731. Enable Linux inotify: ${have_inotify}
  732. Enable stack-smashing protection: ${enable_ssp}
  733. systemd unit directory: ${with_systemdsystemunitdir}
  734. "
  735. BUILD_DAEMON="no (You need libdaemon and expat/bsdxml!)"
  736. if test "x$HAVE_XML" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
  737. BUILD_DAEMON=yes
  738. fi
  739. BUILD_PYTHON="no (You need python, pygtk and python-dbus!)"
  740. if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" -a "x$HAVE_PYTHON" = "xyes" -a "x$HAVE_PYTHON_DBUS" = "xyes" -a "x$HAVE_PYGTK" = "xyes" ; then
  741. BUILD_PYTHON=yes
  742. fi
  743. BUILD_CLIENT="no (You need avahi-daemon and D-Bus!)"
  744. if test "x$BUILD_DAEMON" = "xyes" -a "x$HAVE_DBUS" = "xyes" ; then
  745. BUILD_CLIENT=yes
  746. fi
  747. if test "x$ENABLE_COMPAT_LIBDNS_SD" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
  748. ENABLE_COMPAT_LIBDNS_SD="no (You need libavahi-client!)"
  749. fi
  750. if test "x$ENABLE_COMPAT_HOWL" = "xyes" -a "x$BUILD_CLIENT" != "xyes" ; then
  751. ENABLE_COMPAT_HOWL="no (You need libavahi-client!)"
  752. fi
  753. if test "x$ENABLE_AUTOIPD" = "xyes" -a "x$HAVE_LIBDAEMON" != "xyes" ; then
  754. ENABLE_AUTOIPD="no (You need libdaemon!)"
  755. fi
  756. HAVE_GTK2OR3=no
  757. if test "x$HAVE_GTK" = "xyes" -o "x$HAVE_GTK3" = "xyes" ; then
  758. HAVE_GTK2OR3=yes
  759. fi
  760. BUILD_UI="no"
  761. if test "x$HAVE_GTK2OR3" = "xyes" -a "x$BUILD_CLIENT" = "xyes" ; then
  762. BUILD_UI="yes"
  763. fi
  764. BUILD_GOBJECT="no"
  765. if test "x$BUILD_CLIENT" = "xyes" -a "x$HAVE_GOBJECT" = "xyes" ; then
  766. BUILD_GOBJECT="yes"
  767. fi
  768. echo "\
  769. Building libavahi-tqt: ${HAVE_TQT}
  770. "