Re: GTK+ Compiling

Mikkel L. Ellertson (mikkel@execpc.com)
Sat, 31 Oct 1998 12:34:40 -0600


--=====================_909880480==_
Content-Type: text/plain; charset="us-ascii"

At 11:35 PM 10/31/98 MYT, you wrote:
>
>hi there,
>
>I have been trying to compile GTK+ and it says that it needs X
>Libraries.. I thought it was a part of the X windows system, but
>apparently, the files seem to be missing, and they are not a part of the
>SuSE 5.2 distribution. Where do I get the X Libraries from? In
>particular, I am looking for a file called Intrinsic.h.
>
You need the include files for the X libraries. Lood for the devel
package for X. Look for XFree86-devel-3.3.1-xx.i386.rpm where xx
depends on the version of X you have. Change i386 if you are not
running on Intell...

>One more thing :)
>
>I am connected to a network, where win95 rules, and I am the only linux
>user.. is it possible that I can print to a printer that is connected to
>a win95 machine? Is it possible using the samba thing??
>
>Thanks a lot for your time..
>
>Regards,
>
>Shibu
>
Using smbclient from the Samba package will let you print to a
printer attached to a windows machine. The only thing I am not
sure of is how they would handle Postscript output if the printer
driver doesn't handle it. (My printers handle it just fine.)
Here is the printcap entry:

##PRINTTOOL3## SMB ljet4 600x600 letter {} LaserJet4 Default {}
NEC:\
:sd=/var/spool/lpd/lp0:\
:mx#0:\
:sh:\
:if=/var/spool/lpd/lp0/filter:\
:af=/var/spool/lpd/lp0/acct:\
:lp=/dev/null:

I have attached the print filter to this message... (It is a
standard RedHat print filter...)

Have fun!
Mikkel

--=====================_909880480==_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="FILTER"

#!/bin/bash
#
#
# New smart print filter
#
#
# determines input file magic
#
# looks in the default filter plugin (FPI) directory
# finds all *.fpi files, then finds a combination that will
# yield the desired file type, or will indicate this is=
impossible.
#

function filtfrom {
echo -ne ${1%-to-*}
}

function filtto {
echo -ne ${1#*-to-}
}

#
# given filters as input vars, find next level available given the
# first arg is the starting point
#
function nextlvl {

local try
local start
local all
local depth

#
#
# $1 is starting point, find something that will work
#
start=3D"$1"
shift

depth=3D"$1"
shift

all=3D"$@"

#
# get out of here if too deep!
#
if [ $depth -ge $MAX_DEPTH ]; then
return 1
fi
if [ $DEBUG_TREE ]; then
echo "Starting point =3D $start" >> /tmp/filter.debug
fi

if [ $(filtto $start) =3D $DESIRED_TO ]; then
echo " DONE"
return 0
fi

while [ $1 ]; do
try=3D$1
shift
if [ $DEBUG_TREE ]; then
echo "for $start trying $try" >> /tmp/filter.debug
fi
if [ $(filtfrom $try) =3D $(filtto $start) ]; then
echo -n "$start.fpi:$depth:CONT "

if [ $(filtto $try) =3D $DESIRED_TO ]; then
echo -n "$try.fpi:$((depth+1)):DONE "
return 0
else
# echo -n $try
nextlvl $try $((depth+1)) $all
# echo "|G is $G| "
if [ $DEBUG_TREE ]; then
echo "|rt is $?|" >> /tmp/filter.debug
fi
if [ "$?" =3D "0" ]
then
if [ $DEBUG_TREE ]; then
echo "for $start we are done" >> /tmp/filter.debug
fi
# return 0
else
if [ $DEBUG_TREE ]; then
echo "for $start we have failed" >> /tmp/filter.debug
fi
return 1
fi
fi
fi
# echo ""
done
}

#
# MAIN
#
#

#
#
# setup some global variables used by this script
#
#

#
# FPIDIR points to where print filter plug-ins are stored
# Normally these will be installed with a package via RPM
#
FPIDIR=3D/usr/lib/rhs/rhs-printfilters/

PATH=3D${FPIDIR}:${PATH}

#
# MAX_DEPTH determines how long a string of filters will be
# tried as a possible printing solution. How many input
# formats will take 6 filters to output Postscript!
# Unlikely this will need to be changed.
#
MAX_DEPTH=3D6

#
# define these to gets lots of feedback
# output is appended on /tmp/filter.debug
#
DEBUG_TREE=3D""
DEBUG_FILTER=3D""

#
# Setup variables available to all filter plug-ins
#
#

#
# SPOOLDIR is directory which lpd is spooling from
#
export SPOOLDIR=3D$(pwd)

#
# Get queue specific information (which was written by printtool)
#
source ${SPOOLDIR}/general.cfg

if [ "$DEBUG_FILTER" !=3D "" ]; then
echo "Desired print format is $DESIRED_TO" >> /tmp/filter.debug
echo "Paper size is $PAPERSIZE" >> /tmp/filter.debug
echo -n "A form feed will " >> /tmp/filter.debug
if [ "$SEND_EOF" =3D "" ]; then
echo "not be sent." >> /tmp/filter.debug
else
echo "be sent." >> /tmp/filter.debug
fi
fi

cd $FPIDIR
fpis=3D$(ls *.fpi 2> /dev/null | tr '\n' ' ' | sed 's/\.fpi//g')

#
# let's see if its a compressed file first
#
#
# Figure out the magic of the input file
#
magic=3D$(file -)
$FPIDIR/rewindstdin
magic=3D${magic#*: }
if [ "$DEBUG_FILTER" !=3D "" ]; then
echo "Magic is |$magic|" >> /tmp/filter.debug
fi
case `echo $magic | tr 'A-Z' 'a-z'` in
*packed*|*gzip*|*compress* )
DECOMPRESS=3D"gzip -dc";;
* )
DECOMPRESS=3D"";;
esac

#
# Figure out the magic of the input file
#
if [ "$DECOMPRESS" =3D "" ]; then
magic=3D$(file -)
else
magic=3D$($DECOMPRESS - | file -)
fi
$FPIDIR/rewindstdin
magic=3D${magic#*: }
if [ "$DEBUG_FILTER" !=3D "" ]; then
echo "Magic is |$magic|" >> /tmp/filter.debug
fi
case `echo $magic | tr 'A-Z' 'a-z'` in
*empty* )
exit;;
"pc bitmap data"* )
startpnt=3D"INPUT-to-bmp";;
"gif image data"* )
startpnt=3D"INPUT-to-gif";;
"jpeg image data"* )
startpnt=3D"INPUT-to-jpeg";;
"tiff image data"* )
startpnt=3D"INPUT-to-tiff";;
"sun raster image data"* )
startpnt=3D"INPUT-to-rast";;
"pgm"*|"pbm"*|"ppm"* )
startpnt=3D"INPUT-to-pnm";;
postscript* )
startpnt=3D"INPUT-to-ps";;
"tex dvi file"* )
startpnt=3D"INPUT-to-dvi";;
"fig image text"* )
startpnt=3D"INPUT-to-fig";;
# troff is safe again with groff-1.11a or later we hope
"troff or preprocessor"* )
startpnt=3D"INPUT-to-troff";;
"rpm"* )
startpnt=3D"INPUT-to-rpm";;
*ascii*|*text*|*english*|*script* )
startpnt=3D"INPUT-to-asc";;
*data*|*escape* )
startpnt=3D"INPUT-to-prdata";;
*pcl* )
startpnt=3D"INPUT-to-prdata";;
* )
startpnt=3D"INPUT-to-unknown";=
;
esac

#
# here is where we could put in hook to call user routine(s) to
# handle extra magics they've defined filters for
#
# call_user_magic_hook()
#
if [ "$DEBUG_FILTER" !=3D "" ]; then
echo "Type of file is $startpnt" >> /tmp/filter.debug
fi

if [ "$startpnt" =3D "Dont know" ]; then
echo "Error - input file type is unknown - cannot print"
exit 1
fi

#
# catch some easy cases without having to figure out best path the hard=
way
#
bestpath=3D""
foundbest=3D"NO"
if [ $(filtto $startpnt) =3D "asc" ]; then
if [ "$ASCII_TO_PS" =3D "NO" ]; then
bestpath=3D"$startpnt | asc-to-printer.fpi"
foundbest=3D"YES"
fi
elif [ $(filtto $startpnt) =3D "prdata" ]; then
bestpath=3D"$startpnt | cat -"
foundbest=3D"YES"
elif [ $(filtto $startpnt) =3D $DESIRED_TO ]; then
bestpath=3D"$startpnt | $DESIRED_TO-to-printer.fpi"
foundbest=3D"YES"
fi

if [ "$foundbest" !=3D "YES" ]; then
#
# we go through and find best path
#
G=3D`nextlvl "$startpnt" "0" $fpis`

if [ "$DEBUG_FILTER" !=3D "" ]; then
echo "$G" >> /tmp/filter.debug
fi

#
# now sort out the best path of all available
#
#
# if no processing required, depth will equal 'DONE'
#
if [ "${G# *}" !=3D "DONE" ]; then
root=3D""
bestdepth=3D$((MAX_DEPTH*2))
bestpath=3D""
curdepth=3D"0"
depth=3D"0"
foundbest=3D"NO"
for i in $G; do
entry=3D${i%%:*}
depth=3D${i#*:}
depth=3D${depth%:*}
if [ $depth -le $curdepth ]; then
while [ $(($depth <=3D $curdepth && $curdepth >=3D 0)) -eq 1 ];=
do
root=3D${root%* | *}
curdepth=3D$(($curdepth - 1))
done
fi
if [ $(($curdepth < 0)) -eq 1 ]; then
root=3D""
fi
curdepth=3D$depth
if [ "$root" =3D "" ]; then
root=3D"$entry"
else
root=3D"$root | $entry"
fi
if [ ${i##*:} =3D "DONE" ]; then
if [ "$DEBUG_FILTER" !=3D "" ]; then
echo "$root -> depth =3D $depth" >> /tmp/filter.debug
fi
if [ $depth -lt $bestdepth ]; then
foundbest=3D"YES"
bestdepth=3D$depth
bestpath=3D$root
fi
fi
done
fi

if [ "$foundbest" =3D "YES" ]; then
bestpath=3D"$bestpath | $DESIRED_TO-to-printer.fpi"
fi
#
# end of doing it the hard way
#
fi
#
# we have to add filter to convert desired format to something the
# printer can handle. May be as simple as 'cat'
#
#
# ok we got here, and if input data magic is 'data' we'll let it
# through, hoping it really will work on the printer!
# Note we still reject lots of magics, like ELF, by doing this
# which is what we want
#
#
# getting bad, but trapping all "special" cases here
#
#
if [ "$foundbest" =3D "NO" ]; then
printf "No way to print this type of input file: $magic \014"
exit 0
else
#
# fix up the best path so we can run it
#
if [ "$DECOMPRESS" =3D "" ]; then
bestpath=3D"cat - ${bestpath#* }"
else
bestpath=3D"$DECOMPRESS ${bestpath#* }"
fi
fi

#
# any post-filter to run (like smbclient?)
#
if [ "$PRINTER_TYPE" =3D "SMB" ]; then
bestpath=3D"$bestpath | ${FPIDIR}/smbprint ${SPOOLDIR}/acct"
fi

if [ "$DEBUG_FILTER" !=3D "" ]; then
echo "Best path of depth $bestdepth is $bestpath" >>=
/tmp/filter.debug
fi

#
# run the command!
#
eval $bestpath 2>/dev/null

#
#
# see if we need to send a form feed to eject the page from printer
#
# if [ "$SEND_EOF" !=3D "" ]; then
# printf "\014"
# fi

exit 0

--=====================_909880480==_
Content-Type: text/plain; charset="us-ascii"

---
    Do not meddle in the affairs of dragons,
 for you are crunchy and taste good with ketchup.

--=====================_909880480==_--

- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.rutgers.edu