update.
[chise/chise-base.git] / configure.in
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.57)
5 AC_INIT(chise-base, 0.25, chise-en@m17n.org)
6
7 AC_CANONICAL_TARGET
8
9 # Checks for programs.
10 AC_PROG_CC
11 # AC_PROG_LIBTOOL
12 #  AC_CHECK_PROGS(LIBTOOL, glibtool libtool, libtool, \
13 #       /usr/local/bin:/opt/bin:/sw/bin:/usr/bin:/bin)
14
15 AC_SUBST(ac_configure_args)
16 AC_SUBST(xemacs_configure_args)
17 AC_SUBST(xemacs_site_includes)
18 AC_SUBST(xemacs_site_libraries)
19 AC_SUBST(xemacs_opts)
20 AC_SUBST(cvs_root)
21 AC_SUBST(lemi_cvs_root)
22
23 if test -f CVS/Root; then
24         cvs_root=`cat CVS/Root`
25         lemi_cvs_root=`cat CVS/Root|sed 's/chise/root/'`
26 else
27         cvs_root=':pserver:anonymous@cvs.m17n.org:/cvs/chise'
28         lemi_cvs_root=':pserver:anonymous@cvs.m17n.org:/cvs/root'
29 fi
30
31 xemacs_configure_args=`echo $ac_configure_args \
32                         | sed 's/--with-site-includes/--site-includes/' \
33                         | sed 's/--with-site-libraries/--site-libraries/' \
34                         | sed "s/'CC=/'--compiler=/"`
35
36 # Settings for optional paths
37 AC_ARG_WITH(site_includes,
38   --with-site-includes=PATH List of directories to search first for header files
39 ,
40 #xemacs_site_includes="$with_site_includes"
41 ,
42 if test -d /sw/include; then
43         xemacs_site_includes="/sw/include"
44         xemacs_opts="--with-dialogs=athena --with-widgets=athena --with-athena=3d"
45
46         if test -f /sw/include/db3/db.h; then
47                 xemacs_site_includes="$xemacs_site_includes:/sw/include/db3"
48         elif test -f /sw/include/db4/db.h; then
49                 xemacs_site_includes="$xemacs_site_includes:/sw/include/db4"
50         fi
51         if test x"$with_canna" != x"no"; then
52            if test -d /sw/include/canna; then
53                 xemacs_opts="$xemacs_opts --with-canna"
54            fi
55         fi
56 fi
57 )
58
59 AC_ARG_WITH(site_libraries,
60   --with-site-libraries=PATH List of directories to search first for libraries
61 ,
62 #xemacs_site_libraries="$with_site_libraries"
63 ,
64 if test -d /sw/include; then
65         xemacs_site_libraries="/sw/lib"
66 fi
67 )
68
69 AC_ARG_WITH(canna,
70   --with-canna          Support the Canna input method
71 ,
72 #xemacs_opts="$xemacs_opts --with-canna"
73 ,
74 )
75
76 # Checks for libraries.
77 if test x"$xemacs_site_includes" != x""; then
78         xemacs_opts="$xemacs_opts --site-includes=$xemacs_site_includes"
79 fi
80
81 if test x"$xemacs_site_libraries" != x""; then
82         xemacs_opts="$xemacs_opts --site-libraries=$xemacs_site_libraries"
83 fi
84
85 if test x"$with_canna" != x"no"; then
86    AC_CHECK_LIB(canna,jrKanjiControl,
87    xemacs_opts="$xemacs_opts --with-canna")
88 fi
89
90 os_name=`uname -s`
91 mac_product_name=`sw_vers |grep ProductName|cut -f2`
92 mac_product_version=`sw_vers |grep ProductVersion|cut -f2`
93 mac_product_major_version=`echo $mac_product_version|cut -d'.' -f1`
94 mac_product_minor_version=`echo $mac_product_version|cut -d'.' -f2`
95
96 if test "$os_name" = "Darwin" -a \
97         "$mac_product_name" = "Mac OS X" -a \
98         $mac_product_major_version -eq 10 -a \
99         $mac_product_minor_version -ge 7
100 then
101    xemacs_opts="$xemacs_opts '--ldflags=-Wl,-no_pie'"
102 fi
103
104 # Checks for header files.
105
106 # Checks for typedefs, structures, and compiler characteristics.
107 #AC_C_CONST
108 #AC_C_INLINE
109
110 # Checks for library functions.
111 #AC_FUNC_ALLOCA
112 #AC_FUNC_STRNLEN
113
114 #AC_CHECK_FUNCS(strnlen)
115
116 AC_CONFIG_FILES([Makefile])
117 AC_OUTPUT