Hello World Library using autotools

Creating a bin program is very simple with autotools. I just need to define two files.

`Makefile.am '

bin_PROGRAMS = hello hello_SOURCES = hello.c 

`configure.in '

 AC_INIT(hello.c) AM_INIT_AUTOMAKE(hello,1.0) AC_PROG_CC AC_PROG_INSTALL AC_OUTPUT(Makefile) 

can any body give the smallest example for creating a static library using autotools?

+6
source share
1 answer

Makefile.am

 lib_LIBRARIES = libhello.a libhello_a_SOURCES = hello.c 

configure.ac

 AC_INIT([libhello], [1.0], [ bug@libhello.org ]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_PROG_CC AC_PROG_RANLIB AC_CONFIG_FILES([Makefile]) AC_OUTPUT 

The documentation for creating libraries with Automake is here .

+13
source

Source: https://habr.com/ru/post/898202/


All Articles