Use autoconf.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 22 Aug 2006 13:44:21 +0000 (15:44 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 22 Aug 2006 13:44:21 +0000 (15:44 +0200)
.bzrignore
ChangeLog
Makefile
Makefile.settings.in [new file with mode: 0644]
configure.ac [new file with mode: 0644]

index f63c31682ff2deb762698ca16985b696e3e5912c..5dd17bddda41ed46aa21eabc2554f4228378e126 100644 (file)
@@ -1,3 +1,13 @@
 at89prog
 at89prog-gtk
 debian/tmp
+aclocal.m4
+autom4te.cache
+config.status
+config.log
+configure
+Makefile.settings
+at89prog.aux
+at89prog.log
+at89prog.pdf
+at89prog.toc
index d207abf70495b5fa4a5c5fab44450ce463947af3..b9cee13f87b81bdfac78c43342e7cabe45dbb844 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+0.9:
+ * Use autoconf.
+
 0.8:
  * Fix major bug in hex parsing code
  * Detect EOF correctly in Intel hex files
index 7d41ef6ddc1d6b2f85e044387dc828d65a2fcee1..3cf849c3246137dc8bef9abe183f88da90b193f3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,18 @@
-LIBS = -lpopt 
-DEBUG = -g3 #-pg -fprofile-arcs
-GTK_LIBS = `pkg-config --libs gtk+-2.0 glib-2.0 gtkhex`
-GTK_CFLAGS = `pkg-config --cflags gtk+-2.0 glib-2.0 gtkhex`
-#DEBUG = 
+include Makefile.settings
 
 COMMON_OBJ = at89ser.o pins.o pins-serial.o pins-serial-raw.o delays.o pins-parallel.o hexfile.o
 PROG_OBJ = at89prog.o $(COMMON_OBJ)
 GTKPROG_OBJ = at89prog-gtk.o $(COMMON_OBJ)
 
-all: at89prog check-gtk
+all: at89prog $(EXTRA_TARGETS)
 doc: at89prog.pdf
 
+Makefile.settings: Makefile.settings.in configure
+       ./configure
+
+configure: configure.ac
+       autoreconf
+
 install: all doc
        mkdir -p $(DESTDIR)/usr/bin
        cp at89prog $(DESTDIR)/usr/bin
@@ -26,10 +28,6 @@ at89prog.pdf: at89prog.tex
 at89prog: $(PROG_OBJ)
        $(CC) $(DEBUG) -Wall -O -o $@ $(PROG_OBJ) $(LIBS)
 
-# Only build Gtk version if GTK and GLib were found
-check-gtk:
-       -pkg-config --exists gtk+-2.0 glib-2.0 gtkhex 2>/dev/null > /dev/null && $(MAKE) at89prog-gtk
-
 at89prog-gtk: $(GTKPROG_OBJ)
        $(CC) $(DEBUG) -Wall -O -o $@ $(GTKPROG_OBJ) $(LIBS) $(GTK_LIBS)
 
diff --git a/Makefile.settings.in b/Makefile.settings.in
new file mode 100644 (file)
index 0000000..c888c48
--- /dev/null
@@ -0,0 +1,5 @@
+LIBS = -lpopt 
+CFLAGS = @CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+CC = @CC@
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..81dd489
--- /dev/null
@@ -0,0 +1,11 @@
+AC_INIT(at89prog, 0.9, [jelmer@vernstok.nl])
+
+AC_PROG_CC
+
+PKG_CHECK_MODULES(GTK, gtk+-2.0 glib-2.0 gtkhex, EXTRA_TARGETS="at89prog-gtk", 
+                                 echo -n)
+
+AC_SUBST(EXTRA_TARGETS)
+
+AC_CONFIG_FILES([Makefile.settings])
+AC_OUTPUT