Premake on Linux should use system include and libs

I was to say I don’t like the idea too much.
Well, first you have to test if the include file and the lib file is there, to avoid linking with a new lib, while using dependencies include for example.
My commit for zlib does not check that yet.
Guess if you do check both, than it can make sense.
You are then using a debug version.
It is unclear to me how it work exactly on Linux. Feel like when you install a lib-dev package, you get a debug version of the “dll”… not sure the non debug version is still there.

On my Mageia Linux box, I do have a zlib-devel install, but no libbzip2-devel is available (although a libzip2 lib is installed).

No miniupnp packages either.
There is a libgupnp however, that I did not investigate.

you have to make sure you include /usr/include and other system include directories so that the compiler knows where the header files is.

                if _OPTIONS["no-boost"] then
                        defines { "NO_BOOST" }
                end

               -- miniupnpc for every os since it is uncommon to have them on Linux distro (I think!)
                files { "../dependencies/miniupnpc/**" }

               files { "../dependencies/bzip2/**" }
                includedirs { "../dependencies" }
                includedirs { "../dependencies/bzip2" }
               if os.findlib("z") then
                       printf("found zlib on the system, using it")
includedirs { "/usr/include" }
                       links {"z"}
               else
                       printf("zlib not found on the system, we'll use the one in the project")
                       files { "../dependencies/zlib/**" }
                       includedirs { "../dependencies/zlib" }
               end

And, even though the dev-packages isn’t installed as a standard, as long as they are available for the OS, it should use it.
You have to install gmake, gcc and other stuff most of the time anyway on the more desktop friendly Linux OS’es.

And, no, you do not only get the debug-libs when downloading the dev-package. You get the header-files.

To install all dev-packages including debugging in Debian GNU/Linux you run this command:
aptitude install zlib1g zlib1g-dbg zlib1g-dev

zlib1g: Standard lib
zlib1g-dbg: Debug lib
zlib1g-dev: Header files.

For libz2 you run this:
32bit: aptitude install libbz2-1.0 libbz2-dev
64bit: aptitude install lib64bz2-1.0 lib64bz2-dev

Debian doesn’t have miniupnp, but it has libgupnp and libupnp. Either one of those is probably a standard and is available in package-managers throughout most Linux OS’es. I understand that we’ve probably chosen miniupnp because it’s small and could be packaged with our source. But using system includes and libraries is better and you don’t have to manually check if the zlib-version you use is up-to-date.

If miniupnp and libupnp is similiar in it’s usage, maybe we could add some check to see which one is available to use. Using standard libs is probably for the best.