Some jucer make export fixes

diff --git a/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_Make.h b/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_Make.h
index 67b7e8e..d24656b 100644
--- a/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_Make.h       
+++ b/extras/Jucer (experimental)/Source/model/jucer_ProjectExport_Make.h       
@@ -165,6 +165,9 @@ private:
     void writeLinkerFlags (OutputStream& out, const Project::BuildConfiguration& config)
     {
         out << "  LDFLAGS += -L$(BINDIR) -L$(LIBDIR) -mwindows";
+
+        if (project.isAudioPlugin())
+            out << " -shared";
 
         {
             Array<RelativePath> libraryPaths;
@@ -204,7 +207,10 @@ private:
 
         if (config.isDebug().getValue())
             out << " -g -ggdb";
-
+
+        if (project.isAudioPlugin())
+            out << " -fPIC";
+
         out << " -O" << config.getGCCOptimisationFlag() << newLine;
 
         out << "  CXXFLAGS += $(CFLAGS)" << newLine;

Nice one, thanks kraken! So is that all that’s needed to get a linux plugin compiling!?

Not quite. I added a few things and can now cleanly compile an audio plugin project (native linux vst) with Jucer. The resulting plugin (Hello World) works fine in Renoise.
Here’s the patch:

[code]duo:~/tmp/juce_git/juce/extras/Jucer (experimental)/Source/Project$ diff -u jucer_ProjectExport_Make.h.orig jucer_ProjectExport_Make.h
— jucer_ProjectExport_Make.h.orig 2010-09-13 00:50:26.000000000 +0200
+++ jucer_ProjectExport_Make.h 2010-09-13 01:33:48.000000000 +0200
@@ -96,6 +96,14 @@
if (shouldFileBeCompiledByDefault (juceWrapperFiles.getReference(i)))
files.add (juceWrapperFiles.getReference(i));

  •   // add VST Files if necessary, if this is the right place and method..?
    
  •   if (project.isAudioPlugin())
    
  •   {
    
  •       const Array<RelativePath>& vstFiles = getVSTFilesRequired();
    
  •       for (int i = 0; i < vstFiles.size(); i++)
    
  •           files.add (vstFiles.getReference(i));
    
  •   }
    
  •    MemoryOutputStream mo;
       writeMakefile (mo, files);
    

@@ -151,6 +159,14 @@
headerPaths.insert (0, “/usr/include/freetype2”);
headerPaths.insert (0, “/usr/include”);

  •    // Include from VST Path
    
  •    if (project.shouldAddVSTFolderToPath() && getVSTFolder().toString().isNotEmpty())
    
  •       headerPaths.insert (0, getVSTFolder().toString());
    
  •    // Include from juce wrapper files
    
  •    if (project.isAudioPlugin())
    
  •       headerPaths.insert (0, juceWrapperFiles[0].getParentDirectory().toUnixStyle());
    
  •    for (int i = 0; i < headerPaths.size(); ++i)
           out << " -I " << FileHelpers::unixStylePath (headerPaths[i]).quoted();
    

    }
    @@ -229,6 +245,8 @@

       if (project.isLibrary())
           targetName = getLibbedFilename (targetName);
    
  •   else if (project.isAudioPlugin())
    
  •       targetName = targetName + ".so";
    
       out << "  TARGET := " << escapeSpaces (targetName) << newLine;
    

[/code]
– Johan

Excellent stuff, Johan, thanks very much for digging into that! I’ve tweaked your changes a little and checked them in - hopefully you can give it a spin and see if I’ve done the right thing!

Thanks, it works fine!
(Except for the segfault I posted in another topic :slight_smile: )

– Johan