~ubuntu-branches/ubuntu/trusty/judy/trusty

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Troy Heber
  • Date: 2005-03-22 06:55:53 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050322065553-syjpkd48r4re18dn
Tags: 1.0.1-5

* Moving LGPL link in copyright back to LGPL-2.1
* Cleanup of debian/rules: removed explicit refs to 32-bit archs, removed
  unnecessary nostrip, using --man dir to install man pages, moving from
  dh_movefiles to dh_install.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_PREREQ(2.57)
 
2
AC_INIT(Judy, 1.0.0, doug@sourcejudy.com)
 
3
 
 
4
AM_MAINTAINER_MODE
 
5
 
 
6
dnl Turn on automake, and pass it the PACKAGE_NAME and PACKAGE_VERSION, too.
 
7
AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
 
8
 
 
9
dnl Tell autoconf we want to keep our preprocessor defines in a header named
 
10
dnl config.h.  This keeps automake from passing a zillion -D directives to
 
11
dnl the C compiler.
 
12
AM_CONFIG_HEADER([config.h])
 
13
 
 
14
dnl==========================================================================
 
15
dnl WARNING - WARNING - Shared Library Versioning - WARNING - WARNING
 
16
dnl==========================================================================
 
17
dnl This is the most dangerous part of this file--making a mistake here can
 
18
dnl cause massively painful chaos for libJudy developers, and potentially
 
19
dnl even end users.  So PLEASE pay attention, and read up on the theory of
 
20
dnl shared library versioning.  Tens of thousands of Linux users (and several
 
21
dnl QA departments) may thank you someday.
 
22
dnl
 
23
dnl There are two major concerns:
 
24
dnl
 
25
dnl   1) When changing the libJudy ABI (application binary interface),
 
26
dnl      VERSION_INFO *must* be updated according to libtool's rules.  Failure
 
27
dnl      to do this will make applications using libJudy dump core, typically
 
28
dnl      under obscure conditions on user systems.  I won't attempt to
 
29
dnl      explain these rules here; please see 'info libtool' for details.
 
30
dnl
 
31
dnl   2) When changing the libJudy ABI, it is also desirable to make libJudy
 
32
dnl      "parallel installable".  This means that it should be possible to
 
33
dnl      install development headers and libraries for more than one version
 
34
dnl      of libJudy at once.  Failure to do this may cause problems for
 
35
dnl      Linux distributions which include libJudy.  (For example, it's
 
36
dnl      impossible to switch between libpng2-dev and libpng3-dev on a
 
37
dnl      Debian system without uninstalling and reinstalling both the Gnome
 
38
dnl      and KDE SDKs.)  For more information, do a Google search for
 
39
dnl      "parallel installable".
 
40
dnl
 
41
dnl Right now, this package only provides the mechanisms to handle concern
 
42
dnl (1).  Concern (2) is slightly more complicated, and will require some
 
43
dnl careful thinking.  Fortunately, concern (2) doesn't become important
 
44
dnl until other SDKs rely on the libJudy SDK.
 
45
dnl
 
46
dnl Of course, it's safe to avoid changing the libJudy ABI. :-)
 
47
dnl 
 
48
dnl The version scheme used by Libtool tracks interfaces, where an interface is
 
49
dnl the set of exported entry points into the library. All Libtool libraries
 
50
dnl start with -version-info set to 0:0:0 - this will be the default version
 
51
dnl number if you don't explicitly set it on the Libtool link command line. The
 
52
dnl meaning of these numbers (from left to right) is as follows:
 
53
dnl 
 
54
dnl  current:
 
55
dnl     The number of the current interface exported by the library. A current
 
56
dnl     value of 0, means that you are calling the interface exported by this
 
57
dnl     library interface 0.
 
58
dnl
 
59
dnl  revision:
 
60
dnl     The implementation number of the most recent interface exported by this
 
61
dnl     library. In this case, a revision value of 0 means that this is the
 
62
dnl     first implementation of the interface.
 
63
dnl 
 
64
dnl     If the next release of this library exports the same interface, but has
 
65
dnl     different implementation (perhaps some bugs have been fixed), the
 
66
dnl     revision number will be higher, but current number will be the same. In
 
67
dnl     that case, when given a choice, the library with the highest revision
 
68
dnl     will always be used by the runtime loader.
 
69
dnl
 
70
dnl   age:
 
71
dnl     The number of previous additional interfaces supported by this library.
 
72
dnl     If age were 2, then this library can be linked into executables which
 
73
dnl     were built with a release of this library that exported the current
 
74
dnl     interface number, current, or any of the previous two interfaces.
 
75
dnl
 
76
dnl By definition age must be less than or equal to current. At the outset, only
 
77
dnl the first ever interface is implemented, so age can only be 0.
 
78
dnl 
 
79
 
 
80
VERSION_INFO="-version-info 1:1:0"
 
81
AC_SUBST(VERSION_INFO)
 
82
 
 
83
dnl==========================================================================
 
84
dnl Flavors
 
85
dnl==========================================================================
 
86
dnl Judy can be compiled in one of three flavors: "product" (the default),
 
87
dnl "debug", or "cov".  We allow the user to select flavors using
 
88
dnl --enable-debug and --enable-ccover arguments to automake, which is
 
89
dnl the typical way of doing things.
 
90
dnl 
 
91
dnl Note how we perform string comparison:
 
92
dnl
 
93
dnl   if test "x$enable_debug" = xyes; then
 
94
dnl
 
95
dnl We do several odd things here:
 
96
dnl
 
97
dnl   1) We use 'test' instead of '[ ]' for shell portability.
 
98
dnl   2) We prefix strings with 'x' when comparing them, to protect against
 
99
dnl      empty strings.
 
100
dnl   3) We ALWAYS quote user-supplied shell variables, to protect against
 
101
dnl      embedded spaces.
 
102
dnl
 
103
dnl The results of this test aren't used anywhere yet.
 
104
 
 
105
dnl Keep the user entertained.
 
106
AC_MSG_CHECKING(which flavor to build)
 
107
 
 
108
dnl Process our --enable-debug argument.
 
109
AC_ARG_ENABLE(debug,
 
110
              AC_HELP_STRING([--enable-debug],
 
111
                             [enable debugging features]),
 
112
              , enable_debug=no)
 
113
if test "x$enable_debug" != xyes -a "x$enable_debug" != xno; then
 
114
   AC_MSG_ERROR(You may not pass an argument to --enable-debug)
 
115
fi
 
116
 
 
117
dnl Process our --enable-ccover argument.
 
118
AC_ARG_ENABLE(ccover,
 
119
              AC_HELP_STRING([--enable-ccover],
 
120
                             [enable use of ccover code coverage tools]),
 
121
              , enable_ccover=no)
 
122
if test "x$enable_ccover" != xyes -a "x$enable_ccover" != xno; then
 
123
   AC_MSG_ERROR(You may not pass an argument to --enable-ccover)
 
124
fi
 
125
 
 
126
dnl Determine our flavor.
 
127
if test "x$enable_debug" = xyes -a "x$enable_ccover" = xyes; then
 
128
   AC_MSG_ERROR(You may not use --enable-debug and --enable-ccover together)
 
129
elif test "x$enable_debug" = xyes; then
 
130
   FLAVOR=debug
 
131
elif test "x$enable_ccover" = xyes; then
 
132
   FLAVOR=cov
 
133
else
 
134
   FLAVOR=product
 
135
fi
 
136
 
 
137
dnl Define FLAVOR in our makefiles.
 
138
AC_SUBST(FLAVOR)
 
139
 
 
140
dnl Tell the user what flavor we've decided to build.
 
141
AC_MSG_RESULT($FLAVOR)
 
142
 
 
143
 
 
144
dnl==========================================================================
 
145
dnl Checks for Programs
 
146
dnl==========================================================================
 
147
AC_PROG_CC
 
148
AC_PROG_CPP
 
149
AC_PROG_INSTALL
 
150
AC_PROG_LN_S
 
151
AC_PROG_MAKE_SET
 
152
 
 
153
dnl==========================================================================
 
154
dnl Checks for Header Files
 
155
dnl==========================================================================
 
156
AC_HEADER_STDC
 
157
AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h])
 
158
 
 
159
dnl==========================================================================
 
160
dnl Checks for Typedefs, Structures, and Compiler Characteristics
 
161
dnl==========================================================================
 
162
 
 
163
dnl Standard, boring stuff.
 
164
AC_HEADER_STDBOOL
 
165
AC_C_CONST
 
166
AC_C_INLINE
 
167
AC_TYPE_SIZE_T
 
168
AC_HEADER_TIME
 
169
AC_STRUCT_TM
 
170
AC_C_VOLATILE
 
171
AC_CHECK_TYPES([ptrdiff_t])
 
172
 
 
173
dnl If we're compiling for a little-endian system, define JU_LITTLE_ENDIAN.
 
174
dnl If we can't tell what kind of system we're compling for, alert the
 
175
dnl user as described in 'info autoconf'.
 
176
AC_C_BIGENDIAN(, AC_DEFINE(JU_LITTLE_ENDIAN, 1,
 
177
                           [Define to 1 on little-endian systems.]))
 
178
 
 
179
 
 
180
AC_ARG_ENABLE(32-bit, [ --enable-32-bit          Generate code for a 32-bit environment],
 
181
              b32="$enableval", b32="no")
 
182
if test x"$b32" != "xno"; then
 
183
    AC_MSG_RESULT(Building 32-bit)
 
184
    CFLAGS="-UJU_64BIT $CFLAGS"
 
185
fi
 
186
 
 
187
AC_ARG_ENABLE(64-bit, [ --enable-64-bit          Generate code for a 64-bit environment],
 
188
              b64="$enableval", b64="no")
 
189
if test x"$b64" != "xno"; then
 
190
    AC_MSG_RESULT(Building 64-bit)
 
191
    CFLAGS="-DJU_64BIT $CFLAGS"
 
192
fi
 
193
 
 
194
if test x"$b32" = "xno"; then 
 
195
    if test x"$b64" = "xno"; then
 
196
        AC_MSG_ERROR([You must run configure with either: 
 
197
                      --enable-32-bit 
 
198
                      --enable-64-bit]);
 
199
    fi
 
200
fi
 
201
 
 
202
#  dnl Determine whether or not we're compiling for a 64-bit system by looking
 
203
#  dnl at the size of a 'long'.  This will define SIZEOF_LONG in config.h.  We
 
204
#  dnl append some text to the bottom of config.h to set JU_64BIT appropriately.
 
205
#  dnl we try to do the correct thing if the user doesn't chose for us. 
 
206
#  AC_CHECK_SIZEOF(long)
 
207
#  AH_BOTTOM([/* Define JU_64BIT to 1 if we're on a 64-bit system. */
 
208
#  if SIZEOF_LONG == 8
 
209
#    define JU_64BIT 1
 
210
#  endif])
 
211
#fi
 
212
 
 
213
dnl==========================================================================
 
214
dnl Checks for Libraries
 
215
dnl==========================================================================
 
216
 
 
217
AC_FUNC_ERROR_AT_LINE
 
218
AC_FUNC_MALLOC
 
219
AC_FUNC_MEMCMP
 
220
AC_FUNC_MMAP
 
221
AC_FUNC_STAT
 
222
AC_FUNC_VPRINTF
 
223
AC_CHECK_FUNCS([getpagesize gettimeofday memset munmap pow strchr strcspn strerror strstr strtoul uname])
 
224
 
 
225
dnl These must be called before AM_PROG_LIBTOOL, because it may want
 
226
dnl to call AC_CHECK_PROG.
 
227
AC_CHECK_TOOL(AR, ar)
 
228
AC_CHECK_TOOL(LD, ld)
 
229
AC_CHECK_TOOL(RANLIB, ranlib, :)
 
230
 
 
231
dnl Checks for libtool - this must be done after we set cflags (abi issues)
 
232
dnl
 
233
AM_PROG_LIBTOOL
 
234
 
 
235
WARN_CFLAGS=""
 
236
build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
 
237
AC_ARG_ENABLE([build-warnings],
 
238
              [  --enable-build-warnings    Enable build-time compiler warnings for gcc])
 
239
if test x"$build_warnings" = xyes; then
 
240
    if test x"$GCC" = xyes; then
 
241
        WARN_CFLAGS="${build_warnings}"
 
242
    fi
 
243
fi
 
244
 
 
245
AC_SUBST(WARN_CFLAGS)
 
246
 
 
247
AC_CONFIG_FILES([Makefile
 
248
                 src/Judy1/Makefile
 
249
                 src/JudyCommon/Makefile
 
250
                 src/JudyHS/Makefile
 
251
                 src/JudyL/Makefile
 
252
                 src/JudySL/Makefile
 
253
                 src/Makefile
 
254
                 src/obj/Makefile
 
255
                 tool/Makefile
 
256
                 doc/Makefile
 
257
                 test/Makefile])
 
258
 
 
259
 
 
260
AC_OUTPUT