- rename deprecated configure.in to configure.ac (Ralf)
[apt.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.59)
4 AC_INIT([apt],[0.5.15lorg3.1],[apt-rpm@lists.laiskiainen.org])
5 dnl Check the archs, we want the target type.
6 AC_CONFIG_AUX_DIR([buildlib])
7 AC_CANONICAL_HOST
8 AC_CONFIG_SRCDIR([AUTHORS.RPM])
9 AM_INIT_AUTOMAKE([foreign subdir-objects dist-bzip2 1.9.5])
10 AM_MAINTAINER_MODE
11
12 AC_CONFIG_HEADER([include/config.h:buildlib/config.h.in])
13
14 AC_PROG_LIBTOOL
15
16 dnl Check our C compiler
17 AC_PROG_CC
18 AM_PROG_CC_C_O
19 AC_ISC_POSIX
20
21 dnl Check for other programs
22 AC_PROG_CXX
23 AC_PROG_CPP
24
25 dnl Checks for sockets
26 SAVE_LIBS="$LIBS"
27 LIBS=""
28 AC_SEARCH_LIBS(gethostbyname,nsl)
29 AC_SEARCH_LIBS(connect,socket)
30 SOCKETLIBS="$LIBS"
31 AC_SUBST(SOCKETLIBS)
32 LIBS="$SAVE_LIBS"
33  
34 dnl Checks for pthread -- disabled due to glibc bugs jgg
35 dnl AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
36 AC_SUBST(PTHREADLIB)
37 dnl if test "$PTHREADLIB" != "-lpthread"; then
38 dnl   AC_MSG_ERROR(failed: I need posix threads, pthread)
39 dnl fi
40
41 dnl Check for RPM executable path
42 AC_PATH_PROG(RPM_PATH,rpm,none)
43 if test "$RPM_PATH" = "none"; then
44    AC_MSG_ERROR([RPM executable was not found in your system])
45 else
46    AC_DEFINE_UNQUOTED([HAVE_RPM],1,[Define if RPM backend is available])
47
48    dnl Check for RPM version
49    AC_MSG_CHECKING(for RPM version)
50    RPM_VERSION_RAW=`LANG= LC_ALL= $RPM_PATH --version | sed 's/^RPM version //'`
51    RPM_VERSION_MAJOR=`echo $RPM_VERSION_RAW | cut -d. -f1`
52    RPM_VERSION_MINOR=`echo $RPM_VERSION_RAW | cut -d. -f2`
53    RPM_VERSION_MICRO=`echo $RPM_VERSION_RAW | cut -d. -f3`
54    if test -z "$RPM_VERSION_MAJOR" -o -z "$RPM_VERSION_MINOR"; then
55       AC_MSG_ERROR([can't parse RPM version])
56    fi
57    if test -z "$RPM_VERSION_MICRO"; then
58       RPM_VERSION_MICRO=0
59    fi
60    AC_DEFINE_UNQUOTED([RPM_VERSION_MAJOR],$RPM_VERSION_MAJOR,[RPM major version])
61    AC_DEFINE_UNQUOTED([RPM_VERSION_MINOR],$RPM_VERSION_MINOR,[RPM minor version])
62    AC_DEFINE_UNQUOTED([RPM_VERSION_MICRO],$RPM_VERSION_MICRO,[RPM micro version])
63    AC_DEFINE_UNQUOTED([RPM_VERSION],
64       [((RPM_VERSION_MAJOR<<16)|(RPM_VERSION_MINOR<<8)|RPM_VERSION_MICRO)],
65       [Define to the RPM version])
66    AC_DEFINE_UNQUOTED([RPM_VERSION_RAW],"$RPM_VERSION_RAW",[RPM raw version])
67    AC_MSG_RESULT($RPM_VERSION_RAW)
68
69    dnl Check for RPM libraries and headers
70
71    AC_CHECK_LIB(bz2,BZ2_bzopen, [],
72                 [AC_MSG_ERROR([Can't find libbz2 library])])
73    AC_CHECK_LIB(z,gzopen, [],
74                 [AC_MSG_ERROR([Can't find libz library])])
75    AC_CHECK_HEADERS(db1/db.h)
76
77    CPPFLAGS="$CPPFLAGS -I/usr/include/rpm"
78    AC_CHECK_HEADER(rpm/rpmlib.h, [],
79                    [AC_MSG_ERROR([Can't find rpmlib.h])])
80
81    if test $RPM_VERSION_MAJOR -lt 4; then
82       RPMLIBS="-lrpm -lz -lbz2 -lpopt"
83    else
84       AC_CHECK_LIB(rpmdb,rpmdbOpen,
85          [RPMDBLIBS="-lrpmdb"],
86          [RPMDBLIBS="-ldb-3.1"],
87          [-lrpm -lrpmio -lz -lbz2 -lpopt])
88       RPMLIBS="-lrpm $RPMDBLIBS -lrpmio -lz -lbz2 -lpopt"
89    fi
90    AC_MSG_CHECKING(for RPM libraries)
91    AC_MSG_RESULT($RPMLIBS)
92    AC_SUBST(RPMLIBS)
93 fi
94
95 dnl repomd support needs libxml2, not sure about the minimal version - I've
96 dnl only tested it with 2.6.20
97 ## xmlReadFile is not available before 2.6.0
98 PKG_CHECK_MODULES([LIBXML2],[libxml-2.0 >= 2.6])
99 RPMLIBS="$LIBXML2_LIBS $RPMLIBS"
100 CPPFLAGS="$LIBXML2_CFLAGS $CPPFLAGS"
101
102 dnl Can we use g++ hash_map?
103 AH_TEMPLATE(WITH_GNU_HASH_MAP,
104             [Define to 1 if you want to use the g++ hash_map extension.])
105 AC_MSG_CHECKING(for g++ hash_map extension)
106 AC_LANG_PUSH([C++])
107 AC_TRY_LINK(
108 [
109 #include <ext/hash_map>
110 using namespace __gnu_cxx;
111 ],[hash_map<char*,hash<char*> > HashMap;
112 ],[AC_DEFINE_UNQUOTED(WITH_GNU_HASH_MAP, 1) AC_MSG_RESULT(yes)
113 ],[AC_MSG_RESULT(no)])
114 AC_LANG_POP([C++])
115
116 dnl CNC:2003-03-20
117 AC_MSG_CHECKING(for --disable-scripts)
118 AC_ARG_ENABLE([scripts],
119               AC_HELP_STRING(--disable-scripts, disable the extension system),
120               [enable_scripts="$enableval"],[enable_scripts="yes"])
121 if test "$enable_scripts" != "no"; then
122   AC_MSG_RESULT(no)
123   AC_DEFINE(WITH_LUA, 1, 
124             [Define if you want to enable the extension system.]) 
125 else
126   AC_MSG_RESULT(yes)
127 fi
128 AM_CONDITIONAL(WITH_LUA, test "$enable_scripts" != "no")
129
130 dnl Before configuring libtool check for --enable-static-progs option
131 AC_MSG_CHECKING(for --enable-static-progs)
132 AC_ARG_ENABLE(static-progs,
133               AC_HELP_STRING([--enable-static-progs],
134                              [Build completely static (standalone) binaries.]),
135               [enable_static_progs="$enableval"],[enable_static_progs="no"])
136 AM_CONDITIONAL(COMPILE_STATIC, test "$enable_static_progs" = "yes")
137 if test "$enable_static_progs" = "yes" ; then
138   AC_MSG_RESULT(yes)
139 else
140   AC_MSG_RESULT(no)
141 fi
142
143 dnl Check for apt-shell dependencies
144 AC_CHECK_LIB(ncurses,tputs,
145   [AC_CHECK_HEADER(readline/readline.h,
146      [AC_CHECK_LIB(readline,rl_completion_matches,
147         [compile_aptshell=yes],,[-lncurses])])])
148 AM_CONDITIONAL(COMPILE_APTSHELL, test "$compile_aptshell" = "yes")
149
150 dnl Converts the ARCH to be something singular for this general CPU family
151 dnl This is often the dpkg architecture string.
152 AH_TEMPLATE(COMMON_CPU, [Define the common CPU])
153 AH_TEMPLATE(COMMON_OS, [Define the common OS])
154 AC_MSG_CHECKING(system architecture)
155 archset="`awk \" ! /^#|^\\\$/ { if(match(\\\"$host_cpu\\\",\\\"^\\\"\\\$1\\\"\\\$\\\")) {print \\\$2; exit}}\" $srcdir/buildlib/archtable`"
156 if test "x$archset" = "x"; then
157   AC_MSG_ERROR(failed: use --host=)
158 fi
159 AC_MSG_RESULT($archset)
160 AC_DEFINE_UNQUOTED(COMMON_CPU,"$archset")
161
162 dnl Get a common name for the host OS - this is primarily only for HURD and is
163 dnl non fatal if it fails
164 AC_MSG_CHECKING(system OS)
165 osset="`awk \" ! /^#|^\\\$/ {if (match(\\\"$host_vendor-$host_os\\\",\\\$1)) {print \\\$2; exit}}\" $srcdir/buildlib/ostable`"
166 AC_MSG_RESULT($osset)
167 AC_DEFINE_UNQUOTED(COMMON_OS,"$osset")
168
169 dnl We use C99 types if at all possible
170 AC_CACHE_CHECK([for C99 integer types],c9x_ints,[
171     AC_TRY_COMPILE([#include <inttypes.h>],
172                    [uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;],
173                    c9x_ints=yes,c9x_ints=no)])
174
175 AC_C_BIGENDIAN
176
177 dnl Check the sizes etc. of the architecture
178 dnl Cross compilers can either get a real C library or preload the cache
179 dnl with their size values.
180 AC_CHECK_SIZEOF(char)
181 AC_CHECK_SIZEOF(int)
182 AC_CHECK_SIZEOF(short)
183 AC_CHECK_SIZEOF(long)
184
185 dnl Single Unix Spec statvfs
186 AC_CHECK_FUNC(statvfs,[have_statvfs=yes])
187
188 dnl Arg, linux and bsd put their statfs function in different places
189 AH_TEMPLATE(HAVE_VFS_H, [Define to 1 if sys/vfs.h is available])
190 AH_TEMPLATE(HAVE_MOUNT_H, [Define to 1 if sys/mount.h is available])
191 if test "$have_statvfs" != "yes"; then
192    AC_EGREP_HEADER(statfs,sys/vfs.h,[AC_DEFINE(HAVE_VFS_H)],[
193         AC_EGREP_HEADER(statfs,sys/mount.h,[AC_DEFINE(HAVE_MOUNT_H)],
194                         [AC_MSG_ERROR(failed: Need statvfs)])
195    ])
196 fi
197
198 dnl We should use the real timegm function if we have it.
199 AH_TEMPLATE(HAVE_TIMEGM, [Define to 1 if timegm is available])
200 AC_CHECK_FUNC(timegm,AC_DEFINE(HAVE_TIMEGM))
201 AC_SUBST(HAVE_TIMEGM)
202
203 dnl HP-UX sux..
204 AH_TEMPLATE(NEED_SOCKLEN_T_DEFINE, [Define to 1 if socket_t is missing])
205 AC_MSG_CHECKING(for missing socklen_t)
206 AC_EGREP_HEADER(socklen_t, sys/socket.h,[AC_MSG_RESULT(no)],[
207         AC_DEFINE(NEED_SOCKLEN_T_DEFINE)
208         NEED_SOCKLEN_T_DEFINE=yes
209         AC_MSG_RESULT(missing.)])
210 AC_SUBST(NEED_SOCKLEN_T_DEFINE)
211
212 dnl HP-UX needs -d_XOPEN_SOURCE_EXTENDED for h_errno
213 AC_MSG_CHECKING(for h_errno)
214 AC_EGREP_HEADER(h_errno, netdb.h, [AC_MSG_RESULT(normal)],
215    [CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
216     AC_EGREP_HEADER(h_errno, netdb.h, 
217        [AC_MSG_RESULT(needs _XOPEN_SOURCE_EXTENDED)],
218        [AC_MSG_ERROR("not found.")])
219    ])
220
221 dnl Check for debiandoc
222 dnl AC_PATH_PROG(DEBIANDOC_HTML,debiandoc2html)
223 dnl AC_PATH_PROG(DEBIANDOC_TEXT,debiandoc2text)
224
225 AC_PATH_PROG([GPG],[gpg],[/usr/bin/gpg])
226
227 AM_GNU_GETTEXT_VERSION([0.14.5])
228 AM_GNU_GETTEXT([external])
229
230 dnl ah_NUM_PROCS
231 rc_GLIBC_VER
232 rc_LIBSTDCPP_VER
233 dnl ah_GCC3DEP
234
235 AC_CONFIG_FILES([
236           Makefile
237           lua/Makefile
238           apt-pkg/Makefile
239           methods/Makefile
240           cmdline/Makefile
241           tools/Makefile
242           doc/Makefile
243           po/Makefile.in
244           ])
245 AC_CONFIG_LINKS([include/apti18n.h:buildlib/gettext.h])
246
247 AS_IF([test "$c9x_ints" = "no"],[
248 AC_CONFIG_LINKS([include/inttypes.h:buildlib/inttypes.h])
249 ])
250
251 AS_IF([test "$have_statvfs" != "yes"],[
252 AC_CONFIG_LINKS([include/statvfs.h:buildlib/statvfs.h])
253 ])
254
255 AS_IF([test "$NEED_SOCKLEN_T_DEFINE" = "yes"],[
256 AC_CONFIG_LINKS([include/netdb.h:buildlib/netdb.h])
257 ])
258
259 AC_OUTPUT
260 dnl Process this file with autoconf to produce a configure script.
261
262 AC_PREREQ(2.59)
263 AC_INIT([apt],[0.5.15lorg3.1],[apt-rpm@lists.laiskiainen.org])
264 dnl Check the archs, we want the target type.
265 AC_CONFIG_AUX_DIR([buildlib])
266 AC_CANONICAL_HOST
267 AC_CONFIG_SRCDIR([AUTHORS.RPM])
268 AM_INIT_AUTOMAKE([foreign subdir-objects dist-bzip2 1.9.5])
269 AM_MAINTAINER_MODE
270
271 AC_CONFIG_HEADER([include/config.h:buildlib/config.h.in])
272
273 AC_PROG_LIBTOOL
274
275 dnl Check our C compiler
276 AC_PROG_CC
277 AM_PROG_CC_C_O
278 AC_ISC_POSIX
279
280 dnl Check for other programs
281 AC_PROG_CXX
282 AC_PROG_CPP
283
284 dnl Checks for sockets
285 SAVE_LIBS="$LIBS"
286 LIBS=""
287 AC_SEARCH_LIBS(gethostbyname,nsl)
288 AC_SEARCH_LIBS(connect,socket)
289 SOCKETLIBS="$LIBS"
290 AC_SUBST(SOCKETLIBS)
291 LIBS="$SAVE_LIBS"
292  
293 dnl Checks for pthread -- disabled due to glibc bugs jgg
294 dnl AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
295 AC_SUBST(PTHREADLIB)
296 dnl if test "$PTHREADLIB" != "-lpthread"; then
297 dnl   AC_MSG_ERROR(failed: I need posix threads, pthread)
298 dnl fi
299
300 dnl Check for RPM executable path
301 AC_PATH_PROG(RPM_PATH,rpm,none)
302 if test "$RPM_PATH" = "none"; then
303    AC_MSG_ERROR([RPM executable was not found in your system])
304 else
305    AC_DEFINE_UNQUOTED([HAVE_RPM],1,[Define if RPM backend is available])
306
307    dnl Check for RPM version
308    AC_MSG_CHECKING(for RPM version)
309    RPM_VERSION_RAW=`LANG= LC_ALL= $RPM_PATH --version | sed 's/^RPM version //'`
310    RPM_VERSION_MAJOR=`echo $RPM_VERSION_RAW | cut -d. -f1`
311    RPM_VERSION_MINOR=`echo $RPM_VERSION_RAW | cut -d. -f2`
312    RPM_VERSION_MICRO=`echo $RPM_VERSION_RAW | cut -d. -f3`
313    if test -z "$RPM_VERSION_MAJOR" -o -z "$RPM_VERSION_MINOR"; then
314       AC_MSG_ERROR([can't parse RPM version])
315    fi
316    if test -z "$RPM_VERSION_MICRO"; then
317       RPM_VERSION_MICRO=0
318    fi
319    AC_DEFINE_UNQUOTED([RPM_VERSION_MAJOR],$RPM_VERSION_MAJOR,[RPM major version])
320    AC_DEFINE_UNQUOTED([RPM_VERSION_MINOR],$RPM_VERSION_MINOR,[RPM minor version])
321    AC_DEFINE_UNQUOTED([RPM_VERSION_MICRO],$RPM_VERSION_MICRO,[RPM micro version])
322    AC_DEFINE_UNQUOTED([RPM_VERSION],
323       [((RPM_VERSION_MAJOR<<16)|(RPM_VERSION_MINOR<<8)|RPM_VERSION_MICRO)],
324       [Define to the RPM version])
325    AC_DEFINE_UNQUOTED([RPM_VERSION_RAW],"$RPM_VERSION_RAW",[RPM raw version])
326    AC_MSG_RESULT($RPM_VERSION_RAW)
327
328    dnl Check for RPM libraries and headers
329
330    AC_CHECK_LIB(bz2,BZ2_bzopen, [],
331                 [AC_MSG_ERROR([Can't find libbz2 library])])
332    AC_CHECK_LIB(z,gzopen, [],
333                 [AC_MSG_ERROR([Can't find libz library])])
334    AC_CHECK_HEADERS(db1/db.h)
335
336    CPPFLAGS="$CPPFLAGS -I/usr/include/rpm"
337    AC_CHECK_HEADER(rpm/rpmlib.h, [],
338                    [AC_MSG_ERROR([Can't find rpmlib.h])])
339
340    if test $RPM_VERSION_MAJOR -lt 4; then
341       RPMLIBS="-lrpm -lz -lbz2 -lpopt"
342    else
343       AC_CHECK_LIB(rpmdb,rpmdbOpen,
344          [RPMDBLIBS="-lrpmdb"],
345          [RPMDBLIBS="-ldb-3.1"],
346          [-lrpm -lrpmio -lz -lbz2 -lpopt])
347       RPMLIBS="-lrpm $RPMDBLIBS -lrpmio -lz -lbz2 -lpopt"
348    fi
349    AC_MSG_CHECKING(for RPM libraries)
350    AC_MSG_RESULT($RPMLIBS)
351    AC_SUBST(RPMLIBS)
352 fi
353
354 dnl repomd support needs libxml2, not sure about the minimal version - I've
355 dnl only tested it with 2.6.20
356 ## xmlReadFile is not available before 2.6.0
357 PKG_CHECK_MODULES([LIBXML2],[libxml-2.0 >= 2.6])
358 RPMLIBS="$LIBXML2_LIBS $RPMLIBS"
359 CPPFLAGS="$LIBXML2_CFLAGS $CPPFLAGS"
360
361 dnl Can we use g++ hash_map?
362 AH_TEMPLATE(WITH_GNU_HASH_MAP,
363             [Define to 1 if you want to use the g++ hash_map extension.])
364 AC_MSG_CHECKING(for g++ hash_map extension)
365 AC_LANG_PUSH([C++])
366 AC_TRY_LINK(
367 [
368 #include <ext/hash_map>
369 using namespace __gnu_cxx;
370 ],[hash_map<char*,hash<char*> > HashMap;
371 ],[AC_DEFINE_UNQUOTED(WITH_GNU_HASH_MAP, 1) AC_MSG_RESULT(yes)
372 ],[AC_MSG_RESULT(no)])
373 AC_LANG_POP([C++])
374
375 dnl CNC:2003-03-20
376 AC_MSG_CHECKING(for --disable-scripts)
377 AC_ARG_ENABLE([scripts],
378               AC_HELP_STRING(--disable-scripts, disable the extension system),
379               [enable_scripts="$enableval"],[enable_scripts="yes"])
380 if test "$enable_scripts" != "no"; then
381   AC_MSG_RESULT(no)
382   AC_DEFINE(WITH_LUA, 1, 
383             [Define if you want to enable the extension system.]) 
384 else
385   AC_MSG_RESULT(yes)
386 fi
387 AM_CONDITIONAL(WITH_LUA, test "$enable_scripts" != "no")
388
389 dnl Before configuring libtool check for --enable-static-progs option
390 AC_MSG_CHECKING(for --enable-static-progs)
391 AC_ARG_ENABLE(static-progs,
392               AC_HELP_STRING([--enable-static-progs],
393                              [Build completely static (standalone) binaries.]),
394               [enable_static_progs="$enableval"],[enable_static_progs="no"])
395 AM_CONDITIONAL(COMPILE_STATIC, test "$enable_static_progs" = "yes")
396 if test "$enable_static_progs" = "yes" ; then
397   AC_MSG_RESULT(yes)
398 else
399   AC_MSG_RESULT(no)
400 fi
401
402 dnl Check for apt-shell dependencies
403 AC_CHECK_LIB(ncurses,tputs,
404   [AC_CHECK_HEADER(readline/readline.h,
405      [AC_CHECK_LIB(readline,rl_completion_matches,
406         [compile_aptshell=yes],,[-lncurses])])])
407 AM_CONDITIONAL(COMPILE_APTSHELL, test "$compile_aptshell" = "yes")
408
409 dnl Converts the ARCH to be something singular for this general CPU family
410 dnl This is often the dpkg architecture string.
411 AH_TEMPLATE(COMMON_CPU, [Define the common CPU])
412 AH_TEMPLATE(COMMON_OS, [Define the common OS])
413 AC_MSG_CHECKING(system architecture)
414 archset="`awk \" ! /^#|^\\\$/ { if(match(\\\"$host_cpu\\\",\\\"^\\\"\\\$1\\\"\\\$\\\")) {print \\\$2; exit}}\" $srcdir/buildlib/archtable`"
415 if test "x$archset" = "x"; then
416   AC_MSG_ERROR(failed: use --host=)
417 fi
418 AC_MSG_RESULT($archset)
419 AC_DEFINE_UNQUOTED(COMMON_CPU,"$archset")
420
421 dnl Get a common name for the host OS - this is primarily only for HURD and is
422 dnl non fatal if it fails
423 AC_MSG_CHECKING(system OS)
424 osset="`awk \" ! /^#|^\\\$/ {if (match(\\\"$host_vendor-$host_os\\\",\\\$1)) {print \\\$2; exit}}\" $srcdir/buildlib/ostable`"
425 AC_MSG_RESULT($osset)
426 AC_DEFINE_UNQUOTED(COMMON_OS,"$osset")
427
428 dnl We use C99 types if at all possible
429 AC_CACHE_CHECK([for C99 integer types],c9x_ints,[
430     AC_TRY_COMPILE([#include <inttypes.h>],
431                    [uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;],
432                    c9x_ints=yes,c9x_ints=no)])
433
434 AC_C_BIGENDIAN
435
436 dnl Check the sizes etc. of the architecture
437 dnl Cross compilers can either get a real C library or preload the cache
438 dnl with their size values.
439 AC_CHECK_SIZEOF(char)
440 AC_CHECK_SIZEOF(int)
441 AC_CHECK_SIZEOF(short)
442 AC_CHECK_SIZEOF(long)
443
444 dnl Single Unix Spec statvfs
445 AC_CHECK_FUNC(statvfs,[have_statvfs=yes])
446
447 dnl Arg, linux and bsd put their statfs function in different places
448 AH_TEMPLATE(HAVE_VFS_H, [Define to 1 if sys/vfs.h is available])
449 AH_TEMPLATE(HAVE_MOUNT_H, [Define to 1 if sys/mount.h is available])
450 if test "$have_statvfs" != "yes"; then
451    AC_EGREP_HEADER(statfs,sys/vfs.h,[AC_DEFINE(HAVE_VFS_H)],[
452         AC_EGREP_HEADER(statfs,sys/mount.h,[AC_DEFINE(HAVE_MOUNT_H)],
453                         [AC_MSG_ERROR(failed: Need statvfs)])
454    ])
455 fi
456
457 dnl We should use the real timegm function if we have it.
458 AH_TEMPLATE(HAVE_TIMEGM, [Define to 1 if timegm is available])
459 AC_CHECK_FUNC(timegm,AC_DEFINE(HAVE_TIMEGM))
460 AC_SUBST(HAVE_TIMEGM)
461
462 dnl HP-UX sux..
463 AH_TEMPLATE(NEED_SOCKLEN_T_DEFINE, [Define to 1 if socket_t is missing])
464 AC_MSG_CHECKING(for missing socklen_t)
465 AC_EGREP_HEADER(socklen_t, sys/socket.h,[AC_MSG_RESULT(no)],[
466         AC_DEFINE(NEED_SOCKLEN_T_DEFINE)
467         NEED_SOCKLEN_T_DEFINE=yes
468         AC_MSG_RESULT(missing.)])
469 AC_SUBST(NEED_SOCKLEN_T_DEFINE)
470
471 dnl HP-UX needs -d_XOPEN_SOURCE_EXTENDED for h_errno
472 AC_MSG_CHECKING(for h_errno)
473 AC_EGREP_HEADER(h_errno, netdb.h, [AC_MSG_RESULT(normal)],
474    [CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
475     AC_EGREP_HEADER(h_errno, netdb.h, 
476        [AC_MSG_RESULT(needs _XOPEN_SOURCE_EXTENDED)],
477        [AC_MSG_ERROR("not found.")])
478    ])
479
480 dnl Check for debiandoc
481 dnl AC_PATH_PROG(DEBIANDOC_HTML,debiandoc2html)
482 dnl AC_PATH_PROG(DEBIANDOC_TEXT,debiandoc2text)
483
484 AC_PATH_PROG([GPG],[gpg],[/usr/bin/gpg])
485
486 AM_GNU_GETTEXT_VERSION([0.14.5])
487 AM_GNU_GETTEXT([external])
488
489 dnl ah_NUM_PROCS
490 rc_GLIBC_VER
491 rc_LIBSTDCPP_VER
492 dnl ah_GCC3DEP
493
494 AC_CONFIG_FILES([
495           Makefile
496           lua/Makefile
497           apt-pkg/Makefile
498           methods/Makefile
499           cmdline/Makefile
500           tools/Makefile
501           doc/Makefile
502           po/Makefile.in
503           ])
504 AC_CONFIG_LINKS([include/apti18n.h:buildlib/gettext.h])
505
506 AS_IF([test "$c9x_ints" = "no"],[
507 AC_CONFIG_LINKS([include/inttypes.h:buildlib/inttypes.h])
508 ])
509
510 AS_IF([test "$have_statvfs" != "yes"],[
511 AC_CONFIG_LINKS([include/statvfs.h:buildlib/statvfs.h])
512 ])
513
514 AS_IF([test "$NEED_SOCKLEN_T_DEFINE" = "yes"],[
515 AC_CONFIG_LINKS([include/netdb.h:buildlib/netdb.h])
516 ])
517
518 AC_OUTPUT