1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
|
From: Debian Java Maintainers <[email protected]>
Date: Fri, 30 Aug 2024 10:50:53 0000
Subject: Use-pkgconfig-for-flags
===================================================================
---
Make.def.in | 3
Make.rules | 8 -
Makefile.am | 4
configure.ac | 220 -----------------------------------------------------
4 files changed, 31 insertions( ), 204 deletions(-)
diff --git a/Make.def.in b/Make.def.in
index 24d7697..22a1492 100644
--- a/Make.def.in
b/Make.def.in
@@ -65,6 65,9 @@ X11_LIBS = @X11_LIBS@
MAGICK_INCLUDES = @MAGICK_INCLUDES@
MAGICK_LIBS = @MAGICK_LIBS@
MAGICK_LIB_PATH = @MAGICK_LIB_PATH@
MAGICK_CFLAGS = @MAGICK_CFLAGS@
WAND_CFLAGS = @WAND_CFLAGS@
WAND_LIBS = @WAND_LIBS@
# Java include directories
JAVA_INCLUDES = @JAVA_INCLUDES@
diff --git a/Make.rules b/Make.rules
index 6dcb22a..8c8a2e8 100644
--- a/Make.rules
b/Make.rules
@@ -148,11 148,11 @@ endif
# Rule to compile JNI C files
$(PACKAGE_OBJ_DIR)/%.lo: %.c $(PACKAGE_GENERATED_INPUT_DIR)/%.h
@-mkdir -p $(dir $@)
- $(LIBTOOL) --mode=compile $(CC) -I$(PACKAGE_GENERATED_INPUT_DIR) $(CFLAGS) -c $< -o $@
$(LIBTOOL) --mode=compile $(CC) -I$(PACKAGE_GENERATED_INPUT_DIR) $(CFLAGS) $(MAGICK_CFLAGS) $(WAND_CFLAGS) -c $< -o $@
$(PACKAGE_OBJ_DIR)/%.lo: %.c
@-mkdir -p $(dir $@)
- $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $< -o $@
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(MAGICK_CFLAGS) $(WAND_CFLAGS) -c $< -o $@
# Rule to generate autodependencies in the case where JNI is used.
JNI_DEP_FILE = .jnidep
@@ -194,8 194,10 @@ else
$(LIBTOOL_LINK_FLAG) \
-version-info $(MAJOR):$(MINOR):$(MICRO) \
-rpath $(libdir) $(SHARED_LDFLAGS) $(LDFLAGS) \
$(MAGICK_LDFLAGS) $(WAND_LDFLAGS) \
-o $(JNI_LIB) \
- $(JNI_OBJ) $(JNI_LINK_LIBS) $(EXTRA_LIBS)
$(JNI_OBJ) $(JNI_LINK_LIBS) $(EXTRA_LIBS) \
$(MAGICK_LIBS) $(WAND_LIBS)
endif
# Change install name shown by otool -L if tool available.
diff --git a/Makefile.am b/Makefile.am
index ba46d3d..2aeb3b3 100644
--- a/Makefile.am
b/Makefile.am
@@ -8,6 8,10 @@
#
ACLOCAL_AMFLAGS=-I m4
AM_CFLAGS="@MAGICK_CFLAGS@ @WAND_CFLAGS@"
AM_LIBS="@MAGICK_LIBS@ @WAND_LIBS@"
AM_LDFLAGS="@MAGICK_LDLAGS@ @WAND_LDFLAGS@"
MAKE_PATH = .
include $(MAKE_PATH)/Make.def
diff --git a/configure.ac b/configure.ac
index 118c184..b494fa4 100644
--- a/configure.ac
b/configure.ac
@@ -8,8 8,10 @@ AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wno-portability, foreign])
AC_CONFIG_MACRO_DIRS([m4])
VER_MAJOR=$(echo "$PACKAGE_VERSION" | cut -d . -f 1)
VER_MINOR=$(echo "$PACKAGE_VERSION" | cut -d . -f 2)
VER_MICRO=$(echo "$PACKAGE_VERSION" | cut -d . -f 3)
@@ -271,207 273,17 @@ AC_ARG_ENABLE([diagnostic],
[C_DEBUG=])
AC_SUBST(C_DEBUG)
-AC_ARG_WITH([magick-version],
- AS_HELP_STRING([--with-magick-version=VERSION],
- [ImageMagick version]),
- [MAGICK_VERSION="${withval}"])
-if (test -n "$MAGICK_VERSION"); then
- VER_MAJOR=$(echo "$MAGICK_VERSION" | cut -d . -f 1)
- VER_MINOR=$(echo "$MAGICK_VERSION" | cut -d . -f 2)
- VER_MICRO=$(echo "$MAGICK_VERSION" | cut -d . -f 3)
-fi
-
-dnl Check if ImageMagick home specified
-AC_ARG_WITH([magick-home],
- AS_HELP_STRING([--with-magick-home=PATH],
- [home directory of ImageMagick]),
- [MAGICK_HOME="${withval}"])
-
-for MPATH in ${MAGICK_HOME} /usr /usr/local /usr/local/ImageMagick /usr/local/ImageMagick-${VER_MAJOR}.${VER_MINOR}.${VER_MICRO} ; do
- # Location before IM 6.3.8.something
- if test -f "${MPATH}/include/magick/api.h" ; then
- MAGICK_LIB_PATH=${MPATH}/lib
- case "$target" in
- *-*-cygwin|*-*-mingw32)
- MAGICK_LIBS="-L${MPATH}/lib -lCORE_RL_wand_ -lCORE_RL_magick_"
- MAGICK_CHECK_LIBS="CORE_RL_wand_ CORE_RL_magick_"
- ;;
- *)
- MAGICK_LIBS="-L${MPATH}/lib -lWand -lMagick"
- MAGICK_CHECK_LIBS="Wand Magick"
- ;;
- esac
- MAGICK_INCLUDES=-I${MPATH}/include
- MAGICK_REALHOME=${MPATH}
- MAGICK_VERSION=6
- fi
- # Location after IM 6.3.8.something
- if test -f "${MPATH}/include/ImageMagick/magick/api.h" ; then
- MAGICK_LIB_PATH=${MPATH}/lib
- case "$target" in
- *-*-cygwin|*-*-mingw32)
- MAGICK_LIBS="-L${MPATH}/lib -lCORE_RL_wand_ -lCORE_RL_magick_"
- MAGICK_CHECK_LIBS="CORE_RL_wand_ CORE_RL_magick_"
- ;;
- *)
- MAGICK_LIBS="-L${MPATH}/lib -lWand -lMagick"
- MAGICK_CHECK_LIBS="Wand Magick"
- ;;
- esac
- MAGICK_INCLUDES=-I${MPATH}/include/ImageMagick
- MAGICK_REALHOME=${MPATH}
- MAGICK_VERSION=6
- fi
- # Location after Ubuntu 16.04
- if test -f "${MPATH}/include/ImageMagick-6/magick/api.h" ; then
- MAGICK_LIB_PATH=${MPATH}/lib
- case "$target" in
- *-*-cygwin|*-*-mingw32)
- MAGICK_LIBS="-L${MPATH}/lib -lCORE_RL_wand_ -lCORE_RL_magick_"
- MAGICK_CHECK_LIBS="CORE_RL_wand_ CORE_RL_magick_"
- ;;
- *)
- MAGICK_LIBS="-L${MPATH}/lib -lWand -lMagick"
- MAGICK_CHECK_LIBS="Wand Magick"
- ;;
- esac
- MAGICK_INCLUDES=-I${MPATH}/include/ImageMagick-6
- MAGICK_REALHOME=${MPATH}
- MAGICK_VERSION=6
- fi
- # Location after IM 7.something
- if test -f "${MPATH}/include/MagickCore/MagickCore.h" ; then
- MAGICK_LIB_PATH=${MPATH}/lib
- case "$target" in
- *-*-cygwin|*-*-mingw32)
- MAGICK_LIBS="-L${MPATH}/lib -lCORE_RL_MagickWand_ -lCORE_RL_MagickCore_"
- MAGICK_CHECK_LIBS="CORE_RL_MagickWand_ CORE_RL_MagickCore_"
- ;;
- *)
- MAGICK_LIBS="-L${MPATH}/lib -lMagickWand -lMagickCore"
- MAGICK_CHECK_LIBS="MagickWand MagickCore"
- ;;
- esac
- MAGICK_INCLUDES=-I${MPATH}/include
- MAGICK_REALHOME=${MPATH}
- MAGICK_VERSION=7
- fi
- # Location for some Linux distros
- if test -f "${MPATH}/include/ImageMagick-7/MagickCore/MagickCore.h" ; then
- MAGICK_LIB_PATH=${MPATH}/lib
- case "$target" in
- *-*-cygwin|*-*-mingw32)
- MAGICK_LIBS="-L${MPATH}/lib -lCORE_RL_MagickWand_ -lCORE_RL_MagickCore_"
- MAGICK_CHECK_LIBS="CORE_RL_MagickWand_ CORE_RL_MagickCore_"
- ;;
- *)
- MAGICK_LIBS="-L${MPATH}/lib -lMagickWand -lMagickCore"
- MAGICK_CHECK_LIBS="MagickWand MagickCore"
- ;;
- esac
- MAGICK_INCLUDES=-I${MPATH}/include/ImageMagick-7
- MAGICK_REALHOME=${MPATH}
- MAGICK_VERSION=7
- fi
-done
-
-dnl Check if MagickWand-conf exists
-OLDPATH=${PATH}
-# MagickWand-config isn't installed in /usr/bin in Ubuntu 16.04 due
-# to changes in libmagickcore-dev package.
-AC_ARG_WITH([magickwand-config],
- AS_HELP_STRING([--with-magickwand-config=PATH],
- [path to magickwand-config tool]),
- [magickwand_config="$withval"],
- [magickwand_config=""])
-
-if test -n "$magickwand_config"; then
- MAGICKCONF="$magickwand_config"
-else
- PATH=${MAGICK_REALHOME}/bin:/usr/${LIB}/${build_os}/ImageMagick-${VER_MAJOR}.${VER_MINOR}.${VER_MICRO}-Q64HDRI/bin:/usr/${LIB}/${build_os}/ImageMagick-${VER_MAJOR}.${VER_MINOR}.${VER_MICRO}-Q64/bin:/usr/${LIB}/${build_os}/ImageMagick-${VER_MAJOR}.${VER_MINOR}.${VER_MICRO}-Q32HDRI/bin:/usr/${LIB}/${build_os}/ImageMagick-${VER_MAJOR}.${VER_MINOR}.${VER_MICRO}-Q32/bin:/usr/${LIB}/${build_os}/ImageMagick-${VER_MAJOR}.${VER_MINOR}.${VER_MICRO}-Q16HDRI/bin:/usr/${LIB}/${build_os}/ImageMagick-${VER_MAJOR}.${VER_MINOR}.${VER_MICRO}-Q16/bin:/usr/${LIB}/${build_os}/ImageMagick-${VER_MAJOR}.${VER_MINOR}.${VER_MICRO}-Q8HDRI/bin:/usr/${LIB}/${build_os}/ImageMagick-${VER_MAJOR}.${VER_MINOR}.${VER_MICRO}-Q8/bin:/usr/${LIB}/${build_os}/ImageMagick-${VER_MAJOR}.${VER_MINOR}.${VER_MICRO}/bin:${PATH}
- export PATH
- AC_PATH_PROG(MAGICKCONF, MagickWand-config, not_found)
- PATH=${OLDPATH}
- export PATH
-fi
-
-dnl Added $MAGICK_LIB_PATH and $MAGICK_INCLUDES here because of
-dnl a possible bug in Magick-conf for ImageMagick 5.4.6
-if (test $MAGICKCONF != not_found); then
- LDFLAGS="${LDFLAGS} `$MAGICKCONF --ldflags`"
- MAGICK_LIBS="`$MAGICKCONF --libs`"
- MAGICK_INCLUDES=`$MAGICKCONF --cppflags`
- MAGICK_LIB_PATH=`$MAGICKCONF --exec-prefix`/lib
- MAGICK_REALHOME=`$MAGICKCONF --exec-prefix`
- MAGICK_CHECK_LIBS=`$MAGICKCONF --libs | awk 'function ltrim(s) { sub(/^[ \t\r\n] /, "", s); return s } function rtrim(s) { sub(/[ \t\r\n] $/, "", s); return s } function trim(s) { return rtrim(ltrim(s)); } END { for (i = 1; i <= NF; i ) { if ( substr($i, 0, 2) != "-l") {$i=""} else {$i=substr($i,3)}} print trim($0)}'`
- MAGICK_VERSION=`$MAGICKCONF --version | cut -c1`
-fi
-
-dnl Check if ImageMagick library path specified
-AC_ARG_WITH([magick-lib-dir],
- AS_HELP_STRING([--with-magick-lib-dir=PATH],
- [library path of ImageMagick]),
- [MAGICK_LIB_PATH="${withval}"],
- [MAGICK_LIBS="-L${withval}"])
-
-dnl Check if ImageMagick include path specified
-AC_ARG_WITH([magick-inc-dir],
- AS_HELP_STRING([--with-magick-inc-dir=PATH],
- [path include path of ImageMagick]),
- [MAGICK_INCLUDES="-I${withval}"])
-
-if ( test -f "${MAGICK_INCLUDE_PATH}/magick/api.h" ) ; then
- MAGICK_INCLUDES=-I${MAGICK_INCLUDE_PATH}
- MAGICK_VERSION=6
-fi
-if ( test -f "${MAGICK_INCLUDE_PATH}/MagickCore/MagickCore.h" ) ; then
- MAGICK_INCLUDES=-I${MAGICK_INCLUDE_PATH}
- MAGICK_VERSION=7
-fi
-
-dnl Ensure proper includes in source files
-CFLAGS="${CFLAGS} -DIMAGEMAGICK_HEADER_STYLE_${MAGICK_VERSION}"
-
-dnl Check for the ImageMagick headers
-OLD_CPPFLAGS=${CPPFLAGS}
-if test -n "${MAGICK_INCLUDES}"; then
- CPPFLAGS="${MAGICK_INCLUDES} ${CPPFLAGS}"
-fi
-
-if test "${MAGICK_VERSION}" = 7 ; then
- MAGICK_CHECK_HEADERS="MagickWand/MagickWand.h MagickCore/MagickCore.h"
-elif test "${MAGICK_VERSION}" = 6 ; then
- MAGICK_CHECK_HEADERS="wand/magick-wand.h magick/api.h"
-fi
-
-for MHEADER in ${MAGICK_CHECK_HEADERS} ; do
- AC_CHECK_HEADER(${MHEADER}, HAVE_MAGICK_HEADER=yes, HAVE_MAGICK_HEADER=no)
- if test "${HAVE_MAGICK_HEADER}" = no ; then
- AC_MSG_ERROR('Unable to find ImageMagick header file: ${MHEADER}')
- fi
-done
-
-dnl Check for the ImageMagick libraries
-OLD_LDFLAGS=${LDFLAGS}
-if test -n "${MAGICK_LIBS}"; then
- LDFLAGS="${MAGICK_LIBS} ${LDFLAGS}"
-fi
-
-MAGICK_CHECK_LIB_FUNCTIONS="NewPixelWand ConstituteImage"
-MLIB_INDEX=1
-for MLIB in ${MAGICK_CHECK_LIBS} ; do
- MLIBFUNCTION=`echo ${MAGICK_CHECK_LIB_FUNCTIONS} | awk "{print \\$$MLIB_INDEX}"`
- AC_CHECK_LIB(${MLIB}, ${MLIBFUNCTION},
- HAVE_MAGICK_LIB=yes, HAVE_MAGICK_LIB=no)
- if test ${HAVE_MAGICK_LIB} = no; then
- AC_MSG_ERROR('Unable to find ImageMagick library: ${MLIB}')
- fi
- (( MLIB_INDEX ))
-done
-
-CPPFLAGS=${OLD_CPPFLAGS}
-LDFLAGS=${OLD_LDFLAGS}
-
PKG_PREREQ
PKG_PROG_PKG_CONFIG
MAGICK_LIBS="`$PKG_CONFIG --libs-only-l MagickCore`"
MAGICK_LDFLAGS="`$PKG_CONFIG --libs-only-L MagickCore`"
MAGICK_CFLAGS="`$PKG_CONFIG --cflags MagickCore`"
WAND_LIBS="`$PKG_CONFIG --libs-only-l MagickWand`"
WAND_LDFLAGS="`$PKG_CONFIG --libs-only-L MagickWand`"
WAND_CFLAGS="`$PKG_CONFIG --cflags MagickWand`"
MAGICK_VERSION="`$PKG_CONFIG --modversion MagickWand | perl -pe 's/(^\d )\..*$/$1/g'`"
AS_IF(test $MAGICK_VERSION = 7,AC_DEFINE(IMAGEMAGICK_HEADER_STYLE_7))
HAVE_MAGICK_LIB='yes';
dnl Configure libtool
@@ -483,11 295,17 @@ AC_SUBST(X11_LIBS)
AC_SUBST(X11_INCLUDES)
AC_SUBST(MAGICK_LIB_PATH)
AC_SUBST(MAGICK_LIBS)
AC_SUBST(MAGICK_LDFLAGS)
AC_SUBST(MAGICK_INCLUDES)
AC_SUBST(CFLAGS)
AC_SUBST(MAGICK_CFLAGS)
AC_SUBST(WAND_CFLAGS)
AC_SUBST(WAND_LDFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(JFLAGS)
AC_SUBST(LIBS)
AC_SUBST(MAGICK_LIBS)
AC_SUBST(WAND_LIBS)
AC_SUBST(SHARED_LDFLAGS)
AC_SUBST(LIBTOOL_LINK_FLAG)
AC_SUBST(SHARED_LIB_EXT)
|