|
|
1.1 root 1: dnl Generator configure.in file - process with autoconf
2:
3: AC_INIT(cpu68k/def68k.c)
4: AC_CANONICAL_SYSTEM
1.1.1.3 ! root 5: AM_INIT_AUTOMAKE(generator, 0.34)
1.1 root 6: AM_CONFIG_HEADER(config.h)
7: optimum=yes
8:
9: dnl See what version we're compiling
10:
1.1.1.3 ! root 11: MY_DIST_SUBDIRS="cpu68k raze cmz80 ym2612 sn76496 main glade gtkopts"
! 12: MY_SUBDIRS="cpu68k ym2612 sn76496 main"
! 13: MY_LIBS=""
! 14: UNDERSCORE=""
! 15: ASMOUTPUT=elf
! 16: AC_ARG_WITH(coffasm,
! 17: AC_HELP_STRING([--with-coffasm], [Assemble coff files]),
! 18: ASMOUTPUT=coff; UNDERSCORE="_")
! 19: AC_ARG_WITH(svgalib,
! 20: AC_HELP_STRING([--with-svgalib], [Create svgalib version]),
! 21: MY_PROG="generator-svgalib")
! 22: AC_ARG_WITH(allegro,
! 23: AC_HELP_STRING([--with-allegro], [Create allegro version]),
! 24: MY_PROG="generator-allegro")
! 25: AC_ARG_WITH(tcltk,
! 26: AC_HELP_STRING([--with-tcltk], [Create tcltk version]),
! 27: MY_PROG="generator-tcltk")
! 28: AC_ARG_WITH(gtk,
! 29: AC_HELP_STRING([--with-gtk], [Create gtk version]),
! 30: MY_PROG="generator-gtk")
! 31: if [[ "x$MY_PROG" = "x" ]]; then
! 32: AC_MSG_ERROR(You must select a user interface type:
! 33: svgalib allegro tcltk gtk)
1.1 root 34: fi
1.1.1.3 ! root 35: if [[ "x$MY_PROG" = "xgenerator-allegro" ]]; then
1.1 root 36: AC_DEFINE(ALLEGRO, 1, [Allegro version])
1.1.1.3 ! root 37: PROGRAM='generator-allegro$(EXEEXT)'
! 38: else
! 39: PROGRAM=$MY_PROG
! 40: fi
! 41: AC_ARG_WITH(raze,
! 42: AC_HELP_STRING([--with-raze], [Use RAZE z80 emulation]),
! 43: Z80="raze")
! 44: AC_ARG_WITH(cmz80,
! 45: AC_HELP_STRING([--with-cmz80], [Use C mz80 z80 emulation]),
! 46: Z80="cmz80")
! 47: if [[ "x$Z80" = "xraze" ]]; then
! 48: MY_SUBDIRS="raze $MY_SUBDIRS"
! 49: MY_LIBS="../raze/libraze.a $MY_LIBS"
! 50: AC_DEFINE(RAZE, 1, [Define to use RAZE z80 emulation])
! 51: elif [[ "x$Z80" = "xcmz80" ]]; then
! 52: MY_SUBDIRS="cmz80 $MY_SUBDIRS"
! 53: MY_LIBS="../cmz80/libcmz80.a $MY_LIBS"
! 54: AC_DEFINE(CMZ80, 1, [Define to use the portable C mz80 z80 emulation])
! 55: else
! 56: AC_MSG_ERROR(You must select a z80 emulator: raze cmz80)
1.1 root 57: fi
1.1.1.2 root 58: AC_DEFINE(DIRECTRAM, 1, [Define for direct ram writes (faster)])
1.1.1.3 ! root 59: AC_SUBST(PROGRAM)
! 60: AC_SUBST(ASMOUTPUT)
! 61: AC_SUBST(UNDERSCORE)
! 62: AC_SUBST(MY_LIBS)
! 63: AC_SUBST(MY_SUBDIRS)
! 64: AC_SUBST(MY_DIST_SUBDIRS)
1.1 root 65:
66: dnl Check for processor.
67:
68: case $target_cpu in
69: i?86) AC_MSG_RESULT(Turning on x86 processor optimisations)
70: AC_DEFINE(PROCESSOR_INTEL, 1, [Define if you have an x86 processor])
71: ALIGNLONGS=1
72: ;;
73: sparc) AC_MSG_RESULT(Turning on sparc processor optimisations)
74: AC_DEFINE(PROCESSOR_SPARC, 1, [Define if you have a sparc processor])
75: ALIGNLONGS=0
76: ;;
77: arm) AC_MSG_RESULT(Turning on arm processor optimisations)
78: AC_DEFINE(PROCESSOR_ARM, 1, [Define if you have an ARM processor])
79: ALIGNLONGS=1
80: ;;
81: *) AC_MSG_WARN(Processor type not known - processor optimisations off!)
82: ALIGNLONGS=1
83: optimum=no
84: ;;
85: esac
86:
87: AC_DEFINE(ALIGNLONGS, ALIGNLONGS,
88: [Undefine if your processor can read unaligned 32-bit values])
89:
90: dnl Check for gcc options
91:
92: # default to gcc version 2
93: GCCVER=2
94: WARN=no
95: DEBUG=no
1.1.1.3 ! root 96: AC_ARG_WITH(nologging, AC_HELP_STRING([--with-nologging],
! 97: [Turn off all logging]),
! 98: AC_DEFINE(NOLOGGING, 1, [Define to turn off all logging]))
! 99: AC_ARG_WITH(warnings, AC_HELP_STRING([--with-warnings],
! 100: [Turn on gcc warnings]),
1.1 root 101: WARN=$withval, WARN=no)
1.1.1.3 ! root 102: AC_ARG_WITH(gcc, AC_HELP_STRING([--with-gcc@<:@=VER@:>@],
! 103: [GCC optimisation setting]),
1.1 root 104: GCCVER=$withval)
1.1.1.3 ! root 105: AC_ARG_WITH(raze, AC_HELP_STRING([--with-raze],
! 106: [Use raze z80 emulation]),
! 107: RAZE=$withval, DEBUG=no)
! 108: AC_ARG_WITH(debug, AC_HELP_STRING([--with-debug],
! 109: [Turn debugging options on]),
1.1 root 110: DEBUG=$withval, DEBUG=no)
111: if [[ "x$WARN" != "xno" ]]; then
1.1.1.3 ! root 112: CFLAGS="$CFLAGS -W -Wall -Wstrict-prototypes -Wformat -Wunused"
1.1 root 113: fi
114: if [[ "x$DEBUG" != "xno" ]]; then
115: AC_MSG_RESULT(Turning on debug flags)
116: CFLAGS="$CFLAGS -g -O"
117: optimum=no
118: else
119: if [[ "x$GCCVER" != "xno" ]]; then
120: AC_MSG_RESULT(Turning on gcc optimisations)
121: CFLAGS="$CFLAGS -O3 -ffast-math -fomit-frame-pointer"
122: if [[ "x$GCCVER" = "x3" ]]; then
123: AC_MSG_RESULT(Turning on gcc 3 optimisations)
124: CFLAGS="$CFLAGS -minline-all-stringops -fno-math-errno"
125: fi
126: case $target_cpu in
127: i?86) AC_MSG_RESULT(Turning on pentium optimisations)
128: CFLAGS="$CFLAGS -march=pentium -malign-double -malign-loops=5"
129: CFLAGS="$CFLAGS -malign-jumps=5 -malign-functions=5"
130: ;;
131: esac
132: else
133: AC_MSG_WARN(You did not opt for gcc optimisations!)
134: optimum=no
135: fi
136: fi
137:
138: dnl Checks for programs.
139:
140: AC_PROG_CC
141: AC_PROG_RANLIB
1.1.1.3 ! root 142: AC_PROG_MAKE_SET
1.1 root 143: AC_ISC_POSIX
144: AC_PROG_INSTALL
145: AC_TYPE_SIGNAL
146:
147: dnl Checks for header files.
148:
149: AC_HEADER_STDC
150:
1.1.1.3 ! root 151: dnl Checks for libraries.
! 152:
! 153: if [[ "x$MY_PROG" = "xgenerator-gtk" ]]; then
! 154: MY_SUBDIRS="glade gtkopts $MY_SUBDIRS"
! 155: AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(Generator needs gtk 1.2.0 or later))
! 156: AM_PATH_SDL(1.1.0,,AC_MSG_ERROR(Generator needs sdk 1.1.0 or later))
! 157: fi
! 158:
1.1 root 159: dnl Checks for typedefs, structures, and compiler characteristics.
160:
161: if [[ $cross_compiling = no ]]; then
162: AC_C_BIGENDIAN
163: else
164: AC_WARN(Assuming little endian for cross compilation)
165: # AC_DEFINE(WORDS_BIGENDIAN, 1)
166: fi
167: AC_C_CONST
168: AC_C_INLINE
169: AC_CHECK_SIZEOF(unsigned char, 1)
170: AC_CHECK_SIZEOF(unsigned short, 2)
171: AC_CHECK_SIZEOF(unsigned int, 4)
172: AC_CHECK_SIZEOF(unsigned long, 4)
173: AC_CHECK_SIZEOF(unsigned long long, 8)
174: AC_CHECK_FUNCS(snprintf)
175: AC_CHECK_HEADERS(tcl8.0.h)
176: AC_CHECK_HEADERS(tk8.0.h)
177:
178: dnl Makefile substitutions
179:
180: dnl Final stuff
181:
1.1.1.3 ! root 182: AC_OUTPUT([Makefile cpu68k/Makefile raze/Makefile cmz80/Makefile
! 183: ym2612/Makefile main/Makefile sn76496/Makefile glade/Makefile
! 184: gtkopts/Makefile raze/raze.asm])
1.1 root 185:
186: if [[ $optimum = no ]]; then
187: echo '!!! Generator was compiled non-optimally, see warnings above !!!' 1>&2
188: fi
189:
190: dnl Moooo.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.