Code Monkey home page Code Monkey logo

Comments (6)

alfredh avatar alfredh commented on August 12, 2024

the idea was that the application should include re.mk in its Makefile.
then the application will get the same flags as re. is this possible in your app ?

my goal is to reduce the number of #ifdef s.

for example the following defines might be subject to removal:

HAVE_INTTYPES_H
HAVE_INET6
HAVE_GAI_STRERROR

what do you think about remove these ?

the goal should be that the re API is source and binary compatible,
independently of which flags are set/unset.

from re.

lgrahl avatar lgrahl commented on August 12, 2024

is this possible in your app ?

I'm currently including it via CMake via the use of the pkgconfig file, so I don't think so. But perhaps CMake has a Makefile compatibility layer? No idea tbh. In any case, since re has a pkgconfig file, IMHO it should be striven for that the library can be used with pkg-config alone, essentially

cc foo.c `pkg-config --cflags --libs libre` -o foo

should work fine and not require foo.c to define HAVE_INTTYPES_H & co.

what do you think about remove these ?

That will probably resolve 90% of the issues but not all of them (like USE_ZLIB). I would also like an approach that resolves this issue 100% without generating any headers but at this point I'm uncertain whether that's possible. The alternative is of course to expose the defines directly in the pkgconfig file but that is a bit messy. Edit: This is actually what I've done in my Meson support branch for now (should I create a PR for that? 😉).

from re.

alfredh avatar alfredh commented on August 12, 2024

the pkg-config file is generated in Makefile:

libre.pc:
	@echo 'prefix='$(PREFIX) > libre.pc
	@echo 'exec_prefix=$${prefix}' >> libre.pc
	@echo 'libdir=$${prefix}/lib' >> libre.pc
	@echo 'includedir=$${prefix}/include/re' >> libre.pc
	@echo '' >> libre.pc
	@echo 'Name: libre' >> libre.pc
	@echo 'Description: ' >> libre.pc
	@echo 'Version: '$(VERSION) >> libre.pc
	@echo 'URL: http://creytiv.com/re.html' >> libre.pc
	@echo 'Libs: -L$${libdir} -lre' >> libre.pc
	@echo 'Libs.private: -L$${libdir} -lre ${LIBS}' >> libre.pc
	@echo 'Cflags: -I$${includedir}' >> libre.pc

so you could add all the mentioned flags to the Cflags section, would that work ?

from re.

lgrahl avatar lgrahl commented on August 12, 2024

Could do but the defines are not prefixed so they might clash. I guess it would be an adequate compromise for now.

from re.

alfredh avatar alfredh commented on August 12, 2024

@lgrahl are you planning to do any work on this ?

from re.

alfredh avatar alfredh commented on August 12, 2024

I have added the item to the roadmap:

https://github.com/creytiv/re/wiki/Roadmap

from re.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.