+1999-12-20 Allan Rae <rae@lyx.org>
+
+ * lib/templates/IEEEtran.lyx: small correction and update.
+
+ * configure.in: Attempted to use LYX_PATH_HEADER
+
+ * src/stl_string_fwd.h: Don't need HAVE_STL_STRING_FWD_H anymore
+
+ * acconfig.h, acinclude.m4 (LYX_STL_STRING_FWD): totally revised after
+ input from JMarc. Now use preprocessor to find the header.
+ Also stopped making HAVE_STL_STRING_FWD_H and extended the comments.
+ (LYX_PATH_HEADER): My, so far, failed attempt to generalize
+ LYX_STL_STRING_FWD. See comments in file.
+
1999-12-19 Asger Alstrup Nielsen <alstrup@diku.dk>
* The global MiniBuffer * minibuffer variable is dead.
esac
])
+
+### Check for a headers existence and location iff it exists
+## This is supposed to be a generalised version of LYX_STL_STRING_FWD
+## It almost works. I've tried a few variations but they give errors
+## of one sort or other: bad substitution or file not found etc. The
+## actual header _is_ found though and the cache variable is set however
+## the reported setting (on screen) is equal to $ac_safe for some unknown
+## reason.
+AC_DEFUN(LYX_PATH_HEADER,
+[ AC_CHECK_HEADER($1,[
+ ac_tr_safe=PATH_`echo $ac_safe | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ AC_CACHE_CHECK([path to $1],lyx_cv_path_$ac_safe,
+ [ cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#include <$1>
+EOF
+lyx_cv_path_$ac_safe=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
+ grep $1 2>/dev/null | \
+ sed -e 's/.*\(".*$1"\).*/\1/' -e "1q"`
+rm -f conftest*])
+ AC_DEFINE_UNQUOTED(${ac_tr_safe},${lyx_cv_path_$ac_safe})])
+])
+### end of LYX_PATH_HEADER
+
### Check for stl_string_fwd.h existence and location if it exists
-###
-### Three problems remain:
-### 1. I don't check if $lyx_cv_extra_inc has a value before testing it.
-### 2. I don't issue a warning/error if AC_CHECK_HEADERS finds it but I
-### don't. The warning should only need to be something like:
-### "Can't find path to stl_string_fwd.h please define
-### STL_STRING_FWD_H_LOCATION in src/config.h or supply the path
-### using --with-extra-inc"
-### 3. Multiple extra include dirs? and I don't check --with-extra-prefix yet
-###
AC_DEFUN(LYX_STL_STRING_FWD,
-[AC_CHECK_HEADERS(stl_string_fwd.h,[
- lyx_cv_stl_string_fwd_h_location="<../include/stl_string_fwd.h>"
- AC_CHECK_HEADER(../include/stl_string_fwd.h,[
- ac_cv_header_stl_string_fwd_h=yes
- lyx_cv_stl_string_fwd_h_location="<../include/stl_string_fwd.h>"],[
- AC_CHECK_HEADER($lyx_cv_extra_inc/stl_string_fwd.h,[
- ac_cv_header_stl_string_fwd_h=yes
- lyx_cv_stl_string_fwd_h_location="<$lyx_cv_extra_inc/stl_string_fwd.h>"],[
- ac_cv_header_stl_string_fwd_h=no])])
- AC_DEFINE_UNQUOTED(STL_STRING_FWD_H_LOCATION,$lyx_cv_stl_string_fwd_h_location)])
+[ AC_CHECK_HEADER(stl_string_fwd.h,[
+ AC_CACHE_CHECK([path to stl_string_fwd.h],lyx_cv_path_stl_string_fwd_h,
+ [ cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+
+#include <stl_string_fwd.h>
+EOF
+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)])
])
#define LYX_STL_STRING_FWD_H
-#if defined(HAVE_STL_STRING_FWD_H)
-# ifndef USE_INCLUDED_STRING
+#ifndef USE_INCLUDED_STRING
// include the real stl_string_fwd.h
-# include STL_STRING_FWD_H_LOCATION
-# else
+# include STL_STRING_FWD_H_LOCATION
+#else
// Hide the forward declaration of string by SGI's STL > 3.13.
// We have to provide the declaration of__get_c_string() ourselves
// since SGI expects it to exist and we're blocking their string declarations
// as best we can.
// Note that a declaration for string is still required so we have to
// provide one via LString.h. ARRae.
-# include "LString.h"
-# define __SGI_STL_STRING_FWD_H
- static char const * __get_c_string(string const &);
-# endif // USE_INCLUDED_STRING
-#endif // HAVE_STL_STRING_FWD_H
+# include "LString.h"
+# define __SGI_STL_STRING_FWD_H
+ static char const * __get_c_string(string const &);
+#endif // USE_INCLUDED_STRING
#endif // LYX_STL_STRING_FWD_H