-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.in
746 lines (656 loc) · 21.2 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
AC_INIT
AC_CONFIG_HEADER(config.h)
dnl Define the release numbers here
SETUP_VERSION_MAJOR=1
SETUP_VERSION_MINOR=6
SETUP_VERSION_RELEASE=5
PACKAGE_NAME="Loki Setup"
PACKAGE_TARNAME="setup"
PACKAGE_VERSION="$SETUP_VERSION_MAJOR.$SETUP_VERSION_MINOR.$SETUP_VERSION_RELEASE"
dnl Detect the canonical host and target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PATH_PROGS(AR, [ar gar])
AC_PATH_XTRA
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(strings.h)
AC_CHECK_HEADERS(pwd.h)
AC_CHECK_HEADERS(carbon/carbon.h)
AC_CHECK_HEADERS(dirent.h)
AC_CHECK_HEADERS(sys/dirent.h)
AC_CHECK_HEADERS(sys/ndir.h)
AC_CHECK_HEADERS(ndir.h)
AC_CHECK_HEADERS(sys/dir.h)
AC_CHECK_HEADERS(sys/statfs.h)
AC_CHECK_HEADERS(sys/statvfs.h)
AC_CHECK_HEADERS(sys/vfs.h)
AC_CHECK_HEADERS(sys/mount.h)
AC_CHECK_HEADERS(sys/mnttab.h)
AC_CHECK_HEADERS(sys/ucred.h)
AC_CHECK_HEADERS(mntent.h)
AC_CHECK_HEADERS(fstab.h)
AC_CHECK_HEADERS(dir.h)
AC_CHECK_HEADERS(util.h)
AC_CHECK_HEADERS(libutil.h)
AC_CHECK_HEADERS(libgen.h)
AC_CHECK_HEADERS(pty.h)
AC_CHECK_HEADERS(sys/ptms.h)
AC_CHECK_HEADERS(sys/stropts.h)
AC_CHECK_HEADERS(selinux/selinux.h)
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_HEADERS(osreldate.h)
AC_CHECK_FILES(/dev/ptmx)
AC_CHECK_FILES(/dev/pts)
AC_CHECK_FILES(/dev/ptc)
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(ptsname_r)
AC_CHECK_FUNCS(vhangup)
AC_CHECK_FUNCS(_getpty)
AC_CHECK_FUNCS(ttyname_r)
AC_CHECK_FUNCS(nl_langinfo)
AC_CHECK_FUNCS(strlcpy)
AC_CHECK_FUNCS(waitpid)
AC_PATH_PROG(SU_PATH, su, /bin/su, $PATH:/usr/sbin:/sbin)
AC_PATH_PROG(MOUNT_PATH, mount, /sbin/mount, $PATH:/usr/sbin:/sbin)
AC_PATH_PROG(UMOUNT_PATH, umount, /sbin/umount, $PATH:/usr/sbin:/sbin)
AC_PATH_PROG(BRANDELF, brandelf, true)
LD="$CC"
CFLAGS="-fsigned-char -funroll-loops -Wall -g -O2 -I. $X_CFLAGS"
CONSOLE_LIBS=""
if test -d /usr/codehost/lib; then
LIBS="-L/usr/codehost/lib"
elif test -d /opt/codehost/lib; then
LIBS="-L/opt/codehost/lib"
elif test -d /sw/lib; then
case "$target" in
*-apple-darwin*)
LIBS="-L/sw/lib" ;;
esac
else
LIBS="$LIBS -L/usr/local/lib"
fi
SETUP_GTK=setup.gtk
GTK_SUBDIR=gtk1
# Build some static binaries by default when possible
STATIC="-static"
RDYNAMIC="-rdynamic"
BSTATIC="-Wl,-Bstatic"
BDYNAMIC="-Wl,-Bdynamic"
LIBDL="-ldl"
LIBTINFO=""
EXTRA_LIBS=""
REENTRANT="-D_REENTRANT"
case "$target" in
*i?86*OpenUNIX*)
STATIC=""
CFLAGS="$CFLAGS -Dsco"
RDYNAMIC="-Wl,-Bexport"
EXTRA_LIBS="-lsocket -lnsl -lresolv -lcdfs"
AC_DEFINE(USE_BSD_PTY, 1, Use BSD-style ptys)
AC_DEFINE(NO_XOPEN_SOURCE, 1, XOPEN source breaks)
AC_DEFINE(NO_POSIX_C_SOURCE, 1, POSIX C source breaks)
AC_DEFINE(NO_POSIX_SOURCE, 1, POSIX source breaks)
ARCH=x86 ;;
*i?86*sco*)
STATIC=""
CFLAGS="$CFLAGS -Dsco"
RDYNAMIC="-Wl,-Bexport"
LIBDL=""
EXTRA_LIBS="-L/udk/usr/lib -lsocket -lnsl -lresolv -lgen"
AC_DEFINE(USE_BSD_PTY, 1, Use BSD-style ptys)
AC_DEFINE(NO_XOPEN_SOURCE, 1, XOPEN source breaks)
AC_DEFINE(NO_POSIX_C_SOURCE, 1, POSIX C source breaks)
AC_DEFINE(NO_POSIX_SOURCE, 1, POSIX source breaks)
ARCH=x86 ;;
*aix*)
STATIC=""
BSTATIC=""
BDYNAMIC=""
RDYNAMIC="-Wl,-bexpall"
LDFLAGS="$LDFLAGS -lpthread"
AC_DEFINE(NO_XOPEN_SOURCE, 1, XOPEN source breaks)
AC_DEFINE(NO_POSIX_C_SOURCE, 1, POSIX C source breaks)
AC_DEFINE(NO_POSIX_SOURCE, 1, POSIX source breaks)
ARCH=`uname -p`
if test "$ARCH" = powerpc; then
ARCH=ppc
fi
;;
*i?86*freebsd*)
LIBDL=""
AC_DEFINE(USE_BSD_PTY, 1, Use BSD-style ptys)
ARCH=x86 ;;
amd64*freebsd*)
LIBDL=""
AC_DEFINE(USE_BSD_PTY, 1, Use BSD-style ptys)
ARCH=x86_64 ;;
*alpha*)
CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
ARCH=alpha ;;
*sgi*)
LIBSUFFIX=32
CFLAGS="$CFLAGS -D_SGI_SOURCE"
EXTRA_LIBS="-L/usr/freeware/lib$LIBSUFFIX"
RDYNAMIC=""
STATIC=""
AC_DEFINE(NO_POSIX_SOURCE, 1, POSIX source breaks)
AC_DEFINE(NO_POSIX_C_SOURCE, 1, POSIX C source breaks)
AC_DEFINE(NO_XOPEN_SOURCE, 1, XOPEN source breaks)
ARCH=mips ;;
hppa*hpux*)
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED -Dhpux -Dhppa"
LDFLAGS="$LDFLAGS -Wl,-a,archive_shared"
LIBDL="-ldld -lpthread"
STATIC="-Wl,-E -Wl,-a,archive_shared"
RDYNAMIC="-Wl,-E"
BSTATIC=""
BDYNAMIC="-Wl,-a,archive_shared"
CONSOLE_LIBS="$LIBDL"
ARCH=hppa ;;
ia64*hpux*)
LIBSUFFIX=/hpux32
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED -Dhpux -Dia64"
LDFLAGS="$LDFLAGS -Wl,-a,archive_shared"
LIBDL="-ldld -lpthread"
LIBS="-L/usr/local/lib$LIBSUFFIX $LIBS"
STATIC="-Wl,-E -Wl,-a,archive_shared"
RDYNAMIC="-Wl,-E"
BSTATIC=""
BDYNAMIC="-Wl,-a,archive_shared"
CONSOLE_LIBS="$LIBDL"
ARCH=ia64 ;;
i?86*solaris*)
EXTRA_LIBS="-lsocket -lnsl -lresolv -ldl"
STATIC=""
RDYNAMIC=""
LIBDL=""
ARCH=x86 ;;
sparc*solaris*)
EXTRA_LIBS="-lsocket -lnsl -lresolv -ldl"
STATIC=""
RDYNAMIC=""
LIBDL=""
ARCH=`uname -p` ;;
*-apple-darwin*)
STATIC="-static"
RDYNAMIC="-Wl,-Sn"
BSTATIC=""
BDYNAMIC=""
REENTRANT=""
CFLAGS="$CFLAGS -I/sw/include -Ddarwin"
LDFLAGS="$LDFLAGS -framework Carbon -framework Security -framework IOKit"
COMMON_LIBS="carbon/carbonres.o carbon/carbondebug.o carbon/STUPControl.o carbon/YASTControl.o carbon/appbundle.o"
ARCH=`uname -p` ;;
*ppc64* | *powerpc64*)
ARCH=ppc64 ;;
*ppc* | *powerpc*)
ARCH=ppc ;;
*i?86*)
BSTATIC=""
BDYNAMIC=""
ARCH=x86 ;;
*x86_64*)
STATIC=""
LIBTINFO="-ltinfo"
LIBSUFFIX=64
ARCH=x86_64 ;;
*)
ARCH=`uname -p 2> /dev/null || uname -m` ;;
esac
GTK_STATIC=$BSTATIC
case "$target" in
*i?86*linux*)
# Newer glibc's require to depend at least on them
STATIC=""
GTK_STATIC="\$(BDYNAMIC)" ;;
esac
CFLAGS="$CFLAGS $REENTRANT"
AC_CHECK_FUNCS(getopt)
AC_CHECK_LIB(gnugetopt, getopt_long, LIBS="$LIBS $BSTATIC -lgnugetopt $BDYNAMIC")
AC_CHECK_FUNCS(getopt_long)
AC_CHECK_LIB(util, forkpty, LIBUTIL="-lutil"; LIBS="$LIBS -lutil")
AC_CHECK_FUNCS(openpty)
AC_CHECK_LIB(selinux, is_selinux_enabled, LIBS="$LIBS $BSTATIC -lselinux $BDYNAMIC")
SETUPDB_NAME=loki_setupdb
SETUPDB="`pwd`/../loki_setupdb-$PACKAGE_VERSION"
if test ! -d "$SETUPDB"; then
SETUPDB="`pwd`/../loki_setupdb"
if test ! -d "$SETUPDB"; then
SETUPDB="`pwd`/../setupdb"
SETUPDB_NAME=setupdb
fi
fi
AC_ARG_WITH(setupdb,
[ --with-setupdb with setupdb library at [default=../loki_setupdb]],
, with_setupdb=$SETUPDB)
if test x$with_setupdb != x$SETUPDB; then
SETUPDB=$with_setupdb
fi
dnl Check for correct setupdb installation
if test -f $SETUPDB/$ARCH/libsetupdb.a; then
for ac_SETUPDB_INCDIR in $SETUPDB $SETUPDB/include
do
if test -f $ac_SETUPDB_INCDIR/setupdb.h; then
SETUPDB_INCDIR=$ac_SETUPDB_INCDIR
break
fi
done
if test x$SETUPDB_INCDIR = x; then
AC_MSG_ERROR([*** $SSETUPDB_NAME headers not found. ***])
else
AC_MSG_RESULT([SetupDB library found in $SETUPDB/$ARCH])
fi
else
AC_MSG_ERROR([*** Please compile $SETUPDB_NAME first!])
fi
CFLAGS="$CFLAGS -I$SETUPDB_INCDIR"
GUI_LIBS=$GTK_STATIC
GTK_LIBS=$GTK_STATIC
#!!!TODO - Add carbon libs as necessary
CARBON_LIBS=
LIBS="$LIBS $EXTRA_LIBS"
AC_CHECK_LIB(iconv, iconv_open,
LIBINTL="-liconv"
LIBS="$LIBS $BSTATIC $LIBINTL"
)
AC_CHECK_LIB(intl, gettext,
USE_LIBINTL=yes
LIBINTL="-lintl $LIBINTL",
if test -f /usr/local/lib/libintl.a; then
LIBINTL="/usr/local/lib/libintl.a /usr/local/lib/libiconv.a"
LIBS="$LIBS $LIBINTL"
GUILIBS="$GUI_LIBS $LIBINTL"
CARBONLIBS="$CARBON_LIBS $LIBINTL"
# CFLAGS="$CFLAGS -I/opt/gettext/include"
fi
)
case "$target" in
powerpc-apple-darwin*)
if test -f /sw/lib/libintl.a; then
LIBINTL="/sw/lib/libintl.a /sw/lib/libiconv.a"
LIBS="$LIBS $LIBINTL"
GUILIBS="$GUI_LIBS $LIBINTL"
CARBONLIBS="$CARBON_LIBS $LIBINTL"
CFLAGS="$CFLAGS -I/sw/include"
fi
esac
AC_CHECK_HEADERS(libintl.h)
AC_CHECK_HEADERS(langinfo.h)
AC_CHECK_HEADERS(locale.h)
AC_CHECK_LIB(gpm, Gpm_Open, USE_GPM=yes)
dnl If NCURSES_MOUSE_VERSION is defined, we don't use GPM, so let's not link it in
AC_TRY_COMPILE([#include <ncurses.h>], [int n = NCURSES_MOUSE_VERSION;], unset USE_GPM)
dnl Check for gtk12 libraries in case those are available (FreeBSD)
AC_CHECK_LIB(glib12, g_log, GTK12="12")
AC_CHECK_LIB(dl, dlopen, USE_LIBDL=yes)
AC_ARG_ENABLE(bzip2,
[ --enable-bzip2 enable bzip2 support [default=no]],
, enable_bzip2=no)
if test x$enable_bzip2 = xyes; then
HAVE_BZIP2_SUPPORT="no"
AC_CHECK_LIB(bz2, BZ2_bzopen, HAVE_BZ2_BZOPEN=yes)
AC_CHECK_LIB(bz2, bzopen, HAVE_NORMAL_BZOPEN=yes)
if test x$HAVE_NORMAL_BZOPEN = xyes; then
LIBBZ2_PREFIX="no"
HAVE_BZIP2_SUPPORT="yes"
fi
dnl favor the BZ2_ prefix version, since it's a later revision of the lib.
if test x$HAVE_BZ2_BZOPEN = xyes; then
LIBBZ2_PREFIX="yes"
HAVE_BZIP2_SUPPORT="yes"
fi
if test x$HAVE_BZIP2_SUPPORT = xno; then
AC_MSG_WARN([*** libbz2 not found. bzip2 support has been disabled!])
AC_MSG_WARN([*** you can disable this warning with --disable-bzip2])
fi
elif test x$enable_bzip2 = xdlopen; then
HAVE_BZIP2_SUPPORT="yes"
BZIP2_DLOPEN="yes"
fi
dnl Detect the LibC version
AC_MSG_CHECKING(libc version)
if test `uname -s` != Linux; then
LIBC=glibc-2.1
else
if test -f `echo /lib/libc.so.6* | tail -n 1`; then
dnl This should cover all other releases post 2.1
if grep GLIBC_2.1 /lib/libc.so.6* 2>&1 >/dev/null; then
LIBC="glibc-2.1"
else
LIBC="glibc-2.0"
fi
elif [ -f /lib/libc.so.5 ]; then
LIBC="libc5"
else
LIBC="unknown"
fi
fi
AC_MSG_RESULT($LIBC)
PLUGINS="tar.c"
AC_ARG_WITH(ncurses,
[ --with-ncurses specify ncurses library location],
CONSOLE_LIBS="$CONSOLE_LIBS -L$with_ncurses/lib$LIBSUFFIX"
CFLAGS="$CFLAGS -I$with_ncurses/include"
USE_NCURSES=yes
)
AC_ARG_ENABLE(libglade-static,
[ --enable-libglade-static whether to statically link libglade (default=yes)],,
enable_libglade_static=yes)
if test "x$enable_libglade_static" = "xyes"; then
GLADE_STATIC="$BSTATIC"
fi
AC_ARG_ENABLE(libxml-static,
[ --enable-libxml-static whether to statically link libxml (default=yes)],,
enable_libxml_static=yes)
if test "x$enable_libxml_static" = "xyes"; then
XML_STATIC="$BSTATIC"
fi
AC_ARG_ENABLE(libncurses-static,
[ --enable-libncurses-static whether to statically link libncurses (default=yes)],,
enable_libncurses_static=yes)
if test "x$enable_libncurses_static" = "xyes"; then
NCURSES_STATIC="$BSTATIC"
fi
AC_CHECK_HEADERS(ncurses/term.h)
AC_CHECK_HEADERS(ncurses/curses.h)
AC_CHECK_HEADERS(ncurses.h)
AC_CHECK_LIB(ncurses, keypad, USE_NCURSES=yes)
dnl Check for libglade 1
AC_PATH_PROG(HAVEGLADE, libglade-config, $PATH)
if test ! -z "$HAVEGLADE"; then
GLADE_CFLAGS=`$HAVEGLADE --cflags`
GLADE_PREFIX=`$HAVEGLADE --prefix`
else
AC_MSG_ERROR([*** libglade-config not found. You need a working libglade installation.])
fi
dnl Check for GTK 1.X
AC_PATH_PROG(HAVEGTK, gtk$GTK12-config, $PATH)
AC_PATH_PROG(HAVEGLIB, glib$GTK12-config, $PATH)
if test ! -z "$HAVEGTK"; then
GTK_CFLAGS=`$HAVEGTK --cflags`
GTK_PREFIX=`$HAVEGTK --prefix`
GLIB_PREFIX=`$HAVEGLIB --prefix`
GTK_LIBS="$GTK_LIBS -L$GTK_PREFIX/lib$LIBSUFFIX -L$GLIB_PREFIX/lib$LIBSUFFIX -lgtk$GTK12 -lgdk$GTK12 $RDYNAMIC -lgmodule$GTK12 -lglib$GTK12"
else
AC_MSG_ERROR([*** gtk-config not found. You need a working GTK+ 1.2 installation.])
fi
XMLVER=""
AC_ARG_ENABLE(gtk2,
[ --enable-gtk2 Use gtk2 support, not gtk1 [default=no]],
, enable_gtk2=no)
if test x$enable_gtk2 = xyes; then
AC_DEFINE(ENABLE_GTK2, 1, GTK2 support.)
dnl Check for glade2 and gtk2 libraries
AC_PATH_PROG(HAVEPKGCONFIG, pkg-config, $PATH)
if test ! -z "$HAVEPKGCONFIG"; then
if $HAVEPKGCONFIG --exists libglade-2.0 gtk+-2.0 ; then
GTK2_CFLAGS=`$HAVEPKGCONFIG --cflags libglade-2.0 gtk+-2.0`
GTK2_LIBS=`$HAVEPKGCONFIG --libs libglade-2.0 gtk+-2.0`
dnl Pkg-config is supposed to add the export-dynamic, but it doesn't, at least on my system
LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
CFLAGS="$CFLAGS $GTK2_CFLAGS"
if test ! -z "GLADE_STATIC" ; then
GTK2_LIBS=`echo $GTK2_LIBS | sed "s/-lglade-2.0/$GLADE_STATIC -lglade-2.0 $BDYNAMIC/g"`
fi
dnl Ignore unnecessary dependency on libpng12, not used by our binaries, creates problems with newer distros
GTK2_LIBS=`echo $GTK2_LIBS | sed "s/-lpng12//g"`
GUI_LIBS="$GUI_LIBS $GTK2_LIBS"
SETUP_GTK="setup.gtk2"
GTK_SUBDIR=gtk2
XMLVER="2"
else
AC_MSG_ERROR([*** Either libglade-2.0 or gtk+-2.0 are not available.])
fi
else
AC_MSG_ERROR([*** pkg-config not found. Cannot probe for libglade-2.0 or gtk+-2.0.])
fi
else
CFLAGS="$CFLAGS $GLADE_CFLAGS $GTK_CFLAGS"
GUI_LIBS="$GUI_LIBS $GLADE_STATIC -L$GLADE_PREFIX/lib$LIBSUFFIX -lglade $BDYNAMIC $GTK_LIBS"
fi
dnl Look for the XML libraries
AC_ARG_WITH(libxml2,
[ --with-libxml2 use libxml2 [default=libxml1 unless GTK2 is enabled]],
, with_libxml2=no)
if test x$with_libxml2 != xno; then
XMLVER="2"
EXTRA_LIBS="$EXTRA_LIBS -lm"
fi
AC_PATH_PROG(HAVEXML, xml${XMLVER}-config, $PATH)
if test ! -z "$HAVEXML"; then
XML_CFLAGS=`$HAVEXML --cflags`
XML_PREFIX=`$HAVEXML --prefix`
if "$HAVEXML" --help|grep libtool-libs > /dev/null; then
XML_LIBTOOL=`$HAVEXML --libtool-libs`
if test -f "$XML_LIBTOOL"; then
. "$XML_LIBTOOL"
XML_LIBS="$dependency_libs"
else
XML_LIBS="-lm"
fi
elif "$HAVEXML" --libs | grep thread > /dev/null; then
XML_LIBS="$PTHREAD -lm"
fi
CFLAGS="$CFLAGS $XML_CFLAGS"
if test "$STATIC" = ""; then
LIBS="$LIBS $XML_STATIC -L$XML_PREFIX/lib$LIBSUFFIX -lxml${XMLVER} $BDYNAMIC $XML_LIBS"
GUI_LIBS="$GUI_LIBS $XML_STATIC -L$XML_PREFIX/lib$LIBSUFFIX -lxml${XMLVER} $BDYNAMIC $XML_LIBS"
CARBON_LIBS="$CARBON_LIBS -L$XML_PREFIX/lib$LIBSUFFIX -lxml${XMLVER} $XML_LIBS"
else
LIBS="$LIBS $XML_PREFIX/lib$LIBSUFFIX/libxml${XMLVER}.a $XML_LIBS"
GUI_LIBS="$GUI_LIBS $XML_PREFIX/lib$LIBSUFFIX/libxml${XMLVER}.a $XML_LIBS"
CARBON_LIBS="$CARBON_LIBS $XML_PREFIX/lib$LIBSUFFIX/libxml${XMLVER}.a $XML_LIBS"
fi
else
AC_MSG_ERROR([*** xml${XMLVER}-config not found. You need a working libxml${XMLVER} installation.])
fi
if test x$HAVE_BZIP2_SUPPORT = xyes; then
AC_DEFINE(HAVE_BZIP2_SUPPORT, 1, libbz2 support.)
if test x$BZIP2_DLOPEN = xyes; then
AC_DEFINE(BZIP2_DLOPEN, 1, open libbz2 using dlopen)
BZ2LIB="-ldl"
BZ2_STATIC=""
else
BZ2LIB="-lbz2"
BZ2_STATIC="$BSTATIC"
if test x$LIBBZ2_PREFIX = xyes; then
AC_DEFINE(LIBBZ2_PREFIX, 1, libbz2 has "BZ_" prefix.)
fi
# Use static version of BZIP2 under Carbon if it's available, otherwise
# just stick with the dynamic version
case "$target" in
powerpc-apple-darwin*)
if test -f /usr/lib/libbz2.a; then
BZ2LIB=""
LIBS="$LIBS /usr/lib/libbz2.a"
GUI_LIBS="$GUI_LIBS /usr/lib/libbz2.a"
CARBON_LIBS="$CARBON_LIBS /usr/lib/libbz2.a"
fi
esac
fi
fi
AC_ARG_ENABLE(dialog,
[ --enable-dialog enable the ncurses/dialog UI [default=yes]],
, enable_dialog=yes)
if test x$enable_dialog = xyes; then
CFLAGS="$CFLAGS -DENABLE_DIALOG"
COMMON_LIBS="$COMMON_LIBS dialog/libdialog.a"
CONSOLE_OBJS="dialog_ui.o"
DO_DIALOG="do-dialog"
fi
dnl enable ZIP support
AC_ARG_ENABLE(zip,
[ --enable-zip enable ZIP archives support [default=yes]],
, enable_zip=yes)
if test x$enable_zip = xyes; then
PLUGINS="$PLUGINS zip.c"
CFLAGS="$CFLAGS -DZIP_SUPPORT"
AC_DEFINE(ENABLE_ZIP, 1, ZIP support.)
fi
dnl enable UZ2 support
AC_ARG_ENABLE(uz2,
[ --enable-uz2 enable UZ2 archives support [default=yes]],
, enable_uz2=yes)
if test x$enable_uz2 = xyes; then
PLUGINS="$PLUGINS uz2.c"
CFLAGS="$CFLAGS -DUZ2_SUPPORT"
AC_DEFINE(ENABLE_UZ2, 1, UZ2 support.)
fi
dnl enable RAR support
AC_ARG_ENABLE(rar,
[ --enable-rar enable RAR archives support [default=no]],
, enable_rar=no)
if test x$enable_rar = xyes; then
PLUGINS="$PLUGINS rar.c"
LD="$CXX"
CFLAGS="$CFLAGS -DRAR_SUPPORT -DRARDLL -DSILENT"
COMMON_LIBS="$COMMON_LIBS unrar/filestr.o unrar/scantree.o unrar/dll.o unrar/rar.o unrar/strlist.o unrar/strfn.o unrar/pathfn.o unrar/int64.o unrar/savepos.o unrar/global.o unrar/file.o unrar/filefn.o unrar/filcreat.o unrar/archive.o unrar/arcread.o unrar/unicode.o unrar/system.o unrar/isnt.o unrar/crypt.o unrar/crc.o unrar/rawread.o unrar/encname.o unrar/resource.o unrar/match.o unrar/timefn.o unrar/rdwrfn.o unrar/consio.o unrar/options.o unrar/ulinks.o unrar/errhnd.o unrar/rarvm.o unrar/rijndael.o unrar/getbits.o unrar/sha1.o unrar/extinfo.o unrar/extract.o unrar/volume.o unrar/list.o unrar/find.o unrar/unpack.o unrar/cmddata.o"
AC_DEFINE(ENABLE_RAR, 1, RAR support.)
fi
dnl enable RPM support
AC_ARG_ENABLE(rpm,
[ --enable-rpm enable RPM archives support [default=no]],
, enable_rpm=no)
if test x$enable_rpm = xyes; then
CFLAGS="$CFLAGS -DRPM_SUPPORT=3 -I/usr/include/rpm"
PLUGINS="$PLUGINS rpm.c"
# This is for RPM 3.x
RPM_LIBS="$BSTATIC -lrpm -ldb1 -lpopt"
LIBS="$LIBS $RPM_LIBS"
GUI_LIBS="$GUI_LIBS $RPM_LIBS"
CARBON_LIBS="$CARBON_LIBS $RPM_LIBS"
AC_DEFINE(ENABLE_RPM, 1, RPM support.)
fi
dnl RPM 4.x support, needs additional libraries
AC_ARG_ENABLE(rpm4,
[ --enable-rpm4 enable RPM4 archives support [default=no]],
, enable_rpm=no)
if test x$enable_rpm4 = xyes; then
if test x$HAVE_BZIP2_SUPPORT != xyes; then
AC_MSG_ERROR([*** You need libbz2 to have RPM 4.x support.])
fi
CFLAGS="$CFLAGS -DRPM_SUPPORT=4 -I/usr/include/rpm"
PLUGINS="$PLUGINS rpm.c"
# This is for RPM 4.x
AC_CHECK_LIB(rpmdb, rpmdbInit, RPMDB=yes)
if test x$RPMDB = xyes; then # Mostly Mandrake it looks like
RPM_LIBS="$BSTATIC -lrpm -lrpmio -lrpmdb -ldb1 -ldb-3.1 -lpopt"
else
RPM_LIBS="$BSTATIC -lrpm -lrpmio -ldb1 -ldb-3.1 -lpopt"
fi
LIBS="$LIBS $RPM_LIBS"
GUI_LIBS="$GUI_LIBS $RPM_LIBS"
CARBON_LIBS="$CARBON_LIBS $RPM_LIBS"
AC_DEFINE(ENABLE_RPM, 1, RPM support.)
fi
LIBS="$LIBS $BZ2_STATIC $BZ2LIB $BDYNAMIC"
if test ! -z "$USE_LIBINTL"; then
LIBINTL="$BSTATIC $LIBINTL -lz \$(BDYNAMIC)"
LIBS="$LIBS $LIBINTL"
GUI_LIBS="$GUI_LIBS $LIBINTL"
CARBON_LIBS="$CARBON_LIBS $LIBINTL"
else
if test "$STATIC" = ""; then
LIBS="$LIBS $BSTATIC -lz \$(BDYNAMIC)"
else
LIBS="$LIBS -lz"
fi
GUI_LIBS="$GUI_LIBS $BSTATIC -lz \$(BDYNAMIC)"
CARBON_LIBS="$CARBON_LIBS $BSTATIC -lz \$(BDYNAMIC)"
fi
if test ! -z "$USE_NCURSES"; then
if test "$STATIC" = ""; then
CONSOLE_LIBS="$CONSOLE_LIBS $NCURSES_STATIC -lncurses $LIBTINFO \$(BDYNAMIC)"
else
CONSOLE_LIBS="$CONSOLE_LIBS $NCURSES_STATIC -lncurses $LIBTINFO"
fi
else
if test "$STATIC" = ""; then
CONSOLE_LIBS="$CONSOLE_LIBS $BSTATIC -lcurses \$(BDYNAMIC)"
else
CONSOLE_LIBS="$CONSOLE_LIBS -lcurses"
fi
fi
if test ! -z "$USE_GPM"; then
AC_CHECK_HEADERS(gpm.h)
CONSOLE_LIBS="$CONSOLE_LIBS -lgpm $LIBDL"
else
CONSOLE_LIBS="$CONSOLE_LIBS $LIBDL"
fi
X11_LIBS="\$(BDYNAMIC) $X_PRE_LIBS -L$x_libraries -lXi -lXext -lX11 -lm"
GUI_LIBS="$GUI_LIBS $X11_LIBS"
if test ! -z "$HAVEGTK"; then
GUI_LIBS="$GUI_LIBS $LIBDL"
GTK_LIBS="$GTK_LIBS \$(BDYNAMIC) $LIBDL $BSTATIC"
fi
dnl Check for various options
dnl enable dynamic plugins ?
DYN_PLUGINS=false
AC_ARG_ENABLE(dynamic-plugins,
[ --enable-dynamic-plugins enable dynamic plugins [default=no]],
, enable_dynamic=no)
if test x$enable_dynamic = xyes; then
CFLAGS="$CFLAGS -DDYNAMIC_PLUGINS"
LIBS="$LIBS -ldl"
GUI_LIBS="$GUI_LIBS -ldl"
CARBON_LIBS="$CARBON_LIBS -ldl"
DYN_PLUGINS=true
AC_DEFINE(DYNAMIC_PLUGINS, 1, Dynamic plugin support.)
fi
AC_ARG_WITH(image,
[ --with-image specifiy the CD image path [default=../../spp/private/image]],
, with_image=../../spp/private/image)
IMAGE="$with_image"
AC_ARG_WITH(vendor,
[ --with-vendor specify the vendor prefix [default=loki]],
, with_vendor=loki)
BRAND="$with_vendor"
#dnl enable the Outrage plugin (proprietary)
#AC_ARG_ENABLE(outrage,
#[ --enable-outrage enable the Outrage plugin [default=no]],
# , enable_outrage=no)
#if test x$enable_outrage = xyes; then
# CFLAGS="$CFLAGS -DOUTRAGE_SUPPORT"
# PLUGINS="$PLUGINS outrage.c"
# AC_DEFINE(ENABLE_OUTRAGE, 1, Outrage package decoder.)
#fi
OS=`uname -s`
CXXFLAGS="$CFLAGS"
AC_SUBST(SETUPDB)
AC_SUBST(PLUGINS)
AC_SUBST(DYN_PLUGINS)
AC_SUBST(GUI_LIBS)
AC_SUBST(CARBON_LIBS)
AC_SUBST(GTK_LIBS)
AC_SUBST(X11_LIBS)
AC_SUBST(EXTRA_LIBS)
AC_SUBST(CONSOLE_LIBS)
AC_SUBST(CONSOLE_OBJS)
AC_SUBST(COMMON_LIBS)
AC_SUBST(BZ2LIB)
AC_SUBST(ARCH)
AC_SUBST(LIBC)
AC_SUBST(OS)
AC_SUBST(STATIC)
AC_SUBST(LIBUTIL)
AC_SUBST(LIBINTL)
AC_SUBST(SU_PATH)
AC_SUBST(MOUNT_PATH)
AC_SUBST(UMOUNT_PATH)
AC_SUBST(SETUP_VERSION_MAJOR)
AC_SUBST(SETUP_VERSION_MINOR)
AC_SUBST(SETUP_VERSION_RELEASE)
AC_SUBST(BRANDELF)
AC_SUBST(DO_DIALOG)
AC_SUBST(IMAGE)
AC_SUBST(BRAND)
AC_SUBST(BDYNAMIC)
AC_SUBST(LD)
AC_SUBST(SETUP_GTK)
AC_SUBST(GTK_SUBDIR)
AC_OUTPUT(Makefile plugins/Makefile dialog/Makefile)