I wrote a piece of C code on OS X 10.9.2 (Mavericks) and compiled it using the gcc compiler from terminal by linking the required libraries (like -lm -lfftw3 etc.). It works fine on my computer and another running the same OS (that also has the required libraries) but when I tried running the executable on another computer running OS X 10.8 (Mountain Lion), it doesn't work. I didn't try recompiling on the computer running OS X 10.8 (Mountain Lion) because it doesn't have the required libraries installed. How can I create a new executable using only terminal on my computer (running OS X 10.9.2 (Mavericks)) so that it works on any previous version of the OS that may never have the required libraries installed?
Thanks.