File: configure.in

package info (click to toggle)
g2 0.72-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,696 kB
  • sloc: ansic: 9,772; sh: 2,734; python: 235; perl: 228; makefile: 210; fortran: 183; cpp: 33
file content (149 lines) | stat: -rw-r--r-- 3,470 bytes parent folder | download | duplicates (6)
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

#
# Check for one project file
#
AC_INIT(src/g2_device.c)

PRODUCT=g2


#
# check cannonical system name,
# and set options for shared libraries (black magic)
#
AC_CANONICAL_HOST
case "$host" in
  *-linux* | *-k*bsd*-gnu | *-gnu*)
		LD_SHARED='ld'
		LD_SHARED_FLAGS='-shared -soname libg2.so.0'
		LD_SHARED_OPT='-lc -lm -lX11 -lgd'
		LD_SHARED_EXT='so.$(RVERSION)'
		AC_DEFINE(LINUX);;
    *-aix*)
		LD_SHARED='ld'
		LD_SHARED_FLAGS='-bM:SRE -bnoentry -bexpall'
		LD_SHARED_OPT='$(LDFLAGS) -lc'
		LD_SHARED_EXT='so'
		AC_DEFINE(AIX);;
    *-osf*)
		LD_SHARED='ld'
		LD_SHARED_FLAGS='-shared'
		LD_SHARED_OPT='$(LDFLAGS) -lc'
		LD_SHARED_EXT='so'
		AC_DEFINE(OSF);;
         *)
		LD_SHARED_EXT='so'
		AC_DEFINE(UNIX);;
esac

AC_SUBST(LD_SHARED)
AC_SUBST(LD_SHARED_FLAGS)
AC_SUBST(LD_SHARED_OPT)
AC_SUBST(LD_SHARED_EXT)

#
# check C compiler, preprocesor, etc.
#
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_CHECK_PROG(FIND, find, find, :)
AC_CHECK_PROG(MAKEDEPEND, makedepend, makedepend, :)
AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)


#
# Try to locate the X Window System include files and libraries
# and add /usr/local to include and lib path and add -lm (for testing)
#
AC_PATH_XTRA
CFLAGS="$CFLAGS $X_CFLAGS"
LIBS="$X_LIBS"


DO_PS='#'
DO_FIG='#'
DO_X11='#'
DO_XDBE='#'
DO_GD='#'
DO_GIF='#'
DO_WIN32='#'


#
# check supported devices
#
AC_CHECK_LIB(m,main,DO_PS='';DO_FIG='';LIBS="$LIBS -lm";AC_DEFINE(DO_PS) AC_DEFINE(DO_FIG),break)
AC_CHECK_LIB(X11, main, DO_X11='';LIBS="$LIBS -lX11";AC_DEFINE(DO_X11))
AC_CHECK_LIB(Xext, main, DO_XDBE='';LIBS="$LIBS -lXext";AC_DEFINE(DO_XDBE))
AC_CHECK_LIB(gd, main, have_gd=yes, have_gd=no)
if test "$have_gd" = yes
then
	LIBS="$LIBS -lgd"
	AC_CHECK_FUNC(gdImagePng, DO_GD='';AC_DEFINE(DO_GD))
	AC_CHECK_FUNC(gdImageGif, DO_GIF='';AC_DEFINE(DO_GIF))
fi

#
# handling cygwin environment (and gd for cygwin == bgd)
#
AC_CYGWIN
if test "$CYGWIN" = yes
then
	LIBS="$LIBS -L/lib/w32api"
	AC_CHECK_LIB(gdi32, main, DO_WIN32='';LIBS="$LIBS -lgdi32";AC_DEFINE(DO_WIN32))
#	AC_CHECK_LIB(bgd, main, have_bgd=yes, have_bgd=no)
#	if test "$have_bgd" = yes
#	then
#		LIBS="$LIBS -lbgd"
#		AC_CHECK_FUNC(gdImagePng, DO_GD='';AC_DEFINE(DO_GD))
#	fi
fi
   
#
# Declare variables which we want substituted in the Makefile.in's
#
AC_SUBST(DO_PS)
AC_SUBST(DO_FIG)
AC_SUBST(DO_X11)
AC_SUBST(DO_XDBE)
AC_SUBST(DO_WIN32)
AC_SUBST(DO_GD)
AC_SUBST(DO_GIF)

AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h)



#
# finally create makefiles using Makefile.in
#
echo
AC_OUTPUT(Makefile demo/Makefile g2_perl/Makefile.PL g2_python/Makefile)

echo
echo "Supported devices:"
if test "$DO_PS"    != "#"; then echo "    PostScript"; fi
if test "$DO_FIG"   != "#"; then echo "    FIG"; fi
if test "$DO_X11"   != "#"; then echo "    X11"; fi
if test "$DO_XDBE"  != "#"; then echo "    Xdbe"; fi
if test "$DO_WIN32" != "#"; then echo "    Win32"; fi
if test "$DO_GD"    != "#"; then echo "    GD"; fi
if test "$DO_GIF"    != "#"; then echo "    GD (GIF)"; fi

echo
echo "Unsupported devices:"
if test "$DO_PS"     = "#"; then echo "    PostScript"; fi
if test "$DO_FIG"    = "#"; then echo "    FIG"; fi
if test "$DO_X11"    = "#"; then echo "    X11"; fi
if test "$DO_XDBE"   = "#"; then echo "    Xdbe"; fi
if test "$DO_WIN32"  = "#"; then echo "    Win32"; fi
if test "$DO_GD"     = "#"; then echo "    GD"; fi
if test "$DO_GIF"    = "#"; then echo "    GD (GIF)"; fi
		   
echo
echo "Run 'make depend' to create dependencies."
echo