0

I have two C programs named drive.c and mylib.c.

drive.c is main module mylib.c is sub modulle that I want work as shared library .

I can compile them with following step and run.

gcc –fPIC –g –c –Wall mylib.c 

gcc -shared -Wl,-soname,libmylib.so.1 -o /c/opt/lib/libmylib.so.1.0.1 mylib.o -lc

gcc -g -Wall -Wextra -pedantic  -I./ -L/c/opt/lib -o drive.exe drive.c –l:libmylib.so.1

Now I want know is How can I compile them by autotools as same effect of above way ?

What and how do I have to edit configure.ac and Makefile.am for compile them?

ldav1s
  • 15,885
  • 2
  • 53
  • 56
user1345414
  • 3,745
  • 9
  • 36
  • 56
  • 1
    Learning how to use autotools needs some efforts, you could use [Autotools: A Practioner's Guide to GNU Autoconf, Automake, and Libtool](http://www.amazon.com/Autotools-Practioners-Autoconf-Automake-Libtool/dp/1593272065) as a starting point. – Lee Duhem Mar 18 '14 at 09:13
  • 1
    look here http://www.openismus.com/documents/linux/building_libraries/building_libraries – Jayesh Bhoi Mar 18 '14 at 09:37
  • 1
    I recently provided a fully worked example on Stack Overflow: http://stackoverflow.com/a/22182051/266449 – Peter T.B. Brett Mar 19 '14 at 15:17
  • I can build @Petr Brett's way. – user1345414 Mar 24 '14 at 08:48

0 Answers0