Changeset cffb044


Ignore:
Timestamp:
Apr 19, 2013, 3:23:18 AM (9 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Parents:
487cc2b (diff), 0625919 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge 0625919d1e483ec9ba11021e1281e05f9d2b877a into 487cc2b1b658bcc696e3951201320be455fc86e4
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    r78b9503 ra223b6b  
    44GIT_FLAGS := $(if $(GIT_DESCRIPTION),-DGIT_VERSION=$(GIT_DESCRIPTION:barnowl-%=%))
    55
    6 bin_PROGRAMS = barnowl.bin
     6bin_PROGRAMS = bin/barnowl
    77if ENABLE_ZCRYPT
    88bin_PROGRAMS += zcrypt
     
    1111zcrypt_SOURCES = zcrypt.c filterproc.c
    1212
    13 check_PROGRAMS = tester.bin
     13check_PROGRAMS = bin/tester
    1414dist_check_DATA = t
    1515dist_check_SCRIPTS = runtests.sh
    1616
    17 bin_SCRIPTS = barnowl
     17noinst_SCRIPTS = barnowl
    1818check_SCRIPTS = tester
    1919
    20 barnowl tester: %: barnowl-wrapper.in %.bin Makefile
     20barnowl tester: %: barnowl-wrapper.in bin/% Makefile
    2121        sed \
    2222            -e 's,[@]abs_srcdir[@],$(abs_srcdir),g' \
     
    2525        chmod +x $@
    2626
    27 barnowl_bin_SOURCES = $(BASE_SRCS) \
     27bin_barnowl_SOURCES = $(BASE_SRCS) \
    2828     owl.h owl_perl.h \
    2929     owl.c
    30 nodist_barnowl_bin_SOURCES = $(GEN_C) $(GEN_H)
     30nodist_bin_barnowl_SOURCES = $(GEN_C) $(GEN_H)
    3131
    3232dist_man_MANS = doc/barnowl.1
    3333dist_doc_DATA = doc/intro.txt doc/advanced.txt
    3434
    35 barnowl_bin_LDADD = compat/libcompat.a libfaim/libfaim.a
     35bin_barnowl_LDADD = compat/libcompat.a libfaim/libfaim.a
    3636
    37 tester_bin_SOURCES = $(BASE_SRCS) \
     37bin_tester_SOURCES = $(BASE_SRCS) \
    3838     owl.h owl_perl.h \
    3939     tester.c
    40 nodist_tester_bin_SOURCES = $(GEN_C) $(GEN_H)
     40nodist_bin_tester_SOURCES = $(GEN_C) $(GEN_H)
    4141
    42 tester_bin_LDADD = compat/libcompat.a libfaim/libfaim.a
     42bin_tester_LDADD = compat/libcompat.a libfaim/libfaim.a
    4343
    4444TESTS=runtests.sh
     
    9696        $(COMPILE) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
    9797
    98 do_transform = $(shell echo '$(1)' | sed '$(transform)')
    99 install-exec-hook:
    100         mv -f $(DESTDIR)$(bindir)/$(call do_transform,barnowl.bin) \
    101               $(DESTDIR)$(bindir)/$(call do_transform,barnowl)
    102 
    103 uninstall-local:
    104         rm -f $(DESTDIR)$(bindir)/$(call do_transform,barnowl)
    105 
    106 CLEANFILES = $(BUILT_SOURCES) $(bin_SCRIPTS) $(check_SCRIPTS)
     98CLEANFILES = $(BUILT_SOURCES) $(noinst_SCRIPTS) $(check_SCRIPTS)
    10799EXTRA_DIST = \
    108100    autogen.sh \
  • barnowl-wrapper.in

    r1dba5bd ra223b6b  
    11#!/bin/sh
    22# This is a wrapper script to point BARNOWL_DATA_DIR at the source dir
    3 # if we're running from a build tree. barnowl.bin is the actual built
     3# if we're running from a build tree. bin/barnowl is the actual built
    44# binary.
    55
    6 EXE="$0.bin"
     6EXE="@abs_builddir@/bin/$(basename "$0")"
    77
    88if test ! -x "$EXE"; then
  • configure.ac

    r487cc2b r0625919  
    11dnl Process this file with autoconf to produce a configure script.
    22AC_INIT([BarnOwl],[1.10dev],[bug-barnowl@mit.edu])
    3 AM_INIT_AUTOMAKE([1.7.0 -Wall -Wno-portability foreign])
     3AM_INIT_AUTOMAKE([1.7.0 foreign std-options -Wall -Wno-portability])
    44AM_MAINTAINER_MODE([enable])
    55m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  • owl.c

    r4d9e311c r499224d  
    3434} owl_options;
    3535
    36 void usage(void)
     36void usage(FILE *file)
    3737{
    38   fprintf(stderr, "Barnowl version %s\n", OWL_VERSION_STRING);
    39   fprintf(stderr, "Usage: barnowl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-s <confdir>] [-t <ttyname>]\n");
    40   fprintf(stderr, "  -n,--no-subs        don't load zephyr subscriptions\n");
    41   fprintf(stderr, "  -d,--debug          enable debugging\n");
    42   fprintf(stderr, "  -v,--version        print the Barnowl version number and exit\n");
    43   fprintf(stderr, "  -h,--help           print this help message\n");
    44   fprintf(stderr, "  -s,--config-dir     specify an alternate config dir (default ~/.owl)\n");
    45   fprintf(stderr, "  -c,--config-file    specify an alternate config file (default ~/.owl/init.pl)\n");
    46   fprintf(stderr, "  -t,--tty            set the tty name\n");
     38  fprintf(file, "Barnowl version %s\n", OWL_VERSION_STRING);
     39  fprintf(file, "Usage: barnowl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-s <confdir>] [-t <ttyname>]\n");
     40  fprintf(file, "  -n,--no-subs        don't load zephyr subscriptions\n");
     41  fprintf(file, "  -d,--debug          enable debugging\n");
     42  fprintf(file, "  -v,--version        print the Barnowl version number and exit\n");
     43  fprintf(file, "  -h,--help           print this help message\n");
     44  fprintf(file, "  -s,--config-dir     specify an alternate config dir (default ~/.owl)\n");
     45  fprintf(file, "  -c,--config-file    specify an alternate config file (default ~/.owl/init.pl)\n");
     46  fprintf(file, "  -t,--tty            set the tty name\n");
    4747}
    4848
     
    8383      exit(0);
    8484    case 'h':
     85      usage(stdout);
     86      exit(0);
    8587    default:
    86       usage();
     88      usage(stderr);
    8789      exit(1);
    8890    }
  • zcrypt.c

    r6249a88f r8f335a8  
    1616#include <sys/wait.h>
    1717#include <ctype.h>
     18#include <limits.h>
     19#include <getopt.h>
    1820
    1921#include <config.h>
     
    2628
    2729#include "filterproc.h"
     30
     31#ifndef OWL_VERSION_STRING
     32#ifdef  GIT_VERSION
     33#define stringify(x)       __stringify(x)
     34#define __stringify(x)     #x
     35#define OWL_VERSION_STRING stringify(GIT_VERSION)
     36#else
     37#define OWL_VERSION_STRING PACKAGE_VERSION
     38#endif
     39#endif /* !OWL_VERSION_STRING */
    2840
    2941/* Annotate functions in which the caller owns the return value and is
     
    106118}
    107119
     120void usage(FILE *file, const char *progname)
     121{
     122  fprintf(file, "Usage: %s [-Z|-D|-E|-R|-S] [-F Keyfile] [-c class] [-i instance]\n", progname);
     123  fprintf(file, "       [-advqtluon] [-s signature] [-f arg] [-m message]\n");
     124  fprintf(file, "  One or more of class, instance, and keyfile must be specified.\n");
     125}
     126
    108127int main(int argc, char *argv[])
    109128{
     
    116135  int mode = M_NONE;
    117136
    118   char c;
     137  int c;
    119138
    120139  int messageflag = FALSE;
     
    122141  zoptions.flags = 0;
    123142
    124   while ((c = getopt(argc, argv, "ZDERSF:c:i:advqtluons:f:m")) != (char)EOF)
     143  enum {
     144    OPT_VERSION = CHAR_MAX + 1,
     145    OPT_HELP,
     146  };
     147  static const struct option options[] = {
     148    {"version", no_argument, NULL, OPT_VERSION},
     149    {"help", no_argument, NULL, OPT_HELP},
     150    {NULL, 0, NULL, 0}
     151  };
     152
     153  while ((c = getopt_long(argc, argv, "ZDERSF:c:i:advqtluons:f:m", options, NULL)) != -1)
    125154  {
    126155    switch(c)
    127156    {
     157      case OPT_VERSION:
     158        /* Version */
     159        printf("This is zcrypt version %s\n", OWL_VERSION_STRING);
     160        exit(0);
     161      case OPT_HELP:
     162        /* Help */
     163        usage(stdout, argv[0]);
     164        exit(0);
    128165      case 'Z':
    129166        /* Zephyr encrypt */
     
    257294  if (error || !cryptspec)
    258295  {
    259     fprintf(stderr, "Usage: %s [-Z|-D|-E|-R|-S] [-F Keyfile] [-c class] [-i instance]\n", argv[0]);
    260     fprintf(stderr, "       [-advqtluon] [-s signature] [-f arg] [-m message]\n");
    261     fprintf(stderr, "  One or more of class, instance, and keyfile must be specified.\n");
     296    usage(stderr, argv[0]);
    262297    exit(1);
    263298  }
Note: See TracChangeset for help on using the changeset viewer.