/[gxemul]/trunk/configure
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/configure

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by dpavlin, Mon Oct 8 16:18:00 2007 UTC revision 10 by dpavlin, Mon Oct 8 16:18:27 2007 UTC
# Line 27  Line 27 
27  #  SUCH DAMAGE.  #  SUCH DAMAGE.
28  #  #
29  #  #
30  #  $Id: configure,v 1.123 2005/04/17 01:42:21 debug Exp $  #  $Id: configure,v 1.140 2005/06/27 17:31:50 debug Exp $
31  #  #
32  #  This is a minimal configure script, hardcoded for GXemul. This script  #  This is a minimal configure script, hardcoded for GXemul. This script
33  #  figures out which compiler flags will work, and creates Makefiles in  #  figures out which compiler flags will work, and creates Makefiles in
# Line 52  Line 52 
52  #    o)  prefetch capability  (TODO: this is assumed on Alpha, but not all  #    o)  prefetch capability  (TODO: this is assumed on Alpha, but not all
53  #                              Alphas have it...)  #                              Alphas have it...)
54  #  #
55    #  TODO:
56    #    o)  do not enable prefetch on Alpha ev4 or ev5, only on pca56 and newer
57    #    o)  X11 libs and includes via command line options?
58    #
59  ###############################################################################  ###############################################################################
60    
61  ENABLEALPHA=NO  ENABLEARM=YES
 ENABLEHPPA=NO  
62  ENABLEMIPS=YES  ENABLEMIPS=YES
63  ENABLEPPC=YES  ENABLEPPC=YES
 ENABLESPARC=NO  
64  ENABLEURISC=YES  ENABLEURISC=YES
65  ENABLEX86=NO  ENABLEX86=NO
66    STABLE=NO
67    
68  if [ z"$*" != z ]; then  if [ z"$*" != z ]; then
69          #  Parse command line options:          #  Parse command line options:
# Line 69  if [ z"$*" != z ]; then Line 72  if [ z"$*" != z ]; then
72                          NOX11=YES                          NOX11=YES
73                  else if [ z$a = z--always32 ]; then                  else if [ z$a = z--always32 ]; then
74                          ALWAYS32=YES                          ALWAYS32=YES
75                    else if [ z$a = z--tracenull ]; then
76                            TRACENULL=YES
77                  else if [ z$a = z--disable-bintrans ]; then                  else if [ z$a = z--disable-bintrans ]; then
78                          NOBINTRANS=YES                          NOBINTRANS=YES
79                    else if [ z$a = z--enable-bintrans ]; then
80                            NOBINTRANS=NO
81                    else if [ z$a = z--disable-mips16 ]; then
82                            MIPS16=NO
83                  else if [ z$a = z--enable-mips16 ]; then                  else if [ z$a = z--enable-mips16 ]; then
84                          MIPS16=YES                          MIPS16=YES
85                  else if [ z$a = z--enable-alpha ]; then                  else if [ z$a = z--disable-arm ]; then
86                          ENABLEALPHA=YES                          ENABLEARM=NO
87                  else if [ z$a = z--enable-hppa ]; then                  else if [ z$a = z--enable-arm ]; then
88                          ENABLEHPPA=YES                          ENABLEARM=YES
89                  else if [ z$a = z--disable-mips ]; then                  else if [ z$a = z--disable-mips ]; then
90                          ENABLEMIPS=NO                          ENABLEMIPS=NO
91                    else if [ z$a = z--enable-mips ]; then
92                            ENABLEMIPS=YES
93                  else if [ z$a = z--disable-ppc ]; then                  else if [ z$a = z--disable-ppc ]; then
94                          ENABLEPPC=NO                          ENABLEPPC=NO
95                  else if [ z$a = z--enable-sparc ]; then                  else if [ z$a = z--enable-ppc ]; then
96                          ENABLESPARC=YES                          ENABLEPPC=YES
97                  else if [ z$a = z--disable-urisc ]; then                  else if [ z$a = z--disable-urisc ]; then
98                          ENABLEURISC=NO                          ENABLEURISC=NO
99                    else if [ z$a = z--enable-urisc ]; then
100                            ENABLEURISC=YES
101                    else if [ z$a = z--disable-x86 ]; then
102                            ENABLEX86=NO
103                  else if [ z$a = z--enable-x86 ]; then                  else if [ z$a = z--enable-x86 ]; then
104                          ENABLEX86=YES                          ENABLEX86=YES
105                    else if [ z$a = z--disable-delays ]; then
106                            DELAYS=NO
107                  else if [ z$a = z--enable-delays ]; then                  else if [ z$a = z--enable-delays ]; then
108                          DELAYS=YES                          DELAYS=YES
109                    else if [ z$a = z--disable-caches ]; then
110                            CACHES=NO
111                  else if [ z$a = z--enable-caches ]; then                  else if [ z$a = z--enable-caches ]; then
112                          CACHES=YES                          CACHES=YES
113                  else if [ z$a = z--help ]; then                  else if [ z$a = z--help ]; then
114                          echo "usage: $0 [options]"                          echo "usage: $0 [options]"
115                          printf "\nDevelopment (debug) options:\n"                          printf "\nDevelopment (debug) options:\n"
116                          echo "  --always32          enable" \                          echo "  --always32         enable" \
117                              "ALWAYS_SIGNEXTEND_32 (for hunting down"                              "ALWAYS_SIGNEXTEND_32 (for hunting down"
118                          echo "                      32/64-bit bugs)"                          echo "                     32/64-bit bugs)"
119                            echo "  --tracenull        enable" \
120                                "TRACE_NULL_CRASHES (for bug hunting)"
121                          printf "\nGeneral options:\n"                          printf "\nGeneral options:\n"
122                          echo "  --disable-bintrans  configure without" \                          echo "  --disable-bintrans configure without" \
123                              "bintrans, even if the host supports it"                              "bintrans, even if the host supports it"
124                          echo "  --enable-caches     enable cache emulation" \                          printf "  --enable-caches    enable cache emulation"
125                              "(experimental)"                          printf " (BUGGY)\n"
126                          echo "  --enable-delays     enable instruction" \                          echo "  --enable-delays    enable instruction" \
127                              "latency/delay emulation"                              "latency/delay emulation"
128                          echo "  --disable-x         don't include X11 support"                          echo "  --disable-x        don't include X11 support"
129                          printf "\nCPU selection options: (most of these"                          printf "\nCPU selection options:\n"
130                          printf " are experimental)\n"                          echo "  --disable-arm      disable ARM CPU emulation"
131                          echo "  --enable-alpha      enable Alpha CPU emulation"                          echo "  --disable-mips     disable MIPS CPU emulation"
132                          echo "  --enable-hppa       enable HPPA CPU emulation"                          echo "  --disable-ppc      disable PPC CPU emulation"
133                          echo "  --disable-mips      disable MIPS CPU emulation"                          echo "  --disable-urisc    disable URISC CPU emulation"
134                          echo "  --disable-ppc       disable PPC CPU emulation"                          if [ z$STABLE = zNO ]; then
135                          echo "  --enable-sparc      enable SPARC CPU emulation"                                  printf "  --enable-x86       "
136                          echo "  --disable-urisc     disable URISC CPU emulation"                                  printf "enable x86 CPU emulation"
137                          echo "  --enable-x86        enable x86 CPU emulation"                                  printf " (NOT YET)\n"
138                            fi
139                          printf "\nMIPS-specific options:\n"                          printf "\nMIPS-specific options:\n"
140                          echo "  --enable-mips16     enable MIPS16 instruction" \                          printf "  --enable-mips16    enable MIPS16 instruction"
141                              "support (experimental)"                          printf " support (NOT YET)\n\n"
                         printf "\n"  
142                          exit                          exit
143                  else                  else
144                          echo "Invalid option: $a"                          echo "Invalid option: $a"
145                          echo "Run  $0 --help  to get a list of" \                          echo "Run  $0 --help  to get a list of" \
146                              "available options."                              "available options."
147                          exit                          exit
148                  fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi                  fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi; fi
149                    fi; fi; fi; fi; fi; fi; fi
150          done          done
151  fi  fi
152    
# Line 148  printf "/* Line 170  printf "/*
170  #  Figure out if VERSION should be defined.  #  Figure out if VERSION should be defined.
171  X=`basename \`pwd\`|cut -d \- -f 2-`  X=`basename \`pwd\`|cut -d \- -f 2-`
172  if [ z"$X" = zgxemul ]; then  if [ z"$X" = zgxemul ]; then
173          echo '#  No VERSION defined.' >> _Makefile.header          echo '/*  No VERSION defined.  */' >> config.h
174  else  else
175          printf "#define VERSION \"$X\"\n" >> config.h          printf "#define VERSION \"$X\"\n" >> config.h
176  fi  fi
# Line 165  if [ z$MIPS16 = zYES ]; then Line 187  if [ z$MIPS16 = zYES ]; then
187          printf 'NOTE: MIPS16 support is not really working yet.\n'          printf 'NOTE: MIPS16 support is not really working yet.\n'
188          printf "#define ENABLE_MIPS16\n" >> config.h          printf "#define ENABLE_MIPS16\n" >> config.h
189  fi  fi
190  if [ z$ENABLEALPHA = zYES ]; then  if [ z$ENABLEARM = zYES ]; then
191          printf "#define ENABLE_ALPHA\n" >> config.h          printf "#define ENABLE_ARM\n" >> config.h
 fi  
 if [ z$ENABLEHPPA = zYES ]; then  
         printf "#define ENABLE_HPPA\n" >> config.h  
192  fi  fi
193  if [ z$ENABLEMIPS = zYES ]; then  if [ z$ENABLEMIPS = zYES ]; then
194          printf "#define ENABLE_MIPS\n" >> config.h          printf "#define ENABLE_MIPS\n" >> config.h
# Line 177  fi Line 196  fi
196  if [ z$ENABLEPPC = zYES ]; then  if [ z$ENABLEPPC = zYES ]; then
197          printf "#define ENABLE_PPC\n" >> config.h          printf "#define ENABLE_PPC\n" >> config.h
198  fi  fi
 if [ z$ENABLESPARC = zYES ]; then  
         printf "#define ENABLE_SPARC\n" >> config.h  
 fi  
199  if [ z$ENABLEURISC = zYES ]; then  if [ z$ENABLEURISC = zYES ]; then
200          printf "#define ENABLE_URISC\n" >> config.h          printf "#define ENABLE_URISC\n" >> config.h
201  fi  fi
202  if [ z$ENABLEX86 = zYES ]; then  if [ z$ENABLEX86 = zYES ]; then
203          printf "#define ENABLE_X86\n" >> config.h          printf "#define ENABLE_X86\n" >> config.h
204            if [ z$STABLE = zNO ]; then
205                    printf "\nWARNING: X86 emulation enabled, but it isn't really"
206                    printf " working yet.\n\n"
207            else
208                    printf "Not in the stable release.\n"
209                    exit
210            fi
211  fi  fi
212    
213    
# Line 195  if [ z$DELAYS = zYES ]; then Line 218  if [ z$DELAYS = zYES ]; then
218  fi  fi
219    
220    
221  #  Instruction delay/latency emulation:  #  Development option: ALWAYS_SIGNEXTEND_32
222  if [ z$ALWAYS32 = zYES ]; then  if [ z$ALWAYS32 = zYES ]; then
223          echo 'Enabling ALWAYS_SIGNEXTEND_32. (NOTE:' \          echo 'Enabling ALWAYS_SIGNEXTEND_32. (NOTE:' \
224              'This slows down everything.)'              'This slows down everything.)'
# Line 203  if [ z$ALWAYS32 = zYES ]; then Line 226  if [ z$ALWAYS32 = zYES ]; then
226  fi  fi
227    
228    
229    #  Development option: TRACE_NULL_CRASHES
230    if [ z$TRACENULL = zYES ]; then
231            echo 'Enabling TRACE_NULL_CRASHES. (NOTE:' \
232                'This slows down the emulator.)'
233            printf "#define TRACE_NULL_CRASHES\n" >> config.h
234    fi
235    
236    
237  #  Cache emulation:  #  Cache emulation:
238  if [ z$CACHES = zYES ]; then  if [ z$CACHES = zYES ]; then
239          echo 'Enabling Cache emulation. (EXPERIMENTAL)'          echo 'Enabling Cache emulation. (EXPERIMENTAL)'
# Line 214  if [ z$CACHES = zYES ]; then Line 245  if [ z$CACHES = zYES ]; then
245                  printf '         (--delays) will not produce correct '                  printf '         (--delays) will not produce correct '
246                  printf 'cache miss penalties and such.\n'                  printf 'cache miss penalties and such.\n'
247          fi          fi
248    
249            printf "\nNOTE: Cache emulation enabled, but right now it triggers "
250            printf "weird bugs in the\n      emulator. You have been warned.\n\n"
251  fi  fi
252    
253    
# Line 678  fi Line 712  fi
712  rm -f _testprog _testprog.error _testprog.stdout  rm -f _testprog _testprog.error _testprog.stdout
713    
714    
 #  -fmove-all-movables  
 printf "checking whether -fmove-all-movables can be used... "  
 $CC $CFLAGS -fmove-all-movables _testprog.c -o \  
     _testprog > _testprog.stdout 2>&1  
 cat _testprog.stdout >> _testprog.error  
 if grep movables _testprog.error > /dev/null 2>&1; then  
         printf "no\n"  
 else  
         if [ -x _testprog ]; then  
                 CFLAGS="-fmove-all-movables $CFLAGS"  
                 printf "yes\n"  
         else  
                 printf "no\n"  
         fi  
 fi  
 rm -f _testprog _testprog.error _testprog.stdout  
   
   
715  #  -fomit-frame-pointer  #  -fomit-frame-pointer
716  printf "checking whether -fomit-frame-pointer can be used... "  printf "checking whether -fomit-frame-pointer can be used... "
717  $CC $CFLAGS -fomit-frame-pointer _testprog.c -o \  $CC $CFLAGS -fomit-frame-pointer _testprog.c -o \
# Line 792  fi Line 808  fi
808  rm -f _testr.[co] _testr  rm -f _testr.[co] _testr
809    
810    
811    #  strlcpy missing?
812    printf "checking for strlcpy... "
813    printf "#include <string.h>
814    int main(int argc, char *argv[]) { char *p; char *q; size_t x;
815      x = strlcpy(p, q, 50); return 0;}\n" > _tests.c
816    $CC $CFLAGS _tests.c -o _tests 2> /dev/null
817    if [ ! -x _tests ]; then
818            printf "missing, using mystrlcpy\n"
819            printf "#define strlcpy mystrlcpy\n" >> config.h
820            printf "#define strlcat mystrlcat\n" >> config.h
821            printf "#define USE_STRLCPY_REPLACEMENTS\n" >> config.h
822    else
823            printf "found\n"
824    fi
825    rm -f _tests.[co] _tests
826    
827    
828  #  strtoull missing?  #  strtoull missing?
829  printf "checking for strtoull... "  printf "checking for strtoull... "
830  printf "#include <stdlib.h>  printf "#include <stdlib.h>
# Line 804  if [ ! -x _tests ]; then Line 837  if [ ! -x _tests ]; then
837          printf "missing, using mystrtoull\n"          printf "missing, using mystrtoull\n"
838          printf "#define strtoull mystrtoull\n" >> config.h          printf "#define strtoull mystrtoull\n" >> config.h
839  else  else
840          printf "yes\n"          printf "found\n"
841  fi  fi
842  rm -f _testlong* _tests.[co] _tests  rm -f _tests.[co] _tests
843    
844    
845    #  mkstemp missing?
846    printf "checking for mkstemp... "
847    printf "#include <unistd.h>
848    int main(int argc, char *argv[]) { int x; char *y = \"abc\";
849    x = mkstemp(y); return 0;}\n" > _tests.c
850    $CC $CFLAGS _tests.c -o _tests 2> /dev/null
851    if [ ! -x _tests ]; then
852            printf "missing, using workaround\n"
853            printf "#define mkstemp mymkstemp\n" >> config.h
854    else
855            printf "found\n"
856    fi
857    rm -f _tests.[co] _tests
858    
859    
860  #  fseeko missing?  #  fseeko missing?
# Line 818  printf "#include <stdlib.h> Line 866  printf "#include <stdlib.h>
866  int main(int argc, char *argv[]) { fseeko(NULL, 0, 0); return 0;}\n" > _tests.c  int main(int argc, char *argv[]) { fseeko(NULL, 0, 0); return 0;}\n" > _tests.c
867  $CC $CFLAGS _tests.c -o _tests 2> /dev/null  $CC $CFLAGS _tests.c -o _tests 2> /dev/null
868  if [ ! -x _tests ]; then  if [ ! -x _tests ]; then
869          printf "no\n"          printf "missing\n"
870          printf "WARNING! fseeko missing from libc. Using a hack, "          printf "WARNING! fseeko missing from libc. Using a hack, "
871          printf "which probably doesn't work.\n"          printf "which probably doesn't work.\n"
872          printf "#define HACK_FSEEKO\n" >> config.h          printf "#define HACK_FSEEKO\n" >> config.h
873  else  else
874          printf "yes\n"          printf "found\n"
875  fi  fi
876  rm -f _tests.[co] _tests  rm -f _tests.[co] _tests
877    
# Line 841  if [ ! -x _tests ]; then Line 889  if [ ! -x _tests ]; then
889          printf "no, using int\n"          printf "no, using int\n"
890          CFLAGS="$CFLAGS -Dsocklen_t=int"          CFLAGS="$CFLAGS -Dsocklen_t=int"
891  else  else
892          printf "yes\n"          printf "socklen_t\n"
893  fi  fi
894  rm -f _tests.[co] _tests  rm -f _tests.[co] _tests
895    
# Line 1052  echo "" >> _Makefile.header Line 1100  echo "" >> _Makefile.header
1100  printf "Regression test setup: (not really needed to build gxemul)\n"  printf "Regression test setup: (not really needed to build gxemul)\n"
1101    
1102    
 ##  64-bit HPPA cross-assembler:  
 #  
 #HPPA=''  
 #if [ z$ENABLEHPPA = zYES ]; then  
 #       printf "Checking for a GNU cross-assembler for 64-bit HPPA... "  
 #       echo 'nop' > _testprog.s  
 #  
 #       for HPPA_TRY in hppa64-unknown-elf hppa64-elf; do  
 #               printf '#!/bin/sh\n'$HPPA_TRY'-as _testprog.s' > _test.sh  
 #               printf ' -o _testprog.o\n' >> _test.sh  
 #               chmod 755 _test.sh  
 #               rm -f _testprog.o  
 #               ./_test.sh > /dev/null 2> /dev/null  
 #               if [ -f _testprog.o ]; then  
 #                       HPPA=$HPPA_TRY  
 #                       break  
 #               fi  
 #               rm -f _testprog.o  
 #       done  
 #  
 #       if [ z$HPPA = z ]; then  
 #               echo "none"  
 #       else  
 #               echo $HPPA"-gcc"  
 #       fi  
 #fi  
 #rm -f _testprog* _test.sh  
 #  
 ## TODO: are these ok?  64-bit mode!  
 ##echo "HPPA_CC="$HPPA"-gcc -g -O2 -fno-builtin -fschedule-insns" \  
 ##      >> _Makefile.header  
 #echo "HPPA_AS="$HPPA"-as " >> _Makefile.header  
 #echo "HPPA_LD="$HPPA"-ld -Ttext 0xa800000000030000 -e main" \  
 #    "--oformat=elf64-bigmips" >> _Makefile.header  
 #echo "" >> _Makefile.header  
   
   
1103  #  64-bit MIPS cross-compiler:  #  64-bit MIPS cross-compiler:
1104    
1105  MIPS=''  MIPS=''

Legend:
Removed from v.4  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26