1 # configure.ac for libgpg-error
2 # Copyright (C) 2003, 2004, 2006, 2010 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 General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
19 # (Process this file with autoconf to produce a configure script.)
20 # The following lines are used by ./autogen.sh.
22 min_automake_version="1.9.6"
24 # Remember to change the version number immediately *after* a release.
25 # Set my_issvn to "yes" for non-released code. Remember to run an
26 # "svn up" and "autogen.sh" right before creating a distribution.
27 m4_define([my_version], [1.10])
28 m4_define([my_issvn], [no])
30 m4_define([svn_revision], m4_esyscmd([printf "%d" $(svn info 2>/dev/null \
31 | sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)]))
32 AC_INIT([libgpg-error],
33 [my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision])],
34 [bug-gnupg@gnupg.org])
35 # LT Version numbers, remember to change them just *before* a release.
36 # (Code changed: REVISION++)
37 # (Interfaces added/removed/changed: CURRENT++, REVISION=0)
38 # (Interfaces added: AGE++)
39 # (Interfaces removed: AGE=0)
40 # Note that added error codes don't constitute an interface change.
41 LIBGPG_ERROR_LT_CURRENT=8
43 LIBGPG_ERROR_LT_REVISION=0
44 AC_SUBST(LIBGPG_ERROR_LT_CURRENT)
45 AC_SUBST(LIBGPG_ERROR_LT_AGE)
46 AC_SUBST(LIBGPG_ERROR_LT_REVISION)
50 AC_CONFIG_SRCDIR([src/err-sources.h.in])
51 AC_CONFIG_HEADER([config.h])
52 AC_CONFIG_MACRO_DIR([m4])
54 # We need to know about the host architecture to avoid spurious
59 # Checks for programs.
64 AC_CHECK_TOOL(AR, ar, :)
68 LT_INIT([win32-dll disable-static])
69 LT_LANG([Windows Resource])
72 # We need to compile and run a program on the build machine.
73 dnl The AC_PROG_CC_FOR_BUILD macro in the AC archive is broken for
75 dnl AC_PROG_CC_FOR_BUILD
76 AC_MSG_CHECKING(for cc for build)
77 if test "$cross_compiling" = "yes"; then
78 CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
80 CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
82 AC_MSG_RESULT($CC_FOR_BUILD)
83 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
86 # Set some internal variables depending on the platform for later use.
103 /* Force using of NLS for W32 even if no libintl has been found. This is
104 okay because we have our own gettext implementation for W32. */
105 #if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS)
108 /* For building we need to define these macro. */
109 #define GPG_ERR_ENABLE_GETTEXT_MACROS 1
110 #define GPG_ERR_ENABLE_ERRNO_MACROS 1
114 # Note, that autogen.sh greps for the next line.
115 AM_GNU_GETTEXT_VERSION([0.17])
116 AM_GNU_GETTEXT([external])
118 # Checks for header files.
120 AC_CHECK_HEADERS([stdlib.h locale.h])
124 # All versions of Solaris from 2.4 have a thread-safe strerror().
125 # Since Solaris 10, in addition strerror_r() exists.
128 AC_CHECK_FUNC([strerror_r], [],
129 AC_MSG_WARN([[Without strerror_r, gpg_strerror_r might not be thread-safe]]))
133 # Checks for typedefs, structures, and compiler characteristics.
136 # Substitution used for gpg-error-config
137 GPG_ERROR_CONFIG_LIBS="-lgpg-error"
138 GPG_ERROR_CONFIG_CFLAGS=""
139 GPG_ERROR_CONFIG_ISUBDIRAFTER=""
140 AC_SUBST(GPG_ERROR_CONFIG_LIBS)
141 AC_SUBST(GPG_ERROR_CONFIG_CFLAGS)
142 AC_SUBST(GPG_ERROR_CONFIG_ISUBDIRAFTER)
143 AC_CONFIG_FILES([src/gpg-error-config], [chmod +x src/gpg-error-config])
146 # Special defines for certain platforms
147 if test "$have_w32_system" = yes; then
148 AC_DEFINE(HAVE_W32_SYSTEM,1,[Defined if we run on a W32 API based system])
149 if test "$have_w32ce_system" = yes; then
150 AC_DEFINE(HAVE_W32CE_SYSTEM,1,[Defined if we run on WindowsCE])
151 GPG_ERROR_CONFIG_ISUBDIRAFTER="gpg-extra"
153 BUILD_TIMESTAMP=`date --iso-8601=minutes`
155 BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
158 *-svn*) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,0" ;;
159 *-cvs) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,0" ;;
160 *-rc*) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,1" ;;
161 *) BUILD_FILEVERSION="${BUILD_FILEVERSION}0,2" ;;
164 AC_SUBST(BUILD_TIMESTAMP)
165 AC_SUBST(BUILD_FILEVERSION)
166 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
167 AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
170 AC_ARG_ENABLE(languages,
171 [ --disable-languages do not build support for other languages than C])
172 AM_CONDITIONAL([LANGUAGES_SOME], [test "x$enable_languages" != xno])
176 AC_CONFIG_FILES([Makefile])
177 AC_CONFIG_FILES([po/Makefile.in m4/Makefile])
178 AC_CONFIG_FILES([src/Makefile tests/Makefile])
179 AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpg-error.asd])
180 AC_CONFIG_FILES([src/versioninfo.rc])
185 Libgpg-error v${VERSION} has been configured as follows: