"Fossies" - the Fresh Open Source Software Archive

Member "epm-4.5.1/configure.ac" (18 Nov 2020, 8310 Bytes) of package /linux/privat/epm-4.5.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 4.5_vs_4.5.1.

    1 dnl
    2 dnl Configuration script for the ESP Package Manager (EPM).
    3 dnl
    4 dnl Copyright © 1999-2020 by Michael R Sweet
    5 dnl Copyright © 1999-2007 by Easy Software Products, all rights reserved.
    6 dnl
    7 dnl This program is free software; you can redistribute it and/or modify
    8 dnl it under the terms of the GNU General Public License as published by
    9 dnl the Free Software Foundation; either version 2, or (at your option)
   10 dnl any later version.
   11 dnl
   12 dnl This program is distributed in the hope that it will be useful,
   13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
   14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15 dnl GNU General Public License for more details.
   16 dnl
   17 
   18 AC_INIT([EPM],[4.5.1],[https://github.com/michaelrsweet/epm/issues],[epm],[https://www.msweet.org/epm])
   19 AC_CONFIG_HEADER(config.h)
   20 
   21 dnl Version number...
   22 VERSION="AC_PACKAGE_VERSION"
   23 VERNUMBER=450
   24 AC_SUBST(VERSION)
   25 AC_SUBST(VERNUMBER)
   26 AC_DEFINE_UNQUOTED(EPM_VERSION, "ESP Package Manager v$VERSION")
   27 
   28 dnl Get the build and host platforms and split the host_os value
   29 AC_CANONICAL_BUILD
   30 AC_CANONICAL_HOST
   31 
   32 [host_os_name=`echo $host_os | sed -e '1,$s/[0-9.]*$//g'`]
   33 
   34 
   35 dnl Clear default debugging options and set normal optimization by
   36 dnl default unless the user asks for debugging specifically.
   37 
   38 CFLAGS="${CFLAGS:=}"
   39 CXXFLAGS="${CXXFLAGS:=}"
   40 LDFLAGS="${LDFLAGS:=}"
   41 AC_SUBST(LDFLAGS)
   42 
   43 AC_ARG_WITH(archflags, [  --with-archflags=flags  specify architecture flags [[default=none]]],
   44 	ARCHFLAGS="$withval",
   45 	ARCHFLAGS="${ARCHFLAGS:=}")
   46 AC_SUBST(ARCHFLAGS)
   47 
   48 AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging, default=no])
   49 AC_ARG_ENABLE(sanitizer, [  --enable-sanitizer      build with AddressSanitizer, default=no])
   50 
   51 if test "x$enable_debug" = xyes; then
   52  	OPTIM="-g"
   53  	CSFLAGS=""
   54 else
   55 	OPTIM="-Os -g"
   56 	CSFLAGS="-o runtime"
   57 fi
   58 
   59 AC_SUBST(CSFLAGS)
   60 AC_SUBST(OPTIM)
   61 
   62 AC_ARG_ENABLE(gui, [  --enable-gui            turn on GUI utilities, default=auto])
   63 
   64 AC_ARG_WITH(docdir, [  --with-docdir=/dir      set directory for documentation
   65                           [[default=${datadir}/doc/epm]]],
   66 	docdir="$withval",
   67 	docdir="\${datadir}/doc/epm")
   68 
   69 AC_SUBST(docdir)
   70 
   71 AC_ARG_WITH(softwaredir, [  --with-softwaredir=/dir set directory for EPM uninstall files and init scripts
   72                           [[default=/etc/software]]],
   73 	softwaredir="$withval",
   74 	softwaredir="")
   75 
   76 dnl Checks for programs...
   77 AC_PROG_CC(clang cc gcc)
   78 AC_PROG_CXX(clang++ c++ g++)
   79 AC_PROG_RANLIB
   80 AC_PATH_PROG(AR,ar)
   81 AC_PATH_PROG(CHMOD,chmod)
   82 AC_PATH_PROGS(CODE_SIGN, codesign true)
   83 AC_PATH_PROG(CP,cp)
   84 AC_PATH_PROG(GZIP,gzip)
   85 if test x$GZIP = x; then
   86 	AC_MSG_ERROR([GNU zip not found but required.])
   87 fi
   88 AC_PATH_PROGS(HTMLDOC, htmldoc echo)
   89 AC_PROG_INSTALL
   90 if test "$INSTALL" = "$ac_install_sh"; then
   91         # Use full path to install-sh script...
   92         INSTALL="`pwd`/install-sh -c"
   93 fi
   94 AC_PATH_PROG(MKDIR,mkdir)
   95 AC_PATH_PROG(RM,rm)
   96 AC_PATH_PROG(RPM,rpm)
   97 AC_PATH_PROG(RPMBUILD,rpmbuild)
   98 AC_PATH_PROG(STRIP,strip)
   99 
  100 dnl Architecture checks...
  101 AC_C_CONST
  102 AC_C_CHAR_UNSIGNED
  103 
  104 dnl Checks for header files.
  105 AC_HEADER_STDC
  106 AC_HEADER_DIRENT
  107 AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
  108 AC_CHECK_HEADER(sys/mount.h,AC_DEFINE(HAVE_SYS_MOUNT_H))
  109 AC_CHECK_HEADER(sys/param.h,AC_DEFINE(HAVE_SYS_PARAM_H))
  110 AC_CHECK_HEADER(sys/statfs.h,AC_DEFINE(HAVE_SYS_STATFS_H))
  111 AC_CHECK_HEADER(sys/vfs.h,AC_DEFINE(HAVE_SYS_VFS_H))
  112 
  113 dnl Checks for string functions.
  114 AC_CHECK_FUNCS(strcasecmp strdup strlcat strlcpy strncasecmp)
  115 AC_CHECK_FUNCS(snprintf vsnprintf)
  116 AC_SEARCH_LIBS(gethostname, socket)
  117 
  118 if test "x$enable_gui" != xno; then
  119 	AC_PATH_PROG(FLTKCONFIG,fltk-config)
  120 else
  121 	FLTKCONFIG=""
  122 fi
  123 
  124 if test "x$FLTKCONFIG" = x; then
  125 	GUIS=""
  126 	GUILIBS=""
  127 	INSTALL_GUIS=""
  128 	INSTALL_OSX=""
  129 
  130 	AC_MSG_WARN([Sorry, setup GUI requires FLTK 1.1.x or later.])
  131 else
  132 	CXXFLAGS="`$FLTKCONFIG --cflags` ${CXXFLAGS}"
  133 	GUIS="setup uninst"
  134 	GUILIBS="`$FLTKCONFIG --use-images --ldstaticflags`"
  135 	INSTALL_GUIS="install-guis"
  136 
  137 	if test "$host_os_name" = darwin; then
  138 		GUILIBS="$GUILIBS -framework Security"
  139 		INSTALL_OSX="install-macos"
  140 	else
  141 		INSTALL_OSX=""
  142 	fi
  143 fi
  144 
  145 AC_SUBST(INSTALL_GUIS)
  146 AC_SUBST(INSTALL_OSX)
  147 AC_SUBST(GUIS)
  148 AC_SUBST(GUILIBS)
  149 
  150 dnl Set the default compression value...
  151 case "$host_os_name" in
  152 	darwin* | *bsd* | linux* | sunos*)
  153 		# macOS, *BSD, Linux, and Solaris come with gzip standard
  154 		AC_DEFINE(EPM_COMPRESS, 1)
  155 		;;
  156 
  157 	*)
  158 		# All other OS's do not.
  159 		AC_DEFINE(EPM_COMPRESS, 0)
  160 		;;
  161 esac
  162 
  163 dnl Update compiler options...
  164 if test -n "$GCC"; then
  165 	if test x$enable_sanitizer = xyes; then
  166 		# Use -fsanitize=address with debugging...
  167 		OPTIM="-g -fsanitize=address"
  168 	else
  169 		# Otherwise use the Fortify enhancements to catch any unbounded
  170 		# string operations...
  171 		CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
  172 		CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2"
  173 	fi
  174 
  175 	# Add useful warning options...
  176 	CFLAGS="-Wall -Wformat -Wno-format-y2k -Wunused $CFLAGS"
  177 	CXXFLAGS="-Wall -Wformat -Wno-format-y2k -Wunused $CXXFLAGS"
  178 
  179 	# See if GCC supports -Wno-format-truncation...
  180 	AC_MSG_CHECKING(if GCC supports -Wno-format-truncation)
  181 	OLDCFLAGS="$CFLAGS"
  182 	CFLAGS="$CFLAGS -Werror -Wno-format-truncation"
  183 	AC_TRY_COMPILE(,,[
  184 		CFLAGS="$OLDCFLAGS -Wno-format-truncation"
  185 		CXXFLAGS="$CXXFLAGS -Wno-format-truncation"
  186 		AC_MSG_RESULT(yes)],[
  187 		AC_MSG_RESULT(no)
  188 		CFLAGS="$OLDCFLAGS"])
  189 
  190 	# See if GCC supports -fno-rtti...
  191 	AC_MSG_CHECKING(if GCC supports -fno-rtti)
  192 	OLDCFLAGS="$CFLAGS"
  193 	CFLAGS="$CFLAGS -fno-rtti"
  194 	AC_TRY_COMPILE(,,
  195 		CXXFLAGS="$CXXFLAGS -fno-rtti"
  196 		AC_MSG_RESULT(yes),
  197 		AC_MSG_RESULT(no))
  198 	CFLAGS="$OLDCFLAGS"
  199 
  200 	# See if GCC supports -fno-exceptions...
  201 	AC_MSG_CHECKING(if GCC supports -fno-exceptions)
  202 	OLDCFLAGS="$CFLAGS"
  203 	CFLAGS="$CFLAGS -fno-exceptions"
  204 	AC_TRY_COMPILE(,,
  205 		CXXFLAGS="$CXXFLAGS -fno-exceptions"
  206 		AC_MSG_RESULT(yes),
  207 		AC_MSG_RESULT(no))
  208 	CFLAGS="$OLDCFLAGS"
  209 fi
  210 
  211 dnl Flags for "ar" command...
  212 case $host_os_name in
  213         darwin* | *bsd*)
  214                 ARFLAGS="-rc"
  215                 ;;
  216         *)
  217                 ARFLAGS="crs"
  218                 ;;
  219 esac
  220 
  221 AC_SUBST(ARFLAGS)
  222 
  223 dnl Fix "prefix" variable if it hasn't been specified...
  224 if test "$prefix" = "NONE"; then
  225 	prefix="/usr/local"
  226 fi
  227 
  228 dnl Fix "exec_prefix" variable if it hasn't been specified...
  229 if test "$exec_prefix" = "NONE"; then
  230 	exec_prefix="$prefix"
  231 fi
  232 
  233 dnl Fix "libdir" variable if it hasn't been specified...
  234 if test "$libdir" = "\${exec_prefix}/lib"; then
  235 	libdir="$exec_prefix/lib"
  236 fi
  237 
  238 dnl Fix "datarootdir" variable if it hasn't been specified...
  239 if test "$datarootdir" = "\${prefix}/share"; then
  240 	if test "$prefix" = "/"; then
  241 		datarootdir="/usr/share"
  242 	else
  243 		datarootdir="$prefix/share"
  244 	fi
  245 fi
  246 
  247 dnl Fix "datadir" variable if it hasn't been specified...
  248 if test "$datadir" = "\${prefix}/share"; then
  249 	if test "$prefix" = "/"; then
  250 		datadir="/usr/share"
  251 	else
  252 		datadir="$prefix/share"
  253 	fi
  254 elif test "$datadir" = "\${datarootdir}"; then
  255 	datadir="$datarootdir"
  256 fi
  257 
  258 dnl EPM_SOFTWARE needs special attention for the default location...
  259 if test x$softwaredir = x; then
  260 	EPM_SOFTWARE="/etc/software"
  261 else
  262 	EPM_SOFTWARE="$softwaredir"
  263 fi
  264 
  265 AC_DEFINE_UNQUOTED(EPM_SOFTWARE, "$EPM_SOFTWARE")
  266 AC_SUBST(EPM_SOFTWARE)
  267 
  268 AC_DEFINE_UNQUOTED(EPM_GZIP, "$GZIP")
  269 AC_SUBST(EPM_GZIP)
  270 
  271 AC_DEFINE_UNQUOTED(EPM_STRIP, "$STRIP")
  272 AC_SUBST(EPM_STRIP)
  273 
  274 AC_DEFINE_UNQUOTED(EPM_BINDIR, "$exec_prefix/bin")
  275 AC_SUBST(EPM_BINDIR)
  276 
  277 AC_DEFINE_UNQUOTED(EPM_LIBDIR, "$libdir/epm")
  278 AC_SUBST(EPM_LIBDIR)
  279 
  280 AC_DEFINE_UNQUOTED(EPM_DATADIR, "$datadir/epm")
  281 AC_SUBST(EPM_DATADIR)
  282 
  283 dnl Figure out the right option to use for the RPM build architecture...
  284 if test "x$RPM" != x; then
  285 	# It would be nice if Red Hat could make up its mind...
  286 	rpmversion="`$RPM --version | awk '{print $3}' | awk -F. '{print $1 * 10000 + $2 * 100 + $3}'`"
  287 
  288 	if test $rpmversion -lt 30000; then
  289 		AC_DEFINE_UNQUOTED(EPM_RPMARCH, "--buildarch ")
  290 	else
  291 		if test $rpmversion -ge 40003; then
  292 			AC_DEFINE_UNQUOTED(EPM_RPMARCH, "--target ")
  293 		else
  294 			AC_DEFINE_UNQUOTED(EPM_RPMARCH, "--target=")
  295 		fi
  296 	fi
  297 fi
  298 
  299 if test "x$RPMBUILD" != x; then
  300 	AC_DEFINE_UNQUOTED(EPM_RPMBUILD, "$RPMBUILD")
  301 	AC_DEFINE(EPM_RPMTOPDIR)
  302 else
  303 	if test "x$RPM" != x; then
  304 		AC_DEFINE_UNQUOTED(EPM_RPMBUILD, "$RPM")
  305 	else
  306 		AC_DEFINE_UNQUOTED(EPM_RPMBUILD, "rpm")
  307 	fi
  308 fi
  309 
  310 dnl Output the makefile, list file, and config header...
  311 AC_OUTPUT(Makefile epm.list doc/Makefile)