~ubuntu-branches/ubuntu/precise/pcb/precise

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Hamish Moffatt
  • Date: 2005-02-20 13:14:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050220131400-pfz66g5vhx0azl8f
Tags: 1.99j+20050127-2
* Improved package description: (closes: #295405)
* Fixed dependency: tk84 -> tk8.4 (closes: #295404)
* Updated README.debian (closes: #269578)
* Applied patch to src/djopt.c to allow compilation with gcc-4.0
  (closes: #294319), thanks to Andreas Jochens for the patch.
* Prevent example files from being compressed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl $Id: configure.ac,v 1.23.2.1 2005/01/27 11:26:38 danmc Exp $
 
2
dnl Process this file with autoconf to produce a configure script.
 
3
 
 
4
AC_INIT(src/pinout.c)
 
5
AM_INIT_AUTOMAKE(pcb, 20050127)
 
6
AM_CONFIG_HEADER(config.h)
 
7
 
 
8
AM_MAINTAINER_MODE
 
9
 
 
10
dnl Checks for programs.
 
11
AC_PROG_CC
 
12
AC_PROG_CC_STDC
 
13
AM_PROG_LEX
 
14
AC_PROG_YACC
 
15
AC_PROG_INSTALL
 
16
AC_CHECK_PROGS(M4, gm4 m4)
 
17
 
 
18
AC_PATH_PROGS(WISH, wish wish83 wish8.3 wish80 wish8.0 cygwish83 cygwish80,[none])
 
19
if test "X$WISH" = "Xnone" ; then
 
20
        AC_ERROR([Did not find the wish executible.  You need to make sure
 
21
        that tcl is installed on your system and that wish is in your path])
 
22
fi
 
23
 
 
24
AC_DEFINE_UNQUOTED(M4,$M4,[m4 executible])
 
25
GNUM4=$M4
 
26
AC_SUBST(GNUM4)
 
27
AC_DEFINE_UNQUOTED(GNUM4,"$M4",[m4 program used by pcb])
 
28
AC_CHECK_PROGS(LATEX, latex)
 
29
AC_CHECK_PROGS(DVIPS, dvips)
 
30
AC_CHECK_PROGS(TGIF, tgif, true)
 
31
AC_CHECK_PROGS(PS2PDF, ps2pdf)
 
32
 
 
33
dnl Checks for libraries.
 
34
AC_CHECK_LIB(m, sqrt)
 
35
AC_CHECK_LIB(xnet, gethostbyname)
 
36
AC_CHECK_LIB(fl, yywrap)
 
37
AC_CHECK_FUNCS(strerror)
 
38
AC_CHECK_FUNCS(regcomp re_comp)
 
39
AC_CHECK_FUNCS(logf expf rint)
 
40
AC_PATH_XTRA
 
41
AC_ARG_WITH([libstroke],
 
42
[  --without-libstroke     disable libstroke support (default: enabled)],
 
43
AC_CHECK_LIB(stroke, main, , AC_ERROR([libstroke not found.  Please specify its location or configure --without-libstroke]))
 
44
)
 
45
AC_CHECK_LIB(X11, XOpenDisplay, , , $X_LIBS)
 
46
AC_CHECK_LIB(ICE, main, , , $X_LIBS)
 
47
AC_CHECK_LIB(SM, main, , , $X_LIBS)
 
48
AC_CHECK_LIB(Xext, main, , , $X_LIBS)
 
49
AC_CHECK_LIB(Xt, XtOpenDisplay, , , $X_LIBS)
 
50
AC_CHECK_LIB(Xmu, main, , , $X_LIBS)
 
51
AC_CHECK_LIB(Xpm, main, , , $X_LIBS)
 
52
 
 
53
AC_ARG_WITH([xaw],
 
54
[  --with-xaw=Xaw         Use the specified Athena Widgets type.
 
55
                          For example, Xaw, or Xaw3d.
 
56
                          [default = Xaw]],
 
57
[
 
58
if test "X$with_xaw" = "Xno" ; then
 
59
        AC_ERROR([--without-xaw is not allowed])
 
60
fi
 
61
],
 
62
[
 
63
with_xaw=Xaw
 
64
])
 
65
 
 
66
AC_CHECK_LIB($with_xaw, XawInitializeWidgetSet, , 
 
67
        AC_ERROR([You must have some version of Xaw installed on your system]), $X_LIBS)
 
68
LIBXAW=$with_xaw
 
69
XAWINC=$with_xaw
 
70
 
 
71
dnl Determine the Xfuncproto control definitions:
 
72
FC_CHECK_X_PROTO_DEFINE(FUNCPROTO)
 
73
if test -n "$fc_x_proto_value"; then
 
74
        AC_DEFINE_UNQUOTED(FUNCPROTO, $fc_x_proto_value, [FUNCPROTO used by Xaw])
 
75
fi
 
76
FC_CHECK_X_PROTO_DEFINE(NARROWPROTO)
 
77
if test -n "$fc_x_proto_value"; then
 
78
        AC_DEFINE_UNQUOTED(NARROWPROTO, $fc_x_proto_value, [NARROWPROTO used by Xaw])
 
79
fi
 
80
 
 
81
_use_rpath=yes
 
82
AC_MSG_CHECKING([if hardcoding of the X11 runtime library path is desired])
 
83
AC_ARG_ENABLE([rpath],
 
84
[  --disable-rpath         Disable hardcoding the X11 runtime library path [default=enabled]],
 
85
[
 
86
if test "X$enable_rpath" = "Xno" ; then
 
87
        AC_MSG_RESULT([no])
 
88
        _use_rpath=no
 
89
else
 
90
        AC_MSG_RESULT([yes])
 
91
        _use_rpath=yes
 
92
fi
 
93
],
 
94
[
 
95
        AC_MSG_RESULT([yes])
 
96
        _use_rpath=yes
 
97
])
 
98
 
 
99
if test "X$_use_rpath" = "Xyes" ; then
 
100
dnl Try to figure out if we need -Rpath for finding X11 libs
 
101
dnl at runtime.  Why autoconf doesn't already do this, I don't
 
102
dnl know...
 
103
xlib_path=""
 
104
for p in $X_LIBS ; do
 
105
    case $p in
 
106
    -L*)
 
107
        xlib_path="$xlib_path $p"
 
108
        ;;
 
109
 
 
110
    esac
 
111
done
 
112
xlib_rpath=`echo $xlib_path | sed 's/-L/-R/g'`
 
113
 
 
114
pcb_save_LIBS=$LIBS
 
115
LIBS="$LIBS $X_LIBS"
 
116
rpath=""
 
117
for fl in "-Wl,-rpath " "-Wl,--rpath " "-rpath " "--rpath " "-Wl,-R" "-R" "-R " ; do
 
118
    xlib_rpath=`echo $xlib_path | sed "s/-L/$fl/g"`
 
119
    LIBS="$pcb_save_LIBS $X_LIBS $xlib_rpath"
 
120
    AC_MSG_CHECKING([if the compiler accepts ${fl}path for runtime libraries])
 
121
    AC_LINK_IFELSE([AC_LANG_PROGRAM()],
 
122
        AC_MSG_RESULT([yes])
 
123
        rpath=$fl, 
 
124
        AC_MSG_RESULT([no]))
 
125
    test -n "$rpath" && break
 
126
done
 
127
if test -n "$rpath"; then
 
128
   X_LIBS="$X_LIBS $xlib_rpath"
 
129
fi
 
130
LIBS=$pcb_save_LIBS
 
131
fi
 
132
 
 
133
dnl Checks for header files.
 
134
AC_HEADER_STDC
 
135
AC_CHECK_HEADERS(string.h)
 
136
AC_CHECK_HEADERS(regex.h)
 
137
 
 
138
dnl Checks for typedefs, structures, and compiler characteristics.
 
139
 
 
140
dnl Checks for data types
 
141
 
 
142
dnl Checks for library functions.
 
143
 
 
144
# ------------- dmalloc -------------------
 
145
dnl dmalloc checks
 
146
AC_MSG_CHECKING([if dmalloc debugging should be enabled])
 
147
AC_ARG_ENABLE([dmalloc],
 
148
[  --enable-dmalloc        Compile and link with dmalloc for malloc debugging [default=no]],
 
149
[
 
150
if test "X$enable_dmalloc" != "Xno" ; then
 
151
        AC_MSG_RESULT([yes])
 
152
        AC_CHECK_HEADER(dmalloc.h,,
 
153
                AC_ERROR([You have requested dmalloc debugging but dmalloc.h could not be found]))
 
154
        AC_CHECK_LIB(dmalloc,main,,
 
155
                AC_ERROR([You have requested dmalloc debugging but -ldmalloc could not be found]), $X_LIBS)
 
156
        DMALLOC_LIBS="-ldmalloc"
 
157
else
 
158
        AC_MSG_RESULT([no])
 
159
        DMALLOC_LIBS=""
 
160
fi
 
161
],
 
162
[
 
163
        AC_MSG_RESULT([no])
 
164
        DMALLOC_LIBS=""
 
165
])
 
166
 
 
167
# ------------- ElectricFence -------------------
 
168
dnl ElectricFence checks
 
169
AC_MSG_CHECKING([if ElectricFence debugging should be enabled])
 
170
AC_ARG_ENABLE([efence],
 
171
[  --enable-efence         Link with ElectricFence for malloc debugging [default=no]],
 
172
[
 
173
if test "X$enable_efence" != "Xno" ; then
 
174
        AC_MSG_RESULT([yes])
 
175
        AC_CHECK_LIB(efence,main,,
 
176
                AC_ERROR([You have requested ElectricFence debugging but -lefence could not be found]), $X_LIBS)
 
177
else
 
178
        AC_MSG_RESULT([no])
 
179
fi
 
180
],
 
181
[
 
182
AC_MSG_RESULT([no])
 
183
])
 
184
 
 
185
# XXX fix this!!!
 
186
#if [ test "x$prefix" = xNONE ]; then
 
187
#       datadir=$ac_default_prefix/share
 
188
#else
 
189
#       datadir=$prefix/share
 
190
#fi
 
191
 
 
192
# font filename
 
193
FONTFILENAME=${FONTFILENAME:-"default_font"}
 
194
AC_SUBST(FONTFILENAME)
 
195
AC_DEFINE_UNQUOTED(FONTFILENAME,"$FONTFILENAME",[File for default font])
 
196
 
 
197
# directory for old-style library and for fonts
 
198
PCBLIBDIR=${datadir}/pcb
 
199
AC_SUBST(PCBLIBDIR)
 
200
#AC_DEFINE_UNQUOTED(PCBLIBDIR,"$PCBLIBDIR",[Library directory])
 
201
CPPFLAGS="$CPPFLAGS -DPCBLIBDIR=\\\"$PCBLIBDIR\\\""
 
202
 
 
203
# name for old-style library
 
204
LIBRARYFILENAME=pcblib
 
205
AC_SUBST(LIBRARYFILENAME)
 
206
AC_DEFINE_UNQUOTED(LIBRARYFILENAME,"$LIBRARYFILENAME",[library file name])
 
207
 
 
208
 
 
209
# directory for new library
 
210
PCBTREEDIR=${datadir}/pcb/newlib
 
211
PCBTREEDIR=${PCBTREEDIR:-"$PCBTREEDIR"}
 
212
AC_SUBST(PCBTREEDIR)
 
213
#AC_DEFINE_UNQUOTED(PCBTREEDIR,"$PCBLIB",[top directory for new style pcb library])
 
214
CPPFLAGS="$CPPFLAGS -DPCBTREEDIR=\\\"$PCBTREEDIR\\\""
 
215
 
 
216
# if we have gcc then add -Wall
 
217
if test "x$GCC" = "xyes"; then
 
218
        if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
 
219
                CFLAGS="$CFLAGS -Wall"
 
220
        fi
 
221
fi
 
222
 
 
223
CFLAGS="$CFLAGS $X_CFLAGS"
 
224
LIBS="$LIBS $X_LIBS $DMALLOC_LIBS"
 
225
 
 
226
BTNMOD=${BTNMOD:-"Mod1"}
 
227
AC_SUBST(BTNMOD)
 
228
 
 
229
AC_OUTPUT(
 
230
        Makefile
 
231
        README_FILES/Makefile
 
232
        doc/Makefile
 
233
        example/Makefile
 
234
        example/libraries/Makefile
 
235
        lib/CreateLibraryContents.sh
 
236
        lib/CreateLibrary.sh
 
237
        lib/Makefile
 
238
        lib/QueryLibrary.sh
 
239
        lib/qfp-ui
 
240
        newlib/2_pin_thru-hole_packages/Makefile
 
241
        newlib/Makefile
 
242
        newlib/analog-devices/Makefile
 
243
        newlib/burr-brown/Makefile
 
244
        newlib/connectors/Makefile
 
245
        newlib/crystal/Makefile
 
246
        newlib/cypress/Makefile
 
247
        newlib/electro-optics/Makefile
 
248
        newlib/generic_SMD_packages/Makefile
 
249
        newlib/headers/Makefile
 
250
        newlib/msp430/Makefile
 
251
        newlib/not_vetted_ingo/Makefile
 
252
        newlib/sockets/Makefile
 
253
        newlib/tests/Makefile
 
254
        newlib/toko/Makefile
 
255
        src/Makefile
 
256
        src/script/Makefile
 
257
        src/icons/Makefile
 
258
        tools/Makefile
 
259
        tutorial/Makefile
 
260
        )
 
261
 
 
262