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

Add Linux makefile/config.h, HAVE_LONG_LONG_INT defined but not used #335

Closed
chad-earthscope opened this issue Nov 17, 2024 · 5 comments
Closed
Assignees
Labels
investigating Investigating the issue

Comments

@chad-earthscope
Copy link

In my use case I need very few configuration options, only --disable-shared --enable-threads. The resulting config.h only contains:

#  define MXML_VERSION "Mini-XML v4.0.3"
#  define HAVE_LONG_LONG_INT 1
#  define HAVE_PTHREAD_H 1

The HAVE_LONG_LONG_INT is not used in the code.

It would be useful to be able to set configuration options via compiler command line defines, in my case just for threading support, and to avoid needing autoconf/configure completely for what I suspect are many use cases.

autoconf is kinda slow, but more importantly can be finicky on end users systems, especially after going through systems like git that change file modification times. This seems very close to being unnecessary (for my case and I suspect others).

Also, thank you very much for this library. I have been relying on Mini-XML for ~14 years!

@michaelrsweet
Copy link
Owner

You can always provide your own config.h and makefile (or other project file), much as is already present in the vcnet and xcode directories.

I'll investigate the HAVE_LONG_LONG_INT issue.

@michaelrsweet michaelrsweet self-assigned this Nov 17, 2024
@michaelrsweet michaelrsweet added the investigating Investigating the issue label Nov 17, 2024
@michaelrsweet michaelrsweet changed the title feature request: build configuration without autoconf and config.h HAVE_LONG_LONG_INT defined but not used Nov 17, 2024
@michaelrsweet
Copy link
Owner

[master 2741eca] Drop long long config tests (Issue #335)

@michaelrsweet
Copy link
Owner

OK, so short of adding a "linux" subdirectory with a makefile and config script, I don't see dumping autoconf. The config.h file is short for Mini-XML, but the configure script also determines how (and whether) to make shared/static libraries, where to install things, etc.

@chad-earthscope
Copy link
Author

Thanks @michaelrsweet. My feature request was not to dump autoconf, but to provide an alternative that does not require creating your own config.h or Makefile (which is exactly what I'm doing now), which would make Mini-XML even easier to use and integrate into projects.

For example, an approach where:

  1. a Makefile is provided in the distribution that will build with the default options, and will be replaced if configure is run.
    and
  2. config.h is optional (or the inclusion can be disabled)
    and
  3. the options were all settable as defines (which I think is true now),
    would allow integration that is as simple as untarring the release and running make with CFLAGS set as you wish. This also leaves the capability for folks to run configure can tweak options for more advanced configuration.

In my case I want to set something like CFLAGS += -DMXML_PTHREADS and run make and get a static library. Of course, I can make the extra config.h and/or Makefiles, but that adds overhead and more care is needed when updating to newer versions. Merely a suggestion to lower the, admittedly already low, bar for use.

michaelrsweet added a commit that referenced this issue Nov 18, 2024
@michaelrsweet michaelrsweet changed the title HAVE_LONG_LONG_INT defined but not used Add Linux makefile/config.h, HAVE_LONG_LONG_INT defined but not used Nov 18, 2024
@michaelrsweet
Copy link
Owner

[master 880a461] Add linux makefiles (Issue #335)

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

No branches or pull requests

2 participants