Bug#2113: configure parameters, CXXFLAGS and make, patch included [12:00,06.10.99]

Lubos Lunak l.lunak at sh.cvut.cz
Wed Oct 6 19:01:12 UTC 1999


Package: kdevelop
Version: 1.0-19991005-A
Severity: normal

Bugreport ID : 12:00,06.10.99

Originator	: Lubos Lunak
E-Mail	: l.lunak at email.cz

Subject : configure parameters, CXXFLAGS and make, patch included

Error Class	: software bug
Error Location: build process
Priority	: medium
Bug Description ---------------------------

KDevelop doesn't always set CXXFLAGS and configure
parameters for compilation.
 When just running 'make' and using autoconf/automake,
make detects if e.g. aclocal.m4 has been changed and
updates everything that depends on this file ( it re-runs
aclocal ... configure, etc. ). Therefore configure can in such
a case use default CXXFLAGS and not those set
by KDevelop. To fix this, CXXFLAGS needs to be set
before invoking 'make'.
 Also the configure parameters are not always used - when
a subdirectory is added and also when using
Build->Clean/Rebuild all.

Btw, KDevelop should at least notice that it uses 'cat file | mail' to send the
mail. I'm behind a firewall and the first mail disappeared into the Universe,
good luck it left the file on the disk.


How to repeat the error -------------------

For example, just modify aclocal.m4 and then Build->Make.


Bugfix or Workaround ----------------------

*** ckdevelop.cpp.bak	Thu Sep 30 19:06:01 1999
--- ckdevelop.cpp	Wed Oct  6 10:39:04 1999
*************** void CKDevelop::slotBuildCompileFile(){
*** 720,725 ****
--- 720,738 ----
    // get the filename of the implementation file to compile and change extension for make
    //KDEBUG1(KDEBUG_INFO,CKDEVELOP,"ObjectFile= %s",QString(fileinfo.baseName()+".o").data());
  //  cerr << "ObjectFile= " << fileinfo.baseName()+".o";
+   QString flaglabel=(prj->getProjectType()=="normal_c") ? "CFLAGS=\"" : "CXXFLAGS=\"";
+   process << flaglabel;
+   if (!prj->getCXXFLAGS().isEmpty() || !prj->getAdditCXXFLAGS().isEmpty())
+   {
+        if (!prj->getCXXFLAGS().isEmpty())
+           process << prj->getCXXFLAGS() << " ";
+        if (!prj->getAdditCXXFLAGS().isEmpty())
+           process << prj->getAdditCXXFLAGS();
+   }
+   process  << "\" " << "LDFLAGS=\" " ;
+   if (!prj->getLDFLAGS().isEmpty())
+          process << prj->getLDFLAGS();
+   process  << "\" ";
    process << make_cmd << fileinfo.baseName()+".o";
    process.start(KProcess::NotifyOnExit,KProcess::AllOutput);
  }
*************** void CKDevelop::slotBuildMake(){
*** 784,789 ****
--- 797,815 ----
    messages_widget->clear();
    QDir::setCurrent(prj->getProjectDir() + prj->getSubDir()); 
    process.clearArguments();
+   QString flaglabel=(prj->getProjectType()=="normal_c") ? "CFLAGS=\"" : "CXXFLAGS=\"";
+   process << flaglabel;
+   if (!prj->getCXXFLAGS().isEmpty() || !prj->getAdditCXXFLAGS().isEmpty())
+   {
+        if (!prj->getCXXFLAGS().isEmpty())
+           process << prj->getCXXFLAGS() << " ";
+        if (!prj->getAdditCXXFLAGS().isEmpty())
+           process << prj->getAdditCXXFLAGS();
+   }
+   process  << "\" " << "LDFLAGS=\" " ;
+   if (!prj->getLDFLAGS().isEmpty())
+          process << prj->getLDFLAGS();
+   process  << "\" ";
    if(!prj->getMakeOptions().isEmpty()){
      process << make_cmd << prj->getMakeOptions();
    }
*************** void CKDevelop::slotBuildCleanRebuildAll
*** 880,886 ****
    shell_process  << "\" " << "LDFLAGS=\" " ;
    if (!prj->getLDFLAGS().isEmpty())
           shell_process << prj->getLDFLAGS().simplifyWhiteSpace ();
!   shell_process  << "\" "<< "./configure && " << make_cmd;
  
    beep = true;
    shell_process.start(KProcess::NotifyOnExit,KProcess::AllOutput);
--- 906,912 ----
    shell_process  << "\" " << "LDFLAGS=\" " ;
    if (!prj->getLDFLAGS().isEmpty())
           shell_process << prj->getLDFLAGS().simplifyWhiteSpace ();
!   shell_process  << "\" "<< "./configure " << prj->getConfigureArgs() << " && " << make_cmd;
  
    beep = true;
    shell_process.start(KProcess::NotifyOnExit,KProcess::AllOutput);
*** ckdevelop_project.cpp.bak	Sun Sep 19 20:39:27 1999
--- ckdevelop_project.cpp	Wed Oct  6 10:36:57 1999
*************** void CKDevelop::newSubDir(){
*** 1117,1123 ****
    showOutputView(true);
    QDir::setCurrent(prj->getProjectDir());
    shell_process.clearArguments();
!   shell_process << make_cmd << " -f Makefile.dist  && ./configure";
    shell_process.start(KProcess::NotifyOnExit,KProcess::AllOutput);
  }
  
--- 1117,1136 ----
    showOutputView(true);
    QDir::setCurrent(prj->getProjectDir());
    shell_process.clearArguments();
!   QString flaglabel=(prj->getProjectType()=="normal_c") ? "CFLAGS=\"" : "CXXFLAGS=\"";
!   shell_process << flaglabel;
!   if (!prj->getCXXFLAGS().isEmpty() || !prj->getAdditCXXFLAGS().isEmpty())
!   {
!        if (!prj->getCXXFLAGS().isEmpty())
!           shell_process << prj->getCXXFLAGS() << " ";
!        if (!prj->getAdditCXXFLAGS().isEmpty())
!           shell_process << prj->getAdditCXXFLAGS();
!   }
!   shell_process  << "\" " << "LDFLAGS=\" " ;
!   if (!prj->getLDFLAGS().isEmpty())
!          shell_process << prj->getLDFLAGS();
!   shell_process  << "\" ";
!   shell_process << make_cmd << " -f Makefile.dist  && ./configure" << prj->getConfigureArgs();
    shell_process.start(KProcess::NotifyOnExit,KProcess::AllOutput);
  }


System Information ------------------------

KDevelop version	: 1.0-19991005-A
KDE version		: 1.1.1
QT version		: 1.44
OS/Distribution	: RedHat Linux 6.0
Compiler		: egcs-1.1.2



More information about the KDevelop-devel mailing list