configure.ac 21 KB

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