Git Product home page Git Product logo

Comments (6)

n1tehawk avatar n1tehawk commented on September 1, 2024

You're overriding CFLAGS, killing the DEFINES that would normally get passed from our Makefile, e.g. https://github.com/linux-sunxi/sunxi-tools/blob/v1.4.1/Makefile#L25-L27. The absence of -D_BSD_SOURCE then cripples portable_endian.h.

If you wish to pass additional CFLAGS, you should preferably use EXTRA_CFLAGS instead.

Regards, NiteHawk

from sunxi-tools.

ssvb avatar ssvb commented on September 1, 2024

I would say that we should use CFLAGS for passing additional options (instead of inventing EXTRA_CFLAGS), because it's a common practice used by all build systems. Or at least by autotools and CMake.

It is generally a good idea to follow the principle of least astonishment :)

from sunxi-tools.

n1tehawk avatar n1tehawk commented on September 1, 2024

How do we ensure we get our required flags in? Add whatever we need on top of existing CFLAGS - e.g. CFLAGS += -D_BSD_SOURCE -, or pass them independently in the Makefile rules?

Additionally: Who's supposed to "win" in case of conflicts, e.g. -g vs. -s, -O0 vs. -O2 etc. ?

from sunxi-tools.

ssvb avatar ssvb commented on September 1, 2024

Maybe introduce a new DEFAULT_CFLAGS variable in the makefile? Then append the user supplied CFLAGS variable to it. The user's CFLAGS should have the highest priority and the power to override the default options (for example, providing -O3 option to override the default -O2). Again, this is the way how the other build systems work.

from sunxi-tools.

n1tehawk avatar n1tehawk commented on September 1, 2024

Yes, that seems reasonable.

from sunxi-tools.

ssvb avatar ssvb commented on September 1, 2024

Some information about CFLAGS: https://www.gnu.org/software/automake/manual/html_node/User-Variables.html

from sunxi-tools.

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.