Skip to content

Commit 2c98fc9

Browse files
committed
rm config.h
it's not needed aside from the VERSION and PACKAGE macro, which will be passed via compiler flag if no config.h was generated. additionally add some `#ifndef` in options.c to reduce dependency on autoconf by setting them to sensible defaults.
1 parent fb3519e commit 2c98fc9

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ missing
1414
src/*.o
1515
src/.deps
1616
src/Makefile
17-
src/config.h
1817
src/scrot
1918
src/scrot_config.h
2019
src/stamp-h1

configure.ac

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ AC_INIT([scrot], [1.9],
55
[https://github.com/resurrecting-open-source-projects/scrot])
66
AC_CONFIG_SRCDIR([src/scrot.c])
77
AM_INIT_AUTOMAKE
8-
AC_CONFIG_HEADERS([src/config.h])
98

109
# Checks for programs.
1110
orig_CFLAGS="${CFLAGS}" # Save CFLAGS before AC_PROG_CC sets them.
@@ -41,8 +40,7 @@ PKG_CHECK_MODULES([IMLIB2], [imlib2])
4140
AC_ARG_ENABLE([libbsd-feature-test],
4241
AS_HELP_STRING([--enable-libbsd-feature-test],
4342
["Do not configure the program, return true if libbsd is needed"]))
44-
AC_CHECK_FUNCS([err errx warn warnx],,
45-
[LIBBSD_NEEDED=yes])
43+
AC_CHECK_FUNCS([err errx warn warnx],, [LIBBSD_NEEDED=yes])
4644
AC_CHECK_HEADERS([sys/queue.h],, [LIBBSD_NEEDED=yes], [ ])
4745
# libbsd is obligatory on systems that don't have the BSD functions we use.
4846
# Pass "--enable-libbsd-feature-test" to ./configure, and the configure script

src/options.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,19 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5151
#include <string.h>
5252
#include <unistd.h>
5353

54-
#include "config.h"
5554
#include "note.h"
5655
#include "options.h"
5756
#include "scrot.h"
5857
#include "scrot_selection.h"
5958
#include "util.h"
6059

60+
#ifndef PACKAGE
61+
#define PACKAGE "scrot"
62+
#endif
63+
#ifndef VERSION
64+
#define VERSION "unknown"
65+
#endif
66+
6167
struct ScrotOptions opt = {
6268
.quality = 75,
6369
.compression = 7,

0 commit comments

Comments
 (0)