| 1 |
dnl --------------------------------------------------------------------------- |
| 2 |
dnl This file offers the following common macros... |
| 3 |
dnl --------------------------------------------------------------------------- |
| 4 |
dnl CHECK_REXX |
| 5 |
dnl MH_IPC |
| 6 |
dnl MH_CHECK_X_INC |
| 7 |
dnl MH_CHECK_X_LIB |
| 8 |
dnl MH_HAVE_PROTO |
| 9 |
dnl MH_HAVE_BROKEN_CXX_WITH_STRING_H |
| 10 |
dnl MH_PROG_CC |
| 11 |
dnl MH_PROG_CXX |
| 12 |
dnl MH_CHECK_X_HEADERS |
| 13 |
dnl MH_CHECK_X_KEYDEFS |
| 14 |
dnl MH_CHECK_X_TYPEDEF |
| 15 |
dnl MH_TRY_LINK |
| 16 |
dnl MH_CHECK_LIB |
| 17 |
dnl MH_HOWTO_SHARED_LIBRARY |
| 18 |
dnl MH_SHARED_LIBRARY |
| 19 |
dnl MH_HOWTO_DYN_LINK |
| 20 |
dnl MH_CHECK_CC_O |
| 21 |
dnl MH_CHECK_LEADING_USCORE |
| 22 |
dnl MH_SHLPST |
| 23 |
dnl MH_CHECK_POSIX_THREADS |
| 24 |
dnl MH_CHECK_RPM |
| 25 |
dnl MH_CHECK_PACKAGE_BUILDERS |
| 26 |
dnl MH_C_LONG_LONG |
| 27 |
dnl MH_SHOW_STATUS |
| 28 |
dnl MH_CHECK_OSX_ARCH |
| 29 |
dnl MH_GET_KERNEL_NAME |
| 30 |
dnl MH_GET_DISTRO_NAME |
| 31 |
dnl MH_CHECK_CURSES |
| 32 |
dnl MH_CHECK_FUNCS |
| 33 |
dnl MH_CHECK_TYPES |
| 34 |
dnl MH_SET_FULL_PACKAGE_NAME |
| 35 |
dnl MH_LARGE_FILE_SUPPORT |
| 36 |
|
| 37 |
dnl |
| 38 |
dnl include the stdint.h wrapper |
| 39 |
# before sinclude(common/ax_create_stdint_h.m4) |
| 40 |
sinclude(common/ax_create_stdint_h.m4) |
| 41 |
dnl include the compare_version test |
| 42 |
# before sinclude(common/ax_compare_version.m4) |
| 43 |
sinclude(common/ax_compare_version.m4) |
| 44 |
dnl |
| 45 |
dnl add our expansion macro for directories |
| 46 |
dnl |
| 47 |
# before sinclude(common/ac_define_dir.m4) |
| 48 |
sinclude(common/ac_define_dir.m4) |
| 49 |
dnl --------------------------------------------------------------------------- |
| 50 |
dnl Check REXX library and header files |
| 51 |
dnl --------------------------------------------------------------------------- |
| 52 |
AC_DEFUN([CHECK_REXX], |
| 53 |
[ |
| 54 |
AC_REQUIRE([AC_CANONICAL_SYSTEM]) |
| 55 |
dnl |
| 56 |
dnl Setup various things for different interpreters |
| 57 |
dnl |
| 58 |
extra_rexx_libs="" |
| 59 |
extra_rexx_defines="" |
| 60 |
extra_incdirs="" |
| 61 |
extra_libdirs="" |
| 62 |
REXX_USING_CONFIG=no |
| 63 |
REXX_LIBS="" |
| 64 |
REXX_INCLUDES="" |
| 65 |
REXX_VER="unknown" |
| 66 |
REXX_ADDONS="$libdir" |
| 67 |
REXX_VER="" |
| 68 |
case "$with_rexx" in |
| 69 |
regina) dnl -------- Regina |
| 70 |
AC_DEFINE(USE_REGINA) |
| 71 |
AC_CHECK_PROG(regina_config, [regina-config], yes, no) |
| 72 |
rexx_h="rexxsaa.h" |
| 73 |
rexx_l="regina" |
| 74 |
REXX_INT="Regina" |
| 75 |
REXX_TARGET="Regina" |
| 76 |
if test "$ac_cv_prog_regina_config" = yes; then |
| 77 |
REXX_INCLUDES=`regina-config --cflags` |
| 78 |
numlines=`regina-config --libs$bitflag | wc -l` |
| 79 |
if test $numlines -eq 1; then |
| 80 |
REXX_LIBS=`regina-config --libs$bitflag` |
| 81 |
else |
| 82 |
REXX_LIBS=`regina-config --libs` |
| 83 |
fi |
| 84 |
REXX_INT="Regina (using regina-config)" |
| 85 |
REXX_VER=`regina-config --version` |
| 86 |
REXX_USING_CONFIG=yes |
| 87 |
regina_prefix=`regina-config --prefix` |
| 88 |
if test "$with_brew_addon_dir" = no ; then |
| 89 |
regina_addons=`regina-config --addons` |
| 90 |
else |
| 91 |
regina_addons="$with_brew_addon_dir" |
| 92 |
fi |
| 93 |
REGINA_ADDONS="$regina_addons" |
| 94 |
AX_COMPARE_VERSION([$REXX_VER],[gt],[3.6],[REXX_ADDONS=$REGINA_ADDONS],[REXX_ADDONS=$libdir]) |
| 95 |
else |
| 96 |
case "$target" in |
| 97 |
*nto-qnx*) |
| 98 |
AC_SEARCH_LIBS(dlopen,dl) |
| 99 |
;; |
| 100 |
*qnx*) |
| 101 |
;; |
| 102 |
*hp-hpux*) |
| 103 |
AC_SEARCH_LIBS(shl_load,dld) |
| 104 |
;; |
| 105 |
*) |
| 106 |
AC_SEARCH_LIBS(dlopen,dl) |
| 107 |
;; |
| 108 |
esac |
| 109 |
AC_SEARCH_LIBS(crypt,crypt) |
| 110 |
AC_CHECK_PROG(flex,[flex],yes,no) |
| 111 |
if test "$ac_cv_prog_flex" = yes; then |
| 112 |
LEXLIB="-fl" |
| 113 |
AC_SUBST(LEXLIB) |
| 114 |
fi |
| 115 |
fi |
| 116 |
dnl for FreeBSD, the use of -pthread with ld doesn't work, |
| 117 |
dnl so remove it. |
| 118 |
case "$target" in |
| 119 |
*freebsd*) |
| 120 |
REXX_LIBS="`echo ${REXX_LIBS} | sed -e s/-pthread//`" |
| 121 |
;; |
| 122 |
*) |
| 123 |
;; |
| 124 |
esac |
| 125 |
;; |
| 126 |
rexxtrans) dnl -------- Rexx/Trans |
| 127 |
AC_DEFINE(USE_REXXTRANS) |
| 128 |
AC_CHECK_PROG(rexxtrans_config, [rexxtrans-config], yes, no) |
| 129 |
rexx_h="rexxtrans.h" |
| 130 |
rexx_l="rexxtrans" |
| 131 |
REXX_INT="Rexx/Trans" |
| 132 |
REXX_TARGET="RexxTrans" |
| 133 |
if test "$ac_cv_prog_rexxtrans_config" = yes; then |
| 134 |
REXX_INCLUDES=`rexxtrans-config --cflags` |
| 135 |
dnl |
| 136 |
dnl We now link with the static rexxtrans library |
| 137 |
dnl |
| 138 |
# numlines=`rexxtrans-config --libs$bitflag | wc -l` |
| 139 |
# if test $numlines -eq 1; then |
| 140 |
# REXX_LIBS=`rexxtrans-config --libs$bitflag` |
| 141 |
# else |
| 142 |
# REXX_LIBS=`rexxtrans-config --libs` |
| 143 |
# fi |
| 144 |
REXX_LIBS=`rexxtrans-config --libs-static` |
| 145 |
REXX_INT="Rexx/Trans - static (using rexxtrans-config)" |
| 146 |
REXX_VER=`rexxtrans-config --version` |
| 147 |
REXX_USING_CONFIG=yes |
| 148 |
else |
| 149 |
AC_SEARCH_LIBS(dlopen,dl) |
| 150 |
fi |
| 151 |
;; |
| 152 |
objrexx | orexx | objectrexx) dnl -------- Object Rexx |
| 153 |
with_rexx="objrexx" |
| 154 |
AC_DEFINE(USE_OREXX) |
| 155 |
rexx_h="rexx.h" |
| 156 |
rexx_l="rexxapi" |
| 157 |
REXX_INT="Object Rexx" |
| 158 |
REXX_TARGET="ObjectRexx" |
| 159 |
extra_rexx_libs="-lrexx" |
| 160 |
extra_incdirs="/opt/orexx /usr/local/orexx /usr/lpp/orexx/include" |
| 161 |
extra_libdirs="/opt/orexx/lib /usr/local/orexx/lib /usr/lpp/orexx/lib" |
| 162 |
case "$target" in |
| 163 |
*linux*) |
| 164 |
extra_rexx_defines="-DLINUX" |
| 165 |
;; |
| 166 |
*) |
| 167 |
;; |
| 168 |
esac |
| 169 |
AC_SEARCH_LIBS(pthread_create,pthread pthreads thread) |
| 170 |
;; |
| 171 |
oorexx) dnl -------- Open Object Rexx |
| 172 |
with_rexx="oorexx" |
| 173 |
AC_DEFINE(USE_OOREXX) dnl ---- Open Object Rexx |
| 174 |
AC_CHECK_PROG(oorexx_config, [oorexx-config], yes, no) |
| 175 |
rexx_h="rexx.h" |
| 176 |
rexx_l="rexxapi" |
| 177 |
REXX_INT="Open Object Rexx" |
| 178 |
REXX_TARGET="ooRexx" |
| 179 |
if test "$ac_cv_prog_oorexx_config" = yes; then |
| 180 |
REXX_INCLUDES="-DLINUX `oorexx-config --cflags`" |
| 181 |
REXX_LIBS="`oorexx-config --libs` -ldl" |
| 182 |
REXX_INT="ooRexx (using oorexx-config)" |
| 183 |
REXX_VER=`oorexx-config --version` |
| 184 |
dnl if we are using ooRexx 4.x and greater treat it as another interpreter :-( |
| 185 |
REXX_MAJOR=`echo $REXX_VER | cut -d. -f1` |
| 186 |
if test "x$REXX_MAJOR" = "x4"; then |
| 187 |
AC_DEFINE(OOREXX_40) |
| 188 |
fi |
| 189 |
if test "x$REXX_MAJOR" = "x5"; then |
| 190 |
AC_DEFINE(OOREXX_40) |
| 191 |
fi |
| 192 |
REXX_USING_CONFIG=yes |
| 193 |
else |
| 194 |
extra_rexx_libs="-lrexx" |
| 195 |
extra_incdirs="/usr/local/include/ooRexx /usr/include/ooRexx /opt/ooRexx/include" |
| 196 |
extra_libdirs="/usr/local/lib/ooRexx /usr/lib/ooRexx /opt/ooRexx/lib/ooRexx" |
| 197 |
extra_rexx_defines="-DLINUX" |
| 198 |
fi |
| 199 |
AC_SEARCH_LIBS(pthread_create,pthread pthreads thread) |
| 200 |
;; |
| 201 |
rexximc) dnl -------- Rexx/imc |
| 202 |
AC_DEFINE(USE_REXXIMC) |
| 203 |
rexx_h="rexxsaa.h" |
| 204 |
rexx_l="rexx" |
| 205 |
REXX_INT="REXX/imc" |
| 206 |
REXX_TARGET="REXXimc" |
| 207 |
AC_SEARCH_LIBS(dlopen,dl) |
| 208 |
;; |
| 209 |
rexx6000) dnl -------- REXX6000 |
| 210 |
dnl |
| 211 |
dnl Check that the OS supports REXX/6000 |
| 212 |
dnl Only supported it on AIX |
| 213 |
dnl |
| 214 |
if test "$with_rexx6000" = yes ; then |
| 215 |
case "$target" in |
| 216 |
*aix*) |
| 217 |
;; |
| 218 |
*) |
| 219 |
AC_MSG_ERROR(REXX/6000 support only available on AIX; cannot configure) |
| 220 |
;; |
| 221 |
esac |
| 222 |
fi |
| 223 |
AC_DEFINE(USE_REXX6000) |
| 224 |
rexx_h="rexxtype.h" |
| 225 |
rexx_l="rexx" |
| 226 |
REXX_INT="REXX/6000" |
| 227 |
REXX_TARGET="REXX6000" |
| 228 |
;; |
| 229 |
unirexx) dnl -------- uni-REXX |
| 230 |
AC_DEFINE(USE_UNIREXX) |
| 231 |
rexx_h="rexxsaa.h" |
| 232 |
rexx_l="rx" |
| 233 |
REXX_INT="uni-REXX" |
| 234 |
REXX_TARGET="uni-REXX" |
| 235 |
AC_SEARCH_LIBS(dlopen,dl) |
| 236 |
;; |
| 237 |
none) dnl -------- No Rexx interpreter |
| 238 |
AC_DEFINE(NOREXX) |
| 239 |
rexx_h="" |
| 240 |
rexx_l="" |
| 241 |
REXX_INT="No Rexx Support" |
| 242 |
REXX_TARGET="" |
| 243 |
;; |
| 244 |
*) |
| 245 |
AC_MSG_ERROR(No Rexx interpreter specified with --with-rexx=int : must be one of: regina rexximc oorexx objrexx unirexx rexx6000 rexxtrans none) |
| 246 |
;; |
| 247 |
esac |
| 248 |
AC_SUBST(REXX_TARGET) |
| 249 |
AC_SUBST(REXX_ADDONS) |
| 250 |
REXX_BUILD=$with_rexx |
| 251 |
AC_SUBST(REXX_BUILD) |
| 252 |
AC_SUBST(REXX_VER) |
| 253 |
|
| 254 |
dnl look for REXX header and library, exit if not found |
| 255 |
|
| 256 |
if test "xx$rexx_h" != "xx" -a "x$REXX_INCLUDES" = "x"; then |
| 257 |
dnl look for REXX header and library, exit if not found |
| 258 |
AC_MSG_CHECKING(for location of Rexx header file: $rexx_h) |
| 259 |
mh_rexx_inc_dir="" |
| 260 |
mh_inc_dirs="\ |
| 261 |
${REXXINCDIR} \ |
| 262 |
${extra_incdirs} \ |
| 263 |
${HOME}/include \ |
| 264 |
${HOME}/${MACHTYPE}/include \ |
| 265 |
/usr/local/include \ |
| 266 |
/usr/contrib/include \ |
| 267 |
/opt/include \ |
| 268 |
/opt/sfw/include \ |
| 269 |
/sw/include \ |
| 270 |
/usr/include \ |
| 271 |
/usr/unsupported/include" |
| 272 |
dnl |
| 273 |
dnl Provide for user supplying directory |
| 274 |
dnl |
| 275 |
if test "$with_rexxincdir" != no ; then |
| 276 |
mh_inc_dirs="$with_rexxincdir $mh_inc_dirs" |
| 277 |
fi |
| 278 |
dnl |
| 279 |
dnl Try to determine the directory containing Rexx header |
| 280 |
dnl |
| 281 |
for ac_dir in $mh_inc_dirs ; do |
| 282 |
if test -r $ac_dir/$rexx_h; then |
| 283 |
mh_rexx_inc_dir=$ac_dir |
| 284 |
break |
| 285 |
fi |
| 286 |
done |
| 287 |
if test "x$mh_rexx_inc_dir" != "x" ; then |
| 288 |
REXX_INCLUDES="-I$mh_rexx_inc_dir $extra_rexx_defines" |
| 289 |
AC_MSG_RESULT(found in $mh_rexx_inc_dir) |
| 290 |
else |
| 291 |
AC_MSG_ERROR(Cannot find Rexx header file: $rexx_h; cannot configure) |
| 292 |
fi |
| 293 |
fi |
| 294 |
AC_SUBST(REXX_INCLUDES) |
| 295 |
|
| 296 |
if test "xx$rexx_h" != "xx" -a "x$REXX_LIBS" = "x"; then |
| 297 |
AC_MSG_CHECKING(for location of Rexx library file: $rexx_l) |
| 298 |
mh_rexx_lib_dir="" |
| 299 |
mh_lib_dirs="\ |
| 300 |
${REXXLIBDIR} \ |
| 301 |
${extra_libdirs} \ |
| 302 |
${HOME}/lib64 \ |
| 303 |
${HOME}/lib32 \ |
| 304 |
${HOME}/lib \ |
| 305 |
${HOME}/${MACHTYPE}/lib64 \ |
| 306 |
${HOME}/${MACHTYPE}/lib32 \ |
| 307 |
${HOME}/${MACHTYPE}/lib \ |
| 308 |
/usr/local/lib64 \ |
| 309 |
/usr/local/lib32 \ |
| 310 |
/usr/local/lib \ |
| 311 |
/usr/contrib/lib \ |
| 312 |
/opt/lib64 \ |
| 313 |
/opt/lib32 \ |
| 314 |
/opt/lib \ |
| 315 |
/opt/sfw/lib \ |
| 316 |
/sw/lib \ |
| 317 |
/usr/lib64 \ |
| 318 |
/usr/lib32 \ |
| 319 |
/usr/lib \ |
| 320 |
/usr/unsupported/lib" |
| 321 |
dnl |
| 322 |
dnl Provide for user supplying directory |
| 323 |
dnl |
| 324 |
if test "$with_rexxlibdir" != no ; then |
| 325 |
mh_lib_dirs="$with_rexxlibdir $mh_lib_dirs" |
| 326 |
fi |
| 327 |
dnl |
| 328 |
dnl Try to determine the directory containing Rexx library |
| 329 |
dnl |
| 330 |
for ac_dir in $mh_lib_dirs ; do |
| 331 |
for mh_ext in lib${rexx_l}.a lib${rexx_l}.so lib${rexx_l}.sl ${rexx_l}.lib lib${rexx_l}.dylib; do |
| 332 |
if test -r $ac_dir/$mh_ext; then |
| 333 |
mh_rexx_lib_dir=$ac_dir |
| 334 |
break 2 |
| 335 |
fi |
| 336 |
done |
| 337 |
done |
| 338 |
if test "x$mh_rexx_lib_dir" != "x" ; then |
| 339 |
REXX_LIBS="-L$mh_rexx_lib_dir -l$rexx_l $extra_rexx_libs" |
| 340 |
AC_MSG_RESULT(found in $mh_rexx_lib_dir) |
| 341 |
AC_SUBST(rexxtrans_lib_name) |
| 342 |
else |
| 343 |
AC_MSG_ERROR(Cannot find Rexx library file: $rexx_l; cannot configure) |
| 344 |
fi |
| 345 |
fi |
| 346 |
AC_SUBST(REXX_LIBS) |
| 347 |
])dnl |
| 348 |
|
| 349 |
dnl --------------------------------------------------------------------------- |
| 350 |
dnl Determine if the system has System V IPC. ie sys/ipc.h and sys/shm.h |
| 351 |
dnl headers. |
| 352 |
dnl --------------------------------------------------------------------------- |
| 353 |
AC_DEFUN([MH_IPC], |
| 354 |
[ |
| 355 |
AC_MSG_CHECKING(for System V IPC support) |
| 356 |
AC_CHECK_HEADER(sys/ipc.h) |
| 357 |
if test $ac_cv_header_sys_ipc_h = no; then |
| 358 |
AC_MSG_ERROR(Cannot find required header file sys/ipc.h; XCurses cannot be configured) |
| 359 |
fi |
| 360 |
])dnl |
| 361 |
|
| 362 |
dnl --------------------------------------------------------------------------- |
| 363 |
dnl Set up the correct X header file location |
| 364 |
dnl --------------------------------------------------------------------------- |
| 365 |
AC_DEFUN([MH_CHECK_X_INC], |
| 366 |
[ |
| 367 |
AC_MSG_CHECKING(for location of X headers) |
| 368 |
mh_x11_dir="" |
| 369 |
mh_x11_xaw_dir="" |
| 370 |
dnl |
| 371 |
dnl specify latest release of X directories first |
| 372 |
dnl |
| 373 |
mh_inc_dirs="\ |
| 374 |
$HOME/include/X11 \ |
| 375 |
$HOME/include \ |
| 376 |
/tmp/include/X11 \ |
| 377 |
/tmp/include \ |
| 378 |
/usr/X11R6/include \ |
| 379 |
/usr/include/X11R6 \ |
| 380 |
/usr/local/X11R6/include \ |
| 381 |
/usr/local/include/X11R6 \ |
| 382 |
|
| 383 |
/usr/X11R5/include \ |
| 384 |
/usr/include/X11R5 \ |
| 385 |
/usr/local/X11R5/include \ |
| 386 |
/usr/local/include/X11R5 \ |
| 387 |
/usr/local/x11r5/include \ |
| 388 |
|
| 389 |
/usr/X11R4/include \ |
| 390 |
/usr/include/X11R4 \ |
| 391 |
/usr/local/X11R4/include \ |
| 392 |
/usr/local/include/X11R4 \ |
| 393 |
\ |
| 394 |
/usr/X11/include \ |
| 395 |
/usr/include/X11 \ |
| 396 |
/usr/local/X11/include \ |
| 397 |
/usr/local/include/X11 \ |
| 398 |
\ |
| 399 |
/usr/X386/include \ |
| 400 |
/usr/x386/include \ |
| 401 |
/usr/XFree86/include/X11 \ |
| 402 |
\ |
| 403 |
/usr/include \ |
| 404 |
/usr/local/include \ |
| 405 |
/usr/unsupported/include \ |
| 406 |
/usr/athena/include \ |
| 407 |
/usr/lpp/Xamples/include \ |
| 408 |
\ |
| 409 |
/usr/openwin/include \ |
| 410 |
/usr/openwin/share/include" |
| 411 |
dnl |
| 412 |
dnl Provide for user supplying directory |
| 413 |
dnl |
| 414 |
if test "x$x_includes" != xNONE ; then |
| 415 |
mh_inc_dirs="$x_includes $mh_inc_dirs" |
| 416 |
fi |
| 417 |
|
| 418 |
dnl |
| 419 |
dnl Try to determine the directory containing X headers |
| 420 |
dnl We will append X11 to all the paths above as an extra check |
| 421 |
dnl |
| 422 |
for ac_dir in $mh_inc_dirs ; do |
| 423 |
if test -r $ac_dir/Intrinsic.h; then |
| 424 |
mh_x11_dir=$ac_dir |
| 425 |
break |
| 426 |
fi |
| 427 |
if test -r $ac_dir/X11/Intrinsic.h; then |
| 428 |
mh_x11_dir="$ac_dir/X11" |
| 429 |
break |
| 430 |
fi |
| 431 |
done |
| 432 |
|
| 433 |
dnl |
| 434 |
dnl Try to determine the directory containing Xaw headers |
| 435 |
dnl We will append X11 to all the paths above as an extra check |
| 436 |
dnl |
| 437 |
if test "$with_xaw3d" = yes; then |
| 438 |
mh_xaw_dir="Xaw3d" |
| 439 |
else |
| 440 |
if test "$with_nextaw" = yes; then |
| 441 |
mh_xaw_dir="neXtaw" |
| 442 |
else |
| 443 |
mh_xaw_dir="Xaw" |
| 444 |
fi |
| 445 |
fi |
| 446 |
for ac_dir in $mh_inc_dirs ; do |
| 447 |
if test -r $ac_dir/$mh_xaw_dir/Box.h; then |
| 448 |
mh_x11_xaw_dir=$ac_dir |
| 449 |
break |
| 450 |
fi |
| 451 |
if test -r $ac_dir/X11/$mh_xaw_dir/Box.h; then |
| 452 |
mh_x11_xaw_dir="$ac_dir/X11" |
| 453 |
break |
| 454 |
fi |
| 455 |
done |
| 456 |
|
| 457 |
if test "x$mh_x11_dir" != "x" ; then |
| 458 |
mh_x11_dir_no_x11=`echo $mh_x11_dir | sed 's/\/X11$//'` |
| 459 |
dnl |
| 460 |
dnl Test to see if $mh_x11_dir_no_x11 is /usr/include and we are using gcc |
| 461 |
dnl under Solaris. If so, ignore it. |
| 462 |
AC_REQUIRE([AC_CANONICAL_SYSTEM]) |
| 463 |
mh_solaris_gcc_usr_include="no" |
| 464 |
case "$target" in |
| 465 |
*solaris*) |
| 466 |
if test "$ac_cv_prog_CC" = "gcc" -a "$mh_x11_dir_no_x11" = "/usr/include" ; then |
| 467 |
mh_solaris_gcc_usr_include="yes" |
| 468 |
fi |
| 469 |
;; |
| 470 |
esac |
| 471 |
if test "$mh_x11_dir_no_x11" != "$mh_x11_dir" -a "$mh_solaris_gcc_usr_include" = "no" ; then |
| 472 |
MH_XINC_DIR="-I$mh_x11_dir -I$mh_x11_dir_no_x11" |
| 473 |
else |
| 474 |
MH_XINC_DIR="-I$mh_x11_dir" |
| 475 |
fi |
| 476 |
else |
| 477 |
AC_MSG_ERROR(Cannot find required header file Intrinsic.h; XCurses cannot be configured) |
| 478 |
fi |
| 479 |
|
| 480 |
if test "x$mh_x11_xaw_dir" != "x" ; then |
| 481 |
MH_XINC_DIR="-I$mh_x11_xaw_dir $MH_XINC_DIR" |
| 482 |
else |
| 483 |
AC_MSG_ERROR(Cannot find required Xaw header file Box.h; XCurses cannot be configured) |
| 484 |
fi |
| 485 |
|
| 486 |
AC_MSG_RESULT(found in $mh_x11_dir $mh_x11_xaw_dir) |
| 487 |
AC_SUBST(MH_XINC_DIR) |
| 488 |
|
| 489 |
])dnl |
| 490 |
|
| 491 |
dnl --------------------------------------------------------------------------- |
| 492 |
dnl Set up the correct X library file location |
| 493 |
dnl --------------------------------------------------------------------------- |
| 494 |
AC_DEFUN([MH_CHECK_X_LIB], |
| 495 |
[ |
| 496 |
dnl |
| 497 |
dnl Some systems require extra libraries... |
| 498 |
dnl |
| 499 |
mh_solaris_flag=no |
| 500 |
mh_hpux9_flag=no |
| 501 |
AC_REQUIRE([AC_CANONICAL_SYSTEM]) |
| 502 |
case "$target" in |
| 503 |
*solaris*) |
| 504 |
mh_solaris_flag=yes |
| 505 |
;; |
| 506 |
*pc-sco*) |
| 507 |
extra_x_libs="Xext" |
| 508 |
;; |
| 509 |
sparc*sunos*) |
| 510 |
extra_x_libs="Xext" |
| 511 |
if test "$ac_cv_prog_CC" = "gcc" ; then |
| 512 |
extra_ld_flags="-Wl,-Bstatic" |
| 513 |
extra_ld_flags2="-Wl,-Bdynamic" |
| 514 |
else |
| 515 |
extra_ld_flags="-Bstatic" |
| 516 |
extra_ld_flags2="-Bdynamic" |
| 517 |
fi |
| 518 |
;; |
| 519 |
*hpux9*) |
| 520 |
mh_hpux9_flag=yes |
| 521 |
;; |
| 522 |
esac |
| 523 |
|
| 524 |
AC_MSG_CHECKING(for location of X libraries) |
| 525 |
if test "$with_xaw3d" = yes; then |
| 526 |
MH_X11_LIBS="Xaw3d Xmu Xt X11" |
| 527 |
else |
| 528 |
if test "$with_nextaw" = yes; then |
| 529 |
MH_X11_LIBS="neXtaw Xmu Xt X11" |
| 530 |
else |
| 531 |
MH_X11_LIBS="Xaw Xmu Xt X11" |
| 532 |
fi |
| 533 |
fi |
| 534 |
MH_X11R6_LIBS="Xext Xpm" |
| 535 |
mh_x11r6=no |
| 536 |
|
| 537 |
which dpkg-architecture > /dev/null |
| 538 |
if test $? -eq 0; then |
| 539 |
multiarch_libdir="/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`" |
| 540 |
else |
| 541 |
multiarch_libdir="" |
| 542 |
fi |
| 543 |
dnl |
| 544 |
dnl specify latest release of X directories first |
| 545 |
dnl |
| 546 |
mh_lib_dirs="$multiarch_libdir \ |
| 547 |
$HOME/lib64 \ |
| 548 |
$HOME/lib32 \ |
| 549 |
$HOME/lib \ |
| 550 |
/tmp/lib \ |
| 551 |
/usr/X11R6/lib64 \ |
| 552 |
/usr/X11R6/lib32 \ |
| 553 |
/usr/X11R6/lib \ |
| 554 |
/usr/lib64/X11R6 \ |
| 555 |
/usr/lib32/X11R6 \ |
| 556 |
/usr/lib/X11R6 \ |
| 557 |
/usr/local/X11R6/lib64 \ |
| 558 |
/usr/local/X11R6/lib32 \ |
| 559 |
/usr/local/X11R6/lib \ |
| 560 |
/usr/local/lib64/X11R6 \ |
| 561 |
/usr/local/lib32/X11R6 \ |
| 562 |
/usr/local/lib/X11R6 \ |
| 563 |
|
| 564 |
/usr/X11R5/lib \ |
| 565 |
/usr/lib/X11R5 \ |
| 566 |
/usr/local/X11R5/lib \ |
| 567 |
/usr/local/lib/X11R5 \ |
| 568 |
/usr/local/x11r5/lib \ |
| 569 |
|
| 570 |
/usr/X11R4/lib \ |
| 571 |
/usr/lib/X11R4 \ |
| 572 |
/usr/local/X11R4/lib \ |
| 573 |
/usr/local/lib/X11R4 \ |
| 574 |
\ |
| 575 |
/usr/X11/lib \ |
| 576 |
/usr/lib/X11 \ |
| 577 |
/usr/local/X11/lib \ |
| 578 |
/usr/local/lib/X11 \ |
| 579 |
\ |
| 580 |
/usr/X386/lib \ |
| 581 |
/usr/x386/lib \ |
| 582 |
/usr/XFree86/lib/X11 \ |
| 583 |
\ |
| 584 |
/usr/lib64 \ |
| 585 |
/usr/lib32 \ |
| 586 |
/usr/lib \ |
| 587 |
/usr/local/lib64 \ |
| 588 |
/usr/local/lib32 \ |
| 589 |
/usr/local/lib \ |
| 590 |
/usr/unsupported/lib \ |
| 591 |
/usr/athena/lib \ |
| 592 |
/usr/lpp/Xamples/lib \ |
| 593 |
\ |
| 594 |
/usr/openwin/lib \ |
| 595 |
/usr/openwin/share/lib" |
| 596 |
dnl |
| 597 |
dnl Provide for user supplying directory |
| 598 |
dnl |
| 599 |
if test "x$x_libraries" != xNONE ; then |
| 600 |
mh_lib_dirs="$x_libraries $mh_lib_dirs" |
| 601 |
fi |
| 602 |
|
| 603 |
dnl |
| 604 |
dnl try to find libSM.[a,sl,so,dylib]. If we find it we are using X11R6 |
| 605 |
dnl |
| 606 |
for ac_dir in $mh_lib_dirs ; do |
| 607 |
for mh_xsm in libSM.a libSM.so libSM.sl libSM.dylib; do |
| 608 |
if test -r $ac_dir/$mh_xsm; then |
| 609 |
mh_x11r6=yes |
| 610 |
break 2 |
| 611 |
fi |
| 612 |
done |
| 613 |
done |
| 614 |
|
| 615 |
if test "$mh_x11r6" = yes ; then |
| 616 |
mh_libs="$MH_X11_LIBS $MH_X11R6_LIBS" |
| 617 |
else |
| 618 |
mh_libs="$MH_X11_LIBS $extra_x_libs" |
| 619 |
fi |
| 620 |
|
| 621 |
dnl |
| 622 |
dnl Ensure that all required X libraries are found |
| 623 |
dnl |
| 624 |
mh_prev_dir="" |
| 625 |
mh_where_found="" |
| 626 |
mh_where_found_dirs="" |
| 627 |
mh_solaris_path="" |
| 628 |
for mh_lib in $mh_libs; do |
| 629 |
mh_lib_found=no |
| 630 |
for ac_dir in $mh_lib_dirs ; do |
| 631 |
for mh_ext in a so sl dll.a; do |
| 632 |
if test -r $ac_dir/lib$mh_lib.$mh_ext; then |
| 633 |
if test "x$mh_prev_dir" != "x$ac_dir" ; then |
| 634 |
if test "x$mh_prev_dir" = "x" ; then |
| 635 |
mh_where_found="$mh_where_found found in $ac_dir" |
| 636 |
else |
| 637 |
mh_where_found="$mh_where_found and in $ac_dir" |
| 638 |
fi |
| 639 |
mh_prev_dir=$ac_dir |
| 640 |
mh_where_found_dirs="$mh_where_found_dirs $ac_dir" |
| 641 |
MH_XLIBS="$MH_XLIBS -L$ac_dir" |
| 642 |
mh_solaris_path="${mh_solaris_path}:$ac_dir" |
| 643 |
fi |
| 644 |
MH_XLIBS="$MH_XLIBS -l$mh_lib" |
| 645 |
mh_lib_found=yes |
| 646 |
break 2 |
| 647 |
fi |
| 648 |
done |
| 649 |
done |
| 650 |
if test "$mh_lib_found" = no; then |
| 651 |
AC_MSG_ERROR(Cannot find required X library; lib$mh_lib. XCurses cannot be configured) |
| 652 |
fi |
| 653 |
done |
| 654 |
AC_MSG_RESULT($mh_where_found) |
| 655 |
mh_solaris_path=`echo $mh_solaris_path | sed 's/^://'` |
| 656 |
if test "$mh_solaris_flag" = yes ; then |
| 657 |
MH_XLIBS="-R$mh_solaris_path $extra_ld_flags $MH_XLIBS $extra_libs $extra_ld_flags2" |
| 658 |
else |
| 659 |
MH_XLIBS="$extra_ld_flags $MH_XLIBS $extra_libs $extra_ld_flags2" |
| 660 |
fi |
| 661 |
if test "$mh_hpux9_flag" = yes ; then |
| 662 |
grep -q XtSetLanguageProc $mh_x11_dir/Intrinsic.h |
| 663 |
if test $? -eq 0 ; then |
| 664 |
mh_found_xtshellstrings=no |
| 665 |
for mh_acdir in $mh_where_found_dirs ; do |
| 666 |
for mh_xaw in `ls $mh_acdir/libXaw.*` ; do |
| 667 |
nm $mh_xaw | grep XtShellStrings | grep -qv extern |
| 668 |
if test $? -eq 0 ; then |
| 669 |
mh_found_xtshellstrings=yes |
| 670 |
fi |
| 671 |
done |
| 672 |
done |
| 673 |
if test "$mh_found_xtshellstrings" = no ; then |
| 674 |
AC_MSG_WARN(The X11 development environment has not been installed correctly.) |
| 675 |
AC_MSG_WARN(The header file; Intrinsic.h, is for X11R5 while the Athena Widget) |
| 676 |
AC_MSG_WARN(Set library; libXaw is for X11R4. This is a common problem with) |
| 677 |
AC_MSG_WARN(HP-UX 9.x.) |
| 678 |
AC_MSG_WARN(A set of required X11R5 library files can be obtained from the) |
| 679 |
AC_MSG_WARN(anonymous ftp sites listed on the PDCurses WWW home page:) |
| 680 |
AC_MSG_WARN(http://www.lightlink.com/hessling/) |
| 681 |
AC_MSG_WARN(The file is called HPUX-9.x-libXaw-libXmu.tar.Z) |
| 682 |
AC_MSG_ERROR(X11 installation incomplete; cannot continue) |
| 683 |
fi |
| 684 |
fi |
| 685 |
fi |
| 686 |
AC_SUBST(MH_XLIBS) |
| 687 |
])dnl |
| 688 |
|
| 689 |
dnl --------------------------------------------------------------------------- |
| 690 |
dnl Determine if C compiler handles ANSI prototypes |
| 691 |
dnl --------------------------------------------------------------------------- |
| 692 |
AC_DEFUN([MH_HAVE_PROTO], |
| 693 |
[ |
| 694 |
AC_MSG_CHECKING(if compiler supports ANSI prototypes) |
| 695 |
dnl |
| 696 |
dnl override existing value of $ac_compile so we use the correct compiler |
| 697 |
dnl SHOULD NOT NEED THIS |
| 698 |
dnl |
| 699 |
ac_compile='$ac_cv_prog_CC conftest.$ac_ext $CFLAGS $CPPFLAGS -c 1>&5 2>&5' |
| 700 |
AC_TRY_COMPILE([#include <stdio.h>], |
| 701 |
[extern int xxx(int, char *);], |
| 702 |
mh_have_proto=yes; AC_DEFINE(HAVE_PROTO), mh_have_proto=no ) |
| 703 |
AC_MSG_RESULT($mh_have_proto) |
| 704 |
])dnl |
| 705 |
|
| 706 |
dnl ----------------------------------------------------- |
| 707 |
dnl Determine if compiling <string.h> breaks g++ compiler |
| 708 |
dnl ----------------------------------------------------- |
| 709 |
AC_DEFUN([MH_HAVE_BROKEN_CXX_WITH_STRING_H], |
| 710 |
[ |
| 711 |
AC_MSG_CHECKING(if g++ compiler cannot compile <string.h>) |
| 712 |
dnl |
| 713 |
dnl override existing value of $ac_compile so we use the correct compiler |
| 714 |
dnl SHOULD NOT NEED THIS |
| 715 |
dnl |
| 716 |
ac_compile='$ac_cv_prog_CC conftest.$ac_ext $CFLAGS $CPPFLAGS -c 1>&5 2>&5' |
| 717 |
AC_TRY_COMPILE([#include <string.h>], |
| 718 |
[extern int xxx(int, char *);], |
| 719 |
mh_have_broken_cxx_with_string_h=yes; AC_DEFINE(HAVE_BROKEN_CXX_WITH_STRING_H), mh_have_broken_cxx_with_string_h=no ) |
| 720 |
AC_MSG_RESULT($mh_have_broken_cxx_with_string_h) |
| 721 |
])dnl |
| 722 |
|
| 723 |
dnl --------------------------------------------------------------------------- |
| 724 |
dnl Determine the best C compiler to use given a list |
| 725 |
dnl --------------------------------------------------------------------------- |
| 726 |
AC_DEFUN([MH_PROG_CC], |
| 727 |
[ |
| 728 |
mh_sysv_incdir="" |
| 729 |
mh_sysv_libdir="" |
| 730 |
all_words="clang gcc xlc c99 c89 acc cc" |
| 731 |
ac_dir="" |
| 732 |
AC_MSG_CHECKING(for one of the following C compilers: $all_words) |
| 733 |
AC_CACHE_VAL(ac_cv_prog_CC,[ |
| 734 |
if test -n "$CC"; then |
| 735 |
ac_cv_prog_CC="$CC" # Let the user override the test. |
| 736 |
else |
| 737 |
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" |
| 738 |
for mh_cc in $all_words; do |
| 739 |
for ac_dir in $PATH; do |
| 740 |
test -z "$ac_dir" && ac_dir=. |
| 741 |
if test -f $ac_dir/$mh_cc; then |
| 742 |
ac_cv_prog_CC="$mh_cc" |
| 743 |
if test "$ac_dir" = "/usr/5bin"; then |
| 744 |
mh_sysv_incdir="/usr/5include" |
| 745 |
mh_sysv_libdir="/usr/5lib" |
| 746 |
fi |
| 747 |
break 2 |
| 748 |
fi |
| 749 |
done |
| 750 |
done |
| 751 |
IFS="$ac_save_ifs" |
| 752 |
test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc" |
| 753 |
fi |
| 754 |
CC="$ac_cv_prog_CC" |
| 755 |
]) |
| 756 |
AC_SUBST(CC) |
| 757 |
if test "$ac_dir" = ""; then |
| 758 |
AC_MSG_RESULT(using $ac_cv_prog_CC specified in CC env variable) |
| 759 |
else |
| 760 |
AC_MSG_RESULT(using $ac_dir/$ac_cv_prog_CC) |
| 761 |
fi |
| 762 |
])dnl |
| 763 |
|
| 764 |
dnl --------------------------------------------------------------------------- |
| 765 |
dnl Determine the best C++ compiler to use given a list |
| 766 |
dnl --------------------------------------------------------------------------- |
| 767 |
AC_DEFUN([MH_PROG_CXX], |
| 768 |
[ |
| 769 |
mh_sysv_incdir="" |
| 770 |
mh_sysv_libdir="" |
| 771 |
all_words="$CC_LIST" |
| 772 |
ac_dir="" |
| 773 |
AC_MSG_CHECKING(for one of the following C++ compilers: $all_words) |
| 774 |
AC_CACHE_VAL(ac_cv_prog_CXX,[ |
| 775 |
if test -n "$CXX"; then |
| 776 |
ac_cv_prog_CXX="$CC" # Let the user override the test. |
| 777 |
else |
| 778 |
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" |
| 779 |
for mh_cc in $all_words; do |
| 780 |
for ac_dir in $PATH; do |
| 781 |
test -z "$ac_dir" && ac_dir=. |
| 782 |
if test -f $ac_dir/$mh_cc; then |
| 783 |
ac_cv_prog_CXX="$mh_cc" |
| 784 |
break 2 |
| 785 |
fi |
| 786 |
done |
| 787 |
done |
| 788 |
IFS="$ac_save_ifs" |
| 789 |
test -z "$ac_cv_prog_CXX" && ac_cv_prog_CXX="c++" |
| 790 |
fi |
| 791 |
CXX="$ac_cv_prog_CXX" |
| 792 |
]) |
| 793 |
AC_SUBST(CXX) |
| 794 |
if test "$ac_dir" = ""; then |
| 795 |
AC_MSG_RESULT(using $ac_cv_prog_CXX specified in CXX env variable) |
| 796 |
else |
| 797 |
AC_MSG_RESULT(using $ac_dir/$ac_cv_prog_CXX) |
| 798 |
fi |
| 799 |
])dnl |
| 800 |
|
| 801 |
dnl --------------------------------------------------------------------------- |
| 802 |
dnl Determine if the supplied X headers exist. |
| 803 |
dnl --------------------------------------------------------------------------- |
| 804 |
AC_DEFUN([MH_CHECK_X_HEADERS], |
| 805 |
[ |
| 806 |
save_CPPFLAGS="$CPPFLAGS" |
| 807 |
CPPFLAGS="$CPPFLAGS $MH_XINC_DIR" |
| 808 |
for mh_header in $1; do |
| 809 |
AC_CHECK_HEADERS($mh_header) |
| 810 |
done |
| 811 |
CPPFLAGS="$save_CPPFLAGS" |
| 812 |
])dnl |
| 813 |
|
| 814 |
dnl --------------------------------------------------------------------------- |
| 815 |
dnl Determine if various key definitions exist in keysym.h |
| 816 |
dnl --------------------------------------------------------------------------- |
| 817 |
AC_DEFUN([MH_CHECK_X_KEYDEFS], |
| 818 |
[ |
| 819 |
save_CPPFLAGS="$CPPFLAGS" |
| 820 |
CPPFLAGS="$CPPFLAGS $MH_XINC_DIR" |
| 821 |
for mh_keydef in $1; do |
| 822 |
AC_MSG_CHECKING(for $mh_keydef in keysym.h) |
| 823 |
mh_upper_name="HAVE_`echo $mh_keydef | tr '[a-z]' '[A-Z]'`" |
| 824 |
AC_TRY_COMPILE([#include <keysym.h>], |
| 825 |
[int i = $mh_keydef;], |
| 826 |
mh_have_key=yes; AC_DEFINE_UNQUOTED($mh_upper_name,1), mh_have_key=no ) |
| 827 |
AC_MSG_RESULT($mh_have_key) |
| 828 |
done |
| 829 |
CPPFLAGS="$save_CPPFLAGS" |
| 830 |
])dnl |
| 831 |
|
| 832 |
dnl --------------------------------------------------------------------------- |
| 833 |
dnl Determine if supplied types have been typedefed |
| 834 |
dnl --------------------------------------------------------------------------- |
| 835 |
AC_DEFUN([MH_CHECK_X_TYPEDEF], |
| 836 |
[ |
| 837 |
save_CPPFLAGS="$CPPFLAGS" |
| 838 |
CPPFLAGS="$CPPFLAGS $SYS_DEFS $MH_XINC_DIR" |
| 839 |
for td in $1 ; do |
| 840 |
AC_MSG_CHECKING(if $td is typedefed:) |
| 841 |
AC_TRY_COMPILE( |
| 842 |
[#include "X11/Xlib.h"], |
| 843 |
[$td fred], |
| 844 |
[mh_td=yes], |
| 845 |
[mh_td=no] |
| 846 |
) |
| 847 |
if test "$mh_td" = yes ; then |
| 848 |
TD_upper=`echo $td | tr a-z A-Z` |
| 849 |
AC_DEFINE_UNQUOTED(${TD_upper}_TYPEDEFED, 1) |
| 850 |
fi |
| 851 |
AC_MSG_RESULT($mh_td) |
| 852 |
done |
| 853 |
CPPFLAGS="$save_CPPFLAGS" |
| 854 |
])dnl |
| 855 |
|
| 856 |
dnl --------------------------------------------------------------------------- |
| 857 |
dnl Provide our own AC_TRY_LINK |
| 858 |
dnl --------------------------------------------------------------------------- |
| 859 |
AC_DEFUN([MH_TRY_LINK], |
| 860 |
[ |
| 861 |
mh_link='${LD-ld} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' |
| 862 |
save_CPPFLAGS="$CPPFLAGS" |
| 863 |
CPPFLAGS="$CPPFLAGS $MH_XINC_DIR" |
| 864 |
for mh_keydef in $1; do |
| 865 |
AC_MSG_CHECKING(for $mh_keydef in keysym.h) |
| 866 |
mh_upper_name="HAVE_`echo $mh_keydef | tr '[a-z]' '[A-Z]'`" |
| 867 |
AC_TRY_COMPILE([#include <keysym.h>], |
| 868 |
[int i = $mh_keydef;], |
| 869 |
mh_have_key=yes; AC_DEFINE_UNQUOTED($mh_upper_name,1), mh_have_key=no ) |
| 870 |
AC_MSG_RESULT($mh_have_key) |
| 871 |
done |
| 872 |
CPPFLAGS="$save_CPPFLAGS" |
| 873 |
])dnl |
| 874 |
|
| 875 |
dnl --------------------------------------------------------------------------- |
| 876 |
dnl Check for presense of various libraries |
| 877 |
dnl --------------------------------------------------------------------------- |
| 878 |
AC_DEFUN([MH_CHECK_LIB], |
| 879 |
[ |
| 880 |
MH_EXTRA_LIBS='' |
| 881 |
for mh_lib in $1; do |
| 882 |
if test "$on_qnx4" = yes -a "$ac_cv_prog_CC" != "gcc"; then |
| 883 |
AC_MSG_CHECKING(for library -l${mh_lib}) |
| 884 |
if test -r /usr/lib/${mh_lib}3r.lib; then |
| 885 |
AC_MSG_RESULT(found) |
| 886 |
MH_EXTRA_LIBS="${MH_EXTRA_LIBS} -l${mh_lib}" |
| 887 |
else |
| 888 |
AC_MSG_RESULT(not found) |
| 889 |
fi |
| 890 |
else |
| 891 |
AC_CHECK_LIB($mh_lib,main,mh_lib_found=yes,mh_lib_found=no) |
| 892 |
if test "$mh_lib_found" = yes; then |
| 893 |
MH_EXTRA_LIBS="${MH_EXTRA_LIBS} -l${mh_lib}" |
| 894 |
fi |
| 895 |
fi |
| 896 |
done |
| 897 |
])dnl |
| 898 |
|
| 899 |
dnl --------------------------------------------------------------------------- |
| 900 |
dnl Work out how to create a shared library |
| 901 |
dnl --------------------------------------------------------------------------- |
| 902 |
AC_DEFUN([MH_HOWTO_SHARED_LIBRARY], |
| 903 |
[ |
| 904 |
AC_MSG_CHECKING(how to create a shared library) |
| 905 |
mh_compile='${CC-cc} -c $DYN_COMP conftest.$ac_ext 1>&AC_FD_CC' |
| 906 |
cat > conftest.$ac_ext <<EOF |
| 907 |
dnl [#]line __oline__ "[$]0" |
| 908 |
[#]line __oline__ "configure" |
| 909 |
int foo() |
| 910 |
{ |
| 911 |
return(0); |
| 912 |
} |
| 913 |
EOF |
| 914 |
if AC_TRY_EVAL(mh_compile) && test -s conftest.o; then |
| 915 |
mh_dyn_link='ld -shared -o conftest.so.1.0 conftest.o -lc 1>&AC_FD_CC' |
| 916 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.so.1.0; then |
| 917 |
SHL_LD="ld -shared -o ${SHLPRE}${SHLFILE}${SHLPST} "'$('SHOFILES')'" -lc" |
| 918 |
else |
| 919 |
mh_dyn_link='ld -G -o conftest.so.1.0 conftest.o 1>&AC_FD_CC' |
| 920 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.so.1.0; then |
| 921 |
SHL_LD="ld -G -o ${SHLPRE}${SHLFILE}${SHLPST} "'$('SHOFILES')' |
| 922 |
else |
| 923 |
mh_dyn_link='ld -o conftest.so.1.0 -shared -no_archive conftest.o -lc 1>&AC_FD_CC' |
| 924 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.so.1.0; then |
| 925 |
SHL_LD="ld -o ${SHLPRE}${SHLFILE}${SHLPST} -shared -no_archive "'$('SHOFILES')'" -lc" |
| 926 |
else |
| 927 |
mh_dyn_link='ld -b -o conftest.so.1.0 conftest.o 1>&AC_FD_CC' |
| 928 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.so.1.0; then |
| 929 |
SHL_LD="ld -b -o ${SHLPRE}${SHLFILE}${SHLPST} "'$('SHOFILES')' |
| 930 |
else |
| 931 |
mh_dyn_link='ld -Bshareable -o conftest.so.1.0 conftest.o 1>&AC_FD_CC' |
| 932 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.so.1.0; then |
| 933 |
SHL_LD="ld -Bshareable -o ${SHLPRE}${SHLFILE}${SHLPST} "'$('SHOFILES')' |
| 934 |
else |
| 935 |
mh_dyn_link='ld -assert pure-text -o conftest.so.1.0 conftest.o 1>&AC_FD_CC' |
| 936 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.so.1.0; then |
| 937 |
SHL_LD="ld -assert pure-text -o ${SHLPRE}${SHLFILE}${SHLPST} "'$('SHOFILES')' |
| 938 |
else |
| 939 |
mh_dyn_link='${CC} -shared -o conftest.so.1.0 conftest.o -lc 1>&AC_FD_CC' |
| 940 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.so.1.0; then |
| 941 |
SHL_LD="${CC} -shared -o ${SHLPRE}${SHLFILE}${SHLPST} "'$('SHOFILES')'" -lc" |
| 942 |
else |
| 943 |
SHL_LD="" |
| 944 |
fi |
| 945 |
fi |
| 946 |
fi |
| 947 |
fi |
| 948 |
fi |
| 949 |
fi |
| 950 |
fi |
| 951 |
fi |
| 952 |
if test "$SHL_LD" = ""; then |
| 953 |
AC_MSG_RESULT(unknown) |
| 954 |
else |
| 955 |
AC_MSG_RESULT(found) |
| 956 |
fi |
| 957 |
rm -f conftest* |
| 958 |
]) |
| 959 |
|
| 960 |
dnl --------------------------------------------------------------------------- |
| 961 |
dnl Work out how to create a dynamically loaded module |
| 962 |
dnl --------------------------------------------------------------------------- |
| 963 |
AC_DEFUN([MH_HOWTO_DYN_LINK], |
| 964 |
[ |
| 965 |
mh_compile='${CC-cc} -c $DYN_COMP conftest.$ac_ext 1>&AC_FD_CC' |
| 966 |
cat > conftest.$ac_ext <<EOF |
| 967 |
dnl [#]line __oline__ "[$]0" |
| 968 |
[#]line __oline__ "configure" |
| 969 |
int foo() |
| 970 |
{ |
| 971 |
return(0); |
| 972 |
} |
| 973 |
EOF |
| 974 |
if AC_TRY_EVAL(mh_compile) && test -s conftest.o; then |
| 975 |
mh_dyn_link='ld -shared -o conftest.rxlib conftest.o -lc 1>&AC_FD_CC' |
| 976 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.rxlib; then |
| 977 |
LD_RXLIB1="ld -shared" |
| 978 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 979 |
LD_RXLIB2="${REXX_LIBS}" |
| 980 |
SHLPRE="lib" |
| 981 |
SHLPST=".so" |
| 982 |
RXLIBLEN="6" |
| 983 |
else |
| 984 |
mh_dyn_link='ld -G -o conftest.rxlib conftest.o 1>&AC_FD_CC' |
| 985 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.rxlib; then |
| 986 |
LD_RXLIB1="ld -G" |
| 987 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 988 |
LD_RXLIB2="${REXX_LIBS}" |
| 989 |
SHLPRE="lib" |
| 990 |
SHLPST=".so" |
| 991 |
RXLIBLEN="6" |
| 992 |
else |
| 993 |
mh_dyn_link='${CC} -shared -o conftest.rxlib conftest.o 1>&AC_FD_CC' |
| 994 |
if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.rxlib; then |
| 995 |
LD_RXLIB1="${CC} -shared" |
| 996 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 997 |
LD_RXLIB2="${REXX_LIBS}" |
| 998 |
SHLPRE="lib" |
| 999 |
SHLPST=".so" |
| 1000 |
RXLIBLEN="6" |
| 1001 |
else |
| 1002 |
LD_RXLIB1="" |
| 1003 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1004 |
LD_RXLIB2="" |
| 1005 |
SHLPRE="" |
| 1006 |
SHLPST="" |
| 1007 |
RXLIBLEN="0" |
| 1008 |
fi |
| 1009 |
fi |
| 1010 |
fi |
| 1011 |
fi |
| 1012 |
rm -f conftest* |
| 1013 |
])dnl |
| 1014 |
|
| 1015 |
dnl --------------------------------------------------------------------------- |
| 1016 |
dnl Determine how to build shared libraries etc.. |
| 1017 |
dnl --------------------------------------------------------------------------- |
| 1018 |
AC_DEFUN([MH_SHARED_LIBRARY], |
| 1019 |
[ |
| 1020 |
AC_REQUIRE([MH_SHLPST]) |
| 1021 |
dnl |
| 1022 |
dnl If compiler is gcc, then flags should be the same for all platforms |
| 1023 |
dnl (just guessing on this) |
| 1024 |
dnl |
| 1025 |
OSAVE=".o.save" |
| 1026 |
OBJ="o" |
| 1027 |
EXE="" |
| 1028 |
STATIC_LDFLAGS="" |
| 1029 |
DYNAMIC_LDFLAGS="" |
| 1030 |
AIX_DYN="no" |
| 1031 |
BEOS_DYN="no" |
| 1032 |
SHLFILE="$1" |
| 1033 |
SHLFILES="$*" |
| 1034 |
RXPACKEXPORTS="" |
| 1035 |
BASE_INSTALL="installbase" |
| 1036 |
BASE_BINARY="binarybase" |
| 1037 |
SHLPRE="lib" |
| 1038 |
LD_RXLIB1="" |
| 1039 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1040 |
CAN_USE_ABI="no" |
| 1041 |
LIBEXE="ar" |
| 1042 |
LIBFLAGS="cr" |
| 1043 |
LIBPRE="lib" |
| 1044 |
LIBPST=".a" |
| 1045 |
RXDEFEXP1="" |
| 1046 |
# OTHER_INSTALLS is set to install a non-version numbered shared library |
| 1047 |
# by default; ie. no .\$(ABI) suffix. If the regina executable is not built, |
| 1048 |
# then there is no shared library. Set OTHER_INSTALLS="installabilib" if you |
| 1049 |
# are building a version numbered shared library. |
| 1050 |
OTHER_INSTALLS="installlib" |
| 1051 |
EXTRATARGET="" |
| 1052 |
|
| 1053 |
AC_REQUIRE([AC_CANONICAL_SYSTEM]) |
| 1054 |
case "$target" in |
| 1055 |
*hp-hpux*) |
| 1056 |
SYS_DEFS="-D_HPUX_SOURCE" |
| 1057 |
EEXTRA="-Wl,-E" |
| 1058 |
LD_RXLIB1="ld -b -q -n ${LDFLAGS}" |
| 1059 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1060 |
DYNAMIC_LDFLAGS="-Wl,+s" |
| 1061 |
;; |
| 1062 |
*ibm-aix*) |
| 1063 |
if test "$with_rexx6000" = yes; then |
| 1064 |
mh_entry="-eInitFunc" |
| 1065 |
else |
| 1066 |
mh_entry="-bnoentry" |
| 1067 |
fi |
| 1068 |
SYS_DEFS="-D_ALL_SOURCE -DAIX" |
| 1069 |
AIX_DYN="yes" |
| 1070 |
DYN_COMP="-DDYNAMIC" |
| 1071 |
STATIC_LDFLAGS="-bnso -bI:/lib/syscalls.exp" |
| 1072 |
if test "$ac_cv_prog_CC" = "gcc"; then |
| 1073 |
LD_RXLIB1="${CC} -Wl,$mh_entry -Wl,-bM:SRE ${LDFLAGS}" |
| 1074 |
else |
| 1075 |
LD_RXLIB1="${CC} $mh_entry -bM:SRE ${LDFLAGS}" |
| 1076 |
fi |
| 1077 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1078 |
RXPACKEXPORTS="-bE:$SHLFILE.exp" |
| 1079 |
RXPACKEXP="$SHLFILE.exp" |
| 1080 |
;; |
| 1081 |
powerpc-ibm-os400) |
| 1082 |
LD_RXLIB1="${CC} -shared ${LDFLAGS}" |
| 1083 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1084 |
;; |
| 1085 |
*dec-osf*) |
| 1086 |
if test "$ac_cv_prog_CC" = "gcc"; then |
| 1087 |
SYS_DEFS="-D_POSIX_SOURCE -D_XOPEN_SOURCE" |
| 1088 |
else |
| 1089 |
SYS_DEFS="-D_POSIX_SOURCE -D_XOPEN_SOURCE -Olimit 800" |
| 1090 |
fi |
| 1091 |
LD_RXLIB1="ld -shared ${LDFLAGS}" |
| 1092 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1093 |
;; |
| 1094 |
*sequent-dynix*) |
| 1095 |
LD_RXLIB1="ld -G ${LDFLAGS}" |
| 1096 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1097 |
;; |
| 1098 |
*solaris*) |
| 1099 |
if test "$ac_cv_prog_CC" = "gcc"; then |
| 1100 |
LD_RXLIB1="gcc -shared ${LDFLAGS}" |
| 1101 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1102 |
else |
| 1103 |
LD_RXLIB1="ld -G ${LDFLAGS}" |
| 1104 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1105 |
fi |
| 1106 |
;; |
| 1107 |
*esix*) |
| 1108 |
LD_RXLIB1="ld -G ${LDFLAGS}" |
| 1109 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1110 |
;; |
| 1111 |
*dgux*) |
| 1112 |
LD_RXLIB1="ld -G ${LDFLAGS}" |
| 1113 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1114 |
;; |
| 1115 |
sparc*sunos*) |
| 1116 |
SYS_DEFS="-DSUNOS -DSUNOS_STRTOD_BUG" |
| 1117 |
LD_RXLIB1="ld ${LDFLAGS}" |
| 1118 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1119 |
;; |
| 1120 |
*linux*|*kfreebsd*-gnu*) |
| 1121 |
LD_RXLIB1="${CC} -shared ${LDFLAGS} -Wl,-soname,\$(@)" |
| 1122 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1123 |
CAN_USE_ABI="yes" |
| 1124 |
if test "$USE_ABI" = "yes"; then |
| 1125 |
OTHER_INSTALLS="installabilib" |
| 1126 |
fi |
| 1127 |
;; |
| 1128 |
*atheos*) |
| 1129 |
LD_RXLIB1="${CC} -shared ${LDFLAGS}" |
| 1130 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1131 |
;; |
| 1132 |
*-freebsd* | *openbsd*) |
| 1133 |
if test "$ac_cv_prog_CC" = "gcc"; then |
| 1134 |
LD_RXLIB1="gcc -shared ${LDFLAGS}" |
| 1135 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1136 |
else |
| 1137 |
LD_RXLIB1="ld -Bdynamic -Bshareable ${LDFLAGS}" |
| 1138 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1139 |
fi |
| 1140 |
STATIC_LDFLAGS="-static" |
| 1141 |
;; |
| 1142 |
*pc-sco*) |
| 1143 |
LD_RXLIB1="ld -dy -G ${LDFLAGS}" |
| 1144 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1145 |
;; |
| 1146 |
*beos*) |
| 1147 |
LD_RXLIB1="${CC} ${LDFLAGS} -Wl,-shared -nostart -Xlinker -soname=\$(@)" |
| 1148 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1149 |
BEOS_DYN="yes" |
| 1150 |
BASE_INSTALL="beosinstall" |
| 1151 |
BASE_BINARY="beosbinary" |
| 1152 |
OTHER_INSTALLS="" |
| 1153 |
;; |
| 1154 |
*haiku*) |
| 1155 |
LD_RXLIB1="${CC} -shared ${LDFLAGS} -Wl,-soname,\$(SONAME)" |
| 1156 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1157 |
CAN_USE_ABI="yes" |
| 1158 |
if test "$USE_ABI" = "yes"; then |
| 1159 |
OTHER_INSTALLS="installabilib" |
| 1160 |
fi |
| 1161 |
BASE_INSTALL="haikuinstall" |
| 1162 |
BASE_BINARY="haikubinary" |
| 1163 |
;; |
| 1164 |
*nto-qnx*) |
| 1165 |
LD_RXLIB1="${CC} -shared ${LDFLAGS}" |
| 1166 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1167 |
;; |
| 1168 |
*qnx*) |
| 1169 |
LIBPRE="" |
| 1170 |
LIBPST=".lib" |
| 1171 |
SHLPRE="" |
| 1172 |
DYN_COMP="-Q -DSTATIC_DYNAMIC_LIBRARY" # force no check for dynamic loading |
| 1173 |
SHLFILE="" |
| 1174 |
EEXTRA="-mf -N0x20000 -Q" |
| 1175 |
;; |
| 1176 |
*cygwin) |
| 1177 |
LIBPRE="lib" |
| 1178 |
SHLPRE="" |
| 1179 |
DYN_COMP="-DDYNAMIC" |
| 1180 |
LIBPST=".a" |
| 1181 |
EXE=".exe" |
| 1182 |
RXDEFEXP1="./cygwin.def" |
| 1183 |
# Only for Rexx/Trans do we produce an import library for the DLL we are |
| 1184 |
# building |
| 1185 |
LD_RXLIB1="dllwrap --def \$(RXDEFEXP1) --target i386-cygwin32 --dllname \$(@)" |
| 1186 |
LD_RXTRANSLIB1="dllwrap --def \$(srcdir)/\$(basename \$(@))w32.def --output-lib ${LIBPRE}\$(basename \$(@))${LIBPST} --target i386-cygwin32 --dllname \$(@)" |
| 1187 |
BASE_INSTALL="cygwininstall" |
| 1188 |
BASE_BINARY="cygwinbinary" |
| 1189 |
# cygwininstall target MUST install the shared library itself because |
| 1190 |
# it puts it into $(bindir) not $(libdir) as all other platforms |
| 1191 |
OTHER_INSTALLS="" |
| 1192 |
;; |
| 1193 |
*darwin*) |
| 1194 |
DYN_COMP="-fno-common -DDYNAMIC" |
| 1195 |
# ensure we use two-name namespace on Mac so that when a function in a common source file is called the one |
| 1196 |
# in the shared library the call came from is executed, not one with the same name from another shared library |
| 1197 |
# otherwise you will get memory corruption. |
| 1198 |
LD_RXLIB1="${CC} ${LDFLAGS} ${EEXTRA} -dynamiclib -headerpad_max_install_names" |
| 1199 |
LD_RXTRANSLIB1="$LD_RXLIB1" |
| 1200 |
;; |
| 1201 |
*) |
| 1202 |
;; |
| 1203 |
esac |
| 1204 |
|
| 1205 |
dnl |
| 1206 |
dnl determine what switches our compiler uses for building objects |
| 1207 |
dnl suitable for inclusion in shared libraries |
| 1208 |
dnl Only call this if DYN_COMP is not set. If we have set DYN_COMP |
| 1209 |
dnl above, then we know how to compile AND link for dynamic libraries |
| 1210 |
dnl |
| 1211 |
if test "$DYN_COMP" = ""; then |
| 1212 |
AC_MSG_CHECKING(compiler flags for a dynamic object) |
| 1213 |
|
| 1214 |
cat > conftest.$ac_ext <<EOF |
| 1215 |
dnl [#]line __oline__ "[$]0" |
| 1216 |
[#]line __oline__ "configure" |
| 1217 |
int a=0 |
| 1218 |
EOF |
| 1219 |
|
| 1220 |
DYN_COMP="" |
| 1221 |
mh_cv_stop=no |
| 1222 |
save_cflags="$CFLAGS" |
| 1223 |
mh_cv_flags="-fPIC -KPIC +Z" |
| 1224 |
for a in $mh_cv_flags; do |
| 1225 |
CFLAGS="-c $a" |
| 1226 |
|
| 1227 |
mh_compile='${CC-cc} -c $CFLAGS conftest.$ac_ext > conftest.tmp 2>&1' |
| 1228 |
if AC_TRY_EVAL(mh_compile); then |
| 1229 |
DYN_COMP="" |
| 1230 |
else |
| 1231 |
slash="\\" |
| 1232 |
mh_dyncomp="`egrep -c $slash$a conftest.tmp`" |
| 1233 |
if test "$mh_dyncomp" = "0"; then |
| 1234 |
DYN_COMP="$a -DDYNAMIC" |
| 1235 |
AC_MSG_RESULT($a) |
| 1236 |
break |
| 1237 |
else |
| 1238 |
DYN_COMP="" |
| 1239 |
fi |
| 1240 |
fi |
| 1241 |
done |
| 1242 |
if test "$DYN_COMP" = ""; then |
| 1243 |
AC_MSG_RESULT(none of $mh_cv_flags supported) |
| 1244 |
fi |
| 1245 |
if test "$LD_RXLIB1" = ""; then |
| 1246 |
MH_HOWTO_DYN_LINK() |
| 1247 |
fi |
| 1248 |
CFLAGS=$save_cflags |
| 1249 |
rm -f conftest.* |
| 1250 |
fi |
| 1251 |
|
| 1252 |
|
| 1253 |
aix_exports="config.exports.aix" |
| 1254 |
echo "" > $aix_exports |
| 1255 |
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 |
| 1256 |
if test "$with_rexx" = "rexxtrans" -o "$with_rexx" = "regina" -o "$with_rexx" = "objrexx" -o "$with_rexx" = "oorexx" -o "$with_rexx" = "rexx6000"; then |
| 1257 |
EXPS="1,2,3,4,5,6,7,8,9" |
| 1258 |
SHL_TARGETS="" |
| 1259 |
for a in $SHLFILES |
| 1260 |
do |
| 1261 |
if test "$USE_ABI" = "yes" -a "$CAN_USE_ABI" = "yes"; then |
| 1262 |
SHL_TARGETS="${SHL_TARGETS} ${SHLPRE}${a}${SHLPST}.\$(ABI)" |
| 1263 |
else |
| 1264 |
SHL_TARGETS="${SHL_TARGETS} ${SHLPRE}${a}${SHLPST}" |
| 1265 |
fi |
| 1266 |
this=`echo $EXPS | cut -d, -f1` |
| 1267 |
EXPS=`echo $EXPS | cut -d, -f2-` |
| 1268 |
if test "$AIX_DYN" = "yes"; then |
| 1269 |
echo "RXPACKEXP$this=$a.exp" >> $aix_exports |
| 1270 |
echo "RXPACKEXPORTS$this=-bE:$a.exp" >> $aix_exports |
| 1271 |
if test "$ac_cv_prog_CC" = "gcc"; then |
| 1272 |
echo "RXPACKEXPORTS$this=-Wl,-bE:$a.exp" >> $aix_exports |
| 1273 |
else |
| 1274 |
echo "RXPACKEXPORTS$this=-bE:$a.exp" >> $aix_exports |
| 1275 |
fi |
| 1276 |
else |
| 1277 |
echo "RXPACKEXP$this=" >> $aix_exports |
| 1278 |
echo "RXPACKEXPORTS$this=" >> $aix_exports |
| 1279 |
fi |
| 1280 |
done |
| 1281 |
else |
| 1282 |
SHL_TARGETS="" |
| 1283 |
fi |
| 1284 |
else |
| 1285 |
SHL_TARGETS="" |
| 1286 |
fi |
| 1287 |
|
| 1288 |
if test "$AIX_DYN" = "yes"; then |
| 1289 |
STATICLIB="" |
| 1290 |
LIBPST=".junk" |
| 1291 |
else |
| 1292 |
STATICLIB="${LIBPRE}${SHLFILE}${LIBPST}" |
| 1293 |
fi |
| 1294 |
|
| 1295 |
LD_RXLIB1="$LD_RXLIB1 ${LDFLAGS}" |
| 1296 |
|
| 1297 |
AC_SUBST_FILE(aix_exports) |
| 1298 |
AC_SUBST(EEXTRA) |
| 1299 |
AC_SUBST(CEXTRA) |
| 1300 |
AC_SUBST(OSAVE) |
| 1301 |
AC_SUBST(OBJ) |
| 1302 |
AC_SUBST(EXE) |
| 1303 |
AC_SUBST(DYN_COMP) |
| 1304 |
AC_SUBST(LIBS) |
| 1305 |
AC_SUBST(SHLIBS) |
| 1306 |
AC_SUBST(LD_RXLIB1) |
| 1307 |
AC_SUBST(LD_RXTRANSLIB1) |
| 1308 |
AC_SUBST(SHLPRE) |
| 1309 |
AC_SUBST(SHLPST) |
| 1310 |
AC_SUBST(LIBPST) |
| 1311 |
AC_SUBST(LIBPRE) |
| 1312 |
AC_SUBST(LIBEXE) |
| 1313 |
AC_SUBST(LIBFLAGS) |
| 1314 |
AC_SUBST(DYNAMIC_LDFLAGS) |
| 1315 |
AC_SUBST(STATIC_LDFLAGS) |
| 1316 |
AC_SUBST(STATICLIB) |
| 1317 |
AC_SUBST(SHL_TARGETS) |
| 1318 |
AC_SUBST(O2SAVE) |
| 1319 |
AC_SUBST(O2SHO) |
| 1320 |
AC_SUBST(CC2O) |
| 1321 |
AC_SUBST(BASE_INSTALL) |
| 1322 |
AC_SUBST(OTHER_INSTALLS) |
| 1323 |
AC_SUBST(BASE_BINARY) |
| 1324 |
AC_SUBST(SAVE2O) |
| 1325 |
AC_SUBST(RXPACKEXPORTS) |
| 1326 |
AC_SUBST(RXPACKEXP) |
| 1327 |
AC_SUBST(RXDEFEXP1) |
| 1328 |
AC_SUBST(CAN_USE_ABI) |
| 1329 |
])dnl |
| 1330 |
|
| 1331 |
dnl --------------------------------------------------------------------------- |
| 1332 |
dnl Check if C compiler supports -c -o file.ooo |
| 1333 |
dnl --------------------------------------------------------------------------- |
| 1334 |
AC_DEFUN([MH_CHECK_CC_O], |
| 1335 |
[ |
| 1336 |
AC_MSG_CHECKING(whether $CC understand -c and -o together) |
| 1337 |
set dummy $CC; ac_cc="`echo [$]2 | |
| 1338 |
changequote(, )dnl |
| 1339 |
sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" |
| 1340 |
changequote([, ])dnl |
| 1341 |
AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o, |
| 1342 |
[echo 'int foo(){}' > conftest.c |
| 1343 |
# We do the test twice because some compilers refuse to overwrite an |
| 1344 |
# existing .o file with -o, though they will create one. |
| 1345 |
eval ac_cv_prog_cc_${ac_cc}_c_o=no |
| 1346 |
ac_try='${CC-cc} -c conftest.c -o conftest.ooo 1>&AC_FD_CC' |
| 1347 |
if AC_TRY_EVAL(ac_try) && test -f conftest.ooo && AC_TRY_EVAL(ac_try); |
| 1348 |
then |
| 1349 |
ac_try='${CC-cc} -c conftest.c -o conftest.ooo 1>&AC_FD_CC' |
| 1350 |
if AC_TRY_EVAL(ac_try) && test -f conftest.ooo && AC_TRY_EVAL(ac_try); |
| 1351 |
then |
| 1352 |
eval ac_cv_prog_cc_${ac_cc}_c_o=yes |
| 1353 |
fi |
| 1354 |
fi |
| 1355 |
rm -f conftest* |
| 1356 |
])dnl |
| 1357 |
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then |
| 1358 |
O2SHO="" |
| 1359 |
O2SAVE="" |
| 1360 |
SAVE2O="" |
| 1361 |
CC2O="-o $"'@' |
| 1362 |
AC_MSG_RESULT(yes) |
| 1363 |
else |
| 1364 |
O2SHO="-mv \`basename "$'@'" .sho\`.o "$'@' |
| 1365 |
O2SAVE="-mv \`basename "$'@'" .sho\`.o \`basename "$'@'" .sho\`.o.save" |
| 1366 |
SAVE2O="-mv \`basename "$'@'" .sho\`.o.save \`basename "$'@'" .sho\`.o" |
| 1367 |
CC2O="" |
| 1368 |
AC_MSG_RESULT(no) |
| 1369 |
fi |
| 1370 |
]) |
| 1371 |
|
| 1372 |
dnl --------------------------------------------------------------------------- |
| 1373 |
dnl Work out if functions in dynamically loadable libraries need leading _ |
| 1374 |
dnl Tests based on glib code and only valid for dlopen() mechanism |
| 1375 |
dnl --------------------------------------------------------------------------- |
| 1376 |
AC_DEFUN([MH_CHECK_LEADING_USCORE], |
| 1377 |
[ |
| 1378 |
if test "$ac_cv_header_dlfcn_h" = "yes" -o "$HAVE_DLFCN_H" = "1"; then |
| 1379 |
AC_MSG_CHECKING(if symbols need underscore prepended in loadable modules) |
| 1380 |
tmpLIBS="$LIBS" |
| 1381 |
save_cflags="$CFLAGS" |
| 1382 |
LIBS="$LIBS $DLFCNLIBDIR" |
| 1383 |
CFLAGS="$CFLAGS $DLFCNINCDIR" |
| 1384 |
AC_CACHE_VAL(mh_cv_uscore,[ |
| 1385 |
AC_RUN_IFELSE( |
| 1386 |
[AC_LANG_SOURCE([ |
| 1387 |
#include <dlfcn.h> |
| 1388 |
int mh_underscore_test (void) { return 42; } |
| 1389 |
int main() { |
| 1390 |
void *f1 = (void*)0, *f2 = (void*)0, *handle; |
| 1391 |
handle = dlopen ((void*)0, 0); |
| 1392 |
if (handle) { |
| 1393 |
f1 = dlsym (handle, "mh_underscore_test"); |
| 1394 |
f2 = dlsym (handle, "_mh_underscore_test"); |
| 1395 |
} return (!f2 || f1); |
| 1396 |
}], |
| 1397 |
[mh_cv_uscore=yes], |
| 1398 |
[mh_cv_uscore=no], |
| 1399 |
[mh_cv_uscore=no] |
| 1400 |
) |
| 1401 |
],[mh_cv_uscore=yes],[mh_cv_uscore=no],mh_cv_uscore=no) |
| 1402 |
]) |
| 1403 |
AC_MSG_RESULT($mh_cv_uscore) |
| 1404 |
if test "x$mh_cv_uscore" = "xyes"; then |
| 1405 |
AC_DEFINE(MODULES_NEED_USCORE) |
| 1406 |
fi |
| 1407 |
LIBS="$tmpLIBS" |
| 1408 |
CFLAGS="$save_cflags" |
| 1409 |
fi |
| 1410 |
]) |
| 1411 |
|
| 1412 |
dnl --------------------------------------------------------------------------- |
| 1413 |
dnl Determines the file extension for shared libraries |
| 1414 |
dnl --------------------------------------------------------------------------- |
| 1415 |
AC_DEFUN([MH_SHLPST], |
| 1416 |
[ |
| 1417 |
AC_MSG_CHECKING(shared library/external function extensions) |
| 1418 |
SHLPST=".so" |
| 1419 |
MODPST=".so" |
| 1420 |
AC_REQUIRE([AC_CANONICAL_SYSTEM]) |
| 1421 |
case "$target" in |
| 1422 |
*hp-hpux*) |
| 1423 |
SHLPST=".sl" |
| 1424 |
MODPST=".sl" |
| 1425 |
;; |
| 1426 |
*ibm-aix5*) |
| 1427 |
SHLPST=".a" |
| 1428 |
MODPST=".a" |
| 1429 |
;; |
| 1430 |
*ibm-aix*) |
| 1431 |
SHLPST=".a" |
| 1432 |
MODPST=".a" |
| 1433 |
;; |
| 1434 |
*nto-qnx*) |
| 1435 |
;; |
| 1436 |
*qnx*) |
| 1437 |
SHLPST=".junk" |
| 1438 |
MODPST="" |
| 1439 |
;; |
| 1440 |
*cygwin*) |
| 1441 |
SHLPST=".dll" |
| 1442 |
MODPST=".dll" |
| 1443 |
;; |
| 1444 |
*skyos*) |
| 1445 |
SHLPST=".dll" |
| 1446 |
MODPST=".dll" |
| 1447 |
;; |
| 1448 |
*darwin*) |
| 1449 |
SHLPST=".dylib" |
| 1450 |
MODPST=".dylib" |
| 1451 |
;; |
| 1452 |
esac |
| 1453 |
AC_SUBST(SHLPST) |
| 1454 |
AC_SUBST(MODPST) |
| 1455 |
AC_MSG_RESULT($SHLPST/$MODPST) |
| 1456 |
]) |
| 1457 |
|
| 1458 |
dnl --------------------------------------------------------------------------- |
| 1459 |
dnl Work out if POSIX Threads are supported |
| 1460 |
dnl --------------------------------------------------------------------------- |
| 1461 |
AC_DEFUN([MH_CHECK_POSIX_THREADS], |
| 1462 |
[ |
| 1463 |
MH_MT_LIBS="" |
| 1464 |
THREADING_COMPILE="" |
| 1465 |
THREADING_LINK="" |
| 1466 |
THREADSAFE_TARGET="" |
| 1467 |
MT_FILE="rxmt_notmt" |
| 1468 |
if test "$enable_posix_threads" = yes; then |
| 1469 |
dnl |
| 1470 |
dnl -lrt is needed by posix threads on Solaris |
| 1471 |
dnl |
| 1472 |
AC_CHECK_LIB("rt",main,mh_rt_lib_found=yes,mh_rt_lib_found=no) |
| 1473 |
AC_MSG_CHECKING(whether Posix Threads are supported) |
| 1474 |
tmpLIBS=$LIBS |
| 1475 |
save_cflags="$CFLAGS" |
| 1476 |
pthread_libs="pthreads pthread c_r c" |
| 1477 |
case "$target" in |
| 1478 |
*freebsd*) |
| 1479 |
CFLAGS="$CFLAGS -pthread" |
| 1480 |
;; |
| 1481 |
esac |
| 1482 |
for mh_lib in $pthread_libs; do |
| 1483 |
LIBS="$tmpLIBS -l${mh_lib}" |
| 1484 |
AC_TRY_LINK( |
| 1485 |
[#include <pthread.h>], |
| 1486 |
[pthread_create(NULL,NULL,NULL,NULL)], |
| 1487 |
[mh_has_pthreads=yes], |
| 1488 |
[mh_has_pthreads=no] |
| 1489 |
) |
| 1490 |
if test "$mh_has_pthreads" = yes; then |
| 1491 |
MH_MT_LIBS="-l${mh_lib}" |
| 1492 |
AC_REQUIRE([AC_CANONICAL_SYSTEM]) |
| 1493 |
THREADING_COMPILE="-D_REENTRANT -DPOSIX" |
| 1494 |
THREADING_LINK="" |
| 1495 |
MT_FILE="rxmt_posix" |
| 1496 |
case "$target" in |
| 1497 |
*solaris*) |
| 1498 |
if test "$ac_cv_prog_CC" = "gcc" -o "$ac_cv_prog_CC" = "g++" -o "$ac_cv_prog_CC" = "clang"; then |
| 1499 |
THREADING_COMPILE="-D_REENTRANT -DPOSIX" |
| 1500 |
if test "$mh_rt_lib_found" = "yes"; then |
| 1501 |
THREADING_LINK="-lrt" |
| 1502 |
fi |
| 1503 |
else |
| 1504 |
THREADING_COMPILE="-mt -D_REENTRANT -DREENTRANT -D_PTHREAD_SEMANTICS" |
| 1505 |
THREADING_LINK="-mt" |
| 1506 |
fi |
| 1507 |
;; |
| 1508 |
*hp-hpux1*) |
| 1509 |
if test "$ac_cv_prog_CC" = "gcc" -o "$ac_cv_prog_CC" = "g++" -o "$ac_cv_prog_CC" = "clang"; then |
| 1510 |
THREADING_COMPILE="-D_REENTRANT -DPOSIX" |
| 1511 |
fi |
| 1512 |
if test "$mh_rt_lib_found" = "yes"; then |
| 1513 |
THREADING_LINK="-lrt" |
| 1514 |
fi |
| 1515 |
;; |
| 1516 |
*linux*) |
| 1517 |
if test "$ac_cv_prog_CC" = "gcc" -o "$ac_cv_prog_CC" = "g++" -o "$ac_cv_prog_CC" = "clang"; then |
| 1518 |
THREADING_LINK="-lpthread" |
| 1519 |
else |
| 1520 |
THREADING_LINK="-lpthread" |
| 1521 |
fi |
| 1522 |
;; |
| 1523 |
*freebsd*) |
| 1524 |
THREADING_COMPILE="-pthread -D_REENTRANT -DPOSIX" |
| 1525 |
THREADING_LINK="-pthread" |
| 1526 |
;; |
| 1527 |
*cygwin*) |
| 1528 |
THREADING_COMPILE="-D_REENTRANT -DPOSIX" |
| 1529 |
THREADING_LINK="" |
| 1530 |
;; |
| 1531 |
*) |
| 1532 |
if test "$ac_cv_prog_CC" = "gcc" -o "$ac_cv_prog_CC" = "g++" -o "$ac_cv_prog_CC" = "clang"; then |
| 1533 |
THREADING_COMPILE="-D_REENTRANT -DPOSIX" |
| 1534 |
fi |
| 1535 |
;; |
| 1536 |
esac |
| 1537 |
break |
| 1538 |
fi |
| 1539 |
done |
| 1540 |
LIBS="$tmpLIBS" |
| 1541 |
CFLAGS="$save_cflags" |
| 1542 |
AC_MSG_RESULT($mh_has_pthreads) |
| 1543 |
fi |
| 1544 |
AC_SUBST(THREADING_COMPILE) |
| 1545 |
AC_SUBST(THREADING_LINK) |
| 1546 |
AC_SUBST(MH_MT_LIBS) |
| 1547 |
AC_SUBST(MT_FILE) |
| 1548 |
]) |
| 1549 |
|
| 1550 |
dnl --------------------------------------------------------------------------- |
| 1551 |
dnl Determines where rpm build files are located - use MH_CHECK_PACKAGE_BUILDERS instead |
| 1552 |
dnl --------------------------------------------------------------------------- |
| 1553 |
AC_DEFUN([MH_CHECK_RPM], |
| 1554 |
[ |
| 1555 |
AC_CHECK_PROG(mh_rpm_exists, rpm, yes, no ) |
| 1556 |
if test "$mh_rpm_exists" = yes; then |
| 1557 |
AC_MSG_CHECKING(where rpms are built) |
| 1558 |
RPMTOPDIR=`rpm --eval "%{_topdir}"` |
| 1559 |
AC_MSG_RESULT($RPMTOPDIR) |
| 1560 |
AC_SUBST(RPMTOPDIR) |
| 1561 |
fi |
| 1562 |
]) |
| 1563 |
|
| 1564 |
dnl --------------------------------------------------------------------------- |
| 1565 |
dnl Sets package directories within the source tree |
| 1566 |
dnl --------------------------------------------------------------------------- |
| 1567 |
AC_DEFUN([MH_CHECK_PACKAGE_BUILDERS], |
| 1568 |
[ |
| 1569 |
# |
| 1570 |
# get our own abs_srcdir as autoconf sucks |
| 1571 |
# |
| 1572 |
here=`pwd` |
| 1573 |
cd $srcdir |
| 1574 |
absolute_srcdir=`pwd` |
| 1575 |
cd $here |
| 1576 |
# |
| 1577 |
packagesdir="$absolute_srcdir/packages" |
| 1578 |
AC_SUBST(packagesdir) |
| 1579 |
AC_MSG_CHECKING(where rpms are built) |
| 1580 |
AC_CHECK_PROG(mh_rpm_exists, rpmbuild, yes, no ) |
| 1581 |
if test "$mh_rpm_exists" = yes; then |
| 1582 |
# rpmtopdir=`rpm --eval "%{_topdir}"` |
| 1583 |
rpmtopdir="${packagesdir}/RPM" |
| 1584 |
AC_MSG_RESULT($rpmtopdir) |
| 1585 |
else |
| 1586 |
rpmtopdir="" |
| 1587 |
AC_MSG_RESULT("not avaliable") |
| 1588 |
fi |
| 1589 |
AC_SUBST(rpmtopdir) |
| 1590 |
# |
| 1591 |
AC_MSG_CHECKING(where deb packages are built) |
| 1592 |
AC_CHECK_PROG(mh_dpkg_exists, dpkg-buildpackage, yes, no ) |
| 1593 |
if test "$mh_dpkg_exists" = yes; then |
| 1594 |
debtopdir="${packagesdir}/DEB" |
| 1595 |
AC_MSG_RESULT($debtopdir) |
| 1596 |
else |
| 1597 |
debtopdir="" |
| 1598 |
AC_MSG_RESULT("not avaliable") |
| 1599 |
fi |
| 1600 |
AC_SUBST(debtopdir) |
| 1601 |
# |
| 1602 |
AC_MSG_CHECKING(where apk packages are built) |
| 1603 |
AC_CHECK_PROG(mh_apk_exists, abuild, yes, no ) |
| 1604 |
if test "$mh_apk_exists" = yes; then |
| 1605 |
apktopdir="${packagesdir}/APK" |
| 1606 |
AC_MSG_RESULT($apktopdir) |
| 1607 |
else |
| 1608 |
apktopdir="" |
| 1609 |
AC_MSG_RESULT("not avaliable") |
| 1610 |
fi |
| 1611 |
AC_SUBST(apktopdir) |
| 1612 |
# if we haven't set an environment variable; PACKAGE_RELEASE to a value, |
| 1613 |
# get a timestamp for use in eg RPM Spec file Release |
| 1614 |
AC_MSG_CHECKING(getting PACKAGE_RELEASE value) |
| 1615 |
PACKAGE_RELEASE=`echo $PACKAGE_RELEASE` |
| 1616 |
if test x"$PACKAGE_RELEASE" == "x"; then |
| 1617 |
PACKAGE_RELEASE=`date +%y%m%d.%H%M` |
| 1618 |
fi |
| 1619 |
AC_MSG_RESULT($PACKAGE_RELEASE) |
| 1620 |
AC_SUBST(PACKAGE_RELEASE) |
| 1621 |
]) |
| 1622 |
|
| 1623 |
dnl --------------------------------------------------------------------------- |
| 1624 |
dnl Determines whether compiler supports long long |
| 1625 |
dnl --------------------------------------------------------------------------- |
| 1626 |
AC_DEFUN([MH_C_LONG_LONG], |
| 1627 |
[AC_CACHE_CHECK(for long long int, mh_cv_c_long_long, |
| 1628 |
[if test "$ac_cv_prog_CC" = "gcc" -o "$ac_cv_prog_CC" = "g++" -o "$ac_cv_prog_CC" = "clang"; then |
| 1629 |
mh_cv_c_long_long=yes |
| 1630 |
else |
| 1631 |
AC_TRY_COMPILE(,[long long int i;], |
| 1632 |
mh_cv_c_long_long=yes, |
| 1633 |
mh_cv_c_long_long=no) |
| 1634 |
fi]) |
| 1635 |
if test $mh_cv_c_long_long = yes; then |
| 1636 |
AC_DEFINE(HAVE_LONG_LONG, 1, [compiler understands long long]) |
| 1637 |
fi |
| 1638 |
]) |
| 1639 |
|
| 1640 |
dnl --------------------------------------------------------------------------- |
| 1641 |
dnl Shows the status of the configure options |
| 1642 |
dnl --------------------------------------------------------------------------- |
| 1643 |
AC_DEFUN([MH_SHOW_STATUS], |
| 1644 |
[ |
| 1645 |
echo |
| 1646 |
echo "$FULL_PACKAGE_NAME has now been configured with the following options:" |
| 1647 |
echo |
| 1648 |
echo " Rexx Interpreter: $REXX_INT" |
| 1649 |
|
| 1650 |
if test "$with_rexxincdir" != no ; then |
| 1651 |
echo " rexx headers in: $with_rexxincdir" |
| 1652 |
fi |
| 1653 |
|
| 1654 |
if test "$with_rexxlibdir" != no ; then |
| 1655 |
echo " rexx libraries in: $with_rexxlibdir" |
| 1656 |
fi |
| 1657 |
|
| 1658 |
if test "$with_dlfcnincdir" != no ; then |
| 1659 |
echo " dlfcn headers in: $with_dlfcnincdir" |
| 1660 |
fi |
| 1661 |
if test "$with_dlfcnlibdir" != no ; then |
| 1662 |
echo " dlfcn libraries in: $with_dlfcnlibdir" |
| 1663 |
fi |
| 1664 |
|
| 1665 |
dnl |
| 1666 |
dnl Run the package_specific status shower |
| 1667 |
dnl |
| 1668 |
$1 |
| 1669 |
|
| 1670 |
myopts="$myopts ${bitflag}BIT" |
| 1671 |
|
| 1672 |
if test "$with_debug" = yes ; then |
| 1673 |
myopts="$myopts DEBUG" |
| 1674 |
fi |
| 1675 |
|
| 1676 |
if test "$with_purify" = yes ; then |
| 1677 |
myopts="$myopts PURIFY" |
| 1678 |
fi |
| 1679 |
|
| 1680 |
if test "$with_efence" = yes; then |
| 1681 |
myopts="$myopts EFENCE" |
| 1682 |
fi |
| 1683 |
|
| 1684 |
if test "$with_hpux_portable" = yes ; then |
| 1685 |
myopts="$myopts HPUX-PORTABLE" |
| 1686 |
fi |
| 1687 |
|
| 1688 |
if test "x$found_arch_flags" != "x" ; then |
| 1689 |
myopts="$myopts UNIVERSAL: $found_arch_flags" |
| 1690 |
fi |
| 1691 |
|
| 1692 |
if test "$on_beos" = yes; then |
| 1693 |
bindir="/boot/home/config/bin" |
| 1694 |
libdir="/boot/home/config/lib" |
| 1695 |
fi |
| 1696 |
|
| 1697 |
if test "$on_haiku" = yes; then |
| 1698 |
bindir="/boot/home/config/non-packaged/bin" |
| 1699 |
libdir="/boot/home/config/non-packaged/lib" |
| 1700 |
addonsdir="/boot/home/config/non-packaged/lib/regina-rexx/addons" |
| 1701 |
fi |
| 1702 |
|
| 1703 |
echo " Build options: $myopts" |
| 1704 |
echo " binaries will be installed in: $bindir" |
| 1705 |
if test "x$binarybitprefix" = "x32"; then |
| 1706 |
echo " 32bit binaries will have '32' appended to them." |
| 1707 |
fi |
| 1708 |
echo " libraries will be installed in: $REXX_ADDONS" |
| 1709 |
echo " {prefix}: $prefix" |
| 1710 |
echo " {exec_prefix}: $exec_prefix" |
| 1711 |
if test "x$rpmtopdir" != "x" ; then |
| 1712 |
echo " RPM topdir: $rpmtopdir" |
| 1713 |
fi |
| 1714 |
if test "x$debtopdir" != "x" ; then |
| 1715 |
echo " DEB topdir: $debtopdir" |
| 1716 |
fi |
| 1717 |
if test "x$apktopdir" != "x" ; then |
| 1718 |
echo " APK topdir: $apktopdir" |
| 1719 |
fi |
| 1720 |
echo |
| 1721 |
if test "x$2" != "xnotrailer"; then |
| 1722 |
echo "To build the $MH_PACKAGE binaries, and dynamically loadable libraries, type 'make'" |
| 1723 |
echo "To install $MH_PACKAGE in the above directories, type 'make install'" |
| 1724 |
echo |
| 1725 |
fi |
| 1726 |
]) |
| 1727 |
|
| 1728 |
dnl --------------------------------------------------------------------------- |
| 1729 |
dnl Determines which -arch flags valid on Mac OSX with gcc |
| 1730 |
dnl --------------------------------------------------------------------------- |
| 1731 |
AC_DEFUN([MH_CHECK_OSX_ARCH], |
| 1732 |
[ |
| 1733 |
valid_arch_flags="" |
| 1734 |
found_arch_flags="" |
| 1735 |
AC_ARG_WITH(arch, |
| 1736 |
[ --with-arch=option build universal binaries on MacOS, option: one of "all 32bit 64bit intel apple-silicon ppc ppc64 x86_64 i386 arm64"], |
| 1737 |
[with_arch=$withval], |
| 1738 |
[with_arch=none], |
| 1739 |
) |
| 1740 |
case "$with_arch" in |
| 1741 |
none) |
| 1742 |
arch_flags="" |
| 1743 |
;; |
| 1744 |
all) |
| 1745 |
arch_flags="-arch ppc -arch ppc64 -arch x86_64 -arch i386 -arch arm64" |
| 1746 |
;; |
| 1747 |
32bit) |
| 1748 |
arch_flags="-arch ppc -arch i386" |
| 1749 |
;; |
| 1750 |
64bit) |
| 1751 |
arch_flags="-arch ppc64 -arch x86_64 -arch arm64" |
| 1752 |
;; |
| 1753 |
apple-silicon) |
| 1754 |
arch_flags="-arch x86_64 -arch arm64" |
| 1755 |
;; |
| 1756 |
intel) |
| 1757 |
arch_flags="-arch i386 -arch x86_64" |
| 1758 |
;; |
| 1759 |
apple-silicon) |
| 1760 |
arch_flags="-arch x86_64 -arch arm64" |
| 1761 |
;; |
| 1762 |
*) |
| 1763 |
arch_flags="-arch $with_arch" |
| 1764 |
;; |
| 1765 |
esac |
| 1766 |
|
| 1767 |
valid_arch_flags="" |
| 1768 |
found_arch_flags="" |
| 1769 |
if test $on_osx = "yes"; then |
| 1770 |
AC_MSG_CHECKING(for which MacOS -arch flags are supported for universal binaries) |
| 1771 |
for a in $arch_flags; do |
| 1772 |
if test $a != "-arch"; then |
| 1773 |
save_ldflags="$LDFLAGS" |
| 1774 |
LDFLAGS="$LDFLAGS -arch $a" |
| 1775 |
AC_LINK_IFELSE( |
| 1776 |
[AC_LANG_PROGRAM([#include <stdio.h> |
| 1777 |
#include <stdlib.h>], |
| 1778 |
[exit(0)])], |
| 1779 |
[valid_arch_flags="$valid_arch_flags -arch $a";found_arch_flags="$found_arch_flags $a"], |
| 1780 |
[a="$a"] |
| 1781 |
) |
| 1782 |
LDFLAGS="$save_ldflags" |
| 1783 |
fi |
| 1784 |
done |
| 1785 |
AC_MSG_RESULT($found_arch_flags) |
| 1786 |
AC_SUBST(valid_arch_flags) |
| 1787 |
fi |
| 1788 |
]) |
| 1789 |
|
| 1790 |
dnl --------------------------------------------------------------------------- |
| 1791 |
dnl Determines the kernel name from uname |
| 1792 |
dnl --------------------------------------------------------------------------- |
| 1793 |
AC_DEFUN([MH_GET_KERNEL_NAME], |
| 1794 |
[ |
| 1795 |
AC_CHECK_PROG(uname, [uname], yes, no) |
| 1796 |
AC_MSG_CHECKING(kernel name) |
| 1797 |
if test "$ac_cv_prog_uname" = yes; then |
| 1798 |
kn=`uname -s` |
| 1799 |
else |
| 1800 |
kn="unknown" |
| 1801 |
fi |
| 1802 |
AC_DEFINE_UNQUOTED(MH_KERNEL_NAME, "$kn", [kernel name]) |
| 1803 |
AC_MSG_RESULT($kn) |
| 1804 |
]) |
| 1805 |
|
| 1806 |
dnl --------------------------------------------------------------------------- |
| 1807 |
dnl Determines the Linux distribution name |
| 1808 |
dnl --------------------------------------------------------------------------- |
| 1809 |
AC_DEFUN([MH_GET_DISTRO_NAME], |
| 1810 |
[ |
| 1811 |
AC_CHECK_PROG(lsb_release, [lsb_release], yes, no) |
| 1812 |
if test "$ac_cv_prog_lsb_release" = yes; then |
| 1813 |
AC_MSG_CHECKING(OS distribution name) |
| 1814 |
MYDISTRO="`lsb_release -i | cut -f 2`-`lsb_release -r | cut -f 2`" |
| 1815 |
MYDISTRO="`echo $MYDISTRO | sed \"s/ /_/g\"`" |
| 1816 |
AC_MSG_RESULT($MYDISTRO) |
| 1817 |
else |
| 1818 |
case "$target" in |
| 1819 |
*linux*) |
| 1820 |
if test -f "/etc/os-release"; then |
| 1821 |
myid="`grep ^ID= /etc/os-release | cut -f2 -d\=`" |
| 1822 |
myver="`grep ^VERSION_ID= /etc/os-release | cut -f2 -d\= | sed 's/\"//g'`" |
| 1823 |
MYDISTRO="$myid-$myver" |
| 1824 |
else |
| 1825 |
MYDISTRO="`echo $target | cut -f3 -d-`" |
| 1826 |
fi |
| 1827 |
;; |
| 1828 |
*freebsd* | *openbsd*) |
| 1829 |
MYDISTRO="`echo $target | cut -f3 -d-`" |
| 1830 |
;; |
| 1831 |
*darwin*) |
| 1832 |
MYDISTRO="`echo $target | cut -f2-3 -d-`" |
| 1833 |
;; |
| 1834 |
*pc-solaris2*) |
| 1835 |
MYDISTRO="`echo $target | cut -f2- -d-`" |
| 1836 |
;; |
| 1837 |
*cygwin*) |
| 1838 |
MYDISTRO="`echo $target | cut -f2- -d-`" |
| 1839 |
;; |
| 1840 |
*nto-qnx*) |
| 1841 |
MYDISTRO="`uname -s`-`uname -r`" |
| 1842 |
;; |
| 1843 |
*qnx*) |
| 1844 |
MYDISTRO="`uname -s`-`uname -v`" |
| 1845 |
;; |
| 1846 |
*) |
| 1847 |
MYDISTRO="$target" |
| 1848 |
;; |
| 1849 |
esac |
| 1850 |
fi |
| 1851 |
AC_SUBST(MYDISTRO) |
| 1852 |
]) |
| 1853 |
|
| 1854 |
AC_DEFUN([MH_CHECK_NCURSES], |
| 1855 |
[ |
| 1856 |
curs=$1 |
| 1857 |
NCURSES_PKG="${curs}" |
| 1858 |
# look for pkg-config first |
| 1859 |
AC_CHECK_PROG(pkg_config, [pkg-config], "yes", no) |
| 1860 |
if test "$pkg_config" = yes; then |
| 1861 |
# we have pkg_config, do we have ncurses[w]? |
| 1862 |
pkg-config --exists ${NCURSES_PKG} > /dev/null |
| 1863 |
if test $? -eq 0; then |
| 1864 |
MH_CURSES_INC="`pkg-config --cflags ${NCURSES_PKG}`" |
| 1865 |
MH_CURSES_LIB="`pkg-config --libs ${NCURSES_PKG}`" |
| 1866 |
CURSES_BUILD=$with_curses |
| 1867 |
CURSES_CONFIG="pkg-config ${NCURSES_PKG}" |
| 1868 |
curses_h="curses.h" |
| 1869 |
curses_l="$NCURSES_PKG" |
| 1870 |
AC_DEFINE(USE_NCURSES) |
| 1871 |
else |
| 1872 |
# no pkg-config, what about ncurses-config? |
| 1873 |
if test "$curs" = "ncursesw" -o "$curs" = "ncursesw8"; then |
| 1874 |
curses_configs="ncursesw-config ncursesw6-config ncursesw5-config" |
| 1875 |
else |
| 1876 |
curses_configs="ncurses-config ncurses6-config ncurses5-config" |
| 1877 |
fi |
| 1878 |
for config_name in $curses_configs ; |
| 1879 |
do |
| 1880 |
AC_CHECK_PROG([config_var], [$config_name], [yes], no) |
| 1881 |
if test "x$config_var" = "xyes"; then |
| 1882 |
MH_CURSES_INC="`${config_name} --cflags`" |
| 1883 |
MH_CURSES_LIB="`${config_name} --libs`" |
| 1884 |
CURSES_BUILD=$with_curses |
| 1885 |
CURSES_CONFIG="${config_name}" |
| 1886 |
curses_h="curses.h" |
| 1887 |
curses_l="$NCURSES_PKG" |
| 1888 |
AC_DEFINE(USE_NCURSES) |
| 1889 |
break |
| 1890 |
fi |
| 1891 |
# ensure variable is not cached |
| 1892 |
unset ac_cv_prog_config_var |
| 1893 |
unset config_var |
| 1894 |
done |
| 1895 |
if test "x$curses_h" = "x"; then |
| 1896 |
AC_MSG_ERROR(unable to find configuration for ${NCURSES_PKG} package; cannot configure) |
| 1897 |
fi |
| 1898 |
fi |
| 1899 |
fi |
| 1900 |
]) |
| 1901 |
|
| 1902 |
AC_DEFUN([MH_CHECK_PDCURSES_X11], |
| 1903 |
[ |
| 1904 |
curs=$1 |
| 1905 |
builtin=$2 |
| 1906 |
flags=$3 |
| 1907 |
if test $builtin_curses = yes; then |
| 1908 |
MH_CHECK_X_INC |
| 1909 |
MH_CHECK_X_LIB |
| 1910 |
MH_CURSES_INC="$flags -DXCURSES $MH_XINC_DIR" |
| 1911 |
MH_CURSES_LIB="pdc-obj/libpdcurses.a $MH_XLIBS" |
| 1912 |
CURSES_BUILD=$with_curses |
| 1913 |
CURSES_CONFIG="builtin PDCursesMod" |
| 1914 |
curses_h="curses.h" |
| 1915 |
curses_l="pdcurses" |
| 1916 |
else |
| 1917 |
PDCURSES_PKG="lib${curs}" |
| 1918 |
# look for pkg-config first |
| 1919 |
AC_CHECK_PROG(pkg_config, [pkg-config], yes, no) |
| 1920 |
if test "$ac_cv_prog_pkg_config" = yes; then |
| 1921 |
# we have pkg_config, do we have ncursesw? |
| 1922 |
pkg-config --exists ${PDCURSES_PKG} > /dev/null |
| 1923 |
if test $? -eq 0; then |
| 1924 |
MH_CURSES_INC="`pkg-config --cflags ${PDCURSES_PKG}`" |
| 1925 |
MH_CURSES_LIB="`pkg-config --libs ${PDCURSES_PKG}`" |
| 1926 |
curses_h="curses.h" #xcurses.h |
| 1927 |
curses_l="XCurses" |
| 1928 |
else |
| 1929 |
AC_MSG_ERROR(pkg-config cannot find ${PDCURSES_PKG} package; cannot configure) |
| 1930 |
fi |
| 1931 |
fi |
| 1932 |
fi |
| 1933 |
]) |
| 1934 |
|
| 1935 |
AC_DEFUN([MH_CHECK_PDCURSES_SDL], |
| 1936 |
[ |
| 1937 |
curs=$1 |
| 1938 |
builtin=$2 |
| 1939 |
pkg=$3 |
| 1940 |
flags=$4 |
| 1941 |
if test $builtin_curses = yes; then |
| 1942 |
# look for pkg-config first |
| 1943 |
AC_CHECK_PROG(pkg_config, [pkg-config], yes, no) |
| 1944 |
if test "$ac_cv_prog_pkg_config" = yes; then |
| 1945 |
# we have pkg_config, do we have sdl or SDL_ttf? |
| 1946 |
pkg-config --exists $pkg > /dev/null |
| 1947 |
if test $? -eq 0; then |
| 1948 |
MH_CURSES_INC="$flags `pkg-config --cflags $pkg`" |
| 1949 |
MH_CURSES_LIB="pdc-obj/libpdcurses.a `pkg-config --libs $pkg`" |
| 1950 |
CURSES_BUILD=$with_curses |
| 1951 |
CURSES_CONFIG="builtin PDCursesMod" |
| 1952 |
curses_h="curses.h" |
| 1953 |
curses_l="pdcurses" |
| 1954 |
else |
| 1955 |
AC_MSG_ERROR(--with-curses=$with_curses requires $pkg package installed; THE cannot be configured) |
| 1956 |
fi |
| 1957 |
else |
| 1958 |
AC_MSG_ERROR(--with-curses=$with_curses requires pkg-config and $pkg package installed; THE cannot be configured) |
| 1959 |
fi |
| 1960 |
else |
| 1961 |
PDCURSES_PKG="lib${curs}" |
| 1962 |
# look for pkg-config first |
| 1963 |
AC_CHECK_PROG(pkg_config, [pkg-config], yes, no) |
| 1964 |
if test "$ac_cv_prog_pkg_config" = yes; then |
| 1965 |
# we have pkg_config, do we have pdcurses package? |
| 1966 |
pkg-config --exists ${PDCURSES_PKG} > /dev/null |
| 1967 |
if test $? -eq 0; then |
| 1968 |
MH_CURSES_INC="`pkg-config --cflags ${PDCURSES_PKG}`" |
| 1969 |
MH_CURSES_LIB="`pkg-config --libs ${PDCURSES_PKG}`" |
| 1970 |
CURSES_BUILD=$with_curses |
| 1971 |
CURSES_CONFIG="pkg-config ${PDCURSES_PKG}" |
| 1972 |
curses_h="curses.h" |
| 1973 |
curses_l="pdcurses" |
| 1974 |
fi |
| 1975 |
fi |
| 1976 |
fi |
| 1977 |
]) |
| 1978 |
|
| 1979 |
AC_DEFUN([MH_CHECK_PDCURSES_SDL1], |
| 1980 |
[ |
| 1981 |
curs=$1 |
| 1982 |
builtin=$2 |
| 1983 |
pkg=$3 |
| 1984 |
flags=$4 |
| 1985 |
if test $builtin_curses = yes; then |
| 1986 |
# look for pkg-config first |
| 1987 |
AC_CHECK_PROG(pkg_config, [pkg-config], yes, no) |
| 1988 |
if test "$ac_cv_prog_pkg_config" = yes; then |
| 1989 |
# we have pkg_config, do we have sdl or SDL_ttf? |
| 1990 |
pkg-config --exists $pkg > /dev/null |
| 1991 |
if test $? -eq 0; then |
| 1992 |
MH_CURSES_INC="-DPDC_WIDE `pkg-config --cflags $pkg`" |
| 1993 |
MH_CURSES_LIB="pdc-obj/libpdcurses.a `pkg-config --libs $pkg`" |
| 1994 |
CURSES_BUILD=$with_curses |
| 1995 |
CURSES_CONFIG="builtin PDCursesMod" |
| 1996 |
curses_h="curses.h" |
| 1997 |
curses_l="pdcurses" |
| 1998 |
else |
| 1999 |
AC_MSG_ERROR(--with-curses=$with_curses requires $pkg package installed; THE cannot be configured) |
| 2000 |
fi |
| 2001 |
else |
| 2002 |
AC_MSG_ERROR(--with-curses=$with_curses requires pkg-config and $pkg package installed; THE cannot be configured) |
| 2003 |
fi |
| 2004 |
else |
| 2005 |
PDCURSES_PKG="lib${curs}" |
| 2006 |
# look for pkg-config first |
| 2007 |
AC_CHECK_PROG(pkg_config, [pkg-config], yes, no) |
| 2008 |
if test "$ac_cv_prog_pkg_config" = yes; then |
| 2009 |
# we have pkg_config, do we have pdcurses package? |
| 2010 |
pkg-config --exists ${PDCURSES_PKG} > /dev/null |
| 2011 |
if test $? -eq 0; then |
| 2012 |
MH_CURSES_INC="`pkg-config --cflags ${PDCURSES_PKG}`" |
| 2013 |
MH_CURSES_LIB="`pkg-config --libs ${PDCURSES_PKG}`" |
| 2014 |
CURSES_BUILD=$with_curses |
| 2015 |
CURSES_CONFIG="pkg-config ${PDCURSES_PKG}" |
| 2016 |
curses_h="curses.h" |
| 2017 |
curses_l="pdcurses" |
| 2018 |
fi |
| 2019 |
fi |
| 2020 |
fi |
| 2021 |
]) |
| 2022 |
|
| 2023 |
AC_DEFUN([MH_CHECK_PDCURSES_SDL2], |
| 2024 |
[ |
| 2025 |
curs=$1 |
| 2026 |
builtin=$2 |
| 2027 |
if test $builtin_curses = yes; then |
| 2028 |
# look for pkg-config first |
| 2029 |
AC_CHECK_PROG(pkg_config, [pkg-config], yes, no) |
| 2030 |
if test "$ac_cv_prog_pkg_config" = yes; then |
| 2031 |
# we have pkg_config, do we have SDL2_ttf? |
| 2032 |
pkg-config --exists SDL2_ttf > /dev/null |
| 2033 |
if test $? -eq 0; then |
| 2034 |
flag='' |
| 2035 |
case "$curs" in |
| 2036 |
pdcurses-sdl2w) |
| 2037 |
flag="-DPDC_WIDE" |
| 2038 |
;; |
| 2039 |
pdcurses-sdl2w8) |
| 2040 |
flag="-DPDC_WIDE -DPDC_FORCE_UTF8" |
| 2041 |
;; |
| 2042 |
*) |
| 2043 |
;; |
| 2044 |
esac |
| 2045 |
MH_CURSES_INC="$flag `pkg-config --cflags SDL2_ttf`" |
| 2046 |
MH_CURSES_LIB="pdc-obj/libpdcurses.a `pkg-config --libs SDL2_ttf`" |
| 2047 |
CURSES_BUILD=$with_curses |
| 2048 |
CURSES_CONFIG="builtin PDCursesMod" |
| 2049 |
curses_h="curses.h" |
| 2050 |
curses_l="pdcurses" |
| 2051 |
else |
| 2052 |
AC_MSG_ERROR(--with-curses=$with_curses requires SDL2_ttf package installed; THE cannot be configured) |
| 2053 |
fi |
| 2054 |
else |
| 2055 |
AC_MSG_ERROR(--with-curses=$with_curses requires pkg-config and SDL2_ttf package installed; THE cannot be configured) |
| 2056 |
fi |
| 2057 |
else |
| 2058 |
PDCURSES_PKG="lib${curs}" |
| 2059 |
# look for pkg-config first |
| 2060 |
AC_CHECK_PROG(pkg_config, [pkg-config], yes, no) |
| 2061 |
if test "$ac_cv_prog_pkg_config" = yes; then |
| 2062 |
# we have pkg_config, do we have ncursesw? |
| 2063 |
pkg-config --exists ${PDCURSES_PKG} > /dev/null |
| 2064 |
if test $? -eq 0; then |
| 2065 |
MH_CURSES_INC="`pkg-config --cflags ${PDCURSES_PKG}`" |
| 2066 |
MH_CURSES_LIB="`pkg-config --libs ${PDCURSES_PKG}`" |
| 2067 |
CURSES_BUILD=$with_curses |
| 2068 |
CURSES_CONFIG="pkg-config ${PDCURSES_PKG}" |
| 2069 |
curses_h="curses.h" |
| 2070 |
curses_l="pdcurses" |
| 2071 |
fi |
| 2072 |
fi |
| 2073 |
fi |
| 2074 |
]) |
| 2075 |
|
| 2076 |
AC_DEFUN([MH_CHECK_PDCURSES_VT], |
| 2077 |
[ |
| 2078 |
curs=$1 |
| 2079 |
builtin_curses=$2 |
| 2080 |
flags=$3 |
| 2081 |
if test $builtin_curses = yes; then |
| 2082 |
MH_CURSES_INC="$flags -I$srcdir/src/PDCursesMod" |
| 2083 |
MH_CURSES_LIB="pdc-obj/libpdcurses.a" |
| 2084 |
CURSES_BUILD=$with_curses |
| 2085 |
CURSES_CONFIG="builtin PDCursesMod" |
| 2086 |
curses_h="curses.h" |
| 2087 |
curses_l="pdcurses" |
| 2088 |
else |
| 2089 |
PDCURSES_PKG="lib${curs}" |
| 2090 |
# look for pkg-config first |
| 2091 |
AC_CHECK_PROG(pkg_config, [pkg-config], yes, no) |
| 2092 |
if test "$ac_cv_prog_pkg_config" = yes; then |
| 2093 |
# we have pkg_config, do we have ncursesw? |
| 2094 |
pkg-config --exists ${PDCURSES_PKG} > /dev/null |
| 2095 |
if test $? -eq 0; then |
| 2096 |
MH_CURSES_INC="`pkg-config --cflags ${PDCURSES_PKG}`" |
| 2097 |
MH_CURSES_LIB="`pkg-config --libs ${PDCURSES_PKG}`" |
| 2098 |
CURSES_BUILD=$with_curses |
| 2099 |
CURSES_CONFIG="pkg-config ${PDCURSES_PKG}" |
| 2100 |
curses_h="curses.h" |
| 2101 |
curses_l="pdcurses" |
| 2102 |
fi |
| 2103 |
fi |
| 2104 |
fi |
| 2105 |
]) |
| 2106 |
|
| 2107 |
AC_DEFUN([MH_CHECK_X_CONFIG], |
| 2108 |
[ |
| 2109 |
MH_CHECK_X_INC |
| 2110 |
MH_CHECK_X_LIB |
| 2111 |
]) |
| 2112 |
|
| 2113 |
dnl --------------------------------------------------------------------------- |
| 2114 |
dnl Check curses library and header files |
| 2115 |
dnl --------------------------------------------------------------------------- |
| 2116 |
AC_DEFUN([MH_CHECK_CURSES], |
| 2117 |
[ |
| 2118 |
AC_MSG_CHECKING(curses platform) |
| 2119 |
CURSES_BUILD="" |
| 2120 |
CURSES_CONFIG="" |
| 2121 |
case "$target" in |
| 2122 |
*hpux1*) |
| 2123 |
mh_curses_colr=yes |
| 2124 |
mh_pre_curses_h_include="stdarg" |
| 2125 |
;; |
| 2126 |
*aix*4.2*) |
| 2127 |
mh_curses_colr=no |
| 2128 |
mh_pre_curses_h_include="stdarg" |
| 2129 |
;; |
| 2130 |
*) |
| 2131 |
mh_curses_colr=no |
| 2132 |
mh_pre_curses_h_include="" |
| 2133 |
esac |
| 2134 |
case "$with_curses" in |
| 2135 |
ncurses|ncursesw|ncursesw8) |
| 2136 |
MH_CHECK_NCURSES($with_curses) |
| 2137 |
;; |
| 2138 |
pdcurses-x11) |
| 2139 |
MH_CHECK_PDCURSES_X11($with_curses,$1,'') |
| 2140 |
;; |
| 2141 |
pdcurses-x11w) |
| 2142 |
MH_CHECK_PDCURSES_X11($with_curses,$1,'-DPDC_WIDE') |
| 2143 |
;; |
| 2144 |
pdcurses-x11w8) |
| 2145 |
MH_CHECK_PDCURSES_X11($with_curses,$1,'-DPDC_WIDE -DPDC_FORCE_UTF8') |
| 2146 |
;; |
| 2147 |
pdcurses-sdl1) |
| 2148 |
MH_CHECK_PDCURSES_SDL($with_curses,$1,sdl,'') |
| 2149 |
;; |
| 2150 |
pdcurses-sdl1w) |
| 2151 |
MH_CHECK_PDCURSES_SDL($with_curses,$1,SDL_ttf,'-DPDC_WIDE') |
| 2152 |
;; |
| 2153 |
pdcurses-sdl1w8) |
| 2154 |
MH_CHECK_PDCURSES_SDL($with_curses,$1,SDL_ttf,'-DPDC_WIDE -DPDC_FORCE_UTF8') |
| 2155 |
;; |
| 2156 |
pdcurses-sdl2) |
| 2157 |
MH_CHECK_PDCURSES_SDL($with_curses,$1,sdl2,'') |
| 2158 |
;; |
| 2159 |
pdcurses-sdl2w) |
| 2160 |
MH_CHECK_PDCURSES_SDL($with_curses,$1,SDL2_ttf,'-DPDC_WIDE') |
| 2161 |
;; |
| 2162 |
pdcurses-sdl2w8) |
| 2163 |
MH_CHECK_PDCURSES_SDL($with_curses,$1,SDL2_ttf,'-DPDC_WIDE -DPDC_FORCE_UTF8') |
| 2164 |
;; |
| 2165 |
pdcurses-vt) |
| 2166 |
MH_CHECK_PDCURSES_VT($with_curses,$1,'') |
| 2167 |
;; |
| 2168 |
pdcurses-vtw) |
| 2169 |
MH_CHECK_PDCURSES_VT($with_curses,$1,'-DPDC_WIDE') |
| 2170 |
;; |
| 2171 |
pdcurses-vtw8) |
| 2172 |
MH_CHECK_PDCURSES_VT($with_curses,$1,'-DPDC_WIDE -DPDC_FORCE_UTF8') |
| 2173 |
;; |
| 2174 |
*) |
| 2175 |
# none specified |
| 2176 |
esac |
| 2177 |
AC_SUBST(MH_CURSES_INC) |
| 2178 |
AC_SUBST(MH_CURSES_LIB) |
| 2179 |
CURSES_BUILD=$with_curses |
| 2180 |
AC_SUBST(CURSES_BUILD) |
| 2181 |
APK_CURSES_BUILD="`echo ${with_curses} | sed -e s/-/_/g`" |
| 2182 |
AC_SUBST(APK_CURSES_BUILD) |
| 2183 |
AC_MSG_RESULT($CURSES_BUILD) |
| 2184 |
]) |
| 2185 |
|
| 2186 |
dnl --------------------------------------------------------------------------- |
| 2187 |
dnl Wrapper for AC_CHECK_FUNCS. |
| 2188 |
dnl --------------------------------------------------------------------------- |
| 2189 |
AC_DEFUN([MH_CHECK_FUNCS], |
| 2190 |
[ |
| 2191 |
dnl check a standard list of functions, then those passed in as args |
| 2192 |
AC_CHECK_FUNCS(memcpy memmove strerror getopt strtof $*) |
| 2193 |
])dnl |
| 2194 |
|
| 2195 |
dnl --------------------------------------------------------------------------- |
| 2196 |
dnl Check if various types have been typedefed by supplied header files |
| 2197 |
dnl --------------------------------------------------------------------------- |
| 2198 |
AC_DEFUN([MH_CHECK_TYPES], |
| 2199 |
[ |
| 2200 |
header=$1 |
| 2201 |
inc=$2 |
| 2202 |
types="LONG CHAR SHORT ULONG UCHAR USHORT $3" |
| 2203 |
if test "x$inc" != "x"; then |
| 2204 |
save_CFLAGS="$CFLAGS" |
| 2205 |
CFLAGS="$CFLAGS $inc" |
| 2206 |
fi |
| 2207 |
CFLAGS="$CFLAGS $DB_INCLUDES" |
| 2208 |
for mh_type in $types; do |
| 2209 |
AC_MSG_CHECKING(if $mh_type already defined) |
| 2210 |
if test "x$header" = "x"; then |
| 2211 |
AC_TRY_COMPILE([], |
| 2212 |
[${mh_type} var1;], |
| 2213 |
mh_type_found=yes, mh_type_found=no ) |
| 2214 |
else |
| 2215 |
AC_TRY_COMPILE([#include <$header>], |
| 2216 |
[${mh_type} var1;], |
| 2217 |
mh_type_found=yes, mh_type_found=no ) |
| 2218 |
fi |
| 2219 |
AC_MSG_RESULT($mh_type_found) |
| 2220 |
if test "$mh_type_found" = yes; then |
| 2221 |
AC_DEFINE_UNQUOTED(${mh_type}_TYPEDEFED) |
| 2222 |
fi |
| 2223 |
done |
| 2224 |
if test "x$inc" != "x"; then |
| 2225 |
CFLAGS=$save_CFLAGS |
| 2226 |
fi |
| 2227 |
])dnl |
| 2228 |
|
| 2229 |
dnl --------------------------------------------------------------------------- |
| 2230 |
dnl Set full package name from package name and version |
| 2231 |
dnl --------------------------------------------------------------------------- |
| 2232 |
AC_DEFUN([MH_SET_FULL_PACKAGE_NAME], |
| 2233 |
[ |
| 2234 |
FULL_PACKAGE_NAME=$1-$2 |
| 2235 |
AC_SUBST(FULL_PACKAGE_NAME) |
| 2236 |
]) |
| 2237 |
|
| 2238 |
dnl --------------------------------------------------------------------------- |
| 2239 |
dnl Check if large file support available |
| 2240 |
dnl --------------------------------------------------------------------------- |
| 2241 |
AC_DEFUN([MH_LARGE_FILE_SUPPORT], |
| 2242 |
[ |
| 2243 |
LARGE_FILE_SUPPORT="" |
| 2244 |
AC_CHECK_PROG(getconf, [getconf], yes, no) |
| 2245 |
if test "$ac_cv_prog_getconf" = yes; then |
| 2246 |
AC_MSG_CHECKING(large file support flags) |
| 2247 |
LARGE_FILE_SUPPORT=`getconf LFS_CFLAGS` |
| 2248 |
AC_MSG_RESULT($LARGE_FILE_SUPPORT) |
| 2249 |
fi |
| 2250 |
if test "$LARGE_FILE_SUPPORT" = "undefined"; then |
| 2251 |
LARGE_FILE_SUPPORT="" |
| 2252 |
fi |
| 2253 |
AC_SUBST(LARGE_FILE_SUPPORT) |
| 2254 |
])dnl |