title: makefile.am variable to set some libs after object files in make command
body: <p>I have a some code that use the clang libs. I want to use a makefile.am and the autotools to compile it. My problem is that in the compile command, my clang libs must be after the objects files for example:</p>
  
  <pre><code> clang++ $(CXXFLAGS) -o myprog myprog.o -lclanglibs1 -lclanglibs2
  </code></pre>
  
  <p>When I create my makefile.am I have used:</p>
  
  <pre><code> myprog_LDFLAGS = -lclanglibs1 -lclanglibs2
  </code></pre>
  
  <p>which in fact result in the Makefile:</p>
  
  <pre><code> clang++ $(CXXFLAGS) -lclanglibs1 -lclanglibs2 -o myprog myprog.o 
  </code></pre>
  
  <p>And this don't compile (this is a particularity of the clang libs, if I generate manualy the compile command clang++ $(CXXFLAGS) -o myprog myprog.o -lclanglibs1 -lclanglibs2, it works)</p>
  
  <p>I have tryed to skirt this problem with the use of the variable myprogram_LDADD but I get an error because the autotools detects that I it contains some linking libs and autotools says to use myprog_LDFLAGS.</p>
  
  <p>How can I set the clang libs in such manner that they will appear at the end of the compile command?</p>
  
  <p>edit :
  in my makefile.am I get some clang libs like this:</p>
  
  <pre><code> -lclanglibs1 -lclanglibs2 $(shell llvm-config --libs)
  </code></pre>