convert to use autotools
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 13 Apr 2009 22:21:37 +0000 (15:21 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 13 Apr 2009 22:21:37 +0000 (15:21 -0700)
.gitignore
Makefile
Makefile.am [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
bti.c
configure.ac [new file with mode: 0644]

index 6576479..780cf47 100644 (file)
@@ -1,6 +1,25 @@
+.deps
 bti
-bti_version.h
 *.o
 *.swp
 *.gz
 *.bz2
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+config.h
+config.h.in
+config.log
+config.status
+config.guess
+config.sub
+libtool
+ltmain.sh
+install-sh
+missing
+configure
+stamp-h1
+depcomp
+INSTALL
+check-news.in
index 05c23b4..18212e3 100644 (file)
--- a/Makefile
+++ b/Makefile
-#
-# Copyright (C) 2006 Greg Kroah-Hartman <greg@kroah.com>
-#
-# 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; version 2 of the License.
-#
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.  Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
 # 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, write to the Free Software
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-#
-#
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
 
-VERSION = 017
 
-PROGRAM = bti
-SCRIPTS = bti-shrink-urls
 
-CORE_OBJS = \
-       bti.o
 
-GEN_HEADERS = \
-       bti_version.h
+pkgdatadir = $(datadir)/bti
+pkglibdir = $(libdir)/bti
+pkgincludedir = $(includedir)/bti
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+bin_PROGRAMS = bti$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(top_srcdir)/configure COPYING ChangeLog INSTALL depcomp \
+       install-sh missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_bti_OBJECTS = bti.$(OBJEXT)
+bti_OBJECTS = $(am_bti_OBJECTS)
+bti_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I.
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(bti_SOURCES)
+DIST_SOURCES = $(bti_SOURCES)
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(dist_man_MANS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = ${SHELL} /home/gregkh/src/bti/missing --run aclocal-1.10
+AMTAR = ${SHELL} /home/gregkh/src/bti/missing --run tar
+AUTOCONF = ${SHELL} /home/gregkh/src/bti/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/gregkh/src/bti/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/gregkh/src/bti/missing --run automake-1.10
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -Wall -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wpointer-arith -Wsign-compare -Wchar-subscripts -Wstrict-prototypes -Wshadow -Wformat=2 -Wtype-limits -O2
+CPPFLAGS =   -I/usr/include/libxml2
+CYGPATH_W = echo
+DEFS = -DPACKAGE_NAME=\"bti\" -DPACKAGE_TARNAME=\"bti\" -DPACKAGE_VERSION=\"017\" -DPACKAGE_STRING=\"bti\ 017\" -DPACKAGE_BUGREPORT=\"greg@kroah.com\" -DPACKAGE=\"bti\" -DVERSION=\"017\" -DHAVE_LIBNSL=1 -DHAVE_LIBREADLINE=1 -DHAVE_LIBPCRE=1 -DHAVE_LIBCURL=1 -DLIBCURL_FEATURE_SSL=1 -DLIBCURL_FEATURE_IPV6=1 -DLIBCURL_FEATURE_LIBZ=1 -DLIBCURL_FEATURE_NTLM=1 -DLIBCURL_PROTOCOL_HTTP=1 -DLIBCURL_PROTOCOL_HTTPS=1 -DLIBCURL_PROTOCOL_FTP=1 -DLIBCURL_PROTOCOL_FTPS=1 -DLIBCURL_PROTOCOL_FILE=1 -DLIBCURL_PROTOCOL_TELNET=1 -DLIBCURL_PROTOCOL_DICT=1 -DLIBCURL_PROTOCOL_TFTP=1
+DEPDIR = .deps
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EXEEXT = 
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LDFLAGS = 
+LIBCURL = -lcurl -lrt -lz -L/usr/lib -lgnutls -L/usr/lib -ltasn1 -lgcrypt -lgpg-error
+LIBCURL_CPPFLAGS = 
+LIBOBJS = 
+LIBS = -lpcre -lreadline -lnsl  -lcurl -lrt -lz -L/usr/lib -lgnutls -L/usr/lib -ltasn1 -lgcrypt -lgpg-error -lxml2 -lz -lm
+LTLIBOBJS = 
+MAKEINFO = ${SHELL} /home/gregkh/src/bti/missing --run makeinfo
+MKDIR_P = /bin/mkdir -p
+OBJEXT = o
+PACKAGE = bti
+PACKAGE_BUGREPORT = greg@kroah.com
+PACKAGE_NAME = bti
+PACKAGE_STRING = bti 017
+PACKAGE_TARNAME = bti
+PACKAGE_VERSION = 017
+PATH_SEPARATOR = :
+SET_MAKE = 
+SHELL = /bin/sh
+STRIP = 
+VERSION = 017
+XML2_CONFIG = /usr/bin/xml2-config
+XML_CPPFLAGS = -I/usr/include/libxml2
+XML_LIBS = -lxml2 -lz -lm
+_libcurl_config = 
+abs_builddir = /home/gregkh/src/bti
+abs_srcdir = /home/gregkh/src/bti
+abs_top_builddir = /home/gregkh/src/bti
+abs_top_srcdir = /home/gregkh/src/bti
+ac_ct_CC = gcc
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = ${exec_prefix}/bin
+build_alias = 
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host_alias = 
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = $(SHELL) /home/gregkh/src/bti/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = /bin/mkdir -p
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = 
+top_builddir = .
+top_srcdir = .
+bti_SOURCES = \
+       bti.c
 
-MAN_PAGES = \
+dist_man_MANS = \
        bti.1 \
        bti-shrink-urls.1
 
-CROSS_COMPILE ?=
-CC = $(CROSS_COMPILE)gcc
-LD = $(CROSS_COMPILE)gcc
-AR = $(CROSS_COMPILE)ar
-
-XML2_CFLAGS = `xml2-config --cflags`
-PCRE_CFLAGS = `pcre-config --cflags`
-override CFLAGS        += -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -O2 $(XML2_CFLAGS) $(PCRE_CFLAGS)
-
-WARNINGS       = -Wstrict-prototypes -Wsign-compare -Wshadow \
-                 -Wchar-subscripts -Wmissing-declarations -Wnested-externs \
-                 -Wpointer-arith -Wcast-align -Wsign-compare -Wmissing-prototypes
-CFLAGS         += $(WARNINGS)
-LDFLAGS                += -Wl,-warn-common,--as-needed
-
-DEST           ?=
-PREFIX         ?= /usr/local
-
-INSTALL                = install
-INSTALL_BIN    = ${INSTALL} -m 0755 -t ${DEST}${PREFIX}/bin
-INSTALL_MAN    = ${INSTALL} -m 0644 -t ${DEST}${PREFIX}/share/man
-
-ifeq ($(strip $(V)),)
-       E = @echo
-       Q = @
-else
-       E = @\#
-       Q =
-endif
-export E Q
-
-
-# We need -lcurl for the curl stuff
-# We need -lsocket and -lnsl when on Solaris
-# We need -lreadline for readline support
-# We need -lssl and -lcrypto when using libcurl with SSL support
-# We need -lpthread for the pthread example
-#LIB_OBJS = -lcurl -lnsl -lssl -lcrypto
-LIB_OBJS = -lcurl -lnsl -lreadline
-LIB_XML2 = `xml2-config --libs`
-LIB_PCRE = `pcre-config --libs`
-
-all:   $(PROGRAM) $(MAN_PAGES)
-
-# "Static Pattern Rule" to build all programs
-bti: %: $(HEADERS) $(GEN_HEADERS) $(CORE_OBJS)
-       $(E) "  LD      " $@
-       $(Q) $(LD) $(LDFLAGS) $(CORE_OBJS) -o $@ $(LIB_OBJS) $(LIB_XML2) $(LIB_PCRE)
-
-# build the objects
-%.o: %.c $(HEADERS) $(GEN_HEADERS)
-       $(E) "  CC      " $@
-       $(Q) $(CC) -c $(CFLAGS) $< -o $@
-
-
-bti_version.h: Makefile
-       $(E) "  GENHDR  " $@
-       $(Q) echo "/* Generated by make. */" > $@
-       $(Q) echo \#define BTI_VERSION  \"$(VERSION)\" >> $@
-
-
-# man pages
-%.1: %.xml
-       $(E) "  XMLTO   " $@
-       $(Q) xmlto man $?
-.PRECIOUS: %.3
-
-clean:
-       $(E) "  CLEAN   "
-       $(Q) - find . -type f -name '*.orig' -print0 | xargs -0r rm -f
-       $(Q) - find . -type f -name '*.rej' -print0 | xargs -0r rm -f
-       $(Q) - find . -type f -name '*~' -print0 | xargs -0r rm -f
-       $(Q) - find . -type f -name '*.[oas]' -print0 | xargs -0r rm -f
-       $(Q) - find . -type f -name "*.gcno" -print0 | xargs -0r rm -f
-       $(Q) - find . -type f -name "*.gcda" -print0 | xargs -0r rm -f
-       $(Q) - find . -type f -name "*.gcov" -print0 | xargs -0r rm -f
-       $(Q) - rm -f core $(PROGRAM) $(GEN_HEADERS)
-.PHONY: clean
-
-release:
-       $(Q) - rm -f bti-$(VERSION).tar.gz
-       head -1 ChangeLog | grep -q "to v$(VERSION)"
-       head -1 RELEASE-NOTES | grep -q "bti $(VERSION)"
-       git commit -a -m "release $(VERSION)"
-       cat .git/refs/heads/master > .git/refs/tags/$(VERSION)
-       @ echo
-       git archive --format=tar --prefix=bti-$(VERSION)/ HEAD | gzip -9v > bti-$(VERSION).tar.gz
-.PHONY: release
-
-install: all
-       $(E) "  INSTALL  " ${DEST}${PREFIX}
-       ${Q} ${INSTALL_BIN} ${PROGRAM} ${SCRIPTS}
-       ${Q} ${INSTALL_MAN} ${MAN_PAGES}
-.PHONY: install
+EXTRA_DIST = \
+       bti.xml \
+       bti-shrink-urls.xml
+
+AUTOMAKE_OPTIONS = foreign
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+am--refresh:
+       @:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+             cd $(srcdir) && $(AUTOMAKE) --foreign  \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           echo ' $(SHELL) ./config.status'; \
+           $(SHELL) ./config.status;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+       @list='$(bin_PROGRAMS)'; for p in $$list; do \
+         p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         if test -f $$p \
+         ; then \
+           f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+          echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+          $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+         else :; fi; \
+       done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; for p in $$list; do \
+         f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+         echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+         rm -f "$(DESTDIR)$(bindir)/$$f"; \
+       done
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+bti$(EXEEXT): $(bti_OBJECTS) $(bti_DEPENDENCIES) 
+       @rm -f bti$(EXEEXT)
+       $(LINK) $(bti_OBJECTS) $(bti_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+include ./$(DEPDIR)/bti.Po
+
+.c.o:
+       $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+       mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+#      source='$<' object='$@' libtool=no \
+#      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+#      $(COMPILE) -c $<
+
+.c.obj:
+       $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+       mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+#      source='$<' object='$@' libtool=no \
+#      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+#      $(COMPILE) -c `$(CYGPATH_W) '$<'`
+install-man1: $(man1_MANS) $(man_MANS)
+       @$(NORMAL_INSTALL)
+       test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+       @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+       l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+       for i in $$l2; do \
+         case "$$i" in \
+           *.1*) list="$$list $$i" ;; \
+         esac; \
+       done; \
+       for i in $$list; do \
+         if test -f $$i; then file=$$i; \
+         else file=$(srcdir)/$$i; fi; \
+         ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+         case "$$ext" in \
+           1*) ;; \
+           *) ext='1' ;; \
+         esac; \
+         inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+         inst=`echo $$inst | sed -e 's/^.*\///'`; \
+         inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+         echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+         $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
+       done
+uninstall-man1:
+       @$(NORMAL_UNINSTALL)
+       @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+       l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+       for i in $$l2; do \
+         case "$$i" in \
+           *.1*) list="$$list $$i" ;; \
+         esac; \
+       done; \
+       for i in $$list; do \
+         ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+         case "$$ext" in \
+           1*) ;; \
+           *) ext='1' ;; \
+         esac; \
+         inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+         inst=`echo $$inst | sed -e 's/^.*\///'`; \
+         inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+         echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
+         rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d $(distdir) || mkdir $(distdir)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+       -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+       || chmod -R a+r $(distdir)
+dist-gzip: distdir
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       $(am__remove_distdir)
+
+dist-bzip2: distdir
+       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+       $(am__remove_distdir)
+
+dist-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-tarZ: distdir
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+       $(am__remove_distdir)
+
+dist-shar: distdir
+       shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+       $(am__remove_distdir)
+
+dist-zip: distdir
+       -rm -f $(distdir).zip
+       zip -rq $(distdir).zip $(distdir)
+       $(am__remove_distdir)
+
+dist dist-all: distdir
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+       case '$(DIST_ARCHIVES)' in \
+       *.tar.gz*) \
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+       *.zip*) \
+         unzip $(distdir).zip ;;\
+       esac
+       chmod -R a-w $(distdir); chmod a+w $(distdir)
+       mkdir $(distdir)/_build
+       mkdir $(distdir)/_inst
+       chmod a-w $(distdir)
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && cd $(distdir)/_build \
+         && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+           $(DISTCHECK_CONFIGURE_FLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+         && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+               distuninstallcheck \
+         && chmod -R a-w "$$dc_install_base" \
+         && ({ \
+              (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+                   distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+             } || { rm -rf "$$dc_destdir"; exit 1; }) \
+         && rm -rf "$$dc_destdir" \
+         && $(MAKE) $(AM_MAKEFLAGS) dist \
+         && rm -rf $(DIST_ARCHIVES) \
+         && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @cd $(distuninstallcheck_dir) \
+       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+          || { echo "ERROR: files left after uninstall:" ; \
+               if test -n "$(DESTDIR)"; then \
+                 echo "  (check DESTDIR support)"; \
+               fi ; \
+               $(distuninstallcheck_listfiles) ; \
+               exit 1; } >&2
+distcleancheck: distclean
+       @if test '$(srcdir)' = . ; then \
+         echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+         exit 1 ; \
+       fi
+       @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+         || { echo "ERROR: files left in build directory after distclean:" ; \
+              $(distcleancheck_listfiles) ; \
+              exit 1; } >&2
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(MANS)
+installdirs:
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man: install-man1
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf $(top_srcdir)/autom4te.cache
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \
+       distclean distclean-compile distclean-generic distclean-tags \
+       distcleancheck distdir distuninstallcheck dvi dvi-am html \
+       html-am info info-am install install-am install-binPROGRAMS \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-man1 \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-binPROGRAMS \
+       uninstall-man uninstall-man1
+
+       bti-shrink-urls
+
+%.1 : %.xml
+        $(XSLTPROC) -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..2376b51
--- /dev/null
@@ -0,0 +1,20 @@
+bin_PROGRAMS = \
+       bti
+       bti-shrink-urls
+
+bti_SOURCES = \
+       bti.c
+
+dist_man_MANS = \
+       bti.1 \
+       bti-shrink-urls.1
+
+EXTRA_DIST = \
+       bti.xml \
+       bti-shrink-urls.xml
+
+%.1 : %.xml
+        $(XSLTPROC) -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+
+
+AUTOMAKE_OPTIONS = foreign
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..64ffead
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh -e
+
+autoreconf --install --symlink
+
+CFLAGS="-g -Wall \
+-Wmissing-declarations -Wmissing-prototypes \
+-Wnested-externs -Wpointer-arith \
+-Wpointer-arith -Wsign-compare -Wchar-subscripts \
+-Wstrict-prototypes -Wshadow \
+-Wformat=2 -Wtype-limits"
+
+case "$1" in
+       *install|"")
+               export CFLAGS="$CFLAGS -O2"
+               echo "   configure:  $args"
+               echo
+               ./configure $args
+               ;;
+       *devel)
+               export CFLAGS="$CFLAGS -O0"
+               echo "   configure:  $args"
+               echo
+               ./configure $args
+               ;;
+       *clean)
+               ./configure
+               make maintainer-clean
+               git clean -f -X
+               exit 0
+               ;;
+       *)
+               echo "Usage: $0 [--install|--devel|--clean]"
+               exit 1
+               ;;
+esac
diff --git a/bti.c b/bti.c
index 1050e0a..2ae7b4c 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -16,6 +16,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
+#define _GNU_SOURCE
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
@@ -35,7 +37,6 @@
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 #include <pcre.h>
-#include "bti_version.h"
 
 
 #define zalloc(size)   calloc(size, 1)
@@ -90,7 +91,7 @@ struct bti_curl_buffer {
 static void display_help(void)
 {
        fprintf(stdout, "bti - send tweet to twitter or identi.ca\n");
-       fprintf(stdout, "Version: " BTI_VERSION "\n");
+       fprintf(stdout, "Version: " VERSION "\n");
        fprintf(stdout, "Usage:\n");
        fprintf(stdout, "  bti [options]\n");
        fprintf(stdout, "options are:\n");
@@ -114,7 +115,7 @@ static void display_help(void)
 
 static void display_version(void)
 {
-       fprintf(stdout, "bti - version %s\n", BTI_VERSION);
+       fprintf(stdout, "bti - version %s\n", VERSION);
 }
 
 static struct session *session_alloc(void)
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..630cfa7
--- /dev/null
@@ -0,0 +1,73 @@
+AC_INIT([bti], [017], [greg@kroah.com])
+AC_PREREQ(2.60)
+
+AM_INIT_AUTOMAKE(bti, 017)
+dnl AM_CONFIG_HEADER([check-news foreign 1.9 dist-bzip2])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+AC_CONFIG_MACRO_DIR([m4])
+
+dnl FIXME: Replace `main' with a function in `-lnsl':
+AC_CHECK_LIB([nsl], [main])
+dnl FIXME: Replace `main' with a function in `-lreadline':
+AC_CHECK_LIB([readline], [main])
+
+AC_CHECK_LIB([pcre], [main])
+
+# CURL
+LIBCURL_CHECK_CONFIG([yes], [], [have_libcurl="yes"], [have_libcurl="no"])
+if test "${have_libcurl}" != yes; then
+       AC_MSG_ERROR([libcurl library not found, please install it])
+else
+       CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
+       LIBS="${LIBS} ${LIBCURL}"
+fi
+
+# libxml2
+AM_PATH_XML2([], [have_libxml="yes"], [have_libxml="no"])
+if test "${have_libxml}" != yes; then
+       AC_MSG_ERROR([libxml not found, please install it])
+else
+       CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
+       LIBS="$LIBS $XML_LIBS"
+fi
+
+
+
+dnl Checks for header files.
+#AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h unistd.h])
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+#AC_TYPE_PID_T
+#AC_TYPE_SIZE_T
+#AC_TYPE_SSIZE_T
+
+dnl Checks for library functions.
+#AC_FUNC_ALLOCA
+#AC_FUNC_FORK
+#AC_FUNC_MALLOC
+#AC_FUNC_REALLOC
+#AC_CHECK_FUNCS([strcasecmp strchr strdup strncasecmp strndup])
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
+
+
+echo "
+       bti $VERSION
+       =======
+
+       prefix:                 ${prefix}
+       datarootdir:            ${datarootdir}
+       mandir:                 ${mandir}
+
+       compiler:               ${CC}
+       cflags:                 ${CFLAGS}
+       ldflags:                ${LDFLAGS}
+
+       xsltproc:               ${XSLTPROC}
+"
+