1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | AC_INIT(idl/oaf.idl) |
---|
3 | |
---|
4 | OAF_MAJOR_VERSION=0 |
---|
5 | OAF_MINOR_VERSION=6 |
---|
6 | OAF_MICRO_VERSION=10 |
---|
7 | OAF_VERSION="$OAF_MAJOR_VERSION.$OAF_MINOR_VERSION.$OAF_MICRO_VERSION" |
---|
8 | AM_INIT_AUTOMAKE(oaf, $OAF_VERSION) |
---|
9 | AC_SUBST(OAF_MAJOR_VERSION) |
---|
10 | AC_SUBST(OAF_MINOR_VERSION) |
---|
11 | AC_SUBST(OAF_MICRO_VERSION) |
---|
12 | |
---|
13 | dnl Specify a header configuration file |
---|
14 | AM_CONFIG_HEADER(config.h) |
---|
15 | |
---|
16 | dnl Initialize maintainer mode |
---|
17 | AM_MAINTAINER_MODE |
---|
18 | |
---|
19 | dnl Initialize libtool |
---|
20 | AM_DISABLE_STATIC |
---|
21 | AM_PROG_LIBTOOL |
---|
22 | |
---|
23 | AM_PROG_XML_I18N_TOOLS |
---|
24 | |
---|
25 | |
---|
26 | dnl Build time sanity check |
---|
27 | AM_SANITY_CHECK |
---|
28 | |
---|
29 | dnl Checks for programs. |
---|
30 | AC_PROG_CC |
---|
31 | AM_PROG_LEX |
---|
32 | AC_PROG_YACC |
---|
33 | AC_PROG_INSTALL |
---|
34 | AC_PROG_LN_S |
---|
35 | AC_PROG_MAKE_SET |
---|
36 | AC_ISC_POSIX |
---|
37 | |
---|
38 | dnl internationalization support |
---|
39 | ALL_LINGUAS="az bg da de el es eu fi fr ga gl hu it ja ko nl nn no pl pt pt_BR ro ru sk sl sv ta tr uk zh_CN zh_TW" |
---|
40 | AM_GNU_OAF_GETTEXT |
---|
41 | |
---|
42 | |
---|
43 | dnl Checks for libraries. |
---|
44 | AM_PATH_GLIB(1.2.0,, |
---|
45 | AC_MSG_ERROR([ |
---|
46 | *** GLIB 1.2.0 or better is required. The latest version of GLIB |
---|
47 | *** is always available from ftp://ftp.gtk.org/.]), gmodule) |
---|
48 | |
---|
49 | AM_PATH_ORBIT(0.5.1,,AC_MSG_ERROR([ORBit not installed or installation problem])) |
---|
50 | AC_DEFINE(HAVE_ORB_ORBIT_H) |
---|
51 | |
---|
52 | dnl Check for ORBit > 0.5.1 (CORBA_Object_create_request is prototyped |
---|
53 | dnl in orb/dii.h in the "new" ORBit, but not ORBit 0.5.1, so #defining |
---|
54 | dnl it to nothing results in a compile error iff we have the new ORBit.) |
---|
55 | saved_CFLAGS="$CFLAGS" |
---|
56 | saved_LDFLAGS="$LDFLAGS" |
---|
57 | CFLAGS="$CFLAGS $ORBIT_CFLAGS" |
---|
58 | LDFLAGS="$LDFLAGS $ORBIT_LDFLAGS" |
---|
59 | AC_TRY_COMPILE([ |
---|
60 | #define CORBA_Object_create_request |
---|
61 | #include <orb/dii.h> |
---|
62 | ],[], AC_MSG_ERROR([You need a newer version of ORBit. See the README.]), :) |
---|
63 | CFLAGS="$saved_CFLAGS" |
---|
64 | LDFLAGS="$saved_LDFLAGS" |
---|
65 | |
---|
66 | APP_LIBS="" |
---|
67 | AC_SUBST(APP_LIBS) |
---|
68 | |
---|
69 | dnl |
---|
70 | dnl Locate the xml library |
---|
71 | dnl |
---|
72 | AC_CHECK_PROG(XML_CONFIG, xml-config, xml-config) |
---|
73 | if test "$XML_CONFIG" != "" |
---|
74 | then |
---|
75 | XML_LIBS="`$XML_CONFIG --libs`" |
---|
76 | XML_CFLAGS="`$XML_CONFIG --cflags`" |
---|
77 | XML_VERSION="`$XML_CONFIG --version`" |
---|
78 | else |
---|
79 | AC_MSG_ERROR(Can't find gnome-xml library.) |
---|
80 | fi |
---|
81 | |
---|
82 | case $XML_VERSION in |
---|
83 | 1.*) ;; |
---|
84 | 2.*) AC_MSG_ERROR(libxml 2.x detected; OAF requires libxml 1.x) ;; |
---|
85 | *) AC_MSG_ERROR(unrecognized version of libxml detected; OAF requires libxml 1.x) ;; |
---|
86 | esac; |
---|
87 | |
---|
88 | AC_SUBST(XML_LIBS) |
---|
89 | AC_SUBST(XML_CFLAGS) |
---|
90 | |
---|
91 | dnl ====================== |
---|
92 | dnl = gtk-doc stuff |
---|
93 | dnl ====================== |
---|
94 | |
---|
95 | AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false) |
---|
96 | AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC) |
---|
97 | AC_SUBST(HAVE_GTK_DOC) |
---|
98 | |
---|
99 | dnl Let people disable the gtk-doc stuff. |
---|
100 | AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto) |
---|
101 | |
---|
102 | if test x$enable_gtk_doc = xauto ; then |
---|
103 | if test x$GTKDOC = xtrue ; then |
---|
104 | enable_gtk_doc=yes |
---|
105 | else |
---|
106 | enable_gtk_doc=no |
---|
107 | fi |
---|
108 | fi |
---|
109 | dnl NOTE: We need to use a separate automake conditional for this |
---|
110 | dnl to make this work with the tarballs. |
---|
111 | AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) |
---|
112 | |
---|
113 | dnl ====================== |
---|
114 | dnl = end gtk-doc stuff |
---|
115 | dnl ====================== |
---|
116 | |
---|
117 | |
---|
118 | AC_CHECK_LIB(popt, poptDupArgv,, |
---|
119 | AC_MSG_ERROR([You must have popt 1.5 or newer to compile oaf.])) |
---|
120 | |
---|
121 | dnl Checks for header files. |
---|
122 | AC_HEADER_DIRENT |
---|
123 | AC_HEADER_STDC |
---|
124 | AC_CHECK_HEADERS(fcntl.h unistd.h alloca.h malloc.h) |
---|
125 | |
---|
126 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
127 | AC_C_CONST |
---|
128 | |
---|
129 | dnl Checks for library functions |
---|
130 | AC_CHECK_FUNCS(select strcspn strdup strtol snprintf usleep nanosleep unsetenv) |
---|
131 | |
---|
132 | dnl declare --enable-* args |
---|
133 | |
---|
134 | oaf_debug_default=no; |
---|
135 | |
---|
136 | AC_ARG_ENABLE(oaf-debug, [ --enable-oaf-debug=[no/yes] turn on debugging [default=$oaf_debug_default]],enable_oaf_debug=$enableval,enable_oaf_debug=$debug_default) |
---|
137 | |
---|
138 | if test "x$enable_oaf_debug" = "xyes"; then |
---|
139 | AC_DEFINE(OAF_DEBUG) |
---|
140 | fi |
---|
141 | |
---|
142 | dnl turn warnings into errors to enforce clean code |
---|
143 | |
---|
144 | |
---|
145 | |
---|
146 | AC_ARG_ENABLE(more-warnings, |
---|
147 | [ --enable-more-warnings Maximum compiler warnings], |
---|
148 | set_more_warnings="$enableval",[ |
---|
149 | if test -f $srcdir/CVSVERSION; then |
---|
150 | set_more_warnings=yes |
---|
151 | else |
---|
152 | set_more_warnings=no |
---|
153 | fi |
---|
154 | ]) |
---|
155 | |
---|
156 | if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then |
---|
157 | echo "enable compile warnings = $set_more_warnings" |
---|
158 | CFLAGS="\ |
---|
159 | -Wall \ |
---|
160 | -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \ |
---|
161 | -Wnested-externs -Wpointer-arith \ |
---|
162 | -Werror \ |
---|
163 | $CFLAGS" |
---|
164 | |
---|
165 | for option in -Wsign-promo -Wno-sign-compare; do |
---|
166 | SAVE_CFLAGS="$CFLAGS" |
---|
167 | CFLAGS="$CFLAGS $option" |
---|
168 | AC_MSG_CHECKING([whether gcc understands $option]) |
---|
169 | AC_TRY_COMPILE([], [], |
---|
170 | has_option=yes, |
---|
171 | has_option=no,) |
---|
172 | CFLAGS="$SAVE_CFLAGS" |
---|
173 | if test $has_option = yes; then |
---|
174 | CFLAGS="$CFLAGS $option" |
---|
175 | fi |
---|
176 | AC_MSG_RESULT($has_option) |
---|
177 | unset has_option |
---|
178 | unset SAVE_CFLAGS |
---|
179 | done |
---|
180 | unset option |
---|
181 | fi |
---|
182 | |
---|
183 | AC_PATH_PROG(PERL_PATH, perl) |
---|
184 | if test -n "$PERL_PATH"; then |
---|
185 | OAF_SLAY=oaf-slay |
---|
186 | AC_PATH_PROG(PS_PATH, ps) |
---|
187 | AC_CACHE_CHECK([for POSIX ps], ac_cv_prog_ps_posix, [ |
---|
188 | USER=${USER:-${LOGNAME:-`logname`}} |
---|
189 | if $PS_PATH -U $USER -opid,args >/dev/null 2>&1; then |
---|
190 | ac_cv_prog_ps_posix=yes |
---|
191 | else |
---|
192 | ac_cv_prog_ps_posix=no |
---|
193 | fi |
---|
194 | ]) |
---|
195 | if test "$ac_cv_prog_ps_posix" = yes; then |
---|
196 | IF_BSD_PS=# |
---|
197 | else |
---|
198 | IF_POSIX_PS=# |
---|
199 | fi |
---|
200 | fi |
---|
201 | AC_SUBST(PERL_PATH) |
---|
202 | AC_SUBST(OAF_SLAY) |
---|
203 | AC_SUBST(PS_PATH) |
---|
204 | AC_SUBST(IF_BSD_PS) |
---|
205 | AC_SUBST(IF_POSIX_PS) |
---|
206 | |
---|
207 | AC_OUTPUT([ |
---|
208 | Makefile |
---|
209 | oaf.spec |
---|
210 | idl/Makefile |
---|
211 | docs/Makefile |
---|
212 | api-docs/Makefile |
---|
213 | liboaf/Makefile |
---|
214 | liboaf/liboaf-version.h |
---|
215 | oafd/Makefile |
---|
216 | test/Makefile |
---|
217 | test/oaf-slay |
---|
218 | utils/Makefile |
---|
219 | intl/Makefile |
---|
220 | po/Makefile.in |
---|
221 | oaf-config |
---|
222 | oafConf.sh |
---|
223 | oafd/OAF_naming-service.oaf |
---|
224 | ], |
---|
225 | [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) |
---|