From 9a3431654e0a246fa55472dc43acf62b2ba8b55f Mon Sep 17 00:00:00 2001 From: TLINDEN Date: Sun, 17 Nov 2013 16:53:20 +0100 Subject: [PATCH] fixed aix portability problems --- autogen.sh | 3 + configure | 11 +- configure.ac | 8 +- include/pcp/config.h.in | 6 + include/pcp/mem.h | 2 - include/pcp/platform.h | 75 ++++++++++- libpcp/fatal.c | 1 + libpcp/mem.c | 5 +- man/pcp1.1 | 2 +- src/Makefile.am | 3 +- src/Makefile.in | 6 +- src/compat_getopt.c | 279 ++++++++++++++++++++++++++++++++++++++++ src/compat_getopt.h | 91 +++++++++++++ src/pcp.h | 2 +- src/z85util.h | 1 - tests/Makefile.am | 2 +- tests/Makefile.in | 19 ++- tests/collisions.c | 2 +- tests/invalidkeys.h | 1 - tests/pwhashes.c | 1 - 20 files changed, 496 insertions(+), 24 deletions(-) create mode 100644 src/compat_getopt.c create mode 100644 src/compat_getopt.h diff --git a/autogen.sh b/autogen.sh index bf11bb9..f9a3c41 100755 --- a/autogen.sh +++ b/autogen.sh @@ -79,3 +79,6 @@ if test -z "$clean"; then fi rm -rf README include/pcp/config.h.in~ libpcp/stamp-h1 autom4te.cache + +sleep 1 +touch Makefile.in configure */Makefile.in \ No newline at end of file diff --git a/configure b/configure index 1179fae..5fbeb55 100755 --- a/configure +++ b/configure @@ -12364,7 +12364,9 @@ for ac_func in \ be32toh \ htobe32 \ umask \ - towlower + towlower \ + getopt_long \ + vasprintf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` @@ -12476,10 +12478,13 @@ $as_echo "no" >&6; } fi - # Check for some target-specific stuff case "$host" in - *-*-aix*) ;; + *aix*) + # libm is required as well + CFLAGS="$CFLAGS -D_AIX_SOURCE=1" + LDFLAGS="$LDFLAGS -lm" + ;; *-*-android*) ;; *-*-cygwin*) ;; *-*-dgux*) ;; diff --git a/configure.ac b/configure.ac index 581b01e..6c682e2 100755 --- a/configure.ac +++ b/configure.ac @@ -79,7 +79,9 @@ AC_CHECK_FUNCS( \ be32toh \ htobe32 \ umask \ - towlower + towlower \ + getopt_long \ + vasprintf ) AC_MSG_CHECKING([compiler and flags for sanity]) @@ -151,11 +153,11 @@ if test "x${_havenacl}" = "xno"; then fi - # Check for some target-specific stuff case "$host" in - *-*-aix*) + *aix*) # libm is required as well + CFLAGS="$CFLAGS -D_AIX_SOURCE=1" LDFLAGS="$LDFLAGS -lm" ;; *-*-android*) ;; diff --git a/include/pcp/config.h.in b/include/pcp/config.h.in index 96b1c04..605383a 100644 --- a/include/pcp/config.h.in +++ b/include/pcp/config.h.in @@ -45,6 +45,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H +/* Define to 1 if you have the `getopt_long' function. */ +#undef HAVE_GETOPT_LONG + /* Define to 1 if you have the `htobe32' function. */ #undef HAVE_HTOBE32 @@ -132,6 +135,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the `vasprintf' function. */ +#undef HAVE_VASPRINTF + /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H diff --git a/include/pcp/mem.h b/include/pcp/mem.h index 3f32f85..faa42fa 100644 --- a/include/pcp/mem.h +++ b/include/pcp/mem.h @@ -25,8 +25,6 @@ #include #include -#include -#include #include "platform.h" // simple malloc() wrapper diff --git a/include/pcp/platform.h b/include/pcp/platform.h index f025384..61c1082 100644 --- a/include/pcp/platform.h +++ b/include/pcp/platform.h @@ -31,14 +31,18 @@ # ifdef HAVE_SYS_ENDIAN_H # include # ifdef HAVE_BETOH32 - // openbsd, use aliases +# // openbsd, use aliases # define be32toh betoh32 # define htobe32 hto32be +# define be64toh betoh64 +# define htobe64 hto64be # endif # else // no sys/endian.h # if __BYTE_ORDER == __BIG_ENDIAN -# define be32toh(x) ((void)0) -# define htobe32(x) ((void)0) +# define be32toh(x) (x) +# define htobe32(x) (x) +# define be64toh(x) (x) +# define htobe64(x) (x) # else # ifdef HAVE_ARPA_INET_H # include @@ -51,6 +55,8 @@ # endif # define be32toh(x) ((u_int32_t)ntohl((u_int32_t)(x))) # define htobe32(x) ((u_int32_t)htonl((u_int32_t)(x))) +# define be64toh(x) ((u_int64_t)ntohl((u_int64_t)(x))) +# define htobe64(x) ((u_int64_t)htonl((u_int64_t)(x))) # endif # endif // HAVE_SYS_ENDIAN_H #endif // HAVE_ENDIAN_H @@ -73,5 +79,68 @@ static inline void arc4random_buf(void *buf, size_t nbytes) { #endif +#ifndef HAVE_ERR_H + +#include +#include +#include +#include + +static inline void err(int eval, const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "pcp1"); + if (fmt != NULL) { + fprintf(stderr, ": "); + vfprintf(stderr, fmt, ap); + } + fprintf(stderr, ": %s\n", strerror(errno)); + va_end(ap); +} + +#else + +#include +#include + +#endif + + + +#ifndef HAVE_VASPRINTF + +#include +static inline +int vasprintf(char **ret, const char *format, va_list args) { + va_list copy; + va_copy(copy, args); + + *ret = 0; + + int count = vsnprintf(NULL, 0, format, args); + if (count >= 0) { + char* buffer = malloc(count + 1); + if (buffer != NULL) { + count = vsnprintf(buffer, count + 1, format, copy); + if (count < 0) + free(buffer); + else + *ret = buffer; + } + } + va_end(copy); // Each va_start() or va_copy() needs a va_end() + + return count; +} + +#endif + + +#ifdef _AIX_SOURCE +#define _LINUX_SOURCE_COMPAT +#endif + + + #endif /* !_HAVE_PCP_PLATFORM_H */ diff --git a/libpcp/fatal.c b/libpcp/fatal.c index b3ccee0..fcc0896 100644 --- a/libpcp/fatal.c +++ b/libpcp/fatal.c @@ -21,6 +21,7 @@ #include "defines.h" +#include "platform.h" #include #include diff --git a/libpcp/mem.c b/libpcp/mem.c index c900a66..b67838d 100644 --- a/libpcp/mem.c +++ b/libpcp/mem.c @@ -25,11 +25,14 @@ void *ucmalloc(size_t s) { + if (s == 0) + return NULL; + size_t size = s * sizeof(unsigned char); void *value = malloc (size); if (value == NULL) { - err(errno, "Cannot allocate memory"); + err(errno, "Cannot allocate %d bytes of memory", (int)s); exit(-1); } diff --git a/man/pcp1.1 b/man/pcp1.1 index c4cb82e..1b7bdec 100644 --- a/man/pcp1.1 +++ b/man/pcp1.1 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "PCP1 1" -.TH PCP1 1 "2013-11-16" "PCP 0.1.5" "USER CONTRIBUTED DOCUMENTATION" +.TH PCP1 1 "2013-11-17" "PCP 0.1.5" "USER CONTRIBUTED DOCUMENTATION" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/src/Makefile.am b/src/Makefile.am index 8fbda5b..0862a02 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,5 +26,6 @@ bin_PROGRAMS = pcp1 pcp1_LDADD = ../libpcp/.libs/libpcp1.a pcp1_SOURCES = pcp.c keymgmt.c keyprint.c readpass.c \ - encryption.c z85util.c signature.c + encryption.c z85util.c signature.c \ + compat_getopt.c diff --git a/src/Makefile.in b/src/Makefile.in index 6ce061a..d43a0a4 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -91,7 +91,7 @@ am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_pcp1_OBJECTS = pcp.$(OBJEXT) keymgmt.$(OBJEXT) keyprint.$(OBJEXT) \ readpass.$(OBJEXT) encryption.$(OBJEXT) z85util.$(OBJEXT) \ - signature.$(OBJEXT) + signature.$(OBJEXT) compat_getopt.$(OBJEXT) pcp1_OBJECTS = $(am_pcp1_OBJECTS) pcp1_DEPENDENCIES = ../libpcp/.libs/libpcp1.a DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/pcp @@ -233,7 +233,8 @@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I../include/pcp -Wall -g pcp1_LDADD = ../libpcp/.libs/libpcp1.a pcp1_SOURCES = pcp.c keymgmt.c keyprint.c readpass.c \ - encryption.c z85util.c signature.c + encryption.c z85util.c signature.c \ + compat_getopt.c all: all-am @@ -325,6 +326,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat_getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encryption.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keymgmt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyprint.Po@am__quote@ diff --git a/src/compat_getopt.c b/src/compat_getopt.c new file mode 100644 index 0000000..674f874 --- /dev/null +++ b/src/compat_getopt.c @@ -0,0 +1,279 @@ +/* + * my_getopt.c - my re-implementation of getopt. + * Copyright 1997, 2000, 2001, 2002, Benjamin Sittler + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "config.h" + +#if ! ( defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT_LONG) ) + +#include +#include +#include +#include + +#include "compat_getopt.h" + +int my_optind=1, my_opterr=1, my_optopt=0; +char *my_optarg=0; + +/* this is the plain old UNIX getopt, with GNU-style extensions. */ +/* if you're porting some piece of UNIX software, this is all you need. */ +/* this supports GNU-style permution and optional arguments */ + +int my_getopt(int argc, char * argv[], const char *opts) +{ + static int charind=0; + const char *s; + char mode, colon_mode; + int off = 0, opt = -1; + + if(getenv("POSIXLY_CORRECT")) colon_mode = mode = '+'; + else { + if((colon_mode = *opts) == ':') off ++; + if(((mode = opts[off]) == '+') || (mode == '-')) { + off++; + if((colon_mode != ':') && ((colon_mode = opts[off]) == ':')) + off ++; + } + } + my_optarg = 0; + if(charind) { + my_optopt = argv[my_optind][charind]; + for(s=opts+off; *s; s++) if(my_optopt == *s) { + charind++; + if((*(++s) == ':') || ((my_optopt == 'W') && (*s == ';'))) { + if(argv[my_optind][charind]) { + my_optarg = &(argv[my_optind++][charind]); + charind = 0; + } else if(*(++s) != ':') { + charind = 0; + if(++my_optind >= argc) { + if(my_opterr) fprintf(stderr, + "%s: option requires an argument -- %c\n", + argv[0], my_optopt); + opt = (colon_mode == ':') ? ':' : '?'; + goto my_getopt_ok; + } + my_optarg = argv[my_optind++]; + } + } + opt = my_optopt; + goto my_getopt_ok; + } + if(my_opterr) fprintf(stderr, + "%s: illegal option -- %c\n", + argv[0], my_optopt); + opt = '?'; + if(argv[my_optind][++charind] == '\0') { + my_optind++; + charind = 0; + } + my_getopt_ok: + if(charind && ! argv[my_optind][charind]) { + my_optind++; + charind = 0; + } + } else if((my_optind >= argc) || + ((argv[my_optind][0] == '-') && + (argv[my_optind][1] == '-') && + (argv[my_optind][2] == '\0'))) { + my_optind++; + opt = -1; + } else if((argv[my_optind][0] != '-') || + (argv[my_optind][1] == '\0')) { + char *tmp; + int i, j, k; + + if(mode == '+') opt = -1; + else if(mode == '-') { + my_optarg = argv[my_optind++]; + charind = 0; + opt = 1; + } else { + for(i=j=my_optind; i j) { + tmp=argv[--i]; + for(k=i; k+1 argc) my_optind = argc; + return opt; +} + +/* this is the extended getopt_long{,_only}, with some GNU-like + * extensions. Implements _getopt_internal in case any programs + * expecting GNU libc getopt call it. + */ + +int _my_getopt_internal(int argc, char * argv[], const char *shortopts, + const struct option *longopts, int *longind, + int long_only) +{ + char mode, colon_mode = *shortopts; + int shortoff = 0, opt = -1; + + if(getenv("POSIXLY_CORRECT")) colon_mode = mode = '+'; + else { + if((colon_mode = *shortopts) == ':') shortoff ++; + if(((mode = shortopts[shortoff]) == '+') || (mode == '-')) { + shortoff++; + if((colon_mode != ':') && ((colon_mode = shortopts[shortoff]) == ':')) + shortoff ++; + } + } + my_optarg = 0; + if((my_optind >= argc) || + ((argv[my_optind][0] == '-') && + (argv[my_optind][1] == '-') && + (argv[my_optind][2] == '\0'))) { + my_optind++; + opt = -1; + } else if((argv[my_optind][0] != '-') || + (argv[my_optind][1] == '\0')) { + char *tmp; + int i, j, k; + + opt = -1; + if(mode == '+') return -1; + else if(mode == '-') { + my_optarg = argv[my_optind++]; + return 1; + } + for(i=j=my_optind; i j) { + tmp=argv[--i]; + for(k=i; k+1= argc) { + opt = (colon_mode == ':') ? ':' : '?'; + if(my_opterr) fprintf(stderr, + "%s: option `--%s' requires an argument\n", + argv[0], longopts[found].name); + } else my_optarg = argv[my_optind]; + } + if(!opt) { + if (longind) *longind = found; + if(!longopts[found].flag) opt = longopts[found].val; + else *(longopts[found].flag) = longopts[found].val; + } + my_optind++; + } else if(!hits) { + if(offset == 1) opt = my_getopt(argc, argv, shortopts); + else { + opt = '?'; + if(my_opterr) fprintf(stderr, + "%s: unrecognized option `%s'\n", + argv[0], argv[my_optind++]); + } + } else { + opt = '?'; + if(my_opterr) fprintf(stderr, + "%s: option `%s' is ambiguous\n", + argv[0], argv[my_optind++]); + } + } + if (my_optind > argc) my_optind = argc; + return opt; +} + +int my_getopt_long(int argc, char * argv[], const char *shortopts, + const struct option *longopts, int *longind) +{ + return _my_getopt_internal(argc, argv, shortopts, longopts, longind, 0); +} + +int my_getopt_long_only(int argc, char * argv[], const char *shortopts, + const struct option *longopts, int *longind) +{ + return _my_getopt_internal(argc, argv, shortopts, longopts, longind, 1); +} + +#endif + diff --git a/src/compat_getopt.h b/src/compat_getopt.h new file mode 100644 index 0000000..c0c94d2 --- /dev/null +++ b/src/compat_getopt.h @@ -0,0 +1,91 @@ +/* + * my_getopt.h - interface to my re-implementation of getopt. + * Copyright 1997, 2000, 2001, 2002, Benjamin Sittler + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef MY_GETOPT_H_INCLUDED +#define MY_GETOPT_H_INCLUDED + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#if defined(HAVE_GETOPT_H) && defined(HAVE_GETOPT_LONG) +#include +#else + +/* Prevent mingw32 from including an incompatible getopt implementation */ +#define __GETOPT_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define getopt my_getopt +#define getopt_long my_getopt_long +#define getopt_long_only my_getopt_long_only +#define _getopt_internal _my_getopt_internal +#define opterr my_opterr +#define optind my_optind +#define optopt my_optopt +#define optarg my_optarg + +/* UNIX-style short-argument parser */ +extern int my_getopt(int argc, char * argv[], const char *opts); + +extern int my_optind, my_opterr, my_optopt; +extern char *my_optarg; + +struct option { + const char *name; + int has_arg; + int *flag; + int val; +}; + +/* human-readable values for has_arg */ +#undef no_argument +#define no_argument 0 +#undef required_argument +#define required_argument 1 +#undef optional_argument +#define optional_argument 2 + +/* GNU-style long-argument parsers */ +extern int my_getopt_long(int argc, char * argv[], const char *shortopts, + const struct option *longopts, int *longind); + +extern int my_getopt_long_only(int argc, char * argv[], const char *shortopts, + const struct option *longopts, int *longind); + +extern int _my_getopt_internal(int argc, char * argv[], const char *shortopts, + const struct option *longopts, int *longind, + int long_only); + +#ifdef __cplusplus +} +#endif + +#endif /* HAVE_GETOPT_H && HAVE_GETOPT_LONG && HAVE_GETOPT_LONG_ONLY */ + +#endif /* MY_GETOPT_H_INCLUDED */ diff --git a/src/pcp.h b/src/pcp.h index 4ee6f3e..a11183e 100644 --- a/src/pcp.h +++ b/src/pcp.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include // lib #include "mem.h" diff --git a/src/z85util.h b/src/z85util.h index bf1b54b..e79ba78 100644 --- a/src/z85util.h +++ b/src/z85util.h @@ -30,7 +30,6 @@ #include #include #include -#include #include "mem.h" #include "z85.h" diff --git a/tests/Makefile.am b/tests/Makefile.am index 50cc6bd..053d3ac 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,7 +23,7 @@ AM_CFLAGS = -I../include/pcp -Wall -g check_PROGRAMS = col invalidkeys pwhashes col_LDADD = ../libpcp/.libs/libpcp1.a -col_SOURCES = collisions.c +col_SOURCES = collisions.c ../src/compat_getopt.c invalidkeys_LDADD = ../libpcp/.libs/libpcp1.a \ ../src/keyprint.o ../src/keymgmt.o ../src/readpass.o diff --git a/tests/Makefile.in b/tests/Makefile.in index 7853852..71adbfc 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -86,7 +86,7 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/pcp/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am_col_OBJECTS = collisions.$(OBJEXT) +am_col_OBJECTS = collisions.$(OBJEXT) compat_getopt.$(OBJEXT) col_OBJECTS = $(am_col_OBJECTS) col_DEPENDENCIES = ../libpcp/.libs/libpcp1.a am_invalidkeys_OBJECTS = invalidkeys.$(OBJEXT) @@ -235,7 +235,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I../include/pcp -Wall -g col_LDADD = ../libpcp/.libs/libpcp1.a -col_SOURCES = collisions.c +col_SOURCES = collisions.c ../src/compat_getopt.c invalidkeys_LDADD = ../libpcp/.libs/libpcp1.a \ ../src/keyprint.o ../src/keymgmt.o ../src/readpass.o @@ -303,6 +303,7 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collisions.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat_getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/invalidkeys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwhashes.Po@am__quote@ @@ -327,6 +328,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +compat_getopt.o: ../src/compat_getopt.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compat_getopt.o -MD -MP -MF $(DEPDIR)/compat_getopt.Tpo -c -o compat_getopt.o `test -f '../src/compat_getopt.c' || echo '$(srcdir)/'`../src/compat_getopt.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/compat_getopt.Tpo $(DEPDIR)/compat_getopt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/compat_getopt.c' object='compat_getopt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compat_getopt.o `test -f '../src/compat_getopt.c' || echo '$(srcdir)/'`../src/compat_getopt.c + +compat_getopt.obj: ../src/compat_getopt.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compat_getopt.obj -MD -MP -MF $(DEPDIR)/compat_getopt.Tpo -c -o compat_getopt.obj `if test -f '../src/compat_getopt.c'; then $(CYGPATH_W) '../src/compat_getopt.c'; else $(CYGPATH_W) '$(srcdir)/../src/compat_getopt.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/compat_getopt.Tpo $(DEPDIR)/compat_getopt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../src/compat_getopt.c' object='compat_getopt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compat_getopt.obj `if test -f '../src/compat_getopt.c'; then $(CYGPATH_W) '../src/compat_getopt.c'; else $(CYGPATH_W) '$(srcdir)/../src/compat_getopt.c'; fi` + mostlyclean-libtool: -rm -f *.lo diff --git a/tests/collisions.c b/tests/collisions.c index a9d4428..450dd35 100644 --- a/tests/collisions.c +++ b/tests/collisions.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/tests/invalidkeys.h b/tests/invalidkeys.h index 5dbc15a..694f2d0 100644 --- a/tests/invalidkeys.h +++ b/tests/invalidkeys.h @@ -1,7 +1,6 @@ #include #include #include -#include #include #include diff --git a/tests/pwhashes.c b/tests/pwhashes.c index a8239af..8895246 100644 --- a/tests/pwhashes.c +++ b/tests/pwhashes.c @@ -1,7 +1,6 @@ #include #include #include -#include #include #include