root/lang/objective-cplusplus/i3/trunk/configure.ac @ 31214

Revision 31214, 4.6 kB (checked in by saturday06, 4 years ago)

guha

Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.60)
5AC_INIT([i3],[0.1alpha],[dyob@lunaport.net])
6AC_CONFIG_AUX_DIR([build-aux])
7AM_INIT_AUTOMAKE([gnu no-define check-news std-options tar-ustar])
8AC_CONFIG_SRCDIR([src/Main.cpp])
9AC_CONFIG_HEADER([config.h])
10
11# ---------------------------------------
12# this should be set before AC_PROG_CC, AC_USE_SYSTEM_EXTENSIONS
13AC_ARG_ENABLE(debug,
14    AS_HELP_STRING([--enable-debug], [build debug binaries]),
15        enable_debug="$enableval", enable_debug="no")
16AM_CONDITIONAL(ENABLE_DEBUG, test "$enable_debug" = "yes")
17if test "$enable_debug" = "yes"; then
18  if test "$CFLAGS" = ""; then
19    CFLAGS="-O0 -g"
20  fi
21  if test "$CXXFLAGS" = ""; then
22    CXXFLAGS="-O0 -g"
23  fi
24fi
25
26# ---------------------------------------
27# Programs
28AC_USE_SYSTEM_EXTENSIONS
29AC_CANONICAL_HOST
30AC_PROG_CC
31AC_PROG_CXX
32AC_LANG([C++])
33
34AM_CONDITIONAL(USE_GCH, test "$GXX" = "yes")
35
36# ---------------------------------------
37# OS
38
39case "$host_os" in
40    mingw*)
41        with_os=windows
42#        with_gui_default=windows
43        with_gui_default=gnustep
44        ;;
45    cygwin*)
46        with_os=unix
47        with_gui_default=gnustep
48        with_cygwin=yes
49        ;;
50    darwin*)
51        with_os=unix
52        with_gui_default=cocoa
53        ;;
54    *)
55        with_os=unix
56        with_gui_default=gnustep
57        ;;
58esac
59
60AC_ARG_WITH(gui,
61    AS_HELP_STRING([--with-gui={cocoa|gnustep|windows}], [gui]),
62        with_gui="$withval", with_gui=$with_gui_default)
63
64case "$with_gui" in
65    windows)
66    ;;
67    cocoa)
68        with_gui=gnustep
69
70        GNUSTEP_CXXFLAGS=""
71        GNUSTEP_LIBS="-framework Cocoa"
72
73        CXXFLAGS="-x objective-c++ $CXXFLAGS"
74        LDFLAGS="-x none $LDFLAGS"
75        AC_SUBST(GNUSTEP_CXXFLAGS)
76        AC_SUBST(GNUSTEP_LIBS)
77    ;;
78    gnustep)
79        which gnustep-config > /dev/null
80        if test $? -ne 0; then
81            echo "GNUstep not found."
82            exit 1
83        fi
84
85        GNUSTEP_CXXFLAGS=`perl $srcdir/scripts/gnustep-config-filter.pl gnustep-config --objc-flags`
86        GNUSTEP_LIBS=`perl $srcdir/scripts/gnustep-config-filter.pl gnustep-config --gui-libs`
87
88        CXXFLAGS="-x objective-c++ $CXXFLAGS"
89        LDFLAGS="-x none $LDFLAGS"
90        AC_SUBST(GNUSTEP_CXXFLAGS)
91        AC_SUBST(GNUSTEP_LIBS)
92    ;;
93    *)
94        AC_MSG_ERROR([*** --with-gui=$with_gui is invalid])
95    ;;
96esac
97
98OS_DIR="os-$with_os"
99GUI_DIR="gui-$with_gui"
100AC_SUBST(OS_DIR)
101AC_SUBST(GUI_DIR)
102
103#AC_ARG_ENABLE(windows-unicode,
104#    AS_HELP_STRING([--enable-windows-unicode], [UNICODE build]),
105#        enable_windows_unicode="$enableval", enable_windows_unicode="no")
106#AM_CONDITIONAL(ENABLE_WINDOWS_UNICODE, test "$enable_windows_unicode" = "yes")
107
108AM_CONDITIONAL(WITH_CYGWIN,      test "$with_cygwin" = "yes")
109AM_CONDITIONAL(WITH_OS_WINDOWS,  test "$with_os"     = "windows")
110AM_CONDITIONAL(WITH_OS_UNIX,     test "$with_os"     = "unix")
111AM_CONDITIONAL(WITH_GUI_WINDOWS, test "$with_gui"    = "windows")
112AM_CONDITIONAL(WITH_GUI_COCOA,   test "$with_gui"    = "cocoa")
113AM_CONDITIONAL(WITH_GUI_GNUSTEP, test "$with_gui"    = "gnustep")
114
115if test "$with_gui" != "windows"; then
116    AC_MSG_CHECKING([objective-c++])
117    AC_COMPILE_IFELSE(
118        [AC_LANG_PROGRAM([[]], [[]])],
119        [AC_MSG_RESULT([OK])],
120        [AC_MSG_RESULT([NG]); echo "objective-c++ compiler not found"; exit 1])
121fi
122
123# ---------------------------------------
124# Libraries
125
126#
127# boost
128#
129
130AX_BOOST_BASE([1.38.0])
131#AX_BOOST_PROGRAM_OPTIONS
132#AX_BOOST_UNIT_TEST_FRAMEWORK
133
134#
135# pthread
136#
137
138ACX_PTHREAD
139
140#
141# gettext
142#
143
144AC_LANG_PUSH([C])
145# follow cygwin & mingw version ?
146AM_GNU_GETTEXT_VERSION([0.16.1])
147AM_GNU_GETTEXT
148AC_LANG_POP
149
150# ---------------------------------------
151# Checks for header files.
152AC_CHECK_HEADERS([popt.h])
153AC_CHECK_HEADERS([xbyak.h])
154AC_CHECK_HEADERS([cstdatomic])
155
156# ---------------------------------------
157# Checks for typedefs, structures, and compiler characteristics.
158
159
160# ---------------------------------------
161# Checks for library functions.
162
163#AC_CHECK_LIB([argtable2],[arg_parse], [], [echo "argtable2 not found"])
164
165#
166# popt
167#
168
169AC_CHECK_LIB([popt],[poptGetContext],
170  [
171    LIBS="$LIBS -lpopt $LIBINTL"
172  ],
173  [
174    AC_CHECK_LIB([popt],[poptFreeContext], [], [echo "popt not found"])
175  ],
176  ["$LIBINTL"])
177
178#
179# wbindtextdomain
180#
181
182LIBS_ORIG="$LIBS"
183LIBS="$LIBS $LIBINTL"
184AC_CHECK_FUNCS([wbindtextdomain])
185LIBS="$LIBS_ORIG"
186
187#
188# autotest
189#
190
191AC_CONFIG_TESTDIR([tests])
192AC_CONFIG_FILES([tests/Makefile tests/atlocal])
193
194# ---------------------------------------
195AC_CONFIG_FILES([Makefile intl/Makefile po/Makefile.in])
196AC_OUTPUT
197
198echo "Then type 'make' to make ${PACKAGE_NAME}. Good luck. "
199
Note: See TracBrowser for help on using the browser.