Commit af489348 af489348ce6156107be1012f582a9b01ad370aa1 by Sergey Poznyakoff

Remove HAVE_DECL_PROGRAM_INVOCATION_NAME hack, newer argp does that itself

1 parent 9ffaea71
...@@ -352,13 +352,6 @@ AC_CHECK_MEMBERS([struct tm.tm_zone, struct tm.tm_gmtoff, struct tm.tm_isdst], ...@@ -352,13 +352,6 @@ AC_CHECK_MEMBERS([struct tm.tm_zone, struct tm.tm_gmtoff, struct tm.tm_isdst],
352 352
353 dnl Check for working functions 353 dnl Check for working functions
354 354
355 # Dirty hack: make sure HAVE_DECL_PROGRAM_INVOCATION_NAME is defined
356 # This must be done before gl_ARGP, which attempts
357 # an AC_CHECK_DECLS([program_invocation_name), because autoconf machinery
358 # gives preference to the first definition, in spite of what the comment
359 # at autoconf/status.m4:574 sais
360 AC_DEFINE([HAVE_DECL_PROGRAM_INVOCATION_NAME], 1)
361
362 dnl Escape defuns that force automake to add their arguments 355 dnl Escape defuns that force automake to add their arguments
363 dnl to LIBOBJS. 356 dnl to LIBOBJS.
364 dnl All dependencies has been handled by gnulib-sync. 357 dnl All dependencies has been handled by gnulib-sync.
...@@ -442,40 +435,9 @@ dnl Check for libraries ...@@ -442,40 +435,9 @@ dnl Check for libraries
442 # The gnulib version fixes a number of bugs and provides new features, 435 # The gnulib version fixes a number of bugs and provides new features,
443 # so currently we force to use it. This may change when gnulib and glibc 436 # so currently we force to use it. This may change when gnulib and glibc
444 # are synchronized. 437 # are synchronized.
445 MU_LIBOBJ(pin)
446 MU_HEADER(getopt.h,getopt_.h) 438 MU_HEADER(getopt.h,getopt_.h)
447 MU_HEADER(argp.h) 439 MU_HEADER(argp.h)
448 440
449 AC_MSG_CHECKING(whether extern program_invocation_name is present)
450 AC_TRY_COMPILE([#include <argp.h>
451 #include <errno.h>],
452 [ program_invocation_name = "test"; ],
453 [AC_DEFINE(PROGRAM_INVOCATION_NAME_DECLARED,1,
454 [Define if program_invocation_name is declared in argp.h])
455 AC_MSG_RESULT(yes)],
456 [AC_MSG_RESULT(no)])
457
458 AH_BOTTOM([
459 #ifndef PROGRAM_INVOCATION_NAME_DECLARED
460 extern char *program_invocation_short_name;
461 extern char *program_invocation_name;
462 #endif])
463
464
465 AC_MSG_CHECKING(whether program_invocation_name is declared)
466 AC_TRY_COMPILE([#include <argp.h>
467 #include <errno.h>],
468 [
469 #ifndef PROGRAM_INVOCATION_NAME_DECLARED
470 extern char *program_invocation_name;
471 #endif
472 program_invocation_name = "test";
473 ],
474 [AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME,1,
475 [Define if the variable program_invocation_name exists])
476 AC_MSG_RESULT(yes)],
477 [AC_MSG_RESULT(no)])
478
479 AH_BOTTOM([ 441 AH_BOTTOM([
480 /* program_name is used by lib/error.c */ 442 /* program_name is used by lib/error.c */
481 #define program_name program_invocation_name 443 #define program_name program_invocation_name
......