source: trunk/config.sh@ 8446

Last change on this file since 8446 was 8446, checked in by gf, 9 years ago

webif: Compress built-in templates.

Use the minilzo code that we already have to compress the built-in
templates. This saves ~90k binary size on 32bit defconfig. As the
tool reports:

Compressed 148820 template bytes into 51619 bytes. 97201 saved bytes (65.31%).

The old code that works with non-compressed templates is still here,
to use it, comment #define USE_COMPRESSION 1 in webif/pages_gen.c
and recompile.

Once we establish that template compression works fine the old
code can be removed.

This commit introduces no user visible changes.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 17.6 KB
Line 
1#!/bin/sh
2
3addons="WEBIF TOUCH HAVE_DVBAPI IRDETO_GUESSING CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_SSL WITH_LB CS_CACHEEX CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT IPV6SUPPORT"
4protocols="MODULE_CAMD33 MODULE_CAMD35 MODULE_CAMD35_TCP MODULE_NEWCAMD MODULE_CCCAM MODULE_CCCSHARE MODULE_GBOX MODULE_RADEGAST MODULE_SERIAL MODULE_CONSTCW MODULE_PANDORA MODULE_GHTTP"
5readers="READER_NAGRA READER_IRDETO READER_CONAX READER_CRYPTOWORKS READER_SECA READER_VIACCESS READER_VIDEOGUARD READER_DRE READER_TONGFANG READER_BULCRYPT READER_GRIFFIN READER_DGCRYPT"
6card_readers="CARDREADER_PHOENIX CARDREADER_INTERNAL CARDREADER_SC8IN1 CARDREADER_MP35 CARDREADER_SMARGO CARDREADER_DB2COM CARDREADER_STAPI"
7
8defconfig="
9CONFIG_WEBIF=y
10CONFIG_TOUCH=y
11CONFIG_HAVE_DVBAPI=y
12CONFIG_IRDETO_GUESSING=y
13CONFIG_CS_ANTICASC=y
14CONFIG_WITH_DEBUG=y
15CONFIG_MODULE_MONITOR=y
16# CONFIG_WITH_SSL=n
17CONFIG_WITH_LB=y
18CONFIG_CS_CACHEEX=y
19CONFIG_CW_CYCLE_CHECK=y
20# CONFIG_LCDSUPPORT=n
21# CONFIG_LEDSUPPORT=n
22# CONFIG_IPV6SUPPORT=n
23# CONFIG_MODULE_CAMD33=n
24CONFIG_MODULE_CAMD35=y
25CONFIG_MODULE_CAMD35_TCP=y
26CONFIG_MODULE_NEWCAMD=y
27CONFIG_MODULE_CCCAM=y
28CONFIG_MODULE_CCCSHARE=y
29CONFIG_MODULE_GBOX=y
30CONFIG_MODULE_RADEGAST=y
31CONFIG_MODULE_SERIAL=y
32CONFIG_MODULE_CONSTCW=y
33CONFIG_MODULE_PANDORA=y
34# CONFIG_MODULE_GHTTP=n
35CONFIG_WITH_CARDREADER=y
36CONFIG_READER_NAGRA=y
37CONFIG_READER_IRDETO=y
38CONFIG_READER_CONAX=y
39CONFIG_READER_CRYPTOWORKS=y
40CONFIG_READER_SECA=y
41CONFIG_READER_VIACCESS=y
42CONFIG_READER_VIDEOGUARD=y
43CONFIG_READER_DRE=y
44CONFIG_READER_TONGFANG=y
45CONFIG_READER_BULCRYPT=y
46CONFIG_READER_GRIFFIN=y
47CONFIG_READER_DGCRYPT=y
48CARDREADER_PHOENIX=y
49CARDREADER_INTERNAL=y
50CARDREADER_SC8IN1=y
51CARDREADER_MP35=y
52CARDREADER_SMARGO=y
53CARDREADER_DB2COM=y
54CARDREADER_STAPI=y
55"
56
57usage() {
58 echo \
59"OSCam config
60Usage: `basename $0` [parameters]
61
62 -g, --gui Start interactive configuration
63
64 -s, --show-enabled [param] Show enabled configuration options.
65 -Z, --show-disabled [param] Show disabled configuration options.
66 -S, --show-valid [param] Show valid configuration options.
67 Possible params: all, addons, protocols,
68 readers, card_readers
69
70 -l, --list-config List active configuration variables.
71 -e, --enabled [option] Check if certain option is enabled.
72 -d, --disabled [option] Check if certain option is disabled.
73
74 -E, --enable [option] Enable config option.
75 -D, --disable [option] Disable config option.
76
77 The following [option]s enable or disable multiple settings.
78 all - Everything.
79 addons - All addons.
80 protocols - All protocols.
81 readers - All readers.
82 card_readers - All card readers.
83
84 -R, --restore Restore default config.
85
86 -v, --oscam-version Display OSCam version.
87 -r, --oscam-revision Display OSCam SVN revision.
88
89 -O, --detect-osx-sdk-version Find where OS X SDK is located
90
91 -h, --help Display this help text.
92
93Examples:
94 # Enable WEBIF and SSL
95 ./config.sh --enable WEBIF WITH_SSL
96
97 # Disable WEBIF but enable WITH_SSL
98 ./config.sh --disable WEBIF --enable WITH_SSL
99
100 # Restore defaults and disable WEBIF and READER_NAGRA
101 ./config.sh --restore --disable WEBIF READER_NAGRA
102
103 # Use default config with only one enabled reader
104 ./config.sh --restore --disable readers --enable READER_BULCRYPT
105
106 # Disable everything and enable webif one module and one card reader
107 ./config.sh --disable all --enable WEBIF MODULE_NEWCAMD READER_BULCRYPT
108
109 # Disable all card readers except INTERNAL
110 ./config.sh -D card_readers -E CARDREADER_INTERNAL
111
112Available options:
113 addons: $addons
114 protocols: $protocols
115 readers: $readers
116 card_readers: $card_readers
117"
118}
119
120# Output directory for config.mak set by --objdir parameter
121OBJDIR=.
122
123# Use flags set by --use-flags parameter
124USE_FLAGS=
125
126have_flag() {
127 for FLAG in $USE_FLAGS
128 do
129 [ $FLAG = "$1" ] && return 0
130 done
131 return 1
132}
133
134have_all_flags() {
135 for opt ; do
136 have_flag $opt || return 1
137 done
138 return 0
139}
140
141have_any_flags() {
142 for opt ; do
143 have_flag $opt && return 0
144 done
145 return 1
146}
147
148not_have_flag() {
149 for FLAG in $USE_FLAGS
150 do
151 [ $FLAG = "$1" ] && return 1
152 done
153 return 0
154}
155
156not_have_all_flags() {
157 for opt ; do
158 not_have_flag $opt || return 1
159 done
160 return 0
161}
162
163not_have_any_flags() {
164 for opt ; do
165 not_have_flag $opt && return 0
166 done
167 return 1
168}
169
170# Config functions
171enabled() {
172 grep "^\#define $1 1$" config.h >/dev/null 2>/dev/null
173 return $?
174}
175
176disabled() {
177 grep "^\#define $1 1$" config.h >/dev/null 2>/dev/null
178 test $? = 0 && return 1
179 return 0
180}
181
182enabled_all() {
183 for opt ; do
184 enabled $opt || return 1
185 done
186 return 0
187}
188
189disabled_all() {
190 for opt ; do
191 disabled $opt || return 1
192 done
193 return 0
194}
195
196enabled_any() {
197 for opt ; do
198 enabled $opt && return 0
199 done
200 return 1
201}
202
203disabled_any() {
204 for opt ; do
205 disabled $opt && return 0
206 done
207 return 1
208}
209
210list_enabled() {
211 for OPT in $@
212 do
213 enabled $OPT && echo $OPT
214 done
215}
216
217list_disabled() {
218 for OPT in $@
219 do
220 disabled $OPT && echo $OPT
221 done
222}
223
224valid_opt() {
225 [ "$1" = "WITH_CARDREADER" ] && return 0 # Special case
226 echo $addons $protocols $readers $card_readers | grep -w "$1" >/dev/null
227 return $?
228}
229
230enable_opt() {
231 valid_opt $1 && disabled $1 && {
232 sed -i.bak -e "s|//#define $1 1$|#define $1 1|g" config.h && rm config.h.bak
233 echo "Enable $1"
234 }
235}
236
237enable_opts() {
238 for OPT in $@
239 do
240 enable_opt $OPT
241 done
242}
243
244disable_opt() {
245 valid_opt $1 && enabled $1 && {
246 sed -i.bak -e "s|#define $1 1$|//#define $1 1|g" config.h && rm config.h.bak
247 echo "Disable $1"
248 }
249}
250
251disable_opts() {
252 for OPT in $@
253 do
254 disable_opt $OPT
255 done
256}
257
258get_opts() {
259 OPTS=""
260 case "$1" in
261 'addons') OPTS="$addons" ; ;;
262 'protocols') OPTS="$protocols" ; ;;
263 'readers') OPTS="$readers" ; ;;
264 'card_readers') OPTS="$card_readers" ; ;;
265 *) OPTS="$addons $protocols $readers $card_readers" ; ;;
266 esac
267 echo $OPTS
268}
269
270update_deps() {
271 # Calculate dependencies
272 enabled_any $(get_opts readers) $(get_opts card_readers) && enable_opt WITH_CARDREADER >/dev/null
273 disabled_all $(get_opts readers) $(get_opts card_readers) && disable_opt WITH_CARDREADER >/dev/null
274 enabled MODULE_CCCSHARE && enable_opt MODULE_CCCAM >/dev/null
275 enabled_any CARDREADER_DB2COM CARDREADER_MP35 CARDREADER_SC8IN1 && enable_opt CARDREADER_PHOENIX >/dev/null
276}
277
278list_config() {
279 update_deps
280 # Handle use flags
281 have_flag USE_STAPI && echo "CONFIG_WITH_STAPI=y" || echo "# CONFIG_WITH_STAPI=n"
282 have_flag USE_COOLAPI && echo "CONFIG_WITH_COOLAPI=y" || echo "# CONFIG_WITH_COOLAPI=n"
283 have_flag USE_AZBOX && echo "CONFIG_WITH_AZBOX=y" || echo "# CONFIG_WITH_AZBOX=n"
284 have_flag USE_MCA && echo "CONFIG_WITH_MCA=y" || echo "# CONFIG_WITH_MCA=n"
285 have_flag USE_LIBCRYPTO && echo "CONFIG_WITH_LIBCRYPTO=y" || echo "# CONFIG_WITH_LIBCRYPTO=n"
286 for OPT in $addons $protocols WITH_CARDREADER $readers
287 do
288 enabled $OPT && echo "CONFIG_$OPT=y" || echo "# CONFIG_$OPT=n"
289 done
290 for OPT in $card_readers
291 do
292 if [ $OPT = CARDREADER_INTERNAL ]
293 then
294 # Internal card reader is actually three different readers depending on USE flags
295 enabled $OPT && have_flag USE_AZBOX && echo "CONFIG_${OPT}_AZBOX=y" || echo "# CONFIG_${OPT}_AZBOX=n"
296 enabled $OPT && have_flag USE_COOLAPI && echo "CONFIG_${OPT}_COOLAPI=y" || echo "# CONFIG_${OPT}_COOLAPI=n"
297 enabled $OPT && not_have_all_flags USE_AZBOX USE_COOLAPI && echo "CONFIG_${OPT}_SCI=y" || echo "# CONFIG_${OPT}_SCI=n"
298 continue
299 fi
300 if [ $OPT = CARDREADER_STAPI ]
301 then
302 # Enable CARDREADER_STAPI only if USE_STAPI is set
303 enabled $OPT && have_flag USE_STAPI && echo "CONFIG_$OPT=y" || echo "# CONFIG_$OPT=n"
304 continue
305 fi
306 enabled $OPT && echo "CONFIG_$OPT=y" || echo "# CONFIG_$OPT=n"
307 done
308 have_flag USE_LIBUSB && echo "CONFIG_CARDREADER_SMART=y" || echo "# CONFIG_CARDREADER_SMART=n"
309 have_flag USE_PCSC && echo "CONFIG_CARDREADER_PCSC=y" || echo "# CONFIG_CARDREADER_PCSC=n"
310 # Extra modules/libraries
311 enabled_any MODULE_GBOX WEBIF && echo "CONFIG_LIB_MINILZO=y" || echo "# CONFIG_LIB_MINILZO=n"
312 not_have_flag USE_LIBCRYPTO && echo "CONFIG_LIB_AES=y" || echo "# CONFIG_LIB_AES=n"
313 enabled MODULE_CCCAM && echo "CONFIG_LIB_RC6=y" || echo "# CONFIG_LIB_RC6=n"
314 not_have_flag USE_LIBCRYPTO && enabled MODULE_CCCAM && echo "CONFIG_LIB_SHA1=y" || echo "# CONFIG_LIB_SHA1=n"
315 enabled_any MODULE_NEWCAMD READER_DRE && echo "CONFIG_LIB_DES=y" || echo "# CONFIG_LIB_DES=n"
316 enabled_any MODULE_CCCAM READER_NAGRA && echo "CONFIG_LIB_IDEA=y" || echo "# CONFIG_LIB_IDEA=n"
317 not_have_flag USE_LIBCRYPTO && enabled_any READER_CONAX READER_CRYPTOWORKS READER_NAGRA && echo "CONFIG_LIB_BIGNUM=y" || echo "# CONFIG_LIB_BIGNUM=n"
318 have_flag CMAKE && echo "# *** OSCAM WAS BUILD WITH cmake THIS CONFIGURATION IS NOT COMPLETE ***"
319}
320
321make_config_c() {
322 OPENSSL=$(which openssl 2>/dev/null)
323 if [ "$OPENSSL" = "" ]
324 then
325 echo "// openssl not found!"
326 echo "const char *config_mak = \"CFG: openssl not found in PATH!\";"
327 else
328 echo "// This file is generated by ./config.sh --objdir $OBJDIR --make-config.mak"
329 echo "const char *config_mak ="
330 printf " \"\\\nCFG: strings FILE | sed -n 's/^CFG~//p' | openssl enc -d -base64 | gzip -d\\\n\"\n"
331 gzip -9 < $OBJDIR/config.mak | $OPENSSL enc -base64 | while read LINE
332 do
333 printf " \"CFG~%s\\\\n\"\n" "$LINE"
334 done
335 echo " ;"
336 fi
337}
338
339make_config_mak() {
340 TMPFILE=$(mktemp -t config.mak.XXXXXX) || exit 1
341 list_config > $TMPFILE
342 [ ! -d $OBJDIR ] && mkdir -p $OBJDIR 2>/dev/null
343 cmp $TMPFILE $OBJDIR/config.mak >/dev/null 2>/dev/null
344 if [ $? != 0 ]
345 then
346 cat $TMPFILE > $OBJDIR/config.mak
347 make_config_c > $OBJDIR/config.c
348 else
349 make_config_c > $TMPFILE
350 cmp $TMPFILE $OBJDIR/config.c >/dev/null 2>/dev/null
351 [ $? != 0 ] && cat $TMPFILE > $OBJDIR/config.c
352 fi
353 rm -rf $TMPFILE
354}
355
356check_test() {
357 if [ "$(cat $tempfileconfig | grep "^#define $1 1$")" != "" ]; then
358 echo "on"
359 else
360 echo "off"
361 fi
362}
363
364disable_all() {
365 for i in $1; do
366 sed -i.bak -e "s/^#define ${i} 1$/\/\/#define ${i} 1/g" $tempfileconfig
367 done
368}
369
370enable_package() {
371 for i in $(cat $tempfile); do
372 strip=$(echo $i | sed "s/\"//g")
373 sed -i.bak -e "s/\/\/#define ${strip} 1$/#define ${strip} 1/g" $tempfileconfig
374 done
375}
376
377print_components() {
378 clear
379 echo "You have selected the following components:"
380 echo
381 echo "Add-ons:"
382 for i in $addons; do
383 printf "\t%-20s: %s\n" $i $(check_test "$i")
384 done
385
386 echo
387 echo "Protocols:"
388 for i in $protocols; do
389 printf "\t%-20s: %s\n" $i $(check_test "$i")
390 done
391
392 echo
393 echo "Readers:"
394 for i in $readers; do
395 printf "\t%-20s: %s\n" $i $(check_test "$i")
396 done
397
398 echo
399 echo "Card readers:"
400 for i in $card_readers; do
401 printf "\t%-20s: %s\n" $i $(check_test "$i")
402 done
403
404 cp -f $tempfileconfig $configfile
405}
406
407menu_addons() {
408 ${DIALOG} --checklist "\nChoose add-ons:\n " $height $width $listheight \
409 WEBIF "Web Interface" $(check_test "WEBIF") \
410 TOUCH "Touch Web Interface" $(check_test "TOUCH") \
411 HAVE_DVBAPI "DVB API" $(check_test "HAVE_DVBAPI") \
412 IRDETO_GUESSING "Irdeto guessing" $(check_test "IRDETO_GUESSING") \
413 CS_ANTICASC "Anti cascading" $(check_test "CS_ANTICASC") \
414 WITH_DEBUG "Debug messages" $(check_test "WITH_DEBUG") \
415 MODULE_MONITOR "Monitor" $(check_test "MODULE_MONITOR") \
416 WITH_SSL "OpenSSL support" $(check_test "WITH_SSL") \
417 WITH_LB "Loadbalancing" $(check_test "WITH_LB") \
418 CS_CACHEEX "Cache exchange" $(check_test "CS_CACHEEX") \
419 CW_CYCLE_CHECK "CW Cycle Check" $(check_test "CW_CYCLE_CHECK") \
420 LCDSUPPORT "LCD support" $(check_test "LCDSUPPORT") \
421 LEDSUPPORT "LED support" $(check_test "LEDSUPPORT") \
422 IPV6SUPPORT "IPv6 support (experimental)" $(check_test "IPV6SUPPORT") \
423 2> ${tempfile}
424
425 opt=${?}
426 if [ $opt != 0 ]; then return; fi
427
428 disable_all "$addons"
429 enable_package
430}
431
432menu_protocols() {
433 ${DIALOG} --checklist "\nChoose protocols:\n " $height $width $listheight \
434 MODULE_CAMD33 "camd 3.3" $(check_test "MODULE_CAMD33") \
435 MODULE_CAMD35 "camd 3.5 UDP" $(check_test "MODULE_CAMD35") \
436 MODULE_CAMD35_TCP "camd 3.5 TCP" $(check_test "MODULE_CAMD35_TCP") \
437 MODULE_NEWCAMD "newcamd" $(check_test "MODULE_NEWCAMD") \
438 MODULE_CCCAM "CCcam" $(check_test "MODULE_CCCAM") \
439 MODULE_CCCSHARE "CCcam share" $(check_test "MODULE_CCCSHARE") \
440 MODULE_GBOX "gbox" $(check_test "MODULE_GBOX") \
441 MODULE_RADEGAST "radegast" $(check_test "MODULE_RADEGAST") \
442 MODULE_SERIAL "Serial" $(check_test "MODULE_SERIAL") \
443 MODULE_CONSTCW "constant CW" $(check_test "MODULE_CONSTCW") \
444 MODULE_PANDORA "Pandora" $(check_test "MODULE_PANDORA") \
445 MODULE_GHTTP "Ghttp" $(check_test "MODULE_GHTTP") \
446 2> ${tempfile}
447
448 opt=${?}
449 if [ $opt != 0 ]; then return; fi
450
451 disable_all "$protocols"
452 enable_package
453}
454
455menu_readers() {
456 ${DIALOG} --checklist "\nChoose readers (CA systems):\n " $height $width $listheight \
457 READER_NAGRA "Nagravision" $(check_test "READER_NAGRA") \
458 READER_IRDETO "Irdeto" $(check_test "READER_IRDETO") \
459 READER_CONAX "Conax" $(check_test "READER_CONAX") \
460 READER_CRYPTOWORKS "Cryptoworks" $(check_test "READER_CRYPTOWORKS") \
461 READER_SECA "Seca" $(check_test "READER_SECA") \
462 READER_VIACCESS "Viaccess" $(check_test "READER_VIACCESS") \
463 READER_VIDEOGUARD "NDS Videoguard" $(check_test "READER_VIDEOGUARD") \
464 READER_DRE "DRE Crypt" $(check_test "READER_DRE") \
465 READER_TONGFANG "Tongfang" $(check_test "READER_TONGFANG") \
466 READER_BULCRYPT "Bulcrypt" $(check_test "READER_BULCRYPT") \
467 READER_GRIFFIN "Griffin" $(check_test "READER_GRIFFIN") \
468 READER_DGCRYPT "DGCrypt" $(check_test "READER_DGCRYPT") \
469 2> ${tempfile}
470
471 opt=${?}
472 if [ $opt != 0 ]; then return; fi
473
474 disable_all "$readers"
475 enable_package
476}
477
478menu_card_readers() {
479 ${DIALOG} --checklist "\nChoose card reader drivers:\n " $height $width $listheight \
480 CARDREADER_PHOENIX "Phoenix/mouse" $(check_test "CARDREADER_PHOENIX") \
481 CARDREADER_INTERNAL "Internal (Sci,Azbox,Cool)" $(check_test "CARDREADER_INTERNAL") \
482 CARDREADER_SC8IN1 "SC8in1" $(check_test "CARDREADER_SC8IN1") \
483 CARDREADER_MP35 "AD-Teknik MP 3.6/USB Phoenix" $(check_test "CARDREADER_MP35") \
484 CARDREADER_SMARGO "Argolis Smargo Smartreader" $(check_test "CARDREADER_SMARGO") \
485 CARDREADER_DB2COM "dbox2" $(check_test "CARDREADER_DB2COM") \
486 CARDREADER_STAPI "STAPI" $(check_test "CARDREADER_STAPI") \
487 2> ${tempfile}
488
489 opt=${?}
490 if [ $opt != 0 ]; then return; fi
491
492 disable_all "$card_readers"
493 enable_package
494}
495
496
497config_dialog() {
498 height=30
499 width=65
500 listheight=16
501
502 DIALOG=${DIALOG:-`which dialog`}
503 if [ -z "${DIALOG}" ]; then
504 echo "Please install dialog package." 1>&2
505 exit 1
506 fi
507
508 configfile=config.h
509 tempfile=$(mktemp -t oscam-config.dialog.XXXXXX) || exit 1
510 tempfileconfig=$(mktemp -t oscam-config.h.XXXXXX) || exit 1
511 trap 'rm -f $tempfile $tempfileconfig $tempfileconfig.bak 2>/dev/null' INT TERM EXIT
512 cp -f $configfile $tempfileconfig
513
514 while true; do
515 ${DIALOG} --menu "\nSelect category:\n " $height $width $listheight \
516 Add-ons "Add-ons" \
517 Protocols "Network protocols" \
518 Readers "Readers (CA systems)" \
519 CardReaders "Card reader drivers" \
520 Save "Save" \
521 2> ${tempfile}
522
523 opt=${?}
524 if [ $opt != 0 ]; then clear; exit; fi
525
526 menuitem=`cat $tempfile`
527 case $menuitem in
528 Add-ons) menu_addons ;;
529 Protocols) menu_protocols ;;
530 Readers) menu_readers ;;
531 CardReaders) menu_card_readers ;;
532 Save)
533 print_components
534 update_deps
535 exit 0
536 ;;
537 esac
538 done
539}
540
541# Change working directory to the directory where the script is
542cd $(dirname $0)
543
544if [ $# = 0 ]
545then
546 usage
547 exit 1
548fi
549
550while [ $# -gt 0 ]
551do
552 case "$1" in
553 '-g'|'--gui'|'--config'|'--menuconfig')
554 config_dialog
555 break
556 ;;
557 '-s'|'--show-enabled'|'--show')
558 shift
559 list_enabled $(get_opts $1)
560 break
561 ;;
562 '-Z'|'--show-disabled')
563 shift
564 list_disabled $(get_opts $1)
565 break
566 ;;
567 '-S'|'--show-valid')
568 shift
569 for OPT in $(get_opts $1)
570 do
571 echo $OPT
572 done
573 break
574 ;;
575 '-E'|'--enable')
576 shift
577 while [ "$1" != "" ]
578 do
579 case "$1" in
580 -*)
581 update_deps
582 continue 2
583 ;;
584 all|addons|protocols|readers|card_readers)
585 enable_opts $(get_opts $1)
586 ;;
587 *)
588 enable_opt "$1"
589 ;;
590 esac
591 shift
592 done
593 update_deps
594 ;;
595 '-D'|'--disable')
596 shift
597 while [ "$1" != "" ]
598 do
599 case "$1" in
600 -*)
601 update_deps
602 continue 2
603 ;;
604 all|addons|protocols|readers|card_readers)
605 disable_opts $(get_opts $1)
606 ;;
607 *)
608 disable_opt "$1"
609 ;;
610 esac
611 shift
612 done
613 update_deps
614 ;;
615 '-R'|'--restore')
616 echo $defconfig | sed -e 's|# ||g' | xargs printf "%s\n" | grep "=y$" | sed -e 's|^CONFIG_||g;s|=.*||g' |
617 while read OPT
618 do
619 enable_opt "$OPT"
620 done
621 echo $defconfig | sed -e 's|# ||g' | xargs printf "%s\n" | grep "=n$" | sed -e 's|^CONFIG_||g;s|=.*||g' |
622 while read OPT
623 do
624 disable_opt "$OPT"
625 done
626 update_deps
627 ;;
628 '-e'|'--enabled')
629 enabled $2 && echo "Y" && exit 0 || echo "N" && exit 1
630 break
631 ;;
632 '-d'|'--disabled')
633 disabled $2 && echo "Y" && exit 0 || echo "N" && exit 1
634 break
635 ;;
636 '-v'|'--oscam-version')
637 grep CS_VERSION globals.h | cut -d\" -f2
638 break
639 ;;
640 '-r'|'--oscam-revision')
641 (svnversion -n . 2>/dev/null || printf 0) | sed 's/.*://; s/[^0-9]*$//; s/^$/0/'
642 break
643 ;;
644 '-O'|'--detect-osx-sdk-version')
645 shift
646 OSX_VER=${1:-10.8}
647 for DIR in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX{$OSX_VER,10.8,10.7}.sdk /Developer/SDKs/MacOSX{$OSX_VER,10.6,10.5}.sdk
648 do
649 if test -d $DIR
650 then
651 echo $DIR
652 exit 0
653 fi
654 done
655 echo Cant_find_OSX_SDK
656 break
657 ;;
658 '-l'|'--list-config')
659 list_config
660 exit 0
661 ;;
662 '-m'|'--make-config.mak')
663 make_config_mak
664 exit 0
665 ;;
666 '--use-flags')
667 shift
668 USE_FLAGS=$1
669 ;;
670 '--objdir')
671 shift
672 OBJDIR=$1
673 ;;
674 '-h'|'--help')
675 usage
676 break
677 ;;
678 *)
679 echo "[WARN] Unknown parameter: $1" >&2
680 ;;
681 esac
682 # Some shells complain when there are no more parameters to shift
683 test $# -gt 0 && shift
684done
685
686exit 0
Note: See TracBrowser for help on using the repository browser.