X-Git-Url: http://git.shiar.nl/netris.git/blobdiff_plain/ec797c133bd83404f6167fb46c098c236333d168..4f561019fc85c2817e3a72341397d1df32bc0868:/Configure diff --git a/Configure b/Configure index 7fe293e..537142f 100755 --- a/Configure +++ b/Configure @@ -1,7 +1,7 @@ : # # Netris -- A free networked version of T*tris -# Copyright (C) 1994,1995,1996 Mark H. Weaver +# Copyright (C) 1994-1996,1999 Mark H. Weaver # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -17,21 +17,22 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -# $Id: Configure,v 1.17 1996/02/09 08:22:03 mhw Exp $ +# $Id: Configure,v 1.18 1999/05/16 06:56:19 mhw Exp $ # CC="gcc" -COPT="-g -O" -CEXTRA="" +COPT="-O" +CEXTRA="-m486" LEXTRA="" +CURSES_HACK=false while [ $# -ge 1 ]; do opt="$1" shift case "$opt" in -g) - COPT="-g" - CEXTRA="-Wall -Wstrict-prototypes" + COPT="-g -O0" +# CEXTRA="-Wall -Wstrict-prototypes -m486" ;; -O*) COPT="$opt" @@ -53,6 +54,9 @@ while [ $# -ge 1 ]; do LEXTRA="$1" shift ;; + --curses-hack) + CURSES_HACK=true + ;; *) cat << "END" Usage: ./Configure [options...] @@ -62,6 +66,7 @@ Usage: ./Configure [options...] --copt : Set C optimization flags --cextra : Set extra C flags --lextra : Set extra linker flags + --curses-hack: Disable scroll-optimization for broken curses END exit 1 ;; @@ -73,8 +78,12 @@ CFLAGS="$COPT $CEXTRA" echo "Checking for libraries" echo 'main(){}' > test.c LFLAGS="" -for lib in -lsocket -lnsl -lcurses -ltermcap -do +for lib in -lcurses -lncurses; do + if $CC $CFLAGS $LEXTRA test.c $lib > /dev/null 2>&1; then + LFLAGS="$lib" + fi +done +for lib in -lsocket -lnsl -ltermcap; do if $CC $CFLAGS $LEXTRA test.c $lib > /dev/null 2>&1; then LFLAGS="$LFLAGS $lib" fi @@ -129,13 +138,12 @@ fi rm -f test.c test.o a.out ORIG_SOURCES="game- curses- shapes- board- util- inet- robot-" -GEN_SOURCES="version-" -SOURCES="$ORIG_SOURCES $GEN_SOURCES" +SOURCES="$ORIG_SOURCES" SRCS="`echo $SOURCES | sed -e s/-/.c/g`" OBJS="`echo $SOURCES | sed -e s/-/.o/g`" -DISTFILES="README FAQ COPYING VERSION Configure netris.h sr.c robot_desc" +DISTFILES="README FAQ COPYING VERSION Configure netris.h sr.c server.c robot_desc" DISTFILES="$DISTFILES `echo $ORIG_SOURCES | sed -e s/-/.c/g`" echo > .depend @@ -144,7 +152,8 @@ echo "Creating Makefile" sed -e "s/-LFLAGS-/$LFLAGS/g" -e "s/-SRCS-/$SRCS/g" \ -e "s/-OBJS-/$OBJS/g" -e "s/-DISTFILES-/$DISTFILES/g" \ -e "s/-COPT-/$COPT/g" -e "s/-CEXTRA-/$CEXTRA/g" \ - -e "s/-LEXTRA-/$LEXTRA/g" -e "s/-CC-/$CC/g" << "END" > Makefile + -e "s/-LEXTRA-/$LEXTRA/g" -e "s/-CC-/$CC/g" \ + << "END" > Makefile # # Automatically generated by ./Configure -- DO NOT EDIT! # @@ -163,13 +172,16 @@ SRCS = -SRCS- OBJS = -OBJS- DISTFILES = -DISTFILES- -all: Makefile config.h proto.h $(PROG) sr +all: Makefile config.h proto.h $(PROG) sr server $(PROG): $(OBJS) - $(CC) -o $(PROG) $(OBJS) $(LFLAGS) + $(CC) -o $(PROG) $(OBJS) $(LFLAGS) $(CFLAGS) sr: sr.o - $(CC) -o sr sr.o $(LFLAGS) + $(CC) -o sr sr.o $(LFLAGS) $(CFLAGS) + +server: server.o + $(CC) -o server server.o $(LFLAGS) $(CFLAGS) .c.o: $(CC) $(CFLAGS) -c $< @@ -179,10 +191,6 @@ Makefile config.h: Configure @echo "Run ./Configure now" @false -version.c: VERSION - @echo "Creating version.c" - @sed -e 's/^\(.*\)$$/char *version_string = "\1";/' VERSION > $@ - proto.h: $(SRCS) @touch $@ @mv $@ $@.old @@ -213,7 +221,7 @@ dist: $(DISTFILES) tar -cvzof $$dir.tar.gz $$dir clean: - rm -f proto.h proto.chg $(PROG) $(OBJS) version.c test.c a.out sr sr.o + rm -f proto.h proto.chg $(PROG) $(OBJS) test.c a.out sr sr.o server server.o cleandir: clean rm -f .depend Makefile config.h @@ -244,6 +252,9 @@ fi if [ "$HAS_SIGPROCMASK" = "true" ]; then echo "#define HAS_SIGPROCMASK" >> config.h fi +if [ "$CURSES_HACK" = "true" ]; then + echo "#define CURSES_HACK" >> config.h +fi echo "Running 'make depend'" if make depend; then :; else cat << END; fi