imm wrote:
On 30 Sep 2007, at 9:50, Gonzalo Garramuño wrote:
Greg Ercolano wrote:
I'm curious that I've properly followed FLTK2's API style; I basically
        set it up so that its all fltk::NativeFileChooser namespace style.

I can confirm that it does not work for latest fltk2.
Linking fails due to:
undefined reference to `fltk::FileIcon::load_system_icons()'

Odd - it works completely fine for me.
I just built this test for fltk-1.1 and fltk-2 on my Mac(10.4.10) and linux(FC7) using fltk-2-r5940 and in both cases it works just fine.


More than likely you still are using some different fltk2-config, as r5940 is definitively broken. And greg's makefile is also broken as does not include libfltk2_images.so which is the one that contains load_system_icons().

If you are picking that is something due to your OS.

On windows, dlls pick other dlls automatically, so it is not much of a check. Mac, I have no clue. FC7 also no clue, albeit if it is picking stuff automatically, it is incorrect behavior. Run your makefile with verbose or -n to see why it works for you. If you are using r5940, fltk2_images should never appear in your link line.

----------
Here's the fix needed for both configure.in and fltk2-config.in.
----------
And the fix to greg's Makefile-fltk2 also needed.


--
Gonzalo Garramuño
[EMAIL PROTECTED]

AMD4400 - ASUS48N-E
GeForce7300GT
Kubuntu Edgy
dnl 
dnl the "configure" script is made from this by running GNU "autoconf"
dnl
dnl "$Id: configure.in 5936 2007-07-24 11:25:53Z spitzak $"
dnl
dnl Configuration script for the Fast Light Tool Kit (FLTK).
dnl
dnl Copyright 1998-2003 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 "[EMAIL PROTECTED]".
dnl

dnl We need at least autoconf 2.50...
dnl AC_PREREQ(2.50)

dnl Required file in package...
AC_INIT(src/Widget.cxx)

dnl FLTK library versions...
FL_MAJOR_VERSION=2
FL_MINOR_VERSION=0
FL_PATCH_VERSION=0
FL_RELEASE_VERSION=a0
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_RELEASE_VERSION)
AC_SUBST(FL_API_VERSION)

dnl Get the operating system and version number...
uname=`uname`
uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'`
case $uname in
  IRIX*)
    uname="IRIX"
  ;;
  MINGW*)
    uname="MINGW"
  ;;
  CYGWIN*)
    uname="CYGWIN"
  ;;
esac

dnl Don't automatically add "-g" to compiler options...
CFLAGS="${CFLAGS:=}"
CPPFLAGS="${CPPFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}"
OPTIM="${OPTIM:=}"

AC_SUBST(OPTIM)

dnl OS-specific pre-tests...
case $uname in
    CYGWIN*)
        # Handle Cygwin option *first*, before all other tests.
        AC_ARG_ENABLE(cygwin, [  --enable-cygwin         use the CygWin 
libraries (default=no)])
        if test x$enable_cygwin != xyes; then
            CFLAGS="$CFLAGS -mno-cygwin"
            CPPFLAGS="$CPPFLAGS -mno-cygwin"
            CXXFLAGS="$CXXFLAGS -mno-cygwin"
        else
            CFLAGS="$CFLAGS -D_WIN32"
            CPPFLAGS="$CPPFLAGS -D_WIN32"
            CXXFLAGS="$CXXFLAGS -D_WIN32"
        fi
        ;;
esac

dnl Define the libraries and link options we'll need.
GLDEMOS="gldemos"

AC_SUBST(GLDEMOS)

LINKFLTK="-lfltk2"
LINKFLTKGL="-lfltk2_gl"
LINKFLTKIMG="-lfltk2_images"

AC_SUBST(LINKFLTK)
AC_SUBST(LINKFLTKGL)
AC_SUBST(LINKFLTKIMG)

LIBPREFIX="lib"
LIBSUFFIX=".a"
LIBTARGET="static"

AC_SUBST(LIBPREFIX)
AC_SUBST(LIBSUFFIX)
AC_SUBST(LIBTARGET)

DSOLINK=""
DSOPREFIX=""
DSOSUFFIX=""
DSOSYMLINK=""
DSOTARGET=""

AC_SUBST(DSOLINK)
AC_SUBST(DSOPREFIX)
AC_SUBST(DSOSUFFIX)
AC_SUBST(DSOSYMLINK)
AC_SUBST(DSOTARGET)

BUILDTARGETS="programs"
INSTALLTARGETS="install_programs"

AC_SUBST(BUILDTARGETS)
AC_SUBST(INSTALLTARGETS)

dnl Handle compile-time options...
AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging (default=no)])
if test x$enable_debug = xyes; then
    DEBUGFLAG="-g "
else
    DEBUGFLAG=""
fi

AC_ARG_ENABLE(gl, [  --enable-gl             turn on OpenGL support 
(default=yes)])

AC_ARG_ENABLE(shared, [  --enable-shared         turn on shared libraries 
(default=no)])
if test x$enable_shared = xyes; then
    DSOPREFIX="lib"
    DSOSUFFIX=".so.$FL_API_VERSION"
    DSOSYMLINK=".so"
    DSOTARGET="shared"

    PICFLAG=1
    SHAREDSUFFIX=""
    FLUID="fluid2-shared"

    BUILDTARGETS="shared $BUILDTARGETS"
    INSTALLTARGETS="install_shared $INSTALLTARGETS"

    case $uname in
        Darwin*)
            DSOSYMLINK=".dylib"
            DSOSUFFIX=".$FL_API_VERSION.dylib"
            DSOCOMMAND="ld $DSOFLAGS -dylib /usr/lib/dylib1.o -lc"
            if test "$libdir" != "/usr/lib"; then
                    DSOLINK="-Wl,-rpath,$libdir"
            fi
            ;;

        SunOS* | UNIX_S*)
            DSOCOMMAND="\$(CXX) -h \$@ \$(LDLIBS) -G $DEBUGFLAG -o"
            if test "$libdir" != "/usr/lib"; then
                    DSOLINK="-R$libdir"
            fi
            ;;
        HP-UX*)
            DSOSUFFIX=".sl.$FL_API_VERSION"
            DSOSYMLINK=".sl"
            DSOCOMMAND="ld -b -z +h \$@ $DEBUGFLAG -o"
            if test "$libdir" != "/usr/lib"; then
                    DSOLINK="-Wl,-rpath,$libdir"
            fi
            ;;
        IRIX*)
            DSOCOMMAND="\$(CXX) -Wl,-soname,\$@,-set_version,sgi1.1 \$(LDLIBS) 
-shared $DEBUGFLAG -o"
            if test "$libdir" != "/usr/lib" - a "$libdir" != "/usr/lib32"; then
                    DSOLINK="-Wl,-rpath,$libdir"
            fi
            ;;
        OSF1*)
            DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG 
-o"
            if test "$libdir" != "/usr/lib" - a "$libdir" != "/usr/lib32"; then
                    DSOLINK="-Wl,-rpath,$libdir"
            fi
            ;;
        Linux* | *BSD*)
#           DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC 
$DEBUGFLAG -o"
            DSOCOMMAND="\$(CXX) \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
            if test "$libdir" != "/usr/lib"; then
                    DSOLINK="-Wl,-rpath,$libdir"
            fi
            ;;
        AIX*)
            DSOSUFFIX="_s.a"
            DSOSYMLINK="_s.a"
            DSOCOMMAND="\$(CXX) -Wl,-bexpall,-bM:SRE,-bnoentry -o"
            SHAREDSUFFIX="_s"
            ;;
        CYGWIN*)
            AC_MSG_WARN(Shared libraries are not supported under CygWin.)
            ;;
                MINGW*)
                        DSOPREFIX=""
                        DSOSUFFIX=".dll"
                        DSOSYMLINK=""

                        PICFLAG=0
                        SHAREDSUFFIX=".dll"
                        DSOCOMMAND="\$(CXX) -Wl,--out-implib,lib\$(DSONAME).a 
-shared -DFL_SHARED -DFL_LIBRARY -DFL_IMAGES_LIBRARY -DFL_GLUT_LIBRARY 
-DFL_FORMS_LIBRARY -DFL_GL_LIBRARY $DEBUGFLAG -o"
                CFLAGS="$CFLAGS -D_WIN32"
                        CPPFLAGS="$CPPFLAGS -D_WIN32"
                CXXFLAGS="$CXXFLAGS -D_WIN32"
                        LDFLAGS="-Wl,--enable-runtime-pseudo-reloc"
                ;;
        *)
            AC_MSG_WARN(Shared libraries may not be supported.  Trying -shared 
option with compiler.)
            DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG 
-o"
            ;;
    esac

#   LINKSHARED="-L../images -lfltk2_images$SHAREDSUFFIX -L../forms 
-lfltk2_forms$SHAREDSUFFIX -L../src -lfltk2$SHAREDSUFFIX"
    LINKSHARED="-L../images -lfltk2_images$SHAREDSUFFIX -L../src 
-lfltk2$SHAREDSUFFIX"
else
    DSOCOMMAND="echo"
    DSOLINK=""
    PICFLAG=0
    SHAREDSUFFIX=""
    FLUID="fluid2"
#    LINKSHARED="-L../lib -lfltk2_images -lfltk2_forms -lfltk2"
    LINKSHARED="-L../lib -lfltk2_images -lfltk2"
fi

AC_SUBST(DSOCOMMAND)
AC_SUBST(DSOLINK)
AC_SUBST(SHAREDSUFFIX)
AC_SUBST(LINKSHARED)
AC_SUBST(FLUID)

AC_ARG_ENABLE(threads, [  --enable-threads        enable multi-threading 
support (default=yes)])

AC_ARG_WITH(optim, [  --with-optim="flags"      custom optimization flags for 
compiler])

dnl Find commands...
AC_PROG_CC
AC_PROG_CXX
dnl AC_PROG_INSTALL
AC_PATH_PROG(NROFF,nroff)
if test "$NROFF" = ""; then
    AC_PATH_PROG(GROFF,groff)
    if test "$GROFF" = ""; then
        NROFF="echo"
    else
        NROFF="$GROFF -T ascii"
    fi
fi
AC_PATH_PROG(HTMLDOC,htmldoc)

dnl How do we make libraries?
AC_PROG_RANLIB
AC_PATH_PROG(AR, ar)

if test "x$AR" = "x:"; then
    AC_MSG_ERROR(Configure could not find the library archiver, aborting.)
fi

if test "x$RANLIB" != "x:"; then
    LIBCOMMAND="$AR cr"
else
    LIBCOMMAND="$AR crs"
fi

AC_SUBST(LIBCOMMAND)

dnl Command for building themes.
THEMECOMMAND="\${CXX} -shared $DEBUGFLAG -o"
AC_SUBST(THEMECOMMAND)

dnl Architecture checks...
AC_C_BIGENDIAN

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 Does the C++ compiler support the bool type?
AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type,
    ac_cv_cxx_bool,[
        AC_LANG_SAVE
        AC_LANG_CPLUSPLUS
        AC_TRY_COMPILE([
            int f(int  x){return 1;}
            int f(char x){return 1;}
            int f(bool x){return 1;}
        ],[
            bool b = true;
            return f(b);
        ], ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no)
        AC_LANG_RESTORE
    ])

if test "$ac_cv_cxx_bool" != yes; then
    CXXFLAGS="-Dbool=char -Dfalse=0 -Dtrue=1 $CXXFLAGS"
fi

dnl Standard headers and functions...
AC_HEADER_DIRENT
AC_CHECK_HEADER(sys/select.h,AC_DEFINE(HAVE_SYS_SELECT_H))
AC_CHECK_HEADER(sys/stdtypes.h,AC_DEFINE(HAVE_SYS_SELECT_H))
AC_CHECK_FUNC(scandir,[
    if test "$uname" = SunOS -o "$uname" = QNX; then
        AC_MSG_WARN(Not using $uname scandir emulation function.)
    else
        AC_DEFINE(HAVE_SCANDIR)
    fi])

dnl String headers and functions...
AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))

AC_CHECK_FUNC(snprintf,[
    case $uname in
        HP-UX*)
            if test "$uversion" = "1020"; then
                AC_MSG_WARN(Not using built-in snprintf function because you 
are running HP-UX 10.20.)
            fi
            ;;

        OSF1*)
            if test "$uversion" = "40"; then
                AC_MSG_WARN(Not using built-in snprintf function because you 
are running Tru64 4.0.)
            fi
            ;;

        *)
            AC_DEFINE(HAVE_SNPRINTF)
            ;;
    esac],[
    case $uname in
        CYGWIN* | MINGW*)
            AC_DEFINE(HAVE_SNPRINTF)
            ;;
        *)
            ;;
    esac])

AC_CHECK_FUNC(vsnprintf,[
    case $uname in
        HP-UX*)
            if test "$uversion" = "1020"; then
                AC_MSG_WARN(Not using built-in vsnprintf function because you 
are running HP-UX 10.20.)
            fi
            ;;

        OSF1*)
            if test "$uversion" = "40"; then
                AC_MSG_WARN(Not using built-in vsnprintf function because you 
are running Tru64 4.0.)
            fi
            ;;

        *)
            AC_DEFINE(HAVE_VSNPRINTF)
            ;;
    esac],[
    case $uname in
        CYGWIN* | MINGW*)
            AC_DEFINE(HAVE_VSNPRINTF)
            ;;
        *)
            ;;
    esac])

AC_CHECK_FUNC(strcasecmp,AC_DEFINE(HAVE_STRCASECMP),[
    case $uname in
        CYGWIN* | MINGW*)
            AC_DEFINE(HAVE_STRCASECMP)
            ;;
        *)
            ;;
    esac])
AC_CHECK_FUNC(strdup,AC_DEFINE(HAVE_STRDUP))
AC_CHECK_FUNC(strncasecmp,AC_DEFINE(HAVE_STRNCASECMP),[
    case $uname in
        CYGWIN* | MINGW*)
            AC_DEFINE(HAVE_STRNCASECMP)
            ;;
        *)
            ;;
    esac])
AC_CHECK_FUNC(strlcat,AC_DEFINE(HAVE_STRLCAT))
AC_CHECK_FUNC(strlcpy,AC_DEFINE(HAVE_STRLCPY))

dnl FLTK library uses math library functions...
AC_SEARCH_LIBS(pow, m)

dnl Check for image libraries...
SAVELIBS="$LIBS"
IMAGELIBS=""

AC_ARG_ENABLE(jpeg, [  --enable-jpeg           turn on JPEG support: 
auto,no,local (default=auto)])
if test x$enable_jpeg != xno; then
        if test x$enable_jpeg != xlocal; then
                AC_CHECK_HEADER(jpeglib.h,[
                    AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,[
                        HAVE_LIBJPEG=1
                        AC_DEFINE(HAVE_LIBJPEG)
                        IMAGELIBS="$IMAGELIBS -ljpeg"
                        ])])
        fi
        if test x$HAVE_LIBJPEG != x1; then
                AC_DEFINE(HAVE_LIBJPEG)
                AC_DEFINE(HAVE_LOCAL_JPEG_H)                
                LOCAL_IMAGELIBS="$LOCAL_IMAGELIBS ../lib/libfltk2_jpeg.a"
                LOCAL_IMAGETARGETS="$LOCAL_IMAGETARGETS images/libjpeg"
                IMAGELIBS="$IMAGELIBS -lfltk2_jpeg"
        fi
fi

dnl First check for existence of zlib
dnl -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
AC_ARG_ENABLE(zlib, [  --enable-zlib           turn on ZLIB support: 
auto,no,local (default=auto)])
if test x$enable_zlib != xno; then
        if test x$enable_zlib != xlocal; then
                AC_CHECK_HEADER(zlib.h,[
                    AC_CHECK_LIB(z, gzopen,[
                        HAVE_LIBZ=1
                        AC_DEFINE(HAVE_LIBZ)
                        IMAGELIBS="$IMAGELIBS -lz"
                        LIBS="$LIBS -lz"
                        ])])
        fi
        if test x$HAVE_LIBZ != x1; then
                AC_DEFINE(HAVE_LIBZ)
                ZLIBINC="../zlib"
                LOCAL_IMAGELIBS="$LOCAL_IMAGELIBS ../lib/libfltk2_z.a"
                LOCAL_IMAGETARGETS="$LOCAL_IMAGETARGETS images/zlib"
                # fltk_z should go before fltk2_jpeg and after fltk2_png
                IMAGELIBS="-lfltk2_z $IMAGELIBS"
        fi
fi

dnl After zlib check for existence of libpng
dnl -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
AC_ARG_ENABLE(png, [  --enable-png            turn on PNG support: 
auto,no,local (default=auto)])
if test x$enable_png != xno; then
        if test x$enable_png != xlocal; then
                AC_CHECK_HEADER(png.h, AC_DEFINE(HAVE_PNG_H))
                AC_CHECK_HEADER(libpng/png.h, AC_DEFINE(HAVE_LIBPNG_PNG_H))
                if test x$ac_cv_header_png_h = xyes -o 
x$ac_cv_header_libpng_png_h = xyes; then
                    AC_CHECK_LIB(png, png_read_rows,[
                        HAVE_LIBPNG=1
                        AC_DEFINE(HAVE_LIBPNG)
                        IMAGELIBS="-lpng $IMAGELIBS"
                        LIBS="-lpng $LIBS"
                        AC_CHECK_FUNCS(png_get_valid png_set_tRNS_to_alpha)])
                fi
        fi
        if test x$HAVE_LIBPNG != x1; then
                AC_DEFINE(HAVE_LIBPNG)
                AC_DEFINE(HAVE_LOCAL_PNG_H)
                LOCAL_IMAGELIBS="$LOCAL_IMAGELIBS ../lib/libfltk2_png.a"
                LOCAL_IMAGETARGETS="$LOCAL_IMAGETARGETS images/libpng"
                IMAGELIBS=" -lfltk2_png $IMAGELIBS "
        fi
fi

AC_SUBST(ZLIBINC)
AC_SUBST(LOCAL_IMAGELIBS)
AC_SUBST(LOCAL_IMAGETARGETS)
AC_SUBST(IMAGELIBS)

dnl Restore original LIBS settings...
LIBS="$SAVELIBS"

dnl See if we need a .exe extension on executables...
AC_EXEEXT

dnl Check for pthreads for multi-threaded apps...
have_pthread=no

if test x"$enable_threads" != xno; then
    AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H))
    AC_CHECK_LIB(pthread, pthread_create)

    if test x"$ac_cv_lib_pthread_pthread_create" = xyes -a 
x$ac_cv_header_pthread_h = xyes; then
        have_pthread=yes
    else
        dnl *BSD uses -pthread option...
        AC_MSG_CHECKING([for pthread_create using -pthread])
        SAVELIBS="$LIBS"
        LIBS="-pthread $LIBS"
        AC_TRY_LINK([#include <pthread.h>],
            [pthread_create(0, 0, 0, 0);],
            LIBS="-pthread $SAVELIBS"
            have_pthread=yes,
            LIBS="$SAVELIBS")
        AC_MSG_RESULT([$have_pthread])
    fi
fi

dnl Define OS-specific stuff...
HLINKS=
POSTBUILD=:
THREADS=

case $uname in
    CYGWIN* | MINGW*)
        dnl Cygwin environment...
        CFLAGS="-mwindows -DWIN32 $CFLAGS"
        CXXFLAGS="-mwindows -DWIN32 $CXXFLAGS"
        LDFLAGS="-mwindows $LDFLAGS"
        LIBS="$LIBS -lmsimg32 -lole32 -luuid -lcomctl32 -lwsock32"
        OPTIM="$OPTIM"

        if test x$enable_gl != xno; then
            AC_CHECK_HEADER(GL/gl.h,[
                AC_DEFINE(HAVE_GL)
                GLLIB="-lopengl32"])
            AC_CHECK_HEADER(GL/glu.h,[
                AC_DEFINE(HAVE_GL_GLU_H)
                GLLIB="-lglu32 $GLLIB"])
        else
            LINKFLTKGL=""
            GLLIBNAME=""
            GLDSONAME=""
            GLDEMOS=""
        fi

        if test x$have_pthread = xyes; then
            AC_DEFINE(HAVE_PTHREAD)
            THREADS="threads.exe"
        fi

        # Don't make symlinks since Windows is not case sensitive.
        HLINKS="#"
        ;;

    Darwin*)
        # MacOS X uses Carbon for graphics...
        LIBS="$LIBS -framework Carbon -framework ApplicationServices"

        if test x$have_pthread = xyes; then
            AC_DEFINE(HAVE_PTHREAD)
            THREADS="threads"
        fi

        if test x$enable_gl != xno; then
            AC_DEFINE(HAVE_GL)
            AC_DEFINE(HAVE_GL_GLU_H)
            GLLIB="-framework AGL -framework OpenGL"
        else
            LINKFLTKGL=""
            GLLIBNAME=""
            GLDSONAME=""
            GLDEMOS=""
        fi

        # Don't make symlinks because HFS+ is not case sensitive...
        HLINKS="#"

        # Add a postbuild step after linking applications
        dnl POSTBUILD="/Developer/Tools/Rez -t APPL -o"
        dnl Check for Cairo library unless disabled...
        AC_ARG_ENABLE(cairo,[  --enable-cairo          use Cairo graphics 
(default=no)])
        if test x$enable_cairo = xyes; then
           AC_DEFINE(USE_CAIRO)
#   FIXME This part should be fixed so configure do not depend on
#   we do not rely on pkg-config . 
          LIBS="$LIBS `pkg-config --libs cairo`"
          CXXFLAGS="$CXXFLAGS `pkg-config --cflags cairo`" 
        fi
        ;;

    *)
        # All others are UNIX/X11...
        if test x$have_pthread = xyes; then
            AC_DEFINE(HAVE_PTHREAD)
            THREADS="threads"
        fi

        dnl Check for X11...
        AC_PATH_XTRA

        if test x$no_x = xyes; then
            AC_MSG_ERROR(Configure could not find required X11 libraries, 
aborting.)
        fi

        if test "x$X_PRE_LIBS" != x; then
            AC_MSG_WARN(Ignoring libraries \"$X_PRE_LIBS\" requested by 
configure.)
        fi

        LIBS="$LIBS -lXext $X_EXTRA_LIBS"
        CFLAGS="$CFLAGS$X_CFLAGS"
        CXXFLAGS="$CXXFLAGS$X_CFLAGS"
        LDFLAGS="$X_LIBS $LDFLAGS"

        if test "x$x_includes" != x; then
            ac_cpp="$ac_cpp -I$x_includes"
        fi

        dnl Check for OpenGL unless disabled...
        GLLIB=

        if test x$enable_gl != xno; then
            AC_SEARCH_LIBS(dlopen, dl)
            AC_CHECK_HEADER(GL/gl.h,[
                AC_CHECK_LIB(GL, glXMakeCurrent,[
                    AC_DEFINE(HAVE_GL)
                    GLLIB="-lGL"],[
                    AC_CHECK_LIB(MesaGL,glXMakeCurrent,[
                        AC_DEFINE(HAVE_GL)
                        GLLIB=" -lMesaGL"],,
                        -lm)],
                    -lm)])
            AC_CHECK_HEADER(GL/glu.h,[
                AC_DEFINE(HAVE_GL_GLU_H)
                if test x$ac_cv_lib_GL_glXMakeCurrent = xyes; then
                    GLLIB="-lGLU $GLLIB"
                fi
                if test x$ac_cv_lib_MesaGL_glXMakeCurrent = xyes; then
                    GLLIB="-lMesaGLU $GLLIB"
                fi])

            if test x$ac_cv_lib_GL_glXMakeCurrent != xyes -a 
x$ac_cv_lib_MesaGL_glXMakeCurrent != xyes; then
                    LINKFLTKGL=""
                    GLLIBNAME=""
                    GLDSONAME=""
                    GLDEMOS=""
            fi
        else
            LINKFLTKGL=""
            GLLIBNAME=""
            GLDSONAME=""
            GLDEMOS=""
        fi

        dnl Check for Cairo library unless disabled...
        AC_ARG_ENABLE(cairo,[  --enable-cairo          use Cairo graphics 
(default=no)])
        if test x$enable_cairo = xyes; then
          AC_DEFINE(USE_CAIRO)
          dnl FIXME This part should be fixed so configure do not depend on
          dnl we do not rely on pkg-config . 
          LIBS="$LIBS `pkg-config --libs cairo`"
          CXXFLAGS="$CXXFLAGS `pkg-config --cflags cairo`" 
        fi

        dnl X11 multithreading
        AC_ARG_ENABLE(x11multithread, [  --enable-x11multithread use 
XLockDisplay for X11 (default=no)])
        if test x$enable_x11multithread = xyes; then
          AC_DEFINE(USE_X11_MULTITHREADING)
        fi

        dnl Check for the Xft library unless disabled...
        AC_ARG_ENABLE(xft, [  --enable-xft            turn on Xft support 
(default=yes)])
        if test x$enable_xft != xno; then
          AC_PATH_PROG(FTCONFIG, freetype-config)
          if test "x$FTCONFIG" != "x:"; then
            CPPFLAGS="`$FTCONFIG --cflags` $CPPFLAGS"
            CXXFLAGS="`$FTCONFIG --cflags` $CXXFLAGS"
            ac_cpp="$ac_cpp `$FTCONFIG --cflags`"
            AC_CHECK_HEADER(
              X11/Xft/Xft.h,
              AC_CHECK_LIB(Xft, XftDrawCreate,
              AC_DEFINE(USE_XFT)
              LIBS="-lXft $LIBS")
            )
          fi
        fi

        dnl Check for the Xshm extension unless disabled...
        AC_ARG_ENABLE(xshm, [  --enable-xshm           turn on MIT-SHM support 
(default=no)])
        if test x$enable_xshm == xyes; then
          AC_CHECK_HEADER(X11/extensions/XShm.h, AC_DEFINE(USE_XSHM),,
            [#include <X11/Xlib.h>])
        fi

        dnl Check for the Xdbe extension unless disabled...
        AC_ARG_ENABLE(xdbe, [  --enable-xdbe           turn on Xdbe support 
(default=yes)])
        if test x$enable_xdbe != xno; then
          AC_CHECK_HEADER(X11/extensions/Xdbe.h, AC_DEFINE(HAVE_XDBE),,
            [#include <X11/Xlib.h>])
        fi

        dnl Check for the Xinerama extension unless disabled...
        AC_ARG_ENABLE(xinerama, [  --enable-xinerama       turn on Xinerama 
support (default=yes)])
        if test x$enable_xinerama != xno; then
          AC_CHECK_HEADER(X11/extensions/Xinerama.h,
            AC_DEFINE(USE_XINERAMA)
            LIBS="-lXinerama $LIBS",,
            [#include <X11/Xlib.h>])
        fi

        dnl Probably want a test for Xi here...
        LIBS="-lXi $LIBS"

        dnl Check for overlay visuals...
        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
            else
                ac_cv_have_overlay=no
            fi)

        if test x$ac_cv_have_overlay = xyes; then
            AC_DEFINE(HAVE_OVERLAY)
        fi

        dnl Check for iconv if the X lacks UTF-8 facilities (non-XFree86).
        AC_CHECK_LIB(X11, Xutf8LookupString,,[
            AC_CHECK_HEADERS([iconv.h],[
                AC_DEFINE(_XOPEN_SOURCE, 1)
                AC_CHECK_LIB(iconv, iconv,[
                    AC_DEFINE(HAVE_ICONV) LIBS="-liconv $LIBS"],[
                    AC_CHECK_FUNC(iconv, AC_DEFINE(HAVE_ICONV))
                ])
            ])
        ])
        ;;
esac

AC_SUBST(GLDEMOS)
AC_SUBST(GLLIB)
AC_SUBST(HLINKS)
AC_SUBST(POSTBUILD)
AC_SUBST(THREADS)

dnl Figure out the appropriate formatted man page extension...
case "$uname" in
    *BSD* | Darwin*)
        # *BSD
        CAT1EXT=0
        CAT3EXT=0
        ;;
    IRIX*)
        # SGI IRIX
        CAT1EXT=z
        CAT3EXT=z
        ;;
    *)
        # All others
        CAT1EXT=1
        CAT3EXT=3
        ;;
esac

AC_SUBST(CAT1EXT)
AC_SUBST(CAT3EXT)

dnl Fix "mandir" variable...
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then
    case "$uname" in
        *BSD* | Darwin* | Linux*)
            # *BSD, Darwin, and Linux
            mandir="\${prefix}/share/man"
            ;;
        IRIX*)
            # SGI IRIX
            mandir="\${prefix}/share/catman"
            ;;
    esac
fi

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

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

if test "$uname" = "IRIX" -a $uversion -ge 62 -a "$libdir" = 
"\${exec_prefix}/lib" -a "$exec_prefix" = "\${prefix}" -a "$prefix" = "/usr"; 
then
    libdir="/usr/lib32"
fi

dnl Define the command used to update the dependencies (this option
dnl mainly for FLTK core developers - not necessary for users)
dnl Command must write dependencies to stdout!
MAKEDEPEND="\$(CXX) -MM -DMAKEDEPEND"
AC_SUBST(MAKEDEPEND)

dnl Add warnings to compiler switches:
dnl do this last so messing with switches does not break tests

if test -n "$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
        case "$uname" in
            # do not add for Darwin as it is already linked with it
            Darwin*)
            ;;
            *)
            LIBS="$LIBS -lsupc++"
            AC_MSG_RESULT(yes)
            ;;
        esac
    esac

    if test x$uname != xDarwin; then
        CXX="$CC"
    fi

    AC_ARG_ENABLE(exceptions, [  --enable-exceptions     turn on GCC exceptions 
(default=yes)])
    if test x$enable_exceptions != xno; then
        AC_DEFINE(HAVE_EXCEPTIONS)
    else
        # See if GCC supports -fno-exceptions...
        AC_MSG_CHECKING(if GCC supports -fno-exceptions)
        OLDCFLAGS="$CFLAGS"
        CFLAGS="$CFLAGS -fno-exceptions"
        AC_TRY_COMPILE(,,            
            OPTIM="$OPTIM -fno-exceptions"
            AC_MSG_RESULT(yes),
            AC_MSG_RESULT(no))
        CFLAGS="$OLDCFLAGS"
    fi

    AC_ARG_ENABLE(rtti, [  --enable-rtti           turn on GCC rtti 
(default=yes)])
    if test x$enable_rtti != xno; then
        AC_DEFINE(HAVE_RTTI)
    else
        # See if GCC supports -fno-rtti...
        AC_MSG_CHECKING(if GCC supports -fno-rtti)
        OLDCFLAGS="$CFLAGS"
        CFLAGS="$CFLAGS -fno-rtti"
        AC_TRY_COMPILE(,,            
            OPTIM="$OPTIM -fno-rtti"
            AC_MSG_RESULT(yes),
            AC_MSG_RESULT(no))
        CFLAGS="$OLDCFLAGS"
    fi

    # Show all standard warnings + unused variables when compiling...
    OPTIM="-Wall -Wunused $OPTIM"
    # remove the following gcc warning but only on cxx files
    # (OPTIM is used by C files and will conflict under cygwin:
    CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"
    # The following additional warnings are useful for tracking down problems...
    #OPTIM="-Wshadow -Wconversion -Winline $OPTIM"

    # Set the default compiler optimizations...
    if test -z "$DEBUGFLAG"; then
        #
        # Note: Can't use -fomit-frame-pointer - prevents tools like
        #       libsafe from working!
        #
        #       Don't use -fforce-mem, -fforce-addr, or -fcaller-saves.
        #       They all seem to make either no difference or enlarge
        #       the code by a few hundred bytes.
        #
        #       "-O2" seems to be the best compromise between speed and
        #       code size.  "-O3" and higher seem to make no effective
        #       difference in the speed of the code, but does bloat the
        #       library 10+%.
        #

        if test "x$with_optim" != x; then
            OPTIM="$with_optim $OPTIM"
        else
            OPTIM="-O2 $OPTIM"
        fi
    fi

    # Generate position-independent code when needed...
    if test $PICFLAG = 1; then
        OPTIM="$OPTIM -fPIC"
    fi

    # See if we are running Solaris; if so, try the -fpermissive option...
    # This option is required on some versions of Solaris to work around
    # bugs in the X headers up through Solaris 7.
    #
    # Unlike the other compiler/optimization settings, this one is placed
    # in CFLAGS and CXXFLAGS so that fltk2-config will provide the option
    # to clients - otherwise client apps will not compile properly...
    if test "$uname" = SunOS; then
        AC_MSG_CHECKING(if GCC supports -fpermissive)

        OLDCFLAGS="$CFLAGS"
        CFLAGS="$CFLAGS -fpermissive"
        AC_TRY_COMPILE(,,
            CXXFLAGS="$CXXFLAGS -fpermissive"
            AC_MSG_RESULT(yes),
            CFLAGS="$OLDCFLAGS"
            AC_MSG_RESULT(no))
    fi
else
    case "$uname" 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 -mips3"
                #     CC="cc -n32 -mips3"
                #     LD="ld -n32 -mips3"
                #     MAKEDEPEND="CC -M"

                if test "x`grep abi=n32 /etc/compiler.defaults`" = x; then
                        AC_MSG_WARN(FOR BEST RESULTS BEFORE COMPILING: setenv 
SGI_ABI \"-n32 -mips3\")
                fi

                OPTIM="-fullwarn $OPTIM"
            fi
            if test -z "$DEBUGFLAG"; then
                if test "x$with_optim" != x; then
                    OPTIM="$with_optim $OPTIM"
                else
                    OPTIM="-O2 $OPTIM"
                    if test $uversion -gt 62; then
                        OPTIM="-OPT:Olimit=4000 $OPTIM"
                    fi
                fi
            fi
            ;;
        HP-UX*)
            # Running HP-UX; these options should work for the HP compilers.
            if test -z "$DEBUGFLAG"; then
                if test "x$with_optim" != x; then
                    OPTIM="$with_optim $OPTIM"
                else
                    OPTIM="+O2 $OPTIM"
                fi
            fi

            if test "x$with_optim" = x; then
                OPTIM="$OPTIM +DAportable"
            fi

            if test $PICFLAG = 1; then
                OPTIM="+z $OPTIM"
            fi

            OPTIM="$OPTIM +W336,501,736,740,749,829"
            ;;
        OSF1*)
            # Running Digital/Tru64 UNIX; these options should work for the
            # Digital/Compaq/NewHP compilers.
            if test -z "$DEBUGFLAG"; then
                if test "x$with_optim" != x; then
                    OPTIM="$with_optim $OPTIM"
                else
                    OPTIM="-O2 $OPTIM"
                fi
            fi
            ;;
        SunOS*)
            # Solaris
            if test -z "$DEBUGFLAG"; then
                if test "x$with_optim" != x; then
                    OPTIM="$with_optim $OPTIM"
                else
                    OPTIM="-xO3 $OPTIM"
                fi
            fi

            if test $PICFLAG = 1; then
                OPTIM="-KPIC $OPTIM"
            fi
            ;;
        AIX*)
            if test -z "$DEBUGFLAG"; then
                if test "x$with_optim" != x; then
                    OPTIM="$with_optim $OPTIM"
                else
                    OPTIM="-O2 $OPTIM"
                fi
            fi

            AC_MSG_WARN(The AIX C and C++ compilers are known not to correctly 
compile the FLTK library.)
            ;;
        *)
            # Running some other operating system; inform the user they
            # should contribute the necessary options to [EMAIL PROTECTED]
            AC_MSG_WARN(Building FLTK with default compiler optimizations)
            AC_MSG_WARN(Contact [EMAIL PROTECTED] with uname and compiler 
options.)
            ;;
    esac
fi

OPTIM="$DEBUGFLAG $OPTIM"

dnl Define the FLTK documentation directory...
if test x$prefix = xNONE; then
    AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "/usr/local/share/doc/fltk")
else
    AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "$prefix/share/doc/fltk")
fi

dnl Define the FLTK data directory...
if test x$prefix = xNONE; then
    AC_DEFINE_UNQUOTED(FLTK_DATADIR, "/usr/local/share/fltk")
else
    AC_DEFINE_UNQUOTED(FLTK_DATADIR, "$prefix/share/fltk")
fi

dnl Write all of the files...
AC_CONFIG_HEADER(config.h:configh.in)
dnl AC_CONFIG_HEADER(fltk/string.h)
AC_OUTPUT(makeinclude fltk.list fltk2-config)

dnl Make sure the fltk2-config script is executable...
chmod +x fltk2-config

echo
echo Libs:              $LIBS
echo System image libs: $IMAGELIBS
echo Local image libs:  $LOCAL_IMAGELIBS
echo OpenGL libs:       $GLLIB
echo 
echo Build targets:     $LIBTARGET $DSOTARGET
echo

dnl
dnl End of "$Id: configure.in 5936 2007-07-24 11:25:53Z spitzak $".
dnl
#!/bin/sh
#
# "$Id: fltk2-config.in 4958 2006-04-15 17:43:12Z fabien $"
# 
# FLTK configuration utility.
#
# Copyright 2000-2003 by Bill Spitzak and others.
# Original version Copyright 2000 by James Dean Palmer
# Adapted by Vincent Penne and Michael Sweet
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Please report all bugs and problems to "[EMAIL PROTECTED]".
#

[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
APIVERSION="$MAJOR_VERSION.$MINOR_VERSION"

### BEGIN fltk2-config

# First, we need to figure out where we are, in case we are in a non-installed 
invocation
# BUT to do that we need to check if we were called via a symlink or not...
# AND some systems (e.g. mingw) have neither symlinks, nor readlink, nor 
which...
HAVE_READLINK=`type -p readlink`
if test -z "$HAVE_READLINK"; then
# We don't have readlink, so just use local dir as selfdir
  selfdir=`dirname $0`
else
# We do have readlink - let us check if we were called via a symlink or not
  selfdir=`readlink $0`
  if test -n "$selfdir"; then
#   Was a symlink, find the real selfdir
    selfdir=`dirname $selfdir`
  else
#   Not a symlink, find the selfdir
    selfdir=`dirname $0`
  fi
fi

[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
exec_prefix_set=no
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@

# compiler names
CXX="@CXX@"
CC="@CC@"

# post-process command (only needed for MacOS)
POSTBUILD="@POSTBUILD@"

# flags for C++ compiler:
CFLAGS="@CFLAGS@"
CXXFLAGS="@CXXFLAGS@"
LDFLAGS="@LDFLAGS@"
LDLIBS="@LDFLAGS@ @LIBS@"

# libraries to link with:
LIBNAME="@LIBNAME@"
DSONAME="@DSONAME@"
DSOLINK="@DSOLINK@"
IMAGELIBS="@IMAGELIBS@"
SHAREDSUFFIX="@SHAREDSUFFIX@"

# Check for local invocation, and update paths accordingly...
if test -e "$selfdir/fltk/Window.h"; then
  bindir="$selfdir/fluid"
  includedir="$selfdir"
  libdir="$selfdir/lib"
  prefix="$selfdir"
        if test -f "$libdir/libfltk2_jpeg.a"; then
                CFLAGS="-I$includedir/images/jpeg $CFLAGS"
                CXXFLAGS="-I$includedir/images/jpeg $CXXFLAGS"
        fi

        if test -f "$libdir/libfltk2_z.a"; then
                CFLAGS="-I$includedir/images/zlib $CFLAGS"
                CXXFLAGS="-I$includedir/images/zlib $CXXFLAGS"
        fi

        if test -f "$libdir/libfltk2_png.a"; then
                CFLAGS="-I$includedir/images/png $CFLAGS"
                CXXFLAGS="-I$includedir/images/png $CXXFLAGS"
        fi
fi

usage ()
{
    echo "Usage: fltk2-config [OPTIONS]
Options:
        [--prefix[=DIR]]  return/set where FLTK is installed
        [--exec-prefix[=DIR]]
        [--version]
        [--api-version]

Options telling what we are doing:
        [--use-gl]        use GL
        [--use-images]    use extra image formats (PNG, JPEG)
        [--use-glut]      use glut compatibility layer
        [--use-forms]     use forms compatibility layer

Options telling what information we request:
        [--cflags]        return flags to compile C using FLTK
        [--cxxflags]      return flags to compile C++ using FLTK
        [--ldflags]       return flags to link against FLTK
        [--ldstaticflags] return flags to link against static FLTK library
                                          even if there are DSOs installed
        [--libs]          return FLTK libraries full path for dependencies
        [--cxx]           return name of C++ compiler used to build FLTK
        [--cc]            return name of C compiler used to build FLTK

Option to compile and link an application:
        [-g]              compile the program with debugging information
        [--compile program.cxx]
  [--post program]
"
    exit $1
}

if test $# -eq 0; then
    usage 1
fi

no_plugins=no
compile=
post=
debug=

# Parse command line options
while test $# -gt 0 
do
    case "$1" in
        -*=*) 
            optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
            ;;
        *)
            optarg=
            ;;
    esac

    case $1 in
        --prefix=*)
            prefix=$optarg
            if test $exec_prefix_set = no ; then
              exec_prefix=$optarg
            fi
## FIXME
#     This fixes --prefix=<path> bug - fltk2-config didn't return proper stuff
      bindir=${exec_prefix}
      includedir=${prefix}/include
      libdir=${prefix}/lib
      DSOLINK="-Wl,-rpath,${prefix}/lib"
            ;;
        --prefix)
            echo_prefix=yes
            ;;
        --exec-prefix=*)
            exec_prefix=$optarg
            exec_prefix_set=yes
            ;;
        --exec-prefix)
            echo_exec_prefix=yes
            ;;
        --version)
            echo $VERSION
            ;;
        --api-version)
            echo $APIVERSION
            ;;
        --use-gl | --use-glut)
            use_gl=yes
            ;;
        --use-forms)
            use_forms=yes
            ;;
        --use-images)
            use_images=yes
            ;;
        --cflags)
            echo_cflags=yes
            ;;
        --cxxflags)
            echo_cxxflags=yes
            ;;
        --ldflags)
            echo_ldflags=yes
            ;;
        --ldstaticflags)
            echo_ldstaticflags=yes
            ;;
        --libs)
            echo_libs=yes
            ;;
        -g)
            debug=-g
            ;;
        --compile)
            compile=$2
            post=$2
            shift
            ;;
        --cxx)
            echo_cxx_name=yes
            ;;
        --cc)
            echo_cc_name=yes
            ;;      
        --post)
            post=$2
            shift
            ;;
        *)
            echo_help=yes
            ;;
    esac
    shift
done

if test "$includedir" != /usr/include; then
    includes=-I$includedir
else
    includes=
fi

if test "$libdir" != /usr/lib -a "$libdir" != /usr/lib32; then
    libs=-L$libdir
else
    libs=
fi

###
# Some MinGW variants still need -I/usr/include and -L/usr/lib ...
#
case `uname -s` in
    MINGW*)
        if test "$includedir" == /usr/include; then
          includes=-I$includedir
        fi
        if test "$libdir" == /usr/lib; then
          libs=-L$libdir
        fi
        ;;
esac
LDSTATIC_PATHS=$libs
LDLIBS_PATHS=$libs 

# Calculate needed libraries
LDSTATIC="$libdir/libfltk2.a $LDLIBS"
LDLIBS="$libs -lfltk2$SHAREDSUFFIX $LDLIBS"

if test x$use_forms = xyes; then
    LDLIBS="-lfltk2_forms$SHAREDSUFFIX $LDLIBS"
    LDSTATIC="$libdir/libfltk2_forms.a $LDSTATIC"
fi
if test x$use_gl = xyes; then
    LDLIBS="-lfltk2_gl$SHAREDSUFFIX @GLLIB@ $LDLIBS"
    LDSTATIC="$libdir/libfltk2_gl.a @GLLIB@ $LDSTATIC"
fi
if test x$use_images = xyes; then
    LDLIBS="-lfltk2_images$SHAREDSUFFIX $IMAGELIBS $LDLIBS"
    LDSTATIC="$libdir/libfltk2_images.a $LDSTATIC $IMAGELIBS"
fi

LDLIBS="$DSOLINK $LDLIBS"
LDSTATIC="$LDSTATIC_PATHS $LDSTATIC"

# Answer to user requests
if test -n "$echo_help"; then
    usage 1
fi

if test -n "$compile"; then
    case $compile in
        *.cxx)
            prog=`basename $compile .cxx`
            ;;
        *.cpp)
            prog=`basename $compile .cpp`
            ;;
        *.cc)
            prog=`basename $compile .cc`
            ;;
        *.C)
            prog=`basename $compile .C`
            ;;
        *)
            echo "ERROR: Unknown/bad C++ source file extension on \"$compile\"!"
            exit 1
            ;;
    esac
            
    post=$prog

    echo $CXX $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC
    $CXX $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC
fi

if test -n "$post" -a "$POSTBUILD" != ":"; then
    echo $POSTBUILD $post $includedir/fltk/mac.r
    $POSTBUILD $post $includedir/fltk/mac.r
fi

if test "$echo_prefix" = "yes"; then
    echo $prefix
fi

if test "$echo_exec_prefix" = "yes"; then
    echo $exec_prefix
fi

if test "$echo_cflags" = "yes"; then
    echo $includes $CFLAGS
fi

if test "$echo_cxxflags" = "yes"; then
    echo $includes $CXXFLAGS
fi

if test "$echo_ldflags" = "yes"; then
    my_libs=
    libdirs=$libs

    for i in $LDLIBS ; do
        if test $i != -L$libdir ; then
            if test -z "$my_libs" ; then
                my_libs="$i"
            else
                my_libs="$my_libs $i"
            fi
        fi
    done
    echo $libdirs $my_libs
fi

if test "$echo_ldstaticflags" = "yes"; then
    echo $LDSTATIC
fi

if test "$echo_libs" = "yes"; then
    echo $LDLIBS
fi

if test "$echo_cc_name" = "yes"; then
    echo $CC
fi

if test "$echo_cxx_name" = "yes"; then
    echo $CXX
fi

#
# End of "$Id: fltk2-config.in 4958 2006-04-15 17:43:12Z fabien $".
#
# Makefile that uses fltkconfig
# Submitted by Ian MacArthur.
# NOTE: This makes use of new features in fltk-config 1.1.6: --cxx and --cc 
flags.
#########################################################

# Assumes FLTK2CONFIG has been set by main Makefile

# flags for compiler:
CFLAGS   = -Wall -O3 -I. $(shell $(FLTK2CONFIG) --cflags) -DFLTK2
CXXFLAGS = -Wall -O3 -I. $(shell $(FLTK2CONFIG) --cxxflags) -DFLTK2

# Possible steps after linking...
STRIP      = strip
POSTBUILD  = $(FLTK2CONFIG) --post

# libraries to link with:
LDLIBS   = -lm
LINKFLTK = $(shell $(FLTK2CONFIG) --ldstaticflags)
IMGLIB   = $(shell $(FLTK2CONFIG) --use-images --ldstaticflags)
GL_LIB   = $(shell $(FLTK2CONFIG) --use-gl --ldstaticflags)

# Other general settings
CXX     = $(shell $(FLTK2CONFIG) --cxx)
CC      = $(shell $(FLTK2CONFIG) --cc)

# now we can make specific modifications based on the operating system and host
UNAME := $(shell uname)

NATIVESRCS=Fl_Native_File_Chooser.cxx \
           Fl_Native_File_Chooser_WIN32.cxx \
           Fl_Native_File_Chooser_MAC.cxx \
           Fl_Native_File_Chooser_FLTK.cxx \
           fltk/NativeFileChooser.h \
           fltk/NativeFileChooser_WIN32.h \
           fltk/NativeFileChooser_MAC.h \
           fltk/NativeFileChooser_FLTK.h

ifeq '$(OS)' "Windows_NT"
EXE = .exe
endif # end of WIN32 options

ifeq ($(strip $(UNAME)),Linux)
EXE = 
endif # end of linux options

ifeq ($(strip $(UNAME)),Darwin)
EXE      =
LDLIBS  += -framework CoreFoundation
endif # end of OSX options

#.SILENT: # Make the build run quietly

all: test-browser-fltk2$(EXE) simple-app-fltk2$(EXE)

#########################################################
# make sure the basic rules are in place, just in case...
# Build commands and filename extensions...
.SUFFIXES: .c .cxx .cpp .cc .h .fl .o

# Rule to build an object file from a C++ source file
%.o : %.cxx
        @echo Compile [EMAIL PROTECTED]
        $(CXX) -c -o $@ $< $(CXXFLAGS)

# Rule to build an object file from a C source file
%.o : %.c
        @echo Compile [EMAIL PROTECTED]
        $(CC) -c -o $@ $< $(CFLAGS)

#########################################################
# define rules for the known targets...

NativeFileChooser.o: $(NATIVESRCS)
        $(CXX) $(CXXFLAGS) $< -c -o NativeFileChooser.o

test-browser-fltk2.o: test-browser-fltk2.cxx
        $(CXX) $(CXXFLAGS) $< -c

test-browser-fltk2$(EXE): test-browser-fltk2.o NativeFileChooser.o
        $(CXX) test-browser-fltk2.o NativeFileChooser.o $(LINKFLTK) $(IMGLIB) 
$(LDLIBS) $(IMGLIB) -o $@
        $(STRIP) $@
        $(POSTBUILD) test-browser-fltk2$(EXE)

simple-app-fltk2.o: simple-app-fltk2.cxx
        $(CXX) $(CXXFLAGS) $< -c

simple-app-fltk2$(EXE): simple-app-fltk2.o NativeFileChooser.o
        $(CXX) simple-app-fltk2.o NativeFileChooser.o $(LINKFLTK) $(IMGLIB) 
$(LDLIBS) -o $@
        $(STRIP) $@
        $(POSTBUILD) simple-app-fltk2$(EXE)

# FORCE TARGET -- Do not remove
FORCE:
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to