jung1981 / linux-track

Automatically exported from code.google.com/p/linux-track
MIT License
0 stars 0 forks source link

configure --help doesn't build xplane plugin with compile options as documented #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run configure --help and observe the following documented compile option:

  --enable-xplane-plugin  build XPlane plugin (requires XPlane SDK >
                          2.0.1)[default=yes]

2. run configure --enable-xplane-plugin --with-xplane-sdk=<path-to-sdk-cheaders>
3. compile and install
4. run ltr_gui and choose option to Install XPlane Plugin
5. choose location of xplane executable

You will get a dialog saying "/usr/lib64/linuxtrack/xlinuxtrack9_32.so does not 
exist."  This is because it does not compile and install the plugin.

However, if in step 2, you instead run:  configure --with-xplane-plugin 
--with-xplane-sdk=<path-to-sdk-cheaders>, you observe that 
/usr/lib64/linuxtrack/xlinuxtrack9_32.so is compiles and installed.  I haven't 
tried it yet, but from looking at the source code it should successfully 
install the plugin.

FYI, I am building on gentoo linux 64 bit.

Original issue reported on code.google.com by jharv...@dogpad.tk on 11 Jan 2014 at 4:04

GoogleCodeExporter commented 9 years ago
Hello,
I checked and the 32bit XPlane plugin is built when this option is used:

--enable-ltr-32lib-on-x64
                          build 32bit linuxtrack library on 64bit host
                          [default=yes]

As you can see, it should be done by default, which leads me to the conclusion, 
that there is some other problem...

To be sure, I'd like to ask you to attach your config.log here, so I can take a 
peek at that...
Kind regards,

Michal

PS. In the meantime, you should be able to use the universal package...

Original comment by f.jo...@email.cz on 11 Jan 2014 at 5:22

GoogleCodeExporter commented 9 years ago
Michal,

I have attached the config.log from step 2.

But I think you are on the wrong track.  The problem is that neither the 32bit 
nor the 64bit versions of the plugin are built or installed with 
--enable-xplane-plugin.  The reason the dialog complains about the 32bit 
version is only because the gui installer for the xplane plugin requires both 
the 32bit and 64bit and fails first on the 32bit one being missing.  Note in 
the code included below that the installPlugin method returns false immediately 
if the source file does not exist.  So it complains only about the 32bit 
version only even if both are missing.

I have also attached a directory listing of all the files that get installed 
when built with these arguments to configure.  I got this listing by doing the 
install into a chrooted sandbox.  You can see that all the xplane plugin 
libraries are missing.

{code}
void XPluginInstall::on_BrowseXPlane_pressed()
{
  QString fileName = QFileDialog::getOpenFileName(this,
     "Find XPlane executable", QDir::homePath(), "All Files (*)");
  QRegExp pathRexp("^(.*/)[^/]+$");
  if(pathRexp.indexIn(fileName) == -1){
    hide();
    return;
  }
  QString sourceFile32 = PrefProxy::getLibPath("xlinuxtrack9_32");
  QString sourceFile = PrefProxy::getLibPath("xlinuxtrack9");
  QString destPath = pathRexp.cap(1) + "/Resources/plugins";
  if(!QFile::exists(destPath)){
    warningMessage(QString("Can't install XPlane plugin there:'" + fileName + "'"));
    return;
  }

  //Check for the old plugin and remove it if exists
  QString oldPlugin = destPath + "/xlinuxtrack.xpl";
  QFileInfo old(oldPlugin);
  if(old.exists()){
    if(!removePlugin(oldPlugin)){
      return;
    }
  }
  destPath += "/xlinuxtrack/";
#ifndef DARWIN
  if(installPlugin(sourceFile32, destPath + "/lin.xpl") &&
       installPlugin(sourceFile, destPath + "/64/lin.xpl")){
#else
  if(installPlugin(sourceFile, destPath + "/mac.xpl")){
#endif
    QMessageBox::information(NULL, "Linuxtrack", "XPlane plugin installed successfuly!");
  }else{
    warningMessage(QString("XPlane plugin installation failed!"));
  }
  hide();
}
{code}

Original comment by jharv...@dogpad.tk on 12 Jan 2014 at 4:37

Attachments:

GoogleCodeExporter commented 9 years ago
Michal,

In this post, I show the config.log and the resulting installed files when I 
run ./configure --with-xplane-plugin 
--with-xplane-sdk=/opt/x-plane-sdk/SDK/CHeaders.

Note the warning autoconf produces about the unrecognized option 
--with-xplane-plugin, but that the end result is that the xplane plugin 
libraries are actually built and installed as a result of this option.

Original comment by jharv...@dogpad.tk on 12 Jan 2014 at 4:48

Attachments:

GoogleCodeExporter commented 9 years ago
Hmmm... I think this is what happens:

The enable XPlane plugin option indeed is in the 0.99.7 (I removed it since, as 
it is redundant, so 0.99.8 does not use it anymore). Now the snippet in 
question is this:
{{{
AC_ARG_ENABLE([xplane_plugin],
            [AS_HELP_STRING([--enable-xplane-plugin],
              [build XPlane plugin (requires XPlane SDK > 2.0.1)@<:@default=yes@:>@])],
            [],
            [
                AC_CHECK_FILE([${XPLANE_SDK}/XPLM/XPLMScenery.h],
                    [
                      AC_SUBST([XPLANE_SDK])
                      with_xplane_plugin=yes
                    ],
                    [
                      with_xplane_plugin=no
                    ]
                )
            ]
)
}}}

So it seems there is a problem in there - when you specify the 
--enable-xplane-plugin option, the necessary with_xplane_plugin=yes is not set; 
however if you don't specify it, the script checks for the presence of the 
header file and according to the result decides whether to build the plugin or 
not...

As I said, the 0.99.8 does not use this option anymore, exactly for that reason.
Hope it helps and I'm sorry for the trouble,

Michal

Original comment by f.jo...@email.cz on 12 Jan 2014 at 8:33

GoogleCodeExporter commented 9 years ago
Hello,
I'm closing this issue, feel free to reopen it if this problem still bothers 
you...

Kind regards,

Michal

Original comment by f.jo...@email.cz on 18 Nov 2014 at 6:18