unofficial version 0.7.1: ui improvements
[netris.git] / Configure
index 254366509539118bcae013ea0a5070ca9385bb65..537142f2b52e1c46528b43686905cc60f99a117d 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1,7 +1,7 @@
 :
 #
-# Netris -- A free networked version of Tetris
-# Copyright (C) 1994,1995  Mark Weaver <Mark_Weaver@brown.edu>
+# Netris -- A free networked version of T*tris
+# Copyright (C) 1994-1996,1999  Mark H. Weaver <mhw@netris.org>
 # 
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #
-# $Id: Configure,v 1.16 1995/07/11 08:55:42 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 <opt>: Set C optimization flags
     --cextra <opt>: Set extra C flags
     --lextra <opt>: 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
@@ -255,3 +266,5 @@ cat << END
 Now do a 'make'
 
 END
+
+# vi: ts=4 ai