Archive for the ‘autotools’ Category

Well, that was an eventful day!

Saturday, September 12th, 2009

*whew* I did a bunch of things yesterday. We took our kindergärtner to her first Friday at her new school (and were about 10 minutes tardy. oops). We then took our toddler to a nearby playground with swings and slides and let her expend some energy. After she had been sufficiently exercised, we walked back home, stopping at a coffee shop on the way. The baristo (you call male baristas “baristos,” right? :) ) recognized my MC Frontalot shirt and asked whether I had caught him the previous weekend at PAX. Unfortunately, I have not attended PAX since 2006, but I *did* purchase the tee directly from The Front himself ;)

When we got home, I worked a bit on an English Language parser implementation and then went to the University of Washington to meet with Emily Bender about getting in to the Professional Master’s program in Computational Linguistics. It all looks good, and I even got the good news that the GRE is no longer required!

After the meeting, I headed home and poked at the parser for a little while longer. I then picked Scarlet up from after-school care and brought her home. I then hopped in the car and drove toward Bellevue to meet up with Monty while he’s in town. I over-estimated the amount of time traffic would steal on my way to Bellevue, and had an extra hour to blow. So I dropped by building 41 and shot the IronPython bull with Dino. It turns out he’s got an android phone, too. I told him it was possible to put a debian chroot on it and that he should even be able to ‘apt-get install ironpython’ to his phone soon ;) We talked briefly about the CodePlex Foundation and Sam Ramji’s departure from The Evil Empire. Dino seems skeptical about the project. I don’t have enough information to have much of an opinion. However, it sounds like some folks I trust are involved, so I’m hopeful.

I left MS just in time to make it to the wrong address at the specified time. My phone had just enough juice to call Monty to get the right address and then use the navigation system to find my way there. I wasn’t able to make reservations at the place we intended to go for dinner until 8:15, so we went to the Barnes & Noble for a bit. They only had one NLP book in stock and the examples are all in Python. I should learn that language one of these days… As we were leaving the Pacific Place, Monty mentioned to me that he is on the advisory board for the CodePlex Foundation, and that they have been responsive enough to his input that they changed the Mission statement, at his recommendation, just one day before the Foundation was publicized. He feels that this is a very good direction for Microsoft to be heading.

My brother Chris was kind enough to watch the kids while we went out to dinner. Quick note: he recently graduated from UW with a BA in Electrical Engineering and is looking for work using his acquired knowledge, in case anyone needs one of those ;)

We met up with my wife, Hannah and our friends, Mike & Cynthia at our place. Monty graciously avoided mentioning the terrible state in which our apartment has recently found itself. The kids were super cute and polite and said hi/bye.

Over dinner we discussed building an android app (Monty has one, too ;) ) to automate the process of creating bounties for apps and getting folks to implement them. We also talked about MySQL and MariaDB, of course. Hannah and I recalled my time working for MySQL, Inc. on the MaxDB project and some subtle cultural differences we noticed while traveling. It was interesting getting the inside scoop about the Sun acquisition and some of the recent goings-on in the MySQL/Sun/Oracle world. I wasn’t aware, for instance, that the EU is balking on the merger because of monopoly concerns.

PCRE support has hit quagga

Friday, June 19th, 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


http://bugzilla.quagga.net/show_bug.cgi?id=483

Paul Jakma
 changed:

           What    |Removed                     |Added
- ----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |paul dishone st
         Resolution|                            |FIXED

- --- Comment #2 from Paul Jakma
  2009-06-19 15:09:42 ---
I've pulled in the patch from Jeremy Jackson which, I understand, was based on
this. This adds, at least for now, a --enable-pcreposix argument to
configure.ac.

Thanks!

- --
Configure bugmail: http://bugzilla.quagga.net/userprefs.cgi?tab=email
- ------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are the assignee for the bug.
You reported the bug.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEUEARECAAYFAko7vtkACgkQXKBS0hdr6Ua3+gCYoJkTzUb0zidPxo0opTPBXgKL
cACbBU8av2K63mKAMLeUF8ZLmJSGTj4=
=qdU2
-----END PGP SIGNATURE-----

Jenkara is building

Wednesday, January 14th, 2009

Okay… after this morning’s post, I decided to make Jenkara build. It is now. You can get it thus:

$ svn co http://svn.colliertech.org/svn/trunk/jenkara

or

$ wget http://www.colliertech.org/downloads/jenkara-0.0.1.tar.gz

You can build it with ye olde

$ ./configure && make

there’s no install target, so run it with

$ cd src && ./jenkara

but it doesn’t work for ‘cuz the glade file it reads doesn’t work with the new libglade. I did write this stuff in 2001, after all…

So if any of you know how to make the following glade file work with the new and shiny, it would be great to get some of that info!

http://svn.colliertech.org/svn/trunk/jenkara/ui/jenkara.glade2

One day I will re-write this in C# and run it on mono. Promise!

Writing Free Sofware index

Sunday, August 24th, 2008

So, I’ve been meaning to write an index for this series. I haxx0red my web server and made this easy-to-remember url work.

http://wp.colliertech.org/cj/writing-free-software/

Writing Free Software: Part 11 – A simple man page

Sunday, August 24th, 2008

Introduction

Okay… it’s high time we wrote some docs. I come from a perl background, so we’re going to write the docs using perldoc. I know there are better ways to do this for C# projects and I’m happy to take contributions to this series. Just ask for contributor status and you can post the next article :)

Return to the workspace

$ cd ~/src/greeting

Create the POD

$ mkdir doc
$ cat > doc/greeting.pod.in

=head1 NAME

Greeting - Example to illustrate writing and distributing Free Software

=head1 VERSION

Version @PACKAGE_VERSION@

=head1 SYNOPSIS

 Greeting will greet the planet specified numerically
 (1 = Mercury .. 9 = Pluto) or the world, given
 no argument or arg value 0.

 $ greeting
 Greetings World!
 $ greeting -n 1
 Greetings Mercury!
 $ greeting --number 3
 Greetings Earth!

=head1 COPYRIGHT

Copyright 2008 J. Random Hacker .

  Permission is granted to copy, distribute and/or modify
  this document under the terms of the GNU Free
  Documentation License, Version 1.2 or any later version
  published by the Free Software Foundation; with no
  Invariant Sections, with no Front-Cover Texts, and with
  no Back-Cover Texts.

=cut

Update configure.ac

$ patch configure.ac
@@ -11,11 +11,18 @@
AC_MSG_ERROR([Can't find "gmcs" in your PATH])
fi
 
+AC_PATH_PROG(PERLDOC, perldoc, no)
+if test "x$PERLDOC" = "x" ; then
+ AC_MSG_ERROR([Can't find "perldoc" in your PATH])
+fi
+
AC_CONFIG_FILES([
Makefile
ndesk/Makefile
src/Makefile
greeting
+doc/Makefile
+doc/greeting.pod
])
AC_OUTPUT
 
@@ -24,6 +31,7 @@
echo "Thank you for configuring '$PACKAGE_NAME' version '$PACKAGE_VERSION'"
echo "Runtime: $RUNTIME"
echo "C# compiler: $CSC"
+echo "Perldoc interpreter: $PERLDOC"
echo "installation prefix: $prefix"
echo ""
echo "================="

Create doc/Makefile.am file for man page

$ cat > doc/Makefile.am

all: man1/greeting.1

man1/greeting.1: man1 greeting.pod
        $(PERLDOC) -d man1/greeting.1 greeting.pod

man1:
        mkdir man1

clean:
        rm -rf man1

noinst_docdir = $(prefix)/share/man/man1
noinst_doc_DATA = man1/greeting.1

DISTCLEAN_FILES = greeting.pod

Update Makefile.am

$ patch Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS = src ndesk
+SUBDIRS = src ndesk doc
 
bin_SCRIPTS = greeting

Re-build Makefile files and configure script

$ autoreconf

Test

$ make
...
$ man -M doc greeting
...
$ sudo make install
...
$ man greeting

Conclusion

There’s a lot more to documentation than this, but like the other pieces of this series, this is an introduction that should get you to a point where you can distributed “just enough.” Some other good tools to look at:

I’m serious about having others beef up this series with a 11.1, 11.2, etc. Leave a comment or catch me on IRC and I’ll hook you up with contributor status.

Next article in the “Writing Free Software” series

Friday, August 15th, 2008

Hey all,

I’m not certain what the next topic should be. I’ve got a few ideas. Could the interested parties let me know what they’re curious most about?

  • documentation
  • distributing .exe.config and .dll.config files
  • inter-package dependencies using pkg-config
  • creating sub packages
  • test harnesses and the “check” target
  • the debian/ directory and .deb packages
  • … something completely different

I’m looking for comments on this one!

Writing Free Software – Part 10: Subdirectories

Monday, August 11th, 2008

In this installment, I’ll cover creating different subdirectories for different parts of the code. We’ll move NDesk.Options.cs into an ndesk directory and Greeting.cs into a src directory. Some modifications need to be made to various pieces of the distribution in order for this to work out correctly. We’ll do the minimum required now and cover the pieces that will make it more extensible but complex in future entries.

Return to the workplace

$ cd ~/src/greeting

Move the source to their new directories

$ mkdir src ndesk
$ mv NDesk.Options.cs ndesk
$ mv Greeting.cs src
$ mv Makefile.am src

Create a new root Makefile.am file

$ cat > Makefile.am
SUBDIRS = src ndesk

bin_SCRIPTS = greeting
^D

Create ndesk/Makefile.am

$ cat > ndesk/Makefile.am
EXTRA_DIST = NDesk.Options.cs

Alter src/Makefile.am to cope with new layout

$ patch src/Makefile.am

10,11c10,11
< Greeting.exe: Greeting.cs NDesk.Options.cs
< # the same as $(CSC) -out:Greeting.exe Greeting.cs
---
> Greeting.exe: Greeting.cs $(top_srcdir)/ndesk/NDesk.Options.cs
> # the same as $(CSC) -out:Greeting.exe Greeting.cs ...
14,15c14
< EXTRA_DIST = Greeting.cs NDesk.Options.cs
<
---
> EXTRA_DIST = Greeting.cs
18,19d16
<
< bin_SCRIPTS = greeting
^D^D
patching file src/Makefile.am

Alter configure.ac to cope with new layout

$ patch configure.ac

@@ -13,6 +13,8 @@
 
 AC_CONFIG_FILES([
 Makefile
+ndesk/Makefile
+src/Makefile
 greeting
 ])
 AC_OUTPUT
missing header for unified diff at line 1 of patch
patching file configure.ac

Prove that we didn’t break anything

$$ automake && autoconf && ./configure
...
$ make
...
$ sudo make install
...
$ greeting
Greetings, World!

Conclusion

In this lesson, I gave an example of re-factoring the build system to use subdirectories. This method can be used to separate portions of one’s codebase. In addition, we saw the use of the $srcdir variable, which stores the location of the root of the source distribution.

In future posts, we will use the work done in this lesson as a basis for some more re-factoring. We will also learn how to do things such as

  • creating sub projects
  • inter-package dependencies using pkg-config

Writing Free Software – Part 9: Creating the wrapper script

Sunday, August 10th, 2008

A previous post covered altering the install target so that it places the .exe assembly into the filesystem of the installer’s computer. In this part, we will cover creating the so-called “wrapper” script, which is the way recommended by the mono project’s application deployment guidelines to make the assembly executable on the system outside of the source distribution.

Return to the workplace

$ cd ~/src/greeting/

Create the wrapper script template

$ cat > greeting.in
#!/bin/bash
 
exec @RUNTIME@ @prefix@/lib/mono/@PACKAGE_NAME@/Greeting.exe "$@"
^D

Alter the configure.ac file to process the wrapper template

$ patch configure.ac

@@ -13,6 +13,7 @@
 
 AC_CONFIG_FILES([
 Makefile
+greeting
 ])
 AC_OUTPUT

^D^D

Alter the Makefile.am file to distribute the wrapper template

$ cat >> Makefile.am
 
bin_SCRIPTS = greeting
 
^D

Re-build the Makefile and wrapper script

$ autoconf && automake && ./configure

Test the install target

$ make && sudo make install
$ which greeting
/usr/local/bin/greeting
$ greeting ––number 8
Greetings, Neptune!

Conclusion

In this post, I gave an example of creating a simple wrapper shell script and using the autotools infrastructure to locate and use the system C# compiler and CLI runtime. This may not seem like much of a feat, but many systems have their binaries installed in weird locations and other quirks. The autotools system is able to detect and take care of these details without having the maintainer of the software create system-specific tweaks that would undoubtedly reduce the number of platforms on which the software would work.

Writing Free Software – Part 8: Exploring configure.ac variables

Sunday, August 10th, 2008

Introduction

One of autotools’ primary purposes is to allow software to be built and installed on a wide range of platforms. The configure script is responsible for a great deal of this flexibility. When it is run, it interrogates the system on which it is being run to determine the features available. If required features are missing, the script can do any number of things, including but not limited to:

  • reporting a problem and bailing out
  • trying an alternate approach
  • attempting to fetch the missing software and continuing/aborting depending on the outcome
  • recommending that the person running the configure script install the required bits
  • mocking the user

In this post, I will note a few of the variables that can be used to determine the configuration of the system.

Return to the workplace

$ cd ~/src/greeting

Modify configure.ac to report some findings

$ patch configure.ac

--- configure.ac.orig	2009-03-20 14:49:16.000000000 -0700
+++ configure.ac	2009-03-20 14:46:16.000000000 -0700
@@ -1,5 +1,11 @@
 AC_INIT([greeting],[0.0.1])
 AM_INIT_AUTOMAKE([1.9 tar-ustar])
+
+AC_PATH_PROG(RUNTIME, mono, no)
+if test "x$RUNTIME" = "x" ; then
+  AC_MSG_ERROR([Can't find "mono" in your PATH])
+fi
+
 AC_PATH_PROG(CSC, gmcs, no)
 if test "x$CSC" = "x" ; then
   AC_MSG_ERROR([Can't find "gmcs" in your PATH])
@@ -8,3 +14,12 @@
 Makefile
 ])
 AC_OUTPUT
+
+echo "================="
+echo ""
+echo "Thank you for configuring '$PACKAGE_NAME' version '$PACKAGE_VERSION'"
+echo "Runtime:             $RUNTIME"
+echo "C# compiler:         $CSC"
+echo "installation prefix: $prefix"
+echo ""
+echo "================="
^D^D

Re-run configure to see results

$ autoconf && ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking for mono... /usr/bin/mono
checking for gmcs... /usr/bin/gmcs
configure: creating ./config.status
config.status: creating Makefile
=================
 
Thank you for configuring 'greeting' version '0.0.1'
Runtime: /usr/bin/mono
C# compiler: /usr/bin/gmcs
installation prefix: /usr/local
 
=================

Conclusion

One of the primary reasons that autotools is so powerful is that it can figure out what’s on your system and use it to build the software in the package. In following posts, we will make use of some of these system configuration variables.

Writing Free Software – Part 7: Creating a working install target

Sunday, August 10th, 2008

Introduction

This entry will show how to add the bits required for an install target. There are two pieces that need to be added to the Makefile.am:

  • target_DATA, which is a list of files associated with the target
  • targetdir, which is the location where the above files will be installed

Return to the workplace

$ cd ~/src/greeting

Add the required variables to Makefile.am

$ cat >> Makefile.am
Greeting.exedir = $(prefix)/lib/mono/greeting
Greeting.exe_DATA = Greeting.exe
^D
$ sudo make install
...
$ ls /usr/local/lib/mono/greeting/
Greeting.exe

Conclusion

We now have the bits in place to put Greeting.exe in the correct directory, but no way to execute it. We’ll address that in a future post. Until then, you might be interested in reading through the application deployment guidelines

Performance Optimization WordPress Plugins by W3 EDGE