GNU Autoconf 2.13 for EMX

Current patchlevel: 3

Original author: Juan Jose Garcia Ripoll
Modified by Hung-Chi Chu

Table of contents

Introduction

Most Linux programs come with a configure script that has the purpose of guessing important system defaults. Currently, most of those scripts are built with a tool named Autoconf, from the FSF, which takes in one or two macro files (configure.in & aclocal.m4) and using the M4 macro processor and another internal set of macro files (mainly acgeneral.m4 & acspecific.m4) creates a third one, named configure. What we have done is tweaking the internal macro files, so that the code they produce is well suited to run under EMX with a filesystem that allows long file names.

News and changes since 2.12 port

Requirements for running Autoconf

Here's a list of the EMX programs you'll need. Most of them are at Leo or Hobbes. And you must also be working on HPFS that allows long file names.

Installation from the pre-built package

Installation from the official sources

Using autoconf

Tips and tricks

Drive unit names and extensions

Unix programs don't know about disk units names, such as 'C:'. We've made Autoconf understand drive unit names, but this doesn't mean that your program does.

In the configuration process Autoconf may introduce absolute pathnames in the code of your program. This will typically happen, either when config.h is created, or by explicit defines when compiling. You might have to add code to let the user override these paths.

OTOH, you might find hand-made rules in aclocal.m4 or in configure.in that check whether a path reference is absolute or not. Typically it looks like in this example:

...
case "$LD" in
  /*)	ac_program_LD="$LD";;
  *)	#some other stuff
...
This must be fixed in the following compatible mode:
...
case "$LD" in
changequote(, )dnl
  /* | [a-zA-Z]:*) ac_program_LD="$LD";;
changequote([, ])dnl
  *)    #some other stuff
...
The fixed rule recognizes drive unit names. Also, as the colon ":" is not a valid path character under unix, it causes no big harm.

Compilation flags

Autoconf's default flags for compiling programs are, as of this release
	CC=gcc.exe
	MAKE=make
	CXX=gcc.exe
	CPP="gcc.exe -E"
	CFLAGS="-O2 -Zmt"
	CXXFLAGS="-O2 -Zmt"
	LDFLAGS="-Zmt -Zcrtdll -Zsysv-signals -Zbin-files"
	CONFIG_SHELL=sh.exe

The flags can be overriden. Either edit the generated configure file or set environment variables

[From within CMD.EXE]
	set MAKE=x11make.exe
	set CFLAGS=-O2
	set CFLAGS=-O2
	set LDFLAGS=-Zexe -Zcrtdll -Zsysv-signals
[From within SH.EXE]
	export MAKE=x11make.exe
	export CFLAGS=-O2
	export CFLAGS=-O2
	export LDFLAGS="-Zexe -Zcrtdll -Zsysv-signals"
or let the configure program run and, at the end, edit config.status changing the variables to suit your needs. (See below)

The default settings are good for X11 programs and won't harm when porting any other kind of application. If you opt to use them, please follow these two rules (extracted from the XFree86/OS2 porting guide):

The config.status file

This script contains all of the configuration parameters and is responsible for converting the *.in files into usable ones. Some tips about this script:

Non portable rules

There are that programs need to guess system dependent features that Autoconf currently doesn't know about. This is usually achieved with rules that are stored in aclocal.m4. Some of these rules are just a set of standard checks put together, but some other are non-portable ones (in the sense that they may not work under OS/2).

The following sections explain how rules are to be modified in order to make them OS/2 compatible.

File names

This release introduces two variables which are used to name executable binary and library file. ac_cv_exeext is ".exe" for OS/2 and empty for Unix. ac_cv_libpre is empty for OS/2 and "lib" for Unix. Sometimes you should modify some Unix formatted filenames and add the variables.

Path separator

The path separator is stored in the PATH_IFS variable and is ";" under OS/2 and ":" elsewhere. You can modify configure.in or aclocal.m4 when necessary to replace the Unix path separator ":" with ${PATH_IFS}.

An example

An example shows how to modify aclocal.m4 is following:

	[case "$LD" in
	  /*)
	  ac_cv_path_LD="$LD" # Let the user override the test with a path.
	  ;;
	  *)
	  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
	  for ac_dir in $PATH; do
	    test -z "$ac_dir" && ac_dir=.
	    if test -f "$ac_dir/ld"; then
		...
	    fi
	  done
	  IFS="$ac_save_ifs"
	  ;;
	esac])
The fixed version is
	[case "$LD" in
        changequote(, )dnl
	  /*|[a-zA-Z]:*)
        changequote([, ])dnl
	  ac_cv_path_LD="$LD" # Let the user override the test with a path.
	  ;;
	  *)
	  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${PATH_IFS}"
	  for ac_dir in $PATH; do
	    test -z "$ac_dir" && ac_dir=.
	    if test -f "$ac_dir/ld$ac_cv_exeext"; then
		...
	    fi
	  done
	  IFS="$ac_save_ifs"
          ;;
	esac])

Bug reports

If you miss a feature in autoconf, or find something doesn't work, please e-mail me.

When reporting bugs, follow these steps:

Acknowledgement and notes

We must thank Juan Jose Garcia Ripoll for hist GREATE port, Hung-Chi Chu