~yves-pelletier/libecbufr/documentation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

#dnl Package version information
BUILD_DATE=`date +%d-%m-%Y`

AC_PREREQ(2.59)

m4_define(ecbufr_version_major, 0)
m4_define(ecbufr_version_minor, 8)
# An odd micro number indicates in-progress development, (eg. from git/cvs)
# An even micro number indicates a released version.
m4_define(ecbufr_version_micro, 2)

AC_INIT(libecbufr, ecbufr_version_major.ecbufr_version_minor.ecbufr_version_micro,"https://launchpad.net/~libecbufr-dev")

AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_SRCDIR(API/Sources)
#AM_CONFIG_HEADER(config.h)
#AM_INIT_AUTOMAKE(ECBUFR, 0.8.2)
AM_INIT_AUTOMAKE(ecbufr_version_major.ecbufr_version_minor)

# use these version macros in Makefile.am
VERSION_MAJOR=ecbufr_version_major
VERSION_MINOR=ecbufr_version_minor
VERSION_MICRO=ecbufr_version_micro
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_MICRO)

dnl Shared library version information
dnl
dnl Current  = interface version (increment when change user interface to lib)
dnl Revision = revision number (increment when change implementation, reset to 0 for new interface)
dnl Age      = number of previous interfaces this one is compatible with (i.e. is a superset of)
dnl
dnl Suffix1  = [Current - Age] (on Linux, anyway, soname suffix is [C-A].A.R)
dnl
LIBTOOL_CURRENT=ecbufr_version_major
LIBTOOL_REVISION=ecbufr_version_minor
LIBTOOL_AGE=0
LIBTOOL_SUFFIX1=ecbufr_version_major
LIBTOOL_SUFFIX=${LIBTOOL_SUFFIX1}.${LIBTOOL_AGE}.${LIBTOOL_REVISION}

TOPDIR=`pwd`

# on IRIX machines: use cc instead of gcc, use -c99 and remove -std=gnu99
#                  CFLAGS="$CFLAGS -c99 -I${PWD}/API/Headers -D_GNU_SOURCE"
# For gcc
# -D_REENTRANT   : so that library compatible with Linux Threads
# -fPIC          : for shared library
# should be stripped with :   strip --strip-unneeded thelibrary
# shared libraries should be installed in /usr/lib  
# otherwise, /etc/ld.so.conf should contains reference to that directory at post-install and
#            removed from at post-removal
#
# no -fPIC       : for static library
#CFLAGS="$CFLAGS -I${PWD}/API/Headers -std=gnu99 -g -D_REENTRANT"
CFLAGS="$CFLAGS -I${PWD}/API/Headers -std=gnu99 -D_REENTRANT -fPIC"
LDFLAGS="$LDFLAGS -L${PWD}/API/Sources"

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
#
# AC_PROG_RANLIB is rendered obsolete by AC_PROG_LIBTOOL
#AC_PROG_RANLIB
# seems AC_PROG_LIBTOOL not available on IRIX, and should be commented 
AC_PROG_LIBTOOL

AC_PATH_PROG(DOXYGEN, doxygen, no)

# Checks for libraries.

# Checks for header files.
#AC_HEADER_STDC
AC_CHECK_HEADERS(stdio.h stdlib.h string.h math.h limits.h sys/types.h time.h ctype.h)

# Checks for typedefs, structures, and compiler characteristics.
#AC_C_CONST
#AC_STRUCT_TM

#  Check endianness 
AC_C_BIGENDIAN

#--------------------------------------------------------------------
# On a few very rare systems, all of the libm.a stuff is
# already in libc.a.  Set compiler flags accordingly.
# Also, Linux requires the "ieee" library for math to work
# right (and it must appear before "-lm").
#--------------------------------------------------------------------
MATH_LIBS=""
AC_CHECK_FUNC(sin, , MATH_LIBS="-lm")
AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])

dnl Checks for precise integer types
AC_CHECK_HEADERS([stdint.h inttypes.h sys/int_types.h])
AC_CHECK_TYPES([uint64_t, uint128_t])


# Checks for library functions.
AC_CHECK_LIB( c, main )
#AC_FUNC_MALLOC
#AC_FUNC_REALLOC
#AC_CHECK_FUNCS([strdup])

dnl Set environment variables.
# AC_SUBST(PACKAGE)
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
# AC_SUBST(RELEASE)
AC_SUBST(BUILD_DATE)

AM_MAINTAINER_MODE

AC_OUTPUT(Makefile \
      API/Makefile \
      API/Headers/Makefile \
      API/Headers/private/Makefile \
      API/Headers/bufr_api.h \
      API/Sources/Makefile \
      API/version \
      Utilities/Makefile \
      Tables/Makefile \
      Test/Makefile \
      Docs/Makefile \
      Test/BUFR/Makefile \
      Test/Dump/Makefile \
      Examples/Makefile )