digital adj. Having digits.     peer n. A comrade; a companion; a fellow; an associate. inmotion    
   
Recent Articles
Handling a Subversion Repository URL Change
Sunday, May 3, 2009
If your repository URL changes, you can use the following command to fix existing snapshots.
vfat Mounts Default to Lowercase Shortnames
Tuesday, April 21, 2009
I want a "this is brain-damage" quote from Linus for this mess.
VirtualBox or VMWare Virtual Machine at Login
Sunday, April 12, 2009
How to start a virtual machine in X when a user logs in.
Dialog Progress Bar Through Pipe
Sunday, April 12, 2009
How to use dialog to display a script progress bar and communicate progress to it through a named pipe.
Mount JFFS2 Image
Saturday, October 25, 2008
Example of how to mount a JFFS2 image using mtdblock.
Ottawa Linux Symposium 2008
Sunday, July 27, 2008
Here are some pictures from the 2008 Linux Symposium.
Linux Symposium 2008
Sunday, July 20, 2008
I'll be attending the Linux Symposium this year.
Clay Shirky: Institutions vs. collaboration
Monday, July 14, 2008
This is a rather interesting talk that takes some very foundational ideas from open source software development, P2P networks, and social networking and implies that these paradigms can apply to a lot more.

Just do it.
- Nike

Projects-Misc Utilities-GNU Autoconf...

GNU Autoconf Scripting Snippets

Thursday, January 13, 2005 by digitalpeer

Face it, you're constantly searching for autoconf macros or how to do things when you've got your source written and you're ready to get it built with the GNU auto tools. I do the same thing. So, here's a bunch of configure.ac or configure.in snippets I've seen or written for your viewing pleasure.

Generate variables with the build, host, and target identifiers.

AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET

An if,else statement.

if test "x${with_gnome}" = xyes
then 
    GNOME_PACKAGES="gtk+-2.0 libgnome-2.0 libgnomeui-2.0 pango"
elif test "x${with_gtk}" = xyes
then
    GNOME_PACKAGES="gtk+-2.0"
else
    GNOME_PACKAGES=""
fi

A for loop over a list of words.

for pkg in $GNOME_PACKAGES
do
    AC_MSG_CHECKING([version of $pkg])
    if gnomevers=`pkg-config --modversion $pkg`
    then
        AC_MSG_RESULT($gnomevers)
    else
        AC_MSG_ERROR([$pkg was not found by pkg-config])        
    fi
done

Define a variable for use later in your Makefile.am.

GNOME_CFLAGS=-g
AC_SUBST(GNOME_CFLAGS)

Display a notice during configure.

AC_MSG_NOTICE([Adding gcc options: $CFLAGS])

Try to compile a test code and report the results.

AC_TRY_COMPILE([
#ifdef HAVE_SYS_MMAN_H
#  include <sys/mman.h>
#endif],[
#ifdef HAVE_MMAP
if (mmap (NULL, 0, 0, 0, 0, 0) == MAP_FAILED)
	return 0;
#else
#error mmap unavailable
#endif], ,[
	AC_DEFINE([MAP_FAILED], [(void *)-1L],
	[Define if MAP_FAILED constant not available])
])
AC_MSG_RESULT()


Submit Comment to This Article - Be the first!
Please post a comment if you have something to add, find something wrong, or would like more information on the topic at hand. Do not use the comment form to contact the author about unrelated concerns!

Name: Email (optional):
Enter verification number here: