diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-09-15 10:40:29 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-09-15 10:40:54 +0300 |
commit | 989a5bbb74c3620abaa2191ce2c4f8d5968dbf0a (patch) | |
tree | c0b2324a523905c3c17201cc2468c9078976fc74 | |
parent | dbad35177723e19147ab49b59a3728e00fe05875 (diff) | |
download | pies-989a5bbb74c3620abaa2191ce2c4f8d5968dbf0a.tar.gz pies-989a5bbb74c3620abaa2191ce2c4f8d5968dbf0a.tar.bz2 |
Branch off from the Mailfromd project into a separate repository.
-rw-r--r-- | .gitignore | 29 | ||||
l--------- | COPYING | 1 | ||||
-rw-r--r-- | ChangeLog.mfd | 342 | ||||
-rw-r--r-- | Makefile.am | 35 | ||||
-rw-r--r-- | NEWS | 33 | ||||
-rw-r--r-- | README | 0 | ||||
-rw-r--r-- | THANKS | 0 | ||||
-rw-r--r-- | am/aggr.m4 | 60 | ||||
-rw-r--r-- | am/gcc.m4 | 67 | ||||
-rw-r--r-- | am/proctitle.m4 | 79 | ||||
-rw-r--r-- | bootstrap.conf | 13 | ||||
-rw-r--r-- | configure.ac | 97 | ||||
-rw-r--r-- | doc/.gitignore | 22 | ||||
-rw-r--r-- | doc/Makefile.am | 39 | ||||
-rw-r--r-- | doc/pies.texi | 176 | ||||
-rw-r--r-- | gnulib.modules | 10 | ||||
-rw-r--r-- | lib/Makefile.am | 33 | ||||
-rw-r--r-- | lib/config.c | 115 | ||||
-rw-r--r-- | lib/intprops.h | 79 | ||||
-rw-r--r-- | lib/libpies.h | 70 | ||||
-rw-r--r-- | lib/nls.c | 34 | ||||
-rw-r--r-- | lib/parsetime.c | 109 | ||||
-rw-r--r-- | lib/proctitle.c | 164 | ||||
-rw-r--r-- | lib/userprivs.c | 291 | ||||
-rw-r--r-- | po/.gitignore | 21 | ||||
-rw-r--r-- | po/POTFILES.in | 19 | ||||
-rw-r--r-- | src/.gitignore (renamed from pies/.gitignore) | 0 | ||||
-rw-r--r-- | src/Makefile.am (renamed from pies/Makefile.am) | 5 | ||||
-rw-r--r-- | src/depmap.c (renamed from pies/depmap.c) | 0 | ||||
-rw-r--r-- | src/limits.c (renamed from pies/limits.c) | 0 | ||||
-rw-r--r-- | src/meta1gram.y (renamed from pies/meta1gram.y) | 0 | ||||
-rw-r--r-- | src/meta1lex.h (renamed from pies/meta1lex.h) | 0 | ||||
-rw-r--r-- | src/meta1lex.l (renamed from pies/meta1lex.l) | 0 | ||||
-rw-r--r-- | src/pies.c (renamed from pies/pies.c) | 10 | ||||
-rw-r--r-- | src/pies.h (renamed from pies/pies.h) | 6 | ||||
-rw-r--r-- | src/pies.rcin (renamed from pies/pies.rcin) | 0 | ||||
-rw-r--r-- | src/progman.c (renamed from pies/progman.c) | 0 | ||||
-rw-r--r-- | src/socket.c (renamed from pies/socket.c) | 0 |
38 files changed, 1874 insertions, 85 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f7b417d --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +*.a +*.la +*.lo +*.o +*.tar.* +*~ +.bootstrap +.deps +.emacs* +.gdbinit +.libs +ABOUT-NLS +ChangeLog +INSTALL +Makefile +Makefile.in +TAGS +aclocal.m4 +autom4te.cache/ +build-aux +config.h +config.h.in +config.log +config.status +configure +core +gnu +m4 +stamp-h1 @@ -0,0 +1 @@ +/usr/share/automake-1.11/COPYING
\ No newline at end of file diff --git a/ChangeLog.mfd b/ChangeLog.mfd new file mode 100644 index 0000000..7c4fcd5 --- /dev/null +++ b/ChangeLog.mfd @@ -0,0 +1,342 @@ +2009-08-27 Sergey Poznyakoff <gray@gnu.org.ua> + + Fix diagnostic and help messages. + + 1. Option descriptions in `--help' output do not constitute + conceptual sentences. Therefore, they should not begin + with a capital letter, nor end with a final point. + 2. According to standards.texi, a diagnostic message in a + non-interactive program "should not begin with a capital letter + when it follows a program name and/or file name, because that + isn't the beginning of a sentence. (The sentence conceptually + starts at the beginning of the line.) Also, it should not end + with a period." + + Affected files: + + * pies/pies.c + * pies/progman.c + +2009-06-17 Sergey Poznyakoff <gray@gnu.org.ua> + + Bugfixes. + + * pies/pies.c (main): Change main loop to do..while, + otherwise a signal arriving before entering the loop + might cause the program to terminate. + +2009-06-14 Sergey Poznyakoff <gray@gnu.org.ua> + + Fix and improve termination actions. + + * pies/pies.h (MAX_RETURN_CODE): Remove. + (STATUS_SIG_BIT, STATUS_CODE): New defines + (struct action): New fields next, nstat, status, command. + (struct component): Keep singly-linked list of termination + actions. + * pies/progman.c (run_command): New function. + (progman_cleanup): Redo iteration over termination actions. + * pies/pies.c (return_code_cfg_param): Pass offsets in + struct component. + (create_action): Accept signal numbers (SIG.* or SIG\+[0-9]+) + in tag. + (return_code_section_parser): Update. + (pies_check_status): Set *pid before returning pies_status_stale. + * doc/pies.texi: Document changes. + +2009-06-04 Sergey Poznyakoff <gray@gnu.org.ua> + + MeTA1-related improvements. + + * pies/pies.c (_cm_include_meta1): Fix coredump on syntax errors + in meta1.conf. + +2009-05-21 Sergey Poznyakoff <gray@gnu.org.ua> + + More work on `silent rules' mode + + * pies/Makefile.am: Add silent rule markers. + +2009-05-13 Sergey Poznyakoff <gray@gnu.org.ua> + + Minor change + + * pies/progman.c: Use _exit in child processes. This + is a work over a fault in MU design: it registers + the pidfile removal function via atexit. + +2008-12-26 Sergey Poznyakoff <gray@gnu.org.ua> + + * doc/pies.texi: Update. + + git-svn-id: file:///svnroot/mailfromd/trunk@1771 + 7a8a7f39-df28-0410-adc6-e0d955640f24 + +2008-12-01 Sergey Poznyakoff <gray@gnu.org.ua> + + Documentation and minor fixes. + + * pies/pies.c, pies/progman.c, pies/meta1gram.y, pies/pies.h, + pies/meta1lex.l: Normalize output redirection terminology, fix the + debug levels. + * doc/pies.texi: Document the configuration. + +2008-11-21 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/pies.c (component_cfg_param): New statement settle-timeout. + * pies/progman.c (recompute_alarm): New static; + (prog_start): Start the component only if all of its prerequisites + are running. + (progman_recompute_alarm): New function. + (progman_start): Reset recompute_alarm to 0. + (check_stopping): New function. + (progman_wake_sleeping): Handle also status_stopping and + status_enabled. Recompute alarm before leaving. + (prog_start_prerequisites): Return 0 or 1 depending on whether all + prerequisites have been started. + (prog_stop): Raise recompute_alarm for stopping components. + (progman_cleanup): Force status_enabled before attepmting to + start a component. + (progman_cleanup): Add a \n after debugging message. + Run progman_wake_sleeping unlsess expect_term is set. + * pies/meta1gram.y (translate_node_list): Force settle-timeout = + 1. + * pies/pies.h (struct component.settle_timeout): New member. + + * pies/pies.c (main): New options --force, --dump-prereq and + --dump-depmap. + Refuse to start if another instance is already running. + (pies_check_status): New function. + (pies_status): Rewrite using pies_check_status. + * pies/progman.c (component_fixup_depend): Bugfix: move + mu_list_append off the conditional. + (progman_dump_prereq, progman_dump_depmap): New functions. + * pies/meta1gram.y (yyerror): Return 0. + * pies/pies.h (progman_dump_prereq, progman_dump_depmap): New + protos. + (meta1_parser_set_debug, meta1lex, meta1error) + (meta1parse): Likewise. + + * pies/progman.c (print_dep): New function. + (progman_build_depmap): Call print_dep to facilitate fixing cyclic + dependencies. + (prog_start_prerequisites): Fix debugging output. + Remove spurious second loop (was it a typo or copy-paste + leftover?) + (prog_stop_dependents): Fix debugging output. + (progman_dump_stats): Avoid race conditions between running and + querying instances. + +2008-11-17 Sergey Poznyakoff <gray@gnu.org.ua> + + Fix handling of retranslators. + + * pies/pies.c (main): Call progman_build_depmap and + progman_create_sockets before starting up components. + * pies/progman.c (struct prog): New member `retr'. + (destroy_prog): New function. + (retr_tag): Change signature. Fix erroneous condition for + xalloc_die. + (register_retr): Return prog. Make static. Initialize idx + with -1. + (update_retr): Register retranslator, if necessary. + (progman_register_retranslators): Remove. + (register_prog0): 2nd argument: index. + (register_prog): Do not create socket at once. + (prog_start): Remove debugging fprintf. + (progman_accept): Update call to register_prog0. + (progman_create_sockets): New function. + (progman_start): Remove calls to progman_register_retranslators + and progman_build_depmap. They must be done only once. + (prog_stop_retranslators): New function. + (prog_stop_dependents): Call prog_stop_retranslators. + (progman_cleanup): Remove dangling retranslators. + * pies/pies.h (progman_create_sockets): New prototype. + +2008-11-16 Sergey Poznyakoff <gray@gnu.org.ua> + + Improve pies. + + * pies/pies.h (create_socket): Change proto to 3 arguments. + * pies/socket.c (create_socket): Take two additional arguments. + Allow to configure ownership and mode of created UNIX sockets. + * pies/progman.c (register_prog, prog_start): Update calls to + create_socket. + +2008-11-15 Sergey Poznyakoff <gray@gnu.org.ua> + + Improve handling of program privileges. + + * pies/pies.h (struct pies_privs_data): Remove + (struct component): Change type of `privs' to struct mf_privs. + (priv_setup): Remove. + * pies/pies.c: Use mf_priv* stuff to manipulate privileges. + * pies/progman.c: Likewise. + * pies/meta1gram.y (list): allow for trailing comma. + +2008-10-31 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/progman.c, pies/pies.h: Use umaxtostr, instead + of mu_umaxtostr. + +2008-10-15 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/progman.c (env_setup): Port new implementation from Rush. + +2008-10-04 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/pies.c (component_cfg_param): New configuration statement + `precious'. + * pies/progman.c (struct prog): New member `precious'. + (register_prog): Set precious. + (prog_start_dependencies): Do not mark disabled precious + dependencies of a disabled component. + * pies/pies.h (pies/pies.h): New member `precious'. + * pies/pies.rcin (mcp): Mark as precious. + + * pies/pies.c (return_code_section_parser): Fix to work with tag + of any type. + * pies/pies.rcin: Minor change. + + * pies/pies.c (main): Do cleanup after main action processing and + only if action == ACTION_CONT. + * pies/progman.c (struct prog): New member `prev'. + (link_prog): Maintain doubly-linked list. + (prog_stop_dependent): Avoid printing diagnostics if there are + no dependencies to be stopped. + (prog_stop): Do nothing if prog->pid is zero. + Do not call prog_stop_dependent, it will be done by + progman_cleanup. + (prog_stop_all): Terminate components from last to first. + * pies/pies.rcin: Improve example, by adding mcp component. + + * pies/pies.c (_cb_depend): Handle single string value. + (_cb_retr): Fix diagnostic message. + (_cb_facility): New function. + (component_cfg_param): New statement `facility'. + (component_section_parser): Initialize comp.facility to the + default value. + * pies/progman.c (struct prog): New member `facility'. + (register_prog): Initialize facility. + (open_retranslator): Use master->facility. + * pies/pies.h (struct component): New member `facility'. + +2008-10-03 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/progman.c (register_prog): Remove stray semicolon. + (retr_exit): Use _exit. + (prog_stop_dependent): Bugfix: stop retranlators as well as + components. + +2008-09-29 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/pies.c: Rewrite configuration + file support to match changes in Mailutils. + +2008-09-09 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/pies.c: Change description. + +2008-06-26 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/pies.h: Include stdint.h + +2008-02-26 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/pies.c: New configuration statement "chdir". + * pies/progman.c (struct prog.v.p): New member `dir'. + (register_prog): Initialize newp->v.p.dir; + (prog_start): Change to the working directory, if required by + config. + +2008-02-01 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/pies.c (progman_wake_disabled): Renamed to + progman_wake_sleeping. + * pies/progman.c: Implement proper handling of dependencies. + * pies/pies.h ((progman_wake_disabled): Renamed to + progman_wake_sleeping. + (pies_depmap_t,pies_depmap_pos_t,enum pies_depmap_direction): New + types. + (depmap_alloc,depmap_copy,depmap_set,depmap_isset,depmap_tc) + (depmap_first,depmap_next): New functions. + * pies/depmap.c: New file. + * pies/Makefile.am (pies_SOURCES): Add depmap.c. + + * pies/pies.c (return_code_section_parser): Allow to use symbolic + exit codes. + (priv_setup): Exit with EX_CONFIG if the user does not exist. + (main): Catch early sigchlds as well. + * pies/progman.c (progman_cleanup): Fix notice wording. + * pies/pies.rcin: Add sample return-code section. + (component pmult): Redirect stderr/stdout to syslog. + +2008-01-31 Sergey Poznyakoff <gray@gnu.org.ua> + + Implement configurable actions depending on the exit code of + a component. + + * pies/pies.c: New configuration file section "return-code". + (capa): Add mailer and debug. + (main): Register "return-code" section and all mailer formats. + * pies/progman.c (enum prog_status): New type. + (struct prog): Remove `disabled'. New fields `status' and `act'. + (register_prog): Initialize act. + (prog_start): Exit with EX_SOFTWARE code if the component cannot + be started. + (progman_start): Do not start disabled components. + (progman_wake_disabled): Wake only components marked as + status_stopped. + (notify): New function. + (progman_cleanup): Act in accordance with the `act' field if the + component terminates. + (progman_stop_component,progman_dump_stats): Take into account + prog->v.p.status. + * pies/pies.h (MAX_RETURN_CODE): New define. + (enum return_action): New type. + (struct component.act): New member. + (default_component): New global. + +2008-01-24 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/pies.c: Fix handling of the --log-tag option. + + * pies/progman.c (prog_start): Remove unconditional debugging + output. + +2008-01-22 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/pies.c (log_setup): Always set mu_debug_default_printer to + override bug in libmailutils. + (component_cfg_param): New keyword `env'. + (main): Bugfix: It is -R that allows arguments, not -r. + * pies/progman.c (struct prog): New member env. + (register_prog): Avoid unnecessary allocations. Copy env. + (env_setup): New function. + (prog_start): Set up environment. + * pies/pies.h (struct component): New member env. + +2008-01-14 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/pies.c, pies/progman.c, + pies/pies.h, pmult/pmult.c: Sync with MU CVS: Use mu_log_facility + and mu_log_tag. + +2008-01-13 Sergey Poznyakoff <gray@gnu.org.ua> + + * pies/pies.c (_cb_group): Bugfix: store group number in the list, + not its name. + (component_section_parser): Initialize retr to default values. + * pies/Makefile.am (LDADD): Place libgnu.a after + MAILUTILS_LIBS. + + * pies: New directory. + * pies/Makefile.am: New file. + * pies/pies.c, pies/progman.c, pies/pies.h, pies/pies.rcin: New + files. + +Local Variables: +mode: change-log +version-control: never +buffer-read-only: t +End: diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..f665de1 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,35 @@ +ACLOCAL_AMFLAGS = -I m4 -I am + +SUBDIRS=gnu lib src doc po + +# Define the following variables in order to use the ChangeLog rule below: +# prev_change_log [optional] Name of the previous ChangeLog file. +# gen_start_date [optional] Start ChangeLog from this date. +# changelog_dir [mandatory] Directory where to create ChangeLog +prev_change_log = ChangeLog.mfd +gen_start_date = 2009-09-04 +changelog_dir = . + +.PHONY: ChangeLog +ChangeLog: + if test -d .git; then \ + cmd=$(top_srcdir)/build-aux/gitlog-to-changelog; \ + if test -n "$(gen_start_date)"; then \ + cmd="$$cmd --since=\"$(gen_start_date)\""; \ + fi; \ + $$cmd --format='%s%n%n%b%n' | \ + sed '/<unknown>$$/d' | fmt -s > $(changelog_dir)/cl-t; \ + if test -n "$(prev_change_log)" && test -f "$(prev_change_log)"; \ + then \ + echo "" >> $(changelog_dir)/cl-t; \ + cat "$(prev_change_log)" | \ + sed '/^Local Variables:/,/^End:/d' >> $(changelog_dir)/cl-t; \ + fi; \ + echo "Local Variables:" >> $(changelog_dir)/cl-t; \ + echo "mode: change-log" >> $(changelog_dir)/cl-t; \ + echo "version-control: never" >> $(changelog_dir)/cl-t; \ + echo "buffer-read-only: t" >> $(changelog_dir)/cl-t; \ + echo "End:" >> $(changelog_dir)/cl-t; \ + rm -f $(changelog_dir)/ChangeLog; \ + mv $(changelog_dir)/cl-t $(changelog_dir)/ChangeLog; \ + fi @@ -0,0 +1,33 @@ +Mailfromd NEWS -- history of user-visible changes. 2009-09-03 +Copyright (C) 2005, 2006, 2007, 2008, 2009 Sergey Poznyakoff +See the end of file for copying conditions. + +Please send Mailfromd bug reports to <bug-mailfromd@gnu.org.ua> + + +Version 1.0 (Git) + + +========================================================================= +Copyright information: + +Copyright (C) 2005, 2006, 2007, 2008, 2009 Sergey Poznyakoff + + Permission is granted to anyone to make or distribute verbatim copies + of this document as received, in any medium, provided that the + copyright notice and this permission notice are preserved, + thus giving the recipient permission to redistribute in turn. + + Permission is granted to distribute modified versions + of this document, or of portions of it, + under the above conditions, provided also that they + carry prominent notices stating who last changed them. + +Local variables: +mode: outline +paragraph-separate: "[ ]*$" +eval: (add-hook 'write-file-hooks 'time-stamp) +time-stamp-start: "changes. " +time-stamp-format: "%:y-%02m-%02d" +time-stamp-end: "\n" +end: diff --git a/am/aggr.m4 b/am/aggr.m4 new file mode 100644 index 0000000..2bdbb46 --- /dev/null +++ b/am/aggr.m4 @@ -0,0 +1,60 @@ +dnl Autoconf macros for checking for aggregate type members +dnl +dnl Copyright (C) 1996, 1997, 1998, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. +dnl +dnl Mostly written by Miles Bader <miles@gnu.ai.mit.edu> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +dnl + +dnl IU_CHECK_MEMBER(AGGREGATE.MEMBER, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], +dnl [INCLUDES]) +dnl AGGREGATE.MEMBER is for instance `struct passwd.pw_gecos'. +dnl The member itself can be of an aggregate type +dnl Shell variables are not a valid argument. +AC_DEFUN([IU_CHECK_MEMBER], +[AS_LITERAL_IF([$1], [], + [AC_FATAL([$0: requires literal arguments])])dnl +m4_bmatch([$1], [\.], , + [m4_fatal([$0: Did not see any dot in `$1'])])dnl +AS_VAR_PUSHDEF([ac_Member], [ac_cv_member_$1])dnl +dnl Extract the aggregate name, and the member name +AC_CACHE_CHECK([for $1], ac_Member, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])], +[dnl AGGREGATE ac_aggr; +static m4_bpatsubst([$1], [\..*]) ac_aggr; +dnl ac_aggr.MEMBER; +if (sizeof(ac_aggr.m4_bpatsubst([$1], [^[^.]*\.]))) +return 0;])], + [AS_VAR_SET(ac_Member, yes)], + [AS_VAR_SET(ac_Member, no)])]) +AS_IF([test AS_VAR_GET(ac_Member) = yes], [$2], [$3]) +AS_VAR_POPDEF([ac_Member])dnl +])dnl IU_CHECK_MEMBER + +dnl IU_CHECK_MEMBERS([AGGREGATE.MEMBER, ...], +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND] +dnl [INCLUDES]) +AC_DEFUN([IU_CHECK_MEMBERS], +[m4_foreach([AC_Member], [$1], + [IU_CHECK_MEMBER(AC_Member, + [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]AC_Member), 1, + [Define to 1 if `]m4_bpatsubst(AC_Member, + [^[^.]*\.])[' is + member of `]m4_bpatsubst(AC_Member, [\..*])['.]) +$2], + [$3], + [$4])])]) diff --git a/am/gcc.m4 b/am/gcc.m4 new file mode 100644 index 0000000..37d90ac --- /dev/null +++ b/am/gcc.m4 @@ -0,0 +1,67 @@ +# This file is part of Mailfromd. -*- autoconf -*- +# Copyright (C) 2009 Sergey Poznyakoff +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +AC_DEFUN([MF_CC_OPT],[ + m4_pushdef([mf_optname],translit($1,[-],[_])) + AC_MSG_CHECKING(whether $CC accepts $1) + mf_save_cc="$CC" + CC="$CC $1" + AC_TRY_RUN([int main() { return 0; }], + [mf_cv_cc_]mf_optname=yes, + [mf_cv_cc_]mf_optname=no, + [mf_cv_cc_]mf_optname=no) + CC="$mf_save_cc" + AC_MSG_RESULT($[mf_cv_cc_]mf_optname) + + if test $[mf_cv_cc_]mf_optname = yes; then + ifelse([$2],,:,[$2]) + ifelse([$3],,,else + [$3]) + fi + m4_popdef([mf_optname]) + ]) + +AC_DEFUN([MF_CC_OPT_CFLAGS],[ + MF_CC_OPT([$1],[CFLAGS="$CFLAGS $1"]) +]) + +AC_DEFUN([MF_GCC_ALIAS_QUIRK],[ + # + # Quoting Linus Torvalds: + # The gcc people are more interested in trying to find out what can be + # allowed by the c99 specs than about making things actually _work_. The + # aliasing code in particular is not even worth enabling, it's just not + # possible to sanely tell gcc when some things can alias. + # (see http://lkml.org/lkml/2003/2/26/158, for details) + # + # (The code below is borrowed from Python's configure.in) + MF_CC_OPT_CFLAGS([-fno-strict-aliasing]) +]) + +AC_DEFUN([MF_GCC_PAREN_QUIRK],[ + MF_CC_OPT_CFLAGS([-Wno-parentheses]) +]) + +AC_DEFUN([MF_GCC_QUIRKS],[ + case $GCC in + yes) + MF_GCC_ALIAS_QUIRK + MF_GCC_PAREN_QUIRK + ;; + *) # FIXME + ;; + esac]) + diff --git a/am/proctitle.m4 b/am/proctitle.m4 new file mode 100644 index 0000000..c912072 --- /dev/null +++ b/am/proctitle.m4 @@ -0,0 +1,79 @@ +dnl This file is part of Mailfromd. +dnl Copyright (C) 2008 Sergey Poznyakoff +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see <http://www.gnu.org/licenses/>. + +AC_DEFUN([MF_PROCTITLE],[ + AH_TEMPLATE([MF_PROCTITLE_TYPE], [Type of setproctitle implementation]) + AH_BOTTOM([ +#define MF_PROCTITLE_SETPROCTITLE 0 +#define MF_PROCTITLE_REPLACE_ARGV 1 +#define MF_PROCTITLE_REWRITE_ARGV 2 +#define MF_PROCTITLE_PSTAT 3 +#define MF_PROCTITLE_PSSTRINGS 4 +]) + AC_SUBST(MF_PROCTITLE_LIBS) + + AC_TRY_LINK([extern char *__progname, *__progname_full;], + [__progname = "foo"; __progname_full = "foo bar";], + [AC_DEFINE(HAVE___PROGNAME, 1, + [Define to 1 if libc has __progname])]) + + mf_proctitle_type=no + AC_CHECK_FUNC(setproctitle, + [mf_proctitle_type=MF_PROCTITLE_SETPROCTITLE], + [AC_CHECK_HEADERS(libutil.h) + AC_CHECK_LIB(util, setproctitle, + [mf_proctitle_type=MF_PROCTITLE_SETPROCTITLE + MF_PROCTITLE_LIBS="-lutil"])]) + + if test "$mf_proctitle_type" = no; then + AC_CHECK_HEADER([sys/pstat.h], + [AC_CHECK_FUNC([pstat], + [mf_proctitle_type=MF_PROCTITLE_PSTAT], + [mf_proctitle_type=MF_PROCTITLE_REWRITE_ARGV])]) + if test "$mf_proctitle_type" = no; then + AC_TRY_COMPILE([#include <machine/vmparam.h> + #include <sys/exec.h>], + [ +#include <sys/types.h> +#include <sys/proc.h> +#include <vm/pmap.h> +#include <machine/pmap.h> +#include <machine/vmparam.h> +#include <sys/exec.h> + +main() +{ + int i = PS_STRINGS; +} +], + [mf_proctitle_type=MF_PROCTITLE_PSSTRINGS]) + + if test "$mf_proctitle_type" = no; then + AC_EGREP_CPP(yes,[ +#if defined(__GNU_HURD__) + yes +#endif +], + [mf_proctitle_type=MF_PROCTITLE_REPLACE_ARGV], + [mf_proctitle_type=MF_PROCTITLE_REWRITE_ARGV]) + fi + fi + fi + + AC_DEFINE_UNQUOTED([MF_PROCTITLE_TYPE],$mf_proctitle_type) + +]) +
\ No newline at end of file diff --git a/bootstrap.conf b/bootstrap.conf index f7188de..ff05127 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -1,4 +1,4 @@ -# Bootstrap configuration for Mailfromd. +# Bootstrap configuration for Pies. # Copyright (C) 2008, 2009 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify @@ -28,14 +28,7 @@ fi gnulib_modules=`grep '^[^#]' gnulib.modules` NLS_MARKERS="\ - MF_THROW:2\ - MF_ASSERT:3\ - parse_error:1\ - parse_error_locus:2\ - mu_error:1\ - gacopyz_io_log:3\ - gacopyz_logmsg:2\ - gacopyz_log:3" + mu_error:1" # Additional xgettext options to use. Use "\\\newline" to break lines. @@ -53,7 +46,7 @@ extract_bug_address=' ' COPYRIGHT_HOLDER="Sergey Poznyakoff" -MSGID_BUGS_ADDRESS=`m4 -D'AC_INIT=AC-INIT-BUG-ADDRESS=$3' configure.ac | sed -n "$extract_bug_address"` +MSGID_BUGS_ADDRESS=`echo 'changequote([,])' | m4 -D'AC_INIT=AC-INIT-BUG-ADDRESS=$3' - configure.ac | sed -n "$extract_bug_address"` if test -z "$MSGID_BUGS_ADDRESS"; then MSGID_BUGS_ADDRESS="bug-${package}@gnu.org.ua" fi diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..192fc53 --- /dev/null +++ b/configure.ac @@ -0,0 +1,97 @@ +# This file is part of Pies. -*- autoconf -*- +# Copyright (C) 2009 Sergey Poznyakoff +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.63]) +AC_INIT([pies], [1.0], [bug-mailfromd@gnu.org.ua]) +AC_CONFIG_SRCDIR([src/pies.h]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_HEADERS([config.h]) +AM_INIT_AUTOMAKE([1.11 gnits tar-ustar dist-bzip2 std-options silent-rules]) + +# Enable silent rules by default: +AM_SILENT_RULES([yes]) + +# Checks for programs. +AC_PROG_CC +gl_EARLY |