]> git.lyx.org Git - lyx.git/commitdiff
Fix putenv() for solaris 7; tweak configure stuff.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 28 Dec 1999 14:06:29 +0000 (14:06 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 28 Dec 1999 14:06:29 +0000 (14:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@396 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
acconfig.h
acinclude.m4
configure.in
src/buffer.C
src/support/filetools.C

index ea998486ac2ace2d98277f86102a7c90efbd5115..122c724526f1bd131b33781bf96644ea66ea2dbf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+1999-12-28  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * src/buffer.C (Dispatch): remove an extraneous break statement.
+
+       * acinclude.m4 (STL_STRING_FWD_H_LOCATION): add the comment for
+       config.h.in to the AC_DEFINE_UNQUOTED() call.
+       (LYX_FUNC_PUTENV_ARGTYPE): new macro. Checks whether putenv()
+       needs char * as argument (because Solaris 7 declares it like
+       that). 
+
+       * acconfig.h: remove placeholder for STL_STRING_FWD_H_LOCATION;
+       remove definition of BZERO.
+
+       * src/support/filetools.C (QuoteName): change to do simple
+       'quoting'. More work is necessary. Also changed to do nothing
+       under emx (needs fix too).
+
 1999-12-24  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * src/support/LRegex.C: include <regex.h> if HAVE_REGEX_H is
index ad67e70f6e4cbe158971c40da6a832af6680ac09..b0a1e0b0d3a84b22d6f14771b49e3ec1ae2f5e2e 100644 (file)
 /* Define as 1 if you have the stpcopy function */
 #undef HAVE_STPCPY
 
-/* define this to the location of stl_string_fwd.h to be used with #include,
-  NOTE: Do not set it to <stl_string_fwd.h> as that will find the LyX
-       supplied version of the header.
-  e.g. <../include/stl_string_fwd.h> or better yet use an absolute path */
-#undef STL_STRING_FWD_H_LOCATION
-
 /* define this to the location of xpm.h to be used with #include,
   e.g. <xpm.h> */
 #undef XPM_H_LOCATION
 /**/#undef __STRICT_ANSI__
 #endif
 
-#ifdef HAVE_MEMSET
-#define BZERO(a,b)      memset(a,0,b)
-#else
-#define BZERO(a,b)      bzero(a,b)
-#endif
-
 #ifndef HAVE_STRCHR
 #define strchr(a,b)     index(a,b)
 #endif
index 1cbf2e1bb9e56f82dec49786c15cb95ae4ba4cc2..ae6c60eb41c9f385d730f331ef2cd37836e4db93 100644 (file)
@@ -608,6 +608,21 @@ if test "$ac_cv_sco" = yes; then
  test "x$GXX" = xyes && lyx_broken_headers=yes
 fi])
 
+dnl Usage: LYX_FUNC_PUTENV_ARGTYPE
+dnl Checks whether putenv() takes 'char const *' or 'char *' as
+dnl argument. This is needed because Solaris 7 (wrongly?) uses 'char *', 
+dnl while everybody else uses the former...
+AC_DEFUN(LYX_FUNC_PUTENV_ARGTYPE,
+[AC_MSG_CHECKING([type of argument for putenv()])
+ AC_CACHE_VAL(lyx_cv_func_putenv_arg,dnl
+  [AC_TRY_COMPILE(dnl
+[#include <cstdlib>
+extern int putenv(const char *);],,dnl
+   [lyx_cv_func_putenv_arg='char const *'],[lyx_cv_func_putenv_arg='char *'])])
+ AC_MSG_RESULT($lyx_cv_func_putenv_arg)
+ AC_DEFINE_UNQUOTED(PUTENV_TYPE_ARG,$lyx_cv_func_putenv_arg,dnl
+   [Define to the type of the argument of putenv(). Needed on Solaris 7.])])
+
 
 dnl Usage: LYX_WITH_DIR(dir-name,desc,dir-var-name,default-value, 
 dnl                       [default-yes-value])  
@@ -683,7 +698,6 @@ AC_DEFUN(AC_VALIDATE_CACHE_SYSTEM_TYPE, [
     ac_cv_target_system_type="$target"
 ])
 
-
 dnl We use this until autoconf fixes its version.
 AC_DEFUN(LYX_FUNC_SELECT_ARGTYPES,
 [AC_MSG_CHECKING([types of arguments for select()])
@@ -1138,7 +1152,11 @@ lyx_cv_path_stl_string_fwd_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
   grep 'stl_string_fwd.h'  2>/dev/null | \
   sed -e 's/.*\(".*stl_string_fwd.h"\).*/\1/' -e "1q"`
 rm -f conftest*])
-  AC_DEFINE_UNQUOTED(STL_STRING_FWD_H_LOCATION,$lyx_cv_path_stl_string_fwd_h)])
+  AC_DEFINE_UNQUOTED(STL_STRING_FWD_H_LOCATION,$lyx_cv_path_stl_string_fwd_h,
+[define this to the location of stl_string_fwd.h to be used with #include,
+  NOTE: Do not set it to <stl_string_fwd.h> as that will find the LyX
+       supplied version of the header.
+  e.g. <../include/stl_string_fwd.h> or better yet use an absolute path])])
 ])
 
 
index 5cecb1c8e8f3b6541dd3f17bcd08b7afc78efcba..900929a5dfa0da84907d2af9f4142124405cc218 100644 (file)
@@ -189,6 +189,9 @@ AC_CHECK_FUNCS(memmove memset strchr putenv setenv mkfifo)
 dnl Until this is fixed in autoconf we provide our own version
 LYX_FUNC_SELECT_ARGTYPES
 
+dnl check whether we have to work around solaris broken putenv()
+LYX_FUNC_PUTENV_ARGTYPE
+
 # SunOS 4.1.3 does not have strerror and atexit
 AC_REPLACE_FUNCS(strerror atexit)
 
index 76fe31fcda11e2546cc8f14536e4507db8043283..4a7e081b18ec3e3ab939aad5cb8393a5073bd650 100644 (file)
@@ -4013,7 +4013,6 @@ void Buffer::Dispatch(int action, const string & argument)
                case LFUN_EXPORT: 
                        MenuExport(this, argument);
                        break;
-                       break;
 
                default:
                        lyxerr << "A truly unknown func!" << endl;
index 2ae0400dc5676c00663598b094354531743bff94..d511683bc5c32bc213f40a3a5b06856fd9b9182a 100644 (file)
@@ -97,10 +97,11 @@ string QuoteName(string const & name)
 #ifdef WITH_WARNINGS
 #warning Add proper emx support here!
 #endif
-       string qname = name;
-       while (qname.find("'") != string::npos) 
-               LSubstring(qname, "'") = "\\'";
-       return '\'' + qname + '\'';
+#ifndef __EMX__
+       return '\'' + name + '\'';
+#else
+       return name; 
+#endif
 }
 
 
@@ -333,7 +334,7 @@ bool PutEnv(string const & envstr)
         // this leaks, but what can we do about it?
         //   Is doing a getenv() and a free() of the older value 
         //   a good idea? (JMarc)
-        int retval = putenv((new string(envstr))->c_str());
+        int retval = putenv(const_cast<PUTENV_TYPE_ARG>((new string(envstr))->c_str()));
 #else
 #ifdef HAVE_SETENV 
         string varname;