configure.ac 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. dnl
  2. dnl Configure.in file for the Midnight Commander
  3. dnl
  4. dnl 2.64 is required at least for m4_esyscmd_s()
  5. AC_PREREQ(2.64)
  6. AC_INIT([GNU Midnight Commander], m4_esyscmd_s([./version.sh .]),
  7. [https://www.midnight-commander.org/wiki/NewTicket], [mc],
  8. [https://www.midnight-commander.org/])
  9. m4_pattern_forbid(MC_)
  10. AC_CONFIG_MACRO_DIR([m4])
  11. AC_CONFIG_AUX_DIR(config)
  12. AC_CONFIG_SRCDIR(src/main.c)
  13. AC_CONFIG_HEADERS(config.h)
  14. dnl Apply "no-define" to avoid defining the VERSION macro in config.h
  15. AM_INIT_AUTOMAKE([no-define])
  16. dnl PACKAGE macro isn't defined if "no-define" is applied
  17. AC_DEFINE([PACKAGE], ["mc"], [Name of package])
  18. dnl Enable silent rules by default (if yes)
  19. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  20. mc_VERSION
  21. AM_MAINTAINER_MODE
  22. AC_CANONICAL_HOST
  23. AC_USE_SYSTEM_EXTENSIONS
  24. dnl ############################################################################
  25. dnl Check for compiler
  26. dnl ############################################################################
  27. AC_PROG_CC
  28. AM_PROG_CC_C_O
  29. mc_CHECK_CFLAGS
  30. CFLAGS_OPTS=""
  31. if test "x$CFLAGS" = "x"; then
  32. CFLAGS_OPTS=" -O2 "
  33. fi
  34. if test x$USE_MAINTAINER_MODE = xyes; then
  35. CFLAGS_OPTS="-g3 -O -ggdb"
  36. AC_DEFINE(USE_MAINTAINER_MODE, 1, [Use maintainer mode])
  37. fi
  38. AC_ARG_ENABLE([werror],
  39. AS_HELP_STRING([--enable-werror], [Handle all compiler warnings as errors]))
  40. if test "x$enable_werror" = xyes; then
  41. AX_APPEND_COMPILE_FLAGS([-Werror], [mc_configured_cflags])
  42. fi
  43. dnl Compiler can generate warnings for unrecognized flags added to CFLAGS
  44. dnl which causes attribute checks to fail
  45. ax_gcc_func_attribute_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
  46. _AC_LANG_PREFIX[]FLAGS=
  47. AX_GCC_FUNC_ATTRIBUTE([fallthrough])
  48. _AC_LANG_PREFIX[]FLAGS=$ax_gcc_func_attribute_save_flags
  49. unset ax_gcc_func_attribute_save_flags
  50. LT_INIT
  51. dnl ############################################################################
  52. dnl Check for programs
  53. dnl ############################################################################
  54. AC_PROG_SED
  55. PKG_PROG_PKG_CONFIG
  56. AC_PROG_INSTALL
  57. AC_PROG_LN_S
  58. dnl See also the "OS specific stuff" section below.
  59. dnl Check nroff and the options it supports
  60. AC_CHECK_PROG(HAVE_nroff, nroff, true, false)
  61. dnl Default values
  62. MANDOC=-man
  63. MAN_FLAGS=
  64. if $HAVE_nroff; then
  65. AC_MSG_CHECKING([for manual formatting macros])
  66. AC_CACHE_VAL(mc_cv_mandoc, [
  67. nroff -mandoc < /dev/null > /dev/null 2>&1
  68. if test $? = 0; then
  69. mc_cv_mandoc=-mandoc
  70. else
  71. mc_cv_mandoc=-man
  72. fi
  73. ])
  74. MANDOC=$mc_cv_mandoc
  75. AC_MSG_RESULT([$MANDOC])
  76. AC_MSG_CHECKING([for option to disable ANSI color in manuals])
  77. AC_CACHE_VAL(mc_cv_man_nocolor, [
  78. nroff -c < /dev/null > /dev/null 2>&1
  79. if test $? = 0; then
  80. mc_cv_man_nocolor=-c
  81. else
  82. mc_cv_man_nocolor=
  83. fi
  84. ])
  85. MAN_FLAGS=$mc_cv_man_nocolor
  86. AC_MSG_RESULT([${MAN_NOCOLOR-none}])
  87. AC_MSG_CHECKING([if nroff accepts -Tlatin1 or -Tascii])
  88. AC_CACHE_VAL(mc_cv_nroff_tascii, [
  89. mc_cv_nroff_tascii=
  90. nroff -Tlatin1 < /dev/null > /dev/null 2>&1 /dev/null
  91. if test $? = 0; then
  92. mc_cv_nroff_tascii=-Tlatin1
  93. else
  94. nroff -Tascii < /dev/null > /dev/null 2>&1 /dev/null
  95. if test $? = 0; then
  96. mc_cv_nroff_tascii=-Tascii
  97. fi
  98. fi
  99. ])
  100. AC_MSG_RESULT([${mc_cv_nroff_tascii-no}])
  101. MAN_FLAGS="$MAN_FLAGS $mc_cv_nroff_tascii"
  102. fi
  103. AC_SUBST(MANDOC)
  104. AC_SUBST(MAN_FLAGS)
  105. dnl Check for -z, -b, -L, and -S options to file
  106. AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
  107. if $HAVE_FILECMD; then
  108. dnl Don't use the file command if it doesn't accept the -z option
  109. AC_MSG_CHECKING([for -z option to file command])
  110. AC_CACHE_VAL(mc_cv_file_z, [
  111. file -z . > /dev/null 2>&1
  112. if test $? = 0; then
  113. mc_cv_file_z=yes
  114. else
  115. mc_cv_file_z=no
  116. fi
  117. ])
  118. AC_MSG_RESULT([$mc_cv_file_z])
  119. if test x$mc_cv_file_z = xyes; then
  120. AC_DEFINE(USE_FILE_CMD, 1, [Define if the file command accepts the -z option])
  121. else
  122. AC_MSG_WARN([The file command doesn't accept the -z option and will not be used])
  123. fi
  124. if test x$mc_cv_file_z = xyes; then
  125. dnl file is used; check -b, -L and -S options
  126. AC_MSG_CHECKING([for -b option to file command])
  127. AC_CACHE_VAL(mc_cv_file_b, [
  128. file -b . > /dev/null 2>&1
  129. if test $? = 0; then
  130. mc_cv_file_b=yes
  131. else
  132. mc_cv_file_b=no
  133. fi
  134. ])
  135. AC_MSG_RESULT([$mc_cv_file_b])
  136. if test x$mc_cv_file_b = xyes; then
  137. AC_DEFINE(FILE_B, "-b ", [Define if the file command accepts the -b option])
  138. fi
  139. AC_MSG_CHECKING([for -L option to file command])
  140. AC_CACHE_VAL(mc_cv_file_L, [
  141. file -L . > /dev/null 2>&1
  142. if test $? = 0; then
  143. mc_cv_file_L=yes
  144. else
  145. mc_cv_file_L=no
  146. fi
  147. ])
  148. AC_MSG_RESULT([$mc_cv_file_L])
  149. if test x$mc_cv_file_L = xyes; then
  150. AC_DEFINE(FILE_L, "-L ", [Define if the file command accepts the -L option])
  151. else
  152. AC_DEFINE(FILE_L, "", [Define if the file command accepts the -L option])
  153. fi
  154. dnl The file command accepts the -S option since 5.33
  155. AC_MSG_CHECKING([for -S option to file command])
  156. AC_CACHE_VAL(mc_cv_file_S, [
  157. file -S . > /dev/null 2>&1
  158. if test $? = 0; then
  159. mc_cv_file_S=yes
  160. else
  161. mc_cv_file_S=no
  162. fi
  163. ])
  164. AC_MSG_RESULT([$mc_cv_file_S])
  165. if test x$mc_cv_file_S = xyes; then
  166. AC_DEFINE(FILE_S, "-S ", [Define if file command accepts the -S option])
  167. else
  168. AC_DEFINE(FILE_S, "", [Define if file command accepts the -S option])
  169. fi
  170. fi
  171. fi
  172. dnl Only list browsers here that can be run in background (i.e. with `&')
  173. AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera])
  174. dnl ############################################################################
  175. dnl Check for other tools
  176. dnl ############################################################################
  177. AC_CHECK_TOOL(AR, ar, ar)
  178. AC_CHECK_TOOL(INDENT, gindent, indent)
  179. mc_UNIT_TESTS
  180. dnl ############################################################################
  181. dnl Check for main libraries
  182. dnl ############################################################################
  183. mc_CHECK_GLIB
  184. mc_G_MODULE_SUPPORTED
  185. mc_WITH_SCREEN
  186. mc_CHECK_SEARCH_TYPE
  187. dnl X11 support. Used to read keyboard modifiers when running under X11.
  188. mc_WITH_X
  189. dnl ############################################################################
  190. dnl Check for header files
  191. dnl ############################################################################
  192. AC_CHECK_HEADERS([string.h memory.h limits.h malloc.h \
  193. utime.h sys/statfs.h sys/vfs.h \
  194. sys/select.h sys/ioctl.h stropts.h arpa/inet.h \
  195. sys/socket.h])
  196. dnl This macro is redefined in m4.include/gnulib/sys_types_h.m4
  197. dnl to work around a buggy version in autoconf <= 2.69.
  198. AC_HEADER_MAJOR
  199. dnl ############################################################################
  200. dnl Check for types
  201. dnl ############################################################################
  202. dnl Check largefile before type sizeof checks
  203. AC_SYS_LARGEFILE
  204. AC_CHECK_SIZEOF(long)
  205. AC_TYPE_UINTMAX_T
  206. AC_CHECK_SIZEOF(uintmax_t)
  207. AC_TYPE_OFF_T
  208. AC_CHECK_SIZEOF(off_t)
  209. AC_TYPE_MODE_T
  210. gl_PROMOTED_TYPE_MODE_T
  211. AC_TYPE_PID_T
  212. AC_TYPE_UID_T
  213. AC_CHECK_TYPE([major_t], [], [AC_DEFINE([major_t], [int], [Type of major device numbers.])])
  214. AC_CHECK_TYPE([minor_t], [], [AC_DEFINE([minor_t], [int], [Type of minor device numbers.])])
  215. AC_STRUCT_ST_BLOCKS
  216. AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev, struct stat.st_mtim])
  217. gl_STAT_SIZE
  218. AH_TEMPLATE([sig_atomic_t],
  219. [/* Define to `int' if <signal.h> doesn't define.])
  220. AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T],
  221. [Some systems declare sig_atomic_t as volatile, some others -- no.
  222. This define will have value `sig_atomic_t' or
  223. `volatile sig_atomic_t' accordingly.])
  224. AC_MSG_CHECKING(for sig_atomic_t in signal.h)
  225. AC_EGREP_HEADER(sig_atomic_t,signal.h,
  226. [
  227. ac_cv_type_sig_atomic_t=yes;
  228. AC_EGREP_HEADER(volatile.*sig_atomic_t,
  229. signal.h,
  230. [
  231. is_sig_atomic_t_volatile=yes;
  232. AC_MSG_RESULT([yes, volatile])
  233. ],
  234. [
  235. is_sig_atomic_t_volatile=no;
  236. AC_MSG_RESULT([yes, non volatile])
  237. ])
  238. ],
  239. [
  240. AC_MSG_RESULT(no)
  241. AC_CHECK_TYPE(sig_atomic_t, int)
  242. is_sig_atomic_t_volatile=no
  243. ])
  244. if test $is_sig_atomic_t_volatile = 'yes'
  245. then
  246. AC_DEFINE(SIG_ATOMIC_VOLATILE_T, sig_atomic_t)
  247. else
  248. AC_DEFINE(SIG_ATOMIC_VOLATILE_T, [volatile sig_atomic_t])
  249. fi
  250. dnl ############################################################################
  251. dnl Check for functions
  252. dnl ############################################################################
  253. AC_CHECK_FUNCS([\
  254. strverscmp \
  255. strncasecmp \
  256. realpath
  257. ])
  258. dnl getpt is a GNU Extension (glibc 2.1.x)
  259. AC_CHECK_FUNCS(posix_openpt, , [AC_CHECK_FUNCS(getpt)])
  260. AC_CHECK_FUNCS(grantpt, , [AC_CHECK_LIB(pt, grantpt)])
  261. dnl replacing lstat with statlstat on sco makes it more portable between
  262. dnl sco clones
  263. AC_CHECK_FUNCS(statlstat)
  264. dnl Overriding mmap support. This has to be before AC_FUNC_MMAP is used.
  265. dnl We use only part of the functionality of mmap, so on AIX,
  266. dnl it's possible to use mmap, even if it doesn't pass the autoconf test.
  267. AC_ARG_WITH([mmap],
  268. AS_HELP_STRING([--with-mmap], [Use the mmap call @<:@yes if found@:>@]))
  269. if test x$with_mmap != xno; then
  270. if test x$with_mmap = x; then
  271. AC_FUNC_MMAP
  272. else
  273. AC_DEFINE(HAVE_MMAP, 1)
  274. fi
  275. fi
  276. mc_GET_FS_INFO
  277. dnl ############################################################################
  278. dnl Internationalization
  279. dnl ############################################################################
  280. AC_CHECK_FUNCS([setlocale])
  281. AM_GNU_GETTEXT([external], [need-ngettext])
  282. AM_GNU_GETTEXT_VERSION([0.18.2])
  283. mc_I18N
  284. dnl ############################################################################
  285. dnl OS specific stuff
  286. dnl ############################################################################
  287. case $host_os in
  288. *os400)
  289. AC_PATH_PROG([PERL], [perl], [/QOpenSys/pkgs/bin/perl])
  290. AC_PATH_PROG([PERL_FOR_BUILD], [perl], [/QOpenSys/pkgs/bin/perl])
  291. AC_PATH_PROG([PYTHON], [python], [/QOpenSys/pkgs/bin/python2])
  292. AC_PATH_PROG([RUBY], [ruby], [/QOpenSys/pkgs/bin/ruby])
  293. ;;
  294. *)
  295. AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])
  296. AC_PATH_PROG([PERL_FOR_BUILD], [perl], [/usr/bin/perl])
  297. AC_PATH_PROG([PYTHON], [python], [/usr/bin/python])
  298. AC_PATH_PROG([RUBY], [ruby], [/usr/bin/ruby])
  299. esac
  300. case $host_os in
  301. aux*)
  302. # A/UX
  303. LIBS="$LIBS -lposix"
  304. AC_DEFINE(_POSIX_SOURCE)
  305. ;;
  306. esac
  307. dnl If running under AIX, AC_AIX does not tell us that
  308. AC_MSG_CHECKING([for AIX defines])
  309. AC_EGREP_CPP([yes],
  310. [
  311. #if defined(AIX) || defined(_AIX) || defined(__aix__) || defined(aix)
  312. yes
  313. #endif
  314. ],
  315. [
  316. AC_DEFINE(IS_AIX, 1, [Define if compiling for AIX])
  317. AC_MSG_RESULT(yes)
  318. ],
  319. [
  320. AC_MSG_RESULT(no)
  321. ])
  322. dnl utimensat is supported since glibc 2.6 and specified in POSIX.1-2008
  323. dnl utimensat() causes different timespec structures to cause failures on IBM i and AIX
  324. case $host_os in
  325. *os400 | aix*)
  326. ;;
  327. *)
  328. AC_CHECK_FUNCS([utimensat])
  329. ;;
  330. esac
  331. case $host_os in
  332. *os400)
  333. AC_DEFINE([PTY_ZEROREAD], [1], [read(1) can return 0 for a non-closed fd])
  334. esac
  335. dnl Check linux/fs.h for FICLONE to support BTRFS's file clone operation
  336. case $host_os in
  337. linux*)
  338. AC_CHECK_HEADERS([linux/fs.h])
  339. esac
  340. dnl Check if the OS is supported by the console saver.
  341. cons_saver=""
  342. case $host_os in
  343. linux*)
  344. cons_saver=yes
  345. esac
  346. dnl Check for gpm mouse support (Linux only)
  347. mouse_lib="xterm only"
  348. AC_ARG_WITH([gpm-mouse],
  349. AS_HELP_STRING([--with-gpm-mouse], [Compile with gpm mouse support (Linux only) @<:@yes if found@:>@]))
  350. case $host_os in
  351. linux*)
  352. if test x$with_gpm_mouse != xno; then
  353. AC_CHECK_LIB(gpm, Gpm_Repeat,
  354. [AC_DEFINE(HAVE_LIBGPM, 1,
  355. [Define to enable gpm mouse support on Linux])
  356. mouse_lib="gpm and xterm"
  357. MCLIBS="$MCLIBS -lgpm"],
  358. if test "x$with_gpm_mouse" = "xyes"; then
  359. [AC_MSG_ERROR([libgpm is missing or older than 0.18])]
  360. else
  361. [AC_MSG_WARN([libgpm is missing or older than 0.18])]
  362. fi
  363. )
  364. fi
  365. ;;
  366. esac
  367. dnl ############################################################################
  368. dnl libmc
  369. dnl ############################################################################
  370. LIBMC_VERSION="0.0.1"
  371. LIBMC_RELEASE="1"
  372. AC_SUBST(LIBMC_VERSION)
  373. AC_SUBST(LIBMC_RELEASE)
  374. AC_ARG_ENABLE([mclib],
  375. [AS_HELP_STRING([--enable-mclib], [Compile shared library libmc.so @<:@no@:>@])],
  376. [
  377. if test "x$enableval" = "xno" ; then
  378. enable_mclib=no
  379. else
  380. if test "x$enable_shared" = "xno" ; then
  381. AC_MSG_WARN([Build of shared library is disabled. Specify --enable-shared first])
  382. enable_mclib=no
  383. else
  384. enable_mclib=yes
  385. fi
  386. fi
  387. ],
  388. [enable_mclib=no])
  389. AM_CONDITIONAL([ENABLE_MCLIB], [test x$enable_mclib = xyes])
  390. dnl ############################################################################
  391. dnl MC options
  392. dnl ############################################################################
  393. mc_ASSERT
  394. mc_WITH_INTERNAL_EDIT
  395. dnl Diff viewer support.
  396. AC_ARG_WITH([diff_viewer],
  397. AS_HELP_STRING([--with-diff-viewer], [Compile with diff viewer @<:@yes@:>@]))
  398. if test x$with_diff_viewer != xno; then
  399. AC_DEFINE(USE_DIFF_VIEW, 1, [Define to enable diff viewer])
  400. use_diff=yes
  401. diff_msg="yes"
  402. AC_MSG_NOTICE([using diff viewer])
  403. else
  404. diff_msg="no"
  405. fi
  406. mc_SUBSHELL
  407. mc_BACKGROUND
  408. mc_EXT2FS_ATTR
  409. mc_VFS_CHECKS
  410. dnl ############################################################################
  411. dnl Directories
  412. dnl ############################################################################
  413. dnl ${prefix} and ${exec_prefix} are undefined here if --prefix is not used in command line
  414. dnl Let define ${prefix} and ${exec_prefix}
  415. test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"
  416. test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"
  417. if test x${libexecdir} = x'${exec_prefix}/libexec'; then
  418. EXTHELPERSDIR=${prefix}/libexec/${PACKAGE}/ext.d
  419. elif test x${libexecdir} = x'${exec_prefix}/lib'; then
  420. EXTHELPERSDIR=${prefix}/lib/${PACKAGE}/ext.d
  421. else
  422. EXTHELPERSDIR=${libexecdir}/${PACKAGE}/ext.d
  423. fi
  424. AC_SUBST(EXTHELPERSDIR)
  425. dnl ############################################################################
  426. dnl Documentation
  427. dnl ############################################################################
  428. MAN_DATE="$(LC_ALL=C date "+%B %Y")"
  429. AC_SUBST(MAN_DATE)
  430. dnl Determine which help translations we want to install.
  431. ALL_DOC_LINGUAS="es hu it pl ru sr"
  432. DOC_LINGUAS=
  433. if test "x$USE_NLS" = xyes; then
  434. if test -z "$LINGUAS"; then
  435. langs="`grep -v '^#' $srcdir/po/LINGUAS`"
  436. else
  437. langs="$LINGUAS"
  438. fi
  439. else
  440. langs=
  441. fi
  442. for h_lang in $ALL_DOC_LINGUAS; do
  443. for lang in $langs; do
  444. if test "$lang" = "$h_lang"; then
  445. DOC_LINGUAS="$DOC_LINGUAS $lang"
  446. break
  447. fi
  448. done
  449. done
  450. AC_SUBST(DOC_LINGUAS)
  451. DX_HTML_FEATURE(ON)
  452. DX_CHM_FEATURE(OFF)
  453. DX_CHI_FEATURE(OFF)
  454. DX_MAN_FEATURE(OFF)
  455. DX_RTF_FEATURE(OFF)
  456. DX_XML_FEATURE(OFF)
  457. DX_PDF_FEATURE(OFF)
  458. DX_PS_FEATURE(OFF)
  459. DX_INIT_DOXYGEN(mc,doxygen.cfg,devel)
  460. dnl ############################################################################
  461. dnl Configure results
  462. dnl ############################################################################
  463. CFLAGS="$mc_configured_cflags $CFLAGS_OPTS $CFLAGS"
  464. AC_SUBST(MCLIBS)
  465. AC_SUBST(CFLAGS)
  466. AC_SUBST(CPPFLAGS)
  467. AC_SUBST(LDFLAGS)
  468. AC_SUBST(LIBS)
  469. AM_CONDITIONAL(USE_NLS, [test x"$USE_NLS" = xyes])
  470. AM_CONDITIONAL(USE_MAINTAINER_MODE, [test x"$USE_MAINTAINER_MODE" = xyes])
  471. AM_CONDITIONAL(USE_SCREEN_SLANG, [test x"$with_screen" = xslang])
  472. AM_CONDITIONAL(USE_INTERNAL_EDIT, [test x"$use_internal_edit" = xyes ])
  473. AM_CONDITIONAL(USE_ASPELL, [test x"$enable_aspell" = xyes ])
  474. AM_CONDITIONAL(USE_DIFF, [test -n "$use_diff"])
  475. AM_CONDITIONAL(CHARSET, [test -n "$have_charset"])
  476. AM_CONDITIONAL(CONS_SAVER, [test -n "$cons_saver"])
  477. dnl Clarify do we really need GModule
  478. AM_CONDITIONAL([HAVE_GMODULE], [test -n "$g_module_supported" && \
  479. test x"$textmode_x11_support" = x"yes" -o x"$enable_aspell" = x"yes"])
  480. AC_ARG_ENABLE([configure-args],
  481. AS_HELP_STRING([--enable-configure-args], [Embed ./configure arguments into binaries]))
  482. if test "x$enable_configure_args" != xno; then
  483. AC_DEFINE([ENABLE_CONFIGURE_ARGS], 1, [Define to enable showing configure arguments in help])
  484. AC_DEFINE_UNQUOTED([MC_CONFIGURE_ARGS], ["$ac_configure_args"], [MC configure arguments])
  485. fi
  486. AC_CONFIG_FILES(
  487. [
  488. src/man2hlp/man2hlp
  489. ],
  490. [
  491. chmod +x src/man2hlp/man2hlp
  492. ])
  493. AC_CONFIG_FILES([
  494. Makefile
  495. contrib/Makefile
  496. misc/Makefile
  497. misc/mc.charsets
  498. misc/mc.menu
  499. misc/mcedit.menu
  500. misc/skins/Makefile
  501. misc/ext.d/Makefile
  502. misc/ext.d/doc.sh
  503. misc/ext.d/misc.sh
  504. misc/ext.d/text.sh
  505. misc/ext.d/web.sh
  506. misc/macros.d/Makefile
  507. misc/mc.ext.ini
  508. src/Makefile
  509. src/consaver/Makefile
  510. src/editor/Makefile
  511. src/man2hlp/Makefile
  512. src/subshell/Makefile
  513. src/viewer/Makefile
  514. src/diffviewer/Makefile
  515. src/filemanager/Makefile
  516. src/vfs/Makefile
  517. src/vfs/cpio/Makefile
  518. src/vfs/extfs/Makefile
  519. src/vfs/extfs/helpers/Makefile
  520. src/vfs/extfs/helpers/a+
  521. src/vfs/extfs/helpers/apt+
  522. src/vfs/extfs/helpers/audio
  523. src/vfs/extfs/helpers/deb
  524. src/vfs/extfs/helpers/deba
  525. src/vfs/extfs/helpers/debd
  526. src/vfs/extfs/helpers/dpkg+
  527. src/vfs/extfs/helpers/iso9660
  528. src/vfs/extfs/helpers/hp48+
  529. src/vfs/extfs/helpers/lslR
  530. src/vfs/extfs/helpers/mailfs
  531. src/vfs/extfs/helpers/patchfs
  532. src/vfs/extfs/helpers/rpms+
  533. src/vfs/extfs/helpers/s3+
  534. src/vfs/extfs/helpers/uace
  535. src/vfs/extfs/helpers/ualz
  536. src/vfs/extfs/helpers/uar
  537. src/vfs/extfs/helpers/uarc
  538. src/vfs/extfs/helpers/uarj
  539. src/vfs/extfs/helpers/ucab
  540. src/vfs/extfs/helpers/uha
  541. src/vfs/extfs/helpers/ulha
  542. src/vfs/extfs/helpers/ulib
  543. src/vfs/extfs/helpers/unar
  544. src/vfs/extfs/helpers/urar
  545. src/vfs/extfs/helpers/uwim
  546. src/vfs/extfs/helpers/uzip
  547. src/vfs/extfs/helpers/uzoo
  548. src/vfs/shell/Makefile
  549. src/vfs/shell/helpers/Makefile
  550. src/vfs/ftpfs/Makefile
  551. src/vfs/sftpfs/Makefile
  552. src/vfs/local/Makefile
  553. src/vfs/sfs/Makefile
  554. src/vfs/tar/Makefile
  555. src/vfs/undelfs/Makefile
  556. lib/Makefile
  557. lib/event/Makefile
  558. lib/filehighlight/Makefile
  559. lib/mcconfig/Makefile
  560. lib/search/Makefile
  561. lib/skin/Makefile
  562. lib/strutil/Makefile
  563. lib/tty/Makefile
  564. lib/vfs/Makefile
  565. lib/widget/Makefile
  566. misc/syntax/Makefile
  567. doc/Makefile
  568. doc/hints/Makefile
  569. doc/hints/l10n/Makefile
  570. doc/man/Makefile
  571. doc/man/es/Makefile
  572. doc/man/hu/Makefile
  573. doc/man/it/Makefile
  574. doc/man/pl/Makefile
  575. doc/man/ru/Makefile
  576. doc/man/sr/Makefile
  577. doc/hlp/Makefile
  578. doc/hlp/es/Makefile
  579. doc/hlp/hu/Makefile
  580. doc/hlp/it/Makefile
  581. doc/hlp/pl/Makefile
  582. doc/hlp/ru/Makefile
  583. doc/hlp/sr/Makefile
  584. po/Makefile.in
  585. ])
  586. dnl https://stackoverflow.com/questions/30897170/ac-subst-does-not-expand-variable/30932102#30932102
  587. AC_CONFIG_FILES(
  588. [misc/syntax/Syntax], [${SED-sed} -e "s%\${prefix}%$PREFIX%" misc/syntax/Syntax > misc/syntax/Syntax.tmp && \
  589. mv -f misc/syntax/Syntax.tmp misc/syntax/Syntax], [export PREFIX=$prefix]
  590. )
  591. AC_CONFIG_FILES([
  592. tests/Makefile
  593. tests/lib/Makefile
  594. tests/lib/mcconfig/Makefile
  595. tests/lib/search/Makefile
  596. tests/lib/strutil/Makefile
  597. tests/lib/vfs/Makefile
  598. tests/lib/widget/Makefile
  599. tests/src/Makefile
  600. tests/src/filemanager/Makefile
  601. tests/src/editor/Makefile
  602. tests/src/editor/test-data.txt
  603. tests/src/vfs/Makefile
  604. tests/src/vfs/extfs/Makefile
  605. tests/src/vfs/extfs/helpers-list/Makefile
  606. tests/src/vfs/extfs/helpers-list/data/config.sh
  607. tests/src/vfs/extfs/helpers-list/misc/Makefile
  608. tests/src/vfs/ftpfs/Makefile
  609. ])
  610. AC_OUTPUT
  611. AC_MSG_NOTICE([
  612. Configuration:
  613. Source code location: ${srcdir}
  614. Compiler: ${CC}
  615. Compiler flags: ${CFLAGS}
  616. Assertions: ${enable_assert}
  617. Unit tests: ${tests_msg}
  618. File system: ${vfs_type}
  619. ${vfs_flags}
  620. Screen library: ${screen_msg}
  621. Mouse support: ${mouse_lib}
  622. X11 events support: ${textmode_x11_support}
  623. With subshell support: ${subshell}
  624. With background operations: ${enable_background}
  625. With ext2fs attributes support: ${ext2fs_attr_msg}
  626. Internal editor: ${edit_msg}
  627. Diff viewer: ${diff_msg}
  628. Support for charset: ${charset_msg}
  629. Search type: ${SEARCH_TYPE}
  630. ])
  631. dnl option checking is disable by default due to AC_CONFIG_SUBDIRS
  632. dnl we enable it back for top-level ./configure
  633. if test -n "$ac_unrecognized_opts"; then
  634. case $enable_option_checking in
  635. fatal) AC_MSG_ERROR([unrecognized options: $ac_unrecognized_opts]) ;;
  636. *) AC_MSG_WARN( [unrecognized options: $ac_unrecognized_opts]) ;;
  637. esac
  638. fi