From 1027575e50728bbe1be64075cbfb9a0ecec6dd50 Mon Sep 17 00:00:00 2001 From: g Date: Sat, 30 Aug 2003 15:51:50 +0000 Subject: [PATCH] gliv-1.0.2 git-svn-id: file:///srv/svn/gliv/trunk@3 dbf4865f-1ec6-0310-8412-f61adeb1ccb1 committer: g --- Makefile.am | 6 + Makefile.in | 10 +- NEWS | 13 +- README | 10 +- aclocal.m4 | 2 +- configure | 458 ++++++++++++++++++++++++++++---------------------------- configure.in | 41 +++-- event.c | 59 ++++---- gliv.1 | 2 +- gliv.c | 96 +++++++----- gliv.h | 17 +-- gliv.list | 20 +++ help.c | 60 ++++---- help2c.c | 6 +- loading.c | 7 +- many_textures.c | 2 +- one_texture.c | 10 +- rendering.c | 34 ++--- setup.c | 111 +++++++++----- 19 files changed, 532 insertions(+), 432 deletions(-) create mode 100644 gliv.list rewrite help.c (92%) diff --git a/Makefile.am b/Makefile.am index 54ccd1e..ee4bd4f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,4 +18,10 @@ cmdline.c: gliv.ggo sed 's/\[FILES\]/FILES/g' < cmdline.c > cmdline.tmp.c mv -f cmdline.tmp.c cmdline.c +rpm: gliv + epm -f rpm gliv + +deb: gliv + epm -f deb gliv + AUTOMAKE_OPTIONS = foreign diff --git a/Makefile.in b/Makefile.in index 2e8f47a..3c42006 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4-p2 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -131,7 +131,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) $(ACLOCAL_M4): configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) @@ -423,6 +423,12 @@ cmdline.c: gliv.ggo sed 's/\[FILES\]/FILES/g' < cmdline.c > cmdline.tmp.c mv -f cmdline.tmp.c cmdline.c +rpm: gliv + epm -f rpm gliv + +deb: gliv + epm -f deb gliv + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/NEWS b/NEWS index 2291d11..7f929ce 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,16 @@ +1.0.2 +~~~~~ + +* Added binary package support using EPM. +* Now, GLiv can be used with no WM running. +* Better handle of dirty exit. +* The -m flag is used in window mode too. +* Several 'gliv -s' launched at the same time will have different +slideshow orders. + + 1.0.1 -~~~ +~~~~~ * Less recomputations of the projection. * Image cleared to avoid display of memory garbage. diff --git a/README b/README index e9a40ec..186cf94 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ -gliv +GLiv ---- -gliv is an image viewer that uses Imlib2 to +GLiv is an image viewer that uses Imlib2 to load images, and OpenGL to render them. Moving and zooming is very fast and smooth if you have an OpenGL board. @@ -17,10 +17,8 @@ Requirements Compilation ----------- -Modify the gliv.h as you want. -Then './configure && make'. -Of course you can change the prefix path for -'./configure'. +Modify the file gliv.h as you like and then +'./configure && make', with your prefix. Installation diff --git a/aclocal.m4 b/aclocal.m4 index bc12e04..c31b171 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -dnl ./aclocal.m4 generated automatically by aclocal 1.4-p2 +dnl aclocal.m4 generated automatically by aclocal 1.4-p4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation diff --git a/configure b/configure index 0102584..c41e793 100755 --- a/configure +++ b/configure @@ -1104,7 +1104,7 @@ fi PACKAGE=gliv -VERSION="1.0.1 Guillaume Chazarain " +VERSION="1.0.2 Guillaume Chazarain " if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:1110: error: source directory already configured; run \"make distclean\" there first" >&5 @@ -1940,35 +1940,17 @@ if test x$ac_test_CFLAGS = x; then CFLAGS="-pipe -O3 -fomit-frame-pointer" fi fi - CFLAGS="-Wall -D_REENTRANT -D_THREAD_SAFE $CFLAGS" - if test "x$LDFLAGS" = x; then LDFLAGS="-Wl,-O1" fi -echo -n checking for Imlib2... -if imlib2-config --version &> /dev/null;then - CFLAGS="$CFLAGS `imlib2-config --cflags`" - LDFLAGS="$LDFLAGS `imlib2-config --libs`" - echo " found (version `imlib2-config --version`)" -else - echo " not found" - echo - echo If you have installed Imlib2, - echo make sure imlib2-config is in - echo your\ \$PATH, which contains : - echo $PATH - echo - exit 1 -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 -echo "$as_me:1971: checking how to run the C preprocessor" >&5 +echo "$as_me:1953: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then @@ -1990,18 +1972,18 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line 1993 "configure" +#line 1975 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:1998: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:1980: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2004: \$? = $ac_status" >&5 + echo "$as_me:1986: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2024,17 +2006,17 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line 2027 "configure" +#line 2009 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2031: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2013: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2037: \$? = $ac_status" >&5 + echo "$as_me:2019: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2071,7 +2053,7 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:2074: result: $CPP" >&5 +echo "$as_me:2056: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -2081,18 +2063,18 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line 2084 "configure" +#line 2066 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2089: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2071: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2095: \$? = $ac_status" >&5 + echo "$as_me:2077: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2115,17 +2097,17 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line 2118 "configure" +#line 2100 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2122: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2104: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2128: \$? = $ac_status" >&5 + echo "$as_me:2110: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2153,7 +2135,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:2156: error: C preprocessor \"$CPP\" fails sanity check" >&5 + { { echo "$as_me:2138: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -2171,23 +2153,23 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu for ac_header in pthread.h do ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh` -echo "$as_me:2174: checking for $ac_header" >&5 +echo "$as_me:2156: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$ac_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2180 "configure" +#line 2162 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:2184: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2166: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2190: \$? = $ac_status" >&5 + echo "$as_me:2172: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2206,7 +2188,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:2209: result: `eval echo '${'$ac_ac_Header'}'`" >&5 +echo "$as_me:2191: result: `eval echo '${'$ac_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6 if test `eval echo '${'$ac_ac_Header'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:2207: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$ac_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2231 "configure" +#line 2213 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:2235: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2217: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2241: \$? = $ac_status" >&5 + echo "$as_me:2223: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2257,7 +2239,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:2260: result: `eval echo '${'$ac_ac_Header'}'`" >&5 +echo "$as_me:2242: result: `eval echo '${'$ac_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6 if test `eval echo '${'$ac_ac_Header'}'` = yes; then cat >>confdefs.h <conftest.$ac_ext <<_ACEOF -#line 2285 "configure" +#line 2267 "configure" #include "confdefs.h" #include @@ -2301,15 +2283,15 @@ int main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:2304: \"$ac_link\"") >&5 +if { (eval echo "$as_me:2286: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:2307: \$? = $ac_status" >&5 + echo "$as_me:2289: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:2309: \"$ac_try\"") >&5 + { (eval echo "$as_me:2291: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2312: \$? = $ac_status" >&5 + echo "$as_me:2294: \$? = $ac_status" >&5 (exit $ac_status); }; }; then pthreads_working="yes" @@ -2325,7 +2307,7 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:2328: checking for pthreads_cflags" >&5 +echo "$as_me:2310: checking for pthreads_cflags" >&5 echo $ECHO_N "checking for pthreads_cflags... $ECHO_C" >&6 if test "${ac_cv_pthreads_cflags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2341,7 +2323,7 @@ if test "$cross_compiling" = yes; then pthreads_working="no" else cat >conftest.$ac_ext <<_ACEOF -#line 2344 "configure" +#line 2326 "configure" #include "confdefs.h" #include @@ -2360,15 +2342,15 @@ int main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:2363: \"$ac_link\"") >&5 +if { (eval echo "$as_me:2345: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:2366: \$? = $ac_status" >&5 + echo "$as_me:2348: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:2368: \"$ac_try\"") >&5 + { (eval echo "$as_me:2350: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2371: \$? = $ac_status" >&5 + echo "$as_me:2353: \$? = $ac_status" >&5 (exit $ac_status); }; }; then pthreads_working="yes" @@ -2394,10 +2376,10 @@ fi fi fi -echo "$as_me:2397: result: $ac_cv_pthreads_cflags" >&5 +echo "$as_me:2379: result: $ac_cv_pthreads_cflags" >&5 echo "${ECHO_T}$ac_cv_pthreads_cflags" >&6 -echo "$as_me:2400: checking for pthreads_lib" >&5 +echo "$as_me:2382: checking for pthreads_lib" >&5 echo $ECHO_N "checking for pthreads_lib... $ECHO_C" >&6 if test "${ac_cv_pthreads_lib+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2413,7 +2395,7 @@ if test "$cross_compiling" = yes; then pthreads_working="no" else cat >conftest.$ac_ext <<_ACEOF -#line 2416 "configure" +#line 2398 "configure" #include "confdefs.h" #include @@ -2432,15 +2414,15 @@ int main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:2435: \"$ac_link\"") >&5 +if { (eval echo "$as_me:2417: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:2438: \$? = $ac_status" >&5 + echo "$as_me:2420: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:2440: \"$ac_try\"") >&5 + { (eval echo "$as_me:2422: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2443: \$? = $ac_status" >&5 + echo "$as_me:2425: \$? = $ac_status" >&5 (exit $ac_status); }; }; then pthreads_working="yes" @@ -2465,7 +2447,7 @@ fi fi fi -echo "$as_me:2468: result: $ac_cv_pthreads_lib" >&5 +echo "$as_me:2450: result: $ac_cv_pthreads_lib" >&5 echo "${ECHO_T}$ac_cv_pthreads_lib" >&6 if test "$pthreads_working" = "yes"; then @@ -2476,10 +2458,11 @@ fi if test x$pthreads_working != xyes; then echo POSIX Threads not found + exit 1 fi unset mdl_cv_have_OpenGL -echo "$as_me:2482: checking for X" >&5 +echo "$as_me:2465: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 # Check whether --with-x or --without-x was given. @@ -2576,17 +2559,17 @@ if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF -#line 2579 "configure" +#line 2562 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2583: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2566: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2589: \$? = $ac_status" >&5 + echo "$as_me:2572: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2619,7 +2602,7 @@ if test "$ac_x_libraries" = no; then ac_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 2622 "configure" +#line 2605 "configure" #include "confdefs.h" #include int @@ -2631,16 +2614,16 @@ XtMalloc (0) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:2634: \"$ac_link\"") >&5 +if { (eval echo "$as_me:2617: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:2637: \$? = $ac_status" >&5 + echo "$as_me:2620: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:2640: \"$ac_try\"") >&5 + { (eval echo "$as_me:2623: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2643: \$? = $ac_status" >&5 + echo "$as_me:2626: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. @@ -2678,7 +2661,7 @@ fi fi # $with_x != no if test "$have_x" != yes; then - echo "$as_me:2681: result: $have_x" >&5 + echo "$as_me:2664: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6 no_x=yes else @@ -2688,7 +2671,7 @@ else # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$as_me:2691: result: libraries $x_libraries, headers $x_includes" >&5 + echo "$as_me:2674: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi @@ -2712,11 +2695,11 @@ else # others require no space. Words are not sufficient . . . . case `(uname -sr) 2>/dev/null` in "SunOS 5"*) - echo "$as_me:2715: checking whether -R must be followed by a space" >&5 + echo "$as_me:2698: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" cat >conftest.$ac_ext <<_ACEOF -#line 2719 "configure" +#line 2702 "configure" #include "confdefs.h" int @@ -2728,16 +2711,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:2731: \"$ac_link\"") >&5 +if { (eval echo "$as_me:2714: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:2734: \$? = $ac_status" >&5 + echo "$as_me:2717: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:2737: \"$ac_try\"") >&5 + { (eval echo "$as_me:2720: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2740: \$? = $ac_status" >&5 + echo "$as_me:2723: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_R_nospace=yes else @@ -2747,13 +2730,13 @@ ac_R_nospace=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test $ac_R_nospace = yes; then - echo "$as_me:2750: result: no" >&5 + echo "$as_me:2733: result: no" >&5 echo "${ECHO_T}no" >&6 X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat >conftest.$ac_ext <<_ACEOF -#line 2756 "configure" +#line 2739 "configure" #include "confdefs.h" int @@ -2765,16 +2748,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:2768: \"$ac_link\"") >&5 +if { (eval echo "$as_me:2751: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:2771: \$? = $ac_status" >&5 + echo "$as_me:2754: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:2774: \"$ac_try\"") >&5 + { (eval echo "$as_me:2757: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2777: \$? = $ac_status" >&5 + echo "$as_me:2760: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_R_space=yes else @@ -2784,11 +2767,11 @@ ac_R_space=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test $ac_R_space = yes; then - echo "$as_me:2787: result: yes" >&5 + echo "$as_me:2770: result: yes" >&5 echo "${ECHO_T}yes" >&6 X_LIBS="$X_LIBS -R $x_libraries" else - echo "$as_me:2791: result: neither works" >&5 + echo "$as_me:2774: result: neither works" >&5 echo "${ECHO_T}neither works" >&6 fi fi @@ -2806,7 +2789,7 @@ echo "${ECHO_T}neither works" >&6 # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). - echo "$as_me:2809: checking for dnet_ntoa in -ldnet" >&5 + echo "$as_me:2792: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2814,7 +2797,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 2817 "configure" +#line 2800 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -2833,16 +2816,16 @@ dnet_ntoa (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:2836: \"$ac_link\"") >&5 +if { (eval echo "$as_me:2819: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:2839: \$? = $ac_status" >&5 + echo "$as_me:2822: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:2842: \"$ac_try\"") >&5 + { (eval echo "$as_me:2825: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2845: \$? = $ac_status" >&5 + echo "$as_me:2828: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dnet_dnet_ntoa=yes else @@ -2853,14 +2836,14 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:2856: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +echo "$as_me:2839: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then - echo "$as_me:2863: checking for dnet_ntoa in -ldnet_stub" >&5 + echo "$as_me:2846: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2868,7 +2851,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 2871 "configure" +#line 2854 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -2887,16 +2870,16 @@ dnet_ntoa (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:2890: \"$ac_link\"") >&5 +if { (eval echo "$as_me:2873: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:2893: \$? = $ac_status" >&5 + echo "$as_me:2876: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:2896: \"$ac_try\"") >&5 + { (eval echo "$as_me:2879: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2899: \$? = $ac_status" >&5 + echo "$as_me:2882: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else @@ -2907,7 +2890,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:2910: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +echo "$as_me:2893: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" @@ -2923,13 +2906,13 @@ fi # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. - echo "$as_me:2926: checking for gethostbyname" >&5 + echo "$as_me:2909: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2932 "configure" +#line 2915 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. */ @@ -2960,16 +2943,16 @@ f = gethostbyname; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:2963: \"$ac_link\"") >&5 +if { (eval echo "$as_me:2946: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:2966: \$? = $ac_status" >&5 + echo "$as_me:2949: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:2969: \"$ac_try\"") >&5 + { (eval echo "$as_me:2952: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2972: \$? = $ac_status" >&5 + echo "$as_me:2955: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else @@ -2979,11 +2962,11 @@ ac_cv_func_gethostbyname=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:2982: result: $ac_cv_func_gethostbyname" >&5 +echo "$as_me:2965: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = no; then - echo "$as_me:2986: checking for gethostbyname in -lnsl" >&5 + echo "$as_me:2969: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2991,7 +2974,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 2994 "configure" +#line 2977 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3010,16 +2993,16 @@ gethostbyname (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3013: \"$ac_link\"") >&5 +if { (eval echo "$as_me:2996: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3016: \$? = $ac_status" >&5 + echo "$as_me:2999: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3019: \"$ac_try\"") >&5 + { (eval echo "$as_me:3002: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3022: \$? = $ac_status" >&5 + echo "$as_me:3005: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else @@ -3030,14 +3013,14 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:3033: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "$as_me:3016: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then - echo "$as_me:3040: checking for gethostbyname in -lbsd" >&5 + echo "$as_me:3023: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3045,7 +3028,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3048 "configure" +#line 3031 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3064,16 +3047,16 @@ gethostbyname (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3067: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3050: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3070: \$? = $ac_status" >&5 + echo "$as_me:3053: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3073: \"$ac_try\"") >&5 + { (eval echo "$as_me:3056: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3076: \$? = $ac_status" >&5 + echo "$as_me:3059: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gethostbyname=yes else @@ -3084,7 +3067,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:3087: result: $ac_cv_lib_bsd_gethostbyname" >&5 +echo "$as_me:3070: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" @@ -3100,13 +3083,13 @@ fi # variants that don't use the nameserver (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. - echo "$as_me:3103: checking for connect" >&5 + echo "$as_me:3086: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6 if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3109 "configure" +#line 3092 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. */ @@ -3137,16 +3120,16 @@ f = connect; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3140: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3123: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3143: \$? = $ac_status" >&5 + echo "$as_me:3126: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3146: \"$ac_try\"") >&5 + { (eval echo "$as_me:3129: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3149: \$? = $ac_status" >&5 + echo "$as_me:3132: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_connect=yes else @@ -3156,11 +3139,11 @@ ac_cv_func_connect=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:3159: result: $ac_cv_func_connect" >&5 +echo "$as_me:3142: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = no; then - echo "$as_me:3163: checking for connect in -lsocket" >&5 + echo "$as_me:3146: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3168,7 +3151,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3171 "configure" +#line 3154 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3187,16 +3170,16 @@ connect (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3190: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3173: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3193: \$? = $ac_status" >&5 + echo "$as_me:3176: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3196: \"$ac_try\"") >&5 + { (eval echo "$as_me:3179: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3199: \$? = $ac_status" >&5 + echo "$as_me:3182: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_connect=yes else @@ -3207,7 +3190,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:3210: result: $ac_cv_lib_socket_connect" >&5 +echo "$as_me:3193: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" @@ -3216,13 +3199,13 @@ fi fi # Guillermo Gomez says -lposix is necessary on A/UX. - echo "$as_me:3219: checking for remove" >&5 + echo "$as_me:3202: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6 if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3225 "configure" +#line 3208 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. */ @@ -3253,16 +3236,16 @@ f = remove; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3256: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3239: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3259: \$? = $ac_status" >&5 + echo "$as_me:3242: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3262: \"$ac_try\"") >&5 + { (eval echo "$as_me:3245: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3265: \$? = $ac_status" >&5 + echo "$as_me:3248: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_remove=yes else @@ -3272,11 +3255,11 @@ ac_cv_func_remove=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:3275: result: $ac_cv_func_remove" >&5 +echo "$as_me:3258: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6 if test $ac_cv_func_remove = no; then - echo "$as_me:3279: checking for remove in -lposix" >&5 + echo "$as_me:3262: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3284,7 +3267,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3287 "configure" +#line 3270 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3303,16 +3286,16 @@ remove (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3306: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3289: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3309: \$? = $ac_status" >&5 + echo "$as_me:3292: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3312: \"$ac_try\"") >&5 + { (eval echo "$as_me:3295: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3315: \$? = $ac_status" >&5 + echo "$as_me:3298: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_posix_remove=yes else @@ -3323,7 +3306,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:3326: result: $ac_cv_lib_posix_remove" >&5 +echo "$as_me:3309: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" @@ -3332,13 +3315,13 @@ fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo "$as_me:3335: checking for shmat" >&5 + echo "$as_me:3318: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6 if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3341 "configure" +#line 3324 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. */ @@ -3369,16 +3352,16 @@ f = shmat; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3372: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3355: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3375: \$? = $ac_status" >&5 + echo "$as_me:3358: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3378: \"$ac_try\"") >&5 + { (eval echo "$as_me:3361: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3381: \$? = $ac_status" >&5 + echo "$as_me:3364: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shmat=yes else @@ -3388,11 +3371,11 @@ ac_cv_func_shmat=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:3391: result: $ac_cv_func_shmat" >&5 +echo "$as_me:3374: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6 if test $ac_cv_func_shmat = no; then - echo "$as_me:3395: checking for shmat in -lipc" >&5 + echo "$as_me:3378: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3400,7 +3383,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3403 "configure" +#line 3386 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3419,16 +3402,16 @@ shmat (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3422: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3405: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3425: \$? = $ac_status" >&5 + echo "$as_me:3408: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3428: \"$ac_try\"") >&5 + { (eval echo "$as_me:3411: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3431: \$? = $ac_status" >&5 + echo "$as_me:3414: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ipc_shmat=yes else @@ -3439,7 +3422,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:3442: result: $ac_cv_lib_ipc_shmat" >&5 +echo "$as_me:3425: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" @@ -3457,7 +3440,7 @@ fi # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry - echo "$as_me:3460: checking for IceConnectionNumber in -lICE" >&5 + echo "$as_me:3443: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3465,7 +3448,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3468 "configure" +#line 3451 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3484,16 +3467,16 @@ IceConnectionNumber (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3487: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3470: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3490: \$? = $ac_status" >&5 + echo "$as_me:3473: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3493: \"$ac_try\"") >&5 + { (eval echo "$as_me:3476: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3496: \$? = $ac_status" >&5 + echo "$as_me:3479: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ICE_IceConnectionNumber=yes else @@ -3504,7 +3487,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:3507: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +echo "$as_me:3490: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" @@ -3514,7 +3497,7 @@ fi fi - echo "$as_me:3517: checking for OpenGL" >&5 + echo "$as_me:3500: checking for OpenGL" >&5 echo $ECHO_N "checking for OpenGL... $ECHO_C" >&6 if test "${mdl_cv_have_OpenGL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3561,7 +3544,7 @@ fi # messages. exec 6>/dev/null - echo "$as_me:3564: checking for library containing glAccum" >&5 + echo "$as_me:3547: checking for library containing glAccum" >&5 echo $ECHO_N "checking for library containing glAccum... $ECHO_C" >&6 if test "${ac_cv_search_glAccum+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3569,7 +3552,7 @@ else ac_func_search_save_LIBS=$LIBS ac_cv_search_glAccum=no cat >conftest.$ac_ext <<_ACEOF -#line 3572 "configure" +#line 3555 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3588,16 +3571,16 @@ glAccum (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3591: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3574: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3594: \$? = $ac_status" >&5 + echo "$as_me:3577: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3597: \"$ac_try\"") >&5 + { (eval echo "$as_me:3580: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3600: \$? = $ac_status" >&5 + echo "$as_me:3583: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_glAccum="none required" else @@ -3609,7 +3592,7 @@ if test "$ac_cv_search_glAccum" = no; then for ac_lib in $GL_search_list; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3612 "configure" +#line 3595 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3628,16 +3611,16 @@ glAccum (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3631: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3614: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3634: \$? = $ac_status" >&5 + echo "$as_me:3617: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3637: \"$ac_try\"") >&5 + { (eval echo "$as_me:3620: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3640: \$? = $ac_status" >&5 + echo "$as_me:3623: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_glAccum="-l$ac_lib" break @@ -3650,7 +3633,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:3653: result: $ac_cv_search_glAccum" >&5 +echo "$as_me:3636: result: $ac_cv_search_glAccum" >&5 echo "${ECHO_T}$ac_cv_search_glAccum" >&6 if test "$ac_cv_search_glAccum" != no; then test "$ac_cv_search_glAccum" = "none required" || LIBS="$ac_cv_search_glAccum $LIBS" @@ -3659,7 +3642,7 @@ else have_GL=no fi - echo "$as_me:3662: checking for library containing gluBeginCurve" >&5 + echo "$as_me:3645: checking for library containing gluBeginCurve" >&5 echo $ECHO_N "checking for library containing gluBeginCurve... $ECHO_C" >&6 if test "${ac_cv_search_gluBeginCurve+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3667,7 +3650,7 @@ else ac_func_search_save_LIBS=$LIBS ac_cv_search_gluBeginCurve=no cat >conftest.$ac_ext <<_ACEOF -#line 3670 "configure" +#line 3653 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3686,16 +3669,16 @@ gluBeginCurve (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3689: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3672: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3692: \$? = $ac_status" >&5 + echo "$as_me:3675: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3695: \"$ac_try\"") >&5 + { (eval echo "$as_me:3678: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3698: \$? = $ac_status" >&5 + echo "$as_me:3681: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_gluBeginCurve="none required" else @@ -3707,7 +3690,7 @@ if test "$ac_cv_search_gluBeginCurve" = no; then for ac_lib in $GLU_search_list; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3710 "configure" +#line 3693 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3726,16 +3709,16 @@ gluBeginCurve (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3729: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3712: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3732: \$? = $ac_status" >&5 + echo "$as_me:3715: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3735: \"$ac_try\"") >&5 + { (eval echo "$as_me:3718: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3738: \$? = $ac_status" >&5 + echo "$as_me:3721: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_gluBeginCurve="-l$ac_lib" break @@ -3748,7 +3731,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:3751: result: $ac_cv_search_gluBeginCurve" >&5 +echo "$as_me:3734: result: $ac_cv_search_gluBeginCurve" >&5 echo "${ECHO_T}$ac_cv_search_gluBeginCurve" >&6 if test "$ac_cv_search_gluBeginCurve" != no; then test "$ac_cv_search_gluBeginCurve" = "none required" || LIBS="$ac_cv_search_gluBeginCurve $LIBS" @@ -3757,7 +3740,7 @@ else have_GLU=no fi - echo "$as_me:3760: checking for library containing glXChooseVisual" >&5 + echo "$as_me:3743: checking for library containing glXChooseVisual" >&5 echo $ECHO_N "checking for library containing glXChooseVisual... $ECHO_C" >&6 if test "${ac_cv_search_glXChooseVisual+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3765,7 +3748,7 @@ else ac_func_search_save_LIBS=$LIBS ac_cv_search_glXChooseVisual=no cat >conftest.$ac_ext <<_ACEOF -#line 3768 "configure" +#line 3751 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3784,16 +3767,16 @@ glXChooseVisual (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3787: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3770: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3790: \$? = $ac_status" >&5 + echo "$as_me:3773: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3793: \"$ac_try\"") >&5 + { (eval echo "$as_me:3776: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3796: \$? = $ac_status" >&5 + echo "$as_me:3779: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_glXChooseVisual="none required" else @@ -3805,7 +3788,7 @@ if test "$ac_cv_search_glXChooseVisual" = no; then for ac_lib in $GLX_search_list; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3808 "configure" +#line 3791 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3824,16 +3807,16 @@ glXChooseVisual (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3827: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3810: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3830: \$? = $ac_status" >&5 + echo "$as_me:3813: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3833: \"$ac_try\"") >&5 + { (eval echo "$as_me:3816: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3836: \$? = $ac_status" >&5 + echo "$as_me:3819: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_glXChooseVisual="-l$ac_lib" break @@ -3846,7 +3829,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:3849: result: $ac_cv_search_glXChooseVisual" >&5 +echo "$as_me:3832: result: $ac_cv_search_glXChooseVisual" >&5 echo "${ECHO_T}$ac_cv_search_glXChooseVisual" >&6 if test "$ac_cv_search_glXChooseVisual" != no; then test "$ac_cv_search_glXChooseVisual" = "none required" || LIBS="$ac_cv_search_glXChooseVisual $LIBS" @@ -3855,7 +3838,7 @@ else have_GLX=no fi - echo "$as_me:3858: checking for library containing glutInit" >&5 + echo "$as_me:3841: checking for library containing glutInit" >&5 echo $ECHO_N "checking for library containing glutInit... $ECHO_C" >&6 if test "${ac_cv_search_glutInit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3863,7 +3846,7 @@ else ac_func_search_save_LIBS=$LIBS ac_cv_search_glutInit=no cat >conftest.$ac_ext <<_ACEOF -#line 3866 "configure" +#line 3849 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3882,16 +3865,16 @@ glutInit (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3885: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3868: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3888: \$? = $ac_status" >&5 + echo "$as_me:3871: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3891: \"$ac_try\"") >&5 + { (eval echo "$as_me:3874: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3894: \$? = $ac_status" >&5 + echo "$as_me:3877: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_glutInit="none required" else @@ -3903,7 +3886,7 @@ if test "$ac_cv_search_glutInit" = no; then for ac_lib in glut; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3906 "configure" +#line 3889 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3922,16 +3905,16 @@ glutInit (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3925: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3908: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3928: \$? = $ac_status" >&5 + echo "$as_me:3911: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3931: \"$ac_try\"") >&5 + { (eval echo "$as_me:3914: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3934: \$? = $ac_status" >&5 + echo "$as_me:3917: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_glutInit="-l$ac_lib" break @@ -3944,7 +3927,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:3947: result: $ac_cv_search_glutInit" >&5 +echo "$as_me:3930: result: $ac_cv_search_glutInit" >&5 echo "${ECHO_T}$ac_cv_search_glutInit" >&6 if test "$ac_cv_search_glutInit" != no; then test "$ac_cv_search_glutInit" = "none required" || LIBS="$ac_cv_search_glutInit $LIBS" @@ -3977,17 +3960,32 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:3980: result: $mdl_cv_have_OpenGL" >&5 +echo "$as_me:3963: result: $mdl_cv_have_OpenGL" >&5 echo "${ECHO_T}$mdl_cv_have_OpenGL" >&6 if test x$mdl_cv_have_OpenGL != xyes;then echo It seems you do not have OpenGL or it does not work. exit 1 fi - CFLAGS="$CFLAGS $GL_CFLAGS" LDFLAGS="$LDFLAGS `echo $GL_LIBS|sed 's/-lglut//g'`" +echo -n checking for Imlib2... +if imlib2-config --version &> /dev/null;then + CFLAGS="$CFLAGS `imlib2-config --cflags`" + LDFLAGS="$LDFLAGS `imlib2-config --libs`" + echo " found (version `imlib2-config --version`)" +else + echo " not found" + echo + echo If you have installed Imlib2, + echo make sure imlib2-config is in + echo your\ \$PATH, which contains : + echo $PATH + echo + exit 1 +fi + ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -4098,7 +4096,7 @@ rm -f confdef2opt.sed : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:4101: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:4099: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -4266,7 +4264,7 @@ cat >>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:4269: error: ambiguous option: $1 + { { echo "$as_me:4267: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} @@ -4288,12 +4286,12 @@ Try \`$0 --help' for more information." >&2;} 'Makefile' ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; # This is an error. - -*) { { echo "$as_me:4291: error: unrecognized option: $1 + -*) { { echo "$as_me:4289: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; - *) { { echo "$as_me:4296: error: invalid argument: $1" >&5 + *) { { echo "$as_me:4294: error: invalid argument: $1" >&5 echo "$as_me: error: invalid argument: $1" >&2;} { (exit 1); exit 1; }; };; esac @@ -4525,7 +4523,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:4528: creating $ac_file" >&5 + { echo "$as_me:4526: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -4543,7 +4541,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:4546: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:4544: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -4556,7 +4554,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:4559: error: cannot find input file: $f" >&5 + { { echo "$as_me:4557: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; diff --git a/configure.in b/configure.in index 5844aae..ee47690 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(gliv.c) -AM_INIT_AUTOMAKE(gliv, "1.0.1 Guillaume Chazarain ") +AM_INIT_AUTOMAKE(gliv, "1.0.2 Guillaume Chazarain ") dnl Checks for programs. AC_PROG_CC @@ -12,36 +12,17 @@ if test x$ac_test_CFLAGS = x; then CFLAGS="-pipe -O3 -fomit-frame-pointer" fi fi - CFLAGS="-Wall -D_REENTRANT -D_THREAD_SAFE $CFLAGS" - if test "x$LDFLAGS" = x; then LDFLAGS="-Wl,-O1" fi -dnl Checks for Imlib2. -echo -n checking for Imlib2... -if imlib2-config --version &> /dev/null;then - CFLAGS="$CFLAGS `imlib2-config --cflags`" - LDFLAGS="$LDFLAGS `imlib2-config --libs`" - echo " found (version `imlib2-config --version`)" -else - echo " not found" - echo - echo If you have installed Imlib2, - echo make sure imlib2-config is in - echo your\ \$PATH, which contains : - echo $PATH - echo - exit 1 -fi - dnl Checks for POSIX threads. APR_CHECK_PTHREADS_H APR_PTHREADS_CHECK if test x$pthreads_working != xyes; then echo POSIX Threads not found -dnl exit 1 + exit 1 fi dnl Checks for OpenGL. @@ -51,8 +32,24 @@ if test x$mdl_cv_have_OpenGL != xyes;then echo It seems you do not have OpenGL or it does not work. exit 1 fi - CFLAGS="$CFLAGS $GL_CFLAGS" LDFLAGS="$LDFLAGS `echo $GL_LIBS|sed 's/-lglut//g'`" +dnl Checks for Imlib2. +echo -n checking for Imlib2... +if imlib2-config --version &> /dev/null;then + CFLAGS="$CFLAGS `imlib2-config --cflags`" + LDFLAGS="$LDFLAGS `imlib2-config --libs`" + echo " found (version `imlib2-config --version`)" +else + echo " not found" + echo + echo If you have installed Imlib2, + echo make sure imlib2-config is in + echo your\ \$PATH, which contains : + echo $PATH + echo + exit 1 +fi + AC_OUTPUT(Makefile) diff --git a/event.c b/event.c index b772803..0dc81ed 100644 --- a/event.c +++ b/event.c @@ -58,9 +58,9 @@ static void user_image(int dir) } /*************************************** - *Modifies im1 parameters when zooming.* + * Updates rt parameters when zooming. * ***************************************/ -static void zoom(double ratio) +static void zoom(float ratio) { rt.image_zoom *= ratio; rt.image_x *= ratio; @@ -125,7 +125,7 @@ static int process_keysym(unsigned int keysym) zoom(ZOOM_FACTOR); return 1; - case XK_Up: /* Up arrow */ + case XK_Up: /* Up arrow */ case XK_KP_Up: /* Up arrow */ rt.image_y -= MOVE_OFFSET; return 1; @@ -202,12 +202,12 @@ static int process_pressed_button(XButtonEvent xbutton) * A non-null return code means that * * the window needs to be refreshed. * ***************************************/ -static int process_this_event(XEvent ev) +static int process_this_event(XEvent * ev) { XEvent last_ev; XEvent *last_resize; - switch (ev.type) { + switch (ev->type) { case ClientMessage: /* The next image was waited and the loading has just ended. */ rt.state = STATE_LOADED; @@ -215,13 +215,13 @@ static int process_this_event(XEvent ev) return 0; case KeyPress: - return process_keysym(XKeycodeToKeysym(dpy, ev.xkey.keycode, 0)); + return process_keysym(XKeycodeToKeysym(dpy, ev->xkey.keycode, 0)); case ButtonPress: - return process_pressed_button(ev.xbutton); + return process_pressed_button(ev->xbutton); case ButtonRelease: - switch (ev.xbutton.button) { + switch (ev->xbutton.button) { case Button2: mouse_wheel_zoom = 1; return 0; @@ -229,8 +229,9 @@ static int process_this_event(XEvent ev) case Button3: rt.zoom_frame = 0; set_zoom_frame(old3_x, old3_y, - ev.xmotion.x - old3_x, ev.xmotion.y - old3_y); - return zoom_frame(); + ev->xmotion.x - old3_x, ev->xmotion.y - old3_y); + zoom_frame(); + return 1; default: return 0; @@ -238,27 +239,26 @@ static int process_this_event(XEvent ev) case MotionNotify: if (rt.delay) { - if (rt.cursor_hidden) { + if (rt.cursor_hidden) reset_cursor(); - rt.cursor_hidden = 0; - } else + else alarm(rt.delay); } - if (ev.xmotion.state & Button1Mask) { + if (ev->xmotion.state & Button1Mask) { /* We move the image. */ - rt.image_x -= ev.xmotion.x - old1_x; - rt.image_y -= ev.xmotion.y - old1_y; - old1_x = ev.xmotion.x; - old1_y = ev.xmotion.y; + rt.image_x -= ev->xmotion.x - old1_x; + rt.image_y -= ev->xmotion.y - old1_y; + old1_x = ev->xmotion.x; + old1_y = ev->xmotion.y; return 1; } - if (ev.xmotion.state & Button3Mask) { + if (ev->xmotion.state & Button3Mask) { /* We draw a zoom rectangle. */ rt.zoom_frame = 1; set_zoom_frame(old3_x, old3_y, - ev.xmotion.x - old3_x, ev.xmotion.y - old3_y); + ev->xmotion.x - old3_x, ev->xmotion.y - old3_y); return 1; } @@ -266,17 +266,17 @@ static int process_this_event(XEvent ev) case Expose: /* Redraw only if it is the last expose in the queue. */ - return !ev.xexpose.count; + return !ev->xexpose.count; case ConfigureNotify: - if ((ev.xconfigure.width == rt.win_w) - && (ev.xconfigure.height == rt.win_h)) + if ((ev->xconfigure.width == rt.win_w) + && (ev->xconfigure.height == rt.win_h)) /* The window has only been moved. */ return 0; while (XCheckTypedEvent(dpy, Expose, &last_ev)); - last_ev = ev; + last_ev = *ev; last_resize = NULL; while (XCheckTypedEvent(dpy, ConfigureNotify, &last_ev)) @@ -292,9 +292,12 @@ static int process_this_event(XEvent ev) change_view(); + if (rt.maximize) + return set_max_zoom(); return 0; case MapNotify: + wm_info(); if (rt.fullscreen) goto_fullscreen(); return 1; @@ -309,17 +312,17 @@ static int process_this_event(XEvent ev) * Processes the most meaningful event * * to avoid useless redraws. * ***************************************/ -int process_event(XEvent ev) +int process_event(XEvent * ev) { - XEvent last_ev = ev; + XEvent *last_ev = ev; - switch (ev.type) { + switch (ev->type) { case KeyPress: case ButtonPress: case MotionNotify: case Expose: /* For these events the last one is enough. */ - while (XCheckTypedEvent(dpy, ev.type, &last_ev)); + while (XCheckTypedEvent(dpy, ev->type, last_ev)); break; case ClientMessage: diff --git a/gliv.1 b/gliv.1 index 1c9f566..c779824 100644 --- a/gliv.1 +++ b/gliv.1 @@ -1,4 +1,4 @@ -.TH "gliv" "1" "" "gliv" "Image viewer" +.TH "gliv" "1" "" "Guillaume Chazarain" "Image viewer" .SH "NAME" gliv \- An OpenGL image viewer .SH "SYNOPSIS" diff --git a/gliv.c b/gliv.c index f5e6112..94013d0 100644 --- a/gliv.c +++ b/gliv.c @@ -25,7 +25,6 @@ #include "gliv.h" Display *dpy; -GLXContext cx; GC gc; Window win; gliv_image *im1 = NULL; /* Displayed. */ @@ -33,7 +32,8 @@ rt_struct rt; char **names; int total = 0; pthread_t thread; -pthread_mutex_t imlib_mutex, ogl_mutex; + +static pthread_mutex_t imlib_mutex, ogl_mutex; /*************************************** * Locks or unlocks a mutex. * @@ -109,7 +109,7 @@ static void randomize_array(char **array) char *tmp; int i, r; - srandom((unsigned) time(NULL)); + srandom((unsigned) (time(NULL) + getpid())); for (i = 0; i < total; i++) { tmp = array[i]; @@ -121,13 +121,13 @@ static void randomize_array(char **array) /*************************************** * Adds a filename to the list. This * - * function is only used by ftw if the * + *function is only used by ftw when the* * -R flag is given. * ***************************************/ -static int add_to_list(const char *file, const struct stat *unused, int flag) +static int add_to_list(const char *file, const struct stat *st, int flag) { if (flag == FTW_F) { - /* The file is a file we don't care if it is an image or not. */ + /* It is not a directory, we don't care if it is an image or not. */ total++; names = realloc(names, total * sizeof(char *)); names[total - 1] = strdup(file); @@ -138,7 +138,7 @@ static int add_to_list(const char *file, const struct stat *unused, int flag) /*************************************** * Recursively adds all files to the * * list by descending directories. The * - * image list is the variable names. * + * image list is the variable 'names'. * ***************************************/ static void build_image_list(char **array, unsigned int nb) { @@ -190,33 +190,28 @@ static void getopt_parser(struct gengetopt_args_info *args) } /*************************************** + * "Hides" the cursor by changing it * + * to a transparent one. * + ***************************************/ +static void alarm_func(int unused) +{ + if (!rt.cursor_hidden) + set_transparent_cursor(); +} + +/*************************************** * Frees OpenGL memory and disconnects * * from glX at exit. * ***************************************/ static void clean_exit(void) { - destroy_image(im1); + signal(SIGALRM, SIG_IGN); + + glDeleteTextures((GLsizei) (im1->nb_w * im1->nb_h), im1->textures); if (!rt.load_requested) { pthread_join(thread, (void *) &im1); - destroy_image(im1); - } - - glXDestroyContext(dpy, cx); - XCloseDisplay(dpy); -} - -/*************************************** - * "Hides" the cursor by changing it * - * to a transparent one. * - ***************************************/ -static void alarm_func(int unused) -{ - if (!rt.cursor_hidden) { - glXWaitGL(); - set_transparent_cursor(); - rt.cursor_hidden = 1; - glXWaitX(); + glDeleteTextures((GLsizei) (im1->nb_w * im1->nb_h), im1->textures); } } @@ -228,9 +223,13 @@ static void exit_with_signal(int sig) { clean_exit(); - /* Ignore the signal. */ + /* Don't intercept the signal once more. */ signal(sig, SIG_DFL); + /* Sometimes the window stays here, so destroy it. */ + XDestroyWindow(dpy, win); + XFlush(dpy); + /* Kill ourselves with the intercepted signal. */ raise(sig); } @@ -253,7 +252,35 @@ static void init_rt(int argc, char *argv[]) rt.help = 0; rt.direction = +1; rt.state = STATE_LOADED; - rt.next_is_bad = 0; +} + +/*************************************** + * Catches signals that would make * + * exit badly. * + ***************************************/ +static void install_sig_handlers(void) +{ +#ifdef SIGHUP + signal(SIGHUP, exit_with_signal); +#endif +#ifdef SIGINT + signal(SIGINT, exit_with_signal); +#endif +#ifdef SIGQUIT + signal(SIGQUIT, exit_with_signal); +#endif +#ifdef SIGILL + signal(SIGILL, exit_with_signal); +#endif +#ifdef SIGSEGV + signal(SIGSEGV, exit_with_signal); +#endif +#ifdef SIGTERM + signal(SIGTERM, exit_with_signal); +#endif +#ifdef SIGBUS + signal(SIGBUS, exit_with_signal); +#endif } /*************************************** @@ -262,6 +289,7 @@ static void init_rt(int argc, char *argv[]) int main(int argc, char *argv[]) { XEvent ev; + struct timespec time_to_sleep = { tv_sec:0, tv_nsec:1000000 }; init_rt(argc, argv); @@ -272,9 +300,7 @@ int main(int argc, char *argv[]) atexit(clean_exit); - signal(SIGINT, exit_with_signal); - signal(SIGTERM, exit_with_signal); - signal(SIGSEGV, exit_with_signal); + install_sig_handlers(); if (rt.delay) { signal(SIGALRM, alarm_func); @@ -302,14 +328,16 @@ int main(int argc, char *argv[]) for (;;) { if (rt.state == STATE_WAITING) - /* Waiting for ClientMessage from thread. */ + /* Waiting for ClientMessage from the loading thread. */ while (!XPending(dpy)) - usleep(1000); + nanosleep(&time_to_sleep, NULL); XNextEvent(dpy, &ev); - if (process_event(ev)) + if (process_event(&ev)) redraw(); + else + nanosleep(&time_to_sleep, NULL); } /* for (;;) never ends but ... */ diff --git a/gliv.h b/gliv.h index abe4a58..76d51e9 100644 --- a/gliv.h +++ b/gliv.h @@ -55,17 +55,16 @@ typedef struct { unsigned char verbose; unsigned char info; unsigned char maximize; - unsigned int delay; + unsigned char delay; unsigned char cursor_hidden; unsigned char zoom_frame; unsigned char help; - double image_x; - double image_y; - double image_zoom; + float image_x; + float image_y; + float image_zoom; - unsigned char next_is_bad; char direction; unsigned char state; @@ -73,9 +72,6 @@ typedef struct { int win_w; int win_h; - - int scr_w; - int scr_h; } rt_struct; /*************************************** @@ -105,7 +101,7 @@ void free_imlib_image(Imlib_Image * im); void destroy_image(gliv_image * im); /* event.c */ -int process_event(XEvent ev); +int process_event(XEvent * ev); /* help.c */ void display_summary(void); @@ -126,7 +122,7 @@ void make_one_texture(gliv_image * im); /* rendering.c */ void make_texture_image(gliv_image * im); void set_zoom_frame(int x, int y, int w, int h); -int zoom_frame(void); +void zoom_frame(void); void redraw(void); void change_view(void); void render(void); @@ -136,6 +132,7 @@ int set_max_zoom(void); void set_transparent_cursor(void); void reset_cursor(void); void texture_parameter(void); +void wm_info(void); void goto_fullscreen(void); void goto_window(void); void init_glX(void); diff --git a/gliv.list b/gliv.list new file mode 100644 index 0000000..05b61e1 --- /dev/null +++ b/gliv.list @@ -0,0 +1,20 @@ +#Files list for EPM. + + +%product GLiv +%description OpenGL Image Viewer +%copyright Guillaume Chazarain +%vendor Guillaume Chazarain +%license COPYING +%readme README +%version 1.0.2 + +$prefix=/usr + +d 0755 root root $prefix/share/doc/gliv +f 0644 root root $prefix/share/doc/gliv/COPYING ./COPYING +f 0644 root root $prefix/share/doc/gliv/NEWS ./NEWS +f 0644 root root $prefix/share/doc/gliv/README ./README +f 0644 root root $prefix/share/doc/gliv/THANKS ./THANKS +f 0644 root root $prefix/share/man/man1/gliv.1 ./gliv.1 +f 0755 root root $prefix/bin/gliv ./gliv diff --git a/help.c b/help.c dissimilarity index 92% index 6d6c6e8..ba715e7 100644 --- a/help.c +++ b/help.c @@ -1,30 +1,30 @@ -/* Generated by help2c.c */ - -#include "gliv.h" - -extern Display *dpy; -extern Window win; -extern GC gc; -extern rt_struct rt; - -void display_summary(void) -{ - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -125, "ESC, q : Quit.", 14); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -110, "f/w : Full-screen/Window.", 28); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -95, "+/- : zoom in/out.", 21); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -80, "n/p : Next/Previous image.", 29); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -65, "i : toggle display of Info.", 32); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -50, "m : Maximize image to fit screen.", 38); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -35, "h : toggle Help.", 21); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -20, "r : Reset position and size.", 33); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -5, "", 0); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 10, "Move the image with the mouse or the arrow", 44); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 25, "keys. Your mouse wheel (if supported) will", 44); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 40, "zoom images and switch between them when the", 44); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 55, "button is pressed.", 18); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 70, "", 0); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 85, "Space and Backspace act like n and p.", 37); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 100, "", 0); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 115, "Draw a rectangle with the right button and", 44); - XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 130, "gliv will zoom in it.", 21); -} +/* Generated by help2c.c */ + +#include "gliv.h" + +extern Display *dpy; +extern Window win; +extern GC gc; +extern rt_struct rt; + +void display_summary(void) +{ + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -125, "ESC, q : Quit.", 14); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -110, "f/w : Full-screen/Window.", 28); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -95, "+/- : zoom in/out.", 21); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -80, "n/p : Next/Previous image.", 29); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -65, "i : toggle display of Info.", 32); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -50, "m : Maximize image to fit screen.", 38); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -35, "h : toggle Help.", 21); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -20, "r : Reset position and size.", 33); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + -5, "", 0); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 10, "Move the image with the mouse or the arrow", 44); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 25, "keys. Your mouse wheel (if supported) will", 44); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 40, "zoom images and switch between them when the", 44); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 55, "button is pressed.", 18); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 70, "", 0); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 85, "Space and Backspace act like n and p.", 37); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 100, "", 0); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 115, "Draw a rectangle with the right button and", 44); + XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + 130, "gliv will zoom in it.", 21); +} diff --git a/help2c.c b/help2c.c index 9d7ee81..88d63cb 100644 --- a/help2c.c +++ b/help2c.c @@ -21,7 +21,7 @@ /*************************************** * It's nice to generate documentation * * from the sources but the opposite * - * is funnier. * + * is funnier. * ***************************************/ #include @@ -29,7 +29,7 @@ #define SEPARATOR "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" #define LINE \ -" XDrawString(dpy,win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + %d, \"%s\", %d);\n" +" XDrawString(dpy, win, gc, rt.win_w / 2 - 155, rt.win_h / 2 + %d, \"%s\", %d);\n" static char *readline(void) { @@ -39,7 +39,7 @@ static char *readline(void) str = malloc(sizeof(char)); str[0] = '\0'; - while ((c = getchar()) != '\n' && !feof(stdin)) { + while (!feof(stdin) && (c = getchar()) != '\n') { str = realloc(str, ++size * sizeof(char)); str[size - 2] = c; str[size - 1] = '\0'; diff --git a/loading.c b/loading.c index dea9674..545d94d 100644 --- a/loading.c +++ b/loading.c @@ -32,6 +32,7 @@ extern int total; extern pthread_t thread; static gliv_image *im2; /* Loaded. */ +static unsigned char next_is_bad = 0; /*************************************** * Loads the next image in a thread. * @@ -186,10 +187,10 @@ void *load_next_image(void *unused) free_imlib_image(im->gl_im); im->im = im->gl_im = NULL; - if (rt.next_is_bad) { + if (next_is_bad) { destroy_image(im); rt.state = STATE_LOADED; - rt.next_is_bad = 0; + next_is_bad = 0; return NULL; } @@ -213,7 +214,7 @@ void reverse_direction(void) pthread_join(thread, (void *) &im2); destroy_image(im2); } else - rt.next_is_bad = 1; + next_is_bad = 1; rt.direction *= -1; diff --git a/many_textures.c b/many_textures.c index 8348294..795ab03 100644 --- a/many_textures.c +++ b/many_textures.c @@ -34,7 +34,7 @@ extern rt_struct rt; static void draw_many(void) { unsigned int i, j; - GLdouble x0, y0, xi, yi; + GLfloat x0, y0, xi, yi; /* (x0;y0) : origin of the image. */ x0 = -(im1->w * rt.image_zoom / 2 + rt.image_x); diff --git a/one_texture.c b/one_texture.c index 21868a0..206605c 100644 --- a/one_texture.c +++ b/one_texture.c @@ -33,7 +33,7 @@ extern rt_struct rt; ***************************************/ static void draw_one(void) { - GLdouble x0, y0, xi, yi; + GLfloat x0, y0, xi, yi; /* (x0;y0) : origin of the image. */ x0 = -(im1->w * rt.image_zoom / 2 + rt.image_x); @@ -53,14 +53,14 @@ static void draw_one(void) glTexCoord2i(0, 0); glVertex2d(x0, y0); - glTexCoord2d((GLdouble) (im1->w - .5) / im1->gl_w, 0.0); + glTexCoord2d((GLfloat) (im1->w - .5) / im1->gl_w, 0.0); glVertex2d(x0 + xi, y0); - glTexCoord2d((GLdouble) (im1->w - .5) / im1->gl_w, - (GLdouble) (im1->h - .5) / im1->gl_h); + glTexCoord2d((GLfloat) (im1->w - .5) / im1->gl_w, + (GLfloat) (im1->h - .5) / im1->gl_h); glVertex2d(x0 + xi, y0 + yi); - glTexCoord2d(0.0, (GLdouble) (im1->h - .5) / im1->gl_h); + glTexCoord2d(0.0, (GLfloat) (im1->h - .5) / im1->gl_h); glVertex2d(x0, y0 + yi); glEnd(); diff --git a/rendering.c b/rendering.c index db2fd29..ff05c07 100644 --- a/rendering.c +++ b/rendering.c @@ -168,26 +168,24 @@ void set_zoom_frame(int x, int y, int w, int h) * Zooms and moves the image according * * to the zoom rectangle dimensions. * ***************************************/ -int zoom_frame(void) +void zoom_frame(void) { - double zoom, zoom_w, zoom_h; + float zoom, zoom_w, zoom_h; if (!zoom_frame_w || !zoom_frame_h) /* To avoid division by zero. */ - return 1; + return; - zoom_w = (double) rt.win_w / zoom_frame_w; - zoom_h = (double) rt.win_h / zoom_frame_h; + zoom_w = (float) rt.win_w / zoom_frame_w; + zoom_h = (float) rt.win_h / zoom_frame_h; zoom = zoom_w < zoom_h ? zoom_w : zoom_h; rt.image_zoom *= zoom; rt.image_x = zoom * (rt.image_x + zoom_frame_x + - (double) (zoom_frame_w - rt.win_w) / 2); + (float) (zoom_frame_w - rt.win_w) / 2); rt.image_y = zoom * (rt.image_y + zoom_frame_y + - (double) (zoom_frame_h - rt.win_h) / 2); - - return 1; + (float) (zoom_frame_h - rt.win_h) / 2); } /*************************************** @@ -213,8 +211,6 @@ void redraw(void) if (rt.help) draw_help(); - - glXWaitX(); } /*************************************** @@ -225,9 +221,11 @@ void change_view(void) { glXWaitX(); glViewport(0, 0, rt.win_w, rt.win_h); + glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluOrtho2D(-(GLdouble) rt.win_w / 2, (GLdouble) rt.win_w / 2, - (GLdouble) rt.win_h / 2, -(GLdouble) rt.win_h / 2); + gluOrtho2D(-(GLfloat) rt.win_w / 2, (GLfloat) rt.win_w / 2, + (GLfloat) rt.win_h / 2, -(GLfloat) rt.win_h / 2); + glMatrixMode(GL_MODELVIEW); redraw(); } @@ -261,12 +259,12 @@ void render(void) ***************************************/ int set_max_zoom(void) { - double max_x; - double max_y; - double new_z; + float max_x; + float max_y; + float new_z; - max_x = (double) rt.win_w / im1->w; - max_y = (double) rt.win_h / im1->h; + max_x = (float) rt.win_w / im1->w; + max_y = (float) rt.win_h / im1->h; new_z = (max_x > max_y) ? max_y : max_x; diff --git a/setup.c b/setup.c index d918dcd..faef59c 100644 --- a/setup.c +++ b/setup.c @@ -25,12 +25,17 @@ #include "gliv.h" extern Display *dpy; -extern GLXContext cx; extern GC gc; extern Window win; extern gliv_image *im1; extern rt_struct rt; +static GLXContext cx; +static int scr_w; +static int scr_h; +static int wm_x = 0; +static int wm_y = 0; + /*************************************** *Creates a small easily hidden cursor.* ***************************************/ @@ -48,6 +53,7 @@ static Cursor create_transparent_cursor(void) XFreePixmap(dpy, pmap); + /* To be freed. */ return cursor; } @@ -56,7 +62,13 @@ static Cursor create_transparent_cursor(void) ***************************************/ void set_transparent_cursor(void) { - XDefineCursor(dpy, win, create_transparent_cursor()); + Cursor cursor; + + cursor = create_transparent_cursor(); + XDefineCursor(dpy, win, cursor); + rt.cursor_hidden = 1; + XFlush(dpy); + XFreeCursor(dpy, cursor); } /*************************************** @@ -65,6 +77,8 @@ void set_transparent_cursor(void) void reset_cursor(void) { XUndefineCursor(dpy, win); + rt.cursor_hidden = 0; + XFlush(dpy); } /*************************************** @@ -74,6 +88,7 @@ void reset_cursor(void) void texture_parameter(void) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); } @@ -89,16 +104,54 @@ static void hw_info(void) printf("GL_VENDOR : %s\n", glGetString(GL_VENDOR)); printf("GL_RENDERER : %s\n", glGetString(GL_RENDERER)); printf("GL_VERSION : %s\n", glGetString(GL_VERSION)); - printf("GL_MAX_TEXTURE_SIZE : %dx%d\n", - rt.max_texture_size, rt.max_texture_size); + printf("GL_MAX_TEXTURE_SIZE : %d\n", rt.max_texture_size); } if (rt.verbose && !strncmp(glGetString(GL_VENDOR), "Brian Paul", 10)) fprintf(stderr, "\nWarning : It seems you do not have OpenGL acceleration\n"); - rt.scr_w = DisplayWidth(dpy, DefaultScreen(dpy)); - rt.scr_h = DisplayHeight(dpy, DefaultScreen(dpy)); + scr_w = DisplayWidth(dpy, DefaultScreen(dpy)); + scr_h = DisplayHeight(dpy, DefaultScreen(dpy)); +} + +/*************************************** + * Used when the Window Manager is * + * neither net_wm nor gnome compliant. * + ***************************************/ +static void dummy_stay_on_top(Display * unused_1, Window unused_2, int unused_3) +{ +} + +/*************************************** + * Some WM dependant parameters. * + ***************************************/ +void wm_info(void) +{ + Window root, parent, *children; + unsigned int nchildren; + XWindowAttributes attr; + + if (wm_detect(dpy)) { + wm_stay_on_top = dummy_stay_on_top; + if (rt.verbose) + puts("wmhooks: unknow"); + } + + XQueryTree(dpy, win, &root, &parent, &children, &nchildren); + if (children) + XFree(children); + + if (parent == DefaultRootWindow(dpy)) { + /* Probably no WM running. */ + wm_x = wm_y = 0; + if (rt.verbose) + puts("It seems that no WM is running."); + } else { + XGetWindowAttributes(dpy, win, &attr); + wm_x = attr.x; + wm_y = attr.y; + } } /*************************************** @@ -125,17 +178,17 @@ void goto_fullscreen(void) { XWindowAttributes attr; - XGetWindowAttributes(dpy, win, &attr); - - if (attr.width == rt.scr_w && attr.height == rt.scr_h && rt.fullscreen == 1) + if (rt.win_w == scr_w && rt.win_h == scr_h && rt.fullscreen) return; + XGetWindowAttributes(dpy, win, &attr); + rt.fullscreen = 1; glXWaitGL(); - /* -attr.[xy] : patch by Jason Baietto. */ - XMoveResizeWindow(dpy, win, -attr.x, -attr.y, rt.scr_w, rt.scr_h); + /* -wm_[xy] : patch by Jason Baietto. */ + XMoveResizeWindow(dpy, win, -wm_x, -wm_y, scr_w, scr_h); (*wm_stay_on_top) (dpy, win, 1); } @@ -149,9 +202,9 @@ void goto_window(void) unsigned int new_w; unsigned int new_h; - if (im1->w >= rt.scr_w || im1->h >= rt.scr_h) { - new_w = 3 * rt.scr_w / 4; - new_h = 3 * rt.scr_h / 4; + if (im1->w >= scr_w || im1->h >= scr_h) { + new_w = 3 * scr_w / 4; + new_h = 3 * scr_h / 4; } else { new_w = im1->w; new_h = im1->h; @@ -167,25 +220,17 @@ void goto_window(void) if (rt.fullscreen) { rt.fullscreen = 0; + (*wm_stay_on_top) (dpy, win, -1); (*wm_stay_on_top) (dpy, win, 0); - XRaiseWindow(dpy, win); XMoveResizeWindow(dpy, win, - (rt.scr_w - new_w) / 2, (rt.scr_h - new_h) / 2, - new_w, new_h); + (scr_w - new_w) / 2 - wm_x, + (scr_h - new_h) / 2 - wm_y, new_w, new_h); } else XResizeWindow(dpy, win, new_w, new_h); } /*************************************** - * Used when the Window Manager is * - * neither net_wm nor gnome compliant. * - ***************************************/ -static void dummy_stay_on_top(Display * unused_1, Window unused_2, int unused_3) -{ -} - -/*************************************** *Initializes X, OpenGL and binds them.* ***************************************/ void init_glX(void) @@ -205,9 +250,12 @@ void init_glX(void) } vi = glXChooseVisual(dpy, DefaultScreen(dpy), glXattrs); + if (!vi) { + fputs("Error : cannot find an appropriate visual.\n", stderr); + exit(1); + } cx = glXCreateContext(dpy, vi, NULL, True); - if (!cx) { fputs("Error : cannot create GLX rendering context.\n", stderr); exit(1); @@ -232,12 +280,6 @@ void init_glX(void) create_gc(); - if (wm_detect(dpy)) { - wm_stay_on_top = dummy_stay_on_top; - if (rt.verbose) - puts("wmhooks: unknow"); - } - glXMakeCurrent(dpy, win, cx); /* OpenGL parameters. */ @@ -246,9 +288,4 @@ void init_glX(void) glPixelStorei(GL_UNPACK_ALIGNMENT, 1); hw_info(); - - if (rt.fullscreen) { - rt.win_w = rt.scr_w; - rt.win_h = rt.scr_h; - } } -- 2.11.4.GIT