Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Switch the build system to using automake.

Use automake for the build system, which lets us clean a bunch of
cruft out of Makefile.in.
  • Loading branch information...
commit 37f27bc0e54077fc0d554781c838adc50188236d 1 parent 4f0a2ee
@nelhage authored
View
7 .gitignore
@@ -3,8 +3,11 @@
*.par
*~
.#*
+.deps
META.yml
Makefile
+/Makefile.in
+/libfaim/Makefile.in
Makefile.old
TAGS
\#*#
@@ -19,11 +22,15 @@ config.log
config.status
configure
core
+depcomp
+install-sh
jabber.log
+missing
owl_prototypes.h
owl_prototypes.h.new
perlglue.c
perlwrap.c
pm_to_blib
+stamp-h1
tester
varstubs.c
View
62 Makefile.am
@@ -0,0 +1,62 @@
+bin_PROGRAMS = barnowl.bin
+
+barnowl_bin_SOURCES = $(BASE_SRCS) \
+ owl.h owl_perl.h config.h test.h \
+ owl.c \
+ libzcrypt.a \
+ $(GEN_C) $(GEN_H)
+
+barnowl_bin_LDADD = libfaim/libfaim.a libzcrypt.a
+
+noinst_LIBRARIES = libzcrypt.a
+
+libzcrypt_a_SOURCES = zcrypt.c
+libzcrypt_a_CFLAGS = -w
+
+CPPFLAGS = -I$(top_srcdir)/ \
+ -I$(top_srcdir)/libfaim/
+
+BASE_SRCS=list.c message.c mainwin.c popwin.c zephyr.c messagelist.c \
+ commands.c global.c text.c fmtext.c editwin.c util.c logging.c \
+ perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \
+ regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
+ keypress.c keymap.c keybinding.c cmd.c context.c \
+ aim.c buddy.c buddylist.c style.c errqueue.c \
+ zbuddylist.c popexec.c obarray.c select.c wcwidth.c \
+ glib_compat.c
+
+GEN_C = varstubs.c perlglue.c
+GEN_H = owl_prototypes.h
+
+BUILT_SOURCES = $(GEN_C) $(GEN_H)
+
+proto: owl_prototypes.h
+
+perlglue.c: perlglue.xs
+ perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c
+
+varstubs.c: variable.c stubgen.pl
+ perl stubgen.pl > varstubs.c
+
+# Only move owl_prototypes.h into place if the new one is different
+owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS)
+ perl codelist.pl > owl_prototypes.h.new
+ @cmp -s owl_prototypes.h.new $@ || { \
+ test -f $@ && echo 'Interfaces changed!'; \
+ echo mv -f owl_prototypes.h.new $@; \
+ mv -f owl_prototypes.h.new $@; }
+
+# For emacs flymake-mode
+check-syntax: proto
+ $(CC) $(CFLAGS) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
+
+install-data-local:
+ $(mkinstalldirs) ${DESTDIR}${pkgdatadir}/lib
+ (cd perl/lib && tar -cf - . ) | (cd ${DESTDIR}${pkgdatadir}/lib && tar -xf - )
+
+do_transform = $(shell echo '$(1)' | sed '$(transform)')
+install-exec-hook:
+ mv -f $(DESTDIR)$(bindir)/$(call do_transform,barnowl.bin) \
+ $(DESTDIR)$(bindir)/$(call do_transform,barnowl)
+
+SUBDIRS = libfaim/ perl/modules/
View
147 Makefile.in
@@ -1,147 +0,0 @@
-# $Id$
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-datarootdir = @datarootdir@
-datadir = @datadir@/barnowl
-bindir = @bindir@
-mandir = @mandir@
-transform = @program_transform_name@
-
-CC=@CC@
-LIBS=@LIBS@ -L./libfaim -lfaim
-CFLAGS=@CFLAGS@ -I./libfaim -DDATADIR=\"${datadir}\"
-LDFLAGS=@LDFLAGS@
-XSUBPPDIR=@XSUBPPDIR@
-XSUBPPFLAGS=@XSUBPPFLAGS@
-INSTALL=@INSTALL@
-INSTALL_PROGRAM=@INSTALL_PROGRAM@
-INSTALL_DATA=@INSTALL_DATA@
-ATHSTATIC=@ATHSTATIC@
-
-BASE_SRCS=list.c message.c mainwin.c popwin.c zephyr.c messagelist.c \
- commands.c global.c text.c fmtext.c editwin.c util.c logging.c \
- perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \
- regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
- keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \
- aim.c buddy.c buddylist.c style.c errqueue.c \
- zbuddylist.c popexec.c obarray.c select.c wcwidth.c \
- glib_compat.c
-OWL_SRC = owl.c
-TESTER_SRC = tester.c
-
-EXE = barnowl.bin
-PERL_MODULES = Jabber IRC WordWrap
-MODULE_DIRS = $(PERL_MODULES:%=perl/modules/%)
-
-BASE_OBJS = $(BASE_SRCS:.c=.o)
-
-GEN_C = varstubs.c perlglue.c
-GEN_H = owl_prototypes.h
-GEN_O = $(GEN_C:.c=.o)
-
-OBJS = $(BASE_OBJS) $(GEN_O)
-
-AUTOGEN=$(GEN_C) $(GEN_H)
-#AUTOGEN=$(GEN_C)
-
-HEADERS=$(GEN_H) owl.h owl_perl.h config.h test.h
-
-all: $(EXE) $(MODULE_DIRS)
-
-$(EXE): $(AUTOGEN) $(OBJS) owl.o libfaim
- $(ATHSTATIC) $(CC) -o $(EXE) owl.o $(OBJS) $(LDFLAGS) $(LIBS)
-
-tester: $(AUTOGEN) $(OBJS) tester.o libfaim
- $(ATHSTATIC) $(CC) -o tester tester.o $(OBJS) $(LDFLAGS) $(LIBS)
-
-%.o: %.c $(HEADERS)
- $(CC) -c $(CFLAGS) $< -o $@
-
-# zcrypt is old crufty DES code I don't want to touch
-# Disable all warnings when compiling it
-zcrypt.o: zcrypt.c $(HEADERS)
- $(CC) -c $(CFLAGS) $< -w -o $@
-
-test: tester
- ./tester reg
-
-clean: libfaimclean modules_clean
- $(RM) $(EXE) tester *.o $(AUTOGEN) owl_prototypes.h.new
-
-distclean: clean libfaimdistclean
- $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core
-
-.PHONY: $(MODULE_DIRS) $(MODULE_DIRS:%=clean_%)
-
-modules: $(MODULE_DIRS)
-modules_clean: $(MODULE_DIRS:%=clean_%)
-
-$(MODULE_DIRS): %: %/Makefile
- ( cd $@ && $(MAKE) $(notdir $@).par )
-
-$(MODULE_DIRS:=/Makefile): %/Makefile: %/Makefile.PL
- ( cd $(dir $@) && perl -I../../lib Makefile.PL )
-
-$(MODULE_DIRS:%=clean_%): clean_%:
- (cd $* && (test ! -f Makefile || $(MAKE) clean))
-
-proto: owl_prototypes.h
-
-perlglue.c: perlglue.xs Makefile
- perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c
-
-varstubs.c: variable.c stubgen.pl
- perl stubgen.pl > varstubs.c
-
-# Only move owl_prototypes.h into place if the new one is different
-owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS)
- perl codelist.pl > owl_prototypes.h.new
- @cmp -s owl_prototypes.h.new $@ || { \
- test -f $@ && echo 'Interfaces changed!'; \
- echo mv -f owl_prototypes.h.new $@; \
- mv -f owl_prototypes.h.new $@; }
-#owl_prototypes.h:
-
-.PHONY: tags clean distclean proto test check-syntax
-
-tags: TAGS
-
-TAGS: $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H)
- etags $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H)
-
-$(BASE_OBJS) varstubs.h: owl.h config.h owl_prototypes.h
-
-libfaim: libfaim/libfaim.a
-
-libfaim/libfaim.a:
- (cd libfaim && $(MAKE))
-
-libfaimclean:
- (cd libfaim && $(MAKE) clean)
-
-libfaimdistclean:
- (cd libfaim && $(MAKE) distclean)
-
-install: all installdirs $(PERL_MODULES:%=module_install_%)
- ${INSTALL_PROGRAM} $(EXE) ${DESTDIR}${bindir}/`echo barnowl|sed '$(transform)'`
- ${INSTALL_DATA} doc/barnowl.1 ${DESTDIR}${mandir}/man1/barnowl.1
- (cd perl/lib && tar --exclude .svn -cf - . ) | (cd ${DESTDIR}${datadir}/lib && tar -xf - )
-
-installdirs: mkinstalldirs
- ${srcdir}/mkinstalldirs \
- ${DESTDIR}${bindir} \
- ${DESTDIR}${mandir}/man1 \
- ${DESTDIR}${datadir}/lib \
- ${DESTDIR}${datadir}/modules
-
-.PHONY: $(PERL_MODULES:%=module_install_%)
-
-$(PERL_MODULES:%=module_install_%): module_install_%: installdirs
- ${INSTALL_DATA} perl/modules/$*/$*.par ${DESTDIR}${datadir}/modules/$*.par
-
-# For emacs flymake-mode
-check-syntax: proto
- $(CC) $(CFLAGS) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
View
3  autogen.sh
@@ -1,2 +1,3 @@
#!/bin/sh
-autoreconf
+autoreconf -fvi
+
View
26 configure.ac
@@ -1,16 +1,12 @@
dnl $Id$
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(owl.c)
+AC_INIT([BarnOwl],[1.1.2],[bug-barnowl@mit.edu])
+AM_INIT_AUTOMAKE([-Wall foreign])
-AC_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADER([config.h])
AC_PROG_CC
-dnl If we're using GCC, enable all warnings
-if test "$GCC" = yes; then
- CFLAGS="$CFLAGS -Wall -g";
-fi
-
dnl Check for Athena
AC_MSG_CHECKING(for /usr/athena/include)
if test -d /usr/athena/include; then
@@ -124,17 +120,21 @@ CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
-dnl Checks for typedefs, structures, and compiler characteristics.
+if test "x${prefix}" = "xNONE"; then
+ prefix="${ac_default_prefix}"
+fi
-dnl Support --program-{prefix,suffix,transform}
-AC_ARG_PROGRAM
+AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
+ [Package data directory])
+
+dnl Checks for typedefs, structures, and compiler characteristics.
AC_SUBST(XSUBPPDIR)
AC_SUBST(XSUBPPFLAGS)
AC_SUBST(ATHSTATIC)
AC_PROG_INSTALL
+AC_PROG_RANLIB
-AC_CONFIG_SUBDIRS(libfaim)
-
-AC_OUTPUT(Makefile)
+AC_CONFIG_FILES([Makefile libfaim/Makefile])
+AC_OUTPUT([perl/modules/Makefile])
View
0  install.sh
No changes.
View
14 libfaim/Makefile.am
@@ -0,0 +1,14 @@
+noinst_LIBRARIES = libfaim.a
+
+libfaim_a_SOURCES = admin.c \
+ adverts.c auth.c bos.c buddylist.c bstream.c \
+ chat.c chatnav.c conn.c email.c ft.c icq.c im.c \
+ invite.c md5.c misc.c msgcookie.c locate.c \
+ popups.c rxhandlers.c rxqueue.c search.c service.c \
+ snac.c ssi.c stats.c tlv.c translate.c txqueue.c \
+ util.c odir.c bart.c \
+ aim_cbtypes.h aim.h aim_internal.h faimconfig.h md5.h
+
+libfaim_a_CFLAGS = -Wno-pointer-sign
+libfaim_a_CPPFLAGS = -DAIM_BUILDDATE=\"x\" -DAIM_BUILDTIME=\"x\" \
+ -I${top_srcdir}/libfaim
View
21 libfaim/Makefile.in
@@ -1,21 +0,0 @@
-CC=@CC@
-LIBS=@LIBS@
-LDFLAGS=@LDFLAGS@
-RANLIB=@RANLIB@
-OBJS=admin.o adverts.o auth.o bos.o buddylist.o bstream.o \
- chat.o chatnav.o conn.o email.o ft.o icq.o im.o \
- invite.o md5.o misc.o msgcookie.o locate.o \
- popups.o rxhandlers.o rxqueue.o search.o service.o \
- snac.o ssi.o stats.o tlv.o translate.o txqueue.o \
- util.o odir.o bart.o
-CFLAGS=@CFLAGS@ -I. -DAIM_BUILDDATE=\"x\" -DAIM_BUILDTIME=\"x\" -Wno-pointer-sign
-
-libfaim: $(OBJS)
- $(AR) -r libfaim.a $(OBJS)
- $(RANLIB) libfaim.a
-
-clean:
- $(RM) *.o libfaim.a
-
-distclean: clean
- $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core
View
13 libfaim/configure.ac
@@ -1,13 +0,0 @@
-AC_INIT(bos.c)
-
-dnl AC_CONFIG_HEADER(config.h)
-
-AC_PROG_CC
-dnl we're using GCC, enable all warnings
-if test "$GCC" = yes; then
- CFLAGS="$CFLAGS -Wall -g";
-fi
-AC_PROG_RANLIB
-
-
-AC_OUTPUT(Makefile)
View
40 mkinstalldirs
@@ -1,40 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-
-# $Id$
-
-errstatus=0
-
-for file
-do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
-
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp"
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- fi
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
View
7 owl.h
@@ -47,12 +47,7 @@ typedef void SV;
static const char owl_h_fileIdent[] = "$Id$";
-#define BARNOWL_STRINGIFY(x) _STRINGIFY(x)
-#define _STRINGIFY(x) #x
-
-#ifndef OWL_VERSION_STRING
-#define OWL_VERSION_STRING "1.1.2"
-#endif
+#define OWL_VERSION_STRING PACKAGE_VERSION
/* Feature that is being tested to redirect stderr through a pipe.
* There may still be some portability problems with this. */
View
39 perl/modules/Makefile.in
@@ -0,0 +1,39 @@
+top_srcdir=@top_srcdir@
+srcdir=@srcdir@
+prefix=@prefix@
+datadir=@datadir@/barnowl
+datarootdir=@datarootdir@
+
+INSTALL=@INSTALL@
+INSTALL_PROGRAM=@INSTALL_PROGRAM@
+INSTALL_DATA=@INSTALL_DATA@
+install_sh = @install_sh@
+mkinstalldirs = $(install_sh) -d
+
+PERL_MODULES = Jabber IRC WordWrap
+MODULE_DIRS = $(PERL_MODULES)
+
+all: modules
+clean: modules_clean
+
+modules: $(MODULE_DIRS)
+modules_clean: $(MODULE_DIRS:%=clean_%)
+
+$(MODULE_DIRS): %: %/Makefile
+ ( cd $@ && $(MAKE) $(notdir $@).par )
+
+$(MODULE_DIRS:=/Makefile): %/Makefile: %/Makefile.PL
+ ( cd $(dir $@) && perl -I../../lib Makefile.PL )
+
+$(MODULE_DIRS:%=clean_%): clean_%:
+ (cd $* && (test ! -f Makefile || $(MAKE) clean))
+
+install: installdirs $(PERL_MODULES:%=module_install_%)
+
+installdirs:
+ $(mkinstalldirs) ${DESTDIR}${datadir}/modules/
+
+$(PERL_MODULES:%=module_install_%): module_install_%:
+ ${INSTALL_DATA} $*/$*.par ${DESTDIR}${datadir}/modules/$*.par
+
+.PHONY: clean modules $(PERL_MODULES:%=module_install_%)
Please sign in to comment.
Something went wrong with that request. Please try again.