2021-03-25 17:24:45 -04:00
|
|
|
dnl Jami - configure.ac
|
2009-11-13 14:38:29 -05:00
|
|
|
|
2011-02-28 20:00:01 -05:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
2021-03-25 17:24:45 -04:00
|
|
|
AC_PREREQ([2.69])
|
2024-01-30 10:46:33 -05:00
|
|
|
AC_INIT([Jami Daemon],[15.2.0],[jami@gnu.org],[jami])
|
2013-06-10 17:31:31 -04:00
|
|
|
|
2021-04-06 21:45:33 -04:00
|
|
|
dnl Clear the implicit flags that default to '-g -O2', otherwise they
|
|
|
|
dnl take precedence over the values we set via the
|
|
|
|
dnl DAEMONCFLAGS/DAEMONCXXFLAGS variables below.
|
|
|
|
: ${CFLAGS=""}
|
|
|
|
: ${CXXFLAGS=""}
|
|
|
|
|
2023-02-06 01:45:52 -05:00
|
|
|
AC_COPYRIGHT([[Copyright (c) Savoir-faire Linux Inc. 2004-2023]])
|
2006-06-28 23:37:53 +00:00
|
|
|
AC_REVISION([$Revision$])
|
|
|
|
|
2014-10-06 15:54:26 -04:00
|
|
|
dnl Where to find configure files
|
2015-01-08 15:43:13 -05:00
|
|
|
AC_CONFIG_SRCDIR(src/ring_api.cpp)
|
2013-02-19 23:43:53 -05:00
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
2014-10-06 15:54:26 -04:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
AC_CANONICAL_BUILD
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
2024-05-22 10:02:19 -04:00
|
|
|
AM_INIT_AUTOMAKE([-Wno-portability subdir-objects foreign])
|
2013-02-19 13:24:24 -05:00
|
|
|
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # required by automake 1.12
|
2011-02-28 20:00:01 -05:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2009-04-02 16:34:46 -04:00
|
|
|
|
2009-10-09 14:56:25 -04:00
|
|
|
# Silent build by default. Use make V=1 to increase verbosity
|
2014-05-16 15:17:04 -04:00
|
|
|
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
2009-10-09 14:56:25 -04:00
|
|
|
|
2018-08-16 16:57:22 -04:00
|
|
|
dnl debug mode is default-disabled
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
AC_ARG_ENABLE([debug],
|
|
|
|
AS_HELP_STRING([--enable-debug],
|
|
|
|
[Build in debug mode, adds stricter warnings, disables optimization]))
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_debug" = "xyes"],
|
2022-07-13 12:09:58 -04:00
|
|
|
[DAEMONCFLAGS+=" -g -fno-omit-frame-pointer -Wall -Wextra -Wnon-virtual-dtor -Wno-deprecated -Wno-deprecated-declarations \
|
2021-05-28 12:23:27 -04:00
|
|
|
-Wno-unknown-pragmas -Wformat=2 -O0"
|
2022-07-13 12:09:58 -04:00
|
|
|
DAEMONCXXFLAGS+=" -g -fno-omit-frame-pointer -Wall -Wextra -Wnon-virtual-dtor -Wno-deprecated -Wno-deprecated-declarations \
|
2021-05-28 12:23:27 -04:00
|
|
|
-Wno-unknown-pragmas -Wformat=2 -O0"],
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
[DAEMONCFLAGS+=" -DNDEBUG=1 -O3"
|
2022-07-13 12:09:58 -04:00
|
|
|
DAEMONCXXFLAGS+=" -DNDEBUG=1 -O3 -Wno-deprecated"])
|
2018-08-16 16:57:22 -04:00
|
|
|
|
2023-10-11 15:43:10 -04:00
|
|
|
dnl Build using address sanitizer
|
|
|
|
AC_ARG_ENABLE([asan],
|
|
|
|
AS_HELP_STRING([--enable-asan],
|
|
|
|
[Enable address sanitization]))
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_asan" = "xyes"],
|
|
|
|
[DAEMONCXXFLAGS+=" -fsanitize=address -fno-omit-frame-pointer"
|
|
|
|
DAEMONLDFLAGS+=" -fsanitize=address"
|
|
|
|
AC_MSG_NOTICE([WARNING: Address sanitization enabled for libjami])], [])
|
|
|
|
|
2021-06-28 15:20:52 -04:00
|
|
|
AC_ARG_ENABLE([fuzzing],
|
|
|
|
AS_HELP_STRING([--enable-fuzzing],
|
|
|
|
[Build fuzzing tools]))
|
|
|
|
AM_CONDITIONAL([ENABLE_FUZZING], [test "x$enable_fuzzing" = "xyes"])
|
|
|
|
AM_COND_IF([ENABLE_FUZZING], [AC_CONFIG_FILES([test/fuzzing/Makefile])])
|
|
|
|
|
2021-07-13 09:37:04 -04:00
|
|
|
AC_ARG_ENABLE([agent],
|
|
|
|
AS_HELP_STRING([--enable-agent],
|
|
|
|
[Build agent]))
|
|
|
|
AM_CONDITIONAL([ENABLE_AGENT], [test "x$enable_agent" = "xyes"])
|
2022-05-20 14:02:19 -04:00
|
|
|
AM_COND_IF([ENABLE_AGENT],
|
|
|
|
[AC_CONFIG_FILES([test/agent/Makefile
|
2022-05-20 16:03:44 -04:00
|
|
|
test/agent/pre-inst-env:test/agent/build-aux/pre-inst-env.in
|
|
|
|
test/agent/scenarios/bulk-calls/run-scenario],
|
|
|
|
[chmod +x test/agent/pre-inst-env
|
|
|
|
chmod +x test/agent/scenarios/bulk-calls/run-scenario])])
|
2021-07-13 09:37:04 -04:00
|
|
|
|
2021-12-09 21:44:37 -05:00
|
|
|
AC_ARG_ENABLE([tracepoints], AS_HELP_STRING([--enable-tracepoints], [Enable tracepoints]))
|
|
|
|
|
2022-05-20 15:31:12 -04:00
|
|
|
AS_IF([test "x$enable_tracepoints" = "xyes"],
|
|
|
|
[AC_DEFINE(ENABLE_TRACEPOINTS, [], [Static tracepoints enabled])
|
|
|
|
AM_CONDITIONAL(ENABLE_TRACEPOINTS, true)],
|
|
|
|
[AM_CONDITIONAL(ENABLE_TRACEPOINTS, false)])
|
2021-12-09 21:44:37 -05:00
|
|
|
|
2011-02-28 20:00:01 -05:00
|
|
|
dnl Check for programs
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
2015-02-18 11:48:42 -05:00
|
|
|
AC_PROG_OBJCXX
|
2011-02-28 20:00:01 -05:00
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
2016-09-21 11:31:38 -04:00
|
|
|
AC_LANG(C++)
|
2011-02-28 20:00:01 -05:00
|
|
|
|
2014-10-06 15:54:26 -04:00
|
|
|
dnl
|
|
|
|
dnl Check the operating system
|
|
|
|
dnl
|
|
|
|
HAVE_WIN64="0"
|
2014-11-17 15:29:14 -05:00
|
|
|
HAVE_IOS="0"
|
2014-10-06 15:54:26 -04:00
|
|
|
HAVE_OSX="0"
|
|
|
|
|
|
|
|
case "${host_os}" in
|
|
|
|
"")
|
|
|
|
SYS=unknown
|
|
|
|
;;
|
|
|
|
linux*)
|
|
|
|
SYS=linux
|
|
|
|
# Necessary for linking .a to a .so
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
DAEMONLDFLAGS+=" -Wl,-Bsymbolic"
|
2015-01-14 12:31:11 -05:00
|
|
|
# Needed for plugin system
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
DAEMONLDFLAGS+=" -ldl"
|
2014-10-06 15:54:26 -04:00
|
|
|
;;
|
|
|
|
darwin*)
|
|
|
|
SYS=darwin
|
2016-05-31 19:16:19 -04:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
|
|
|
[[#import <TargetConditionals.h>
|
|
|
|
#if TARGET_OS_IPHONE == 0
|
|
|
|
#error this is not an IPHONE
|
|
|
|
#endif
|
|
|
|
]])],
|
|
|
|
[HAVE_IOS="1"],
|
|
|
|
[HAVE_OSX="1"])
|
2014-10-06 15:54:26 -04:00
|
|
|
;;
|
|
|
|
mingw32*)
|
|
|
|
SYS=mingw32
|
|
|
|
AC_CHECK_TOOL(WINDRES, windres, :)
|
|
|
|
AC_CHECK_TOOL(OBJCOPY, objcopy, :)
|
|
|
|
AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
|
|
|
|
AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
|
|
|
|
AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
|
|
|
|
AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
|
|
|
|
AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
|
|
|
|
AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
|
|
|
|
AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
|
|
|
|
AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
|
|
|
|
AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
|
|
|
|
AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
|
2015-05-04 16:50:37 -04:00
|
|
|
|
2016-03-21 11:51:22 -04:00
|
|
|
AC_DEFINE([WIN32_LEAN_AND_MEAN],[1], [Define to limit the scope of <windows.h>.])
|
2015-05-04 16:50:37 -04:00
|
|
|
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
DAEMONCPPFLAGS+=" -D_WIN32_WINNT=0x0601 -DWINVER=0x0601 -D__USE_MINGW_ANSI_STDIO=1"
|
|
|
|
DAEMONLDFLAGS+=" -Wl,--nxcompat -Wl,--dynamicbase"
|
2019-12-18 13:42:06 -05:00
|
|
|
LIBS+=" -lws2_32 -lwsock32 -lshlwapi"
|
2014-10-06 15:54:26 -04:00
|
|
|
ac_default_prefix="`pwd`/_win32"
|
|
|
|
DESTDIR="`pwd`/_win32/"
|
|
|
|
AC_SUBST(WINDOWS_ARCH)
|
|
|
|
AC_SUBST(PROGRAMFILES)
|
2016-03-22 11:53:02 -04:00
|
|
|
|
|
|
|
case "${host}" in
|
2021-03-25 23:07:23 -04:00
|
|
|
amd64*|x86_64*)
|
|
|
|
HAVE_WIN64="1"
|
|
|
|
;;
|
2016-03-22 11:53:02 -04:00
|
|
|
esac
|
2014-10-06 15:54:26 -04:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
SYS="${host_os}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
|
|
|
|
AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
|
|
|
|
AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
|
|
|
|
AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1")
|
2021-03-25 23:07:23 -04:00
|
|
|
AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
|
|
|
|
AM_CONDITIONAL(HAVE_IOS, test "${HAVE_IOS}" = "1")
|
2014-10-06 15:54:26 -04:00
|
|
|
|
2022-10-12 14:54:18 -04:00
|
|
|
AS_IF([test "${HAVE_OSX}" = "1"],
|
|
|
|
[DAEMONCFLAGS+=" -arch $ARCH"
|
|
|
|
DAEMONCXXFLAGS+=" -arch $ARCH"]
|
|
|
|
[])
|
|
|
|
|
2019-12-18 14:50:09 -05:00
|
|
|
AC_DEFINE([MSGPACK_DISABLE_LEGACY_NIL], [1], [msgpack])
|
|
|
|
|
2014-10-23 14:38:30 -04:00
|
|
|
dnl FIXME this should be deduced automatically
|
|
|
|
AC_DEFINE_UNQUOTED([HAVE_COREAUDIO],
|
2021-03-25 23:07:23 -04:00
|
|
|
`if test "${HAVE_OSX}" = "1" || test "${HAVE_IOS}" = "1"; \
|
|
|
|
then echo 1; else echo 0; fi`,
|
|
|
|
[Define if you have CoreAudio])
|
2014-10-23 14:38:30 -04:00
|
|
|
|
2014-10-06 15:54:26 -04:00
|
|
|
dnl Android is linux, but a bit different
|
|
|
|
AS_IF([test "$SYS" = linux],[
|
|
|
|
AC_MSG_CHECKING([for an Android system])
|
|
|
|
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
|
|
|
|
[[#ifndef __ANDROID__
|
|
|
|
# error Not Android
|
|
|
|
#endif
|
|
|
|
]],[[;]])
|
|
|
|
],[
|
|
|
|
HAVE_ANDROID="1"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
|
|
|
|
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
AS_IF([test "$SYS" = linux && test "${HAVE_ANDROID}" != "1"],
|
|
|
|
[DAEMONCPPFLAGS+=" -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]
|
|
|
|
[])
|
2019-01-06 13:56:15 +02:00
|
|
|
|
2014-10-28 13:50:27 -04:00
|
|
|
dnl override platform specific check for dependent libraries
|
|
|
|
dnl otherwise libtool linking of shared libraries will
|
|
|
|
dnl fail on anything other than pass_all.
|
|
|
|
AC_CACHE_VAL(lt_cv_deplibs_check_method,
|
|
|
|
[lt_cv_deplibs_check_method=pass_all])
|
|
|
|
|
2022-02-25 15:30:13 -05:00
|
|
|
LT_INIT([dlopen win32-dll shared static])
|
2009-07-03 16:40:46 -04:00
|
|
|
|
2011-08-08 16:22:25 -04:00
|
|
|
dnl Define C++ as default language
|
2014-10-28 13:50:27 -04:00
|
|
|
LT_LANG(C++)
|
|
|
|
|
|
|
|
lt_cv_deplibs_check_method=pass_all
|
2006-05-25 12:01:00 +00:00
|
|
|
|
2020-07-09 17:02:35 -04:00
|
|
|
dnl Check for C++17 support
|
|
|
|
AX_CXX_COMPILE_STDCXX(17,[ext],[mandatory])
|
2013-08-12 16:11:39 -04:00
|
|
|
|
2011-08-08 16:22:25 -04:00
|
|
|
dnl Check for header files
|
2022-02-04 11:46:53 -05:00
|
|
|
AC_CHECK_HEADERS([arpa/inet.h cxxabi.h fcntl.h libintl.h limits.h \
|
2014-11-06 19:05:25 -05:00
|
|
|
netdb.h netinet/in.h stdlib.h string.h \
|
|
|
|
sys/ioctl.h sys/socket.h sys/time.h unistd.h])
|
2011-08-08 16:22:25 -04:00
|
|
|
|
|
|
|
dnl Check for typedefs, structures, and compiler characteristics
|
|
|
|
AC_TYPE_PID_T
|
2006-06-28 23:37:53 +00:00
|
|
|
|
2014-09-30 16:24:20 -04:00
|
|
|
PKG_PROG_PKG_CONFIG()
|
2006-05-25 12:01:00 +00:00
|
|
|
|
2014-09-30 17:01:21 -04:00
|
|
|
dnl On some OS we need static linking
|
2021-03-25 23:07:23 -04:00
|
|
|
AS_IF([test -n "${PKG_CONFIG}"],
|
|
|
|
[AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin"],
|
|
|
|
[PKG_CONFIG="${PKG_CONFIG} --static"])])
|
2014-09-30 17:01:21 -04:00
|
|
|
|
2014-04-24 17:50:36 -04:00
|
|
|
dnl Check if we are using clang
|
|
|
|
AC_MSG_CHECKING([if compiling with clang])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([], [[
|
|
|
|
#ifndef __clang__
|
|
|
|
not clang
|
|
|
|
#endif
|
|
|
|
]])],
|
|
|
|
[CLANG=yes], [CLANG=no])
|
|
|
|
|
|
|
|
AC_MSG_RESULT([$CLANG])
|
2012-08-29 13:49:14 -04:00
|
|
|
|
2022-10-27 16:00:41 -04:00
|
|
|
dnl define LIBJAMI_BUILD because we are building libjami, not using it
|
daemon: Rename dring occurrences in code and file names to jamid.
Automated using the following commands:
$ mv src/{dring,jami}
$ git grep -l src/dring | xargs sed -i 's,src/dring,src/jami,g'
$ git grep -l '#include "dring/' | \
xargs sed -i 's,#include "dring/,#include "jami/,g'
$ git grep -l 'dring.h' | xargs sed -i 's,dring.h,jami.h,g'
And finally,
$ git grep -l 'dring' | xargs sed -i 's,dring,jami,g'
$ files=$(find -name '*dring*' | sort)
$ for f in $files; do mkdir -p "$(dirname "$f")"; \
mv "$f" "$(echo $f | sed 's/dring/jami/g')"; done
To resolve a bad renaming favorably:
$ git grep -l -i AlsaCarjami | \
xargs sed -i -E 's/([Aa])lsaCarjami/\1lsaCardRingtone/g'
The above renaming command is not perfect, so some hand-tuning was
required to complete it.
* src/manager.cpp (Manager::ManagerPimpl::retrieveConfigPath):
Preserve the dring.yml configuration file name, until we add something
to migrate (rename) it to jami.yml.
* man/dring.pod: Delete.
* bin/dbus/jamid.pod: Move to ...
* man/jamid.pod: here.
* bin/dbus/meson.build (jamid_targets): Normalize man section to the
pre-existing 1 and adjust accordingly.
* src/jami/def.h (dring_EXPORTS): Rename to ...
(jami_EXPORTS): ... this.
change-Id: I9828be6da9c711ab2f22c4d1b9539fea89d7b6fb
2021-06-15 11:03:11 -04:00
|
|
|
dnl if building shared library, define jami_EXPORTS
|
2018-08-20 13:48:44 -04:00
|
|
|
AC_MSG_CHECKING([if compiling shared library])
|
2022-10-27 16:00:41 -04:00
|
|
|
DAEMONCPPFLAGS+=" -fvisibility=hidden -DLIBJAMI_BUILD"
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
AS_IF([test "x$enable_shared" == "xyes"],
|
|
|
|
[RING_SHARED=yes
|
daemon: Rename dring occurrences in code and file names to jamid.
Automated using the following commands:
$ mv src/{dring,jami}
$ git grep -l src/dring | xargs sed -i 's,src/dring,src/jami,g'
$ git grep -l '#include "dring/' | \
xargs sed -i 's,#include "dring/,#include "jami/,g'
$ git grep -l 'dring.h' | xargs sed -i 's,dring.h,jami.h,g'
And finally,
$ git grep -l 'dring' | xargs sed -i 's,dring,jami,g'
$ files=$(find -name '*dring*' | sort)
$ for f in $files; do mkdir -p "$(dirname "$f")"; \
mv "$f" "$(echo $f | sed 's/dring/jami/g')"; done
To resolve a bad renaming favorably:
$ git grep -l -i AlsaCarjami | \
xargs sed -i -E 's/([Aa])lsaCarjami/\1lsaCardRingtone/g'
The above renaming command is not perfect, so some hand-tuning was
required to complete it.
* src/manager.cpp (Manager::ManagerPimpl::retrieveConfigPath):
Preserve the dring.yml configuration file name, until we add something
to migrate (rename) it to jami.yml.
* man/dring.pod: Delete.
* bin/dbus/jamid.pod: Move to ...
* man/jamid.pod: here.
* bin/dbus/meson.build (jamid_targets): Normalize man section to the
pre-existing 1 and adjust accordingly.
* src/jami/def.h (dring_EXPORTS): Rename to ...
(jami_EXPORTS): ... this.
change-Id: I9828be6da9c711ab2f22c4d1b9539fea89d7b6fb
2021-06-15 11:03:11 -04:00
|
|
|
DAEMONCPPFLAGS+=" -Djami_EXPORTS"],
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
[RING_SHARED=no])
|
2018-08-20 13:48:44 -04:00
|
|
|
AC_MSG_RESULT([$RING_SHARED])
|
|
|
|
|
2023-04-20 11:19:58 -04:00
|
|
|
DAEMONCPPFLAGS+=" -DASIO_STANDALONE -DMSGPACK_NO_BOOST"
|
2019-09-05 16:21:02 -04:00
|
|
|
|
2014-05-02 19:56:27 -04:00
|
|
|
dnl
|
|
|
|
dnl Check for the contrib directory
|
|
|
|
dnl
|
|
|
|
AC_ARG_WITH(contrib,
|
|
|
|
[AS_HELP_STRING([--with-contrib[=DIR]],
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
[search for 3rd party libraries in DIR/include and DIR/lib])])
|
2014-05-02 19:56:27 -04:00
|
|
|
AC_MSG_CHECKING([for 3rd party libraries path])
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"],
|
|
|
|
[CONTRIB_DIR="${srcdir}/contrib/${host}"
|
|
|
|
AS_IF([test ! -d "${CONTRIB_DIR}"],
|
|
|
|
[echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
|
|
|
|
CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
|
|
|
|
AS_IF([test ! -d "${CONTRIB_DIR}"],
|
|
|
|
[echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
|
|
|
|
CONTRIB_DIR=""
|
|
|
|
AC_MSG_RESULT([not found])])])],
|
|
|
|
[AS_IF([test "${with_contrib}" != "no"],
|
|
|
|
[CONTRIB_DIR="${with_contrib}"],
|
|
|
|
[CONTRIB_DIR=""
|
|
|
|
AC_MSG_RESULT([disabled])])])
|
|
|
|
|
|
|
|
AS_IF([test -n "${CONTRIB_DIR}"],
|
|
|
|
[AS_IF([test -d "${CONTRIB_DIR}/lib"],
|
|
|
|
[CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`],
|
|
|
|
[echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
|
|
|
|
CONTRIB_DIR=""
|
|
|
|
AC_MSG_RESULT([not usable])])])
|
|
|
|
|
|
|
|
AS_IF([test -n "${CONTRIB_DIR}"],
|
|
|
|
[AC_MSG_RESULT([${CONTRIB_DIR}])
|
|
|
|
export PATH=${CONTRIB_DIR}/bin:$PATH
|
|
|
|
|
|
|
|
DAEMONCPPFLAGS+=" -I${CONTRIB_DIR}/include -DPJ_AUTOCONF=1"
|
|
|
|
|
|
|
|
AS_IF([test "${HAVE_WIN64}" = "1"],
|
|
|
|
[DAEMONCPPFLAGS+=" -DPJ_WIN64=1"])
|
|
|
|
|
|
|
|
AS_IF([test "${SYS}" = "mingw32"],
|
|
|
|
[PKG_CONFIG_PATH_CUSTOM="${CONTRIB_DIR}/lib/pkgconfig:\
|
|
|
|
${CONTRIB_DIR}/lib64/pkgconfig"
|
|
|
|
AC_SUBST(PKG_CONFIG_PATH_CUSTOM)
|
|
|
|
export PKG_CONFIG_PATH_CUSTOM])
|
|
|
|
|
|
|
|
export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:\
|
|
|
|
${CONTRIB_DIR}/lib64/pkgconfig:$PKG_CONFIG_PATH"
|
|
|
|
DAEMONLDFLAGS+=" -L${CONTRIB_DIR}/lib"
|
|
|
|
|
|
|
|
AS_IF([test "${SYS}" = "darwin"],
|
|
|
|
[export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
|
|
|
|
export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"])],
|
|
|
|
[AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"],
|
|
|
|
[AC_MSG_ERROR([Third party libraries not found!])])])
|
2014-05-02 19:56:27 -04:00
|
|
|
AC_SUBST(CONTRIB_DIR)
|
|
|
|
|
2014-10-17 12:57:36 -04:00
|
|
|
dnl Add extras/tools to the PATH
|
|
|
|
TOOLS_DIR="${srcdir}/extras/tools/build/bin"
|
2021-03-25 23:07:23 -04:00
|
|
|
AS_IF([test -d "${TOOLS_DIR}"],
|
|
|
|
[TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
|
|
|
|
export PATH="${TOOLS_DIR}":$PATH])
|
2014-06-06 12:59:02 -04:00
|
|
|
|
2016-07-20 14:51:37 -04:00
|
|
|
dnl Check for zlib
|
|
|
|
PKG_CHECK_MODULES(ZLIB, zlib,, AC_MSG_ERROR([zlib not found]))
|
|
|
|
|
2019-10-09 17:06:36 -04:00
|
|
|
PKG_CHECK_MODULES(LIBGIT2, [libgit2 >= 1.1.0],, AC_MSG_ERROR([Missing libgit2 files]))
|
|
|
|
|
2014-06-06 12:59:02 -04:00
|
|
|
dnl Check for pjproject
|
2021-03-25 23:07:23 -04:00
|
|
|
PKG_CHECK_MODULES(PJPROJECT, libpjproject,,
|
|
|
|
AC_MSG_ERROR([Missing pjproject files]))
|
|
|
|
|
2021-07-13 09:37:04 -04:00
|
|
|
dnl Guile
|
|
|
|
AM_COND_IF([ENABLE_AGENT],
|
|
|
|
[PKG_CHECK_MODULES(GUILE, [guile-3.0 >= 3.0.7],, AC_MSG_ERROR([Missing guile files]))],)
|
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
PKG_CHECK_MODULES([YAMLCPP], [yaml-cpp >= 0.5.1],,
|
|
|
|
AC_MSG_ERROR([yaml-cpp not found]))
|
2014-06-06 12:59:02 -04:00
|
|
|
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
PKG_CHECK_MODULES([JSONCPP], [jsoncpp >= 1.6.5],
|
|
|
|
[DAEMONCPPFLAGS+=" ${JSONCPP_CFLAGS}"
|
|
|
|
DAEMONLDFLAGS+=" ${JSONCPP_LIBS}"],
|
|
|
|
AC_MSG_ERROR([jsoncpp not found]))
|
2012-08-29 13:49:14 -04:00
|
|
|
|
2014-10-06 15:54:26 -04:00
|
|
|
if test "${HAVE_ANDROID}" = "1"; then
|
2021-03-25 23:07:23 -04:00
|
|
|
dnl Check for OpenSL
|
|
|
|
AC_ARG_WITH([opensl],
|
|
|
|
AS_HELP_STRING([--without-opensl],
|
|
|
|
[Ignore presence of opensl and disable it]))
|
|
|
|
|
|
|
|
AS_IF([test "x$with_opensl" != "xno"],
|
|
|
|
[AC_CHECK_HEADER(["SLES/OpenSLES.h"],
|
|
|
|
[have_opensl=yes], [have_opensl=no])],
|
|
|
|
[have_opensl=no])
|
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED([HAVE_OPENSL],
|
|
|
|
`if test "x$have_opensl" = "xyes"; then echo 1; else echo 0; fi`,
|
|
|
|
[Define if you have OpenSL])
|
2014-06-17 18:28:24 -04:00
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([BUILD_OPENSL], test "x$have_opensl" = "xyes")
|
|
|
|
|
2015-12-15 14:18:58 -05:00
|
|
|
if test "${SYS}" = "linux"; then
|
2021-03-25 23:07:23 -04:00
|
|
|
dnl Check for alsa development package - name: libasound2-dev
|
|
|
|
ALSA_MIN_VERSION=1.0
|
|
|
|
AC_ARG_WITH([alsa],
|
2016-08-25 22:14:32 -04:00
|
|
|
[AS_HELP_STRING([--without-alsa], [disable support for alsa])],
|
|
|
|
[],
|
|
|
|
[with_alsa=yes])
|
2021-03-25 23:07:23 -04:00
|
|
|
AS_IF([test "x$with_alsa" = "xyes"],
|
|
|
|
[PKG_CHECK_MODULES(ALSA, alsa >= ${ALSA_MIN_VERSION},,
|
|
|
|
AC_MSG_ERROR([Missing alsa development files]))]);
|
2012-08-06 16:20:32 -04:00
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
AC_DEFINE_UNQUOTED([HAVE_ALSA],
|
|
|
|
`if test "x$with_alsa" = "xyes"; then echo 1; else echo 0; fi`,
|
|
|
|
[Define if you have alsa])
|
2015-05-07 16:46:55 -04:00
|
|
|
fi
|
2013-07-15 11:11:22 -04:00
|
|
|
AM_CONDITIONAL(BUILD_ALSA, test "x$with_alsa" = "xyes")
|
|
|
|
|
2012-08-29 13:49:14 -04:00
|
|
|
|
2015-12-15 14:18:58 -05:00
|
|
|
if test "${SYS}" = "linux"; then
|
2021-03-25 23:07:23 -04:00
|
|
|
dnl Check for pulseaudio development package - name: libpulse-dev
|
|
|
|
LIBPULSE_MIN_VERSION=0.9.15
|
|
|
|
AC_ARG_WITH([pulse],
|
2014-04-23 15:14:13 -04:00
|
|
|
[AS_HELP_STRING([--without-pulse], [disable support for pulseaudio])],
|
2012-08-29 13:49:14 -04:00
|
|
|
[],
|
|
|
|
[with_pulse=yes])
|
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
AS_IF([test "x$with_pulse" = "xyes"],
|
|
|
|
[PKG_CHECK_MODULES(PULSEAUDIO, libpulse >= ${LIBPULSE_MIN_VERSION},,
|
|
|
|
AC_MSG_ERROR([Missing pulseaudio development files]))]);
|
2008-10-08 16:32:30 -04:00
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
AC_DEFINE_UNQUOTED([HAVE_PULSE],
|
|
|
|
`if test "x$with_pulse" = "xyes"; then echo 1; else echo 0; fi`,
|
|
|
|
[Define if you have pulseaudio])
|
2015-05-07 16:46:55 -04:00
|
|
|
fi
|
2012-08-06 16:20:32 -04:00
|
|
|
AM_CONDITIONAL(BUILD_PULSE, test "x$with_pulse" = "xyes")
|
2012-06-07 11:21:47 -04:00
|
|
|
|
2014-02-13 19:00:28 -05:00
|
|
|
AC_ARG_WITH([jack],
|
2021-03-25 23:07:23 -04:00
|
|
|
AS_HELP_STRING([--without-jack], [Ignore presence of jack and disable it]))
|
2014-02-13 19:00:28 -05:00
|
|
|
|
|
|
|
AS_IF([test "x$with_jack" != "xno"],
|
2021-03-25 23:07:23 -04:00
|
|
|
[PKG_CHECK_MODULES(JACK, jack, [have_jack=yes], [have_jack=no])],
|
|
|
|
[have_jack=no])
|
2014-02-13 19:00:28 -05:00
|
|
|
|
|
|
|
AS_IF([test "x$have_jack" = "xyes"],,
|
2021-03-25 23:07:23 -04:00
|
|
|
[AS_IF([test "x$with_jack" = "xyes"],
|
|
|
|
[AC_MSG_ERROR([jack requested but not found])])])
|
2014-02-13 19:00:28 -05:00
|
|
|
|
2015-03-12 17:00:51 -04:00
|
|
|
dnl check for libportaudio
|
|
|
|
AS_IF([test "${SYS}" = "mingw32"],[
|
|
|
|
AC_ARG_WITH([portaudio], [AS_HELP_STRING([--without-portaudio],
|
2021-03-25 23:07:23 -04:00
|
|
|
[disable support for portaudio])], [], [with_portaudio=yes])])
|
2015-03-12 17:00:51 -04:00
|
|
|
AS_IF([test "x$with_portaudio" = "xyes"],
|
2021-03-25 23:07:23 -04:00
|
|
|
[PKG_CHECK_MODULES(PORTAUDIO, [portaudio-2.0],
|
|
|
|
[AC_DEFINE([HAVE_PORTAUDIO], 1, [Define if you have portaudio])],
|
|
|
|
[AC_MSG_ERROR([Missing libportaudio development files])])])
|
2016-09-12 10:49:24 -04:00
|
|
|
|
2015-03-12 17:00:51 -04:00
|
|
|
AM_CONDITIONAL(BUILD_PORTAUDIO, test "x$with_portaudio" = "xyes")
|
|
|
|
AM_CONDITIONAL(HAVE_PORTAUDIO, test "x$with_portaudio" = "xyes")
|
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
AC_DEFINE_UNQUOTED([HAVE_JACK],
|
|
|
|
`if test "x$have_jack" = "xyes"; then echo 1; else echo 0; fi`,
|
|
|
|
[Define if you have jack])
|
2014-02-13 19:00:28 -05:00
|
|
|
AM_CONDITIONAL(BUILD_JACK, test "x$have_jack" = "xyes")
|
|
|
|
|
2013-03-06 16:34:56 -05:00
|
|
|
dnl Coverage is default-disabled
|
|
|
|
AC_ARG_ENABLE([coverage], AS_HELP_STRING([--enable-coverage], [Enable coverage]))
|
|
|
|
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
AS_IF([test "x$enable_coverage" = "xyes"],
|
|
|
|
[DAEMONCXXFLAGS+=" --coverage"
|
|
|
|
DAEMONLDFLAGS+=" --coverage"])
|
2012-08-29 13:49:14 -04:00
|
|
|
|
2023-05-21 17:29:37 +03:00
|
|
|
# SDBUSCPP
|
|
|
|
dnl Check for sdbus-c++, the C++ bindings for D-Bus
|
2014-05-23 14:53:49 -04:00
|
|
|
AC_ARG_WITH([dbus],
|
2021-03-25 23:07:23 -04:00
|
|
|
[AS_HELP_STRING([--without-dbus], [disable support for dbus])],
|
|
|
|
[],
|
|
|
|
[with_dbus=yes])
|
2021-03-31 22:05:43 -04:00
|
|
|
AS_IF([test "x$with_dbus" = "xyes"],
|
2023-08-17 22:02:27 -04:00
|
|
|
[PKG_CHECK_MODULES(SDBUSCPP, [sdbus-c++],,
|
|
|
|
AC_MSG_ERROR([sdbus-c++ not found]))
|
2014-11-18 14:40:10 -05:00
|
|
|
|
2021-03-31 22:05:43 -04:00
|
|
|
AC_CONFIG_FILES([bin/dbus/Makefile])
|
2016-04-22 13:39:07 -04:00
|
|
|
|
2023-08-17 22:02:27 -04:00
|
|
|
AC_PATH_PROG([SDBUSCPP_XML2CPP], [sdbus-c++-xml2cpp],
|
2021-03-31 22:05:43 -04:00
|
|
|
[AC_MSG_ERROR([dbusxx-xml2cpp not found])])
|
2014-05-23 14:53:49 -04:00
|
|
|
|
2021-03-31 22:05:43 -04:00
|
|
|
AM_CONDITIONAL(RING_DBUS, true)],
|
|
|
|
[TESTS= $(check_PROGRAMS)
|
|
|
|
AM_CONDITIONAL(RING_DBUS, false)]);
|
2014-05-23 14:53:49 -04:00
|
|
|
|
2018-12-06 10:17:39 -05:00
|
|
|
dnl name service is default-enabled
|
2021-03-25 23:07:23 -04:00
|
|
|
AC_ARG_ENABLE([ringns], AS_HELP_STRING([--disable-ringns],
|
|
|
|
[Enable Name Service]))
|
2021-06-28 15:11:27 -04:00
|
|
|
AM_CONDITIONAL([RINGNS], test "x$enable_ringns" != "xno")
|
2021-03-25 23:07:23 -04:00
|
|
|
AC_DEFINE_UNQUOTED([HAVE_RINGNS],
|
|
|
|
`if test "x$enable_ringns" != "xno"; then echo 1; else echo 0; fi`,
|
|
|
|
[Define if you use the Name Service])
|
2021-06-28 15:11:27 -04:00
|
|
|
AM_COND_IF([RINGNS],
|
|
|
|
[PKG_CHECK_MODULES(LIBCRYPTO, libcrypto,,
|
|
|
|
AC_MSG_ERROR([Missing libcrypto development files]))
|
|
|
|
PKG_CHECK_MODULES(LIBSSL, libssl,,
|
|
|
|
AC_MSG_ERROR([Missing libssl development files]))],
|
|
|
|
[]);
|
2016-10-23 18:29:47 -04:00
|
|
|
|
2018-12-06 10:17:39 -05:00
|
|
|
dnl nodejs module
|
|
|
|
AC_ARG_WITH([nodejs], AS_HELP_STRING([--with-nodejs], [Enable NodeJS module]))
|
2021-06-28 15:11:27 -04:00
|
|
|
AM_CONDITIONAL(ENABLE_NODEJS, [test "x$with_nodejs" = "xyes"])
|
|
|
|
AM_COND_IF([ENABLE_NODEJS],
|
2021-03-25 23:07:23 -04:00
|
|
|
[AC_PATH_PROG(SWIG, swig, "")
|
|
|
|
AS_AC_EXPAND(SBINDIR, $sbindir)
|
|
|
|
AC_SUBST(SBINDIR)
|
2021-06-28 15:11:27 -04:00
|
|
|
AC_CONFIG_FILES([bin/nodejs/Makefile])])
|
2016-08-25 22:14:32 -04:00
|
|
|
|
2015-01-14 12:31:11 -05:00
|
|
|
dnl Check for libav
|
2021-03-25 23:07:23 -04:00
|
|
|
PKG_CHECK_MODULES(LIBAVUTIL, libavutil >= 54.31.100,,
|
|
|
|
AC_MSG_ERROR([Missing libavutil development files]))
|
2015-01-14 12:31:11 -05:00
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
PKG_CHECK_MODULES(LIBAVCODEC, libavcodec >= 56.60.100,,
|
|
|
|
AC_MSG_ERROR([Missing libavcodec development files]))
|
2017-12-15 14:54:20 -05:00
|
|
|
LIBAVCODEC_CFLAGS="${LIBAVCODEC_CFLAGS} -D__STDC_CONSTANT_MACROS"
|
2015-01-14 12:31:11 -05:00
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
PKG_CHECK_MODULES(LIBAVFORMAT, libavformat >= 56.40.101,,
|
|
|
|
AC_MSG_ERROR([Missing libavformat development files]))
|
2015-01-14 12:31:11 -05:00
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
PKG_CHECK_MODULES(LIBAVDEVICE, libavdevice >= 56.4.100,,
|
|
|
|
AC_MSG_ERROR([Missing libavdevice development files]))
|
2015-01-14 12:31:11 -05:00
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
PKG_CHECK_MODULES(LIBAVFILTER, libavfilter >= 5.40.101,,
|
|
|
|
AC_MSG_ERROR([Missing libavfilter development files]))
|
2018-05-11 11:06:38 -05:00
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
PKG_CHECK_MODULES(LIBSWSCALE, libswscale >= 3.1.101,,
|
|
|
|
AC_MSG_ERROR([Missing libswscale development files]))
|
2015-01-14 12:31:11 -05:00
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
PKG_CHECK_MODULES(LIBSWRESAMPLE, libswresample >= 1.2.101,,
|
|
|
|
AC_MSG_ERROR([Missing libswresample development files]))
|
2018-08-01 16:52:39 -04:00
|
|
|
|
2020-05-29 16:36:45 -04:00
|
|
|
dnl Jami Plugin is default-enabled
|
|
|
|
AC_ARG_ENABLE([plugin], AS_HELP_STRING([--disable-plugin], [Disable plugin]))
|
|
|
|
AS_IF([test "x$enable_plugin" != "xno"],
|
2021-03-25 23:07:23 -04:00
|
|
|
[AC_DEFINE(ENABLE_PLUGIN, [], [Jami Plugin support enabled])
|
|
|
|
AM_CONDITIONAL(ENABLE_PLUGIN, true)
|
|
|
|
AS_IF([test "$SYS" = linux],
|
|
|
|
[PKG_CHECK_MODULES([ARCHIVE], [libarchive >= 3.0],,
|
|
|
|
AC_MSG_ERROR([libarchive not found]))],
|
2021-04-29 10:11:38 -04:00
|
|
|
[AS_IF([test "$SYS" = darwin],
|
|
|
|
[PKG_CHECK_MODULES([MINIZIP], [minizip >= 3.0.0],,
|
|
|
|
AC_MSG_ERROR([libminizip not found]))],
|
|
|
|
[])]
|
|
|
|
)],
|
2021-03-25 23:07:23 -04:00
|
|
|
[AM_CONDITIONAL(ENABLE_PLUGIN, false)]);
|
2020-05-29 16:36:45 -04:00
|
|
|
|
2014-07-04 18:01:24 -04:00
|
|
|
dnl Video is default-enabled
|
|
|
|
AC_ARG_ENABLE([video], AS_HELP_STRING([--disable-video], [Disable video]))
|
2011-06-09 11:49:41 -04:00
|
|
|
|
2014-07-04 18:01:24 -04:00
|
|
|
AS_IF([test "x$enable_video" != "xno"],
|
2021-03-25 23:07:23 -04:00
|
|
|
[AC_DEFINE(ENABLE_VIDEO, [], [Video support enabled])
|
|
|
|
AM_CONDITIONAL(ENABLE_VIDEO, true)
|
|
|
|
AS_IF([test "$SYS" = linux && test -z "${HAVE_ANDROID_FALSE}"],
|
|
|
|
[PKG_CHECK_MODULES(UDEV, libudev,,
|
|
|
|
AC_MSG_ERROR([Missing libudev development files]))],
|
|
|
|
[])],
|
|
|
|
[AM_CONDITIONAL(ENABLE_VIDEO, false)]);
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([accel],
|
|
|
|
AS_HELP_STRING([--disable-accel],
|
|
|
|
[Disable all hardware accelerations (enabled by default)]))
|
|
|
|
AS_IF([test "x$enable_video" != "xno" -a "x$enable_accel" != "xno"],
|
2018-12-06 10:17:39 -05:00
|
|
|
dnl if new hwaccel api is found, activate hardware accel
|
2017-12-29 14:06:17 -05:00
|
|
|
dnl prefix needs to be different from the one above
|
2021-03-25 23:07:23 -04:00
|
|
|
[PKG_CHECK_MODULES(AVUTIL, libavutil >= 55.75.100,
|
|
|
|
[ring_accel="yes"
|
|
|
|
AC_DEFINE([RING_ACCEL], [1], [Hardware acceleration is enabled])
|
|
|
|
AS_IF([test "${SYS}" = "darwin"],
|
|
|
|
[AC_CHECK_HEADER([VideoToolbox/VideoToolbox.h],
|
|
|
|
[AC_CHECK_HEADER([libavcodec/videotoolbox.h],
|
|
|
|
[ring_vt="yes"
|
|
|
|
AC_DEFINE([ENABLE_VIDEOTOOLBOX], [1],
|
|
|
|
[Defined if videotoolbox is available])])])])],
|
|
|
|
[])])
|
2016-11-01 15:41:59 -04:00
|
|
|
AM_CONDITIONAL([RING_ACCEL], [test "x${ring_accel}" = "xyes"])
|
|
|
|
|
|
|
|
dnl check for GnuTLS
|
2024-01-30 16:38:22 -05:00
|
|
|
PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.7.4], [], AC_MSG_ERROR([gnutls not found]))
|
2021-06-13 16:57:10 -04:00
|
|
|
PKG_CHECK_MODULES([NETTLE], [nettle >= 3.0.0], [], AC_MSG_ERROR([nettle not found]))
|
2012-07-26 17:07:39 -04:00
|
|
|
|
|
|
|
# PTHREAD
|
2021-03-25 23:07:23 -04:00
|
|
|
# required dependency: libxpat
|
2012-03-20 14:30:18 -04:00
|
|
|
AX_PTHREAD
|
2010-06-30 12:54:49 -04:00
|
|
|
|
2011-06-09 11:48:17 -04:00
|
|
|
dnl Check for libcppunit-dev
|
|
|
|
CPPUNIT_MIN_VERSION=1.12
|
2021-03-25 23:07:23 -04:00
|
|
|
PKG_CHECK_MODULES(CPPUNIT, cppunit >= ${CPPUNIT_MIN_VERSION},
|
|
|
|
AM_CONDITIONAL(BUILD_TEST, test 1 = 1 ),
|
|
|
|
AM_CONDITIONAL(BUILD_TEST, test 0 = 1 ))
|
2007-08-28 12:02:49 -04:00
|
|
|
|
2012-07-26 13:55:49 -04:00
|
|
|
|
2012-07-26 17:07:39 -04:00
|
|
|
# SPEEX CODEC
|
2021-03-25 23:07:23 -04:00
|
|
|
# required dependency: libspeex
|
2010-11-04 15:44:21 -04:00
|
|
|
dnl Check for libspeex
|
2008-02-20 09:39:25 -05:00
|
|
|
AC_ARG_WITH([speex],
|
2021-03-25 23:07:23 -04:00
|
|
|
[AS_HELP_STRING([--without-speex], [disable support for speex codec])],
|
|
|
|
[],
|
|
|
|
[with_speex=yes])
|
2008-02-20 09:39:25 -05:00
|
|
|
|
2014-10-10 16:06:10 -04:00
|
|
|
AS_IF([test "x$with_speex" != xno], [PKG_CHECK_MODULES([SPEEX], [speex])])
|
2012-03-20 14:30:18 -04:00
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
AC_DEFINE_UNQUOTED([HAVE_SPEEX],
|
|
|
|
`if test "x$with_speex" = "xyes"; then echo 1; else echo 0; fi`,
|
|
|
|
[Define if you have libspeex])
|
2010-11-04 15:44:21 -04:00
|
|
|
AM_CONDITIONAL(BUILD_SPEEX, test "x$with_speex" = "xyes" )
|
2009-02-17 16:23:05 -05:00
|
|
|
|
2012-07-26 17:07:39 -04:00
|
|
|
# SPEEX DSP
|
2021-03-25 23:07:23 -04:00
|
|
|
# required dependency: libspeexdsp
|
2010-06-16 17:39:45 -04:00
|
|
|
dnl check in case the libspeexdsp is not installed
|
2012-07-26 13:55:49 -04:00
|
|
|
AC_ARG_WITH([speexdsp],
|
2021-03-25 23:07:23 -04:00
|
|
|
[AS_HELP_STRING([--without-speexdsp],
|
|
|
|
[disable support for speexdp Noise Suppression and Automatic Gain Control])],
|
|
|
|
[],
|
|
|
|
[with_speexdsp=yes])
|
|
|
|
|
|
|
|
AS_IF([test "x$with_speexdsp" != xno],
|
|
|
|
[PKG_CHECK_MODULES([SPEEXDSP], [speexdsp])])
|
|
|
|
AC_DEFINE_UNQUOTED([HAVE_SPEEXDSP],
|
|
|
|
`if test "x$with_speexdsp" = "xyes"; then echo 1; else echo 0; fi`,
|
|
|
|
[Define if you have libspeexdsp])
|
2012-07-26 13:55:49 -04:00
|
|
|
AM_CONDITIONAL(BUILD_SPEEXDSP, test "x$with_speexdsp" = "xyes" )
|
|
|
|
|
2021-03-15 16:16:34 -04:00
|
|
|
# WEBRTC AUDIO PROCESSING
|
|
|
|
if test "${SYS}" = "linux"; then
|
2021-03-25 23:07:23 -04:00
|
|
|
dnl Check for webrtc-audio-processing development package
|
|
|
|
dnl - name: libwebrtc-audio-processing-dev
|
|
|
|
AC_ARG_WITH([webrtcap],
|
2021-04-16 08:37:23 -04:00
|
|
|
[AS_HELP_STRING([--without-webrtcap],
|
2021-03-25 23:07:23 -04:00
|
|
|
[disable support for webrtc-audio-processing])],
|
|
|
|
[], [with_webrtc_ap=yes])
|
|
|
|
|
|
|
|
AS_IF([test "x$with_webrtc_ap" = "xyes"],
|
2021-12-06 13:55:04 -05:00
|
|
|
[PKG_CHECK_MODULES(WEBRTC, [webrtc-audio-processing >= 0.3],
|
2021-03-25 23:07:23 -04:00
|
|
|
[AC_DEFINE([HAVE_WEBRTC_AP], 1,
|
|
|
|
[Define if you have webrtc-audio-processing])],
|
|
|
|
[AC_MSG_WARN([Missing webrtc-audio-processing development files])])])
|
2021-03-15 16:16:34 -04:00
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([HAVE_WEBRTC_AP], test "x$with_webrtc_ap" = "xyes")
|
|
|
|
|
2016-07-04 14:19:04 -04:00
|
|
|
dnl check for openDHT
|
2022-01-03 16:12:47 -05:00
|
|
|
PKG_CHECK_MODULES([OPENDHT], [opendht >= 2.3.2],,
|
2021-03-31 20:23:08 -04:00
|
|
|
AC_MSG_FAILURE([Missing OpenDHT]))
|
2014-09-04 17:33:05 -04:00
|
|
|
|
2023-07-21 14:34:22 -04:00
|
|
|
PKG_CHECK_MODULES([DHTNET], [dhtnet],,
|
|
|
|
AC_MSG_FAILURE([Missing DhtNet]))
|
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
PKG_CHECK_MODULES([SECP256K1], [libsecp256k1 >= 0.1],,
|
|
|
|
AC_MSG_FAILURE([Missing secp256k1]))
|
2016-09-21 11:31:38 -04:00
|
|
|
|
2022-10-17 14:38:49 -04:00
|
|
|
PKG_CHECK_MODULES([FMT], [fmt >= 7.0],,
|
2021-04-12 13:05:03 -04:00
|
|
|
AC_MSG_FAILURE([Missing {fmt}]))
|
|
|
|
|
2015-02-04 15:38:37 -05:00
|
|
|
# LIBUPNP
|
|
|
|
dnl check for libupnp
|
2014-12-09 10:18:36 -05:00
|
|
|
AC_ARG_WITH([upnp], [AS_HELP_STRING([--without-upnp],
|
2021-03-25 23:07:23 -04:00
|
|
|
[disable support for upnp])], [], [with_upnp=yes])
|
2014-12-09 10:18:36 -05:00
|
|
|
|
2015-02-04 15:38:37 -05:00
|
|
|
AS_IF([test "x$with_upnp" = "xyes"],
|
2021-03-25 23:07:23 -04:00
|
|
|
[PKG_CHECK_MODULES(LIBUPNP, [libupnp],
|
|
|
|
[AC_DEFINE([HAVE_LIBUPNP], 1, [Define if you have libupnp])],
|
|
|
|
[AC_MSG_WARN([Missing libupnp development files])
|
|
|
|
AC_DEFINE([HAVE_LIBUPNP], 0, [Define if you have libupnp])])])
|
2019-06-03 12:23:00 -04:00
|
|
|
AM_CONDITIONAL([BUILD_PUPNP], test "x$with_upnp" = "xyes")
|
2012-07-26 13:55:49 -04:00
|
|
|
|
2016-07-25 15:25:17 -04:00
|
|
|
# LIBNATPMP
|
|
|
|
dnl check for libnatpmp
|
|
|
|
AC_ARG_WITH([natpmp], [AS_HELP_STRING([--without-natpmp],
|
2021-03-25 23:07:23 -04:00
|
|
|
[disable support for NAT-PMP])], [], [with_natpmp=yes])
|
2016-07-25 15:25:17 -04:00
|
|
|
|
|
|
|
AS_IF([test "x$with_natpmp" != xno],
|
2021-03-25 23:07:23 -04:00
|
|
|
[AC_CHECK_HEADER([natpmp.h],
|
|
|
|
AC_CHECK_LIB([natpmp], [initnatpmp], [], [with_natpmp=no]),
|
|
|
|
[AC_MSG_WARN([Unable to find the libnatpmp headers
|
|
|
|
(you may need to install the dev package). You may use
|
|
|
|
--without-natpmp to compile without NAT-PMP support.]);
|
|
|
|
with_natpmp=no])],
|
|
|
|
[])
|
2016-07-25 15:25:17 -04:00
|
|
|
|
2021-03-25 23:07:23 -04:00
|
|
|
AC_DEFINE_UNQUOTED([HAVE_LIBNATPMP],
|
|
|
|
`if test "x$with_natpmp" != xno; then echo 1; else echo 0; fi`,
|
|
|
|
[Define if you have libnatpmp])
|
2023-03-05 11:08:35 -05:00
|
|
|
AM_CONDITIONAL([BUILD_NATPMP], test "x$with_natpmp" != "xno")
|
2016-07-25 15:25:17 -04:00
|
|
|
|
2021-11-05 12:19:46 -04:00
|
|
|
# SHM
|
|
|
|
dnl check for shm
|
2022-06-22 16:27:06 -04:00
|
|
|
AS_IF([test "x$with_dbus" == xyes],
|
|
|
|
AC_DEFINE([ENABLE_SHM], [1], [Define if you have shared memory support]))
|
2015-03-13 11:45:37 -04:00
|
|
|
|
2021-12-09 21:44:37 -05:00
|
|
|
# LTTNG
|
|
|
|
AM_COND_IF([ENABLE_TRACEPOINTS],
|
|
|
|
[PKG_CHECK_MODULES(LTTNG, [lttng-ust >= 2.13],, AC_MSG_ERROR([Missing lttng-ust]))
|
|
|
|
PKG_CHECK_MODULES(LIBURCU, [liburcu >= 0.13.1],, AC_MSG_ERROR([Missng liburcu]))])
|
|
|
|
|
2012-07-26 17:07:39 -04:00
|
|
|
# DOXYGEN
|
|
|
|
# required dependency(ies): doxygen
|
2008-03-03 09:02:41 -05:00
|
|
|
# check for doxygen, mostly stolen from http://log4cpp.sourceforge.net/
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
AC_DEFUN([BB_ENABLE_DOXYGEN],
|
2021-03-25 23:07:23 -04:00
|
|
|
[AC_ARG_ENABLE(doxygen,
|
|
|
|
[AS_HELP_STRING([--enable-doxygen],
|
|
|
|
[enable documentation generation with doxygen (disabled by default)])])
|
|
|
|
AC_ARG_ENABLE(dot,
|
|
|
|
[AS_HELP_STRING([--enable-dot],
|
|
|
|
[use 'dot' to generate graphs in doxygen (auto)])])
|
|
|
|
if test "x$enable_doxygen" = xyes; then
|
|
|
|
AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
|
|
|
|
test x$DOXYGEN = x && AC_MSG_ERROR([could not find doxygen])
|
|
|
|
AC_PATH_PROG(DOT, dot, , $PATH)
|
|
|
|
test x$DOT = x -a "x$enable_dot" = xyes && AC_MSG_ERROR([could not find dot])
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(ENABLE_DOXYGEN, test "x$DOXYGEN" != "x")])
|
2012-07-26 13:55:49 -04:00
|
|
|
|
2012-08-29 13:49:14 -04:00
|
|
|
# Actually perform the doxygen check
|
|
|
|
BB_ENABLE_DOXYGEN
|
2012-03-20 16:46:44 -04:00
|
|
|
|
2012-08-29 13:49:14 -04:00
|
|
|
AC_CONFIG_FILES([Makefile \
|
2014-11-13 16:09:50 -05:00
|
|
|
bin/Makefile \
|
2012-08-29 13:49:14 -04:00
|
|
|
src/Makefile \
|
|
|
|
ringtones/Makefile \
|
2017-06-20 20:14:47 -04:00
|
|
|
test/Makefile\
|
2022-09-07 10:57:11 -04:00
|
|
|
test/sip/Makefile
|
2017-08-17 16:43:18 -04:00
|
|
|
test/unitTest/Makefile \
|
2012-08-29 13:49:14 -04:00
|
|
|
man/Makefile \
|
|
|
|
doc/Makefile \
|
2022-08-19 19:56:36 -04:00
|
|
|
doc/doxygen/Makefile
|
|
|
|
jami.pc])
|
2012-03-20 16:46:44 -04:00
|
|
|
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
dnl Transfer the Automake variables set here to Makefile.in.
|
|
|
|
echo DAEMONCPPFLAGS=$DAEMONCPPFLAGS
|
2023-03-03 09:30:00 -05:00
|
|
|
AS_IF([test "${HAVE_OSX}" = "1"],
|
|
|
|
[CXXFLAGS="$DAEMONCXXFLAGS"
|
|
|
|
OBJCXX="$CXX $DAEMONCXXFLAGS"
|
|
|
|
OBJCXXFLAG="$CXX $DAEMONCXXFLAGS"]
|
|
|
|
[])
|
configure.ac: Do not set user variables.
The CFLAGS, CXXFLAGS, LDFLAGS and other variables intended to be
overridden by the user should not directly be set by the package.
This change uses one of the approaches recommended by the Autoconf and
Automake manuals, which is to use custom variables to accumulate flags
in the configure script and add them to the make targets they apply
to. This has the benefit of not cluttering the flags used during the
Autoconf tests, which has proved problematic (see the previous commit
for a demonstration).
* configure.ac: Replace CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS by
DAEMONCFLAGS, DAEMONCXXFLAGS, DAEMONCPPFLAGS and DAEMONLDFLAGS,
respectively.
Use these custom variables as the default values of AM_CFLAGS,
AM_CXXFLAGS, AM_CPPFLAGS and AM_LDFLAGS, respectively. Remove an
extraneous check on jsoncpp.
* bin/Makefile.am (ringcli_CXXFLAGS): Honor the the AM_CXXFLAGS variable.
globals.mk: Extend rather than override the AM_CPPFLAGS variable.
* src/Makefile.am (libring_la_LDFLAGS): Honor AM_LDFLAGS.
(libring_la_CFLAGS): Honor AM_CFLAGS.
(libring_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Honor AM_CXXFLAGS.
* src/im/Makefile.am (libim_la_CXXFLAGS): Remove variable.
* src/jamidht/Makefile.am (libringacc_la_CXXFLAGS): Likewise.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS): Honor
AM_CXXFLAGS.
(libaudio_la_LDFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/audio/coreaudio/Makefile.am (libcoreaudiolayer_la_CXXFLAGS):
Likewise.
* src/media/video/Makefile.am (libvideo_la_CFLAGS): Honor the
AM_CFLAGS variable.
(libvideo_la_CXXFLAGS): Honor the AM_CXXFLAGS variable.
* src/media/video/v4l2/Makefile.am (AM_CXXFLAGS): Extend rather than
override.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Honor the
AM_CXXFLAGS variable.
* src/security/Makefile.am (libsecurity_la_CXXFLAGS): Likewise.
* src/sip/Makefile.am (libsiplink_la_CXXFLAGS): Likewise.
* src/upnp/Makefile.am (libupnpcontrol_la_CXXFLAGS): Remove variable.
* src/upnp/protocol/Makefile.am (libupnpprotocol_la_CXXFLAGS): Likewise.
* src/upnp/protocol/natpmp/Makefile.am (libnat_pmp_la_CXXFLAGS): Likewise.
* src/upnp/protocol/pupnp/Makefile.am (libpupnp_la_CXXFLAGS): Likewise.
* test/sip/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Extend rather than override.
* test/unitTest/Makefile.am (AM_CXXFLAGS, AM_LDFLAGS): Likewise.
GitLab: #487
Change-Id: I18be9d812159f8156efb9f7849e7eac6d4c6b3ca
squash! configure.ac: Do not set user variables.
Change-Id: I1146ea15d6fb75fe53d3cbdd782e981c933e82a6
2021-03-25 23:17:17 -04:00
|
|
|
AC_SUBST([AM_CPPFLAGS], [$DAEMONCPPFLAGS])
|
|
|
|
AC_SUBST([AM_CFLAGS], [$DAEMONCFLAGS])
|
|
|
|
AC_SUBST([AM_CXXFLAGS], [$DAEMONCXXFLAGS])
|
|
|
|
AC_SUBST([AM_LDFLAGS], [$DAEMONLDFLAGS])
|
|
|
|
|
2006-06-28 23:37:53 +00:00
|
|
|
# Go!
|
2011-08-08 16:22:25 -04:00
|
|
|
AC_OUTPUT
|