dnl# -*- sh -*- dnl# Process this file with autoconf to produce a configure script. dnl# dnl#Copyright (c) 1998 Michal Vitecek dnl#Copyright (c) 2001,1998 Sasha Vasko dnl#Copyright (c) 1998 Juergen Sawinski dnl#Copyright (c) 1997 1998 Guylhem AZNAR AC_INIT(Makefile.in) AC_CONFIG_HEADER(config.h:config.h.in) version="0.92" version_major="0" lib_name="LIBAFTERBASE" lib_file_name="libAfterBase" dnl# Setup command-line options dnl# we need the standard prefixes defined early test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix="$prefix" eval "mandir=$mandir" eval "libdir=$libdir" eval "includedir=$includedir" dnl# compile-time switches AC_ARG_ENABLE(i18n, [ --enable-i18n support I18N [no] ],enable_i18n=$enableval,enable_i18n="no") AC_ARG_ENABLE(xlocale, [ --enable-xlocale using X_LOCALE [no] ],enable_xlocale=$enableval,enable_xlocale="no") AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ],with_locale=$withval,with_locale="") AC_ARG_ENABLE(staticlibs, [ --enable-staticlibs enable linking to libAfterBase statically [yes] ],enable_staticlibs=$enableval,enable_staticlibs="yes") AC_ARG_ENABLE(sharedlibs, [ --enable-sharedlibs enable linking to libAfterBase dynamically [no] ],enable_sharedlibs=$enableval,enable_sharedlibs="no") AC_ARG_ENABLE(gdb, [ --enable-gdb add gdb symbols (-g) (for debugging) [no] ],enable_gdb=$enableval,enable_gdb="no") AC_ARG_ENABLE(warn, [ --enable-warn turn on more compiler warnings (for debugging) [no] ],enable_warn=$enableval,enable_warn="no") AC_ARG_ENABLE(gprof, [ --enable-gprof add gprof symbols (-pg) (for debugging) [no] ],enable_gprof=$enableval,enable_gprof="no") AC_ARG_ENABLE(audit, [ --enable-audit memory usage audit (for debugging) [no] ],enable_audit=$enableval,enable_audit="no") AC_ARG_ENABLE(trace, [ --enable-trace some function calls tracing (see include/trace.h) (for debugging) [no] ],enable_trace=$enableval,enable_trace="no") AC_ARG_ENABLE(trace-x, [ --enable-trace-x trace X calls (runtime option) (for debugging) [no] ],enable_trace_x=$enableval,enable_trace_x="no") dnl# Check for compiler tools if test "x$FROM_AFTERSTEP_CONFIGURE" = "xyes"; then dnl# AfterSTep already checked everything for us aaa=bbb dnl# AC_PROG_CC AC_SUBST(CC) AC_SUBST(GCC) AC_SUBST(CFLAGS) dnl# AC_PROG_INSTALL AC_SUBST(INSTALL) AC_SUBST(INSTALL_PROGRAM) AC_SUBST(INSTALL_DATA) AC_SUBST(INSTALL_LIB) AC_SUBST(RANLIB) AC_SUBST(RM) AC_SUBST(MV) AC_SUBST(CP) AC_SUBST(MKDIR) AC_SUBST(PERL) AC_SUBST(FIND) AC_SUBST(XARGS) AC_SUBST(LDCONFIG) AC_SUBST(LEX) AC_SUBST(LEXLIB) AC_SUBST(YACC) AC_SUBST(sgmltools) else dnl# we are alone - have to do all the checks ourselves : AC_PROG_CC dnl# Remove -g if test -n "`echo $CFLAGS' ' | grep '\-g ' 2> /dev/null`" ; then CFLAGS=`echo "$CFLAGS " | sed "s/-g / /"` fi dnl# Add -Wall if test "x$GCC" = "xyes"; then if test -z "`echo $CFLAGS | grep '\-Wall' 2> /dev/null`" ; then CFLAGS="$CFLAGS -Wall" fi fi dnl# Add -fPIC for IA64 compilation AC_CYGWIN if test "x$CYGWIN" = "x" -a "x$GCC" = "xyes" ; then if test -z "`echo $CFLAGS | grep '\-fPIC' 2> /dev/null`" ; then CFLAGS="$CFLAGS -fPIC" fi fi dnl# Add -g if test "x$enable_gdb" = "xyes"; then CFLAGS="$CFLAGS -g" LDFLAGS="$LDFLAGS -g" fi dnl# Add -pg if test "x$enable_gprof" = "xyes"; then CFLAGS="$CFLAGS -pg" LDFLAGS="$LDFLAGS -pg" fi dnl# Add lots more warnings if test "x$enable_warn" = "xyes"; then CFLAGS="$CFLAGS -Wuninitialized -Wwrite-strings -Wcast-qual -Wbad-function-cast -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wconversion -Wcomment -Wcast-align -Winline -Wshadow -Wredundant-decls -Wid-clash-31" fi if test "x$GCC" = "xyes"; then LDFLAGS="$LDFLAGS -rdynamic" fi AC_PROG_INSTALL dnl# if the path to the install program is relative, make it absolute currdir=`pwd` INSTALL=`echo $INSTALL|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` INSTALL_PROGRAM=`echo $INSTALL_PROGRAM|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` INSTALL_DATA=`echo $INSTALL_DATA|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` INSTALL_LIB=`echo $INSTALL_LIB|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` AC_PROG_RANLIB AC_PATH_PROG(RM, rm, rm) AC_PATH_PROG(MV, mv, mv) AC_PATH_PROG(CP, cp, cp) AC_PATH_PROG(MKDIR, mkdir, mkdir) AC_PATH_PROG(PERL, perl, perl) AC_PATH_PROG(FIND, find, find) AC_PATH_PROG(XARGS, xargs, xargs) AC_PATH_PROG(LDCONFIG, ldconfig, ldconfig, $PATH:/sbin:/usr/local/sbin) AC_CHECK_PROG(sgmltools, sgmltools, HAVE_SGMLTOOLS, NO_SGMLTOOLS) fi dnl# some standard checks : dnl# let's check for endiannes of our box AC_C_BIGENDIAN AC_C_INLINE dnl# check for X, if top level configure script did not do that yet : if test "x$PATH_XTRA_CHECKED" != "xyes"; then AC_PATH_XTRA else if test "x$have_x" != "xyes"; then AC_DEFINE(X_DISPLAY_MISSING) fi fi dnl# Check for headers AC_HEADER_DIRENT AC_HEADER_TIME AC_CHECK_HEADERS(sys/wait.h sys/time.h) dnl# this is needed for self diagnostic code : AC_CHECK_HEADERS(link.h elf.h execinfo.h) AC_CHECK_FUNCS(backtrace_symbols) AC_CACHE_CHECK(for struct sigcontext, as_cv_struct_sigcontext, [AC_TRY_COMPILE([#include #include ], [int main(){struct sigcontext sc; return (int)≻}], as_cv_struct_sigcontext=yes, as_cv_struct_sigcontext=no)]) if test "$as_cv_struct_sigcontext" = yes; then AC_DEFINE(HAVE_SIGCONTEXT) fi dnl# Checks for functions if test "x$DO_HAVE_WAIT3" = "xyes"; then AC_DEFINE(HAVE_WAIT3) else dnl# are you sure ? let me doublecheck : AC_FUNC_WAIT3 fi AC_CHECK_FUNCS(uname gethostname) if test "x$enable_staticlibs" = "xyes"; then LIBPROG='$(LIB_STATIC)' LIBINSTALL="install.static" fi if test "x$enable_sharedlibs" = "xyes"; then tmp='$(LIB_SHARED)' LIBPROG="$LIBPROG $tmp" LIBINSTALL="$LIBINSTALL install.dyn" fi dnl# define X_LOCALE. need Linux, NetBSD and etc. if test "x$enable_xlocale" = "xyes"; then DEFINE_XLOCALE="-DX_LOCALE" fi dnl# Check for safe min/max - there still are some retarded compilers out there : AC_MSG_CHECKING(if we can use sign safe min/max macros) AC_TRY_RUN([#define MIN(x,y) \ ({ const typeof(x) _x = (x); const typeof(y) _y = (y); (void) (&_x == &_y); \ _x < _y ? _x : _y; }) int main(){return 0;}], [AC_DEFINE(USE_SAFE_MINMAX) AC_MSG_RESULT(yes)],AC_MSG_RESULT(no)) dnl# Translate enable_* from "yes/no" to "1/0" (for configure.h) if test "x$enable_i18n" = "xyes"; then AC_DEFINE(I18N) fi if test "x$enable_audit" = "xyes"; then AC_DEFINE(DEBUG_ALLOCS) fi if test "x$enable_trace" = "xyes"; then AC_DEFINE(DEBUG_TRACE) fi if test "x$enable_trace_x" = "xyes"; then AC_DEFINE(DEBUG_TRACE_X) fi dnl# Variable strings declaration AC_SUBST(version) AC_SUBST(version_major) AC_SUBST(lib_name) AC_SUBST(lib_file_name) AC_SUBST(with_locale) AC_SUBST(X_CFLAGS) AC_SUBST(LIBPROG) AC_SUBST(LIBINSTALL) AC_SUBST(DEFINE_XLOCALE) AC_SUBST(sgmltools) AC_SUBST(PERL) dnl# Common parts of the Makefile AC_OUTPUT(Makefile)