1# Written by Simon Josefsson <simon@josefsson.org>.
2# Copyright (c) 2006-2014 Yubico AB
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met:
8#
9#   * Redistributions of source code must retain the above copyright
10#      notice, this list of conditions and the following disclaimer.
11#
12#   * Redistributions in binary form must reproduce the above
13#      copyright notice, this list of conditions and the following
14#      disclaimer in the documentation and/or other materials provided
15#      with the distribution.
16#
17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29AC_INIT([libyubikey], [1.13], [yubico-devel@googlegroups.com])
30AC_CONFIG_AUX_DIR([build-aux])
31AC_CONFIG_MACRO_DIR([m4])
32
33# Library code modified:                              REVISION++
34# Interfaces changed/added/removed:   CURRENT++       REVISION=0
35# Interfaces added:                             AGE++
36# Interfaces removed:                           AGE=0
37AC_SUBST(LT_CURRENT, 1)
38AC_SUBST(LT_REVISION, 7)
39AC_SUBST(LT_AGE, 1)
40
41AM_INIT_AUTOMAKE([1.11 -Wall -Werror])
42AM_SILENT_RULES([yes])
43AC_PROG_CC
44
45# workaround for automake 1.12
46m4_pattern_allow([AM_PROG_AR])
47AM_PROG_AR
48
49AC_LIBTOOL_WIN32_DLL
50AC_PROG_LIBTOOL
51AM_MISSING_PROG([A2X], a2x, $missing_dir)
52
53gl_LD_VERSION_SCRIPT
54gl_VALGRIND_TESTS
55
56AC_ARG_ENABLE([gcc-warnings],
57  [AS_HELP_STRING([--enable-gcc-warnings],
58		  [turn on lots of GCC warnings (for developers)])],
59  [case $enableval in
60     yes|no) ;;
61     *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
62   esac
63   gl_gcc_warnings=$enableval],
64  [gl_gcc_warnings=no]
65)
66
67if test "$gl_gcc_warnings" = yes; then
68  nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
69  nw="$nw -Wpadded"                 # Struct's arenot padded
70  nw="$nw -Wc++-compat"             # We don't care strongly about C++ compilers
71  nw="$nw -Wtraditional"            # Warns on #elif which we use often
72  nw="$nw -Wtraditional-conversion" # Too many warnings for now
73  nw="$nw -Wconversion"             # Too many warnings for now
74  nw="$nw -Wsuggest-attribute=pure" # Is it worth using attributes?
75
76  gl_MANYWARN_ALL_GCC([ws])
77  gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw])
78  for w in $ws; do
79    gl_WARN_ADD([$w])
80  done
81
82  gl_WARN_ADD([-fdiagnostics-show-option])
83fi
84
85AC_CONFIG_FILES([
86  Makefile
87  tests/Makefile
88])
89AC_OUTPUT
90
91AC_MSG_NOTICE([summary of build options:
92
93  version:          ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE major $YKPERS_VERSION_MAJOR minor $YKPERS_VERSION_MINOR patch $YKPERS_VERSION_PATCH number $YKPERS_VERSION_NUMBER
94  Host type:        ${host}
95  Install prefix:   ${prefix}
96  Compiler:         ${CC}
97  Compiler CFLAGS:  ${CFLAGS}
98  Warning flags:    ${WARN_CFLAGS}
99  Library types:    Shared=${enable_shared}, Static=${enable_static}
100  Valgrind:         ${VALGRIND}
101  Version script:   $have_ld_version_script
102])
103