Skip to content

Commit

Permalink
Merge pull request #1527 from fingolfin/mh/regenerate-buildsystem
Browse files Browse the repository at this point in the history
Add some rules to regenerate parts of the build system if needed
  • Loading branch information
albinahlback authored Nov 17, 2023
2 parents f09196d + 2cbc76f commit fddfc40
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,45 @@ endif
$(RM_F) $(LIBDIR)/$(FLINT_LIB_STATIC)
$(RM_RF) $(INCLUDEDIR)/flint

################################################################################
# regenerate part of the build system of needed
################################################################################

ifneq ($(MAINTAINER_MODE),no) # disable this for releases?
ifneq ($(shell command -v autoconf 2> /dev/null),)
configure: configure.ac
@echo "Running autoconf"
@autoconf
else
configure: configure.ac
$(warning autoconf not available, proceeding with stale configure)
endif
endif

config.status: configure
./config.status --recheck

Makefile: Makefile.in config.status
./config.status $@

flint.pc: flint.pc.in config.status
./config.status $@

src/flint.h: src/flint.h.in config.status
./config.status $@

libtool: config.status
./config.status $@

src/fft_tuning.h: @FFT_TUNING_IN@ config.status
./config.status $@

src/fmpz/fmpz.c: @FMPZ_C_IN@ config.status
./config.status $@

src/gmpcompat.h: src/@GMPCOMPAT_H_IN@ config.status
./config.status $@

################################################################################
# maintainer stuff
################################################################################
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ case "$host_cpu" in
;;
esac
AC_CONFIG_FILES([src/fft_tuning.h:$fft_tuning_in],[],[fft_tuning_in="$fft_tuning_in"])
AC_SUBST(FFT_TUNING_IN, $fft_tuning_in)

if test -z "$LDCONFIG";
then
Expand Down Expand Up @@ -643,6 +644,7 @@ AC_COMPILE_IFELSE(
gmpcompat_h_in="gmpcompat.h.in")

AC_CONFIG_FILES([src/gmpcompat.h:src/$gmpcompat_h_in],[],[gmpcompat_h_in="$gmpcompat_h_in"])
AC_SUBST(GMPCOMPAT_H_IN, $gmpcompat_h_in)

# Check that MPFR >= 4.1.0
AC_MSG_CHECKING([if version of MPFR is greater than 4.1.0])
Expand Down Expand Up @@ -1102,6 +1104,7 @@ else
fi

AC_CONFIG_FILES([src/fmpz/fmpz.c:$fmpz_c],[],[fmpz_c="$fmpz_c"])
AC_SUBST(FMPZ_C_IN, $fmpz_c)

if test "$enable_shared" = "yes";
then
Expand Down

0 comments on commit fddfc40

Please sign in to comment.