/[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 20 by dpavlin, Mon Oct 8 16:19:23 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.180 2005/11/23 22:03:23 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            ENABLEPPC=YES
68  else  else
69          #  Development:          #  Development:
70          ENABLEALPHA=YES          ENABLEALPHA=YES
71          ENABLEARM=YES          ENABLEARM=YES
72          ENABLEIA64=YES          ENABLEAVR=NO
73          ENABLEM68K=YES          ENABLEHPPA=NO
74            ENABLEI960=NO
75            ENABLEIA64=NO
76            ENABLEM68K=NO
77          ENABLEMIPS=YES          ENABLEMIPS=YES
78            ENABLENEWMIPS=NO
79          ENABLEPPC=YES          ENABLEPPC=YES
80          ENABLESPARC=YES          ENABLESH=NO
81          ENABLEX86=YES          ENABLESPARC=NO
82            ENABLEX86=NO
83  fi  fi
84    
85  if [ z"$*" != z ]; then  if [ z"$*" != z ]; then
# Line 92  if [ z"$*" != z ]; then Line 99  if [ z"$*" != z ]; then
99                          MIPS16=NO                          MIPS16=NO
100                  else if [ z$a = z--enable-mips16 ]; then                  else if [ z$a = z--enable-mips16 ]; then
101                          MIPS16=YES                          MIPS16=YES
102                    else if [ z$a = z--enable-all ]; then
103                            ENABLEALPHA=YES
104                            ENABLEARM=YES
105                            ENABLEAVR=YES
106                            ENABLEHPPA=YES
107                            ENABLEI960=YES
108                            ENABLEIA64=YES
109                            ENABLEM68K=YES
110                            ENABLEMIPS=YES
111                            ENABLENEWMIPS=YES
112                            ENABLEPPC=YES
113                            ENABLESH=YES
114                            ENABLESPARC=YES
115                            ENABLEX86=YES
116                  else if [ z$a = z--disable-alpha ]; then                  else if [ z$a = z--disable-alpha ]; then
117                          ENABLEALPHA=NO                          ENABLEALPHA=NO
118                  else if [ z$a = z--enable-alpha ]; then                  else if [ z$a = z--enable-alpha ]; then
# Line 100  if [ z"$*" != z ]; then Line 121  if [ z"$*" != z ]; then
121                          ENABLEARM=NO                          ENABLEARM=NO
122                  else if [ z$a = z--enable-arm ]; then                  else if [ z$a = z--enable-arm ]; then
123                          ENABLEARM=YES                          ENABLEARM=YES
124                    else if [ z$a = z--disable-avr ]; then
125                            ENABLEAVR=NO
126                    else if [ z$a = z--enable-avr ]; then
127                            ENABLEAVR=YES
128                    else if [ z$a = z--disable-hppa ]; then
129                            ENABLEHPPA=NO
130                    else if [ z$a = z--enable-hppa ]; then
131                            ENABLEHPPA=YES
132                    else if [ z$a = z--disable-i960 ]; then
133                            ENABLEI960=NO
134                    else if [ z$a = z--enable-i960 ]; then
135                            ENABLEI960=YES
136                  else if [ z$a = z--disable-ia64 ]; then                  else if [ z$a = z--disable-ia64 ]; then
137                          ENABLEIA64=NO                          ENABLEIA64=NO
138                  else if [ z$a = z--enable-ia64 ]; then                  else if [ z$a = z--enable-ia64 ]; then
# Line 112  if [ z"$*" != z ]; then Line 145  if [ z"$*" != z ]; then
145                          ENABLEMIPS=NO                          ENABLEMIPS=NO
146                  else if [ z$a = z--enable-mips ]; then                  else if [ z$a = z--enable-mips ]; then
147                          ENABLEMIPS=YES                          ENABLEMIPS=YES
148                    else if [ z$a = z--disable-newmips ]; then
149                            ENABLENEWMIPS=NO
150                    else if [ z$a = z--enable-newmips ]; then
151                            ENABLENEWMIPS=YES
152                  else if [ z$a = z--disable-ppc ]; then                  else if [ z$a = z--disable-ppc ]; then
153                          ENABLEPPC=NO                          ENABLEPPC=NO
154                  else if [ z$a = z--enable-ppc ]; then                  else if [ z$a = z--enable-ppc ]; then
155                          ENABLEPPC=YES                          ENABLEPPC=YES
156                    else if [ z$a = z--disable-sh ]; then
157                            ENABLESH=NO
158                    else if [ z$a = z--enable-sh ]; then
159                            ENABLESH=YES
160                  else if [ z$a = z--disable-sparc ]; then                  else if [ z$a = z--disable-sparc ]; then
161                          ENABLESPARC=NO                          ENABLESPARC=NO
162                  else if [ z$a = z--enable-sparc ]; then                  else if [ z$a = z--enable-sparc ]; then
# Line 154  if [ z"$*" != z ]; then Line 195  if [ z"$*" != z ]; then
195                          echo "  --enable-delays    enable instruction" \                          echo "  --enable-delays    enable instruction" \
196                              "latency/delay emulation"                              "latency/delay emulation"
197    
198                            printf "  --enable-all       enable everything\n"
199    
200                          if [ z$ENABLEALPHA = zYES ]; then                          if [ z$ENABLEALPHA = zYES ]; then
201                                  printf "  --disable-alpha    disable "                                  printf "  --disable-alpha    disable "
202                          else                          else
# Line 168  if [ z"$*" != z ]; then Line 211  if [ z"$*" != z ]; then
211                          fi                          fi
212                          printf "ARM CPU emulation\n"                          printf "ARM CPU emulation\n"
213    
214                            if [ z$ENABLEAVR = zYES ]; then
215                                    printf "  --disable-avr      disable "
216                            else
217                                    printf "  --enable-avr       enable "
218                            fi
219                            printf "Atmel AVR CPU emulation\n"
220    
221                            if [ z$ENABLEHPPA = zYES ]; then
222                                    printf "  --disable-hppa     disable "
223                            else
224                                    printf "  --enable-hppa      enable "
225                            fi
226                            printf "HPPA CPU emulation\n"
227    
228                            if [ z$ENABLEI960 = zYES ]; then
229                                    printf "  --disable-i960     disable "
230                            else
231                                    printf "  --enable-i960      enable "
232                            fi
233                            printf "i960 CPU emulation\n"
234    
235                          if [ z$ENABLEIA64 = zYES ]; then                          if [ z$ENABLEIA64 = zYES ]; then
236                                  printf "  --disable-ia64     disable "                                  printf "  --disable-ia64     disable "
237                          else                          else
# Line 189  if [ z"$*" != z ]; then Line 253  if [ z"$*" != z ]; then
253                          fi                          fi
254                          printf "MIPS CPU emulation\n"                          printf "MIPS CPU emulation\n"
255    
256                            if [ z$ENABLENEWMIPS = zYES ]; then
257                                    printf "  --disable-newmips  disable "
258                            else
259                                    printf "  --enable-newmips   enable "
260                            fi
261                            printf "(New, dyntrans) MIPS CPU emulation\n"
262    
263                          if [ z$ENABLEPPC = zYES ]; then                          if [ z$ENABLEPPC = zYES ]; then
264                                  printf "  --disable-ppc      disable "                                  printf "  --disable-ppc      disable "
265                          else                          else
# Line 196  if [ z"$*" != z ]; then Line 267  if [ z"$*" != z ]; then
267                          fi                          fi
268                          printf "POWER/PPC CPU emulation\n"                          printf "POWER/PPC CPU emulation\n"
269    
270                            if [ z$ENABLESH = zYES ]; then
271                                    printf "  --disable-sh       disable "
272                            else
273                                    printf "  --enable-sh        enable "
274                            fi
275                            printf "SH CPU emulation\n"
276    
277                          if [ z$ENABLESPARC = zYES ]; then                          if [ z$ENABLESPARC = zYES ]; then
278                                  printf "  --disable-sparc    disable "                                  printf "  --disable-sparc    disable "
279                          else                          else
# Line 222  if [ z"$*" != z ]; then Line 300  if [ z"$*" != z ]; then
300                          echo "Run  $0 --help  to get a list of" \                          echo "Run  $0 --help  to get a list of" \
301                              "available options."                              "available options."
302                          exit                          exit
303                  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
304                  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
305                    fi; fi; fi; fi; fi; fi; fi
306          done          done
307  fi  fi
308    
# Line 267  fi Line 346  fi
346  if [ z$ENABLEALPHA = zYES ]; then  if [ z$ENABLEALPHA = zYES ]; then
347          printf "#define ENABLE_ALPHA\n" >> config.h          printf "#define ENABLE_ALPHA\n" >> config.h
348          CPU_ARCHS="$CPU_ARCHS cpu_alpha.o cpu_alpha_palcode.o"          CPU_ARCHS="$CPU_ARCHS cpu_alpha.o cpu_alpha_palcode.o"
349            CPU_TOOLS="$CPU_TOOLS generate_alpha_misc"
350  fi  fi
351  if [ z$ENABLEARM = zYES ]; then  if [ z$ENABLEARM = zYES ]; then
352          printf "#define ENABLE_ARM\n" >> config.h          printf "#define ENABLE_ARM\n" >> config.h
353          CPU_ARCHS="$CPU_ARCHS cpu_arm.o"          CPU_ARCHS="$CPU_ARCHS cpu_arm.o cpu_arm_coproc.o memory_arm.o "
354            CPU_ARCHS="$CPU_ARCHS tmp_arm_dpi.o tmp_arm_loadstore.o tmp_arm_r.o"
355            CPU_ARCHS="$CPU_ARCHS tmp_arm_r0.o tmp_arm_r1.o"
356            CPU_ARCHS="$CPU_ARCHS tmp_arm_r2.o tmp_arm_r3.o"
357            CPU_ARCHS="$CPU_ARCHS tmp_arm_r4.o tmp_arm_r5.o"
358            CPU_ARCHS="$CPU_ARCHS tmp_arm_r6.o tmp_arm_r7.o"
359            CPU_ARCHS="$CPU_ARCHS tmp_arm_r8.o tmp_arm_r9.o"
360            CPU_ARCHS="$CPU_ARCHS tmp_arm_ra.o tmp_arm_rb.o"
361            CPU_ARCHS="$CPU_ARCHS tmp_arm_rc.o tmp_arm_rd.o"
362            CPU_ARCHS="$CPU_ARCHS tmp_arm_re.o tmp_arm_rf.o tmp_arm_multi.o"
363            CPU_TOOLS="$CPU_TOOLS generate_arm_dpi generate_arm_r"
364            CPU_TOOLS="$CPU_TOOLS generate_arm_loadstore generate_arm_multi"
365    fi
366    if [ z$ENABLEAVR = zYES ]; then
367            printf "#define ENABLE_AVR\n" >> config.h
368            CPU_ARCHS="$CPU_ARCHS cpu_avr.o"
369    fi
370    if [ z$ENABLEHPPA = zYES ]; then
371            printf "#define ENABLE_HPPA\n" >> config.h
372            CPU_ARCHS="$CPU_ARCHS cpu_hppa.o"
373    fi
374    if [ z$ENABLEI960 = zYES ]; then
375            printf "#define ENABLE_I960\n" >> config.h
376            CPU_ARCHS="$CPU_ARCHS cpu_i960.o"
377  fi  fi
378  if [ z$ENABLEIA64 = zYES ]; then  if [ z$ENABLEIA64 = zYES ]; then
379          printf "#define ENABLE_IA64\n" >> config.h          printf "#define ENABLE_IA64\n" >> config.h
# Line 283  fi Line 386  fi
386  if [ z$ENABLEMIPS = zYES ]; then  if [ z$ENABLEMIPS = zYES ]; then
387          printf "#define ENABLE_MIPS\n" >> config.h          printf "#define ENABLE_MIPS\n" >> config.h
388  fi  fi
389    if [ z$ENABLENEWMIPS = zYES ]; then
390            printf "#define ENABLE_NEWMIPS\n" >> config.h
391            CPU_ARCHS="$CPU_ARCHS cpu_newmips.o"
392    fi
393  if [ z$ENABLEPPC = zYES ]; then  if [ z$ENABLEPPC = zYES ]; then
394          printf "#define ENABLE_PPC\n" >> config.h          printf "#define ENABLE_PPC\n" >> config.h
395          CPU_ARCHS="$CPU_ARCHS cpu_ppc.o"          CPU_ARCHS="$CPU_ARCHS cpu_ppc.o"
396            CPU_TOOLS="$CPU_TOOLS generate_ppc_loadstore"
397    fi
398    if [ z$ENABLESH = zYES ]; then
399            printf "#define ENABLE_SH\n" >> config.h
400            CPU_ARCHS="$CPU_ARCHS cpu_sh.o"
401  fi  fi
402  if [ z$ENABLESPARC = zYES ]; then  if [ z$ENABLESPARC = zYES ]; then
403          printf "#define ENABLE_SPARC\n" >> config.h          printf "#define ENABLE_SPARC\n" >> config.h
# Line 411  if [ z"$CC" = z ]; then Line 523  if [ z"$CC" = z ]; then
523          fi          fi
524          rm -f _testprog          rm -f _testprog
525    
526          #  Try ccc (FreeBSD/Alpha):  #       #  Try ccc (FreeBSD/Alpha):
527          printf "#!/bin/sh\nccc _testprog.c -o _testprog >" > _test.sh  #       printf "#!/bin/sh\nccc _testprog.c -o _testprog >" > _test.sh
528          printf " /dev/null 2> /dev/null\n" >> _test.sh  #       printf " /dev/null 2> /dev/null\n" >> _test.sh
529          chmod 755 _test.sh  #       chmod 755 _test.sh
530          ./_test.sh > /dev/null 2> /dev/null  #       ./_test.sh > /dev/null 2> /dev/null
531          if [ -x _testprog ]; then  #       if [ -x _testprog ]; then
532                  CC="ccc"  #               CC="ccc"
533          fi  #       fi
534          rm -f _testprog  #       rm -f _testprog
535    
536          rm -f _test.sh          rm -f _test.sh
537  fi  fi
# Line 1016  rm -f _testoff.c _testoff Line 1128  rm -f _testoff.c _testoff
1128    
1129    
1130  #  Check for u_int8_t etc:  #  Check for u_int8_t etc:
1131    #  These are needed because some header files in src/include/ use u_int*
1132    #  instead of uint*, and I don't have time to rewrite them all.
1133  printf "checking for u_int8_t... "  printf "checking for u_int8_t... "
1134  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
1135  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 1151  if [ ! -x _testuint ]; then
1151          printf "typedef uint8_t u_int8_t;\n" >> config.h          printf "typedef uint8_t u_int8_t;\n" >> config.h
1152          printf "typedef uint16_t u_int16_t;\n" >> config.h          printf "typedef uint16_t u_int16_t;\n" >> config.h
1153          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  
1154          printf "uint8_t\n"          printf "uint8_t\n"
1155  else  else
1156          printf "yes\n"          printf "yes\n"
1157  fi  fi
1158  rm -f _testuint.c _testuint  rm -f _testuint.c _testuint
1159    
1160    printf "checking for u_int64_t... "
1161    printf "#include <stdio.h>\n#include <inttypes.h>\n#include <sys/types.h>\n
1162    int main(int argc, char *argv[]){printf(\"%%i\\\n\",
1163     (int)sizeof(u_int64_t));return 0;}\n" > _testuint.c
1164    $CC $CFLAGS _testuint.c -o _testuint 2> /dev/null
1165    if [ ! -x _testuint ]; then
1166            rm -f _testuint*
1167            printf "#include <stdio.h>\n#include <inttypes.h>
1168            \n#include <sys/types.h>\nint main(int argc, char *argv[])
1169            {printf(\"%%i\\\n\", (int)sizeof(uint64_t));return 0;}\n" > _testuint.c
1170            $CC $CFLAGS _testuint.c -o _testuint 2> /dev/null
1171            if [ ! -x _testuint ]; then
1172                    printf "no\n\nERROR: No u_int64_t or uint64_t. Aborting\n"
1173                    #  TODO: Automagically detect using various combinations
1174                    #  of char, int, short, long etc.
1175                    exit
1176            fi
1177    
1178            printf "typedef uint64_t u_int64_t;\n" >> config.h
1179            printf "uint64_t\n"
1180    else
1181            printf "yes\n"
1182    fi
1183    rm -f _testuint.c _testuint
1184    
1185    
1186  ###############################################################################  ###############################################################################
1187  #  #
# Line 1177  echo "DINCLUDE=$DINCLUDE" >> _Makefile.h Line 1315  echo "DINCLUDE=$DINCLUDE" >> _Makefile.h
1315  echo "CC=$CC" >> _Makefile.header  echo "CC=$CC" >> _Makefile.header
1316  echo "OTHERLIBS=$OTHERLIBS" >> _Makefile.header  echo "OTHERLIBS=$OTHERLIBS" >> _Makefile.header
1317  echo "CPU_ARCHS=$CPU_ARCHS" >> _Makefile.header  echo "CPU_ARCHS=$CPU_ARCHS" >> _Makefile.header
1318    echo "CPU_TOOLS=$CPU_TOOLS" >> _Makefile.header
1319  echo "" >> _Makefile.header  echo "" >> _Makefile.header
1320    
1321    
1322  #  Create the Makefiles:  #  Create the Makefiles:
1323    D=". src src/include src/cpus src/devices src/devices/fonts src/promemul"
1324  for a in . src src/devices src/devices/fonts; do  for a in $D; do
1325          echo "creating $a/Makefile"          echo "creating $a/Makefile"
1326          touch $a/Makefile          touch $a/Makefile
1327          cat _Makefile.header > $a/Makefile          cat _Makefile.header > $a/Makefile

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

  ViewVC Help
Powered by ViewVC 1.1.26