From: Reikan <Re...@ra...> - 2003-08-14 23:45:29
|
> Especially in the last couple of months, some features have been added > that are Linux specific. An example is the MIDI logger, that logs to > /dev/midi. More symbolical example is RealTime. When added RealTimeRTC.cc/hh, - they are added to Makefile.am. - not checked whether RTC is available in RealTimeRTC.cc/hh. - HAVE_RTC is defined staticaly in RealTime.cc. Thus, openMSX became to "only for Linux". Although there are RealTimeSDL.cc/hh just as code, implementation of RealTimeRTC.cc/hh, RealTime.cc killed RealTimeSDL.cc/hh as the "fallback". And, almost same for mmap. > If someone would like to port openMSX to another platform, that person > will have a hell of a job finding all the problems. That's why it would > be very useful if Linux specific code would be marked as such with > > #ifdef LINUX > > // linux specific code > > #else > > cout << "Feature not supported on this platform!" << endl; > > #endif This shows basics. For realistic, some features will be in some platform and not in others. So, #ifdef HAVE_MMAP #ifdef HAVE_SYS_MMAP_H #include <sys/mmap.h> #endif ... mmem = mmap(); ... #else workarounds or #error "not supported on this platform" #endif will be better. Yes, autoconf was made to help this. (check and define. using is coder's task.) Sometimes automake/libtool do overkill especially when not build libs. But autoconf helps at portability always, IMHO. In first of all, deciding policy maybe needed. Atleast 3 ways will be there. 1. "portability? What's that? Is it delicious?" Don't just say BAD. When need performance highly or depends on too specific feature, it's nature. 2. "make in specific on main stream. work at portability on another stream." Developer of main stream don't need to care portability too much. But needs POWER(vitality or number) on port maintainer. (OpenSSH is taking this way, you know.) 3. "make whole portable as possible." Developer of main stream must care about portability highly. Portmaintainer just care only highly platform specific part. (NetBSD is taking this way.) Even if choose "be portable", 2. and 3. are there. But in both of them, some(2:portmaitainer/3:maindeveloper) must care highly. Where does openMSX want to go? -- Reikan |