Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

licensing( #24

Closed
merlokk opened this issue Aug 16, 2018 · 8 comments
Closed

licensing( #24

merlokk opened this issue Aug 16, 2018 · 8 comments
Assignees

Comments

@merlokk
Copy link

merlokk commented Aug 16, 2018

Hi

I tried to use argtable3 in proxmark3 project and noticed that getopt not compatible with GPL v2:

There is getopt with 4-clause BSD license (old BSD licence) which included 3rd clause.
3rd clause is not compatible with GPL licenses(

May you change this getopt to getopt from freebsd which have simplified BSD license?
here: https://github.com/freebsd/freebsd/blob/master/include/getopt.h

@surreylabs surreylabs self-assigned this Aug 16, 2018
@tomghuang tomghuang assigned tomghuang and unassigned surreylabs Aug 16, 2018
@tomghuang
Copy link
Contributor

Thanks for letting me know the differences between BSD license versions and the compatibility between them and GPLv2. I will check the getopt implementation from FreeBSD and see if it is possible to replace the current implementation.

@merlokk
Copy link
Author

merlokk commented Aug 16, 2018

thanks))))))

@tomghuang
Copy link
Contributor

@merlokk, I've re-organized the project, which now has the original source files, not the generated amalgamation distribution. You can try two ways to use your preferred getopt:

  • Add #define ARG_REPLACE_GETOPT 0, so that compiler will skip the embedded getopt and use the system getopt.
  • Replace the getopt files in the src directory, and make sure the build environment can use your own version to build the library.

@Kerl13
Copy link

Kerl13 commented Nov 29, 2020

On my system, #define ARG_REPLACE_GETOPT 0 breaks argtable since getopt_long.c calls a getopt_internal function which is not available (though getopt and getopt_long are).

@tomghuang
Copy link
Contributor

@Kerl13 , this mechanism is meant to use your own getopt implementation. If your own getopt has some issues, I'm afraid that you need to figure out how to resolve it. Maybe you can use getopt implementations from other system, instead of using the one in your system.

@Kerl13
Copy link

Kerl13 commented Nov 29, 2020

Thank you for your answer,

Sorry I think my comment was not very clear.
I meant that when I disable ARG_REPLACE_GETOPT, then argtable calls a getopt_internal function (in src/getopt_long.c) that is not defined anymore withing argtable so it expects this function to be defined in my system getopt.

This is what looks suspicious to me: I would assume my system getopt library to expose a getopt and a getopt_long function but not a getopt_internal function. Why is argtable calling this function and not getopt or getopt_long directly?

But I might be completely missing the point… If you tell me that when I disable ARG_REPLACE_GETOPT I am expected to provide a getopt_internal replacement function I'm okay with this answer :)

@Kerl13
Copy link

Kerl13 commented Nov 29, 2020

By the way I had argtable using my system getopt successfully by just removing the src/getopt.h and src/getopt_long.c files from the tools/build script so this is nice!

@tomghuang
Copy link
Contributor

tomghuang commented Nov 29, 2020

@Kerl13 I think you did find a problem in this ARG_REPLACE_GETOPT mechanism... I'm glad that you've found a solution, which is better than this ARG_REPLACE_GETOPT trick. I will check this issue and I may use your solution to replace the current one. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants