/[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 12 by dpavlin, Mon Oct 8 16:18:38 2007 UTC revision 16 by dpavlin, Mon Oct 8 16:19:01 2007 UTC
# Line 27  Line 27 
27  #  SUCH DAMAGE.  #  SUCH DAMAGE.
28  #  #
29  #  #
30  #  $Id: configure,v 1.155 2005/08/16 05:37:08 debug Exp $  #  $Id: configure,v 1.172 2005/10/09 21:32:05 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 62  Line 62 
62  X=`basename \`pwd\`|cut -d \- -f 2-|cut -c1-2`  X=`basename \`pwd\`|cut -d \- -f 2-|cut -c1-2`
63  if [ z"$X" = z0. ]; then  if [ z"$X" = z0. ]; then
64          #  Stable:          #  Stable:
65            ENABLEARM=YES
66          ENABLEMIPS=YES          ENABLEMIPS=YES
67  else  else
68          #  Development:          #  Development:
69          ENABLEALPHA=YES          ENABLEALPHA=YES
70          ENABLEARM=YES          ENABLEARM=YES
71          ENABLEIA64=YES          ENABLEAVR=NO
72          ENABLEM68K=YES          ENABLEHPPA=NO
73            ENABLEI960=NO
74            ENABLEIA64=NO
75            ENABLEM68K=NO
76          ENABLEMIPS=YES          ENABLEMIPS=YES
77          ENABLEPPC=YES          ENABLEPPC=YES
78          ENABLESPARC=YES          ENABLESH=NO
79          ENABLEX86=YES          ENABLESPARC=NO
80            ENABLEX86=NO
81  fi  fi
82    
83  if [ z"$*" != z ]; then  if [ z"$*" != z ]; then
# Line 92  if [ z"$*" != z ]; then Line 97  if [ z"$*" != z ]; then
97                          MIPS16=NO                          MIPS16=NO
98                  else if [ z$a = z--enable-mips16 ]; then                  else if [ z$a = z--enable-mips16 ]; then
99                          MIPS16=YES                          MIPS16=YES
100                    else if [ z$a = z--enable-all ]; then
101                            ENABLEALPHA=YES
102                            ENABLEARM=YES
103                            ENABLEAVR=YES
104                            ENABLEHPPA=YES
105                            ENABLEI960=YES
106                            ENABLEIA64=YES
107                            ENABLEM68K=YES
108                            ENABLEMIPS=YES
109                            ENABLEPPC=YES
110                            ENABLESH=YES
111                            ENABLESPARC=YES
112                            ENABLEX86=YES
113                  else if [ z$a = z--disable-alpha ]; then                  else if [ z$a = z--disable-alpha ]; then
114                          ENABLEALPHA=NO                          ENABLEALPHA=NO
115                  else if [ z$a = z--enable-alpha ]; then                  else if [ z$a = z--enable-alpha ]; then
# Line 100  if [ z"$*" != z ]; then Line 118  if [ z"$*" != z ]; then
118                          ENABLEARM=NO                          ENABLEARM=NO
119                  else if [ z$a = z--enable-arm ]; then                  else if [ z$a = z--enable-arm ]; then
120                          ENABLEARM=YES                          ENABLEARM=YES
121                    else if [ z$a = z--disable-avr ]; then
122                            ENABLEAVR=NO
123                    else if [ z$a = z--enable-avr ]; then
124                            ENABLEAVR=YES
125                    else if [ z$a = z--disable-hppa ]; then
126                            ENABLEHPPA=NO
127                    else if [ z$a = z--enable-hppa ]; then
128                            ENABLEHPPA=YES
129                    else if [ z$a = z--disable-i960 ]; then
130                            ENABLEI960=NO
131                    else if [ z$a = z--enable-i960 ]; then
132                            ENABLEI960=YES
133                  else if [ z$a = z--disable-ia64 ]; then                  else if [ z$a = z--disable-ia64 ]; then
134                          ENABLEIA64=NO                          ENABLEIA64=NO
135                  else if [ z$a = z--enable-ia64 ]; then                  else if [ z$a = z--enable-ia64 ]; then
# Line 116  if [ z"$*" != z ]; then Line 146  if [ z"$*" != z ]; then
146                          ENABLEPPC=NO                          ENABLEPPC=NO
147                  else if [ z$a = z--enable-ppc ]; then                  else if [ z$a = z--enable-ppc ]; then
148                          ENABLEPPC=YES                          ENABLEPPC=YES
149                    else if [ z$a = z--disable-sh ]; then
150                            ENABLESH=NO
151                    else if [ z$a = z--enable-sh ]; then
152                            ENABLESH=YES
153                  else if [ z$a = z--disable-sparc ]; then                  else if [ z$a = z--disable-sparc ]; then
154                          ENABLESPARC=NO                          ENABLESPARC=NO
155                  else if [ z$a = z--enable-sparc ]; then                  else if [ z$a = z--enable-sparc ]; then
# Line 154  if [ z"$*" != z ]; then Line 188  if [ z"$*" != z ]; then
188                          echo "  --enable-delays    enable instruction" \                          echo "  --enable-delays    enable instruction" \
189                              "latency/delay emulation"                              "latency/delay emulation"
190    
191                            printf "  --enable-all       enable everything\n"
192    
193                          if [ z$ENABLEALPHA = zYES ]; then                          if [ z$ENABLEALPHA = zYES ]; then
194                                  printf "  --disable-alpha    disable "                                  printf "  --disable-alpha    disable "
195                          else                          else
# Line 168  if [ z"$*" != z ]; then Line 204  if [ z"$*" != z ]; then
204                          fi                          fi
205                          printf "ARM CPU emulation\n"                          printf "ARM CPU emulation\n"
206    
207                            if [ z$ENABLEAVR = zYES ]; then
208                                    printf "  --disable-avr      disable "
209                            else
210                                    printf "  --enable-avr       enable "
211                            fi
212                            printf "Atmel AVR CPU emulation\n"
213    
214                            if [ z$ENABLEHPPA = zYES ]; then
215                                    printf "  --disable-hppa     disable "
216                            else
217                                    printf "  --enable-hppa      enable "
218                            fi
219                            printf "HPPA CPU emulation\n"
220    
221                            if [ z$ENABLEI960 = zYES ]; then
222                                    printf "  --disable-i960     disable "
223                            else
224                                    printf "  --enable-i960      enable "
225                            fi
226                            printf "i960 CPU emulation\n"
227    
228                          if [ z$ENABLEIA64 = zYES ]; then                          if [ z$ENABLEIA64 = zYES ]; then
229                                  printf "  --disable-ia64     disable "                                  printf "  --disable-ia64     disable "
230                          else                          else
# Line 196  if [ z"$*" != z ]; then Line 253  if [ z"$*" != z ]; then
253                          fi                          fi
254                          printf "POWER/PPC CPU emulation\n"                          printf "POWER/PPC CPU emulation\n"
255    
256                            if [ z$ENABLESH = zYES ]; then
257                                    printf "  --disable-sh       disable "
258                            else
259                                    printf "  --enable-sh        enable "
260                            fi
261                            printf "SH CPU emulation\n"
262    
263                          if [ z$ENABLESPARC = zYES ]; then                          if [ z$ENABLESPARC = zYES ]; then
264                                  printf "  --disable-sparc    disable "                                  printf "  --disable-sparc    disable "
265                          else                          else
# Line 222  if [ z"$*" != z ]; then Line 286  if [ z"$*" != z ]; then
286                          echo "Run  $0 --help  to get a list of" \                          echo "Run  $0 --help  to get a list of" \
287                              "available options."                              "available options."
288                          exit                          exit
289                  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; fi
290                  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; fi
291                    fi; fi; fi; fi; fi
292          done          done
293  fi  fi
294    
# Line 267  fi Line 332  fi
332  if [ z$ENABLEALPHA = zYES ]; then  if [ z$ENABLEALPHA = zYES ]; then
333          printf "#define ENABLE_ALPHA\n" >> config.h          printf "#define ENABLE_ALPHA\n" >> config.h
334          CPU_ARCHS="$CPU_ARCHS cpu_alpha.o cpu_alpha_palcode.o"          CPU_ARCHS="$CPU_ARCHS cpu_alpha.o cpu_alpha_palcode.o"
335            CPU_TOOLS="$CPU_TOOLS generate_alpha_misc"
336  fi  fi
337  if [ z$ENABLEARM = zYES ]; then  if [ z$ENABLEARM = zYES ]; then
338          printf "#define ENABLE_ARM\n" >> config.h          printf "#define ENABLE_ARM\n" >> config.h
339          CPU_ARCHS="$CPU_ARCHS cpu_arm.o"          CPU_ARCHS="$CPU_ARCHS cpu_arm.o cpu_arm_coproc.o memory_arm.o "
340            CPU_ARCHS="$CPU_ARCHS tmp_arm_dpi.o tmp_arm_loadstore.o tmp_arm_r.o"
341            CPU_ARCHS="$CPU_ARCHS tmp_arm_r0.o tmp_arm_r1.o"
342            CPU_ARCHS="$CPU_ARCHS tmp_arm_r2.o tmp_arm_r3.o"
343            CPU_ARCHS="$CPU_ARCHS tmp_arm_r4.o tmp_arm_r5.o"
344            CPU_ARCHS="$CPU_ARCHS tmp_arm_r6.o tmp_arm_r7.o"
345            CPU_ARCHS="$CPU_ARCHS tmp_arm_r8.o tmp_arm_r9.o"
346            CPU_ARCHS="$CPU_ARCHS tmp_arm_ra.o tmp_arm_rb.o"
347            CPU_ARCHS="$CPU_ARCHS tmp_arm_rc.o tmp_arm_rd.o"
348            CPU_ARCHS="$CPU_ARCHS tmp_arm_re.o tmp_arm_rf.o"
349            CPU_TOOLS="$CPU_TOOLS generate_arm_dpi generate_arm_r"
350            CPU_TOOLS="$CPU_TOOLS generate_arm_loadstore"
351    fi
352    if [ z$ENABLEAVR = zYES ]; then
353            printf "#define ENABLE_AVR\n" >> config.h
354            CPU_ARCHS="$CPU_ARCHS cpu_avr.o"
355    fi
356    if [ z$ENABLEHPPA = zYES ]; then
357            printf "#define ENABLE_HPPA\n" >> config.h
358            CPU_ARCHS="$CPU_ARCHS cpu_hppa.o"
359    fi
360    if [ z$ENABLEI960 = zYES ]; then
361            printf "#define ENABLE_I960\n" >> config.h
362            CPU_ARCHS="$CPU_ARCHS cpu_i960.o"
363  fi  fi
364  if [ z$ENABLEIA64 = zYES ]; then  if [ z$ENABLEIA64 = zYES ]; then
365          printf "#define ENABLE_IA64\n" >> config.h          printf "#define ENABLE_IA64\n" >> config.h
# Line 286  fi Line 375  fi
375  if [ z$ENABLEPPC = zYES ]; then  if [ z$ENABLEPPC = zYES ]; then
376          printf "#define ENABLE_PPC\n" >> config.h          printf "#define ENABLE_PPC\n" >> config.h
377          CPU_ARCHS="$CPU_ARCHS cpu_ppc.o"          CPU_ARCHS="$CPU_ARCHS cpu_ppc.o"
378            CPU_TOOLS="$CPU_TOOLS generate_ppc_loadstore"
379    fi
380    if [ z$ENABLESH = zYES ]; then
381            printf "#define ENABLE_SH\n" >> config.h
382            CPU_ARCHS="$CPU_ARCHS cpu_sh.o"
383  fi  fi
384  if [ z$ENABLESPARC = zYES ]; then  if [ z$ENABLESPARC = zYES ]; then
385          printf "#define ENABLE_SPARC\n" >> config.h          printf "#define ENABLE_SPARC\n" >> config.h
# Line 411  if [ z"$CC" = z ]; then Line 505  if [ z"$CC" = z ]; then
505          fi          fi
506          rm -f _testprog          rm -f _testprog
507    
508          #  Try ccc (FreeBSD/Alpha):  #       #  Try ccc (FreeBSD/Alpha):
509          printf "#!/bin/sh\nccc _testprog.c -o _testprog >" > _test.sh  #       printf "#!/bin/sh\nccc _testprog.c -o _testprog >" > _test.sh
510          printf " /dev/null 2> /dev/null\n" >> _test.sh  #       printf " /dev/null 2> /dev/null\n" >> _test.sh
511          chmod 755 _test.sh  #       chmod 755 _test.sh
512          ./_test.sh > /dev/null 2> /dev/null  #       ./_test.sh > /dev/null 2> /dev/null
513          if [ -x _testprog ]; then  #       if [ -x _testprog ]; then
514                  CC="ccc"  #               CC="ccc"
515          fi  #       fi
516          rm -f _testprog  #       rm -f _testprog
517    
518          rm -f _test.sh          rm -f _test.sh
519  fi  fi
# Line 1016  rm -f _testoff.c _testoff Line 1110  rm -f _testoff.c _testoff
1110    
1111    
1112  #  Check for u_int8_t etc:  #  Check for u_int8_t etc:
1113    #  These are needed because some header files in src/include/ use u_int*
1114    #  instead of uint*, and I don't have time to rewrite them all.
1115  printf "checking for u_int8_t... "  printf "checking for u_int8_t... "
1116  printf "#include <stdio.h>\n#include <inttypes.h>\n#include <sys/types.h>\n  printf "#include <stdio.h>\n#include <inttypes.h>\n#include <sys/types.h>\n
1117  int main(int argc, char *argv[]){printf(\"%%i\\\n\",  int main(int argc, char *argv[]){printf(\"%%i\\\n\",
# Line 1037  if [ ! -x _testuint ]; then Line 1133  if [ ! -x _testuint ]; then
1133          printf "typedef uint8_t u_int8_t;\n" >> config.h          printf "typedef uint8_t u_int8_t;\n" >> config.h
1134          printf "typedef uint16_t u_int16_t;\n" >> config.h          printf "typedef uint16_t u_int16_t;\n" >> config.h
1135          printf "typedef uint32_t u_int32_t;\n" >> config.h          printf "typedef uint32_t u_int32_t;\n" >> config.h
         printf "typedef uint64_t u_int64_t;\n" >> config.h  
1136          printf "uint8_t\n"          printf "uint8_t\n"
1137  else  else
1138          printf "yes\n"          printf "yes\n"
1139  fi  fi
1140  rm -f _testuint.c _testuint  rm -f _testuint.c _testuint
1141    
1142    printf "checking for u_int64_t... "
1143    printf "#include <stdio.h>\n#include <inttypes.h>\n#include <sys/types.h>\n
1144    int main(int argc, char *argv[]){printf(\"%%i\\\n\",
1145     (int)sizeof(u_int64_t));return 0;}\n" > _testuint.c
1146    $CC $CFLAGS _testuint.c -o _testuint 2> /dev/null
1147    if [ ! -x _testuint ]; then
1148            rm -f _testuint*
1149            printf "#include <stdio.h>\n#include <inttypes.h>
1150            \n#include <sys/types.h>\nint main(int argc, char *argv[])
1151            {printf(\"%%i\\\n\", (int)sizeof(uint64_t));return 0;}\n" > _testuint.c
1152            $CC $CFLAGS _testuint.c -o _testuint 2> /dev/null
1153            if [ ! -x _testuint ]; then
1154                    printf "no\n\nERROR: No u_int64_t or uint64_t. Aborting\n"
1155                    #  TODO: Automagically detect using various combinations
1156                    #  of char, int, short, long etc.
1157                    exit
1158            fi
1159    
1160            printf "typedef uint64_t u_int64_t;\n" >> config.h
1161            printf "uint64_t\n"
1162    else
1163            printf "yes\n"
1164    fi
1165    rm -f _testuint.c _testuint
1166    
1167    
1168  ###############################################################################  ###############################################################################
1169  #  #
# Line 1177  echo "DINCLUDE=$DINCLUDE" >> _Makefile.h Line 1297  echo "DINCLUDE=$DINCLUDE" >> _Makefile.h
1297  echo "CC=$CC" >> _Makefile.header  echo "CC=$CC" >> _Makefile.header
1298  echo "OTHERLIBS=$OTHERLIBS" >> _Makefile.header  echo "OTHERLIBS=$OTHERLIBS" >> _Makefile.header
1299  echo "CPU_ARCHS=$CPU_ARCHS" >> _Makefile.header  echo "CPU_ARCHS=$CPU_ARCHS" >> _Makefile.header
1300    echo "CPU_TOOLS=$CPU_TOOLS" >> _Makefile.header
1301  echo "" >> _Makefile.header  echo "" >> _Makefile.header
1302    
1303    
1304  #  Create the Makefiles:  #  Create the Makefiles:
1305    
1306  for a in . src src/devices src/devices/fonts; do  for a in . src src/cpus src/devices src/devices/fonts src/promemul; do
1307          echo "creating $a/Makefile"          echo "creating $a/Makefile"
1308          touch $a/Makefile          touch $a/Makefile
1309          cat _Makefile.header > $a/Makefile          cat _Makefile.header > $a/Makefile

Legend:
Removed from v.12  
changed lines
  Added in v.16

  ViewVC Help
Powered by ViewVC 1.1.26