Menu

#25 Honor LDFLAGS

None
closed
nobody
None
5
2020-06-19
2018-12-07
No

Please honor LDFLAGS set at configure time.

Discussion

  • Bill Spitzak

    Bill Spitzak - 2018-12-07

    Should that override the attempt in the makefile to use the fltk ldflags? Or be appended to it?

     
  • Ryan Carsten Schmidt

    I would probably append user-supplied LDFLAGS after any existing flags. Here's what I've used:

    --- makeinclude.in.orig 2014-11-20 15:20:11.000000000 -0600
    +++ makeinclude.in  2018-12-07 10:06:58.000000000 -0600
    @@ -22,4 +22,6 @@
     CXXFLAGS_D =@CXXFLAGS_D@
    
     # libraries to link with:
    +LDFLAGS    =@LDFLAGS@
    +
     INSTALL    =@INSTALL@
    
    --- Makefile.orig   2015-02-09 17:12:19.000000000 -0600
    +++ Makefile    2018-12-07 10:15:52.000000000 -0600
    @@ -17,7 +17,7 @@
     all:   $(PROGRAM)
    
     $(PROGRAM) : $(OBJECTS)
    -   $(CXX) -o $(PROGRAM) $(OBJECTS) `fltk-config --ldflags`
    +   $(CXX) -o $(PROGRAM) $(OBJECTS) `fltk-config --ldflags` $(CXXFLAGS) $(LDFLAGS)
    
     configure: configure.in
        autoconf
    

    I guess equivalent changes are also needed for the "_D" varieties.

    I also added CXXFLAGS because that's where a flag like -stdlib=... is likely to be supplied by the user, and that flag must be used both a compile time and at link time.

     
  • Bill Spitzak

    Bill Spitzak - 2020-06-19

    Fixed as shown above.

     
  • Bill Spitzak

    Bill Spitzak - 2020-06-19
    • status: open --> closed
    • Group: -->
     

Log in to post a comment.