------- Start of forwarded message -------
Message-Id: <199908111253.NAA16344@ io.stargate.co.uk>
To: [EMAIL PROTECTED] (Lars Gullik Bj nnes)
Subject: Re: 3026 public symbol exports in LyX global name space (wa: Re: 
 LaTeX file handling)
Date: Wed, 11 Aug 1999 13:53:57 +0100
From: Duncan Simpson <[EMAIL PROTECTED]>


Due to various systems not supporting symlinks (M$ systems are the most 
prominent example) could I suggest a header called something like 
"os_specifics.h" generated by configure by from os_specifics.h.in with 
appropiate substitutions. In particular one of the substitutions would be a
header that included the os specific stuff. os_specifics.h.in might say

#ifndef __OS_SPECIFICS_H__
#define __OS_SPECIFICS_H__  1

#include "@os_header@"

<...perhaps put some boilerplate declarations here...>
#endif /* __OS_SPECIFICS_H__ */

and a subsititution in Makefile.in that supplies the right object (so if you
are using os/2 it gets chanaged to os2_specifics.o, if you are using Linux you
get linux_specifics.o (or maybe unix_specifics.o) in the Makefile.

You could even follow checkps, which determines an OS then testsfor the 
existance of various files prefixed by the OS name. If these files fail to 
exist defaults could be used instead. Thus to add support for AIX /proc format 
to checkps all I need to do is put aix.c in the distribution and recompile. 
The code that does this is

<begin excerpt from configure.in>
dnl Check for my ability to read process detail information.
AC_CANONICAL_SYSTEM
cps_target=${target_os}
AC_MSG_CHECKING([${target_os} process detail reading code source file])
if test -s ${target_os}.c; then
   CPS_SYSTEM=system.o
   AC_DEFINE(CPS_OS_RD_STAT)
   AC_MSG_RESULT(${target_os}.c)
else
   CPS_SYSTEM=""
   AC_MSG_RESULT([none (/proc details not understood)])
fi
AC_SUBST(cps_target)
AC_SUBST(CPS_SYSTEM)
<end excerpt from configure.in>

and in Makefile.in there is a line stating that
EXTOBJS=@CPS_SYSTEM@ @LIBOBJS@ @getopt@ @pkill_lst@

and a rule for making system.o

system.o: @cps_target@.c
        $(CC) $(CFLAGS) -c -o $@ $< 

The observent will notice there are a few other items that might get included 
too. One of the test AC_DEFINEs a switch if it finds what it wants. This 
posting is too long already so I will stop it here.
-- 
Duncan (-:
"software industry, the: unique industry where selling substandard goods is
legal and you can charge extra for fixing the problems."


------- End of forwarded message -------

Reply via email to