Commit ae4654ea ae4654eab9eeef32006e05328708e0548e440559 by Sergey Poznyakoff

Updated to use new gnulib files.

1 parent 195dcbcc
...@@ -22,6 +22,7 @@ AC_CONFIG_AUX_DIR([scripts]) ...@@ -22,6 +22,7 @@ AC_CONFIG_AUX_DIR([scripts])
22 AC_CANONICAL_TARGET([]) 22 AC_CANONICAL_TARGET([])
23 AM_INIT_AUTOMAKE 23 AM_INIT_AUTOMAKE
24 AC_CONFIG_HEADERS([config.h]) 24 AC_CONFIG_HEADERS([config.h])
25 gl_USE_SYSTEM_EXTENSIONS
25 26
26 AC_PREREQ(2.59) 27 AC_PREREQ(2.59)
27 28
...@@ -313,16 +314,27 @@ AC_CHECK_MEMBERS([struct tm.tm_zone, struct tm.tm_gmtoff, struct tm.tm_isdst], ...@@ -313,16 +314,27 @@ AC_CHECK_MEMBERS([struct tm.tm_zone, struct tm.tm_gmtoff, struct tm.tm_isdst],
313 314
314 dnl Check for working functions 315 dnl Check for working functions
315 316
316 AC_FUNC_MALLOC 317 dnl Escape defuns that force automake to add their arguments
317 AC_FUNC_REALLOC 318 dnl to LIBOBJS.
318 AC_FUNC_ALLOCA 319 dnl All dependencies has been handled by gnulib-sync.
319 320
320 jm_INCLUDED_REGEX(mailbox/regex.c) 321 m4_copy([AC_REPLACE_FUNCS],[MU_SAVE_AC_REPLACE_FUNCS])
322 m4_copy([AC_LIBOBJ],[MU_SAVE_AC_LIBOBJ])
323
324 m4_copy([MU_LIBOBJ],[AC_LIBOBJ])
325 AC_DEFUN([AC_REPLACE_FUNCS],
326 [AC_CHECK_FUNCS([$1], , [MU_LIBOBJ($ac_func)])
327 ])
328
329 libmailbox_GNULIB
330
331 dnl Restore overridden defuns
332 m4_copy([MU_SAVE_AC_REPLACE_FUNCS],[AC_REPLACE_FUNCS])
333 m4_copy([MU_SAVE_AC_LIBOBJ],[AC_LIBOBJ])
334
335 libmailutils_GNULIB
321 336
322 # Not use.
323 #AC_FUNC_MEMCMP
324 AC_FUNC_MMAP 337 AC_FUNC_MMAP
325 AC_FUNC_FNMATCH
326 338
327 AC_CHECK_DECLS([strtok_r, strchrnul, strndup, asprintf, vasprintf, strsignal], 339 AC_CHECK_DECLS([strtok_r, strchrnul, strndup, asprintf, vasprintf, strsignal],
328 , , [ 340 , , [
...@@ -345,8 +357,6 @@ extern char *strsignal (int); ...@@ -345,8 +357,6 @@ extern char *strsignal (int);
345 #endif 357 #endif
346 ]) 358 ])
347 359
348 AC_REPLACE_FUNCS(getpass setenv snprintf strncasecmp \
349 strcasecmp strsignal vasprintf vsyslog)
350 AC_CHECK_FUNCS(mkstemp sigaction sysconf getdelim setreuid \ 360 AC_CHECK_FUNCS(mkstemp sigaction sysconf getdelim setreuid \
351 setresuid seteuid vfork _exit) 361 setresuid seteuid vfork _exit)
352 362
...@@ -359,37 +369,20 @@ AH_BOTTOM([ ...@@ -359,37 +369,20 @@ AH_BOTTOM([
359 #endif 369 #endif
360 ]) 370 ])
361 371
362 MU_CHECK_FUNCS(fgetpwent strtok_r getline strndup strnlen strchrnul) 372 MU_CHECK_FUNC(fgetpwent)
363 373
364 ## Check for presence of utmp.h and utmp-related functions 374 ## Check for presence of utmp.h and utmp-related functions
365 MU_CHECK_UTMP 375 MU_CHECK_UTMP
366 376
367 MU_REPLACE_GNU_GETOPT
368
369 dnl Check for libraries 377 dnl Check for libraries
370 USE_INCLUDED_ARGP= 378
371 AC_ARG_WITH([included-argp], 379 # FIXME: We used to allow to link against libc copy of argp (if any)
372 AC_HELP_STRING([--with-included-argp], 380 # The gnulib version fixes a number of bugs and provides new features,
373 [Use included argp library]), 381 # so currently we force to use it. This may change when gnulib and glibc
374 [USE_INCLUDED_ARGP=${withval}], 382 # are synchronized.
375 [AC_CHECK_HEADER(argp.h, 383 MU_LIBOBJ(pin)
376 [AC_CHECK_FUNCS(argp_parse, :, 384 MU_HEADER(getopt.h,getopt_.h)
377 [USE_INCLUDED_ARGP=yes])], 385 MU_HEADER(argp.h)
378 [USE_INCLUDED_ARGP=yes])])
379
380 if test "$USE_INCLUDED_ARGP" = yes; then
381 MU_LIBOBJ(argp-ba)
382 MU_LIBOBJ(argp-eexst)
383 MU_LIBOBJ(argp-fmtstream)
384 MU_LIBOBJ(argp-fs-xinl)
385 MU_LIBOBJ(argp-help)
386 MU_LIBOBJ(argp-parse)
387 MU_LIBOBJ(argp-pv)
388 MU_LIBOBJ(argp-pvh)
389 MU_LIBOBJ(argp-xinl)
390 MU_LIBOBJ(pin)
391 MU_HEADER(argp.h)
392 fi
393 386
394 AC_MSG_CHECKING(whether extern program_invocation_name is present) 387 AC_MSG_CHECKING(whether extern program_invocation_name is present)
395 AC_TRY_COMPILE([#include <argp.h> 388 AC_TRY_COMPILE([#include <argp.h>
...@@ -421,9 +414,9 @@ AC_TRY_COMPILE([#include <argp.h> ...@@ -421,9 +414,9 @@ AC_TRY_COMPILE([#include <argp.h>
421 AC_MSG_RESULT(yes)], 414 AC_MSG_RESULT(yes)],
422 [AC_MSG_RESULT(no)]) 415 [AC_MSG_RESULT(no)])
423 416
424 AC_CHECK_FUNCS(_obstack_begin, 417 if test "$ac_use_included_regex" = yes; then
425 [AC_DEFINE(HAVE_OBSTACK,1,[Define if GNU obstack is present])], 418 MU_HEADER(regex.h)
426 [AC_LIBOBJ(obstack)]) 419 fi
427 420
428 421
429 422
...@@ -909,8 +902,6 @@ AC_CONFIG_FILES([Makefile ...@@ -909,8 +902,6 @@ AC_CONFIG_FILES([Makefile
909 guimb/scm/Makefile 902 guimb/scm/Makefile
910 imap4d/Makefile 903 imap4d/Makefile
911 imap4d/testsuite/Makefile 904 imap4d/testsuite/Makefile
912 headers/Makefile
913 headers/posix/Makefile
914 include/Makefile 905 include/Makefile
915 include/mailutils/Makefile 906 include/mailutils/Makefile
916 include/mailutils/gnu/Makefile 907 include/mailutils/gnu/Makefile
......