dnl Process this file with autoconf to produce a configure script. dnl Used autoconf 2.53-5. dnl Process it with aclocal to create aclocal.m4. dnl Package, Version, Bugreport, Tarname AC_INIT(nvtv,0.4.7,,nvtv-0.4.7) AC_PREREQ(2.53) dnl FIXME: dnl AC_CONFIG_AUX_DIR(config) dnl dnl Check system type dnl AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) dnl dnl Configuration defaults dnl AC_SUBST(PROGRAM) PROGRAM="nvtv nvtvd" dnl dnl Defaults and host matching dnl withdef_x=yes withdef_gtk=yes host_flag=unix withdef_client_backend=yes withdef_winio=no case $host in *-*-mingw32* | *-*-cygwin* | *-*-windows*) AC_MSG_RESULT(Setting defaults for Windows) PROGRAM="nvtv" host_flag=windows withdef_gtk=no withdef_x=no with_client_backend=no ;; esac dnl dnl Checks for programs. dnl AM_PROG_CC_STDC AC_PROG_INSTALL AC_PROG_MAKE_SET dnl dnl Debugging enables, CFLAGS dnl dnl Clear -g -O2 from CFLAGS CFLAGS="" AC_MSG_CHECKING(for debugging info) AC_ARG_ENABLE(debug, [ --disable-debug disable debugging info ],,enable_debug=yes) if test "$enable_debug" = yes; then CFLAGS="$CFLAGS -g" AC_MSG_RESULT(enabled) else CFLAGS="$CFLAGS -O2" AC_MSG_RESULT(disabled (optimizing on)) fi dnl dnl Check for X dnl AC_PATH_XTRA dnl Add X include dir to preprocessor flags (not done automatically), so dnl the extra X include checks down below work. This seems to be required dnl for some systems, though it shouldn't. Also add /usr/local/include dnl for libpci under FreeBSD. CPPFLAGS="$CPPFLAGS $X_CFLAGS -I/usr/local/include" if test "${with_x+set}" != set; then with_x="$withdef_x" fi dnl dnl Checks for GTK 1.2 or 2.0 dnl AC_ARG_WITH(gtk, [ --with-gtk use GTK 1.2 or 2.0 (force one with 'gtk1' or 'gtk2')], ,with_gtk="$withdef_gtk") have_gtk=no if test ${with_x} = no ; then dnl with_gtk=no AC_MSG_RESULT(X disabled as requested.) fi if test ${with_gtk} = no ; then AC_MSG_RESULT(GTK disabled as requested.) fi if test ${have_gtk} = no ; then if test ${with_gtk} = yes -o ${with_gtk} = gtk1 ; then AM_PATH_GTK(1.2.0, have_gtk=gtk1) fi fi if test ${have_gtk} = no ; then if test ${with_gtk} = yes -o ${with_gtk} = gtk2 ; then AM_PATH_GTK_2_0(2.0.0, have_gtk=gtk2) fi fi if test ${have_gtk} = no ; then if test ${with_gtk} = yes -o ${with_gtk} = gtk1 ; then AC_MSG_WARN(Cannot find GTK 1.2.0 or higher (Is gtk-config in path?)) fi if test ${with_gtk} = yes -o ${with_gtk} = gtk2 ; then AC_MSG_WARN(Cannot find GTK 2.0.0 or higher (Is pkg-config in path?)) fi if test ${with_gtk} != no ; then AC_MSG_WARN(GTK disabled.) with_gtk=no fi else LIBS="$LIBS $GTK_LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" fi dnl dnl Check for wxWindows 2.3 or higher dnl have_wxwin=no with_wxwin=no if test ${with_gtk} = no ; then AM_OPTIONS_WXCONFIG AM_PATH_WXCONFIG(2.3.0, have_wxwin=yes) if test ${have_wxwin} = no ; then if test ${with_wxwin} = yes ; then AC_MSG_WARN(Cannot find wxWindows 2.3.0 or higher) fi else CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" LDFLAGS="$LDFLAGS $WX_LIBS" fi fi dnl dnl Adjust sources dnl AC_SUBST(OBJS_GUI) AC_SUBST(OBJS_EXTRA) AC_SUBST(OBJS_BACKEND) OBJS_GUI="" OBJS_EXTRA="" OBJS_BACKEND="" dnl Use sed instead of expr for for increased portability ("expr substr" dnl does not exist on some versions of "expr", including the FreeBSD one). dnl have_gtk_version=`expr ${have_gtk} : 'gtk\([[12]]\)'` if test ${with_x} = yes ; then AC_DEFINE(HAVE_X,1,[Define to 1 if X is available and used.]) OBJS_EXTRA="$OBJS_EXTRA actions.o" if test ${have_gtk} != no ; then have_gtk_version=`echo ${have_gtk} | sed -e 's/^gtk\(.\).*/\1/'` AC_DEFINE(HAVE_GTK,1,[Define to 1 if GTK is available and used.]) AC_DEFINE_UNQUOTED(HAVE_GTK_VERSION,${have_gtk_version},[Define to 1/2 for GTK major version.]) OBJS_GUI="gui.o gui_bt.o gui_cx.o gui_ch.o gui_ph.o gui_nx.o gui_nv.o gui_tdfx.o gui_i810.o" fi if test ${have_gtk} != gtk1 ; then LIBS="$LIBS $X_LIBS" AC_CHECK_LIB(X11,XOpenDisplay,LIBS="$LIBS -lX11", AC_MSG_ERROR(X11 library required)) AC_CHECK_LIB(Xext,XMissingExtension,LIBS="$LIBS -lXext", AC_MSG_ERROR(Xext library required)) fi fi dnl dnl Check for backend usage dnl AC_MSG_CHECKING(for main (direct) backend) AC_ARG_WITH(winio, [ --with-winio Use WinIo], ,with_winio="$withdef_winio") dnl FIXME check for WinIo availability case ${host_flag} in unix) AC_MSG_RESULT(unix) AC_DEFINE(USE_UNIX_BACKEND,1,[Define to 1 if Unix backend is used.]) OBJS_BACKEND="$OBJS_BACKEND card_direct.o back_unix.o" ;; windows) if test ${with_winio} = yes ; then AC_MSG_RESULT(windows/winio) OBJS_BACKEND="$OBJS_BACKEND card_direct.o back_winio.o" AC_DEFINE(HAVE_WINIO,1,[Define to 1 if WinIo is used.]) else AC_MSG_RESULT(windows/nvdll) OBJS_BACKEND="$OBJS_BACKEND back_mswin.o" fi AC_DEFINE(USE_MSWIN_BACKEND,1,[Define to 1 if MS-Windows backend is used.]) ;; esac AC_MSG_CHECKING(for client backend) AC_ARG_WITH(client-backend, [ --with-client-backend Use client backend (default)], ,with_client_backend="$withdef_client_backend") if test ${with_client_backend} = yes ; then AC_MSG_RESULT(enabled) AC_DEFINE(USE_CLIENT_BACKEND,1,[Define to 1 if client backend is used.]) OBJS_BACKEND="$OBJS_BACKEND back_client.o" else AC_MSG_RESULT(disabled) fi dnl dnl Check for other libraries dnl dnl (must check for winio before pci) dnl AC_CHECK_LIB(m,sin,LIBS="$LIBS -lm", AC_MSG_ERROR(math library required)) case ${host} in *-*-netbsd*) AC_CHECK_LIB(i386,i386_iopl,LIBS="$LIBS -li386", AC_MSG_ERROR(NetBSD i386 library required)) AC_CHECK_LIB(pci,pcibus_conf_read,LIBS="$LIBS -lpci", AC_MSG_ERROR(NetBSD pci library required)) ;; *-*-freebsd*) AC_CHECK_LIB(gnugetopt,getopt_long,LIBS="$LIBS -lgnugetopt", AC_MSG_ERROR(FreeBSD gnugetopt library required)) ;; esac if test ${with_winio} = yes ; then AC_CHECK_LIB(winio,winio_init,LIBS="$LIBS -lwinio", AC_MSG_ERROR(winio wrapper library required)) fi if test ${host_flag} = unix -o ${with_winio} = yes ; then AC_CHECK_LIB(pci,pci_init,LIBS="$LIBS -lpci" pciutils_libname="pci", AC_CHECK_LIB(pciutils,pci_init,LIBS="$LIBS -lpciutils" pciutils_libname="pciutils", AC_MSG_ERROR(pci library required))) fi dnl dnl Check for other X libraries dnl if test ${with_x} = yes ; then AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryVersion,LIBS="$LIBS -lXxf86vm", AC_MSG_ERROR(Xxf86vm video mode extension library required)) AC_CHECK_LIB(Xmu,XmuClientWindow,LIBS="$LIBS -lXmu", AC_MSG_ERROR(Xmu library required)) fi dnl dnl Check for header files dnl AM_CONFIG_HEADER(src/config.h) AC_HEADER_STDC AC_CHECK_HEADERS(sys/io.h) if test ${host_flag} = unix -o ${with_winio} = yes ; then AC_CHECK_HEADER(${pciutils_libname}/pci.h,, AC_MSG_WARN(pci library header \'${pciutils_libname}/pci.h\' required)) AC_DEFINE(HAVE_PCI,1,[Define to 1 if pciutils available and used.]) if test ${pciutils_libname} = pciutils ; then AC_DEFINE(HAVE_PCIUTILS,1,[Define to 1 if pciutils library is named 'pciutils'.]) fi fi if test ${with_winio} = yes ; then AC_CHECK_HEADER(winio.h,, AC_MSG_ERROR(winio wrapper library header 'winio.h' required)) fi dnl dnl Check for X header files dnl if test ${with_x} = yes ; then AC_CHECK_HEADER(X11/Xmu/WinUtil.h,, AC_MSG_ERROR(X11 header 'X11/Xmu/WinUtil.h' required)) AC_MSG_CHECKING(for X11/extensions/xf86vmode.h presence) AC_TRY_CPP([#include ],[ AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no) AC_MSG_ERROR(X11 header 'X11/extensions/xf86vmode.h' required)]) fi dnl dnl Check for XBox option dnl AC_MSG_CHECKING(for XBox support) AC_ARG_WITH(xbox, [ --with-xbox compile for XBox],,with_xbox=no) if test ${with_xbox} = yes ; then AC_MSG_RESULT(enabled) AC_DEFINE(XBOX_SUPPORT,1,[Define to 1 if XBox support is used.]) OBJS_EXTRA="$OBJS_EXTRA xbox.o" else AC_MSG_RESULT(disabled) fi dnl dnl Process other options dnl AC_ARG_WITH(fifo-path, [ --with-fifo-path=PATH path for the server/client fifo pipes (/var/run)], with_fifo_path="$withval", with_fifo_path="/var/run") AC_DEFINE_UNQUOTED(CONFIG_PIPE_PATH, "${with_fifo_path}", [Path to client/server fifo pipes]) AC_MSG_RESULT(path to use for fifo pipes... ${with_fifo_path}) dnl dnl Create files dnl AC_OUTPUT([Makefile src/Makefile man/Makefile test/Makefile])