source: trunk/third/libIDL/configure.in @ 21474

Revision 21474, 4.2 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21473, which included commits to RCS files with non-trunk default branches.
Line 
1dnl -*- mode: shell-script -*-
2dnl Process this file with autoconf to produce a configure script.
3
4m4_define([libidl_major_version], [0])
5m4_define([libidl_minor_version], [8])
6m4_define([libidl_micro_version], [5])
7m4_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
19m4_define([lt_version], [0:0:0])
20
21dnl the forth argument is because AC_INIT will lowercase the package name
22dnl if left off.
23AC_INIT([libIDL], [libidl_version],
24        [http://bugzilla.gnome.org/enter_bug.cgi?product=libIDL],
25        [libIDL])
26AC_CONFIG_SRCDIR([include/libIDL/IDL.h.in])
27
28AM_INIT_AUTOMAKE(no-define)
29
30AC_SUBST(LIBIDL_MAJOR_VERSION, [libidl_major_version])
31AC_SUBST(LIBIDL_MINOR_VERSION, [libidl_minor_version])
32AC_SUBST(LIBIDL_MICRO_VERSION, [libidl_micro_version])
33AC_SUBST(LIBIDL_VERSION, [libidl_version])
34AC_SUBST(LT_VERSION, [lt_version])
35AC_DEFINE_UNQUOTED(LIBIDL_VERSION, ["libidl_version"],
36                   [the libIDL version number])
37
38dnl --disable-comile-warnings
39AC_ARG_ENABLE(compile-warnings,
40  AC_HELP_STRING([--enable-compile-warnings=@<:@no/yes@:>@],
41                 [Turn on compiler warnings.]),,
42  [enable_compile_warnings="yes"])
43
44dnl Make sure that $ACLOCAL_FLAGS is passed to subsequent aclocal runs.
45ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
46AC_SUBST([ACLOCAL_AMFLAGS])
47
48AC_ISC_POSIX
49
50dnl Checks for programs.
51AC_PROG_CC
52AC_PROG_CPP
53AC_CPP_ACCEPT_IDL
54if [[ "$ac_cv_cpp_accept_idl" = "no" ]]; then
55        AC_MSG_WARN(CPP does not accept IDL)
56fi
57AC_CPP_PIPE_STDIN
58AC_CPP_NOSTDINC
59CPP_PROGRAM="$CPP"
60AC_DEFINE_UNQUOTED(CPP_PROGRAM, "$CPP")
61
62AM_PROG_LEX
63if [[ "$LEX" != "flex" ]]; then
64        AC_MSG_ERROR(flex is required to create the libIDL scanner)
65fi
66LFLAGS="-8"
67AC_SUBST(LFLAGS)
68
69AC_PROG_YACC
70dnl determine if a usable yacc is available on this system
71AC_CHECK_PROG(HAVE_YACC, $YACC, yes, no)
72if [[ "$HAVE_YACC" = "no" ]]; then
73        AC_MSG_ERROR($YACC is not usable as yacc - consider using bison)
74fi
75
76AC_LIBTOOL_WIN32_DLL
77AM_PROG_LIBTOOL
78AM_MAINTAINER_MODE
79
80dnl Checks for libraries.
81PKG_CHECK_MODULES(LIBIDL, glib-2.0 >= 1.3.7)
82
83AC_STDC_HEADERS
84AC_CHECK_HEADERS(stddef.h)
85AC_CHECK_HEADERS(unistd.h)
86AC_CHECK_HEADERS(wchar.h, HAVE_WCHAR_H=1)
87AC_CHECK_HEADERS(wcstr.h, HAVE_WCSTR_H=1)
88if test -z "$HAVE_WCHAR_H"; then
89        HAVE_WCHAR_H=0
90fi
91if test -z "$HAVE_WCSTR_H"; then
92        HAVE_WCSTR_H=0
93fi
94AC_SUBST(HAVE_WCHAR_H)
95AC_SUBST(HAVE_WCSTR_H)
96AC_CHECK_FUNCS(popen symlink access)
97
98dnl glib requires a 64-bit type
99dnl to support win32 add __int64
100AC_CHECK_SIZEOF(long long)
101
102AC_MSG_CHECKING(for format to printf and scanf a guint64)
103AC_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])
118if 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)
122else
123    AC_MSG_RESULT(none)
124    AC_MSG_ERROR([
125*** libIDL requires a 64 bit format type.
126])
127fi
128
129
130if test "x$GCC" = "xyes" -a "x$enable_compile_warnings" != "xno"; then
131        WARN_CFLAGS="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations"
132else
133        WARN_CFLAGS=
134fi
135
136AC_MSG_CHECKING(what warning flags to pass to the C compiler)
137AC_MSG_RESULT($WARN_CFLAGS)
138AC_SUBST(WARN_CFLAGS)
139
140AC_CONFIG_FILES([
141Makefile
142Makefile.msc
143include/Makefile
144include/libIDL/Makefile
145include/libIDL/IDL.h
146libIDL-config-2
147libIDL.m4
148libIDL.spec
149libIDL-2.0.pc
150libIDL-2.0-uninstalled.pc
151])
152
153AC_OUTPUT
154
155echo
156echo libIDL $LIBIDL_VERSION configuration complete
157echo
158echo "  C Preprocessor: \"$CPP_PROGRAM\""
159if [[ "$ac_cv_cpp_pipe_stdin" = "yes" ]]; then
160        echo "  Standard input supported."
161else
162        echo "  Using symlink method."
163fi
164echo
Note: See TracBrowser for help on using the repository browser.