diff --git a/configure b/configure
index b5129a16439ae4d09973dc9ecd1a157fe54edb5b..4ff62c7f9722e079b6629df71bd325805dae4615 100755
--- a/configure
+++ b/configure
@@ -591,13 +591,13 @@ for opt do
   ;;
   --enable-small) optimize="small"
   ;;
-  --enable-amr_nb) amr_nb="yes"; amr_nb_fixed="no"
+  --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no"
   ;;
-  --enable-amr_nb-fixed) amr_nb_fixed="yes"; amr_nb="no"
+  --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no"
   ;;
-  --enable-amr_wb) amr_wb="yes"
+  --enable-amr_wb) amr="yes"; amr_wb="yes"
   ;;
-  --enable-amr_if2) amr_if2="yes"
+  --enable-amr_if2) amr="yes"; amr_if2="yes"
   ;;
   --enable-sunmlib) sunmlib="yes"
   ;;
@@ -1913,6 +1913,11 @@ fi
 echo "SRC_PATH=$source_path" >> config.mak
 echo "BUILD_ROOT=$PWD" >> config.mak
 
+if test "$amr" = "yes" ; then
+  echo "#define AMR 1" >> $TMPH
+  echo "AMR=yes" >> config.mak
+fi
+
 if test "$amr_wb" = "yes" ; then
   echo "#define AMR_WB 1" >> $TMPH
   echo "AMR_WB=yes" >> config.mak
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 9586361a00887ea4f63c9753414f3bc6e67efa08..aba23b35a2f018a0d1052c3cc090994ebea37f63 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -235,21 +235,20 @@ ifeq ($(CONFIG_ZMBV_DECODER),yes)
 endif
 
 
-AMROBJS=
+ifeq ($(AMR),yes)
+OBJS+= amr.o
+endif
 
 ifeq ($(AMR_NB),yes)
-AMROBJS= amr.o
 OBJS+= amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
 endif
 
 ifeq ($(AMR_NB_FIXED),yes)
-AMROBJS= amr.o
 EXTRAOBJS += amr/*.o
 EXTRADEPS=amrlibs
 endif
 
 ifeq ($(AMR_WB),yes)
-AMROBJS= amr.o
 OBJS+= amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o  amrwb_float/dec_gain.o  \
        amrwb_float/dec_if.o    amrwb_float/dec_lpc.o  amrwb_float/dec_main.o  \
        amrwb_float/dec_rom.o   amrwb_float/dec_util.o amrwb_float/enc_acelp.o \
@@ -258,8 +257,6 @@ OBJS+= amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o  amrwb_float/dec_gain.o  \
        amrwb_float/enc_util.o  amrwb_float/if_rom.o
 endif
 
-OBJS+= $(AMROBJS)
-
 
 ifeq ($(HAVE_PTHREADS),yes)
 OBJS+= pthread.o
diff --git a/libavformat/Makefile b/libavformat/Makefile
index e5e7efaec6788f4336b9116a13fb86501aa964d3..c164016fff6857d74e714dbacda797e4bdb8a8d5 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -26,17 +26,9 @@ OBJS+= flvenc.o movenc.o asf-enc.o adtsenc.o
 endif
 
 
-AMROBJS=
-ifeq ($(AMR_NB),yes)
-AMROBJS= amr.o
+ifeq ($(AMR),yes)
+OBJS+= amr.o
 endif
-ifeq ($(AMR_NB_FIXED),yes)
-AMROBJS= amr.o
-endif
-ifeq ($(AMR_WB),yes)
-AMROBJS= amr.o
-endif
-OBJS+= $(AMROBJS)
 
 # image formats
 OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o