Hi --

Attached is a preliminary autoconf script for Ion. Hopefully this will
persuade Tuomo that we can have both the existing system.mk and the autoconf
system peacefully co-existing side-by-side.

The script generates a file called acsystem.mk from the attached
acsystem.mk.in, which is an equivalent of system.mk. automake isn't used at
all.

The script is not finished yet. It works, but needs to be integrated with
Ion better. Currently you need to overwrite system.mk with acsystem.mk.
Ideally, I would like an automatic system to include acsystem.mk if it
exists, otherwise use system.mk.

To use it:
        # copy the attached files to your ion directory, then
        autoconf
        ./configure [--enable-xinerama] [--enable-xft] [--enable-debug]
        mv system.mk system.mk.dist # move old system.mk out of the way
        ln -s system.mk acsystem.mk

To do (at least):
1) Proper POSIX flags for libtu.
2) Check for some tools -- ar, install, ln -s, strip
3) Better Xft support?
Some of the above will require _minor_ changes to the existing Makefiles.

Comments?

If all is OK, I will submit a patch that includes the attached files and
patches the existing Makefiles where needed.

Tom
dnl Process this file with autoconf to produce a configure script. 
AC_INIT()
AC_PROG_CC()
AC_PROG_RANLIB()
AC_PATH_XTRA()
test "$no_x" == yes && exit
AC_ARG_ENABLE(debug,
        [  --enable-debug          Debugging support],
        [CFLAGS="$CFLAGS -g"
         LDFLAGS="$LDFLAGS -g"])
AC_ARG_ENABLE(xinerama,
        [  --enable-xinerama       Xinerama support],
        [AC_SEARCH_LIBS(XMissingExtension, Xext, , , "$X_LIBS") 
         AC_SEARCH_LIBS(XineramaQueryExtension, Xinerama, , , "$X_LIBS")],
        AC_DEFINE(CF_NO_XINERAMA))
AC_ARG_ENABLE(xft,
        [  --enable-xft            Xft support],
        [AC_PATH_PROG(XFT_CONFIG, xft-config)
         if test "x$XFT_CONFIG" == "x"; then 
                 AC_SEARCH_LIBS(XftFontOpen, Xft, , , "$X_LIBS")
         else
                 CFLAGS="$CFLAGS `$XFT_CONFIG --cflags`"
                 LIBS="$LIBS `$XFT_CONFIG --libs`"
         fi
         AC_DEFINE(CF_XFT)])
AC_CHECK_FUNC(asprintf,
        AC_DEFINE(HAS_SYSTEM_ASPRINTF))
AC_OUTPUT(acsystem.mk)
##
## System settings
##


##
## Installation paths
##

[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@

# No need to modify these usually
[EMAIL PROTECTED]@
ETCDIR=$(PREFIX)/etc
[EMAIL PROTECTED]@
DOCDIR=$(PREFIX)/doc
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@


##
## Modules
##

#MODULE_SUPPORT=-DCF_NO_MODULE_SUPPORT
MODULE_SUPPORT_LDFLAGS=-export-dynamic -ldl


##
## C compiler
##

[EMAIL PROTECTED]@

# The POSIX_SOURCE, XOPEN_SOURCE and WARN options should not be necessary,
# they're mainly for development use. So, if they cause trouble (not
# the ones that should be used on your system or the system is broken),
# just comment them out.

# libtu/ uses POSIX_SOURCE

POSIX_SOURCE=-ansi -D_POSIX_SOURCE

# and . (ion) XOPEN_SOURCE.
# There is variation among systems what should be used and how they interpret
# it so it is perhaps better not using anything at all.

# Most systems
#XOPEN_SOURCE=-ansi -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
# sunos, (irix)
#XOPEN_SOURCE=-ansi -D__EXTENSIONS__

# Same as '-Wall -pedantic' without '-Wunused' as callbacks often
# have unused variables.
WARN=   -W -Wimplicit -Wreturn-type -Wswitch -Wcomment \
        -Wtrigraphs -Wformat -Wchar-subscripts \
        -Wparentheses -pedantic -Wuninitialized


[EMAIL PROTECTED]@ @X_CFLAGS@ $(WARN) @DEFS@ $(INCLUDES)
[EMAIL PROTECTED]@ @X_LIBS@ @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@ @LIBS@ $(LIBS)


##
## make depend
##

DEPEND_FILE=.depend
MAKE_DEPEND=$(CC) -M $(CFLAGS) > $(DEPEND_FILE)


##
## AR
##

AR=ar
ARFLAGS=cr
[EMAIL PROTECTED]@


##
## Install & strip
##

[EMAIL PROTECTED]@

INSTALLDIR=mkdir -p

BIN_MODE=755
DATA_MODE=664

STRIP=strip

Reply via email to