forked from cosmos72/twin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
939 lines (777 loc) · 25 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
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
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#
dnl Process this file with autoconf to produce a configure script.
PACKAGE=twin
AC_REVISION($Revision: 1.4 $)
AC_INIT(server/main.c)
AC_CONFIG_HEADER(include/autoconf.h)
AC_CONFIG_AUX_DIR(admin)
dnl shared libraries
AC_ARG_ENABLE(-shlibs,dnl
[ --enable--shlibs[=yes|no] enable building shared libraries ],,
enable__shlibs=yes
)dnl
dnl shared modules
AC_ARG_ENABLE(-modules,dnl
[ --enable--modules[=yes|no] enable building shared modules ],,
enable__modules=yes
)dnl
dnl unicode support
AC_ARG_ENABLE(-unicode,dnl
[ --enable--unicode[=yes|no] enable building unicode-aware code ],,
enable__unicode=yes
)dnl
dnl custom malloc/free
AC_ARG_ENABLE(-alloc,dnl
[ --enable--alloc[=yes|no] enable custom malloc/free routines ],,
enable__alloc=yes
)dnl
dnl C type "long long" support (if available on your compiler)
AC_ARG_ENABLE(-long-long,dnl
[ --enable--long-long[=yes|no] enable using long long C type if supported ],,
enable__long_long=no
)dnl
dnl hand-optimized assembler (if available for your platform)
AC_ARG_ENABLE(-asm,dnl
[ --enable--asm[=yes|no] enable hand-optimized assembler if supported ],,
enable__asm=yes
)dnl
dnl socket server
AC_ARG_ENABLE(socket,dnl
[ --enable-socket[=yes|no] enable remote socket connections (libTw) ],,
enable_socket=mod
)dnl
dnl socket compression
AC_ARG_ENABLE(socket_gz,dnl
[ --enable-socket-gz[=yes|no] enable gzip compression on sockets ],,
enable_socket_gz=yes
)dnl
dnl thread safe libTw
AC_ARG_ENABLE(socket_pthreads,dnl
[ --enable-socket-pthreads[=yes|no] enable thread safe libraries (requires pthread) ],,
enable_socket_pthreads=yes
)dnl
dnl support alien architectures
AC_ARG_ENABLE(socket_alien,dnl
[ --enable-socket-alien[=yes|no] enable support for non-native architectures ],,
enable_socket_alien=yes
)dnl
dnl support Text Toolkit library
AC_ARG_ENABLE(tt,dnl
[ --enable-tt[=yes|no] enable Text Toolkit library (libTT) ],,
enable_tt=no
)dnl
dnl Toolkit library: use twin (libTw) as display driver
AC_ARG_ENABLE(tt_hw_twin,dnl
[ --enable-tt-hw-twin[=yes|mod|no] enable libTT to use twin (libTw) as display target ],,
enable_tt_hw_twin=mod
)dnl
dnl Toolkit library: display on twin + server side libTT
AC_ARG_ENABLE(tt_hw_twin_tunnel,dnl
[ --enable-tt-hw-twin-tunnel[=yes|mod|no] enable libTT to use on twin + server side libTT ],,
enable_tt_hw_twin_tunnel=mod
)dnl
dnl Toolkit library: libTT loaded by twin server
AC_ARG_ENABLE(tt_hw_twin_detunnel,dnl
[ --enable-tt-hw-twin-detunnel[=yes|mod|no] enable libTT on twin server side ],,
enable_tt_hw_twin_detunnel=mod
)dnl
dnl Toolkit library: use gtk as display driver
AC_ARG_ENABLE(tt_hw_gtk,dnl
[ --enable-tt-hw-gtk[=yes|mod|no] enable libTT to use gtk as display target ],,
enable_tt_hw_gtk=mod
)dnl
dnl Toolkit library: use X11 as display driver
AC_ARG_ENABLE(tt_hw_x11,dnl
[ --enable-tt-hw-x11[=yes|mod|no] enable libTT to use X11 as display target ],,
enable_tt_hw_x11=mod
)dnl
dnl Toolkit library: use xml files as display driver
AC_ARG_ENABLE(tt_hw_xml,dnl
[ --enable-tt-hw-xml[=yes|mod|no] enable libTT to use xml files as display target ],,
enable_tt_hw_xml=mod
)dnl
dnl builtin window manager
AC_ARG_ENABLE(wm,dnl
[ --enable-wm[=yes|mod|no] enable the builtin WM (absolutely needed!) ],,
enable_wm=mod
)dnl
dnl ~/.twinrc parser
AC_ARG_ENABLE(wm_rc,dnl
[ --enable-wm-rc[=yes|mod|no] enable ~/.twinrc configuration parser ],,
enable_wm_rc=mod
)dnl
dnl use mmapped shared file for parser
AC_ARG_ENABLE(wm_rc_shmmap,dnl
[ --enable-wm-rc-shmmap[=yes|no] enable mmapped shared file for parser ],,
enable_wm_rc_shmmap=yes
)dnl
dnl shrink memory when parser finished
AC_ARG_ENABLE(wm_rc_shrink,dnl
[ --enable-wm-rc-shrink[=yes|no] enable shrinking memory when parser finished ],,
enable_wm_rc_shrink=yes
)dnl
dnl terminal emulator
AC_ARG_ENABLE(term,dnl
[ --enable-term[=yes|mod|no] enable builtin terminal emulator ],,
enable_term=mod
)dnl
dnl use /dev/pts/* for terminal emulator
AC_ARG_ENABLE(term_devpts,dnl
[ --enable-term-devpts[=yes|no] enable Unix98 /dev/pts/* pseudo-ttys ],,
enable_term_devpts=yes
)dnl
dnl store server messages in "Messages" window
AC_ARG_ENABLE(printk,dnl
[ --enable-printk[=yes|no] enable logging messages in Messages window ],,
enable_printk=yes
)dnl
dnl tty drivers
AC_ARG_ENABLE(hw-tty,dnl
[ --enable-hw-tty[=yes|mod|no] enable tty drivers ],,
enable_hw_tty=mod
)dnl
dnl the Linux console driver
AC_ARG_ENABLE(hw-tty-linux,dnl
[ --enable-hw-tty-linux[=yes|no] enable the Linux console driver (gpm mouse, /dev/vcsa)],,
enable_hw_tty_linux=yes
)dnl
dnl the twterm terminal driver
AC_ARG_ENABLE(hw-tty-twterm,dnl
[ --enable-hw-tty-twterm[=yes|no] enable the twterm terminal driver ],,
enable_hw_tty_twterm=yes
)dnl
dnl the termcap terminal driver
AC_ARG_ENABLE(hw-tty-termcap,dnl
[ --enable-hw-tty-termcap[=yes|no] enable the termcap/ncurses terminal driver ],,
enable_hw_tty_termcap=yes
)dnl
dnl the X11 driver
AC_ARG_ENABLE(hw-x11,dnl
[ --enable-hw-x11[=yes|mod|no] enable the X11 driver ],,
enable_hw_x11=mod
)dnl
dnl the gfx driver
AC_ARG_ENABLE(hw-gfx,dnl
[ --enable-hw-gfx[=yes|mod|no] enable the gfx (enhanced X11) driver ],,
enable_hw_gfx=mod
)dnl
dnl the twin driver
AC_ARG_ENABLE(hw-twin,dnl
[ --enable-hw-twin[=yes|mod|no] enable the twin native driver ],,
enable_hw_twin=mod
)dnl
dnl the twdisplay driver
AC_ARG_ENABLE(hw-display,dnl
[ --enable-hw-display[=yes|mod|no] enable the twdisplay client driver ],,
enable_hw_display=mod
)dnl
dnl the ggi driver
AC_ARG_ENABLE(hw-ggi,dnl
[ --enable-hw-ggi[=yes|mod|no] enable the ggi driver (UNFINISHED) ],,
enable_hw_ggi=mod
)dnl
dnl server extensions
AC_ARG_ENABLE(ext,dnl
[ --enable-ext[=yes|no] enable server extensions ],,
enable_ext=yes
)dnl
dnl libTT server extensions
AC_ARG_ENABLE(ext-tt,dnl
[ --enable-ext-tt[=yes|no] enable the libTT server extensions ],,
enable_ext_tt=no
)dnl
dnl
dnl Checks for programs.
dnl
AC_PROG_MAKE_SET
make_is_good=no
if test "${MAKE-make}"; then
${MAKE-make} -v | head -1 | cut -d' ' -f1-4 | cut -d, -f1 | \
while read make_GNU make_Make make_version make_numbers
do
if test "$make_GNU" = "GNU" -a "$make_Make" = "Make"; then
cat >conftestmake <<EOF
3.76.2
$make_numbers
EOF
echo `cat conftestmake | sort` | \
while read make_3_76_2 make_x_numbers
do
if test "$make_3_76_2" = "3.76.2" -a "$make_x_numbers" = "$make_numbers"; then
echo 'make_is_good=yes' > conftestmake.result
fi
break
done
fi
break
done
fi
if test -f conftestmake.result; then
eval "`cat conftestmake.result`"
fi
rm -f conftest*
if test "$make_is_good" != yes; then
AC_MSG_ERROR([GNU Make > 3.76.1 is required to compile twin
your ${MAKE-make} reported:
`${MAKE-make} -v`])
fi
AC_PROG_CC
AC_PROG_CPP
dnl AC_PROG_YACC
dnl AC_PROG_LEX
AC_PROG_INSTALL
AC_PROG_LN_S
dnl
dnl Check for os-specific settings
dnl
AC_CACHE_CHECK(for OS, ac_cv_sys_uname, [
ac_cv_sys_uname="`uname`"
])
AC_CACHE_CHECK(for shared library support, ac_cv_sys_shlibs, [
if test "$ac_cv_sys_uname" = Linux -o "$ac_cv_sys_uname" = FreeBSD; then
if test "$ac_cv_prog_gcc" = yes; then
ac_cv_sys_shlibs=native
fi
fi
])
if test "$ac_cv_sys_shlibs" = native; then
AC_MSG_RESULT([ this system is Linux/FreeBSD with GNU C
assuming GNU C internally uses GNU ld
using native rules to create shared libraries])
AC_CHECK_PROG(AR, ar, ar,)
AC_CHECK_PROG(RANLIB, ranlib, ranlib,)
lt_cv_prog_gnu_ld=yes
elif test "$ac_cv_sys_shlibs" != no; then
AC_MSG_RESULT([ this system is not Linux/FreeBSD with GNU C
trying to use libtool to create shared libraries
configuring libtool...])
#
# disable static libraries in libtool... we build them manually
#
AC_CHECK_PROG(AR, ar, ar,)
AC_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_MSG_RESULT([...libtool configured])
AC_MSG_CHECKING(for shared library support (again))
if ./libtool --features | grep 'enable shared lib' >/dev/null; then
ac_cv_sys_shlibs=libtool
else
ac_cv_sys_shlibs=no
fi
AC_MSG_RESULT([$ac_cv_sys_shlibs])
else
AC_MSG_RESULT([ cache file says this system does not support shared libraries
skipping libtool configuration])
fi
dnl
dnl Check for compiler characteristics.
dnl
AC_C_CONST
AC_CACHE_CHECK(for long long, ac_cv_type_long_long, AC_TRY_COMPILE( , [
long long a = 0x1234567812345678ll;
unsigned long long b = 0xFEDCBA0012345678ull;
b -= a;
a += b;
],
ac_cv_type_long_long=yes,
ac_cv_type_long_long=no))
AC_C_INLINE
for try_cflag in -g -p -pg -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -Wall -Wshadow \
-Wno-uninitialized -Wno-pointer-sign -Wno-unused -Wundef -Wstrict-prototypes \
-Wcast-qual -Wcast-align -Wpointer-arith -Wbad-function-cast -Waggregate-return; do
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $try_cflag"
try_cflag_id="`echo \"$try_cflag\" | tr - _`"
AC_CACHE_CHECK(for compiler flag $try_cflag, ac_cv_cflag$try_cflag_id, AC_TRY_COMPILE( [
static inline int ret0(void) {
return 0;
}
] , [
int a = ret0();
],
eval "ac_cv_cflag$try_cflag_id=yes",
eval "ac_cv_cflag$try_cflag_id=no"))
CFLAGS="$save_CFLAGS"
if test `eval echo '${'ac_cv_cflag$try_cflag_id'}'` = yes; then
eval "CC_FLAG$try_cflag_id=\"$try_cflag\""
fi
done
CC_FLAGS_DEBUG="$CC_FLAG_g $CC_FLAG_no_unused"
CC_FLAGS_PROFILE="$CC_FLAG_p $CC_FLAG_pg"
CC_FLAGS_OPT="$CC_FLAG_O2 $CC_FLAG_fomit_frame_pointer $CC_FLAG_fno_strict_aliasing"
CC_FLAGS_BASE="$CC_FLAG_Wall $CC_FLAG_Wshadow $CC_FLAG_Wno_uninitialized $CC_FLAG_Wno_pointer_sign"
CC_FLAGS_PARANOID="$CC_FLAG_Wundef $CC_FLAG_Wstrict_prototypes $CC_FLAG_Wcast_qual $CC_FLAG_Wcast_align \
$CC_FLAG_Wpointer_arith $CC_FLAG_Wbad_function_cast $CC_FLAG_Waggregate_return"
AC_SUBST(CC_FLAGS_DEBUG)
AC_SUBST(CC_FLAGS_PROFILE)
AC_SUBST(CC_FLAGS_OPT)
AC_SUBST(CC_FLAGS_BASE)
AC_SUBST(CC_FLAGS_PARANOID)
AC_CACHE_CHECK(for gcc-compatible 'static inline', ac_cv_c_static_inline, AC_TRY_COMPILE( [
static inline int ret0(void) {
return 0;
}
] , [
int a = ret0();
],
ac_cv_c_static_inline=yes,
ac_cv_c_static_inline=no))
AC_CACHE_CHECK(for gcc-compatible 'attribute((const))', ac_cv_c_attribute_const, AC_TRY_COMPILE( [
static int ret0(void) __attribute__((const));
static int ret0(void) {
return 0;
}
] , [
int a = ret0();
],
ac_cv_c_attribute_const=yes,
ac_cv_c_attribute_const=no))
AC_CACHE_CHECK(for gcc-compatible 'attribute((packed))', ac_cv_c_attribute_packed, AC_TRY_COMPILE( , [
struct sp {
int a;
char b;
} __attribute__((packed));
struct sp s[2];
],
ac_cv_c_attribute_packed=yes,
ac_cv_c_attribute_packed=no))
AC_CACHE_CHECK(for gcc-compatible i386 assembler, ac_cv_prog_gcc_i386_asm, AC_TRY_COMPILE( , [
#ifdef __i386__
asm ("\n\tmovl %eax,%eax"
"\n\tpushl %ecx"
"\n\tpushl $1"
"\n\tpopl %ecx"
"\n\tpopl %ecx");
#else
choke me
#endif
],
ac_cv_prog_gcc_i386_asm=yes,
ac_cv_prog_gcc_i386_asm=no))
dnl
dnl Checks for header files.
dnl
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(crypt.h dirent.h dlfcn.h fcntl.h gpm.h ggi/ggi.h limits.h ltdl.h memory.h \
ncurses.h ncurses/ncurses.h termcap.h ncurses/termcap.h pthread.h shadow.h \
stddef.h stdint.h stdlib.h sys/filio.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h \
sys/select.h sys/timeb.h sys/ttydefaults.h sys/types.h sys/utsname.h sys/wait.h \
asm/page.h machine/param.h termio.h termios.h unistd.h zlib.h)
dnl
dnl Checks for typedefs, and structures
dnl
dnl
dnl do not use AC_TYPE_UID_T, it seems to be bugged on Linux Debian/unstable
dnl with autoconf 2.59 + gcc 4.0.3 + libc6 2.3.6 + kernel 2.6.x.
dnl
AC_CHECK_TYPE(uid_t,int)
AC_CHECK_TYPE(gid_t,int)
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_STRUCT_TM
AC_CHECK_FILE(/dev/ptmx)
dnl
dnl Checks for library functions.
dnl
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_SETVBUF_REVERSED
dnl we never use the 'struct rusage' returned by wait3()
dnl AC_FUNC_WAIT3
AC_CHECK_FUNCS(ftime gettimeofday getspnam hstrerror initgroups lstat putenv setenv \
select strdup strerror strspn strstr scandir alphasort uname usleep \
vprintf vsprintf vsnprintf wait3 wait4 getpt grantpt unlockpt ptsname)
AC_CHECK_FUNC(crypt,,AC_CHECK_LIB(crypt,crypt))
AC_CHECK_FUNC(dlopen,,AC_CHECK_LIB(dl,dlopen))
AC_CHECK_LIB(ltdl,lt_dlopen)
AC_CHECK_FUNC(socket,,AC_CHECK_LIB(socket,socket))
AC_CHECK_FUNC(connect,,AC_CHECK_LIB(socket,connect))
AC_CHECK_FUNC(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
dnl AC_CHECK_FUNC(gethostbyname,,AC_CHECK_LIB(resolv,gethostbyname))
dnl try -lwsock32 (for mingw32 on Windows) if no socket-related functions found
if test "$ac_cv_func_select" = no; then
AC_CHECK_LIB(wsock32,select)
AC_CHECK_LIB(wsock32,socket)
AC_CHECK_LIB(wsock32,connect)
AC_CHECK_LIB(wsock32,gethostbyname)
fi
AC_CHECK_FUNC(pthread_self)
AC_CHECK_LIB(pthread,pthread_self) dnl FreeBSD would require AC_CHECK_LIB(c_r,pthread_self)
AC_CHECK_LIB(z, deflate)
AC_CHECK_LIB(gpm, Gpm_Open)
AC_CHECK_LIB(ggi, ggiOpen)
dnl libgpm if often linked against ncurses...
dnl no need for additional libraries in that case
AC_CHECK_LIB(gpm, tgetent)
LIBS=
AC_CHECK_LIB(termcap,tgetent,,AC_CHECK_LIB(ncurses,tgetent))
LIBS=
dnl test for X11
AC_PATH_X
if test "$have_x" = yes; then
if test "$ac_x_includes"; then
CF_HEADERX11="-I$ac_x_includes"
fi
if test "$ac_x_libraries"; then
LD_LIBX11="-L$ac_x_libraries"
fi
LD_LIBX11="$LD_LIBX11 -lX11"
fi
dnl test for xpm
if test "$have_x" = yes; then
ac_save_cpp="$ac_cpp"
ac_save_link="$ac_link"
ac_cpp="$ac_cpp $CF_HEADERX11"
ac_link="$ac_link $LD_LIBX11"
fi
AC_CHECK_HEADERS(X11/xpm.h)
AC_CHECK_LIB(Xpm, XpmReadFileToPixmap)
if test "$have_x" = yes; then
ac_cpp="$ac_save_cpp"
ac_link="$ac_save_link"
fi
LIBS=
dnl test for gtk
AC_CHECK_PROG(gtk_config, gtk-config, yes)
if test "$ac_cv_prog_gtk_config" = yes; then
ac_save_cpp="$ac_cpp"
ac_save_link="$ac_link"
ac_cpp="$ac_cpp `gtk-config --cflags`"
ac_link="$ac_link `gtk-config --libs`"
fi
AC_CHECK_HEADERS(gtk/gtk.h)
AC_CHECK_LIB(gtk, gtk_init)
if test "$ac_cv_prog_gtk_config" = yes; then
ac_cpp="$ac_save_cpp"
ac_link="$ac_save_link"
fi
LIBS=
dnl test for xml2
dnl
dnl AC_CHECK_PROG(xml2_config, xml2-config, yes)
dnl if test "$ac_cv_prog_xml2_config" = yes; then
dnl ac_save_cpp="$ac_cpp"
dnl ac_save_link="$ac_link"
dnl ac_cpp="$ac_cpp `xml2-config --cflags`"
dnl ac_link="$ac_link `xml2-config --libs`"
dnl fi
dnl AC_CHECK_HEADERS(libxml/parser.h)
dnl AC_CHECK_LIB(xml2, xmlInitParser)
dnl if test "$ac_cv_prog_xml2_config" = yes; then
dnl ac_cpp="$ac_save_cpp"
dnl ac_link="$ac_save_link"
dnl fi
dnl
dnl sanity checkings
dnl
if test "$ac_cv_type_long_long" != no; then
AC_DEFINE(HAVE_LONG_LONG, 1, Define if you have the long long type)
fi
if test "$ac_cv_c_inline" != no; then
AC_DEFINE(HAVE_INLINE, 1, Define if you have the inline keyword)
fi
if test "$ac_cv_c_static_inline" != no; then
AC_DEFINE(HAVE_STATIC_INLINE, 1, Define if you have gcc-compatible 'static inline')
fi
if test "$ac_cv_c_attribute_const" != no; then
AC_DEFINE(HAVE_ATTRIBUTE_CONST, 1, Define if you have gcc-compatible '__attribute__((const))')
fi
if test "$ac_cv_c_attribute_packed" != no; then
AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Define if you have gcc-compatible '__attribute__((packed))')
fi
can_enable__asm=no
dnl do we have gcc i386 compatible assembler?
if test "$ac_cv_prog_gcc_i386_asm" = yes; then
AC_DEFINE(HAVE_GCC_I386_ASM, 1, Define if you have gcc-compatible i386 assembler)
can_enable__asm=yes
can_enable__asm_style="gcc-i386-asm"
fi
GCC_I386_ASM="$ac_cv_prog_gcc_i386_asm"
AC_SUBST(GCC_I386_ASM)
dnl do we have other supported assemblers?
dnl other assemblers may be added here...
if test "$can_enable__asm" = yes; then
AC_DEFINE(HAVE_ASM, 1, Define if you have an assembler supported by twin)
fi
GNU_LD="$lt_cv_prog_gnu_ld"
AC_SUBST(GNU_LD)
BUILD_PROG_TWIN=yes
if test "$ac_cv_func_gettimeofday" = no -a "$ac_cv_func_ftime" = no; then
AC_MSG_WARN(missing gettimeofday() and ftime(): cannot compile twin server!)
BUILD_PROG_TWIN=no
fi
AC_SUBST(BUILD_PROG_TWIN)
if test "$ac_cv_func_select" = no; then
AC_MSG_ERROR(missing select(): cannot compile twin! Aborting.)
fi
if test "$ac_cv_func_gethostbyname" = yes -o "$ac_cv_lib_nsl_gethostbyname" = yes; then
AC_DEFINE(HAVE_GETHOSTBYNAME, 1, Define if you have the gethostbyname function)
fi
if test "$ac_cv_func_memcmp_clean" = yes -o "$ac_cv_func_memcmp_working" = yes; then
AC_DEFINE(HAVE_MEMCMP, 1, Define if memcmp() is available and works)
fi
if test "$ac_cv_func_putenv" = no -a "$ac_cv_func_setenv" = no; then
AC_MSG_WARN(both putenv() and setenv() missing. twin will not set TERM and TWDISPLAY correctly!)
fi
if test "$ac_cv_func_wait3" = no -a "$ac_cv_func_wait4" = no; then
AC_MSG_WARN(both wait3() and wait4() missing. twin will generate a lot of zombie processes!)
fi
if test "$ac_cv_func_crypt" = no -a "$ac_cv_lib_crypt_crypt" = no; then
AC_MSG_WARN(missing crypt(): disabling twdm client!)
LD_LIBCRYPT=
elif test "$ac_cv_lib_crypt_crypt" = yes; then
LD_LIBCRYPT=-lcrypt
fi
dnl
dnl fixup configuration basing on autoconfigured stuff
dnl
dnl
dnl enable shared libraries/modules if possible
dnl
if test "$ac_cv_sys_shlibs" = no; then
enable__modules=no
enable__shlibs=no
fi
if test "$enable__modules" = yes; then
can_enable__modules=no
if test "$ac_cv_func_dlopen" = yes -o "$ac_cv_lib_dl_dlopen" = yes; then
if test "$ac_cv_header_dlfcn_h" = yes; then
AC_DEFINE(HAVE_DLOPEN, 1, Define if you have the dlopen() API)
can_enable__modules=yes
fi
fi
if test "$can_enable__modules" = no -a "$ac_cv_lib_ltdl_lt_dlopen" = yes -a "$ac_cv_header_ltdl_h" = yes; then
AC_MSG_WARN([
support for GNU libltdl is not functional yet, will not be used
])
#AC_DEFINE(HAVE_LT_DLOPEN, 1, Define if you have the lt_dlopen() API)
#can_enable__modules=yes
fi
enable__modules="$can_enable__modules"
fi
if test "$ac_cv_func_mmap_fixed_mapped" = no; then
enable__alloc=no
enable_wm_rc_shmmap=no
fi
if test "$enable__asm" = yes; then
enable__asm="$can_enable__asm"
enable__asm_style="$can_enable__asm_style"
fi
if test "$ac_cv_type_long_long" = no; then
enable__long_long=no
fi
if test "$ac_cv_func_socket" = no -a "$ac_cv_lib_socket_socket" = no -a "$ac_cv_lib_wsock32_socket" = no; then
AC_MSG_WARN(missing socket(): disabling socket connections (libTw)!)
enable_socket=no
fi
if test "$ac_cv_func_connect" = no -a "$ac_cv_lib_socket_connect" = no -a "$ac_cv_lib_wsock32_connect" = no; then
AC_MSG_WARN(missing connect(): disabling socket connections (libTw)!)
enable_socket=no
fi
if test "$ac_cv_func_gethostbyname" = no -a "$ac_cv_lib_nsl_gethostbyname" = no -a "$ac_cv_lib_wsock32_gethostbyname" = no; then
AC_MSG_WARN(missing gethostbyname(): libTw will only accept numerical IP addresses!)
fi
if test "$ac_cv_lib_pthread_pthread_self" = no -o "$ac_cv_header_pthread_h" = no; then
enable_socket_pthreads=no
fi
if test "$ac_cv_lib_z_deflate" = no -o "$ac_cv_header_zlib_h" = no; then
enable_socket_gz=no
fi
if test "$ac_cv_func_getpt" = no; then
enable_term_devpts=no
fi
if test "$ac_cv_func_grantpt" = no -o "$ac_cv_func_unlockpt" = no -o "$ac_cv_func_ptsname" = no; then
enable_term_devpts=no
fi
if test "$ac_cv_lib_gpm_Gpm_Open" = no -o "$ac_cv_header_gpm_h" = no; then
enable_hw_tty_linux=no
fi
if test "$ac_cv_lib_gpm_tgetent" = no -a "$ac_cv_lib_termcap_tgetent" = no -a "$ac_cv_lib_ncurses_tgetent" = no; then
enable_hw_tty_termcap=no
fi
if test "$ac_cv_lib_ggi_ggiOpen" = no -o "$ac_cv_header_ggi_ggi_h" = no; then
enable_hw_ggi=no
fi
if test "$have_x" != yes; then
enable_hw_x11=no
enable_tt_hw_x11=no
fi
if test "$have_x" != yes -o "$ac_cv_header_X11_xpm_h" = no -o "$ac_cv_lib_Xpm_XpmReadFileToPixmap" = no; then
enable_hw_gfx=no
fi
if test "$ac_cv_header_gtk_gtk_h" = no -o "$ac_cv_lib_gtk_gtk_init" = no; then
enable_tt_hw_gtk=no
fi
dnl if test "$ac_cv_header_libxml_parser_h" = no -o "$ac_cv_lib_xml2_xmlInitParser" = no; then
dnl enable_tt_hw_xml=no
dnl fi
dnl
dnl rememeber any autodetected setting
dnl
OS="$ac_cv_sys_uname"
AC_SUBST(OS)
if test "$ECHO_E" = ""; then
ECHO_E='echo'
if test "`/bin/echo -e '\n'`" = ""; then
ECHO_E='/bin/echo -e'
elif test "`/bin/echo '\n'`" = ""; then
ECHO_E='/bin/echo'
elif test "`/bin/sh -c "echo -e '\n'"`" = ""; then
ECHO_E='echo -e'
elif test "`/bin/sh -c \"echo '\n'\"`" = ""; then
ECHO_E='echo'
fi
fi
echo "checking for echo -e... $ECHO_E"
ECHO_C=
ECHO_N=
if test "`( echo '1\c'; echo 2 ) | grep 12`" = "12"; then
ECHO_C='\c'
elif test "`( echo -n "1"; echo 2 ) | grep 12`" = 12; then
ECHO_N='-n'
fi
echo "checking for echo -n... echo $ECHO_C$ECHO_N"
if test -x /bin/bash; then
BASH=/bin/bash
elif bash -c : 2>/dev/null; then
BASH=bash
elif test -x "$BASH"; then
:
else
BASH=sh
fi
AC_SUBST(ECHO_E)
AC_SUBST(ECHO_N)
AC_SUBST(ECHO_C)
AC_SUBST(BASH)
echo "checking for bash... $BASH"
if test "$ac_cv_prog_RANLIB"; then
RANLIB="$ac_cv_prog_RANLIB"
elif test "ac_cv_prog_ac_ct_RANLIB"; then
RANLIB="$ac_cv_prog_ac_ct_RANLIB"
else
RANLIB=:
fi
if test "$ac_cv_prog_AR"; then
AR="$ac_cv_prog_AR"
fi
echo "checking for ranlib... $RANLIB"
echo "checking for ar... $AR"
AC_SUBST(RANLIB)
AC_SUBST(AR)
SYS_SHLIBS="$ac_cv_sys_shlibs"
AC_SUBST(SYS_SHLIBS)
if test "$ac_cv_lib_dl_dlopen" = yes; then
LD_LIBDL=-ldl
elif test "$ac_cv_lib_ltdl_lt_dlopen" = yes; then
LD_LIBDL=-lltdl
fi
AC_SUBST(LD_LIBDL)
if test "$ac_cv_lib_socket_socket" = yes -o "$ac_cv_lib_socket_connect" = yes; then
LD_LIBSOCKET=-lsocket
elif test "$ac_cv_lib_wsock32_socket" = yes -o "$ac_cv_lib_wsock32_connect" = yes; then
LD_LIBSOCKET=-lwsock32
fi
AC_SUBST(LD_LIBSOCKET)
if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
LD_LIBNSL=-lnsl
fi
AC_SUBST(LD_LIBNSL)
if test "$ac_cv_lib_pthread_pthread_self" = yes; then
LD_LIBPTHREAD=-lpthread
fi
if test "$ac_cv_func_pthread_self" = no; then
LD_LIBPTHREAD_WEAK="$LD_LIBPTHREAD"
fi
AC_SUBST(LD_LIBPTHREAD)
AC_SUBST(LD_LIBPTHREAD_WEAK)
if test "$ac_cv_lib_gpm_tgetent" = yes; then
LD_LIBTERMCAP_IN_LIBGPM=-lgpm
fi
if test "$ac_cv_lib_termcap_tgetent" = yes; then
LD_LIBTERMCAP=-ltermcap
elif test "$ac_cv_lib_ncurses_tgetent" = yes; then
LD_LIBTERMCAP=-lncurses
elif test "$ac_cv_lib_gpm_tgetent" = yes; then
LD_LIBTERMCAP=-lgpm
fi
AC_SUBST(LD_LIBTERMCAP_IN_LIBGPM)
AC_SUBST(LD_LIBTERMCAP)
if test "$ac_cv_header_X11_xpm_h" = yes; then
CF_HEADERGFX="$CF_HEADERX11"
fi
if test "$ac_cv_lib_Xpm_XpmReadFileToPixmap" = yes; then
LD_LIBGFX="$LD_LIBX11 -lXpm"
fi
AC_SUBST(CF_HEADERGFX)
AC_SUBST(LD_LIBGFX)
AC_SUBST(CF_HEADERX11)
AC_SUBST(LD_LIBX11)
AC_SUBST(LD_LIBCRYPT)
if test "$enable_tt_hw_gtk" != no; then
CF_HEADERGTK="`gtk-config --cflags`"
LD_LIBGTK="`gtk-config --libs`"
fi
AC_SUBST(CF_HEADERGTK)
AC_SUBST(LD_LIBGTK)
dnl if test "$enable_tt_hw_xml" != no; then
dnl CF_HEADERXML="`xml2-config --cflags`"
dnl LD_LIBXML="`xml2-config --libs`"
dnl fi
AC_SUBST(CF_HEADERXML)
AC_SUBST(LD_LIBXML)
dnl
dnl prepare conf/conf.auto using old conf/conf.current (or conf/conf.default)
dnl for non-specified, non-autodetectable things (CONF_OPT_*)
dnl
# Remove last slash and all that follows it. Not all systems have dirname.
# we use [[ ]] since m4 will remove one level of them.
TOP_SRCDIR="`echo $0|sed 's%/[[^/]][[^/]]*$%%'`"
if test "${TOP_SRCDIR}" = "$0"; then
TOP_SRCDIR=.
fi
. ${TOP_SRCDIR}/conf/conf.default
if test -f ${TOP_SRCDIR}/conf/conf.current; then
. ${TOP_SRCDIR}/conf/conf.current
fi
if test -f ${TOP_SRCDIR}/conf/conf.auto; then
. ${TOP_SRCDIR}/conf/conf.auto
fi
CONF_=
for ac_FEATURE in `cat ${TOP_SRCDIR}/conf/conf.list`; do
ac_feature=enable_`echo $ac_FEATURE | cut -d_ -f2- | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
eval "ac_feature_val=$`echo $ac_feature`"
case "$ac_feature_val" in
y | yes ) ac_feature_val=y ;;
n | no ) ac_feature_val=n ;;
m | mod ) ac_feature_val=m ;;
* )
# unset / undetectable. use old value.
eval "ac_feature_val=$`echo $ac_FEATURE`"
;;
esac
if test "$ac_feature_val"; then
CONF_="$CONF_ $ac_FEATURE=$ac_feature_val;"
fi
done
AC_SUBST(CONF_)
# all done. now just output makefiles.
# this will prepare the Makefiles
. ${TOP_SRCDIR}/scripts/Makefiles.sh "${TOP_SRCDIR}"
AC_OUTPUT(makeautoconf conf/conf.auto)
enable_="`echo \"$CONF_\" | sed 's/CONF_/enable_/g' | tr -d ';' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`"
${TOP_SRCDIR}/scripts/Prettyconfig.sh "prefix='$prefix'" "CC='$CC'" "CC_FLAGS_OPT='$CC_FLAGS_OPT'" "OS='$OS'" \
"SYS_SHLIBS='$SYS_SHLIBS'" "enable__asm_style='$enable__asm_style'" $enable_
AC_MSG_RESULT([
twin is now (hopefully) configured.
As next step, you probably want to run '${MAKE-make}'.])