* sim/ucsim/cmd.src/Makefile.in: run lex only if $(PRJDIR)/devel exists
[fw/sdcc] / sim / ucsim / configure.in
index 4ec7f55faf8b343630367e256868e4ceec91e056..1c9e059299a83df2a3f4ff4688785e890b7edbb4 100644 (file)
@@ -27,6 +27,13 @@ AC_DEFINE_UNQUOTED(VERSIONP, $VERSIONP)
 
 # Some options
 #==============
+# *nix default: "${datadir}/sdcc/doc"
+AC_ARG_VAR(docdir, documentation installation directory)
+if test "${docdir}" = ""; then
+    docdir="\${datadir}"/sdcc/doc
+fi
+AC_SUBST(docdir)
+
 AC_ARG_ENABLE(ucsim,
 [  --enable-ucsim          compile ucsim frontend],
 if test $enable_ucsim != "no"; then
@@ -58,6 +65,12 @@ if test $enable_z80 != "no"; then
     enable_z80="yes"
 fi,
 enable_z80="no")
+AC_ARG_ENABLE(hc08,
+[  --enable-hc08           compile simulator for hc08],
+if test $enable_hc08 != "no"; then
+    enable_hc08="yes"
+fi,
+enable_hc08="yes")
 AC_ARG_ENABLE(xa,
 [  --enable-xa             compile simulator for XA],
 if test $enable_xa != "no"; then
@@ -75,19 +88,44 @@ AC_SUBST(enable_dlso)
 AC_SUBST(enable_51)
 AC_SUBST(enable_avr)
 AC_SUBST(enable_z80)
+AC_SUBST(enable_hc08)
 AC_SUBST(enable_xa)
 AC_SUBST(enable_serio)
 
+AC_ARG_ENABLE(statistic,
+[  --enable-statistic      compile statistical features (slower simulation)],
+if test $enable_statistic != "no"; then
+   enable_statistic="yes"
+fi,
+enable_statistic="no")
+AC_DEFINE_UNQUOTED(STATISTIC, $enable_statistic)
+
+
 # Required programs
 #-------------------
 AC_PROG_CXX
 AC_PROG_CXXCPP
 AC_PROG_INSTALL
 AC_PROG_RANLIB
-AC_LANG_CPLUSPLUS
+dnl AC_LANG_CPLUSPLUS
 
 AC_CHECK_PROG(STRIP, strip, strip, :)
 
+AC_LIBTOOL_DLOPEN
+dnl AC_LIBTOOL_WIN32_DLL
+AC_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+
+AC_PROG_LEX
+if test ${LEX} = "flex"; then
+       AC_DEFINE(HAVE_FLEX)
+fi
+AC_PROG_YACC
+AC_CHECK_PROG(BISON_PLUS_PLUS, bison++, bison++, :)
+
+
+AC_LANG_CPLUSPLUS
+
 # Checking for header files.
 # ===========================================================================
 
@@ -181,7 +219,8 @@ AC_SUBST(curses_ok)
 AC_SUBST(CURSES_LIBS)
 
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(vsnprintf vasprintf)
+AC_CHECK_FUNCS(vsnprintf)
+AC_CHECK_FUNCS(vasprintf)
 AC_CHECK_FUNCS(strlen strcpy strcat strstr strcmp strerror strtok strdup)
 AC_CHECK_FUNCS(strchr memcpy)
 dnl AC_CHECK_FUNCS(getline)
@@ -267,7 +306,7 @@ AC_DEFUN(DD_COPT, [
 AC_CACHE_CHECK(whether $$1 accepts -$2,ucsim_cv_$1$2,
 cat >_test_.c <<EOF
 #include <stdio.h>
-void main(void) {}
+int main(void) {return(0);}
 EOF
 $$1 -v -$2 -c _test_.c 1>&5 2>&5
 if test "$?" = "0"; then
@@ -293,7 +332,7 @@ if test "$CC" = "i586-mingw32msvc-gcc"; then
   ac_cv_sizeof_long_long=4
 fi
 
-if test "$cross_compiling" == "no"
+if test "$cross_compiling" = "no"
 then
     AC_C_BIGENDIAN
 else
@@ -322,12 +361,18 @@ AC_SUBST(M_OR_MM)
 # This is the first time when CFLAGS are set/modified!!
 
 DD_COPT(CXX, ggdb)
-if test "$ucsim_cv_CXXggdb" = "yes"; then
-    if test "$CXXFLAGS"x = x ;then
-       CXXFLAGS="-ggdb"
-    else
-       CXXFLAGS="$CXXFLAGS -ggdb"
-    fi
+DD_COPT(CXX, gstabs)
+if test "$ucsim_cv_CXXgstabs" = "yes"; then
+   gopt="-gstabs+ -g3"
+elif test "$ucsim_cv_CXXggdb" = "yes"; then
+     gopt="-ggdb -g3"
+else 
+     gopt="-g"
+fi
+if test "$CXXFLAGS"x = x ;then
+       CXXFLAGS="$gopt"
+else
+       CXXFLAGS="$CXXFLAGS $gopt"
 fi
 
 DD_COPT(CXX, pipe)
@@ -443,7 +488,6 @@ fi
 AC_DEFINE_UNQUOTED(_A_, "${A}")
 AC_DEFINE_UNQUOTED(_M_, "${M}")
 
-
 # Generating output files
 # ===========================================================================
 
@@ -454,6 +498,7 @@ cmd.src/Makefile
 s51.src/Makefile
 avr.src/Makefile
 z80.src/Makefile
+hc08.src/Makefile
 xa.src/Makefile
 gui.src/Makefile
 gui.src/serio.src/Makefile