File: configure.in

package info (click to toggle)
xnc 5.0.4-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 9,672 kB
  • ctags: 13,113
  • sloc: ansic: 72,174; cpp: 50,020; sh: 4,444; makefile: 1,380; yacc: 316; sed: 16
file content (817 lines) | stat: -rw-r--r-- 18,736 bytes parent folder | download | duplicates (3)
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
dnl# -*- sh -*-
dnl#
dnl# $Id: configure.in,v 1.14 2003/12/25 12:43:18 leo Exp $
dnl#
dnl# Process this file with autoconf to produce a configure script.
dnl#
AC_INIT(src/include/globals.h)


dnl ======================= Package and Verision =======================

PACKAGE=xnc
VERSION=5.0.4

AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)

dnl ====================================================================

if test -z "${CFLAGS}"; then
    if test -z "${CCOPTS}"; then
        CCOPTS='-O'
    fi
    CFLAGS="$CCOPTS"
fi

dnl# Checks for programs.
dnl AC_MAKE_SET

AC_CANONICAL_HOST
changequote(,)dnl
ARCH=`echo $host | sed 's/\([^-]*\)-[^-]*-\([^-]*\)/\1-\2/'`
changequote([,])dnl

dnl Checks for programs.
AC_PREFIX_DEFAULT(/usr)
AC_ISC_POSIX
AC_AIX
AC_MINIX
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PATH_PROG(RM, rm, rm)
AC_PATH_PROG(CP, cp, cp)

AC_SUBST(SHAREFLAGS)
AC_SUBST(LD_SHAREFLAGS)
AC_SUBST(PLUGINS)
AC_SUBST(DEB)
AC_SUBST(BASE_DIR)
AC_SUBST(PO_MAKE_DIR)

BASE_DIR=`pwd`

dnl ****************************************************************
dnl On SCO Unix, there are ELF and COFF binaries.  We want elf to
dnl provide for dlopen() and friends.  With help from Tamas Laufer!
dnl ****************************************************************

case "$ARCH" in
    *sco*|*SCO*)
        AC_MSG_CHECKING("SCO-Unix.  See if we need -belf")
        old_cflags="$CFLAGS"
        CFLAGS="$CFLAGS -belf"
        AC_TRY_COMPILE(
        [
        ],
        [
        ],
        CMFLAGS="$CMFLAGS -belf"
        AC_MSG_RESULT(yes),
        AC_MSG_RESULT(no)
        CFLAGS="$old_cflags")
        ;;
esac

dnl ================ Checking GNU gettext for l10n =====================

AM_GNU_GETTEXT

dnl ====================================================================

dnl Checks for header files.

dnl ======================= X11 checks =================================
AC_PATH_X
AC_PATH_XTRA
dnl ====================================================================

AC_MSG_CHECKING("for long long type")
AC_TRY_COMPILE(
[
#include <stdio.h>
],
[
long long very_long;
],
 AC_DEFINE(HAVE_LONG_LONG)
 AC_MSG_RESULT(yes),
 AC_MSG_RESULT(no))


AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(fcntl.h \
		termios.h \
		sys/ioctl.h \
		sys/select.h \
		sys/time.h \
		sys/sockio.h \
		sys/byteorder.h \
		sys/sigevent.h \
		utmpx.h \
		mntent.h \
		unistd.h \
		errno.h \
		unix.h \
		setjmp.h \
		dirent.h \
		strings.h \
		dlfcn.h \
		malloc.h \
		locale.h \
		X11/extensions/shape.h)

dnl ==================== Checks for libraries. =========================

AC_CHECK_LIB(m, pow)
AC_CHECK_FUNCS(setlocale)

dnl ====================================================================

dnl --------------------------------------------------------------------------
dnl ===========  Additional configure options added for xnc ==================

AC_ARG_ENABLE(debug, [  --enable-debug          Turn on debugging output of xnc],
              xncdebug=yes,
              xncdebug=no)

if test "$xncdebug" = "yes"; then
    DEB="-g -DDEBUG_XNC"
else
    DEB=""
fi


AC_ARG_WITH(pty,
  [  --with-pty=NAME         set the pseudo terminal mode to NAME
                          values are: 
                               OPENPTY
                               SGI4
                               SCO
                               HPUX
                               GLIBC
                               PTC
                               STREAMS
                               BSD],
  [if test x$withval != x; then
     rxvt_cv_ptys=$withval
   else
     rxvt_cv_ptys=detect
  fi])


AC_ARG_ENABLE(oldpty, [  --enable-oldpty         Turn on old style of pty detection],
              xncoldpty=yes,
              xncoldpty=no)


dnl --------------------------------------------------------------------------

AC_ARG_ENABLE(shared, [  --disable-shared        No plugins (shared-lib interface is disabled)],
              configshared=no,
              configshared=yes)

if test "$configshared" = "yes"; then
  PLUGINS="gui_plugins"
  AC_DEFINE(USE_SHARED_LOADING,1)
  AC_CHECK_LIB(dl, dlopen)
  if test "$ac_cv_lib_dl_dlopen" = "yes"; then
    AC_CHECK_FUNCS(dlopen)
  else
    AC_CHECK_LIB(dld, shl_load)
    AC_CHECK_FUNCS(shl_load)
  fi
fi

dnl On SCO, dlopen is in libc.so and requires dlfcn.h to compile.  Thanks
dnl to Tamas Laufer.

if test ! "$ac_cv_func_dlopen" = "yes"; then
AC_MSG_CHECKING("dlopen in libc")
AC_TRY_COMPILE(
[
#include <dlfcn.h>
#ifndef RTLD_NOW
#define RTLD_NOW 0
#endif
],
[ dlopen("foobar", RTLD_NOW);
], AC_DEFINE(HAVE_DLOPEN)
   AC_MSG_RESULT(yes),
   AC_MSG_RESULT(no))
fi

out_lib=${LIBS}




dnl ---------------------- Checking for image libraries ------------------------


AC_CHECK_LIB(jpeg, jpeg_read_scanlines,
[
  echo "JLIB=-ljpeg" > make.conf
  echo "JPGDEFINE=-DLOAD_JPG" >>make.conf
  echo "JINC=" >> make.conf
  echo "JDEP=" >> make.conf
  echo "JLOC="`pwd`"/src/lib/jpeg/libjpeg.a" >> make.conf
  out_lib="$out_lib -ljpeg"
],
[
 echo "JLOC="`pwd`"/src/lib/jpeg/libjpeg.a" >  make.conf
 echo "JPGDEFINE=-DLOAD_JPG" >>make.conf
 echo "JLIB="`pwd`"/src/lib/jpeg/libjpeg.a" >> make.conf
 echo "JINC=-I"`pwd`"/src/lib/jpeg" >> make.conf
 echo "JDEP=\$(JLOC)" >> make.conf
 need_jpeg="yes"
])

AC_CHECK_LIB(tiff, TIFFGetField,
[
  out_lib="$out_lib -ltiff"
  echo "TLIB=-ltiff" >> make.conf
  echo "TIFFDEFINE=-DLOAD_TIF" >>make.conf
  echo "TIFFINC=" >> make.conf
  tiff="TIFF"
],
[
  echo "TLIB=" >> make.conf
  echo "TIFFDEFINE=" >>make.conf
  echo "TIFFINC=" >> make.conf
])


AC_CHECK_LIB(z, inflate,
[
 echo "ZINC=" >>make.conf
 echo "ZLIB=-lz" >>make.conf
 echo "ZDEP=" >>make.conf
 out_lib="$out_lib -lz"
],
[
 echo "ZINC=-I`pwd`/src/lib/zlib" >>make.conf
 echo "ZLIB=`pwd`/src/lib/zlib/libz.a" >>make.conf
 echo "ZDEP=\$(ZLIB)" >>make.conf
])


AC_CHECK_LIB(png, png_get_valid,
[
 echo "PNGDEFINE=-DLOAD_PNG" >>make.conf
 echo "PNG=-DPNG_SUPPORT" >>make.conf
 echo "PNGINC=" >>make.conf
 echo "PNGLIB=-lpng" >>make.conf
 echo "PNGDEP=" >>make.conf
 png="PNG"
 out_lib="$out_lib -lpng"
],
[
 echo "PNGDEFINE=-DLOAD_PNG" >>make.conf
 echo "PNG=-DPNG_SUPPORT" >>make.conf
 echo "PNGINC=-I`pwd`/src/lib/libpng -I`pwd`/src/lib/zlib" >>make.conf
 echo "PNGLIB=`pwd`/src/lib/libpng/libpng.a" >>make.conf
 echo "PNGDEP=\$(PNGLIB)" >>make.conf
 png="PNG"
], -lz -lm)


dnl ---------------------- End image libraries checking ----------------

dnl ==== Checks for typedefs, structures, and compiler characteristics.

AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_TYPE_SIGNAL




dnl ---------------------- Checks for library functions -----------------

AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_CHECK_FUNCS( getcwd \
		mkdir \
		putenv \
		select \
		socket \
		seteuid \
		unsetenv \
		setutent \
		atexit \
		openpty \
		_getpty \
		grantpt \
		unlockpt \
		isastream \
                access
		)



dnl -------------- Defining PO_MAKE_DIR -------------------------

if test "$MSGFMT" != ":"; then
    PO_MAKE_DIR="po"
else
    PO_MAKE_DIR=""
fi


dnl -------------- Checking pty type here -------------------------


AC_CACHE_CHECK(for getpt, rxvt_cv_func_getpt,
[AC_TRY_LINK([#define _GNU_SOURCE
# include <stdlib.h>
],
  [(void)getpt();],
  rxvt_cv_func_getpt=yes, rxvt_cv_func_getpt=no)])
if test x${rxvt_cv_func_getpt} = xyes; then
  AC_DEFINE(HAVE_GETPT)
fi



if test x$xncoldpty = xyes; then

dnl ------------- OLD pty detection technique --------------------

# if we don't guess right then it's up to the user
AC_CACHE_CHECK(for tty/pty type, rxvt_cv_ptys,
[AC_TRY_RUN([#include <stdio.h>
# ifdef HAVE_GETPT
#  define _GNU_SOURCE
# endif
# include <stdlib.h>
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#include <sys/stat.h>
#include <errno.h>
main()
{
    int pty, checkerror;
    FILE *a, *f=fopen("conftestval", "w");
    struct stat statbuf;
    extern int errno;

    if (!f) exit(1);
/* presume that S_IXOTH is required for people to access devices */
    if (stat("/dev", &statbuf) < 0)
	checkerror = 0;
    else
	checkerror = ((statbuf.st_mode & S_IXOTH) == S_IXOTH) ? 1 : 0;
#if defined(__sgi) || defined(sgi) || defined(__sgi__)
    if (stat("/dev/ptc", &statbuf) >= 0)
# ifdef HAVE__GETPTY
	fprintf(f, "SGI4");
# else
	fprintf(f, "SGI3");
# endif
    else
	fprintf(f, "SGI4");
    exit(0);
#endif
#ifdef _SCO_DS
    if (stat("/dev/ttyp20", &statbuf) == 0) {
	fprintf(f, "SCO");
	exit(0);
    }
#endif
/* HPUX: before ptmx */
    pty = open("/dev/ptym/clone", O_RDWR);
    if (pty >= 0 || (checkerror && errno == EACCES)) {
	fprintf(f, "HPUX");
	exit(0);
    }
#if defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT)
# ifdef HAVE_GETPT
    pty = getpt();
    if (pty >= 0 || errno == EACCES) {
	fprintf(f, "GLIBC");
	exit(0);
    }
# endif
    if (stat("/dev/ptmx", &statbuf) >= 0
	&& ((statbuf.st_mode & S_IFCHR) == S_IFCHR))
	if (stat("/dev/pts/0", &statbuf) >= 0
	    && ((statbuf.st_mode & S_IFCHR) == S_IFCHR)
	    && ((pty = open("/dev/ptmx", O_RDWR)) >= 0
		|| (checkerror && errno == EACCES))) {
	    fprintf(f, "USG");
	    exit(0);
    }
#endif
    if (stat("/dev/ttyp20", &statbuf) == 0) {
	fprintf(f, "SCO");
	exit(0);
    }
    fprintf(f, "BSD");
    exit(0);
}], rxvt_cv_ptys=`cat conftestval`, rxvt_cv_ptys=UNKNOWN )])

if test x${rxvt_cv_ptys} = xSCO; then
  AC_DEFINE(PTYS_ARE_NUMERIC)
  AC_SUBST(PTYS_ARE_NUMERIC)
fi
if test x${rxvt_cv_ptys} = xUSG; then
  AC_DEFINE(PTYS_ARE_PTMX)
  AC_SUBST(PTYS_ARE_PTMX)
  AC_DEFINE(PTYS_ARE_SEARCHED)
  AC_SUBST(PTYS_ARE_SEARCHED)
fi
if test x${rxvt_cv_ptys} = xSGI3; then
  AC_DEFINE(PTYS_ARE_PTC)
  AC_SUBST(PTYS_ARE_PTC)
fi
if test x${rxvt_cv_ptys} = xSGI4; then
  AC_DEFINE(PTYS_ARE__GETPTY)
  AC_SUBST(PTYS_ARE__GETPTY)
fi
if test x${rxvt_cv_ptys} = xCONVEX; then
  AC_DEFINE(PTYS_ARE_GETPTY)
  AC_SUBST(PTYS_ARE_GETPTY)
fi
if test x${rxvt_cv_ptys} = xGLIBC; then
  AC_DEFINE(PTYS_ARE_GETPT)
  AC_SUBST(PTYS_ARE_GETPT)
  AC_DEFINE(PTYS_ARE_SEARCHED)
  AC_SUBST(PTYS_ARE_SEARCHED)
fi
if test x${rxvt_cv_ptys} = xHPUX; then
  AC_DEFINE(PTYS_ARE_CLONE)
  AC_SUBST(PTYS_ARE_CLONE)
  AC_DEFINE(PTYS_ARE_SEARCHED)
  AC_SUBST(PTYS_ARE_SEARCHED)
fi
if test x${rxvt_cv_ptys} = xBSD; then
  AC_DEFINE(PTYS_ARE_SEARCHED)
  AC_SUBST(PTYS_ARE_SEARCHED)
fi

else



dnl ====================================================================
dnl --> New version of checking pty/tty taken from rxvt-2.7.6 <---

dnl# if we don't guess right then it's up to the user


if test x$rxvt_cv_ptys = xdetect -o x$rxvt_cv_ptys = x; then

AC_CACHE_CHECK(for pty/tty type, rxvt_cv_ptys,
[if test x$ac_cv_func_openpty = xyes; then
    rxvt_cv_ptys=OPENPTY
 else if test x$ac_cv_func__getpty = xyes; then
    rxvt_cv_ptys=SGI4
 else if test -c /dev/ttyp20; then
    rxvt_cv_ptys=SCO
 else if test -c /dev/ptym/clone; then
    rxvt_cv_ptys=HPUX
 else if test x$rxvt_cv_func_getpt = xyes; then
    rxvt_cv_ptys=GLIBC
 else if test -c /dev/ptc -a -c /dev/pts; then
    rxvt_cv_ptys=PTC
 else if test -c /dev/ptc -a -d /dev/pts; then
    rxvt_cv_ptys=PTC
 else if test -c /dev/ptmx -a -c /dev/pts/0; then
    rxvt_cv_ptys=STREAMS
 else if test x$ac_cv_func_grantpt = xyes && test x$ac_cv_func_unlockpt = xyes; then
dnl# catch CYGWIN
    rxvt_cv_ptys=STREAMS
 else
    rxvt_cv_ptys=BSD
fi
fi
fi
fi
fi
fi
fi
fi
fi
])

fi

if test x$rxvt_cv_ptys = xOPENPTY; then
  AC_DEFINE(PTYS_ARE_OPENPTY)
  AC_SUBST(PTYS_ARE_OPENPTY)
fi
if test x$rxvt_cv_ptys = xSCO; then
  AC_DEFINE(PTYS_ARE_NUMERIC)
  AC_SUBST(PTYS_ARE_NUMERIC)
fi
if test x$rxvt_cv_ptys = xSTREAMS; then
  AC_DEFINE(PTYS_ARE_PTMX)
  AC_SUBST(PTYS_ARE_PTMX)
  if test x$ac_cv_func_access = xyes; then
    AC_DEFINE(PTYS_ARE_SEARCHED)
  fi
fi
if test x$rxvt_cv_ptys = xPTC; then
  AC_DEFINE(PTYS_ARE_PTC)
  AC_SUBST(PTYS_ARE_PTC)
fi
if test x$rxvt_cv_ptys = xSGI4; then
  AC_DEFINE(PTYS_ARE__GETPTY)
  AC_SUBST(PTYS_ARE__GETPTY)
fi
if test x$rxvt_cv_ptys = xCONVEX; then
  AC_DEFINE(PTYS_ARE_GETPTY)
  AC_SUBST(PTYS_ARE_GETPTY)
fi
if test x$rxvt_cv_ptys = xGLIBC; then
  AC_DEFINE(PTYS_ARE_GETPT)
  AC_SUBST(PTYS_ARE_GETPT)
  AC_DEFINE(PTYS_ARE_SEARCHED)  dnl# really needed?
  AC_SUBST(PTYS_ARE_SEARCHED)   dnl# really needed?
fi
if test x$rxvt_cv_ptys = xHPUX; then
  AC_DEFINE(PTYS_ARE_CLONE)
  AC_SUBST(PTYS_ARE_CLONE)
  AC_DEFINE(PTYS_ARE_SEARCHED)  dnl# really needed?
  AC_SUBST(PTYS_ARE_SEARCHED)   dnl# really needed?
fi
if test x$rxvt_cv_ptys = xBSD; then
  AC_DEFINE(PTYS_ARE_SEARCHED)
  AC_SUBST(PTYS_ARE_SEARCHED)
fi

fi

dnl --------------------------------------------------------------







CFLAGS=${CFLAGS--O}
LDFLAGS=${LDFLAGS--O}
CPPFLAGS="$CPPFLAGS"
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
dnl# common parts of the Makefile
MCOMMON=./Make.common
AC_SUBST_FILE(MCOMMON)


dnl -------------- Check for SHARED resource compiling -------------

if test "$configshared" = "yes"; then

dnl Some versions of (g)cc need to export the symbols from the main program
dnl using -export-dynamic or (older versions) -rdynamic.  See whether
dnl this gcc understands this flag.

AC_MSG_CHECKING("whether LDFLAGS need -export-dynamic")
  old_ldflags="$LDFLAGS"
  LDFLAGS="-export-dynamic $LDFLAGS"
  AC_TRY_RUN(
main()
{ exit(0);
},
     if grep 'unrecognized option `-export-dynamic'"'" config.log >/dev/null; then
       AC_MSG_RESULT(no)
       LDFLAGS="$old_ldflags"
     else
       AC_MSG_RESULT(yes)
       exportdynamic=done
     fi,
     AC_MSG_RESULT(no)
     LDFLAGS="$old_ldflags",
     AC_MSG_RESULT(no)
     LDFLAGS="$old_ldflags")

if test "$exportdynamic" != "done"; then
AC_MSG_CHECKING("whether LDFLAGS need -rdynamic")
  old_ldflags="$LDFLAGS"
  LDFLAGS="-rdynamic $LDFLAGS"
  AC_TRY_RUN(
main()
{ exit(0);
},
     if grep 'unrecognized option `-rdynamic'"'" config.log >/dev/null; then
       AC_MSG_RESULT(no)
       LDFLAGS="$old_ldflags"
     else
       AC_MSG_RESULT(yes)
     fi,
     AC_MSG_RESULT(no)
     LDFLAGS="$old_ldflags",
     AC_MSG_RESULT(no)
     LDFLAGS="$old_ldflags")
fi      dnl test for -exportdynamic



dnl Check for -fpic option for dll

AC_MSG_CHECKING("whether LDFLAGS need -fpic")
  old_ldflags="$LDFLAGS"
  LDFLAGS="-fpic $LDFLAGS"
  AC_TRY_RUN(
main()
{ exit(0);
},
     if grep 'unrecognized option `-fpic'"'" config.log >/dev/null; then
       AC_MSG_RESULT(no)
       LDFLAGS="$old_ldflags"
     else
       LDFLAGS="$old_ldflags"
       SHAREFLAGS=-fpic
       AC_MSG_RESULT(yes)
     fi,
     AC_MSG_RESULT(no)
     LDFLAGS="$old_ldflags",
     AC_MSG_RESULT(no)
     LDFLAGS="$old_ldflags")


dnl Some specific OS stuff

case "$ARCH" in
  *linux*)
           AC_DEFINE(SO_EXT, "so")
        ;;
  *hppa*|*hpux*)
        AC_DEFINE(SO_EXT, "so")
        if test "$GCC" = "yes"; then
            LDFLAGS="$LDFLAGS -Wl,-E"
	    LD_SHAREFLAGS="-Wl,-b"
        else
            LDFLAGS="$LDFLAGS -E"
        fi
        ;;
  *solaris*)
        AC_DEFINE(SO_EXT, "so")
        if test "$GCC" = "yes"; then
		AC_MSG_CHECKING("whether we need -fpermissive")
		old_cflags="$CFLAGS"
		CFLAGS="-fpermissive $CFLAGS"
		AC_TRY_RUN(
		main()
		{ exit(0);
		},
	        if grep 'option `-fpermissive'"'" config.log >/dev/null; then
	           AC_MSG_RESULT(no)
	           CFLAGS="$old_cflags"
	        else
	           CFLAGS="$old_cflags -fpermissive"
	           AC_MSG_RESULT(yes)
	        fi,
	        AC_MSG_RESULT(no)
	        CFLAGS="$old_cflags",
	        AC_MSG_RESULT(no)
	        CFLAGS="$old_cflags")


	        AC_MSG_CHECKING("whether we need -mimpure-text")
		old_cflags="$CFLAGS"
		CFLAGS="-mimpure-text $CFLAGS"
		AC_TRY_RUN(
		main()
		{ exit(0);
		},
	        if grep 'option `-mimpure-text'"'" config.log >/dev/null; then
	           AC_MSG_RESULT(no)
	           CFLAGS="$old_cflags"
	        else
	           CFLAGS="$old_cflags"
  	           LD_SHAREFLAGS="-mimpure-text"
	           AC_MSG_RESULT(yes)
	        fi,
	        AC_MSG_RESULT(no)
	        CFLAGS="$old_cflags",
	        AC_MSG_RESULT(no)
	        CFLAGS="$old_cflags")
		if test "$LD_SHAREFLAGS" = "-mimpure-text"; then
  	           LD_SHAREFLAGS="-mimpure-text -Wl,-ztextoff"
		fi
        fi
        ;;
  *aix*)
        AC_DEFINE(SO_EXT, "so")
        if test "$GCC" = "yes"; then
            LDFLAGS="$LDFLAGS -Wl,-bexpall"
	    LD_SHAREFLAGS="-Wl,-berok"
        else
            LDFLAGS="$LDFLAGS -bexpall"
	    LD_SHAREFLAGS="-berok"
        fi
        ;;
  *darwin*)
        LD_SHAREFLAGS="-dynamiclib -undefined suppress"
	;;
  *)
        AC_DEFINE(SO_EXT, "so")
        ;;
esac

fi

dnl ------------------------- End SHARED part --------------------------------

if test ! -z "${need_jpeg}"; then
  AC_CONFIG_SUBDIRS(src/lib/jpeg)
fi

AC_CONFIG_HEADER(src/include/config.h)
AC_OUTPUT(Make.common  intl/Makefile po/Makefile.in \
    Makefile \
    reconfig \
    src/include/xncdirs.h \
    src/makefile \
    src/lib/makefile \
    src/helpers/makefile \
    src/lib/image2/makefile \
    src/lib/northgui/makefile \
    src/lib/vfs/makefile \
    src/lib/filedir/makefile \
    src/lib/manage/makefile \
    src/lib/tool/makefile \
    src/lib/rxvt2/makefile \
    src/lib/xbitmaps/makefile \
    src/ives/makefile \
    src/xsetup/makefile \
    src/launch/makefile \
    src/xjroot/makefile \
    src/plugins/makefile \
    src/plugins/five/makefile \
    src/plugins/aqua/makefile \
    src/plugins/theme/makefile \
    src/lib/libpng/makefile \
    src/lib/zlib/Makefile \
    src/config_doc.cxx \
    iconset/makefile) 

 echo "NO_ALT=" >>make.conf
 rus="enabled"

 echo "PSEUDO=-DPSEUDOCOLOR" >>make.conf
 pse="PseudoColor; TrueColor;"


 bmp="BMP"

 xpm="XPM"

 pcx="PCX"

 targa="TGA"

 echo "PCD=-DPCD_SUPPORT" >>make.conf
 pcd="PhotoCD"

ln -sf src/include/config.h config.h

echo "---------------X Northern Captain Project----------------------"

echo "
Configuration:

  Source code location:     ${srcdir}
  C Compiler:               ${CC}
  C Compiler flags:         ${CFLAGS}
  C++ Compiler:             ${CXX}
  Libraries:                ${out_lib}
  Install path:             ${prefix}/bin
  Man pages path:           ${prefix}/man
  X11 versions:            ${X_LIBS}
  X Visuals:                ${pse}
  Image formats:            JPEG GIF LBM ${pcd} ${tiff} ${xpm} ${pcx} ${bmp} ${targa} ${png}
  IVES Russian:             ${rus}
  Pseudo terminal type:     ${rxvt_cv_ptys}
"
echo "---------------------------------------------------------------"
echo ""
echo "Use ./reconfig for changing these settings before compile XNC"
echo "then type 'make' for building XNC binaries, and after that"
echo "do 'make install' as 'root'."
echo ""
echo "Thank you..."
chmod 755 ${srcdir}/reconfig