-2

Possible Duplicate:
How to build OpenSSL with MinGW in WIndows?

I have downloaded the OpenSSL source (openssl-1.0.1c) from their website. I need to build/compile this source, so that I can use the same on Windows, MAC and Linux environments. I google'd and read some blogs, but nothing sounds useful for me. If anybody has worked or anybody has relevant knowledge please help me!

Compile once, use the same on all three different environments.

Community
  • 1
  • 1
Charan
  • 942
  • 1
  • 6
  • 18
  • You can find the answer in this post : http://stackoverflow.com/questions/9379363/how-to-build-openssl-with-mingw-in-windows – phsym Oct 25 '12 at 11:28
  • @physm Hey! I am asking cross compilation of OpenSSL, and you are redirecting me to on Windows(only) compilation. – Charan Oct 25 '12 at 12:02
  • I'd suggest you look at how the distro-specific packages are being built. Usually (in case of GPL, I think, mandatory) those scripts are shared. So you can work out the required details, and hook them up into your own desired build thingie. – sehe Oct 25 '12 at 12:14
  • @jalf Is it really not possible to develop something like a library (OpenSSL is based on C-language) that works on all three environments? And, C works on the environments (Windows, MAC & Linux). Please elaborate your point of view and idea. – Charan Oct 25 '12 at 12:19
  • @sehe Okay. I will. If any such, I will get back to you later. – Charan Oct 25 '12 at 12:20
  • @Charan: The C language works just fine under multiple operating systems. That is, the C *source code*. But when you compile it, you compile for a *specific* OS, using a *specific* executable format, and linking against *specific* OS APIs and libraries. And that won't work on another OS which exposes different APIs and libraries, and expects executables to use a different file format. – jalf Oct 25 '12 at 12:20
  • @jalf You are correct! I expected this. I did some ground work. As I learnt libraries on MAC are dylib files, on Windows dll files and on Linux .so files. But, I thought there has to be some way to compile that can be worked everywhere. – Charan Oct 25 '12 at 12:23

1 Answers1

3

That's not possible, and it's not what cross compilation means. Cross-compiling means (for example), compiling for Windows while running in a Linux environment. It doesn't mean compiling something that will run under both Linux and Windows.

There is no way to build a single executable, which can be used on all three operating systems.

You have to compile the library once for Windows, once for Linux and once for Mac.

jalf
  • 243,077
  • 51
  • 345
  • 550