This file is indexed.

/usr/bin/cs-config-2.0 is in libcrystalspace-dev 2.0+dfsg-1build1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
#!/bin/sh
# Config Script for Crystal Space, outputs compiler flags for compiling 
# Crystal Space applications
# (c)2002,2003 by Matthias Braun <matze@braunis.de>
#
# ...code stolen from gnome-config...
# From autoconf:
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  echo "#! /bin/sh" >conf$$.sh
  echo  "exit 0"   >>conf$$.sh
  chmod +x conf$$.sh
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
    PATH_SEPARATOR=';'
  else
    PATH_SEPARATOR=:
  fi
  rm -f conf$$.sh
fi

CS_VERSION=2.0
CRYSTAL="${CRYSTAL-/usr$PATH_SEPARATOR.}"
CRYSTAL_2_0="${CRYSTAL_2_0-$CRYSTAL}"
_CRYSTAL_ACTUAL="$CRYSTAL_2_0"

# On MinGW, CRYSTAL may contain the path in one of two flavors:
# MSYS paths, separated by , or Win32 paths, separated
# by ';'. Since for the configure check we need MSYS paths, CRYSTAL
# is first treated like a Win32-style list. If that yields sensible
# results these are used subsequently. Otherwise use CRYSTAL as-is.
if test "`uname -s | sed -e 's+\(.*\)_.*+\1+'`" = "MINGW32" ; then
    NEW_CRYSTAL=''
    my_IFS=$IFS; IFS=\;
    for win32_dir in $_CRYSTAL_ACTUAL; do
        win32_dir=`echo $win32_dir | tr '\\\\' '/'  | sed "s/\(.\):/\\/\\1/"`
        if test -d "$win32_dir"; then
            if test -n "$NEW_CRYSTAL"; then
                NEW_CRYSTAL="$NEW_CRYSTAL$PATH_SEPARATOR"
            fi
            NEW_CRYSTAL="$NEW_CRYSTAL$win32_dir"
        fi
    done
    IFS=$my_IFS
    if test -n "$NEW_CRYSTAL"; then
        _CRYSTAL_ACTUAL="$NEW_CRYSTAL"
    fi
fi

my_IFS=$IFS; IFS=$PATH_SEPARATOR
for p in $_CRYSTAL_ACTUAL
do
  prefix="${p}"
  exec_prefix="${prefix}"
  makeout="./out/linux/optimize"
  version="2.0"
  longversion="crystalspace 2.0"
  newincdir=""
  # try to determine if we're in a source or installed CS version
  if test "x$includedir_main" = "x"
  then
    if [ -r ${prefix}/include/crystalspace-2.0/cssysdef.h ] ; then
      newincdir="${prefix}/include/crystalspace-2.0"
      includedir_main=$newincdir
    elif [ -r ${prefix}/include/cssysdef.h ] ; then
      newincdir="${prefix}/include"
      includedir_main=$newincdir
    fi
  fi
  if test "x$includedir_config" = "x"
  then
    if [ -r ${prefix}/include/crystalspace-2.0/csconfig.h ] ; then
      newincdir="${prefix}/include/crystalspace-2.0"
      includedir_config=$newincdir
    elif [ -r ${prefix}/include/csconfig.h ] ; then
      newincdir="${prefix}/include"
      includedir_config=$newincdir
    fi
  fi
  if test -n "$newincdir"
  then
    if test "x$includedir" = "x"
    then
      includedir="$newincdir"
    else
      includedir="$includedir$PATH_SEPARATOR$newincdir"
    fi
  fi
done
IFS=$my_IFS
if test "x$includedir" = "x"
then
  includedir="/usr/include/crystalspace-2.0"
fi
syslibs=" -lc -lm -ldl -lnsl -L/usr/local/lib "
common_cflags="  "
common_cxxflags="   "
staticdeps="crystalspace_staticplugins.jam"

makevars()
{
cat << "__EOF__"
LFLAGS.L = -L
LFLAGS.l = -l
CFLAGS.D = -D
CFLAGS.I = -I
EXE=
DLL=.so
LIBS.EXE.PLATFORM=-ldl -lm -lnsl
LFLAGS.GENERAL=$(LFLAGS.L)/usr/local/lib -lpthread
LFLAGS.DLL=-shared -Wl,-soname -Wl,$@

__EOF__
}
# dependencies of CS
depends()
{
    case $1 in
        -lcrystalspace-2.0) DEPS=" -lz -lpthread -lpthread" ;;
        -lcrystalspace_opengl-2.0) DEPS=" -lcrystalspace-2.0 -lGL -lXext -lX11 -lX11 -lXext -lpthread -lm" ;;
        -lcrystalspace_staticplugins-2.0) DEPS="" ;;

	*)
	    CEXFILE=.cex
	    findcexfile "$CEXFILE"
	    if test -r "$CEXFILE"; then
		DEPS=`/bin/sh $CEXFILE --deps`
	    else
		DEPS=''
	    fi
	    ;;                                        	    
    esac
}

checklibname()
{
    case $1 in
     crystalspace) 
	addlib "-lcrystalspace-2.0" 	
	;;			
     crystalspace_opengl) 
	addlib "-lcrystalspace_opengl-2.0" 	
	;;			
     crystalspace_staticplugins) 
	addlib "-lcrystalspace_staticplugins-2.0" 	
	;;			

    *)
	findcexfile "$1"
	if test -z "$CEXFILE"; then
	    echo "Unknown library: $1; consult --help for library list" 1>&2
	    exit 1
	fi
	
	addexlib "$CEXFILE"
        ;;
    esac
}

liblist=" crystalspace crystalspace_opengl
"
liblist_opt=" crystalspace_staticplugins
"

libcrystalspace=crystalspace-2.0
 libcrystalspace_opengl=crystalspace_opengl-2.0
 libcrystalspace_staticplugins=crystalspace_staticplugins-2.0



# Hack to do variable indirection for posix compliant systems that don't use bash (like ubuntu)
give_libbase()
{
  case $1 in
    "crystalspace"):
      libbase=crystalspace-2.0 ;;
    "crystalspace_opengl"):
      libbase=crystalspace_opengl-2.0 ;;
    "crystalspace_staticplugins"):
      libbase=crystalspace_staticplugins-2.0 ;;

    *)
      # should never ever happen
      echo "Internal error, due to unspecified libbase."
      exit;;
    esac
}

# Detect type of the installation and the directories where the library files
# reside in.
libdir=""
lflags=""

for libname in lib${libcrystalspace}.so \
	       lib${libcrystalspace}.dylib \
	       lib${libcrystalspace}.a \
	       ; do
    if test -r "$prefix/Jamfile" && \
	test -r "$prefix/$makeout/libs/$libname"; then
	libdir="$prefix/$makeout/libs"
	lflags="-L$libdir"
    elif test -z "$libdir" && test -r "${exec_prefix}/lib/$libname"; then
	libdir="${exec_prefix}/lib"
	lflags="-L${exec_prefix}/lib"
    # Test default locations for cases where CS is installed using a
    # package manager
    elif test -z "$libdir"; then
        for p in lib lib64 lib32 ; do
            if test -r "/usr/${p}/$libname"; then
                libdir="/usr/${p}"
                lflags="-L$libdir"
                break
            fi
        done
    else
	my_IFS=$IFS; IFS=$PATH_SEPARATOR
	for p in $_CRYSTAL_ACTUAL
	  do
	  if test -r "$p/Jamfile" && \
	      test -r "$p/$makeout/libs/$libname"; then
	      libdir="$p/$makeout/libs"
	      lflags="-L$libdir"
	      break
	  elif test -z "$libdir" && test -r "${p}/lib/$libname"; then
	      libdir="${p}/lib"
	      lflags="-L$libdir"
	      break
	  fi
	done
	IFS=$my_IFS
    fi
    if test -n "$lflags" ; then
        break
    fi
done

# Look for build tools such as relaytool
tools_sentinel=relaytool
if test -x "$prefix/bin/$tools_sentinel" ; then
    tools_prefix="$prefix"
elif test -x "$exec_prefix/bin/$tools_sentinel"; then
    tools_prefix="$exec_prefix"
else
    my_IFS=$IFS; IFS=$PATH_SEPARATOR
    for p in $_CRYSTAL_ACTUAL
    do
      if test -x "$p/bin/$tools_sentinel" ; then
	  tools_prefix="$p"
	  break
      fi
    done
    IFS=$my_IFS
fi

# Check for optional libs, add to list if present.

for l in $liblist_opt
do
  give_libbase $l
  if test -r "$libdir/lib$libbase.so" \
    || test -r "$libdir/lib$libbase.dylib" \
    || test -r "$libdir/lib$libbase.a" ; then
    liblist="$liblist $l"
  fi
done

usage()
{
	cat <<EOF
Usage: cs-config-$CS_VERSION [OPTIONS] [LIBRARIES]
Options:
	[--prefix]
	[--exec-prefix]
	[--tools-prefix]
	[--version]
	[--long-version]
	[--libdir]
	[--includedir]
	[--libs]
	[--cflags]
	[--cxxflags]
	[--available-libs]
	[--makevars]
	[--staticdeps]
	[--help]
Libraries:
EOF
    for lib in $liblist; do
	echo "        $lib"
    done
    cat <<EOF
Note that the Crystal Space directory is detect by examining the CRYSTAL
environment variable. Ensure that this variable is set correctly.
EOF
}

includedeps()
{
#we have to remember vars here because on older shells $1,$2... are global
    id_first=$1
    id_all=$@
    shift
    id_second=$1
    id_rest=$@

# already had all dependencies of this lib? then exit
    case " $ALREADY_TESTED " in
    	*\ ${id_first}\ *) return 0;;
    	*) ;;
    esac

# if not add 1 dependency
    depends ${id_first}
    ALREADY_TESTED="$ALREADY_TESTED ${id_first}"
    for a in $DEPS; do
	case " ${id_all} " in
	    *\ $a\ *) ;;
    	    *)  
		the_libs="${the_libs} $a"
	    	return 1
	    ;;
	esac
    done
    if test -n "${id_second}"; then
	if includedeps ${id_rest}; then
	    return 0
	else
	    return 1
	fi
    else
	return 0
    fi
}

addlib()
{
    # Lib already in list?
    case " $the_libs " in
	*\ $1\ *) return;;
	*) ;;
    esac

    the_libs="$1 $the_libs"

    # loop till all dependencies are resolved
    loop=true
    while $loop; do
	includedeps $the_libs
	if test $? -eq 0; then
	    loop=false
	else
	    ALREADY_TESTED=""
	fi
    done
}

findcexfile()
{
#   file in search path?
    for p in $CSCONFPATH; do
	if test -f "$p/$1.cex"; then
	    CEXFILE="$p/$1.cex"
	    return
	fi
    done

    if test -f "$_CRYSTAL_ACTUAL/bin/$1.cex"; then
	CEXFILE="$_CRYSTAL_ACTUAL/bin/$1.cex"
	return
    fi
    
    if test -f "$_CRYSTAL_ACTUAL/$1.cex"; then
	CEXFILE="$_CRYSTAL_ACTUAL/$1.cex"
	return
    fi

    CEXFILE=""
}      

addexlib()
{
    EXDEP=`/bin/sh $1 --deps`
    EXLIB=`/bin/sh $1 --libs`
    EXCXXFLAGS=`/bin/sh $1 --cxxflags`
    EXCFLAGS=`/bin/sh $1 --cflags`
    add_cxxflags="$add_cxxflags $EXCXXFLAGS"
    add_cflags="$add_cflags $EXCFLAGS"

    for lib in "$EXDEP"; do
	addlib "$lib"
    done

    if test -n "$EXLIB"; then
        addlib "$EXLIB"
    fi
}

# Author: Keith Marshall <keith.marshall@total.com>
# Source: http://article.gmane.org/gmane.comp.gnu.mingw.msys/2785
msys_canonical_path()
{
  mcp_dir="$1"
  pwd -W >/dev/null 2>&1 && mcp_pwd_w="pwd -W" || mcp_pwd_w=pwd
  until mcp_val=`exec 2>/dev/null; cd "$mcp_dir" && $mcp_pwd_w`
  do
     mcp_dir=`dirname "$mcp_dir"`
  done
  mcp_dir=`echo "$mcp_dir" | sed 's?^[./]*??'`
  mcp_val=`echo "$mcp_val" | sed 's?/*$??'`
  echo "$1" | sed "s?^[./]*$mcp_dir/*?$mcp_val/?"';s?/*$??'
}

raw_names=""
the_libs=""
show_libs=""
show_cflags=""
show_cxxflags=""
show_availlibs=""

if test $# -eq 0; then
	usage 1>&2
	exit 1
fi

while test $# -gt 0; do
  case $1 in
    --prefix)
	echo $prefix
	exit 0
	;;
    --exec-prefix)
	echo $exec_prefix
	exit 0
	;;
    --tools-prefix)
	echo $tools_prefix
	exit 0
	;;
    --help)
	usage
	exit 0
	;;
    --version)
        echo $version
        exit 0
        ;;
    --long-version|--longversion)
	echo $longversion
	exit 0
	;;
    --libdir)
	echo $libdir
	exit 0
	;;
    --includedir)
	echo $includedir_main
	exit 0
	;;
    --cflags)
        show_cflags=true
        ;;
    --includes)
	show_includes=true
	;;
    --cxxflags)
	show_cxxflags=true
	;;
    --makevars)
	makevars
	exit 0
	;;
    --libs)
	show_libs=true
	;;
    --available-libs)
	show_availlibs=true
	;;
    --static-deps)
	echo `msys_canonical_path $libdir`/$staticdeps
	exit 0
	;;
    *)
	raw_names="$raw_names $1"
        ;;
  esac
  shift
done

# This is tested late in order to allow --help to work even if the Crystal
# Space directory is not found.
if test -z "$lflags"; then
  cat 1>&2 <<EOF
Failed to detect directory containing Crystal Space link libraries; aborting!
Did you build Crystal Space? Did you set the CRYSTAL environment variable
correctly?
EOF
  exit 1
fi

inc_dir_shown=""
my_IFS=$IFS; IFS=$PATH_SEPARATOR
for p in $includedir
do
  inc_dir_shown="$inc_dir_shown -I$p"
done
IFS=$my_IFS

if test -n "$show_cflags"; then
	echo "$inc_dir_shown $common_cflags $add_cflags"
else
    if test -n "$show_cxxflags"; then
	echo "$inc_dir_shown $common_cxxflags $add_cxxflags"
    else
	if test -n "$show_includes"; then
	    echo "$inc_dir_shown"
	fi
    fi
fi    
    
if test -n "$show_libs"; then
    # If user specified no libraries, then emit commonly needed ones.
    if test -z "$raw_names"; then
	raw_names="$liblist"
    fi
    for do_lib in $raw_names; do
	checklibname $do_lib
    done
    echo "$lflags $the_libs $syslibs"
fi

if test -n "$show_availlibs"; then
    # If user specified no libraries, then emit all.
    if test -z "$raw_names"; then
	for x in $liblist; do
	    echo $x
	done
    else
	# Filter the user-supplied list down to valid entries. It is not an
	# error for the user-supplied list to contain unknown library names;
	# we are filtering the list down to names which are valid under this
	# installation's configuration. For instance, the client might request
	# `csplugincommon_osx', and we do not want to emit an error when the
	# request is made on GNU/Linux; we just want to return a usable subset
	# of those requested. Other options, such as --cflags, --libs, etc.,
	# will emit an appropriate error for unknown library requests.
	for x in $raw_names; do
	    for z in $liblist; do
		if test "_$x" = "_$z"; then
		    echo $x
		    break
		fi
	    done
        done
    fi
fi

exit 0