* tools/tiffcrop.c: Patch from Richard Nolde to avoid a

potentially unterminated buffer due to using an exceptionally long
file name.
This commit is contained in:
Bob Friesenhahn 2010-07-13 15:51:37 +00:00
parent 548b403d10
commit 28d10ec5bd
25 changed files with 538 additions and 307 deletions

View File

@ -1,3 +1,9 @@
2010-07-13 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* tools/tiffcrop.c: Patch from Richard Nolde to avoid a
potentially unterminated buffer due to using an exceptionally long
file name.
2010-07-08 Andrey Kiselev <dron@ak4719.spb.edu>
* tools/tiff2pdf.c: Fixed ID buffer filling in

View File

@ -260,12 +260,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -220,12 +220,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

709
configure vendored
View File

@ -618,7 +618,7 @@ GL_CFLAGS
PTHREAD_CFLAGS
PTHREAD_LIBS
PTHREAD_CC
acx_pthread_config
ax_pthread_config
X_EXTRA_LIBS
X_LIBS
X_PRE_LIBS
@ -797,7 +797,6 @@ with_jpeg12_include_dir
with_jpeg12_lib
enable_cxx
with_x
with_apple_opengl_framework
enable_strip_chopping
with_default_strip_size
enable_extrasample_as_alpha
@ -1510,8 +1509,6 @@ Optional Packages:
--with-jpeg12-lib=LIBRARY
path to libjpeg 12bit library
--with-x use the X Window System
--with-apple-opengl-framework
use Apple OpenGL framework (Mac OS X only)
--with-default-strip-size=SIZE
default size of the strip in bytes (when strip
chopping enabled) [[default=8192]]
@ -17829,15 +17826,9 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
acx_pthread_ok=no
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
@ -17864,13 +17855,13 @@ return pthread_join ();
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
acx_pthread_ok=yes
ax_pthread_ok=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
$as_echo "$acx_pthread_ok" >&6; }
if test x"$acx_pthread_ok" = xno; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
$as_echo "$ax_pthread_ok" >&6; }
if test x"$ax_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
@ -17878,54 +17869,26 @@ $as_echo "$acx_pthread_ok" >&6; }
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case "${host_cpu}-${host_os}" in
*solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthread or
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
;;
*-darwin*)
ax_pthread_flags="-pthread $ax_pthread_flags"
;;
esac
if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do
if test x"$ax_pthread_ok" = xno; then
for flag in $ax_pthread_flags; do
case $flag in
none)
@ -17944,11 +17907,11 @@ $as_echo_n "checking whether pthreads work with $flag... " >&6; }
set dummy pthread-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_acx_pthread_config+set}" = set; then :
if test "${ac_cv_prog_ax_pthread_config+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$acx_pthread_config"; then
ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test.
if test -n "$ax_pthread_config"; then
ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@ -17957,7 +17920,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_acx_pthread_config="yes"
ac_cv_prog_ax_pthread_config="yes"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@ -17965,20 +17928,20 @@ done
done
IFS=$as_save_IFS
test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no"
test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
fi
fi
acx_pthread_config=$ac_cv_prog_acx_pthread_config
if test -n "$acx_pthread_config"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5
$as_echo "$acx_pthread_config" >&6; }
ax_pthread_config=$ac_cv_prog_ax_pthread_config
if test -n "$ax_pthread_config"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
$as_echo "$ax_pthread_config" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test x"$acx_pthread_config" = xno; then continue; fi
if test x"$ax_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
@ -17995,30 +17958,26 @@ $as_echo_n "checking for the pthreads library -l$flag... " >&6; }
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
static void routine(void* a) {a=0;}
static void* start_routine(void* a) {return a;}
int
main ()
{
pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0);
pthread_t th; pthread_attr_t attr;
pthread_create(&th,0,start_routine,0);
pthread_join(th, 0);
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
acx_pthread_ok=yes
ax_pthread_ok=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
@ -18026,9 +17985,9 @@ rm -f core conftest.err conftest.$ac_objext \
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
$as_echo "$acx_pthread_ok" >&6; }
if test "x$acx_pthread_ok" = xyes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
$as_echo "$ax_pthread_ok" >&6; }
if test "x$ax_pthread_ok" = xyes; then
break;
fi
@ -18037,15 +17996,13 @@ $as_echo "$acx_pthread_ok" >&6; }
done
fi
# Various other checks:
if test "x$acx_pthread_ok" = xyes; then
if test "x$ax_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
$as_echo_n "checking for joinable pthread attribute... " >&6; }
attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
@ -18055,7 +18012,7 @@ $as_echo_n "checking for joinable pthread attribute... " >&6; }
int
main ()
{
int attr=$attr;
int attr=$attr; return attr;
;
return 0;
}
@ -18092,9 +18049,11 @@ $as_echo "${flag}" >&6; }
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with cc_r
# Extract the first word of "cc_r", so it can be a program name with args.
set dummy cc_r; ac_word=$2
if test x"$GCC" != xyes; then
for ac_prog in xlc_r cc_r
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then :
@ -18110,7 +18069,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_PTHREAD_CC="cc_r"
ac_cv_prog_PTHREAD_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@ -18118,7 +18077,6 @@ done
done
IFS=$as_save_IFS
test -z "$ac_cv_prog_PTHREAD_CC" && ac_cv_prog_PTHREAD_CC="${CC}"
fi
fi
PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
@ -18131,6 +18089,13 @@ $as_echo "no" >&6; }
fi
test -n "$PTHREAD_CC" && break
done
test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}"
else
PTHREAD_CC=$CC
fi
else
PTHREAD_CC="$CC"
fi
@ -18139,14 +18104,13 @@ fi
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then
if test x"$ax_pthread_ok" = xyes; then
$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
:
else
acx_pthread_ok=no
ax_pthread_ok=no
fi
ac_ext=c
@ -18157,31 +18121,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#
# There isn't a reliable way to know we should use the Apple OpenGL framework
# without a configure option. A Mac OS X user may have installed an
# alternative GL implementation (e.g., Mesa), which may or may not depend on X.
#
# Check whether --with-apple-opengl-framework was given.
if test "${with_apple_opengl_framework+set}" = set; then :
withval=$with_apple_opengl_framework;
fi
if test "X$with_apple_opengl_framework" = "Xyes"; then
$as_echo "#define HAVE_APPLE_OPENGL_FRAMEWORK 1" >>confdefs.h
GL_LIBS="-framework OpenGL"
else
ac_ext=c
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Microsoft C compiler" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Microsoft C compiler" >&5
$as_echo_n "checking whether we are using the Microsoft C compiler... " >&6; }
if test "${ax_cv_c_compiler_ms+set}" = set; then :
$as_echo_n "(cached) " >&6
@ -18211,25 +18158,38 @@ ax_cv_c_compiler_ms=$ax_compiler_ms
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_ms" >&5
$as_echo "$ax_cv_c_compiler_ms" >&6; }
if test X$ax_compiler_ms = Xno; then
GL_CFLAGS="${PTHREAD_CFLAGS}"
GL_LIBS="${PTHREAD_LIBS} -lm"
fi
if test X$ax_compiler_ms = Xno; then :
GL_CFLAGS="${PTHREAD_CFLAGS}"; GL_LIBS="${PTHREAD_LIBS} -lm"
fi
#
# Use x_includes and x_libraries if they have been set (presumably by
# AC_PATH_X).
#
if test "X$no_x" != "Xyes"; then
if test -n "$x_includes"; then
GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"
fi
if test -n "$x_libraries"; then
GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"
fi
fi
if test "X$no_x" != "Xyes"; then :
if test -n "$x_includes"; then :
GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"
fi
if test -n "$x_libraries"; then :
GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"
fi
fi
for ac_header in windows.h
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
for ac_header in GL/gl.h OpenGL/gl.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
eval as_val=\$$as_ac_Header
if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
CPPFLAGS="${ax_save_CPPFLAGS}"
for ac_header in windows.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
if test "x$ac_cv_header_windows_h" = x""yes; then :
@ -18242,31 +18202,43 @@ fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL library" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL library" >&5
$as_echo_n "checking for OpenGL library... " >&6; }
if test "${ax_cv_check_gl_libgl+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ax_cv_check_gl_libgl="no"
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
ax_save_LIBS="${LIBS}"
LIBS=""
ax_check_libs="-lopengl32 -lGL"
for ax_lib in ${ax_check_libs}; do
if test X$ax_compiler_ms = Xyes; then
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
else
ax_try_lib="${ax_lib}"
fi
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
case $host_cpu in
x86_64) ax_check_gl_libdir=lib64 ;;
*) ax_check_gl_libdir=lib ;;
esac
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
ax_save_LIBS="${LIBS}"
LIBS=""
ax_check_libs="-lopengl32 -lGL"
for ax_lib in ${ax_check_libs}; do
if test X$ax_compiler_ms = Xyes; then :
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
else
ax_try_lib="${ax_lib}"
fi
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# if HAVE_WINDOWS_H && defined(_WIN32)
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
# include <windows.h>
# endif
# include <GL/gl.h>
# ifdef HAVE_GL_GL_H
# include <GL/gl.h>
# elif defined(HAVE_OPENGL_GL_H)
# include <OpenGL/gl.h>
# else
# error no gl.h
# endif
int
main ()
{
@ -18277,23 +18249,158 @@ glBegin(0)
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ax_cv_check_gl_libgl="${ax_try_lib}"; break
else
ax_check_gl_nvidia_flags="-L/usr/${ax_check_gl_libdir}/nvidia" LIBS="${ax_try_lib} ${ax_check_gl_nvidia_flags} ${GL_LIBS} ${ax_save_LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
# include <windows.h>
# endif
# ifdef HAVE_GL_GL_H
# include <GL/gl.h>
# elif defined(HAVE_OPENGL_GL_H)
# include <OpenGL/gl.h>
# else
# error no gl.h
# endif
int
main ()
{
glBegin(0)
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_nvidia_flags}"; break
else
ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' LIBS="${ax_try_lib} ${ax_check_gl_dylib_flag} ${GL_LIBS} ${ax_save_LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
# include <windows.h>
# endif
# ifdef HAVE_GL_GL_H
# include <GL/gl.h>
# elif defined(HAVE_OPENGL_GL_H)
# include <OpenGL/gl.h>
# else
# error no gl.h
# endif
int
main ()
{
glBegin(0)
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_dylib_flag}"; break
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
done
LIBS=${ax_save_LIBS}
CPPFLAGS=${ax_save_CPPFLAGS}
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
done
if test "X$ax_cv_check_gl_libgl" = Xno -a "X$no_x" = Xyes; then :
LIBS='-framework OpenGL'
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
# include <windows.h>
# endif
# ifdef HAVE_GL_GL_H
# include <GL/gl.h>
# elif defined(HAVE_OPENGL_GL_H)
# include <OpenGL/gl.h>
# else
# error no gl.h
# endif
int
main ()
{
glBegin(0)
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ax_cv_check_gl_libgl="$LIBS"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
LIBS=${ax_save_LIBS}
CPPFLAGS=${ax_save_CPPFLAGS}
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_libgl" >&5
$as_echo "$ax_cv_check_gl_libgl" >&6; }
if test "X${ax_cv_check_gl_libgl}" = "Xno"; then
no_gl="yes"
GL_CFLAGS=""
GL_LIBS=""
else
GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"
fi
if test "X$ax_cv_check_gl_libgl" = Xno; then :
no_gl=yes; GL_CFLAGS=""; GL_LIBS=""
else
GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
GLU_CFLAGS="${GL_CFLAGS}"
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
for ac_header in GL/glu.h OpenGL/glu.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
eval as_val=\$$as_ac_Header
if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
CPPFLAGS="${ax_save_CPPFLAGS}"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility library" >&5
$as_echo_n "checking for OpenGL Utility library... " >&6; }
if test "${ax_cv_check_glu_libglu+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ax_cv_check_glu_libglu="no"
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
ax_save_LIBS="${LIBS}"
LIBS="${GL_LIBS} ${ax_save_LIBS}"
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test X$ax_compiler_ms = Xyes; then :
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@ -18301,57 +18408,52 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
GLU_CFLAGS="${GL_CFLAGS}"
if test "X${with_apple_opengl_framework}" != "Xyes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility library" >&5
$as_echo_n "checking for OpenGL Utility library... " >&6; }
if test "${ax_cv_check_glu_libglu+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ax_cv_check_glu_libglu="no"
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
ax_save_LIBS="${LIBS}"
LIBS=""
ax_check_libs="-lglu32 -lGLU"
for ax_lib in ${ax_check_libs}; do
if test X$ax_compiler_ms = Xyes; then
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
else
ax_try_lib="${ax_lib}"
fi
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
#
# libGLU typically links with libstdc++ on POSIX platforms. However,
# setting the language to C++ means that test program source is named
# "conftest.cc"; and Microsoft cl doesn't know what to do with such a
# file.
#
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test X$ax_compiler_ms = Xyes; then
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# if HAVE_WINDOWS_H && defined(_WIN32)
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
# include <windows.h>
# endif
# include <GL/glu.h>
# ifdef HAVE_GL_GLU_H
# include <GL/glu.h>
# elif defined(HAVE_OPENGL_GLU_H)
# include <OpenGL/glu.h>
# else
# error no glu.h
# endif
int
main ()
{
gluBeginCurve(0)
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ax_cv_check_glu_libglu=yes
else
LIBS=""
ax_check_libs="-lglu32 -lGLU"
for ax_lib in ${ax_check_libs}; do
if test X$ax_compiler_ms = Xyes; then :
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
else
ax_try_lib="${ax_lib}"
fi
LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
# include <windows.h>
# endif
# ifdef HAVE_GL_GLU_H
# include <GL/glu.h>
# elif defined(HAVE_OPENGL_GLU_H)
# include <OpenGL/glu.h>
# else
# error no glu.h
# endif
int
main ()
{
@ -18365,85 +18467,148 @@ if ac_fn_c_try_link "$LINENO"; then :
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test X$ax_compiler_ms = Xyes; then
ac_ext=cpp
done
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test X$ax_compiler_ms = Xyes; then :
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
fi
ac_ext=c
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
done
LIBS=${ax_save_LIBS}
CPPFLAGS=${ax_save_CPPFLAGS}
LIBS=${ax_save_LIBS}
CPPFLAGS=${ax_save_CPPFLAGS}
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_libglu" >&5
$as_echo "$ax_cv_check_glu_libglu" >&6; }
if test "X${ax_cv_check_glu_libglu}" = "Xno"; then
no_glu="yes"
GLU_CFLAGS=""
GLU_LIBS=""
else
GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"
fi
if test "X$ax_cv_check_glu_libglu" = Xno; then :
no_glu=yes; GLU_CFLAGS=""; GLU_LIBS=""
else
if test "X$ax_cv_check_glu_libglu" = Xyes; then :
GLU_LIBS="$GL_LIBS"
else
GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"
fi
fi
if test "X$with_apple_opengl_framework" = "Xyes"; then
GLUT_CFLAGS="${GLU_CFLAGS}"
GLUT_LIBS="-framework GLUT -lobjc ${GL_LIBS}"
if test "X$ax_cv_check_glu_libglu" != Xno; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for varargs GLU tesselator callback function type" >&5
$as_echo_n "checking for varargs GLU tesselator callback function type... " >&6; }
if test "${ax_cv_varargs_glu_tesscb+set}" = set; then :
$as_echo_n "(cached) " >&6
else
GLUT_CFLAGS=${GLU_CFLAGS}
GLUT_LIBS=${GLU_LIBS}
ax_cv_varargs_glu_tesscb=no
ax_save_CFLAGS="$CFLAGS"
CFLAGS="$GL_CFLAGS $CFLAGS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#
# If X is present, assume GLUT depends on it.
#
if test "X${no_x}" != "Xyes"; then
GLUT_LIBS="${X_PRE_LIBS} -lXmu -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}"
fi
# ifdef HAVE_GL_GLU_H
# include <GL/glu.h>
# else
# include <OpenGL/glu.h>
# endif
int
main ()
{
GLvoid (*func)(...); gluTessCallback(0, 0, func)
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_varargs_glu_tesscb=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$ax_save_CFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_varargs_glu_tesscb" >&5
$as_echo "$ax_cv_varargs_glu_tesscb" >&6; }
if test X$ax_cv_varargs_glu_tesscb = Xyes; then :
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
$as_echo "#define HAVE_VARARGS_GLU_TESSCB 1" >>confdefs.h
fi
fi
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}"
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GLU_CFLAGS} ${CPPFLAGS}"
for ac_header in GL/glut.h GLUT/glut.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
eval as_val=\$$as_ac_Header
if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLUT library" >&5
fi
done
CPPFLAGS="${ax_save_CPPFLAGS}"
GLUT_CFLAGS=${GLU_CFLAGS}
GLUT_LIBS=${GLU_LIBS}
if test X$no_x != Xyes; then :
GLUT_LIBS="${X_PRE_LIBS} -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLUT library" >&5
$as_echo_n "checking for GLUT library... " >&6; }
if test "${ax_cv_check_glut_libglut+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ax_cv_check_glut_libglut="no"
ax_save_LIBS="${LIBS}"
LIBS=""
ax_check_libs="-lglut32 -lglut"
for ax_lib in ${ax_check_libs}; do
if test X$ax_compiler_ms = Xyes; then
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
else
ax_try_lib="${ax_lib}"
fi
LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ax_save_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}"
ax_save_LIBS="${LIBS}"
LIBS=""
ax_check_libs="-lglut32 -lglut"
for ax_lib in ${ax_check_libs}; do
if test X$ax_compiler_ms = Xyes; then :
ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
else
ax_try_lib="${ax_lib}"
fi
LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# if HAVE_WINDOWS_H && defined(_WIN32)
# include <windows.h>
# endif
# include <GL/glut.h>
# ifdef HAVE_GL_GLUT_H
# include <GL/glut.h>
# elif defined(HAVE_GLUT_GLUT_H)
# include <GLUT/glut.h>
# else
# error no glut.h
# endif
int
main ()
{
@ -18457,28 +18622,54 @@ if ac_fn_c_try_link "$LINENO"; then :
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
done
done
LIBS=${ax_save_LIBS}
if test "X$ax_cv_check_glut_libglut" = Xno -a "X$no_x" = Xyes; then :
LIBS='-framework GLUT'
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# if HAVE_WINDOWS_H && defined(_WIN32)
# include <windows.h>
# endif
# ifdef HAVE_GL_GLUT_H
# include <GL/glut.h>
# elif defined(HAVE_GLUT_GLUT_H)
# include <GLUT/glut.h>
# else
# error no glut.h
# endif
int
main ()
{
glutMainLoop()
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ax_cv_check_glut_libglut="$LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_libglut" >&5
$as_echo "$ax_cv_check_glut_libglut" >&6; }
CPPFLAGS="${ax_save_CPPFLAGS}"
ac_ext=c
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
CPPFLAGS="${ax_save_CPPFLAGS}"
LIBS="${ax_save_LIBS}"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_libglut" >&5
$as_echo "$ax_cv_check_glut_libglut" >&6; }
if test "X${ax_cv_check_glut_libglut}" = "Xno"; then
no_glut="yes"
GLUT_CFLAGS=""
GLUT_LIBS=""
else
GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}"
fi
if test "X$ax_cv_check_glut_libglut" = Xno; then :
no_glut="yes"; GLUT_CFLAGS=""; GLUT_LIBS=""
else
GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}"
fi

View File

@ -219,12 +219,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -211,12 +211,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -260,12 +260,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -182,12 +182,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -210,12 +210,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -179,12 +179,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -179,12 +179,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -179,12 +179,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -179,12 +179,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -179,12 +179,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -179,12 +179,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -245,12 +245,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -204,12 +204,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -204,12 +204,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -285,12 +285,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -18,9 +18,6 @@
packages produce RGBA files but don't mark the alpha properly. */
#undef DEFAULT_EXTRASAMPLE_AS_ALPHA
/* Use the Apple OpenGL framework. */
#undef HAVE_APPLE_OPENGL_FRAMEWORK
/* Define to 1 if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
@ -36,6 +33,18 @@
/* Define to 1 if you have the `getopt' function. */
#undef HAVE_GETOPT
/* Define to 1 if you have the <GLUT/glut.h> header file. */
#undef HAVE_GLUT_GLUT_H
/* Define to 1 if you have the <GL/glut.h> header file. */
#undef HAVE_GL_GLUT_H
/* Define to 1 if you have the <GL/glu.h> header file. */
#undef HAVE_GL_GLU_H
/* Define to 1 if you have the <GL/gl.h> header file. */
#undef HAVE_GL_GL_H
/* Define as 0 or 1 according to the floating point format suported by the
machine */
#undef HAVE_IEEEFP
@ -88,6 +97,12 @@
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
/* Define to 1 if you have the <OpenGL/glu.h> header file. */
#undef HAVE_OPENGL_GLU_H
/* Define to 1 if you have the <OpenGL/gl.h> header file. */
#undef HAVE_OPENGL_GL_H
/* Define to 1 if you have the `pow' function. */
#undef HAVE_POW
@ -148,6 +163,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Use nonstandard varargs form for the GLU tesselator callback */
#undef HAVE_VARARGS_GLU_TESSCB
/* Define to 1 if you have the <windows.h> header file. */
#undef HAVE_WINDOWS_H

View File

@ -206,12 +206,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -210,12 +210,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -312,12 +312,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -320,12 +320,12 @@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
acx_pthread_config = @acx_pthread_config@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@

View File

@ -1,4 +1,4 @@
/* $Id: tiffcrop.c,v 1.18 2010-06-16 01:54:48 bfriesen Exp $ */
/* $Id: tiffcrop.c,v 1.19 2010-07-13 15:51:39 bfriesen Exp $ */
/* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of
* the image data through additional options listed below
@ -6,16 +6,16 @@
* Original code:
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
* Additions (c) Richard Nolde 2006-2009
* Additions (c) Richard Nolde 2006-2010
*
* Permission to use, copy, modify, distribute, and sell this software and
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
@ -108,7 +108,7 @@
*/
static char tiffcrop_version_id[] = "2.3";
static char tiffcrop_rev_date[] = "06-15-2010";
static char tiffcrop_rev_date[] = "07-12-2010";
#include "tif_config.h"
#include "tiffiop.h"
@ -149,13 +149,14 @@ extern int getopt(int, char**, char*);
#endif
#define strneq(a,b,n) (strncmp((a),(b),(n)) == 0)
/* NB: the uint32 casts are to silence certain ANSI-C compilers */
#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y)))
#define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
#define TRUE 1
#define FALSE 0
#ifndef TIFFhowmany
#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y)))
#define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
#endif
/*
* Definitions and data structures required to support cropping and image
* manipulations.
@ -204,6 +205,7 @@ extern int getopt(int, char**, char*);
#define MAX_IMAGES 2048 /* number of images in descrete list, not in the file */
#define MAX_SAMPLES 8 /* maximum number of samples per pixel supported */
#define MAX_BITS_PER_SAMPLE 64 /* maximum bit depth supported */
#define MAX_EXPORT_PAGES 999999 /* maximum number of export pages per file */
#define DUMP_NONE 0
#define DUMP_TEXT 1
@ -1674,9 +1676,6 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
(opt_ptr = strtok (NULL, ",")), i++)
{
opt_offset = strpbrk(opt_ptr, ":=");
/*
opt_offset = strchr(opt_ptr, ':');
*/
if (opt_offset == NULL)
{
TIFFError("Invalid dump option", "%s", optarg);
@ -1721,12 +1720,18 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
{ /* Look for dump level specification */
if (strncmp (opt_ptr, "lev", 3) == 0)
dump->level = atoi(opt_offset + 1);
/* Look for input data dump file name */
/* Look for input data dump file name */
if (strncmp (opt_ptr, "in", 2) == 0)
{
strncpy (dump->infilename, opt_offset + 1, PATH_MAX - 20);
/* Look for output data dump file name */
dump->infilename[PATH_MAX - 20] = '\0';
}
/* Look for output data dump file name */
if (strncmp (opt_ptr, "out", 3) == 0)
strncpy (dump->outfilename, opt_offset + 1, PATH_MAX - 20);
{
strncpy (dump->outfilename, opt_offset + 1, PATH_MAX - 20);
dump->outfilename[PATH_MAX - 20] = '\0';
}
if (strncmp (opt_ptr, "deb", 3) == 0)
dump->debug = atoi(opt_offset + 1);
}
@ -2035,7 +2040,6 @@ update_output_file (TIFF **tiffout, char *mode, int autoindex,
char export_ext[16];
char exportname[PATH_MAX];
strcpy (export_ext, ".tiff");
if (autoindex && (*tiffout != NULL))
{
/* Close any export file that was previously opened */
@ -2043,7 +2047,11 @@ update_output_file (TIFF **tiffout, char *mode, int autoindex,
*tiffout = NULL;
}
strncpy (exportname, outname, PATH_MAX - 15);
strcpy (export_ext, ".tiff");
memset (exportname, '\0', PATH_MAX);
/* Leave room for page number portion of the new filename */
strncpy (exportname, outname, PATH_MAX - 16);
if (*tiffout == NULL) /* This is a new export file */
{
if (autoindex)
@ -2057,13 +2065,21 @@ update_output_file (TIFF **tiffout, char *mode, int autoindex,
else
strncpy (export_ext, ".tiff", 5);
export_ext[5] = '\0';
sprintf (filenum, "-%03d%s", findex, export_ext);
filenum[15] = '\0';
strncat (exportname, filenum, 14);
}
*tiffout = TIFFOpen(exportname, mode);
/* MAX_EXPORT_PAGES limited to 6 digits to prevent string overflow of pathname */
if (findex > MAX_EXPORT_PAGES)
{
TIFFError("update_output_file", "Maximum of %d pages per file exceeded.\n", MAX_EXPORT_PAGES);
return 1;
}
sprintf (filenum, "-%03d%s", findex, export_ext);
filenum[14] = '\0';
strncat (exportname, filenum, 15);
}
exportname[PATH_MAX - 1] = '\0';
*tiffout = TIFFOpen(exportname, mode);
if (*tiffout == NULL)
{
TIFFError("update_output_file", "Unable to open output file %s\n", exportname);