-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·695 lines (617 loc) · 22.7 KB
/
configure
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
#!/bin/sh
cd $(dirname "$0") || exit 1
. package/info
usage () {
cat <<EOF
Usage: $0 [OPTION]... [TARGET]
Defaults for the options are specified in brackets.
System types:
--target=TARGET configure to run on target TARGET [detected]
--host=TARGET same as --target
Installation directories:
--prefix=PREFIX main installation prefix [/]
--exec-prefix=EPREFIX installation prefix for executable files [PREFIX]
Fine tuning of the installation directories:
--dynlibdir=DIR shared library files [PREFIX/lib]
--bindir=BINDIR user executables [EPREFIX/bin]
--libexecdir=DIR package-scoped executables [EPREFIX/libexec]
--libdir=DIR static library files [PREFIX/lib/66]
--includedir=DIR C header files [PREFIX/include]
--sysconfdir=SYSDIR global configuration files [/etc]
--datarootdir=DATAROOTDIR read-only architecture-independent data root [PREFIX/share]
--mandir=DIR man documentation [$datarootdir/man]
--shebangdir=DIR absolute path for execline #\! invocations [BINDIR]
--livedir=DIR default live directory [/run/66]
--max-service=NUMBER default maximum number of services handled by s6-svscan [500]
--max-path-size=KB default maximum size of a path[1024KB]
--max-service-size=KB default maximum size of a frontend service name[256KB]
--max-tree-name-size=KB default maximum size of a tree name[256KB]
--with-default-tree-name=NAME name of the default tree [global]
--with-skeleton=DIR skeleton files directory installation [SYSDIR/66]
--with-system-log=DIR system service log directory [/var/log/66]
--with-s6-log-user=USER user for running s6-log program [root]
--with-s6-log-timestamp=FORMAT default timestamp for s6-log program [tai]
--disable-s6-log-notification disable s6-log notification [enabled]
--with-system-dir=DIR 66 tools system working directory [/var/lib/66]
--with-system-service=DIR system service frontend directory [DATAROOTDIR/66/service]
--with-system-script=DIR system script directory [DATAROOTDIR/66/script]
--with-system-seed=DIR system trees default configuration [DATAROOTDIR/66/seed]
--with-sysadmin-service=DIR sysadmin service frontend directory [SYSDIR/66/service]
--with-sysadmin-service-conf=DIR sysadmin service configuration file directory [SYSDIR/66/conf]
--with-sysadmin-seed=DIR sysadmin trees default configuration [SYSDIR/66/seed]
--with-sysadmin-environment=DIR sysadmin environment directory [SYSDIR/66/environment]
--with-user-dir=DIR 66 tools user working directory [.66]
--with-user-log=DIR user service log directory [.66/log]
--with-user-service=DIR user service directory [.66/service]
--with-user-service-conf=DIR user service configuration directory [.66/conf]
--with-user-script=DIR user script directory [.66/script]
--with-user-seed=DIR user trees default configuration [.66/seed]
--with-user-environment=DIR user environment directory [.66/environment]
Do not set an absolute path but a \$HOME relative path for --with-user-dir,
--with-user-log, --with-user-service, --with-user-service-conf, --with-user-script
and --with-user-seed.
The \$HOME prefix will be appened at the pathname automatically in function of the user.
For example , by default the final path for --with-user-dir will be \$HOME/.66.
--with-system-service and --with-sysadmin-service directory must be two differents path.
For example do not set --with-sysadmin-service=/etc/66/service/sysadmin with system service
--with-system-service=/etc/66/service.
Valid FORMAT for --with-s6-log-timestamp are tai,iso,none.
--max-path-size correspond to the maximum size of the path of per specified options for the
configuration installation. Each --with-*-*=DIR can not exceed --max-path-size=. Also, please
consider to incorporate the size of the $HOME path.
--max-service-size= correspond to the maximum size of a frontend service name. Note: an
initiated service name can not exceed this size. For a frontend file with name foo@, the final name
of the runtime service (e.g. foo@bar) can not exceed --max-service-size=.
Dependencies:
--with-sysdeps=DIR use sysdeps in DIR [PREFIX/lib/skalibs/sysdeps]
--with-include=DIR add DIR to the list of searched directories for headers
--with-lib=DIR add DIR to the list of searched directories for static libraries
--with-dynlib=DIR add DIR to the list of searched directories for shared libraries
Optional features:
--enable-shared build shared libraries [disabled]
--disable-static do not build static libraries [enabled]
--disable-allstatic do not prefer linking against static libraries [enabled]
--enable-static-libc make entirely static binaries [disabled]
--disable-all-pic do not build static libraries as PIC [enabled]
If no --prefix option is given, by default sysdeps will be fetched from
/usr/lib/skalibs/sysdeps.
EOF
exit 0
}
# Helper functions
# If your system does not have printf, you can comment this, but it is
# generally not a good idea to use echo.
# See http://www.etalabs.net/sh_tricks.html
echo () {
IFS=" "
printf %s\\n "$*"
}
quote () {
tr '\n' ' ' <<EOF | grep '^[-[:alnum:]_=,./:]* $' >/dev/null 2>&1 && { echo "$1" ; return 0 ; }
$1
EOF
echo "$1" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/'/" -e "s#^'\([-[:alnum:]_,./:]*\)=\(.*\)\$#\1='\2#" -e "s|\*/|* /|g"
}
fail () {
echo "$*"
exit 1
}
fnmatch () {
eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac"
}
cmdexists () {
type "$1" >/dev/null 2>&1
}
trycc () {
test -z "$CC_AUTO" && cmdexists "$1" && CC_AUTO="$*"
}
stripdir () {
while eval "fnmatch '*/' \"\${$1}\"" ; do
eval "$1=\${$1%/}"
done
}
tryflag () {
echo "Checking whether compiler accepts $2 ..."
echo "typedef int x;" > "$tmpc"
if $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST "$2" -c -o "$tmpo" "$tmpc" >/dev/null 2>&1 ; then
echo " ... yes"
eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }"
return 0
else
echo " ... no"
return 1
fi
}
tryldflag () {
echo "Checking whether linker accepts $2 ..."
echo "typedef int x;" > "$tmpc"
if $CC_AUTO $CFLAGS_AUTO $CFLAGS $CFLAGS_POST $LDFLAGS_AUTO $LDFLAGS $LDFLAGS_POST -nostdlib "$2" -o "$tmpe" "$tmpc" >/dev/null 2>&1 ; then
echo " ... yes"
eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }"
return 0
else
echo " ... no"
return 1
fi
}
# Actual script
CC_AUTO=
CPPFLAGS_AUTO="-D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -D_GNU_SOURCE -iquote src/include-local -Isrc/include"
CPPFLAGS_POST="$CPPFLAGS"
CPPFLAGS=
CFLAGS_AUTO="-pipe -Wall"
CFLAGS_POST="$CFLAGS"
CFLAGS=-O2
LDFLAGS_AUTO=
LDFLAGS_POST="$LDFLAGS"
LDFLAGS=
LDFLAGS_NOSHARED=
LDFLAGS_SHARED=-shared
prefix=
exec_prefix='$prefix'
dynlibdir='$prefix/lib'
libexecdir='$exec_prefix/libexec'
bindir='$exec_prefix/bin'
libdir='$prefix/lib/$package'
includedir='$prefix/include'
sysconfdir='/etc'
datarootdir='$prefix/share'
mandir='$datarootdir/man'
shebangdir='$bindir'
livedir='/run/66'
max_service='500'
max_path='1024'
max_service_size='256'
max_treename='256'
default_treename='global'
skel='$sysconfdir/66'
system_dir='/var/lib/66'
system_log='/var/log/66'
s6log_user='root'
s6log_timestamp='tai'
s6log_notify=false
service_system='$datarootdir/66/service'
script_system='$datarootdir/66/script'
seed_system='$datarootdir/66/seed'
service_adm='$sysconfdir/66/service'
service_admconf='$sysconfdir/66/conf'
seed_adm='$sysconfdir/66/seed'
environment_adm='$sysconfdir/66/environment'
user_dir='.66'
service_user='.66/service'
script_user='.66/script'
service_userconf='.66/conf'
user_log='.66/log'
seed_user='.66/seed'
environment_user='.66/environment'
sysdeps='$prefix/lib/skalibs/sysdeps'
manualsysdeps=false
shared=false
static=true
allpic=true
allstatic=true
evenmorestatic=false
addincpath=''
addlibspath=''
addlibdpath=''
vpaths=''
vpathd=''
build=
for arg ; do
case "$arg" in
--help) usage ;;
--prefix=*) prefix=${arg#*=} ;;
--exec-prefix=*) exec_prefix=${arg#*=} ;;
--dynlibdir=*) dynlibdir=${arg#*=} ;;
--libexecdir=*) libexecdir=${arg#*=} ;;
--bindir=*) bindir=${arg#*=} ;;
--libdir=*) libdir=${arg#*=} ;;
--includedir=*) includedir=${arg#*=} ;;
--sysconfdir=*) sysconfdir=${arg#*=} ;;
--datarootdir=*) datarootdir=${arg#*=} ;;
--mandir=*) mandir=${arg#*=} ;;
--shebangdir=*) shebangdir=${arg#*=} ;;
--livedir=*) livedir=${arg#*=} ;;
--max-service=*) max_service=${arg#*=} ;;
--max-path-size=*) max_path=${arg#*=} ;;
--max-service-size=*) max_service_size=${arg#*=} ;;
--max-tree-name-size=*) max_treename=${arg#*=} ;;
--with-default-tree-name=*) default_treename=${arg#*=} ;;
--with-skeleton=*) skel=${arg#*=} ;;
--with-system-dir=*) system_dir=${arg#*=} ;;
--with-system-log=*) system_log=${arg#*=} ;;
--with-s6-log-user=*) s6log_user=${arg#*=} ;;
--with-s6-log-timestamp=*) s6log_timestamp=${arg#*=} ;;
--disable-s6-log-notification) s6log_notify=true ;;
--with-system-service=*) service_system=${arg#*=} ;;
--with-system-script=*) script_system=${arg#*=} ;;
--with-system-seed=*) seed_system=${arg#*=} ;;
--with-sysadmin-service=*) service_adm=${arg#*=} ;;
--with-sysadmin-service-conf=*) service_admconf=${arg#*=} ;;
--with-sysadmin-seed=*) seed_adm=${arg#*=} ;;
--with-sysadmin-environment=*) environment_adm=${arg#*=} ;;
--with-user-dir=*) user_dir=${arg#*=} ;;
--with-user-service=*) service_user=${arg#*=} ;;
--with-user-script=*) script_user=${arg#*=} ;;
--with-user-service-conf=*) service_userconf=${arg#*=} ;;
--with-user-log=*) user_log=${arg#*=} ;;
--with-user-seed=*) seed_user=${arg#*=} ;;
--with-user-environment=*) environment_user=${arg#*=} ;;
--with-sysdeps=*) sysdeps=${arg#*=} manualsysdeps=true ;;
--with-include=*) var=${arg#*=} ; stripdir var ; addincpath="$addincpath -I$var" ;;
--with-lib=*) var=${arg#*=} ; stripdir var ; addlibspath="$addlibspath -L$var" ; vpaths="$vpaths $var" ;;
--with-dynlib=*) var=${arg#*=} ; stripdir var ; addlibdpath="$addlibdpath -L$var" ; vpathd="$vpathd $var" ;;
--enable-shared|--enable-shared=yes) shared=true ;;
--disable-shared|--enable-shared=no) shared=false ;;
--enable-static|--enable-static=yes) static=true ;;
--disable-static|--enable-static=no) static=false ;;
--enable-allstatic|--enable-allstatic=yes) allstatic=true ;;
--disable-allstatic|--enable-allstatic=no) allstatic=false ; evenmorestatic=false ;;
--enable-static-libc|--enable-static-libc=yes) allstatic=true ; evenmorestatic=true ;;
--disable-static-libc|--enable-static-libc=no) evenmorestatic=false ;;
--enable-all-pic|--enable-all-pic=yes) allpic=true ;;
--disable-all-pic|--enable-all-pic=no) allpic=false ;;
--enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;;
--host=*|--target=*) target=${arg#*=} ;;
--build=*) build=${arg#*=} ;;
-* ) echo "$0: unknown option $arg" ;;
*=*) ;;
*) target=$arg ;;
esac
done
# Add /usr in the default default case
if test -z "$prefix" ; then
if test "$libdir" = '$prefix/lib/$package' ; then
libdir=/usr/lib/$package
fi
if test "$includedir" = '$prefix/include' ; then
includedir=/usr/include
fi
if test "$sysdeps" = '$prefix/lib/skalibs/sysdeps' ; then
sysdeps=/usr/lib/skalibs/sysdeps
fi
if test "$datarootdir" = '$prefix/share'; then
datarootdir=/usr/share
fi
fi
# Add /etc/66 in the default case
if test -z "$sysconfdir" ; then
if test "$service_adm" = '$sysconfdir/66/service' ; then
service_adm='$sysconfdir/66/service'
fi
if test "$service_admconf" = '$sysconfdir/66/conf' ; then
service_admconf='$sysconfdir/66/conf'
fi
if test "$skel" = '$sysconfdir/66' ; then
skel='$sysconfdir/66'
fi
if test "$seed_adm" = '$sysconfdir/66/seed' ; then
seed_adm='$sysconfdir/66/seed'
fi
if test "$environment_adm" = '$sysconfdir/66/environment' ; then
environment_adm='$sysconfdir/66/environment'
fi
fi
# Expand installation directories
stripdir prefix
for i in exec_prefix dynlibdir libexecdir bindir libdir includedir sysconfdir \
datarootdir mandir shebangdir livedir skel system_dir system_log \
service_system script_system service_adm service_admconf sysdeps ; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
stripdir datarootdir
for i in service_system script_system seed_system mandir; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
stripdir sysconfdir
for i in service_adm service_admconf seed_adm environment_adm skel; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
# check valid s6-log timestamp
if [ $s6log_timestamp = "tai" ]; then
s6log_timestamp='0'
elif [ $s6log_timestamp = "iso" ]; then
s6log_timestamp='1'
elif [ $s6log_timestamp = "none" ]; then
s6log_timestamp='2'
else
fail "$0: invalid --with-s6-log-timestamp value -- valid value are: tai, iso or none"
fi
# check valid integer
for i in $max_service $max_path $max_service_size $max_treename; do
case $i in
''|*[!0-9]*) fail "$0: invalid number for $i" ;;
*) break ;;
esac
done
if [ $max_service -lt 2 ]; then
fail "$0: lower limit for --max-service is 2"
fi
if [ $max_path -lt 2 ]; then
fail "$0: lower limit for --max-path-size is 2"
fi
if [ $max_service_size -lt 2 ]; then
fail "$0: lower limit for --max-service-size is 2"
fi
if [ $max_treename -lt 2 ]; then
fail "$0: lower limit for --max-tree-name-size is 2"
fi
if [ ${#default_treename} -gt $max_treename ]; then
fail "$0: maximum length of --with-default-tree-name is $max_treename"
fi
for i in $skel $system_dir $system_log $service_system $script_system \
$seed_system $service_adm $service_admconf $seed_adm $environment_adm $user_dir $service_user \
$script_user $service_userconf $user_log $seed_user $environment_user; do
if [ ${#i} -ge $max_path ]; then
fail "$0: higher length for $i is $max_path"
fi
done
## logger notification
if $s6log_notify; then
s6log_notify='0'
else
s6log_notify='1'
fi
# Get usable temp filenames
i=0
set -C
while : ; do
i=$((i+1))
tmpc="./tmp-configure-$$-$PPID-$i.c"
tmpo="./tmp-configure-$$-$PPID-$i.o"
tmpe="./tmp-configure-$$-$PPID-$i.tmp"
2>|/dev/null > "$tmpc" && break
2>|/dev/null > "$tmpo" && break
2>|/dev/null > "$tmpe" && break
test "$i" -gt 50 && fail "$0: cannot create temporary files"
done
set +C
trap 'rm -f "$tmpc" "$tmpo" "$tmpe"' EXIT ABRT INT QUIT TERM HUP
# Find a C compiler to use
if test -n "$target" && test x${build} != x${target} ; then
cross=${target}-
else
cross=
fi
echo "Checking for C compiler..."
trycc ${CC}
if test -n "$CC_AUTO" ; then
b=$(basename "$CC")
adjust_cross=false
if test "$b" != "$CC" ; then
adjust_cross=true
echo "$0: warning: compiler $CC is declared with its own path. If it's not accessible via PATH, you will need to pass AR, RANLIB and STRIP make variables to the make invocation." 1>&2
fi
if test -n "$cross" ; then
if test "$b" = "${b##$cross}" ; then
echo "$0: warning: compiler $CC is declared as a cross-compiler for target $target but does not start with prefix ${cross}" 1>&2
elif $adjust_cross ; then
cross=$(dirname "$CC")/"$cross"
fi
fi
fi
trycc ${cross}gcc
trycc ${cross}clang
trycc ${cross}cc
test -n "$CC_AUTO" || { echo "$0: cannot find a C compiler" ; exit 1 ; }
echo " ... $CC_AUTO"
echo "Checking whether C compiler works... "
echo "typedef int x;" > "$tmpc"
if $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST -c -o "$tmpo" "$tmpc" 2>"$tmpe" ; then
echo " ... yes"
else
echo " ... no. Compiler output follows:"
cat < "$tmpe"
exit 1
fi
echo "Checking target system type..."
if test -z "$target" ; then
if test -n "$build" ; then
target=$build ;
else
target=$($CC_AUTO -dumpmachine 2>/dev/null) || target=unknown
fi
fi
echo " ... $target"
if test ! -d $sysdeps || test ! -f $sysdeps/target ; then
echo "$0: error: $sysdeps is not a valid sysdeps directory"
exit 1
fi
if [ "x$target" != "x$(cat $sysdeps/target)" ] ; then
echo "$0: error: target $target does not match the contents of $sysdeps/target"
exit 1
fi
spawn_lib=$(cat $sysdeps/spawn.lib)
socket_lib=$(cat $sysdeps/socket.lib)
sysclock_lib=$(cat $sysdeps/sysclock.lib)
timer_lib=$(cat $sysdeps/timer.lib)
util_lib=$(cat $sysdeps/util.lib)
if $allpic ; then
tryflag CPPFLAGS_AUTO -fPIC
fi
tryflag CFLAGS_AUTO -std=c99
tryflag CFLAGS -fomit-frame-pointer
tryflag CFLAGS_AUTO -fno-exceptions
tryflag CFLAGS_AUTO -fno-unwind-tables
tryflag CFLAGS_AUTO -fno-asynchronous-unwind-tables
tryflag CPPFLAGS_AUTO -Werror=implicit-function-declaration
tryflag CPPFLAGS_AUTO -Werror=implicit-int
tryflag CPPFLAGS_AUTO -Werror=pointer-sign
tryflag CPPFLAGS_AUTO -Werror=pointer-arith
tryflag CPPFLAGS_AUTO -Wno-unused-value
tryflag CPPFLAGS_AUTO -Wno-parentheses
tryflag CFLAGS_AUTO -ffunction-sections
tryflag CFLAGS_AUTO -fdata-sections
tryldflag LDFLAGS_AUTO -Wl,--as-needed
tryldflag LDFLAGS_AUTO -Wl,--sort-section=alignment
tryldflag LDFLAGS_AUTO -Wl,--sort-common
CPPFLAGS_AUTO="${CPPFLAGS_AUTO}${addincpath}"
if $evenmorestatic ; then
LDFLAGS_NOSHARED=-static
fi
if $shared ; then
tryldflag LDFLAGS -Wl,--hash-style=both
fi
LDFLAGS_SHARED="${LDFLAGS_SHARED}${addlibdpath}"
if $allstatic ; then
LDFLAGS_NOSHARED="${LDFLAGS_NOSHARED}${addlibspath}"
tryldflag LDFLAGS_NOSHARED -Wl,--gc-sections
else
LDFLAGS_NOSHARED="${LDFLAGS_NOSHARED}${addlibdpath}"
fi
if test -z "$vpaths" ; then
while read dep ; do
base=$(basename $dep)
vpaths="$vpaths /usr/lib/$base"
addlibspath="$addlibspath -L/usr/lib/$base"
done < package/deps-build
fi
echo "Creating config.mak..."
cmdline=$(quote "$0")
for i ; do cmdline="$cmdline $(quote "$i")" ; done
exec 3>&1 1>config.mak
cat << EOF
# This file was generated by:
# $cmdline
# Any changes made here will be lost if configure is re-run.
target := $target
package := $package
prefix := $prefix
exec_prefix := $exec_prefix
dynlibdir := $dynlibdir
libexecdir := $libexecdir
bindir := $bindir
libdir := $libdir
includedir := $includedir
sysconfdir := $sysconfdir
shebangdir := $shebangdir
datarootdir := $datarootdir
mandir := $mandir
livedir := $livedir
max_service := $max_service
max_path := $max_path
max_service_size := $max_service_size
max_treename := $max_treename
default_treename := $default_treename
skel := $skel
system_dir := $system_dir
system_log := $system_log
s6log_user := $s6log_user
s6log_timestamp := $s6log_timestamp
s6log_notify := $s6log_notify
service_system := $service_system
script_system := $script_system
seed_system := $seed_system
service_adm := $service_adm
service_admconf := $service_admconf
seed_adm := $seed_adm
environment_adm := $environment_adm
user_dir := $user_dir
service_user := $service_user
script_user := $script_user
service_userconf := $service_userconf
user_log := $user_log
seed_user := $seed_user
environment_user := $environment_user
sysdeps := $sysdeps
version := $version
SPAWN_LIB := ${spawn_lib}
SOCKET_LIB := ${socket_lib}
SYSCLOCK_LIB := ${sysclock_lib}
TIMER_LIB := ${timer_lib}
UTIL_LIB := ${util_lib}
CC := $CC_AUTO
CPPFLAGS_AUTO := $CPPFLAGS_AUTO
CPPFLAGS := $CPPFLAGS $CPPFLAGS_POST
CFLAGS_AUTO := $CFLAGS_AUTO
CFLAGS := $CFLAGS $CFLAGS_POST
LDFLAGS_AUTO := $LDFLAGS_AUTO
LDFLAGS := $LDFLAGS $LDFLAGS_POST
LDFLAGS_SHARED := $LDFLAGS_SHARED
LDFLAGS_NOSHARED := $LDFLAGS_NOSHARED
CROSS_COMPILE := $cross
vpath lib%.a$vpaths
vpath lib%.so$vpathd
EOF
if $allstatic ; then
echo ".LIBPATTERNS := lib%.a"
echo "DO_ALLSTATIC := 1"
else
echo ".LIBPATTERNS := lib%.so"
fi
if $static ; then
echo "DO_STATIC := 1"
else
echo "DO_STATIC :="
fi
if $shared ; then
echo "DO_SHARED := 1"
else
echo "DO_SHARED :="
fi
if $allpic ; then
echo "STATIC_LIBS_ARE_PIC := 1"
else
echo "STATIC_LIBS_ARE_PIC :="
fi
exec 1>&3 3>&-
echo " ... done."
echo "Creating src/include/${package}/config.h..."
mkdir -p -m 0755 src/include/${package}
exec 3>&1 1> src/include/${package}/config.h
cat <<EOF
/* Copyright (c) 2018-2024 Eric Vidal <[email protected]>
All rights reserved.*/
/* ISC license. */
/* Generated by: $cmdline */
#ifndef ${package_macro_name}_CONFIG_H
#define ${package_macro_name}_CONFIG_H
#define ${package_macro_name}_VERSION "$version"
#define ${package_macro_name}_LIVE "$livedir/"
#define ${package_macro_name}_MAX_SERVICE $max_service
#define ${package_macro_name}_MAX_PATH $max_path
#define ${package_macro_name}_MAX_SERVICE_NAME $max_service_size
#define ${package_macro_name}_MAX_TREENAME $max_treename
#define ${package_macro_name}_DEFAULT_TREENAME "$default_treename"
#define ${package_macro_name}_SYSTEM_DIR "$system_dir/"
#define ${package_macro_name}_SKEL_DIR "$skel/"
#define ${package_macro_name}_LOGGER_SYSDIR "$system_log/"
#define ${package_macro_name}_LOGGER_RUNNER "$s6log_user"
#define ${package_macro_name}_LOGGER_TIMESTAMP $s6log_timestamp
#define ${package_macro_name}_LOGGER_NOTIFY $s6log_notify
#define ${package_macro_name}_SERVICE_SYSDIR "$service_system/"
#define ${package_macro_name}_SERVICE_SYSDIR_USER "$service_system/user/"
#define ${package_macro_name}_SERVICE_ADMDIR "$service_adm/"
#define ${package_macro_name}_SERVICE_ADMDIR_USER "$service_adm/user/"
#define ${package_macro_name}_SERVICE_ADMCONFDIR "$service_admconf/"
#define ${package_macro_name}_SCRIPT_SYSDIR "$script_system/"
#define ${package_macro_name}_SEED_SYSDIR "$seed_system/"
#define ${package_macro_name}_SEED_ADMDIR "$seed_adm/"
#define ${package_macro_name}_ENVIRONMENT_ADMDIR "$environment_adm/"
/** Do not use absolute path but a \$HOME relative path
* The /home/<user> prefix will be automatically added to the pathname */
#define ${package_macro_name}_USER_DIR "$user_dir/"
#define ${package_macro_name}_LOGGER_USERDIR "$user_log/"
#define ${package_macro_name}_SERVICE_USERDIR "$service_user/"
#define ${package_macro_name}_SERVICE_USERCONFDIR "$service_userconf/"
#define ${package_macro_name}_SCRIPT_USERDIR "$script_user/"
#define ${package_macro_name}_SEED_USERDIR "$seed_user/"
#define ${package_macro_name}_ENVIRONMENT_USERDIR "$environment_user/"
EOF
echo "#define ${package_macro_name}_BINPREFIX \"\""
echo "#define ${package_macro_name}_EXTBINPREFIX \"\""
echo "#define ${package_macro_name}_EXTLIBEXECPREFIX \"$libexecdir/\""
echo "#define ${package_macro_name}_LIBEXECPREFIX \"$libexecdir/\""
echo "#define ${package_macro_name}_EXECLINE_SHEBANGPREFIX \"$shebangdir/\""
echo
echo "#endif"
exec 1>&3 3>&-
echo " ... done."