This repository has been archived by the owner on Jan 16, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed XLIBS to config, added -D/-l options
- Loading branch information
Bert
committed
Sep 13, 2011
1 parent
255dd5b
commit 81cfbf1
Showing
4 changed files
with
52 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
XLIBS | ||
config | ||
config.h | ||
*.o | ||
sxiv | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#define _POSIX_C_SOURCE 200112L | ||
#define _FEATURE_CONFIG | ||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include "config.h" | ||
|
||
#define QUOTE(m) #m | ||
#define PUT_MACRO(m) \ | ||
printf("%s-D%s=%s", n++ ? " " : "", #m, QUOTE(m)) | ||
|
||
int n = 0; | ||
|
||
inline void puts_if(const char *s, int c) { | ||
if (c) | ||
printf("%s%s", n++ ? " " : "", s); | ||
} | ||
|
||
inline void endl() { | ||
if (n) { | ||
printf("\n"); | ||
n = 0; | ||
} | ||
} | ||
|
||
int main(int argc, char **argv) { | ||
int i; | ||
|
||
for (i = 1; i < argc; i++) { | ||
if (!strcmp(argv[i], "-D")) { | ||
PUT_MACRO(EXIF_SUPPORT); | ||
PUT_MACRO(GIF_SUPPORT); | ||
endl(); | ||
} else if (!strcmp(argv[i], "-l")) { | ||
puts_if("-lexif", EXIF_SUPPORT); | ||
puts_if("-lgif", GIF_SUPPORT); | ||
endl(); | ||
} else { | ||
fprintf(stderr, "%s: invalid argument: %s\n", argv[0], argv[i]); | ||
return 1; | ||
} | ||
} | ||
return 0; | ||
} |