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

Revision 30282, 5.1 kB (checked in by saturday06, 5 years ago)

b

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="-g"
20  fi
21  if test "$CXXFLAGS" = ""; then
22    CXXFLAGS="-g"
23  fi
24fi
25
26# ---------------------------------------
27# Programs
28AC_USE_SYSTEM_EXTENSIONS
29AC_PROG_CC
30AC_PROG_CXX
31AC_LANG([C++])
32AM_CONDITIONAL(USE_GCH, test "$GXX" = "yes")
33
34# ---------------------------------------
35# Libraries
36
37#
38# boost
39#
40
41AX_BOOST_BASE([1.35.0])
42#AX_BOOST_PROGRAM_OPTIONS
43#AX_BOOST_UNIT_TEST_FRAMEWORK
44
45#
46# pthread
47#
48
49ACX_PTHREAD
50
51#
52# gettext
53#
54
55AC_LANG([C])
56# follow cygwin & mingw version ?
57AM_GNU_GETTEXT_VERSION([0.17])
58AM_GNU_GETTEXT
59AC_LANG([C++])
60
61# ---------------------------------------
62# Checks for header files.
63AC_CHECK_HEADERS([popt.h])
64AC_CHECK_HEADERS([xbyak.h])
65AC_CHECK_HEADERS([cstdatomic])
66
67# ---------------------------------------
68# Checks for typedefs, structures, and compiler characteristics.
69
70
71# ---------------------------------------
72# Checks for library functions.
73
74#AC_CHECK_LIB([argtable2],[arg_parse], [], [echo "argtable2 not found"])
75
76#
77# popt
78#
79
80AC_CHECK_LIB([popt],[poptGetContext],
81  [
82    LIBS="$LIBS -lpopt $LIBINTL"
83  ],
84  [
85    AC_CHECK_LIB([popt],[poptFreeContext], [], [echo "popt not found"])
86  ],
87  ["$LIBINTL"])
88
89#
90# wbindtextdomain
91#
92
93LIBS_ORIG="$LIBS"
94LIBS="$LIBS $LIBINTL"
95AC_CHECK_FUNCS([wbindtextdomain])
96LIBS="$LIBS_ORIG"
97
98# ---------------------------------------
99# OS
100
101case "$host_os" in
102    mingw*)
103        with_os=windows
104#        with_gui_default=windows
105        with_gui_default=gnustep
106        ;;
107    cygwin*)
108        with_os=unix
109        with_gui_default=gnustep
110        with_cygwin=yes
111        ;;
112    *)
113        with_os=unix
114        with_gui_default=gnustep
115        ;;
116esac
117
118AC_ARG_WITH(gui,
119    AS_HELP_STRING([--with-gui={cocoa|gnustep|windows}], [gui]),
120        with_gui="$withval", with_gui=$with_gui_default)
121
122case "$with_gui" in
123    windows)
124    ;;
125    cocoa)
126
127    ;;
128    gnustep)
129        which gnustep-config > /dev/null
130        if test $? -ne 0; then
131            echo "GNUstep not found."
132            exit 1
133        fi
134
135#        GNUSTEP_CXXFLAGS="`gnustep-config --objc-flags`"
136#        GNUSTEP_LIBS="`gnustep-config --objc-libs``gnustep-config --base-libs``gnustep-config --gui-libs`"
137        GNUSTEP_CXXFLAGS="-MMD -MP -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -DGNUSTEP_WITH_DLL -g -Wall -DDEBUG -fno-omit-frame-pointer -DGSWARN -DGSDIAGNOSE -Wno-import -g -fno-strict-aliasing -fgnu-runtime -fconstant-string-class=NSConstantString -I. -I/home/Owner/GNUstep/Library/Headers -I/GNUstep/Local/Library/Headers -I/GNUstep/System/Library/Headers"
138        GNUSTEP_LIBS="-Wl,--enable-auto-import -fgnu-runtime -L/home/Owner/GNUstep/Library/Libraries -L/GNUstep/Local/Library/Libraries -L/GNUstep/System/Library/Libraries -lobjc -lws2_32 -ladvapi32 -lcomctl32 -luser32 -lcomdlg32 -lmpr -lnetapi32 -lm -I.-Wl,--enable-auto-import -fgnu-runtime -L/home/Owner/GNUstep/Library/Libraries -L/GNUstep/Local/Library/Libraries -L/GNUstep/System/Library/Libraries -lgnustep-base -lobjc -lws2_32 -ladvapi32 -lcomctl32 -luser32 -lcomdlg32 -lmpr -lnetapi32 -lm -I.-Wl,--enable-auto-import -fgnu-runtime -L/home/Owner/GNUstep/Library/Libraries -L/GNUstep/Local/Library/Libraries -L/GNUstep/System/Library/Libraries -lgnustep-gui -lgnustep-base -lobjc -lws2_32 -ladvapi32 -lcomctl32 -luser32 -lcomdlg32 -lmpr -lnetapi32 -lm -I."
139        AC_SUBST(GNUSTEP_CXXFLAGS)
140        AC_SUBST(GNUSTEP_LIBS)
141    ;;
142    *)
143        AC_MSG_ERROR([*** --with-gui=$with_gui is invalid])
144    ;;
145esac
146
147OS_DIR="os-$with_os"
148GUI_DIR="gui-$with_gui"
149AC_SUBST(OS_DIR)
150AC_SUBST(GUI_DIR)
151
152AC_ARG_ENABLE(windows-unicode,
153    AS_HELP_STRING([--disable-windows-unicode], [UNICODE build]),
154        enable_windows_unicode="$enableval", enable_windows_unicode="yes")
155AM_CONDITIONAL(ENABLE_WINDOWS_UNICODE, test "$enable_windows_unicode" = "yes")
156
157AM_CONDITIONAL(WITH_CYGWIN,      test "$with_cygwin" = "yes")
158AM_CONDITIONAL(WITH_OS_WINDOWS,  test "$with_os"     = "windows")
159AM_CONDITIONAL(WITH_OS_UNIX,     test "$with_os"     = "unix")
160AM_CONDITIONAL(WITH_GUI_WINDOWS, test "$with_gui"    = "windows")
161AM_CONDITIONAL(WITH_GUI_COCOA,   test "$with_gui"    = "cocoa")
162AM_CONDITIONAL(WITH_GUI_GNUSTEP, test "$with_gui"    = "gnustep")
163
164#
165# autotest
166#
167
168AC_CONFIG_TESTDIR([tests])
169AC_CONFIG_FILES([tests/Makefile tests/atlocal])
170
171# ---------------------------------------
172AC_CONFIG_FILES([Makefile intl/Makefile po/Makefile.in])
173AC_OUTPUT
174
175echo "Then type 'make' to make ${PACKAGE_NAME}. Good luck. "
Note: See TracBrowser for help on using the browser.