configure: Add WUtil flags to avoid compilation error
[fsviewer.git] / configure.ac
blob1a9e962799ebb9b30be6db06991961e5f1bcec41
1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(FSViewer.app,0.2.6,[guido.scholz@bayernline.de])
4 AC_CONFIG_SRCDIR([src/FSViewer.c])
5 AM_INIT_AUTOMAKE([dist-bzip2])
6 AC_CONFIG_HEADERS([src/config.h])
8 dnl Checks for programs.
9 AC_PROG_CC
10 dnl AC_PROG_INSTALL
11 dnl AC_PROG_LN_S
13 dnl AC_ARG_PROGRAM
14 AC_PROG_RANLIB
16 dnl the prefix
17 dnl ==========
18 dnl
19 dnl move this earlier in the script... anyone know why this is handled
20 dnl in such a bizarre way?
22 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23 dnl Let make expand exec_prefix.
24 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
26 dnl look for X windows first so further libs check
27 AC_PATH_X 
29 if test "$x_includes" != "NONE"; then
30         CFLAGS="$CFLAGS -I$x_includes"
32 if test "$x_libraries" != "NONE"; then
33         LDFLAGS="$LDFLAGS -L$x_libraries"
36 dnl Additional "default" items
37 #LIBS="$LIBS -lX11"
38 #CFLAGS="$CFLAGS -I/usr/X11/include"
39 #LDFLAGS="$LDFLAGS -L/usr/X11/lib"
41 dnl Check for get-wraster-flags
42 AC_CHECK_PROG(GET_WRASTER_FLAGS, get-wraster-flags, get-wraster-flags)
43 if test "$GET_WRASTER_FLAGS" != ""; then
44         dnl CFLAGS first
45         c_flags=`$GET_WRASTER_FLAGS --cflags`
46         echo $c_flags
47         CFLAGS="$CFLAGS $c_flags"
49         dnl LDFLAGS next
50         ld_flags=`$GET_WRASTER_FLAGS --ldflags`
51         echo $ld_flags
52         LDFLAGS="$LDFLAGS $ld_flags"
53         
54         dnl And finally libs
55         libs_flags=`$GET_WRASTER_FLAGS --libs`
56         echo $libs_flags
57         LIBS="$LIBS $libs_flags"
58         
59 else
61         AC_MSG_ERROR("Danger Will Robinson: Unable to find get-wraster-flags in $PATH variable.");
64 dnl Check for get-wutil-flags
65 AC_CHECK_PROG(GET_WUTIL_FLAGS, get-wutil-flags, get-wutil-flags)
66 if test "$GET_WUTIL_FLAGS" != ""; then
67         dnl CFLAGS first
68         c_flags=`$GET_WUTIL_FLAGS --cflags`
69         echo $c_flags
70         CFLAGS="$CFLAGS $c_flags"
72         dnl LDFLAGS next
73         ld_flags=`$GET_WUTIL_FLAGS --ldflags`
74         echo $ld_flags
75         LDFLAGS="$LDFLAGS $ld_flags"
77         dnl And finally libs
78         libs_flags=`$GET_WUTIL_FLAGS --libs`
79         echo $libs_flags
80         LIBS="$LIBS $libs_flags"
82 else
84         AC_MSG_ERROR("Danger Will Robinson: Unable to find get-wutil-flags in $PATH variable.");
87 AC_CHECK_LIB(Xmu, XmuClientWindow)
89 dnl Support for extralibs
90 dnl ==============================================
92 extralibs=""
94 AC_ARG_WITH(extralibs,
95 [  --with-extralibs=LIBS    specify any libs the script doesn't detect e.g. -lmylib], extralibs=$withval )
97 if test "x$extralibs" != "x"; then
98     LIBS="$extralibs $LIBS"
101 AC_CHECK_LIB(Xft, XftFontOpen,,
102              AC_MSG_ERROR([Xft library not found]))
103 AC_CHECK_LIB(WMaker, WMAppSetMainMenu,,
104              AC_MSG_ERROR([WMaker library not found]))
105 AC_CHECK_LIB(WINGs, WMAppSetMainMenu,,
106              AC_MSG_ERROR([WINGs library not found]))
108 dnl Checks for PropList (not necessary since version 0.2.3b)
109 dnl AC_CHECK_HEADERS(proplist.h,, AC_MSG_WARN(Can't find PropList include-file: Please install libPropList (included in WindowMaker)))
110 dnl AC_CHECK_LIB(PropList, PLGetProplistWithPath,, AC_MSG_WARN(Can't find PropList library: Please install libPropList (included in WindowMaker)), , $LIBS)
112 dnl Needed by Sun/Solaris
113 AC_CHECK_LIB(nsl, gethostbyname)
114 AC_CHECK_LIB(socket, socket)
116 dnl Needed by FreeBSD
117 AC_CHECK_LIB(kvm, kvm_read)
119 dnl Checks for header files.
120 AC_HEADER_STDC
121 AC_CHECK_HEADERS(unistd.h)
122 AC_HEADER_DIRENT
124 dnl Checks for typedefs, structures, and compiler characteristics.
125 AC_C_CONST
126 AC_TYPE_PID_T
127 AC_STRUCT_TM
129 dnl Checks for library functions.
130 AC_CHECK_FUNCS(mktime strdup)
132 dnl Disable Clock in Inspector
133 dnl ==========================
135 clk=no
136 AC_ARG_ENABLE(clk,
137 [  --enable-clk            enable inspector clk (default = yes)],
138                 clk=$enableval, clk=yes)
139 AH_TEMPLATE([CLK],[enable inspector clk])
140 if test "$clk" = yes; then
141     AC_DEFINE([CLK], [1])
142     dnl AC_DEFINE(CLK, 1)
143 else
144     AC_DEFINE([CLK], [0])
145     dnl    AC_DEFINE(CLK, 0)    
149 dnl Support for GNUSTEP_LOCAL_ROOT
150 dnl ==============================================
152 appspath=""
154 AC_ARG_WITH(appspath,
155 [  --with-appspath=PATH    specify the directory for GNUstep applications], appspath=$withval )
157 if test "x$appspath" = "x"; then
158     gnustepdir="${prefix}/GNUstep"
159 dnl WMPrefs uses this method but it doesn't seem to work for me
160 dnl if there are problems with ICONDIR or fsviewerdir uncomment 
161 dnl the next line
162 dnl    gnustepdir='$(prefix)/GNUstep'
164     if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
165         gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
166         gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
167     fi
169     with_appspath=$gnustepdir/Apps
172 fsviewerdir=$with_appspath/FSViewer.app
173 AC_SUBST(fsviewerdir)
175 AH_TEMPLATE([ICONDIR],[Where to put icon files])
176 AC_DEFINE_UNQUOTED([ICONDIR], "${fsviewerdir}")
178 dnl Support for NLS
179 dnl ==============================================
180 dnl directory where .mo (translation) files should be placed
182 LOCALEDIR="${prefix}/share/locale"
184 AC_SUBST(LOCALEDIR)
185 AH_TEMPLATE([LOCALEDIR],[Where to put locale files])
186 AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
189 AM_GNU_GETTEXT([external])
190 AM_GNU_GETTEXT_VERSION([0.15])
192 AC_OUTPUT(Makefile src/Makefile src/regexp/Makefile defs/Makefile \
193   po/Makefile.in m4/Makefile tiff/Makefile xpm/Makefile man/Makefile)