以前学automake时的简单例子
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
# configure.ac
#
AC_INIT(hello, 1.3, hello@hello.org)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/hello.c])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_LIBTOOL
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h netdb.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CHECK_FUNCS([socket])
AC_CHECK_LIB(nsl, gethostent)
AC_CHECK_LIB(socket, socket)
AC_CONFIG_FILES([Makefile
libmym/Makefile
src/Makefile])
AC_OUTPUT
#
# Makefile.am
#
AUTOMAKE_OPTIONS = foreign
SUBDIRS = libmym src
#
# src/Makefile.am
#
AUTOMAKE_OPTIONS = foreign
bin_PROGRAMS = hello
hello_SOURCES = hello.c
hello_LDADD = $(top_builddir)/libmym/libmym.la
AM_CPPFLAGS =
-DLIBDIR="$(libdir)"
-I$(top_builddir)/libmym
#
# libmym/Makefile.am
#
AUTOMAKE_OPTIONS = foreign
lib_LTLIBRARIES = libmym.la
libmym_la_SOURCES = mym.c mym.h