"Fossies" - the Fresh Open Source Software Archive

Member "libksba-1.5.0/configure.ac" (18 Nov 2020, 15811 Bytes) of package /linux/privat/libksba-1.5.0.tar.bz2:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 1.4.0_vs_1.5.0.

    1 # configure.ac - for libksba
    2 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
    3 #               2010, 2011, 2012, 2018, 2019  g10 Code GmbH
    4 #
    5 # This file is part of KSBA
    6 #
    7 # KSBA is free software; you can redistribute it and/or modify
    8 # it under the terms of the GNU General Public License as published by
    9 # the Free Software Foundation; either version 3 of the License, or
   10 # (at your option) any later version.
   11 #
   12 # KSBA is distributed in the hope that it will be useful,
   13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15 # GNU General Public License for more details.
   16 #
   17 # You should have received a copy of the GNU General Public License
   18 # along with this program; if not, see <http://www.gnu.org/licenses/>.
   19 
   20 # Process this file with autoconf to produce a configure script.
   21 AC_PREREQ([2.61])
   22 min_automake_version="1.14"
   23 
   24 
   25 # To build a release you need to create a tag with the version number
   26 # (git tag -s libksba-n.m.k) and run "./autogen.sh --force".  Please
   27 # bump the version number immediately after the release and do another
   28 # commit and push so that the git magic is able to work.  See below
   29 # for the LT versions.
   30 m4_define([mym4_package],[libksba])
   31 m4_define([mym4_major], [1])
   32 m4_define([mym4_minor], [5])
   33 m4_define([mym4_micro], [0])
   34 
   35 # Below is m4 magic to extract and compute the git revision number,
   36 # the decimalized short revision number, a beta version string and a
   37 # flag indicating a development version (mym4_isbeta).  Note that the
   38 # m4 processing is done by autoconf and not during the configure run.
   39 m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \
   40                            mym4_package mym4_major mym4_minor mym4_micro),[:]))
   41 m4_define([mym4_isbeta],       m4_argn(2, mym4_verslist))
   42 m4_define([mym4_version],      m4_argn(4, mym4_verslist))
   43 m4_define([mym4_revision],     m4_argn(7, mym4_verslist))
   44 m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
   45 m4_esyscmd([echo ]mym4_version[>VERSION])
   46 AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
   47 
   48 # LT Version numbers: Remember to change them just *before* a release.
   49 #   (Interfaces removed:    CURRENT++, AGE=0, REVISION=0)
   50 #   (Interfaces added:      CURRENT++, AGE++, REVISION=0)
   51 #   (No interfaces changed:                   REVISION++)
   52 # Please remember to document interface changes in the NEWS file.
   53 LIBKSBA_LT_CURRENT=21
   54 LIBKSBA_LT_AGE=13
   55 LIBKSBA_LT_REVISION=0
   56 #-------------------
   57 # If the API is changed in an incompatible way: increment the next counter.
   58 KSBA_CONFIG_API_VERSION=1
   59 
   60 
   61 NEED_GPG_ERROR_VERSION=1.8
   62 
   63 
   64 AC_CONFIG_AUX_DIR([build-aux])
   65 AC_CONFIG_SRCDIR([src/ksba.h.in])
   66 AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
   67 AC_CONFIG_HEADERS([config.h])
   68 AC_CONFIG_MACRO_DIR([m4])
   69 AC_CANONICAL_HOST
   70 AB_INIT
   71 
   72 AC_USE_SYSTEM_EXTENSIONS
   73 
   74 # Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE
   75 dnl Under Linux, make sure that the old dtags are used if LD_LIBRARY_PATH
   76 dnl is defined. The issue is that with the new dtags, LD_LIBRARY_PATH has
   77 dnl the precedence over the run path, so that if a compatible MPFR library
   78 dnl is installed in some directory from $LD_LIBRARY_PATH, then the tested
   79 dnl MPFR library will be this library instead of the MPFR library from the
   80 dnl build tree. Other OS with the same issue might be added later.
   81 dnl
   82 dnl References:
   83 dnl   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859732
   84 dnl   http://lists.gnu.org/archive/html/libtool/2017-05/msg00000.html
   85 dnl
   86 dnl We need to check whether --disable-new-dtags is supported as alternate
   87 dnl linkers may be used (e.g., with tcc: CC=tcc LD=tcc).
   88 dnl
   89 case $host in
   90   *-*-linux*)
   91     if test -n "$LD_LIBRARY_PATH"; then
   92       saved_LDFLAGS="$LDFLAGS"
   93       LDADD_FOR_TESTS_KLUDGE="-Wl,--disable-new-dtags"
   94       LDFLAGS="$LDFLAGS $LDADD_FOR_TESTS_KLUDGE"
   95       AC_MSG_CHECKING(whether --disable-new-dtags is supported by the linker)
   96       AC_LINK_IFELSE([AC_LANG_SOURCE([[
   97 int main (void) { return 0; }
   98       ]])],
   99       [AC_MSG_RESULT(yes (use it since LD_LIBRARY_PATH is set))],
  100       [AC_MSG_RESULT(no)
  101        LDADD_FOR_TESTS_KLUDGE=""
  102       ])
  103       LDFLAGS="$saved_LDFLAGS"
  104     fi
  105     ;;
  106 esac
  107 AC_SUBST([LDADD_FOR_TESTS_KLUDGE])
  108 
  109 LT_PREREQ([2.2.6])
  110 LT_INIT([win32-dll disable-static])
  111 LT_LANG([Windows Resource])
  112 
  113 AM_MAINTAINER_MODE
  114 
  115 
  116 AC_SUBST(LIBKSBA_LT_CURRENT)
  117 AC_SUBST(LIBKSBA_LT_AGE)
  118 AC_SUBST(LIBKSBA_LT_REVISION)
  119 
  120 VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_major \
  121                           mym4_minor mym4_micro)
  122 AC_SUBST(VERSION_NUMBER)
  123 
  124 
  125 AH_TOP([
  126 #ifndef _KSBA_CONFIG_H_INCLUDED
  127 #define _KSBA_CONFIG_H_INCLUDED
  128 
  129 /* Enable gpg-error's strerror macro for W32CE.  */
  130 #define GPG_ERR_ENABLE_ERRNO_MACROS 1
  131 ])
  132 
  133 AH_BOTTOM([
  134 
  135 #endif /*_KSBA_CONFIG_H_INCLUDED*/
  136 ])
  137 
  138 
  139 
  140 # Checks for programs.
  141 missing_dir=`cd $ac_aux_dir && pwd`
  142 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  143 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  144 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  145 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  146 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  147 AM_SILENT_RULES
  148 AC_PROG_AWK
  149 AC_PROG_CC
  150 AC_PROG_CPP
  151 AM_PROG_CC_C_O
  152 if test "x$ac_cv_prog_cc_c89" = "xno" ; then
  153   AC_MSG_ERROR([[No C-89 compiler found]])
  154 fi
  155 AC_PROG_INSTALL
  156 AC_PROG_LN_S
  157 AC_PROG_MAKE_SET
  158 gl_EARLY
  159 #AC_ARG_PROGRAM
  160 AC_PROG_YACC
  161 AX_PROG_BISON([have_bison=yes],[have_bison=no])
  162 
  163 if test "$USE_MAINTAINER_MODE" = "yes"; then
  164 	AC_CHECK_PROGS(GCOV, [gcov], gcov)
  165 	# gcov coverage reporting
  166 	AC_TDD_GCOV
  167 	AC_SUBST(COVERAGE_CFLAGS)
  168 	AC_SUBST(COVERAGE_LDFLAGS)
  169 else
  170 	AM_CONDITIONAL(HAVE_GCOV, false)
  171 fi
  172 
  173 AC_C_INLINE
  174 
  175 # We need to compile and run a program on the build machine.
  176 #   The AC_PROG_CC_FOR_BUILD macro in the AC archive is broken for
  177 #   autoconf 2.57.
  178 AC_MSG_CHECKING(for cc for build)
  179 if test "$cross_compiling" = "yes"; then
  180   CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
  181 else
  182   CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
  183 fi
  184 AC_MSG_RESULT($CC_FOR_BUILD)
  185 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
  186 
  187 
  188 # This is handy for debugging so the compiler doesn't rearrange
  189 # things and eliminate variables.
  190 AC_ARG_ENABLE(optimization,
  191        AS_HELP_STRING([--disable-optimization],
  192                       [disable compiler optimization]),
  193                       [if test $enableval = no ; then
  194                          CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'`
  195                        fi])
  196 
  197 if test "$GCC" = yes; then
  198     CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
  199 
  200     if test "$USE_MAINTAINER_MODE" = "yes"; then
  201         CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
  202 
  203         # We use -W only if -Wno-missing-field-initializers is supported.
  204         # -W is important because it detects errors like "if (foo);"
  205         AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
  206         _gcc_cflags_save=$CFLAGS
  207         CFLAGS="-Wno-missing-field-initializers"
  208         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
  209         AC_MSG_RESULT($_gcc_wopt)
  210         CFLAGS=$_gcc_cflags_save;
  211         if test x"$_gcc_wopt" = xyes ; then
  212           CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
  213         fi
  214 
  215         AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
  216         _gcc_cflags_save=$CFLAGS
  217         CFLAGS="-Wdeclaration-after-statement"
  218         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
  219         AC_MSG_RESULT($_gcc_wopt)
  220         CFLAGS=$_gcc_cflags_save;
  221         if test x"$_gcc_wopt" = xyes ; then
  222           CFLAGS="$CFLAGS -Wdeclaration-after-statement"
  223         fi
  224     fi
  225 
  226     AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
  227     _gcc_cflags_save=$CFLAGS
  228     CFLAGS="-Wpointer-arith"
  229     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
  230     AC_MSG_RESULT($_gcc_wopt)
  231     CFLAGS=$_gcc_cflags_save;
  232     if test x"$_gcc_wopt" = xyes ; then
  233        CFLAGS="$CFLAGS -Wpointer-arith"
  234     fi
  235 
  236     AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
  237     _gcc_cflags_save=$CFLAGS
  238     CFLAGS="-Wno-pointer-sign"
  239     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_psign=yes,_gcc_psign=no)
  240     AC_MSG_RESULT($_gcc_psign)
  241     CFLAGS=$_gcc_cflags_save;
  242     if test x"$_gcc_psign" = xyes ; then
  243        CFLAGS="$CFLAGS -Wno-pointer-sign"
  244     fi
  245 
  246 fi
  247 
  248 # Setup some stuff depending on host.
  249 have_w32_system=no
  250 have_w32ce_system=no
  251 case "${host}" in
  252     *-*-mingw32ce*)
  253       have_w32_system=yes
  254       have_w32ce_system=yes
  255       ;;
  256     *-*-mingw32*)
  257       have_w32_system=yes
  258       ;;
  259      *-apple-darwin*)
  260       AC_DEFINE(_DARWIN_C_SOURCE, 900000L,
  261                 Expose all libc features (__DARWIN_C_FULL).)
  262       ;;
  263     *)
  264       ;;
  265 esac
  266 if test "$have_w32_system" = yes; then
  267    AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
  268    if test "$have_w32ce_system" = yes; then
  269      AC_DEFINE(HAVE_W32CE_SYSTEM,1,[Defined if we run on WindowsCE])
  270    fi
  271 fi
  272 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
  273 AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
  274 
  275 
  276 # For some systems we know that we have ld_version scripts.
  277 # Use it then as default.
  278 have_ld_version_script=no
  279 case "${host}" in
  280     *-*-linux*)
  281 	have_ld_version_script=yes
  282         ;;
  283     *-*-gnu*)
  284 	have_ld_version_script=yes
  285         ;;
  286 esac
  287 AC_ARG_ENABLE([ld-version-script],
  288               AS_HELP_STRING([--enable-ld-version-script],
  289                              [enable/disable use of linker version script.
  290                               (default is system dependent)]),
  291               [have_ld_version_script=$enableval],
  292               [ : ] )
  293 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
  294 
  295 
  296 #
  297 # Check for ELF visibility support.
  298 #
  299 AC_CACHE_CHECK(whether the visibility attribute is supported,
  300        ksba_cv_visibility_attribute,
  301        [ksba_cv_visibility_attribute=no
  302         AC_LANG_CONFTEST([AC_LANG_SOURCE(
  303           [[int foo __attribute__ ((visibility ("hidden"))) = 1;
  304             int bar __attribute__ ((visibility ("protected"))) = 1;
  305           ]])])
  306 
  307         if ${CC-cc} -Werror -S conftest.c -o conftest.s \
  308                   1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
  309             if grep '\.hidden.*foo' conftest.s >/dev/null 2>&1 ; then
  310                 if grep '\.protected.*bar' conftest.s >/dev/null 2>&1; then
  311                     ksba_cv_visibility_attribute=yes
  312                 fi
  313             fi
  314         fi
  315        ])
  316 if test "$ksba_cv_visibility_attribute" = "yes"; then
  317     AC_CACHE_CHECK(for broken visibility attribute,
  318        ksba_cv_broken_visibility_attribute,
  319        [ksba_cv_broken_visibility_attribute=yes
  320         AC_LANG_CONFTEST([AC_LANG_SOURCE(
  321           [[int foo (int x);
  322             int bar (int x) __asm__ ("foo")
  323                             __attribute__ ((visibility ("hidden")));
  324             int bar (int x) { return x; }
  325           ]])])
  326 
  327         if ${CC-cc} -Werror -S conftest.c -o conftest.s \
  328                   1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
  329            if grep '\.hidden@<:@ 	_@:>@foo' conftest.s >/dev/null 2>&1;
  330             then
  331                ksba_cv_broken_visibility_attribute=no
  332            fi
  333         fi
  334        ])
  335 fi
  336 if test "$ksba_cv_visibility_attribute" = "yes"; then
  337     AC_CACHE_CHECK(for broken alias attribute,
  338        ksba_cv_broken_alias_attribute,
  339        [ksba_cv_broken_alias_attribute=yes
  340         AC_LANG_CONFTEST([AC_LANG_SOURCE(
  341           [[extern int foo (int x) __asm ("xyzzy");
  342             int bar (int x) { return x; }
  343             extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
  344             extern int dfoo;
  345             extern __typeof (dfoo) dfoo __asm ("abccb");
  346             int dfoo = 1;
  347           ]])])
  348 
  349         if ${CC-cc} -Werror -S conftest.c -o conftest.s \
  350                   1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
  351            if grep 'xyzzy' conftest.s >/dev/null 2>&1 && \
  352               grep 'abccb' conftest.s >/dev/null 2>&1; then
  353               ksba_cv_broken_alias_attribute=no
  354            fi
  355         fi
  356         ])
  357 fi
  358 if test "$ksba_cv_visibility_attribute" = "yes"; then
  359     AC_CACHE_CHECK(if gcc supports -fvisibility=hidden,
  360        ksba_cv_gcc_has_f_visibility,
  361        [ksba_cv_gcc_has_f_visibility=no
  362         _gcc_cflags_save=$CFLAGS
  363         CFLAGS="-fvisibility=hidden"
  364         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
  365                           ksba_cv_gcc_has_f_visibility=yes)
  366         CFLAGS=$_gcc_cflags_save;
  367        ])
  368 fi
  369 if test "$ksba_cv_visibility_attribute" = "yes" \
  370    && test "$ksba_cv_broken_visibility_attribute" != "yes" \
  371    && test "$ksba_cv_broken_alias_attribute" != "yes" \
  372    && test "$ksba_cv_gcc_has_f_visibility" = "yes"
  373  then
  374    AC_DEFINE(KSBA_USE_VISIBILITY, 1,
  375                [Define to use the GNU C visibility attribute.])
  376    CFLAGS="$CFLAGS -fvisibility=hidden"
  377 fi
  378 
  379 
  380 #
  381 # Checks for libraries.
  382 #
  383 AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION")
  384 if test "x$GPG_ERROR_LIBS" = "x"; then
  385   AC_MSG_ERROR([libgpg-error is needed.
  386                 See ftp://ftp.gnupg.org/gcrypt/libgpg-error/ .])
  387 fi
  388 
  389 AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_KSBA,
  390           [The default error source for libksba.])
  391 
  392 
  393 # Checks for header files.
  394 AC_HEADER_STDC
  395 AC_CHECK_HEADERS([string.h])
  396 
  397 # Checks for typedefs, structures, and compiler characteristics.
  398 AC_C_CONST
  399 
  400 AC_C_BIGENDIAN
  401 
  402 AC_CHECK_SIZEOF(unsigned int)
  403 AC_CHECK_SIZEOF(unsigned long)
  404 AC_CHECK_TYPES([u32])
  405 
  406 
  407 # Checks for library functions.
  408 AC_CHECK_FUNCS([memmove strchr strtol strtoul stpcpy gmtime_r getenv])
  409 
  410 
  411 # GNUlib checks
  412 gl_SOURCE_BASE(gl)
  413 gl_M4_BASE(gl/m4)
  414 gl_MODULES(alloca valgrind-tests)
  415 gl_INIT
  416 
  417 # To be used in ksba-config
  418 KSBA_CONFIG_LIBS="-lksba"
  419 KSBA_CONFIG_CFLAGS=""
  420 KSBA_CONFIG_HOST="$host"
  421 AC_SUBST(KSBA_CONFIG_LIBS)
  422 AC_SUBST(KSBA_CONFIG_CFLAGS)
  423 AC_SUBST(KSBA_CONFIG_API_VERSION)
  424 AC_SUBST(KSBA_CONFIG_HOST)
  425 
  426 # The Makefiles need to know about cross compiling
  427 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling != xno)
  428 
  429 
  430 # Generate extended version information for W32.
  431 if test "$have_w32_system" = yes; then
  432    changequote(,)dnl
  433    BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
  434    changequote([,])dnl
  435    BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec"
  436 fi
  437 AC_SUBST(BUILD_REVISION)
  438 AC_SUBST(BUILD_FILEVERSION)
  439 BUILD_REVISION="mym4_revision"
  440 AC_SUBST(BUILD_REVISION)
  441 AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION",
  442                    [GIT commit id revision used to build this package])
  443 
  444 AC_ARG_ENABLE([build-timestamp],
  445   AS_HELP_STRING([--enable-build-timestamp],
  446                  [set an explicit build timestamp for reproducibility.
  447                   (default is the current time in ISO-8601 format)]),
  448      [if test "$enableval" = "yes"; then
  449         BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
  450       else
  451         BUILD_TIMESTAMP="$enableval"
  452       fi],
  453      [BUILD_TIMESTAMP="<none>"])
  454 AC_SUBST(BUILD_TIMESTAMP)
  455 AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
  456                    [The time this package was configured for a build])
  457 
  458 build_doc=yes
  459 AC_ARG_ENABLE([doc], AS_HELP_STRING([--disable-doc],
  460                                     [do not build the documentation]),
  461                      build_doc=$enableval, build_doc=yes)
  462 AM_CONDITIONAL([BUILD_DOC], [test "x$build_doc" != xno])
  463 
  464 
  465 AC_CONFIG_FILES([
  466 Makefile
  467 m4/Makefile
  468 gl/Makefile
  469 src/Makefile
  470 src/ksba.h
  471 src/ksba-config
  472 src/ksba.pc
  473 src/versioninfo.rc
  474 tests/Makefile
  475 doc/Makefile
  476 ])
  477 AC_OUTPUT
  478 
  479 if test x"$have_bison" = xno; then
  480     AC_MSG_NOTICE([[
  481 ***
  482 *** Note: The installed yacc version is not GNU Bison.  You need
  483 *** to install Bison if you want to change any grammar (.y) file.
  484 ***]])
  485 fi
  486 
  487 echo "
  488         Libksba v${VERSION} has been configured as follows:
  489 
  490         Revision:  mym4_revision  (mym4_revision_dec)
  491         Platform:  $host
  492 
  493 "