| 1 |
dnl --------------------------------------------------------------------------- |
| 2 |
dnl This file offers the following macros... |
| 3 |
dnl --------------------------------------------------------------------------- |
| 4 |
dnl MH_IPC |
| 5 |
dnl MH_CHECK_X_INC |
| 6 |
dnl MH_CHECK_X_LIB |
| 7 |
dnl MH_CHECK_X_HEADERS |
| 8 |
dnl MH_CHECK_X_KEYDEFS |
| 9 |
dnl MH_CHECK_X_TYPEDEF |
| 10 |
dnl MH_CHECK_LIB |
| 11 |
dnl MH_SHARED_LIBRARY |
| 12 |
dnl MH_HOWTO_DYN_LINK |
| 13 |
dnl MH_CHECK_CC_O |
| 14 |
dnl MH_SHLPST |
| 15 |
dnl MH_CHECK_MAX_SIGNALS |
| 16 |
|
| 17 |
dnl --------------------------------------------------------------------------- |
| 18 |
dnl Determine if the system has System V IPC. ie sys/ipc.h and sys/shm.h |
| 19 |
dnl headers. |
| 20 |
dnl --------------------------------------------------------------------------- |
| 21 |
AC_DEFUN([MH_IPC], |
| 22 |
[ |
| 23 |
AC_CHECK_HEADER(sys/ipc.h) |
| 24 |
if test $ac_cv_header_sys_ipc_h = no; then |
| 25 |
AC_MSG_ERROR(Cannot find required header file sys/ipc.h; PDCurses cannot be configured) |
| 26 |
fi |
| 27 |
])dnl |
| 28 |
|
| 29 |
dnl --------------------------------------------------------------------------- |
| 30 |
dnl Set up the correct X header file location |
| 31 |
dnl --------------------------------------------------------------------------- |
| 32 |
AC_DEFUN([MH_CHECK_X_INC], |
| 33 |
[ |
| 34 |
mh_x11_dir="" |
| 35 |
mh_x11_xaw_dir="" |
| 36 |
|
| 37 |
mh_inc_dirs="$ac_x_header_dirs" |
| 38 |
|
| 39 |
dnl Provide for user supplying directory |
| 40 |
|
| 41 |
if test "x$x_includes" != xNONE ; then |
| 42 |
mh_inc_dirs="$x_includes $mh_inc_dirs" |
| 43 |
fi |
| 44 |
|
| 45 |
dnl Try to determine the directory containing X headers |
| 46 |
dnl We will append X11 to all the paths above as an extra check |
| 47 |
|
| 48 |
for ac_dir in $mh_inc_dirs ; do |
| 49 |
if test -r $ac_dir/Intrinsic.h; then |
| 50 |
mh_x11_dir=$ac_dir |
| 51 |
break |
| 52 |
fi |
| 53 |
if test -r $ac_dir/X11/Intrinsic.h; then |
| 54 |
mh_x11_dir="$ac_dir/X11" |
| 55 |
break |
| 56 |
fi |
| 57 |
done |
| 58 |
|
| 59 |
dnl Try to determine the directory containing Xaw headers |
| 60 |
dnl We will append X11 to all the paths above as an extra check |
| 61 |
|
| 62 |
if test "$with_xaw3d" = yes; then |
| 63 |
mh_xaw_dir="Xaw3d" |
| 64 |
else |
| 65 |
if test "$with_nextaw" = yes; then |
| 66 |
mh_xaw_dir="neXtaw" |
| 67 |
else |
| 68 |
mh_xaw_dir="Xaw" |
| 69 |
fi |
| 70 |
fi |
| 71 |
for ac_dir in $mh_inc_dirs ; do |
| 72 |
if test -r $ac_dir/$mh_xaw_dir/Box.h; then |
| 73 |
mh_x11_xaw_dir=$ac_dir |
| 74 |
break |
| 75 |
fi |
| 76 |
if test -r $ac_dir/X11/$mh_xaw_dir/Box.h; then |
| 77 |
mh_x11_xaw_dir="$ac_dir/X11" |
| 78 |
break |
| 79 |
fi |
| 80 |
done |
| 81 |
|
| 82 |
if test "x$mh_x11_dir" != "x" ; then |
| 83 |
mh_x11_dir_no_x11=`echo $mh_x11_dir | sed 's/\/X11$//'` |
| 84 |
|
| 85 |
if test "$mh_x11_dir_no_x11" != "$mh_x11_dir" ; then |
| 86 |
MH_XINC_DIR="-I$mh_x11_dir -I$mh_x11_dir_no_x11" |
| 87 |
else |
| 88 |
MH_XINC_DIR="-I$mh_x11_dir" |
| 89 |
fi |
| 90 |
else |
| 91 |
AC_MSG_ERROR(Cannot find required header file Intrinsic.h; PDCurses cannot be configured) |
| 92 |
fi |
| 93 |
|
| 94 |
if test "x$mh_x11_xaw_dir" != "x"; then |
| 95 |
if test "$mh_x11_xaw_dir" != "$mh_x11_dir" ; then |
| 96 |
MH_XINC_DIR="-I$mh_x11_xaw_dir $MH_XINC_DIR" |
| 97 |
fi |
| 98 |
else |
| 99 |
AC_MSG_ERROR(Cannot find required Xaw header file Box.h; PDCurses cannot be configured) |
| 100 |
fi |
| 101 |
|
| 102 |
AC_SUBST(MH_XINC_DIR) |
| 103 |
|
| 104 |
])dnl |
| 105 |
|
| 106 |
dnl --------------------------------------------------------------------------- |
| 107 |
dnl Set up the correct X library file location |
| 108 |
dnl --------------------------------------------------------------------------- |
| 109 |
AC_DEFUN([MH_CHECK_X_LIB], |
| 110 |
[ |
| 111 |
dnl Some systems require extra libraries... |
| 112 |
|
| 113 |
mh_solaris_flag=no |
| 114 |
mh_hpux9_flag=no |
| 115 |
AC_REQUIRE([AC_CANONICAL_SYSTEM]) |
| 116 |
case "$target" in |
| 117 |
*solaris*) |
| 118 |
mh_solaris_flag=yes |
| 119 |
;; |
| 120 |
*pc-sco*) |
| 121 |
extra_x_libs="Xext" |
| 122 |
;; |
| 123 |
sparc*sunos*) |
| 124 |
extra_x_libs="Xext" |
| 125 |
if test "$ac_cv_prog_CC" = "gcc" ; then |
| 126 |
extra_ld_flags="-Wl,-Bstatic" |
| 127 |
extra_ld_flags2="-Wl,-Bdynamic" |
| 128 |
else |
| 129 |
extra_ld_flags="-Bstatic" |
| 130 |
extra_ld_flags2="-Bdynamic" |
| 131 |
fi |
| 132 |
;; |
| 133 |
*hpux9*) |
| 134 |
mh_hpux9_flag=yes |
| 135 |
;; |
| 136 |
esac |
| 137 |
|
| 138 |
if test "$with_xaw3d" = yes; then |
| 139 |
MH_X11_LIBS="Xaw3d Xmu Xt X11" |
| 140 |
else |
| 141 |
if test "$with_nextaw" = yes; then |
| 142 |
MH_X11_LIBS="neXtaw Xmu Xt X11" |
| 143 |
else |
| 144 |
MH_X11_LIBS="Xaw Xmu Xt X11" |
| 145 |
fi |
| 146 |
fi |
| 147 |
MH_X11R6_LIBS="SM ICE Xext" |
| 148 |
mh_x11r6=no |
| 149 |
|
| 150 |
mh_lib_dirs="$x_libraries `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`" |
| 151 |
|
| 152 |
dnl try to find libSM.[a,sl,so,dylib]. If we find it we are using X11R6 |
| 153 |
for ac_dir in $mh_lib_dirs ; do |
| 154 |
for mh_xsm in libSM.a libSM.so libSM.sl libSM.dylib; do |
| 155 |
if test -r $ac_dir/$mh_xsm; then |
| 156 |
mh_x11r6=yes |
| 157 |
break 2 |
| 158 |
fi |
| 159 |
done |
| 160 |
done |
| 161 |
|
| 162 |
if test "$mh_x11r6" = yes ; then |
| 163 |
mh_libs="$MH_X11_LIBS $MH_X11R6_LIBS" |
| 164 |
else |
| 165 |
mh_libs="$MH_X11_LIBS $extra_x_libs" |
| 166 |
fi |
| 167 |
|
| 168 |
|
| 169 |
dnl Ensure that all required X libraries are found |
| 170 |
|
| 171 |
mh_prev_dir="" |
| 172 |
mh_where_found="" |
| 173 |
mh_where_found_dirs="" |
| 174 |
mh_solaris_path="" |
| 175 |
for mh_lib in $mh_libs; do |
| 176 |
mh_lib_found=no |
| 177 |
for ac_dir in $mh_lib_dirs ; do |
| 178 |
for mh_ext in a so sl dll.a dylib; do |
| 179 |
if test -r $ac_dir/lib$mh_lib.$mh_ext; then |
| 180 |
if test "x$mh_prev_dir" != "x$ac_dir" ; then |
| 181 |
if test "x$mh_prev_dir" = "x" ; then |
| 182 |
mh_where_found="$mh_where_found found in $ac_dir" |
| 183 |
else |
| 184 |
mh_where_found="$mh_where_found and in $ac_dir" |
| 185 |
fi |
| 186 |
mh_prev_dir=$ac_dir |
| 187 |
mh_where_found_dirs="$mh_where_found_dirs $ac_dir" |
| 188 |
MH_XLIBS="$MH_XLIBS -L$ac_dir" |
| 189 |
mh_solaris_path="${mh_solaris_path}:$ac_dir" |
| 190 |
fi |
| 191 |
MH_XLIBS="$MH_XLIBS -l$mh_lib" |
| 192 |
mh_lib_found=yes |
| 193 |
break 2 |
| 194 |
fi |
| 195 |
done |
| 196 |
done |
| 197 |
if test "$mh_lib_found" = no; then |
| 198 |
AC_MSG_ERROR(Cannot find required X library; lib$mh_lib. PDCurses cannot be configured) |
| 199 |
fi |
| 200 |
done |
| 201 |
|
| 202 |
mh_solaris_path=`echo $mh_solaris_path | sed 's/^://'` |
| 203 |
if test "$mh_solaris_flag" = yes ; then |
| 204 |
MH_XLIBS="-R$mh_solaris_path $extra_ld_flags $MH_XLIBS $extra_libs $extra_ld_flags2" |
| 205 |
else |
| 206 |
MH_XLIBS="$extra_ld_flags $MH_XLIBS $extra_libs $extra_ld_flags2" |
| 207 |
fi |
| 208 |
if test "$mh_hpux9_flag" = yes ; then |
| 209 |
grep -q XtSetLanguageProc $mh_x11_dir/Intrinsic.h |
| 210 |
if test $? -eq 0 ; then |
| 211 |
mh_found_xtshellstrings=no |
| 212 |
for mh_acdir in $mh_where_found_dirs ; do |
| 213 |
for mh_xaw in `ls $mh_acdir/libXaw.*` ; do |
| 214 |
nm $mh_xaw | grep XtShellStrings | grep -qv extern |
| 215 |
if test $? -eq 0 ; then |
| 216 |
mh_found_xtshellstrings=yes |
| 217 |
fi |
| 218 |
done |
| 219 |
done |
| 220 |
if test "$mh_found_xtshellstrings" = no ; then |
| 221 |
AC_MSG_WARN(The X11 development environment has not been installed correctly.) |
| 222 |
AC_MSG_WARN(The header file; Intrinsic.h, is for X11R5 while the Athena Widget) |
| 223 |
AC_MSG_WARN(Set library; libXaw is for X11R4. This is a common problem with) |
| 224 |
AC_MSG_WARN(HP-UX 9.x.) |
| 225 |
AC_MSG_ERROR(X11 installation incomplete; cannot continue) |
| 226 |
fi |
| 227 |
fi |
| 228 |
fi |
| 229 |
|
| 230 |
AC_SUBST(MH_XLIBS) |
| 231 |
|
| 232 |
])dnl |
| 233 |
|
| 234 |
dnl --------------------------------------------------------------------------- |
| 235 |
dnl Determine if the supplied X headers exist. |
| 236 |
dnl --------------------------------------------------------------------------- |
| 237 |
AC_DEFUN([MH_CHECK_X_HEADERS], |
| 238 |
[ |
| 239 |
save_CPPFLAGS="$CPPFLAGS" |
| 240 |
CPPFLAGS="$CPPFLAGS $MH_XINC_DIR" |
| 241 |
for mh_header in $1; do |
| 242 |
AC_CHECK_HEADERS($mh_header) |
| 243 |
done |
| 244 |
CPPFLAGS="$save_CPPFLAGS" |
| 245 |
])dnl |
| 246 |
|
| 247 |
dnl --------------------------------------------------------------------------- |
| 248 |
dnl Determine if various key definitions exist in keysym.h |
| 249 |
dnl --------------------------------------------------------------------------- |
| 250 |
AC_DEFUN([MH_CHECK_X_KEYDEFS], |
| 251 |
[ |
| 252 |
save_CPPFLAGS="$CPPFLAGS" |
| 253 |
CPPFLAGS="$CPPFLAGS $MH_XINC_DIR" |
| 254 |
for mh_keydef in $1; do |
| 255 |
AC_MSG_CHECKING(for $mh_keydef in keysym.h) |
| 256 |
mh_upper_name="HAVE_`echo $mh_keydef | tr '[a-z]' '[A-Z]'`" |
| 257 |
AC_TRY_COMPILE([#include <keysym.h>], |
| 258 |
[int i = $mh_keydef;], |
| 259 |
mh_have_key=yes; AC_DEFINE_UNQUOTED($mh_upper_name,1), mh_have_key=no ) |
| 260 |
AC_MSG_RESULT($mh_have_key) |
| 261 |
done |
| 262 |
CPPFLAGS="$save_CPPFLAGS" |
| 263 |
])dnl |
| 264 |
|
| 265 |
dnl --------------------------------------------------------------------------- |
| 266 |
dnl Determine if supplied types have been typedefed |
| 267 |
dnl --------------------------------------------------------------------------- |
| 268 |
AC_DEFUN([MH_CHECK_X_TYPEDEF], |
| 269 |
[ |
| 270 |
save_CPPFLAGS="$CPPFLAGS" |
| 271 |
CPPFLAGS="$CPPFLAGS $SYS_DEFS $MH_XINC_DIR" |
| 272 |
for td in $1 ; do |
| 273 |
AC_MSG_CHECKING(if $td is typedefed:) |
| 274 |
AC_TRY_COMPILE( |
| 275 |
[#include "X11/Xlib.h"], |
| 276 |
[$td fred], |
| 277 |
[mh_td=yes], |
| 278 |
[mh_td=no] |
| 279 |
) |
| 280 |
if test "$mh_td" = yes ; then |
| 281 |
TD_upper=`echo $td | tr a-z A-Z` |
| 282 |
AC_DEFINE_UNQUOTED(${TD_upper}_TYPEDEFED, 1) |
| 283 |
fi |
| 284 |
AC_MSG_RESULT($mh_td) |
| 285 |
done |
| 286 |
CPPFLAGS="$save_CPPFLAGS" |
| 287 |
])dnl |
| 288 |
|
| 289 |
dnl --------------------------------------------------------------------------- |
| 290 |
dnl Check for presence of various libraries |
| 291 |
dnl --------------------------------------------------------------------------- |
| 292 |
AC_DEFUN([MH_CHECK_LIB], |
| 293 |
[ |
| 294 |
MH_EXTRA_LIBS='' |
| 295 |
for mh_lib in $1; do |
| 296 |
if test "$on_qnx" = yes; then |
| 297 |
AC_MSG_CHECKING(for library -l${mh_lib}) |
| 298 |
if test -r /usr/lib/${mh_lib}3r.lib; then |
| 299 |
AC_MSG_RESULT(found) |
| 300 |
MH_EXTRA_LIBS="${MH_EXTRA_LIBS} -l${mh_lib}" |
| 301 |
else |
| 302 |
AC_MSG_RESULT(not found) |
| 303 |
fi |
| 304 |
else |
| 305 |
AC_CHECK_LIB($mh_lib,main,mh_lib_found=yes,mh_lib_found=no) |
| 306 |
if test "$mh_lib_found" = yes; then |
| 307 |
MH_EXTRA_LIBS="${MH_EXTRA_LIBS} -l${mh_lib}" |
| 308 |
fi |
| 309 |
fi |
| 310 |
done |
| 311 |
])dnl |
| 312 |
|
| 313 |
dnl --------------------------------------------------------------------------- |
| 314 |
dnl Work out how to create a dynamically loaded module |
| 315 |
dnl --------------------------------------------------------------------------- |
| 316 |
AC_DEFUN([MH_HOWTO_DYN_LINK], |
| 317 |
[ |
| 318 |
mh_compile='${CC-cc} -c $DYN_COMP conftest.$ac_ext 1>&AC_FD_CC' |
| 319 |
cat > conftest.$ac_ext <<EOF |
| 320 |
dnl [#]line __oline__ "[$]0" |
| 321 |
[#]line __oline__ "configure" |
| 322 |
int foo() |
| 323 |
{ |
| 324 |
return(0); |
| 325 |
} |
| 326 |
EOF |
| 327 |
if AC_TRY_EVAL(mh_compile) && test -s conftest.o; then |
| 328 |
mh_dyn_link='ld -shared -o conftest.rxlib conftest.o -lc 1>&AC_FD_CC' |
| 329 |
# mh_dyn_link='${CC} -Wl,-shared -o conftest.rxlib conftest.o -lc 1>&AC_FD_CC' |
| 330 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.rxlib; then |
| 331 |
LD_RXLIB1="ld -shared" |
| 332 |
# LD_RXLIB1="${CC} -Wl,-shared" |
| 333 |
SHLPRE="lib" |
| 334 |
SHLPST=".so" |
| 335 |
else |
| 336 |
mh_dyn_link='ld -G -o conftest.rxlib conftest.o 1>&AC_FD_CC' |
| 337 |
# mh_dyn_link='${CC} -Wl,-G -o conftest.rxlib conftest.o 1>&AC_FD_CC' |
| 338 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.rxlib; then |
| 339 |
LD_RXLIB1="ld -G" |
| 340 |
# LD_RXLIB1="${CC} -Wl,-G" |
| 341 |
SHLPRE="lib" |
| 342 |
SHLPST=".so" |
| 343 |
else |
| 344 |
LD_RXLIB1="" |
| 345 |
SHLPRE="" |
| 346 |
SHLPST="" |
| 347 |
fi |
| 348 |
fi |
| 349 |
fi |
| 350 |
rm -f conftest* |
| 351 |
])dnl |
| 352 |
|
| 353 |
dnl --------------------------------------------------------------------------- |
| 354 |
dnl Determine how to build shared libraries etc.. |
| 355 |
dnl --------------------------------------------------------------------------- |
| 356 |
AC_DEFUN([MH_SHARED_LIBRARY], |
| 357 |
[ |
| 358 |
AC_REQUIRE([MH_SHLPST]) |
| 359 |
dnl |
| 360 |
dnl If compiler is gcc, then flags should be the same for all platforms |
| 361 |
dnl (just guessing on this) |
| 362 |
dnl |
| 363 |
AIX_DYN="no" |
| 364 |
BEOS_DYN="no" |
| 365 |
SHLFILE="$1" |
| 366 |
SHLFILES="$*" |
| 367 |
RXPACKEXPORTS="" |
| 368 |
SHLPRE="lib" |
| 369 |
LD_RXLIB1="" |
| 370 |
|
| 371 |
AC_REQUIRE([AC_CANONICAL_SYSTEM]) |
| 372 |
case "$target" in |
| 373 |
*hp-hpux*) |
| 374 |
SYS_DEFS="-D_HPUX_SOURCE" |
| 375 |
LD_RXLIB1="ld -b -q -n" |
| 376 |
;; |
| 377 |
*ibm-aix*) |
| 378 |
SYS_DEFS="-D_ALL_SOURCE -DAIX" |
| 379 |
AIX_DYN="yes" |
| 380 |
DYN_COMP="-DDYNAMIC" |
| 381 |
LD_RXLIB1="ld -bnoentry -bM:SRE" |
| 382 |
RXPACKEXPORTS="-bE:$SHLFILE.exp" |
| 383 |
RXPACKEXP="$SHLFILE.exp" |
| 384 |
;; |
| 385 |
*dec-osf*) |
| 386 |
if test "$ac_cv_prog_CC" = "gcc"; then |
| 387 |
SYS_DEFS="-D_POSIX_SOURCE -D_XOPEN_SOURCE" |
| 388 |
else |
| 389 |
SYS_DEFS="-D_POSIX_SOURCE -D_XOPEN_SOURCE -Olimit 800" |
| 390 |
fi |
| 391 |
LD_RXLIB1="ld -shared" |
| 392 |
;; |
| 393 |
*sequent-dynix*|*esix*|*dgux*) |
| 394 |
LD_RXLIB1="ld -G" |
| 395 |
;; |
| 396 |
*solaris*) |
| 397 |
if test "$ac_cv_prog_CC" = "gcc"; then |
| 398 |
LD_RXLIB1="gcc -shared" |
| 399 |
else |
| 400 |
LD_RXLIB1="ld -G" |
| 401 |
fi |
| 402 |
;; |
| 403 |
sparc*sunos*) |
| 404 |
SYS_DEFS="-DSUNOS -DSUNOS_STRTOD_BUG" |
| 405 |
LD_RXLIB1="ld" |
| 406 |
;; |
| 407 |
*linux*|*atheos*|*nto-qnx*) |
| 408 |
LD_RXLIB1="${CC} -shared" |
| 409 |
;; |
| 410 |
*freebsd*) |
| 411 |
LD_RXLIB1="ld -Bdynamic -Bshareable" |
| 412 |
;; |
| 413 |
*pc-sco*) |
| 414 |
LD_RXLIB1="ld -dy -G" |
| 415 |
;; |
| 416 |
*beos*) |
| 417 |
LD_RXLIB1="${CC} -Wl,-shared -nostart -Xlinker -soname=\$(@)" |
| 418 |
BEOS_DYN="yes" |
| 419 |
;; |
| 420 |
*qnx*) |
| 421 |
SHLPRE="" |
| 422 |
DYN_COMP="-Q" # force no check for dynamic loading |
| 423 |
SHLFILE="" |
| 424 |
;; |
| 425 |
*cygwin) |
| 426 |
SHLPRE="" |
| 427 |
DYN_COMP="-DDYNAMIC" |
| 428 |
LD_RXLIB1="dllwrap --def \$(srcdir)/../win32/pdcurses.def --target i386-cygwin32 --dllname \$(@)" |
| 429 |
# cygwininstall target MUST install the shared library itself because |
| 430 |
# it puts it into $(bindir) not $(libdir) as all other platforms |
| 431 |
;; |
| 432 |
*darwin*) |
| 433 |
DYN_COMP="-fno-common" |
| 434 |
LD_RXLIB1="${CC} -flat_namespace -undefined suppress -dynamiclib -install_name=\$(@)" |
| 435 |
;; |
| 436 |
*) |
| 437 |
;; |
| 438 |
esac |
| 439 |
|
| 440 |
dnl determine what switches our compiler uses for building objects |
| 441 |
dnl suitable for inclusion in shared libraries |
| 442 |
dnl Only call this if DYN_COMP is not set. If we have set DYN_COMP |
| 443 |
dnl above, then we know how to compile AND link for dynamic libraries |
| 444 |
|
| 445 |
if test "$DYN_COMP" = ""; then |
| 446 |
AC_MSG_CHECKING(compiler flags for a dynamic object) |
| 447 |
|
| 448 |
cat > conftest.$ac_ext <<EOF |
| 449 |
dnl [#]line __oline__ "[$]0" |
| 450 |
[#]line __oline__ "configure" |
| 451 |
int a=0 |
| 452 |
EOF |
| 453 |
|
| 454 |
DYN_COMP="" |
| 455 |
mh_cv_stop=no |
| 456 |
save_cflags="$CFLAGS" |
| 457 |
mh_cv_flags="-fPIC -KPIC +Z" |
| 458 |
for a in $mh_cv_flags; do |
| 459 |
CFLAGS="-c $a" |
| 460 |
|
| 461 |
mh_compile='${CC-cc} -c $CFLAGS conftest.$ac_ext > conftest.tmp 2>&1' |
| 462 |
if AC_TRY_EVAL(mh_compile); then |
| 463 |
DYN_COMP="" |
| 464 |
else |
| 465 |
slash="\\" |
| 466 |
mh_dyncomp="`grep -E -c $slash$a conftest.tmp`" |
| 467 |
if test "$mh_dyncomp" = "0"; then |
| 468 |
DYN_COMP="$a -DDYNAMIC" |
| 469 |
AC_MSG_RESULT($a) |
| 470 |
break |
| 471 |
else |
| 472 |
DYN_COMP="" |
| 473 |
fi |
| 474 |
fi |
| 475 |
done |
| 476 |
if test "$DYN_COMP" = ""; then |
| 477 |
AC_MSG_RESULT(none of $mh_cv_flags supported) |
| 478 |
fi |
| 479 |
if test "$LD_RXLIB1" = ""; then |
| 480 |
MH_HOWTO_DYN_LINK() |
| 481 |
fi |
| 482 |
CFLAGS=$save_cflags |
| 483 |
rm -f conftest.* |
| 484 |
fi |
| 485 |
|
| 486 |
|
| 487 |
SHL_TARGETS="" |
| 488 |
|
| 489 |
if test "$AIX_DYN" = "yes"; then |
| 490 |
aix_exports="config.exports.aix" |
| 491 |
echo "" > $aix_exports |
| 492 |
fi |
| 493 |
|
| 494 |
if test "$ac_cv_header_dl_h" = "yes" -o "$ac_cv_header_dlfcn_h" = "yes" -o "$AIX_DYN" = "yes" -o "$BEOS_DYN" = "yes" -o "$DLFCNINCDIR" != "" -o "$DLFCNLIBDIR" != ""; then |
| 495 |
EXPS="1,2,3,4,5,6,7,8,9" |
| 496 |
for a in $SHLFILES |
| 497 |
do |
| 498 |
SHL_TARGETS="${SHL_TARGETS} ${SHLPRE}${a}${SHLPST}" |
| 499 |
this=`echo $EXPS | cut -d, -f1` |
| 500 |
EXPS=`echo $EXPS | cut -d, -f2-` |
| 501 |
if test "$AIX_DYN" = "yes"; then |
| 502 |
echo "RXPACKEXP$this=$a.exp" >> $aix_exports |
| 503 |
echo "RXPACKEXPORTS$this=-bE:$a.exp" >> $aix_exports |
| 504 |
fi |
| 505 |
done |
| 506 |
fi |
| 507 |
|
| 508 |
AC_SUBST(DYN_COMP) |
| 509 |
AC_SUBST(LIBS) |
| 510 |
AC_SUBST(LD_RXLIB1) |
| 511 |
AC_SUBST(SHLPRE) |
| 512 |
AC_SUBST(SHLPST) |
| 513 |
AC_SUBST(SHL_TARGETS) |
| 514 |
AC_SUBST(O2SAVE) |
| 515 |
AC_SUBST(CC2O) |
| 516 |
AC_SUBST(SAVE2O) |
| 517 |
AC_SUBST(RXPACKEXPORTS) |
| 518 |
])dnl |
| 519 |
|
| 520 |
dnl --------------------------------------------------------------------------- |
| 521 |
dnl Check if C compiler supports -c -o file.ooo |
| 522 |
dnl --------------------------------------------------------------------------- |
| 523 |
AC_DEFUN([MH_CHECK_CC_O], |
| 524 |
[ |
| 525 |
AC_MSG_CHECKING(whether $CC understand -c and -o together) |
| 526 |
set dummy $CC; ac_cc="`echo [$]2 | |
| 527 |
changequote(, )dnl |
| 528 |
sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" |
| 529 |
changequote([, ])dnl |
| 530 |
AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o, |
| 531 |
[echo 'foo(){}' > conftest.c |
| 532 |
# We do the test twice because some compilers refuse to overwrite an |
| 533 |
# existing .o file with -o, though they will create one. |
| 534 |
eval ac_cv_prog_cc_${ac_cc}_c_o=no |
| 535 |
ac_try='${CC-cc} -c conftest.c -o conftest.ooo 1>&AC_FD_CC' |
| 536 |
if AC_TRY_EVAL(ac_try) && test -f conftest.ooo && AC_TRY_EVAL(ac_try); |
| 537 |
then |
| 538 |
ac_try='${CC-cc} -c conftest.c -o conftest.ooo 1>&AC_FD_CC' |
| 539 |
if AC_TRY_EVAL(ac_try) && test -f conftest.ooo && AC_TRY_EVAL(ac_try); |
| 540 |
then |
| 541 |
eval ac_cv_prog_cc_${ac_cc}_c_o=yes |
| 542 |
fi |
| 543 |
fi |
| 544 |
rm -f conftest* |
| 545 |
])dnl |
| 546 |
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then |
| 547 |
O2SAVE="" |
| 548 |
SAVE2O="" |
| 549 |
CC2O="-o $"'@' |
| 550 |
AC_MSG_RESULT(yes) |
| 551 |
else |
| 552 |
O2SAVE="-mv \`basename "$'@'" .sho\`.o \`basename "$'@'" .sho\`.o.save;" |
| 553 |
SAVE2O="-mv \`basename "$'@'" .sho\`.o "$'@'"; mv \`basename "$'@'" .sho\`.o.save \`basename "$'@'" .sho\`.o" |
| 554 |
CC2O="" |
| 555 |
AC_MSG_RESULT(no) |
| 556 |
fi |
| 557 |
]) |
| 558 |
|
| 559 |
dnl --------------------------------------------------------------------------- |
| 560 |
dnl Determines the file extension for shared libraries |
| 561 |
dnl --------------------------------------------------------------------------- |
| 562 |
AC_DEFUN([MH_SHLPST], |
| 563 |
[ |
| 564 |
AC_MSG_CHECKING(shared library extension) |
| 565 |
SHLPST=".so" |
| 566 |
AC_REQUIRE([AC_CANONICAL_SYSTEM]) |
| 567 |
case "$target" in |
| 568 |
*hp-hpux*) |
| 569 |
SHLPST=".sl" |
| 570 |
;; |
| 571 |
*ibm-aix*) |
| 572 |
SHLPST=".a" |
| 573 |
;; |
| 574 |
*qnx*) |
| 575 |
SHLPST="" |
| 576 |
;; |
| 577 |
*cygwin*) |
| 578 |
SHLPST=".dll" |
| 579 |
;; |
| 580 |
*darwin*) |
| 581 |
SHLPST=".dylib" |
| 582 |
;; |
| 583 |
esac |
| 584 |
AC_SUBST(SHLPST) |
| 585 |
AC_MSG_RESULT($SHLPST) |
| 586 |
]) |
| 587 |
|
| 588 |
dnl --------------------------------------------------------------------------- |
| 589 |
dnl Determine the system limit for number of signals |
| 590 |
dnl --------------------------------------------------------------------------- |
| 591 |
AC_DEFUN([MH_CHECK_MAX_SIGNALS], |
| 592 |
[ |
| 593 |
save_CPPFLAGS="$CPPFLAGS" |
| 594 |
CPPFLAGS="$CPPFLAGS $SYS_DEFS" |
| 595 |
AC_MSG_CHECKING(for maximum signal specifier:) |
| 596 |
AC_CACHE_VAL(mh_cv_max_signals, |
| 597 |
mh_found="no" |
| 598 |
for mh_sigs in $1; do |
| 599 |
AC_TRY_COMPILE([#include <signal.h>], |
| 600 |
[return $mh_sigs;], |
| 601 |
mh_found="yes"; mh_cv_max_signals="$mh_sigs" ) |
| 602 |
if test "$mh_found" = "yes"; then |
| 603 |
break; |
| 604 |
fi |
| 605 |
done) |
| 606 |
CPPFLAGS="$save_CPPFLAGS" |
| 607 |
if test "$mh_found" = "no"; then |
| 608 |
AC_MSG_ERROR(Cannot find a system limit for number of signals. PDCurses cannot be configured on this machine.) |
| 609 |
else |
| 610 |
AC_DEFINE_UNQUOTED(PDC_MAX_SIGNALS,$mh_cv_max_signals) |
| 611 |
AC_MSG_RESULT($mh_cv_max_signals) |
| 612 |
fi |
| 613 |
])dnl |