Skip to content
Snippets Groups Projects
configure.ac 47.5 KiB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
dnl Process this file with autoconf to produce a configure script.
dnl Original author: Michael Patra
dnl See ChangeLog file for detailed change history.

m4_define(WINE_VERSION,regexp(m4_include(VERSION),[version \([-.0-9A-Za-z]+\)],[\1]))

AC_CONFIG_SRCDIR(server/atom.c)
AC_CONFIG_HEADERS(include/config.h)
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_CONFIG_AUX_DIR(tools)
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Command-line arguments ****

AC_ARG_ENABLE(win16, AC_HELP_STRING([--disable-win16],[do not include Win16 support]))
AC_ARG_ENABLE(debug, AC_HELP_STRING([--disable-debug],[compile out all debugging messages]))
AC_ARG_ENABLE(trace, AC_HELP_STRING([--disable-trace],[compile out TRACE messages]))

AC_ARG_WITH(opengl,    AC_HELP_STRING([--without-opengl],[do not use OpenGL]))
AC_ARG_WITH(curses,    AC_HELP_STRING([--without-curses],[do not use curses]))
AC_ARG_WITH(wine-tools,AC_HELP_STRING([--with-wine-tools=<dir>],[use Wine tools from directory <dir>]))
Alexandre Julliard's avatar
Alexandre Julliard committed

AC_SUBST(WIN16_FILES,"\$(WIN16_FILES)")
AC_SUBST(WIN16_INSTALL,"\$(WIN16_INSTALL)")
if test "x$enable_win16" = "xno"
then
  WIN16_FILES=""
  WIN16_INSTALL=""
fi
Alexandre Julliard's avatar
Alexandre Julliard committed
then
    AC_DEFINE(NO_DEBUG_MSGS,1,[Define to disable all debug messages.])
if test "x$enable_trace" = "xno" -o "x$enable_debug" = "xno"
    AC_DEFINE(NO_TRACE_MSGS,1,[Define to disable trace messages.])
Alexandre Julliard's avatar
Alexandre Julliard committed
fi

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Check for some programs ****
Alexandre Julliard's avatar
Alexandre Julliard committed

Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PROG_MAKE_SET
AC_PROG_CC
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PROG_CPP

AC_CACHE_CHECK([for the directory containing the Wine tools], wine_cv_toolsdir,
  [if test -z "$with_wine_tools"; then
     if test "$cross_compiling" = "yes"; then
       AC_MSG_ERROR([you must use the --with-wine-tools option when cross-compiling.])
     else
       wine_cv_toolsdir="\$(TOPOBJDIR)"
     fi
   elif test -d "$with_wine_tools/tools/winebuild"; then
     case $with_wine_tools in
       /*) wine_cv_toolsdir="$with_wine_tools" ;;
       *)  wine_cv_toolsdir="\$(TOPOBJDIR)/$with_wine_tools" ;;
     esac
   else
     AC_MSG_ERROR([could not find Wine tools in $with_wine_tools.])
   fi])
AC_SUBST(TOOLSDIR,$wine_cv_toolsdir)

Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PATH_XTRA
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PROG_YACC
AC_PROG_LEX

dnl **** Just additional warning checks, since AC_PROG just sets 'yacc' even
dnl **** without one present.
AC_CHECK_PROGS(XYACC,$YACC bison yacc,none)
if test "$XYACC" = "none"
then
  AC_MSG_ERROR([no suitable bison/yacc found. Please install the 'bison' package.])
AC_CHECK_PROGS(XLEX,$LEX flex lex,none)
if test "$XLEX" = "none"
then
  AC_MSG_ERROR([no suitable lex found. Please install the 'flex' package.])
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PROG_RANLIB
AC_CHECK_TOOL(STRIP,strip,strip)
AC_CHECK_TOOL(WINDRES,windres,false)
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_PROG_LN_S
Alexandre Julliard's avatar
Alexandre Julliard committed
WINE_PROG_LN
AC_PATH_PROG(LDCONFIG, ldconfig, true, [/sbin /usr/sbin $PATH])
AC_PROG_INSTALL
dnl Prepend src dir to install path dir if it's a relative path
case "$INSTALL" in
  [[\\/$]]* | ?:[[\\/]]* ) ;;
  *)  INSTALL="\\\$(TOPSRCDIR)/$INSTALL" ;;
esac
Alexandre Julliard's avatar
Alexandre Julliard committed

dnl Check for lint
AC_CHECK_PROGS(LINT, lclint lint)
if test "$LINT" = "lint"
then
  LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
  dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
fi
AC_SUBST(LINT)
AC_SUBST(LINTFLAGS)

dnl Check for db2html
AC_CHECK_PROGS(DB2HTML, docbook2html db2html, false)
AC_SUBST(DB2HTML)

dnl Check for db2pdf
AC_CHECK_PROGS(DB2PDF, docbook2pdf db2pdf, false)
AC_SUBST(DB2PDF)

dnl Check for db2ps
AC_CHECK_PROGS(DB2PS, docbook2ps db2ps, false)
AC_SUBST(DB2PS)

dnl Check for db2txt
AC_CHECK_PROGS(DB2TXT, docbook2txt db2txt, false)
AC_SUBST(DB2TXT)

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl **** Check for some libraries ****

Alexandre Julliard's avatar
Alexandre Julliard committed
dnl Check for -li386 for NetBSD and OpenBSD
Alexandre Julliard's avatar
Alexandre Julliard committed
AC_CHECK_LIB(i386,i386_set_ldt)
dnl Check for -lossaudio for NetBSD
AC_CHECK_LIB(ossaudio,_oss_ioctl)
Alexandre Julliard's avatar
Alexandre Julliard committed
dnl Check for -lw for Solaris
AC_CHECK_FUNCS(iswalnum,,AC_CHECK_LIB(w,iswalnum))
AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
dnl Check for -lsocket for Solaris
AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
dnl Check for -lresolv for Solaris
AC_CHECK_FUNCS(inet_aton,,AC_CHECK_LIB(resolv,inet_aton))
Alexandre Julliard's avatar
Alexandre Julliard committed
dnl Check for -lxpg4 for FreeBSD
AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
dnl Check for -lpthread
AC_CHECK_LIB(pthread,pthread_create,AC_SUBST(LIBPTHREAD,"-lpthread"))
JPEGLIB=""
AC_SUBST(JPEGLIB)
AC_CHECK_HEADERS(jpeglib.h,
    AC_CHECK_LIB(jpeg,jpeg_start_decompress,
    	AC_DEFINE(HAVE_LIBJPEG,1,[Define if you have libjpeg including devel headers])
	JPEGLIB="-ljpeg"
    )
)

AC_SUBST(GIFLIB,"")
AC_CHECK_HEADERS(gif_lib.h,
    AC_CHECK_LIB(ungif,DGifOpen,
        [AC_DEFINE(HAVE_LIBGIF,1,[Define if you have libgif/libungif including devel headers])
         GIFLIB="-lungif"],
        [AC_CHECK_LIB(gif,DGifOpen,
                      [AC_DEFINE(HAVE_LIBGIF,1)
                       GIFLIB="-lgif"])]))

AC_SUBST(XFILES)
XFILES=""
Lionel Ulmer's avatar
Lionel Ulmer committed
AC_SUBST(OPENGLFILES)
OPENGLFILES=""
AC_SUBST(GLU32FILES)
AC_SUBST(OPENGL_LIBS)
OPENGL_LIBS=""
    XLIB="-lXext -lX11"
    ac_save_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
    dnl *** All of the following tests require X11/Xlib.h
    AC_CHECK_HEADERS(X11/Xlib.h,
      [
        AC_CHECK_HEADERS([X11/XKBlib.h \
                          X11/Xutil.h \
                          X11/extensions/shape.h \
                          X11/extensions/XShm.h \
                          X11/extensions/Xrandr.h \
                          X11/extensions/Xrender.h \
                          X11/extensions/Xvlib.h \
                          X11/extensions/xf86dga.h \
                          X11/extensions/xf86vmode.h],,,
                         [#include <X11/Xlib.h>
                          #ifdef HAVE_X11_XUTIL_H
                          # include <X11/Xutil.h>
                          #endif])

        dnl *** Check for X keyboard extension
        if test "$ac_cv_header_X11_XKBlib_h" = "yes"
        then
              AC_CHECK_LIB(X11, XkbQueryExtension,
              AC_DEFINE(HAVE_XKB, 1, [Define if you have the XKB extension]),,
              $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
Loading
Loading full blame...