On Tue, Feb 25, 2003 at 08:19:35AM +0200, Tuomo Valkonen wrote:
> I have changed the Makefiles to include system-inc.mk that checks for
> acsystem.mk and uses it if it exists and system.mk otherwise. Could
> you rename the file to system-ac.mk, though?
OK -- updated (and fractionally improved) files attached. Same procedure as
before.
Still to do (IMHO):
Set ETCDIR and DOCDIR properly (which autoconf vars are these equivalent
to?)
--enable-xinerama and --enable-module should default to yes (not sure how to
do this)
Set MODULE_SUPPORT/MODULE_SUPPORT_LDFLAGS better (libtool? ugh!)
Proper POSIX support for libtu?
Proper Xft support? (i.e. allow user to override CFLAGS and LIBS and path to
xft-config)
Proper Debug support (don't strip binaries).
Checks for minor programs.
Regards,
Tom
dnl Process this file with autoconf to produce a configure script.
AC_INIT()
AC_PROG_CC()
AC_PROG_INSTALL()
AC_PROG_LN_S()
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_SUBST(MODULE_SUPPORT)
AC_SUBST(MODULE_SUPPORT_LDFLAGS)
AC_ARG_ENABLE(module,
[ --enable-module Module support],
[MODULE_SUPPORT_LDFLAGS="-export-dynamic -ldl"],
[MODULE_SUPPORT="-DCF_NO_MODULE_SUPPORT"])
AC_ARG_ENABLE(xinerama,
[ --enable-xinerama Xinerama support],
[AC_CHECK_LIB(Xext, XMissingExtension, , exit, $X_LIBS)
AC_CHECK_LIB(Xinerama, XineramaQueryExtension, , exit, $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_CHECK_LIB(Xft, XftFontOpen, , exit , $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(system-ac.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
##
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
##
## 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