Skip to content
Snippets Groups Projects
Commit e450f472 authored by slevy's avatar slevy
Browse files

Revamp FLTK configuration -- use fltk-config. It tells us which libraries we...

Revamp FLTK configuration -- use fltk-config.  It tells us which libraries we need.  It also can tell us where to find libpng and libjpeg - either the versions built-in to fltk since 1.1.x, or else the system version if available.
parent b0731a57
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -22,7 +22,7 @@ dnl -- checks for system services
AC_HEADER_STDC
AC_CHECK_FUNCS(strchr memcpy snprintf strcasecmp rint sqrtf)
AC_CHECK_HEADERS(malloc.h zlib.h)
AC_CHECK_HEADERS(malloc.h zlib.h png.h jpeglib.h)
AC_FUNC_ALLOCA
AC_PROG_CC
......@@ -107,55 +107,31 @@ dnl ---------------------------------------------------------------------
dnl Check for FLTK
AC_ARG_WITH(fltk, [ --with-fltk=<d> find FLTK in -I<d>/include/FL -L<d>/lib ], with_fltk=$withval, with_fltk=/usr/local)
if test -n "$with_fltk" && test -d "$with_fltk"; then
# maybe should test both $with_fltk and the include directory therein??
case "$with_fltk" in
*/) with_fltk=`expr "$with_fltk" : '\(.*\)/$'` ;;
esac
if test -f "$with_fltk/include/FL/Fl.H"; then
FLTK_INC=-I$with_fltk/include
elif test -f "$with_fltk/FL/Fl.H"; then
FLTK_INC=-I$with_fltk
if test -f "$with_fltk/png/png.h"; then
FLTK_INC="-I$with_fltk -I$with_fltk/png -I$with_fltk/jpeg"
fi
if test -x "$with_fltk/fltk-config"; then
dnl
FLTK_INC="`$with_fltk/fltk-config --use-gl --use-images --cxxflags`"
FLTK_LIB="`$with_fltk/fltk-config --use-gl --use-images --ldflags`"
else
AC_MSG_WARN("Could not find FL/Fl.H for the fltk library")
with_fltk=""
FLTK_INC="`$with_fltk/fltk-config --use-gl --use-images --cxxflags`"
FLTK_LIB="`$with_fltk/fltk-config --use-gl --use-images --ldflags`"
fi
FLTK_LIB="-L$with_fltk/lib -lfltk"
if test -f "$with_fltk/lib/libfltk_gl.a" || \
test -f "$with_fltk/lib/libfltk_gl.so"; then
FLTK_LIB="-L$with_fltk/lib -lfltk_gl -lfltk"
fi
else
# assume the compile does -L/usr/local/lib (they don't do all....)
FLTK_INC=-I/usr/local/include
FLTK_LIB=-lfltk
AC_CHECK_LIB(fltk, fl_display,
:, AC_MSG_WARN([couldn't find fltk library]))
dnl otherwise we'd better be able to find fltk-config in $PATH somewhere
FLTK_INC="`$with_fltk/fltk-config --use-gl --use-images --cxxflags`"
FLTK_LIB="`$with_fltk/fltk-config --use-gl --use-images --ldflags`"
fi
TEMPCPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $FLTK_INC"
AC_CHECK_HEADERS(png.h jpeglib.h)
CPPFLAGS="$TEMPCPPFLAGS"
if test -f "$with_fltk/lib/libfltk_png.a"; then
FLTK_LIB="$FLTK_LIB -lfltk_png -lz"
elif test -n "$ac_cv_header_png_h"; then
# hmm, if FLTK's libfltk_png.a isn't available, how do we try with pkgconfig?
# failing that, let's just assume it's "libpng" (not e.g. libpng12)
FLTK_LIB="$FLTK_LIB -lpng -lz"
if test -z "$FLTK_INC"; then
AC_MSG_WARN("Couldn't find fltk-config -- is fltk 1.1.x (or later) installed?")
fi
if test -f "$with_fltk/lib/libfltk_jpeg.a"; then
FLTK_LIB="$FLTK_LIB -lfltk_jpeg"
elif test -n "$ac_cv_header_jpeglib_h"; then
FLTK_LIB="$FLTK_LIB -ljpeg"
fi
#----------- as of partiview 0.7.04 - marx: ------------------------------------
#we no longer support old file chooser so we deleted support for it from this file
......@@ -172,22 +148,6 @@ fi
#----------- as of partiview 0.7.04 - marx: ------------------------------------
#we no longer support old file chooser so we deleted support for it from this file
#in any event you should be on fltk release 1.1.x (not 2.x).
# the library fltk_images did not exist prior to 1.1.x used to determine relase == 1.1.x
if test -f "$with_fltk/lib/libfltk_images.a" || \
test -f "$with_fltk/lib/libfltk_images.so"; then
:
else
AC_MSG_ERROR("we do not support fltk on releases earlier than 1.1.x. you must be on fltk release 1.1.x")
fi
#----------end as of partiview 0.7.04 - marx: -----------------------------------
AC_SUBST(FLTK_INC)
AC_SUBST(FLTK_LIB)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment