blob: 3384df245ea29f919d2297d0dd9ef21c87bda621 [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001dnl***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002dnl Copyright 2018-2022,2023 Thomas E. Dickey *
3dnl Copyright 2010-2016,2018 Free Software Foundation, Inc. *
Steve Kondikae271bc2015-11-15 02:50:53 +01004dnl *
5dnl Permission is hereby granted, free of charge, to any person obtaining a *
6dnl copy of this software and associated documentation files (the *
7dnl "Software"), to deal in the Software without restriction, including *
8dnl without limitation the rights to use, copy, modify, merge, publish, *
9dnl distribute, distribute with modifications, sublicense, and/or sell *
10dnl copies of the Software, and to permit persons to whom the Software is *
11dnl furnished to do so, subject to the following conditions: *
12dnl *
13dnl The above copyright notice and this permission notice shall be included *
14dnl in all copies or substantial portions of the Software. *
15dnl *
16dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
17dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
18dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
19dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
20dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
21dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
22dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23dnl *
24dnl Except as contained in this notice, the name(s) of the above copyright *
25dnl holders shall not be used in advertising or otherwise to promote the *
26dnl sale, use or other dealings in this Software without prior written *
27dnl authorization. *
28dnl***************************************************************************
29dnl
30dnl Author: Thomas E. Dickey
31dnl
micky3879b9f5e72025-07-08 18:04:53 -040032dnl $Id: configure.in,v 1.91 2023/02/18 23:21:29 tom Exp $
Steve Kondikae271bc2015-11-15 02:50:53 +010033dnl Process this file with autoconf to produce a configure script.
34dnl
micky3879b9f5e72025-07-08 18:04:53 -040035dnl For additional information, see
36dnl https://invisible-island.net/autoconf/
37dnl https://invisible-island.net/autoconf/my-autoconf.html
Steve Kondikae271bc2015-11-15 02:50:53 +010038dnl
39dnl ---------------------------------------------------------------------------
micky3879b9f5e72025-07-08 18:04:53 -040040AC_PREREQ(2.52.20210509)
41AC_REVISION($Revision: 1.91 $)
Steve Kondikae271bc2015-11-15 02:50:53 +010042AC_INIT(gen/gen.c)
43AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
44
micky3879b9f5e72025-07-08 18:04:53 -040045AC_DEFUN([AC_PATH_XTRA],[])dnl ignore dependencies on this
46
47PACKAGE="AdaCurses" AC_SUBST(PACKAGE)
48
Steve Kondikae271bc2015-11-15 02:50:53 +010049CF_TOP_BUILDDIR
50
micky3879b9f5e72025-07-08 18:04:53 -040051CF_HELP_MESSAGE(General Options:)
52
Steve Kondikae271bc2015-11-15 02:50:53 +010053CF_WITH_SYSTYPE
54
55### Save the given $CFLAGS to allow user-override.
56cf_user_CFLAGS="$CFLAGS"
57
58### Default install-location
59CF_CFG_DEFAULTS
60
61### Checks for programs.
62CF_PROG_CC(gnatgcc gcc cc)
63AC_PROG_CPP
64AC_PROG_GCC_TRADITIONAL
micky3879b9f5e72025-07-08 18:04:53 -040065CF_PROG_CC_C_O(CC,[$CFLAGS $CPPFLAGS])
Steve Kondikae271bc2015-11-15 02:50:53 +010066
67AC_ARG_PROGRAM
68
69CF_PROG_AWK
70CF_PROG_EGREP
71AC_PROG_INSTALL
72CF_PROG_LN_S
73
micky3879b9f5e72025-07-08 18:04:53 -040074CF_PROG_INSTALL
75CF_INSTALL_OPTS
76
Steve Kondikae271bc2015-11-15 02:50:53 +010077AC_SYS_LONG_FILE_NAMES
78
79# if we find pkg-config, check if we should install the ".pc" files.
80CF_PKG_CONFIG
81CF_WITH_PKG_CONFIG_LIBDIR
82
83AC_MSG_CHECKING(if you want to build test-programs)
84AC_ARG_WITH(tests,
85 [ --without-tests suppress build with test-programs],
86 [cf_with_tests=$withval],
87 [cf_with_tests=yes])
88AC_MSG_RESULT($cf_with_tests)
89
90AC_MSG_CHECKING(if we should assume mixed-case filenames)
91AC_ARG_ENABLE(mixed-case,
92 [ --enable-mixed-case tic should assume mixed-case filenames],
93 [enable_mixedcase=$enableval],
94 [enable_mixedcase=auto])
95AC_MSG_RESULT($enable_mixedcase)
96if test "$enable_mixedcase" = "auto" ; then
97 CF_MIXEDCASE_FILENAMES
98else
99 cf_cv_mixedcase=$enable_mixedcase
100 if test "$enable_mixedcase" = "yes" ; then
101 AC_DEFINE(MIXEDCASE_FILENAMES)
102 fi
103fi
104
105# do this after mixed-case option (tags/TAGS is not as important as tic).
106AC_PROG_MAKE_SET
micky3879b9f5e72025-07-08 18:04:53 -0400107CF_MAKE_PHONY
Steve Kondikae271bc2015-11-15 02:50:53 +0100108CF_MAKE_TAGS
109CF_MAKEFLAGS
110
111dnl These are standard among *NIX systems, but not when cross-compiling
112AC_CHECK_TOOL(RANLIB, ranlib, ':')
113AC_CHECK_TOOL(LD, ld, ld)
114AC_CHECK_TOOL(AR, ar, ar)
115CF_AR_FLAGS
116CF_PATHSEP
117
118dnl Special option for use by system-builders: the install-prefix is used to
119dnl adjust the location into which the actual install is done, so that an
120dnl archive can be built without modifying the host system's configuration.
121AC_MSG_CHECKING(if you have specified an install-prefix)
122AC_ARG_WITH(install-prefix,
123 [ --with-install-prefix prefixes actual install-location ($DESTDIR)],
124 [case "$withval" in
125 (yes|no)
126 ;;
127 (*) DESTDIR="$withval"
128 ;;
129 esac])
130AC_MSG_RESULT($DESTDIR)
131AC_SUBST(DESTDIR)
132
133###############################################################################
134CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
135# If we're cross-compiling, allow the user to override the tools and their
136# options. The configure script is oriented toward identifying the host
137# compiler, etc., but we need a build compiler to generate parts of the source.
138CF_BUILD_CC
139
140###############################################################################
141CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
142
143### Options to allow the user to specify the set of libraries which are used.
144### Use "--without-normal --with-shared" to allow the default model to be
145### shared, for example.
146cf_list_models=""
147
148AC_MSG_CHECKING(if you want to build shared C-objects)
149AC_ARG_WITH(shared,
150 [ --with-shared generate shared C-objects (needed for --with-ada-sharedlib)],
151 [with_shared=$withval],
152 [with_shared=no])
153AC_MSG_RESULT($with_shared)
154test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
155
156AC_MSG_CHECKING(for specified models)
157test -z "$cf_list_models" && cf_list_models=normal
158AC_MSG_RESULT($cf_list_models)
159
160### Use the first model as the default, and save its suffix for use in building
161### up test-applications.
162AC_MSG_CHECKING(for default model)
163DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
164AC_MSG_RESULT($DFT_LWR_MODEL)
165
166CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
167
168AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal")
169AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL")
170
171CF_NCURSES_ADDON
172
173CF_WITH_LIB_PREFIX(cf_prefix)
174
175LIB_SUFFIX=
176AC_SUBST(LIB_SUFFIX)
177
178###############################################################################
179
180dnl Not all ports of gcc support the -g option
181
182if test X"$CC_G_OPT" = X"" ; then
183 CC_G_OPT='-g'
184 test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
185fi
186AC_SUBST(CC_G_OPT)
187
188AC_MSG_CHECKING(for default loader flags)
189case $DFT_LWR_MODEL in
190(normal) LD_MODEL='' ;;
191(debug) LD_MODEL=$CC_G_OPT ;;
192(profile) LD_MODEL='-pg';;
193(shared) LD_MODEL='' ;;
194esac
195AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
196AC_MSG_RESULT($LD_MODEL)
197
198CF_SHARED_OPTS
199
200# The test/sample programs in the original tree link using rpath option.
201# Make it optional for packagers.
202if test -n "$LOCAL_LDFLAGS"
203then
204 AC_MSG_CHECKING(if you want to link sample programs with rpath option)
205 AC_ARG_ENABLE(rpath-link,
206 [ --enable-rpath-link link sample programs with rpath option],
207 [with_rpath_link=$enableval],
208 [with_rpath_link=yes])
209 AC_MSG_RESULT($with_rpath_link)
210 if test "$with_rpath_link" = no
211 then
212 LOCAL_LDFLAGS=
213 LOCAL_LDFLAGS2=
214 fi
215fi
216
217###############################################################################
218CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
219
220### use option --enable-broken-linker to force on use of broken-linker support
micky3879b9f5e72025-07-08 18:04:53 -0400221CF_ENABLE_BROKEN_LINKER
Steve Kondikae271bc2015-11-15 02:50:53 +0100222
223# Check to define _XOPEN_SOURCE "automatically"
micky3879b9f5e72025-07-08 18:04:53 -0400224CF_XOPEN_SOURCE(600)
225AC_CHECK_DECL(exit)
Steve Kondikae271bc2015-11-15 02:50:53 +0100226
227CF_LARGEFILE
228
229### Enable compiling-in rcs id's
230AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
231AC_ARG_WITH(rcs-ids,
232 [ --with-rcs-ids compile-in RCS identifiers],
233 [with_rcs_ids=$withval],
234 [with_rcs_ids=no])
235AC_MSG_RESULT($with_rcs_ids)
236test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS,1,[Define to 1 if RCS identifiers should be compiled-in)])
237
238###############################################################################
239CF_HELP_MESSAGE(Extensions:)
240
241### Note that some functions (such as const) are normally disabled anyway.
242AC_MSG_CHECKING(if you want to build with function extensions)
243AC_ARG_ENABLE(ext-funcs,
244 [ --disable-ext-funcs disable function-extensions],
245 [with_ext_funcs=$enableval],
246 [with_ext_funcs=yes])
247AC_MSG_RESULT($with_ext_funcs)
248if test "$with_ext_funcs" = yes ; then
249 NCURSES_EXT_FUNCS=1
250 AC_DEFINE(HAVE_USE_DEFAULT_COLORS,1,[Define to 1 if we have use_default_colors function])
251 AC_DEFINE(NCURSES_EXT_FUNCS,1,[Define to 1 if we have ncurses extended functions])
252else
253 NCURSES_EXT_FUNCS=0
254fi
255AC_SUBST(NCURSES_EXT_FUNCS)
256
257### use option --enable-const to turn on use of const beyond that in XSI.
258AC_MSG_CHECKING(for extended use of const keyword)
259AC_ARG_ENABLE(const,
260 [ --enable-const compile with extra/non-standard const],
261 [with_ext_const=$enableval],
262 [with_ext_const=no])
263AC_MSG_RESULT($with_ext_const)
264NCURSES_CONST='/*nothing*/'
265if test "$with_ext_const" = yes ; then
266 NCURSES_CONST=const
267fi
268AC_SUBST(NCURSES_CONST)
269
270###############################################################################
271# These options are relatively safe to experiment with.
272CF_HELP_MESSAGE(Development Code:)
273AC_MSG_CHECKING(if you want all development code)
274AC_ARG_WITH(develop,
275 [ --without-develop disable development options],
276 [with_develop=$withval],
277 [with_develop=no])
278AC_MSG_RESULT($with_develop)
279
280###############################################################################
281# These are just experimental, probably should not be in a package:
282CF_HELP_MESSAGE(Experimental Code:)
283
284# This is still experimental (20080329), but should ultimately be moved to
285# the script-block --with-normal, etc.
286CF_WITH_PTHREAD
287
288AC_MSG_CHECKING(if you want to use weak-symbols for pthreads)
289AC_ARG_ENABLE(weak-symbols,
290 [ --enable-weak-symbols enable weak-symbols for pthreads],
291 [use_weak_symbols=$withval],
292 [use_weak_symbols=no])
293AC_MSG_RESULT($use_weak_symbols)
294if test "$use_weak_symbols" = yes ; then
295 CF_WEAK_SYMBOLS
296else
297 cf_cv_weak_symbols=no
298fi
299
300if test $cf_cv_weak_symbols = yes ; then
301 AC_DEFINE(USE_WEAK_SYMBOLS,1,[Define to 1 to enable weak-symbols for pthreads])
302fi
303
304PTHREAD=
305if test "$with_pthread" = "yes" ; then
306 AC_DEFINE(USE_PTHREADS,1,[Define to 1 to use the pthreads library])
307 enable_reentrant=yes
308 if test $cf_cv_weak_symbols = yes ; then
309 PTHREAD=-lpthread
310 fi
311fi
312AC_SUBST(PTHREAD)
313
314# OpenSUSE is installing ncurses6, using reentrant option.
315AC_CHECK_FUNC(_nc_TABSIZE,[assume_reentrant=yes], [assume_reentrant=no])
316
317# Reentrant code has to be opaque; there's little advantage to making ncurses
318# opaque outside of that, so there is no --enable-opaque option. We can use
319# this option without --with-pthreads, but this will be always set for
320# pthreads.
321AC_MSG_CHECKING(if you want experimental reentrant code)
322AC_ARG_ENABLE(reentrant,
323 [ --enable-reentrant compile with experimental reentrant code],
324 [with_reentrant=$enableval],
325 [with_reentrant=$assume_reentrant])
326AC_MSG_RESULT($with_reentrant)
327if test "$with_reentrant" = yes ; then
328 cf_cv_enable_reentrant=1
329 if test $cf_cv_weak_symbols = yes ; then
330 CF_REMOVE_LIB(LIBS,$LIBS,pthread)
331 elif test "$assume_reentrant" = no ; then
332 LIB_SUFFIX="t${LIB_SUFFIX}"
333 fi
334 AC_DEFINE(USE_REENTRANT,1,[Define to 1 to compile with experimental reentrant code])
335else
336 cf_cv_enable_reentrant=0
337fi
338AC_SUBST(cf_cv_enable_reentrant)
339
340### Allow using a different wrap-prefix
341if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
342 AC_MSG_CHECKING(for prefix used to wrap public variables)
343 AC_ARG_WITH(wrap-prefix,
344 [ --with-wrap-prefix=XXX override prefix used for public variables],
345 [NCURSES_WRAP_PREFIX=$withval],
346 [NCURSES_WRAP_PREFIX=_nc_])
347 AC_MSG_RESULT($NCURSES_WRAP_PREFIX)
348else
349 NCURSES_WRAP_PREFIX=_nc_
350fi
351AC_SUBST(NCURSES_WRAP_PREFIX)
352AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX",[Define to override _nc_ ncurses internal prefix])
353
354###############################################################################
355CF_HELP_MESSAGE(Testing/development Options:)
356
357### use option --disable-echo to suppress full display compiling commands
358CF_DISABLE_ECHO
359
micky3879b9f5e72025-07-08 18:04:53 -0400360CF_ENABLE_WARNINGS(Wno-unknown-pragmas Wswitch-enum,yes)
361if test "x$enable_warnings" = "xyes"; then
362 CF_ADD_ADAFLAGS(-gnatwa -gnatyg)
Steve Kondikae271bc2015-11-15 02:50:53 +0100363fi
Steve Kondikae271bc2015-11-15 02:50:53 +0100364
365### use option --enable-assertions to turn on generation of assertion code
366AC_MSG_CHECKING(if you want to enable runtime assertions)
367AC_ARG_ENABLE(assertions,
368 [ --enable-assertions test: turn on generation of assertion code],
369 [with_assertions=$enableval],
370 [with_assertions=no])
371AC_MSG_RESULT($with_assertions)
372if test -n "$GCC"
373then
374 if test "$with_assertions" = no
375 then
376 CPPFLAGS="$CPPFLAGS -DNDEBUG"
377 else
378 CF_ADD_ADAFLAGS(-gnata)
379 fi
380fi
381
382### use option --disable-leaks to suppress "permanent" leaks, for testing
383AC_DEFINE(HAVE_NC_ALLOC_H,1,[Define to 1 if we have nc_alloc.h header])
384
385### use option --enable-expanded to generate certain macros as functions
386AC_ARG_ENABLE(expanded,
387 [ --enable-expanded test: generate functions for certain macros],
388 [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED,1,[Define to 1 if ncurses macros should be expanded as functions])])
389
390### use option --disable-macros to suppress macros in favor of functions
391AC_ARG_ENABLE(macros,
392 [ --disable-macros test: use functions rather than macros],
393 [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS,1,[Define to 1 if ncurses macros should be expanded as functions])])
394
395# Normally we only add trace() to the debug-library. Allow this to be
396# extended to all models of the ncurses library:
397cf_all_traces=no
398case "$CFLAGS $CPPFLAGS" in
399(*-DTRACE*)
400 cf_all_traces=yes
401 ;;
402esac
403
404AC_MSG_CHECKING(whether to add trace feature to all models)
405AC_ARG_WITH(trace,
406[ --with-trace test: add trace() function to all models of ncurses],
407[cf_with_trace=$withval],
408[cf_with_trace=$cf_all_traces])
409AC_MSG_RESULT($cf_with_trace)
410
411if test "$cf_with_trace" = yes ; then
412 ADA_TRACE=TRUE
413 CF_ADD_CFLAGS(-DTRACE)
414else
415 ADA_TRACE=FALSE
416fi
417
418AC_SUBST(ADA_TRACE)
419
420CF_DISABLE_GNAT_PROJECTS
421
422### Checks for libraries.
423case $cf_cv_system_name in
424(*mingw32*)
micky3879b9f5e72025-07-08 18:04:53 -0400425 CF_CHECK_LIBSSP
Steve Kondikae271bc2015-11-15 02:50:53 +0100426 ;;
427(*)
micky3879b9f5e72025-07-08 18:04:53 -0400428 CF_FUNC_GETTIME
Steve Kondikae271bc2015-11-15 02:50:53 +0100429 ;;
430esac
431
432### Checks for header files.
micky3879b9f5e72025-07-08 18:04:53 -0400433AC_CHECK_SIZEOF([signed char])
Steve Kondikae271bc2015-11-15 02:50:53 +0100434AC_HEADER_DIRENT
435AC_HEADER_TIME
436
437### checks for compiler characteristics
438AC_LANG_C
439AC_C_CONST
440
441### Checks for external-data
442CF_LINK_DATAONLY
443
444### Checks for library functions.
445CF_MKSTEMP
446
447dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
448if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
449 CF_STRIP_G_OPT(CFLAGS)
450 CF_STRIP_G_OPT(CXXFLAGS)
451fi
452
453CF_HELP_MESSAGE(Ada95 Binding Options:)
454cf_with_ada=yes
455dnl Check for availability of GNU Ada Translator (GNAT).
456dnl At the moment we support no other Ada95 compiler.
457if test "$cf_with_ada" != "no" ; then
458 CF_PROG_GNAT
459 if test "$cf_cv_prog_gnat_correct" = yes; then
460 CF_FIXUP_ADAFLAGS
461
462 CF_GNATPREP_OPT_T
463
464 CF_GNAT_GENERICS
465 CF_GNAT_SIGINT
466 CF_GNAT_PROJECTS
467
468 CF_WITH_ADA_COMPILER
469
470 cf_ada_package=terminal_interface
471 AC_SUBST(cf_ada_package)
472
473 CF_WITH_ADA_INCLUDE
474 CF_WITH_ADA_OBJECTS
475 CF_WITH_ADA_SHAREDLIB
micky3879b9f5e72025-07-08 18:04:53 -0400476
477 # allow the Ada binding to be renamed
478 CF_WITH_ADA_LIBNAME(AdaCurses)
Steve Kondikae271bc2015-11-15 02:50:53 +0100479 else
480 AC_MSG_ERROR(No usable Ada compiler found)
481 fi
482else
483 AC_MSG_ERROR(The Ada compiler is needed for this package)
484fi
485
486################################################################################
487
488# not needed
489TINFO_LDFLAGS2=
490AC_SUBST(TINFO_LDFLAGS2)
491TINFO_LIBS=
492AC_SUBST(TINFO_LIBS)
493
494### Construct the list of include-directories to be generated
495CF_INCLUDE_DIRS
496CF_ADA_INCLUDE_DIRS
497
498### Build up pieces for makefile rules
499AC_MSG_CHECKING(default library suffix)
500CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
501AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
502AC_MSG_RESULT($DFT_ARG_SUFFIX)
503
504AC_MSG_CHECKING(default library-dependency suffix)
505CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_LIB_SUFFIX,DFT_DEP_SUFFIX)dnl
506AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
507AC_MSG_RESULT($DFT_DEP_SUFFIX)
508
509AC_MSG_CHECKING(default object directory)
510CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
511AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
512AC_MSG_RESULT($DFT_OBJ_SUBDIR)
513
514### Set up low-level terminfo dependencies for makefiles.
515
516if test "$DFT_LWR_MODEL" = shared ; then
517 case $cf_cv_system_name in
518 (cygwin*)
519 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
520 ;;
521 (msys*)
522 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
523 ;;
524 esac
525fi
526
micky3879b9f5e72025-07-08 18:04:53 -0400527USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
528AC_SUBST(USE_ARG_SUFFIX)
529
530USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
531AC_SUBST(USE_LIB_SUFFIX)
532
Steve Kondikae271bc2015-11-15 02:50:53 +0100533USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
534AC_SUBST(USE_CFG_SUFFIX)
535
536### Construct the list of subdirectories for which we'll customize makefiles
537### with the appropriate compile-rules.
538
539SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
540
541AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR',[Define to override ':' as the library path-separator])
542
Steve Kondikae271bc2015-11-15 02:50:53 +0100543################################################################################
544
545TEST_ARG2=
546AC_SUBST(TEST_ARG2)
547
548TEST_LIBS2=
549AC_SUBST(TEST_LIBS2)
550
551dnl for separate build, this is good enough for "sh $(top_srcdir)/misc/shlib"
552NCURSES_SHLIB2="sh -c"
553AC_SUBST(NCURSES_SHLIB2)
554
555ADA_SUBDIRS="include gen src doc"
556if test "x$cf_with_tests" != "xno" ; then
557 ADA_SUBDIRS="$ADA_SUBDIRS samples"
558fi
559for cf_dir in $ADA_SUBDIRS
560do
561 SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
562done
563AC_SUBST(ADA_SUBDIRS)
564
565NCURSES_TREE="#"
566AC_SUBST(NCURSES_TREE)
567
568EXTERNAL_TREE=
569AC_SUBST(EXTERNAL_TREE)
570
571# match layout used by make-tar.sh
572ADAHTML_DIR=../doc/ada
573AC_SUBST(ADAHTML_DIR)
574
micky3879b9f5e72025-07-08 18:04:53 -0400575if test "x$cross_compiling" = xyes ; then
576 ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
577else
578 ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
579fi
580
581AC_SUBST(ADAGEN_LDFLAGS)
582
Steve Kondikae271bc2015-11-15 02:50:53 +0100583AC_OUTPUT( \
584 $SUB_MAKEFILES \
micky3879b9f5e72025-07-08 18:04:53 -0400585 src/library.gpr:src/library.gpr.in \
Steve Kondikae271bc2015-11-15 02:50:53 +0100586 doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in \
587 Makefile,[
micky3879b9f5e72025-07-08 18:04:53 -0400588$AWK -v PACKAGE=$PACKAGE -f $srcdir/mk-pkg.awk </dev/null >> Makefile
Steve Kondikae271bc2015-11-15 02:50:53 +0100589if test -z "$USE_OLD_MAKERULES" ; then
590 $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
591fi
592],[
593### Special initialization commands, used to pass information from the
594### configuration-run into config.status
595
596AWK="$AWK"
597DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
598DFT_LWR_MODEL="$DFT_LWR_MODEL"
599LIB_NAME="$LIB_NAME"
600LIB_PREFIX="$LIB_PREFIX"
601LIB_SUFFIX="$LIB_SUFFIX"
602LN_S="$LN_S"
603NCURSES_MAJOR="$NCURSES_MAJOR"
604NCURSES_MINOR="$NCURSES_MINOR"
605NCURSES_PATCH="$NCURSES_PATCH"
micky3879b9f5e72025-07-08 18:04:53 -0400606PACKAGE="$PACKAGE"
Steve Kondikae271bc2015-11-15 02:50:53 +0100607USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
micky3879b9f5e72025-07-08 18:04:53 -0400608cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
609cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
Steve Kondikae271bc2015-11-15 02:50:53 +0100610cf_cv_abi_version="$cf_cv_abi_version"
611cf_cv_rel_version="$cf_cv_rel_version"
612cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
613cf_cv_shared_soname='$cf_cv_shared_soname'
614cf_cv_shlib_version="$cf_cv_shlib_version"
615cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
616cf_cv_system_name="$cf_cv_system_name"
617host="$host"
618target="$target"
619
620],cat)dnl
621${MAKE:-make} preinstall