Date: Thursday August 24, 2000 @ 22:57 Author: cvs Update of /home/cvs/CVS/client In directory boltzmann.eecs.berkeley.edu:/tmp/cvs-serv13252 Modified Files: CHANGES README client.man configure configure.in gx11.c xutil.c Log Message: configure.in, configure: Move check for -lm before png check, and libpng on sparc/solaris systems require math library for proper linking. Also, change the -with-xpm* to -with-ldflags and -with-includes to be more general since extra values may be needed for more than just xpm library. client.man: Updated for information about png images and cwindow command. README: Updated with changes mentioned above with the --with-png options. gx11.c: Remove all support for pixmap images. They didn't work anyways, but you could specify -pix on the command line and get no images - now it will at least result in an error message. Also, savedefaults will now save png status properly. xutil.c: Modified so that it will save png status when savedefaults is issued. MSW 8/24/2000 **************************************** Index: client/CHANGES diff -u client/CHANGES:1.20 client/CHANGES:1.21 --- client/CHANGES:1.20 Sun Aug 13 21:42:35 2000 +++ client/CHANGES Thu Aug 24 22:57:39 2000 @@ -1,5 +1,21 @@ -"$Id: CHANGES,v 1.20 2000/08/14 04:42:35 cvs Exp $" +"$Id: CHANGES,v 1.21 2000/08/25 05:57:39 cvs Exp $" Top of CVS tree: + +configure.in, configure: Move check for -lm before png check, and +libpng on sparc/solaris systems require math library for proper linking. +Also, change the -with-xpm* to -with-ldflags and -with-includes to be +more general since extra values may be needed for more than just xpm +library. +client.man: Updated for information about png images and +cwindow command. +README: Updated with changes mentioned above with the --with-png options. +gx11.c: Remove all support for pixmap images. They didn't work anyways, +but you could specify -pix on the command line and get no images - +now it will at least result in an error message. Also, savedefaults +will now save png status properly. +xutil.c: Modified so that it will save png status when savedefaults +is issued. +MSW 8/24/2000 The following change removes imlib as are png loading/rendering library - instead, we use our own local function located in png.c. libpng is Index: client/README diff -u client/README:1.3 client/README:1.4 --- client/README:1.3 Tue Jun 20 21:45:47 2000 +++ client/README Thu Aug 24 22:57:39 2000 @@ -4,8 +4,8 @@ You will need the XPM library to compile the client. If you want to run the gtk client, you will need to install the gtk libraries. - If you want png support, you will need to install the Imlib and png - library. There may be other requisites for the Imlib file. + If you want png support, you will need to install the png + library. 1) type './configure' to configure for your OS/system. Most options normally understood by configure should be available. @@ -23,6 +23,20 @@ sound daemon). If you want to use the builtin sound system, use the --enable-old-sound. See sound notes further down. + To specify additional places to find header files, use the + --with-includes=value - this includes any -I or other options to provide + the compiler. Example: + ./configure --with-includes="-I/usr/local/include -I/opt/xpm/include" + + Similarly, there is a --with-ldflags option. Example: + ./configure --with-ldflags"-L/usr/local/lib -R/usr/local/lib" + -R is used on many systems to specify run location for libraries so + you don't need to set LD_LIBRARY_PATH. + + Generally, if you are setting --with-includes, your probably need to + set --with-ldflags, as if one is not in a standard place, the other + probably is not either. + 2) Type 'make depend; make' to compile the client. If you get link errors, it may be because you have an older version of the gtk libraries. If you get errors like 'can't find target client.c', your make program @@ -32,10 +46,6 @@ 4) The client can be run by typing 'cfclient' for the X11 version, gcfclient for the gtk client. - -If you wish to generate the X11 client after generating the gtk client, -you just need to re-run configure with the appropriate options, do -a make clean, and then make. ------------------------------------------------------------------------------ Converting keybindings from old save files for use with the client: Index: client/client.man diff -u client/client.man:1.3 client/client.man:1.4 --- client/client.man:1.3 Thu Apr 20 23:50:56 2000 +++ client/client.man Thu Aug 24 22:57:39 2000 @@ -1,12 +1,12 @@ -.\"$Id: client.man,v 1.3 2000/04/21 06:50:56 cvs Exp $ -.TH cfclient "November 29, 1998" +.\"$Id: client.man,v 1.4 2000/08/25 05:57:39 cvs Exp $ +.TH cfclient .SH NAME cfclient - X11 client program for crossfire servers. .br gcfclient - gtk client program for crossfire servers. .SH SYNOPSIS .B client [-server server] [-port number] [-display display] [-split|-nosplit] -[-echo] [-pix|-xpm] [-showicon] [-scrollines number] [-sync] [-help] +[-echo] [-pix|-xpm|-png] [-showicon] [-scrollines number] [-sync] [-help] [-cache|-nocache] .SH DESCRIPTION .PP @@ -51,7 +51,7 @@ printed in the information window as they are sent to the server. .TP -.B -pix|-xpm +.B -pix|-xpm|-png This determines the graphic image types to use. -pix uses pixmap images - these are two color images with no masking (one image per space.). -xpm uses XPM format images - these are multi colored images with masking, @@ -59,8 +59,13 @@ more local processing power (unless you are on a very old machine, this should not be an issue), the installation of the XPM library, and also require more bandwidth to download (however, see the -cache option -further down.) +further down.) Png have all the same features of XPM, but are +slightly larger (32x32 instead of 24x24), appear better, and do the the +efficiency of the png format, actually take less bandwidth to transmit +than the xpm images. Using the png images require that the client +has been compiled with png support. + .TP .B -showicon This shows a little icon next to items in your inventory that contains @@ -186,6 +191,29 @@ 'help bind gives much more detailed information. Once a command is bound, it is stored in ~/.crossfire/keys and will be used in future plays. +.TP +.B scroll +Cfclient only. Toggles between scroll and wrap mode. +In wrap mode, when text gets to the bottom of the +message window, it starts new messages at the top. +Scroll is only really useful on very slow systems where +the performance hit of scrolling the window is too costly. +.TP +.B magicmap +Displays the data from the last time the magic mapping +spell was cast. This information can be completely useless +if you are now on another map. +.TP +.B cwindow <number> +Specifies the number of unprocessed commands to the server. +The server processes player commands as the character has +actions to perform them - having this number too high +can result in extended lengths of time that after you stop +entering commands the character is still performing actions. +Having this value too low on slow links can result in the +character sitting idle even though they have an action +comming to them. + .SH FILES .TP @@ -212,7 +240,7 @@ .PP Please let me know about any bugs you find in the client. .SH AUTHOR -Copyright (C) 1994,1996,1998 Mark Wedel ( mark at pyramid.com ) +Copyright (C) 1994,2000 Mark Wedel ( mwedel at scruz.net ) GTK port by David Sundqvist ( azzie at netpolicy.com ) There are a great many other contributors to both the client and server Index: client/configure diff -u client/configure:1.7 client/configure:1.8 --- client/configure:1.7 Sun Aug 13 21:42:35 2000 +++ client/configure Thu Aug 24 22:57:39 2000 @@ -18,9 +18,9 @@ ac_help="$ac_help --disable-gtk make x11 client [default=make gtk client if available]" ac_help="$ac_help - --with-xpm-lib=dir provide different directory to find xpm lib in " + --with-ldflags=dir provide addition linker directives to find libraries " ac_help="$ac_help - --with-xpm-inc=dir provide different directory to find xpm includes in " + --with-includes=dir provide different compiler options to find headers with " ac_help="$ac_help --with-sound-dir=dir Directory where the sounds are located (default=/usr/local/lib/sounds) " ac_help="$ac_help @@ -1132,17 +1132,17 @@ -# Check whether --with-xpm-lib or --without-xpm-lib was given. -if test "${with_xpm_lib+set}" = set; then - withval="$with_xpm_lib" - XPMLIB="-L$withval" XPMRUN="-R$withval" +# Check whether --with-ldflags or --without-ldflags was given. +if test "${with_ldflags+set}" = set; then + withval="$with_ldflags" + EXTRA_LIB="$withval" fi -# Check whether --with-xpm-inc or --without-xpm-inc was given. -if test "${with_xpm_inc+set}" = set; then - withval="$with_xpm_inc" - XPMINC="-I$withval" +# Check whether --with-includes or --without-includes was given. +if test "${with_includes+set}" = set; then + withval="$with_includes" + EXTRA_INC="$withval" fi @@ -2792,7 +2792,6 @@ GTK_CFLAGS="$GTK_CFLAGS" - CPPFLAGS="$CPPFLAGS $XPMINC" TARGET="gcfclient cfclient" else echo "$ac_t""GTK not found - building xlib client" 1>&6 @@ -2800,19 +2799,19 @@ TARGET="cfclient" - CPPFLAGS="$CPPFLAGS $XPMINC" echo Xlibs: $X_LIBS echo Extras: $X_EXTRA_LIBS echo Xpre: $X_PRE_LIBS fi -LDFLAGS="$LDFLAGS $XPMLIB" +CPPFLAGS="$CPPFLAGS $EXTRA_INC" +LDFLAGS="$LDFLAGS $EXTRA_LIB" if eval "test x$need_r_flag = xyes"; then - LDFLAGS="$LDFLAGS $XPMRUN" + LDFLAGS="$LDFLAGS" fi echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6 -echo "configure:2816: checking for main in -lasound" >&5 +echo "configure:2815: checking for main in -lasound" >&5 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2820,14 +2819,14 @@ ac_save_LIBS="$LIBS" LIBS="-lasound -lm $LIBS" cat > conftest.$ac_ext <<EOF -#line 2824 "configure" +#line 2823 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:2831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2848,7 +2847,7 @@ fi echo $ac_n "checking for alNewConfig in -laudio""... $ac_c" 1>&6 -echo "configure:2852: checking for alNewConfig in -laudio" >&5 +echo "configure:2851: checking for alNewConfig in -laudio" >&5 ac_lib_var=`echo audio'_'alNewConfig | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2856,7 +2855,7 @@ ac_save_LIBS="$LIBS" LIBS="-laudio $LIBS" cat > conftest.$ac_ext <<EOF -#line 2860 "configure" +#line 2859 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2867,7 +2866,7 @@ alNewConfig() ; return 0; } EOF -if { (eval echo configure:2871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2889,17 +2888,17 @@ ac_safe=`echo "sys/soundcard.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/soundcard.h""... $ac_c" 1>&6 -echo "configure:2893: checking for sys/soundcard.h" >&5 +echo "configure:2892: checking for sys/soundcard.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2898 "configure" +#line 2897 "configure" #include "confdefs.h" #include <sys/soundcard.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2923,17 +2922,17 @@ ac_safe=`echo "sys/audioio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/audioio.h""... $ac_c" 1>&6 -echo "configure:2927: checking for sys/audioio.h" >&5 +echo "configure:2926: checking for sys/audioio.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2932 "configure" +#line 2931 "configure" #include "confdefs.h" #include <sys/audioio.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2996,7 +2995,6 @@ - if test -n "$DEBUGFLAG"; then CFLAGS="$DEBUGFLAG $CFLAGS" fi @@ -3027,7 +3025,7 @@ if eval "test x$networklibs = xyes"; then echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:3031: checking for main in -lnsl" >&5 +echo "configure:3029: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3035,14 +3033,14 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF -#line 3039 "configure" +#line 3037 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:3046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3063,7 +3061,7 @@ fi echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:3067: checking for main in -lsocket" >&5 +echo "configure:3065: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3071,14 +3069,14 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <<EOF -#line 3075 "configure" +#line 3073 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:3082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3102,12 +3100,12 @@ gcfc_save_CPPFLAGS="$CPPFLAGS" gcfc_save_LIBS="$LIBS" -CPPFLAGS="$GTK_CFLAGS $CPPFLAGS $X_CFLAGS" +CPPFLAGS="$GTK_CFLAGS $CPPFLAGS $X_CFLAGS $EXTRA_INC" LIBS="$LIBS $GTK_LIBS $X_LIBS" if test -z "$LIBXPM_LIB"; then echo $ac_n "checking for XpmReadFileToXpmImage in -lXpm""... $ac_c" 1>&6 -echo "configure:3111: checking for XpmReadFileToXpmImage in -lXpm" >&5 +echo "configure:3109: checking for XpmReadFileToXpmImage in -lXpm" >&5 ac_lib_var=`echo Xpm'_'XpmReadFileToXpmImage | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3115,7 +3113,7 @@ ac_save_LIBS="$LIBS" LIBS="-lXpm $X_LIBS $LIBS" cat > conftest.$ac_ext <<EOF -#line 3119 "configure" +#line 3117 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3126,7 +3124,7 @@ XpmReadFileToXpmImage() ; return 0; } EOF -if { (eval echo configure:3130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3147,17 +3145,17 @@ ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6 -echo "configure:3151: checking for X11/xpm.h" >&5 +echo "configure:3149: checking for X11/xpm.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3156 "configure" +#line 3154 "configure" #include "confdefs.h" #include <X11/xpm.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3176,19 +3174,19 @@ XPM='xpm'; LIBXPM_LIB='-lXpm' else echo "$ac_t""no" 1>&6 -{ echo "configure: error: XPM header file not found - you may need to use --with-xpm-inc=dir" 1>&2; exit 1; } +{ echo "configure: error: XPM header file not found - you may need to use --with-includes=-Idir" 1>&2; exit 1; } fi else echo "$ac_t""no" 1>&6 -{ echo "configure: error: XPM library not found - you may need to use --with-xpm-lib=dir" 1>&2; exit 1; } +{ echo "configure: error: XPM library not found - you may need to use --with-ldflags=-Ldir" 1>&2; exit 1; } fi fi echo $ac_n "checking for main in -lXext""... $ac_c" 1>&6 -echo "configure:3192: checking for main in -lXext" >&5 +echo "configure:3190: checking for main in -lXext" >&5 ac_lib_var=`echo Xext'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3196,14 +3194,14 @@ ac_save_LIBS="$LIBS" LIBS="-lXext $LIBS" cat > conftest.$ac_ext <<EOF -#line 3200 "configure" +#line 3198 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:3207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3230,23 +3228,27 @@ -echo $ac_n "checking for main in -lpng""... $ac_c" 1>&6 -echo "configure:3235: checking for main in -lpng" >&5 -ac_lib_var=`echo png'_'main | sed 'y%./+-%__p_%'` +echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6 +echo "configure:3233: checking for sqrt in -lm" >&5 +ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lpng $LIBS" +LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF -#line 3243 "configure" +#line 3241 "configure" #include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char sqrt(); int main() { -main() +sqrt() ; return 0; } EOF -if { (eval echo configure:3250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3261,36 +3263,36 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo png | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <<EOF #define $ac_tr_lib 1 EOF - LIBS="-lpng $LIBS" + LIBS="-lm $LIBS" else echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for main in -ldmalloc""... $ac_c" 1>&6 -echo "configure:3279: checking for main in -ldmalloc" >&5 -ac_lib_var=`echo dmalloc'_'main | sed 'y%./+-%__p_%'` +echo $ac_n "checking for main in -lpng""... $ac_c" 1>&6 +echo "configure:3281: checking for main in -lpng" >&5 +ac_lib_var=`echo png'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-ldmalloc $LIBS" +LIBS="-lpng $LIBS" cat > conftest.$ac_ext <<EOF -#line 3287 "configure" +#line 3289 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:3294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3305,40 +3307,36 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + ac_tr_lib=HAVE_LIB`echo png | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <<EOF #define $ac_tr_lib 1 EOF - LIBS="-ldmalloc $LIBS" + LIBS="-lpng $LIBS" else echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6 -echo "configure:3323: checking for sqrt in -lm" >&5 -ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'` +echo $ac_n "checking for main in -ldmalloc""... $ac_c" 1>&6 +echo "configure:3325: checking for main in -ldmalloc" >&5 +ac_lib_var=`echo dmalloc'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lm $LIBS" +LIBS="-ldmalloc $LIBS" cat > conftest.$ac_ext <<EOF -#line 3331 "configure" +#line 3333 "configure" #include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char sqrt(); int main() { -sqrt() +main() ; return 0; } EOF -if { (eval echo configure:3342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3353,13 +3351,13 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <<EOF #define $ac_tr_lib 1 EOF - LIBS="-lm $LIBS" + LIBS="-ldmalloc $LIBS" else echo "$ac_t""no" 1>&6 @@ -3367,13 +3365,14 @@ + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3372: checking for ANSI C header files" >&5 +echo "configure:3371: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3377 "configure" +#line 3376 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -3381,7 +3380,7 @@ #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3398,7 +3397,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 3402 "configure" +#line 3401 "configure" #include "confdefs.h" #include <string.h> EOF @@ -3416,7 +3415,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 3420 "configure" +#line 3419 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -3437,7 +3436,7 @@ : else cat > conftest.$ac_ext <<EOF -#line 3441 "configure" +#line 3440 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3448,7 +3447,7 @@ exit (0); } EOF -if { (eval echo configure:3452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3475,17 +3474,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3479: checking for $ac_hdr" >&5 +echo "configure:3478: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3484 "configure" +#line 3483 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3489: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3513,12 +3512,12 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3517: checking for working const" >&5 +echo "configure:3516: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3522 "configure" +#line 3521 "configure" #include "confdefs.h" int main() { @@ -3567,7 +3566,7 @@ ; return 0; } EOF -if { (eval echo configure:3571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3588,12 +3587,12 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3592: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3591: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3597 "configure" +#line 3596 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -3602,7 +3601,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3625,13 +3624,13 @@ if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:3629: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:3628: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext <<EOF -#line 3635 "configure" +#line 3634 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -3649,7 +3648,7 @@ if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 3653 "configure" +#line 3652 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -3671,12 +3670,12 @@ fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:3675: checking for vprintf" >&5 +echo "configure:3674: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3680 "configure" +#line 3679 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vprintf(); below. */ @@ -3699,7 +3698,7 @@ ; return 0; } EOF -if { (eval echo configure:3703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -3723,12 +3722,12 @@ if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:3727: checking for _doprnt" >&5 +echo "configure:3726: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3732 "configure" +#line 3731 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt(); below. */ @@ -3751,7 +3750,7 @@ ; return 0; } EOF -if { (eval echo configure:3755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -3778,12 +3777,12 @@ for ac_func in mkdir socket strcspn sysconf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3782: checking for $ac_func" >&5 +echo "configure:3781: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3787 "configure" +#line 3786 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3806,7 +3805,7 @@ ; return 0; } EOF -if { (eval echo configure:3810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4014,7 +4013,6 @@ s%@GUI_OBJS@%$GUI_OBJS%g s%@GUI_SRCS@%$GUI_SRCS%g s%@SND_LIBS@%$SND_LIBS%g -s%@XPMRUN@%$XPMRUN%g s%@TARGET@%$TARGET%g s%@XPM@%$XPM%g s%@SOUNDDIR@%$SOUNDDIR%g Index: client/configure.in diff -u client/configure.in:1.7 client/configure.in:1.8 --- client/configure.in:1.7 Sun Aug 13 21:42:35 2000 +++ client/configure.in Thu Aug 24 22:57:39 2000 @@ -48,11 +48,11 @@ dnl resides if not with the normal X11 stuff (ie, in /usr/local and not /usr dnl /usr/X11 -AC_ARG_WITH(xpm-lib, [ --with-xpm-lib=dir provide different directory to find xpm lib in ], - XPMLIB="-L$withval" XPMRUN="-R$withval") +AC_ARG_WITH(ldflags, [ --with-ldflags=dir provide addition linker directives to find libraries ], + EXTRA_LIB="$withval") -AC_ARG_WITH(xpm-inc, [ --with-xpm-inc=dir provide different directory to find xpm includes in ], - XPMINC="-I$withval") +AC_ARG_WITH(includes, [ --with-includes=dir provide different compiler options to find headers with ], + EXTRA_INC="$withval") AC_ARG_WITH(sound-dir, [ --with-sound-dir=dir Directory where the sounds are located (default=/usr/local/lib/sounds) ], SOUNDDIR="$withval") @@ -125,7 +125,6 @@ GTK_CFLAGS="$GTK_CFLAGS" AC_SUBST(GTK_LIBS) AC_SUBST(GTK_CFLAGS) - CPPFLAGS="$CPPFLAGS $XPMINC" TARGET="gcfclient cfclient" dnl AC_DEFINE(GTK_CLIENT) else @@ -134,15 +133,15 @@ AC_SUBST(X_LIBS) AC_SUBST(X_CFLAGS) TARGET="cfclient" - CPPFLAGS="$CPPFLAGS $XPMINC" echo Xlibs: $X_LIBS echo Extras: $X_EXTRA_LIBS echo Xpre: $X_PRE_LIBS fi -LDFLAGS="$LDFLAGS $XPMLIB" +CPPFLAGS="$CPPFLAGS $EXTRA_INC" +LDFLAGS="$LDFLAGS $EXTRA_LIB" if eval "test x$need_r_flag = xyes"; then - LDFLAGS="$LDFLAGS $XPMRUN" + LDFLAGS="$LDFLAGS" fi AC_CHECK_LIB(asound, main, alsa_sound=yes, , -lm) @@ -187,7 +186,6 @@ AC_SUBST(GUI_SRCS) AC_SUBST(SND_LIBS) AC_SUBST(LDFLAGS) -AC_SUBST(XPMRUN) AC_SUBST(TARGET) @@ -232,7 +230,7 @@ dnl Save and modify CPPFLAGS and LIBS (to include X and GTK paths temporarily). gcfc_save_CPPFLAGS="$CPPFLAGS" gcfc_save_LIBS="$LIBS" -CPPFLAGS="$GTK_CFLAGS $CPPFLAGS $X_CFLAGS" +CPPFLAGS="$GTK_CFLAGS $CPPFLAGS $X_CFLAGS $EXTRA_INC" LIBS="$LIBS $GTK_LIBS $X_LIBS" dnl Test for libXpm @@ -241,8 +239,8 @@ AC_DEFINE(HAVE_LIBXPM) AC_CHECK_HEADER(X11/xpm.h, XPM='xpm'; LIBXPM_LIB='-lXpm', - AC_MSG_ERROR(XPM header file not found - you may need to use --with-xpm-inc=dir)), - AC_MSG_ERROR(XPM library not found - you may need to use --with-xpm-lib=dir), $X_LIBS) + AC_MSG_ERROR(XPM header file not found - you may need to use --with-includes=-Idir)), + AC_MSG_ERROR(XPM library not found - you may need to use --with-ldflags=-Ldir), $X_LIBS) fi dnl Put this here so we get the gdk libs @@ -259,13 +257,14 @@ AC_SUBST(LIBS) +dnl sound.c needs sqrt. So does png (on some systems) +AC_CHECK_LIB(m, sqrt) + AC_CHECK_LIB(png, main) dnl not strictly needed, but since the X11 client uses it, lets use it here AC_CHECK_LIB(dmalloc, main) -dnl sound.c needs sqrt -AC_CHECK_LIB(m, sqrt) dnl Checks for header files. Index: client/gx11.c diff -u client/gx11.c:1.7 client/gx11.c:1.8 --- client/gx11.c:1.7 Sun Aug 13 21:42:35 2000 +++ client/gx11.c Thu Aug 24 22:57:39 2000 @@ -1,6 +1,6 @@ /* * static char *rcsid_xio_c = - * "$Id: gx11.c,v 1.7 2000/08/14 04:42:35 cvs Exp $"; + * "$Id: gx11.c,v 1.8 2000/08/25 05:57:39 cvs Exp $"; * * This file handles all the windowing stuff. The idea is * that all of it is in one file, so to port to different systems @@ -853,8 +853,8 @@ if (!strcmp(inbuf,"display")) { if (!strcmp(cp,"xpm")) display_mode=Xpm_Display; - else if (!strcmp(cp,"pixmap")) - display_mode = Pix_Display; + if (!strcmp(cp,"png")) + display_mode=Png_Display; else fprintf(stderr,"Unknown display specication in %s, %s", path, cp); continue; @@ -932,8 +932,8 @@ fprintf(fp,"server: %s\n", server); if (display_mode==Xpm_Display) { fprintf(fp,"display: xpm\n"); - } else if (display_mode==Pix_Display) { - fprintf(fp,"display: pixmap\n"); + } else if (display_mode==Png_Display) { + fprintf(fp,"display: png\n"); } fprintf(fp,"cacheimages: %s\n", cache_images?"True":"False"); fprintf(fp,"split: %s\n", split_windows?"True":"False"); @@ -1238,60 +1238,62 @@ void FaceCmd(unsigned char *data, int len) { - int pnum; - char *face,buf[MAX_BUF]; + int pnum; + char *face,buf[MAX_BUF]; - /* A quick sanity check, since if client isn't caching, all the data - * structures may not be initialized. - */ + /* A quick sanity check, since if client isn't caching, all the data + * structures may not be initialized. + */ - if (!cache_images) { - fprintf(stderr,"Received a 'face' command when we are not caching\n"); - return; - } - pnum = GetShort_String(data); - face = (char *)data+2; - data[len] = '\0'; - /* To prevent having a directory with 2000 images, we do a simple - * split on the first 2 characters. - */ - sprintf(buf,"%s/%c%c/%s", facecachedir, face[0], face[1],face); + if (!cache_images) { + fprintf(stderr,"Received a 'face' command when we are not caching\n"); + return; + } + pnum = GetShort_String(data); + face = (char *)data+2; + data[len] = '\0'; + /* To prevent having a directory with 2000 images, we do a simple + * split on the first 2 characters. + */ + sprintf(buf,"%s/%c%c/%s", facecachedir, face[0], face[1],face); - if (display_mode == Xpm_Display) - strcat(buf,".xpm"); - else if (display_mode == Png_Display) - strcat(buf,".png"); + if (display_mode == Xpm_Display) + strcat(buf,".xpm"); + else if (display_mode == Png_Display) + strcat(buf,".png"); - /* check to see if we already have the file. IF not, we need to request - * it from the server. - */ - if (access(buf,R_OK)) { + /* check to see if we already have the file. IF not, we need to request + * it from the server. + */ + if (access(buf,R_OK)) { - requestface(pnum, face, buf); + requestface(pnum, face, buf); - } else if (display_mode == Xpm_Display) { + } else { + if (display_mode == Xpm_Display) { - GtkStyle *style; + GtkStyle *style; - style = gtk_widget_get_style(gtkwin_root); - pixmaps[pnum].gdkpixmap = gdk_pixmap_create_from_xpm(gtkwin_root->window, + style = gtk_widget_get_style(gtkwin_root); + pixmaps[pnum].gdkpixmap = gdk_pixmap_create_from_xpm(gtkwin_root->window, &pixmaps[pnum].gdkmask, &style->bg[GTK_STATE_NORMAL], (gchar *) buf ); - if (!pixmaps[pnum].gdkpixmap) { - requestface(pnum, face, buf); + if (!pixmaps[pnum].gdkpixmap) { + requestface(pnum, face, buf); + } } - } - else if (display_mode == Png_Display) { + else if (display_mode == Png_Display) { #ifdef HAVE_LIBPNG - if (png_to_gdkpixmap(gtkwin_root->window, buf, &pixmaps[pnum].gdkpixmap, + if (png_to_gdkpixmap(gtkwin_root->window, buf, &pixmaps[pnum].gdkpixmap, &pixmaps[pnum].gdkmask,gtk_widget_get_colormap(gtkwin_root))) { - fprintf(stderr,"Got error on png_to_gdkpixmap\n"); - requestface(pnum, face, buf); - } + fprintf(stderr,"Got error on png_to_gdkpixmap\n"); + requestface(pnum, face, buf); + } #endif - } + } + } /* else Don't have image */ } @@ -6217,7 +6219,6 @@ puts("-display <name> - Use <name> instead if DISPLAY environment variable.\n"); puts("-split - Use split windows."); puts("-echo - Echo the bound commands"); - puts("-pix - Use bitmaps instead of the font."); #ifdef Xpm_Pix puts("-xpm - Use color pixmaps (XPM) for display."); #endif @@ -6301,11 +6302,6 @@ fprintf(stderr,"Ignoring -png flag\n"); continue; #endif - } - else if (!strcmp(argv[on_arg],"-pix")) { - display_mode = Pix_Display; - image_size=24; - continue; } else if (!strcmp(argv[on_arg],"-cache")) { cache_images= TRUE; Index: client/xutil.c diff -u client/xutil.c:1.8 client/xutil.c:1.9 --- client/xutil.c:1.8 Sun Aug 13 21:42:35 2000 +++ client/xutil.c Thu Aug 24 22:57:39 2000 @@ -1,6 +1,6 @@ /* * static char *rcsid_xio_c = - * "$Id: xutil.c,v 1.8 2000/08/14 04:42:35 cvs Exp $"; + * "$Id: xutil.c,v 1.9 2000/08/25 05:57:39 cvs Exp $"; * * This contains varous 'support' functions. These functions will probably * go mostly unaltered between different toolkits, as long as X11 is still @@ -1220,6 +1220,8 @@ if (!strcmp(inbuf,"display")) { if (!strcmp(cp,"xpm")) display_mode=Xpm_Display; + if (!strcmp(cp,"png")) + display_mode=Png_Display; else if (!strcmp(cp,"pixmap")) display_mode = Pix_Display; else fprintf(stderr,"Unknown display specication in %s, %s", @@ -1297,6 +1299,8 @@ fprintf(fp,"display: xpm\n"); } else if (display_mode==Pix_Display) { fprintf(fp,"display: pixmap\n"); + } else if (display_mode==Png_Display) { + fprintf(fp,"display: png\n"); } fprintf(fp,"cacheimages: %s\n", cache_images?"True":"False"); fprintf(fp,"split: %s\n", split_windows?"True":"False");