~ubuntu-branches/ubuntu/precise/ggz-client-libs/precise

« back to all changes in this revision

Viewing changes to m4/ggz/ggz.m4

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2008-03-11 23:59:30 UTC
  • mfrom: (1.1.3 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080311235930-idenwe4pp73ozh1k
Tags: 0.0.14.1-1
* New upstream release
  - Obsoletes typos.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
  ac_ggz_stdetc="$ac_ggz_stdetc /usr/local/etc/ggzd /etc/ggzd"
181
181
fi
182
182
if test "x$1" = "xexport" || test "x$2" = "xexport"; then
183
 
  CPPFLAGS="$CPPFLAGS -isystem ${ac_ggz_prefix_incdir} -isystem /usr/local/include"
 
183
  CPPFLAGS="$CPPFLAGS -I ${ac_ggz_prefix_incdir} -I /usr/local/include"
184
184
  LDFLAGS="$LDFLAGS -L${ac_ggz_prefix_libdir} -L/usr/local/lib"
185
185
fi
186
186
 
187
187
save_cflags=$CFLAGS
188
188
save_cxxflags=$CXXFLAGS
189
 
CFLAGS="-Wall -Werror"
190
 
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
191
 
        [[void signedness(void){char c;if(c==-1)c=0;}]])],
192
 
        [],
193
 
        [save_cflags="$save_cflags -fsigned-char"
194
 
         save_cxxflags="$save_cxxflags -fsigned-char"])
 
189
if test "x$GCC" = xyes; then
 
190
        CFLAGS="-Wall -Werror"
 
191
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
 
192
                [[void signedness(void){char c;if(c==-1)c=0;}]])],
 
193
                [],
 
194
                [save_cflags="$save_cflags -fsigned-char"
 
195
                 save_cxxflags="$save_cxxflags -fsigned-char"])
 
196
else
 
197
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
 
198
                [[#if defined(__SUNPRO_C) || (__SUNPRO_C >= 0x550)
 
199
                #else
 
200
                # include "Error: Only GCC and Sun Studio are supported compilers."
 
201
                #endif]], [[]])],
 
202
                [save_cflags="$save_cflags -xchar=signed"
 
203
                 save_cxxflags="$save_cxxflags -xchar=signed"],
 
204
                [])
 
205
 
 
206
fi
195
207
CFLAGS=$save_cflags
196
208
CXXFLAGS=$save_cxxflags
197
209
])
221
233
        save_libs=$LIBS
222
234
        save_ldflags=$LDFLAGS
223
235
        save_cppflags=$CPPFLAGS
 
236
        save_ldlibrary_path=$LD_LIBRARY_PATH
224
237
        LDFLAGS=$LIBGGZ_LDFLAGS
225
238
        LIBS=$LIB_GGZ
226
239
        CPPFLAGS=$LIBGGZ_INCLUDES
 
240
        export LD_LIBRARY_PATH=$save_ldlibrary_path:$libggz_libraries
227
241
 
228
242
        AC_MSG_CHECKING([for GGZ library version: $major.$minor.$micro])
229
243
        AC_RUN_IFELSE(
230
244
                [AC_LANG_PROGRAM([[$testprologue]], [[$testbody]])],
231
245
                [ac_ggz_version_check=yes],
232
 
                [ac_ggz_version_check=no]
 
246
                [ac_ggz_version_check=no],
 
247
                [ac_ggz_version_check="skipped due to cross-compiling"]
233
248
        )
234
 
        if test "x$ac_ggz_version_check" = "xyes"; then
235
 
                AC_MSG_RESULT([yes])
236
 
                $4
237
 
        else
 
249
        if test "$ac_ggz_version_check" = "no"; then
238
250
                AC_MSG_RESULT([no])
239
251
                if test "x$5" = "x"; then
240
252
                        AC_MSG_ERROR([The GGZ version is too old. Version $major.$minor.$micro is required.])
241
253
                fi
242
254
                $5
 
255
        else
 
256
                AC_MSG_RESULT($ac_ggz_version_check)
 
257
                $4
243
258
        fi
244
259
 
245
260
        LIBS=$save_libs
246
261
        LDFLAGS=$save_ldflags
247
262
        CPPFLAGS=$save_cppflags
 
263
        LD_LIBRARY_PATH=$save_ldlibrary_path
248
264
])
249
265
 
250
266
dnl ------------------------------------------------------------------------
329
345
  AC_SUBST(libggz_libraries)
330
346
  AC_SUBST(libggz_includes)
331
347
 
332
 
  LIBGGZ_INCLUDES="-isystem $libggz_includes"
 
348
  LIBGGZ_INCLUDES="-I $libggz_includes"
333
349
  LIBGGZ_LDFLAGS="-L$libggz_libraries"
334
350
 
335
351
  AC_SUBST(LIBGGZ_INCLUDES)
427
443
  AC_SUBST(ggzcore_libraries)
428
444
  AC_SUBST(ggzcore_includes)
429
445
 
430
 
  GGZCORE_INCLUDES="-isystem $ggzcore_includes"
 
446
  GGZCORE_INCLUDES="-I $ggzcore_includes"
431
447
  GGZCORE_LDFLAGS="-L$ggzcore_libraries"
432
448
 
433
449
  AC_SUBST(GGZCORE_INCLUDES)
484
500
  if test "x$2" = "xignore"; then
485
501
    AC_MSG_RESULT([$have_ggz_config (intentionally ignored)])
486
502
    GGZ_CONFIG="true"
487
 
    ggzexecmoddir="\${prefix}/lib/ggz"
488
 
    ggzdatadir="\${prefix}/share/ggz"
 
503
    ggzexecmoddir="\${libdir}/ggz"
 
504
    ggzdatadir="\${datadir}/ggz"
489
505
    AC_SUBST(GGZ_CONFIG)
490
506
    AC_SUBST(ggzexecmoddir)
491
507
    AC_SUBST(ggzdatadir)
492
 
    AC_DEFINE_UNQUOTED(GAMEDIR, "${prefix}/lib/ggz", [Path where to install the games])
493
 
    AC_DEFINE_UNQUOTED(GGZDATADIR, "${prefix}/share/ggz", [Path where the games should look for their data files])
 
508
    AC_DEFINE_UNQUOTED(GAMEDIR, "${libdir}/ggz", [Path where to install the games])
 
509
    AC_DEFINE_UNQUOTED(GGZDATADIR, "${datadir}/ggz", [Path where the games should look for their data files])
494
510
  else
495
511
    AC_MSG_RESULT([$have_ggz_config])
496
512
    if test "x$2" = "x"; then
511
527
  if test "x$pathto_app" != "x$pathto_ggz"; then
512
528
    AC_MSG_RESULT([$have_ggz_config (dismissed due to different prefix)])
513
529
    GGZ_CONFIG="true"
514
 
    ggzexecmoddir="\${prefix}/lib/ggz"
515
 
    ggzdatadir="\${prefix}/share/ggz"
 
530
    ggzexecmoddir="\${libdir}/ggz"
 
531
    ggzdatadir="\${datadir}/ggz"
516
532
    AC_SUBST(GGZ_CONFIG)
517
533
    AC_SUBST(ggzexecmoddir)
518
534
    AC_SUBST(ggzdatadir)
519
535
    AC_DEFINE_UNQUOTED(GGZMODULECONFDIR, "${prefix}/etc", [Path where the game registry is located])
520
 
    AC_DEFINE_UNQUOTED(GAMEDIR, "${prefix}/lib/ggz", [Path where to install the games])
521
 
    AC_DEFINE_UNQUOTED(GGZDATADIR, "${prefix}/share/ggz", [Path where the games should look for their data files])
 
536
    AC_DEFINE_UNQUOTED(GAMEDIR, "${libdir}/ggz", [Path where to install the games])
 
537
    AC_DEFINE_UNQUOTED(GGZDATADIR, "${datadir}/ggz", [Path where the games should look for their data files])
522
538
  else
523
539
    ac_cv_have_ggz_config="have_ggz_config=yes \
524
540
      ac_ggz_config=$ac_ggz_config"
645
661
  AC_SUBST(ggzmod_libraries)
646
662
  AC_SUBST(ggzmod_includes)
647
663
 
648
 
  GGZMOD_INCLUDES="-isystem $ggzmod_includes"
 
664
  GGZMOD_INCLUDES="-I $ggzmod_includes"
649
665
  GGZMOD_LDFLAGS="-L$ggzmod_libraries"
650
666
 
651
667
  AC_SUBST(GGZMOD_INCLUDES)
743
759
  AC_SUBST(ggzdmod_libraries)
744
760
  AC_SUBST(ggzdmod_includes)
745
761
 
746
 
  GGZDMOD_INCLUDES="-isystem $ggzdmod_includes"
 
762
  GGZDMOD_INCLUDES="-I $ggzdmod_includes"
747
763
  GGZDMOD_LDFLAGS="-L$ggzdmod_libraries"
748
764
 
749
765
  AC_SUBST(GGZDMOD_INCLUDES)
841
857
  AC_SUBST(ggz_gtk_libraries)
842
858
  AC_SUBST(ggz_gtk_includes)
843
859
 
844
 
  GGZ_GTK_INCLUDES="-isystem $ggz_gtk_includes"
 
860
  GGZ_GTK_INCLUDES="-I $ggz_gtk_includes"
845
861
  GGZ_GTK_LDFLAGS="-L$ggz_gtk_libraries"
846
862
 
847
863
  AC_SUBST(GGZ_GTK_INCLUDES)
915
931
          AC_MSG_RESULT([$have_ggzdconf (but forced to ${ggzdconfdir})])
916
932
        else
917
933
          AC_MSG_RESULT([$have_ggzdconf])
918
 
      if test "x$2" = "x"; then
 
934
          if test "x$2" = "x"; then
919
935
            AC_MSG_ERROR([GGZ server configuration not found. Please check your installation! ])
920
 
      fi
 
936
          fi
921
937
 
922
938
          # Perform actions given by argument 2.
923
939
          $2
940
956
if test "$have_ggzdconf" = yes || test "x$2" = "xforce"; then
941
957
        AC_SUBST(ggzdconfdir)
942
958
 
943
 
        ggzddatadir=${prefix}/share/${PACKAGE}
 
959
        ggzddatadir=${datadir}/${PACKAGE}
944
960
        AC_DEFINE_UNQUOTED(GGZDDATADIR, "${ggzddatadir}", [Game server data directory])
945
961
        AC_SUBST(ggzddatadir)
946
962
 
948
964
          if test "x${exec_prefix}" = "xNONE"; then
949
965
            if test "x${prefix}" = "xNONE"; then
950
966
              ggzdexecmoddir="\${ac_default_prefix}/lib/ggzd"
951
 
                  ggzdexecmodpath="${ac_default_prefix}/lib/ggzd"
 
967
              ggzdexecmodpath="${ac_default_prefix}/lib/ggzd"
952
968
            else
953
969
              ggzdexecmoddir="\${prefix}/lib/ggzd"
954
 
                  ggzdexecmodpath="${prefix}/lib/ggzd"
 
970
              ggzdexecmodpath="${prefix}/lib/ggzd"
955
971
            fi
956
972
          else
957
973
            ggzdexecmoddir="\${exec_prefix}/lib/ggzd"
958
 
                ggzdexecmodpath="${exec_prefix}/lib/ggzd"
 
974
            ggzdexecmodpath="${exec_prefix}/lib/ggzd"
959
975
          fi
960
976
        else
961
977
          ggzdexecmoddir="\${libdir}/ggzd"
999
1015
      AC_GGZ_GGZDMOD([ggz_server="yes"], [ggz_server="no"])
1000
1016
    fi
1001
1017
    if test "$ggz_server" = "yes"; then
 
1018
      AC_GGZ_SERVER
1002
1019
      AC_DEFINE(GGZ_SERVER, 1, [Server support for GGZ])
1003
1020
    else
1004
1021
      if test "$try_ggz_server" = "yes"; then
1024
1041
dnl
1025
1042
AC_DEFUN([AC_GGZ_CHECK],
1026
1043
[
1027
 
  AC_GGZ_INIT
 
1044
  AC_GGZ_INIT([defaults])
1028
1045
  AC_GGZ_LIBGGZ([try_ggz="yes"], [try_ggz="no"])
1029
1046
 
1030
1047
  if test "$try_ggz" = "yes"; then