开发者

Hello World Library using autotools

开发者 https://www.devze.com 2023-04-08 19:28 出处:网络
Creating bin program is really easy using autotools I need to just define two files. `Makefile.am\' bin_PROGRAMS = hello

Creating bin program is really easy using autotools I need to just define two files.

`Makefile.am'

bin_PROGRAMS = hello
hello_SOURCES = hello.c

`configure.in'

AC_INIT(hello.c)
AM_INIT_AUTOMAKE(hello,1.0)
A开发者_JAVA技巧C_PROG_CC
AC_PROG_INSTALL
AC_OUTPUT(Makefile)

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


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 building libraries with Automake is here.

0

精彩评论

暂无评论...
验证码 换一张
取 消