]> granicus.if.org Git - recode/blob - configure.ac
Update nl.po
[recode] / configure.ac
1 # Configure template for Recode.
2 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 # Process this file with autoconf to produce a configure script.
4
5 AC_PREREQ(2.69)
6 AC_INIT(recode, 3.7.6, [rrt@sc3d.org])
7 AC_CONFIG_SRCDIR(src/recode.c)
8 AC_CONFIG_AUX_DIR([build-aux])
9 AM_INIT_AUTOMAKE
10 AC_CONFIG_MACRO_DIR(m4)
11 AC_CANONICAL_HOST
12
13 dnl Release number rules:
14 dnl This is derived from "Versioning" chapter of info libtool documentation.
15 dnl Format is MAJOR:MINOR:MICRO
16 dnl     4a) Increment major when removing or changing interfaces.
17 dnl     4a) 5) Increment minor when adding interfaces.
18 dnl     6) Set minor to zero when removing or changing interfaces.
19 dnl     3) Increment micro when interfaces not changed at all,
20 dnl               only bug fixes or internal changes made.
21 dnl     4b) Set micro to zero when adding, removing or changing interfaces.
22
23 dnl First extract pieces from the version number string
24 RECODE_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'`
25 RECODE_MINOR_VERSION=`echo $VERSION | awk -F. '{print $2}'`
26 RECODE_MICRO_VERSION=`echo $VERSION | awk -F. '{print $3}'`
27
28 dnl Version info for libraries = CURRENT:REVISION:AGE
29 RECODE_SONUM=$RECODE_MAJOR_VERSION
30 AGE=$RECODE_MINOR_VERSION
31 REVISION=$RECODE_MICRO_VERSION
32 CURRENT=`expr $RECODE_SONUM + $AGE`
33 VERSION_INFO=$CURRENT:$REVISION:$AGE
34 AC_SUBST(VERSION_INFO)
35
36 AC_PROG_CC_C99
37 gl_EARLY
38 LT_INIT
39 AC_PROG_LEX
40 AM_PATH_PYTHON([3.5])
41 gl_INIT
42
43 dnl help2man
44 dnl Set a value even if not found, so that an invocation via build-aux/missing works
45 AC_PATH_PROG([HELP2MAN], [help2man], [help2man])
46
47 dnl Cython
48 AC_CHECK_PROG([CYTHON], [cython], [cython])
49
50 AC_SUBST([objdir])
51 LT_SYS_MODULE_EXT
52 case $host_os in
53   *mingw*|*cygwin* )  pyextext=.dll;;
54   * )                 pyextext=.so;;
55 esac
56 AC_SUBST([pyextext], [$pyextext])
57
58 dnl Extra warnings with GCC and compatible compilers
59 AC_ARG_ENABLE([gcc-warnings],
60   [AS_HELP_STRING([--disable-gcc-warnings],
61                   [turn off lots of GCC warnings])],
62   [case $enableval in
63      yes|no) ;;
64      *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
65    esac
66    gl_gcc_warnings=$enableval],
67   [gl_gcc_warnings=yes]
68 )
69 if test "$gl_gcc_warnings" = yes; then
70   dnl Set up the list of undesired warnings.
71   nw=
72   nw="$nw -Wsystem-headers"   # Don’t let system headers trigger warnings
73   nw="$nw -Wundef"            # All compiler preprocessors support #if UNDEF
74   nw="$nw -Wtraditional"      # All compilers nowadays support ANSI C
75   nw="$nw -Wdeclaration-after-statement" # We require C99.
76   nw="$nw -Wstrict-overflow"  # Use a lower level (see below).
77   nw="$nw -Wconversion"       # These warnings usually don’t point to mistakes.
78   nw="$nw -Wsign-conversion"  # Likewise.
79
80   gl_MANYWARN_ALL_GCC([warnings])
81
82   dnl Enable all GCC warnings not in this list.
83   gl_MANYWARN_COMPLEMENT([warnings], [$warnings], [$nw])
84   for w in $warnings; do
85     gl_WARN_ADD([$w])
86   done
87
88   dnl Add an extra warning
89   gl_WARN_ADD([-Wstrict-overflow=1])
90   dnl Add some more safety measures
91   gl_WARN_ADD([-D_FORTIFY_SOURCE=2])
92   dnl Remove a warning being promoted to error: we trigger this and can't turn it off with pragmas.
93   gl_WARN_ADD([-Wno-error=format-security])
94
95   # When compiling with GCC, prefer -isystem to -I when including system
96   # include files, to avoid generating useless diagnostics for the files.
97   ISYSTEM='-isystem '
98 else
99   ISYSTEM='-I'
100 fi
101 AC_SUBST([ISYSTEM])
102
103 # Extra settings for running tests, e.g. LD_PRELOAD for ASAN
104 AC_SUBST([TESTS_ENVIRONMENT_EXTRA])
105
106 AC_CONFIG_HEADERS([config.h])
107 AC_HEADER_STDC
108 AM_ICONV
109 LIBS="$LIBICONV $LIBS"
110 AM_WITH_DMALLOC
111
112 AM_GNU_GETTEXT_VERSION(0.19)
113 AM_GNU_GETTEXT(external)
114 AM_XGETTEXT_OPTION([--from-code=UTF-8])
115
116 AC_OUTPUT(Makefile contrib/Makefile doc/Makefile lib/Makefile
117           po/Makefile.in src/Makefile tests/Makefile tests/setup.py)