1. 01 Nov, 2017 2 commits
  2. 30 Oct, 2017 1 commit
  3. 24 May, 2017 1 commit
  4. 03 May, 2017 3 commits
    • Idar Tollefsen's avatar
      configure.in: Removes superfluous -fPIC from LDFLAGS. · 475af06e
      Idar Tollefsen authored
      Since the compiler is used as the link driver, CFLAGS is included on the
      link line. Since -fPIC is already part of CFLAGS, having it in LDFLAGS as
      well just duplicates it on the link line.
      475af06e
    • Idar Tollefsen's avatar
      configure.in: Adds support for EXTRA_CFLAGS to be appended to CFLAGS. · ba304fcb
      Idar Tollefsen authored
      If the user sets CFLAGS on the command line, configure will not set its
      own set of default flags. Which makes sense. It's annoying when configure
      scripts thinks they know better and overrides a user's optimization or
      warning flags.
      
      However, this also makes it impossible to just add something to CFLAGS
      short of manually inspecting and copying the defaults on the command line
      along with whatever flag(s) the user wanted to add.
      
      This fixes it by adding support for EXTRA_CFLAGS that will be appended
      to CFLAGS after all other checks are done.
      
      This also reorders some of the program checks to get the "influential
      environment variables" section of `configure --help` to look right and
      removes a rouge "dnl" inside a comment block left by accident by a
      earlier reformatting change
      ba304fcb
    • Idar Tollefsen's avatar
      configure.in: Require- and unconditionally use- AM_PROG_AR. · 38e50768
      Idar Tollefsen authored
      The problem was discovered as part of issue #296.
      
      AM_PROG_AR was introduced in Automake 1.11.2. The m4_ifdef() check around
      its use was there to make it possible to regenerate the `configure`
      script with `autoreconf` also on systems with older Automake
      versions. However, `ar` is required and not running AM_PROG_AR will lead
      to build failures.
      
      Starting with Automake 1.12, AM_PROG_AR is "required" when building
      libraries with Automake. libsrtp does not use Automake, but has a
      handwritten Makefile.in template instead. That template has a AR variable
      that `configure` is supposed to set.
      
      The logic for doing so comes from AM_PROG_AR, which does a AC_SUBST() on
      the variable to set it. If AM_PROG_AR is not available/used, AR will not
      be set and the build will fail with rather obscure message.
      
      There's only two solutions to this; either do what this patch does, which
      is to require Automake 1.11.2 or newer on systems that are to regenerate
      the `configure` script, or write a "else" part to the m4_ifdef() check
      and roll your own AR check. The latter is probably non-trivial given
      various systems, cross compilers, etc.
      38e50768
  5. 29 Mar, 2017 1 commit
    • Pascal Bühler's avatar
      Add strict-prototypes warning if supported. · bb6ef8a3
      Pascal Bühler authored
      Ensure that all functions are correctly declared for c.
      There was one function in libsrtp that was not declared correctly
      and now it can be caught.
      
      This flags needed a custom program to check in configure, the built
      in function was invalid when using this flag.
      bb6ef8a3
  6. 06 Mar, 2017 2 commits
  7. 10 Feb, 2017 1 commit
  8. 09 Feb, 2017 2 commits
    • Pascal Bühler's avatar
      Change required openssl version to be >= 1.0.1 · 6c949b69
      Pascal Bühler authored
      The previous requirement did not make sense.
      On system that did not use pgk-config then the library happily linked
      against version 1.0.1 as the required functions are present in that
      version. If pkg-config was used then suddenly configure would fail with
      version 1.0.1 due to the version check.
      6c949b69
    • Idar Tollefsen's avatar
      configure.in: Lowers pkg-config version required. · f9c148d3
      Idar Tollefsen authored
      The use of PKG_CHECK_MODULES_STATIC was introduced in 333fa84e alongside
      requiring pkg-config 0.29 or later.
      
      PKG_CHECK_MODULES_STATIC was introduced in May 2013 in respons to
      pkg-config bug 19541:
      <https://bugs.freedesktop.org/show_bug.cgi?id=19541>
      
      Gathered from version history, it appears PKG_CHECK_MODULES_STATIC was
      released with pkg-config 0.29 in September 2015.
      
      The use of PKG_CHECK_MODULES_STATIC and the pkg-verison requirement aren't
      really connected tough. 0.29 or later is only required for regenerating
      the configure script, not really for using it.
      
      And it has also become apparent that 0.29 is too new. Developers that
      wants to make changes and regenerate the configure script might not have
      it and therefore error out with a warning about PKG_CHECK_MODULES_STATIC
      being undefined when running autoreconf.
      
      This removes the pkg-config version requirement again.
      
      And instead of using PKG_CHECK_MODULES_STATIC, it sets "$PKG_CONFIG" to
      "$PKG_CONFIG --static" and uses the regular PKG_CHECK_MODULES macro.
      This is in essence what PKG_CHECK_MODULES_STATIC does internally, and was
      the recommended way of doing this prior to its introduction in 0.29.
      f9c148d3
  9. 30 Jan, 2017 1 commit
    • Pascal Bühler's avatar
      Simplify logging of errors and debug · 88579e67
      Pascal Bühler authored
      Previously logging of debug and errors did not always work as expected.
      Now there are three configure options to control output. The idea is not to
      be overly complicated but to give some simple options that work.
      
      --enable-log-stdout
      This will out put all debug and error logging to stdout
      
      --with-log-file=<filename>
      This will output all debug and error logging to the given filename
      
      --enable-debug-logging
      This enable debug logging for all internal debug modules. This is very
      verbose and should only be used for debugging and development.
      88579e67
  10. 27 Jan, 2017 1 commit
    • Idar Tollefsen's avatar
      configure.in: Replaces hardcoded CFLAGS with compiler checks. · 0e79075f
      Idar Tollefsen authored
      Hardcoding CFLAGS without checking if the flags are supported isn't a
      good idea. For instance, if no CFLAGS where given, it would
      unconditionally add -O4 as the optimization flag. Clang doesn't have
      -O4. It understands it, but will issue a warning for every compilation
      unit that -O4 is equal to -O3. Clang also doesn't have
      -fexpensive-optimizations.
      
      This changes it to actually check for supported compiler flags and only
      adds them if the compiler understands them.
      
      There are several details here.
      
      CFLAGS where previously set at the start, before AC_PROG_CC since that
      adds default flags. That check now instead seta a EMPTY_CFLAGS marker
      that's later used to determine if we should add the previously hardcoded
      flags.
      
      The variable supported_cflags will be filled with the flags the compiler
      supports and eventually CFLAGS will be set to supported_cflags.
      
      For correct detection, -Werror (or equivalent) needs to be in effect for
      the compiler to issue an error for unknown flags. This is therefore
      checked first and added to CFLAGS while performing the checks. This is not
      added to supported_cflags and does therefore not end up on the final
      CFLAGS.
      
      Next, the check for -fPIC has been migrated from a platform check to a
      compiler flag check. If found to work, it's added both to supported_cflags
      and to LDFLAGS as it needs to be present during linking as well.
      
      Then comes the check for the flags that were previously added
      unconditionally if CFLAGS was empty, in the order they were before.
      Of particular note here is the split in logic to check for the
      optimization flag. It will check -O4 first. If -O4 is supported, it will
      not check for others. If -O4 is not supported, it will check -O3.
      
      The final compiler flags check is for disabling warnings. This is new and,
      like -fPIC, is done regardless of whether CFLAGS was empty or not. The
      only check here so far is for -Wno-language-extension-token which Clang
      needs to stop complaining about inline assembly statements. Note that the
      checks for warnings needs sed to convert from the -Wno-<warning> form to
      the -W<warning> form, so a AC_PROG_SED check is added to the top with the
      other program checks. This is because the -Wno-<warning> form isn't
      consulted unless there is warning (at least by GCC) so the flag would
      always be accepted. The -W<warning> form mean the compiler is forced to
      consider it up front.
      0e79075f
  11. 26 Jan, 2017 6 commits
    • Idar Tollefsen's avatar
      configure.in/Makefile.in: Removes -fPIC flag on Windows. · b015c45e
      Idar Tollefsen authored
      On Windows, adding -fPIC will print a warning for every compilation unit
      about all code being positioned independent. I.e. the flag is redundant.
      
      This removes the unconditional -fPIC flag from CPPFLAGS in Makefile.in and
      sets it in configure.in instead, except when compiling for *cygwin*
      or *mingw*.
      b015c45e
    • Idar Tollefsen's avatar
      configure.in: Improves OpenSSL discovery and linking. · 333fa84e
      Idar Tollefsen authored
      Fixes pkg-config usage and switches from AC_CHECK_LIB() to
      AC_SEARCH_LIBS() for libcrypto.
      
      This fixes the issue mentioned in pull request #176 of the crypto library
      being added multiple times when using OpenSSL.
      
      There are several details to note.
      
      If the user specifies a OpenSSL directory with --with-openssl-dir, then
      the relevant subdirectories need to end up in CFLAGS and LDFLAGS (as they
      already did), not in CFLAGS and LIBS as proposed by PR #176. Since
      AC_CHECK_LIB() prepends the library, putting the user supplied directory
      in LIBS before the call to AC_CHECK_LIB() would put -lcrypto before
      -L<dir>/lib, potentially picking up the wrong library or the system
      supplied library.
      
      If pkg-config is available and the user specifies a OpenSSL directory that
      contains lib/pkgconfig/libcrypto.pc, then PKG_CONFIG_PATH is set so that
      the custom location can be picked up by pkg-config. In this case, neither
      CFLAGS nor LDFLAGS are modified since the pkg-config check will do the
      right thing here.
      
      The original code would call $PKG_CONFIG unconditionally via a shell
      invocation regardless of whether pkg-config was available or not. This
      changes it to use the PKG_CHECK_MODULES_STATIC() macro only if pkg-config
      is available.
      
      Note that PKG_CHECK_MODULES_STATIC() requires pkg-config 0.29 or higher,
      hence the version argument to PKG_PROG_PKG_CONFIG().
      
      Unlike PKG_CHECK_MODULES(), PKG_CHECK_MODULES_STATIC() includes
      Libs.private for static linking (corresponds to 'pkg-config
      --static'). For libcrypto, this will include libz and/or libdl as
      necessary/configured.
      
      For the case when pkg-config is not installed, the AC_CHECK_LIB() calls
      for libz and libdl are kept. If found, they'll be added unconditionally,
      as before.
      
      As mentioned in the comment for PR #176, even if pkg-config is available
      and used, it's still desirable to check for the presence of certain
      functions in the configured library, and the usability of the library
      itself (i.e. it's built for the correct platform).
      
      To do so, and also to check for libcrypto if pkg-config isn't installed,
      AC_SEARCH_LIBS() is used. This will check for the given function in the
      libraries listed, which is only libcrypto in this case.
      
      The way AC_SEARCH_LIBS() works is that it will try to find the function
      without adding any libraries and then start adding libraries from the
      given list until the function is found or the list exhausted.
      
      For the case when pkg-config is installed and libcrypto is found via
      PKG_CHECK_MODULES_STATIC(), these extra checks for specific functions
      will not add -lcrypto again because it doesn't need to - it's already in
      LIBS and the functions will be found.
      
      For the case when pkg-config is not installed, the first check will
      add -lcrypto to LIBS while subsequent checks will pass without adding
      it again.
      
      Should any of the checks fail, i.e. the function isn't found or the
      configured library isn't usable, then it will fail as intended.
      333fa84e
    • Idar Tollefsen's avatar
      configure.in/Makefile.in: Always generate and install pkg-config file. · 3edfcefe
      Idar Tollefsen authored
      The libsrtp2.pc file should always be generated and installed regardless
      of whether pkg-config is installed on the build machine.
      
      For instance, if a machine is dedicated to building packages, but doesn't
      have pkg-config installed, that doesn't mean users of the finished package
      doesn't want the pkg-config file.
      
      The libsrtp2.pc file, generated from the libsrtp2.pc.in template, is only
      dependent on the correct AC_SUBST() calls in configure.in. I.e. pkg-config
      does not have to be installed to generate it.
      
      This removes the entire HAVE_PKG_CONFIG concept and always generates and
      installs the libsrtp2.pc file.
      3edfcefe
    • Idar Tollefsen's avatar
      configure.in: Adds proper quoting and small improvements flowing from it. · 5e67d396
      Idar Tollefsen authored
      Primarily, this Fixes #113.
      
      Some minor formatting changes were made where it made the quoted logic
      easier to read/follow.
      
      There were also a couple of other improvements that naturally flowed from
      the changes in quotation:
      
      Instead of using AC_CHECK_HEADERS() per header, they have now been
      coalesced into one call where appropriate.
      
      Adds explicit usage of AC_INCLUDES_DEFAULT as the includes argument to
      AC_CHECK_HEADERS(). Without this, some platforms/compilers will complain
      that the header was found, but not useable by the compiler. This will
      happen on e.g. Solaris where certain  header files have to be included to
      pull in the necessary defines. This is achieved through the use
      AC_INCLUDES_DEFAULT.
      
      Removes variables that were either not used or only set for use with
      AC_SUBST(); HOST_IS_WINDOWS, USE_OPENSSL, PCAP and HAVE_PCAP.
      AC_SUBSTS() will happily accept both the name and the value as two
      separate arguments - no need to set a variable just for that.
      
      Adds AC_MSG_RESULT() for the AC_MSG_CHECKING() message for user specified
      OpenSSL directory. Without this, the configure script would output the
      next check on the same line.
      5e67d396
    • Idar Tollefsen's avatar
      configure.in: Changes empty CFLAGS check to be (more) shell neutral. · 27d857ce
      Idar Tollefsen authored
      The test for empty CFLAGS used the bash (and compatible) -z test to check
      for a zero length string.
      
      This changes it to the more shell neutral "x$foo" = "x" form that's also
      used elsewhere in this file.
      
      The AS_IF macro is the preferred way of expressing these tests.
      Since there are a few of them in this file, such a rewrite would touch
      large parts of it. Perhaps something to look into later.
      27d857ce
    • Idar Tollefsen's avatar
      configure.in/Makefile.in: Whitespace cleanup. · 5fd11874
      Idar Tollefsen authored
      For configure.in, this additionally replaces
      the few tabs there where with spaces.
      5fd11874
  12. 19 Jan, 2017 1 commit
  13. 15 Oct, 2016 1 commit
  14. 16 Jun, 2016 3 commits
  15. 05 Jun, 2016 1 commit
  16. 04 Jun, 2016 1 commit
  17. 02 Feb, 2016 2 commits
  18. 15 Dec, 2015 1 commit
  19. 11 May, 2015 1 commit
    • jfigus's avatar
      Add support for using OpenSSL SRTP KDF algorithm. This work was originally... · 038d2cf3
      jfigus authored
      Add support for using OpenSSL SRTP KDF algorithm.  This work was originally done by Barry Fussell, but has been adapted to the latest libsrtp.  Added new configure option called --enable-openssl-kdf to enable this feature.  Also added new configure option to specify the location of the OpenSSL directory (--with-openssl-dir).  Lastly, this commit updates config_in.h (via autoheader).
      038d2cf3
  20. 06 Apr, 2015 1 commit
  21. 11 Mar, 2015 1 commit
  22. 02 Mar, 2015 1 commit
  23. 26 Feb, 2015 1 commit
  24. 19 Feb, 2015 2 commits
  25. 04 Dec, 2014 1 commit
  26. 02 Dec, 2014 1 commit