gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > How to release a lib

#159699 - sverx - Fri Jul 04, 2008 4:19 pm

Hi there,
say you're writing a library to do something on the DS, say you'd like to give everybody in the homebrew the chance of using your library (for free, I mean). Say you anyway want your code not to be public (for whatever reason, maybe you just know your code is very bad ;) ).
What should you do then?
Sorry if it's a newbie question... well, maybe it's because I am -still- a newbie.

Thanks. Ciao :)

#159700 - Noda - Fri Jul 04, 2008 4:28 pm

Not release anything.

#159702 - dovoto - Fri Jul 04, 2008 4:36 pm

Well, let's ignore for the moment that code so bad you dont want it seen probably will not result in a good library.

To release a closed source lib you simply need to post the .a file and the header files someplace convenient. Because there will be no source code you need to invest a good deal of effort into documenting the api (not only what it does but what resources it utilizes to achieve the functionality).

I personally have no issue with releasing libs closed source but if it is graphics related it will probably not be well recieved as it is unlikely your lib will cover all the things a person needs to do on the DS. Without source it will be difficult to add that functionality in a non conflicting manner.

Libraries that might lend well to closed source:
-sound/music api
-libs that utilize no ds resources directly (other than memory) such as a physics lib or text or speach recognition lib.
-possibly a high level 3D api but it would have to be damned good and not interfere with the 2D engine more than necessary ;)
-wifi / networking libs
-A complete game engine which handles "everything"

Libraries that would be difficult to utilize without source
-Pretty much anything that attempts to touch the 2D graphics engine in a generic manner
-generic game scripting engines


Not sure if this is what you are asking about but perhaps a few more details on what your lib is supposed to do for us would enable us to answer your question better.
_________________
www.drunkencoders.com

#159704 - sverx - Fri Jul 04, 2008 5:27 pm

First of all: Thanks for detailed answer :)

dovoto wrote:
Well, let's ignore for the moment that code so bad you dont want it seen probably will not result in a good library.


:( ... well, it was just to keep the question short. I meant something like "I'm not really good with C so it seems like it's written by a Pascal programmer". But the part that already works isn't so bad, I hope I'll be able to release a tech demo of something using that lib soon. (Ah, yes, another thing I never did is to release a tech demo... mmm, I'll ask you guys another time...)

dovoto wrote:
To release a closed source lib you simply need to post the .a file and the header files someplace convenient. Because there will be no source code you need to invest a good deal of effort into documenting the api (not only what it does but what resources it utilizes to achieve the functionality).


I see. Is it the same if part of it should be run on ARM7 and part on ARM9? Should I release two .a then? (mmm... .o ? )

dovoto wrote:
I personally have no issue with releasing libs closed source but if it is graphics related it will probably not be well recieved as it is unlikely your lib will cover all the things a person needs to do on the DS. Without source it will be difficult to add that functionality in a non conflicting manner.

Libraries that might lend well to closed source:
-sound/music api
-libs that utilize no ds resources directly (other than memory) such as a physics lib or text or speach recognition lib.
-possibly a high level 3D api but it would have to be damned good and not interfere with the 2D engine more than necessary ;)
-wifi / networking libs
-A complete game engine which handles "everything"

Libraries that would be difficult to utilize without source
-Pretty much anything that attempts to touch the 2D graphics engine in a generic manner
-generic game scripting engines


I see... of course it should explain how it uses the ds resources and how it's possible to integrate it with the other 'standard' libs...

dovoto wrote:
Not sure if this is what you are asking about but perhaps a few more details on what your lib is supposed to do for us would enable us to answer your question better.


It was a good answer. Anyway the lib isn't ready to be released yet (still too much in a embrional state...), I was just thinking about what will I do with it and I decided to ask here since I always had a lot of useful/interesting hints. Just like today :)

Ciao! :)

#159705 - tepples - Fri Jul 04, 2008 6:08 pm

sverx wrote:
dovoto wrote:
To release a closed source lib you simply need to post the .a file and the header files someplace convenient.

Is it the same if part of it should be run on ARM7 and part on ARM9? Should I release two .a then? (mmm... .o ? )

Yes. For example, libnds comes as libnds7.a + libnds9.a. But even if you do release binaries of the library, it's still a good idea to release source code so that the library can be combined with an application distributed under a copyleft license such as the GNU GPL.

sverx wrote:
It was a good answer. Anyway the lib isn't ready to be released yet (still too much in a embrional state...)

Some tech demos might help drum up interest. Even if nothing else, the process of making the tech demos will help you find ways to clean up and document the library.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#159709 - dovoto - Fri Jul 04, 2008 9:13 pm

sverx wrote:
dovoto wrote:
To release a closed source lib you simply need to post the .a file and the header files someplace convenient.

Is it the same if part of it should be run on ARM7 and part on ARM9? Should I release two .a then? (mmm... .o ? )


Yes, two libraries would be required. Keep in mind handling comunications between arm7 and arm9 is a difficult task to do in a way which will not break libnds (especially given we are about to make a fundamental change to the way that happens). Without source provided for critique, acceptance of any dual processor library will be difficult to gain from most competent users.


tepples wrote:
But even if you do release binaries of the library, it's still a good idea to release source code so that the library can be combined with an application distributed under a copyleft license such as the GNU GPL.


I certainly would not put any effort into making your library compatible with a fundamentally broken license such as GPL. Release of source code is YOUR choice. There are a lot of really good reasons to open source your project, compatibility with GPL is not one of them.
_________________
www.drunkencoders.com

#159718 - nanou - Sat Jul 05, 2008 1:32 am

dovoto wrote:
I certainly would not put any effort into making your library compatible with a fundamentally broken license such as GPL. Release of source code is YOUR choice. There are a lot of really good reasons to open source your project, compatibility with GPL is not one of them.

*gasp* How can you say that?

Just kidding, I'm surprised to hear that attitude though. (I agree, btw.)
_________________
- nanou

#159719 - sgeos - Sat Jul 05, 2008 1:53 am

sverx wrote:
dovoto wrote:
Well, let's ignore for the moment that code so bad you dont want it seen probably will not result in a good library.
:( ... well, it was just to keep the question short.

You could just say "if for whatever reason". Even if you can only think of one or two reasons, there will be reasons that did not occur to you.

The GPL does not produce "free" software.
The license actually restricts market freedom.
If you really want something to be free, throw it into the public domain.

-Brendan

#159722 - silent_code - Sat Jul 05, 2008 2:37 am

... and state that you can not be held reliable for any harm / damage, direct or indirect, of any kind in any way and that usage and storage of your software and data is at the user's own risk...
Never forget, that strange things happen, sometimes they might even be beyond logic and sanity. ;^)
I remember some"cool" license that went by the name of "DWTFYW" or "DWTHYW" or something simmilar. It means "Do What the ... You Want." :^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#159723 - sgeos - Sat Jul 05, 2008 2:51 am

I like the "use at your own risk" license.
It basically states three things:
1) Do not use software you do not understand.
2) Use of this software may have harmful effects.
3) Use at your own risk; author will not be held liable for damage.

-Brendan

#159724 - silent_code - Sat Jul 05, 2008 3:01 am

4) Author tries to protect himself from stupid people that alter any amount of lines of source code and then damage some potentially valuable data, which results in some kind of monetary loss, thus trying to sue the original author, because his implementation did not fit some (any) application, yadda yadda... :^D
It's the "Just make sure you don't get your butt sued for arbitrary reasons" license, I guess. ;^D

@ sgeos: If that wasn't ironical, it's exactly like you wrote. :^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#159725 - sgeos - Sat Jul 05, 2008 3:59 am

To actually sue someone, you need to physically get ahold of the person. If you anonymously release something (into the public domain), I think chances are next to nil that you will be sued. Perhaps if you make something that is obviously illegal to the extent it requires an investigation, effort will be put forth to figure out who the author is, but even then, I think chances are slim that the dots will be connected. (And to the extent there is an investigation, the author is probably looking at being arrested, not sued.)

Of course, if you live in a corrupt country that does not cooperate with other countries, there is probably no reason to worry about any of this.

Another question, are you judgement proof? For example, if you were ordered to hand over 1.2 million dollars, is there any way you could possibly do that? If someone has no way to recover the costs of suing you, then they are wasting their time.

-Brendan

#159726 - DensitY - Sat Jul 05, 2008 4:32 am

On GPL:
GPLing your library is a sure way of stopping a-lot of people from using it.

Your free to pick your own license but if I was developing a library I would pick one that doesn't saw off all of the user's options.

#159727 - nanou - Sat Jul 05, 2008 7:25 am

DensitY wrote:
On GPL:
GPLing your library is a sure way of stopping a-lot of people from using it.

Your free to pick your own license but if I was developing a library I would pick one that doesn't saw off all of the user's options.

If the LGPL is used then only hardcore haters* are not going to use it. I personally don't like RMS's spirit, but he seems to regard the LGPL as a mistake anyway.

*: the exception being people who're trying to create a homogenously licensed distribution. That's cool, but that's really their own responsibility at that point.
_________________
- nanou

#159728 - Noda - Sat Jul 05, 2008 9:53 am

Don't forget one thing: the public domain thing, copyleft/right licenses & the needed clause for not being responsible for users' studidity are mostly US things.

The free licenses remains the 'no license' (=/= from public domain everywhere but in the US) and the MIT/ZLIB/BSD(v2) ones which only protects the author's rights and give him a responsability decline (again, applicable mostly in US, as for example in France even if you release a code without a license you still own the author's rights on it and can't be held responsible for anything except if it was volontarily designed to be harmful).

#159730 - tepples - Sat Jul 05, 2008 12:23 pm

silent_code wrote:
I remember some"cool" license that went by the name of "DWTFYW" or "DWTHYW" or something simmilar. It means "Do What the ... You Want." :^)

That's the WTFPL.

For a library that you want to be widely used, I'd recommend a simple permissive license such as WTFPL, MIT, zlib, or FreeBSD. I only mentioned the GPL because a lot of applications that people have ported to the DS, such as Doom and Quake, are under the GPL.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#159731 - silent_code - Sat Jul 05, 2008 12:27 pm

@ Noda: Damn right, it's mostly for the US.
@ tepples: That's the one. :^)

Well, if you decide to release your software with your name on it, I doubt it's going to be that hard to find you, especially when anyone can do a whois on your web site (which some of use have)... ;^)

Well, your program may do something that you might not be aware of (especially as a hobby programmer with moderate programming skills or when using other software through libraries etc.), which could be harmful in such a way, that a system might lock up in some very ULTRA rare case.

If that happens in a company and they lose any amount of time to get their network back up, which costs them money (just because of a super tiny bug you overlooked or didn't know of, because it's not in your own code, or the OS version the company uses isn't compatible in exactly that case... whatever!), then you should hope you've either made it clear that usage is "on the user's own risk" or that they don't have one of those crazy lawyers. ("You name it, I'll sue it!") ;^D

I mean, if people succeed in suing McD for scalding their mouth with hot coffee (because there was no "ATTENTION: HOT BEVERAGE" [or what ever it is in English] printed on the cup), you better watch your butt when releasing software. ;^)

I know that are extreme cases and most of the time (I guess, it's close to always) such things simply don't happen. Even though, that I'm still pretty secure (and feel so) in Germany, I personally like to be on the safe side, nevertheless.

Another example, that applies to what we do here in the forum, would be some NDS routines, that could potentially damage hardware (I read something about the SLOT2, that could damage something if used incorrectly!), if used in the wrong way. Now imagine (yet another rather extreme situation) that some kid downloads the sources you put on your site. Image (let's assume it's a boy) he messes around with it, tries to run that on his brand new lime NDSl and breaks it that way (warranty loss - 130 bucks down the drain.)
Now imagine his father is a crazy lawyer and you just happen so live in the same country... ;^D


FYI: Here in Germany, the government openly discusses a law that enables federal agents to spy on your computer via a trojan at any time (as well as physically via audio / video etc.), without the need of a court ruling. The thing is being called the "Federal Trojan"... 1984 anyone?

Random Sidenote:
Soon you won't be able to really take anything for granted (not even your damn rights for privacy!) anymore, so just make sure to work around as much potential trouble as possible.
This is even more true with the "Police State" (I don't know to what extend that is true) being created in the US. Scary stuff.
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#159743 - sgeos - Sat Jul 05, 2008 10:15 pm

silent_code wrote:
I mean, if people succeed in suing McD for scalding their mouth with hot coffee (because there was no "ATTENTION: HOT BEVERAGE" [or what ever it is in English] printed on the cup), you better watch your butt when releasing software. ;^)

Not true. McDonalds repeatedly failed inspections. They knew they kept their products too hot. The were aware of the problem. They served hot coffee to an elderly woman who received third degree burns when the coffee spilled. Third degree burns are pretty serious. The elderly woman wanted help with her medical bills. McDonalds could care less. A lawyer thought he could win the case, and he did. McDonalds does their best to make the verdicted appear to be joke. McDonalds succeeds. Later, McDonalds settles with the woman.
The Actual Facts About The Mcdonalds' Coffee Case

You are unlikely to be liable for millions of dollars in punitive damages, unless your conduct is "reckless, callous and willful", and you have a couple million dollars to spare.

Quote:
Now imagine his father is a crazy lawyer and you just happen so live in the same country... ;^D

If you can be classified as "poor", he will not waste his time. You are judgement proof. If you have a couple million in the bank, you might be shaking in your boots. I suspect you would actually just throw 50K or so at legal defense and then find a less expensive hobby. I'll admit that I'm not sure if things work the same way in other countries.

-Brendan

#159744 - silent_code - Sat Jul 05, 2008 10:21 pm

After reading that very informative post, I have to write: You are very damn right. :^) (And I should research a little better next time - but well, one reason dicussion forums are there, is to learn from each other, right? :^) )

Well, lesson learned. Thank you! :^D

PS: 3rd degree burns from coffee... man... that stuff had to be crazy hot, literally boiling in that cup! If it were a younger person, I guess the damage wouldn't have been that severe, but still very painful and probably even scarring. Poor woman.
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.


Last edited by silent_code on Sun Jul 06, 2008 3:25 pm; edited 1 time in total

#159745 - sgeos - Sun Jul 06, 2008 12:04 am

silent_code wrote:
After reading that very informative post, I have to write: You are very damn right. :^) (And I should research a little better next time - but well, one reason dicussion forums are there, is to learn from each other, right? :^) )

A while back, I was going to use the McDonalds case as an example of how silly the legal system in USA is. After routine verification, I changed my mind. =)

silent_code wrote:
If it were a younger person, I guess the damage wouldn't have been that severe, but still very painful and probably even scarring.

Because a 5 year old doesn't have as much skin to melt off? My opinion- McDonalds is not a safe place to take your kids.

A few interesting things from the WTFPL:
WTFPL wrote:
Isn?t this license basically public domain?

There is no such thing as ?putting a work in the public domain?, you America-centered, Commonwealth-biased individual. Public domain varies with the jurisdictions, and it is in some places debatable whether someone who has not been dead for the last seventy years is entitled to put his own work in the public domain.

I did not realize that. Americans are bad at recognizing that other parts of the world are not the USA.

WTFPL wrote:
Bradley Kuhn (executive director of the Free Software Foundation) was quoted saying that the FSF?s folks agree the WTFPL is a valid free software license.

Somehow it amuses me that they recognize a completely interoperable lightweight free license as valid.

WTFPL wrote:
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

Requiring a name change on modified versions does make a lot of sense.

I suppose the other way to avoid liability is to release something under a completely restricted (but unenforced) license. "You are not permitted to use this software / source code for any purpose."

-Brendan

#159769 - tepples - Sun Jul 06, 2008 3:19 pm

silent_code wrote:
PS: 3rd degree burns from coffee... man... that stuff had to crazy hot, literally boiling in that cup!

McDonald's coffee was 82?C (180?F), compared to ordinary coffee served at 60?C (140?F).

sgeos wrote:
I suppose the other way to avoid liability is to release something under a completely restricted (but unenforced) license. "You are not permitted to use this software / source code for any purpose."

Or anything like what Daniel J. Bernstein used to do?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#159775 - Dwedit - Sun Jul 06, 2008 4:08 pm

Lovely how the latest posts in the thread have nothing to do with releasing a lib. Mods fallen asleep?
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#159777 - silent_code - Sun Jul 06, 2008 4:14 pm

Since when does licensing not fall under "releasing something"? I think this might be very helpful (although a bt confusing in the beginning) for the author. I personally like to be informed about most of the possibilities I have, before I do something the first time.
It might not be strictly related to the OT, I agree with that, but it still *is* related to it. I mean the "big picture", with all the symbolic "consequences" and images etc. ;^)

Be happy! :^)

PS: tepples = moderator... ;^)


I guess we can summarize it:

HOW TO RELEASE A SOFTWARE LIBRARY:

For a binary release:
- all the externally needed header (signature) files
- either object files (.o) or library files (.s, .a etc.) for all target platforms
- a readme or any other (at least minimal) documentation, including (if you want to) terms of use (like "don't bug me about it" or "include me in the credits, if you'd like to" or "use at your own risk [and don't bug me]") and licensing (even if it's a [literally] "do what you want" license)

For a source release:
- all header (signature) and source (implementation) files
- some kind of documentation (s.a.)
- optionally some precompiled files (when not releasing them seperately anyways)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#159791 - sgeos - Sun Jul 06, 2008 8:43 pm

Dwedit wrote:
Lovely how the latest posts in the thread have nothing to do with releasing a lib. Mods fallen asleep?

Licensing has everything to do with releasing a library and nothing to do with preparing it. The OP's questions seem to have been resolved to the extent there have been no furthur questions. I do not think forking the thread would be correct or incorrect at this point.

tepples wrote:
Or anything like what Daniel J. Bernstein used to do?

What did he do? Wikipedia did not appear to contian anything relevant on Bernstein.

-Brendan

#159801 - keldon - Mon Jul 07, 2008 12:06 am

http://en.wikipedia.org/w/index.php?title=License-free_software&oldid=221617354 maybe?

#159815 - sgeos - Mon Jul 07, 2008 3:39 am

keldon wrote:
http://en.wikipedia.org/w/index.php?title=License-free_software&oldid=221617354 maybe?

Yes, I was thinking something along those lines. The goal behind the restrictive license is to be able to say "you are not allowed to follow the modification instructions, crash your bank, and lose a lot of money with my software". Admittedly, certain users may not be comfortable using a restricted license.

I guess that leads to a good point. Figure out who your target users are before you go through the trouble of making a library. Naturally, "me and anyone else who wants to use it," is valid.

-Brendan

#159830 - sverx - Mon Jul 07, 2008 10:10 am

Well, thanks for all the answers, even for the ones that scary me ;) It means that I'll take care of releasing a good library AND a good 'term of use'.

So I'll stick with:
silent_code wrote:
HOW TO RELEASE A SOFTWARE LIBRARY:
For a binary release:
- all the externally needed header (signature) files
- either object files (.o) or library files (.s, .a etc.) for all target platforms
- a readme or any other (at least minimal) documentation, including (if you want to) terms of use (like "don't bug me about it" or "include me in the credits, if you'd like to" or "use at your own risk [and don't bug me]") and licensing (even if it's a [literally] "do what you want" license)

but anyway it won't happen so soon.

Thanks again :)
Ciao!

#164079 - sverx - Mon Oct 20, 2008 12:12 pm

Back to this topic again, now I have some more questions :)

I want to release the lib (xm7lib, beta as it is now...) and let people use it so that they can give me an opinion about it (it rocks! is sucks! it lacks that feature... etc...) before it's too late [ ;) ] to change things.

Actually it'll be a binary release. I already started writing the documentation on how to use it and how it works, but I still don't know how to compile a '.a' file. All I've got are 3 files:

- xm7lib.h
- xm7lib_arm7.c
- xm7lib_arm9.c

so, what do I do now? Is it there a generic help somewhere?

Thanks :D

#164184 - sverx - Thu Oct 23, 2008 9:31 am

sverx wrote:
I still don't know how to compile a '.a' file.


No help on this topic? :| I've been searching the forum but I found no answer...

#164187 - eKid - Thu Oct 23, 2008 9:47 am

Use arm-eabi-ar with -rc option (during linking).
Line from my makefile:
Code:
@$(AR) -rc "$(TARGET)" $(OFILES)


I'm not really sure how I figured that out, but it works for me. :P

#164190 - sverx - Thu Oct 23, 2008 10:07 am

eKid wrote:
Use arm-eabi-ar with -rc option (during linking).
Line from my makefile:
Code:
@$(AR) -rc "$(TARGET)" $(OFILES)

I'm not really sure how I figured that out, but it works for me. :P


Thanks! But I really do not understand anything about Makefiles... I've tryed adding the line like that:

Code:
$(ARM7ELF)   :   $(OFILES)
      @echo linking $(notdir $@)
      @$(LD)  $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
      #  generate .a
      @$(AR) -rc "$(TARGET)" $(OFILES)


but when I make it says "missing separator. Stop." :| :| :|

#164192 - eKid - Thu Oct 23, 2008 10:14 am

Have a look at the arm9lib makefile (it makes arm9 libs), it just needs a few changes to make it into an arm7lib one.

#164197 - sverx - Thu Oct 23, 2008 11:19 am

eKid wrote:
Have a look at the arm9lib makefile (it makes arm9 libs), it just needs a few changes to make it into an arm7lib one.


Too hard. Anyway I see that .a files are a kind of "archive" for .o files (right?) so I finally think I'll simply make a .bat to do that:

Code:
arm-eabi-ar -rc myarchive.a myobyect.o


;) ;)

#164200 - sverx - Thu Oct 23, 2008 12:02 pm

Ok, quite done ;)

I've read all the posts regarding the 'licensing' and it scared me a little. Since I don't want to have trouble with that (hey, I'm releasing a code that somebody's going to use on his Nintendo DS, who's sure I'm able to code at all?) I think I'll simply write a readme.txt file with that inside

Quote:
License:
I don't know how to write a license but I've got to tell you what you CAN do and what you CAN'T do with that library:
- You CAN use it for your NDS homebrew games/apps, you just have to give credit to the library (e.g. state "This uses xm7lib" somewhere in your credits page)
- You CAN give it to everyone as long as it's free of charge (you can't sell it!)
This software is provided "as is". It may not be suitable for your needs, it
could even have mistakes in it, and it's not so unlikely.
*** YOU USE IT AT YOUR OWN RISK ***
I won't be liable for any kind of damage that could happen using it


Do you think it's adequate? Does it have something important missing?

Thanks once more, I hope that whole topic will be usefull for others when releasing their libs... :)

#164205 - mml - Thu Oct 23, 2008 12:38 pm

Don't roll your own license unless you know what you're doing.

For example your custom license there makes no mention of whether/how open source projects can use your library; that point about "not selling it" is completely vague (what if a commercial game uses your library, do they then have to give their entire game away for free, or do they merely have to chuck a copy of your .a and .h file somewhere on the disc?); etc.

If you're not a lawyer, stay well away from writing licenses; just use one of the many that's already out there. You think it's scary working out how to license your library? Imagine from the other point of view: you're a developer, you want to use a library, and it's license is just some sketchy ramble someone just made up and you've got no idea what position it puts you in should you use the thing. Would you want your entire project dependent on something you're never quite sure if you're actually allowed to use?

Just spend some time doing the research and pick one of the licenses everyone is already familiar with. That way everyone immediately knows where they stand and whether or not they can use your library.

Or heck, release the source into the public domain, and wipe your hands of the whole licensing fiasco.

#164209 - sverx - Thu Oct 23, 2008 1:20 pm

mml wrote:
(what if a commercial game uses your library, do they then have to give their entire game away for free, or do they merely have to chuck a copy of your .a and .h file somewhere on the disc?)


... can somebody actually sell homebrew for NDS?

mml wrote:
If you're not a lawyer, stay well away from writing licenses; just use one of the many that's already out there.


mmm... I guess you're right. So let's say: which licence do you suggest I could use? I think I need something similar to the other (closed-source) libraries for the DS (if there are) so that my licence isn't a limit for the homebrew development...

#164215 - 0xtob - Thu Oct 23, 2008 3:01 pm

I did some extensive research of existing licenses for releasing libntxm. I basically wanted the same as you: People should be able to use the library in both open and closed source projects as long as they are non-commercial.

GPL is cool and open source friendly, but incompatible with closed source.

LGPL is often called the "GPL for libraries", but it has a clause that says that the person who uses the library in their apps needs to make sure that the app can be linked with newer versions of the library. This works on the PC because you can create dynamic libraries (.so , .dll), but due to CPU limitations this does not work on the DS. So, LGPL isn't that great for DS projects either since it forces software authors to ship their .o files to enable people to re-link their apps against your library.

The zlib license allows closed source, but also use in commercial products, so meh here as well.

What I eventually decided on is a dual licensing scheme, meaning people can decide on which of the licenses provided they want to use. The two libraries I chose are the GPL for open source use and the "noncommercial zLib license" which is the zlib license altered to not allow commercial use.

For me this is a good solution, but it's up for every coder to decide how they want to restrict usage of their code or binaries.
_________________
http://blog.dev-scene.com/0xtob | http://nitrotracker.tobw.net | http://dsmi.tobw.net

#164216 - sverx - Thu Oct 23, 2008 3:45 pm

Thanks for your post, 0xtob... in fact some 30 minutes ago I was checking which license you choosed for your lib, and I found it was GPL.

But... yes, my lib it's closed source, at least at the moment.

You wrote

Quote:
The zlib license allows closed source, but also use in commercial products, so meh here as well.


and, to say the truth, I don't think that somebody could make a commercial product from my lib, especially since we're talking about homebrew... is there such a market at all? (Really, if there's one I would like to know!)

So if zLib (or say "noncommercial zLib license") could be ok, I'll stick with this one. And it seems to me that I can also write something like "Licensed under zlib, if you need a different licensing please contact me", right? :)

Thanks :)

#164233 - mml - Thu Oct 23, 2008 11:19 pm

sverx wrote:
And it seems to me that I can also write something like "Licensed under zlib, if you need a different licensing please contact me", right? :)


Yes; it's your copyright, you're entitled to license it however you want to whoever you want. This includes licensing it differently from one individual to another.

#164245 - sverx - Fri Oct 24, 2008 11:27 am

mml wrote:
it's your copyright, you're entitled to license it however you want to whoever you want. This includes licensing it differently from one individual to another.


Thanks for the confirmation!

#164324 - sverx - Tue Oct 28, 2008 6:30 pm

Ouch, I still have one problem with the library :|

I made that xm7lib7.a file, "inside" that there's the xm7lib7.o file... and it seems to me it's correct.

Now I'm trying to use the library in a new (test) project. I add the header file to my source code
Code:
#include "xm7lib.h"

and I add the (arm7 part of the) library to the library list in the makefile
Code:
LIBS := -lxm7lib7 -lnds7

but the linker says:
Quote:
ld.exe: cannot find -lxm7lib7

and that's strange because the xm7lib7.a it's in the same folder where the other libs are: libnds.a , libfat.a etc etc...

Then I noticed that in chishm's libfat page it says:
Quote:
Change this to:
Code:
LIBS := -lfat -lnds9


but the archive file name isn't fat.a, but it's libfat.a !!!

So, how can I add my library to my project? :| Did I forgot something or made something wrong making the library file?

Thanks!

#164327 - relpats_eht - Tue Oct 28, 2008 7:27 pm

A library linked by "-lNAME" will be named "libNAME.a". It is odd, I think, but that is just the way it is. Your problem is likely your library should be named "libxm7lib7.a" but is missing the "lib" prefix.
_________________
- relpats_eht

#164328 - sverx - Tue Oct 28, 2008 7:32 pm

relpats_eht wrote:
A library linked by "-lNAME" will be named "libNAME.a". It is odd, I think, but that is just the way it is. Your problem is likely your library should be named "libxm7lib7.a" but is missing the "lib" prefix.


Ouch! It seems to me you're right... but libxm7lib7.a it's completely stupid! Is there a different parameter? I mean, if I don't use -l<name>, what can I use?

Thanks :)

edit: anyway now the linker says: "undefined reference to 'MyFunction'"... what's wrong with that too???


Last edited by sverx on Tue Oct 28, 2008 7:37 pm; edited 1 time in total

#164329 - kusma - Tue Oct 28, 2008 7:34 pm

sverx wrote:
relpats_eht wrote:
A library linked by "-lNAME" will be named "libNAME.a". It is odd, I think, but that is just the way it is. Your problem is likely your library should be named "libxm7lib7.a" but is missing the "lib" prefix.


Ouch! It seems to me you're right... but libxm7lib7.a it's completely stupid! Is there a different parameter? I mean, if I don't use -l<name>, what can I use?

Thanks :)


Just list the whole filename...

#164330 - sverx - Tue Oct 28, 2008 7:43 pm

kusma wrote:
Just list the whole filename...


How? I tried
Code:
-lC:/devkitPro/libnds/lib/xm7lib7.a

but anyway the linker says
Code:
cannot find -lC:/devkitPro/libnds/lib/xm7lib7.a


edit: mmm... without the -l seems working. Still have that other problem...

#164352 - sverx - Wed Oct 29, 2008 2:38 pm

sverx wrote:
Still have that other problem...


I don't know what's wrong :| Now I can link the .a (at least it seems to me, the linker no longer warns me 'I cannot find that file!') but the linking goes bad :|

It says:
Code:
linking alarm.arm7.elf
main.o: In function `RtcHandler':
c:/[...]/alarm/arm7/source/main.c:88: undefined reference to `XM7_StartModule'


does the .o file that contains that function should be compiled with some particular option?

Help! Thanks :)

#164353 - elhobbs - Wed Oct 29, 2008 3:24 pm

the most obvious issue would be that the function does not exist (typo in name or something similiar). other possible issues might be that you are mixing c and c++ code, or that you were missing a declaration for the function so the compiler made some assumptions about the parameters and return type and they do not match the actual function. are there any compiler warnings?

#164355 - sverx - Wed Oct 29, 2008 3:57 pm

elhobbs wrote:
the most obvious issue would be that the function does not exist (typo in name or something similiar). other possible issues might be that you are mixing c and c++ code, or that you were missing a declaration for the function so the compiler made some assumptions about the parameters and return type and they do not match the actual function. are there any compiler warnings?


Well, I'm not mixing C and C++, that's the only thing I'm sure ;)
But you're right, I've got a compiler warning. It says:
Code:
c:/[...]/alarm/arm7/source/main.c:88: warning: implicit declaration of function 'XM7_StartModule'

Does it mean something to you?

#164357 - elhobbs - Wed Oct 29, 2008 4:35 pm

sverx wrote:
But you're right, I've got a compiler warning. It says:
Code:
c:/[...]/alarm/arm7/source/main.c:88: warning: implicit declaration of function 'XM7_StartModule'

Does it mean something to you?
yes, it means that the function is being called without a declaration. in other words the compiler does not know the return type or the parameters to the function when it reaches it while compiling. this can be fixed by putting a function declaration before the reference. usually in a header file or at the top of the source file referencing the function.
so for
Code:
int foo(int x) {
return x;
}
the declaration is
Code:
int foo(int x);
this just lets the compiler know about the parameters, return type, calling convention etc. I believe all of these things are taken into account when linking and can cause linking errors when the compiler makes incorrect assumptions.

#164358 - sverx - Wed Oct 29, 2008 4:38 pm

elhobbs wrote:
it means that the function is being called without a declaration.


I already have
Code:
void XM7_PlayModule (XM7_ModuleManager_Type* TheModule);

in the .h file that I include in the main.c :|


OMG! StartModule? PlayModule? Am I stupid???

edit: sorry for wasting your time :( :( :(

#164359 - elhobbs - Wed Oct 29, 2008 5:05 pm

sverx wrote:
elhobbs wrote:
it means that the function is being called without a declaration.


I already have
Code:
void XM7_PlayModule (XM7_ModuleManager_Type* TheModule);

in the .h file that I include in the main.c :|


OMG! StartModule? PlayModule? Am I stupid???

edit: sorry for wasting your time :( :( :(
so does it compile and link now?

#164361 - sverx - Wed Oct 29, 2008 5:11 pm

elhobbs wrote:
so does it compile and link now?


Yes, it does... that's why I'm sorry to made this forum waste time reading my stupid mistake...

... but it's one step closer to the release of the library, at least :)

#164373 - mml - Wed Oct 29, 2008 9:54 pm

Heh, when you get problems like this, a lot of times it helps to have a fresh set of eyes looking at your code, cause your own have seen it so much they stop actually reading what's there and just read what they expect to see.

I usually look at my own code in a different font and without syntax highlighting every now and then cause that can help too -- the code *looks* different, so when I read through it it's less from memory and more actual reading.

#164394 - sverx - Thu Oct 30, 2008 12:39 pm

mml wrote:
Heh, when you get problems like this, a lot of times it helps to have a fresh set of eyes looking at your code, cause your own have seen it so much they stop actually reading what's there and just read what they expect to see.


I guess it's exactly so. Thanks everybody once more :) Now I'm writing the documentation, I hope I'll release the library soon :)