Debian Codegraph @

configure.in

raw ◀ ▶
6 Debian patches touch this file
1 dnl *************************************************************************
2 dnl * GSM TA/ME library
3 dnl *
4 dnl * File: configure.in
5 dnl *
6 dnl * Purpose: autoconf configure script template
7 dnl *
8 dnl * Author: Peter Hofmann ([email protected])
9 dnl *
10 dnl * Created: 11.11.1999
11 dnl *************************************************************************
12
13 dnl Process this file with autoconf to produce a configure script.
14 AC_INIT(gsmlib/gsm_error.h)
15
16 dnl Other
17 AC_CONFIG_AUX_DIR(scripts)
•18 AC_CONFIG_MACRO_DIR([m4])
19 AC_PROG_INSTALL
20
21 dnl check for libintl
22 AC_CHECK_LIB(intl, textdomain)
23
24 dnl use config header
25 AM_CONFIG_HEADER(gsm_config.h)
26
27 dnl use automake
28 AM_INIT_AUTOMAKE(gsmlib, 1.10)
29
30 dnl change to no if you want no shared libraries for debugging purposes
31 AM_ENABLE_SHARED(yes)
32
33 dnl use -O2 optimization by default
34 if test "$CXXFLAGS" = ""; then
35 CXXFLAGS="-O2"
36 fi
37
•38 AC_USE_SYSTEM_EXTENSIONS
39
40 dnl comment out this line to get extensive debugging output and asserts
41 dnl CXXFLAGS="-DNDEBUG $CXXFLAGS"
42
43 dnl uncomment to get translations without installing gsmlib
44 dnl CXXFLAGS="-DLOCAL_TRANSLATIONS $CXXFLAGS"
45
46 dnl check _REENTRANT in header files
47 if test x"`egrep _REENTRANT /usr/include/features.h`" != x; then
48 CXXFLAGS="-D_REENTRANT $CXXFLAGS"
49 CFLAGS="-D_REENTRANT $CFLAGS"
50 fi
51
52 dnl output all warnings
53 CXXFLAGS="-Wall $CXXFLAGS"
54
•55 dnl use libtool
56 AM_PROG_LIBTOOL
57
58 dnl Checks for programs.
59 AC_PROG_CPP
60 AC_PROG_CXX
61
•62 AC_LANG([C++])
•63
64 dnl Debian-specific: Enforce C++14 (not C++17)
65 AX_CHECK_COMPILE_FLAG([-std=c++14], [CXXFLAGS="$CXXFLAGS -std=c++14"])
66
67 dnl check for gcc 2.95.x
68 AC_TRY_COMPILE([#include <unistd.h>],[
69 #if defined(__GNUC__) && \
70 ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
•71 # error gcc too old
72 return 1;
73 #endif
74 ],,
75 [echo "need at least gcc 2.95 to compile correctly"
76 exit 1])
77
78 dnl check for alloca
79 AC_FUNC_ALLOCA
80
81 dnl check for getopt_long in the C library
82 AC_CHECK_LIB(c, getopt_long, AC_DEFINE(HAVE_GETOPT_LONG))
83
84 dnl check for alarm in the C library
85 AC_CHECK_LIB(c, alarm, AC_DEFINE(HAVE_ALARM))
86
87 dnl check for netinet/in.h header
88 AC_CHECK_HEADERS(netinet/in.h)
89
90 dnl check for string.h header
91 AC_CHECK_HEADERS(string.h)
92
93 dnl check for libintl.h header
94 AC_CHECK_HEADERS(libintl.h)
95
96 dnl Checks for typedefs, structures, and compiler characteristics.
97 AC_C_CONST
98
99 dnl check for vsnprintf()
100 dnl AC_FUNC_VPRINTF
101 AC_EGREP_HEADER(vsnprintf, stdio.h, AC_DEFINE(HAVE_VSNPRINTF))
102
103 dnl checks for builtin data type sizes
104 AC_CHECK_SIZEOF(unsigned short int, 2)
105 AC_CHECK_SIZEOF(unsigned long int, 4)
106 AC_CHECK_SIZEOF(unsigned int, 4)
107
108 dnl Project-specific settings
109 GSM_VERSION="1:4:0"
110 AC_SUBST(GSM_VERSION)
111
112 dnl national language support (NLS)
113 LINGUAS="de"
114 ALL_LINGUAS=$LINGUAS
•115 AM_GNU_GETTEXT([external])
•116 AM_GNU_GETTEXT_VERSION([0.23])
117 dnl AM_GLIB_GNU_GETTEXT
118
119 dnl set locale dir (FIXME there must be a better way)
120 _localedir=`eval "echo $datadir/locale"`
121 if test "$_localedir" = "NONE/share/locale"; then
122 AC_DEFINE_UNQUOTED(LOCALEDIR, "/usr/local/share/locale")
123 else
124 _localedir=`echo \"$_localedir\"`
125 AC_DEFINE_UNQUOTED(LOCALEDIR, $_localedir)
126 fi
127
128 dnl whether to compile the intl directory
129 AM_CONDITIONAL(COMPILE_INTL, test x$USE_INCLUDED_LIBINTL = xyes)
130
131 AC_OUTPUT(Makefile gsmlib/Makefile tests/Makefile apps/Makefile win32/Makefile
132 doc/Makefile scripts/Makefile intl/Makefile po/Makefile.in
133 ext/Makefile,
134 echo timestamp > stamp-h)
135
136 dnl repair Makefile in po subdir
137 dnl sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile