File: autostuff

package info (click to toggle)
alliance 5.0-20120515-6
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 70,324 kB
  • ctags: 39,977
  • sloc: ansic: 350,299; vhdl: 34,227; yacc: 27,122; sh: 12,416; cpp: 9,478; makefile: 7,057; lex: 3,684
file content (345 lines) | stat: -rwxr-xr-x 11,707 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
#$Log: autostuff,v $
#Revision 1.15  2012/04/17 08:04:27  alliance
#Removed generation of the old alliance.spec (now uses alliance-fedora.spec).
#
#Revision 1.14  2011/09/13 11:39:15  alliance
#Remove also automake script ylwrap.
#
#Revision 1.13  2011/02/09 22:48:53  jpc
#Replace AC_PROG_RANLIB by AC_PROG_LIBTOOL.
#
#Revision 1.12  2005/04/15 08:38:29  alliance
#
#* alliance/src/ : porting under Darwin/MacOS X
#  - Bug : the Darwin link editor seems to be more strict, or having a
#     different policy about implicit static/extern variables. We have
#     to do a lot of cleanup to avoid symbols redefinition at link time.
#     We do hope it may solve the earlier bison problem with asimut...
#
#Revision 1.11  2004/07/26 17:51:23  ludo
#- operator '==' doesn't exists/not compatible with old /bin/sh version
#  (such as the one installed under Solaris or Cygwin ...)
#  Replaced by '=' and here in the context it doesn't matter
#  (no need of a pattern string matching/comparison ...)
#
#Revision 1.10  2004/07/26 12:34:39  fred
#Added a test on Makefile.am to avoid errors when making 'clean'.
#Sources without Makefile.am in their top directory are now totally
#ignored.
#
###################################################
## Possible arguments: 
##  - clean : to sweap all built files
##  - dirs  : to build only in dirs
###################################################

## Is it a clean
if  test "$1" = "clean" ; then
   find . -name Makefile.in -exec rm {} \; -print
   find . -name aclocal.m4 -exec rm {} \; -print
   find . -name configure -exec rm {} \; -print
   find . -name autom4te.cache -exec rm -r {} \; -print
   rm -f mkinstalldirs
   rm -f missing
   rm -f install-sh
   rm -f depcomp
   rm -f ylwrap
   rm -f distrib/alliance.spec
   exit
fi 


## take parameters for directories or take all dirs by default
if [ $# -eq 0 ] ; then
dirs=`\ls -l $srcdir | grep '^d' | awk '{print $NF}'`
else
dirs=$*
fi
newdirs=""
for dir in $dirs; do
  if [ "$dir" = "CVS"            ]; then continue; fi
  if [ "$dir" = "autom4te.cache" ]; then continue; fi
  if [ "$dir" = "Linux"          ]; then continue; fi
  if [ "$dir" = "Solaris"        ]; then continue; fi
  if [ "$dir" = "documentation"  ]; then continue; fi
  if [ ! -f "$dir/Makefile.am"    ]; then continue; fi
  newdirs="$newdirs $dir"
done
dirs="$newdirs documentation"


## Order directories.
order="mbk mbkal mbkap mbkedif mbkhilo mbkmg mbkspice mbkvhdl mbkvrlog mbkvti \
       mbkvhdlg aut rds rdscif rdsgds elp abl bdd log btr vex ctl ctp abe abt \
       abv fsm fks fvh ftl rtn rtd scl vbh vbl vpn vpd vvh vtl pat ppt phl gcp \
       druc beh bhl bvl"
ordered_dirs=""
for lib in $order; do
   if echo "$dirs" | grep $lib > /dev/null ; then
     dirs=`echo "$dirs" | sed "s, $lib , ,"`
     if [ -z "$ordered_dirs" ]; then
       ordered_dirs="$lib"
     else
       ordered_dirs="$ordered_dirs $lib"
     fi
   fi
done
ordered_dirs="$ordered_dirs $dirs"

AC_OUTPUT=`find $ordered_dirs -name Makefile.am | sed "s,\.am,,"`

rm -f configure.in
echo ""                                      >> configure.in
echo "AC_INIT(./autostuff)"                  >> configure.in
echo "AM_INIT_AUTOMAKE(alliance, 5.0)"       >> configure.in
echo ""                                      >> configure.in
echo "AM_PROG_LEX"                           >> configure.in
echo "AM_PROG_LIBTOOL"                       >> configure.in
echo "AC_CHECK_HEADERS(fcntl.h malloc.h strings.h sys/time.h unistd.h)" >>  configure.in
echo "AC_CHECK_HEADERS(strings.h unistd.h)"  >> configure.in
echo "AC_CHECK_LIB(gen, basename)"           >> configure.in
echo "AC_CHECK_LIB(iberty, basename)"        >> configure.in
echo "AC_CHECK_LIB(m, exp)"                  >> configure.in
echo "AC_CHECK_LIB(m, floor)"                >> configure.in
echo "AC_CHECK_LIB(m, pow)"                  >> configure.in
echo "AC_CHECK_LIB(m, sqrt)"                 >> configure.in
echo "AC_CHECK_PROG(SED, sed, sed)"          >> configure.in
echo "AC_CHECK_PROGS(SED, gsed sed)"         >> configure.in
echo "AC_C_CONST"                            >> configure.in
echo "AC_FUNC_VFORK"                         >> configure.in
echo "AC_HEADER_STDC"                        >> configure.in
echo "AC_HEADER_SYS_WAIT"                    >> configure.in
echo "AC_PATH_XTRA"                          >> configure.in
echo "AC_PROG_CC"                            >> configure.in
echo "AC_PROG_CPP"                           >> configure.in
echo "AC_PROG_CXX"                           >> configure.in
echo "AC_PROG_INSTALL"                       >> configure.in
echo "AC_PROG_MAKE_SET"                      >> configure.in
echo "AC_PROG_LIBTOOL"                       >> configure.in
echo "AC_PROG_YACC"                          >> configure.in
echo "AC_TYPE_SIGNAL"                        >> configure.in

cat >> configure.in <<"EOF"
dnl
dnl Check for X stuff
dnl
dnl
dnl Check X options
dnl
if test "$with_x" = no; then
AC_MSG_ERROR([requires the X window system to compile and run.
                  Please do not use the configure option '--without-x'.])
fi
if test "$with_motif" = no; then
AC_MSG_ERROR([requires Motif to compile and run.
                  Please do not use the configure option '--without-motif'.])
fi
dnl
dnl
dnl Check for X libraries
dnl
if test "$with_x" != no; then
ice_save_LIBS="$LIBS"
ice_save_CFLAGS="$CFLAGS"
ice_save_CXXFLAGS="$CXXFLAGS"
ice_save_CPPFLAGS="$CPPFLAGS"
ice_save_LDFLAGS="$LDFLAGS"

dnl
dnl

AC_FIND_MOTIF
AC_FIND_XPM

dnl
dnl
dnl
LIBS="$LIBS $X_EXTRA_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS"
dnl
dnl Check for X library
dnl
X11_LIBS=""
AC_CHECK_LIB(X11, XOpenDisplay, X11_LIBS="-lX11",,${X_PRE_LIBS} ${X_EXTRA_LIBS})
if test "$X11_LIBS" = ""; then
dnl Not having X is fatal.  Let the user fix this.
AC_MSG_ERROR([The X11 library '-lX11' could not be found.
                  Please use the configure options '--x-includes=DIR'
                  and '--x-libraries=DIR' to specify the X location.])
fi
AC_SUBST(X_LIBS)
AC_SUBST(X11_LIBS)
AC_SUBST(X_PRE_LIBS)
dnl
dnl
dnl Check for -lXintl library.  Lutz Kittler <kittler@sse-erfurt.de> says
dnl that DLD-Linux with CDE wants `-lXintl' to refine `Xlcmbcurmax'.
dnl Guenther Roehrich <guenther@studbox.uni-stuttgart.de> says that
dnl we must check for `_Xlcmbcurmax' instead of `Xlcmbcurmax'.
dnl
AC_CHECK_LIB(Xintl, _Xlcmbcurmax, X11_LIBS="${X11_LIBS} -lXintl",,
	${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
dnl
dnl
dnl Check for -lipc library.  SCO unix is said to want that.
dnl
AC_CHECK_LIB(ipc, shmap, X11_LIBS="${X11_LIBS} -lipc",,
	${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
dnl
dnl
dnl Check for X toolkit libraries
dnl
XT_LIBS=""
AC_CHECK_LIB(Xt, XtToolkitInitialize, XT_LIBS="-lXt",,
	${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
if test "$XT_LIBS" = ""; then
dnl Not having Xt is fatal.  Let the user fix this.
AC_MSG_ERROR([The X toolkit library '-lXt' could not be found.
                  Please use the configure options '--x-includes=DIR'
                  and '--x-libraries=DIR' to specify the X location.
                  See the files 'config.log' and 'ddd/config.log'
                  for further diagnostics.])
fi
AC_SUBST(XT_LIBS)
dnl
dnl
dnl Check for X extension libraries
dnl
dnl
XEXT_LIBS=""
AC_CHECK_LIB(Xext, XShapeQueryVersion, XEXT_LIBS="-lXext",,
	${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
AC_SUBST(XEXT_LIBS)
dnl
dnl
dnl
dnl Check for Xpm library and headers
dnl
XPM_LIBS=""
if test "$xpm_includes" != "no" && test "$xpm_libraries" != "no"
then
AC_CHECK_LIB(Xpm, XpmCreatePixmapFromXpmImage,
	XPM_LIBS="-lXpm"
	AC_DEFINE(HAVE_XPM),,${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
if test "$XPM_LIBS" != ""; then
AC_CHECK_HEADERS(X11/xpm.h xpm.h)
fi
fi
AC_SUBST(XPM_LIBS)

dnl Check for Motif widget libraries
dnl

XM_LIBS=""
XP_LIBS=""
if test "$motif_includes" != "no" && test "$motif_libraries" != "no"
then
dnl Motif 2.1 wants `-lXp' (X11R6.3 print server)
AC_CHECK_LIB(Xp, XpSelectInput,
	XP_LIBS="-lXp"
	AC_DEFINE(HAVE_XP),,
                   ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
dnl
AC_CHECK_LIB(Xm, XmCreateOptionMenu, 
	XM_LIBS="-lXm"
	AC_DEFINE(HAVE_MOTIF),,
	${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
dnl
AC_CHECK_LIB(Xm, xmUseVersion, 
	AC_DEFINE(HAVE_XMUSEVERSION),,
	${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
dnl
AC_CHECK_LIB(Xm, XmInstallImage,
	AC_DEFINE(HAVE_XMINSTALLIMAGE),,
	${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
dnl
AC_CHECK_LIB(Xm, Xm21InstallImage,
	AC_DEFINE(HAVE_XM21INSTALLIMAGE),,
	${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS})
fi
if test "$XM_LIBS" = ""; then
dnl Without Motif, we won't get far.  Let the user fix this.
AC_MSG_ERROR([The Motif library '-lXm' could not be found.
                  Please use the configure options '--with-motif-includes=DIR'
                  and '--with-motif-libraries=DIR' to specify the Xm location.
                  See the files 'config.log'
                  for further diagnostics.])
fi

AC_SUBST(XP_LIBS)
AC_SUBST(XM_LIBS)

LIBS="$LIBS ${XM_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}"
    
    
LIBS="$ice_save_LIBS"
CFLAGS="$ice_save_CFLAGS"
CXXFLAGS="$ice_save_CXXFLAGS"
CPPFLAGS="$ice_save_CPPFLAGS"
LDFLAGS="$ice_save_LDFLAGS"
fi
EOF

echo "AM_ALLIANCE"                                 >> configure.in
echo "AM_CONDITIONAL([ALLIANCE_BUILD],[(exit 0)])" >> configure.in

find $ordered_dirs -name configure.in | while read config; do
  echo "Scanning $config"
  echo "" >> configure.in
  echo "dnl Infos extracted from $config"  >> configure.in

  for version_line in  `grep -h _CUR= $config`; do
    echo "$version_line"  >> configure.in
    version_name=`echo $version_line | sed 's,=.*,,'`
    echo "AC_SUBST($version_name)" >> configure.in
  done
  for version_line in  `grep -h _REV= $config`; do
    echo "$version_line"  >> configure.in
    version_name=`echo $version_line | sed 's,=.*,,'`
    echo "AC_SUBST($version_name)" >> configure.in
  done
  for version_line in  `grep -h _REL= $config`; do
    echo "$version_line"  >> configure.in
    version_name=`echo $version_line | sed 's,=.*,,'`
    echo "AC_SUBST($version_name)" >> configure.in
  done

  for dll_line in `grep -h _DLL_VERSION= $config`; do
    echo "$dll_line"  >> configure.in
    dll_name=`echo $dll_line | sed 's,=.*,,'`
    echo "AC_SUBST($dll_name)" >> configure.in
  done
  for version_line in  `grep -h _VERSION= $config | grep -v DLL`; do
    echo "$version_line"  >> configure.in
    version_name=`echo $version_line | sed 's,=.*,,'`
    echo "AC_SUBST($version_name)" >> configure.in
  done
done

# Debian: workaround for missing configure.in's in subdirs:
cat configure-extracts >> configure.in

echo ""                                      >> configure.in
echo "TOOLSDIRS=\"$ordered_dirs\""           >> configure.in
echo "AC_SUBST(TOOLSDIRS)"                   >> configure.in

echo ""                                      >> configure.in
echo "AC_OUTPUT(["                           >> configure.in
echo "Makefile"                              >> configure.in
echo "distrib/etc/alc_env.sh"                >> configure.in
echo "distrib/etc/alc_env.csh"               >> configure.in
for template in $AC_OUTPUT; do
  echo "$template"                           >> configure.in
done
echo "])"                                    >> configure.in


aclocal -I .
libtoolize --force --copy --automake
automake --foreign --add-missing --copy -f
autoconf

exit 0