Sun Feb 9 00:44:25 2020 UTC ()
doc/guide: explain how to track down where the CFLAGS are ignored


(rillig)
diff -r1.55 -r1.56 pkgsrc/doc/guide/files/faq.xml

cvs diff -r1.55 -r1.56 pkgsrc/doc/guide/files/faq.xml (expand / switch to unified diff)

--- pkgsrc/doc/guide/files/faq.xml 2017/01/09 04:03:34 1.55
+++ pkgsrc/doc/guide/files/faq.xml 2020/02/09 00:44:25 1.56
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1<!-- $NetBSD: faq.xml,v 1.55 2017/01/09 04:03:34 sevan Exp $ --> 1<!-- $NetBSD: faq.xml,v 1.56 2020/02/09 00:44:25 rillig Exp $ -->
2 2
3<chapter id="faq"> <?dbhtml filename="faq.html"?> 3<chapter id="faq"> <?dbhtml filename="faq.html"?>
4<title>Frequently Asked Questions</title> 4<title>Frequently Asked Questions</title>
5 5
6<para>This section contains hints, tips &amp; tricks on special things in 6<para>This section contains hints, tips &amp; tricks on special things in
7pkgsrc that we didn't find a better place for in the previous chapters, and 7pkgsrc that we didn't find a better place for in the previous chapters, and
8it contains items for both pkgsrc users and developers.</para> 8it contains items for both pkgsrc users and developers.</para>
9 9
10<!-- ================================================================== --> 10<!-- ================================================================== -->
11 11
12 <sect1 id="mailing-list-pointers"> 12 <sect1 id="mailing-list-pointers">
13 <title>Are there any mailing lists for pkg-related discussion?</title> 13 <title>Are there any mailing lists for pkg-related discussion?</title>
14 14
@@ -548,26 +548,46 @@ perform a security check before building @@ -548,26 +548,46 @@ perform a security check before building
548 package.</para> 548 package.</para>
549 549
550 <para>Currently there is no solution to this problem. If you 550 <para>Currently there is no solution to this problem. If you
551 really need the package to use your <varname>CFLAGS</varname> 551 really need the package to use your <varname>CFLAGS</varname>
552 you should run <command>make patch</command> in the package 552 you should run <command>make patch</command> in the package
553 directory and then inspect any <filename>Makefile</filename> and 553 directory and then inspect any <filename>Makefile</filename> and
554 <filename>Makefile.in</filename> for whether they define 554 <filename>Makefile.in</filename> for whether they define
555 <varname>CFLAGS</varname> explicitly. Usually you can remove 555 <varname>CFLAGS</varname> explicitly. Usually you can remove
556 these lines. But be aware that some <quote>smart</quote> 556 these lines. But be aware that some <quote>smart</quote>
557 programmers write so bad code that it only works for the 557 programmers write so bad code that it only works for the
558 specific combination of <varname>CFLAGS</varname> they have 558 specific combination of <varname>CFLAGS</varname> they have
559 chosen.</para> 559 chosen.</para>
560 560
 561<para>To find out where the CFLAGS are ignored, add the following lines to &mk.conf;:</para>
 562
 563<programlisting>
 564CPPFLAGS+= -Dpkgsrc___CPPFLAGS
 565CFLAGS+= -Dpkgsrc___CFLAGS
 566CXXFLAGS+= -Dpkgsrc___CXXFLAGS
 567</programlisting>
 568
 569<para>Then run <command>bmake show-all-configure show-all-build</command>
 570to see whether the above flags are passed to the actual build
 571commands in general.</para>
 572
 573<para>To find out whether the flags are passed to individual compiler
 574commands, have a look at the file <filename>work/.work.log</filename>. In
 575most cases, the flags from the original command lines (the lines starting
 576with <literal>[*]</literal>) are passed unmodified to the actual compiler
 577(the lines starting with <literal>&lt;.&gt;</literal>). If the flag is
 578missing from the actual compiler command, it must have been removed by
 579the <link linkend="build.wrapper">pkgsrc compiler wrappers</link>.</para>
 580
561</sect1> 581</sect1>
562 582
563<sect1 id="ufaq-fail"> 583<sect1 id="ufaq-fail">
564<title>A package does not build. What shall I do?</title> 584<title>A package does not build. What shall I do?</title>
565 585
566 <procedure> 586 <procedure>
567 587
568 <step><para>Make sure that your copy of pkgsrc is consistent. A 588 <step><para>Make sure that your copy of pkgsrc is consistent. A
569 case that occurs often is that people only update pkgsrc in 589 case that occurs often is that people only update pkgsrc in
570 parts, because of performance reasons. Since pkgsrc is one large 590 parts, because of performance reasons. Since pkgsrc is one large
571 system, not a collection of many small systems, there are 591 system, not a collection of many small systems, there are
572 sometimes changes that only work when the whole pkgsrc tree is 592 sometimes changes that only work when the whole pkgsrc tree is
573 updated.</para></step> 593 updated.</para></step>