This repository has been archived by the owner on Jan 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
200 lines (160 loc) · 5.55 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
AC_INIT([fm], 1.0.0)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AM_PROG_LIBTOOL
AC_ARG_ENABLE(screen, AC_HELP_STRING([--enable-screen], [Library for terminal handling (default=ncursesw)]),screen="$enableval",screen="ncursesw")
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Compile code for debugging (default=no)]),debug="yes",debug="no")
AC_ARG_ENABLE(localedir, AC_HELP_STRING([--enable-localedir], [Directory with localization files]),localedir="$enableval",localedir="")
AC_ARG_ENABLE(noinst_debug, AC_HELP_STRING([--enable-noinst-debug], [Generate code for non-installation debugging (default=no)]),noinst_debug="yes",noinst_debug="no")
AC_ARG_ENABLE(verbose_compilation, AC_HELP_STRING([--enable-verbose-compilation], [Show more information while compiling (default=no)]),verbose_compilation="1",verbose_compilation="0")
dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
#AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")
dnl ===================
dnl Check for libraries
dnl ===================
PCRE_REQ=6.7
dnl Ok, first we find out what flags we need to use.
AC_MSG_CHECKING([for what extension and flags to use for plugin compilation])
case "$target" in
*)
AC_MSG_RESULT([libdl-compatible: -fPIC -DPIC -shared, .so])
PICFLAGS="-fPIC -DPIC"
PICLDFLAGS="-fPIC -DPIC -shared"
LIBLDFLAGS="-fPIC -DPIC -shared"
AUDLDFLAGS="-Wl,-export-dynamic $RPATH_VAL"
SHARED_SUFFIX=".so"
;;
esac
AC_SUBST(PICFLAGS)
AC_SUBST(PICLDFLAGS)
AC_SUBST(LIBLDFLAGS)
AC_SUBST(AUDLDFLAGS)
AC_SUBST(SHARED_SUFFIX)
AC_DEFINE_UNQUOTED(SHARED_SUFFIX, "${SHARED_SUFFIX}",
[Define the shared module suffix extension on your platform.])
dnl Check libpcre
AC_MSG_CHECKING(if libpcre >= ${PCRE_REQ} exists)
if pkg-config --exists libpcre ; then
PCRE_CFLAGS=`pkg-config --cflags libpcre`
PCRE_LIBS=`pkg-config --libs libpcre`
PCRE_PREFIX=`pkg-config --variable=prefix libpcre`
PCRE_VERSION=`pkg-config --modversion libpcre`
AC_SUBST(PCRE_VERSION)
AC_SUBST(PCRE_PREFIX)
AC_SUBST(PCRE_CFLAGS)
AC_SUBST(PCRE_LIBS)
if pkg-config --exists libpcre '>=' ${PCRE_REQ} ; then
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR("only ${PCRE_VERSION} found")
fi
AC_DEFINE_UNQUOTED(USE_PCRE,"1",[Library for terminal handling])
USE_PCRE=true
else
AC_MSG_ERROR(no)
USE_PCRE=false
fi
AC_SUBST(USE_PCRE)
dnl =============================
dnl Checks for library functions
dnl =============================
# AC_FUNC_MMAP
dnl =====================
dnl Set stuff in config.h
dnl =====================
dnl Get the prefix
if test "x${prefix}" = "xNONE"; then
PREFIX="${ac_default_prefix}"
AC_DEFINE_UNQUOTED(PREFIX, "${ac_default_prefix}", [definition of PREFIX])
else
PREFIX="${prefix}"
AC_DEFINE_UNQUOTED(PREFIX, "${prefix}", [definition of PREFIX])
fi
AC_SUBST(PREFIX)
datadir="$PREFIX/share"
dnl Set DATA_DIR in config.h.
if test "x${datadir}" = 'x${prefix}/share'; then
if test "x${prefix}" = "xNONE"; then
datadir="${ac_default_prefix}/share/${PACKAGE}"
else
datadir="${prefix}/share/${PACKAGE}"
fi
else
datadir="${datadir}/${PACKAGE}"
fi
AC_DEFINE_UNQUOTED(DATA_DIR, "${datadir}/", [Directory of data files])
AC_DEFINE_UNQUOTED(WC_DATA_DIR, L"${datadir}/", [Directory of data files])
if test "x${localedir}" = "x"; then
localedir="${datadir}/locale"
fi
AC_DEFINE_UNQUOTED(WC_PACKAGE, L"$PACKAGE", [Directory of data files])
# Host
AC_DEFINE_UNQUOTED(HOST, "${host}", [definition of HOST])
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Package name for gettext])
case "$screen" in
ncursesw)
AC_DEFINE_UNQUOTED(SCREEN_NCURSESW,"1",[Library for terminal handling])
SCREENLIBS="-lncursesw -lpanel"
;;
*)
AC_DEFINE_UNQUOTED(SCREEN_NCURSESW,"1",[Library for terminal handling])
SCREENLIBS=""
;;
esac
AC_SUBST(SCREENLIBS)
if test "x${noinst_debug}" = 'xyes'; then
AC_DEFINE_UNQUOTED(NOINST_DEBUG,1,[Debugging in source tree only])
project_path="`pwd`/`dirname $0`"
AC_DEFINE_UNQUOTED(PROJECT_PATH,"$project_path",[Absolutely project path])
AC_DEFINE_UNQUOTED(WC_PROJECT_PATH,L"$project_path",[Absolutely project path])
localedir="$project_path/po/locale"
debug="yes"
fi
AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir", [Directory with i18n files])
AC_DEFINE_UNQUOTED(WC_LOCALEDIR, L"$localedir", [Directory with i18n files])
str_debug="no"
if test "x${debug}" = 'xyes'; then
str_debug="yes"
AC_DEFINE_UNQUOTED(DEBUG,1,[Compile information for debugging])
CFLAGS="-g -O0"
CXXFLAGS="-g -O0"
fi
str_screen="{unknown}"
if test "x${screen}" = 'xncursesw'; then
str_screen="ncursesw"
fi
PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
AC_SUBST(verbose_compilation)
dnl =====================
dnl Write some output
dnl =====================
AC_OUTPUT([
Makefile
mk/rules.mk
mk/init.mk
src/Makefile
src/widgets/Makefile
src/actions/Makefile
src/tcl/Makefile
src/vfs/Makefile
src/vfs/plugins/localfs/Makefile
t/vfs/Makefile
po/Makefile
])
echo "
Configuration for $PACKAGE $VERSION :
-----------------------------------
Host System Type ................ : $host
Compiler ........................ : $CC
CFLAGS .......................... : ${PICFLAGS} ${CFLAGS}
LDFLAGS ......................... : ${PICLDFLAGS} ${LDFLAGS}
Linker .......................... : $CC $LDFLAGS ${LIBLDFLAGS} $LIBS
Screen library .................. : ${str_screen}
Debug information ............... : ${str_debug}
Now type 'make' to build $PACKAGE $VERSION,
and then type 'make install' for installation.
"