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

Revision 31349, 4.4 kB (checked in by saturday06, 4 years ago)

ta

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