* debugger/mcs51/sdcdb.c: replaced hardcoded "/" with DIR_SEPARATOR_STRING
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 30 Oct 2006 19:32:18 +0000 (19:32 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 30 Oct 2006 19:32:18 +0000 (19:32 +0000)
* debugger/mcs51/acinclude.m4: locate readline even when cross compiling

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4446 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
debugger/mcs51/acinclude.m4
debugger/mcs51/sdcdb.c

index 1120cd0ea43d06bbbc761b27be1c6b23ec346429..434718d36a0db76fcfca7dbbf647f22514567610 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-10-30 Borut Razem <borut.razem AT siol.net>
+
+       * debugger/mcs51/sdcdb.c: replaced hardcoded "/" with DIR_SEPARATOR_STRING
+       * debugger/mcs51/acinclude.m4: locate readline even when cross compiling
+
 2006-10-29 Jesus Calvino-Fraga <jesusc at ece.ubc.ca>
 
        * device/include/mcs51/serial_IO.h: putchar() and getchar() using
 
 2006-10-20 Borut Razem <borut.razem AT siol.net>
 
-       * sebugger/mcs51/sdcdb.c: replaced isblank() with isspace()
+       * debugger/mcs51/sdcdb.c: replaced isblank() with isspace()
 
 2006-10-19 Maarten Brock <sourceforge.brock AT dse.nl>
 
index aeabddf2a9880e5091499a2de3c04d47d2796c09..64ea826cdd661e0bd79ede25786ccc316039e8f2 100644 (file)
-dnl Scott Dattalo
-dnl
-dnl  This is copied from the NcFTP distribution.
-dnl  Author Mike Gleason mgleason@NcFTP.com
-dnl
-dnl This macro will check for the presence and version
-dnl of the readline library. To get it into the aclocal.m4
-dnl file, do this:
+dnl This macro will check for the presence of the readline library.
+dnl To get it into the aclocal.m4 dnl file, do this:
 dnl   aclocal -I . --verbose
 dnl
 dnl The --verbose will show all of the files that are searched
 dnl for .m4 macros.
-AC_DEFUN([wi_LIB_READLINE], [
-AC_MSG_CHECKING([for GNU Readline library, version 2.0 or newer])
-
-wi_cv_lib_readline=no
-wi_cv_lib_readline_result=no
-ac_save_LIBS="$LIBS"
-# Note: $LIBCURSES is permitted to be empty.
-for LIBREADLINE in "-lreadline" "-lreadline $LIBCURSES" "-lreadline -ltermcap" "-lreadline -lncurses" "-lreadline -lcurses"
-do
-       LIBS="$ac_save_LIBS $LIBREADLINE"
-       AC_TRY_RUN([
-       /* program */
-#include <stdio.h>
-#include <stdlib.h>
-
-main(int argc, char **argv)
-{
-       /* Note:  don't actually call readline, since it may block;
-        * We just want to see if it (dynamic) linked in okay.
-        */
-       if (argc == 0)  /* never true */
-               readline(0);
-       exit(0);
-}
-],[
-       # action if true
-       wi_cv_lib_readline=yes
-],[
-       # action if false
-       wi_cv_lib_readline=no
-],[
-       # action if cross compiling
-       wi_cv_lib_readline=no
-])
-
-       if test "$wi_cv_lib_readline" = yes ; then break ; fi
-done
-
-# Now try it again, to be sure it is recent enough.
-# rl_function_of_keyseq appeared in version 2.0
-#
-dnl AC_CHECK_FUNC(rl_function_of_keyseq, [wi_cv_lib_readline=yes],[
-dnl    wi_cv_lib_readline=no;wi_cv_lib_readline_result="no (it is present but too old to use)"
-dnl ])
-       AC_TRY_LINK([
-               /* includes */
-       ],[
-               /* function-body */
-               readline(0);
-               rl_function_of_keyseq(0);
-       ],[
-               wi_cv_lib_readline=yes
-       ],[
-               wi_cv_lib_readline=no
-               wi_cv_lib_readline_result="no (it is present but too old to use)"
-       ])
-
-if test "$wi_cv_lib_readline" = no ; then
-       LIBREADLINE=""
-       # restore LIBS
-       LIBS="$ac_save_LIBS"
-else
-       /bin/rm -f readline.ver
-       touch readline.ver
-
-       AC_TRY_RUN([
-       /* program */
-#include <unistd.h>
-#include <sys/types.h>
-#include <stdio.h>
-
-extern char *rl_library_version;
 
-main()
-{
-       FILE *fp;
-       double d;
-
-       sscanf(rl_library_version, "%lf", &d);
-       fp = fopen("readline.ver", "w");
-       if (fp == NULL) exit(1);
-       if (fprintf(fp, "%s\n", rl_library_version) < 0) exit(1);
-       if (fprintf(fp, "%03d\n", (int) (d * 100.0)) < 0) exit(1);
-       if (fclose(fp) < 0) exit(1);
-       exit(0);
-}
-       ],[
-               # action if true
-               rl_library_version=`sed -n 1,1p readline.ver 2>/dev/null`
-               rlver=`sed -n 2,2p readline.ver 2>/dev/null`
-               /bin/rm -f readline.ver
-       ],[
-               # action if false
-               rl_library_version=''
-               rlver=''
-               /bin/rm -f readline.ver
-       ],[
-               # action if cross compiling
-               rl_library_version=''
-               rlver=''
-               /bin/rm -f readline.ver
-       ])
-
-       case "$rlver" in
-               ???)
-                       wi_cv_lib_readline_result="yes, installed version is $rl_library_version"
-                       ;;
-               *)
-                       # Test using current LIBS.
-                       AC_TRY_LINK([
-                               /* includes */
-                               extern int rl_completion_append_character;
-                       ],[
-                               /* function-body */
-                               readline(0);
-                               rl_completion_append_character = 0;
-                       ],[
-                               rlver="210"
-                       ],[
-                               rlver="200"
-                       ])
-
-                       if test "$rlver" = "210" ; then
-                               wi_cv_lib_readline_result="yes, version 2.1 or higher"
-                       else
-                               wi_cv_lib_readline_result="yes, version 2.0"
-                       fi
-                       ;;
-       esac
-
-       wi_cv_lib_readline=yes
-       # restore LIBS
-       LIBS="$ac_save_LIBS"
-fi
-AC_MSG_RESULT($wi_cv_lib_readline_result)
-AC_SUBST(LIBREADLINE)
-
-if test "$wi_cv_lib_readline" = yes ; then
-       # Now verify that all the headers are installed.
-       #
-       AC_REQUIRE_CPP()
-       unset ac_cv_header_readline_chardefs_h
-       unset ac_cv_header_readline_history_h
-       unset ac_cv_header_readline_keymaps_h
-       unset ac_cv_header_readline_readline_h
-       unset ac_cv_header_readline_tilde_h
-       AC_CHECK_HEADERS([readline/chardefs.h readline/history.h readline/keymaps.h readline/readline.h readline/tilde.h])
-
-       for xxwi in \
-               "$ac_cv_header_readline_chardefs_h" \
-               "$ac_cv_header_readline_history_h" \
-               "$ac_cv_header_readline_keymaps_h" \
-               "$ac_cv_header_readline_readline_h" \
-               "$ac_cv_header_readline_tilde_h"
-       do
-               if test "$xxwi" = no ; then
-                       break
-               fi
-       done
-
-       if test "$xxwi" = no ; then
-               AC_MSG_WARN([GNU Readline headers are not installed or could not be found -- GNU Readline will not be used.])
-               wi_cv_lib_readline=no
-               wi_cv_lib_readline_result="no (headers not installed)"
-       else
-               AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE, $rlver,[Readline])
-       fi
-fi
-       dnl Check to see if we have a namespace clean version of readline
-       dnl or not. At least FreeBSD 4.9 ships with non-ns-clean readline.
-       if test "$wi_cv_lib_readline" = "yes" ; then
-               ac_save_LIBS="$LIBS"
-               LIBS="$ac_save_LIBS $LIBREADLINE"
-               AC_CHECK_FUNCS(rl_completion_matches completion_matches)
-               # restore LIBS
-               LIBS="$ac_save_LIBS"
-       fi
-       dnl Check to see if rl_callback_handler_install takes a cast
-       AC_MSG_CHECKING([to see if readline callbacks take a cast])
-       ac_save_LIBS="$LIBS"
-       LIBS="$ac_save_LIBS $LIBREADLINE"
-       ac_save_CC="$CC"
-       CC="$CXX"
-       AC_TRY_LINK([
-#include <stdio.h>
-#include <readline/readline.h>
-void func(void) { return; }
-       ],[
-               rl_callback_handler_install(">", (void(*)(char*))func);
-       ],[
-               AC_DEFINE(READLINE_CB_TAKES_CAST, 1, [callbacks take a cast])
-               AC_MSG_RESULT([yes])
-       ],[
-               AC_MSG_RESULT([no])
-       ])
-       # restore LIBS
-       LIBS="$ac_save_LIBS"
-       CC="$ac_save_CC"
+AC_DEFUN([wi_LIB_READLINE], [
+  dnl check for the readline.h header file
+  AC_CHECK_HEADER(readline/readline.h)
+
+  if test "$ac_cv_header_readline_readline_h" = yes; then
+    dnl check for the readline library
+
+    ac_save_LIBS="$LIBS"
+    # Note: $LIBCURSES is permitted to be empty.
+
+    for LIBREADLINE in "-lreadline.dll" "-lreadline" "-lreadline $LIBCURSES" "-lreadline -ltermcap" "-lreadline -lncurses" "-lreadline -lcurses"
+    do
+      AC_MSG_CHECKING([for GNU Readline library])
+
+      LIBS="$ac_save_LIBS $LIBREADLINE"
+
+      AC_TRY_LINK([
+        /* includes */
+        #include <stdio.h>
+        #include <readline/readline.h>
+      ],[
+        /* function-body */
+        readline(NULL);
+        rl_function_of_keyseq(NULL, NULL, NULL);
+      ],[
+        wi_cv_lib_readline=yes
+        wi_cv_lib_readline_result="$LIBREADLINE"
+      ],[
+        wi_cv_lib_readline=no
+        wi_cv_lib_readline_result=no
+      ])
+
+      if test "$wi_cv_lib_readline" = yes; then
+        AC_MSG_RESULT($wi_cv_lib_readline_result)
+        AC_SUBST(LIBREADLINE)
+        AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE, 1, [Readline])
+        break
+      fi
+    done
+
+    LIBS="$ac_save_LIBS"
+  fi
 ])
-dnl
-dnl
index eb598461192868e79ea9384ac5b9f77ffd4a9c78..507ad1bfc7b7337b8b598f32a0b230b663de1649 100644 (file)
@@ -52,7 +52,7 @@ short showfull = 0;
 char userinterrupt = 0;
 char nointerrupt = 0;
 char contsim = 0;
-char *ssdirl = DATADIR LIB_DIR_SUFFIX ":" DATADIR LIB_DIR_SUFFIX "/small" ;
+char *ssdirl = DATADIR LIB_DIR_SUFFIX ":" DATADIR LIB_DIR_SUFFIX DIR_SEPARATOR_STRING "small" ;
 char *simArgs[40];
 int nsimArgs = 0;
 char model_str[20];