SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET (WITH_TEST_SUITE CACHE BOOL "")
+SET (NO_OFFENSIVE CACHE BOOL "Exclude the offensive option.")
SET (LOCALDIR "${CMAKE_INSTALL_PREFIX}/local/share/games/fortunes" CACHE STRING "LOCALDIR fortunes dir")
SET (LOCALODIR "${LOCALDIR}/off" CACHE STRING "offensive fortunes localdir")
SET (COOKIEDIR "${CMAKE_INSTALL_PREFIX}/share/games/fortunes" CACHE STRING "cookie dir not under /usr/local")
ADD_DEFINITIONS("-DOFFDIR=\"${OCOOKIEDIR}\"")
ADD_DEFINITIONS("-DFORTDIR=\"${COOKIEDIR}\"")
+IF ("${NO_OFFENSIVE}")
+ ADD_DEFINITIONS("-DNO_OFFENSIVE=1")
+ENDIF()
+
INCLUDE(CheckIncludeFile)
CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H)
#ifndef NO_REGEX
(void) fprintf(stderr, "i");
#endif /* NO_REGEX */
- (void) fprintf(stderr, "losw]");
+ (void) fprintf(stderr, "l");
+#ifndef NO_OFFENSIVE
+ (void) fprintf(stderr, "o");
+#endif
+ (void) fprintf(stderr, "sw]");
#ifndef NO_REGEX
(void) fprintf(stderr, " [-m pattern]");
#endif /* NO_REGEX */
ignore_case = FALSE;
#ifdef DEBUG
- while ((ch = getopt(argc, argv, "acDefilm:n:osvw")) != EOF)
+#define DEBUG_GETOPT "D"
#else
- while ((ch = getopt(argc, argv, "acefilm:n:osvw")) != EOF)
-#endif /* DEBUG */
+#define DEBUG_GETOPT
+#endif
+
+#ifdef NO_OFFENSIVE
+#define OFFENSIVE_GETOPT
+#else
+#define OFFENSIVE_GETOPT "o"
+#endif
+
+ while ((ch = getopt(argc, argv, "ac" DEBUG_GETOPT "efilm:n:" OFFENSIVE_GETOPT "svw")) != EOF)
switch (ch)
{
case 'a': /* any fortune */
case 'n':
SLEN = atoi(optarg);
break;
+#ifndef NO_OFFENSIVE
case 'o': /* offensive ones only */
Offend++;
break;
+#endif
case 's': /* short ones only */
Short_only++;
Long_only = FALSE;