[Git][ghc/ghc][master] configure: remove dead code in configure scripts
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 81d10134 by Cheng Shao at 2025-12-24T06:11:52-05:00 configure: remove dead code in configure scripts This patch removes dead code in our configure scripts, including: - Variables and auto-detected programs that are not used - autoconf functions that are not used, or export a variable that's not used - `AC_CHECK_HEADERS` invocations that don't have actual corresponding `HAVE_XXX_H` usage - Other dead code (e.g. stray `AC_DEFUN()`) Co-authored-by: Codex <codex@openai.com> - - - - - 8 changed files: - configure.ac - libraries/ghc-internal/configure.ac - − m4/find_ghc_bootstrap_prog.m4 - − m4/fp_copy_shellvar.m4 - − m4/fp_prog_ld_flag.m4 - − m4/fp_prog_sort.m4 - m4/prep_target_file.m4 - rts/configure.ac Changes: ===================================== configure.ac ===================================== @@ -57,14 +57,10 @@ dnl ** which are needed by FP_SETUP_PROJECT_VERSION dnl ** Find find command (for Win32's benefit) FP_PROG_FIND -FP_PROG_SORT dnl ---------------------------------------------------------- FP_SETUP_PROJECT_VERSION -# Hmmm, we fix the RPM release number to 1 here... Is this convenient? -AC_SUBST([release], [1]) - dnl * We require autoconf version 2.69 due to dnl https://bugs.ruby-lang.org/issues/8179. Also see #14910. dnl * We need 2.50 due to the use of AC_SYS_LARGEFILE and AC_MSG_NOTICE. @@ -249,9 +245,6 @@ then fi AC_SUBST([WithGhc]) -dnl ** Without optimization some INLINE trickery fails for GHCi -SRC_CC_OPTS="-O" - dnl-------------------------------------------------------------------- dnl * Choose host(/target/build) platform dnl-------------------------------------------------------------------- @@ -753,10 +746,6 @@ AC_PROG_LN_S dnl ** Find the path to sed AC_PATH_PROGS(SedCmd,gsed sed,sed) - -dnl ** check for time command -AC_PATH_PROG(TimeCmd,time) - dnl ** check for tar dnl if GNU tar is named gtar, look for it first. AC_PATH_PROGS(TarCmd,gnutar gtar tar,tar) ===================================== libraries/ghc-internal/configure.ac ===================================== @@ -23,7 +23,7 @@ AC_MSG_RESULT($WINDOWS) AC_CHECK_TYPES([long long]) # check for specific header (.h) files that we are interested in -AC_CHECK_HEADERS([ctype.h errno.h fcntl.h inttypes.h limits.h signal.h sys/file.h sys/resource.h sys/select.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/wait.h termios.h time.h unistd.h utime.h windows.h winsock.h langinfo.h poll.h sys/epoll.h sys/event.h sys/eventfd.h sys/socket.h]) +AC_CHECK_HEADERS([ctype.h errno.h fcntl.h inttypes.h limits.h signal.h sys/resource.h sys/select.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/wait.h termios.h unistd.h utime.h windows.h winsock.h langinfo.h poll.h sys/epoll.h sys/event.h sys/eventfd.h sys/socket.h]) # Enable large file support. Do this before testing the types ino_t, off_t, and # rlim_t, because it will affect the result of that test. ===================================== m4/find_ghc_bootstrap_prog.m4 deleted ===================================== @@ -1,17 +0,0 @@ -# FIND_GHC_BOOTSTRAP_PROG() -# -------------------------------- -# Parse the bootstrap GHC's compiler settings file for the location of things -# like the `llc` and `opt` commands. -# -# $1 = the variable to set -# $2 = The bootstrap compiler. -# $3 = The string to grep for to find the correct line. -# -AC_DEFUN([FIND_GHC_BOOTSTRAP_PROG],[ - BootstrapTmpCmd=`grep $3 $($2 --print-libdir)/settings 2>/dev/null | sed 's/.*", "//;s/".*//'` - if test -n "$BootstrapTmpCmd" && test `basename $BootstrapTmpCmd` = $BootstrapTmpCmd ; then - AC_PATH_PROG([$1], [$BootstrapTmpCmd], "") - else - $1=$BootstrapTmpCmd - fi -]) ===================================== m4/fp_copy_shellvar.m4 deleted ===================================== @@ -1,3 +0,0 @@ -# Helper for cloning a shell variable's state -AC_DEFUN([FP_COPY_SHELLVAR], -[if test -n "${$1+set}"; then $2="$$1"; else unset $2; fi ]) ===================================== m4/fp_prog_ld_flag.m4 deleted ===================================== @@ -1,17 +0,0 @@ -# FP_PROG_LD_FLAG -# --------------- -# Sets the output variable $2 to $1 if ld supports the $1 flag. -# Otherwise the variable's value is empty. -AC_DEFUN([FP_PROG_LD_FLAG], -[ -AC_CACHE_CHECK([whether ld understands $1], [fp_cv_$2], -[echo 'int foo() { return 0; }' > conftest.c -${CC-cc} -c conftest.c -if $LD -r $1 -o conftest2.o conftest.o > /dev/null 2>&1; then - fp_cv_$2=$1 -else - fp_cv_$2= -fi -rm -rf conftest*]) -$2=$fp_cv_$2 -])# FP_PROG_LD_FLAG ===================================== m4/fp_prog_sort.m4 deleted ===================================== @@ -1,18 +0,0 @@ -# FP_PROG_SORT -# ------------ -# Find a Unix-like sort -AC_DEFUN([FP_PROG_SORT], -[AC_PATH_PROG([fp_prog_sort], [sort]) -echo conwip > conftest.txt -$fp_prog_sort -f conftest.txt > conftest.out 2>&1 -if grep 'conwip' conftest.out > /dev/null 2>&1 ; then - # The goods - SortCmd="$fp_prog_sort" -else - # Summink else..pick next one. - AC_MSG_WARN([$fp_prog_sort looks like a non-*nix sort, ignoring it]) - FP_CHECK_PROG([SortCmd], [sort], [], [], [$fp_prog_sort]) -fi -rm -f conftest.txt conftest.out -AC_SUBST([SortCmd])[]dnl -])# FP_PROG_SORT ===================================== m4/prep_target_file.m4 ===================================== @@ -229,5 +229,3 @@ AC_DEFUN([PREP_TARGET_FILE],[ esac AC_SUBST([TargetEndianness]) ]) - -AC_DEFUN() ===================================== rts/configure.ac ===================================== @@ -96,7 +96,7 @@ dnl off_t, because it will affect the result of that test. AC_SYS_LARGEFILE dnl ** check for specific header (.h) files that we are interested in -AC_CHECK_HEADERS([ctype.h dirent.h dlfcn.h errno.h fcntl.h grp.h limits.h locale.h nlist.h pthread.h pwd.h signal.h sys/param.h sys/mman.h sys/resource.h sys/select.h sys/time.h sys/timeb.h sys/timerfd.h sys/timers.h sys/times.h sys/utsname.h sys/wait.h termios.h utime.h windows.h winsock.h sched.h]) +AC_CHECK_HEADERS([ctype.h dlfcn.h errno.h fcntl.h limits.h locale.h nlist.h pthread.h signal.h sys/param.h sys/mman.h sys/resource.h sys/select.h sys/time.h sys/timeb.h sys/timerfd.h sys/timers.h sys/times.h sys/utsname.h sys/wait.h termios.h utime.h windows.h winsock.h sched.h]) dnl sys/cpuset.h needs sys/param.h to be included first on FreeBSD 9.1; #7708 AC_CHECK_HEADERS([sys/cpuset.h], [], [], @@ -148,7 +148,7 @@ FP_CHECK_FUNC([GetModuleFileName], dnl ** check for more functions dnl ** The following have been verified to be used in ghc/, but might be used somewhere else, too. -AC_CHECK_FUNCS([getclock getrusage gettimeofday setitimer siginterrupt sysconf times ctime_r sched_setaffinity sched_getaffinity setlocale uselocale]) +AC_CHECK_FUNCS([getclock getrusage gettimeofday sysconf times ctime_r sched_setaffinity sched_getaffinity uselocale]) dnl ** On OS X 10.4 (at least), time.h doesn't declare ctime_r if dnl ** _POSIX_C_SOURCE is defined @@ -488,5 +488,3 @@ cat ghcautoconf.h.autoconf | sed \ >> include/ghcautoconf.h echo "#endif /* __GHCAUTOCONF_H__ */" >> include/ghcautoconf.h ] - - View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/81d101346771a05be97d725493ee7bdf... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/81d101346771a05be97d725493ee7bdf... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)