root/lang/cplusplus/i3/trunk/configure.ac @ 30560

Revision 30491, 4.3 kB (checked in by saturday06, 4 years ago)

aaaaaaaaaaaaaaa

Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.60)
5AC_INIT([i3],[0.1],[dyob@lunaport.net])
6AC_CONFIG_AUX_DIR([build-aux])
7AM_INIT_AUTOMAKE([gnu no-define filename-length-max=99 check-news std-options])
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
85GNUSTEP_CXXFLAGS=`gnustep-config --objc-flags`
86GNUSTEP_LIBS=`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
103AC_ARG_ENABLE(windows-unicode,
104    AS_HELP_STRING([--disable-windows-unicode], [UNICODE build]),
105        enable_windows_unicode="$enableval", enable_windows_unicode="yes")
106AM_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
115# ---------------------------------------
116# Libraries
117
118#
119# boost
120#
121
122AX_BOOST_BASE([1.35.0])
123#AX_BOOST_PROGRAM_OPTIONS
124#AX_BOOST_UNIT_TEST_FRAMEWORK
125
126#
127# pthread
128#
129
130ACX_PTHREAD
131
132#
133# gettext
134#
135
136AC_LANG_PUSH([C])
137# follow cygwin & mingw version ?
138AM_GNU_GETTEXT_VERSION([0.14])
139AM_GNU_GETTEXT
140AC_LANG_POP
141
142# ---------------------------------------
143# Checks for header files.
144AC_CHECK_HEADERS([popt.h])
145AC_CHECK_HEADERS([xbyak.h])
146AC_CHECK_HEADERS([cstdatomic])
147
148# ---------------------------------------
149# Checks for typedefs, structures, and compiler characteristics.
150
151
152# ---------------------------------------
153# Checks for library functions.
154
155#AC_CHECK_LIB([argtable2],[arg_parse], [], [echo "argtable2 not found"])
156
157#
158# popt
159#
160
161AC_CHECK_LIB([popt],[poptGetContext],
162  [
163    LIBS="$LIBS -lpopt $LIBINTL"
164  ],
165  [
166    AC_CHECK_LIB([popt],[poptFreeContext], [], [echo "popt not found"])
167  ],
168  ["$LIBINTL"])
169
170#
171# wbindtextdomain
172#
173
174LIBS_ORIG="$LIBS"
175LIBS="$LIBS $LIBINTL"
176AC_CHECK_FUNCS([wbindtextdomain])
177LIBS="$LIBS_ORIG"
178
179#
180# autotest
181#
182
183AC_CONFIG_TESTDIR([tests])
184AC_CONFIG_FILES([tests/Makefile tests/atlocal])
185
186# ---------------------------------------
187AC_CONFIG_FILES([Makefile intl/Makefile po/Makefile.in])
188AC_OUTPUT
189
190echo "Then type 'make' to make ${PACKAGE_NAME}. Good luck. "
191
Note: See TracBrowser for help on using the browser.