From: Borut R. <bor...@si...> - 2003-03-13 21:25:14
|
Hi fellows, here is may proposal for "different paths". Please comment it, propose changes, but don't start to yell on me before you read it entirely. It is only a proposal and can be changed or even dropped. Please have in mind also different platforms on which SDCC runs. As far as I know *nix and WIN32 are currently supported, other may come in the game in future. (It would be fine to have a list of "officially supported platforms"). After we will find an agreement, I'll start to work on implementation. The base for this proposal is Johan Knol's list. binaries: if getenv("SDCCHOME") getenv("SDCCHOME")/bin else if path(argv[0]) path(argv[0]) else $PATH else /usr/local/bin (for *nix) end_if includes: -I *standard system include directories at the end: if getenv("SDCC_INCLUDE") getenv("SDCC_INCLUDE") else if getenv("SDCCHOME") getenv("SDCCHOME")/include else if directory exist: path(argv[0])/../share/sdcc/include (for *nix) path(argv[0])/../include (for WIN32; also for *nix???) else /usr/local/share/sdcc/include (for *nix) end_if libs: -L *standard system library directories at the end: if getenv("SDCC_LIB") getenv("SDCC_LIB")/<model> else if getenv("SDCCHOME") getenv("SDCCHOME")/lib/<model> else if directory exist: path(argv[0])/../share/sdcc/lib/<model> (for *nix) path(argv[0])/../lib/<model> (for WIN32; also for *nix???) else /usr/local/share/sdcc/lib/<model> (for *nix) end_if docs: - path("sdcc.exe")/../doc (for WIN32 and *nix) - /usr/local/share/sdcc/doc (for *nix) *nix: all flavors of Unix, CygWin WIN23: native WIN32: MSVC, BORLANDC, MINGW Comments on differences with Johan Knol's proposal: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ binaries: - I don't see a reason to have SDCC_BIN_PATH, so I removed it. Johan (or anybody else), can you explain, why we should have it? - I think that SDCCHOME should be searched before path(argv[0]). Example: testing a development version of sdcc in combination with release version of other binaries: SDCCHOME points to the release directory, development version of sdcc is somewhere else. - on *nix the binaries can be searched in /usr/local/bin as the last resort, as this is the "standard location" for sdcc binaries. There is no such a standard location on WIN32 platforms: SDCC will be installed in x:\Program Files (at least I'm working on it:-). The problem is that the drive letter can differ and "Program Files" is localized to different languages. includes: - I renamed SDCC_INCLUDE_PATH to SDCC_INCLUDE (or maybe SDCCINCLUDE, to be compatible with SDCCHOME. Maybe SDCCHOME should become SDCC_HOME?) to be shorter. - I added path(argv[0])/../share/sdcc/include (for *nix) and path(argv[0])/../include (for WIN32) before the *nix standard location. I would propose to search path(argv[0])/../include also on *nix. Linux guys, before you start to yell on me, let me explain: On HP-UX (I don't know about others flavors of UNIX except Linux) the optional software is usually installed in /opt directory, so the situation would be: /opt/sdcc/bin - binaries /opt/sdcc/include - header files /opt/sdcc/lib/<model> - libraries which is the same situation as on Windows, if you replace /opt with x:\Program Files. Did I convince you? ;-) libs: - Similar situation as for includes, so I won't repeat it. My only comment is that <model> will not be added to -L paths automatically, but it will be appended in other cases. docs: - I changed the search sequence: the "standard place" is the last resort. Defines in sdccconf.h and sdcc_vc.h: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Values in brackets are for WIN32. PREFIX "/usr/local" ("") PREFIX is replaced with SDCCHOME in run time if env. var. SDCCHOME is defined. Other paths should be defined as diff to PREFIX (or SDCCHOME): BIN_DIR_DIFF "/bin" INCLUDE_DIR_DIFF "/share/sdcc/include" ("/include") LIB_DIR_DIFF "/share/sdcc/lib" ("/lib") In case that path(argv[0]) is taken as search path for include and lib, ".." will be prepended to INCLUDE_DIR_DIFF and LIB_DIR_DIFF, so the path will be: path(argv[0]) ".." INCLUDE_DIR_DIFF path(argv[0]) ".." LIB_DIR_DIFF Borut |
From: Bernhard H. <Ber...@be...> - 2003-03-14 08:16:11
|
SDCC has already a getenv("SDCC_DIR"), which is necessary e.g. to build the libraries or run the regression tests on the compile farm. If there's no other good reason, I suggest to keep SDCC_DIR and omit SDCCHOME. > binaries: > if getenv("SDCCHOME") > getenv("SDCCHOME")/bin > else if path(argv[0]) > path(argv[0]) > else > $PATH > else > /usr/local/bin (for *nix) Not needed. > end_if > > includes: > -I > *standard system include directories at the end: > if getenv("SDCC_INCLUDE") > getenv("SDCC_INCLUDE") > else if getenv("SDCCHOME") > getenv("SDCCHOME")/include > else if directory exist: > path(argv[0])/../share/sdcc/include (for *nix) > path(argv[0])/../include (for WIN32; also for *nix???) Not for *nix. > else > /usr/local/share/sdcc/include (for *nix) > end_if > > libs: > -L > *standard system library directories at the end: > if getenv("SDCC_LIB") > getenv("SDCC_LIB")/<model> > else if getenv("SDCCHOME") > getenv("SDCCHOME")/lib/<model> > else if directory exist: > path(argv[0])/../share/sdcc/lib/<model> (for *nix) > path(argv[0])/../lib/<model> (for WIN32; also for *nix???) Not for *nix. > else > /usr/local/share/sdcc/lib/<model> (for *nix) > end_if > > docs: > - path("sdcc.exe")/../doc (for WIN32 and *nix) > - /usr/local/share/sdcc/doc (for *nix) > > *nix: all flavors of Unix, CygWin > WIN23: native WIN32: MSVC, BORLANDC, MINGW > > > Comments on differences with Johan Knol's proposal: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > binaries: > - on *nix the binaries can be searched in /usr/local/bin as the last resort, > as this is the "standard location" for sdcc binaries. If I want /usr/local/bin to be searched for binaries, I'll include it in PATH. I agree with all the other proposals. Bernhard |
From: Borut R. <bor...@si...> - 2003-03-16 14:02:54
|
> SDCC has already a getenv("SDCC_DIR"), which is necessary e.g. to build the > libraries or run the regression tests on the compile farm. If there's no > other good reason, I suggest to keep SDCC_DIR and omit SDCCHOME. I checked the source code, and found out, that the env. variable name is actually "SDCCDIR" (see src/SDCCmain.c). Should we leave it or change it to "SDCC_DIR"? What about the env. variables for libs and includes? Should they be "SDCCLIB" and "SDCCINCLUDE" or "SDCC_LIB" and "SDCC_INCLUDE"? >> path(argv[0])/../include (for WIN32; also for *nix???) >> path(argv[0])/../lib/<model> (for WIN32; also for *nix???) >Not for *nix. I would like to hear your arguments. Johan, Jesus and others, where are you? I would like to hear something from you, before I start (or finish ;-) the implementation. Borut |
From: Johan K. <joh...@id...> - 2003-03-16 14:28:19
|
> Johan, Jesus and others, where are you? I would like to hear something from > you, before I start (or finish ;-) the implementation. /usr/local/bin should indeed be left out for nix SDCC_HOME makes more sense to me that SDCC_DIR or whatever I'd prefer the SDCC_ prefix in environmental variables Johan > > Borut > > > > ------------------------------------------------------- > This SF.net email is sponsored by:Crypto Challenge is now open! > Get cracking and register here for some mind boggling fun and > the chance of winning an Apple iPod: > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > _______________________________________________ > sdcc-devel mailing list > sdc...@li... > https://lists.sourceforge.net/lists/listinfo/sdcc-devel > > |
From: Bernhard H. <ber...@be...> - 2003-03-17 21:47:23
|
> /usr/local/bin should indeed be left out for nix I don't like too much automatic things, but ok, if you like it ... > SDCC_HOME makes more sense to me that SDCC_DIR or whatever Accepted. > I'd prefer the SDCC_ prefix in environmental variables This becomes a larger cleanup. I've to copy the changes to sdcc-build (for the nightly build). Borut, we should schedule our commits, so that the nightly build doesn't generate too much noise. Bernhard |
From: Borut R. <bor...@si...> - 2003-03-18 20:17:12
|
>> /usr/local/bin should indeed be left out for nix > I don't like too much automatic things, but ok, if you like it ... Now I'm really confused: I understood "be left out for nix" to remove it, but you (Bernhard) probably understood to keep it. Johan, can you clarify, what you meant? I hope that this will not take too much of your time, dedicated to "money making" projects :-) Here is the latest version: binaries: if getenv("SDCC_HOME") getenv("SDCC_HOME")/bin else if path(argv[0]) path(argv[0]) else $PATH //???? else //???? /usr/local/bin (for *nix) end_if includes: -I *standard system include directories at the end: if getenv("SDCC_INCLUDE") getenv("SDCC_INCLUDE") else if getenv("SDCC_HOME") getenv("SDCC_HOME")/share/sdcc/include (for *nix) getenv("SDCC_HOME")\include (for WIN32) else if directory exist: path(argv[0])/../share/sdcc/include (for *nix) path(argv[0])\..\include (for WIN32) else /usr/local/share/sdcc/include (for *nix) end_if libs: -L *standard system system library directories at the end: if getenv("SDCC_LIB") getenv("SDCC_LIB")/<model> else if getenv("SDCC_HOME") getenv("SDCC_HOME")/share/sdcc/lib/<model> (for *nix) getenv("SDCC_HOME")\lib\<model> (for WIN32) else if directory exist: path(argv[0])/../share/sdcc/lib/<model> (for *nix) path(argv[0])\..\lib\<model> (for WIN32) else /usr/local/share/sdcc/lib/<model> (for *nix) end_if docs: - path("sdcc.exe")/../doc (for WIN32 and *nix) - /usr/local/share/sdcc/doc (for *nix) *nix: all flavors of Unix, CygWin WIN23: native WIN32: MSVC, BORLANDC, MINGW > Borut, we should schedule our commits, so that the nightly > build doesn't generate too much noise. The functionality is already implemented, now I plan to test it carefully on different platforms/compilers: Win2000, Win98 (MSVC, BORLANDC, CygWin) and Linux. I would like to establish the MINGW compiling on environment WIN32 (CygWin using -mno-cygwin) and MINGW compiling on Linux. Bernhard, can you advise me, how to build the gcc MINGW cross compiler for Linux (or where to get the precompiled version), where to get MINGW and WIN32 libraries and everything I need for cross compilation? As you probably already noticed, I'm a "Sunday SDCC developer". I plan to spend the next (and probably the one after next) Sunday afternoon for testing. I have also to update the configuration files... I will send a message to the sdcc-devel list some time before I'll commit changes, so that Bernhard can synchronize the nightly build. Borut |
From: Johan K. <joh...@id...> - 2003-03-19 07:33:11
|
> >> /usr/local/bin should indeed be left out for nix > > I don't like too much automatic things, but ok, if you like it ... > > Now I'm really confused: I understood "be left out for nix" to remove it, > but you (Bernhard) probably understood to keep it. Right, leave out means don't. Bernhard was right when he said that you can put it in your PATH. Johan > > Johan, can you clarify, what you meant? I hope that this will not take too > much of your time, dedicated to "money making" projects :-) > > Here is the latest version: > > binaries: > if getenv("SDCC_HOME") > getenv("SDCC_HOME")/bin > else if path(argv[0]) > path(argv[0]) > else > $PATH > //???? else > //???? /usr/local/bin (for *nix) > end_if > > includes: > -I > *standard system include directories at the end: > if getenv("SDCC_INCLUDE") > getenv("SDCC_INCLUDE") > else if getenv("SDCC_HOME") > getenv("SDCC_HOME")/share/sdcc/include (for *nix) > getenv("SDCC_HOME")\include (for WIN32) > else if directory exist: > path(argv[0])/../share/sdcc/include (for *nix) > path(argv[0])\..\include (for WIN32) > else > /usr/local/share/sdcc/include (for *nix) > end_if > > libs: > -L > *standard system system library directories at the end: > if getenv("SDCC_LIB") > getenv("SDCC_LIB")/<model> > else if getenv("SDCC_HOME") > getenv("SDCC_HOME")/share/sdcc/lib/<model> (for *nix) > getenv("SDCC_HOME")\lib\<model> (for WIN32) > else if directory exist: > path(argv[0])/../share/sdcc/lib/<model> (for *nix) > path(argv[0])\..\lib\<model> (for WIN32) > else > /usr/local/share/sdcc/lib/<model> (for *nix) > end_if > > docs: > - path("sdcc.exe")/../doc (for WIN32 and *nix) > - /usr/local/share/sdcc/doc (for *nix) > > *nix: all flavors of Unix, CygWin > WIN23: native WIN32: MSVC, BORLANDC, MINGW > > > Borut, we should schedule our commits, so that the nightly > > build doesn't generate too much noise. > > The functionality is already implemented, now I plan to test it carefully > on different platforms/compilers: Win2000, Win98 (MSVC, BORLANDC, CygWin) > and > Linux. I would like to establish the MINGW compiling on environment WIN32 > (CygWin using -mno-cygwin) and MINGW compiling on Linux. > > Bernhard, can you advise me, how to build the gcc MINGW cross compiler for > Linux (or where to get the precompiled version), where to get MINGW and > WIN32 > libraries and everything I need for cross compilation? > > As you probably already noticed, I'm a "Sunday SDCC developer". I plan to > spend the next (and probably the one after next) Sunday afternoon for > testing. > I have also to update the configuration files... > I will send a message to the sdcc-devel list some time before I'll commit > changes, > so that Bernhard can synchronize the nightly build. > > Borut > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Does your code think in ink? > You could win a Tablet PC. Get a free Tablet PC hat just for playing. > What are you waiting for? > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en > _______________________________________________ > sdcc-devel mailing list > sdc...@li... > https://lists.sourceforge.net/lists/listinfo/sdcc-devel > > |
From: Bernhard H. <Ber...@be...> - 2003-03-19 08:04:42
|
> >> /usr/local/bin should indeed be left out for nix > > I don't like too much automatic things, but ok, if you like it ... > > Now I'm really confused: I understood "be left out for nix" to remove it, > but you (Bernhard) probably understood to keep it. Sorry for the confusion, I understood it wrong :-( > Bernhard, can you advise me, how to build the gcc MINGW cross compiler for > Linux (or where to get the precompiled version), where to get MINGW and > WIN32 > libraries and everything I need for cross compilation? http://sourceforge.net/project/showfiles.php?group_id=2435 You need binutils, gcc (the snapshots are built with 3.2), mingw-runtime and w32api (I'm not 100% sure if you really need w32api, but I've installed it on the CF). Although I built the binaries on the CF I wouldn't compile it for my machine at home. The build on the CF was necessary, because the package is installed in $HOME/local/cross-tools instead of /usr/local/cross-tools. There's a handy script sdcc/support/sdcc_mingw32 to cross compile on linux. I didn't yet adapt it to the new configure scripts, but I'll fix it soon. Bernhard |
From: Borut R. <bor...@si...> - 2003-03-24 06:16:19
|
Hi everybody, this is actually a call for help for Bernhard: The configure.in and sdccconf_in.h should be changed, so that generted sdccconf.h will look like this: ------------------------------------------------- /* sdccconf.h. Generated by configure. */ #ifndef SDCCCONF_HEADER #define SDCCCONF_HEADER #define SDCC_VERSION_HI 2 #define SDCC_VERSION_LO 3 #define SDCC_VERSION_P 4 #define SDCC_VERSION_STR "2.3.4" #define PREFIX "/usr/local" //#define DATADIR "/usr/local/share/sdcc" //#define SRCDIR "/cygdrive/d/cvs/sdcc/sdcc_mingw" //#define STANDARD_INCLUDE_DIR "/usr/local/share/sdcc/include" //#define SDCC_INCLUDE_DIR "/usr/local/share/sdcc/include" //#define SDCC_LIB_DIR "/usr/local/share/sdcc/lib" #define BIN_DIR_SUFFIX "/bin" #define INCLUDE_DIR_SUFFIX "/share/sdcc/include" #define LIB_DIR_SUFFIX "/share/sdcc/lib" /* environment variables */ #define SDCC_DIR_NAME "SDCC_HOME" #define SDCC_INCLUDE_NAME "SDCC_INCLUDE" #define SDCC_LIB_NAME "SDCC_LIB" #define STD_LIB "libsdcc" #define STD_INT_LIB "libint" #define STD_LONG_LIB "liblong" #define STD_FP_LIB "libfloat" #define STD_DS390_LIB "libds390" /* #undef STD_XA51_LIB */ #define HAVE_SYS_SOCKET_H 1 #define HAVE_STRERROR 1 #define HAVE_VSNPRINTF 1 #define HAVE_SNPRINTF 1 #define HAVE_VSPRINTF 1 #define HAVE_MKSTEMP 1 #define TYPE_BYTE char #define TYPE_WORD short #define TYPE_DWORD int #define TYPE_UBYTE unsigned TYPE_BYTE #define TYPE_UWORD unsigned TYPE_WORD #define TYPE_UDWORD unsigned TYPE_DWORD /* #undef WORDS_BIGENDIAN */ #define OPT_DISABLE_MCS51 0 #define OPT_DISABLE_GBZ80 0 #define OPT_DISABLE_Z80 0 #define OPT_DISABLE_AVR 0 #define OPT_DISABLE_DS390 0 #define OPT_DISABLE_TININative 0 #define OPT_DISABLE_PIC 0 #define OPT_DISABLE_XA51 0 #define OPT_ENABLE_LIBGC 0 #endif /* End of config.h */ ------------------------------------------------- Commented defines for: //#define DATADIR "/usr/local/share/sdcc" //#define SRCDIR "/cygdrive/d/cvs/sdcc/sdcc_mingw" //#define STANDARD_INCLUDE_DIR "/usr/local/share/sdcc/include" //#define SDCC_INCLUDE_DIR "/usr/local/share/sdcc/include" //#define SDCC_LIB_DIR "/usr/local/share/sdcc/lib" won't be needed any more, so they can be removed. I'm not an autoconf expert, so I'm asking Bernhard to modify configure.in and sdccconf_in.h accordingly. Bernhard, will you do that? If you will do it, please send the modified files (or patches) to me. I'll commit them into CVS together with other stuff. Borut |
From: Bernhard H. <Ber...@be...> - 2003-03-24 08:01:43
|
> I'm not an autoconf expert, so I'm asking Bernhard to modify > configure.in and sdccconf_in.h accordingly. > Bernhard, will you do that? Yes, but please give me some time. I'm again very busy this week. If anybody else wants to jump in, please let us know. Bernhard |
From: Borut R. <bor...@si...> - 2003-03-24 20:08:02
|
> Yes, but please give me some time. I'm again very busy this week. No problem, Bernhard. I'm short of time too, so it can wait ;-) And one other thing, Bernhard: The only env. variable the SDCC nightly build depends on in SDCCDIR. Is this correct? If yes, then I can implement both: - first SDCC_HOME is tested - if not defined, SDCCDIR is tested - ... This can be done just for certain time, to keep backward compatibility. Later on, SDCCDIR can be removed. This also means that the "nightly build won't generate too much noise" after committing the new functionality, and you can adopt it after that without a hurry. Do you agree? Borut |
From: Bernhard H. <ber...@be...> - 2003-03-24 20:59:06
|
> If yes, then I can implement both: > - first SDCC_HOME is tested > - if not defined, SDCCDIR is tested > > Do you agree? No ;-) Thanks for the offer, but it's not a big thing to switch from SDCC_HOME to SDCCDIR (SDCC_DIR?). Bernhard |
From: Bernhard H. <ber...@be...> - 2003-03-30 21:59:44
|
> Yes, but please give me some time. I'm again very busy this week. I'm sorry Borut, that I didn't yet send you anything. I'm neither sleeping nor on holiday ;-) But the configure thing turned out to be not too easy. I already digged into the autoconf manual, made a bigger cleanup of configure.in and related files. I had to learn, that "datadir" (besides "prefix") is an important standard in the *nix world when using configure, and I don't want to break it (making e.g. packagers' life easier). The header proposed by Borut doesn't fit all needs, and I even started to edit sdccman.lyx to propose a little bit extended version of the path story. Another thing I've to deal with all the time is "make install", which has to use the configure output too. I'm sure I can finish sdccman tomorrow, and if nobody disagrees my 'configure' can be ready in the next few days. But now I've to finish, Bernhard |
From: Borut R. <bor...@si...> - 2003-03-31 16:02:39
|
> I'm sorry Borut, that I didn't yet send you anything. I'm neither sleeping nor > on holiday ;-) No problem. As you can see, I already committed a lot of changes as the preparation for the final one. > The header proposed by Borut doesn't fit all needs, and I even started to edit > sdccman.lyx to propose a little bit extended version of the path story. So please let me know the new proposal ASAP, so I can prepare the code. > I'm sure I can finish sdccman tomorrow, and if nobody disagrees my 'configure' > can be ready in the next few days. I'll wait for it. Borut |
From: Bernhard H. <ber...@be...> - 2003-03-31 20:54:02
|
> > The header proposed by Borut doesn't fit all needs, and I even started to > > edit > > sdccman.lyx to propose a little bit extended version of the path story. > > So please let me know the new proposal ASAP, so I can prepare the code. Here it is: http://sdcc.sourceforge.net/doc/sdccman.pdf Comments invited! HTML has again a strange problem. Bernhard |
From: Borut R. <bor...@si...> - 2003-04-01 17:43:18
|
> Here it is: > http://sdcc.sourceforge.net/doc/sdccman.pdf > > Comments invited! In section 2.1 Install paths: in table 1. Binary files, the Win32 default value for $PREFIX/$BIN_DIR_SUFFIX should be "\sdcc\bin" In section 2.2 Search paths: in table 2. and 3. there is written arv[0] instead argv[0] in table 3. Library files, the Win32 default value for $DATADIR/$LIB_DIR_SUFFIX should be "(not on Win32)" the paragraph: "So, for windoze it is highly recommended to set the environment variable SDCC_HOME to prevent needless usage of -I and -L options. For *nix-builds SDCC_HOME should only be set when sdcc is installed in non-standard paths." should be removed on my opinion. path(argv[0]\..\include) and path(argv[0]\..\lib\<model>) works perfectly if SDCC is installed in standard way. SDCC_HOME should be defined only if libraries and includes reside somewhere else. Borut |
From: Bernhard H. <ber...@be...> - 2003-04-01 20:00:00
|
> > Comments invited! > ... 100% accepted, HTML fixed. Thanks for carefully reading the doc, Bernhard |
From: Bernhard H. <ber...@be...> - 2003-04-02 20:17:08
|
> > 'configure' can be ready in the next few days. > I'll wait for it. Ufff. I've commited the first part of the `configure` thing. There's still some work left: - the new items are not yet configurable - the Makefiles have to be adapted - obsolete paths have to be removed I hope I broke nothing ... although I'm a really sceptical :-{> Bernhard |
From: Borut R. <bor...@si...> - 2003-04-03 19:10:26
|
> Ufff. > I've commited the first part of the `configure` thing. > There's still some work left: > - the new items are not yet configurable > - the Makefiles have to be adapted > - obsolete paths have to be removed > >I hope I broke nothing ... although I'm a really sceptical :-{> Congratulations, Bernhard! Meanwhile I found an other mistake in sdccman.lyx: Sectin 2.2 Search paths: table 2. Include files: in 2nd row: the INCLUDE environment variable should be $SDCC_INCLUDE instead $SDCC_INCLUDE_PATH table 3. Library files in 2nd row: the LIB environment variable should be $SDCC_LIB instead $SDCC_LIB_PATH And here is an other proposition: it would be better if defines for suffixes would also include the dir separator: #define BIN_DIR_SUFFIX "\\bin" #define SEARCH_SUFFIX "" #define INCLUDE_DIR_SUFFIX "\\include" #define LIB_DIR_SUFFIX "\\lib" in sdcc_vc_in.h and #define BIN_DIR_SUFFIX "/bin" #define SEARCH_SUFFIX "/share/sdcc" #define INCLUDE_DIR_SUFFIX "/include" #define LIB_DIR_SUFFIX "/lib" ore even better if feasible with autoconf: #ifdef _WIN32 /* for MINGW build */ #define BIN_DIR_SUFFIX "\\bin" #define SEARCH_SUFFIX "" #define INCLUDE_DIR_SUFFIX "\\include" #define LIB_DIR_SUFFIX "\\lib" #else /* for *nix build */ #define BIN_DIR_SUFFIX "/bin" #define SEARCH_SUFFIX "/share/sdcc" #define INCLUDE_DIR_SUFFIX "/include" #define LIB_DIR_SUFFIX "/lib" #endif in sdccconf.h after ./conigure the reason is that in current implementation (without dir separators), the include path has to be combined like this: ... if ((p = getenv(SDCC_DIR_NAME)) != NULL) { SNPRINTF(buf, sizeof buf, "%s" DIR_SEPARATOR_STRING SEARCH_SUFFIX DIR_SEPARATOR_STRING INCLUDE_DIR_SUFFIX, p); p = buf; } ... so if the value of SDCC_HOME is c:\sdcc, the result is: c:\sdcc\\include. The problem is the double backspace before include, as a result of empty SEARCH_SUFFIX. On *nix this is not a problem, because the SERCH_SUFFIX is not empty. With my proposal, where suffixes include the dir separator, the code would look like: ... if ((p = getenv(SDCC_DIR_NAME)) != NULL) { SNPRINTF(buf, sizeof buf, "%s" SEARCH_SUFFIX INCLUDE_DIR_SUFFIX, p); p = buf; } ... so the result would be c:\sdcc\include. But anyway, double directory separators seem to work on *nix and Win32, so if including the dir separator would take too much effort, it can remain as it is. Borut |
From: Bernhard H. <Ber...@be...> - 2003-04-04 13:25:49
|
> Sectin 2.2 Search paths: > table 2. Include files: > in 2nd row: the INCLUDE environment variable should be $SDCC_INCLUDE > instead $SDCC_INCLUDE_PATH > table 3. Library files > in 2nd row: the LIB environment variable should be $SDCC_LIB instead > $SDCC_LIB_PATH Will be fixed soon ... > it would be better if defines for suffixes would also include the dir > separator: At first I didn't like it, because it looks like an absolute path with a leading separator. But the main problem will be the checks, if the user passed all the paths/suffixes with/without leading/trailing separators. Of course it would be nice to make this with 'configure', but I've to check if this is feasible and how expensive it will be. > the reason is that in current implementation (without dir separators), the > include path has to be combined like this: > ... > if ((p = getenv(SDCC_DIR_NAME)) != NULL) { > SNPRINTF(buf, sizeof buf, "%s" DIR_SEPARATOR_STRING SEARCH_SUFFIX > DIR_SEPARATOR_STRING INCLUDE_DIR_SUFFIX, p); > p = buf; > } > ... > so if the value of SDCC_HOME is c:\sdcc, the result is: c:\sdcc\\include. > The problem is the double backspace Good point. But if you want to avoid double separators in any case, you'll have to check SDCC_DIR_NAME, it could also be e.g. "c:\sdcc\". One possible solution could be a universal function (with variable argument list), which concatens it's arguments with exactly one separator. > #ifdef _WIN32 > /* for MINGW build */ > #define BIN_DIR_SUFFIX "\\bin" > #define SEARCH_SUFFIX "" > #define INCLUDE_DIR_SUFFIX "\\include" > #define LIB_DIR_SUFFIX "\\lib" > #else > /* for *nix build */ > #define BIN_DIR_SUFFIX "/bin" > #define SEARCH_SUFFIX "/share/sdcc" > #define INCLUDE_DIR_SUFFIX "/include" > #define LIB_DIR_SUFFIX "/lib" > #endif You did not yet crosscompile, did you? If 'configure' detects the mingw crosscompiler, then of course sdccconf.h contains the defaults as given in sdccman: #define PREFIX "/sdcc" #define DATADIR "/sdcc" ... #define BIN_DIR_SUFFIX "/bin" #define SEARCH_SUFFIX "" #define INCLUDE_DIR_SUFFIX "/include" #define LIB_DIR_SUFFIX "/lib" I'm afraid I've a further extension of the search paths: the "GNU programming standards" demand a full reloctability of a binary package. The recommended solution is not to use absolute paths, but to evaluate macros ("{prefix}", "{datadir}") during runtime. Indeed the default output of 'configure' are strings with macros, and I violate these programming standard by expanding them for sdccconf.h (these have been the topics I was fighting with during the last days). I think we don't really need these macros during runtime. I prefer another solution: use a relative path from the binary dir to the datadir. For this I've to fill in the two fields, which are marked with "not on *nix". There will be another string emitted by 'configure', which contains the path difference between "prefix" and "datadir". This is the only clean solution, even for windows. I'll update the doc later, but I've to finish for now, Bernhard |
From: Borut R. <bor...@si...> - 2003-04-04 20:10:10
|
> But if you want to avoid double separators in any case, you'll have to check > SDCC_DIR_NAME, it could also be e.g. "c:\sdcc\". One possible solution could > be a > universal function (with variable argument list), which concatens it's > arguments with exactly one separator. The lib and include path is formed from two parts: the first part comes from SDCC_HOME env. variable. It can be easily checked if it contains the trailing dir separator and remove it if required. The second part is defined in compile time, and it doesn't need to be checked or changed, if it's parts are properly defined in sdccconf.h. In the run time only this two parts have to be concatenated, so I don't see the need for the "universal function". But this is true with assumption that the definition of suffixes include the dir separator. > You did not yet crosscompile, did you? > If 'configure' detects the mingw crosscompiler, then of course sdccconf.h > contains the defaults as given in sdccman: You are right, I didn't. I took a look in configure.in and saw, that this is handled there. My only comment is to use backslashes as dir separators for MINGW (currentyl only prefix="/sdcc", but prefix is not used on WIN32 anyway). > I'm afraid I've a further extension of the search paths: the "GNU > programming standards" demand a full reloctability of a binary package. The > recommended solution is not to use absolute paths, but to evaluate macros > ("{prefix}", "{datadir}") during runtime. Indeed the default output of > 'configure' are strings with macros, and I violate these programming > standard by expanding them for sdccconf.h (these have been the topics I was > fighting with during the last days). > > I think we don't really need these macros during runtime. I prefer another > solution: use a relative path from the binary dir to the datadir. For this > I've to fill in the two fields, which are marked with "not on *nix". There > will be another string emitted by 'configure', which contains the path > difference between "prefix" and "datadir". This is the only clean solution, > even for windows. On WIN32 this is not a problem: we are not dealing with absolute paths at all and the package is fully relocatible. On *nix this is a problem, because we don't have path(argv[0]) relative rule (which I already proposed, but you didn't agree with it ;-). Yes, I agree with your proposal to "use a relative path from the binary dir to the datadir". But we already have such sting: it is SEARCH_SUFFIX. So the rule for include is: path(argv[0])/../SEARCH_SUFFIX/INCLUDE_DIR_SUFFIX and for lib: path(argv[0])/../SEARCH_SUFFIX/LIB_DIR_SUFFIX Am I right? So I think we already have everything we need. The only question that remains is if path delimiters can be added in front of BIN_DIR_SUFFIX, SEARCH_SUFFIX, INCLUDE_DIR_SUFFIX and LIB_DIR_SUFFIX. Borut |
From: Bernhard H. <ber...@be...> - 2003-04-06 20:08:46
|
My quick status: Good news: - backslashes and leading separators are working - most of the work is done; it could be commited after some testing - sdccman is updated Bad news: - I've again changed some parts; it's now even more compatible with the coding standard. I start to like it ;-) - I'm out of time for today. See you tomorrow ;-) Bernhard |
From: Borut R. <bor...@si...> - 2003-04-12 14:04:59
|
> I will send a message to the sdcc-devel list some time before I'll commit > changes, so that Bernhard can synchronize the nightly build. Hi Bernhad, THE day finally arrived. I plan to commit changes today evening after 18.00 CET. Please let me know if you will be able to update the nightly build by then. BR, Borut |
From: Bernhard H. <ber...@be...> - 2003-04-12 15:37:46
|
> THE day finally arrived. I plan to commit changes today evening after 18.00 > CET. > Please let me know if you will be able to update the nightly build by then. Please go on! Bernhard |
From: Borut R. <bor...@si...> - 2003-04-12 16:11:01
|
> Please go on! Done. Borut |