summaryrefslogtreecommitdiff
path: root/configure.in
blob: 5987fcf797ee5446e9875e3455863c8ddc78328c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
dnl Process this file with autoconf to produce a configure script.
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation
#
# This file is part of LIBTASN1.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

AC_PREREQ(2.61)
AC_INIT([libtasn1], [2.0], [bug-gnutls@gnu.org])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([1.10 -Wall -Werror -Wno-override])

# Library code modified:                              REVISION++
# Interfaces changed/added/removed:   CURRENT++       REVISION=0
# Interfaces added:                             AGE++
# Interfaces removed:                           AGE=0
AC_SUBST(LT_CURRENT, 5)
AC_SUBST(LT_REVISION, 0)
AC_SUBST(LT_AGE, 0)

AC_PROG_CC
gl_EARLY
AC_PROG_YACC
AC_PROG_LN_S

dnl Checks for programs.
AC_PROG_INSTALL
AM_MISSING_PROG(PERL, perl, $missing_dir)
AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)

AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL

AC_CHECK_SIZEOF(unsigned long int, 4)
AC_CHECK_SIZEOF(unsigned int, 4)

# Run self-tests under valgrind?
if test "$cross_compiling" = no; then
  AC_CHECK_PROGS(VALGRIND, valgrind)
fi
if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
  opt_valgrind_tests=yes
else
  opt_valgrind_tests=no
  VALGRIND=
fi 
AC_MSG_CHECKING([whether self tests are run under valgrind])
AC_ARG_ENABLE(valgrind-tests,
	AS_HELP_STRING([--enable-valgrind-tests],
                       [run self tests under valgrind]),
  opt_valgrind_tests=$enableval)
AC_MSG_RESULT($opt_valgrind_tests)

AC_ARG_ENABLE([ld-version-script],
  AS_HELP_STRING([--enable-ld-version-script],
    [enable/disable linker version script (default is enabled when possible)]),
    [have_ld_version_script=$enableval], [])
if test -z "$have_ld_version_script"; then
  AC_MSG_CHECKING([if -Wl,--version-script works])
  save_LDFLAGS="$LDFLAGS"
  LDFLAGS="$LDFLAGS -Wl,--version-script=$srcdir/lib/libtasn1.vers"
  AC_LINK_IFELSE(AC_LANG_PROGRAM([], []),
                 [have_ld_version_script=yes], [have_ld_version_script=no])
  LDFLAGS="$save_LDFLAGS"
  AC_MSG_RESULT($have_ld_version_script)
fi
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")

# Check for gtk-doc.
GTK_DOC_CHECK(1.2)

# Update version number in lib/libtasn1.h.
if ! sed 's/_VERSION ".*"/_VERSION "'$PACKAGE_VERSION'"/' \
     $srcdir/lib/libtasn1.h > fixhdr.tmp; then
  AC_MSG_ERROR([[*** Failed to update version number in lib/libtasn1.h...]])
fi
if cmp -s $srcdir/lib/libtasn1.h fixhdr.tmp 2>/dev/null; then
  rm -f fixhdr.tmp
elif ! mv fixhdr.tmp $srcdir/lib/libtasn1.h; then
  AC_MSG_ERROR([[*** Failed to move fixhdr.tmp to lib/libtasn1.h...]])
fi

# For gnulib compatibility modules in gl/.
gl_INIT

gl_WARN_ADD([-Wall])
gl_WARN_ADD([-Wpointer-arith])
gl_WARN_ADD([-Wstrict-prototypes])
gl_WARN_ADD([-Wno-pointer-sign])

AC_CONFIG_FILES([ \
  Makefile \
  gl/Makefile \
  lib/Makefile \
  lib/libtasn1.pc \
  src/Makefile \
  tests/Makefile \
  doc/Makefile \
  doc/cyclo/Makefile \
  doc/reference/Makefile \
  examples/Makefile \
])
AC_OUTPUT