dnl# -*- sh -*-
dnl# the "configure" script is made from this by running GNU "autoconf"
dnl#
dnl# "$Id: configure.in 2126 2007-11-16 10:08:55Z karijes $"
dnl#
dnl# Configuration script for the Fast Light Tool Kit (FLTK).
dnl#
dnl# Copyright 1998-1999 by Bill Spitzak and others.
dnl#
dnl# This library is free software; you can redistribute it and/or
dnl# modify it under the terms of the GNU Library General Public
dnl# License as published by the Free Software Foundation; either
dnl# version 2 of the License, or (at your option) any later version.
dnl#
dnl# This library is distributed in the hope that it will be useful,
dnl# but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dnl# Library General Public License for more details.
dnl#
dnl# You should have received a copy of the GNU Library General Public
dnl# License along with this library; if not, write to the Free Software
dnl# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
dnl# USA.
dnl#
dnl# Please report all bugs and problems to "fltk-bugs@easysw.com".
dnl#

if test "configure" -ot "configure.in"; then
  echo "*** You must run autoconf first! ***"
  exit 1
fi

AC_INIT(src/core/Fl.cpp)

dnl EFLTK library version
FL_MAJOR_VERSION=2
FL_MINOR_VERSION=0
FL_PATCH_VERSION=7
FL_API_VERSION=${FL_MAJOR_VERSION}.${FL_MINOR_VERSION}

AC_SUBST(FL_MAJOR_VERSION)
AC_SUBST(FL_MINOR_VERSION)
AC_SUBST(FL_PATCH_VERSION)
AC_SUBST(FL_API_VERSION)

AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
if test $ac_cv_sizeof_short -eq 2; then
    AC_DEFINE(U16,unsigned short)
fi
if test $ac_cv_sizeof_int -eq 4; then
    AC_DEFINE(U32,unsigned)
else
    if test $ac_cv_sizeof_long -eq 4; then
        AC_DEFINE(U32,unsigned long)
    fi
fi
if test $ac_cv_sizeof_int -eq 8; then
    AC_DEFINE(U64,unsigned)
else
    if test $ac_cv_sizeof_long -eq 8; then
        AC_DEFINE(U64,unsigned long)
    fi
fi

dnl Don't automatically add "-g" to compiler options...
CFLAGS="-fexceptions"
CXXFLAGS="-fexceptions"

dnl# See if we need a .exe extension on executables...
AC_EXEEXT
dnl Architecture checks...
AC_PROG_CC
AC_PROG_CXX

if test "$CXX" = "gcc";
then
    # Starting with GCC 3.0, you must link C++ programs against either
    # libstdc++ (shared by default), or libsupc++ (always static).  If
    # you care about binary portability between Linux distributions,
    # you need to either 1) build your own GCC with static C++ libraries
    # or 2) link using gcc and libsupc++.  We choose the latter since
    # CUPS doesn't (currently) use any of the stdc++ library.
    #
    # Also, GCC 3.0.x still has problems compiling some code.  You may
    # or may not have success with it.  USE 3.0.x WITH EXTREME CAUTION!
    #
    # Previous versions of GCC do not have the reliance on the stdc++
    # or g++ libraries, so the extra supc++ library is not needed.

    AC_MSG_CHECKING(if libsupc++ is required)

    SUPC="`$CXX -print-file-name=libsupc++.a 2>/dev/null`"
    case "$SUPC" in
    	libsupc++.a*)
	    # Library not found, so this is and older GCC...
	    AC_MSG_RESULT(no)
	    ;;
	*)
            # This is gcc 3.x, and it knows of libsupc++, so we need it
            LDLIBS="$LDLIBS -lsupc++"
            AC_MSG_RESULT(yes)
	    ;;
    esac
fi

AC_C_BIGENDIAN
AC_PROG_RANLIB

LIBEXT=".a"
if test "$RANLIB" != ":"; then
  LIBCOMMAND="ar cr"
else
  LIBCOMMAND="ar crs"
fi
DSOCFLAGS=""
DSOEXT=""
DSOSHORTEXT=""
DSOLIBS=""
THEMELIBS=""

PACKAGE="efltk"
AC_SUBST(PACKAGE)

EFLTK_BUILD=`date +%G%m%d`
AC_SUBST(EFLTK_BUILD)

EFLTK_BUILDDIR=`pwd`
AC_SUBST(EFLTK_BUILDDIR)

LD="\${CXX}"
LDLIBS="$LDLIBS -lX11 -lXext -lm"

DSOEXT=".so.$FL_API_VERSION"
DSOSHORTEXT=".so"

DEBUGFLAG=""
SYSTYPE="UNIX"
DSOCOMMAND=""
THEMECOMMAND=""
DSOCFLAGS=""

AC_ARG_ENABLE(xdbe, [  --enable-xdbe           enable XWindow XDBE extension, if available],[if eval "test x$enable_xdbe = xyes"; then
	AC_DEFINE(USE_XDBE)
fi])

AC_ARG_ENABLE(xft, [  --enable-xft            enable XWindow XFT extension],[if eval "test x$enable_xft = xyes"; then
	AC_DEFINE(USE_XFT)
	LDLIBS="$LDLIBS `xft-config --libs`"
        CXXFLAGS="$CXXFLAGS `xft-config --cflags`"
fi])

AC_ARG_ENABLE(debug, [  --enable-debug          compile with debug rather than optimized],[if eval "test x$enable_debug = xyes"; then
	DEBUGFLAG="-g3 -D_DEBUG"
fi])

dnl# Get the operating system and version number...
uname=`uname`
uversion=`uname -r | sed -e 's/-.*$//g;s/\.//g'`
dnl# uversion=`uname -r | sed -e '1,$s/\.//g'`
if test -z "$uname"; then uname="WIN32"; fi
if test "$uname" = "IRIX64"; then uname="IRIX"; fi

case $uname in
    SunOS* | UNIX_S*)
          if test "$uversion" -ge 50; then
	    DSOCOMMAND="\${CXX} -R\${EFLTK_LIBDIR} -G $DEBUGFLAG -o"
	    THEMECOMMAND="\${CXX} -G $DEBUGFLAG -o"
    	  else
            DSOCOMMAND="\${CXX} -L\${EFLTK_LIBDIR} $DEBUGFLAG -o"
	    THEMECOMMAND="\${CXX} $DEBUGFLAG -o"
          fi
          DSOCFLAGS="-fPIC"
          CXXFLAGS="$CXXFLAGS -I/opt/csw/include"
	  ;;
    HP-UX*)
	  DSOCOMMAND="ld +b\${EFLTK_LIBDIR} $DEBUGFLAG -b -o"
	  THEMECOMMAND="ld -b $DEBUGFLAG -o"
	  DSOEXT=".sl.$FL_API_VERSION"
	  DSOSHORTEXT=".sl"
          DSOCFLAGS="+z"
	  ;;
    CYGWIN* | WIN32)
          uname="WIN32"
	  CFLAGS="$CFLAGS -D_WIN32"
	  CXXFLAGS="$CXXFLAGS -D_WIN32"
	  LDLIBS="-lgdi32 -luser32 -lmsvcrt -lwsock32 -lws2_32 -lcomdlg32"
	  SYSTYPE="WIN32"
          DSOCOMMAND="\${CXX} -Wl,--out-implib,\$@.import -shared $DEBUGFLAG -o"
          THEMECOMMAND="\${CXX} -shared $DEBUGFLAG -o"
	  DSOLIBS="-lgdi32 -luser32 -lmsvcrt -lwsock32 -lws2_32 -lcomdlg32"
	  THEMELIBS="-L \${EFLTK_BUILDDIR}/lib -lefltk.2.dll"
          DSOLIBimagesNAME="efltk_images"
          DSOLIBformsNAME="efltk_forms"
          DSOLIBglNAME="efltk_gl"
          DSOLIBglutNAME="efltk_glut"
	  DSOEXT=".$FL_API_VERSION.dll"
	  DSOSHORTEXT=""
	  ;;

    OSF1)
          DSOCOMMAND="\${CXX} $DEBUGFLAG -o"
          THEMECOMMAND="\${CXX} $DEBUGFLAG -o"
	  ;;
    *)
          DSOCOMMAND="\${CXX} -Wl,-soname,\${DSONAME} -shared $DEBUGFLAG -o"
          THEMECOMMAND="\${CXX} -shared $DEBUGFLAG -o"
          DSOCFLAGS="-fPIC"
	  ;;
esac

BUILDTARGETS="shared programs"
INSTALLTARGETS="install_shared install_programs"

FLLIB="\${EFLTK_BUILDDIR}/lib/libefltk${DSOEXT}"
FLGLLIB="\${EFLTK_BUILDDIR}/lib/libefltk_gl${DSOEXT}"
FLIMAGESLIB="\${EFLTK_BUILDDIR}/lib/libefltk_images${DSOEXT}"
FLXMLLIB="\${EFLTK_BUILDDIR}/lib/libefltk_xml${DSOEXT}"
FLODBCLIB="\${EFLTK_BUILDDIR}/lib/libefltk_odbc${DSOEXT}"
FLMYSQLLIB="\${EFLTK_BUILDDIR}/lib/libefltk_mysql${DSOEXT}"
FLNETLIB="\${EFLTK_BUILDDIR}/lib/libefltk_net${DSOEXT}"

CFLAGS="$CFLAGS -DFL_SHARED"
CXXFLAGS="$CXXFLAGS -DFL_SHARED"
case $uname in
	WIN32)
	    FLLIB="\${EFLTK_BUILDDIR}/lib/libefltk.2.dll.a"
	    FLGLLIB="\${EFLTK_BUILDDIR}/lib/libefltk_gl.2.dll.a"
	    FLIMAGESLIB="\${EFLTK_BUILDDIR}/lib/libefltk_images.2.dll.a"
	    FLXMLLIB="\${EFLTK_BUILDDIR}/lib/libefltk_xml.2.dll.a"
	    FLODBCLIB="\${EFLTK_BUILDDIR}/lib/libefltk_odbc.2.dll.a"
	    FLMYSQLLIB="\${EFLTK_BUILDDIR}/lib/libefltk_mysql.2.dll.a"
	    FLNETLIB="\${EFLTK_BUILDDIR}/lib/libefltk_net.2.dll.a"
	;;
esac

AC_ARG_ENABLE(static, [  --enable-static         create static libraries])
if test x$enable_static = xyes; then
	BUILDTARGETS="static programs"
	INSTALLTARGETS="install_static install_programs"
	FLLIB="\${EFLTK_BUILDDIR}/lib/libefltk${LIBEXT}"
	FLGLLIB="\${EFLTK_BUILDDIR}/lib/libefltk_gl${LIBEXT}"
	FLIMAGESLIB="\${EFLTK_BUILDDIR}/lib/libefltk_images${LIBEXT}"
	FLXMLLIB="\${EFLTK_BUILDDIR}/lib/libefltk_xml${LIBEXT}"
	FLODBCLIB="\${EFLTK_BUILDDIR}/lib/libefltk_odbc${LIBEXT}"
	FLMYSQLLIB="\${EFLTK_BUILDDIR}/lib/libefltk_mysql${LIBEXT}"
	FLNETLIB="\${EFLTK_BUILDDIR}/lib/libefltk_net${LIBEXT}"
fi

dnl# AC_PROG_INSTALL
dnl# AC_LANG_CPLUSPLUS

AC_HEADER_DIRENT
AC_CHECK_HEADER(sys/select.h)
AC_CHECK_FUNCS(scandir,
    if test "$uname" != "SunOS"; then
        AC_DEFINE(HAVE_SCANDIR)
    fi)
AC_CHECK_FUNCS(vsnprintf,
    if test "$uname" != "HP-UX"; then
        AC_DEFINE(HAVE_VSNPRINTF)
    fi)
AC_CHECK_FUNCS(snprintf,
    if test "$uname" != "HP-UX"; then
        AC_DEFINE(HAVE_SNPRINTF)
    fi)
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(vsprintf)

dnl# AC_CHECK_FUNCS(strtok_r)
dnl# this test is needed for Digital Unix, where C++ must be used?
AC_MSG_CHECKING([for strtok_r])
AC_TRY_LINK([#include <string.h>],[char *ptr; ptr=strtok_r("  ", ".", &ptr);],
[AC_DEFINE(HAVE_STRTOK_R) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])]

AC_PATH_X
if test "$x_libraries" = "/usr/lib"; then
    echo "Ignoring X library directory \"$x_libraries\" requested by configure."
    x_libraries="NONE"
fi

if test ! "$x_libraries" = "NONE" -a ! "$x_libraries" = ""; then
    LDFLAGS="$LDFLAGS -L$x_libraries"
    if test "$uname" = "SunOS"; then
	    LDFLAGS="$LDFLAGS -R$x_libraries"
    fi
fi

if test "$x_includes" = "/usr/include"; then
    echo "Ignoring X include directory \"$x_includes\" requested by configure."
    x_includes="NONE"
fi

if test ! "$x_includes" = "NONE" -a ! "$x_includes" = ""; then
    CFLAGS="$CFLAGS -I$x_includes"
    CXXFLAGS="$CXXFLAGS -I$x_includes"
fi

AC_CHECK_LIB(X11,XOpenDisplay)
AC_CHECK_LIB(X11, Xutf8TextPropertyToTextList, AC_DEFINE(HAVE_X11_UTF_TEXT_PROP), )
AC_CHECK_LIB(Xext,XdbeQueryExtension)

dnl# echo "Ignoring libraries \"$X_PRE_LIBS\" requested by configure."

LIBS="$LIBS$X_LIBS"
CFLAGS="$CFLAGS$X_CFLAGS"
CXXFLAGS="$CXXFLAGS$X_CFLAGS"

dnl# Test for libGL or libMesaGL
AC_ARG_ENABLE(opengl, [  --enable-opengl         turn on OpenGL support [default=yes]])
GLLIB=
if test x$enable_opengl != xno; then
    if test "$uname" = "WIN32"
    then
	GLLIB="-lopengl32 -lglu32"
	AC_DEFINE(HAVE_GL)
    else
	AC_CHECK_LIB(GL, glXMakeCurrent, \
	    AC_DEFINE(HAVE_GL) GLLIB=" -lGLU -lGL", \
	    AC_CHECK_LIB(MesaGL, glXMakeCurrent, \
		AC_DEFINE(HAVE_GL) GLLIB=" -lMesaGLU -lMesaGL",,\
		-lX11 -lXext $X_EXTRA_LIBS -lm), \
	    -lX11 -lXext $X_EXTRA_LIBS -lm)
    fi
fi
AC_SUBST(GLLIB)

dnl# Test for libpng (and for libz by the way)
dnl# We check for a 1.0 function so versions of libpng < 1.0 are not
dnl# used...
AC_CHECK_HEADER(png.h, AC_CHECK_LIB(png, png_set_sig_bytes, \
	AC_DEFINE(HAVE_PNG) LIBPNG=" -lpng -lz"\
        ,,$X_EXTRA_LIBS -lz -lm))
AC_SUBST(LIBPNG)


dnl# Test for libjpeg
AC_CHECK_HEADER(jpeglib.h, AC_CHECK_LIB(jpeg, jpeg_stdio_src, \
	AC_DEFINE(HAVE_JPEG) LIBJPEG=" -ljpeg"\ 
        ,,))
AC_SUBST(LIBJPEG)
 
AC_CHECK_HEADER(X11/extensions/Xdbe.h, AC_DEFINE(HAVE_XDBE))

ac_cv_have_overlay=no
if test "$uname" != "WIN32"; then
    AC_CACHE_CHECK("for X overlay visuals", ac_cv_have_overlay,
	if xprop -root 2>/dev/null | grep -c "SERVER_OVERLAY_VISUALS" >/dev/null; then
	    ac_cv_have_overlay=yes
	fi)
fi

if test "$ac_cv_have_overlay" = yes; then
    AC_DEFINE(HAVE_OVERLAY)
fi


dnl just use libiconv without checking

AC_ARG_ENABLE(iconv, [  --enable-iconv	  use libiconv(only on old systems)],
	[if test x$enable_iconv = xyes; then
		LDLIBS="$LDLIBS -liconv"
	 fi ])

AC_MSG_CHECKING([for math emulation])
AC_TRY_LINK([#include <math.h>],[ floorf(1.0f); fabsf(1.0f); ],
[AC_DEFINE(HAVE_FLOAT_FUNCTIONS) AC_MSG_RESULT(not needed)], [AC_MSG_RESULT(needed)])]

AC_ARG_ENABLE(plugins, [  --enable-plugins        enable FLTK plug-in support])
have_dlopen=no
if test x$enable_plugins != xno; then
  AC_CHECK_LIB(c, dlopen, have_dlopen=yes, 
  	AC_CHECK_LIB(dl, dlopen, LDLIBS="$LDLIBS -ldl" GLDLIBS="$GLDLIBS -ldl" have_dlopen=yes,,),
  )
fi

if test x$have_dlopen = xyes; then
    AC_DEFINE(HAVE_DLOPEN)
fi

AC_ARG_ENABLE(cmap, [  --disable-cmap          disable 8bit display support],,enable_cmap=yes)
if test "$enable_cmap" = yes; then
	AC_DEFINE(USE_COLORMAP)
fi


AC_ARG_ENABLE(asm, [  --disable-asm           disable all ASM code inside efltk lib],,enable_asm=yes)
if test "$enable_asm" != yes; then
        AC_DEFINE(DISABLE_ASM)
fi

AC_ARG_ENABLE(duffs, [  --disable-duffs         disable duffs looping optimization, makes lib ~80kb smaller],,enable_duffs=yes)
if test "$enable_duffs" = yes; then
	AC_DEFINE(USE_DUFFS_LOOP)
fi

AC_ARG_ENABLE(utf8,  [  --disable-utf8          do not use UTF-8 support],, enable_utf8=yes)
if test "$enable_utf8" = yes; then
	AC_DEFINE(HAVE_XUTF8)    
fi

AC_DEFUN([AC_WITH_EFLTK_NLS],
[   AC_MSG_CHECKING([whether NLS is requested])
    dnl Default is enabled NLS
    AC_ARG_ENABLE(nls,
      [  --disable-nls           do not use Native Language Support],
      USE_NLS=$enableval, USE_NLS=yes)
    AC_MSG_RESULT($USE_NLS)
    AC_SUBST(USE_NLS)

    dnl If we use NLS figure out what method
    if test "$USE_NLS" = "yes"; then
      AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.])
    fi      
])   

AC_WITH_EFLTK_NLS

AC_ARG_ENABLE(threads, [  --disable-threads       dont require mt libraries],,enable_threads=yes)
have_pthread=no
if test "$enable_threads" = yes; then
  AC_CHECK_LIB(c, pthread_create, \
     have_pthread=yes,
     AC_CHECK_LIB(pthread, pthread_create, \
        THREADSLIBS=-lpthread have_pthread=yes,,),
  )
fi

if test "$have_pthread" = yes; then
    LDLIBS="$LDLIBS"
    GLDLIBS="$GLDLIBS"
    AC_DEFINE(HAVE_PTHREAD)
fi
AC_SUBST(THREADSLIBS)

dnl# Let's look for unixODBC...
AC_ARG_ENABLE(unixODBC, [  --disable-unixODBC      don't add unixODBC support],,enable_unixODBC=yes)
have_unixODBC=no
if test "$enable_unixODBC" = yes; then
  AC_CHECK_HEADER(sql.h, \
  	AC_CHECK_LIB(odbc, SQLAllocConnect, UNIXODBCLIB="-lodbc",,) \
  )
fi

dnl# Let's look for MySQL...
AC_ARG_ENABLE(mysql, [  --disable-mysql         don't add MySQL support],,enable_mysql=yes)
if test "$enable_mysql" = yes; then
	MYSQLCONFIG=mysql_config
	AC_PATH_PROG(MYSQLCONFIG_PATH, ${MYSQLCONFIG},, $PATH)
        
 	if test -n "$MYSQLCONFIG_PATH"; then
	        MYSQLLIBS=`$MYSQLCONFIG_PATH --libs`
		MYSQLFLAGS=`$MYSQLCONFIG_PATH --cflags`
        else
		DIRS="/usr/include /usr/local/include /usr/include/mysql /usr/local/include/mysql"
		for dir in $DIRS; do
                        if test -r "$dir/mysql.h"; then
                        	mysql_include="$dir";
                        fi
		done

		OLIBS="$LIBS"
                OCFLAGS="$CFLAGS"
		LIBS="$LIBS -lmysqlclient -lz"
                CFLAGS="$CFLAGS -I$mysql_include"
		AC_TRY_LINK(
                      [#include <mysql.h>],
  	              [int f() { mysql_init(0); }],
                      echo "Enabling MYSQL"
		      MYSQLLIBS="-lmysqlclient -lz"
		      MYSQLFLAGS="-I$mysql_include"
                      , echo "No MySQL")
	        LIBS="$OLIBS"
                CFLAGS="$OCFLAGS"
        fi
       	AC_SUBST(MYSQLLIBS)
       	AC_SUBST(MYSQLFLAGS)
fi

STRIP=strip
AC_PATH_PROG(STRIP_PATH, ${STRIP},, $PATH)
AC_SUBST(STRIP_PATH)

MAKEDEPEND="\${CXX} -M"

dnl# add warnings to compiler switches:
dnl# do this last so messing with switches does not break tests
if test -n "$GXX"; then
    if test -z "$DEBUGFLAG"; then
    	# Note: Can't use -fomit-frame-pointer - prevents tools like
	#       libsafe from working!
	# WAS: I removed the -fforce-mem, -fforce-addr, -fcaller-saves
	#      They all seemed to make either no difference or enlarged
	#      the code by a few hundred bytes.
        DEBUGFLAG="-Wuninitialized -O2"
    fi

    # See if we are running Solaris; if so, try the -fpermissive option...
    if test $uname = SunOS; then
	echo "Testing if GCC supports -fpermissive..."

	OLDCFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS -fpermissive"
	AC_TRY_COMPILE(,,
	    CXXFLAGS="$CXXFLAGS -fpermissive"
	    echo "Enabling -fpermissive to work around X header bugs...",
	    CFLAGS="$OLDCFLAGS"
	    echo "The -fpermissive option is not required by your GCC...")
    fi
    
else
dnl# NO GCC
    case `(uname) 2>/dev/null` in
        IRIX*)
	    # Running some flavor of IRIX; see which version and
	    # set things up according...
	    if test "$uversion" -ge 62; then
	        # We are running IRIX 6.2 or higher; uncomment the following
		# lines if you don't have IDO 7.2 or higher:
		#
		#     CXX="CC -n32"
		#     CC="cc -n32"
		#     LD="ld -n32"
		#     MAKEDEPEND="CC -M"

        	CFLAGS="-fullwarn $CFLAGS"
        	CXXFLAGS="-fullwarn $CXXFLAGS"
		if test -z "$DEBUGFLAG"; then
	            DEBUGFLAG="-OPT:Olimit=3000"
		fi
	    else
        	CXXFLAGS="+w +pp $CXXFLAGS"
		if test -z "$DEBUGFLAG"; then
	            DEBUGFLAG="-Olimit=3000"
		fi
	    fi
	    ;;
	HP-UX*)
	    # Running HP-UX; these options should work for the HP compilers.
	    if test -z "$DEBUGFLAG"; then
		DEBUGFLAG="+O2"
	    fi
	    ;;
	SunOS*)
	    # Solaris
	    if test -z "$DEBUGFLAG"; then
		DEBUGFLAG="-O2"
	    fi
	    ;;
	*)
	    # Running some other operating system; inform the user they
	    # should contribute the necessary options to fltk-bugs@easysw.com...
	    echo "Building FLTK with default compiler optimizations; contact"
	    echo "fltk-bugs@easysw.com with uname and compiler options needed"
	    echo "for your platform, or set the CFLAGS and CXXFLAGS options"
	    echo "before running configure."
	    ;;
    esac
fi

dnl Fix "libdir" variable...
if test "$prefix" = NONE; then
    prefix=/usr/local
    #dnl prefix=${ac_default_prefix}
fi

if test "$exec_prefix" = NONE; then
    exec_prefix="\${prefix}"
fi

AC_SUBST(DEBUGFLAG)

AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
AC_DEFINE_UNQUOTED(CONFIGDIR, "${prefix}/share/ede")

AC_SUBST(UNIXODBCLIB)

AC_SUBST(DSOEXT)
AC_SUBST(DSOSHORTEXT)
AC_SUBST(DSOCOMMAND)
AC_SUBST(THEMECOMMAND)
AC_SUBST(DSOCFLAGS)
AC_SUBST(LIBEXT)
AC_SUBST(LIBCOMMAND)
AC_SUBST(MAKEDEPEND)
AC_SUBST(SYSTYPE)

AC_SUBST(LD)
AC_SUBST(LDLIBS)

AC_SUBST(FLLIB)
AC_SUBST(FLGLLIB)
AC_SUBST(FLGLUTLIB)
AC_SUBST(FLFORMSLIB)
AC_SUBST(FLIMAGESLIB)
AC_SUBST(FLXMLLIB)
AC_SUBST(FLODBCLIB)
AC_SUBST(FLMYSQLLIB)
AC_SUBST(FLNETLIB)

AC_SUBST(DSOLIBS)
AC_SUBST(BUILDTARGETS)
AC_SUBST(INSTALLTARGETS)
AC_SUBST(THEMELIBS)

AC_CONFIG_HEADER(config.h:configh.in)
AC_OUTPUT(makeinclude efltk-config efltk.spec)

chmod +x efltk-config

echo
echo "Build information:"
echo "-------------------------"
echo "Prefix: $prefix"
echo "Bin directory: $prefix/bin"
echo "Lib directory: $prefix/lib"
echo "Include directory: $prefix/include"
echo
echo "Debug/Optim flags: $DEBUGFLAG"
echo
echo "Thread libs: $THREADSLIBS"
echo "Png   libs:  $LIBPNG"
echo "Jpeg  libs:  $LIBJPEG"
echo "ODBC  libs:  $UNIXODBCLIB"
echo "MySQL libs:  $MYSQLLIBS"
echo
echo "-------------------------"
echo "EFLTK is ready for build."
echo "To start building, type: ./emake"
echo

dnl#
dnl# End of "$Id: configure.in 2126 2007-11-16 10:08:55Z karijes $".
dnl#
