1 # configure.ac for libgpg-error
2 # Copyright (C) 2003, 2004, 2006 g10 Code GmbH
4 # This file is part of libgpg-error.
6 # libgpg-error is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU Lesser General Public License as
8 # published by the Free Software Foundation; either version 2.1 of the
9 # License, or (at your option) any later version.
11 # libgpg-error is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 # (Process this file with autoconf to produce a configure script.)
21 # The following lines are used by ./autogen.sh.
23 min_automake_version="1.9.6"
25 # Remember to change the version number immediately *after* a release.
26 # Set my_issvn to "yes" for non-released code. Remember to run an
27 # "svn up" and "autogen.sh" right before creating a distribution.
28 m4_define([my_version], [1.7])
29 m4_define([my_issvn], [no])
31 m4_define([svn_revision], m4_esyscmd([printf "%d" $(svn info 2>/dev/null \
32 | sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)]))
33 AC_INIT([libgpg-error],
34 [my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision])],
35 [bug-gnupg@gnupg.org])
36 # LT Version numbers, remember to change them just *before* a release.
37 # (Code changed: REVISION++)
38 # (Interfaces added/removed/changed: CURRENT++, REVISION=0)
39 # (Interfaces added: AGE++)
40 # (Interfaces removed: AGE=0)
41 # Note that added error codes don't constitute an interface change.
42 LIBGPG_ERROR_LT_CURRENT=5
44 LIBGPG_ERROR_LT_REVISION=0
45 AC_SUBST(LIBGPG_ERROR_LT_CURRENT)
46 AC_SUBST(LIBGPG_ERROR_LT_AGE)
47 AC_SUBST(LIBGPG_ERROR_LT_REVISION)
51 AC_CONFIG_SRCDIR([src/err-sources.h.in])
52 AC_CONFIG_HEADER([config.h])
54 # We need to know about the host architecture to avoid spurious
59 # Checks for programs.
64 AC_CHECK_TOOL(AR, ar, :)
71 # We need to compile and run a program on the build machine.
72 dnl The AC_PROG_CC_FOR_BUILD macro in the AC archive is broken for
74 dnl AC_PROG_CC_FOR_BUILD
75 AC_MSG_CHECKING(for cc for build)
76 if test "$cross_compiling" = "yes"; then
77 CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
79 CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
81 AC_MSG_RESULT($CC_FOR_BUILD)
82 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
85 # Set some internal variables depending on the platform for later use.
97 /* Force using of NLS for W32 even if no libintl has been found. This is
98 okay because we have our own gettext implementation for W32. */
99 #if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS)
105 # Note, that autogen.sh greps for the next line.
106 AM_GNU_GETTEXT_VERSION([0.15])
107 AM_GNU_GETTEXT([external])
109 # Checks for header files.
111 AC_CHECK_HEADERS([stdlib.h locale.h])
115 # All versions of Solaris from 2.4 have a thread-safe strerror().
116 # Since Solaris 10, in addition strerror_r() exists.
119 AC_CHECK_FUNC([strerror_r], [],
120 AC_MSG_WARN([[Without strerror_r, gpg_strerror_r might not be thread-safe]]))
124 # Checks for typedefs, structures, and compiler characteristics.
127 # Substitution used for gpg-error-config
128 GPG_ERROR_CONFIG_LIBS="-lgpg-error"
129 GPG_ERROR_CONFIG_CFLAGS=""
130 AC_SUBST(GPG_ERROR_CONFIG_LIBS)
131 AC_SUBST(GPG_ERROR_CONFIG_CFLAGS)
132 AC_CONFIG_FILES([src/gpg-error-config], [chmod +x src/gpg-error-config])
135 # Special defines for certain platforms
136 if test "$have_w32_system" = yes; then
137 AC_DEFINE(HAVE_W32_SYSTEM,1,[Defined if we run on a W32 API based system])
138 BUILD_TIMESTAMP=`date --iso-8601=minutes`
139 AC_SUBST(BUILD_TIMESTAMP)
141 BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
144 *-svn*) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,0" ;;
145 *-cvs) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,0" ;;
146 *-rc*) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,1" ;;
147 *) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,2" ;;
150 AC_SUBST(BUILD_TIMESTAMP)
151 AC_SUBST(BUILD_FILEVERSION)
152 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
155 AC_ARG_ENABLE(languages,
156 [ --disable-languages do not build support for other languages than C])
157 AM_CONDITIONAL([LANGUAGES_SOME], [test "x$enable_languages" != xno])
162 AC_CONFIG_FILES([Makefile])
163 AC_CONFIG_FILES([po/Makefile.in m4/Makefile])
164 AC_CONFIG_FILES([src/Makefile tests/Makefile])
165 AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpg-error.asd])
166 AC_CONFIG_FILES([src/versioninfo.rc])
171 Libgpg-error v${VERSION} has been configured as follows: