Start using autotools to build the project.

This commit is contained in:
Jef Driesen 2008-06-04 13:56:41 +00:00
parent 0312351bac
commit 5b8410f98b
4 changed files with 139 additions and 0 deletions

1
Makefile.am Normal file
View File

@ -0,0 +1 @@
SUBDIRS = src examples

45
configure.ac Normal file
View File

@ -0,0 +1,45 @@
AC_INIT([libdivecomputer], [0.1])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AC_PROG_CC_C99
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_MSG_CHECKING([for native Win32])
case "$host" in
*-*-mingw*)
os_win32=yes
;;
*)
os_win32=no
;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL([OS_WIN32], [test "$os_win32" = "yes"])
AC_CHECK_HEADERS([winsock2.h af_irda.h], [irda_win32=yes], [irda_win32=no], [
#if HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
])
AC_CHECK_HEADERS([sys/socket.h linux/types.h linux/irda.h], [irda_linux=yes], [irda_linux=no], [
#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
# endif
#if HAVE_LINUX_TYPES_H
# include <linux/types.h>
# endif
])
AM_CONDITIONAL([IRDA], [test "$irda_win32" = "yes" || test "$irda_linux" = "yes"])
AM_CONDITIONAL([IRDA_WIN32], [test "$irda_win32" = "yes"])
AM_CONDITIONAL([IRDA_LINUX], [test "$irda_linux" = "yes"])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
examples/Makefile
])
AC_OUTPUT

36
examples/Makefile.am Normal file
View File

@ -0,0 +1,36 @@
AM_CFLAGS = -I$(top_srcdir)/src
LDADD = $(top_builddir)/src/libdivecomputer.la
bin_PROGRAMS = \
eon \
vyper \
vyper2 \
d9 \
sensuspro \
sensusultra \
aladin \
memomouse
if IRDA
bin_PROGRAMS += smart
endif
eon_SOURCES = suunto_eon_test.c
vyper_SOURCES = suunto_vyper_test.c
vyper2_SOURCES = suunto_vyper2_test.c
d9_SOURCES = suunto_d9_test.c
sensuspro_SOURCES = reefnet_sensuspro_test.c
sensusultra_SOURCES = reefnet_sensusultra_test.c
aladin_SOURCES = uwatec_aladin_test.c
memomouse_SOURCES = uwatec_memomouse_test.c
if IRDA
smart_SOURCES = uwatec_smart_test.c
endif

57
src/Makefile.am Normal file
View File

@ -0,0 +1,57 @@
#
# Public header files.
#
libdivecomputerdir = $(includedir)/libdivecomputer
libdivecomputer_HEADERS = \
utils.h \
suunto.h \
suunto_eon.h \
suunto_vyper.h \
suunto_vyper2.h \
suunto_d9.h \
reefnet.h \
reefnet_sensuspro.h \
reefnet_sensusultra.h \
uwatec.h \
uwatec_aladin.h \
uwatec_memomouse.h \
uwatec_smart.h
#
# Source files.
#
lib_LTLIBRARIES = libdivecomputer.la
libdivecomputer_la_LDFLAGS = -no-undefined
libdivecomputer_la_SOURCES = \
suunto.h \
suunto_common.h suunto_common.c \
suunto_eon.h suunto_eon.c \
suunto_vyper.h suunto_vyper.c \
suunto_vyper2.h suunto_vyper2.c \
suunto_d9.h suunto_d9.c \
reefnet.h \
reefnet_sensuspro.h reefnet_sensuspro.c \
reefnet_sensusultra.h reefnet_sensusultra.c \
uwatec.h \
uwatec_aladin.h uwatec_aladin.c \
uwatec_memomouse.h uwatec_memomouse.c \
utils.h utils.c
if OS_WIN32
libdivecomputer_la_SOURCES += serial.h serial_win32.c
else
libdivecomputer_la_SOURCES += serial.h serial_posix.c
endif
if IRDA
if IRDA_WIN32
libdivecomputer_la_LIBADD = -lws2_32
endif
libdivecomputer_la_SOURCES += \
irda.h irda.c \
uwatec_smart.h uwatec_smart.c
endif