?? configure.sh
字號:
#!/bin/sh# csh and tcsh do not like this file# ash produces incorrect quotingif [ "`/bin/ls -la /bin/sh |grep '\-> ash'`" != "" ]; then echo -e "\nash shell is not supported\n" exitfi##############################################################################CC="cc"LD="cc"CFLAGS="-O2 -Wall"LFLAGS=""PROG="bfe2"OWNER="root"GROUP="root"DOCFILES="BUGS CHANGELOG COMMANDS COPYRIGHT INSTALL README.bferc TODO bferc-sample"# install directoriesPREFIX="/usr/local"BIN="bin"SYSCONF="etc"DOC="share/doc/bfe2"BOCHSPATH="bochs"############################################################################### Platform configurationsOPTIONS=""GTK="1.2"BOCHS="2.0"PLATFORM=`uname`if [ "$PLATFORM" = "FreeBSD" ]; then CC=%%CC%% LD=%%CC%% CFLAGS=%%CFLAGS%% GROUP="wheel" PREFIX=%%PREFIX%%fi############################################################################### Parse command line optionsDEBUG="NO"while [ $1 ]; do if [ "$1" = "--help" ]; then echo "" echo -e "\t--prefix [path]\tSet prefix path [default: $PREFIX]" echo -e "\t--bindir [path]\tSet binary path [default: \$PREFIX/$BIN]" echo -e "\t--sysconfdir [path]\tSet config path [default: \$PREFIX/$SYSCONF]" echo -e "\t--docdir [path]\tSet help files path [default: \$PREFIX/$DOC]" echo -e "\t--bochs-path [path]\tSet path to Bochs binary [default: $BOCHSPATH]" echo -e "\t--bochs [ver]\tSet Bochs version: 2.0 [default: $BOCHS]" echo -e "\t--gtk [ver]\tSet GTK version: 1.2 or 2.0 [default: $GTK]" echo -e "\t--quiet\t\t\tEnable fewer configure.sh messages" echo -e "\t--debug\t\t\tEnable debugging" echo -e "\t--confirm-quit\t\tEnable quit confirmation" echo "" exit elif [ "$1" = "--confirm-quit" ]; then OPTIONS="$OPTIONS -D__CONFIRM_QUIT__" shift elif [ "$1" = "--debug" ]; then OPTIONS="$OPTIONS -D__DEBUG__" DEBUG="YES" CFLAGS="$CFLAGS -g" shift elif [ "$1" = "--quiet" ]; then QUIET=1 shift elif [ "$1" = "--gtk" ]; then GTK="$2" shift shift elif [ "$1" = "--bochs" ]; then BOCHS="$2" shift shift elif [ "$1" = "--bochs-path" ]; then BOCHSPATH="$2" shift shift elif [ "$1" = "--prefix" ]; then PREFIX="$2" shift shift elif [ "$1" = "--bindir" ]; then BINDIR="$2" shift shift elif [ "$1" = "--sysconfdir" ]; then SYSCONFDIR="$2" shift shift elif [ "$1" = "--docdir" ]; then DOCDIR="$2" shift shift else echo "Invalid option ($1)" exit fidoneif [ "$PREFIX" = "/" ]; then PREFIX=""fiif [ "$BINDIR" = "" ]; then BINDIR="$PREFIX/$BIN"fiif [ "$SYSCONFDIR" = "" ]; then SYSCONFDIR="$PREFIX/$SYSCONF"fiif [ "$DOCDIR" = "" ]; then DOCDIR="$PREFIX/$DOC"fiif [ "$GTK" = "1.2" ]; then LIBS="\`gtk-config --libs\`" INCS="\`gtk-config --cflags\`"elif [ "$GTK" = "2.0" ]; then LIBS="-L/usr/X11R6/lib \`pkg-config --libs gtk+-2.0\`" INCS="\`pkg-config --cflags gtk+-2.0\`"else echo -e "\tInvalid GTK version [$GTK]" exitfiif [ "$BOCHS" = "2.0" ]; then BOCHSPATH="$BOCHSPATH -q"else echo -e "\tInvalid Bochs version [$BOCHS]" exitfiecho ""echo -e "\tConfig: bindir = $BINDIR"echo -e "\tConfig: sysconfdir = $SYSCONFDIR"echo -e "\tConfig: docdir = $DOCDIR"echo -e "\tConfig: options = $OPTIONS"echo -e "\tConfig: debug = $DEBUG"echo -e "\tConfig: bochs-path = $BOCHSPATH"echo -e "\tConfig: bochs = $BOCHS"echo -e "\tConfig: gtk = $GTK"echo ""############################################################################### Final messagesif [ "$QUIET" != "1" ]; then echo -e "\tType 'make' to compile" if [ "$DEBUG" = "NO" ]; then echo -e "\tType 'make install' to install" fi echo -e "\tType 'make clean' to clean up" echo -e "\tType 'make distclean' to clean up and remove Makefile" echo "" if [ "$DEBUG" = "NO" ]; then echo -e "\t*******************************************" echo -e "\t* *" echo -e "\t* Did you read the above messages? *" echo -e "\t* Did you read \`./configure.sh --help\`? *" echo -e "\t* *" echo -e "\t*******************************************" echo "" fi echo -e "\tBochs MUST be configured with --enable-debugger," echo -e "\t--enable-disasm and --disable-readline for BFE to work." echo -e "\tBinary packages of Bochs will not work with BFE." echo ""fi############################################################################### create Makefilerm -f Makefilecp -f .gtkrc-bfe gtkrc-bfe-samplecp -f .bferc bferc-sampleecho "# Generated by configure.sh" >> MakefileOBJS=""for file in *.c; do OBJS="$OBJS ${file%%.c}.o"doneecho -e "all: $PROGdistclean: clean rm -f Makefile gtkrc-bfe-sample bferc-sampleclean: rm -f $PROG *.o core __*__$PROG: $OBJS $LD $LFLAGS -o $PROG $OBJS $LIBS.c.o: $CC $CFLAGS -o \$@ -c \$< $OPTIONS $INCS -DBOCHS_PATH=\"\\\"$BOCHSPATH\\\"\" -DCFGDIR=\"\\\"$SYSCONFDIR\\\"\"" >> Makefilefor file in *.c; do echo "${file%%.c}.o: $file common.h functions.h Makefile" >> Makefiledoneif [ "$DEBUG" = "NO" ]; then echo -e "\ninstall: $PROG\n\tstrip $PROG" >> Makefile echo -e "\t(umask 022 ; /bin/mkdir -m 0755 -p $BINDIR)" >> Makefile echo -e "\tinstall -o $OWNER -g $GROUP -m 0755 $PROG $BINDIR" >> Makefile echo -e "\t(umask 022 ; /bin/mkdir -m 0755 -p $SYSCONFDIR)" >> Makefile echo -e "\tinstall -o $OWNER -g $GROUP -m 0644 .gtkrc-bfe $SYSCONFDIR/gtkrc-bfe" >> Makefile echo -e "\t(umask 022 ; /bin/mkdir -m 0755 -p $DOCDIR)" >> Makefile echo -e "\tinstall -o $OWNER -g $GROUP -m 0644 $DOCFILES $DOCDIR" >> Makefilefi
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -