1 | dnl -*- mode: shell-script -*- |
---|
2 | dnl Process this file with autoconf to produce a configure script. |
---|
3 | |
---|
4 | m4_define([libidl_major_version], [0]) |
---|
5 | m4_define([libidl_minor_version], [8]) |
---|
6 | m4_define([libidl_micro_version], [5]) |
---|
7 | m4_define([libidl_version], [libidl_major_version.libidl_minor_version.libidl_micro_version]) |
---|
8 | |
---|
9 | # Before making a release, the LT_VERSION string should be modified. |
---|
10 | # The string is of the form C:R:A. |
---|
11 | # - If interfaces have been changed or added, but binary compatibility |
---|
12 | # has |
---|
13 | # been preserved, change to C+1:0:A+1 |
---|
14 | # - If binary compatibility has been broken (eg removed or changed |
---|
15 | # interfaces) |
---|
16 | # change to C+1:0:0 |
---|
17 | # - If the interface is the same as the previous version, change to |
---|
18 | # C:R+1:A |
---|
19 | m4_define([lt_version], [0:0:0]) |
---|
20 | |
---|
21 | dnl the forth argument is because AC_INIT will lowercase the package name |
---|
22 | dnl if left off. |
---|
23 | AC_INIT([libIDL], [libidl_version], |
---|
24 | [http://bugzilla.gnome.org/enter_bug.cgi?product=libIDL], |
---|
25 | [libIDL]) |
---|
26 | AC_CONFIG_SRCDIR([include/libIDL/IDL.h.in]) |
---|
27 | |
---|
28 | AM_INIT_AUTOMAKE(no-define) |
---|
29 | |
---|
30 | AC_SUBST(LIBIDL_MAJOR_VERSION, [libidl_major_version]) |
---|
31 | AC_SUBST(LIBIDL_MINOR_VERSION, [libidl_minor_version]) |
---|
32 | AC_SUBST(LIBIDL_MICRO_VERSION, [libidl_micro_version]) |
---|
33 | AC_SUBST(LIBIDL_VERSION, [libidl_version]) |
---|
34 | AC_SUBST(LT_VERSION, [lt_version]) |
---|
35 | AC_DEFINE_UNQUOTED(LIBIDL_VERSION, ["libidl_version"], |
---|
36 | [the libIDL version number]) |
---|
37 | |
---|
38 | dnl --disable-comile-warnings |
---|
39 | AC_ARG_ENABLE(compile-warnings, |
---|
40 | AC_HELP_STRING([--enable-compile-warnings=@<:@no/yes@:>@], |
---|
41 | [Turn on compiler warnings.]),, |
---|
42 | [enable_compile_warnings="yes"]) |
---|
43 | |
---|
44 | dnl Make sure that $ACLOCAL_FLAGS is passed to subsequent aclocal runs. |
---|
45 | ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}" |
---|
46 | AC_SUBST([ACLOCAL_AMFLAGS]) |
---|
47 | |
---|
48 | AC_ISC_POSIX |
---|
49 | |
---|
50 | dnl Checks for programs. |
---|
51 | AC_PROG_CC |
---|
52 | AC_PROG_CPP |
---|
53 | AC_CPP_ACCEPT_IDL |
---|
54 | if [[ "$ac_cv_cpp_accept_idl" = "no" ]]; then |
---|
55 | AC_MSG_WARN(CPP does not accept IDL) |
---|
56 | fi |
---|
57 | AC_CPP_PIPE_STDIN |
---|
58 | AC_CPP_NOSTDINC |
---|
59 | CPP_PROGRAM="$CPP" |
---|
60 | AC_DEFINE_UNQUOTED(CPP_PROGRAM, "$CPP") |
---|
61 | |
---|
62 | AM_PROG_LEX |
---|
63 | if [[ "$LEX" != "flex" ]]; then |
---|
64 | AC_MSG_ERROR(flex is required to create the libIDL scanner) |
---|
65 | fi |
---|
66 | LFLAGS="-8" |
---|
67 | AC_SUBST(LFLAGS) |
---|
68 | |
---|
69 | AC_PROG_YACC |
---|
70 | dnl determine if a usable yacc is available on this system |
---|
71 | AC_CHECK_PROG(HAVE_YACC, $YACC, yes, no) |
---|
72 | if [[ "$HAVE_YACC" = "no" ]]; then |
---|
73 | AC_MSG_ERROR($YACC is not usable as yacc - consider using bison) |
---|
74 | fi |
---|
75 | |
---|
76 | AC_LIBTOOL_WIN32_DLL |
---|
77 | AM_PROG_LIBTOOL |
---|
78 | AM_MAINTAINER_MODE |
---|
79 | |
---|
80 | dnl Checks for libraries. |
---|
81 | PKG_CHECK_MODULES(LIBIDL, glib-2.0 >= 1.3.7) |
---|
82 | |
---|
83 | AC_STDC_HEADERS |
---|
84 | AC_CHECK_HEADERS(stddef.h) |
---|
85 | AC_CHECK_HEADERS(unistd.h) |
---|
86 | AC_CHECK_HEADERS(wchar.h, HAVE_WCHAR_H=1) |
---|
87 | AC_CHECK_HEADERS(wcstr.h, HAVE_WCSTR_H=1) |
---|
88 | if test -z "$HAVE_WCHAR_H"; then |
---|
89 | HAVE_WCHAR_H=0 |
---|
90 | fi |
---|
91 | if test -z "$HAVE_WCSTR_H"; then |
---|
92 | HAVE_WCSTR_H=0 |
---|
93 | fi |
---|
94 | AC_SUBST(HAVE_WCHAR_H) |
---|
95 | AC_SUBST(HAVE_WCSTR_H) |
---|
96 | AC_CHECK_FUNCS(popen symlink access) |
---|
97 | |
---|
98 | dnl glib requires a 64-bit type |
---|
99 | dnl to support win32 add __int64 |
---|
100 | AC_CHECK_SIZEOF(long long) |
---|
101 | |
---|
102 | AC_MSG_CHECKING(for format to printf and scanf a guint64) |
---|
103 | AC_CACHE_VAL(libIDL_cv_long_long_format,[ |
---|
104 | for format in ll q I64; do |
---|
105 | AC_TRY_RUN([#include <stdio.h> |
---|
106 | int main() |
---|
107 | { |
---|
108 | long long b, a = -0x3AFAFAFAFAFAFAFALL; |
---|
109 | char buffer[1000]; |
---|
110 | sprintf (buffer, "%${format}u", a); |
---|
111 | sscanf (buffer, "%${format}u", &b); |
---|
112 | exit (b!=a); |
---|
113 | } |
---|
114 | ], |
---|
115 | libIDL_cv_long_long_format=${format} |
---|
116 | break) |
---|
117 | done]) |
---|
118 | if test -n "$libIDL_cv_long_long_format"; then |
---|
119 | AC_MSG_RESULT(%${libIDL_cv_long_long_format}u) |
---|
120 | IDL_LL="\"${libIDL_cv_long_long_format}\"" |
---|
121 | AC_SUBST(IDL_LL) |
---|
122 | else |
---|
123 | AC_MSG_RESULT(none) |
---|
124 | AC_MSG_ERROR([ |
---|
125 | *** libIDL requires a 64 bit format type. |
---|
126 | ]) |
---|
127 | fi |
---|
128 | |
---|
129 | |
---|
130 | if test "x$GCC" = "xyes" -a "x$enable_compile_warnings" != "xno"; then |
---|
131 | WARN_CFLAGS="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations" |
---|
132 | else |
---|
133 | WARN_CFLAGS= |
---|
134 | fi |
---|
135 | |
---|
136 | AC_MSG_CHECKING(what warning flags to pass to the C compiler) |
---|
137 | AC_MSG_RESULT($WARN_CFLAGS) |
---|
138 | AC_SUBST(WARN_CFLAGS) |
---|
139 | |
---|
140 | AC_CONFIG_FILES([ |
---|
141 | Makefile |
---|
142 | Makefile.msc |
---|
143 | include/Makefile |
---|
144 | include/libIDL/Makefile |
---|
145 | include/libIDL/IDL.h |
---|
146 | libIDL-config-2 |
---|
147 | libIDL.m4 |
---|
148 | libIDL.spec |
---|
149 | libIDL-2.0.pc |
---|
150 | libIDL-2.0-uninstalled.pc |
---|
151 | ]) |
---|
152 | |
---|
153 | AC_OUTPUT |
---|
154 | |
---|
155 | echo |
---|
156 | echo libIDL $LIBIDL_VERSION configuration complete |
---|
157 | echo |
---|
158 | echo " C Preprocessor: \"$CPP_PROGRAM\"" |
---|
159 | if [[ "$ac_cv_cpp_pipe_stdin" = "yes" ]]; then |
---|
160 | echo " Standard input supported." |
---|
161 | else |
---|
162 | echo " Using symlink method." |
---|
163 | fi |
---|
164 | echo |
---|