106 FREETYPE2_NOT_NEEDED= 107 AC_MSG_RESULT([alsa pulse]) 108 fi 109 ]) 110 111 AC_DEFUN_ONCE([LIB_SETUP_X11], 112 [ 113 114 ############################################################################### 115 # 116 # Check for X Windows 117 # 118 119 # Check if the user has specified sysroot, but not --x-includes or --x-libraries. 120 # Make a simple check for the libraries at the sysroot, and setup --x-includes and 121 # --x-libraries for the sysroot, if that seems to be correct. 122 if test "x$SYS_ROOT" != "x/"; then 123 if test "x$x_includes" = xNONE; then 124 if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then 125 x_includes="$SYS_ROOT/usr/X11R6/include" 126 fi 127 fi 128 if test "x$x_libraries" = xNONE; then 129 if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then 130 x_libraries="$SYS_ROOT/usr/X11R6/lib" 131 fi 132 fi 133 fi 134 135 # Now let autoconf do it's magic 136 AC_PATH_X 137 AC_PATH_XTRA 138 139 # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling 140 # this doesn't make sense so we remove it. 141 if test "x$COMPILE_TYPE" = xcross; then 142 X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'` 143 fi 144 145 if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then 146 HELP_MSG_MISSING_DEPENDENCY([x11]) 147 AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG]) 148 fi 149 150 # Some of the old makefiles require a setting of OPENWIN_HOME 342 AC_MSG_ERROR([Could not find $FREETYPE2_LIB_PATH/freetype.dll]) 343 fi 344 USING_SYSTEM_FT_LIB=true 345 FREETYPE2_FOUND=yes 346 fi 347 AC_MSG_RESULT([$FREETYPE2_FOUND]) 348 fi 349 if test "x$FREETYPE2_FOUND" = xno; then 350 PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) 351 # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. 352 FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'` 353 USING_SYSTEM_FT_LIB=true 354 # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 355 if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then 356 FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'` 357 fi 358 fi 359 if test "x$FREETYPE2_FOUND" = xno; then 360 AC_MSG_CHECKING([for freetype in some standard locations]) 361 362 if test -s /usr/X11/include/ft2build.h && test -d /usr/X11/include/freetype2/freetype; then 363 DEFAULT_FREETYPE_CFLAGS="-I/usr/X11/include/freetype2 -I/usr/X11/include" 364 DEFAULT_FREETYPE_LIBS="-L/usr/X11/lib -lfreetype" 365 fi 366 if test -s /usr/include/ft2build.h && test -d /usr/include/freetype2/freetype; then 367 DEFAULT_FREETYPE_CFLAGS="-I/usr/include/freetype2" 368 DEFAULT_FREETYPE_LIBS="-lfreetype" 369 fi 370 371 PREV_CXXCFLAGS="$CXXFLAGS" 372 PREV_LDFLAGS="$LDFLAGS" 373 CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS" 374 LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS" 375 AC_LINK_IFELSE([AC_LANG_SOURCE([[#include<ft2build.h> 376 #include FT_FREETYPE_H 377 int main() { return 0; } 378 ]])], 379 [ 380 # Yes, the default cflags and libs did the trick. 381 FREETYPE2_FOUND=yes 382 FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS" 383 FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS" 384 ], 385 [ 386 FREETYPE2_FOUND=no 387 ]) | 106 FREETYPE2_NOT_NEEDED= 107 AC_MSG_RESULT([alsa pulse]) 108 fi 109 ]) 110 111 AC_DEFUN_ONCE([LIB_SETUP_X11], 112 [ 113 114 ############################################################################### 115 # 116 # Check for X Windows 117 # 118 119 # Check if the user has specified sysroot, but not --x-includes or --x-libraries. 120 # Make a simple check for the libraries at the sysroot, and setup --x-includes and 121 # --x-libraries for the sysroot, if that seems to be correct. 122 if test "x$SYS_ROOT" != "x/"; then 123 if test "x$x_includes" = xNONE; then 124 if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then 125 x_includes="$SYS_ROOT/usr/X11R6/include" 126 elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then 127 x_includes="$SYS_ROOT/usr/include" 128 fi 129 fi 130 if test "x$x_libraries" = xNONE; then 131 if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then 132 x_libraries="$SYS_ROOT/usr/X11R6/lib" 133 elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then 134 x_libraries="$SYS_ROOT/usr/lib64" 135 elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then 136 x_libraries="$SYS_ROOT/usr/lib" 137 fi 138 fi 139 fi 140 141 # Now let autoconf do it's magic 142 AC_PATH_X 143 AC_PATH_XTRA 144 145 # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling 146 # this doesn't make sense so we remove it. 147 if test "x$COMPILE_TYPE" = xcross; then 148 X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'` 149 fi 150 151 if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then 152 HELP_MSG_MISSING_DEPENDENCY([x11]) 153 AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG]) 154 fi 155 156 # Some of the old makefiles require a setting of OPENWIN_HOME 348 AC_MSG_ERROR([Could not find $FREETYPE2_LIB_PATH/freetype.dll]) 349 fi 350 USING_SYSTEM_FT_LIB=true 351 FREETYPE2_FOUND=yes 352 fi 353 AC_MSG_RESULT([$FREETYPE2_FOUND]) 354 fi 355 if test "x$FREETYPE2_FOUND" = xno; then 356 PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) 357 # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. 358 FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'` 359 USING_SYSTEM_FT_LIB=true 360 # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 361 if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then 362 FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'` 363 fi 364 fi 365 if test "x$FREETYPE2_FOUND" = xno; then 366 AC_MSG_CHECKING([for freetype in some standard locations]) 367 368 if test -s $SYS_ROOT/usr/X11/include/ft2build.h && test -d $SYS_ROOT/usr/X11/include/freetype2/freetype; then 369 DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/X11/include/freetype2 -I$SYS_ROOT/usr/X11/include" 370 DEFAULT_FREETYPE_LIBS="-L$SYS_ROOT/usr/X11/lib -lfreetype" 371 fi 372 if test -s $SYS_ROOT/usr/include/ft2build.h && test -d $SYS_ROOT/usr/include/freetype2/freetype; then 373 DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/include/freetype2" 374 DEFAULT_FREETYPE_LIBS="-lfreetype" 375 fi 376 377 PREV_CXXCFLAGS="$CXXFLAGS" 378 PREV_LDFLAGS="$LDFLAGS" 379 CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS" 380 LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS" 381 AC_LINK_IFELSE([AC_LANG_SOURCE([[#include<ft2build.h> 382 #include FT_FREETYPE_H 383 int main() { return 0; } 384 ]])], 385 [ 386 # Yes, the default cflags and libs did the trick. 387 FREETYPE2_FOUND=yes 388 FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS" 389 FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS" 390 ], 391 [ 392 FREETYPE2_FOUND=no 393 ]) |