### ImageMagick version

7.1.0-57

### Operating system

Linux

### Operating system, version and so on

amzn2

### Description

The LibRaw-devel package distributed by amzn2 (Amazon Linux 2) is ancient. The ImageMagick configure script detects it and determines it's ok ( > 0.14.8 - from the package name it's exactly 0.14.8), but ImageMagick then fails to compile (because the libraw structures lack members the IM source is expecting - specifically, a "no_interpolation" member which it seems, from the git blame of the relevant header, was not added to libraw until 0.21).

Having built latest libraw from source, I'd like to link it statically into my build of ImageMagick. To that end, I've set the RAW_R_LIBS environment variable. Unfortunately, though, it seems that while the configure script detects this, in the end it ignores it, as you can see from this grep of config.log:

```
bash-4.2# fgrep RAW_R_LIBS config.log
ac_cv_env_RAW_R_LIBS_set=set
ac_cv_env_RAW_R_LIBS_value='/dbsrc2/3rdparty/install/lib/libraw_r.a -fopenmp -lstdc++ -lz'
pkg_cv_RAW_R_LIBS='-fopenmp -L/dbsrc2/3rdparty/install/lib -lraw_r -lstdc++ -lz  '
CONFIGURE_ARGS='./configure  '\''--prefix=/dbsrc2/3rdparty/install'\'' '\''--enable-static'\'' '\''--enable-shared'\'' '\''--disable-installed'\'' '\''--with-openjp2'\'' '\''--with-raw'\'' '\''--with-webp'\'' '\''--without-x'\'' '\''--without-magick-plus-plus'\'' '\''--without-perl'\'' '\''--without-threads'\'' '\''--without-freetype'\'' '\''--without-lcms'\'' '\''--without-xml'\'' '\''--without-bzlib'\'' '\''--without-zlib'\'' '\''--without-gslib'\'' '\''--without-gvc'\'' '\''--without-rsvg'\'' '\''--disable-hdri'\'' '\''PKG_CONFIG_PATH=/dbsrc2/3rdparty/install/lib/pkgconfig'\'' '\''RAW_R_LIBS=/dbsrc2/3rdparty/install/lib/libraw_r.a -fopenmp -lstdc++ -lz'\'''
RAW_R_LIBS='-fopenmp -L/dbsrc2/3rdparty/install/lib -lraw_r -lstdc++ -lz  '
```

I've tried avoiding pkg-config completely by specifying RAW_R_CFLAGS and RAW_R_LIBS, but the configure script then determines there is no libraw support. It looks like the test explicitly uses pkg-config:

```
configure:33268: checking for libraw_r >= 0.14.8
configure:33275: $PKG_CONFIG --exists --print-errors "libraw_r >= 0.14.8"
Package libraw_r was not found in the pkg-config search path.
Perhaps you should add the directory containing `libraw_r.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libraw_r' found
configure:33278: $? = 1
configure:33292: $PKG_CONFIG --exists --print-errors "libraw_r >= 0.14.8"
Package libraw_r was not found in the pkg-config search path.
Perhaps you should add the directory containing `libraw_r.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libraw_r' found
configure:33295: $? = 1
configure:33309: result: no
No package 'libraw_r' found
```

### Steps to Reproduce

1. Download and build libraw from source and install to some directory $LIBRAWINSTALLDIR
2. Run `PKG_CONFIG_PATH=$LIBRAWINSTALLDIR/lib/pkgconfig RAW_R_LIBS=foo ./configure`
3. Verify that the report of the value of RAW_R_LIBS at the end of config.log is not foo

### Images

_No response_
RAW_R_LIBS environment variable ignored by configure script
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : RAW_R_LIBS environment variable ignored by configure script
Issue date:

--- start body ---
### ImageMagick version

7.1.0-57

### Operating system

Linux

### Operating system, version and so on

amzn2

### Description

The LibRaw-devel package distributed by amzn2 (Amazon Linux 2) is ancient. The ImageMagick configure script detects it and determines it's ok ( > 0.14.8 - from the package name it's exactly 0.14.8), but ImageMagick then fails to compile (because the libraw structures lack members the IM source is expecting - specifically, a "no_interpolation" member which it seems, from the git blame of the relevant header, was not added to libraw until 0.21).

Having built latest libraw from source, I'd like to link it statically into my build of ImageMagick. To that end, I've set the RAW_R_LIBS environment variable. Unfortunately, though, it seems that while the configure script detects this, in the end it ignores it, as you can see from this grep of config.log:

```
bash-4.2# fgrep RAW_R_LIBS config.log
ac_cv_env_RAW_R_LIBS_set=set
ac_cv_env_RAW_R_LIBS_value='/dbsrc2/3rdparty/install/lib/libraw_r.a -fopenmp -lstdc++ -lz'
pkg_cv_RAW_R_LIBS='-fopenmp -L/dbsrc2/3rdparty/install/lib -lraw_r -lstdc++ -lz  '
CONFIGURE_ARGS='./configure  '\''--prefix=/dbsrc2/3rdparty/install'\'' '\''--enable-static'\'' '\''--enable-shared'\'' '\''--disable-installed'\'' '\''--with-openjp2'\'' '\''--with-raw'\'' '\''--with-webp'\'' '\''--without-x'\'' '\''--without-magick-plus-plus'\'' '\''--without-perl'\'' '\''--without-threads'\'' '\''--without-freetype'\'' '\''--without-lcms'\'' '\''--without-xml'\'' '\''--without-bzlib'\'' '\''--without-zlib'\'' '\''--without-gslib'\'' '\''--without-gvc'\'' '\''--without-rsvg'\'' '\''--disable-hdri'\'' '\''PKG_CONFIG_PATH=/dbsrc2/3rdparty/install/lib/pkgconfig'\'' '\''RAW_R_LIBS=/dbsrc2/3rdparty/install/lib/libraw_r.a -fopenmp -lstdc++ -lz'\'''
RAW_R_LIBS='-fopenmp -L/dbsrc2/3rdparty/install/lib -lraw_r -lstdc++ -lz  '
```

I've tried avoiding pkg-config completely by specifying RAW_R_CFLAGS and RAW_R_LIBS, but the configure script then determines there is no libraw support. It looks like the test explicitly uses pkg-config:

```
configure:33268: checking for libraw_r >= 0.14.8
configure:33275: $PKG_CONFIG --exists --print-errors "libraw_r >= 0.14.8"
Package libraw_r was not found in the pkg-config search path.
Perhaps you should add the directory containing `libraw_r.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libraw_r' found
configure:33278: $? = 1
configure:33292: $PKG_CONFIG --exists --print-errors "libraw_r >= 0.14.8"
Package libraw_r was not found in the pkg-config search path.
Perhaps you should add the directory containing `libraw_r.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libraw_r' found
configure:33295: $? = 1
configure:33309: result: no
No package 'libraw_r' found
```

### Steps to Reproduce

1. Download and build libraw from source and install to some directory $LIBRAWINSTALLDIR
2. Run `PKG_CONFIG_PATH=$LIBRAWINSTALLDIR/lib/pkgconfig RAW_R_LIBS=foo ./configure`
3. Verify that the report of the value of RAW_R_LIBS at the end of config.log is not foo

### Images

_No response_
--- end body ---
